draw.io is a JavaScript, client-side editor for general diagramming.
29.2.7 release
David Benson34466eba2331
diff --git a/ChangeLog b/ChangeLogindex 6645e4e22..eee080b0c 100644--- a/ChangeLog+++ b/ChangeLog@@ -1,3 +1,7 @@+10-DEC-2025: 29.2.7++- Reverts edit icon for local .html files [jgraph/drawio#5375]+08-DEC-2025: 29.2.6- Changes edit icon naming clash caused by [jgraph/drawio#5375]diff --git a/VERSION b/VERSIONindex 0573b8c8b..61ebd785a 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-29.2.6\ No newline at end of file+29.2.7\ No newline at end of filediff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.jsindex ad2ec4f37..c4b9a7b38 100644--- a/src/main/webapp/js/app.min.js+++ b/src/main/webapp/js/app.min.js@@ -68,7 +68,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:"29.2.6",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"29.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&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||@@ -12988,7 +12988,7 @@ mxEvent.addListener(t,"click",function(Ca){Fa.checked=!0;mxEvent.consume(Ca)}));T.style.colorScheme="dark"):(T.classList.remove("geDarkMode"),T.style.colorScheme="light")};m.addListener("darkModeChanged",ya);ya();var Oa=function(Ca,Ga){Ca=Ga.getProperty("dialog");T.parentNode==Ca.container&&(m.editor.removeListener(Oa),m.removeListener(ya))};m.editor.addListener("hideDialog",Oa)}this.container=T};var K=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 m=this.image;null!=m&&null!=m.src&&Graph.isPageLink(m.src)&&(m={originalSrc:m.src});this.page.viewState.backgroundImage=m}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 K.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&&(m=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=m?m:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.2.6";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&&+this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.2.7";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.enablePlantUml=EditorUi.enableLogging||"1"==urlParams.dev;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 window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={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,@@ -13022,43 +13022,43 @@ if(1<x.length||1==x.length&&x[0].hasAttribute("name")){this.fileNode=d;this.pageg?g:this.editor.graph;x=null!=x?x:!1;H=null!=H?H:!0;S=null!=S?S:!Editor.defaultCompressed;var P=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var v="_blank";else P=v=n;if(null==d)return"";var y=d;if("mxfile"!=y.nodeName.toLowerCase()){if(S){var M=d.ownerDocument.createElement("diagram");M.setAttribute("name",mxResources.get("pageWithNumber",[1]));M.setAttribute("id",Editor.guid());M.appendChild(d)}else{M=Graph.zapGremlins(mxUtils.getXml(d));y=Graph.compress(M);if(Graph.decompress(y)!=M)return M;M=d.ownerDocument.createElement("diagram");M.setAttribute("name",mxResources.get("pageWithNumber",[1]));M.setAttribute("id",Editor.guid());mxUtils.setTextContent(M,y)}y=d.ownerDocument.createElement("mxfile");y.appendChild(M)}D?(y=y.cloneNode(!0),y.removeAttribute("modified"),y.removeAttribute("host"),y.removeAttribute("agent"),y.removeAttribute("etag"),y.removeAttribute("userAgent"),y.removeAttribute("version"),y.removeAttribute("editor"),y.removeAttribute("type")):(y.removeAttribute("userAgent"),y.removeAttribute("modified"),y.removeAttribute("version"),y.removeAttribute("editor"),y.removeAttribute("pages"),y.removeAttribute("type"),y.removeAttribute("etag"),mxClient.IS_CHROMEAPP?y.setAttribute("host","Chrome"):EditorUi.isElectronApp?y.setAttribute("host","Electron"):y.setAttribute("host",window.location.hostname),y.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),y.setAttribute("version",EditorUi.VERSION),1<y.getElementsByTagName("diagram").length&&-null!=this.pages&&y.setAttribute("pages",this.pages.length));null!=U&&(y=y.cloneNode(!0),y.setAttribute("scale",U));null!=R&&(y=y.cloneNode(!0),y.setAttribute("border",R));d=S?mxUtils.getPrettyXml(y):mxUtils.getXml(y);if(!A&&!x&&(B||null!=l&&/(\.html)$/i.test(l.getTitle())))d=this.getHtml2(mxUtils.getXml(y),g,null!=l?l.getTitle():null,v,P,null==P&&!EditorUi.isElectronApp&&"draw.io"==this.getServiceName());else if(A||!x&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&-l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(y),d=this.getEmbeddedSvg(d,g,n,null,I,H,P,null,null,l.scale,l.border,null,Editor.svgFileTheme);return d};EditorUi.prototype.getXmlFileData=function(d,g,l,n){d=null!=d?d:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var x=this.editor.getGraphXml(d,n);if(d&&null!=this.fileNode&&null!=this.currentPage)if(d=function(H){var D=H.getElementsByTagName("mxGraphModel"),S=0<D.length?D[0]:null;D=H;null==S&&l?(S=mxUtils.getNodeValue(H),-0<S.length&&(S=Graph.decompress(S),null!=S&&0<S.length&&(D=H.cloneNode(!1),D.appendChild(mxUtils.parseXml(S).documentElement)))):null==S||l?D=H.cloneNode(!0):(D=H.cloneNode(!1),mxUtils.setTextContent(D,Graph.compressNode(S)));x.appendChild(D)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),g)d(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var A=this.pages[g],B=A.node;if(A!=this.currentPage)if(A.needsUpdate){var I=-new mxCodec(mxUtils.createXmlDocument());I=I.encode(new mxGraphModel(A.root));this.editor.graph.saveViewState(A.viewState,I,null,n);EditorUi.removeChildNodes(B);B.appendChild(I);delete A.needsUpdate}else n&&(this.updatePageRoot(A),null!=A.viewState.backgroundImage&&null!=A.viewState.backgroundImage.originalSrc&&(I=new mxCodec(mxUtils.createXmlDocument()),I=I.encode(new mxGraphModel(A.root)),this.editor.graph.saveViewState(A.viewState,I,null,n,A),B=B.cloneNode(!1),B.appendChild(I)));d(B)}return x};-EditorUi.prototype.anonymizeString=function(d,g){for(var l=[],n=0;n<d.length;n++){var x=d.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?l.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(d){d=mxUtils.clone(d);if(null!=-d[EditorUi.DIFF_INSERT])for(var g=0;g<d[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(d[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));d[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(A){d[EditorUi.DIFF_INSERT][g].data=A.message}if(null!=d[EditorUi.DIFF_UPDATE]){for(var n in d[EditorUi.DIFF_UPDATE]){var x=d[EditorUi.DIFF_UPDATE][n];null!=x.name&&(x.name=this.anonymizeString(x.name));-null!=x.cells&&(g=mxUtils.bind(this,function(A){var B=x.cells[A];if(null!=B){for(var I in B)null!=B[I].value&&(B[I].value="["+B[I].value.length+"]"),null!=B[I].xmlValue&&(B[I].xmlValue="["+B[I].xmlValue.length+"]"),null!=B[I].style&&(B[I].style="["+B[I].style.length+"]"),mxUtils.isEmptyObject(B[I])&&delete B[I];mxUtils.isEmptyObject(B)&&delete x.cells[A]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);mxUtils.isEmptyObject(x)&&delete d[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(d[EditorUi.DIFF_UPDATE])&&-delete d[EditorUi.DIFF_UPDATE]}return d};EditorUi.prototype.anonymizeAttributes=function(d,g){if(null!=d.attributes)for(var l=0;l<d.attributes.length;l++)"as"!=d.attributes[l].name&&d.setAttribute(d.attributes[l].name,this.anonymizeString(d.attributes[l].value,g));if(null!=d.childNodes)for(l=0;l<d.childNodes.length;l++)this.anonymizeAttributes(d.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(d,g){g=d.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&-g[l].setAttribute("value","["+g[l].getAttribute("value").length+"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length+"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return d};-EditorUi.prototype.synchronizeCurrentFile=function(d){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!d&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),this.clearStatus(),d?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):-g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(d,g,l,n,x,A,B,I,H,D,S,U,R){x=null!=x?x:!0;A=null!=A?A:!1;D=null!=D?D:!Editor.defaultCompressed;var P=this.editor.graph;if((g||!d&&null!=H&&/(\.svg)$/i.test(H.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var v=P.getGlobalVariable;P=this.createTemporaryGraph(P.getStylesheet());P.setBackgroundImage=-this.editor.graph.setBackgroundImage;P.background=this.editor.graph.background;var y=null!=this.pages?this.pages[0]:null;null==y||this.currentPage==y?P.setBackgroundImage(this.editor.graph.backgroundImage):null!=y.viewState&&null!=y.viewState&&P.setBackgroundImage(y.viewState.backgroundImage);P.getGlobalVariable=function(M){return"page"==M&&null!=y?y.getName():"pagenumber"==M?1:v.apply(this,arguments)};document.body.appendChild(P.container);null!=y&&P.model.setRoot(y.root)}B=null!=B?B:this.getXmlFileData(x,-A,D,S);H=null!=H?H:this.getCurrentFile();d=this.createFileData(B,P,H,window.location.href,d,g,l,n,x,I,D,U,R);P!=this.editor.graph&&P.container.parentNode.removeChild(P.container);return d};EditorUi.prototype.getHtml=function(d,g,l,n,x,A){A=null!=A?A:!0;var B=null,I=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=g){B=A?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var H=g.view.scale;A=Math.floor(B.x/H-g.view.translate.x);H=Math.floor(B.y/H-g.view.translate.y);B=g.background;null==-x&&(g=this.getBasenames().join(";"),0<g.length&&(I=EditorUi.drawHost+"/embed.js?s="+g));d.setAttribute("x0",A);d.setAttribute("y0",H)}null!=d&&(d.setAttribute("pan","1"),d.setAttribute("zoom","1"),d.setAttribute("resize","0"),d.setAttribute("fit","0"),d.setAttribute("border","20"),d.setAttribute("links","1"),null!=n&&d.setAttribute("edit",n));null!=x&&(x=x.replace(/&/g,"&"));d=null!=d?Graph.zapGremlins(mxUtils.getXml(d)):"";n=Graph.compress(d);Graph.decompress(n)!=d&&(n=encodeURIComponent(d));-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!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=B&&B!=mxConstants.NONE?' style="background-color:'+B+';">':">")+'\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==x?'<script type="text/javascript" src="'+I+'">\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(d,g,l,n,x,A){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";d={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(d),-toolbar:"pages zoom layers lightbox"};null!=x?x=x.replace(/&/g,"&"):A&&(d.editor=window.DRAWIO_BASE_URL,d.toolbar+=" editlocal");null!=this.pages&&null!=this.currentPage&&(d.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!=l?"<title>"+mxUtils.htmlEntities(l)+"</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(d))+'"></div>\n'+(null==x?'<script type="text/javascript" src="'+g+'">\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.setFileData=function(d){d=this.validateFileData(d);this.pages=this.fileNode=this.currentPage=null;var g=null!=d&&0<d.length?mxUtils.parseXml(d).documentElement:null,l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[d],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");d=null!=g?this.editor.extractGraphModel(g,!0):null;null!=d&&(g=d);-if(null!=g&&"mxfile"==g.nodeName&&(d=g.getElementsByTagName("diagram"),l={},0<d.length)){var n=this.getHashObject(),x=null;this.fileNode=g;this.pages=[];for(var A=0;A<d.length;A++){null==d[A].getAttribute("id")&&d[A].setAttribute("id",A);g=new DiagramPage(d[A]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[A+1]));this.pages.push(g);if(null==n.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||null!=n.pageId&&g.getId()==n.pageId)x=g;if(null==l[g.getId()])l[g.getId()]=-g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=-this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var B=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(A=0;A<B.length;A++)g[B[A]]=!0;var I=this.editor.graph.getModel(),H=I.getChildren(I.root);for(A=0;A<H.length;A++){var D=H[A];I.setVisible(D,g[D.id]||!1)}}catch(S){}};EditorUi.prototype.getBaseFilename=function(d){var g=this.getCurrentFile();g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||-/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!d&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=function(d,g,l,n,x,A,B,I,H,D,S,U,R,P,v,y,M){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var J=this.getBaseFilename(!x),-K=J+("xml"==d||"pdf"==d&&S?".drawio":"")+"."+d;if("xml"==d){var m=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,x,null,null,null,g);this.saveData(K,d,m,"text/xml")}else if("html"==d)m=this.getHtml2(this.getFileData(!0),this.editor.graph,J),this.saveData(K,d,m,"text/html");else if("svg"!=d&&"xmlsvg"!=d||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==d?K=J+".png":"jpeg"==d&&(K=J+".jpg"),this.saveRequest(K,d,mxUtils.bind(this,function(O,Q){try{return this.createDownloadRequest(O,-d,n,Q,B,x,I,H,D,S,U,void 0,void 0,!A,R,P,v,y,M)}catch(T){this.handleError(T)}}));else{var t=null,C=mxUtils.bind(this,function(O){O.length<=MAX_REQUEST_SIZE?this.saveData(K,"svg",O,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(t)}))});if("svg"==d){var N=this.editor.graph.background;if(B||N==mxConstants.NONE)N=null;var L=this.editor.graph.getSvg(N,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(L);-this.editor.convertImages(L,mxUtils.bind(this,mxUtils.bind(this,function(O){this.spinner.stop();C(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(O))})))}else K=J+".svg",t=this.getFileData(!1,!0,null,mxUtils.bind(this,function(O){this.spinner.stop();C(O)}),n)}}catch(O){this.handleError(O)}};EditorUi.prototype.createDownloadRequest=function(d,g,l,n,x,A,B,I,H,D,S,U,R,P,v,y,M,J,K){d=this.downloadRequestBuilder(d,g,l,n,x,A,B,I,H,D,S,U,R,P,v,y,M,J,K);g="";for(var m in d)l=d[m],null!=l&&-(g+=m+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(d,g,l,n,x,A,B,I,H,D,S,U,R,P,v,y,M,J,K){var m=this.editor.graph,t=m.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==A?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var C=null,N=null,L=null;if(!EditorUi.isElectronApp&&(t.width*t.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};D=D?"1":"0";"pdf"==g&&-(null!=S?(C=S.from,N=S.to):0==A&&(L="1"));"xmlpng"==g&&(D="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(A=0;A<this.pages.length;A++)if(this.pages[A]==this.currentPage){C=A;break}A=m.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!x?x||null!=A&&A!=mxConstants.NONE||(A="#ffffff"):A=mxConstants.NONE;x={globalVars:m.getExportVariables()};null!=S&&null!=S.from&&(x.globalVars.pagenumber=S.from+1);H&&(x.grid={size:m.gridSize,steps:m.view.gridSteps,color:Editor.isDarkMode()&&-"pdf"==g?mxGraphView.prototype.defaultGridColor:m.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);return{format:g,from:C,to:N,allPages:L,bg:null!=A?A:mxConstants.NONE,base64:n,embedXml:D,xml:l,filename:null!=d?d:"",extras:JSON.stringify(x),scale:B,border:I,pageMargin:v,w:U&&isFinite(U)?U:null,h:R&&isFinite(R)?R:null,crop:null!=P&&P?"1":"0",fit:null!=y&&y?"1":"0",shadows:null!=K&&K?"1":"0",sheetsAcross:M,sheetsDown:J}};EditorUi.prototype.setMode=function(d,g){this.mode=-d};EditorUi.prototype.getDiagramId=function(){var d=window.location.hash;null!=d&&0<d.length&&(d=d.substring(1));if(null!=d&&1<d.length){var g=d.indexOf("#");0<=g&&(d=d.substring(0,g))}return d};EditorUi.prototype.getHashObject=function(){var d=window.location.hash,g={};if(null!=d&&0<d.length){var l=d.lastIndexOf("#");if(0<l){d=decodeURIComponent(d.substring(l+1));try{g=JSON.parse(d)}catch(n){}}}return g};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&-""!=this.currentFile.getHash()){var d=this.getHashObject();d.pageId=this.currentPage.getId();this.setHashObject(d)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(d){if(Editor.enableHashObjects){var g=window.location.hash;if(null==g||""==g)g="#";var l=g.lastIndexOf("#");0<l&&(g=g.substring(0,l));try{null==d||mxUtils.isEmptyObject(d)||(g=g+"#"+encodeURIComponent(JSON.stringify(d)))}catch(n){}0<l&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=-function(d,g,l){var n=window.location.hash,x=mxUtils.bind(this,function(B){var I=null!=d.data?d.data:"";null!=B&&0<B.length&&(0<I.length&&(I+="\n"),I+=B);B=new LocalFile(this,"csv"!=d.format&&0<I.length?I:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);B.getHash=function(){return n};this.fileLoaded(B);"csv"==d.format&&this.importCsv(I,mxUtils.bind(this,function(R){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));-if(null!=d.update){var H=null!=d.interval?parseInt(d.interval):6E4,D=null,S=mxUtils.bind(this,function(){var R=this.currentPage;mxUtils.post(d.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(P){R===this.currentPage&&(200<=P.getStatus()&&300>=P.getStatus()?(this.updateDiagram(P.getText()),U()):this.handleError({message:mxResources.get("error")+" "+P.getStatus()}))}),mxUtils.bind(this,function(P){this.handleError(P)}))}),U=mxUtils.bind(this,function(){window.clearTimeout(D);-D=window.setTimeout(S,H)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){U();S()}));U();S()}null!=g&&g()});if(null!=d.url&&0<d.url.length){var A=this.editor.getProxiedUrl(d.url);this.editor.loadUrl(A,mxUtils.bind(this,function(B){x(B)}),mxUtils.bind(this,function(B){null!=l&&l(B)}))}else x("")};EditorUi.prototype.updateDiagram=function(d){function g(m){var t=new mxCellOverlay(m.image||x.warningImage,m.tooltip,m.align,m.valign,m.offset);t.addListener(mxEvent.CLICK,function(C,-N){n.alert(m.tooltip)});return t}var l=null,n=this;if(null!=d&&0<d.length&&(l=mxUtils.parseXml(d),d=null!=l?l.documentElement:null,null!=d&&"updates"==d.nodeName)){var x=this.editor.graph,A=x.getModel();A.beginUpdate();var B=null;try{for(d=d.firstChild;null!=d;){if("update"==d.nodeName){var I=A.getCell(d.getAttribute("id"));if(null!=I){try{var H=d.getAttribute("value");if(null!=H){var D=mxUtils.parseXml(H).documentElement;if(null!=D)if("1"==D.getAttribute("replace-value"))A.setValue(I,D);else for(var S=-D.attributes,U=0;U<S.length;U++)x.setAttributeForCell(I,S[U].nodeName,0<S[U].nodeValue.length?S[U].nodeValue:null)}}catch(m){null!=window.console&&console.log("Error in value for "+I.id+": "+m)}try{var R=d.getAttribute("style");null!=R&&x.model.setStyle(I,R)}catch(m){null!=window.console&&console.log("Error in style for "+I.id+": "+m)}try{var P=d.getAttribute("icon");if(null!=P){var v=0<P.length?JSON.parse(P):null;null!=v&&v.append||x.removeCellOverlays(I);null!=v&&x.addCellOverlay(I,g(v))}}catch(m){null!=-window.console&&console.log("Error in icon for "+I.id+": "+m)}try{var y=d.getAttribute("geometry");if(null!=y){y=JSON.parse(y);var M=x.getCellGeometry(I);if(null!=M){M=M.clone();for(key in y){var J=parseFloat(y[key]);"dx"==key?M.x+=J:"dy"==key?M.y+=J:"dw"==key?M.width+=J:"dh"==key?M.height+=J:M[key]=parseFloat(y[key])}x.model.setGeometry(I,M)}}}catch(m){null!=window.console&&console.log("Error in icon for "+I.id+": "+m)}}}else if("model"==d.nodeName){for(var K=d.firstChild;null!=K&&K.nodeType!=mxConstants.NODETYPE_ELEMENT;)K=+null!=this.pages&&y.setAttribute("pages",this.pages.length));null!=U&&(y=y.cloneNode(!0),y.setAttribute("scale",U));null!=R&&(y=y.cloneNode(!0),y.setAttribute("border",R));d=S?mxUtils.getPrettyXml(y):mxUtils.getXml(y);if(!A&&!x&&(B||null!=l&&/(\.html)$/i.test(l.getTitle())))d=this.getHtml2(mxUtils.getXml(y),g,null!=l?l.getTitle():null,v,P);else if(A||!x&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(y),+d=this.getEmbeddedSvg(d,g,n,null,I,H,P,null,null,l.scale,l.border,null,Editor.svgFileTheme);return d};EditorUi.prototype.getXmlFileData=function(d,g,l,n){d=null!=d?d:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var x=this.editor.getGraphXml(d,n);if(d&&null!=this.fileNode&&null!=this.currentPage)if(d=function(H){var D=H.getElementsByTagName("mxGraphModel"),S=0<D.length?D[0]:null;D=H;null==S&&l?(S=mxUtils.getNodeValue(H),0<S.length&&(S=Graph.decompress(S),null!=S&&0<S.length&&(D=H.cloneNode(!1),+D.appendChild(mxUtils.parseXml(S).documentElement)))):null==S||l?D=H.cloneNode(!0):(D=H.cloneNode(!1),mxUtils.setTextContent(D,Graph.compressNode(S)));x.appendChild(D)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),g)d(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var A=this.pages[g],B=A.node;if(A!=this.currentPage)if(A.needsUpdate){var I=new mxCodec(mxUtils.createXmlDocument());I=I.encode(new mxGraphModel(A.root));+this.editor.graph.saveViewState(A.viewState,I,null,n);EditorUi.removeChildNodes(B);B.appendChild(I);delete A.needsUpdate}else n&&(this.updatePageRoot(A),null!=A.viewState.backgroundImage&&null!=A.viewState.backgroundImage.originalSrc&&(I=new mxCodec(mxUtils.createXmlDocument()),I=I.encode(new mxGraphModel(A.root)),this.editor.graph.saveViewState(A.viewState,I,null,n,A),B=B.cloneNode(!1),B.appendChild(I)));d(B)}return x};EditorUi.prototype.anonymizeString=function(d,g){for(var l=[],n=0;n<d.length;n++){var x=+d.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?l.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(d){d=mxUtils.clone(d);if(null!=d[EditorUi.DIFF_INSERT])for(var g=0;g<d[EditorUi.DIFF_INSERT].length;g++)try{var l=+mxUtils.parseXml(d[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));d[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(A){d[EditorUi.DIFF_INSERT][g].data=A.message}if(null!=d[EditorUi.DIFF_UPDATE]){for(var n in d[EditorUi.DIFF_UPDATE]){var x=d[EditorUi.DIFF_UPDATE][n];null!=x.name&&(x.name=this.anonymizeString(x.name));null!=x.cells&&(g=mxUtils.bind(this,function(A){var B=x.cells[A];+if(null!=B){for(var I in B)null!=B[I].value&&(B[I].value="["+B[I].value.length+"]"),null!=B[I].xmlValue&&(B[I].xmlValue="["+B[I].xmlValue.length+"]"),null!=B[I].style&&(B[I].style="["+B[I].style.length+"]"),mxUtils.isEmptyObject(B[I])&&delete B[I];mxUtils.isEmptyObject(B)&&delete x.cells[A]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);mxUtils.isEmptyObject(x)&&delete d[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(d[EditorUi.DIFF_UPDATE])&&delete d[EditorUi.DIFF_UPDATE]}return d};+EditorUi.prototype.anonymizeAttributes=function(d,g){if(null!=d.attributes)for(var l=0;l<d.attributes.length;l++)"as"!=d.attributes[l].name&&d.setAttribute(d.attributes[l].name,this.anonymizeString(d.attributes[l].value,g));if(null!=d.childNodes)for(l=0;l<d.childNodes.length;l++)this.anonymizeAttributes(d.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(d,g){g=d.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&g[l].setAttribute("value","["+g[l].getAttribute("value").length++"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length+"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return d};EditorUi.prototype.synchronizeCurrentFile=function(d){var g=+this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!d&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),this.clearStatus(),d?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==+DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(d,g,l,n,x,A,B,I,H,D,S,U,R){x=null!=x?x:!0;A=null!=A?A:!1;D=null!=D?D:!Editor.defaultCompressed;var P=this.editor.graph;if((g||!d&&null!=H&&/(\.svg)$/i.test(H.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var v=P.getGlobalVariable;P=this.createTemporaryGraph(P.getStylesheet());P.setBackgroundImage=this.editor.graph.setBackgroundImage;P.background=this.editor.graph.background;+var y=null!=this.pages?this.pages[0]:null;null==y||this.currentPage==y?P.setBackgroundImage(this.editor.graph.backgroundImage):null!=y.viewState&&null!=y.viewState&&P.setBackgroundImage(y.viewState.backgroundImage);P.getGlobalVariable=function(M){return"page"==M&&null!=y?y.getName():"pagenumber"==M?1:v.apply(this,arguments)};document.body.appendChild(P.container);null!=y&&P.model.setRoot(y.root)}B=null!=B?B:this.getXmlFileData(x,A,D,S);H=null!=H?H:this.getCurrentFile();d=this.createFileData(B,P,H,+window.location.href,d,g,l,n,x,I,D,U,R);P!=this.editor.graph&&P.container.parentNode.removeChild(P.container);return d};EditorUi.prototype.getHtml=function(d,g,l,n,x,A){A=null!=A?A:!0;var B=null,I=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=g){B=A?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var H=g.view.scale;A=Math.floor(B.x/H-g.view.translate.x);H=Math.floor(B.y/H-g.view.translate.y);B=g.background;null==x&&(g=this.getBasenames().join(";"),0<g.length&&(I=EditorUi.drawHost++"/embed.js?s="+g));d.setAttribute("x0",A);d.setAttribute("y0",H)}null!=d&&(d.setAttribute("pan","1"),d.setAttribute("zoom","1"),d.setAttribute("resize","0"),d.setAttribute("fit","0"),d.setAttribute("border","20"),d.setAttribute("links","1"),null!=n&&d.setAttribute("edit",n));null!=x&&(x=x.replace(/&/g,"&"));d=null!=d?Graph.zapGremlins(mxUtils.getXml(d)):"";n=Graph.compress(d);Graph.decompress(n)!=d&&(n=encodeURIComponent(d));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!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=B&&B!=mxConstants.NONE?' style="background-color:'+B+';">':">")+'\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==x?'<script type="text/javascript" src="'+I+'">\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(d,g,l,n,x){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=x&&(x=x.replace(/&/g,"&"));d={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,+xml:Graph.zapGremlins(d),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(d.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!=l?"<title>"+mxUtils.htmlEntities(l)+"</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(d))+'"></div>\n'+(null==x?'<script type="text/javascript" src="'+g+'">\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.setFileData=+function(d){d=this.validateFileData(d);this.pages=this.fileNode=this.currentPage=null;var g=null!=d&&0<d.length?mxUtils.parseXml(d).documentElement:null,l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[d],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");d=null!=g?this.editor.extractGraphModel(g,!0):null;null!=d&&(g=d);if(null!=g&&"mxfile"==g.nodeName&&(d=g.getElementsByTagName("diagram"),+l={},0<d.length)){var n=this.getHashObject(),x=null;this.fileNode=g;this.pages=[];for(var A=0;A<d.length;A++){null==d[A].getAttribute("id")&&d[A].setAttribute("id",A);g=new DiagramPage(d[A]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[A+1]));this.pages.push(g);if(null==n.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||null!=n.pageId&&g.getId()==n.pageId)x=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=+null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),+this.scrollToPage());if(null!=urlParams["layer-ids"])try{var B=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(A=0;A<B.length;A++)g[B[A]]=!0;var I=this.editor.graph.getModel(),H=I.getChildren(I.root);for(A=0;A<H.length;A++){var D=H[A];I.setVisible(D,g[D.id]||!1)}}catch(S){}};EditorUi.prototype.getBaseFilename=function(d){var g=this.getCurrentFile();g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=+g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!d&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=function(d,g,l,n,x,A,B,I,H,D,S,U,R,P,v,y,M){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var J=this.getBaseFilename(!x),K=J+("xml"==d||"pdf"==d&&S?".drawio":"")+"."++d;if("xml"==d){var m=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,x,null,null,null,g);this.saveData(K,d,m,"text/xml")}else if("html"==d)m=this.getHtml2(this.getFileData(!0),this.editor.graph,J),this.saveData(K,d,m,"text/html");else if("svg"!=d&&"xmlsvg"!=d||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==d?K=J+".png":"jpeg"==d&&(K=J+".jpg"),this.saveRequest(K,d,mxUtils.bind(this,function(O,Q){try{return this.createDownloadRequest(O,d,n,Q,B,x,I,H,D,S,U,void 0,+void 0,!A,R,P,v,y,M)}catch(T){this.handleError(T)}}));else{var t=null,C=mxUtils.bind(this,function(O){O.length<=MAX_REQUEST_SIZE?this.saveData(K,"svg",O,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(t)}))});if("svg"==d){var N=this.editor.graph.background;if(B||N==mxConstants.NONE)N=null;var L=this.editor.graph.getSvg(N,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(L);this.editor.convertImages(L,+mxUtils.bind(this,mxUtils.bind(this,function(O){this.spinner.stop();C(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(O))})))}else K=J+".svg",t=this.getFileData(!1,!0,null,mxUtils.bind(this,function(O){this.spinner.stop();C(O)}),n)}}catch(O){this.handleError(O)}};EditorUi.prototype.createDownloadRequest=function(d,g,l,n,x,A,B,I,H,D,S,U,R,P,v,y,M,J,K){d=this.downloadRequestBuilder(d,g,l,n,x,A,B,I,H,D,S,U,R,P,v,y,M,J,K);g="";for(var m in d)l=d[m],null!=l&&(g+=m+"="+encodeURIComponent(l)++"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(d,g,l,n,x,A,B,I,H,D,S,U,R,P,v,y,M,J,K){var m=this.editor.graph,t=m.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==A?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var C=null,N=null,L=null;if(!EditorUi.isElectronApp&&(t.width*t.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};D=D?"1":"0";"pdf"==g&&(null!=S?(C=S.from,N=S.to):0==A&&+(L="1"));"xmlpng"==g&&(D="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(A=0;A<this.pages.length;A++)if(this.pages[A]==this.currentPage){C=A;break}A=m.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!x?x||null!=A&&A!=mxConstants.NONE||(A="#ffffff"):A=mxConstants.NONE;x={globalVars:m.getExportVariables()};null!=S&&null!=S.from&&(x.globalVars.pagenumber=S.from+1);H&&(x.grid={size:m.gridSize,steps:m.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:+m.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);return{format:g,from:C,to:N,allPages:L,bg:null!=A?A:mxConstants.NONE,base64:n,embedXml:D,xml:l,filename:null!=d?d:"",extras:JSON.stringify(x),scale:B,border:I,pageMargin:v,w:U&&isFinite(U)?U:null,h:R&&isFinite(R)?R:null,crop:null!=P&&P?"1":"0",fit:null!=y&&y?"1":"0",shadows:null!=K&&K?"1":"0",sheetsAcross:M,sheetsDown:J}};EditorUi.prototype.setMode=function(d,g){this.mode=d};EditorUi.prototype.getDiagramId=function(){var d=+window.location.hash;null!=d&&0<d.length&&(d=d.substring(1));if(null!=d&&1<d.length){var g=d.indexOf("#");0<=g&&(d=d.substring(0,g))}return d};EditorUi.prototype.getHashObject=function(){var d=window.location.hash,g={};if(null!=d&&0<d.length){var l=d.lastIndexOf("#");if(0<l){d=decodeURIComponent(d.substring(l+1));try{g=JSON.parse(d)}catch(n){}}}return g};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var d=this.getHashObject();+d.pageId=this.currentPage.getId();this.setHashObject(d)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(d){if(Editor.enableHashObjects){var g=window.location.hash;if(null==g||""==g)g="#";var l=g.lastIndexOf("#");0<l&&(g=g.substring(0,l));try{null==d||mxUtils.isEmptyObject(d)||(g=g+"#"+encodeURIComponent(JSON.stringify(d)))}catch(n){}0<l&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=function(d,g,l){var n=window.location.hash,+x=mxUtils.bind(this,function(B){var I=null!=d.data?d.data:"";null!=B&&0<B.length&&(0<I.length&&(I+="\n"),I+=B);B=new LocalFile(this,"csv"!=d.format&&0<I.length?I:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);B.getHash=function(){return n};this.fileLoaded(B);"csv"==d.format&&this.importCsv(I,mxUtils.bind(this,function(R){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=d.update){var H=null!=d.interval?+parseInt(d.interval):6E4,D=null,S=mxUtils.bind(this,function(){var R=this.currentPage;mxUtils.post(d.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(P){R===this.currentPage&&(200<=P.getStatus()&&300>=P.getStatus()?(this.updateDiagram(P.getText()),U()):this.handleError({message:mxResources.get("error")+" "+P.getStatus()}))}),mxUtils.bind(this,function(P){this.handleError(P)}))}),U=mxUtils.bind(this,function(){window.clearTimeout(D);D=window.setTimeout(S,+H)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){U();S()}));U();S()}null!=g&&g()});if(null!=d.url&&0<d.url.length){var A=this.editor.getProxiedUrl(d.url);this.editor.loadUrl(A,mxUtils.bind(this,function(B){x(B)}),mxUtils.bind(this,function(B){null!=l&&l(B)}))}else x("")};EditorUi.prototype.updateDiagram=function(d){function g(m){var t=new mxCellOverlay(m.image||x.warningImage,m.tooltip,m.align,m.valign,m.offset);t.addListener(mxEvent.CLICK,function(C,N){n.alert(m.tooltip)});+return t}var l=null,n=this;if(null!=d&&0<d.length&&(l=mxUtils.parseXml(d),d=null!=l?l.documentElement:null,null!=d&&"updates"==d.nodeName)){var x=this.editor.graph,A=x.getModel();A.beginUpdate();var B=null;try{for(d=d.firstChild;null!=d;){if("update"==d.nodeName){var I=A.getCell(d.getAttribute("id"));if(null!=I){try{var H=d.getAttribute("value");if(null!=H){var D=mxUtils.parseXml(H).documentElement;if(null!=D)if("1"==D.getAttribute("replace-value"))A.setValue(I,D);else for(var S=D.attributes,U=0;U<+S.length;U++)x.setAttributeForCell(I,S[U].nodeName,0<S[U].nodeValue.length?S[U].nodeValue:null)}}catch(m){null!=window.console&&console.log("Error in value for "+I.id+": "+m)}try{var R=d.getAttribute("style");null!=R&&x.model.setStyle(I,R)}catch(m){null!=window.console&&console.log("Error in style for "+I.id+": "+m)}try{var P=d.getAttribute("icon");if(null!=P){var v=0<P.length?JSON.parse(P):null;null!=v&&v.append||x.removeCellOverlays(I);null!=v&&x.addCellOverlay(I,g(v))}}catch(m){null!=window.console&&+console.log("Error in icon for "+I.id+": "+m)}try{var y=d.getAttribute("geometry");if(null!=y){y=JSON.parse(y);var M=x.getCellGeometry(I);if(null!=M){M=M.clone();for(key in y){var J=parseFloat(y[key]);"dx"==key?M.x+=J:"dy"==key?M.y+=J:"dw"==key?M.width+=J:"dh"==key?M.height+=J:M[key]=parseFloat(y[key])}x.model.setGeometry(I,M)}}}catch(m){null!=window.console&&console.log("Error in icon for "+I.id+": "+m)}}}else if("model"==d.nodeName){for(var K=d.firstChild;null!=K&&K.nodeType!=mxConstants.NODETYPE_ELEMENT;)K=K.nextSibling;null!=K&&(new mxCodec(d.firstChild)).decode(K,A)}else if("view"==d.nodeName){if(d.hasAttribute("scale")&&(x.view.scale=parseFloat(d.getAttribute("scale"))),d.hasAttribute("dx")||d.hasAttribute("dy"))x.view.translate=new mxPoint(parseFloat(d.getAttribute("dx")||0),parseFloat(d.getAttribute("dy")||0))}else"fit"==d.nodeName&&(B=d.hasAttribute("max-scale")?parseFloat(d.getAttribute("max-scale")):1);d=d.nextSibling}}finally{A.endUpdate()}null!=B&&this.chromelessResize&&this.chromelessResize(!0,B)}return l};EditorUi.prototype.getCopyFilename=function(d,g){var l=null!=d&&null!=d.getTitle()?d.getTitle():this.defaultFilename;d="";var n=l.lastIndexOf(".");0<=n&&(d=l.substring(n),l=l.substring(0,n));if(g){g=l;var x=new Date;l=x.getFullYear();n=x.getMonth()+1;var A=x.getDate(),B=x.getHours(),I=x.getMinutes();x=x.getSeconds();l=g+(" "+(l+"-"+n+"-"+A+"-"+B+"-"+I+"-"+x))}return l=mxResources.get("copyOf",[l])+d};EditorUi.prototype.logIfModified=function(d,g){try{null!=d&&g&&EditorUi.debug("File.closed",[d])}catch(l){}};EditorUi.prototype.fileLoaded=function(d,g,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[d],"noDialogs",[g]);var n=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var x=!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 A=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);@@ -13114,87 +13114,87 @@ U.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(U,mxResources.getR()}));var P=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(D.style,"transform",B);window.setTimeout(mxUtils.bind(this,function(){R()}),1E3)});mxEvent.addListener(D,"click",mxUtils.bind(this,function(v){var y=mxEvent.getSource(v);y!=S&&y!=U?(null!=l&&l(),R(),mxEvent.consume(v)):P()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(D.style,"transform",I)}),500);window.setTimeout(P,x?5E3:3E4);A=!0}return A};EditorUi.prototype.setCurrentFile=function(d){null!=d&&(d.opened=new Date);this.currentFile=d};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(d,g,l,n){d=d.toDataURL("image/"+l);if(null!=d&&6<d.length)null!=g&&(d=Editor.writeGraphModelToPng(d,"tEXt","mxfile",encodeURIComponent(g))),0<n&&(d=Editor.writeGraphModelToPng(d,"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return d};EditorUi.prototype.saveCanvas=function(d,g,l,n,x){var A="jpeg"==l?"jpg":l;n=this.getBaseFilename(n)+(null!=g?".drawio":"")+"."+A;d=this.createImageDataUri(d,g,l,x);this.saveData(n,A,d.substring(d.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(d,g){d=new TextareaDialog(this,d,g,null,null,mxResources.get("close"));-this.showDialog(d.container,620,460,!0,!0,null,null,null,null,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(d,g,l,n,x,A){"text/xml"!=l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=A?A:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)d=n?this.base64ToBlob(d,l):new Blob([d],{type:l}),navigator.msSaveOrOpenBlob(d,g);else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==-l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",d):this.openInNewWindow(d,l,n);else{var B=document.createElement("a");A=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof B.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var I=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);A=65==(I?parseInt(I[2],10):!1)?!1:A}if(A||this.isOffline()){B.href=URL.createObjectURL(n?this.base64ToBlob(d,l):new Blob([d],{type:l}));A?B.download=g:B.setAttribute("target",-"_blank");document.body.appendChild(B);try{window.setTimeout(function(){URL.revokeObjectURL(B.href)},2E4),B.click(),B.parentNode.removeChild(B)}catch(H){}}else this.createEchoRequest(d,g,l,n,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(d,g,l,n,x,A){d="xml="+encodeURIComponent(d);return new mxXmlRequest(SAVE_URL,d+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=A?"&base64="+A:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=-function(d,g,l,n,x,A,B,I,H){A=null!=A?A:!1;B=null!=B?B:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var D=mxUtils.bind(this,function(U,R,P,v){try{if("_blank"==R)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(d,l,n);else if(null!=l&&"text/html"==l.substring(0,9)){var y=new EmbedDialog(this,d);this.showDialog(y.container,450,240,!0,!0);y.init()}else{var M=window.open("about:blank");null==M?mxUtils.popup(d,!0):(M.document.write("<pre>"+mxUtils.htmlEntities(d,!1)+"</pre>"),M.document.close())}else if(R==-App.MODE_DEVICE||"download"==R)this.doSaveLocalFile(d,U,l,n,null,I);else if(null!=U&&0<U.length){var J=mxUtils.bind(this,function(K){try{this.exportFile(d,U,l,n,R,K)}catch(m){this.handleError(m)}});null!=v?J(v):this.pickFolder(R,J)}}catch(K){this.handleError(K)}});x=[];A||x.push(App.MODE_BROWSER);B||x.push("_blank");var S=new SaveDialog(this,g,mxUtils.bind(this,function(U,R,P){D(U.value,R,U,P);this.hideDialog(null,null,S.container)}),x,d,l,n,H);this.showDialog(S.container,420,110,!0,!1,mxUtils.bind(this,-function(){this.hideDialog()}));S.init()};EditorUi.prototype.openInNewWindow=function(d,g,l){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(d,!0);else{var x="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var A=mxUtils.parseXml(d).documentElement.style.backgroundColor;""!=A&&(x="background: "+A+";")}x='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+x+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=-g||l?(A=l?d:btoa(unescape(encodeURIComponent(d))),n.document.write(x+'<img style="max-width:100%;" src="data:'+g+";base64,"+A+'"/></body></html>')):n.document.write(x+d+"</body></html>"):n.document.write(x+"<pre>"+mxUtils.htmlEntities(d,!1)+"</pre></body></html>");n.document.close()}};var c=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(d){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var g=d(mxUtils.bind(this,function(n){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 x=g.getBoundingClientRect();this.tagsDialog.style.left=x.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=x.zIndex;document.body.appendChild(this.tagsDialog);-this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();g.style.display=0<n.length?"":"none"}))}c.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()){this.exportDialog=null;var l=d(mxUtils.bind(this,function(n){var x=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",x);null!=this.exportDialog&&-(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)x.apply(this);else{this.exportDialog=document.createElement("div");var A=l.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=A.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";A=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=A.zIndex;var B=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});B.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",x);this.editor.exportToCanvas(mxUtils.bind(this,function(I){B.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var H=this.createImageDataUri(I,null,"png");I=document.createElement("img");I.style.maxWidth="140px";I.style.maxHeight="140px";-I.style.cursor="pointer";I.style.backgroundColor="white";I.setAttribute("title",mxResources.get("openInNewWindow"));I.setAttribute("border","0");I.setAttribute("src",H);this.exportDialog.appendChild(I);mxEvent.addListener(I,"click",mxUtils.bind(this,function(){this.openInNewWindow(H.substring(H.indexOf(",")+1),"image/png",!0);x.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(I){B.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),-this.exportDialog=null);this.handleError(I)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(d,g,l,n,x,A){this.isLocalFileSave()?this.saveLocalFile(l,d,n,x,g,A):this.saveRequest(d,g,mxUtils.bind(this,function(B,I){return this.createEchoRequest(l,B,n,x,g,I)}),l,x,n)};EditorUi.prototype.saveRequest=function(d,g,l,n,x,A,B){B=null!=B?B:!mxClient.IS_IOS||!navigator.standalone;var I=mxUtils.bind(this,-function(D,S,U,R){if("_blank"==S||null!=D&&0<D.length){var P=l("_blank"==S?null:D,S==App.MODE_DEVICE||"download"==S||null==S||"_blank"==S?"0":"1");null!=P&&(S==App.MODE_DEVICE||"download"==S||"_blank"==S?P.simulate(document,"_blank"):(U=mxUtils.bind(this,function(v){A=null!=A?A:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,D,A,!0,S,v)}catch(y){this.handleError(y)}else this.spinner.spin(document.body,mxResources.get("saving"))&&P.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=P.getStatus()&&299>=P.getStatus())try{this.exportFile(P.getText(),D,A,!0,S,v)}catch(y){this.handleError(y)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}))}),null!=R?U(R):this.pickFolder(S,U)))}});x=[App.MODE_BROWSER];B||x.push("_blank");var H=new SaveDialog(this,d,mxUtils.bind(this,function(D,S,U){I(D.value,S,D,U);this.hideDialog(null,null,H.container)}),x,null,"application/pdf");this.showDialog(H.container,-420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));H.init()};EditorUi.prototype.isServices=function(d){return 1!=d};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(d,g,l,n,x,A){};EditorUi.prototype.getServiceForName=function(d){return null};EditorUi.prototype.getTitleForService=function(d){return mxResources.get(d)};EditorUi.prototype.pickFolder=function(d,g,l){g(null)};EditorUi.prototype.exportSvg=function(d,g,l,n,x,A,-B,I,H,D,S,U,R,P){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(W){Editor.addRetryToError(W,mxUtils.bind(this,function(){this.exportSvg(d,g,l,n,x,A,B,I,H,D,S,U,R,P)}));this.handleError(W)})))try{var v=this.editor.graph.isSelectionEmpty();l=null!=l?l:v;var y=g?null:this.editor.graph.background;y==mxConstants.NONE&&(y=null);null==y&&0==g&&(y=this.editor.graph.shapeBackgroundColor);var M=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&-(this.editor.graph.addForeignObjectWarning=function(){});var J=mxUtils.lightDarkColorSupported,K=mxUtils.preferDarkColor;if("light"==S||"dark"==S)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==S;var m=Graph.addFont,t={};Graph.addFont=function(W,Y,Z,aa){m.call(this,W,Y,Z,t)};var C=this.editor.graph.createSvgImageExport(x),N=C.drawCellState;C.drawCellState=function(W,Y){null!=W&&Graph.processFontStyle(W.style);N.apply(this,arguments)};var L=this.editor.graph.getSvg(y,d,B,I,null,-l,null,C,"blank"==D?"_blank":"self"==D?"_top":null,null,!R,S,U);mxUtils.lightDarkColorSupported=J;mxUtils.preferDarkColor=K;this.editor.graph.addForeignObjectWarning=M;n&&this.editor.graph.addSvgShadow(L);var O=this.getBaseFilename()+(x?".drawio":"")+".svg";P=null!=P?P:mxUtils.bind(this,function(W){this.isLocalFileSave()||W.length<=MAX_REQUEST_SIZE?this.saveData(O,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(W)}))});-var Q=mxUtils.bind(this,function(W){this.spinner.stop();x&&W.setAttribute("content",this.getFileData(!0,null,null,null,l,H,null,null,null,null,null,d,B));P(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(W))});this.editor.graph.mathEnabled&&this.editor.addMathCss(L);var T=mxUtils.bind(this,function(W){Editor.replaceSvgDataUris&&A&&EditorUi.embedSvgImages(W);Editor.foreignObjectImages&&R?this.replaceAlternateContent(W,S,Q):Q(W)}),V=Graph.customFontElements;-Graph.customFontElements=t;var X=mxUtils.bind(this,function(W){Graph.customFontElements=V;Graph.addFont=m;A&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(W,T,this.thumbImageCache)):T(W)});R?this.embedFonts(L,X):(this.editor.addFontCss(L),X(L))}catch(W){this.handleError(W)}};EditorUi.prototype.replaceAlternateContent=function(d,g,l){function n(U,R,P,v,y){var M=mxUtils.createElementNs(d.ownerDocument,mxConstants.NS_SVG,"image");-M.setAttribute("x",R);M.setAttribute("y",P+.5);M.setAttribute("width",v.width);M.setAttribute("height",v.height);null==M.setAttributeNS?M.setAttribute("xlink:href",y):M.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",y);U.replaceChild(M,U.lastChild);I()}function x(){if(B<S.length)S[B++](x)}var A="";g=d.getElementsByTagName("style");for(var B=0;B<g.length;B++)A+=g[B].innerHTML;g=d.getElementsByTagName("switch");counter=g.length;var I=mxUtils.bind(this,function(){counter--;0==counter&&l(d)}),H={},-D={},S=[];for(B=0;B<g.length;B++)mxUtils.bind(this,function(U){var R=U.getElementsByTagName("div");if(0<R.length)try{var P=R[0].cloneNode(!0),v=parseInt(P.style.marginLeft),y=parseInt(P.style.paddingTop),M=P.getElementsByTagName("div")[1],J=R=!1,K=P.style.alignItems,m=P.style.justifyContent;if(null!=P.style.writingMode){var t=P.style.writingMode;J="vertical-"==t.substring(0,9);R="-rl"==t.substring(t.length-3)}var C=!J&&"1px"==P.style.width||J&&"1px"==P.style.height;if(!J&&"1px"==P.style.height||J&&-"1px"==P.style.width)P.style.alignItems=J&&R?"unsafe flex-end":"unsafe flex-start";C&&(P.style.justifyContent="unsafe flex-start");P.style.paddingTop="";P.style.marginLeft="";var N=P.outerHTML,L=H[N];null==L&&(P.style.position="absolute",P.style.visibility="hidden",document.body.appendChild(P),t=1,t="1px"==P.style.width?M.offsetWidth:parseInt(P.style.width),C=1,C="1px"==P.style.height?M.offsetHeight:parseInt(P.style.height),document.body.removeChild(P),L=new mxRectangle(v,y,t,C),H[N]=L);"1px"==P.style.height&&-("unsafe center"==K?y-=L.height/2:"unsafe flex-end"==K&&(y-=L.height));if("1px"==P.style.width)if(!J&&"unsafe center"==m||J&&"unsafe center"==K)v-=L.width/2;else if(!J&&"unsafe flex-end"==m||J&&(!R&&"unsafe flex-end"==K||R&&"unsafe flex-start"==K))v-=L.width;L=new mxRectangle(v,y,L.width,L.height+parseInt(M.style.fontSize)/4);S.push(mxUtils.bind(this,function(O){var Q=D[N];null==Q?Graph.htmlToPng(N,L.width,L.height,mxUtils.bind(this,function(T){n(U,v,y,L,T);D[N]=T;O()}),A):(n(U,v,y,L,Q),O())}))}catch(O){I()}else I()})(g[B]);-0==counter&&l(d);B=0;x()};EditorUi.prototype.addRadiobox=function(d,g,l,n,x,A,B){return this.addCheckbox(d,l,n,x,A,B,!0,g)};EditorUi.prototype.addCheckbox=function(d,g,l,n,x,A,B,I){A=null!=A?A:!0;var H=document.createElement("input");H.style.marginRight="8px";H.style.marginTop="16px";H.setAttribute("type",B?"radio":"checkbox");B="geCheckbox-"+Editor.guid();H.id=B;null!=I&&H.setAttribute("name",I);l&&(H.setAttribute("checked","checked"),H.defaultChecked=!0);n&&H.setAttribute("disabled","disabled");-A&&(d.appendChild(H),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",B),d.appendChild(l),x||mxUtils.br(d));return H};EditorUi.prototype.addEditButton=function(d,g){var l=this.addCheckbox(d,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var n=this.getCurrentFile(),x="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(x=window.location.href);var A=document.createElement("select");A.style.maxWidth="200px";A.style.width="auto";A.style.marginLeft=-"8px";A.style.marginRight="10px";A.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));A.appendChild(n);var B=document.createElement("option");B.setAttribute("value","custom");mxUtils.write(B,mxResources.get("custom")+"...");A.appendChild(B);d.appendChild(A);mxEvent.addListener(A,"change",mxUtils.bind(this,function(){if("custom"==A.value){var I=new FilenameDialog(this,x,mxResources.get("ok"),function(H){null!=H?(x=H,B.setAttribute("title",-H)):(A.value="blank",B.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){A.value="blank"});this.showDialog(I.container,300,80,!0,!1);I.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")}));mxUtils.br(d);return{getLink:function(){return l.checked?"blank"===A.value?"_blank":x:null},getEditInput:function(){return l},getEditSelect:function(){return A}}};-EditorUi.prototype.addLinkSection=function(d,g){function l(){var I=document.createElement("div");I.style.width="100%";I.style.height="100%";I.style.boxSizing="border-box";null!=A&&A!=mxConstants.NONE?(I.style.border="1px solid black",I.style.backgroundColor=A):(I.style.backgroundPosition="center center",I.style.backgroundRepeat="no-repeat",I.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");B.innerText="";B.appendChild(I)}mxUtils.write(d,mxResources.get("links")+":");var n=document.createElement("select");-n.style.width="100px";n.style.padding="0px";n.style.marginLeft="8px";n.style.marginRight="10px";n.className="geBtn";var x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));-n.appendChild(x);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));d.appendChild(n);mxUtils.write(d,mxResources.get("borderColor")+":");var A="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(I){this.pickColor(A||"none",function(H){A=H;l()});mxEvent.consume(I)}));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=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";B.className="geColorBtn";d.appendChild(B);mxUtils.br(d);return{getColor:function(){return A},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(d,g,l,n,x,A){A=null!=A?A:[];l&&(A.push("lightbox=1"),"auto"!=d&&A.push("target="+d),null!=g&&g!=mxConstants.NONE&&A.push("highlight="+("#"==g.charAt(0)?g.substring(1):-g)),null!=n&&0<n.length&&A.push("edit="+encodeURIComponent(n)),x&&A.push("layers=1"),this.editor.graph.foldingEnabled&&A.push("nav=1"));return A};EditorUi.prototype.createLink=function(d,g,l,n,x,A,B,I,H,D,S,U,R){var P=this.getCurrentFile();H=this.createUrlParameters(d,g,n,x,A,H);d=!0;null!=B?l="#U"+encodeURIComponent(B):I||null==P||""==P.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=-"#"+P.getHash(),d=!1);d&&null!=P&&null!=P.getTitle()&&P.getTitle()!=this.defaultFilename&&H.push("title="+encodeURIComponent(P.getTitle()));D&&1<l.length&&(H.push("open="+l.substring(1)),l="");S&&null!=this.currentPage&&H.push("page-id="+this.currentPage.getId());U&&H.push("transparent=1");null!=R&&H.push("dark="+R);return(n&&(null!=B||null!=P&&P.getMode()!=App.MODE_GITHUB&&P.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?-EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<H.length?"?"+H.join("&"):"")+l};EditorUi.prototype.createHtml=function(d,g,l,n,x,A,B,I,H,D,S,U,R){this.getBasenames();var P={};""!=x&&x!=mxConstants.NONE&&(P.highlight=x);"auto"!==n&&(P.target=n);D||(P.lightbox=!1);P.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(P.zoom=l/100);l=[];B&&(l.push("pages"),P.resize=!0,null!=this.pages&&null!=this.currentPage&&(P.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),-P.resize=!0);I&&l.push("layers");H&&l.push("tags");null!=R&&(P["dark-mode"]=R);0<l.length&&(D&&l.push("lightbox"),P.toolbar=l.join(" "));null!=S&&0<S.length&&(P.edit=S);null!=d?P.url=d:P.xml=this.getFileData(!0,null,null,null,null,!B);g='<div class="mxgraph" style="'+(A?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(P))+'"></div>';d=null!=d?"&fetch="+encodeURIComponent(d):"";U(g,'<script type="text/javascript" src="'+(0<d.length?-("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+d:"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.showHtmlDialog=function(d,g,l,n){var x=document.createElement("div");x.style.whiteSpace="nowrap";var A=document.createElement("h3");mxUtils.write(A,mxResources.get("html"));A.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";-x.appendChild(A);var B=document.createElement("div");B.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var I=document.createElement("input");I.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","type-embedhtmldialog");A=I.cloneNode(!0);A.setAttribute("value","copy");B.appendChild(A);var H=document.createElement("span");mxUtils.write(H,mxResources.get("includeCopyOfMyDiagram"));-B.appendChild(H);mxUtils.br(B);B.appendChild(I);H=document.createElement("span");mxUtils.write(H,mxResources.get("publicDiagramUrl"));B.appendChild(H);var D=this.getCurrentFile();null==l&&null!=D&&D.constructor==window.DriveFile&&(H=document.createElement("a"),H.style.paddingLeft="12px",H.style.color="gray",H.style.cursor="pointer",mxUtils.write(H,mxResources.get("share")),B.appendChild(H),mxEvent.addListener(H,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(D.getId(),-D)})));A.setAttribute("checked","checked");null==l&&I.setAttribute("disabled","disabled");x.appendChild(B);B=380;var S=this.addLinkSection(x),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginTop="16px";H=document.createElement("option");H.setAttribute("value","light");mxUtils.write(H,mxResources.get("light"));U.appendChild(H);H=document.createElement("option");H.setAttribute("value","dark");mxUtils.write(H,mxResources.get("dark"));U.appendChild(H);-H=document.createElement("option");H.setAttribute("value","auto");mxUtils.write(H,mxResources.get("automatic"));H.setAttribute("selected","selected");U.appendChild(H);H.setAttribute("selected","selected");mxUtils.write(x,mxResources.get("appearance")+":");x.appendChild(U);mxUtils.br(x);B+=26;var R=this.addCheckbox(x,mxResources.get("zoom"),!0,null,!0);mxUtils.write(x,":");var P=document.createElement("input");P.setAttribute("type","text");P.style.marginRight="16px";P.style.width="60px";P.style.marginLeft=-"4px";P.style.marginRight="12px";P.value="100%";x.appendChild(P);var v=this.addCheckbox(x,mxResources.get("fit"),!0);H=null!=this.pages&&1<this.pages.length;var y=y=this.addCheckbox(x,mxResources.get("allPages"),H,!H),M=this.addCheckbox(x,mxResources.get("layers"),!0),J=this.addCheckbox(x,mxResources.get("tags"),!0),K=this.addCheckbox(x,mxResources.get("lightbox"),!0),m=null;if(EditorUi.enableHtmlEditOption){m=this.addEditButton(x,K);var t=m.getEditInput();t.style.marginBottom="16px";B+=50;mxEvent.addListener(K,-"change",function(){K.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled");t.checked&&K.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")})}d=new CustomDialog(this,x,mxUtils.bind(this,function(){n(I.checked?l:null,R.checked,P.value,S.getTarget(),S.getColor(),v.checked,y.checked,M.checked,J.checked,K.checked,null!=m?m.getLink():null,null!=U?U.value:null)}),null,d,g);this.showDialog(d.container,340,B,!0,!0);A.focus()};-EditorUi.prototype.showPublishLinkDialog=function(d,g,l,n,x,A,B,I,H,D,S,U){var R=document.createElement("div");R.style.whiteSpace="nowrap";var P=document.createElement("h3");mxUtils.write(P,d||mxResources.get("publish"));P.style.width="100%";P.style.textAlign="center";P.style.marginTop="2px";P.style.marginBottom="20px";R.appendChild(P);var v=document.createElement("select");d=30;v.className="geBtn";v.style.marginBottom="8px";v.style.marginLeft="0px";v.style.width="100%";v.style.boxSizing="border-box";-if(null==I||""==I.getHash())x=null!=x?x:"https://www.drawio.com/doc/faq/publish-diagram-as-link",P=document.createElement("option"),mxUtils.write(P,mxResources.get("makeCopy")),P.setAttribute("value","copy"),v.appendChild(P);P=document.createElement("option");mxUtils.write(P,mxResources.get("authorizationRequired"));P.setAttribute("value","auth");v.appendChild(P);null!=I&&""!=I.getHash()||P.setAttribute("disabled","disabled");I=document.createElement("option");I.setAttribute("value","public");v.appendChild(I);-null!=B?(mxUtils.write(I,mxResources.get("publicDiagramUrl")),I.setAttribute("title",B),v.value="public"):(mxUtils.write(I,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),I.setAttribute("disabled","disabled"));R.appendChild(v);mxUtils.br(R);v.focus();var y=null,M=null;if(null!=g||null!=l)d+=30,mxUtils.write(R,mxResources.get("width")+":"),y=document.createElement("input"),y.setAttribute("type","text"),y.style.marginRight="16px",y.style.width="50px",y.style.marginLeft=-"6px",y.style.marginRight="16px",y.style.marginBottom="10px",y.value="100%",R.appendChild(y),mxUtils.write(R,mxResources.get("height")+":"),M=document.createElement("input"),M.setAttribute("type","text"),M.style.width="50px",M.style.marginLeft="6px",M.style.marginBottom="10px",M.value=l+"px",R.appendChild(M),mxUtils.br(R);var J=this.addLinkSection(R,n),K=D?this.addCheckbox(R,mxResources.get("transparentBackground"),!1):null;null!=K&&(d+=20);var m=document.createElement("select");m.className="geBtn";-m.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");m.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");m.appendChild(g);var t=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(d+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),U&&(mxUtils.write(R,-mxResources.get("pages")+":"),R.appendChild(m),mxUtils.br(R),d+=30),t=this.addCheckbox(R,mxResources.get("selectedPage")+": "+g));var C=document.createElement("select");C.style.maxWidth="260px";C.style.marginLeft="8px";C.style.marginTop="16px";U=document.createElement("option");U.setAttribute("value","0");mxUtils.write(U,mxResources.get("light"));C.appendChild(U);U=document.createElement("option");U.setAttribute("value","1");mxUtils.write(U,mxResources.get("dark"));C.appendChild(U);U=document.createElement("option");-U.setAttribute("value","auto");mxUtils.write(U,mxResources.get("automatic"));U.setAttribute("selected","selected");C.appendChild(U);S&&(mxUtils.write(R,mxResources.get("appearance")+":"),R.appendChild(C),mxUtils.br(R),d+=30);var N=this.addCheckbox(R,mxResources.get("lightbox"),!0,null,null,!n),L=this.addEditButton(R,N),O=L.getEditInput();n&&(O.style.marginLeft=N.style.marginLeft,N.style.display="none",d-=20);var Q=this.addCheckbox(R,mxResources.get("layers"),!0);Q.style.marginLeft=O.style.marginLeft;-Q.style.marginTop="8px";var T=this.addCheckbox(R,mxResources.get("tags"),!0);T.style.marginLeft=O.style.marginLeft;T.style.marginBottom="16px";T.style.marginTop="16px";mxEvent.addListener(N,"change",function(){N.checked?(Q.removeAttribute("disabled"),O.removeAttribute("disabled"),T.removeAttribute("disabled")):(Q.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"));O.checked&&N.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled",-"disabled")});n=new CustomDialog(this,R,mxUtils.bind(this,function(){H(J.getTarget(),J.getColor(),null==t?!1:t.checked,N.checked,L.getLink(),Q.checked,null!=y?y.value:null,null!=M?M.value:null,T.checked,v.value,null!=K?K.checked:!1,C.value,"allPages"==m.value)}),null,mxResources.get("create"),x,A);this.showDialog(n.container,340,296+d,!0,!0);null!=y?(y.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?y.select():document.execCommand("selectAll",!1,null)):null==v.parentNode;J.focus()};-EditorUi.prototype.showRemoteExportDialog=function(d,g,l,n,x){var A=document.createElement("div");A.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxResources.get("image"));B.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(x?"10":"4")+"px";A.appendChild(B);if(x){mxUtils.write(A,mxResources.get("zoom")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.marginRight="16px";I.style.width="60px";I.style.marginLeft=-"4px";I.style.marginRight="12px";I.value=this.lastExportZoom||"100%";A.appendChild(I);mxUtils.write(A,mxResources.get("borderWidth")+":");var H=document.createElement("input");H.setAttribute("type","text");H.style.marginRight="16px";H.style.width="60px";H.style.marginLeft="4px";H.value=this.lastExportBorder||"0";A.appendChild(H);mxUtils.br(A)}var D=this.addCheckbox(A,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),S=n?null:this.addCheckbox(A,mxResources.get("includeCopyOfMyDiagram"),-Editor.defaultIncludeDiagram);B=this.editor.graph;var U=n?null:this.addCheckbox(A,mxResources.get("transparentBackground"),B.background==mxConstants.NONE||null==B.background);null!=U&&(U.style.marginBottom="16px");d=new CustomDialog(this,A,mxUtils.bind(this,function(){var R=parseInt(I.value)/100||1,P=parseInt(H.value)||0;l(!D.checked,null!=S?S.checked:!1,null!=U?U.checked:!1,R,P)}),null,d,g);this.showDialog(d.container,300,(x?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(d,-g,l,n,x,A,B,I,H){B=null!=B?B:Editor.defaultIncludeDiagram;var D=document.createElement("div");D.style.whiteSpace="nowrap";var S=this.editor.graph,U="jpeg"==I||"webp"==I?220:320,R=document.createElement("h3");mxUtils.write(R,d);R.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";D.appendChild(R);mxUtils.write(D,mxResources.get("zoom")+":");var P=document.createElement("input");P.setAttribute("type","text");P.style.marginRight="16px";P.style.width="60px";P.style.marginLeft=-"4px";P.style.marginRight="12px";P.value=this.lastExportZoom||"100%";D.appendChild(P);mxUtils.write(D,mxResources.get("borderWidth")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.value=this.lastExportBorder||"0";D.appendChild(v);mxUtils.br(D);var y=this.addCheckbox(D,mxResources.get("selectionOnly"),!1,S.isSelectionEmpty()),M=document.createElement("input");M.style.marginTop="16px";M.style.marginRight=-"8px";M.style.marginLeft="24px";M.setAttribute("disabled","disabled");M.setAttribute("type","checkbox");var J=document.createElement("select");J.style.marginTop="16px";J.style.marginLeft="8px";d=["selectionOnly","diagram","page"];for(R=0;R<d.length;R++)if(!S.isSelectionEmpty()||"selectionOnly"!=d[R]){var K=document.createElement("option");mxUtils.write(K,mxResources.get(d[R]));K.setAttribute("value",d[R]);J.appendChild(K)}H?(mxUtils.write(D,mxResources.get("size")+":"),D.appendChild(J),mxUtils.br(D),-U+=26,mxEvent.addListener(J,"change",function(){"selectionOnly"==J.value&&(y.checked=!0)})):A&&(D.appendChild(M),mxUtils.write(D,mxResources.get("crop")),mxUtils.br(D),U+=30,mxEvent.addListener(y,"change",function(){y.checked?M.removeAttribute("disabled"):M.setAttribute("disabled","disabled")}));S.isSelectionEmpty()?H&&(y.style.display="none",y.nextSibling.style.display="none",y.nextSibling.nextSibling.style.display="none",U-=30):(J.value="diagram",M.setAttribute("checked","checked"),M.defaultChecked=-!0,mxEvent.addListener(y,"change",function(){J.value=y.checked?"selectionOnly":"diagram"}));var m=this.addCheckbox(D,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=I&&"webp"!=I),t=document.createElement("select");t.style.maxWidth="260px";t.style.marginLeft="8px";t.style.marginTop="16px";A=document.createElement("option");A.setAttribute("value","light");mxUtils.write(A,mxResources.get("light"));t.appendChild(A);H=document.createElement("option");H.setAttribute("value","dark");mxUtils.write(H,-mxResources.get("dark"));t.appendChild(H);"svg"==I&&mxUtils.lightDarkColorSupported?(A=document.createElement("option"),A.setAttribute("value","auto"),mxUtils.write(A,mxResources.get("automatic")),A.setAttribute("selected","selected"),t.appendChild(A)):Editor.isDarkMode()?H.setAttribute("selected","selected"):A.setAttribute("selected","selected");mxUtils.write(D,mxResources.get("appearance")+":");D.appendChild(t);mxUtils.br(D);U+=26;var C=this.addCheckbox(D,mxResources.get("shadow"),S.shadowVisible),-N=null;if("png"==I||"jpeg"==I||"webp"==I)N=this.addCheckbox(D,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),U+=30;S=null!=this.pages?this.pages.length:1;var L=this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram")+(1<S?":":""),B,null,null,"jpeg"!=I&&"webp"!=I),O=document.createElement("select");O.style.maxWidth="260px";O.style.marginLeft="28px";"png"==I||"svg"==I?(B=function(){L.checked?O.removeAttribute("disabled"):O.setAttribute("disabled","disabled")},A=document.createElement("option"),-A.setAttribute("value","allPages"),mxUtils.write(A,mxResources.get("allPages")),O.appendChild(A),A=document.createElement("option"),A.setAttribute("value","currentPage"),mxUtils.write(A,mxResources.get("currentPage")),O.appendChild(A),1<S?(L.style.marginBottom="12px",O.style.marginBottom="16px",D.appendChild(O),mxUtils.br(D),U+=20):L.style.marginBottom="16px",null!=this.lastEmbedInclude&&(O.value=this.lastEmbedInclude),mxEvent.addListener(L,"change",B),B()):L.style.marginBottom="16px";var Q=document.createElement("input");-Q.style.marginBottom="16px";Q.style.marginRight="8px";Q.setAttribute("type","checkbox");Q.id="geCheckbox-"+Editor.guid();var T=document.createElement("input");T.style.marginBottom="16px";T.style.marginRight="8px";T.setAttribute("type","checkbox");T.id="geCheckbox-"+Editor.guid();g&&(Q.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,D.appendChild(Q),B=document.createElement("label"),mxUtils.write(B,mxResources.get("embedImages")),B.setAttribute("for",Q.id),D.appendChild(B),mxUtils.br(D),-T.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,D.appendChild(T),B=document.createElement("label"),mxUtils.write(B,mxResources.get("embedFonts")),B.setAttribute("for",T.id),D.appendChild(B),mxUtils.br(D),U+=50);var V=document.createElement("select");V.style.maxWidth="260px";V.style.marginLeft="8px";A=document.createElement("option");A.setAttribute("value","auto");mxUtils.write(A,mxResources.get("automatic"));V.appendChild(A);B=document.createElement("option");B.setAttribute("value","blank");-mxUtils.write(B,mxResources.get("openInNewWindow"));V.appendChild(B);B=document.createElement("option");B.setAttribute("value","self");mxUtils.write(B,mxResources.get("openInThisWindow"));V.appendChild(B);B=document.createElement("div");mxUtils.write(B,mxResources.get("LinksLost"));B.style.margin="7px";B.style.display="none";"svg"==I&&(mxUtils.write(D,mxResources.get("links")+":"),D.appendChild(V),D.appendChild(B),mxUtils.br(D),mxUtils.br(D),U+=50);l=new CustomDialog(this,D,mxUtils.bind(this,function(){this.lastExportBorder=-v.value;this.lastExportZoom=P.value;this.lastEmbedImages=Q.checked;this.lastEmbedFonts=T.checked;this.lastEmbedInclude=O.value;x(P.value,m.checked,!y.checked,C.checked,L.checked,Q.checked&&g,v.value,M.checked,("png"==I||"svg"==I)&&"currentPage"==O.value,V.value,null!=N?N.checked:null,null!=t?t.value:null,J.value,T.checked)}),null,l,n);this.showDialog(l.container,340,U,!0,!0,null,null,null,null,!0);P.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?P.select():document.execCommand("selectAll",-!1,null)};EditorUi.prototype.showEmbedImageDialog=function(d,g,l,n,x){var A=document.createElement("div");A.style.whiteSpace="nowrap";var B=this.editor.graph;if(null!=g){var I=document.createElement("h3");mxUtils.write(I,g);I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";A.appendChild(I)}var H=this.addCheckbox(A,mxResources.get("fit"),!0),D=this.addCheckbox(A,mxResources.get("shadow"),B.shadowVisible&&n,!n),S=this.addCheckbox(A,l),U=this.addCheckbox(A,mxResources.get("lightbox"),-!0),R=this.addEditButton(A,U),P=R.getEditInput(),v=1<B.model.getChildCount(B.model.getRoot()),y=this.addCheckbox(A,mxResources.get("layers"),v,!v);y.style.marginLeft=P.style.marginLeft;y.style.marginBottom="12px";y.style.marginTop="8px";mxEvent.addListener(U,"change",function(){U.checked?(v&&y.removeAttribute("disabled"),P.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"));P.checked&&U.checked?R.getEditSelect().removeAttribute("disabled"):R.getEditSelect().setAttribute("disabled",-"disabled")});g=new CustomDialog(this,A,mxUtils.bind(this,function(){d(H.checked,D.checked,S.checked,U.checked,R.getLink(),y.checked)}),null,mxResources.get("embed"),x);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(d,g,l,n,x,A,B,I){function H(P){var v=" ",y="";n&&(v=" 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!=S?"&page="+S:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+"');}})(this);\"",y+="cursor:pointer;");d&&(y+="max-width:100%;");var M="";l&&(M=' width="'+Math.round(D.width)+'" height="'+Math.round(D.height)+'"');B('<img src="'+P+'"'+M+(""!=y?' style="'+y+'"':"")+v+"/>")}var D=this.editor.graph.getGraphBounds(),S=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(P){var v=n?this.getFileData(!0):-null;P=this.createImageDataUri(P,v,"png");H(P)}),null,null,null,mxUtils.bind(this,function(P){I({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),D.width*D.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var U="";l&&(U="&w="+Math.round(2*D.width)+"&h="+Math.round(2*D.height));var R=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+U+"&xml="+encodeURIComponent(g));R.send(mxUtils.bind(this,function(){200<=-R.getStatus()&&299>=R.getStatus()?H("data:image/png;base64,"+R.getText()):I({message:mxResources.get("unknownError")})}))}else I({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(d,g,l,n,x,A,B){var I=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),H=I.getElementsByTagName("a");if(null!=H)for(var D=0;D<H.length;D++){var S=H[D].getAttribute("href");null!=S&&"#"==S.charAt(0)&&"_blank"==H[D].getAttribute("target")&&H[D].removeAttribute("target")}n&&-I.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(I);if(l){var U=" ",R="";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"+(x?"&edit=_blank":"")+(A?"&layers=1":-"")+"');}})(this);\"",R+="cursor:pointer;");d&&(R+="max-width:100%;");this.editor.convertImages(I,mxUtils.bind(this,function(P){B('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(P))+'"'+(""!=R?' style="'+R+'"':"")+U+"/>")}))}else R="",n&&(g=this.getSelectedPageIndex(),I.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('"++this.showDialog(d.container,620,460,!0,!0,null,null,null,null,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(d,g,l,n,x,A){"text/xml"!=l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=A?A:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)d=n?this.base64ToBlob(d,l):new Blob([d],{type:l}),navigator.msSaveOrOpenBlob(d,g);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==+l?mxUtils.popup(d,!0):(l.document.write(d),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",d):this.openInNewWindow(d,l,n);else{var B=document.createElement("a");A=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof B.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var I=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);+A=65==(I?parseInt(I[2],10):!1)?!1:A}if(A||this.isOffline()){B.href=URL.createObjectURL(n?this.base64ToBlob(d,l):new Blob([d],{type:l}));A?B.download=g:B.setAttribute("target","_blank");document.body.appendChild(B);try{window.setTimeout(function(){URL.revokeObjectURL(B.href)},2E4),B.click(),B.parentNode.removeChild(B)}catch(H){}}else this.createEchoRequest(d,g,l,n,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(d,g,l,n,x,A){d="xml="+encodeURIComponent(d);return new mxXmlRequest(SAVE_URL,+d+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=A?"&base64="+A:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(d,g,l,n,x,A,B,I,H){A=null!=A?A:!1;B=null!=B?B:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var D=mxUtils.bind(this,function(U,R,P,v){try{if("_blank"==R)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(d,l,n);else if(null!=l&&"text/html"==l.substring(0,9)){var y=new EmbedDialog(this,d);this.showDialog(y.container,+450,240,!0,!0);y.init()}else{var M=window.open("about:blank");null==M?mxUtils.popup(d,!0):(M.document.write("<pre>"+mxUtils.htmlEntities(d,!1)+"</pre>"),M.document.close())}else if(R==App.MODE_DEVICE||"download"==R)this.doSaveLocalFile(d,U,l,n,null,I);else if(null!=U&&0<U.length){var J=mxUtils.bind(this,function(K){try{this.exportFile(d,U,l,n,R,K)}catch(m){this.handleError(m)}});null!=v?J(v):this.pickFolder(R,J)}}catch(K){this.handleError(K)}});x=[];A||x.push(App.MODE_BROWSER);B||x.push("_blank");+var S=new SaveDialog(this,g,mxUtils.bind(this,function(U,R,P){D(U.value,R,U,P);this.hideDialog(null,null,S.container)}),x,d,l,n,H);this.showDialog(S.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));S.init()};EditorUi.prototype.openInNewWindow=function(d,g,l){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(d,!0);else{var x="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var A=mxUtils.parseXml(d).documentElement.style.backgroundColor;+""!=A&&(x="background: "+A+";")}x='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+x+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||l?(A=l?d:btoa(unescape(encodeURIComponent(d))),n.document.write(x+'<img style="max-width:100%;" src="data:'+g+";base64,"+A+'"/></body></html>')):n.document.write(x+d+"</body></html>"):n.document.write(x+"<pre>"+mxUtils.htmlEntities(d,!1)+"</pre></body></html>");n.document.close()}};var c=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(d){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var g=d(mxUtils.bind(this,function(n){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 x=g.getBoundingClientRect();this.tagsDialog.style.left=x.left+"px";+this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=x.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();+g.style.display=0<n.length?"":"none"}))}c.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()){this.exportDialog=null;var l=d(mxUtils.bind(this,function(n){var x=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",x);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)x.apply(this);else{this.exportDialog=document.createElement("div");var A=l.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=A.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)++this.chromelessToolbar.offsetHeight+4+"px";A=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=A.zIndex;var B=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});B.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",x);this.editor.exportToCanvas(mxUtils.bind(this,function(I){B.stop();this.exportDialog.style.width=+"auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var H=this.createImageDataUri(I,null,"png");I=document.createElement("img");I.style.maxWidth="140px";I.style.maxHeight="140px";I.style.cursor="pointer";I.style.backgroundColor="white";I.setAttribute("title",mxResources.get("openInNewWindow"));I.setAttribute("border","0");I.setAttribute("src",H);this.exportDialog.appendChild(I);mxEvent.addListener(I,"click",mxUtils.bind(this,function(){this.openInNewWindow(H.substring(H.indexOf(",")++1),"image/png",!0);x.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(I){B.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(I)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(d,g,l,n,x,A){this.isLocalFileSave()?this.saveLocalFile(l,+d,n,x,g,A):this.saveRequest(d,g,mxUtils.bind(this,function(B,I){return this.createEchoRequest(l,B,n,x,g,I)}),l,x,n)};EditorUi.prototype.saveRequest=function(d,g,l,n,x,A,B){B=null!=B?B:!mxClient.IS_IOS||!navigator.standalone;var I=mxUtils.bind(this,function(D,S,U,R){if("_blank"==S||null!=D&&0<D.length){var P=l("_blank"==S?null:D,S==App.MODE_DEVICE||"download"==S||null==S||"_blank"==S?"0":"1");null!=P&&(S==App.MODE_DEVICE||"download"==S||"_blank"==S?P.simulate(document,"_blank"):(U=mxUtils.bind(this,+function(v){A=null!=A?A:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,D,A,!0,S,v)}catch(y){this.handleError(y)}else this.spinner.spin(document.body,mxResources.get("saving"))&&P.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=P.getStatus()&&299>=P.getStatus())try{this.exportFile(P.getText(),D,A,!0,S,v)}catch(y){this.handleError(y)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}))}),+null!=R?U(R):this.pickFolder(S,U)))}});x=[App.MODE_BROWSER];B||x.push("_blank");var H=new SaveDialog(this,d,mxUtils.bind(this,function(D,S,U){I(D.value,S,D,U);this.hideDialog(null,null,H.container)}),x,null,"application/pdf");this.showDialog(H.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));H.init()};EditorUi.prototype.isServices=function(d){return 1!=d};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(d,g,+l,n,x,A){};EditorUi.prototype.getServiceForName=function(d){return null};EditorUi.prototype.getTitleForService=function(d){return mxResources.get(d)};EditorUi.prototype.pickFolder=function(d,g,l){g(null)};EditorUi.prototype.exportSvg=function(d,g,l,n,x,A,B,I,H,D,S,U,R,P){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(W){Editor.addRetryToError(W,mxUtils.bind(this,function(){this.exportSvg(d,g,l,n,x,A,B,I,H,D,S,U,R,P)}));this.handleError(W)})))try{var v=this.editor.graph.isSelectionEmpty();+l=null!=l?l:v;var y=g?null:this.editor.graph.background;y==mxConstants.NONE&&(y=null);null==y&&0==g&&(y=this.editor.graph.shapeBackgroundColor);var M=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var J=mxUtils.lightDarkColorSupported,K=mxUtils.preferDarkColor;if("light"==S||"dark"==S)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==S;var m=Graph.addFont,t={};Graph.addFont=function(W,Y,Z,aa){m.call(this,+W,Y,Z,t)};var C=this.editor.graph.createSvgImageExport(x),N=C.drawCellState;C.drawCellState=function(W,Y){null!=W&&Graph.processFontStyle(W.style);N.apply(this,arguments)};var L=this.editor.graph.getSvg(y,d,B,I,null,l,null,C,"blank"==D?"_blank":"self"==D?"_top":null,null,!R,S,U);mxUtils.lightDarkColorSupported=J;mxUtils.preferDarkColor=K;this.editor.graph.addForeignObjectWarning=M;n&&this.editor.graph.addSvgShadow(L);var O=this.getBaseFilename()+(x?".drawio":"")+".svg";P=null!=P?P:mxUtils.bind(this,+function(W){this.isLocalFileSave()||W.length<=MAX_REQUEST_SIZE?this.saveData(O,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(W)}))});var Q=mxUtils.bind(this,function(W){this.spinner.stop();x&&W.setAttribute("content",this.getFileData(!0,null,null,null,l,H,null,null,null,null,null,d,B));P(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(W))});this.editor.graph.mathEnabled&&+this.editor.addMathCss(L);var T=mxUtils.bind(this,function(W){Editor.replaceSvgDataUris&&A&&EditorUi.embedSvgImages(W);Editor.foreignObjectImages&&R?this.replaceAlternateContent(W,S,Q):Q(W)}),V=Graph.customFontElements;Graph.customFontElements=t;var X=mxUtils.bind(this,function(W){Graph.customFontElements=V;Graph.addFont=m;A&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(W,T,this.thumbImageCache)):T(W)});R?this.embedFonts(L,+X):(this.editor.addFontCss(L),X(L))}catch(W){this.handleError(W)}};EditorUi.prototype.replaceAlternateContent=function(d,g,l){function n(U,R,P,v,y){var M=mxUtils.createElementNs(d.ownerDocument,mxConstants.NS_SVG,"image");M.setAttribute("x",R);M.setAttribute("y",P+.5);M.setAttribute("width",v.width);M.setAttribute("height",v.height);null==M.setAttributeNS?M.setAttribute("xlink:href",y):M.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",y);U.replaceChild(M,U.lastChild);I()}function x(){if(B<S.length)S[B++](x)}+var A="";g=d.getElementsByTagName("style");for(var B=0;B<g.length;B++)A+=g[B].innerHTML;g=d.getElementsByTagName("switch");counter=g.length;var I=mxUtils.bind(this,function(){counter--;0==counter&&l(d)}),H={},D={},S=[];for(B=0;B<g.length;B++)mxUtils.bind(this,function(U){var R=U.getElementsByTagName("div");if(0<R.length)try{var P=R[0].cloneNode(!0),v=parseInt(P.style.marginLeft),y=parseInt(P.style.paddingTop),M=P.getElementsByTagName("div")[1],J=R=!1,K=P.style.alignItems,m=P.style.justifyContent;+if(null!=P.style.writingMode){var t=P.style.writingMode;J="vertical-"==t.substring(0,9);R="-rl"==t.substring(t.length-3)}var C=!J&&"1px"==P.style.width||J&&"1px"==P.style.height;if(!J&&"1px"==P.style.height||J&&"1px"==P.style.width)P.style.alignItems=J&&R?"unsafe flex-end":"unsafe flex-start";C&&(P.style.justifyContent="unsafe flex-start");P.style.paddingTop="";P.style.marginLeft="";var N=P.outerHTML,L=H[N];null==L&&(P.style.position="absolute",P.style.visibility="hidden",document.body.appendChild(P),+t=1,t="1px"==P.style.width?M.offsetWidth:parseInt(P.style.width),C=1,C="1px"==P.style.height?M.offsetHeight:parseInt(P.style.height),document.body.removeChild(P),L=new mxRectangle(v,y,t,C),H[N]=L);"1px"==P.style.height&&("unsafe center"==K?y-=L.height/2:"unsafe flex-end"==K&&(y-=L.height));if("1px"==P.style.width)if(!J&&"unsafe center"==m||J&&"unsafe center"==K)v-=L.width/2;else if(!J&&"unsafe flex-end"==m||J&&(!R&&"unsafe flex-end"==K||R&&"unsafe flex-start"==K))v-=L.width;L=new mxRectangle(v,y,+L.width,L.height+parseInt(M.style.fontSize)/4);S.push(mxUtils.bind(this,function(O){var Q=D[N];null==Q?Graph.htmlToPng(N,L.width,L.height,mxUtils.bind(this,function(T){n(U,v,y,L,T);D[N]=T;O()}),A):(n(U,v,y,L,Q),O())}))}catch(O){I()}else I()})(g[B]);0==counter&&l(d);B=0;x()};EditorUi.prototype.addRadiobox=function(d,g,l,n,x,A,B){return this.addCheckbox(d,l,n,x,A,B,!0,g)};EditorUi.prototype.addCheckbox=function(d,g,l,n,x,A,B,I){A=null!=A?A:!0;var H=document.createElement("input");H.style.marginRight=+"8px";H.style.marginTop="16px";H.setAttribute("type",B?"radio":"checkbox");B="geCheckbox-"+Editor.guid();H.id=B;null!=I&&H.setAttribute("name",I);l&&(H.setAttribute("checked","checked"),H.defaultChecked=!0);n&&H.setAttribute("disabled","disabled");A&&(d.appendChild(H),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",B),d.appendChild(l),x||mxUtils.br(d));return H};EditorUi.prototype.addEditButton=function(d,g){var l=this.addCheckbox(d,mxResources.get("edit")+":",!0,null,!0);+l.style.marginLeft="24px";var n=this.getCurrentFile(),x="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(x=window.location.href);var A=document.createElement("select");A.style.maxWidth="200px";A.style.width="auto";A.style.marginLeft="8px";A.style.marginRight="10px";A.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));A.appendChild(n);var B=document.createElement("option");B.setAttribute("value",+"custom");mxUtils.write(B,mxResources.get("custom")+"...");A.appendChild(B);d.appendChild(A);mxEvent.addListener(A,"change",mxUtils.bind(this,function(){if("custom"==A.value){var I=new FilenameDialog(this,x,mxResources.get("ok"),function(H){null!=H?(x=H,B.setAttribute("title",H)):(A.value="blank",B.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){A.value="blank"});this.showDialog(I.container,300,80,!0,!1);I.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,+function(){l.checked&&(null==g||g.checked)?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")}));mxUtils.br(d);return{getLink:function(){return l.checked?"blank"===A.value?"_blank":x:null},getEditInput:function(){return l},getEditSelect:function(){return A}}};EditorUi.prototype.addLinkSection=function(d,g){function l(){var I=document.createElement("div");I.style.width="100%";I.style.height="100%";I.style.boxSizing="border-box";null!=A&&A!=mxConstants.NONE?(I.style.border="1px solid black",+I.style.backgroundColor=A):(I.style.backgroundPosition="center center",I.style.backgroundRepeat="no-repeat",I.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");B.innerText="";B.appendChild(I)}mxUtils.write(d,mxResources.get("links")+":");var n=document.createElement("select");n.style.width="100px";n.style.padding="0px";n.style.marginLeft="8px";n.style.marginRight="10px";n.className="geBtn";var x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));+n.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));n.appendChild(x);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));d.appendChild(n);mxUtils.write(d,mxResources.get("borderColor")++":");var A="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(I){this.pickColor(A||"none",function(H){A=H;l()});mxEvent.consume(I)}));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=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";B.className="geColorBtn";d.appendChild(B);mxUtils.br(d);return{getColor:function(){return A},getTarget:function(){return n.value},+focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(d,g,l,n,x,A){A=null!=A?A:[];l&&(A.push("lightbox=1"),"auto"!=d&&A.push("target="+d),null!=g&&g!=mxConstants.NONE&&A.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=n&&0<n.length&&A.push("edit="+encodeURIComponent(n)),x&&A.push("layers=1"),this.editor.graph.foldingEnabled&&A.push("nav=1"));return A};EditorUi.prototype.createLink=function(d,g,l,n,x,A,B,I,H,D,S,U,R){var P=this.getCurrentFile();H=this.createUrlParameters(d,+g,n,x,A,H);d=!0;null!=B?l="#U"+encodeURIComponent(B):I||null==P||""==P.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="#"+P.getHash(),d=!1);d&&null!=P&&null!=P.getTitle()&&P.getTitle()!=this.defaultFilename&&H.push("title="+encodeURIComponent(P.getTitle()));D&&1<l.length&&(H.push("open="+l.substring(1)),l="");S&&null!=this.currentPage&&H.push("page-id="+this.currentPage.getId());U&&H.push("transparent=1");+null!=R&&H.push("dark="+R);return(n&&(null!=B||null!=P&&P.getMode()!=App.MODE_GITHUB&&P.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<H.length?"?"+H.join("&"):"")+l};EditorUi.prototype.createHtml=function(d,g,l,n,x,A,B,I,H,D,S,U,R){this.getBasenames();var P={};""!=x&&x!=mxConstants.NONE&&(P.highlight=x);"auto"!==n&&(P.target=n);D||(P.lightbox=+!1);P.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(P.zoom=l/100);l=[];B&&(l.push("pages"),P.resize=!0,null!=this.pages&&null!=this.currentPage&&(P.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),P.resize=!0);I&&l.push("layers");H&&l.push("tags");null!=R&&(P["dark-mode"]=R);0<l.length&&(D&&l.push("lightbox"),P.toolbar=l.join(" "));null!=S&&0<S.length&&(P.edit=S);null!=d?P.url=d:P.xml=this.getFileData(!0,null,null,null,null,!B);g='<div class="mxgraph" style="'++(A?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(P))+'"></div>';d=null!=d?"&fetch="+encodeURIComponent(d):"";U(g,'<script type="text/javascript" src="'+(0<d.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+d:"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.showHtmlDialog=function(d,g,l,n){var x=document.createElement("div");x.style.whiteSpace="nowrap";var A=document.createElement("h3");mxUtils.write(A,mxResources.get("html"));A.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";x.appendChild(A);var B=document.createElement("div");B.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var I=document.createElement("input");I.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";+I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","type-embedhtmldialog");A=I.cloneNode(!0);A.setAttribute("value","copy");B.appendChild(A);var H=document.createElement("span");mxUtils.write(H,mxResources.get("includeCopyOfMyDiagram"));B.appendChild(H);mxUtils.br(B);B.appendChild(I);H=document.createElement("span");mxUtils.write(H,mxResources.get("publicDiagramUrl"));B.appendChild(H);var D=this.getCurrentFile();null==l&&null!=D&&D.constructor==window.DriveFile&&(H=+document.createElement("a"),H.style.paddingLeft="12px",H.style.color="gray",H.style.cursor="pointer",mxUtils.write(H,mxResources.get("share")),B.appendChild(H),mxEvent.addListener(H,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(D.getId(),D)})));A.setAttribute("checked","checked");null==l&&I.setAttribute("disabled","disabled");x.appendChild(B);B=380;var S=this.addLinkSection(x),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";+U.style.marginTop="16px";H=document.createElement("option");H.setAttribute("value","light");mxUtils.write(H,mxResources.get("light"));U.appendChild(H);H=document.createElement("option");H.setAttribute("value","dark");mxUtils.write(H,mxResources.get("dark"));U.appendChild(H);H=document.createElement("option");H.setAttribute("value","auto");mxUtils.write(H,mxResources.get("automatic"));H.setAttribute("selected","selected");U.appendChild(H);H.setAttribute("selected","selected");mxUtils.write(x,mxResources.get("appearance")++":");x.appendChild(U);mxUtils.br(x);B+=26;var R=this.addCheckbox(x,mxResources.get("zoom"),!0,null,!0);mxUtils.write(x,":");var P=document.createElement("input");P.setAttribute("type","text");P.style.marginRight="16px";P.style.width="60px";P.style.marginLeft="4px";P.style.marginRight="12px";P.value="100%";x.appendChild(P);var v=this.addCheckbox(x,mxResources.get("fit"),!0);H=null!=this.pages&&1<this.pages.length;var y=y=this.addCheckbox(x,mxResources.get("allPages"),H,!H),M=this.addCheckbox(x,mxResources.get("layers"),+!0),J=this.addCheckbox(x,mxResources.get("tags"),!0),K=this.addCheckbox(x,mxResources.get("lightbox"),!0),m=null;if(EditorUi.enableHtmlEditOption){m=this.addEditButton(x,K);var t=m.getEditInput();t.style.marginBottom="16px";B+=50;mxEvent.addListener(K,"change",function(){K.checked?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled");t.checked&&K.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")})}d=new CustomDialog(this,x,mxUtils.bind(this,+function(){n(I.checked?l:null,R.checked,P.value,S.getTarget(),S.getColor(),v.checked,y.checked,M.checked,J.checked,K.checked,null!=m?m.getLink():null,null!=U?U.value:null)}),null,d,g);this.showDialog(d.container,340,B,!0,!0);A.focus()};EditorUi.prototype.showPublishLinkDialog=function(d,g,l,n,x,A,B,I,H,D,S,U){var R=document.createElement("div");R.style.whiteSpace="nowrap";var P=document.createElement("h3");mxUtils.write(P,d||mxResources.get("publish"));P.style.width="100%";P.style.textAlign="center";+P.style.marginTop="2px";P.style.marginBottom="20px";R.appendChild(P);var v=document.createElement("select");d=30;v.className="geBtn";v.style.marginBottom="8px";v.style.marginLeft="0px";v.style.width="100%";v.style.boxSizing="border-box";if(null==I||""==I.getHash())x=null!=x?x:"https://www.drawio.com/doc/faq/publish-diagram-as-link",P=document.createElement("option"),mxUtils.write(P,mxResources.get("makeCopy")),P.setAttribute("value","copy"),v.appendChild(P);P=document.createElement("option");mxUtils.write(P,+mxResources.get("authorizationRequired"));P.setAttribute("value","auth");v.appendChild(P);null!=I&&""!=I.getHash()||P.setAttribute("disabled","disabled");I=document.createElement("option");I.setAttribute("value","public");v.appendChild(I);null!=B?(mxUtils.write(I,mxResources.get("publicDiagramUrl")),I.setAttribute("title",B),v.value="public"):(mxUtils.write(I,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),I.setAttribute("disabled","disabled"));R.appendChild(v);+mxUtils.br(R);v.focus();var y=null,M=null;if(null!=g||null!=l)d+=30,mxUtils.write(R,mxResources.get("width")+":"),y=document.createElement("input"),y.setAttribute("type","text"),y.style.marginRight="16px",y.style.width="50px",y.style.marginLeft="6px",y.style.marginRight="16px",y.style.marginBottom="10px",y.value="100%",R.appendChild(y),mxUtils.write(R,mxResources.get("height")+":"),M=document.createElement("input"),M.setAttribute("type","text"),M.style.width="50px",M.style.marginLeft="6px",M.style.marginBottom=+"10px",M.value=l+"px",R.appendChild(M),mxUtils.br(R);var J=this.addLinkSection(R,n),K=D?this.addCheckbox(R,mxResources.get("transparentBackground"),!1):null;null!=K&&(d+=20);var m=document.createElement("select");m.className="geBtn";m.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");m.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");+m.appendChild(g);var t=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(d+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),U&&(mxUtils.write(R,mxResources.get("pages")+":"),R.appendChild(m),mxUtils.br(R),d+=30),t=this.addCheckbox(R,mxResources.get("selectedPage")+": "+g));var C=document.createElement("select");C.style.maxWidth="260px";C.style.marginLeft="8px";C.style.marginTop="16px";U=document.createElement("option");+U.setAttribute("value","0");mxUtils.write(U,mxResources.get("light"));C.appendChild(U);U=document.createElement("option");U.setAttribute("value","1");mxUtils.write(U,mxResources.get("dark"));C.appendChild(U);U=document.createElement("option");U.setAttribute("value","auto");mxUtils.write(U,mxResources.get("automatic"));U.setAttribute("selected","selected");C.appendChild(U);S&&(mxUtils.write(R,mxResources.get("appearance")+":"),R.appendChild(C),mxUtils.br(R),d+=30);var N=this.addCheckbox(R,mxResources.get("lightbox"),+!0,null,null,!n),L=this.addEditButton(R,N),O=L.getEditInput();n&&(O.style.marginLeft=N.style.marginLeft,N.style.display="none",d-=20);var Q=this.addCheckbox(R,mxResources.get("layers"),!0);Q.style.marginLeft=O.style.marginLeft;Q.style.marginTop="8px";var T=this.addCheckbox(R,mxResources.get("tags"),!0);T.style.marginLeft=O.style.marginLeft;T.style.marginBottom="16px";T.style.marginTop="16px";mxEvent.addListener(N,"change",function(){N.checked?(Q.removeAttribute("disabled"),O.removeAttribute("disabled"),+T.removeAttribute("disabled")):(Q.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"));O.checked&&N.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,R,mxUtils.bind(this,function(){H(J.getTarget(),J.getColor(),null==t?!1:t.checked,N.checked,L.getLink(),Q.checked,null!=y?y.value:null,null!=M?M.value:null,T.checked,v.value,null!=K?K.checked:!1,C.value,"allPages"==+m.value)}),null,mxResources.get("create"),x,A);this.showDialog(n.container,340,296+d,!0,!0);null!=y?(y.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?y.select():document.execCommand("selectAll",!1,null)):null==v.parentNode;J.focus()};EditorUi.prototype.showRemoteExportDialog=function(d,g,l,n,x){var A=document.createElement("div");A.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxResources.get("image"));B.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"++(x?"10":"4")+"px";A.appendChild(B);if(x){mxUtils.write(A,mxResources.get("zoom")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.marginRight="16px";I.style.width="60px";I.style.marginLeft="4px";I.style.marginRight="12px";I.value=this.lastExportZoom||"100%";A.appendChild(I);mxUtils.write(A,mxResources.get("borderWidth")+":");var H=document.createElement("input");H.setAttribute("type","text");H.style.marginRight="16px";H.style.width="60px";H.style.marginLeft="4px";H.value=+this.lastExportBorder||"0";A.appendChild(H);mxUtils.br(A)}var D=this.addCheckbox(A,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),S=n?null:this.addCheckbox(A,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);B=this.editor.graph;var U=n?null:this.addCheckbox(A,mxResources.get("transparentBackground"),B.background==mxConstants.NONE||null==B.background);null!=U&&(U.style.marginBottom="16px");d=new CustomDialog(this,A,mxUtils.bind(this,function(){var R=+parseInt(I.value)/100||1,P=parseInt(H.value)||0;l(!D.checked,null!=S?S.checked:!1,null!=U?U.checked:!1,R,P)}),null,d,g);this.showDialog(d.container,300,(x?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(d,g,l,n,x,A,B,I,H){B=null!=B?B:Editor.defaultIncludeDiagram;var D=document.createElement("div");D.style.whiteSpace="nowrap";var S=this.editor.graph,U="jpeg"==I||"webp"==I?220:320,R=document.createElement("h3");mxUtils.write(R,d);R.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";+D.appendChild(R);mxUtils.write(D,mxResources.get("zoom")+":");var P=document.createElement("input");P.setAttribute("type","text");P.style.marginRight="16px";P.style.width="60px";P.style.marginLeft="4px";P.style.marginRight="12px";P.value=this.lastExportZoom||"100%";D.appendChild(P);mxUtils.write(D,mxResources.get("borderWidth")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.value=this.lastExportBorder||+"0";D.appendChild(v);mxUtils.br(D);var y=this.addCheckbox(D,mxResources.get("selectionOnly"),!1,S.isSelectionEmpty()),M=document.createElement("input");M.style.marginTop="16px";M.style.marginRight="8px";M.style.marginLeft="24px";M.setAttribute("disabled","disabled");M.setAttribute("type","checkbox");var J=document.createElement("select");J.style.marginTop="16px";J.style.marginLeft="8px";d=["selectionOnly","diagram","page"];for(R=0;R<d.length;R++)if(!S.isSelectionEmpty()||"selectionOnly"!=d[R]){var K=+document.createElement("option");mxUtils.write(K,mxResources.get(d[R]));K.setAttribute("value",d[R]);J.appendChild(K)}H?(mxUtils.write(D,mxResources.get("size")+":"),D.appendChild(J),mxUtils.br(D),U+=26,mxEvent.addListener(J,"change",function(){"selectionOnly"==J.value&&(y.checked=!0)})):A&&(D.appendChild(M),mxUtils.write(D,mxResources.get("crop")),mxUtils.br(D),U+=30,mxEvent.addListener(y,"change",function(){y.checked?M.removeAttribute("disabled"):M.setAttribute("disabled","disabled")}));S.isSelectionEmpty()?+H&&(y.style.display="none",y.nextSibling.style.display="none",y.nextSibling.nextSibling.style.display="none",U-=30):(J.value="diagram",M.setAttribute("checked","checked"),M.defaultChecked=!0,mxEvent.addListener(y,"change",function(){J.value=y.checked?"selectionOnly":"diagram"}));var m=this.addCheckbox(D,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=I&&"webp"!=I),t=document.createElement("select");t.style.maxWidth="260px";t.style.marginLeft="8px";t.style.marginTop="16px";A=document.createElement("option");+A.setAttribute("value","light");mxUtils.write(A,mxResources.get("light"));t.appendChild(A);H=document.createElement("option");H.setAttribute("value","dark");mxUtils.write(H,mxResources.get("dark"));t.appendChild(H);"svg"==I&&mxUtils.lightDarkColorSupported?(A=document.createElement("option"),A.setAttribute("value","auto"),mxUtils.write(A,mxResources.get("automatic")),A.setAttribute("selected","selected"),t.appendChild(A)):Editor.isDarkMode()?H.setAttribute("selected","selected"):A.setAttribute("selected",+"selected");mxUtils.write(D,mxResources.get("appearance")+":");D.appendChild(t);mxUtils.br(D);U+=26;var C=this.addCheckbox(D,mxResources.get("shadow"),S.shadowVisible),N=null;if("png"==I||"jpeg"==I||"webp"==I)N=this.addCheckbox(D,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),U+=30;S=null!=this.pages?this.pages.length:1;var L=this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram")+(1<S?":":""),B,null,null,"jpeg"!=I&&"webp"!=I),O=document.createElement("select");O.style.maxWidth=+"260px";O.style.marginLeft="28px";"png"==I||"svg"==I?(B=function(){L.checked?O.removeAttribute("disabled"):O.setAttribute("disabled","disabled")},A=document.createElement("option"),A.setAttribute("value","allPages"),mxUtils.write(A,mxResources.get("allPages")),O.appendChild(A),A=document.createElement("option"),A.setAttribute("value","currentPage"),mxUtils.write(A,mxResources.get("currentPage")),O.appendChild(A),1<S?(L.style.marginBottom="12px",O.style.marginBottom="16px",D.appendChild(O),mxUtils.br(D),+U+=20):L.style.marginBottom="16px",null!=this.lastEmbedInclude&&(O.value=this.lastEmbedInclude),mxEvent.addListener(L,"change",B),B()):L.style.marginBottom="16px";var Q=document.createElement("input");Q.style.marginBottom="16px";Q.style.marginRight="8px";Q.setAttribute("type","checkbox");Q.id="geCheckbox-"+Editor.guid();var T=document.createElement("input");T.style.marginBottom="16px";T.style.marginRight="8px";T.setAttribute("type","checkbox");T.id="geCheckbox-"+Editor.guid();g&&(Q.checked=null!=+this.lastEmbedImages?this.lastEmbedImages:!0,D.appendChild(Q),B=document.createElement("label"),mxUtils.write(B,mxResources.get("embedImages")),B.setAttribute("for",Q.id),D.appendChild(B),mxUtils.br(D),T.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,D.appendChild(T),B=document.createElement("label"),mxUtils.write(B,mxResources.get("embedFonts")),B.setAttribute("for",T.id),D.appendChild(B),mxUtils.br(D),U+=50);var V=document.createElement("select");V.style.maxWidth="260px";V.style.marginLeft=+"8px";A=document.createElement("option");A.setAttribute("value","auto");mxUtils.write(A,mxResources.get("automatic"));V.appendChild(A);B=document.createElement("option");B.setAttribute("value","blank");mxUtils.write(B,mxResources.get("openInNewWindow"));V.appendChild(B);B=document.createElement("option");B.setAttribute("value","self");mxUtils.write(B,mxResources.get("openInThisWindow"));V.appendChild(B);B=document.createElement("div");mxUtils.write(B,mxResources.get("LinksLost"));B.style.margin="7px";+B.style.display="none";"svg"==I&&(mxUtils.write(D,mxResources.get("links")+":"),D.appendChild(V),D.appendChild(B),mxUtils.br(D),mxUtils.br(D),U+=50);l=new CustomDialog(this,D,mxUtils.bind(this,function(){this.lastExportBorder=v.value;this.lastExportZoom=P.value;this.lastEmbedImages=Q.checked;this.lastEmbedFonts=T.checked;this.lastEmbedInclude=O.value;x(P.value,m.checked,!y.checked,C.checked,L.checked,Q.checked&&g,v.value,M.checked,("png"==I||"svg"==I)&&"currentPage"==O.value,V.value,null!=N?N.checked:+null,null!=t?t.value:null,J.value,T.checked)}),null,l,n);this.showDialog(l.container,340,U,!0,!0,null,null,null,null,!0);P.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?P.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(d,g,l,n,x){var A=document.createElement("div");A.style.whiteSpace="nowrap";var B=this.editor.graph;if(null!=g){var I=document.createElement("h3");mxUtils.write(I,g);I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";+A.appendChild(I)}var H=this.addCheckbox(A,mxResources.get("fit"),!0),D=this.addCheckbox(A,mxResources.get("shadow"),B.shadowVisible&&n,!n),S=this.addCheckbox(A,l),U=this.addCheckbox(A,mxResources.get("lightbox"),!0),R=this.addEditButton(A,U),P=R.getEditInput(),v=1<B.model.getChildCount(B.model.getRoot()),y=this.addCheckbox(A,mxResources.get("layers"),v,!v);y.style.marginLeft=P.style.marginLeft;y.style.marginBottom="12px";y.style.marginTop="8px";mxEvent.addListener(U,"change",function(){U.checked?+(v&&y.removeAttribute("disabled"),P.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"));P.checked&&U.checked?R.getEditSelect().removeAttribute("disabled"):R.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,A,mxUtils.bind(this,function(){d(H.checked,D.checked,S.checked,U.checked,R.getLink(),y.checked)}),null,mxResources.get("embed"),x);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=+function(d,g,l,n,x,A,B,I){function H(P){var v=" ",y="";n&&(v=" 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!=S?"&page="+S:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+"');}})(this);\"",y+=+"cursor:pointer;");d&&(y+="max-width:100%;");var M="";l&&(M=' width="'+Math.round(D.width)+'" height="'+Math.round(D.height)+'"');B('<img src="'+P+'"'+M+(""!=y?' style="'+y+'"':"")+v+"/>")}var D=this.editor.graph.getGraphBounds(),S=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(P){var v=n?this.getFileData(!0):null;P=this.createImageDataUri(P,v,"png");H(P)}),null,null,null,mxUtils.bind(this,function(P){I({message:mxResources.get("unknownError")})}),+null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),D.width*D.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var U="";l&&(U="&w="+Math.round(2*D.width)+"&h="+Math.round(2*D.height));var R=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+U+"&xml="+encodeURIComponent(g));R.send(mxUtils.bind(this,function(){200<=R.getStatus()&&299>=R.getStatus()?H("data:image/png;base64,"+R.getText()):I({message:mxResources.get("unknownError")})}))}else I({message:mxResources.get("drawingTooLarge")})};+EditorUi.prototype.createEmbedSvg=function(d,g,l,n,x,A,B){var I=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),H=I.getElementsByTagName("a");if(null!=H)for(var D=0;D<H.length;D++){var S=H[D].getAttribute("href");null!=S&&"#"==S.charAt(0)&&"_blank"==H[D].getAttribute("target")&&H[D].removeAttribute("target")}n&&I.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(I);if(l){var U=" ",R="";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"+(x?"&edit=_blank":"")+(A?"&layers=1":"")+"');}})(this);\"",R+="cursor:pointer;");d&&(R+="max-width:100%;");this.editor.convertImages(I,mxUtils.bind(this,function(P){B('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(P))+'"'+(""!=R?' style="'+R+'"':"")+U+"/>")}))}else R="",n&&(g=this.getSelectedPageIndex(),I.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"+(null!=g?"&page="+g:"")+(x?"&edit=_blank":"")+(A?"&layers=1":"")+"');}}})(this);"),R+="cursor:pointer;"),d&&(d=parseInt(I.getAttribute("width")),x=parseInt(I.getAttribute("height")),I.setAttribute("viewBox","-0.5 -0.5 "+d+" "+x),R+="max-width:100%;max-height:"+x+"px;",I.removeAttribute("height")),""!=R&&I.setAttribute("style",R),this.editor.addFontCss(I),this.editor.graph.mathEnabled&&this.editor.addMathCss(I),B(mxUtils.getXml(I))};EditorUi.prototype.timeSince=function(d){d=Math.floor((new Date-d)/1E3);var g=Math.floor(d/31536E3);if(1<g)return g+" "+mxResources.get("years");g=Math.floor(d/2592E3);if(1<g)return g+" "+mxResources.get("months");g=Math.floor(d/86400);if(1<g)return g+" "+mxResources.get("days");g=Math.floor(d/3600);if(1<g)return g+" "+mxResources.get("hours");g=Math.floor(d/60);return 1<g?g+" "+mxResources.get("minutes"):1==g?g+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(d,g){if(null!=d){var l=null;if("diagram"==d.nodeName)l=d;else if("mxfile"==d.nodeName){var n=d.getElementsByTagName("diagram");if(0<n.length){l=n[0];var x=g.getGlobalVariable;g.getGlobalVariable=function(A){return"page"==A?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==A?1:x.apply(this,arguments)}}}null!=l&&(d=Editor.parseDiagramNode(l))}n=this.editor.graph;try{this.editor.graph=g,this.editor.setGraphXml(d)}catch(A){}finally{this.editor.graph=n}return d};EditorUi.prototype.getSvgFileProperties=function(d){return this.getPngFileProperties(d)};diff --git a/src/main/webapp/js/diagramly/Dialogs.js b/src/main/webapp/js/diagramly/Dialogs.jsindex f62e58416..3435b9d13 100644--- a/src/main/webapp/js/diagramly/Dialogs.js+++ b/src/main/webapp/js/diagramly/Dialogs.js@@ -795,13 +795,13 @@ var EmbedDialog = function(editorUi, result, timeout, ignoreSize, previewFn, tit}var downloadBtn = mxUtils.button(mxResources.get('export'), function()- {- editorUi.hideDialog();- editorUi.saveData((filename != null) ? filename : 'embed.txt', 'txt', result, 'text/plain');- });-- downloadBtn.className = 'geBtn';- buttons.appendChild(downloadBtn);+ {+ editorUi.hideDialog();+ editorUi.saveData((filename != null) ? filename : 'embed.txt', 'txt', result, 'text/plain');+ });++ downloadBtn.className = 'geBtn';+ buttons.appendChild(downloadBtn);if (!editorUi.isOffline() && result.length < maxSize){diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.jsindex 0e1265e81..9937ce45b 100644--- a/src/main/webapp/js/diagramly/EditorUi.js+++ b/src/main/webapp/js/diagramly/EditorUi.js@@ -1454,9 +1454,7 @@// Writes the file as an embedded HTML fileif (!forceSvg && !forceXml && (forceHtml || (file != null && /(\.html)$/i.test(file.getTitle())))){- xml = this.getHtml2(mxUtils.getXml(fileNode), graph, (file != null) ? file.getTitle() : null,- editLink, redirect, redirect == null && !EditorUi.isElectronApp &&- this.getServiceName() == 'draw.io');+ xml = this.getHtml2(mxUtils.getXml(fileNode), graph, (file != null) ? file.getTitle() : null, editLink, redirect);}// Maps the XML data to the content attribute in the SVG nodeelse if (forceSvg || (!forceXml && file != null && /(\.svg)$/i.test(file.getTitle())))@@ -2018,23 +2016,19 @@/*** Same as above but using the new embed code.*/- EditorUi.prototype.getHtml2 = function(xml, graph, title, editLink, redirect, addEditLink)+ EditorUi.prototype.getHtml2 = function(xml, graph, title, editLink, redirect){var js = window.DRAWIO_VIEWER_URL || EditorUi.drawHost + '/js/viewer-static.min.js';- var data = {highlight: '#0000ff', nav: this.editor.graph.foldingEnabled, resize: true,- xml: Graph.zapGremlins(xml), toolbar: 'pages zoom layers lightbox'};-+// Makes XHTML compatibleif (redirect != null){redirect = redirect.replace(/&/g, '&');}- else if (addEditLink)- {- data.editor = window.DRAWIO_BASE_URL;- data.toolbar += ' editlocal';- }-++ var data = {highlight: '#0000ff', nav: this.editor.graph.foldingEnabled, resize: true,+ xml: Graph.zapGremlins(xml), toolbar: 'pages zoom layers lightbox'};+if (this.pages != null && this.currentPage != null){data.page = mxUtils.indexOf(this.pages, this.currentPage);@@ -5108,6 +5102,23 @@new Blob([data], {type: mimeType})navigator.msSaveOrOpenBlob(blob, filename);}+ // Older versions of IE (binary not supported)+ else if (mxClient.IS_IE)+ {+ var win = window.open('about:blank', '_blank');++ if (win == null)+ {+ mxUtils.popup(data, true);+ }+ else+ {+ win.document.write(data);+ win.document.close();+ win.document.execCommand('SaveAs', true, filename);+ win.close();+ }+ }else if (mxClient.IS_IOS && this.isOffline()){// Workaround for "WebKitBlobResource error 1" in mobile Safaridiff --git a/src/main/webapp/js/diagramly/GraphViewer.js b/src/main/webapp/js/diagramly/GraphViewer.jsindex 9543fa767..d10f30221 100644--- a/src/main/webapp/js/diagramly/GraphViewer.js+++ b/src/main/webapp/js/diagramly/GraphViewer.js@@ -153,7 +153,6 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)this.layersEnabled = mxUtils.indexOf(this.toolbarItems, 'layers') >= 0;this.tagsEnabled = mxUtils.indexOf(this.toolbarItems, 'tags') >= 0;this.lightboxEnabled = mxUtils.indexOf(this.toolbarItems, 'lightbox') >= 0;- this.editEnabled = mxUtils.indexOf(this.toolbarItems, 'editlocal') >= 0;this.lightboxClickEnabled = this.graphConfig.lightbox != false;this.initialOverflow = document.body.style.overflow;this.initialWidth = (container != null) ? container.style.width : null;@@ -1722,24 +1721,6 @@ GraphViewer.prototype.addToolbar = function()}), Editor.fullscreenImage, (mxResources.get('fullscreen') || 'Fullscreen'));}}- else if (token == 'editlocal')- {- if (this.editEnabled && this.graphConfig.editor != null)- {- addButton(mxUtils.bind(this, function()- {- try- {- window.location.href = this.graphConfig.editor + '#R' +- encodeURIComponent(this.xml);- }- catch (e)- {- alert(e.message);- }- }), Editor.editImage, (mxResources.get('edit') || 'Edit'));- }- }else if (this.graphConfig['toolbar-buttons'] != null){var def = this.graphConfig['toolbar-buttons'][token];diff --git a/src/main/webapp/js/integrate.min.js b/src/main/webapp/js/integrate.min.jsindex 0ac0f4816..477b3f441 100644--- a/src/main/webapp/js/integrate.min.js+++ b/src/main/webapp/js/integrate.min.js@@ -68,7 +68,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:"29.2.6",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"29.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&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||@@ -12143,9 +12143,9 @@ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=funct$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;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,l,n){if(b==Array.prototype||b==Object.prototype)return b;b[l]=n.value;return b};$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 n=b[l];if(n&&n.Math==Math)return n}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 n=$jscomp.propertyToPolyfillSymbol[l];if(null==n)return b[l];n=b[n];return void 0!==n?n:b[l]};$jscomp.polyfill=function(b,l,n,d){l&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(b,l,n,d):$jscomp.polyfillUnisolated(b,l,n,d))};-$jscomp.polyfillUnisolated=function(b,l,n,d){n=$jscomp.global;b=b.split(".");for(d=0;d<b.length-1;d++){var x=b[d];if(!(x in n))return;n=n[x]}b=b[b.length-1];d=n[b];l=l(d);l!=d&&null!=l&&$jscomp.defineProperty(n,b,{configurable:!0,writable:!0,value:l})};-$jscomp.polyfillIsolated=function(b,l,n,d){var x=b.split(".");b=1===x.length;d=x[0];d=!b&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var A=0;A<x.length-1;A++){var z=x[A];if(!(z in d))return;d=d[z]}x=x[x.length-1];n=$jscomp.IS_SYMBOL_NATIVE&&"es6"===n?d[x]:null;l=l(n);null!=l&&(b?$jscomp.defineProperty($jscomp.polyfills,x,{configurable:!0,writable:!0,value:l}):l!==n&&(void 0===$jscomp.propertyToPolyfillSymbol[x]&&(n=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[x]=$jscomp.IS_SYMBOL_NATIVE?-$jscomp.global.Symbol(x):$jscomp.POLYFILL_PREFIX+n+"$"+x),$jscomp.defineProperty(d,$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(n){}return!1};+$jscomp.polyfillUnisolated=function(b,l,n,d){n=$jscomp.global;b=b.split(".");for(d=0;d<b.length-1;d++){var v=b[d];if(!(v in n))return;n=n[v]}b=b[b.length-1];d=n[b];l=l(d);l!=d&&null!=l&&$jscomp.defineProperty(n,b,{configurable:!0,writable:!0,value:l})};+$jscomp.polyfillIsolated=function(b,l,n,d){var v=b.split(".");b=1===v.length;d=v[0];d=!b&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var A=0;A<v.length-1;A++){var z=v[A];if(!(z in d))return;d=d[z]}v=v[v.length-1];n=$jscomp.IS_SYMBOL_NATIVE&&"es6"===n?d[v]:null;l=l(n);null!=l&&(b?$jscomp.defineProperty($jscomp.polyfills,v,{configurable:!0,writable:!0,value:l}):l!==n&&(void 0===$jscomp.propertyToPolyfillSymbol[v]&&(n=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[v]=$jscomp.IS_SYMBOL_NATIVE?+$jscomp.global.Symbol(v):$jscomp.POLYFILL_PREFIX+n+"$"+v),$jscomp.defineProperty(d,$jscomp.propertyToPolyfillSymbol[v],{configurable:!0,writable:!0,value:l})))};$jscomp.underscoreProtoCanBeSet=function(){var b={a:!0},l={};try{return l.__proto__=b,l.a}catch(n){}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};$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(b){this.yieldResult=b};$jscomp.generator.Context.prototype.throw_=function(b){this.abruptCompletion_={exception:b,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.return=function(b){this.abruptCompletion_={return:b};this.nextAddress=this.finallyAddress_};@@ -12157,45 +12157,45 @@ $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(n){return{value:n,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,n){try{var d=b.call(this.context_.yieldAllIterator_,l);$jscomp.generator.ensureIteratorResultIsObject_(d);if(!d.done)return this.context_.stop_(),d;var x=d.value}catch(A){return this.context_.yieldAllIterator_=null,this.context_.throw_(A),this.nextStep_()}this.context_.yieldAllIterator_=null;n.call(this.context_,x);return this.nextStep_()};+$jscomp.generator.Engine_.prototype.yieldAllStep_=function(b,l,n){try{var d=b.call(this.context_.yieldAllIterator_,l);$jscomp.generator.ensureIteratorResultIsObject_(d);if(!d.done)return this.context_.stop_(),d;var v=d.value}catch(A){return this.context_.yieldAllIterator_=null,this.context_.throw_(A),this.nextStep_()}this.context_.yieldAllIterator_=null;n.call(this.context_,v);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(d){return b.next(d)}function n(d){return b.throw(d)}return new Promise(function(d,x){function A(z){z.done?d(z.value):Promise.resolve(z.value).then(l,n).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)))};+$jscomp.asyncExecutePromiseGenerator=function(b){function l(d){return b.next(d)}function n(d){return b.throw(d)}return new Promise(function(d,v){function A(z){z.done?d(z.value):Promise.resolve(z.value).then(l,n).then(A,v)}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(){null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData));return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b){this.shadowPages=b};-DrawioFile.prototype.synchronizeFile=function(b,l){if(this.savingFile)null!=l&&l({message:mxResources.get("busy")});else{var n=!0,d=window.setTimeout(mxUtils.bind(this,function(){n=!1;null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,l)})})}),this.ui.timeout),x=mxUtils.bind(this,function(z){n&&(window.clearTimeout(d),null!=l&&l(z))}),A=mxUtils.bind(this,function(){return!n});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,-function(z){n&&(window.clearTimeout(d),this.sync.cleanup(b,l,z))}),x,A):this.updateFile(mxUtils.bind(this,function(){n&&(window.clearTimeout(d),null!=b&&b())}),x,A)}};-DrawioFile.prototype.updateFile=function(b,l,n,d,x){null!=n&&n()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",x,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=l&&l():this.getLatestVersion(mxUtils.bind(this,function(A){try{null!=n&&n()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[A]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=l&&l():null!=A?this.mergeFile(A,b,l,-d,x):this.reloadFile(b,l))}catch(z){null!=l&&l(z)}}),l))};-DrawioFile.prototype.mergeFile=function(b,l,n,d,x){try{var A=b.getShadowPages();if(null!=A&&0<A.length){var z=this.getShadowPages(),D=[this.ui.diffPages(null!=d?d:z,A)],P=this.ignorePatches(D);if(P)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",P),null!=l&&l();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var J=this.isModified()?this.ui.diffPages(z,-this.isRealtime()?this.ownPages:this.ui.pages):null,L=this.ui.patchPages(this.ui.clonePages(z),D[0]),c=this.ui.getHashValueForPages(L,{}),f=this.ui.getHashValueForPages(A,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",z,"pages",A,"patched",L,"patches",D,"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(n,D,null,null,"mergeFile",-c,f,b.getCurrentRevisionId());else{this.setShadowPages(A);if(null!=this.sync){var k=this.sync.patchRealtime(D,DrawioFile.LAST_WRITE_WINS?J:null,null,x);null==k||mxUtils.isEmptyObject(k)||D.push(k)}this.patch(D,DrawioFile.LAST_WRITE_WINS?J:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=l&&l()}}catch(v){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=n&&n(v);try{var m=this.getCurrentUser(),t=null!=m?-m.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),t,v)}catch(y){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(v){null!=n&&n(v)}};-DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var l=new mxCodec(mxUtils.createXmlDocument()),n=l.document.createElement("mxfile");if(null!=b)for(var d=0;d<b.length;d++){var x=l.encode(new mxGraphModel(b[d].root));"1"!=urlParams.dev&&(x=this.ui.anonymizeNode(x,!0));x.setAttribute("id",b[d].getId());b[d].viewState&&this.ui.editor.graph.saveViewState(b[d].viewState,x,!0);n.appendChild(x)}return mxUtils.getPrettyXml(n)};+DrawioFile.prototype.synchronizeFile=function(b,l){if(this.savingFile)null!=l&&l({message:mxResources.get("busy")});else{var n=!0,d=window.setTimeout(mxUtils.bind(this,function(){n=!1;null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,l)})})}),this.ui.timeout),v=mxUtils.bind(this,function(z){n&&(window.clearTimeout(d),null!=l&&l(z))}),A=mxUtils.bind(this,function(){return!n});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,+function(z){n&&(window.clearTimeout(d),this.sync.cleanup(b,l,z))}),v,A):this.updateFile(mxUtils.bind(this,function(){n&&(window.clearTimeout(d),null!=b&&b())}),v,A)}};+DrawioFile.prototype.updateFile=function(b,l,n,d,v){null!=n&&n()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=l&&l():this.getLatestVersion(mxUtils.bind(this,function(A){try{null!=n&&n()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[A]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=l&&l():null!=A?this.mergeFile(A,b,l,+d,v):this.reloadFile(b,l))}catch(z){null!=l&&l(z)}}),l))};+DrawioFile.prototype.mergeFile=function(b,l,n,d,v){try{var A=b.getShadowPages();if(null!=A&&0<A.length){var z=this.getShadowPages(),D=[this.ui.diffPages(null!=d?d:z,A)],P=this.ignorePatches(D);if(P)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",P),null!=l&&l();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var J=this.isModified()?this.ui.diffPages(z,+this.isRealtime()?this.ownPages:this.ui.pages):null,L=this.ui.patchPages(this.ui.clonePages(z),D[0]),c=this.ui.getHashValueForPages(L,{}),f=this.ui.getHashValueForPages(A,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",z,"pages",A,"patched",L,"patches",D,"changes",J,"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(n,D,null,null,"mergeFile",+c,f,b.getCurrentRevisionId());else{this.setShadowPages(A);if(null!=this.sync){var k=this.sync.patchRealtime(D,DrawioFile.LAST_WRITE_WINS?J:null,null,v);null==k||mxUtils.isEmptyObject(k)||D.push(k)}this.patch(D,DrawioFile.LAST_WRITE_WINS?J:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=l&&l()}}catch(x){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=n&&n(x);try{var m=this.getCurrentUser(),t=null!=m?+m.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),t,x)}catch(y){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(x){null!=n&&n(x)}};+DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var l=new mxCodec(mxUtils.createXmlDocument()),n=l.document.createElement("mxfile");if(null!=b)for(var d=0;d<b.length;d++){var v=l.encode(new mxGraphModel(b[d].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[d].getId());b[d].viewState&&this.ui.editor.graph.saveViewState(b[d].viewState,v,!0);n.appendChild(v)}return mxUtils.getPrettyXml(n)};DrawioFile.prototype.compressReportData=function(b,l,n){l=null!=l?l:1E4;null!=n&&null!=b&&b.length>n?b=b.substring(0,n)+"[...]":null!=b&&b.length>l&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,l,n,d,x,A,z,D){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var P=this.getCurrentUser(),J=null!=P?P.id:"unknown",L=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",c=JSON.stringify(l).length,f=null;if(null!=l&&1E3>c){b=[];for(n=0;n<l.length;n++)b.push(this.ui.anonymizePatch(l[n]));f=JSON.stringify(b);f=null!=f&&1E3>-f.length?Graph.compress(f):null}this.getLatestVersion(mxUtils.bind(this,function(k){try{var m=null!=f?"report":"error",t=this.ui.getHashValueForPages(k.getShadowPages()),v="unknown",y="unknown",F="unknown";try{var E=null!=k.initialData&&0<k.initialData.length?mxUtils.parseXml(k.initialData).documentElement:null;null!=E&&(null!=E.getAttribute("version")&&(v=E.getAttribute("version")),null!=E.getAttribute("agent")&&(y=E.getAttribute("agent")),null!=E.getAttribute("type")&&(F=E.getAttribute("type")))}catch(C){}EditorUi.logError("Checksum "+-m+" in "+x,null,this.getMode()+"."+L,"user_"+J+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+l.length+(null!=f?"-json_"+f:"")+"-size_"+this.getSize()+(null!=A?"-expected_"+A:"")+(null!=z?"-current_"+z:"")+(null!=D?"-rev_"+this.ui.hashValue(D):"")+(null!=t?"-latest_"+t:"")+"-latestRev_"+this.ui.hashValue(k.getCurrentRevisionId())+("-latestVersion_"+v)+("-latestAgent_"+y)+("-latestType_"+F));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+L,action:x,label:"user_"++DrawioFile.prototype.checksumError=function(b,l,n,d,v,A,z,D){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var P=this.getCurrentUser(),J=null!=P?P.id:"unknown",L=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",c=JSON.stringify(l).length,f=null;if(null!=l&&1E3>c){b=[];for(n=0;n<l.length;n++)b.push(this.ui.anonymizePatch(l[n]));f=JSON.stringify(b);f=null!=f&&1E3>+f.length?Graph.compress(f):null}this.getLatestVersion(mxUtils.bind(this,function(k){try{var m=null!=f?"report":"error",t=this.ui.getHashValueForPages(k.getShadowPages()),x="unknown",y="unknown",F="unknown";try{var E=null!=k.initialData&&0<k.initialData.length?mxUtils.parseXml(k.initialData).documentElement:null;null!=E&&(null!=E.getAttribute("version")&&(x=E.getAttribute("version")),null!=E.getAttribute("agent")&&(y=E.getAttribute("agent")),null!=E.getAttribute("type")&&(F=E.getAttribute("type")))}catch(C){}EditorUi.logError("Checksum "++m+" in "+v,null,this.getMode()+"."+L,"user_"+J+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+l.length+(null!=f?"-json_"+f:"")+"-size_"+this.getSize()+(null!=A?"-expected_"+A:"")+(null!=z?"-current_"+z:"")+(null!=D?"-rev_"+this.ui.hashValue(D):"")+(null!=t?"-latest_"+t:"")+"-latestRev_"+this.ui.hashValue(k.getCurrentRevisionId())+("-latestVersion_"+x)+("-latestAgent_"+y)+("-latestType_"+F));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+L,action:v,label:"user_"+J+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+l.length+"-size_"+this.getSize()})}catch(C){}}),function(){})}catch(k){}};-DrawioFile.prototype.sendErrorReport=function(b,l,n,d){try{var x=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),A=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),z=this.getCurrentUser(),D=null!=z?this.ui.hashValue(z.id):"unknown",P=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",J=this.getTitle(),L=J.lastIndexOf(".");z="xml";0<L&&(z=J.substring(L));var c=null!=n?n.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++DrawioFile.prototype.sendErrorReport=function(b,l,n,d){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),A=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),z=this.getCurrentUser(),D=null!=z?this.ui.hashValue(z.id):"unknown",P=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",J=this.getTitle(),L=J.lastIndexOf(".");z="xml";0<L&&(z=J.substring(L));var c=null!=n?n.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="+D+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!=l?"\n\n"+l:-"")+(null!=n?"\n\nError: "+n.message:"")+"\n\nStack:\n"+c+"\n\nShadow:\n"+x+"\n\nData:\n"+A,d)}catch(f){}};-DrawioFile.prototype.reloadFile=function(b,l){try{this.stats.fileReloaded++;var n=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),d=this.ui.editor.graph,x=d.getSelectionCells(),A=d.getViewState(),z=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(D){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[n],"viewState",[A],"latestFile",D);null!=D?(this.ui.replaceFileData(D.getData(),-[n]),this.ui.restoreViewState(z,A,x),this.setDescriptor(D.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([n]),P.fileChanged());this.ui.restoreViewState(z,A,x);null!=b&&b()}else null!=l&&l(this.ui.fileLoadedError)}),!0))}),l)}catch(D){null!=l&&l(D)}};+"")+(null!=n?"\n\nError: "+n.message:"")+"\n\nStack:\n"+c+"\n\nShadow:\n"+v+"\n\nData:\n"+A,d)}catch(f){}};+DrawioFile.prototype.reloadFile=function(b,l){try{this.stats.fileReloaded++;var n=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),d=this.ui.editor.graph,v=d.getSelectionCells(),A=d.getViewState(),z=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(D){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[n],"viewState",[A],"latestFile",D);null!=D?(this.ui.replaceFileData(D.getData(),+[n]),this.ui.restoreViewState(z,A,v),this.setDescriptor(D.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([n]),P.fileChanged());this.ui.restoreViewState(z,A,v);null!=b&&b()}else null!=l&&l(this.ui.fileLoadedError)}),!0))}),l)}catch(D){null!=l&&l(D)}};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 n=0;n<b.length&&l;n++)l=l&&mxUtils.isEmptyObject(b[n]);return l};-DrawioFile.prototype.patch=function(b,l,n,d){if(null!=b){var x=this.ui.editor.undoManager,A=x.history.slice(),z=x.indexOfNextAdd,D=this.ui.editor.graph;D.container.style.visibility="hidden";var P=this.changeListenerEnabled;this.changeListenerEnabled=n;var J=D.foldingEnabled,L=D.mathEnabled,c=D.cellRenderer.redraw;D.cellRenderer.redraw=function(y){y.view.graph.isEditing(y.cell)&&(y.view.graph.scrollCellToVisible(y.cell),y.view.graph.cellEditor.resize());c.apply(this,arguments)};D.model.beginUpdate();-try{if(n){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,m=this.ui.applyPatches(this.ui.pages,b,!0,l,this.isModified()),t=0;t<m.length;t++){var v=mxUtils.indexOf(this.ui.pages,m[t]);0>v?this.ui.insertPage(m[t],Math.min(t,this.ui.pages.length)):this.ui.movePage(v,t)}for(t=0;t<f.length;t++)0>mxUtils.indexOf(m,f[t])&&this.ui.removePage(f[t]);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);D.checkDefaultParent()}finally{D.container.style.visibility="";D.model.endUpdate();D.cellRenderer.redraw=c;this.changeListenerEnabled=P;n||(x.history=A,x.indexOfNextAdd=z,x.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)L!=D.mathEnabled?(this.ui.editor.updateGraphComponents(),D.refresh()):(J!=D.foldingEnabled?+DrawioFile.prototype.patch=function(b,l,n,d){if(null!=b){var v=this.ui.editor.undoManager,A=v.history.slice(),z=v.indexOfNextAdd,D=this.ui.editor.graph;D.container.style.visibility="hidden";var P=this.changeListenerEnabled;this.changeListenerEnabled=n;var J=D.foldingEnabled,L=D.mathEnabled,c=D.cellRenderer.redraw;D.cellRenderer.redraw=function(y){y.view.graph.isEditing(y.cell)&&(y.view.graph.scrollCellToVisible(y.cell),y.view.graph.cellEditor.resize());c.apply(this,arguments)};D.model.beginUpdate();+try{if(n){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,m=this.ui.applyPatches(this.ui.pages,b,!0,l,this.isModified()),t=0;t<m.length;t++){var x=mxUtils.indexOf(this.ui.pages,m[t]);0>x?this.ui.insertPage(m[t],Math.min(t,this.ui.pages.length)):this.ui.movePage(x,t)}for(t=0;t<f.length;t++)0>mxUtils.indexOf(m,f[t])&&this.ui.removePage(f[t]);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);D.checkDefaultParent()}finally{D.container.style.visibility="";D.model.endUpdate();D.cellRenderer.redraw=c;this.changeListenerEnabled=P;n||(v.history=A,v.indexOfNextAdd=z,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)L!=D.mathEnabled?(this.ui.editor.updateGraphComponents(),D.refresh()):(J!=D.foldingEnabled?D.view.revalidate():D.view.validate(),D.sizeDidChange());null!=this.sync&&this.isRealtime()&&!d&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",l,"undoable",n)}return b};-DrawioFile.prototype.save=function(b,l,n,d,x,A){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",d,"overwrite",x,"manual",A,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!x&&this.invalidChecksum)if(null!=n)n({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=l&&l();else if(null!=n)n({message:mxResources.get("readOnly")});+DrawioFile.prototype.save=function(b,l,n,d,v,A){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",d,"overwrite",v,"manual",A,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=n)n({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=l&&l();else if(null!=n)n({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(z){if(null!=n)n(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.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,n){};DrawioFile.prototype.saveFile=function(b,l,n,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};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,l,n){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(b,l,n){};-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 l=this.ui.editor.graph,n=l.getSelectionCells(),d=l.getViewState(),x=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(x,+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 l=this.ui.editor.graph,n=l.getSelectionCells(),d=l.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,d,n);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 l=0;null!=b&&l<b.length;l++){var n=b[l];null!=n.id&&0==n.id.indexOf("extFont_")&&n.parentNode.removeChild(n)}};DrawioFile.prototype.open=function(){this.stats.opened++;var b=this.getData();null!=b&&(this.ui.setFileData(b),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};@@ -12222,110 +12222,110 @@ DrawioFile.prototype.showRefreshDialog=function(b,l,n){null==n&&(n=mxResources.gfunction(){null!=b&&b();this.ui.alert(mxResources.get("copyCreated"))}),l)}),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!=l&&l()}))}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,130))};DrawioFile.prototype.showCopyDialog=function(b,l,n){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,l)}),null,mxResources.get("overwrite"),n,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,150)};DrawioFile.prototype.showConflictDialog=function(b,l){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),b,null,mxResources.get("merge"),l,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),380,130)};-DrawioFile.prototype.redirectToNewApp=function(b,l){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var n=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),d=mxResources.get("redirectToNewApp");null!=l&&(d+=" ("+l+")");l=mxUtils.bind(this,function(){var x=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==n?window.location.reload():window.location.href=-n});null==b&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),x,mxResources.get("cancel"),mxResources.get("discardChanges")):x()});null!=b?this.isModified()?this.ui.confirm(d,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),l,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(d,l,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"),+DrawioFile.prototype.redirectToNewApp=function(b,l){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var n=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),d=mxResources.get("redirectToNewApp");null!=l&&(d+=" ("+l+")");l=mxUtils.bind(this,function(){var v=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==n?window.location.reload():window.location.href=+n});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(d,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),l,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(d,l,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"),l)}};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,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 n=this.getErrorMessage(b);null!=n&&60<n.length&&(n=n.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("error"))+(null!=n?" ("+mxUtils.htmlEntities(n)+")":"")+"</div>")}))))};-DrawioFile.prototype.handleConflictError=function(b,l){var n=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=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,n,d,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,n,d,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(n,d,x):this.invalidChecksum&&l?this.showRefreshDialog(n,d,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")));+DrawioFile.prototype.handleConflictError=function(b,l){var n=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=mxUtils.bind(this,function(z){this.handleFileError(z,!0)}),v=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,n,d,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,n,d,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(n,d,v):this.invalidChecksum&&l?this.showRefreshDialog(n,d,this.getErrorMessage(b)):l?this.showConflictDialog(v,A):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(n,d)}))};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 n=0;n<l.length;n++){var d=l[n].node;if(null!=d&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=l[n].getId())){var x=d.getElementsByTagName("mxGraphModel");x=0<x.length?x[0]:null;var A=Graph.decompress(mxUtils.getNodeValue(d));b?0==A.length&&null!=x&&(EditorUi.removeChildNodes(d),mxUtils.setTextContent(d,Graph.compressNode(x)),EditorUi.debug("DrawioFile.compressionChanged",-[this],"Page "+n+" compressed")):0<A.length&&null==x&&(EditorUi.removeChildNodes(d),d.appendChild(mxUtils.parseXml(A).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+n+" 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 n=0;n<l.length;n++){var d=l[n].node;if(null!=d&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=l[n].getId())){var v=d.getElementsByTagName("mxGraphModel");v=0<v.length?v[0]:null;var A=Graph.decompress(mxUtils.getNodeValue(d));b?0==A.length&&null!=v&&(EditorUi.removeChildNodes(d),mxUtils.setTextContent(d,Graph.compressNode(v)),EditorUi.debug("DrawioFile.compressionChanged",+[this],"Page "+n+" compressed")):0<A.length&&null==v&&(EditorUi.removeChildNodes(d),d.appendChild(mxUtils.parseXml(A).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+n+" 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(n){EditorUi.debug("DrawioFile.createSecret",[this],"secret",l,"token",n);b(l,n)}),mxUtils.bind(this,function(){b(l)})):b(l)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};-DrawioFile.prototype.fileSaved=function(b,l,n,d,x,A,z){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;A=null!=A?A:this.ui.getPagesForXml(b);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!=n&&n()):this.sync.fileSaved(A,l,n,d,x,z)}catch(J){this.invalidChecksum=+DrawioFile.prototype.fileSaved=function(b,l,n,d,v,A,z){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;A=null!=A?A:this.ui.getPagesForXml(b);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!=n&&n()):this.sync.fileSaved(A,l,n,d,v,z)}catch(J){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(J);try{var D=this.getCurrentUser(),P=null!=D?D.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),P,J)}catch(L){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[l],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(J){this.descriptorChanged(),null!=d&&d(J)}};-DrawioFile.prototype.autosave=function(b,l,n,d){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 z=this.isAutosaveRevision();-z&&(this.lastAutosaveRevision=(new Date).getTime());this.save(z,mxUtils.bind(this,function(D){this.autosaveCompleted();null!=n&&n(D)}),mxUtils.bind(this,function(D){null!=d&&d(D)}))}else this.isModified()||this.ui.clearStatus(),null!=n&&n(null)}catch(D){null!=d&&d(D)}}),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.autosave=function(b,l,n,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=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 z=this.isAutosaveRevision();+z&&(this.lastAutosaveRevision=(new Date).getTime());this.save(z,mxUtils.bind(this,function(D){this.autosaveCompleted();null!=n&&n(D)}),mxUtils.bind(this,function(D){null!=d&&d(D)}))}else this.isModified()||this.ui.clearStatus(),null!=n&&n(null)}catch(D){null!=d&&d(D)}}),v);this.autosaveThread=A;EditorUi.debug("DrawioFile.autosave",[this],"thread",A,"delay",b,"maxDelay",l,"actualDelay",v,"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 n=b.lastIndexOf(".");b=0<n?b.substring(n):"";n=l.lastIndexOf(".");return b===(0<n?l.substring(n):"")}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,n){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,n,d,x,A,z){DrawioFile.call(this,b,l);this.title=n;this.mode=d?null:App.MODE_DEVICE;this.fileHandle=x;this.desc=A;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};-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,n,d,x){this.saveAs(this.title,l,n,d,x)};LocalFile.prototype.saveAs=function(b,l,n,d,x){this.saveFile(b,!1,l,n,null,d,x)};+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,n){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,n,d,v,A,z){DrawioFile.call(this,b,l);this.title=n;this.mode=d?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=A;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};+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,n,d,v){this.saveAs(this.title,l,n,d,v)};LocalFile.prototype.saveAs=function(b,l,n,d,v){this.saveFile(b,!1,l,n,null,d,v)};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,n,d,x,A,z){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;x||this.updateFileData();var D=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var P=this.getData(),J=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=n&&n()}),L=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+LocalFile.prototype.saveFile=function(b,l,n,d,v,A,z){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var D=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var P=this.getData(),J=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=n&&n()}),L=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=!0;var f=mxUtils.bind(this,function(m){this.savingFile=!1;null!=d&&d({error:m})});this.saveDraft(P);this.fileHandle.createWritable().then(mxUtils.bind(this,function(m){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[t],"conflict",this.desc.lastModified!=t.lastModified);z||this.desc.lastModified==t.lastModified?m.write(D?this.ui.base64ToBlob(c,"image/png"):c).then(mxUtils.bind(this,function(){m.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(v){try{var y=this.desc;this.savingFile=!1;this.desc=v;this.fileSaved(P,y,J,f);this.removeDraft()}catch(F){f(F)}}),f)}),f)}),f):(this.inConflictState=!0,f())}),mxUtils.bind(this,function(t){this.invalidFileHandle=!0;f(t)}))}),f)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,b,D?"image/png":"text/xml",D);else if(c.length<MAX_REQUEST_SIZE){var k=b.lastIndexOf(".");k=0<k?b.substring(k+1):"xml";+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(x){try{var y=this.desc;this.savingFile=!1;this.desc=x;this.fileSaved(P,y,J,f);this.removeDraft()}catch(F){f(F)}}),f)}),f)}),f):(this.inConflictState=!0,f())}),mxUtils.bind(this,function(t){this.invalidFileHandle=!0;f(t)}))}),f)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,b,D?"image/png":"text/xml",D);else if(c.length<MAX_REQUEST_SIZE){var k=b.lastIndexOf(".");k=0<k?b.substring(k+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+k+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(b)+(D?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));J()}});D?(l=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(c){L(c)}),d,this.ui.getCurrentFile()!=this?P:null,l.scale,l.border)):L(P)};LocalFile.prototype.rename=function(b,l,n){this.title=b;this.descriptorChanged();null!=l&&l()};LocalLibrary=function(b,l,n){LocalFile.call(this,b,l,n)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,l,n){this.saveFile(b,!1,l,n)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,l,n){DrawioFile.call(this,b,l);this.title=n;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(n){b(this.getEtag(n))}),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,n){this.saveAs(this.getTitle(),l,n)};-StorageFile.prototype.saveAs=function(b,l,n){DrawioFile.prototype.save.apply(this,[!1,mxUtils.bind(this,function(){this.saveFile(this.getTitle(),!1,l,n)}),n])};StorageFile.insertFile=function(b,l,n,d,x,A){StorageFile.doInsertFile(null!=A?A:new StorageFile(b,n,l),d,x)};-StorageFile.doInsertFile=function(b,l,n){var d=b.getTitle(),x=b.getUi(),A=mxUtils.bind(this,function(z){var D=function(){b.writeFile(d,function(){l(b)},n)};z?x.confirm(mxResources.get("replaceIt",[d]),D,n):D()});StorageFile.getFileContent(x,d,function(z){A(null!=z)},function(){A(!1)})};StorageFile.getFileContent=function(b,l,n,d){b.getDatabaseItem(l,function(x){n(null!=x?x.data:null)},mxUtils.bind(this,function(){null==b.database?b.getLocalData(l,n):null!=d&&d()}),"files")};-StorageFile.getFileInfo=function(b,l,n,d){b.getDatabaseItem(l,function(x){n(x)},mxUtils.bind(this,function(){null==b.database?b.getLocalData(l,function(x){n(null!=x?{title:l}:null)}):null!=d&&d()}),"filesInfo")};-StorageFile.prototype.saveFile=function(b,l,n,d,x){x=null!=x?x:0;if(this.isEditable()){var A=mxUtils.bind(this,function(){this.writeFile(b,n,d)});this.isRenamable()&&"."==b.charAt(0)&&null!=d?d({message:mxResources.get("invalidName")}):this instanceof StorageLibrary?A():StorageFile.getFileInfo(this.ui,b,mxUtils.bind(this,function(z){this.isRenamable()&&this.getTitle()!=b&&null!=z?this.ui.confirm(mxResources.get("replaceIt",[b]),A,d):this.getLatestVersion(mxUtils.bind(this,function(D){D.getDescriptor()!=-this.getDescriptor()?(EditorUi.debug("StorageFile.saveFile",[this],"conflict",[D]),this.mergeFile(D,mxUtils.bind(this,function(){x>=this.maxRetries||this.invalidChecksum||this.inConflictState?(this.inConflictState=!0,null!=d&&d()):this.retrySave(mxUtils.bind(this,function(){this.updateFileData();this.saveFile(b,l,n,d,x+1)}))}),d)):A()}),d)}),d)}else null!=n&&n();EditorUi.debug("StorageFile.saveFile",[this],"title",b,"revision",l,"retry",x)};+StorageFile.prototype.saveAs=function(b,l,n){DrawioFile.prototype.save.apply(this,[!1,mxUtils.bind(this,function(){this.saveFile(this.getTitle(),!1,l,n)}),n])};StorageFile.insertFile=function(b,l,n,d,v,A){StorageFile.doInsertFile(null!=A?A:new StorageFile(b,n,l),d,v)};+StorageFile.doInsertFile=function(b,l,n){var d=b.getTitle(),v=b.getUi(),A=mxUtils.bind(this,function(z){var D=function(){b.writeFile(d,function(){l(b)},n)};z?v.confirm(mxResources.get("replaceIt",[d]),D,n):D()});StorageFile.getFileContent(v,d,function(z){A(null!=z)},function(){A(!1)})};StorageFile.getFileContent=function(b,l,n,d){b.getDatabaseItem(l,function(v){n(null!=v?v.data:null)},mxUtils.bind(this,function(){null==b.database?b.getLocalData(l,n):null!=d&&d()}),"files")};+StorageFile.getFileInfo=function(b,l,n,d){b.getDatabaseItem(l,function(v){n(v)},mxUtils.bind(this,function(){null==b.database?b.getLocalData(l,function(v){n(null!=v?{title:l}:null)}):null!=d&&d()}),"filesInfo")};+StorageFile.prototype.saveFile=function(b,l,n,d,v){v=null!=v?v:0;if(this.isEditable()){var A=mxUtils.bind(this,function(){this.writeFile(b,n,d)});this.isRenamable()&&"."==b.charAt(0)&&null!=d?d({message:mxResources.get("invalidName")}):this instanceof StorageLibrary?A():StorageFile.getFileInfo(this.ui,b,mxUtils.bind(this,function(z){this.isRenamable()&&this.getTitle()!=b&&null!=z?this.ui.confirm(mxResources.get("replaceIt",[b]),A,d):this.getLatestVersion(mxUtils.bind(this,function(D){D.getDescriptor()!=+this.getDescriptor()?(EditorUi.debug("StorageFile.saveFile",[this],"conflict",[D]),this.mergeFile(D,mxUtils.bind(this,function(){v>=this.maxRetries||this.invalidChecksum||this.inConflictState?(this.inConflictState=!0,null!=d&&d()):this.retrySave(mxUtils.bind(this,function(){this.updateFileData();this.saveFile(b,l,n,d,v+1)}))}),d)):A()}),d)}),d)}else null!=n&&n();EditorUi.debug("StorageFile.saveFile",[this],"title",b,"revision",l,"retry",v)};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,n){this.isRenamable()&&(this.title=b);try{var d=this.getDescriptor(),x=this.getData(),A=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.setDescriptor(this.getEtag(x));this.contentChanged();this.fileSaved(x,d,l,n)});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(z){null!=n&&n(z)}else null!=n&&n()}),["filesInfo","files"])}catch(z){null!=n&&n(z)}};StorageFile.prototype.rename=function(b,l,n){var d=this.getTitle();d!=b?StorageFile.getFileInfo(this.ui,b,mxUtils.bind(this,function(x){var A=mxUtils.bind(this,function(){this.title=b;this.hasSameExtension(d,b)||this.setData(this.ui.getFileData());this.saveFile(b,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(d,l)}),n)});null!=x?this.ui.confirm(mxResources.get("replaceIt",[b]),A,n):A()}),n):l()};+StorageFile.prototype.writeFile=function(b,l,n){this.isRenamable()&&(this.title=b);try{var d=this.getDescriptor(),v=this.getData(),A=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.setDescriptor(this.getEtag(v));this.contentChanged();this.fileSaved(v,d,l,n)});this.setShadowModified(!1);this.ui.setDatabaseItem(null,[{title:this.title,size:v.length,lastModified:Date.now(),type:this.type},{title:this.title,data:v}],A,mxUtils.bind(this,function(){if(null==this.ui.database)try{this.ui.setLocalData(this.title,+v,A)}catch(z){null!=n&&n(z)}else null!=n&&n()}),["filesInfo","files"])}catch(z){null!=n&&n(z)}};StorageFile.prototype.rename=function(b,l,n){var d=this.getTitle();d!=b?StorageFile.getFileInfo(this.ui,b,mxUtils.bind(this,function(v){var A=mxUtils.bind(this,function(){this.title=b;this.hasSameExtension(d,b)||this.setData(this.ui.getFileData());this.saveFile(b,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(d,l)}),n)});null!=v?this.ui.confirm(mxResources.get("replaceIt",[b]),A,n):A()}),n):l()};StorageFile.prototype.getLatestVersion=function(b,l){StorageFile.getFileContent(this.ui,this.title,mxUtils.bind(this,function(n){b(new StorageFile(this.ui,n,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=[],n=0;n<localStorage.length;n++){var d=localStorage.key(n),x=localStorage.getItem(d);if(0<d.length&&"."!=d.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)),z=(null==b||"L"==b)&&"<mxlibrary>"===x.substring(0,11);(A||z)&&l.push({title:d,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 n=b.transaction(["files","filesInfo"],"readwrite");b=n.objectStore("files");n=n.objectStore("filesInfo");for(var d=0;d<l.length;d++){var x=l[d],A=localStorage.getItem(x.title);b.add({title:x.title,data:A});n.add(x)}};-StorageFile.listFiles=function(b,l,n,d){b.getDatabaseItems(function(x){var A=[];if(null!=x)for(var z=0;z<x.length;z++)"."==x[z].title.charAt(0)||null!=l&&x[z].type!=l||A.push(x[z]);n(A)},function(){null==b.database?n(StorageFile.listLocalStorageFiles(l)):null!=d&&d()},"filesInfo")};StorageFile.deleteFile=function(b,l,n,d){b.removeDatabaseItem([l,l],n,function(){null==b.database?(localStorage.removeItem(l),n()):null!=d&&d()},["files","filesInfo"])};StorageLibrary=function(b,l,n){StorageFile.call(this,b,l,n)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.type="L";StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(b,l,n){this.saveFile(b,!1,l,n)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};+StorageFile.listLocalStorageFiles=function(b){for(var l=[],n=0;n<localStorage.length;n++){var d=localStorage.key(n),v=localStorage.getItem(d);if(0<d.length&&"."!=d.charAt(0)&&0<v.length){var A=(null==b||"F"==b)&&("<mxfile "===v.substring(0,8)||"<?xml"===v.substring(0,5)||"\x3c!--[if IE]>"===v.substring(0,12)),z=(null==b||"L"==b)&&"<mxlibrary>"===v.substring(0,11);(A||z)&&l.push({title:d,type:A?"F":"L",size:v.length,lastModified:Date.now()})}}return l};+StorageFile.migrate=function(b){var l=StorageFile.listLocalStorageFiles();l.push({title:".scratchpad",type:"L"});var n=b.transaction(["files","filesInfo"],"readwrite");b=n.objectStore("files");n=n.objectStore("filesInfo");for(var d=0;d<l.length;d++){var v=l[d],A=localStorage.getItem(v.title);b.add({title:v.title,data:A});n.add(v)}};+StorageFile.listFiles=function(b,l,n,d){b.getDatabaseItems(function(v){var A=[];if(null!=v)for(var z=0;z<v.length;z++)"."==v[z].title.charAt(0)||null!=l&&v[z].type!=l||A.push(v[z]);n(A)},function(){null==b.database?n(StorageFile.listLocalStorageFiles(l)):null!=d&&d()},"filesInfo")};StorageFile.deleteFile=function(b,l,n,d){b.removeDatabaseItem([l,l],n,function(){null==b.database?(localStorage.removeItem(l),n()):null!=d&&d()},["files","filesInfo"])};StorageLibrary=function(b,l,n){StorageFile.call(this,b,l,n)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.type="L";StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(b,l,n){this.saveFile(b,!1,l,n)};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,n){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(b,l,n){DrawioFile.call(this,b,l);this.title=n;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,n){RemoteFile.call(this,b,l,n.title);this.libObj=n};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,n){};RemoteLibrary.prototype.saveAs=function(b,l,n){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,l,n){StorageFile.call(this,b,l,n);b=n;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,n){return!1};UrlLibrary.prototype.saveAs=function(b,l,n){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,l,n){DrawioFile.call(this,b,l);this.desc=n||{};this.mode=App.MODE_EMBED};mxUtils.extend(EmbedFile,DrawioFile);EmbedFile.prototype.getMode=function(){return this.mode};EmbedFile.prototype.getTitle=function(){return this.desc.title||""};/*mxClient.IS_IOS || */-var StorageDialog=function(b,l,n){function d(c,f,k,m,t,v){function y(){mxEvent.addListener(F,"click",null!=v?v:function(){k==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(k,!0);l()})):k==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(k,!0);l()}),function(Q){b.spinner.stop();b.handleError(Q)}):+var StorageDialog=function(b,l,n){function d(c,f,k,m,t,x){function y(){mxEvent.addListener(F,"click",null!=x?x:function(){k==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(k,!0);l()})):k==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(k,!0);l()}),function(Q){b.spinner.stop();b.handleError(Q)}):(b.setMode(k,!0),l())})}D++;++z>n&&(mxUtils.br(P),z=1);var F=document.createElement("a");F.style.overflow="hidden";F.style.display="inline-block";F.className="geBaseButton";F.style.boxSizing="border-box";F.style.fontSize="11px";F.style.position="relative";F.style.margin="4px";F.style.marginTop="8px";F.style.marginBottom="0px";F.style.padding="8px 10px 8px 10px";F.style.width="88px";F.style.height="100px";F.style.whiteSpace="nowrap";F.setAttribute("title",f);var E=document.createElement("div");E.style.textOverflow="ellipsis";E.style.overflow="hidden";E.style.position="absolute";E.style.bottom="8px";E.style.left="0px";E.style.right="0px";mxUtils.write(E,f);F.appendChild(E);if(null!=c){var C=document.createElement("img");C.setAttribute("src",c);C.setAttribute("border","0");C.setAttribute("align","absmiddle");C.style.width="60px";C.style.height="60px";C.style.paddingBottom="6px";F.appendChild(C)}else E.style.paddingTop="5px",E.style.whiteSpace="normal",mxClient.IS_IOS?(F.style.padding="0px 10px 20px 10px",F.style.top="6px"):mxClient.IS_FF&&(E.style.paddingTop="0px",E.style.marginTop="-2px");if(null!=t)for(c=0;c<t.length;c++)mxUtils.br(E),mxUtils.write(E,t[c]);if(null!=m&&null==b[m]){C.style.visibility="hidden";mxUtils.setOpacity(E,10);var S=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});S.spin(F);var U=window.setTimeout(function(){null==b[m]&&(S.stop(),F.style.display="none")},3E4);b.addListener("clientLoaded",-mxUtils.bind(this,function(Q,O){null!=b[m]&&O.getProperty("client")==b[m]&&(window.clearTimeout(U),mxUtils.setOpacity(E,100),C.style.visibility="",S.stop(),y(),"drive"==m&&null!=J.parentNode&&J.parentNode.removeChild(J))}))}else y();P.appendChild(F)}n=null!=n?n: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 z=0,D=0,P=document.createElement("div");P.style.paddingTop="2px";A.appendChild(P);var J=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(A);z=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===+mxUtils.bind(this,function(Q,O){null!=b[m]&&O.getProperty("client")==b[m]&&(window.clearTimeout(U),mxUtils.setOpacity(E,100),C.style.visibility="",S.stop(),y(),"drive"==m&&null!=J.parentNode&&J.parentNode.removeChild(J))}))}else y();P.appendChild(F)}n=null!=n?n:2;var v=document.createElement("div");v.style.textAlign="center";v.style.whiteSpace="nowrap";v.style.paddingTop="0px";v.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 z=0,D=0,P=document.createElement("div");P.style.paddingTop="2px";A.appendChild(P);var J=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")+":");v.appendChild(L);v.appendChild(A);z=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");"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.DropboxClient&&d(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");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");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 c=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=c});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(J.style.padding="7px",J.style.fontSize="9pt",J.style.marginTop="-14px",J.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(J))},5E3);this.container=x},SplashDialog=function(b){var l=document.createElement("div");l.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var n=b.addLanguageMenu(l,!1,"28px");null!=n&&(n.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 x=document.createElement("div");x.style.margin="8px 0px 0px 0px";x.style.padding="18px 0px 24px 0px";n="";b.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",n=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",n=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",n=mxResources.get("oneDrive")):b.mode==App.MODE_GITHUB?-(d.src=IMAGE_PATH+"/github-logo.svg",n=mxResources.get("github")):b.mode==App.MODE_GITLAB?(d.src=IMAGE_PATH+"/gitlab-logo.svg",n=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",n=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",n=mxResources.get("trello")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",x.style.paddingBottom="10px",x.style.paddingTop="30px",n=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 z=document.createElement("table"),D=document.createElement("tbody"),P=document.createElement("tr"),J=document.createElement("td"),L=document.createElement("td");z.setAttribute("align",+v.appendChild(A);mxEvent.addListener(A,"click",function(){b.hideDialog();var c=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=c});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(J.style.padding="7px",J.style.fontSize="9pt",J.style.marginTop="-14px",J.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>",v.appendChild(J))},5E3);this.container=v},SplashDialog=function(b){var l=document.createElement("div");l.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var n=b.addLanguageMenu(l,!1,"28px");null!=n&&(n.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 v=document.createElement("div");v.style.margin="8px 0px 0px 0px";v.style.padding="18px 0px 24px 0px";n="";b.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",n=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",n=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",n=mxResources.get("oneDrive")):b.mode==App.MODE_GITHUB?+(d.src=IMAGE_PATH+"/github-logo.svg",n=mxResources.get("github")):b.mode==App.MODE_GITLAB?(d.src=IMAGE_PATH+"/gitlab-logo.svg",n=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",n=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",n=mxResources.get("trello")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",v.style.paddingBottom="10px",v.style.paddingTop="30px",n=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)v.style.padding="42px 0px 10px 0px",A.style.marginBottom="12px";else{v.style.border="1px solid #d3d3d3";v.style.borderWidth="1px 0px 1px 0px";var z=document.createElement("table"),D=document.createElement("tbody"),P=document.createElement("tr"),J=document.createElement("td"),L=document.createElement("td");z.setAttribute("align","center");J.appendChild(d);d=document.createElement("div");d.style.fontSize="22px";d.style.paddingBottom="6px";d.style.color="gray";mxUtils.write(d,n);L.style.textAlign="left";L.appendChild(d);P.appendChild(J);P.appendChild(L);D.appendChild(P);z.appendChild(D);l.appendChild(z);n=document.createElement("span");n.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,0)");mxUtils.write(n,-mxResources.get("changeStorage"));mxEvent.addListener(n,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});l.appendChild(n)}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(n=function(k){A.style.marginBottom="24px";var m=document.createElement("a");m.style.display="inline-block";m.style.color="gray";m.style.cursor="pointer";m.style.marginTop="6px";mxUtils.write(m,mxResources.get("signOut"));A.style.marginBottom="16px";x.style.paddingBottom="18px";mxEvent.addListener(m,"click",function(){b.confirm(mxResources.get("areYouSure"),function(){k()})});x.appendChild(m)},b.mode==App.MODE_GOOGLE&&-null!=b.drive){var c=b.drive.getUsersList();if(0<c.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");A.style.marginBottom="16px";x.style.paddingBottom="18px";x.appendChild(d);var f=document.createElement("select");f.style.marginLeft="4px";f.style.width="140px";for(n=0;n<c.length;n++)z=document.createElement("option"),mxUtils.write(z,c[n].displayName),z.value=n,f.appendChild(z),z=document.createElement("option"),z.innerHTML=" ",-mxUtils.write(z,"<"+c[n].email+">"),z.setAttribute("disabled","disabled"),f.appendChild(z);z=document.createElement("option");mxUtils.write(z,mxResources.get("addAccount"));z.value=c.length;f.appendChild(z);mxEvent.addListener(f,"change",function(){var k=f.value,m=c.length!=k;m&&b.drive.setUser(c[k]);b.drive.authorize(m,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(t){b.handleError(t,null,function(){b.hideDialog();b.showSplash()})},!0)});x.appendChild(f)}else n(function(){b.drive.logout()})}else b.mode!=+mxResources.get("changeStorage"));mxEvent.addListener(n,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});l.appendChild(n)}mxUtils.write(A,mxResources.get("createNewDiagram"));mxEvent.addListener(A,"click",function(){b.hideDialog();b.actions.get("new").funct()});v.appendChild(A);mxUtils.br(v);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()});v.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(n=function(k){A.style.marginBottom="24px";var m=document.createElement("a");m.style.display="inline-block";m.style.color="gray";m.style.cursor="pointer";m.style.marginTop="6px";mxUtils.write(m,mxResources.get("signOut"));A.style.marginBottom="16px";v.style.paddingBottom="18px";mxEvent.addListener(m,"click",function(){b.confirm(mxResources.get("areYouSure"),function(){k()})});v.appendChild(m)},b.mode==App.MODE_GOOGLE&&+null!=b.drive){var c=b.drive.getUsersList();if(0<c.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");A.style.marginBottom="16px";v.style.paddingBottom="18px";v.appendChild(d);var f=document.createElement("select");f.style.marginLeft="4px";f.style.width="140px";for(n=0;n<c.length;n++)z=document.createElement("option"),mxUtils.write(z,c[n].displayName),z.value=n,f.appendChild(z),z=document.createElement("option"),z.innerHTML=" ",+mxUtils.write(z,"<"+c[n].email+">"),z.setAttribute("disabled","disabled"),f.appendChild(z);z=document.createElement("option");mxUtils.write(z,mxResources.get("addAccount"));z.value=c.length;f.appendChild(z);mxEvent.addListener(f,"change",function(){var k=f.value,m=c.length!=k;m&&b.drive.setUser(c[k]);b.drive.authorize(m,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(t){b.handleError(t,null,function(){b.hideDialog();b.showSplash()})},!0)});v.appendChild(f)}else n(function(){b.drive.logout()})}else b.mode!=App.MODE_ONEDRIVE||null==b.oneDrive||b.oneDrive.noLogout?b.mode==App.MODE_GITHUB&&null!=b.gitHub?n(function(){b.gitHub.logout();b.openLink("https://www.github.com/logout")}):b.mode==App.MODE_GITLAB&&null!=b.gitLab?n(function(){b.gitLab.logout();var k=document.createElement("form");k.setAttribute("method","post");k.setAttribute("action",DRAWIO_GITLAB_URL+"/users/sign_out");k.setAttribute("target","_blank");document.body.appendChild(k);k.submit();k.parentNode.removeChild(k)}):b.mode==App.MODE_TRELLO&&-null!=b.trello?b.trello.isAuthorized()&&n(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&n(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):n(function(){b.oneDrive.logout()});l.appendChild(x);this.container=l},EmbedDialog=function(b,l,n,d,x,A,z,D,P){d=document.createElement("div");var J=/^https?:\/\//.test(l)||/^mailto:\/\//.test(l);null!=A?mxUtils.write(d,A):mxUtils.write(d,mxResources.get(5E5>l.length?J?"link":"mainEmbedNotice":"preview")+":");+null!=b.trello?b.trello.isAuthorized()&&n(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&n(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):n(function(){b.oneDrive.logout()});l.appendChild(v);this.container=l},EmbedDialog=function(b,l,n,d,v,A,z,D,P){d=document.createElement("div");var J=/^https?:\/\//.test(l)||/^mailto:\/\//.test(l);null!=A?mxUtils.write(d,A):mxUtils.write(d,mxResources.get(5E5>l.length?J?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);A=document.createElement("div");A.style.position="absolute";A.style.top="30px";A.style.right="30px";A.style.color="gray";mxUtils.write(A,b.formatFileSize(l.length));d.appendChild(A);var L=document.createElement("textarea");L.setAttribute("autocomplete","off");L.setAttribute("autocorrect","off");L.setAttribute("autocapitalize","off");L.setAttribute("spellcheck","false");L.style.fontFamily="monospace";L.style.wordBreak="break-all";L.style.marginTop="10px";L.style.resize="none";L.style.height="180px";L.style.width="440px";L.style.border="1px solid gray";L.value=mxResources.get("updatingDocument");d.appendChild(L);mxUtils.br(d);this.init=function(){window.setTimeout(function(){5E5>l.length?(L.value=l,L.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null)):(L.setAttribute("readonly","true"),L.value=mxResources.get("tooLargeUseDownload"))},0)};A=document.createElement("div");A.style.position="absolute";A.style.bottom="36px";-A.style.right="32px";z=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&J&&(z=mxUtils.button(null!=D?D:mxResources.get(5E5>l.length?"preview":"openInNewWindow"),function(){var f=5E5>l.length?L.value:l;if(null!=x)x(f);else if(J)try{var k=b.openLink(f);null!=k&&(null==n||0<n)&&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(t){}}),+A.style.right="32px";z=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&J&&(z=mxUtils.button(null!=D?D:mxResources.get(5E5>l.length?"preview":"openInNewWindow"),function(){var f=5E5>l.length?L.value:l;if(null!=v)v(f);else if(J)try{var k=b.openLink(f);null!=k&&(null==n||0<n)&&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(t){}}),n||500)}catch(t){b.handleError({message:t.message||mxResources.get("drawingTooLarge")})}else{var m=window.open();m=null!=m?m.document:null;null!=m?(m.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>"),m.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),z.className="geBtn",A.appendChild(z));D=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=P?P:"embed.txt","txt",l,"text/plain")});D.className="geBtn";A.appendChild(D);if(!b.isOffline()&&5E5>l.length){D=mxUtils.button("",function(){try{var f="mailto:?subject="+encodeURIComponent(P||b.defaultFilename)+"&body="+encodeURIComponent(L.value);b.openLink(f)}catch(k){b.handleError({message:k.message||mxResources.get("drawingTooLarge")})}});var c=document.createElement("img");c.className="geAdaptiveAsset";c.setAttribute("src",Editor.mailImage);c.setAttribute("width","18");c.setAttribute("height","18");c.setAttribute("border","0");c.style.marginBottom="5px";D.appendChild(c);D.style.verticalAlign="bottom";D.style.paddingTop="4px";D.style.minWidth="46px";D.className="geBtn";A.appendChild(D)}D=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});A.appendChild(D);c=mxUtils.button(mxResources.get("copy"),function(){L.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});5E5>l.length?mxClient.IS_SF||null!=document.documentMode?D.className="geBtn gePrimaryBtn":(A.appendChild(c),c.className="geBtn gePrimaryBtn",D.className="geBtn"):null!=z&&(A.appendChild(z),D.className="geBtn",z.className="geBtn gePrimaryBtn");d.appendChild(A);this.container=d};EmbedDialog.showPreviewOption=!0;-var CreateGraphDialog=function(b,l,n){var d=document.createElement("div");d.style.textAlign="right";this.init=function(){var x=document.createElement("div");x.style.position="relative";x.style.border="1px solid gray";x.style.boxSizing="border-box";x.style.width="100%";x.style.height="360px";x.style.overflow="hidden";x.style.marginBottom="16px";mxEvent.disableContextMenu(x);d.appendChild(x);var A=new Graph(x);A.setCellsCloneable(!0);A.setPanning(!0);A.setAllowDanglingEdges(!1);A.connectionHandler.select=-!1;A.view.setTranslate(20,20);A.border=20;A.panningHandler.useLeftButtonForPanning=!0;mxClient.IS_SVG&&null!=A.view.getDrawPane()&&(x=A.view.getDrawPane().ownerSVGElement,null!=x&&(x.style.position="absolute"));var z="curved=1;";A.cellRenderer.installCellOverlayListeners=function(m,t,v){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(v.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(y){t.fireEvent(new mxEventObject("pointerdown","event",y,-"state",m))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(v.node,"touchstart",function(y){t.fireEvent(new mxEventObject("pointerdown","event",y,"state",m))})};A.getAllConnectionConstraints=function(){return null};A.connectionHandler.marker.highlight.keepOnTop=!1;A.connectionHandler.createEdgeState=function(m){m=A.createEdge(null,null,null,null,null,z);return new mxCellState(this.graph.view,m,this.graph.getCellStyle(m))};var D=A.getDefaultParent(),P=mxUtils.bind(this,function(m){var t=-new mxCellOverlay(this.connectImage,"Add outgoing");t.cursor="hand";t.addListener(mxEvent.CLICK,function(v,y){A.connectionHandler.reset();A.clearSelection();var F=A.getCellGeometry(m),E;c(function(){E=A.insertVertex(D,null,"Entry",F.x,F.y,80,30,"rounded=1;");P(E);A.view.refresh(E);A.insertEdge(D,null,"",m,E,z)},function(){A.scrollCellToVisible(E)})});t.addListener("pointerdown",function(v,y){v=y.getProperty("event");y=y.getProperty("state");A.popupMenuHandler.hideMenu();A.stopEditing(!1);var F=mxUtils.convertPoint(A.container,-mxEvent.getClientX(v),mxEvent.getClientY(v));A.connectionHandler.start(y,F.x,F.y);A.isMouseDown=!0;A.isMouseTrigger=mxEvent.isMouseEvent(v);mxEvent.consume(v)});A.addCellOverlay(m,t)});A.getModel().beginUpdate();try{var J=A.insertVertex(D,null,"Start",0,0,80,30,"ellipse");P(J)}finally{A.getModel().endUpdate()}if("horizontalTree"==n){var L=new mxCompactTreeLayout(A);L.edgeRouting=!1;L.levelDistance=30;L.sortEdges=!0;z="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==n?(L=new mxCompactTreeLayout(A,+var CreateGraphDialog=function(b,l,n){var d=document.createElement("div");d.style.textAlign="right";this.init=function(){var v=document.createElement("div");v.style.position="relative";v.style.border="1px solid gray";v.style.boxSizing="border-box";v.style.width="100%";v.style.height="360px";v.style.overflow="hidden";v.style.marginBottom="16px";mxEvent.disableContextMenu(v);d.appendChild(v);var A=new Graph(v);A.setCellsCloneable(!0);A.setPanning(!0);A.setAllowDanglingEdges(!1);A.connectionHandler.select=+!1;A.view.setTranslate(20,20);A.border=20;A.panningHandler.useLeftButtonForPanning=!0;mxClient.IS_SVG&&null!=A.view.getDrawPane()&&(v=A.view.getDrawPane().ownerSVGElement,null!=v&&(v.style.position="absolute"));var z="curved=1;";A.cellRenderer.installCellOverlayListeners=function(m,t,x){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(x.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(y){t.fireEvent(new mxEventObject("pointerdown","event",y,+"state",m))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(x.node,"touchstart",function(y){t.fireEvent(new mxEventObject("pointerdown","event",y,"state",m))})};A.getAllConnectionConstraints=function(){return null};A.connectionHandler.marker.highlight.keepOnTop=!1;A.connectionHandler.createEdgeState=function(m){m=A.createEdge(null,null,null,null,null,z);return new mxCellState(this.graph.view,m,this.graph.getCellStyle(m))};var D=A.getDefaultParent(),P=mxUtils.bind(this,function(m){var t=+new mxCellOverlay(this.connectImage,"Add outgoing");t.cursor="hand";t.addListener(mxEvent.CLICK,function(x,y){A.connectionHandler.reset();A.clearSelection();var F=A.getCellGeometry(m),E;c(function(){E=A.insertVertex(D,null,"Entry",F.x,F.y,80,30,"rounded=1;");P(E);A.view.refresh(E);A.insertEdge(D,null,"",m,E,z)},function(){A.scrollCellToVisible(E)})});t.addListener("pointerdown",function(x,y){x=y.getProperty("event");y=y.getProperty("state");A.popupMenuHandler.hideMenu();A.stopEditing(!1);var F=mxUtils.convertPoint(A.container,+mxEvent.getClientX(x),mxEvent.getClientY(x));A.connectionHandler.start(y,F.x,F.y);A.isMouseDown=!0;A.isMouseTrigger=mxEvent.isMouseEvent(x);mxEvent.consume(x)});A.addCellOverlay(m,t)});A.getModel().beginUpdate();try{var J=A.insertVertex(D,null,"Start",0,0,80,30,"ellipse");P(J)}finally{A.getModel().endUpdate()}if("horizontalTree"==n){var L=new mxCompactTreeLayout(A);L.edgeRouting=!1;L.levelDistance=30;L.sortEdges=!0;z="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==n?(L=new mxCompactTreeLayout(A,!1),L.edgeRouting=!1,L.levelDistance=30,L.sortEdges=!0,z="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==n?(L=new mxRadialTreeLayout(A,!1),L.edgeRouting=!1,L.levelDistance=80):"verticalFlow"==n?L=new mxHierarchicalLayout(A,mxConstants.DIRECTION_NORTH):"horizontalFlow"==n?L=new mxHierarchicalLayout(A,mxConstants.DIRECTION_WEST):"circle"==n?L=new mxCircleLayout(A):(L=new mxFastOrganicLayout(A,!1),L.forceConstant=80);if(null!=L){var c=function(m,t){A.getModel().beginUpdate();try{null!=m&&m(),-L.execute(A.getDefaultParent(),J)}catch(v){throw v;}finally{m=new mxMorphing(A),m.addListener(mxEvent.DONE,mxUtils.bind(this,function(){A.getModel().endUpdate();null!=t&&t()})),m.startAnimation()}},f=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(m,t,v,y,F){f.apply(this,arguments);c()};A.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);c()};A.connectionHandler.addListener(mxEvent.CONNECT,function(){c()})}x=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),-function(){b.hideDialog()})});x.className="geBtn";b.editor.cancelFirst&&d.appendChild(x);var k=mxUtils.button(mxResources.get("insert"),function(m){A.clearCellOverlays();var t=A.getModel().getChildren(A.getDefaultParent());m=mxEvent.isAltDown(m)?b.editor.graph.getFreeInsertPoint():b.editor.graph.getCenterInsertPoint(A.getBoundingBoxFromGeometry(t,!0));t=b.editor.graph.importCells(t,m.x,m.y);m=b.editor.graph.view;var v=m.getBounds(t);null!=v&&(v.x-=m.translate.x,v.y-=m.translate.y,b.editor.graph.scrollRectToVisible(v),-b.editor.graph.setSelectionCells(t));b.hideDialog()});d.appendChild(k);k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||d.appendChild(x);this.graph=A};this.container=d};+L.execute(A.getDefaultParent(),J)}catch(x){throw x;}finally{m=new mxMorphing(A),m.addListener(mxEvent.DONE,mxUtils.bind(this,function(){A.getModel().endUpdate();null!=t&&t()})),m.startAnimation()}},f=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(m,t,x,y,F){f.apply(this,arguments);c()};A.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);c()};A.connectionHandler.addListener(mxEvent.CONNECT,function(){c()})}v=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),+function(){b.hideDialog()})});v.className="geBtn";b.editor.cancelFirst&&d.appendChild(v);var k=mxUtils.button(mxResources.get("insert"),function(m){A.clearCellOverlays();var t=A.getModel().getChildren(A.getDefaultParent());m=mxEvent.isAltDown(m)?b.editor.graph.getFreeInsertPoint():b.editor.graph.getCenterInsertPoint(A.getBoundingBoxFromGeometry(t,!0));t=b.editor.graph.importCells(t,m.x,m.y);m=b.editor.graph.view;var x=m.getBounds(t);null!=x&&(x.x-=m.translate.x,x.y-=m.translate.y,b.editor.graph.scrollRectToVisible(x),+b.editor.graph.setSelectionCells(t));b.hideDialog()});d.appendChild(k);k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||d.appendChild(v);this.graph=A};this.container=d};CreateGraphDialog.prototype.connectImage=new mxImage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==",26,26);-var BackgroundImageDialog=function(b,l,n,d,x){function A(){null==u||u==mxConstants.NONE?(q.style.display="none",Q.checked=!1):(q.style.backgroundColor=u,q.style.display="",Q.checked=!0)}var z=b.editor.graph,D=document.createElement("div");D.style.whiteSpace="nowrap";var P=document.createElement("h2");mxUtils.write(P,mxResources.get("background"));P.style.marginTop="0px";D.appendChild(P);var J=null!=n&&null!=n.originalSrc;P=!1;var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-bottom:8px;";L.setAttribute("value",+var BackgroundImageDialog=function(b,l,n,d,v){function A(){null==u||u==mxConstants.NONE?(q.style.display="none",Q.checked=!1):(q.style.backgroundColor=u,q.style.display="",Q.checked=!0)}var z=b.editor.graph,D=document.createElement("div");D.style.whiteSpace="nowrap";var P=document.createElement("h2");mxUtils.write(P,mxResources.get("background"));P.style.marginTop="0px";D.appendChild(P);var J=null!=n&&null!=n.originalSrc;P=!1;var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-bottom:8px;";L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name","geBackgroundImageDialogOption");var c=document.createElement("input");c.style.cssText="margin-right:8px;margin-bottom:8px;";c.setAttribute("value","url");c.setAttribute("type","radio");c.setAttribute("name","geBackgroundImageDialogOption");var f=document.createElement("input");f.setAttribute("type","text");f.style.marginBottom="8px";f.style.width="360px";f.value=J||null==n?"":n.src;var k=document.createElement("select");k.style.width="360px";if(null!=b.pages)for(var m=0;m<b.pages.length;m++){var t=document.createElement("option");mxUtils.write(t,b.pages[m].getName()||mxResources.get("pageWithNumber",[m+1]));t.setAttribute("value","data:page/id,"+b.pages[m].getId());b.pages[m]==b.currentPage&&t.setAttribute("disabled","disabled");null!=n&&n.originalSrc==t.getAttribute("value")&&(t.setAttribute("selected","selected"),P=!0);k.appendChild(t)}J||null!=b.pages&&1!=b.pages.length||(L.style.display="none",c.style.display="none",k.style.display=-"none");var v=document.createElement("option"),y=!1,F=!1,E=function(G,H){y||null!=G&&F||(c.checked?null!=H&&H(v.selected?null:k.value):""==f.value||b.isOffline()?(S.value="",U.value="",null!=H&&H("")):(f.value=mxUtils.trim(f.value),b.loadImage(f.value,function(g){S.value=g.width;U.value=g.height;null!=H&&H(f.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));S.value="";U.value="";null!=H&&H(null)})))},C=mxUtils.bind(this,function(G){b.importFiles(G,+"none");var x=document.createElement("option"),y=!1,F=!1,E=function(G,H){y||null!=G&&F||(c.checked?null!=H&&H(x.selected?null:k.value):""==f.value||b.isOffline()?(S.value="",U.value="",null!=H&&H("")):(f.value=mxUtils.trim(f.value),b.loadImage(f.value,function(g){S.value=g.width;U.value=g.height;null!=H&&H(f.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));S.value="";U.value="";null!=H&&H(null)})))},C=mxUtils.bind(this,function(G){b.importFiles(G,0,0,b.maxBackgroundSize,function(H,g,p,B,K,M){f.value=H;E();f.focus()},function(){},function(H){return"image/"==H.type.substring(0,6)},function(H){for(var g=0;g<H.length;g++)H[g]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){J?k.focus():f.focus();mxEvent.addListener(k,"focus",function(){L.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});mxEvent.addListener(f,"focus",function(){c.removeAttribute("checked");L.setAttribute("checked","checked");L.checked=!0});if(Graph.fileSupport){f.setAttribute("placeholder",mxResources.get("dragImagesHere"));var G=D.parentNode,H=null;mxEvent.addListener(G,"dragleave",function(g){null!=H&&(H.parentNode.removeChild(H),H=null);g.stopPropagation();g.preventDefault()});mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(g){null==H&&(H=b.highlightElement(G));g.stopPropagation();g.preventDefault()}));mxEvent.addListener(G,"drop",mxUtils.bind(this,function(g){null!=H&&(H.parentNode.removeChild(H),H=null);if(0<g.dataTransfer.files.length)C(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)&&(f.value=decodeURIComponent(p),E())}g.stopPropagation();g.preventDefault()}),!1)}};D.appendChild(L);D.appendChild(f);mxUtils.br(D);m=document.createElement("span");m.style.marginLeft="30px";mxUtils.write(m,mxResources.get("width")+":");D.appendChild(m);var S=document.createElement("input");S.setAttribute("type","text");S.style.width="60px";S.style.marginLeft="8px";S.style.marginRight="16px";S.value=null==n||J?"":n.width;D.appendChild(S);mxUtils.write(D,mxResources.get("height")+":");var U=document.createElement("input");U.setAttribute("type","text");U.style.width="60px";U.style.marginLeft="8px";U.style.marginRight="16px";U.value=null==n||J?"":n.height;D.appendChild(U);mxUtils.br(D);mxUtils.br(D);mxEvent.addListener(f,"change",E);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&&(f.value=G.url,E()));f.focus()};D.appendChild(c);D.appendChild(k);mxUtils.br(D);mxUtils.br(D);J?(c.setAttribute("checked","checked"),c.checked=!0):(L.setAttribute("checked","checked"),L.checked=!0);!P&&c.checked&&(mxUtils.write(v,mxResources.get("pageNotFound")),v.setAttribute("disabled","disabled"),v.setAttribute("selected","selected"),v.setAttribute("value","pageNotFound"),k.appendChild(v),mxEvent.addListener(k,-"change",function(){null==v.parentNode||v.selected||v.parentNode.removeChild(v)}));n=document.createElement("div");n.style.display=x?"inline-flex":"none";n.style.alignItems="center";n.style.cursor="default";n.style.minWidth="40%";n.style.height="20px";var Q=document.createElement("input");Q.setAttribute("type","checkbox");Q.style.margin="0px 10px 0px 4px";Q.style.verticalAlign="bottom";Q.defaultChecked=d!=mxConstants.NONE&&null!=d;Q.checked=Q.defaultChecked;n.appendChild(Q);mxUtils.write(n,mxResources.get("fillColor"));-x=n.cloneNode(!1);var O=document.createElement("input");O.setAttribute("type","checkbox");O.style.margin="0px 10px 0px 30px";O.style.verticalAlign="bottom";O.defaultChecked=z.shadowVisible;O.checked=O.defaultChecked;x.appendChild(O);mxUtils.write(x,mxResources.get("shadow"));mxClient.IS_SVG&&!mxClient.IS_SF||O.setAttribute("disabled","disabled");mxEvent.addListener(x,"click",function(G){mxEvent.getSource(G)!=O&&(O.checked=!O.checked)});var q=document.createElement("button");q.style.width="36px";q.style.height=-"18px";q.style.cursor="pointer";q.style.marginLeft="10px";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";q.style.verticalAlign="bottom";q.className="geColorBtn";var u=d;A();mxEvent.addListener(n,"click",function(G){mxEvent.getSource(G)!=Q&&(Q.checked=!Q.checked);u=Q.checked?"#ffffff":null;A()});mxEvent.addListener(q,"click",function(G){b.pickColor(u||"none",function(H){u=H;A()});mxEvent.consume(G)});n.appendChild(q);D.appendChild(n);D.appendChild(x);mxUtils.br(D);-d=document.createElement("div");d.style.marginTop="30px";d.style.textAlign="right";z=mxUtils.button(mxResources.get("cancel"),function(){y=!0;b.hideDialog()});z.className="geBtn";b.editor.cancelFirst&&d.appendChild(z);x=mxUtils.button(mxResources.get("reset"),function(){f.value="";S.value="";U.value="";L.checked=!0;u=mxConstants.NONE;A();y=!1});mxEvent.addGestureListeners(x,function(){y=!0});x.className="geBtn";x.width="100";d.appendChild(x);if(Graph.fileSupport){var I=document.createElement("input");-I.setAttribute("multiple","multiple");I.setAttribute("type","file");mxEvent.addListener(I,"change",function(G){null!=I.files&&(C(I.files),I.type="",I.type="file",I.value="")});I.style.display="none";D.appendChild(I);x=mxUtils.button(mxResources.get("open"),function(){I.click()});x.className="geBtn";d.appendChild(x)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();E(null,function(G){l(""!=G&&null!=G?new mxImage(G,S.value,U.value):null,null==G,u,!mxClient.IS_SVG||mxClient.IS_SF?-null:O.checked)})});mxEvent.addGestureListeners(applyBtn,function(){F=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(z);D.appendChild(d);this.container=D},ParseDialog=function(b,l,n){function d(k,m,t){if("plantUmlPng"==m||"plantUmlSvg"==m||"plantUmlTxt"==m){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var v=function(g,p,B,K,M){A=mxEvent.isAltDown(t)?A:y.getCenterInsertPoint(new mxRectangle(0,0,K,M));var N=null;y.getModel().beginUpdate();+null!=G.docs[0].thumbnails&&(G=G.docs[0].thumbnails[G.docs[0].thumbnails.length-1],null!=G&&(f.value=G.url,E()));f.focus()};D.appendChild(c);D.appendChild(k);mxUtils.br(D);mxUtils.br(D);J?(c.setAttribute("checked","checked"),c.checked=!0):(L.setAttribute("checked","checked"),L.checked=!0);!P&&c.checked&&(mxUtils.write(x,mxResources.get("pageNotFound")),x.setAttribute("disabled","disabled"),x.setAttribute("selected","selected"),x.setAttribute("value","pageNotFound"),k.appendChild(x),mxEvent.addListener(k,+"change",function(){null==x.parentNode||x.selected||x.parentNode.removeChild(x)}));n=document.createElement("div");n.style.display=v?"inline-flex":"none";n.style.alignItems="center";n.style.cursor="default";n.style.minWidth="40%";n.style.height="20px";var Q=document.createElement("input");Q.setAttribute("type","checkbox");Q.style.margin="0px 10px 0px 4px";Q.style.verticalAlign="bottom";Q.defaultChecked=d!=mxConstants.NONE&&null!=d;Q.checked=Q.defaultChecked;n.appendChild(Q);mxUtils.write(n,mxResources.get("fillColor"));+v=n.cloneNode(!1);var O=document.createElement("input");O.setAttribute("type","checkbox");O.style.margin="0px 10px 0px 30px";O.style.verticalAlign="bottom";O.defaultChecked=z.shadowVisible;O.checked=O.defaultChecked;v.appendChild(O);mxUtils.write(v,mxResources.get("shadow"));mxClient.IS_SVG&&!mxClient.IS_SF||O.setAttribute("disabled","disabled");mxEvent.addListener(v,"click",function(G){mxEvent.getSource(G)!=O&&(O.checked=!O.checked)});var q=document.createElement("button");q.style.width="36px";q.style.height=+"18px";q.style.cursor="pointer";q.style.marginLeft="10px";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";q.style.verticalAlign="bottom";q.className="geColorBtn";var u=d;A();mxEvent.addListener(n,"click",function(G){mxEvent.getSource(G)!=Q&&(Q.checked=!Q.checked);u=Q.checked?"#ffffff":null;A()});mxEvent.addListener(q,"click",function(G){b.pickColor(u||"none",function(H){u=H;A()});mxEvent.consume(G)});n.appendChild(q);D.appendChild(n);D.appendChild(v);mxUtils.br(D);+d=document.createElement("div");d.style.marginTop="30px";d.style.textAlign="right";z=mxUtils.button(mxResources.get("cancel"),function(){y=!0;b.hideDialog()});z.className="geBtn";b.editor.cancelFirst&&d.appendChild(z);v=mxUtils.button(mxResources.get("reset"),function(){f.value="";S.value="";U.value="";L.checked=!0;u=mxConstants.NONE;A();y=!1});mxEvent.addGestureListeners(v,function(){y=!0});v.className="geBtn";v.width="100";d.appendChild(v);if(Graph.fileSupport){var I=document.createElement("input");+I.setAttribute("multiple","multiple");I.setAttribute("type","file");mxEvent.addListener(I,"change",function(G){null!=I.files&&(C(I.files),I.type="",I.type="file",I.value="")});I.style.display="none";D.appendChild(I);v=mxUtils.button(mxResources.get("open"),function(){I.click()});v.className="geBtn";d.appendChild(v)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();E(null,function(G){l(""!=G&&null!=G?new mxImage(G,S.value,U.value):null,null==G,u,!mxClient.IS_SVG||mxClient.IS_SF?+null:O.checked)})});mxEvent.addGestureListeners(applyBtn,function(){F=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(z);D.appendChild(d);this.container=D},ParseDialog=function(b,l,n){function d(k,m,t){if("plantUmlPng"==m||"plantUmlSvg"==m||"plantUmlTxt"==m){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var x=function(g,p,B,K,M){A=mxEvent.isAltDown(t)?A:y.getCenterInsertPoint(new mxRectangle(0,0,K,M));var N=null;y.getModel().beginUpdate();try{N="txt"==p?b.insertAsPreText(B,A.x,A.y):y.insertVertex(null,null,null,A.x,A.y,K,M,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(B)+";"),y.setAttributeForCell(N,"plantUmlData",JSON.stringify({data:g,format:p},null,2))}finally{y.getModel().endUpdate()}null!=N&&(y.setSelectionCell(N),y.scrollCellToVisible(N))},y=b.editor.graph,F="plantUmlTxt"==m?"txt":"plantUmlPng"==m?"png":"svg";"@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"==-k&&"svg"==F?window.setTimeout(function(){b.spinner.stop();v(k,F,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",-295,212)},200):b.generatePlantUmlImage(k,F,function(g,p,B){b.spinner.stop();v(k,F,g,p,B)},function(g){b.handleError(g)})}}else if("mermaid"==m||"mermaid2drawio"==m)b.spinner.spin(document.body,mxResources.get("inserting"))&&b.parseMermaidDiagram(k,null,mxUtils.bind(this,function(g){b.spinner.stop();var p=b.editor.graph;p.setSelectionCells(b.importXml(g,Math.max(A.x,20),Math.max(A.y,20),!0,null,null,!0));p.scrollCellToVisible(p.getSelectionCell())}),mxUtils.bind(this,function(g){b.handleError(g)}),+k&&"svg"==F?window.setTimeout(function(){b.spinner.stop();x(k,F,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",+295,212)},200):b.generatePlantUmlImage(k,F,function(g,p,B){b.spinner.stop();x(k,F,g,p,B)},function(g){b.handleError(g)})}}else if("mermaid"==m||"mermaid2drawio"==m)b.spinner.spin(document.body,mxResources.get("inserting"))&&b.parseMermaidDiagram(k,null,mxUtils.bind(this,function(g){b.spinner.stop();var p=b.editor.graph;p.setSelectionCells(b.importXml(g,Math.max(A.x,20),Math.max(A.y,20),!0,null,null,!0));p.scrollCellToVisible(p.getSelectionCell())}),mxUtils.bind(this,function(g){b.handleError(g)}),null,"mermaid2drawio"==m);else if("table"==m){var E=k.split("\n");m=null;for(var C=[],S=0,U={},Q=0;Q<E.length;Q++){var O=mxUtils.trim(E[Q]);if("primary key"==O.substring(0,11).toLowerCase()){var q=O.match(/\((.+)\)/);q&&q[1]&&(U[q[1]]=!0);E.splice(Q,1)}else 0<O.toLowerCase().indexOf("primary key")&&(U[O.split(" ")[0]]=!0,E[Q]=mxUtils.trim(O.replace(/primary key/i,"")))}for(Q=0;Q<E.length;Q++)if(O=mxUtils.trim(E[Q]),"create table"==O.substring(0,12).toLowerCase())O=mxUtils.trim(O.substring(12)),"("==O.charAt(O.length-1)&&(O=mxUtils.trim(O.substring(0,O.length-1))),m=new mxCell(O,new mxGeometry(S,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),m.vertex=!0,C.push(m),O=b.editor.graph.getPreferredSizeForCell(u),null!=O&&(m.geometry.width=O.width+10);else if(null!=m&&")"==O.charAt(0))S+=m.geometry.width+40,m=null;else if("("!=O&&null!=m){O=O.substring(0,","==O.charAt(O.length-1)?O.length-1:O.length);q=U[O.split(" ")[0]];var u=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="+(q?"1":"0")+";");u.vertex=!0;var I=new mxCell(q?"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;"+(q?"fontStyle=1;":@@ -12336,18 +12336,18 @@ S.vertex=!0,O=y.getPreferredSizeForCell(S),null!=O&&S.geometry.width<O.width&&(Sy.scrollCellToVisible(y.getSelectionCell())}}}else{u=function(g){var p=G[g];null==p&&(p=new mxCell(g,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),p.vertex=!0,G[g]=p,C.push(p));return p};var G={};C=[];for(Q=0;Q<E.length;Q++)if(";"!=E[Q].charAt(0)){var H=E[Q].split("->");2<=H.length&&(q=u(H[0]),I=u(H[H.length-1]),H=new mxCell(2<H.length?H[1]:"",new mxGeometry),H.edge=!0,H.geometry.relative=!0,q.insertEdge(H,!0),I.insertEdge(H,!1),C.push(H))}if(0<C.length){E=document.createElement("div");E.style.visibility="hidden";document.body.appendChild(E);y=new Graph(E);y.getModel().beginUpdate();try{C=y.importCells(C);for(Q=0;Q<C.length;Q++)y.getModel().isVertex(C[Q])&&(O=y.getPreferredSizeForCell(C[Q]),C[Q].geometry.width=Math.max(C[Q].geometry.width,O.width),C[Q].geometry.height=Math.max(C[Q].geometry.height,O.height));Q=!0;"horizontalFlow"==m||"verticalFlow"==m?((new mxHierarchicalLayout(y,"horizontalFlow"==m?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(y.getDefaultParent(),C),Q=!1):"circle"==m?(new mxCircleLayout(y)).execute(y.getDefaultParent()):(S=new mxFastOrganicLayout(y),S.disableEdgeStyle=!1,S.forceConstant=180,S.execute(y.getDefaultParent()));Q&&(U=new mxParallelEdgeLayout(y),U.spacing=30,U.execute(y.getDefaultParent()))}finally{y.getModel().endUpdate()}y.clearCellOverlays();O=[];b.editor.graph.getModel().beginUpdate();try{C=y.getModel().getChildren(y.getDefaultParent()),A=mxEvent.isAltDown(t)?A:b.editor.graph.getCenterInsertPoint(y.getBoundingBoxFromGeometry(C,!0)),O=b.editor.graph.importCells(C,-A.x,A.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",O))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(O);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());y.destroy();E.parentNode.removeChild(E)}}}function x(){return"list"==D.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"==D.value||+A.x,A.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",O))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(O);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());y.destroy();E.parentNode.removeChild(E)}}}function v(){return"list"==D.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"==D.value||"mermaid2drawio"==D.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==D.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":"plantUmlPng"==D.value?"@startuml\nskinparam backgroundcolor transparent\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":"plantUmlSvg"==D.value||"plantUmlTxt"==D.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();l=document.createElement("div");var z=document.createElement("textarea");z.style.position="absolute";z.style.left="30px";z.style.right="30px";z.style.top="30px";z.style.bottom="100px";z.style.resize="none";z.setAttribute("wrap","off");z.setAttribute("spellcheck","false");z.setAttribute("autocorrect","off");z.setAttribute("autocomplete","off");z.setAttribute("autocapitalize","off");var D=document.createElement("select");D.className="geBtn";if("formatSql"==n||"mermaid"==n&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())D.style.display="none";var P=document.createElement("option");P.setAttribute("value","list");mxUtils.write(P,mxResources.get("list"));"plantUml"!=n&&"mermaid"!=n&&D.appendChild(P);null!=n&&"fromText"!=n||P.setAttribute("selected","selected");P=document.createElement("option");P.setAttribute("value","table");mxUtils.write(P,mxResources.get("formatSql"));"formatSql"==n&&(D.appendChild(P),P.setAttribute("selected","selected"));P=document.createElement("option");P.setAttribute("value","mermaid");mxUtils.write(P,mxResources.get("image"));if("mermaid"==n){if("undefined"!==typeof mxMermaidToDrawio){var J=document.createElement("option");J.setAttribute("value","mermaid2drawio");J.setAttribute("selected","selected");mxUtils.write(J,mxResources.get("diagram"));D.appendChild(J)}else D.style.display="none";D.appendChild(P)}P=document.createElement("option");P.setAttribute("value","diagram");mxUtils.write(P,mxResources.get("diagram"));J=document.createElement("option");J.setAttribute("value","circle");mxUtils.write(J,mxResources.get("circle"));var L=document.createElement("option");L.setAttribute("value","horizontalFlow");mxUtils.write(L,mxResources.get("horizontalFlow"));var c=document.createElement("option");c.setAttribute("value","verticalFlow");mxUtils.write(c,mxResources.get("verticalFlow"));"plantUml"!=n&&"mermaid"!=n&&(D.appendChild(P),D.appendChild(J),D.appendChild(L),D.appendChild(c));P=document.createElement("option");P.setAttribute("value","plantUmlSvg");mxUtils.write(P,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==n&&P.setAttribute("selected","selected");J=document.createElement("option");-J.setAttribute("value","plantUmlPng");mxUtils.write(J,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");L=document.createElement("option");L.setAttribute("value","plantUmlTxt");mxUtils.write(L,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==n&&(D.appendChild(P),D.appendChild(J),D.appendChild(L));var f=x();z.value=f;l.appendChild(z);P=document.createElement("div");P.style.position="absolute";P.style.bottom=+J.setAttribute("value","plantUmlPng");mxUtils.write(J,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");L=document.createElement("option");L.setAttribute("value","plantUmlTxt");mxUtils.write(L,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==n&&(D.appendChild(P),D.appendChild(J),D.appendChild(L));var f=v();z.value=f;l.appendChild(z);P=document.createElement("div");P.style.position="absolute";P.style.bottom="46px";P.style.right="30px";P.style.left="30px";P.style.justifyContent="end";P.style.display="flex";this.init=function(){z.focus()};Graph.fileSupport&&(z.addEventListener("dragover",function(k){k.stopPropagation();k.preventDefault()},!1),z.addEventListener("drop",function(k){k.stopPropagation();k.preventDefault();if(0<k.dataTransfer.files.length){k=k.dataTransfer.files[0];var m=new FileReader;m.onload=function(t){z.value=t.target.result};m.readAsText(k)}},!1));"plantUml"==n&&"https://plant-aws.diagrams.net"==window.PLANT_URL&&(J=document.createElement("div"),J.style.display="inline-block",J.style.color="#c00",J.style.fontSize="12px",J.style.marginRight="10px",J.style.display="flex",J.style.alignItems="center",J.innerHTML='<a href="https://github.com/jgraph/drawio/discussions/5074" target="_blank" rel="noopener noreferrer" style="color: #c00; text-decoration: underline;">PlantUML is deprecated</a>',P.appendChild(J));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=n&&"plantUml"!=n||P.appendChild(b.createHelpIcon("mermaid"==-n?"https://mermaid.js.org/intro/":"https://plantuml.com/"));P.appendChild(D);mxEvent.addListener(D,"change",function(){var k=x();if(0==z.value.length||z.value==f)f=k,z.value=f});n=mxUtils.button(mxResources.get("close"),function(){z.value==f?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});n.className="geBtn";b.editor.cancelFirst&&P.appendChild(n);J=mxUtils.button(mxResources.get("insert"),function(k){try{b.hideDialog(),d(z.value,D.value,k)}catch(m){b.handleError(m)}});-J.className="geBtn gePrimaryBtn";P.appendChild(J);b.editor.cancelFirst||P.appendChild(n);l.appendChild(P);this.container=l},NewDialog=function(b,l,n,d,x,A,z,D,P,J,L,c,f,k,m,t,v,y,F,E){function C(na){null!=na&&(La=Za=na?135:140);na=!0;if(null!=lb)for(;V<lb.length&&(na||0!=mxUtils.mod(V,30));){var Aa=lb[V++];Aa=I(Aa.url,Aa.libs,Aa.title,Aa.tooltip?Aa.tooltip:Aa.title,Aa.select,Aa.imgUrl,Aa.info,Aa.onClick,Aa.preview,Aa.noImg,Aa.clibs,Aa.type);na&&Aa.click();na=!1}}function S(na,Aa,sa,Da,va,ya){if(null!=+n?"https://mermaid.js.org/intro/":"https://plantuml.com/"));P.appendChild(D);mxEvent.addListener(D,"change",function(){var k=v();if(0==z.value.length||z.value==f)f=k,z.value=f});n=mxUtils.button(mxResources.get("close"),function(){z.value==f?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});n.className="geBtn";b.editor.cancelFirst&&P.appendChild(n);J=mxUtils.button(mxResources.get("insert"),function(k){try{b.hideDialog(),d(z.value,D.value,k)}catch(m){b.handleError(m)}});+J.className="geBtn gePrimaryBtn";P.appendChild(J);b.editor.cancelFirst||P.appendChild(n);l.appendChild(P);this.container=l},NewDialog=function(b,l,n,d,v,A,z,D,P,J,L,c,f,k,m,t,x,y,F,E){function C(na){null!=na&&(La=Za=na?135:140);na=!0;if(null!=lb)for(;V<lb.length&&(na||0!=mxUtils.mod(V,30));){var Aa=lb[V++];Aa=I(Aa.url,Aa.libs,Aa.title,Aa.tooltip?Aa.tooltip:Aa.title,Aa.select,Aa.imgUrl,Aa.info,Aa.onClick,Aa.preview,Aa.noImg,Aa.clibs,Aa.type);na&&Aa.click();na=!1}}function S(na,Aa,sa,Da,va,ya){if(null!=na&&mxUtils.isAncestorNode(document.body,Da)){na=mxUtils.parseXml(na);na=Editor.parseDiagramNode(na.documentElement,null,!0);var Ka=new mxCodec(na.ownerDocument),Na=new mxGraphModel;Ka.decode(na,Na);b.sidebar.createTooltip(Da,Na.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!=va?mxResources.get(va):null,!0,new mxPoint(Aa,sa),!0,function(){la=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=ya&&Q(Da,null,null,ya,infoObj,clibs)},!0,!1)}}function U(){if(ra==$a&&null==ta&&null!=bb&&null!=eb)d&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+eb.value+"'")&&(g=!0,b.hideDialog()),bb.click();else if(g&&b.spinner.stop(),za&&null!=k)n||g||b.hideDialog(),k(za,Ga,N.value);else if(d)n||g||b.hideDialog(),d(ta,N.value,Ba,ia);else{var na=N.value;if(null!=na&&0<na.length){var Aa=function(Da,va,ya){b.createFile(ya,ta,null!=ia&&0<ia.length?ia:null,Da,function(){g||b.hideDialog()},null,va,null,null!=ma&&0<ma.length?ma:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var sa=new SaveDialog(b,na,mxUtils.bind(this,function(Da,va,ya){Aa(va,ya,Da.value)}),null,null,null,null,b.mode);b.showDialog(sa.container,420,150,!0,!1);sa.init()}else b.pickFolder(b.mode,function(Da){Aa(b.mode,Da,na)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function Q(na,Aa,sa,Da,@@ -12367,7 +12367,7 @@ sa+" ("+ya.length+")");mxUtils.write(va,va.getAttribute("title"));null!=J&&(va.sya=null;if(null!=Qa[Da].content)va=document.createElement(Ka?"ul":"div"),sa=na(Da),va.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;",va.setAttribute("title",sa),mxUtils.write(va,sa),Ja.appendChild(va),sa=va;else{var Ka=Ta[Da];sa=va=document.createElement(Ka?"ul":"div");ya=Qa[Da];var Na=na(Da,ya);if(null!=Ka){ya=document.createElement("li");var Sa=document.createElement("div");Sa.className="geTempTreeCaret";Sa.setAttribute("title",Na);mxUtils.write(Sa,Na);sa=Sa;ya.appendChild(Sa);Na=document.createElement("ul");Na.className="geTempTreeNested";Na.style.visibility="hidden";for(var jb in Ka){var ab=document.createElement("li"),nb=na(jb,Ka[jb]);ab.setAttribute("title",nb);mxUtils.write(ab,nb);Aa(Da,ab,jb);Na.appendChild(ab)}ya.appendChild(Na);va.className="geTempTree";va.appendChild(ya);(function(Pa,gb){mxEvent.addListener(gb,"click",function(){Pa.style.visibility="visible";Pa.classList.toggle("geTempTreeActive");Pa.classList.toggle("geTempTreeNested")&&setTimeout(function(){Pa.style.visibility="hidden"},550);gb.classList.toggle("geTempTreeCaret-down")})})(Na,Sa)}else va.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;",va.setAttribute("title",Na),mxUtils.write(va,Na);null!=J&&(va.style.padding=J);Ja.appendChild(va)}Aa(Da,sa);null==Xa&&sa.click()}C(!1)}-var H=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);n=null!=n?n:!0;x=null!=x?x:!1;z=null!=z?z:"light-dark(#ebf2f9, "+Editor.darkColor+")";L=null!=L?L:EditorUi.templateFile;var g=!1,p=document.createElement("div");p.style.userSelect="none";p.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";n&&p.appendChild(B);var K=document.createElement("img");K.setAttribute("border","0");K.setAttribute("align","absmiddle");+var H=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);n=null!=n?n:!0;v=null!=v?v:!1;z=null!=z?z:"light-dark(#ebf2f9, "+Editor.darkColor+")";L=null!=L?L:EditorUi.templateFile;var g=!1,p=document.createElement("div");p.style.userSelect="none";p.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";n&&p.appendChild(B);var K=document.createElement("img");K.setAttribute("border","0");K.setAttribute("align","absmiddle");K.style.width="40px";K.style.height="40px";K.style.marginRight="10px";K.style.paddingBottom="4px";K.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_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||H||!n||B.appendChild(K);n&&mxUtils.write(B,(H?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var M=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?M=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?M=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?M=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?M=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?M=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(M=b.trello.extension);var N=document.createElement("input");N.setAttribute("value",b.defaultFilename+M);N.style.marginLeft="10px";N.style.width=l||H?"144px":"244px";this.init=function(){n&&Editor.selectFilename(N);null!=xa.parentNode&&null!=xa.parentNode.parentNode&&mxEvent.addGestureListeners(xa.parentNode.parentNode,mxUtils.bind(this,function(na){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};@@ -12389,11 +12389,11 @@ mxEvent.consume(na)});Ua.appendChild(eb);Ua.appendChild(bb);Ua.appendChild(Ma);Uhb=0,db=!0,Xa=null,mb=null;Qa.basic=E?[]:[{title:"blankDiagram"}];var lb=Qa.basic;Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&Qa.basic.push({title:"generate",type:"generative"});if(!l){var vb=function(){mxUtils.get(sb,function(na){if(!zb){zb=!0;na=na.getXml().documentElement.firstChild;for(var Aa={};null!=na;){if("undefined"!==typeof na.getAttribute)if("parsererror"==na.nodeName)null!=window.console&&console.log("Parser error in "+L+": "+na.textContent);else if("clibs"==na.nodeName){for(var sa=na.getAttribute("name"),Da=na.getElementsByTagName("add"),va=[],ya=0;ya<Da.length;ya++)va.push(encodeURIComponent(mxUtils.getTextContent(Da[ya])));null!=sa&&0<va.length&&(Aa[sa]=va.join(";"))}else if(va=na.getAttribute("url"),null!=va){Da=na.getAttribute("section");sa=na.getAttribute("subsection");if(null==Da&&(ya=va.indexOf("/"),Da=va.substring(0,ya),null==sa)){var Ka=va.indexOf("/",ya+1);-1<Ka&&(sa=va.substring(ya+1,Ka))}ya=Qa[Da];null==ya&&(ya=[],Qa[Da]=ya);va=na.getAttribute("clibs");null!=Aa[va]&&(va=Aa[va]);va={url:na.getAttribute("url"),libs:na.getAttribute("libs"),title:na.getAttribute("title"),tooltip:na.getAttribute("name")||na.getAttribute("url"),preview:na.getAttribute("preview"),clibs:va,tags:na.getAttribute("tags")};ya.push(va);null!=sa&&(ya=Ta[Da],null==ya&&(ya={},Ta[Da]=ya),Da=ya[sa],null==Da&&(Da=[],ya[sa]=Da),Da.push(va))}na=na.nextSibling}X.stop();G()}})};p.appendChild(Ca);p.appendChild(Ja);-p.appendChild(xa);var zb=!1,sb=L;/^https?:\/\//.test(sb)&&!b.editor.isCorsEnabledForUrl(sb)&&(sb=PROXY_URL+"?url="+encodeURIComponent(sb));X.spin(xa);null!=v?v(function(na,Aa){Va=na;ka=hb=Aa;vb()},vb):vb();ja=Qa}mxEvent.addListener(N,"keypress",function(na){b.dialog.container.firstChild==p&&13==na.keyCode&&U()});var kb=document.createElement("div");kb.style.marginTop=l?"4px":"16px";kb.style.textAlign="right";kb.style.position="absolute";kb.style.left="40px";kb.style.bottom="24px";kb.style.right="40px";-var wb=mxUtils.button(mxResources.get("cancel"),function(){null!=A&&A();b.hideDialog(!0)});wb.className="geBtn";!b.editor.cancelFirst||x&&null==A||kb.appendChild(wb);if(!(l||"1"==urlParams.embed||x||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Ab=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var na=new FilenameDialog(b,"",mxResources.get("create"),function(Aa){null!=Aa&&0<Aa.length&&b.editor.loadUrl(b.editor.getProxiedUrl(Aa),function(sa){ta=sa;ia=null;templateRealURl=+p.appendChild(xa);var zb=!1,sb=L;/^https?:\/\//.test(sb)&&!b.editor.isCorsEnabledForUrl(sb)&&(sb=PROXY_URL+"?url="+encodeURIComponent(sb));X.spin(xa);null!=x?x(function(na,Aa){Va=na;ka=hb=Aa;vb()},vb):vb();ja=Qa}mxEvent.addListener(N,"keypress",function(na){b.dialog.container.firstChild==p&&13==na.keyCode&&U()});var kb=document.createElement("div");kb.style.marginTop=l?"4px":"16px";kb.style.textAlign="right";kb.style.position="absolute";kb.style.left="40px";kb.style.bottom="24px";kb.style.right="40px";+var wb=mxUtils.button(mxResources.get("cancel"),function(){null!=A&&A();b.hideDialog(!0)});wb.className="geBtn";!b.editor.cancelFirst||v&&null==A||kb.appendChild(wb);if(!(l||"1"==urlParams.embed||v||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var Ab=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var na=new FilenameDialog(b,"",mxResources.get("create"),function(Aa){null!=Aa&&0<Aa.length&&b.editor.loadUrl(b.editor.getProxiedUrl(Aa),function(sa){ta=sa;ia=null;templateRealURl=Aa;b.hideDialog();U()},function(sa){b.handleError(sa)})},mxResources.get("url"),null,null,null,!1);b.showDialog(na.container,300,80,!0,!0);na.init()});Ab.className="geBtn";kb.appendChild(Ab)}if(Graph.fileSupport&&m){var Bb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var na=document.createElement("input");na.setAttribute("multiple","multiple");na.setAttribute("type","file");mxEvent.addListener(na,"change",function(Aa){b.openFiles(na.files,!0);na.value=""});na.style.display=-"none";document.body.appendChild(na);b.newDlgFileInputElt=na}b.newDlgFileInputElt.click()});Bb.className="geBtn";kb.appendChild(Bb)}kb.appendChild(W);b.editor.cancelFirst||null!=d||x&&null==A||kb.appendChild(wb);p.appendChild(kb);this.container=p};NewDialog.tagsList={};-var SaveDialog=function(b,l,n,d,x,A,z,D,P,J,L){function c(g,p,B,K,M,N){var R=null;if((null==d||0>mxUtils.indexOf(d,g))&&(null==P||g==P)&&(null==J||0<=mxUtils.indexOf(J,g))){M=null!=M?M:b.getTitleForService(g);var T=0<=mxUtils.indexOf(u,g);if(T||null!=b.getServiceForName(g)){R=document.createElement("option");var V="";!T&&b.isOffline(g==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(R.setAttribute("disabled","disabled"),V=" ("+mxResources.get("offline")+")");if("pick"==N)R.innerHTML=mxUtils.htmlEntities(M)++"none";document.body.appendChild(na);b.newDlgFileInputElt=na}b.newDlgFileInputElt.click()});Bb.className="geBtn";kb.appendChild(Bb)}kb.appendChild(W);b.editor.cancelFirst||null!=d||v&&null==A||kb.appendChild(wb);p.appendChild(kb);this.container=p};NewDialog.tagsList={};+var SaveDialog=function(b,l,n,d,v,A,z,D,P,J,L){function c(g,p,B,K,M,N){var R=null;if((null==d||0>mxUtils.indexOf(d,g))&&(null==P||g==P)&&(null==J||0<=mxUtils.indexOf(J,g))){M=null!=M?M:b.getTitleForService(g);var T=0<=mxUtils.indexOf(u,g);if(T||null!=b.getServiceForName(g)){R=document.createElement("option");var V="";!T&&b.isOffline(g==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(R.setAttribute("disabled","disabled"),V=" ("+mxResources.get("offline")+")");if("pick"==N)R.innerHTML=mxUtils.htmlEntities(M)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+V,R.setAttribute("value","pickFolder-"+g),R.setAttribute("title",M+" - "+mxResources.get("pickFolder")+"...");else{T=g+(null!=B?"-"+B:"");var X=G[T];null!=X&&null!=X.option&&X.option.parentNode.removeChild(X.option);X=null;if(null!=p){"/"==p.charAt(p.length-1)&&(p=p.substring(0,p.length-1));"/"==p.charAt(0)&&(p=p.substring(1));X=p;if(g!=App.MODE_GITHUB&&g==App.MODE_GITLAB){var W=X.lastIndexOf("/");0<=W&&(X=X.substring(W+1))}40<X.length&&(X=X.substring(0,20)+"..."+X.substring(X.length-20))}R.innerHTML=mxUtils.htmlEntities(M)+(null!=X?" – "+mxUtils.htmlEntities(X):"")+V;R.setAttribute("title",M+(null!=p?" ("+p+")":"")+(null!=B&&decodeURIComponent(B)!=p?" ["+B+"]":""));R.setAttribute("value",T);G[T]={option:R,mode:g,path:p,id:B};SaveDialog.lastValue==T&&null==D&&"disabled"==!R.getAttribute("disabled")?K=!0:null==K&&("root"==N?K=null==D&&b.mode==g||null!=g&&g==D:"pickFolder-"==q.value.substring(0,11)&&(K=!0));K&&R.setAttribute("selected","selected")}q.appendChild(R)}}return R}function f(g){b.pickFolder(g,function(p){var B=null;g==App.MODE_GOOGLE&&null!=p.docs&&0<p.docs.length?B={mode:g,path:p.docs[0].name,id:p.docs[0].id}:g==App.MODE_ONEDRIVE&&null!=p.value&&0<p.value.length?B={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&&(B={mode:g,path:decodeURIComponent(p),id:p});null!=B&&(b.addRecent(B,@@ -12401,22 +12401,22 @@ q.value.substring(0,11)&&(K=!0));K&&R.setAttribute("selected","selected")}q.appenull,null,"root"),c(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&c(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);c(App.MODE_GITHUB,null,null,null,null,"pick");c(App.MODE_GITLAB,null,null,null,null,"pick");c(App.MODE_TRELLO);g=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&g&&c(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&&c(App.MODE_BROWSER);g&&c("download");Editor.popupsAllowed&&c("_blank",null,null,null,mxResources.get("openInNewWindow"));"pickFolder-"==q.value.substring(0,11)&&(g=document.createElement("option"),g.setAttribute("value",""),g.setAttribute("selected","selected"),mxUtils.write(g,mxResources.get("pickFolder")+"..."),q.insertBefore(g,q.firstChild));I=q.value}function m(){if("pickFolder-"==q.value.substring(0,11)){var g=q.value.substring(11);q.value=I;f(g)}else if(null!=O&&null!=G[q.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[O.value].extension){g=b.getExtensionForService(G[q.value].mode);var p=Q.value;null!=g&&0>l.indexOf(".")&&0>p.indexOf(".")&&(Q.value=p+g)}H.innerHTML="";mxUtils.write(H,null!=L?L:mxResources.get("download"==q.value||"_blank"==q.value||null!=P?"ok":"save"));""==q.value?H.setAttribute("disabled","disabled"):H.removeAttribute("disabled")}var t=document.createElement("div");t.style.display="flex";t.style.flexWrap="wrap";t.style.whiteSpace=-"nowrap";var v=document.createElement("div");v.style.display="grid";v.style.gap="5px 8px";v.style.gridAutoRows="auto auto 44px";v.style.gridAutoColumns="0fr minmax(0,1fr)";v.style.width="100%";var y=null,F=null;if(null!=x&&null!=A&&"image/"==A.substring(0,6)&&("image/svg"!=A.substring(0,9)||mxClient.IS_SVG)){v.style.display="inline-grid";v.style.flexBasis="75%";y=document.createElement("div");y.style.display="inline-block";y.style.height="auto";y.style.maxWidth="25%";y.style.margin="auto";var E=document.createElement("img"),-C=z?x:btoa(unescape(encodeURIComponent(x))),S="data:"+A+";base64,"+C;E.setAttribute("src",S);E.style.boxSizing="border-box";E.style.maxHeight="50px";E.style.maxWidth="100%";E.style.paddingLeft="10px";y.appendChild(E);"image/png"!=A&&"image/svg+xml"!=A||"function"!==typeof window.ClipboardItem||null==navigator.clipboard||(F=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(S,null,null,A,mxUtils.bind(this,function(){"copy"==D?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"))?(y.setAttribute("title",mxResources.get("openInNewWindow")),y.style.cursor="pointer",mxEvent.addGestureListeners(y,null,null,function(g){mxEvent.isPopupTrigger(g)||b.openInNewWindow(x,A,z)})):y.setAttribute("title",mxResources.get("preview"))}C=document.createElement("div");C.style.display="flex";C.style.padding="1px";C.style.alignItems="center";C.style.justifyContent="flex-end";-C.style.gridColumn="1";C.style.whiteSpace="nowrap";var U=document.createElement("div");U.style.display="grid";U.style.padding="1px";U.style.alignItems="center";U.style.gridColumn="2";U.style.gridAutoColumns="minmax(0,1fr) auto";U.style.gap="6px";mxUtils.write(C,mxResources.get("saveAs")+":");var Q=document.createElement("input");Q.setAttribute("type","text");Q.setAttribute("value",l);Q.style.boxSizing="border-box";Q.style.width="100%";U.appendChild(Q);null==P&&(v.appendChild(C),v.appendChild(U));-var O=null;null!=b.editor.diagramFileTypes&&null==A&&null==P&&(C=C.cloneNode(!1),U=U.cloneNode(!1),mxUtils.write(C,mxResources.get("type")+":"),O=FilenameDialog.createFileTypes(b,Q,b.editor.diagramFileTypes),O.style.boxSizing="border-box",O.style.width="100%",U.appendChild(O),v.appendChild(C),v.appendChild(U));C=C.cloneNode(!1);U=U.cloneNode(!1);mxUtils.write(C,mxResources.get("where")+":");var q=document.createElement("select");q.style.textOverflow="ellipsis";q.style.gridColumn="1";var u=["browser",+"nowrap";var x=document.createElement("div");x.style.display="grid";x.style.gap="5px 8px";x.style.gridAutoRows="auto auto 44px";x.style.gridAutoColumns="0fr minmax(0,1fr)";x.style.width="100%";var y=null,F=null;if(null!=v&&null!=A&&"image/"==A.substring(0,6)&&("image/svg"!=A.substring(0,9)||mxClient.IS_SVG)){x.style.display="inline-grid";x.style.flexBasis="75%";y=document.createElement("div");y.style.display="inline-block";y.style.height="auto";y.style.maxWidth="25%";y.style.margin="auto";var E=document.createElement("img"),+C=z?v:btoa(unescape(encodeURIComponent(v))),S="data:"+A+";base64,"+C;E.setAttribute("src",S);E.style.boxSizing="border-box";E.style.maxHeight="50px";E.style.maxWidth="100%";E.style.paddingLeft="10px";y.appendChild(E);"image/png"!=A&&"image/svg+xml"!=A||"function"!==typeof window.ClipboardItem||null==navigator.clipboard||(F=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(S,null,null,A,mxUtils.bind(this,function(){"copy"==D?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"))?(y.setAttribute("title",mxResources.get("openInNewWindow")),y.style.cursor="pointer",mxEvent.addGestureListeners(y,null,null,function(g){mxEvent.isPopupTrigger(g)||b.openInNewWindow(v,A,z)})):y.setAttribute("title",mxResources.get("preview"))}C=document.createElement("div");C.style.display="flex";C.style.padding="1px";C.style.alignItems="center";C.style.justifyContent="flex-end";+C.style.gridColumn="1";C.style.whiteSpace="nowrap";var U=document.createElement("div");U.style.display="grid";U.style.padding="1px";U.style.alignItems="center";U.style.gridColumn="2";U.style.gridAutoColumns="minmax(0,1fr) auto";U.style.gap="6px";mxUtils.write(C,mxResources.get("saveAs")+":");var Q=document.createElement("input");Q.setAttribute("type","text");Q.setAttribute("value",l);Q.style.boxSizing="border-box";Q.style.width="100%";U.appendChild(Q);null==P&&(x.appendChild(C),x.appendChild(U));+var O=null;null!=b.editor.diagramFileTypes&&null==A&&null==P&&(C=C.cloneNode(!1),U=U.cloneNode(!1),mxUtils.write(C,mxResources.get("type")+":"),O=FilenameDialog.createFileTypes(b,Q,b.editor.diagramFileTypes),O.style.boxSizing="border-box",O.style.width="100%",U.appendChild(O),x.appendChild(C),x.appendChild(U));C=C.cloneNode(!1);U=U.cloneNode(!1);mxUtils.write(C,mxResources.get("where")+":");var q=document.createElement("select");q.style.textOverflow="ellipsis";q.style.gridColumn="1";var u=["browser","device","download","_blank"],I=null,G={};E=mxUtils.button(mxResources.get("reset"),function(){Q.value=l;Q.dispatchEvent(new Event("change"));b.resetRecent("Folders");q.innerHTML="";q.value="";pickFolderOption=null;G={};k()},null,"geBtn");var H=mxUtils.button("",function(){SaveDialog.lastValue=q.value;var g=G[SaveDialog.lastValue];null!=g&&n(Q,g.mode,g.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(Q,"keypress",function(g){13==g.keyCode&&("copy"==D&&null!=F?F.click():H.click())});mxEvent.addListener(q,-"change",m);k();U.appendChild(q);null!=SaveDialog.lastValue&&null!=G[SaveDialog.lastValue]&&(q.value=SaveDialog.lastValue);m();v.appendChild(C);v.appendChild(U);t.appendChild(v);null!=y&&t.appendChild(y);v=document.createElement("div");v.style.flexBasis="100%";v.style.textAlign="right";v.style.marginTop=null!=A?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||v.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));y=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},-null,"geBtn");b.editor.cancelFirst&&v.appendChild(y);v.appendChild(E);"copy"==D&&null!=F?(F.className="geBtn gePrimaryBtn",H.className="geBtn",v.appendChild(H),v.appendChild(F)):(null!=F&&v.appendChild(F),v.appendChild(H));b.editor.cancelFirst||v.appendChild(y);t.appendChild(v);this.init=function(){Editor.selectFilename(Q)};this.container=t},CreateDialog=function(b,l,n,d,x,A,z,D,P,J,L,c,f,k,m,t,v){function y(q,u,I,G){function H(){mxEvent.addListener(g,"click",function(){var N=I;if(z){var R=C.value,+"change",m);k();U.appendChild(q);null!=SaveDialog.lastValue&&null!=G[SaveDialog.lastValue]&&(q.value=SaveDialog.lastValue);m();x.appendChild(C);x.appendChild(U);t.appendChild(x);null!=y&&t.appendChild(y);x=document.createElement("div");x.style.flexBasis="100%";x.style.textAlign="right";x.style.marginTop=null!=A?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||x.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));y=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},+null,"geBtn");b.editor.cancelFirst&&x.appendChild(y);x.appendChild(E);"copy"==D&&null!=F?(F.className="geBtn gePrimaryBtn",H.className="geBtn",x.appendChild(H),x.appendChild(F)):(null!=F&&x.appendChild(F),x.appendChild(H));b.editor.cancelFirst||x.appendChild(y);t.appendChild(x);this.init=function(){Editor.selectFilename(Q)};this.container=t},CreateDialog=function(b,l,n,d,v,A,z,D,P,J,L,c,f,k,m,t,x){function y(q,u,I,G){function H(){mxEvent.addListener(g,"click",function(){var N=I;if(z){var R=C.value,T=R.lastIndexOf(".");if(0>l.lastIndexOf(".")&&0>T){N=null!=N?N:O.value;var V="";N==App.MODE_GOOGLE?V=b.drive.extension:N==App.MODE_GITHUB?V=b.gitHub.extension:N==App.MODE_GITLAB?V=b.gitLab.extension:N==App.MODE_TRELLO?V=b.trello.extension:N==App.MODE_DROPBOX?V=b.dropbox.extension:N==App.MODE_ONEDRIVE?V=b.oneDrive.extension:N==App.MODE_DEVICE&&(V=".drawio");0<=T&&(R=R.substring(0,T));C.value=R+V}}F(I)})}var g=document.createElement("a");g.style.overflow="hidden";var p=document.createElement("img");p.src=q;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 B=document.createElement("div");g.appendChild(B);mxUtils.write(B,u);if(null!=G&&null==b[G]){p.style.visibility="hidden";mxUtils.setOpacity(B,10);var K=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});K.spin(g);var M=window.setTimeout(function(){null==b[G]&&(K.stop(),g.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[G]&&(window.clearTimeout(M),mxUtils.setOpacity(B,100),p.style.visibility="",K.stop(),H())}))}else H();U.appendChild(g);++Q==c&&(mxUtils.br(U),Q=0)}function F(q){var u=C.value;-if(null==q||null!=u&&0<u.length)v&&b.hideDialog(),n(u,q,C)}L="1"==urlParams.noDevice?!1:L;z=null!=z?z:!0;D=null!=D?D:!0;c=null!=c?c:4;v=null!=v?v:!0;A=document.createElement("div");A.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(A);var E=document.createElement("h2");mxUtils.write(E,x||mxResources.get("create"));E.style.marginTop="0px";E.style.marginBottom="24px";A.appendChild(E);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 C=document.createElement("input");C.setAttribute("value",l);C.style.width="180px";C.style.marginLeft="10px";C.style.marginBottom="20px";C.style.maxWidth="70%";this.init=function(){Editor.selectFilename(C)};A.appendChild(C);null!=t&&null!=b.editor.diagramFileTypes&&(t=FilenameDialog.createFileTypes(b,C,b.editor.diagramFileTypes),t.style.marginLeft="6px",t.style.width="90px",A.appendChild(t));t=null;if("1"!=-urlParams.noDevice&&null!=f&&null!=k&&"image/"==k.substring(0,6)&&("image/svg"!=k.substring(0,9)||mxClient.IS_SVG)){C.style.width="160px";x=document.createElement("img");var S=m?f:btoa(unescape(encodeURIComponent(f)));x.setAttribute("src","data:"+k+";base64,"+S);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"!=k||null==+if(null==q||null!=u&&0<u.length)x&&b.hideDialog(),n(u,q,C)}L="1"==urlParams.noDevice?!1:L;z=null!=z?z:!0;D=null!=D?D:!0;c=null!=c?c:4;x=null!=x?x:!0;A=document.createElement("div");A.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(A);var E=document.createElement("h2");mxUtils.write(E,v||mxResources.get("create"));E.style.marginTop="0px";E.style.marginBottom="24px";A.appendChild(E);v=document.createElement("span");mxUtils.write(v,mxResources.get("filename")+":");v.style.maxWidth="106px";v.style.overflow=+"hidden";v.style.textOverflow="ellipsis";v.style.display="inline-block";A.appendChild(v);var C=document.createElement("input");C.setAttribute("value",l);C.style.width="180px";C.style.marginLeft="10px";C.style.marginBottom="20px";C.style.maxWidth="70%";this.init=function(){Editor.selectFilename(C)};A.appendChild(C);null!=t&&null!=b.editor.diagramFileTypes&&(t=FilenameDialog.createFileTypes(b,C,b.editor.diagramFileTypes),t.style.marginLeft="6px",t.style.width="90px",A.appendChild(t));t=null;if("1"!=+urlParams.noDevice&&null!=f&&null!=k&&"image/"==k.substring(0,6)&&("image/svg"!=k.substring(0,9)||mxClient.IS_SVG)){C.style.width="160px";v=document.createElement("img");var S=m?f:btoa(unescape(encodeURIComponent(f)));v.setAttribute("src","data:"+k+";base64,"+S);v.style.position="absolute";v.style.top="70px";v.style.right="100px";v.style.maxWidth="120px";v.style.maxHeight="80px";mxUtils.setPrefixedStyle(v.style,"transform","translate(50%,-50%)");A.appendChild(v);mxClient.IS_FF||"image/png"!=k||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(t=mxUtils.button(mxResources.get("copy"),function(q){q=b.base64ToBlob(S,"image/png");q=new ClipboardItem({"image/png":q,"text/html":new Blob(['<img src="data:'+k+";base64,"+S+'">'],{type:"text/html"})});navigator.clipboard.write([q]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(u){b.handleError(u)}))}),t.style.marginTop="6px",t.className="geBtn");P&&Editor.popupsAllowed&&-(x.style.cursor="pointer",mxEvent.addGestureListeners(x,null,null,function(q){mxEvent.isPopupTrigger(q)||F("_blank")}))}mxUtils.br(A);var U=document.createElement("div");U.style.textAlign="center";var Q=0;U.style.marginTop="6px";A.appendChild(U);var O=document.createElement("select");O.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(f,mxResources.get("googleDrive")),+(v.style.cursor="pointer",mxEvent.addGestureListeners(v,null,null,function(q){mxEvent.isPopupTrigger(q)||F("_blank")}))}mxUtils.br(A);var U=document.createElement("div");U.style.textAlign="center";var Q=0;U.style.marginTop="6px";A.appendChild(U);var O=document.createElement("select");O.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(f,mxResources.get("googleDrive")),O.appendChild(f),y(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(f,mxResources.get("oneDrive")),O.appendChild(f),b.mode==App.MODE_ONEDRIVE&&f.setAttribute("selected","selected"),y(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(f,mxResources.get("dropbox")),O.appendChild(f),b.mode==App.MODE_DROPBOX&&f.setAttribute("selected","selected"),y(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_GITHUB),mxUtils.write(f,mxResources.get("github")),O.appendChild(f),y(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_GITLAB),mxUtils.write(f,mxResources.get("gitlab")),O.appendChild(f),y(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(f=document.createElement("option"),f.setAttribute("value",App.MODE_TRELLO),mxUtils.write(f,mxResources.get("trello")),O.appendChild(f),y(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||@@ -12424,37 +12424,37 @@ f.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(f,mxResources.get("dropbomxResources.get("browser")),O.appendChild(D),b.mode==App.MODE_BROWSER&&D.setAttribute("selected","selected"),y(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));D=document.createElement("div");D.style.marginTop="26px";D.style.textAlign="center";null!=J&&(L=mxUtils.button(mxResources.get("help"),function(){b.openLink(J)}),L.className="geBtn",D.appendChild(L));L=mxUtils.button(mxResources.get(null!=d?"close":"cancel"),function(){null!=d?d():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});L.className="geBtn";b.editor.cancelFirst&&null==d&&D.appendChild(L);null==d&&(f=mxUtils.button(mxResources.get("decideLater"),function(){F(null)}),f.className="geBtn",D.appendChild(f));P&&Editor.popupsAllowed&&(P=mxUtils.button(mxResources.get("openInNewWindow"),function(){F("_blank")}),P.className="geBtn",D.appendChild(P));CreateDialog.showDownloadButton&&(P=mxUtils.button(mxResources.get("download"),function(){F("download")}),P.className="geBtn",D.appendChild(P),null!=t&&(P.style.marginTop="6px",D.style.marginTop="6px"));null!=t&&(mxUtils.br(D),D.appendChild(t));b.editor.cancelFirst&&null==d||D.appendChild(L);mxEvent.addListener(C,"keypress",function(q){13==q.keyCode?F(App.MODE_DEVICE):27==q.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});A.appendChild(D);this.container=A};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;-var PopupDialog=function(b,l,n,d,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 z=mxUtils.button(mxResources.get("openInThisWindow"),function(){x&&b.hideDialog();null!=d&&d()});z.className="geBtn";z.style.marginBottom="8px";z.style.width="280px";A.appendChild(z);mxUtils.br(A);var D=mxUtils.button(mxResources.get("openInNewWindow"),function(){x&&b.hideDialog();-null!=n&&n();b.openLink(l,null,!0)});D.className="geBtn gePrimaryBtn";D.style.width=z.style.width;A.appendChild(D);mxUtils.br(A);mxUtils.br(A);mxUtils.write(A,mxResources.get("allowPopups"));this.container=A},ImageDialog=function(b,l,n,d,x,A,z,D){function P(){0<c.value.length?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled");"data:"!=c.value.substring(0,5)?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")}A=null!=A?A:!0;var J=b.editor.graph,L=document.createElement("div");+var PopupDialog=function(b,l,n,d,v){v=null!=v?v:!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 z=mxUtils.button(mxResources.get("openInThisWindow"),function(){v&&b.hideDialog();null!=d&&d()});z.className="geBtn";z.style.marginBottom="8px";z.style.width="280px";A.appendChild(z);mxUtils.br(A);var D=mxUtils.button(mxResources.get("openInNewWindow"),function(){v&&b.hideDialog();+null!=n&&n();b.openLink(l,null,!0)});D.className="geBtn gePrimaryBtn";D.style.width=z.style.width;A.appendChild(D);mxUtils.br(A);mxUtils.br(A);mxUtils.write(A,mxResources.get("allowPopups"));this.container=A},ImageDialog=function(b,l,n,d,v,A,z,D){function P(){0<c.value.length?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled");"data:"!=c.value.substring(0,5)?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")}A=null!=A?A:!0;var J=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 c=document.createElement("input");c.setAttribute("value",n);c.setAttribute("type","text");c.setAttribute("spellcheck","false");c.setAttribute("autocorrect","off");c.setAttribute("autocomplete","off");c.setAttribute("autocapitalize","off");c.style.marginTop="6px";c.style.width=(Graph.fileSupport?460:340)-20+"px";c.style.backgroundImage="url('"+Editor.crossImage+"')";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="100% 50%";c.style.paddingRight="14px";n=document.createElement("div");n.setAttribute("title",mxResources.get("reset"));n.style.position="relative";n.style.left="-16px";n.style.width="12px";n.style.height="14px";n.style.cursor="pointer";n.style.display="inline-block";n.style.top="3px";n.style.background="url('"+b.editor.transparentImage+"')";mxEvent.addListener(n,"click",function(){c.value="";c.focus()});l.appendChild(c);l.appendChild(n);L.appendChild(l);var f=D,k,m,t=function(C,S,U,Q){var O="data:"==C.substring(0,5);!b.isOffline()||O&&"undefined"===typeof chrome?0<C.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(C,function(q){b.spinner.stop();b.hideDialog();var u=!1===Q?1:null!=S&&null!=U?Math.max(S/q.width,U/q.height):Math.min(1,Math.min(520/q.width,520/q.height));A&&(C=b.convertDataUri(C));d(C,-Math.round(Number(q.width)*u),Math.round(Number(q.height)*u),f,k,m)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(C,null,null,f,k,m)):(C=b.convertDataUri(C),S=null==S?120:S,U=null==U?100:U,b.hideDialog(),d(C,S,U,f,k,m))},v=function(C,S){if(null!=C){var U=x?null:J.getModel().getGeometry(J.getSelectionCell());null!=U?t(C,U.width,U.height,S):t(C,null,null,S)}else b.hideDialog(),d(null)};this.init=function(){c.focus();+Math.round(Number(q.width)*u),Math.round(Number(q.height)*u),f,k,m)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(C,null,null,f,k,m)):(C=b.convertDataUri(C),S=null==S?120:S,U=null==U?100:U,b.hideDialog(),d(C,S,U,f,k,m))},x=function(C,S){if(null!=C){var U=v?null:J.getModel().getGeometry(J.getSelectionCell());null!=U?t(C,U.width,U.height,S):t(C,null,null,S)}else b.hideDialog(),d(null)};this.init=function(){c.focus();if(Graph.fileSupport){c.setAttribute("placeholder",mxResources.get("dragImagesHere"));var C=L.parentNode,S=null;mxEvent.addListener(C,"dragleave",function(U){null!=S&&(S.parentNode.removeChild(S),S=null);U.stopPropagation();U.preventDefault()});mxEvent.addListener(C,"dragover",mxUtils.bind(this,function(U){null==S&&(S=b.highlightElement(C));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(C,"drop",mxUtils.bind(this,function(U){null!=S&&(S.parentNode.removeChild(S),S=null);if(0<U.dataTransfer.files.length)b.importFiles(U.dataTransfer.files,-0,0,b.maxImageSize,function(O,q,u,I,G,H,g,p){v(O,p)},function(){},function(O){return"image/"==O.type.substring(0,6)},function(O){for(var q=0;q<O.length;q++)O[q]()},!mxEvent.isControlDown(U),null,null,!0);else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")){var Q=U.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(Q)&&v(decodeURIComponent(Q))}U.stopPropagation();U.preventDefault()}),!1)}};D=document.createElement("div");D.style.marginTop="14px";D.style.textAlign=+0,0,b.maxImageSize,function(O,q,u,I,G,H,g,p){x(O,p)},function(){},function(O){return"image/"==O.type.substring(0,6)},function(O){for(var q=0;q<O.length;q++)O[q]()},!mxEvent.isControlDown(U),null,null,!0);else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")){var Q=U.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(Q)&&x(decodeURIComponent(Q))}U.stopPropagation();U.preventDefault()}),!1)}};D=document.createElement("div");D.style.marginTop="14px";D.style.textAlign="center";n=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});n.className="geBtn";b.editor.cancelFirst&&D.appendChild(n);ImageDialog.filePicked=function(C){C.action==google.picker.Action.PICKED&&null!=C.docs[0].thumbnails&&(C=C.docs[0].thumbnails[C.docs[0].thumbnails.length-1],null!=C&&(c.value=C.url));c.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var y=document.createElement("input");y.setAttribute("multiple","multiple");y.setAttribute("type",-"file");mxEvent.addListener(y,"change",function(C){null!=y.files&&(b.importFiles(y.files,0,0,b.maxImageSize,function(S,U,Q,O,q,u){v(S)},function(){},function(S){return"image/"==S.type.substring(0,6)},function(S){for(var U=0;U<S.length;U++)S[U]()},!0),y.type="",y.type="file",y.value="")});y.style.display="none";document.body.appendChild(y);b.imgDlgFileInputElt=y}l=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});l.className="geBtn";D.appendChild(l)}mxEvent.addListener(c,-"keypress",function(C){13==C.keyCode&&v(c.value)});var F=mxUtils.button(mxResources.get("crop"),function(){var C=new CropImageDialog(b,c.value,f,function(S,U,Q){f=S;k=U;m=Q});b.showDialog(C.container,300,390,!0,!0)});z&&(F.className="geBtn",D.appendChild(F));var E=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=c.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var C=b.editor.createImageUrlConverter().convert(c.value),S=new Image;S.onload=function(){b.editor.convertImageToDataUri(C,+"file");mxEvent.addListener(y,"change",function(C){null!=y.files&&(b.importFiles(y.files,0,0,b.maxImageSize,function(S,U,Q,O,q,u){x(S)},function(){},function(S){return"image/"==S.type.substring(0,6)},function(S){for(var U=0;U<S.length;U++)S[U]()},!0),y.type="",y.type="file",y.value="")});y.style.display="none";document.body.appendChild(y);b.imgDlgFileInputElt=y}l=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});l.className="geBtn";D.appendChild(l)}mxEvent.addListener(c,+"keypress",function(C){13==C.keyCode&&x(c.value)});var F=mxUtils.button(mxResources.get("crop"),function(){var C=new CropImageDialog(b,c.value,f,function(S,U,Q){f=S;k=U;m=Q});b.showDialog(C.container,300,390,!0,!0)});z&&(F.className="geBtn",D.appendChild(F));var E=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=c.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var C=b.editor.createImageUrlConverter().convert(c.value),S=new Image;S.onload=function(){b.editor.convertImageToDataUri(C,function(U){b.confirmImageResize(function(Q){b.resizeImage(S,U,mxUtils.bind(this,function(O,q,u){b.spinner.stop();null!=O&&O.length<b.maxImageBytes?(c.value=O,P()):b.handleError({message:mxResources.get("imageTooBig")})}),Q,b.maxImageSize)},S.width>b.maxImageSize||S.height>b.maxImageSize||U.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};S.onerror=function(){b.spinner.stop();b.handleError({message:mxResources.get("fileNotFound")})};-S.src=C}});E.className="geBtn";mxEvent.addListener(c,"change",function(C){f=null;P()});P();D.appendChild(E);z=mxUtils.button(mxResources.get("apply"),function(){v(c.value)});z.className="geBtn gePrimaryBtn";D.appendChild(z);b.editor.cancelFirst||D.appendChild(n);Graph.fileSupport&&(D.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(D);this.container=L},LinkDialog=function(b,l,n,d,x,A,z){function D(C,S){var U=document.createElement("option");mxUtils.write(U,mxResources.get(C));U.value=C;F.appendChild(U);E[C]=S}var P=document.createElement("div");P.style.height="100%";mxUtils.write(P,mxResources.get("editLink")+":");var J=document.createElement("div");+S.src=C}});E.className="geBtn";mxEvent.addListener(c,"change",function(C){f=null;P()});P();D.appendChild(E);z=mxUtils.button(mxResources.get("apply"),function(){x(c.value)});z.className="geBtn gePrimaryBtn";D.appendChild(z);b.editor.cancelFirst||D.appendChild(n);Graph.fileSupport&&(D.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(D);this.container=L},LinkDialog=function(b,l,n,d,v,A,z){function D(C,S){var U=document.createElement("option");mxUtils.write(U,mxResources.get(C));U.value=C;F.appendChild(U);E[C]=S}var P=document.createElement("div");P.style.height="100%";mxUtils.write(P,mxResources.get("editLink")+":");var J=document.createElement("div");J.className="geUrlLinkContainer";J.style.backgroundColor="transparent";J.style.borderColor="transparent";J.style.whiteSpace="nowrap";J.style.textOverflow="clip";J.style.cursor="default";var L=document.createElement("input");L.setAttribute("placeholder",mxResources.get("dragUrlsHere"));L.setAttribute("type","text");L.style.marginTop="6px";L.style.width="414px";L.style.boxSizing="border-box";L.style.backgroundRepeat="no-repeat";L.style.backgroundPosition="100% 50%";L.style.paddingRight="16px";L.style.marginBottom="4px";var c=document.createElement("div");c.setAttribute("title",mxResources.get("reset"));c.style.backgroundImage="url("+Editor.crossImage+")";c.className="geAdaptiveAsset";c.style.display="inline-block";c.style.position="relative";c.style.top="3px";c.style.left="-16px";c.style.width="12px";c.style.height="14px";c.style.cursor="pointer";mxEvent.addListener(c,"click",function(){L.value="";L.focus()});var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-bottom:8px;";f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","geLinkDialogOption");var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","geLinkDialogOption");var m=document.createElement("select");m.style.width="414px";var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.margin="0 6p 0 6px";null!=z&&(t.setAttribute("checked","checked"),t.defaultChecked=-!0);z=null!=z?z:"_blank";t.setAttribute("title",z);A&&(L.style.width="200px");if(x&&null!=b.pages){null!=l&&Graph.isPageLink(l)?(k.setAttribute("checked","checked"),k.defaultChecked=!0):(L.setAttribute("value",l),f.setAttribute("checked","checked"),f.defaultChecked=!0);J.appendChild(f);J.appendChild(L);J.appendChild(c);A&&(J.appendChild(t),mxUtils.write(J,mxResources.get("openInNewWindow")));mxUtils.br(J);J.appendChild(k);x=!1;for(A=0;A<b.pages.length;A++)c=document.createElement("option"),mxUtils.write(c,-b.pages[A].getName()||mxResources.get("pageWithNumber",[A+1])),c.setAttribute("value","data:page/id,"+b.pages[A].getId()),l==c.getAttribute("value")&&(c.setAttribute("selected","selected"),x=!0),m.appendChild(c);if(!x&&k.checked){var v=document.createElement("option");mxUtils.write(v,mxResources.get("pageNotFound"));v.setAttribute("disabled","disabled");v.setAttribute("selected","selected");v.setAttribute("value","pageNotFound");m.appendChild(v);mxEvent.addListener(m,"change",function(){null==v.parentNode||-v.selected||v.parentNode.removeChild(v)})}J.appendChild(m)}else L.setAttribute("value",l),J.appendChild(L),J.appendChild(c);P.appendChild(J);var y=mxUtils.button(n,function(){b.hideDialog();d(k.checked?"pageNotFound"!==m.value?m.value:l:L.value,LinkDialog.selectedDocs,t.checked?z:null)});y.style.verticalAlign="middle";y.className="geBtn gePrimaryBtn";this.init=function(){k.checked?m.focus():(L.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",+!0);z=null!=z?z:"_blank";t.setAttribute("title",z);A&&(L.style.width="200px");if(v&&null!=b.pages){null!=l&&Graph.isPageLink(l)?(k.setAttribute("checked","checked"),k.defaultChecked=!0):(L.setAttribute("value",l),f.setAttribute("checked","checked"),f.defaultChecked=!0);J.appendChild(f);J.appendChild(L);J.appendChild(c);A&&(J.appendChild(t),mxUtils.write(J,mxResources.get("openInNewWindow")));mxUtils.br(J);J.appendChild(k);v=!1;for(A=0;A<b.pages.length;A++)c=document.createElement("option"),mxUtils.write(c,+b.pages[A].getName()||mxResources.get("pageWithNumber",[A+1])),c.setAttribute("value","data:page/id,"+b.pages[A].getId()),l==c.getAttribute("value")&&(c.setAttribute("selected","selected"),v=!0),m.appendChild(c);if(!v&&k.checked){var x=document.createElement("option");mxUtils.write(x,mxResources.get("pageNotFound"));x.setAttribute("disabled","disabled");x.setAttribute("selected","selected");x.setAttribute("value","pageNotFound");m.appendChild(x);mxEvent.addListener(m,"change",function(){null==x.parentNode||+x.selected||x.parentNode.removeChild(x)})}J.appendChild(m)}else L.setAttribute("value",l),J.appendChild(L),J.appendChild(c);P.appendChild(J);var y=mxUtils.button(n,function(){b.hideDialog();d(k.checked?"pageNotFound"!==m.value?m.value:l:L.value,LinkDialog.selectedDocs,t.checked?z:null)});y.style.verticalAlign="middle";y.className="geBtn gePrimaryBtn";this.init=function(){k.checked?m.focus():(L.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(m,"focus",function(){f.removeAttribute("checked");k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(L,"focus",function(){k.removeAttribute("checked");f.setAttribute("checked","checked");f.checked=!0});if(Graph.fileSupport){var C=P.parentNode,S=null;mxEvent.addListener(C,"dragleave",function(U){null!=S&&(S.parentNode.removeChild(S),S=null);U.stopPropagation();U.preventDefault()});mxEvent.addListener(C,"dragover",mxUtils.bind(this,function(U){null==S&&(S=b.highlightElement(C));U.stopPropagation();U.preventDefault()}));mxEvent.addListener(C,"drop",mxUtils.bind(this,function(U){try{null!=S&&(S.parentNode.removeChild(S),S=null),0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")&&(L.value=decodeURIComponent(U.dataTransfer.getData("text/uri-list")),f.setAttribute("checked","checked"),f.checked=!0,y.click())}catch(Q){b.handleError(Q)}U.stopPropagation();U.preventDefault()}),!1)}};n=document.createElement("div");n.style.marginTop="16px";n.style.textAlign="right";b.isOffline()||n.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));J=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});J.style.verticalAlign="middle";J.className="geBtn";b.editor.cancelFirst&&n.appendChild(J);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(C){if(C.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=C.docs;var S=C.docs[0].url;"application/mxe"==C.docs[0].mimeType||null!=C.docs[0].mimeType&&"application/vnd.jgraph."==-C.docs[0].mimeType.substring(0,23)?S="https://app.diagrams.net/#G"+C.docs[0].id:"application/vnd.google-apps.folder"==C.docs[0].mimeType&&(S="https://drive.google.com/#folders/"+C.docs[0].id);L.value=S;L.focus()}else LinkDialog.selectedDocs=null;L.focus()};var F=document.createElement("select");F.className="geBtn";F.style.position="relative";F.style.top="1px";F.style.maxWidth="120px";var E={};x=document.createElement("option");mxUtils.write(x,mxResources.get("select")+"...");x.value="";F.appendChild(x);+C.docs[0].mimeType.substring(0,23)?S="https://app.diagrams.net/#G"+C.docs[0].id:"application/vnd.google-apps.folder"==C.docs[0].mimeType&&(S="https://drive.google.com/#folders/"+C.docs[0].id);L.value=S;L.focus()}else LinkDialog.selectedDocs=null;L.focus()};var F=document.createElement("select");F.className="geBtn";F.style.position="relative";F.style.top="1px";F.style.maxWidth="120px";var E={};v=document.createElement("option");mxUtils.write(v,mxResources.get("select")+"...");v.value="";F.appendChild(v);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&D("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 C=b.drive.createLinkPicker();b.linkPicker=C.setCallback(function(S){LinkDialog.filePicked(S)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&D("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(C){L.value=C[0].link;L.focus()}})});null!=b.oneDrive&&D("oneDrive",function(){b.oneDrive.pickFile(function(C,S){null!=S&&null!=S.value&&0<S.value.length&&(L.value=S.value[0].webUrl,L.focus())},!0)});null!=b.gitHub&&D("github",function(){b.gitHub.pickFile(function(C){if(null!=C){C=C.split("/");var S=C[0],U=C[1],Q=C[2];C=C.slice(3,C.length).join("/");L.value="https://github.com/"+S+"/"+U+"/blob/"+Q+"/"+C;L.focus()}})});null!=b.gitLab&&D("gitlab",function(){b.gitLab.pickFile(function(C){if(null!=C){C=C.split("/");var S=C[0],U=C[1],Q=C[2];C=C.slice(3,C.length).join("/");L.value=DRAWIO_GITLAB_URL+"/"+S+"/"+U+"/blob/"+Q+"/"+C;L.focus()}})});1<F.children.length&&(n.appendChild(F),mxEvent.addListener(F,"change",function(C){null!=E[F.value]&&(E[F.value](),F.value="")}));mxEvent.addListener(L,"keypress",function(C){13==C.keyCode&&y.click()});n.appendChild(y);b.editor.cancelFirst||n.appendChild(J);P.appendChild(n);this.container=P},RevisionDialog=function(b,l,n){var d=document.createElement("div"),-x=document.createElement("h3");x.style.marginTop="3px";mxUtils.write(x,mxResources.get("revisionHistory"));d.appendChild(x);x=document.createElement("div");x.style.position="absolute";x.style.overflow="auto";x.style.width="170px";x.style.height="378px";d.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 z=document.createElement("div");+v=document.createElement("h3");v.style.marginTop="3px";mxUtils.write(v,mxResources.get("revisionHistory"));d.appendChild(v);v=document.createElement("div");v.style.position="absolute";v.style.overflow="auto";v.style.width="170px";v.style.height="378px";d.appendChild(v);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 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";A.appendChild(z);mxEvent.disableContextMenu(A);d.appendChild(A);var D=new Graph(A);D.setTooltips(!1);D.setEnabled(!1);D.setPanning(!0);D.panningHandler.ignoreCell=!0;D.panningHandler.useLeftButtonForPanning=!0;D.minFitScale=null;D.maxFitScale=null;D.centerZoom=!0;var P=0,J=null,L=0,c=D.getGlobalVariable;D.getGlobalVariable=function(Y){return"page"==Y&&null!=J&&null!=J[L]?J[L].getAttribute("name"):"pagenumber"==Y?L+1:"pagecount"==Y?null!=J?J.length:1:c.apply(this,arguments)};D.getLinkForCell=function(){return null};for(var f=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%"}),k=b.getCurrentFile(),m=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),t={},v=0;v<m.length;v++)t[m[v].getAttribute("id")]=m[v];var y=null,F=null,E=null,C=null,S=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=E&&D.zoomIn()},20);S.setAttribute("disabled","disabled");var U=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=E&&D.zoomOut()},20);U.setAttribute("disabled","disabled");var Q=b.createToolbarButton(Editor.zoomFitImage,+left:"50%"}),k=b.getCurrentFile(),m=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),t={},x=0;x<m.length;x++)t[m[x].getAttribute("id")]=m[x];var y=null,F=null,E=null,C=null,S=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=E&&D.zoomIn()},20);S.setAttribute("disabled","disabled");var U=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=E&&D.zoomOut()},20);U.setAttribute("disabled","disabled");var Q=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=E&&(1==D.view.scale?(D.maxFitScale=8,D.fit(8)):D.zoomActual(),D.center())},20);Q.setAttribute("disabled","disabled");var O=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));O.setAttribute("disabled","disabled");var q=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));q.setAttribute("disabled","disabled");var u=A.cloneNode(!1);u.style.pointerEvent="none";A.parentNode.appendChild(u);var I=new Graph(u);I.setTooltips(!1);I.setEnabled(!1);I.setPanning(!0);I.panningHandler.ignoreCell=!0;I.panningHandler.useLeftButtonForPanning=!0;I.minFitScale=null;I.maxFitScale=null;I.centerZoom=!0;var G=document.createElement("div");G.style.textAlign="left";G.style.color="gray";G.style.backgroundColor="transparent";G.style.overflow="hidden";G.style.textOverflow="ellipsis";G.style.whiteSpace="nowrap";G.style.cursor="default";G.style.height="100%";G.style.display="inline-flex";G.style.alignItems="center";G.style.flexGrow="1";mxEvent.addListener(G,"click",function(){var Y=mxUtils.getTextContent(G);""!=Y&&b.alert(Y)});var H=null;mxEvent.addGestureListeners(O,function(Y){try{var Z=null!=J[P]?t[J[P].getAttribute("id")]:null;mxUtils.setOpacity(O,20);z.innerText="";if(null==Z)z.style.display="inline-block",mxUtils.write(z,mxResources.get("pageNotFound"));else{H=G.innerHTML;G.innerHTML=mxResources.get("current");A.style.display="none";u.style.display="";u.style.backgroundColor=A.style.backgroundColor;var aa=Editor.parseDiagramNode(Z);(new mxCodec(aa.ownerDocument)).decode(aa,@@ -12465,7 +12465,7 @@ null,null,null,null,function(aa,la){if(null!=Z[EditorUi.DIFF_UPDATE]){var ha=docb.confirm(mxResources.get("areYouSure"),function(){null!=n?n(C):b.spinner.spin(document.body,mxResources.get("restoring"))&&(g.setAttribute("disabled","disabled"),k.save(!0,function(Z){b.spinner.stop();g.removeAttribute("disabled");b.replaceFileData(C);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 B=null;mxEvent.addListener(p,"change",function(Y){null!=B&&(B(Y),mxEvent.consume(Y))});var K=mxUtils.button(mxResources.get("open"),function(){null!=E&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(E.documentElement)),b.openLink(b.getUrl(),null,!0))});K.className="geBtn";K.setAttribute("disabled","disabled");var M=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});M.className="geBtn";M.setAttribute("disabled","disabled");null!=n&&(K.style.display="none");m=document.createElement("div");m.style.position="absolute";m.style.top="482px";m.style.right="28px";m.style.left="32px";m.style.justifyContent="end";m.style.display="flex";var N=document.createElement("div");N.className="geToolbarContainer";N.style.backgroundColor="transparent";N.style.left="32px";N.style.right=-"32px";N.style.border="none";N.style.top="442px";var R=null;if(null!=l&&0<l.length){A.style.cursor="move";var T=document.createElement("table");T.style.borderWidth="1px";T.style.borderStyle="solid";T.style.borderCollapse="collapse";T.style.borderSpacing="0px";T.style.width="100%";var V=document.createElement("tbody"),X=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(P=mxUtils.indexOf(b.pages,b.currentPage));for(v=l.length-1;0<=v;v--){var W=function(Y){var Z=new Date(Y.modifiedDate),+"32px";N.style.border="none";N.style.top="442px";var R=null;if(null!=l&&0<l.length){A.style.cursor="move";var T=document.createElement("table");T.style.borderWidth="1px";T.style.borderStyle="solid";T.style.borderCollapse="collapse";T.style.borderSpacing="0px";T.style.width="100%";var V=document.createElement("tbody"),X=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(P=mxUtils.indexOf(b.pages,b.currentPage));for(x=l.length-1;0<=x;x--){var W=function(Y){var Z=new Date(Y.modifiedDate),aa=null;if(0<=Z.getTime()){var la=function(ca){f.stop();z.innerText="";var ja=mxUtils.parseXml(ca),ka=b.editor.extractGraphModel(ja.documentElement,!0);if(null!=ka){var ba=function(oa){null!=oa&&(oa=ea(Editor.parseDiagramNode(oa)));return oa},ea=function(oa){var pa=oa.getAttribute("background");if(null==pa||""==pa||pa==mxConstants.NONE)pa=D.defaultPageBackgroundColor;A.style.backgroundColor=mxUtils.getLightDarkColor(pa);(new mxCodec(oa.ownerDocument)).decode(oa,D.getModel());D.maxFitScale=1;D.fit(8);D.center();D.mathEnabled="1"==oa.getAttribute("math");D.setAdaptiveColors(oa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&D.mathEnabled&&Editor.MathJaxRender(D.container);return oa};p.style.display="none";p.innerText="";E=ja;C=ca;J=parseSelectFunction=null;L=0;if("mxfile"==ka.nodeName){ja=ka.getElementsByTagName("diagram");J=[];for(ca=0;ca<ja.length;ca++)J.push(ja[ca]);L=Math.min(P,J.length-1);0<J.length&&ba(J[L]);if(1<J.length)for(p.removeAttribute("disabled"),p.style.display="",ca=0;ca<J.length;ca++){ja=document.createElement("option");ja.setAttribute("title",fa+" ("+J[ca].getAttribute("id")+")");ja.setAttribute("value",ca);var fa=J[ca].getAttribute("name")||mxResources.get("pageWithNumber",[ca+1]);ka=b.getPageById(J[ca].getAttribute("id"));var da="";if(null!=ka){var qa=new DiagramPage(J[ca]);b.getHashValueForPages([ka])!=b.getHashValueForPages([qa])&&(da=" (M)")}else da=" (X)";mxUtils.write(ja,fa+da);ca==L&&ja.setAttribute("selected","selected");p.appendChild(ja)}B=function(){try{var oa=@@ -12474,48 +12474,48 @@ g.removeAttribute("disabled"),K.removeAttribute("disabled"),M.removeAttribute("d"12px";aa.style.cursor="pointer";var ha=document.createElement("td");ha.style.padding="6px";ha.style.whiteSpace="nowrap";Y==l[l.length-1]?mxUtils.write(ha,mxResources.get("current")):Z.toDateString()===X?mxUtils.write(ha,Z.toLocaleTimeString()):mxUtils.write(ha,Z.toLocaleDateString()+" "+Z.toLocaleTimeString());aa.appendChild(ha);aa.setAttribute("title",Z.toLocaleDateString()+" "+Z.toLocaleTimeString()+(null!=Y.fileSize?" "+b.formatFileSize(parseInt(Y.fileSize)):"")+(null!=Y.lastModifyingUserName?" "+Y.lastModifyingUserName:""));mxEvent.addListener(aa,"click",function(ca){F!=Y&&(f.stop(),null!=y&&(y.style.backgroundColor=""),F=Y,y=aa,y.style.backgroundColor="light-dark(#ebf2f9, #000000)",C=E=null,G.removeAttribute("title"),G.innerText=mxResources.get("loading")+"...",A.style.backgroundColor=D.defaultPageBackgroundColor,z.innerText="",D.getModel().clear(),g.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"),q.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"),mxUtils.setOpacity(S,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(Q,20),mxUtils.setOpacity(O,20),mxUtils.setOpacity(q,20),f.spin(A),Y.getXml(function(ja){if(F==Y)try{la(ja)}catch(ka){G.innerText=mxResources.get("error")+": "+ka.message}},function(ja){f.stop();p.style.display="none";p.innerText="";G.innerText="";mxUtils.write(G,mxResources.get("errorLoadingFile"));-mxUtils.write(z,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ca))});mxEvent.addListener(aa,"dblclick",function(ca){K.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ca)},!1);V.appendChild(aa)}return aa}(l[v]);null!=W&&v==l.length-1&&(R=W)}T.appendChild(V);x.appendChild(T)}else null==k||null==b.drive&&k.constructor==window.DriveFile||null==b.dropbox&&k.constructor==window.DropboxFile?(A.style.display="none",-N.style.display="none",mxUtils.write(x,mxResources.get("notAvailable"))):(A.style.display="none",N.style.display="none",mxUtils.write(x,mxResources.get("noRevisions")));this.init=function(){null!=R&&R.click()};x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";N.appendChild(G);N.appendChild(O);N.appendChild(U);N.appendChild(Q);N.appendChild(S);N.appendChild(p);N.appendChild(q);b.editor.cancelFirst&&m.appendChild(x);m.appendChild(K);null!=k&&k.constructor==DriveFile&&-m.appendChild(M);m.appendChild(g);b.editor.cancelFirst||m.appendChild(x);d.appendChild(m);d.appendChild(N);this.container=d},DraftDialog=function(b,l,n,d,x,A,z,D,P){var J=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);J.appendChild(L);var c=document.createElement("select"),f=mxUtils.bind(this,function(){"-1"==c.value?(c.value=c.options[0].value,f(),b.confirm(mxResources.get("areYouSure"),-null,mxUtils.bind(this,function(){var O=this,q;return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){for(q=0;q<P.length;q++)x.apply(O,[q,mxUtils.bind(O,function(){})]);b.hideDialog(!0);u.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(F=mxUtils.parseXml(P[c.value].data),E=b.editor.extractGraphModel(F.documentElement,!0),C=0,this.init())});if(null!=P){c.style.marginLeft="4px";for(l=0;l<P.length;l++){var k=document.createElement("option");k.setAttribute("value",l);var m=new Date(P[l].created),-t=new Date(P[l].modified);mxUtils.write(k,m.toLocaleDateString()+" "+m.toLocaleTimeString()+" - "+(m.toDateString(),t.toDateString(),t.toLocaleDateString())+" "+t.toLocaleTimeString());c.appendChild(k)}k=document.createElement("option");k.setAttribute("value","-1");mxUtils.write(k,mxResources.get("deleteAll"));c.appendChild(k);L.appendChild(c);mxEvent.addListener(c,"change",f)}null==n&&(n=P[0].data);var v=document.createElement("div");v.style.position="absolute";v.style.border="1px solid lightGray";-v.style.marginTop="10px";v.style.left="40px";v.style.right="40px";v.style.top="46px";v.style.bottom="74px";v.style.overflow="hidden";mxEvent.disableContextMenu(v);J.appendChild(v);var y=new Graph(v);y.setEnabled(!1);y.setPanning(!0);y.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";y.panningHandler.ignoreCell=!0;y.panningHandler.useLeftButtonForPanning=!0;y.minFitScale=null;y.maxFitScale=null;y.centerZoom=!0;var F=mxUtils.parseXml(n),E=b.editor.extractGraphModel(F.documentElement,!0),C=0,S=null,+mxUtils.write(z,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ca))});mxEvent.addListener(aa,"dblclick",function(ca){K.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ca)},!1);V.appendChild(aa)}return aa}(l[x]);null!=W&&x==l.length-1&&(R=W)}T.appendChild(V);v.appendChild(T)}else null==k||null==b.drive&&k.constructor==window.DriveFile||null==b.dropbox&&k.constructor==window.DropboxFile?(A.style.display="none",+N.style.display="none",mxUtils.write(v,mxResources.get("notAvailable"))):(A.style.display="none",N.style.display="none",mxUtils.write(v,mxResources.get("noRevisions")));this.init=function(){null!=R&&R.click()};v=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});v.className="geBtn";N.appendChild(G);N.appendChild(O);N.appendChild(U);N.appendChild(Q);N.appendChild(S);N.appendChild(p);N.appendChild(q);b.editor.cancelFirst&&m.appendChild(v);m.appendChild(K);null!=k&&k.constructor==DriveFile&&+m.appendChild(M);m.appendChild(g);b.editor.cancelFirst||m.appendChild(v);d.appendChild(m);d.appendChild(N);this.container=d},DraftDialog=function(b,l,n,d,v,A,z,D,P){var J=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);J.appendChild(L);var c=document.createElement("select"),f=mxUtils.bind(this,function(){"-1"==c.value?(c.value=c.options[0].value,f(),b.confirm(mxResources.get("areYouSure"),+null,mxUtils.bind(this,function(){var O=this,q;return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){for(q=0;q<P.length;q++)v.apply(O,[q,mxUtils.bind(O,function(){})]);b.hideDialog(!0);u.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(F=mxUtils.parseXml(P[c.value].data),E=b.editor.extractGraphModel(F.documentElement,!0),C=0,this.init())});if(null!=P){c.style.marginLeft="4px";for(l=0;l<P.length;l++){var k=document.createElement("option");k.setAttribute("value",l);var m=new Date(P[l].created),+t=new Date(P[l].modified);mxUtils.write(k,m.toLocaleDateString()+" "+m.toLocaleTimeString()+" - "+(m.toDateString(),t.toDateString(),t.toLocaleDateString())+" "+t.toLocaleTimeString());c.appendChild(k)}k=document.createElement("option");k.setAttribute("value","-1");mxUtils.write(k,mxResources.get("deleteAll"));c.appendChild(k);L.appendChild(c);mxEvent.addListener(c,"change",f)}null==n&&(n=P[0].data);var x=document.createElement("div");x.style.position="absolute";x.style.border="1px solid lightGray";+x.style.marginTop="10px";x.style.left="40px";x.style.right="40px";x.style.top="46px";x.style.bottom="74px";x.style.overflow="hidden";mxEvent.disableContextMenu(x);J.appendChild(x);var y=new Graph(x);y.setEnabled(!1);y.setPanning(!0);y.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";y.panningHandler.ignoreCell=!0;y.panningHandler.useLeftButtonForPanning=!0;y.minFitScale=null;y.maxFitScale=null;y.centerZoom=!0;var F=mxUtils.parseXml(n),E=b.editor.extractGraphModel(F.documentElement,!0),C=0,S=null,U=y.getGlobalVariable;y.getGlobalVariable=function(O){return"page"==O&&null!=S&&null!=S[C]?S[C].getAttribute("name"):"pagenumber"==O?C+1:"pagecount"==O?null!=S?S.length:1:U.apply(this,arguments)};y.getLinkForCell=function(){return null};n=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){y.zoomIn()},20);L=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){y.zoomOut()},20);l=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==-y.view.scale?(y.maxFitScale=8,y.fit(8)):y.zoomActual();y.center()},20);z=mxUtils.button(z||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var O=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(q){x.apply(O,[c.value,mxUtils.bind(O,function(){null!=c.parentNode&&(c.options[c.selectedIndex].parentNode.removeChild(c.options[c.selectedIndex]),1<c.options.length?(c.value=c.options[0].value,f()):b.hideDialog(!0))})]);q.jumpToEnd()})}),+y.view.scale?(y.maxFitScale=8,y.fit(8)):y.zoomActual();y.center()},20);z=mxUtils.button(z||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var O=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(q){v.apply(O,[c.value,mxUtils.bind(O,function(){null!=c.parentNode&&(c.options[c.selectedIndex].parentNode.removeChild(c.options[c.selectedIndex]),1<c.options.length?(c.value=c.options[0].value,f()):b.hideDialog(!0))})]);q.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});z.className="geBtn";var Q=document.createElement("select");Q.style.maxWidth="80px";Q.style.position="relative";Q.style.top="-2px";Q.style.verticalAlign="bottom";Q.style.marginRight="6px";Q.style.display="none";A=mxUtils.button(A||mxResources.get("edit"),function(){d.apply(this,[c.value])});A.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.position="absolute";k.style.bottom="30px";k.style.right="40px";k.style.textAlign="right";-m=document.createElement("div");m.className="geToolbarContainer";m.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function O(G){if(null!=G){var H=G.getAttribute("background");if(null==H||""==H||H==mxConstants.NONE)H="light-dark(#ffffff, transparent)";v.style.backgroundColor=H;(new mxCodec(G.ownerDocument)).decode(G,y.getModel());y.maxFitScale=1;y.fit(8);y.center()}return G}function q(G){null!=G&&(G=+m=document.createElement("div");m.className="geToolbarContainer";m.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function O(G){if(null!=G){var H=G.getAttribute("background");if(null==H||""==H||H==mxConstants.NONE)H="light-dark(#ffffff, transparent)";x.style.backgroundColor=H;(new mxCodec(G.ownerDocument)).decode(G,y.getModel());y.maxFitScale=1;y.fit(8);y.center()}return G}function q(G){null!=G&&(G=O(Editor.parseDiagramNode(G)));return G}mxEvent.addListener(Q,"change",function(G){C=parseInt(Q.value);q(S[C]);mxEvent.consume(G)});if("mxfile"==E.nodeName){var u=E.getElementsByTagName("diagram");S=[];for(var I=0;I<u.length;I++)S.push(u[I]);0<S.length&&q(S[C]);Q.innerText="";if(1<S.length)for(Q.style.display="",I=0;I<S.length;I++)u=document.createElement("option"),mxUtils.write(u,S[I].getAttribute("name")||mxResources.get("pageWithNumber",[I+1])),u.setAttribute("value",I),I==C&&u.setAttribute("selected","selected"),Q.appendChild(u);else Q.style.display="none"}else O(E)};m.appendChild(Q);m.appendChild(n);m.appendChild(L);m.appendChild(l);n=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});n.className="geBtn";D=null!=D?mxUtils.button(mxResources.get("ignore"),D):null;null!=D&&(D.className="geBtn");b.editor.cancelFirst?(k.appendChild(n),null!=D&&k.appendChild(D),k.appendChild(z),k.appendChild(A)):(k.appendChild(A),k.appendChild(z),null!=D&&k.appendChild(D),k.appendChild(n));J.appendChild(k);-J.appendChild(m);this.container=J},FindWindow=function(b,l,n,d,x,A){function z(B,K,M){if("object"===typeof K.value&&null!=K.value.attributes){K=K.value.attributes;for(var N=0;N<K.length;N++)if("label"!=K[N].nodeName){var R=mxUtils.trim(K[N].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==B&&0<=R.indexOf(M)||null!=B&&B.test(R))return!0}}return!1}function D(){k?(H.removeAttribute("disabled"),g.removeAttribute("disabled")):(H.setAttribute("disabled","disabled"),g.setAttribute("disabled",+J.appendChild(m);this.container=J},FindWindow=function(b,l,n,d,v,A){function z(B,K,M){if("object"===typeof K.value&&null!=K.value.attributes){K=K.value.attributes;for(var N=0;N<K.length;N++)if("label"!=K[N].nodeName){var R=mxUtils.trim(K[N].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==B&&0<=R.indexOf(M)||null!=B&&B.test(R))return!0}}return!1}function D(){k?(H.removeAttribute("disabled"),g.removeAttribute("disabled")):(H.setAttribute("disabled","disabled"),g.setAttribute("disabled","disabled"));C.value?p.removeAttribute("disabled"):p.setAttribute("disabled","disabled")}function P(B,K,M){I.innerText="";var N=L.model.getDescendants(L.model.getRoot()),R=C.value.toLowerCase(),T=U.checked?new RegExp(R):null,V=null;t=null;c!=R&&(c=R,f=null,m=!1);var X=null==f;if(0<R.length){if(m){m=!1;for(var W,Y=0;Y<b.pages.length;Y++)if(b.currentPage==b.pages[Y]){W=Y;break}B=(W+1)%b.pages.length;f=null;do m=!1,N=b.pages[B],L=b.createTemporaryGraph(L.getStylesheet()),b.updatePageRoot(N),L.model.setRoot(N.root),B=(B+1)%b.pages.length;while(!P(!0,K,M)&&B!=W);f&&(f=null,M?b.editor.graph.model.execute(new SelectPage(b,N)):b.selectPage(N));m=!1;L=b.editor.graph;return P(!0,K,M)}for(Y=0;Y<N.length;Y++){W=L.view.getState(N[Y]);K&&(X=X||W==f);if(null!=W&&null!=W.cell.value&&(X||null==V)&&(L.model.isVertex(W.cell)||L.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(O.innerHTML=L.sanitizeHtml(L.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([O])):label=L.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g,-" ")).toLowerCase();var Z=0;K&&A&&W==f&&(label=label.substr(v),Z=v);var aa=null==S||""==S.value;if(null==T&&(0<=label.indexOf(R)||aa&&z(T,W.cell,R))||null!=T&&(T.test(label)||aa&&z(T,W.cell,R)))if(A&&(null!=T?(aa=label.match(T),null!=aa&&0<aa.length&&(t=aa[0].toLowerCase(),v=Z+aa.index+t.length)):(t=R,v=Z+label.indexOf(R)+t.length)),X){V=W;break}else null==V&&(V=W)}X=X||W==f}}if(null!=V){if(Y==N.length&&Q.checked)return f=null,m=!0,P(!0,K,M);f=V;L.scrollCellToVisible(f.cell);L.isEnabled()&&!L.isCellLocked(f.cell)?-M||L.getSelectionCell()==f.cell&&1==L.getSelectionCount()||L.setSelectionCell(f.cell):L.highlightCell(f.cell)}else{if(!B&&Q.checked)return m=!0,P(!0,K,M);L.isEnabled()&&!M&&L.clearSelection()}k=null!=V;A&&!B&&D();return 0==R.length||null!=V}var J=b.actions.get("findReplace"),L=b.editor.graph,c=null,f=null,k=!1,m=!1,t=null,v=0,y=1,F=document.createElement("div");F.style.userSelect="none";F.style.overflow="hidden";F.style.padding="10px";F.style.height="100%";var E=A?"260px":"200px",C=document.createElement("input");+" ")).toLowerCase();var Z=0;K&&A&&W==f&&(label=label.substr(x),Z=x);var aa=null==S||""==S.value;if(null==T&&(0<=label.indexOf(R)||aa&&z(T,W.cell,R))||null!=T&&(T.test(label)||aa&&z(T,W.cell,R)))if(A&&(null!=T?(aa=label.match(T),null!=aa&&0<aa.length&&(t=aa[0].toLowerCase(),x=Z+aa.index+t.length)):(t=R,x=Z+label.indexOf(R)+t.length)),X){V=W;break}else null==V&&(V=W)}X=X||W==f}}if(null!=V){if(Y==N.length&&Q.checked)return f=null,m=!0,P(!0,K,M);f=V;L.scrollCellToVisible(f.cell);L.isEnabled()&&!L.isCellLocked(f.cell)?+M||L.getSelectionCell()==f.cell&&1==L.getSelectionCount()||L.setSelectionCell(f.cell):L.highlightCell(f.cell)}else{if(!B&&Q.checked)return m=!0,P(!0,K,M);L.isEnabled()&&!M&&L.clearSelection()}k=null!=V;A&&!B&&D();return 0==R.length||null!=V}var J=b.actions.get("findReplace"),L=b.editor.graph,c=null,f=null,k=!1,m=!1,t=null,x=0,y=1,F=document.createElement("div");F.style.userSelect="none";F.style.overflow="hidden";F.style.padding="10px";F.style.height="100%";var E=A?"260px":"200px",C=document.createElement("input");C.setAttribute("placeholder",mxResources.get("find"));C.setAttribute("type","text");C.style.marginTop="4px";C.style.marginBottom="6px";C.style.width=E;C.style.fontSize="12px";C.style.borderRadius="4px";C.style.padding="6px";F.appendChild(C);mxUtils.br(F);if(A){var S=document.createElement("input");S.setAttribute("placeholder",mxResources.get("replaceWith"));S.setAttribute("type","text");S.style.marginTop="4px";S.style.marginBottom="6px";S.style.width=E;S.style.fontSize="12px";S.style.borderRadius="4px";S.style.padding="6px";F.appendChild(S);mxUtils.br(F);mxEvent.addListener(S,"input",D)}var U=document.createElement("input");U.setAttribute("id","geFindWinRegExChck");U.setAttribute("type","checkbox");U.style.marginRight="4px";F.appendChild(U);E=document.createElement("label");E.setAttribute("for","geFindWinRegExChck");F.appendChild(E);mxUtils.write(E,mxResources.get("regularExpression"));F.appendChild(E);E=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");E.style.position="relative";E.style.marginLeft="6px";F.appendChild(E);mxUtils.br(F);var Q=document.createElement("input");Q.setAttribute("id","geFindWinAllPagesChck");Q.setAttribute("type","checkbox");Q.style.marginRight="4px";F.appendChild(Q);E=document.createElement("label");E.setAttribute("for","geFindWinAllPagesChck");F.appendChild(E);mxUtils.write(E,mxResources.get("allPages"));F.appendChild(E);var O=document.createElement("div");mxUtils.br(F);E=document.createElement("div");E.style.left="0px";E.style.right="0px";E.style.marginTop="6px";E.style.padding="0 6px 0 6px";F.appendChild(E);var q=mxUtils.button(mxResources.get("reset"),function(){I.innerText="";C.value="";C.style.backgroundColor="";A&&(S.value="",D());c=f=null;m=!1;C.focus()});q.setAttribute("title",mxResources.get("reset"));q.style.float="none";q.style.width="120px";q.style.marginTop="6px";q.style.marginLeft="8px";q.style.overflow="hidden";q.style.textOverflow="ellipsis";q.className="geBtn";A||E.appendChild(q);var u=mxUtils.button(mxResources.get("find"),function(){try{C.style.backgroundColor=P()?"":"light-dark(#ffcfcf, #ff0000)"}catch(B){b.handleError(B)}});u.setAttribute("title",mxResources.get("find")+" (Enter)");u.style.float="none";u.style.width="120px";u.style.marginTop="6px";u.style.marginLeft="8px";u.style.overflow="hidden";u.style.textOverflow="ellipsis";u.className="geBtn gePrimaryBtn";E.appendChild(u);var I=document.createElement("div");I.style.marginTop="10px";if(A){var G=function(B,K,M,N,R){if(null==R||"1"!=R.html)return N=B.toLowerCase().indexOf(K,N),0>N?B:B.substr(0,N)+M+B.substr(N+K.length);var T=B;K=mxUtils.htmlEntities(K,!1,!1,!1);R=[];var V=-1;for(B=B.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=B.indexOf("<",V+1));)R.push(V);V=B.match(/<[^>]*>/g);B=B.replace(/<[^>]*>/g,"");N=B.toLowerCase().indexOf(K,N);if(0>N)return T;T=N+K.length;M=mxUtils.htmlEntities(M);B=B.substr(0,N)+M+B.substr(T);for(var X=0,W=0;W<R.length;W++){if(R[W]-X<N)B=B.substr(0,R[W])+V[W]+B.substr(R[W]);-else{var Y=R[W]-X<T?N+X:R[W]+(M.length-K.length);B=B.substr(0,Y)+V[W]+B.substr(Y)}X+=V[W].length}return B.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};E.style.textAlign="center";var H=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=t&&null!=f){var B=f.cell,K=L.getLabel(B);L.isCellEditable(B)&&L.model.setValue(B,G(K,t,S.value,v-t.length,L.getCurrentCellStyle(B)));C.style.backgroundColor=P(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(M){b.handleError(M)}});-H.setAttribute("title",mxResources.get("replFind"));H.style.float="none";H.style.width="120px";H.style.marginTop="6px";H.style.marginLeft="8px";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.className="geBtn gePrimaryBtn";H.setAttribute("disabled","disabled");E.appendChild(H);mxUtils.br(E);var g=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=t&&null!=f){var B=f.cell,K=L.getLabel(B);L.model.setValue(B,G(K,t,S.value,v-t.length,L.getCurrentCellStyle(B)));H.setAttribute("disabled",+else{var Y=R[W]-X<T?N+X:R[W]+(M.length-K.length);B=B.substr(0,Y)+V[W]+B.substr(Y)}X+=V[W].length}return B.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};E.style.textAlign="center";var H=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=t&&null!=f){var B=f.cell,K=L.getLabel(B);L.isCellEditable(B)&&L.model.setValue(B,G(K,t,S.value,x-t.length,L.getCurrentCellStyle(B)));C.style.backgroundColor=P(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(M){b.handleError(M)}});+H.setAttribute("title",mxResources.get("replFind"));H.style.float="none";H.style.width="120px";H.style.marginTop="6px";H.style.marginLeft="8px";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.className="geBtn gePrimaryBtn";H.setAttribute("disabled","disabled");E.appendChild(H);mxUtils.br(E);var g=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=t&&null!=f){var B=f.cell,K=L.getLabel(B);L.model.setValue(B,G(K,t,S.value,x-t.length,L.getCurrentCellStyle(B)));H.setAttribute("disabled","disabled");g.setAttribute("disabled","disabled")}}catch(M){b.handleError(M)}});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");E.appendChild(g);var p=mxUtils.button(mxResources.get("replaceAll"),function(){I.innerText="";c=null;var B=b.currentPage,K=b.editor.graph.getSelectionCells();-b.editor.graph.rendering=!1;L.getModel().beginUpdate();try{for(var M=0,N={};P(!1,!0,!0)&&100>M;){var R=f.cell,T=L.getLabel(R),V=N[R.id];if(V&&V.replAllMrk==y&&V.replAllPos>=v)break;N[R.id]={replAllMrk:y,replAllPos:v};L.isCellEditable(R)&&(L.model.setValue(R,G(T,t,S.value,v-t.length,L.getCurrentCellStyle(R))),M++)}B!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,B));mxUtils.write(I,mxResources.get("matchesRepl",[M]))}catch(X){b.handleError(X)}finally{L.getModel().endUpdate(),b.editor.graph.setSelectionCells(K),+b.editor.graph.rendering=!1;L.getModel().beginUpdate();try{for(var M=0,N={};P(!1,!0,!0)&&100>M;){var R=f.cell,T=L.getLabel(R),V=N[R.id];if(V&&V.replAllMrk==y&&V.replAllPos>=x)break;N[R.id]={replAllMrk:y,replAllPos:x};L.isCellEditable(R)&&(L.model.setValue(R,G(T,t,S.value,x-t.length,L.getCurrentCellStyle(R))),M++)}B!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,B));mxUtils.write(I,mxResources.get("matchesRepl",[M]))}catch(X){b.handleError(X)}finally{L.getModel().endUpdate(),b.editor.graph.setSelectionCells(K),b.editor.graph.rendering=!0}y++});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");E.appendChild(p);mxUtils.br(E);E.appendChild(q);q=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));q.setAttribute("title",mxResources.get("close"));q.style.float="none";q.style.width="120px";q.style.marginTop="6px";q.style.marginLeft="8px";q.style.overflow="hidden";q.style.textOverflow="ellipsis";q.className="geBtn";E.appendChild(q);mxUtils.br(E);E.appendChild(I)}else E.style.display="flex",E.style.alignItems="center",q.style.width="",u.style.width="";mxEvent.addListener(C,"keyup",function(B){if(91==B.keyCode||93==B.keyCode||17==B.keyCode)mxEvent.consume(B);else if(27==B.keyCode)J.funct();else if(c!=C.value.toLowerCase()||13==B.keyCode)try{C.style.backgroundColor=-P()?"":"light-dark(#ffcfcf, #ff0000)"}catch(K){C.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(F,"keydown",function(B){70==B.keyCode&&b.keyHandler.isControlDown(B)&&!mxEvent.isShiftDown(B)&&(J.funct(),mxEvent.consume(B))});this.window=new mxWindow(mxResources.get("find")+(A?"/"+mxResources.get("replace"):""),F,l,n,d,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()?(C.focus(),mxClient.IS_GC||mxClient.IS_FF?C.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?Q.removeAttribute("disabled"):(Q.checked=!1,Q.setAttribute("disabled","disabled"))):L.container.focus()}));b.installResizeHandler(this,!1);this.doSearch=function(B){C.focus();C.value=B;u.click()}},FreehandWindow=function(b,l,n,d,x,A){var z=b.editor.graph,D=document.createElement("div");D.style.textAlign=+P()?"":"light-dark(#ffcfcf, #ff0000)"}catch(K){C.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(F,"keydown",function(B){70==B.keyCode&&b.keyHandler.isControlDown(B)&&!mxEvent.isShiftDown(B)&&(J.funct(),mxEvent.consume(B))});this.window=new mxWindow(mxResources.get("find")+(A?"/"+mxResources.get("replace"):""),F,l,n,d,v,!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()?(C.focus(),mxClient.IS_GC||mxClient.IS_FF?C.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?Q.removeAttribute("disabled"):(Q.checked=!1,Q.setAttribute("disabled","disabled"))):L.container.focus()}));b.installResizeHandler(this,!1);this.doSearch=function(B){C.focus();C.value=B;u.click()}},FreehandWindow=function(b,l,n,d,v,A){var z=b.editor.graph,D=document.createElement("div");D.style.textAlign="center";D.style.userSelect="none";D.style.overflow="hidden";D.style.height="100%";if(A){var P=function(){var k=z.freehand.getStrokeColor(!0);null!=k&&k!=mxConstants.NONE&&1<k.length&&"string"===typeof k&&("default"==k?k=mxResources.get("useBlackAndWhite"):(k="#"==k.charAt(0)?k.substring(1).toUpperCase():k,k=ColorDialog.prototype.colorNames[k]),null!=k&&L.setAttribute("title",k))},J=document.createElement("input");J.setAttribute("id","geFreehandBrush");J.setAttribute("type","checkbox");J.checked=z.freehand.isPerfectFreehandMode();J.style.margin="10px 5px 0px 10px";J.style.float="left";D.appendChild(J);z.freehand.setPerfectFreehandMode(J.checked);A=document.createElement("label");A.setAttribute("for","geFreehandBrush");A.style.float="left";A.style.marginTop="10px";D.appendChild(A);mxUtils.write(A,mxResources.get("brush"));D.appendChild(A);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()});P();A=mxUtils.button("",mxUtils.bind(this,function(k){b.pickColor(z.freehand.getStrokeColor(!0),function(m){z.freehand.setStrokeColor(m);L.style.backgroundColor=z.freehand.getStrokeColor();P()},"default");mxEvent.consume(k)}));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(L);D.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";D.appendChild(A);mxEvent.addListener(A,"click",mxUtils.bind(this,function(k){k=z.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",k,function(m){!isNaN(m)&&0<m&&20>=m&&z.freehand.setSmoothing(parseInt(m))})}));mxUtils.br(D);var c=document.createElement("input");c.setAttribute("type","range");c.setAttribute("min","2");c.setAttribute("max","30");c.setAttribute("value",z.freehand.getBrushSize());c.style.width="90%";c.style.visibility="hidden";D.appendChild(c);mxUtils.br(D);A=function(){z.freehand.setPerfectFreehandMode(J.checked);c.style.visibility=J.checked?"visible":"hidden"};mxEvent.addListener(J,"change",A);A();mxEvent.addListener(c,"change",function(){z.freehand.setBrushSize(parseInt(this.value))})}var f=mxUtils.button(mxResources.get("startDrawing"),function(){z.freehand.isDrawing()?z.freehand.stopDrawing():z.freehand.startDrawing()});f.setAttribute("title",mxResources.get("startDrawing")+" (X)");f.style.width="90%";f.style.marginLeft="0px";f.style.position="relative";f.className="geBtn gePrimaryBtn";D.appendChild(f);-this.window=new mxWindow(mxResources.get("freehand"),D,l,n,d,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(){f.innerText="";mxUtils.write(f,mxResources.get(z.freehand.isDrawing()?"stopDrawing":"startDrawing"));var k=document.createElement("span");k.className="geShortcutKey";k.style.margin="0 2px 4px 0";mxUtils.write(k,"X");f.appendChild(k);f.setAttribute("title",-mxResources.get(z.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");f.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,n,d,x){var A=b.editor.graph,z=document.createElement("div");z.style.userSelect="none";z.style.overflow=+this.window=new mxWindow(mxResources.get("freehand"),D,l,n,d,v,!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(){f.innerText="";mxUtils.write(f,mxResources.get(z.freehand.isDrawing()?"stopDrawing":"startDrawing"));var k=document.createElement("span");k.className="geShortcutKey";k.style.margin="0 2px 4px 0";mxUtils.write(k,"X");f.appendChild(k);f.setAttribute("title",+mxResources.get(z.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");f.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,n,d,v){var A=b.editor.graph,z=document.createElement("div");z.style.userSelect="none";z.style.overflow="hidden";z.style.height="100%";var D=document.createElement("div");D.style.display="flex";D.style.alignItems="center";D.style.justifyContent="center";D.style.paddingTop="20px";var P=document.createElement("input");P.setAttribute("type","checkbox");P.style.marginRight="4px";P.checked=!0;var J=document.createElement("input");J.setAttribute("type","checkbox");J.style.marginRight="4px";J.checked=!0;var L=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(A.isSelectionEmpty()?-A.getVerticesAndEdges():A.getSelectionCells(),P.checked,J.checked)}));L.setAttribute("title","Convert Colors");L.className="geBtn gePrimaryBtn";D.appendChild(L);z.appendChild(D);D=D.cloneNode(!1);D.appendChild(J);D.style.paddingTop="8px";mxUtils.write(D,mxResources.get("background"));z.appendChild(D);D=D.cloneNode(!1);D.appendChild(P);D.style.paddingTop="8px";mxUtils.write(D,mxResources.get("labels"));z.appendChild(D);this.window=new mxWindow(mxResources.get("adaptiveColors"),z,l,n,d,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,n,d,x){function A(){O||(q=t.value,u());E.style.display="createPublic"==t.value?"none":""}function z(){O=!0;t.value=q;L.isSelectionEmpty()?(F.setAttribute("disabled","disabled"),"selectionOnly"==t.value&&(t.value="includeCopyOfMyDiagram")):F.removeAttribute("disabled");+A.getVerticesAndEdges():A.getSelectionCells(),P.checked,J.checked)}));L.setAttribute("title","Convert Colors");L.className="geBtn gePrimaryBtn";D.appendChild(L);z.appendChild(D);D=D.cloneNode(!1);D.appendChild(J);D.style.paddingTop="8px";mxUtils.write(D,mxResources.get("background"));z.appendChild(D);D=D.cloneNode(!1);D.appendChild(P);D.style.paddingTop="8px";mxUtils.write(D,mxResources.get("labels"));z.appendChild(D);this.window=new mxWindow(mxResources.get("adaptiveColors"),z,l,n,d,v,!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,n,d,v){function A(){O||(q=t.value,u());E.style.display="createPublic"==t.value?"none":""}function z(){O=!0;t.value=q;L.isSelectionEmpty()?(F.setAttribute("disabled","disabled"),"selectionOnly"==t.value&&(t.value="includeCopyOfMyDiagram")):F.removeAttribute("disabled");b.isDiagramEmpty()?(y.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==t.value&&(t.value="help")):y.removeAttribute("disabled");O=!1}function D(I){var G=document.createElement("div");G.style.textAlign="left";G.style.padding="6px";G.style.margin="6px 0";mxUtils.write(G,I);f.appendChild(G);return G}function P(I){var G=[],H=D(I);G.push(H);H.style.marginBottom="2px";H.style.marginLeft="40%";H.style.borderRadius="10px";H.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";var g=document.createElement("div");g.className="geInlineButtons";g.style.display="flex";g.style.justifyContent="end";G.push(g);var p=document.createElement("img");p.className="geAdaptiveAsset geLibraryButton";p.setAttribute("src",Editor.trashImage);p.setAttribute("title",mxResources.get("remove"));g.appendChild(p);mxEvent.addListener(p,"click",mxUtils.bind(this,function(Y){if(mxEvent.isShiftDown(Y))f.innerHTML="";else{for(Y=0;Y<G.length;Y++)null!=G[Y].parentNode&&G[Y].parentNode.removeChild(G[Y]);G=[]}}));p=p.cloneNode();p.setAttribute("src",Editor.copyImage);p.setAttribute("title",mxResources.get("copy"));mxEvent.addListener(p,"click",mxUtils.bind(this,function(){b.writeTextToClipboard(I,mxUtils.bind(this,function(Y){b.handleError(Y)}))}));g.appendChild(p);p=p.cloneNode();p.setAttribute("src",Editor.editImage);p.setAttribute("title",mxResources.get("edit"));g.appendChild(p);mxEvent.addListener(p,"click",mxUtils.bind(this,function(){Q.value=I;Q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?Q.select():document.execCommand("selectAll",@@ -12537,61 +12537,61 @@ ea=null;ea="gemini-"==M.substring(0,7)?fa.candidates[0].content.parts[0].text:"c"Error: "+ea.getStatus();try{var oa=JSON.parse(ea.getText());null!=oa&&null!=oa.error&&null!=oa.error.message&&(qa=oa.error.message)}catch(pa){}B.innerHTML="";mxUtils.write(B,qa);B.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(pa){ja(pa)}}),ja)}),function(ca){B.innerHTML="";B.appendChild(Y(ca.message));B.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.addMessage","error",ca)})});W()}function J(){""!=mxUtils.trim(Q.value)&&(P(Q.value),Q.value="")}var L=b.editor.graph,c=document.createElement("div");c.style.display="flex";c.style.flexDirection="column";c.style.overflow="hidden";c.style.height="100%";c.style.padding="10px 12px 20px 12px";c.style.boxSizing="border-box";mxEvent.addGestureListeners(c,mxUtils.bind(this,function(I){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null);var f=document.createElement("div");f.style.flexGrow="1";f.style.overflow="auto";f.style.fontSize="12px";f.style.marginRight="-8px";f.style.paddingRight="8px";mxEvent.addListener(f,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});c.appendChild(f);var k=document.createElement("div");k.style.borderRadius="20px";k.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";k.style.padding="8px";k.style.marginTop="8px";var m=document.createElement("div");m.style.display="flex";m.style.gap="6px";m.style.paddingRight="8px";m.style.justifyContent="start";var t=document.createElement("select");t.style.borderColor="transparent";t.style.textOverflow=-"ellipsis";t.style.padding="5px";t.style.minWidth="0";if("undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled){var v=document.createElement("option");v.setAttribute("value","createPublic");mxUtils.write(v,mxResources.get("create")+" ("+mxResources.get("diagramIsPublic")+")");t.appendChild(v)}var y=document.createElement("option");y.setAttribute("value","includeCopyOfMyDiagram");mxUtils.write(y,mxResources.get("includeCopyOfMyDiagram"));t.appendChild(y);var F=document.createElement("option");-F.setAttribute("value","selectionOnly");mxUtils.write(F,mxResources.get("selectionOnly"));t.appendChild(F);"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(v=document.createElement("option"),v.setAttribute("value","create"),mxUtils.write(v,mxResources.get("create")),t.appendChild(v),t.value="create");v=document.createElement("option");v.setAttribute("value","help");mxUtils.write(v,mxResources.get("help"));t.appendChild(v);t.value="createPublic";var E=t.cloneNode(!1);for(U in Editor.gptModels)if(v=-Editor.gptModels[U],"gpt-"==v.substring(0,4)&&null!=Editor.gptApiKey||"gemini-"==v.substring(0,7)&&null!=Editor.geminiApiKey||"claude-"==v.substring(0,7)&&null!=Editor.claudeApiKey){var C=document.createElement("option");C.setAttribute("value",v);mxUtils.write(C,U);E.appendChild(C)}var S=0==E.children.length;var U=document.createElement("div");U.style.whiteSpace="nowrap";U.style.textOverflow="clip";U.style.cursor="default";var Q=document.createElement("input");Q.setAttribute("type","text");Q.style.width=-"100%";Q.style.outline="none";Q.style.border="none";Q.style.background="transparent";Q.style.padding="6px 30px 6px 10px";Q.style.boxSizing="border-box";U.appendChild(Q);v=document.createElement("img");v.setAttribute("src",Editor.sendImage);v.setAttribute("title",mxResources.get("sendMessage"));v.className="geAdaptiveAsset";v.style.position="relative";v.style.cursor="pointer";v.style.opacity="0.5";v.style.height="19px";v.style.left="-28px";v.style.top="5px";v.style.background="url('"+b.editor.transparentImage+-"')";U.appendChild(v);k.appendChild(U);S||(m.appendChild(t),m.appendChild(E),k.appendChild(m));var O=!1,q=t.value,u=function(){Q.setAttribute("placeholder",mxResources.get("create"==t.value||"createPublic"==t.value?"describeYourDiagram":"askMeAnything"))};u();mxEvent.addListener(t,"change",A);A();L.selectionModel.addListener(mxEvent.CHANGE,z);L.getModel().addListener(mxEvent.CHANGE,z);z();c.appendChild(k);mxEvent.addListener(v,"click",J);mxEvent.addListener(Q,"keydown",function(I){13!=I.keyCode||-mxEvent.isShiftDown(I)||J()});this.generate=mxUtils.bind(this,function(I){Q.value=I;J()});this.window=new mxWindow(mxResources.get("generate"),c,l,n,d,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,120,100);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener(mxEvent.DESTROY,mxUtils.bind(this,function(){L.getModel().removeListener(z)}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();-Q.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,l,n,d,x){var A=b.editor.graph,z=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)z=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var D=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(P,J){if(A.isEnabled()){var L=new FilenameDialog(b,"",mxResources.get("add"),function(c){b.hideDialog();if(null!=c&&0<c.length){c=c.split(" ");for(var f=[],k=[],m=0;m<c.length;m++){var t=-mxUtils.trim(c[m]);""!=t&&(k.push(t),0>mxUtils.indexOf(P,t)&&f.push(t))}A.isSelectionEmpty()?J(P.concat(f)):A.addTagsForCells(A.getSelectionCells(),k)}},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=D.div;this.window=new mxWindow(mxResources.get("tags"),z,l,n,d,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(){D.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AuthDialog=function(b,l,n,d){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("authorizationRequired"));var z="Unknown",D=document.createElement("img");D.setAttribute("border","0");+"ellipsis";t.style.padding="5px";t.style.minWidth="0";if("undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled){var x=document.createElement("option");x.setAttribute("value","createPublic");mxUtils.write(x,mxResources.get("create")+" ("+mxResources.get("diagramIsPublic")+")");t.appendChild(x)}var y=document.createElement("option");y.setAttribute("value","includeCopyOfMyDiagram");mxUtils.write(y,mxResources.get("includeCopyOfMyDiagram"));t.appendChild(y);var F=document.createElement("option");+F.setAttribute("value","selectionOnly");mxUtils.write(F,mxResources.get("selectionOnly"));t.appendChild(F);"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(x=document.createElement("option"),x.setAttribute("value","create"),mxUtils.write(x,mxResources.get("create")),t.appendChild(x),t.value="create");x=document.createElement("option");x.setAttribute("value","help");mxUtils.write(x,mxResources.get("help"));t.appendChild(x);t.value="createPublic";var E=t.cloneNode(!1);for(U in Editor.gptModels)if(x=+Editor.gptModels[U],"gpt-"==x.substring(0,4)&&null!=Editor.gptApiKey||"gemini-"==x.substring(0,7)&&null!=Editor.geminiApiKey||"claude-"==x.substring(0,7)&&null!=Editor.claudeApiKey){var C=document.createElement("option");C.setAttribute("value",x);mxUtils.write(C,U);E.appendChild(C)}var S=0==E.children.length;var U=document.createElement("div");U.style.whiteSpace="nowrap";U.style.textOverflow="clip";U.style.cursor="default";var Q=document.createElement("input");Q.setAttribute("type","text");Q.style.width=+"100%";Q.style.outline="none";Q.style.border="none";Q.style.background="transparent";Q.style.padding="6px 30px 6px 10px";Q.style.boxSizing="border-box";U.appendChild(Q);x=document.createElement("img");x.setAttribute("src",Editor.sendImage);x.setAttribute("title",mxResources.get("sendMessage"));x.className="geAdaptiveAsset";x.style.position="relative";x.style.cursor="pointer";x.style.opacity="0.5";x.style.height="19px";x.style.left="-28px";x.style.top="5px";x.style.background="url('"+b.editor.transparentImage++"')";U.appendChild(x);k.appendChild(U);S||(m.appendChild(t),m.appendChild(E),k.appendChild(m));var O=!1,q=t.value,u=function(){Q.setAttribute("placeholder",mxResources.get("create"==t.value||"createPublic"==t.value?"describeYourDiagram":"askMeAnything"))};u();mxEvent.addListener(t,"change",A);A();L.selectionModel.addListener(mxEvent.CHANGE,z);L.getModel().addListener(mxEvent.CHANGE,z);z();c.appendChild(k);mxEvent.addListener(x,"click",J);mxEvent.addListener(Q,"keydown",function(I){13!=I.keyCode||+mxEvent.isShiftDown(I)||J()});this.generate=mxUtils.bind(this,function(I){Q.value=I;J()});this.window=new mxWindow(mxResources.get("generate"),c,l,n,d,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,120,100);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener(mxEvent.DESTROY,mxUtils.bind(this,function(){L.getModel().removeListener(z)}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();+Q.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,l,n,d,v){var A=b.editor.graph,z=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)z=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var D=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(P,J){if(A.isEnabled()){var L=new FilenameDialog(b,"",mxResources.get("add"),function(c){b.hideDialog();if(null!=c&&0<c.length){c=c.split(" ");for(var f=[],k=[],m=0;m<c.length;m++){var t=+mxUtils.trim(c[m]);""!=t&&(k.push(t),0>mxUtils.indexOf(P,t)&&f.push(t))}A.isSelectionEmpty()?J(P.concat(f)):A.addTagsForCells(A.getSelectionCells(),k)}},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=D.div;this.window=new mxWindow(mxResources.get("tags"),z,l,n,d,v,!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(){D.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AuthDialog=function(b,l,n,d){var v=document.createElement("div");v.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("authorizationRequired"));var z="Unknown",D=document.createElement("img");D.setAttribute("border","0");D.setAttribute("align","absmiddle");D.style.marginRight="10px";l==b.drive?(z=mxResources.get("googleDrive"),D.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(z=mxResources.get("dropbox"),D.src=IMAGE_PATH+"/dropbox-logo-white.svg"):l==b.oneDrive?(z=mxResources.get("oneDrive"),D.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(z=mxResources.get("github"),D.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(z=mxResources.get("gitlab"),D.src=IMAGE_PATH+"/gitlab-logo.svg",D.style.width=-"32px"):l==b.trello&&(z=mxResources.get("trello"),D.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[z]));var P=document.createElement("input");P.setAttribute("type","checkbox");z=mxUtils.button(mxResources.get("authorize"),function(){d(P.checked)});z.insertBefore(D,z.firstChild);z.style.marginTop="6px";z.className="geBigButton";z.style.fontSize="18px";z.style.padding="14px";x.appendChild(A);x.appendChild(b);x.appendChild(z);-n&&(n=document.createElement("p"),n.style.marginTop="20px",n.appendChild(P),A=document.createElement("span"),mxUtils.write(A," "+mxResources.get("rememberMe")),n.appendChild(A),x.appendChild(n),P.checked=!0,P.defaultChecked=!0,mxEvent.addListener(A,"click",function(J){P.checked=!P.checked;mxEvent.consume(J)}));this.container=x},MoreShapesDialog=function(b,l,n){n=null!=n?n:b.sidebar.entries;var d=document.createElement("div"),x=[];if(null!=b.sidebar.customEntries)for(var A=0;A<b.sidebar.customEntries.length;A++){for(var z=-b.sidebar.customEntries[A]||{},D={title:b.getResource(z.title),entries:[]},P=0;null!=z.entries&&P<z.entries.length;P++){var J=z.entries[P];D.entries.push({id:J.id,title:b.getResource(J.title),desc:b.getResource(J.desc),image:J.preview})}0<D.entries.length&&x.push(D)}for(A=0;A<n.length;A++)if(null==b.sidebar.enabledLibraries)x.push(n[A]);else{D={title:n[A].title,entries:[]};for(P=0;P<n[A].entries.length;P++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,n[A].entries[P].id)&&D.entries.push(n[A].entries[P]);-0<D.entries.length&&x.push(D)}n=x;if(l){A=mxUtils.bind(this,function(U){for(var Q=0;Q<U.length;Q++)(function(O){var q=m.cloneNode(!1);q.style.fontWeight="bold";q.style.backgroundColor="light-dark(#e5e5e5, #505759)";q.style.padding="6px 0px 6px 20px";mxUtils.write(q,O.title);L.appendChild(q);for(var u=0;u<O.entries.length;u++)(function(I){var G=m.cloneNode(!1);G.style.cursor="pointer";G.style.padding="4px 0px 4px 20px";G.style.whiteSpace="nowrap";G.style.overflow="hidden";G.style.textOverflow="ellipsis";+"32px"):l==b.trello&&(z=mxResources.get("trello"),D.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",[z]));var P=document.createElement("input");P.setAttribute("type","checkbox");z=mxUtils.button(mxResources.get("authorize"),function(){d(P.checked)});z.insertBefore(D,z.firstChild);z.style.marginTop="6px";z.className="geBigButton";z.style.fontSize="18px";z.style.padding="14px";v.appendChild(A);v.appendChild(b);v.appendChild(z);+n&&(n=document.createElement("p"),n.style.marginTop="20px",n.appendChild(P),A=document.createElement("span"),mxUtils.write(A," "+mxResources.get("rememberMe")),n.appendChild(A),v.appendChild(n),P.checked=!0,P.defaultChecked=!0,mxEvent.addListener(A,"click",function(J){P.checked=!P.checked;mxEvent.consume(J)}));this.container=v},MoreShapesDialog=function(b,l,n){n=null!=n?n:b.sidebar.entries;var d=document.createElement("div"),v=[];if(null!=b.sidebar.customEntries)for(var A=0;A<b.sidebar.customEntries.length;A++){for(var z=+b.sidebar.customEntries[A]||{},D={title:b.getResource(z.title),entries:[]},P=0;null!=z.entries&&P<z.entries.length;P++){var J=z.entries[P];D.entries.push({id:J.id,title:b.getResource(J.title),desc:b.getResource(J.desc),image:J.preview})}0<D.entries.length&&v.push(D)}for(A=0;A<n.length;A++)if(null==b.sidebar.enabledLibraries)v.push(n[A]);else{D={title:n[A].title,entries:[]};for(P=0;P<n[A].entries.length;P++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,n[A].entries[P].id)&&D.entries.push(n[A].entries[P]);+0<D.entries.length&&v.push(D)}n=v;if(l){A=mxUtils.bind(this,function(U){for(var Q=0;Q<U.length;Q++)(function(O){var q=m.cloneNode(!1);q.style.fontWeight="bold";q.style.backgroundColor="light-dark(#e5e5e5, #505759)";q.style.padding="6px 0px 6px 20px";mxUtils.write(q,O.title);L.appendChild(q);for(var u=0;u<O.entries.length;u++)(function(I){var G=m.cloneNode(!1);G.style.cursor="pointer";G.style.padding="4px 0px 4px 20px";G.style.whiteSpace="nowrap";G.style.overflow="hidden";G.style.textOverflow="ellipsis";G.setAttribute("title",I.title+" ("+I.id+")");var H=document.createElement("input");H.setAttribute("type","checkbox");H.checked=b.sidebar.isEntryVisible(I.id);H.defaultChecked=H.checked;G.appendChild(H);mxUtils.write(G," "+I.title);L.appendChild(G);var g=function(p){if(null==p||"INPUT"!=mxEvent.getSource(p).nodeName){c.style.textAlign="center";c.style.padding="0px";c.style.color="";c.innerText="";if(null!=I.desc){var B=document.createElement("pre");B.style.boxSizing="border-box";B.style.fontFamily="inherit";B.style.margin="20px";B.style.right="0px";B.style.textAlign="left";mxUtils.write(B,I.desc);c.appendChild(B)}null!=I.imageCallback?I.imageCallback(c):null!=I.image?(B=document.createElement("img"),B.setAttribute("border","0"),B.style.maxWidth="100%",B.setAttribute("src",I.image),c.appendChild(B)):null==I.desc&&(c.style.padding="20px",c.style.color="rgb(179, 179, 179)",mxUtils.write(c,mxResources.get("noPreview")));null!=f&&(f.style.backgroundColor="");f=G;f.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=p&&mxEvent.consume(p)}};mxEvent.addListener(G,"click",g);mxEvent.addListener(G,"dblclick",function(p){H.checked=!H.checked;mxEvent.consume(p)});k.push(function(){return H.checked?I.id:null});0==Q&&0==u&&g()})(O.entries[u])})(U[Q])});P=document.createElement("div");P.className="geDialogTitle";mxUtils.write(P,mxResources.get("shapes"));P.style.position="absolute";P.style.top="0px";P.style.left="0px";P.style.lineHeight="40px";P.style.height="40px";P.style.right="0px";var L=document.createElement("div"),c=document.createElement("div");L.style.position="absolute";L.style.top="40px";L.style.left="0px";L.style.width="202px";L.style.bottom="60px";L.style.overflow="auto";c.style.position="absolute";c.style.left="202px";c.style.right="0px";c.style.top="40px";c.style.bottom="60px";c.style.overflow="auto";c.style.borderLeftStyle="solid";c.style.borderLeftWidth="1px";c.style.textAlign="center";var f=null,k=[],m=document.createElement("div");m.style.position="relative";m.style.left="0px";m.style.right="0px";A(n);d.style.padding="30px";d.appendChild(P);d.appendChild(L);d.appendChild(c);n=document.createElement("div");n.className="geDialogFooter";n.style.position="absolute";n.style.paddingRight="16px";n.style.left="0px";n.style.right="0px";n.style.bottom="0px";n.style.height="60px";n.style.lineHeight="52px";var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.position="relative";t.style.top="1px";t.checked=b.sidebar.sidebarTitles;t.defaultChecked=t.checked;n.appendChild(t);A=-document.createElement("span");mxUtils.write(A," "+mxResources.get("labels"));A.style.paddingRight="20px";n.appendChild(A);mxEvent.addListener(A,"click",function(U){t.checked=!t.checked;mxEvent.consume(U)});var v=document.createElement("input");v.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)A=document.createElement("span"),A.style.paddingRight="20px",A.appendChild(v),mxUtils.write(A," "+mxResources.get("rememberThisSetting")),v.style.position="relative",v.style.top="1px",-v.checked=!0,v.defaultChecked=!0,mxEvent.addListener(A,"click",function(U){mxEvent.getSource(U)!=v&&(v.checked=!v.checked,mxEvent.consume(U))}),n.appendChild(A);A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});A.className="geBtn";P=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var U=[],Q=0;Q<k.length;Q++){var O=k[Q].apply(this,arguments);null!=O&&U.push(O)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||-(Q=mxUtils.indexOf(U,".scratchpad"),null!=b.scratchpad!=(0<=Q&&0<U.splice(Q,1).length)&&b.toggleScratchpad(),Q=mxUtils.indexOf(U,"search"),mxSettings.settings.search=0<=Q&&0<U.splice(Q,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),v.checked&&mxSettings.save());b.sidebar.showEntries(U.join(";"),v.checked,!0);b.setSidebarTitles(t.checked,v.checked)});P.className="geBtn gePrimaryBtn"}else{var y=document.createElement("table");A=document.createElement("tbody");d.style.height="100%";-d.style.overflow="auto";P=document.createElement("tr");y.style.width="100%";l=document.createElement("td");x=document.createElement("td");z=document.createElement("td");var F=mxUtils.bind(this,function(U,Q,O){var q=document.createElement("input");q.type="checkbox";y.appendChild(q);q.checked=b.sidebar.isEntryVisible(O);var u=document.createElement("span");mxUtils.write(u,Q);Q=document.createElement("div");Q.style.display="block";Q.appendChild(q);Q.appendChild(u);mxEvent.addListener(u,"click",function(I){q.checked=-!q.checked;mxEvent.consume(I)});U.appendChild(Q);return function(){return q.checked?O:null}});P.appendChild(l);P.appendChild(x);P.appendChild(z);A.appendChild(P);y.appendChild(A);k=[];var E=0;for(A=0;A<n.length;A++)for(P=0;P<n[A].entries.length;P++)E++;var C=[l,x,z],S=0;for(A=0;A<n.length;A++)(function(U){for(var Q=0;Q<U.entries.length;Q++){var O=U.entries[Q];k.push(F(C[Math.floor(S/(E/3))],O.title,O.id));S++}})(n[A]);d.appendChild(y);n=document.createElement("div");n.style.marginTop="18px";n.style.textAlign=-"center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=!0,n.appendChild(v),A=document.createElement("span"),mxUtils.write(A," "+mxResources.get("rememberThisSetting")),n.appendChild(A),mxEvent.addListener(A,"click",function(U){v.checked=!v.checked;mxEvent.consume(U)}));d.appendChild(n);A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});A.className="geBtn";P=mxUtils.button(mxResources.get("apply"),function(){for(var U=-["search"],Q=0;Q<k.length;Q++){var O=k[Q].apply(this,arguments);null!=O&&U.push(O)}b.sidebar.showEntries(0<U.length?U.join(";"):"",v.checked);b.hideDialog()});P.className="geBtn gePrimaryBtn";n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="right"}b.editor.cancelFirst?(n.appendChild(A),n.appendChild(P)):(n.appendChild(P),n.appendChild(A));d.appendChild(n);this.container=d},PluginsDialog=function(b,l,n,d){function x(){P=!0;if(0==D.length)z.innerText=mxResources.get("noPlugins");+document.createElement("span");mxUtils.write(A," "+mxResources.get("labels"));A.style.paddingRight="20px";n.appendChild(A);mxEvent.addListener(A,"click",function(U){t.checked=!t.checked;mxEvent.consume(U)});var x=document.createElement("input");x.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)A=document.createElement("span"),A.style.paddingRight="20px",A.appendChild(x),mxUtils.write(A," "+mxResources.get("rememberThisSetting")),x.style.position="relative",x.style.top="1px",+x.checked=!0,x.defaultChecked=!0,mxEvent.addListener(A,"click",function(U){mxEvent.getSource(U)!=x&&(x.checked=!x.checked,mxEvent.consume(U))}),n.appendChild(A);A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});A.className="geBtn";P=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var U=[],Q=0;Q<k.length;Q++){var O=k[Q].apply(this,arguments);null!=O&&U.push(O)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||+(Q=mxUtils.indexOf(U,".scratchpad"),null!=b.scratchpad!=(0<=Q&&0<U.splice(Q,1).length)&&b.toggleScratchpad(),Q=mxUtils.indexOf(U,"search"),mxSettings.settings.search=0<=Q&&0<U.splice(Q,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),x.checked&&mxSettings.save());b.sidebar.showEntries(U.join(";"),x.checked,!0);b.setSidebarTitles(t.checked,x.checked)});P.className="geBtn gePrimaryBtn"}else{var y=document.createElement("table");A=document.createElement("tbody");d.style.height="100%";+d.style.overflow="auto";P=document.createElement("tr");y.style.width="100%";l=document.createElement("td");v=document.createElement("td");z=document.createElement("td");var F=mxUtils.bind(this,function(U,Q,O){var q=document.createElement("input");q.type="checkbox";y.appendChild(q);q.checked=b.sidebar.isEntryVisible(O);var u=document.createElement("span");mxUtils.write(u,Q);Q=document.createElement("div");Q.style.display="block";Q.appendChild(q);Q.appendChild(u);mxEvent.addListener(u,"click",function(I){q.checked=+!q.checked;mxEvent.consume(I)});U.appendChild(Q);return function(){return q.checked?O:null}});P.appendChild(l);P.appendChild(v);P.appendChild(z);A.appendChild(P);y.appendChild(A);k=[];var E=0;for(A=0;A<n.length;A++)for(P=0;P<n[A].entries.length;P++)E++;var C=[l,v,z],S=0;for(A=0;A<n.length;A++)(function(U){for(var Q=0;Q<U.entries.length;Q++){var O=U.entries[Q];k.push(F(C[Math.floor(S/(E/3))],O.title,O.id));S++}})(n[A]);d.appendChild(y);n=document.createElement("div");n.style.marginTop="18px";n.style.textAlign=+"center";x=document.createElement("input");isLocalStorage&&(x.setAttribute("type","checkbox"),x.checked=!0,x.defaultChecked=!0,n.appendChild(x),A=document.createElement("span"),mxUtils.write(A," "+mxResources.get("rememberThisSetting")),n.appendChild(A),mxEvent.addListener(A,"click",function(U){x.checked=!x.checked;mxEvent.consume(U)}));d.appendChild(n);A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});A.className="geBtn";P=mxUtils.button(mxResources.get("apply"),function(){for(var U=+["search"],Q=0;Q<k.length;Q++){var O=k[Q].apply(this,arguments);null!=O&&U.push(O)}b.sidebar.showEntries(0<U.length?U.join(";"):"",x.checked);b.hideDialog()});P.className="geBtn gePrimaryBtn";n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="right"}b.editor.cancelFirst?(n.appendChild(A),n.appendChild(P)):(n.appendChild(P),n.appendChild(A));d.appendChild(n);this.container=d},PluginsDialog=function(b,l,n,d){function v(){P=!0;if(0==D.length)z.innerText=mxResources.get("noPlugins");else{z.innerText="";for(var k=0;k<D.length;k++){var m=document.createElement("span");m.style.display="flex";m.style.alignItems="center";m.style.whiteSpace="nowrap";var t=document.createElement("img");t.src=Editor.trashImage;t.style.position="relative";t.style.cursor="pointer";t.style.marginRight="4px";t.style.display="inline-block";t.style.width="18px";t.setAttribute("title",mxResources.get("delete"));m.appendChild(t);mxUtils.write(m,D[k]);z.appendChild(m);mxUtils.br(z);mxEvent.addListener(t,"click",-function(v){return function(){b.confirm(mxResources.get("delete")+' "'+D[v]+'"?',function(){null!=n&&n(D[v]);D.splice(v,1);x()})}}(k))}}}var A=document.createElement("div"),z=document.createElement("div");z.style.height="180px";z.style.overflow="auto";var D=mxSettings.getPlugins().slice(),P=!1;A.appendChild(z);x();P=!1;var J=mxUtils.button(mxResources.get("add"),null!=l?function(){l(function(k){k&&0>mxUtils.indexOf(D,k)&&D.push(k);x()})}:function(){var k=document.createElement("div"),m=document.createElement("span");-m.style.marginTop="6px";mxUtils.write(m,mxResources.get("builtinPlugins")+": ");k.appendChild(m);var t=document.createElement("select");t.style.width="150px";for(m=0;m<App.publicPlugin.length;m++){var v=document.createElement("option");mxUtils.write(v,App.publicPlugin[m]);v.value=App.publicPlugin[m];t.appendChild(v)}k.appendChild(t);mxUtils.br(k);mxUtils.br(k);m=mxUtils.button(mxResources.get("custom")+"...",function(){var y=new FilenameDialog(b,"",mxResources.get("add"),function(F){b.hideDialog();-if(null!=F&&0<F.length){F=F.split(";");for(var E=0;E<F.length;E++){var C=F[E],S=App.pluginRegistry[C];null!=S&&(C=S);0<C.length&&0>mxUtils.indexOf(D,C)&&D.push(C)}x()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(y.container,300,80,!0,!0);y.init()});m.className="geBtn";ALLOW_CUSTOM_PLUGINS||(m.style.display="none");k=new CustomDialog(b,k,mxUtils.bind(this,function(){var y=App.pluginRegistry[t.value];0>mxUtils.indexOf(D,y)&&(D.push(y),x())}),null,null,null,m);b.showDialog(k.container,+function(x){return function(){b.confirm(mxResources.get("delete")+' "'+D[x]+'"?',function(){null!=n&&n(D[x]);D.splice(x,1);v()})}}(k))}}}var A=document.createElement("div"),z=document.createElement("div");z.style.height="180px";z.style.overflow="auto";var D=mxSettings.getPlugins().slice(),P=!1;A.appendChild(z);v();P=!1;var J=mxUtils.button(mxResources.get("add"),null!=l?function(){l(function(k){k&&0>mxUtils.indexOf(D,k)&&D.push(k);v()})}:function(){var k=document.createElement("div"),m=document.createElement("span");+m.style.marginTop="6px";mxUtils.write(m,mxResources.get("builtinPlugins")+": ");k.appendChild(m);var t=document.createElement("select");t.style.width="150px";for(m=0;m<App.publicPlugin.length;m++){var x=document.createElement("option");mxUtils.write(x,App.publicPlugin[m]);x.value=App.publicPlugin[m];t.appendChild(x)}k.appendChild(t);mxUtils.br(k);mxUtils.br(k);m=mxUtils.button(mxResources.get("custom")+"...",function(){var y=new FilenameDialog(b,"",mxResources.get("add"),function(F){b.hideDialog();+if(null!=F&&0<F.length){F=F.split(";");for(var E=0;E<F.length;E++){var C=F[E],S=App.pluginRegistry[C];null!=S&&(C=S);0<C.length&&0>mxUtils.indexOf(D,C)&&D.push(C)}v()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(y.container,300,80,!0,!0);y.init()});m.className="geBtn";ALLOW_CUSTOM_PLUGINS||(m.style.display="none");k=new CustomDialog(b,k,mxUtils.bind(this,function(){var y=App.pluginRegistry[t.value];0>mxUtils.indexOf(D,y)&&(D.push(y),v())}),null,null,null,m);b.showDialog(k.container,360,100,!0,!0)});J.className="geBtn";var L=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});L.className="geBtn";var c=mxUtils.button(d?mxResources.get("close"):mxResources.get("apply"),function(){P?(mxSettings.setPlugins(D),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});c.className="geBtn gePrimaryBtn";var f=document.createElement("div");f.style.marginTop="14px";f.style.textAlign="right";b.isOffline()||f.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));-b.editor.cancelFirst?(d||f.appendChild(L),f.appendChild(J),f.appendChild(c)):(f.appendChild(J),f.appendChild(c),d||f.appendChild(L));A.appendChild(f);this.container=A},CropImageDialog=function(b,l,n,d){function x(){var U=v.checked,Q=y.checked,O=k.geometry,q=P.width,u=P.height,I=(300-q)/2,G=(300-u)/2;O.x<I?(O.width-=I-O.x,O.x=I):O.x+O.width>I+q&&(O.width=I+q-O.x,O.x=Math.min(O.x,I+q));O.y<G?(O.height-=G-O.y,O.y=G):O.y+O.height>G+u&&(O.height=G+u-O.y,O.y=Math.min(O.y,G+u));var H=(O.x-I)/q*100;q=100--(O.x+O.width-I)/q*100;I=(O.y-G)/u*100;O=100-(O.y+O.height-G)/u*100;return"inset("+mxUtils.format(I)+"% "+mxUtils.format(q)+"% "+mxUtils.format(O)+"% "+mxUtils.format(H)+"%"+(U?" round "+f+"%":Q?" round 50%":"")+")"}function A(U){null!=L&&(!0!==U&&(L.model.setGeometry(k,c.clone()),f=5,E.value=f),L.model.setStyle(k,m+x()),L.selectAll(),F.style.visibility=v.checked?"visible":"hidden")}var z=document.createElement("div"),D=document.createElement("div");D.style.height="300px";D.style.width="300px";D.style.display=-"inline-flex";D.style.justifyContent="center";D.style.alignItems="center";D.style.position="absolute";var P=document.createElement("img");P.onload=function(){function U(){L.model.setStyle(k,m+x())}L=new Graph(J);L.autoExtend=!1;L.autoScroll=!1;L.setGridEnabled(!1);L.setEnabled(!0);L.setPanning(!1);L.setConnectable(!1);L.getRubberband().setEnabled(!1);L.graphHandler.allowLivePreview=!1;var Q=L.createVertexHandler;L.createVertexHandler=function(){var T=Q.apply(this,arguments);T.livePreview=!1;return T};-if(null!=n)try{if("inset"==n.substring(0,5)){var O=k.geometry,q=P.width,u=P.height,I=(300-q)/2,G=(300-u)/2,H=n.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),g=parseFloat(H[0]),p=parseFloat(H[1]),B=parseFloat(H[2]),K=parseFloat(H[3]);isFinite(g)&&isFinite(p)&&isFinite(B)&&isFinite(K)?(O.x=K/100*q+I,O.y=g/100*u+G,O.width=(100-p)/100*q+I-O.x,O.height=(100-B)/100*u+G-O.y,"round"==H[4]?"50%"==H[5]?y.setAttribute("checked","checked"):(f=parseInt(H[5]),E.value=f,v.setAttribute("checked","checked"),F.style.visibility=-"visible"):t.setAttribute("checked","checked")):n=null}else n=null}catch(T){}k.style=m+(n?n:x());k.vertex=!0;L.addCell(k,null,null,null,null);L.selectAll();L.addListener(mxEvent.CELLS_MOVED,U);L.addListener(mxEvent.CELLS_RESIZED,U);var M=L.graphHandler.mouseUp,N=L.graphHandler.mouseDown;L.graphHandler.mouseUp=function(){M.apply(this,arguments);J.style.backgroundColor="#fff9"};L.graphHandler.mouseDown=function(){N.apply(this,arguments);J.style.backgroundColor=""};L.dblClick=function(){};var R=L.getSelectionModel().changeSelection;+b.editor.cancelFirst?(d||f.appendChild(L),f.appendChild(J),f.appendChild(c)):(f.appendChild(J),f.appendChild(c),d||f.appendChild(L));A.appendChild(f);this.container=A},CropImageDialog=function(b,l,n,d){function v(){var U=x.checked,Q=y.checked,O=k.geometry,q=P.width,u=P.height,I=(300-q)/2,G=(300-u)/2;O.x<I?(O.width-=I-O.x,O.x=I):O.x+O.width>I+q&&(O.width=I+q-O.x,O.x=Math.min(O.x,I+q));O.y<G?(O.height-=G-O.y,O.y=G):O.y+O.height>G+u&&(O.height=G+u-O.y,O.y=Math.min(O.y,G+u));var H=(O.x-I)/q*100;q=100-+(O.x+O.width-I)/q*100;I=(O.y-G)/u*100;O=100-(O.y+O.height-G)/u*100;return"inset("+mxUtils.format(I)+"% "+mxUtils.format(q)+"% "+mxUtils.format(O)+"% "+mxUtils.format(H)+"%"+(U?" round "+f+"%":Q?" round 50%":"")+")"}function A(U){null!=L&&(!0!==U&&(L.model.setGeometry(k,c.clone()),f=5,E.value=f),L.model.setStyle(k,m+v()),L.selectAll(),F.style.visibility=x.checked?"visible":"hidden")}var z=document.createElement("div"),D=document.createElement("div");D.style.height="300px";D.style.width="300px";D.style.display=+"inline-flex";D.style.justifyContent="center";D.style.alignItems="center";D.style.position="absolute";var P=document.createElement("img");P.onload=function(){function U(){L.model.setStyle(k,m+v())}L=new Graph(J);L.autoExtend=!1;L.autoScroll=!1;L.setGridEnabled(!1);L.setEnabled(!0);L.setPanning(!1);L.setConnectable(!1);L.getRubberband().setEnabled(!1);L.graphHandler.allowLivePreview=!1;var Q=L.createVertexHandler;L.createVertexHandler=function(){var T=Q.apply(this,arguments);T.livePreview=!1;return T};+if(null!=n)try{if("inset"==n.substring(0,5)){var O=k.geometry,q=P.width,u=P.height,I=(300-q)/2,G=(300-u)/2,H=n.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),g=parseFloat(H[0]),p=parseFloat(H[1]),B=parseFloat(H[2]),K=parseFloat(H[3]);isFinite(g)&&isFinite(p)&&isFinite(B)&&isFinite(K)?(O.x=K/100*q+I,O.y=g/100*u+G,O.width=(100-p)/100*q+I-O.x,O.height=(100-B)/100*u+G-O.y,"round"==H[4]?"50%"==H[5]?y.setAttribute("checked","checked"):(f=parseInt(H[5]),E.value=f,x.setAttribute("checked","checked"),F.style.visibility=+"visible"):t.setAttribute("checked","checked")):n=null}else n=null}catch(T){}k.style=m+(n?n:v());k.vertex=!0;L.addCell(k,null,null,null,null);L.selectAll();L.addListener(mxEvent.CELLS_MOVED,U);L.addListener(mxEvent.CELLS_RESIZED,U);var M=L.graphHandler.mouseUp,N=L.graphHandler.mouseDown;L.graphHandler.mouseUp=function(){M.apply(this,arguments);J.style.backgroundColor="#fff9"};L.graphHandler.mouseDown=function(){N.apply(this,arguments);J.style.backgroundColor=""};L.dblClick=function(){};var R=L.getSelectionModel().changeSelection;L.getSelectionModel().changeSelection=function(){R.call(this,[k],[k])}};P.onerror=function(){P.onload=null;P.src=Editor.errorImage};P.setAttribute("src",l);P.style.maxWidth="300px";P.style.maxHeight="300px";D.appendChild(P);z.appendChild(D);var J=document.createElement("div");J.style.width="300px";J.style.height="300px";J.style.overflow="hidden";J.style.backgroundColor="#fff9";z.appendChild(J);var L=null,c=new mxGeometry(100,100,100,100),f=5,k=new mxCell("",c.clone(),""),m="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+-l.replace(";base64","")+";clipPath=",t=document.createElement("input");t.setAttribute("type","radio");t.setAttribute("id","croppingRect");t.setAttribute("name","croppingShape");t.setAttribute("checked","checked");t.style.margin="5px";z.appendChild(t);l=document.createElement("label");l.setAttribute("for","croppingRect");mxUtils.write(l,mxResources.get("rectangle"));z.appendChild(l);var v=document.createElement("input");v.setAttribute("type","radio");v.setAttribute("id","croppingRounded");v.setAttribute("name",-"croppingShape");v.style.margin="5px";z.appendChild(v);l=document.createElement("label");l.setAttribute("for","croppingRounded");mxUtils.write(l,mxResources.get("rounded"));z.appendChild(l);var y=document.createElement("input");y.setAttribute("type","radio");y.setAttribute("id","croppingEllipse");y.setAttribute("name","croppingShape");y.style.margin="5px";z.appendChild(y);l=document.createElement("label");l.setAttribute("for","croppingEllipse");mxUtils.write(l,mxResources.get("ellipse"));z.appendChild(l);-mxEvent.addListener(t,"change",A);mxEvent.addListener(v,"change",A);mxEvent.addListener(y,"change",A);var F=document.createElement("div");F.style.textAlign="center";F.style.visibility="hidden";var E=document.createElement("input");E.setAttribute("type","range");E.setAttribute("min","1");E.setAttribute("max","49");E.setAttribute("value",f);E.setAttribute("title",mxResources.get("arcSize"));F.appendChild(E);z.appendChild(F);mxEvent.addListener(E,"change",function(){f=this.value;A(!0)});l=mxUtils.button(mxResources.get("cancel"),-function(){b.hideDialog()});l.className="geBtn";D=mxUtils.button(mxResources.get("apply"),function(){d(x(),k.geometry.width,k.geometry.height);b.hideDialog()});D.className="geBtn gePrimaryBtn";var C=mxUtils.button(mxResources.get("reset"),function(){d(null,P.width,P.height);b.hideDialog()});C.className="geBtn";var S=document.createElement("div");S.style.marginTop="10px";S.style.textAlign="right";b.editor.cancelFirst?(S.appendChild(l),S.appendChild(C),S.appendChild(D)):(S.appendChild(C),S.appendChild(D),-S.appendChild(l));z.appendChild(S);this.container=z},EditGeometryDialog=function(b,l){var n=b.editor.graph,d=1==l.length?n.getCellGeometry(l[0]):null,x=document.createElement("div"),A=document.createElement("table"),z=document.createElement("tbody"),D=document.createElement("tr"),P=document.createElement("td"),J=document.createElement("td");A.style.paddingLeft="6px";mxUtils.write(P,mxResources.get("relative")+":");var L=document.createElement("input");L.setAttribute("type","checkbox");null!=d&&d.relative&&+l.replace(";base64","")+";clipPath=",t=document.createElement("input");t.setAttribute("type","radio");t.setAttribute("id","croppingRect");t.setAttribute("name","croppingShape");t.setAttribute("checked","checked");t.style.margin="5px";z.appendChild(t);l=document.createElement("label");l.setAttribute("for","croppingRect");mxUtils.write(l,mxResources.get("rectangle"));z.appendChild(l);var x=document.createElement("input");x.setAttribute("type","radio");x.setAttribute("id","croppingRounded");x.setAttribute("name",+"croppingShape");x.style.margin="5px";z.appendChild(x);l=document.createElement("label");l.setAttribute("for","croppingRounded");mxUtils.write(l,mxResources.get("rounded"));z.appendChild(l);var y=document.createElement("input");y.setAttribute("type","radio");y.setAttribute("id","croppingEllipse");y.setAttribute("name","croppingShape");y.style.margin="5px";z.appendChild(y);l=document.createElement("label");l.setAttribute("for","croppingEllipse");mxUtils.write(l,mxResources.get("ellipse"));z.appendChild(l);+mxEvent.addListener(t,"change",A);mxEvent.addListener(x,"change",A);mxEvent.addListener(y,"change",A);var F=document.createElement("div");F.style.textAlign="center";F.style.visibility="hidden";var E=document.createElement("input");E.setAttribute("type","range");E.setAttribute("min","1");E.setAttribute("max","49");E.setAttribute("value",f);E.setAttribute("title",mxResources.get("arcSize"));F.appendChild(E);z.appendChild(F);mxEvent.addListener(E,"change",function(){f=this.value;A(!0)});l=mxUtils.button(mxResources.get("cancel"),+function(){b.hideDialog()});l.className="geBtn";D=mxUtils.button(mxResources.get("apply"),function(){d(v(),k.geometry.width,k.geometry.height);b.hideDialog()});D.className="geBtn gePrimaryBtn";var C=mxUtils.button(mxResources.get("reset"),function(){d(null,P.width,P.height);b.hideDialog()});C.className="geBtn";var S=document.createElement("div");S.style.marginTop="10px";S.style.textAlign="right";b.editor.cancelFirst?(S.appendChild(l),S.appendChild(C),S.appendChild(D)):(S.appendChild(C),S.appendChild(D),+S.appendChild(l));z.appendChild(S);this.container=z},EditGeometryDialog=function(b,l){var n=b.editor.graph,d=1==l.length?n.getCellGeometry(l[0]):null,v=document.createElement("div"),A=document.createElement("table"),z=document.createElement("tbody"),D=document.createElement("tr"),P=document.createElement("td"),J=document.createElement("td");A.style.paddingLeft="6px";mxUtils.write(P,mxResources.get("relative")+":");var L=document.createElement("input");L.setAttribute("type","checkbox");null!=d&&d.relative&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);this.init=function(){L.focus()};J.appendChild(L);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");J=document.createElement("td");mxUtils.write(P,mxResources.get("left")+":");var c=document.createElement("input");c.setAttribute("type","text");c.style.width="100px";c.value=null!=d?d.x:"";J.appendChild(c);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");J=document.createElement("td");mxUtils.write(P,mxResources.get("top")+":");var f=document.createElement("input");f.setAttribute("type","text");f.style.width="100px";f.value=null!=d?d.y:"";J.appendChild(f);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");J=document.createElement("td");mxUtils.write(P,mxResources.get("dx")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value=null!=d&&null!=d.offset?d.offset.x:"";J.appendChild(k);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");J=document.createElement("td");mxUtils.write(P,mxResources.get("dy")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="100px";m.value=null!=d&&null!=d.offset?d.offset.y:"";J.appendChild(m);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");-J=document.createElement("td");mxUtils.write(P,mxResources.get("width")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=d?d.width:"";J.appendChild(t);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");J=document.createElement("td");mxUtils.write(P,mxResources.get("height")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=-d?d.height:"";J.appendChild(v);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");J=document.createElement("td");mxUtils.write(P,mxResources.get("rotation")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=1==l.length?mxUtils.getValue(n.getCellStyle(l[0]),mxConstants.STYLE_ROTATION,0):"";J.appendChild(y);D.appendChild(P);D.appendChild(J);z.appendChild(D);A.appendChild(z);x.appendChild(A);+J=document.createElement("td");mxUtils.write(P,mxResources.get("width")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=d?d.width:"";J.appendChild(t);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");J=document.createElement("td");mxUtils.write(P,mxResources.get("height")+":");var x=document.createElement("input");x.setAttribute("type","text");x.style.width="100px";x.value=null!=+d?d.height:"";J.appendChild(x);D.appendChild(P);D.appendChild(J);z.appendChild(D);D=document.createElement("tr");P=document.createElement("td");J=document.createElement("td");mxUtils.write(P,mxResources.get("rotation")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=1==l.length?mxUtils.getValue(n.getCellStyle(l[0]),mxConstants.STYLE_ROTATION,0):"";J.appendChild(y);D.appendChild(P);D.appendChild(J);z.appendChild(D);A.appendChild(z);v.appendChild(A);d=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});d.className="geBtn";var F=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();n.getModel().beginUpdate();try{for(var E=0;E<l.length;E++){var C=n.getCellGeometry(l[E]);null!=C&&(C=C.clone(),n.isCellMovable(l[E])&&(C.relative=L.checked,0<mxUtils.trim(c.value).length&&(C.x=Number(c.value)),0<mxUtils.trim(f.value).length&&(C.y=Number(f.value)),0<mxUtils.trim(k.value).length&&(null==C.offset&&(C.offset=new mxPoint),C.offset.x=-Number(k.value)),0<mxUtils.trim(m.value).length&&(null==C.offset&&(C.offset=new mxPoint),C.offset.y=Number(m.value))),n.isCellResizable(l[E])&&(0<mxUtils.trim(t.value).length&&(C.width=Number(t.value)),0<mxUtils.trim(v.value).length&&(C.height=Number(v.value))),n.getModel().setGeometry(l[E],C));0<mxUtils.trim(y.value).length&&n.setCellStyles(mxConstants.STYLE_ROTATION,Number(y.value),[l[E]])}}finally{n.getModel().endUpdate()}});F.className="geBtn gePrimaryBtn";mxEvent.addListener(x,"keypress",function(E){13==-E.keyCode&&F.click()});A=document.createElement("div");A.style.marginTop="20px";A.style.textAlign="right";b.editor.cancelFirst?(A.appendChild(d),A.appendChild(F)):(A.appendChild(F),A.appendChild(d));x.appendChild(A);this.container=x},LibraryDialog=function(b,l,n,d,x,A,z){function D(q){for(q=document.elementFromPoint(q.clientX,q.clientY);null!=q&&q.parentNode!=t;)q=q.parentNode;var u=null;if(null!=q){var I=t.firstChild;for(u=0;null!=I&&I!=q;)I=I.nextSibling,u++}return u}function P(q,u,I,G,H,g,p,B,-K){try{if(b.spinner.stop(),null==u||"image/"==u.substring(0,6))if(null==q&&null!=p||null==y[q]){var M=function(){Z.innerText="";Z.style.cursor="pointer";Z.style.whiteSpace="nowrap";Z.style.textOverflow="ellipsis";mxUtils.write(Z,null!=aa.title&&0<aa.title.length?aa.title:mxResources.get("untitled"));Z.style.color=null==aa.title||0==aa.title.length?"#d0d0d0":""};t.style.backgroundImage="";v.style.display="none";var N=H,R=g;if(H>b.maxImageSize||g>b.maxImageSize){var T=Math.min(1,Math.min(b.maxImageSize/+Number(k.value)),0<mxUtils.trim(m.value).length&&(null==C.offset&&(C.offset=new mxPoint),C.offset.y=Number(m.value))),n.isCellResizable(l[E])&&(0<mxUtils.trim(t.value).length&&(C.width=Number(t.value)),0<mxUtils.trim(x.value).length&&(C.height=Number(x.value))),n.getModel().setGeometry(l[E],C));0<mxUtils.trim(y.value).length&&n.setCellStyles(mxConstants.STYLE_ROTATION,Number(y.value),[l[E]])}}finally{n.getModel().endUpdate()}});F.className="geBtn gePrimaryBtn";mxEvent.addListener(v,"keypress",function(E){13==+E.keyCode&&F.click()});A=document.createElement("div");A.style.marginTop="20px";A.style.textAlign="right";b.editor.cancelFirst?(A.appendChild(d),A.appendChild(F)):(A.appendChild(F),A.appendChild(d));v.appendChild(A);this.container=v},LibraryDialog=function(b,l,n,d,v,A,z){function D(q){for(q=document.elementFromPoint(q.clientX,q.clientY);null!=q&&q.parentNode!=t;)q=q.parentNode;var u=null;if(null!=q){var I=t.firstChild;for(u=0;null!=I&&I!=q;)I=I.nextSibling,u++}return u}function P(q,u,I,G,H,g,p,B,+K){try{if(b.spinner.stop(),null==u||"image/"==u.substring(0,6))if(null==q&&null!=p||null==y[q]){var M=function(){Z.innerText="";Z.style.cursor="pointer";Z.style.whiteSpace="nowrap";Z.style.textOverflow="ellipsis";mxUtils.write(Z,null!=aa.title&&0<aa.title.length?aa.title:mxResources.get("untitled"));Z.style.color=null==aa.title||0==aa.title.length?"#d0d0d0":""};t.style.backgroundImage="";x.style.display="none";var N=H,R=g;if(H>b.maxImageSize||g>b.maxImageSize){var T=Math.min(1,Math.min(b.maxImageSize/Math.max(1,H)),b.maxImageSize/Math.max(1,g));H*=T;g*=T}N>R?(R=Math.round(100*R/N),N=100):(N=Math.round(100*N/R),R=100);var V=document.createElement("div");V.setAttribute("draggable","true");V.style.display="inline-block";V.style.position="relative";V.style.padding="0 12px";V.style.cursor="move";mxUtils.setPrefixedStyle(V.style,"transition","transform .1s ease-in-out");if(null!=q){var X=document.createElement("img");X.setAttribute("src",S.convert(q));X.style.width=N+"px";X.style.height=R+"px";X.style.margin="10px";X.style.paddingBottom=Math.floor((100-R)/2)+"px";X.style.paddingLeft=Math.floor((100-N)/2)+"px";V.appendChild(X)}else if(null!=p){var W=b.stringToCells("<"==p.xml.charAt(0)?p.xml:Graph.decompress(p.xml));0<W.length&&(b.sidebar.createThumb(W,100,100,V,null,!0,!1,null,null,f.shapeBackgroundColor),V.firstChild.style.display="inline-block",V.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(ka){mxEvent.consume(ka)});(function(ka,ba,ea){mxEvent.addListener(Y,"click",function(fa){y[ba]=null;for(var da=0;da<c.length;da++)if(null!=c[da].data&&c[da].data==ba||null!=c[da].xml&&null!=ea&&c[da].xml==ea.xml){c.splice(da,1);break}V.parentNode.removeChild(ka);0==c.length&&(t.style.backgroundImage=-"url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(fa)});mxEvent.addListener(Y,"dblclick",function(fa){mxEvent.consume(fa)})})(V,q,p);V.appendChild(Y);V.style.marginBottom="30px";var Z=document.createElement("div");Z.style.position="absolute";Z.style.boxSizing="border-box";Z.style.bottom="-18px";Z.style.left="10px";Z.style.right="10px";Z.style.backgroundColor="light-dark(#ffffff, transparent)";Z.style.overflow="hidden";Z.style.textAlign="center";Z.setAttribute("title",mxResources.get("rename"));+"url('"+IMAGE_PATH+"/droptarget.png')",x.style.display="");mxEvent.consume(fa)});mxEvent.addListener(Y,"dblclick",function(fa){mxEvent.consume(fa)})})(V,q,p);V.appendChild(Y);V.style.marginBottom="30px";var Z=document.createElement("div");Z.style.position="absolute";Z.style.boxSizing="border-box";Z.style.bottom="-18px";Z.style.left="10px";Z.style.right="10px";Z.style.backgroundColor="light-dark(#ffffff, transparent)";Z.style.overflow="hidden";Z.style.textAlign="center";Z.setAttribute("title",mxResources.get("rename"));var aa=null;null!=q?(aa={data:q,w:H,h:g,title:K},null!=B&&(aa.aspect=B),y[q]=X,c.push(aa)):null!=p&&(p.aspect="fixed",c.push(p),aa=p);mxEvent.addListener(Z,"keydown",function(ka){13==ka.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(ka))});M();V.appendChild(Z);mxEvent.addListener(Z,"mousedown",function(ka){"true"!=Z.getAttribute("contentEditable")&&mxEvent.consume(ka)});W=function(ka){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ba=new FilenameDialog(b,aa.title||"",mxResources.get("ok"),function(ea){null!=ea&&(aa.title=ea,M())},mxResources.get("enterValue"));b.showDialog(ba.container,300,80,!0,!0);ba.init();mxEvent.consume(ka)}else if("true"!=Z.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==aa.title||0==aa.title.length)Z.innerText="";Z.style.textOverflow="";Z.style.whiteSpace="";Z.style.cursor="text";Z.style.color="";Z.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(Z.style,"user-select","text");Z.focus();document.execCommand("selectAll",!1,null);C=function(){Z.removeAttribute("contentEditable");Z.style.cursor="pointer";aa.title=mxUtils.getTextContent(Z);M()};mxEvent.consume(ka)}};mxEvent.addListener(Z,"click",W);mxEvent.addListener(V,"dblclick",W);t.appendChild(V);mxEvent.addListener(V,"dragstart",function(ka){null==C&&(null==q&&null!=p&&(Y.style.visibility="hidden",Z.style.visibility="hidden"),mxClient.IS_FF&&null!=p.xml&&ka.dataTransfer.setData("Text",p.xml),F=D(ka),mxClient.IS_GC&&(V.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(V.style,@@ -12599,77 +12599,77 @@ aa.title||"",mxResources.get("ok"),function(ea){null!=ea&&(aa.title=ea,M())},mxRif(null!=R&&0<R.length)for(var la=0;la<R.length;la++)null!=R[la].xml?P(null,null,0,0,0,0,R[la]):P(R[la].data,null,0,0,R[la].w,R[la].h,null,"fixed",R[la].title);H=!0}else if("mxfile"==N.documentElement.nodeName){var ha=N.documentElement.getElementsByTagName("diagram");for(la=0;la<ha.length;la++){var ca=Editor.getDiagramNodeXml(ha[la]);W=b.stringToCells(ca);if(0<W.length){var ja=b.editor.graph.getBoundingBoxFromGeometry(W);null!=ja&&P(null,null,0,0,0,0,{xml:ca,w:ja.width,h:ja.height})}}H=!0}}catch(ka){null!=window.console&&console.error("Error in library dialog: "+ka)}H||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ka){null!=window.console&&console.log("Error in library dialog: "+ka)}return null}function J(q){q.dataTransfer.dropEffect=null!=F?"move":"copy";q.stopPropagation();q.preventDefault()}function L(q){q.stopPropagation();q.preventDefault();U=!1;E=D(q);if(null!=F)null!=E&&E<t.children.length?(c.splice(E>F?E-1:E,0,c.splice(F,1)[0]),t.insertBefore(t.children[F],t.children[E])):(c.push(c.splice(F,1)[0]),t.appendChild(t.children[F]));else if(0<q.dataTransfer.files.length)b.importFiles(q.dataTransfer.files,0,0,b.maxImageSize,Q(q));else if(0<=mxUtils.indexOf(q.dataTransfer.types,"text/uri-list")){var u=decodeURIComponent(q.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(u)||/(\.png)($|\?)/i.test(u)||/(\.gif)($|\?)/i.test(u)||/(\.svg)($|\?)/i.test(u))&&b.loadImage(u,function(I){P(u,null,0,0,I.width,I.height);t.scrollTop=t.scrollHeight})}q.stopPropagation();-q.preventDefault()}var c=[],f=b.editor.graph;n=document.createElement("div");n.style.height="100%";var k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.height="40px";n.appendChild(k);mxUtils.write(k,mxResources.get("filename")+":");null==l&&(l=b.defaultLibraryName+".xml");var m=document.createElement("input");m.setAttribute("value",l);m.style.marginRight="20px";m.style.marginLeft="10px";m.style.width="500px";null==x||x.isRenamable()||m.setAttribute("disabled","true");this.init=-function(){if(null==x||x.isRenamable())m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null)};k.appendChild(m);Editor.enableUncompressedLibraries&&(m.style.width="420px",l=document.createElement("input"),l.setAttribute("type","checkbox"),l.style.marginRight="10px",k.appendChild(l),mxUtils.write(k,mxResources.get("compressed")));var t=document.createElement("div");t.style.borderWidth="1px 0px 1px 0px";t.style.borderColor="#d3d3d3";t.style.borderStyle=-"solid";t.style.marginTop="6px";t.style.overflow="auto";t.style.height="340px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==c.length&&Graph.fileSupport&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var v=document.createElement("div");v.style.position="absolute";v.style.width="640px";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));n.appendChild(v);-var y={},F=null,E=null,C=null;k=function(q){"true"!=mxEvent.getSource(q).getAttribute("contentEditable")&&null!=C&&(C(),C=null,mxEvent.consume(q))};mxEvent.addListener(t,"mousedown",k);mxEvent.addListener(t,"pointerdown",k);mxEvent.addListener(t,"touchstart",k);var S=new mxUrlConverter,U=!1;if(null!=d)for(k=0;k<d.length;k++)l=d[k],P(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(t,"dragleave",function(q){v.style.cursor="";for(var u=mxEvent.getSource(q);null!=u;){if(u==t||u==v){q.stopPropagation();+q.preventDefault()}var c=[],f=b.editor.graph;n=document.createElement("div");n.style.height="100%";var k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.height="40px";n.appendChild(k);mxUtils.write(k,mxResources.get("filename")+":");null==l&&(l=b.defaultLibraryName+".xml");var m=document.createElement("input");m.setAttribute("value",l);m.style.marginRight="20px";m.style.marginLeft="10px";m.style.width="500px";null==v||v.isRenamable()||m.setAttribute("disabled","true");this.init=+function(){if(null==v||v.isRenamable())m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null)};k.appendChild(m);Editor.enableUncompressedLibraries&&(m.style.width="420px",l=document.createElement("input"),l.setAttribute("type","checkbox"),l.style.marginRight="10px",k.appendChild(l),mxUtils.write(k,mxResources.get("compressed")));var t=document.createElement("div");t.style.borderWidth="1px 0px 1px 0px";t.style.borderColor="#d3d3d3";t.style.borderStyle=+"solid";t.style.marginTop="6px";t.style.overflow="auto";t.style.height="340px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==c.length&&Graph.fileSupport&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var x=document.createElement("div");x.style.position="absolute";x.style.width="640px";x.style.top="260px";x.style.textAlign="center";x.style.fontSize="22px";x.style.color="#a0c3ff";mxUtils.write(x,mxResources.get("dragImagesHere"));n.appendChild(x);+var y={},F=null,E=null,C=null;k=function(q){"true"!=mxEvent.getSource(q).getAttribute("contentEditable")&&null!=C&&(C(),C=null,mxEvent.consume(q))};mxEvent.addListener(t,"mousedown",k);mxEvent.addListener(t,"pointerdown",k);mxEvent.addListener(t,"touchstart",k);var S=new mxUrlConverter,U=!1;if(null!=d)for(k=0;k<d.length;k++)l=d[k],P(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(t,"dragleave",function(q){x.style.cursor="";for(var u=mxEvent.getSource(q);null!=u;){if(u==t||u==x){q.stopPropagation();q.preventDefault();break}u=u.parentNode}});var Q=function(q){return function(u,I,G,H,g,p,B,K,M){null!=M&&EditorUi.isVisioFilename(M.name)?b.importVisio(M,mxUtils.bind(this,function(N){P(N,I,G,H,g,p,B,"fixed",mxEvent.isAltDown(q)?null:B.substring(0,B.lastIndexOf(".")).replace(/_/g," "))})):null!=M&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(u,M.name)?b.isExternalDataComms()?b.parseFile(M,mxUtils.bind(this,function(N){4==N.readyState&&(b.spinner.stop(),200<=N.status&&299>=N.status&&(P(N.responseText,-I,G,H,g,p,B,"fixed",mxEvent.isAltDown(q)?null:B.substring(0,B.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(P(u,I,G,H,g,p,B,"fixed",mxEvent.isAltDown(q)?null:B.substring(0,B.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",J);mxEvent.addListener(t,"drop",L);mxEvent.addListener(v,"dragover",J);mxEvent.addListener(v,"drop",L);n.appendChild(t);-d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});k.setAttribute("id","btnCancel");k.className="geBtn";b.editor.cancelFirst&&d.appendChild(k);"draw.io"!=b.getServiceName()||null==x||x.constructor!=DriveLibrary&&x.constructor!=GitHubLibrary||(l=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(x,function(q){if(null!=q){var u=b.getSearch("create title mode url drive splash state clibs ui".split(" "));-u+=(0==u.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(q);q=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+u,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(q.container,450,240,!0);q.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,+I,G,H,g,p,B,"fixed",mxEvent.isAltDown(q)?null:B.substring(0,B.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(P(u,I,G,H,g,p,B,"fixed",mxEvent.isAltDown(q)?null:B.substring(0,B.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",J);mxEvent.addListener(t,"drop",L);mxEvent.addListener(x,"dragover",J);mxEvent.addListener(x,"drop",L);n.appendChild(t);+d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});k.setAttribute("id","btnCancel");k.className="geBtn";b.editor.cancelFirst&&d.appendChild(k);"draw.io"!=b.getServiceName()||null==v||v.constructor!=DriveLibrary&&v.constructor!=GitHubLibrary||(l=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(v,function(q){if(null!=q){var u=b.getSearch("create title mode url drive splash state clibs ui".split(" "));+u+=(0==u.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(q);q=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+u,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(q.container,450,240,!0);q.init()}else v.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(v.getId(),v)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),l.className="geBtn",d.appendChild(l));l=mxUtils.button(mxResources.get("export"),function(){var q=b.createLibraryDataFromImages(c),u=m.value;/(\.xml)$/i.test(u)||(u+=".xml");b.isLocalFileSave()?b.saveLocalFile(q,u,"text/xml",null,null,null!=z?z:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(u)+"&format=xml&xml="+encodeURIComponent(q))).simulate(document,"_blank")});l.setAttribute("id","btnDownload");l.className="geBtn";d.appendChild(l);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var O=document.createElement("input");O.setAttribute("multiple","multiple");O.setAttribute("type","file");mxEvent.addListener(O,"change",function(q){U=!1;b.importFiles(O.files,0,0,b.maxImageSize,function(u,I,G,H,g,p,B,K,M){null!=O.files&&(Q(q)(u,I,G,H,g,p,B,K,M),O.type="",O.type="file",O.value="")});t.scrollTop=t.scrollHeight});O.style.display="none";document.body.appendChild(O);b.libDlgFileInputElt=O}l=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);b.libDlgFileInputElt.click()});l.setAttribute("id","btnAddImage");l.className="geBtn";d.appendChild(l)}l=mxUtils.button(mxResources.get("addImages"),function(){null!=C&&(C(),C=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(q,u,I){U=!1;if(null!=q){if("data:image/"==q.substring(0,11)){var G=q.indexOf(",");0<G&&(q=q.substring(0,G)+";base64,"+q.substring(G+1))}P(q,null,0,0,u,I);t.scrollTop=t.scrollHeight}})});l.setAttribute("id","btnAddImageUrl");l.className=-"geBtn";d.appendChild(l);this.saveBtnClickHandler=function(q,u,I,G){b.saveLibrary(q,u,I,G)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(m.value,c,x,A)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";d.appendChild(l);b.editor.cancelFirst||d.appendChild(k);n.appendChild(d);this.container=n},EditShapeDialog=function(b,l,n){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 x=document.createElement("div");x.style.position="absolute";x.style.top="0px";mxUtils.write(x,n);d.appendChild(x);n=document.createElement("div");n.style.position="absolute";n.style.width="100%";n.style.display="flex";n.style.alignItems="stretch";n.style.top="24px";n.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";n.appendChild(A);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);n.appendChild(z);var D=new Graph(z);D.setEnabled(!1);var P=b.editor.graph.cloneCell(l);D.addCells([P]);x=D.view.getState(P);var J="";null!=x.shape&&null!=x.shape.stencil&&(J=mxUtils.getPrettyXml(x.shape.stencil.desc));mxUtils.write(A,J||-"");d.appendChild(n);n=document.createElement("div");n.style.position="absolute";n.style.display="flex";n.style.alignItems="center";n.style.justifyContent="end";n.style.bottom="6px";n.style.height="30px";n.style.width="100%";b.isOffline()||n.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&&n.appendChild(x);var L=function(f,k,m){var t=A.value,v=mxUtils.parseXml(t);-t=mxUtils.getPrettyXml(v.documentElement);v=v.documentElement.getElementsByTagName("parsererror");if(null!=v&&0<v.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(m&&b.hideDialog(),v=!f.model.contains(k),!m||v||t!=J){t=Graph.compress(t);f.getModel().beginUpdate();try{if(v){var y=b.editor.graph.getFreeInsertPoint();k.geometry.x=y.x;k.geometry.y=y.y;f.addCell(k)}f.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+t+")",[k])}catch(F){throw F;-}finally{f.getModel().endUpdate()}v&&(f.setSelectionCell(k),f.scrollCellToVisible(k))}},c=mxUtils.button(mxResources.get("preview"),function(){L(D,P,!1);D.fit()});c.className="geBtn";n.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){L(b.editor.graph,l,!0)});c.className="geBtn gePrimaryBtn";n.appendChild(c);b.editor.cancelFirst||n.appendChild(x);d.appendChild(n);this.init=function(){A.focus();A.scrollTop=0;D.fit();z.style.overflow="auto";D.fit()};this.container=d},CustomDialog=-function(b,l,n,d,x,A,z,D,P,J,L,c){var f=document.createElement("div");f.appendChild(l);var k=document.createElement("div");k.style.marginTop=null!=c?c:"30px";k.style.textAlign="right";null!=z&&k.appendChild(z);b.isOffline()||null==A||k.appendChild(b.createHelpIcon(A));l=mxUtils.button(P||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d()});l.className="geBtn";D&&(l.style.display="none");b.editor.cancelFirst&&k.appendChild(l);x=mxUtils.button(x||mxResources.get("ok"),mxUtils.bind(this,-function(){J||b.hideDialog(null,null,this.container);if(null!=n){var m=n();if("string"===typeof m){b.showError(mxResources.get("error"),m);return}}J&&b.hideDialog(null,null,this.container)}));k.appendChild(x);x.className="geBtn gePrimaryBtn";b.editor.cancelFirst||k.appendChild(l);if(null!=L)for(D=0;D<L.length;D++)(function(m,t,v){m=mxUtils.button(m,function(y){t(y)});null!=v&&m.setAttribute("title",v);m.className="geBtn";k.appendChild(m)})(L[D][0],L[D][1],L[D][2]);f.appendChild(k);this.cancelBtn=-l;this.okButton=x;this.container=f},BtnDialog=function(b,l,n,d){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 z="Unknown",D=document.createElement("img");D.setAttribute("border","0");D.setAttribute("align","absmiddle");D.style.marginRight="10px";l==b.drive?(z=mxResources.get("googleDrive"),D.src=IMAGE_PATH+"/google-drive-logo-white.svg"):+"geBtn";d.appendChild(l);this.saveBtnClickHandler=function(q,u,I,G){b.saveLibrary(q,u,I,G)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(m.value,c,v,A)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";d.appendChild(l);b.editor.cancelFirst||d.appendChild(k);n.appendChild(d);this.container=n},EditShapeDialog=function(b,l,n){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 v=document.createElement("div");v.style.position="absolute";v.style.top="0px";mxUtils.write(v,n);d.appendChild(v);n=document.createElement("div");n.style.position="absolute";n.style.width="100%";n.style.display="flex";n.style.alignItems="stretch";n.style.top="24px";n.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";n.appendChild(A);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);n.appendChild(z);var D=new Graph(z);D.setEnabled(!1);var P=b.editor.graph.cloneCell(l);D.addCells([P]);v=D.view.getState(P);var J="";null!=v.shape&&null!=v.shape.stencil&&(J=mxUtils.getPrettyXml(v.shape.stencil.desc));mxUtils.write(A,J||+"");d.appendChild(n);n=document.createElement("div");n.style.position="absolute";n.style.display="flex";n.style.alignItems="center";n.style.justifyContent="end";n.style.bottom="6px";n.style.height="30px";n.style.width="100%";b.isOffline()||n.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));v=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});v.className="geBtn";b.editor.cancelFirst&&n.appendChild(v);var L=function(f,k,m){var t=A.value,x=mxUtils.parseXml(t);+t=mxUtils.getPrettyXml(x.documentElement);x=x.documentElement.getElementsByTagName("parsererror");if(null!=x&&0<x.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(m&&b.hideDialog(),x=!f.model.contains(k),!m||x||t!=J){t=Graph.compress(t);f.getModel().beginUpdate();try{if(x){var y=b.editor.graph.getFreeInsertPoint();k.geometry.x=y.x;k.geometry.y=y.y;f.addCell(k)}f.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+t+")",[k])}catch(F){throw F;+}finally{f.getModel().endUpdate()}x&&(f.setSelectionCell(k),f.scrollCellToVisible(k))}},c=mxUtils.button(mxResources.get("preview"),function(){L(D,P,!1);D.fit()});c.className="geBtn";n.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){L(b.editor.graph,l,!0)});c.className="geBtn gePrimaryBtn";n.appendChild(c);b.editor.cancelFirst||n.appendChild(v);d.appendChild(n);this.init=function(){A.focus();A.scrollTop=0;D.fit();z.style.overflow="auto";D.fit()};this.container=d},CustomDialog=+function(b,l,n,d,v,A,z,D,P,J,L,c){var f=document.createElement("div");f.appendChild(l);var k=document.createElement("div");k.style.marginTop=null!=c?c:"30px";k.style.textAlign="right";null!=z&&k.appendChild(z);b.isOffline()||null==A||k.appendChild(b.createHelpIcon(A));l=mxUtils.button(P||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d()});l.className="geBtn";D&&(l.style.display="none");b.editor.cancelFirst&&k.appendChild(l);v=mxUtils.button(v||mxResources.get("ok"),mxUtils.bind(this,+function(){J||b.hideDialog(null,null,this.container);if(null!=n){var m=n();if("string"===typeof m){b.showError(mxResources.get("error"),m);return}}J&&b.hideDialog(null,null,this.container)}));k.appendChild(v);v.className="geBtn gePrimaryBtn";b.editor.cancelFirst||k.appendChild(l);if(null!=L)for(D=0;D<L.length;D++)(function(m,t,x){m=mxUtils.button(m,function(y){t(y)});null!=x&&m.setAttribute("title",x);m.className="geBtn";k.appendChild(m)})(L[D][0],L[D][1],L[D][2]);f.appendChild(k);this.cancelBtn=+l;this.okButton=v;this.container=f},BtnDialog=function(b,l,n,d){var v=document.createElement("div");v.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 z="Unknown",D=document.createElement("img");D.setAttribute("border","0");D.setAttribute("align","absmiddle");D.style.marginRight="10px";l==b.drive?(z=mxResources.get("googleDrive"),D.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(z=mxResources.get("dropbox"),D.src=IMAGE_PATH+"/dropbox-logo-white.svg"):l==b.oneDrive?(z=mxResources.get("oneDrive"),D.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(z=mxResources.get("github"),D.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(z=mxResources.get("gitlab"),D.src=IMAGE_PATH+"/gitlab-logo.svg"):l==b.trello&&(z=mxResources.get("trello"),D.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",-[z],"You are now authorized in {1}"));n=mxUtils.button(n,d);n.insertBefore(D,n.firstChild);n.style.marginTop="6px";n.className="geBigButton";n.style.fontSize="18px";n.style.padding="14px";x.appendChild(A);x.appendChild(b);x.appendChild(n);this.container=x},FontDialog=function(b,l,n,d,x){function A(E){this.style.border="";13==E.keyCode&&F.click()}var z=document.createElement("table"),D=document.createElement("tbody");z.style.marginTop="8px";var P=document.createElement("tr");var J=document.createElement("td");+[z],"You are now authorized in {1}"));n=mxUtils.button(n,d);n.insertBefore(D,n.firstChild);n.style.marginTop="6px";n.className="geBigButton";n.style.fontSize="18px";n.style.padding="14px";v.appendChild(A);v.appendChild(b);v.appendChild(n);this.container=v},FontDialog=function(b,l,n,d,v){function A(E){this.style.border="";13==E.keyCode&&F.click()}var z=document.createElement("table"),D=document.createElement("tbody");z.style.marginTop="8px";var P=document.createElement("tr");var J=document.createElement("td");J.colSpan=2;J.style.whiteSpace="nowrap";J.style.fontSize="10pt";J.style.fontWeight="bold";var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-bottom:8px;";L.setAttribute("value","sysfonts");L.setAttribute("type","radio");L.setAttribute("name","current-fontdialog");L.setAttribute("id","fontdialog-sysfonts");J.appendChild(L);var c=document.createElement("label");c.setAttribute("for","fontdialog-sysfonts");mxUtils.write(c,mxResources.get("sysFonts",null,"System Fonts"));J.appendChild(c);P.appendChild(J);D.appendChild(P);P=document.createElement("tr");J=document.createElement("td");J.style.whiteSpace="nowrap";J.style.fontSize="10pt";J.style.width="120px";J.style.paddingLeft="15px";mxUtils.write(J,mxResources.get("fontname",null,"Font Name")+":");P.appendChild(J);var f=document.createElement("input");"s"==d&&f.setAttribute("value",l);f.style.marginLeft="4px";f.style.width="250px";f.className="dlg_fontName_s";J=document.createElement("td");J.appendChild(f);P.appendChild(J);D.appendChild(P);P=document.createElement("tr");J=document.createElement("td");J.colSpan=2;J.style.whiteSpace="nowrap";J.style.fontSize="10pt";J.style.fontWeight="bold";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","googlefonts");k.setAttribute("type","radio");k.setAttribute("name","current-fontdialog");k.setAttribute("id","fontdialog-googlefonts");J.appendChild(k);c=document.createElement("label");c.setAttribute("for","fontdialog-googlefonts");mxUtils.write(c,mxResources.get("googleFonts",null,"Google Fonts"));J.appendChild(c);if(!b.isOffline()||EditorUi.isElectronApp)c=b.createHelpIcon("https://fonts.google.com/"),J.appendChild(c);P.appendChild(J);"0"!=urlParams.isGoogleFontsEnabled&&D.appendChild(P);P=document.createElement("tr");J=document.createElement("td");J.style.whiteSpace="nowrap";J.style.fontSize="10pt";J.style.width="120px";J.style.paddingLeft="15px";mxUtils.write(J,mxResources.get("fontname",null,"Font Name")+":");P.appendChild(J);var m=document.createElement("input");"g"==d&&m.setAttribute("value",l);m.style.marginLeft="4px";m.style.width="250px";m.className="dlg_fontName_g";J=document.createElement("td");J.appendChild(m);P.appendChild(J);"0"!=urlParams.isGoogleFontsEnabled&&D.appendChild(P);P=document.createElement("tr");J=document.createElement("td");J.colSpan=2;J.style.whiteSpace="nowrap";J.style.fontSize="10pt";J.style.fontWeight="bold";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","webfonts");t.setAttribute("type","radio");t.setAttribute("name","current-fontdialog");t.setAttribute("id","fontdialog-webfonts");J.appendChild(t);c=document.createElement("label");c.setAttribute("for","fontdialog-webfonts");mxUtils.write(c,mxResources.get("webfonts",null,"Web Fonts"));J.appendChild(c);P.appendChild(J);Editor.enableWebFonts&&D.appendChild(P);P=document.createElement("tr");J=document.createElement("td");J.style.whiteSpace="nowrap";J.style.fontSize="10pt";J.style.width=-"120px";J.style.paddingLeft="15px";mxUtils.write(J,mxResources.get("fontname",null,"Font Name")+":");P.appendChild(J);var v=document.createElement("input");"w"==d&&(Editor.enableWebFonts?v.setAttribute("value",l):f.setAttribute("value",l));v.style.marginLeft="4px";v.style.width="250px";v.className="dlg_fontName_w";J=document.createElement("td");J.appendChild(v);P.appendChild(J);Editor.enableWebFonts&&D.appendChild(P);P=document.createElement("tr");J=document.createElement("td");J.style.whiteSpace=-"nowrap";J.style.fontSize="10pt";J.style.width="120px";J.style.paddingLeft="15px";mxUtils.write(J,mxResources.get("fontUrl",null,"Font URL")+":");P.appendChild(J);var y=document.createElement("input");y.setAttribute("value",n||"");y.style.marginLeft="4px";y.style.width="250px";y.className="dlg_fontUrl";J=document.createElement("td");J.appendChild(y);P.appendChild(J);Editor.enableWebFonts&&D.appendChild(P);this.init=function(){var E=f;"g"==d?E=m:"w"==d&&Editor.enableWebFonts&&(E=v);E.focus();mxClient.IS_GC||-mxClient.IS_FF||5<=document.documentMode?E.select():document.execCommand("selectAll",!1,null)};P=document.createElement("tr");J=document.createElement("td");J.colSpan=2;J.style.paddingTop="20px";J.style.whiteSpace="nowrap";J.setAttribute("align","right");b.isOffline()||J.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();x()});l.className="geBtn";b.editor.cancelFirst&&J.appendChild(l);var F=mxUtils.button(mxResources.get("apply"),-function(){if(L.checked){var E=f.value;var C="s"}else if(k.checked){E=m.value;var S=Editor.GOOGLE_FONTS+encodeURIComponent(E).replace(/%20/g,"+");C="g"}else t.checked&&(E=v.value,S=y.value,C="w");var U=E;var Q=S,O=C,q=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,u=z.querySelector(".dlg_fontName_"+O);null==u||null!=U&&0!=U.length?(u=z.querySelector(".dlg_fontUrl"),null==u||"w"!=O||q.test(Q)?U=!0:(u.style.border="1px solid red",U=!1)):(u.style.border="1px solid red",-U=!1);U&&(x(E,S,C),b.hideDialog())});F.className="geBtn gePrimaryBtn";mxEvent.addListener(f,"keypress",A);mxEvent.addListener(m,"keypress",A);mxEvent.addListener(v,"keypress",A);mxEvent.addListener(y,"keypress",A);mxEvent.addListener(f,"focus",function(){L.setAttribute("checked","checked");L.checked=!0});mxEvent.addListener(m,"focus",function(){k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(v,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});mxEvent.addListener(y,+"120px";J.style.paddingLeft="15px";mxUtils.write(J,mxResources.get("fontname",null,"Font Name")+":");P.appendChild(J);var x=document.createElement("input");"w"==d&&(Editor.enableWebFonts?x.setAttribute("value",l):f.setAttribute("value",l));x.style.marginLeft="4px";x.style.width="250px";x.className="dlg_fontName_w";J=document.createElement("td");J.appendChild(x);P.appendChild(J);Editor.enableWebFonts&&D.appendChild(P);P=document.createElement("tr");J=document.createElement("td");J.style.whiteSpace=+"nowrap";J.style.fontSize="10pt";J.style.width="120px";J.style.paddingLeft="15px";mxUtils.write(J,mxResources.get("fontUrl",null,"Font URL")+":");P.appendChild(J);var y=document.createElement("input");y.setAttribute("value",n||"");y.style.marginLeft="4px";y.style.width="250px";y.className="dlg_fontUrl";J=document.createElement("td");J.appendChild(y);P.appendChild(J);Editor.enableWebFonts&&D.appendChild(P);this.init=function(){var E=f;"g"==d?E=m:"w"==d&&Editor.enableWebFonts&&(E=x);E.focus();mxClient.IS_GC||+mxClient.IS_FF||5<=document.documentMode?E.select():document.execCommand("selectAll",!1,null)};P=document.createElement("tr");J=document.createElement("td");J.colSpan=2;J.style.paddingTop="20px";J.style.whiteSpace="nowrap";J.setAttribute("align","right");b.isOffline()||J.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();v()});l.className="geBtn";b.editor.cancelFirst&&J.appendChild(l);var F=mxUtils.button(mxResources.get("apply"),+function(){if(L.checked){var E=f.value;var C="s"}else if(k.checked){E=m.value;var S=Editor.GOOGLE_FONTS+encodeURIComponent(E).replace(/%20/g,"+");C="g"}else t.checked&&(E=x.value,S=y.value,C="w");var U=E;var Q=S,O=C,q=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,u=z.querySelector(".dlg_fontName_"+O);null==u||null!=U&&0!=U.length?(u=z.querySelector(".dlg_fontUrl"),null==u||"w"!=O||q.test(Q)?U=!0:(u.style.border="1px solid red",U=!1)):(u.style.border="1px solid red",+U=!1);U&&(v(E,S,C),b.hideDialog())});F.className="geBtn gePrimaryBtn";mxEvent.addListener(f,"keypress",A);mxEvent.addListener(m,"keypress",A);mxEvent.addListener(x,"keypress",A);mxEvent.addListener(y,"keypress",A);mxEvent.addListener(f,"focus",function(){L.setAttribute("checked","checked");L.checked=!0});mxEvent.addListener(m,"focus",function(){k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(x,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});mxEvent.addListener(y,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});J.appendChild(F);b.editor.cancelFirst||J.appendChild(l);P.appendChild(J);D.appendChild(P);z.appendChild(D);this.container=z};-function AspectDialog(b,l,n,d,x){this.aspect={pageId:l||(b.pages?b.pages[0].getId():null),layerIds:n||[]};l=document.createElement("div");var A=document.createElement("h5");A.style.margin="0 0 10px";mxUtils.write(A,mxResources.get("pages"));l.appendChild(A);n=document.createElement("div");n.className="geAspectDlgList";l.appendChild(n);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=n;this.layersContainer=A;this.ui=b;n=document.createElement("div");n.style.marginTop="16px";n.style.textAlign="center";A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=x&&x()});A.className="geBtn";b.editor.cancelFirst&&n.appendChild(A);var z=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();d({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));n.appendChild(z);z.className="geBtn gePrimaryBtn";+function AspectDialog(b,l,n,d,v){this.aspect={pageId:l||(b.pages?b.pages[0].getId():null),layerIds:n||[]};l=document.createElement("div");var A=document.createElement("h5");A.style.margin="0 0 10px";mxUtils.write(A,mxResources.get("pages"));l.appendChild(A);n=document.createElement("div");n.className="geAspectDlgList";l.appendChild(n);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=n;this.layersContainer=A;this.ui=b;n=document.createElement("div");n.style.marginTop="16px";n.style.textAlign="center";A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=v&&v()});A.className="geBtn";b.editor.cancelFirst&&n.appendChild(A);var z=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();d({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));n.appendChild(z);z.className="geBtn gePrimaryBtn";b.editor.cancelFirst||n.appendChild(A);z.setAttribute("disabled","disabled");this.okBtn=z;l.appendChild(n);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","Page-1",mxUtils.parseXml(b).documentElement)};-AspectDialog.prototype.createViewer=function(b,l,n,d){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!=d?d:"#ffffff";b.style.backgroundColor=A;d=new mxCodec(l.ownerDocument);b=x.getModel();d.decode(l,b);l=b.getChildCount(b.root);-d=null==n;for(A=0;A<l;A++){var z=b.getChildAt(b.root,A);b.setVisible(z,d||n==z.id)}x.maxFitScale=1;x.fit(0);x.center()}return x};-AspectDialog.prototype.createPageItem=function(b,l,n){var d=document.createElement("div");d.className="geAspectDlgListItem";d.setAttribute("data-page-id",b);d.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(l)+"</div>";this.pagesContainer.appendChild(d);var x=this.createViewer(d.childNodes[0],n);l=mxUtils.bind(this,function(){null!=this.selectedItem&&(this.selectedItem.className="geAspectDlgListItem");this.selectedItem=d;-this.selectedPage=b;d.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var A=x.model;A=A.getChildCells(A.getRoot());for(var z=0;z<A.length;z++)this.createLayerItem(A[z],b,x,n)});mxEvent.addListener(d,"click",l);this.aspect.pageId==b&&l()};-AspectDialog.prototype.createLayerItem=function(b,l,n,d){l=n.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],d,b.id);d=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",d);-1!=this.aspect.layerIds.indexOf(b.id)&&d()};-var FilePropertiesDialog=function(b,l){function n(C){var S=J;J=function(U,Q){try{C(function(){S(U,Q)},Q)}catch(O){Q(O)}}}var d=document.createElement("table"),x=document.createElement("tbody");d.style.width="100%";d.style.marginTop="8px";d.style.tableLayout="fixed";var A=b.getCurrentFile(),z=null!=A&&null!=A.getTitle()?A.getTitle():b.defaultFilename,D=/(\.png)$/i.test(z),P=/(\.svg)$/i.test(z),J=function(C,S){C()},L=null!=A?A.isLocked():!1;var c=document.createElement("tr");var f=document.createElement("td");-f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.textOverflow="ellipsis";f.style.fontSize="10pt";mxUtils.write(f,mxResources.get("locked")+":");c.appendChild(f);var k=document.createElement("input");k.setAttribute("type","checkbox");L&&(k.setAttribute("checked","checked"),k.defaultChecked=!0);f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(k);c.appendChild(f);x.appendChild(c);this.init=function(){k.focus()};n(function(C,S){null!=b.fileNode&&L!=k.checked?window.setTimeout(function(){null!=+AspectDialog.prototype.createViewer=function(b,l,n,d){mxEvent.disableContextMenu(b);b.style.userSelect="none";var v=new Graph(b);v.setTooltips(!1);v.setEnabled(!1);v.setPanning(!1);v.minFitScale=null;v.maxFitScale=null;v.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!=d?d:"#ffffff";b.style.backgroundColor=A;d=new mxCodec(l.ownerDocument);b=v.getModel();d.decode(l,b);l=b.getChildCount(b.root);+d=null==n;for(A=0;A<l;A++){var z=b.getChildAt(b.root,A);b.setVisible(z,d||n==z.id)}v.maxFitScale=1;v.fit(0);v.center()}return v};+AspectDialog.prototype.createPageItem=function(b,l,n){var d=document.createElement("div");d.className="geAspectDlgListItem";d.setAttribute("data-page-id",b);d.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(l)+"</div>";this.pagesContainer.appendChild(d);var v=this.createViewer(d.childNodes[0],n);l=mxUtils.bind(this,function(){null!=this.selectedItem&&(this.selectedItem.className="geAspectDlgListItem");this.selectedItem=d;+this.selectedPage=b;d.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var A=v.model;A=A.getChildCells(A.getRoot());for(var z=0;z<A.length;z++)this.createLayerItem(A[z],b,v,n)});mxEvent.addListener(d,"click",l);this.aspect.pageId==b&&l()};+AspectDialog.prototype.createLayerItem=function(b,l,n,d){l=n.convertValueToString(b)||mxResources.get("background")||"Background";var v=document.createElement("div");v.setAttribute("data-layer-id",b.id);v.className="geAspectDlgListItem";v.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(l)+"</div>";this.layersContainer.appendChild(v);this.createViewer(v.childNodes[0],d,b.id);d=mxUtils.bind(this,function(){0<=v.className.indexOf("geAspectDlgListItemSelected")?+(v.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(v.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(v,"click",d);-1!=this.aspect.layerIds.indexOf(b.id)&&d()};+var FilePropertiesDialog=function(b,l){function n(C){var S=J;J=function(U,Q){try{C(function(){S(U,Q)},Q)}catch(O){Q(O)}}}var d=document.createElement("table"),v=document.createElement("tbody");d.style.width="100%";d.style.marginTop="8px";d.style.tableLayout="fixed";var A=b.getCurrentFile(),z=null!=A&&null!=A.getTitle()?A.getTitle():b.defaultFilename,D=/(\.png)$/i.test(z),P=/(\.svg)$/i.test(z),J=function(C,S){C()},L=null!=A?A.isLocked():!1;var c=document.createElement("tr");var f=document.createElement("td");+f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.textOverflow="ellipsis";f.style.fontSize="10pt";mxUtils.write(f,mxResources.get("locked")+":");c.appendChild(f);var k=document.createElement("input");k.setAttribute("type","checkbox");L&&(k.setAttribute("checked","checked"),k.defaultChecked=!0);f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(k);c.appendChild(f);v.appendChild(c);this.init=function(){k.focus()};n(function(C,S){null!=b.fileNode&&L!=k.checked?window.setTimeout(function(){null!=A&&A.setLocked(k.checked);C()},0):C()});if(D||P){z=1;D=0;c=b.fileNode;null!=c&&(c.hasAttribute("scale")&&(z=parseFloat(c.getAttribute("scale"))),c.hasAttribute("border")&&(D=parseInt(c.getAttribute("border"))));c=document.createElement("tr");f=document.createElement("td");f.style.whiteSpace="nowrap";f.style.fontSize="10pt";mxUtils.write(f,mxResources.get("zoom")+":");c.appendChild(f);var m=document.createElement("input");m.setAttribute("value",100*z+"%");m.style.marginLeft="4px";m.style.width="100%";-f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(m);c.appendChild(f);x.appendChild(c);c=document.createElement("tr");f=document.createElement("td");f.style.whiteSpace="nowrap";f.style.fontSize="10pt";mxUtils.write(f,mxResources.get("borderWidth")+":");c.appendChild(f);var t=document.createElement("input");t.setAttribute("value",D);t.style.marginLeft="4px";t.style.width="100%";f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(t);c.appendChild(f);x.appendChild(c);-this.init=this.init||function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null)};n(function(C,S){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(m.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(t.value))),null!=A&&A.fileChanged());C()})}else if(!/(\.html)$/i.test(z)&&!/(\.svg)$/i.test(z)){var v=null!=A?A.isCompressed():Editor.defaultCompressed;c=document.createElement("tr");f=document.createElement("td");-f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.textOverflow="ellipsis";f.style.fontSize="10pt";mxUtils.write(f,mxResources.get("compressed")+":");c.appendChild(f);var y=document.createElement("input");y.setAttribute("type","checkbox");v&&(y.setAttribute("checked","checked"),y.defaultChecked=!0);f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(y);c.appendChild(f);x.appendChild(c);this.init=this.init||function(){y.focus()};n(function(C,S){null!=b.fileNode&&v!=+f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(m);c.appendChild(f);v.appendChild(c);c=document.createElement("tr");f=document.createElement("td");f.style.whiteSpace="nowrap";f.style.fontSize="10pt";mxUtils.write(f,mxResources.get("borderWidth")+":");c.appendChild(f);var t=document.createElement("input");t.setAttribute("value",D);t.style.marginLeft="4px";t.style.width="100%";f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(t);c.appendChild(f);v.appendChild(c);+this.init=this.init||function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null)};n(function(C,S){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(m.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(t.value))),null!=A&&A.fileChanged());C()})}else if(!/(\.html)$/i.test(z)&&!/(\.svg)$/i.test(z)){var x=null!=A?A.isCompressed():Editor.defaultCompressed;c=document.createElement("tr");f=document.createElement("td");+f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.textOverflow="ellipsis";f.style.fontSize="10pt";mxUtils.write(f,mxResources.get("compressed")+":");c.appendChild(f);var y=document.createElement("input");y.setAttribute("type","checkbox");x&&(y.setAttribute("checked","checked"),y.defaultChecked=!0);f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(y);c.appendChild(f);v.appendChild(c);this.init=this.init||function(){y.focus()};n(function(C,S){null!=b.fileNode&&x!=y.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",y.checked?"true":"false");null!=A&&(A.compressionChanged(y.checked),A.fileChanged());C()},0):C()})}if(null!=A&&A.isRealtimeOptional()){c=document.createElement("tr");f=document.createElement("td");f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.textOverflow="ellipsis";f.style.fontSize="10pt";mxUtils.write(f,mxResources.get("realtimeCollaboration")+":");c.appendChild(f);var F=document.createElement("input");F.setAttribute("type",-"checkbox");var E=A.isRealtimeEnabled();if(E="disabled"!=b.drive.getCustomProperty(A.desc,"collaboration"))F.setAttribute("checked","checked"),F.defaultChecked=!0;n(function(C,S){F.checked!=E?A.setRealtimeEnabled(F.checked,C,S):C()});this.init=null!=this.init?this.init:function(){F.focus()};f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(F);f.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));c.appendChild(f);x.appendChild(c)}null!=A&&+"checkbox");var E=A.isRealtimeEnabled();if(E="disabled"!=b.drive.getCustomProperty(A.desc,"collaboration"))F.setAttribute("checked","checked"),F.defaultChecked=!0;n(function(C,S){F.checked!=E?A.setRealtimeEnabled(F.checked,C,S):C()});this.init=null!=this.init?this.init:function(){F.focus()};f=document.createElement("td");f.style.whiteSpace="nowrap";f.appendChild(F);f.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));c.appendChild(f);v.appendChild(c)}null!=A&&"draw.io"==b.getServiceName()&&0<A.getSize()&&"1"!=urlParams.embed&&(c=document.createElement("tr"),f=document.createElement("td"),f.style.whiteSpace="nowrap",f.style.overflow="hidden",f.style.textOverflow="ellipsis",f.style.fontSize="10pt",mxUtils.write(f,mxResources.get("size")+":"),c.appendChild(f),f=b.formatFileSize(A.getSize()),z=document.createElement("input"),z.setAttribute("title",f),z.setAttribute("value",f),z.setAttribute("disabled","disabled"),z.style.marginLeft="4px",z.style.width="100%",-f=document.createElement("td"),f.style.whiteSpace="nowrap",f.appendChild(z),c.appendChild(f),x.appendChild(c));null!=l&&(c=document.createElement("tr"),f=document.createElement("td"),f.style.whiteSpace="nowrap",f.style.overflow="hidden",f.style.textOverflow="ellipsis",f.style.fontSize="10pt",mxUtils.write(f,mxResources.get("publicDiagramUrl")+":"),c.appendChild(f),z=document.createElement("a"),z.setAttribute("href",l),z.setAttribute("title",l),z.style.whiteSpace="nowrap",z.style.overflow="hidden",-z.style.textOverflow="ellipsis",z.style.display="block",z.style.margin="2px 0px 2px 8px",z.style.fontSize="10pt",mxUtils.write(z,l),mxEvent.addListener(z,"click",function(C){b.openLink(l);mxEvent.consume(C)}),f=document.createElement("td"),f.appendChild(z),c.appendChild(f),x.appendChild(c));null!=A&&null!=A.fileObject&&null!=A.fileObject.path&&(c=document.createElement("tr"),f=document.createElement("td"),f.style.whiteSpace="nowrap",f.style.overflow="hidden",f.style.textOverflow="ellipsis",f.style.fontSize=-"10pt",mxUtils.write(f,mxResources.get("pathFilename")+":"),c.appendChild(f),z=document.createElement("input"),z.setAttribute("title",A.fileObject.path),z.setAttribute("value",A.fileObject.path),z.setAttribute("disabled","disabled"),z.style.marginLeft="4px",z.style.width="100%",f=document.createElement("td"),f.appendChild(z),c.appendChild(f),x.appendChild(c));this.init=null!=this.init?this.init:function(){};z=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&+f=document.createElement("td"),f.style.whiteSpace="nowrap",f.appendChild(z),c.appendChild(f),v.appendChild(c));null!=l&&(c=document.createElement("tr"),f=document.createElement("td"),f.style.whiteSpace="nowrap",f.style.overflow="hidden",f.style.textOverflow="ellipsis",f.style.fontSize="10pt",mxUtils.write(f,mxResources.get("publicDiagramUrl")+":"),c.appendChild(f),z=document.createElement("a"),z.setAttribute("href",l),z.setAttribute("title",l),z.style.whiteSpace="nowrap",z.style.overflow="hidden",+z.style.textOverflow="ellipsis",z.style.display="block",z.style.margin="2px 0px 2px 8px",z.style.fontSize="10pt",mxUtils.write(z,l),mxEvent.addListener(z,"click",function(C){b.openLink(l);mxEvent.consume(C)}),f=document.createElement("td"),f.appendChild(z),c.appendChild(f),v.appendChild(c));null!=A&&null!=A.fileObject&&null!=A.fileObject.path&&(c=document.createElement("tr"),f=document.createElement("td"),f.style.whiteSpace="nowrap",f.style.overflow="hidden",f.style.textOverflow="ellipsis",f.style.fontSize=+"10pt",mxUtils.write(f,mxResources.get("pathFilename")+":"),c.appendChild(f),z=document.createElement("input"),z.setAttribute("title",A.fileObject.path),z.setAttribute("value",A.fileObject.path),z.setAttribute("disabled","disabled"),z.style.marginLeft="4px",z.style.width="100%",f=document.createElement("td"),f.appendChild(z),c.appendChild(f),v.appendChild(c));this.init=null!=this.init?this.init:function(){};z=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&J(function(){b.spinner.stop();b.hideDialog()},function(C){b.spinner.stop();b.handleError(C,mxResources.get("error"))})});z.className="geBtn gePrimaryBtn";c=document.createElement("tr");f=document.createElement("td");f.colSpan=2;f.style.paddingTop="20px";f.style.whiteSpace="nowrap";f.setAttribute("align","right");D=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});D.className="geBtn";b.editor.cancelFirst&&f.appendChild(D);f.appendChild(z);b.editor.cancelFirst||f.appendChild(D);c.appendChild(f);-x.appendChild(c);d.appendChild(x);this.container=d},ConnectionPointsDialog=function(b,l){function n(){null!=x&&x.destroy()}var d=document.createElement("div");d.style.userSelect="none";var x=null;this.init=function(){function A(G,H,g){var p="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";G=new mxCell("",new mxGeometry(G,H,6,6),p);G.vertex=!0;G.cp=!0;G.constObj=g;return c.addCell(G)}function z(G){G=c.getSelectionCells();+v.appendChild(c);d.appendChild(v);this.container=d},ConnectionPointsDialog=function(b,l){function n(){null!=v&&v.destroy()}var d=document.createElement("div");d.style.userSelect="none";var v=null;this.init=function(){function A(G,H,g){var p="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";G=new mxCell("",new mxGeometry(G,H,6,6),p);G.vertex=!0;G.cp=!0;G.constObj=g;return c.addCell(G)}function z(G){G=c.getSelectionCells();c.deleteCells(G)}function D(){var G=parseInt(O.value)||0;G=0>G?0:100<G?100:G;O.value=G;var H=parseInt(u.value)||0;H=0>H?0:100<H?100:H;u.value=H;var g=parseInt(q.value)||0,p=parseInt(I.value)||0;g=new mxConnectionConstraint(new mxPoint(G/100,H/100),!1,null,g,p);G=c.getConnectionPoint(m,g);H=c.getSelectionCell();if(null!=H){H.constObj=g;g=H.geometry.clone();p=c.view.scale;var B=c.view.translate;g.x=(G.x-3*p)/p-B.x;g.y=(G.y-3*p)/p-B.y;c.model.setGeometry(H,g)}}function P(G){if(G.constObj)return{x:G.constObj.point.x,y:G.constObj.point.y,dx:G.constObj.dx,dy:G.constObj.dy};var H=0,g=0,p=f.geometry,B=mxUtils.format((G.geometry.x+3-p.x)/p.width);G=mxUtils.format((G.geometry.y+3-p.y)/p.height);0>B?(H=B*p.width,B=0):1<B&&(H=(B-1)*p.width,B=1);0>G?(g=G*p.height,G=0):1<G&&(g=(G-1)*p.height,G=1);return{x:B,y:G,dx:parseInt(H),dy:parseInt(g)}}function J(G){if(1==c.getSelectionCount()){var H=c.getSelectionCell();G&&(H.constObj=null);G=P(H);O.value=100*G.x;u.value=100*G.y;q.value=G.dx;I.value=G.dy;Q.style.visibility=""}else Q.style.visibility="hidden"}var L=document.createElement("div");L.style.width="350px";L.style.height="350px";L.style.overflow="hidden";L.style.borderStyle="solid";L.style.borderWidth="1px";L.style.boxSizing="border-box";mxEvent.disableContextMenu(L);d.appendChild(L);var c=new Graph(L);c.transparentBackground=!1;c.autoExtend=!1;c.autoScroll=!1;c.setGridEnabled(!1);c.setEnabled(!0);c.setPanning(!0);c.setConnectable(!1);c.setTooltips(!1);c.minFitScale=null;c.maxFitScale=null;c.centerZoom=!0;c.maxFitScale=2;L=l.geometry;-var f=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;");f.vertex=!0;c.addCell(f);c.dblClick=function(G,H){if(null!=H&&H!=f)c.setSelectionCell(H);else{H=mxUtils.convertPoint(c.container,mxEvent.getClientX(G),mxEvent.getClientY(G));mxEvent.consume(G);G=c.view.scale;var g=c.view.translate;c.setSelectionCell(A((H.x-3*G)/G-g.x,(H.y-3*G)/G-g.y))}};x=new mxKeyHandler(c);x.bindKey(46,z);x.bindKey(8,z);c.getRubberband().isForceRubberbandEvent=-function(G){return 0==G.evt.button&&(null==G.getCell()||G.getCell()==f)};c.panningHandler.isForcePanningEvent=function(G){return 2==G.evt.button};var k=c.isCellSelectable;c.isCellSelectable=function(G){return G==f?!1:k.apply(this,arguments)};c.getLinkForCell=function(){return null};var m=c.view.getState(f);L=c.getAllConnectionConstraints(m);for(var t=0;null!=L&&t<L.length;t++){var v=c.getConnectionPoint(m,L[t]);A(v.x-3,v.y-3,L[t])}c.fit(8);c.center();t=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),-function(){c.zoomIn()});v=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){c.zoomOut()});var y=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==c.view.scale?(c.maxFitScale=8,c.fit(8)):c.zoomActual();c.center()}),F=function(){b.prompt(mxResources.get("gridSize"),c.gridSize,function(G){!isNaN(G)&&0<G&&(c.setGridSize(G),c.setGridEnabled(!0),c.refresh())})},E=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(G){mxEvent.isShiftDown(G)?-F():(c.setGridEnabled(!c.isGridEnabled()),c.refresh())});mxEvent.addListener(E,"dblclick",F);var C=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),z);mxUtils.setOpacity(C,10);L=document.createElement("div");L.style.display="flex";L.style.alignItems="center";L.style.paddingTop="6px";L.appendChild(t);L.appendChild(v);L.appendChild(y);L.appendChild(E);L.appendChild(C);d.appendChild(L);var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","1");S.setAttribute("value",-"1");S.style.width="45px";S.style.position="relative";S.style.margin="0 4px 0 4px";var U=document.createElement("select");U.style.position="relative";v=["left","right","top","bottom"];for(t=0;t<v.length;t++)y=v[t],E=document.createElement("option"),mxUtils.write(E,mxResources.get(y)),E.value=y,U.appendChild(E);t=mxUtils.button(mxResources.get("add"),function(){var G=parseInt(S.value);G=1>G?1:100<G?100:G;S.value=G;for(var H=U.value,g=f.geometry,p=[],B=0;B<G;B++){switch(H){case "left":var K=g.x;var M=+var f=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;");f.vertex=!0;c.addCell(f);c.dblClick=function(G,H){if(null!=H&&H!=f)c.setSelectionCell(H);else{H=mxUtils.convertPoint(c.container,mxEvent.getClientX(G),mxEvent.getClientY(G));mxEvent.consume(G);G=c.view.scale;var g=c.view.translate;c.setSelectionCell(A((H.x-3*G)/G-g.x,(H.y-3*G)/G-g.y))}};v=new mxKeyHandler(c);v.bindKey(46,z);v.bindKey(8,z);c.getRubberband().isForceRubberbandEvent=+function(G){return 0==G.evt.button&&(null==G.getCell()||G.getCell()==f)};c.panningHandler.isForcePanningEvent=function(G){return 2==G.evt.button};var k=c.isCellSelectable;c.isCellSelectable=function(G){return G==f?!1:k.apply(this,arguments)};c.getLinkForCell=function(){return null};var m=c.view.getState(f);L=c.getAllConnectionConstraints(m);for(var t=0;null!=L&&t<L.length;t++){var x=c.getConnectionPoint(m,L[t]);A(x.x-3,x.y-3,L[t])}c.fit(8);c.center();t=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),+function(){c.zoomIn()});x=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){c.zoomOut()});var y=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==c.view.scale?(c.maxFitScale=8,c.fit(8)):c.zoomActual();c.center()}),F=function(){b.prompt(mxResources.get("gridSize"),c.gridSize,function(G){!isNaN(G)&&0<G&&(c.setGridSize(G),c.setGridEnabled(!0),c.refresh())})},E=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(G){mxEvent.isShiftDown(G)?+F():(c.setGridEnabled(!c.isGridEnabled()),c.refresh())});mxEvent.addListener(E,"dblclick",F);var C=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),z);mxUtils.setOpacity(C,10);L=document.createElement("div");L.style.display="flex";L.style.alignItems="center";L.style.paddingTop="6px";L.appendChild(t);L.appendChild(x);L.appendChild(y);L.appendChild(E);L.appendChild(C);d.appendChild(L);var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","1");S.setAttribute("value",+"1");S.style.width="45px";S.style.position="relative";S.style.margin="0 4px 0 4px";var U=document.createElement("select");U.style.position="relative";x=["left","right","top","bottom"];for(t=0;t<x.length;t++)y=x[t],E=document.createElement("option"),mxUtils.write(E,mxResources.get(y)),E.value=y,U.appendChild(E);t=mxUtils.button(mxResources.get("add"),function(){var G=parseInt(S.value);G=1>G?1:100<G?100:G;S.value=G;for(var H=U.value,g=f.geometry,p=[],B=0;B<G;B++){switch(H){case "left":var K=g.x;var M=g.y+(B+1)*g.height/(G+1);break;case "right":K=g.x+g.width;M=g.y+(B+1)*g.height/(G+1);break;case "top":K=g.x+(B+1)*g.width/(G+1);M=g.y;break;case "bottom":K=g.x+(B+1)*g.width/(G+1),M=g.y+g.height}p.push(A(K-3,M-3))}c.setSelectionCells(p)});t.style.marginLeft="auto";L.appendChild(t);L.appendChild(S);L.appendChild(U);var Q=document.createElement("div");Q.style.margin="4px 0px 8px 0px";Q.style.whiteSpace="nowrap";Q.style.height="24px";L=document.createElement("span");mxUtils.write(L,mxResources.get("dx"));Q.appendChild(L);var O=document.createElement("input");O.setAttribute("type","number");O.setAttribute("min","0");O.setAttribute("max","100");O.style.width="45px";O.style.margin="0 4px 0 4px";Q.appendChild(O);mxUtils.write(Q,"%");var q=document.createElement("input");q.setAttribute("type","number");q.style.width="45px";q.style.margin="0 4px 0 4px";Q.appendChild(q);mxUtils.write(Q,"pt");L=document.createElement("span");mxUtils.write(L,mxResources.get("dy"));L.style.marginLeft="12px";Q.appendChild(L);var u=document.createElement("input");u.setAttribute("type","number");u.setAttribute("min","0");u.setAttribute("max","100");u.style.width="45px";u.style.margin="0 4px 0 4px";Q.appendChild(u);mxUtils.write(Q,"%");var I=document.createElement("input");I.setAttribute("type","number");I.style.width="45px";I.style.margin="0 4px 0 4px";Q.appendChild(I);mxUtils.write(Q,"pt");d.appendChild(Q);J();c.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<c.getSelectionCount()?mxUtils.setOpacity(C,60):mxUtils.setOpacity(C,10);J()});c.addListener(mxEvent.CELLS_MOVED,J);mxEvent.addListener(O,"change",D);mxEvent.addListener(u,"change",D);mxEvent.addListener(q,"change",D);mxEvent.addListener(I,"change",D);L=mxUtils.button(mxResources.get("cancel"),function(){n();b.hideDialog()});L.className="geBtn";t=mxUtils.button(mxResources.get("apply"),function(){var G=c.model.cells,H=[],g=[],p;for(p in G){var B=G[p];B.cp&&g.push(P(B))}g.sort(function(K,M){return K.x!=M.x?K.x-M.x:K.y!=M.y?K.y-M.y:K.dx!=M.dx?K.dx--M.dx:K.dy-M.dy});for(G=0;G<g.length;G++)0<G&&g[G].x==g[G-1].x&&g[G].y==g[G-1].y&&g[G].dx==g[G-1].dx&&g[G].dy==g[G-1].dy||H.push("["+g[G].x+","+g[G].y+",0,"+g[G].dx+","+g[G].dy+"]");b.editor.graph.setCellStyles("points","["+H.join(",")+"]",[l]);n();b.hideDialog()});t.className="geBtn gePrimaryBtn";v=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[l]);n();b.hideDialog()});v.className="geBtn";y=document.createElement("div");y.style.marginTop="10px";y.style.textAlign=-"right";b.isOffline()||y.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&y.appendChild(L);y.appendChild(v);y.appendChild(t);b.editor.cancelFirst||y.appendChild(L);d.appendChild(y)};this.destroy=n;this.container=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=+M.dx:K.dy-M.dy});for(G=0;G<g.length;G++)0<G&&g[G].x==g[G-1].x&&g[G].y==g[G-1].y&&g[G].dx==g[G-1].dx&&g[G].dy==g[G-1].dy||H.push("["+g[G].x+","+g[G].y+",0,"+g[G].dx+","+g[G].dy+"]");b.editor.graph.setCellStyles("points","["+H.join(",")+"]",[l]);n();b.hideDialog()});t.className="geBtn gePrimaryBtn";x=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[l]);n();b.hideDialog()});x.className="geBtn";y=document.createElement("div");y.style.marginTop="10px";y.style.textAlign=+"right";b.isOffline()||y.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&y.appendChild(L);y.appendChild(x);y.appendChild(t);b.editor.cancelFirst||y.appendChild(L);d.appendChild(y)};this.destroy=n;this.container=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=";@@ -12837,7 +12837,7 @@ M.join("\n")),B.appendChild(g))}};Editor.prototype.isExportToCanvas=function(){roa=parseInt(ba.getAttribute("width")),pa=parseInt(ba.getAttribute("height"));T=null!=T?T:1;null!=p&&(T=N?Math.min(1,Math.min(3*p/(4*pa),p/oa)):p/oa);T=this.getMaxCanvasScale(oa,pa,T);oa=Math.ceil(T*oa);pa=Math.ceil(T*pa);qa.setAttribute("width",oa);qa.setAttribute("height",pa);var ua=qa.getContext("2d");if(null!=ka){var ia=mxUtils.getLightDarkColor(ka);ua.beginPath();ua.rect(0,0,oa,pa);ua.fillStyle="dark"==ha&&"none"!=Y.getAdaptiveColors()?ia.dark:ia.light;ua.fill()}1!=T&&ua.scale(T,T);if(la){var ma=Y.view,ta=ma.scale;ma.scale=1;var ra=btoa(unescape(encodeURIComponent(ma.createSvgGrid(ma.gridColor))));ma.scale=ta;ra="data:image/svg+xml;base64,"+ra;var za=Y.gridSize*ma.gridSteps*T,Ba=Y.getGraphBounds(),Ga=ma.translate.x*ta,wa=ma.translate.y*ta,Fa=Ga+(Ba.x-Ga)/ta-Z,xa=wa+(Ba.y-wa)/ta-Z,Oa=new Image;Oa.onload=function(){try{for(var Ca=-Math.round(za-mxUtils.mod((Ga-Fa)*T,za)),Ea=-Math.round(za-mxUtils.mod((wa-xa)*T,za));Ca<oa;Ca+=za)for(var Ha=Ea;Ha<pa;Ha+=za)ua.drawImage(Oa,Ca/T,Ha/T);da()}catch(Ja){null!=M&&M(Ja)}};Oa.onerror=function(Ca){null!=M&&M(Ca)};Oa.src=ra}else da()}catch(Ca){null!=M&&M(Ca)}});ea.onerror=function(da){null!=M&&M(da)};X&&this.graph.addSvgShadow(ba);this.graph.mathEnabled&&this.addMathCss(ba);var fa=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ba,this.resolvedFontCss),ea.src=Editor.createSvgDataUri(mxUtils.getXml(ba))}catch(da){null!=M&&M(da)}});this.embedExtFonts(mxUtils.bind(this,function(da){try{null!=da&&this.addFontCss(ba,da),this.loadFonts(fa)}catch(qa){null!=-M&&M(qa)}}))}catch(da){null!=M&&M(da)}}),B,W)}catch(ba){null!=M&&M(ba)}};Editor.crcTable=[];for(var x=0;256>x;x++)for(var A=x,z=0;8>z;z++)A=1==(A&1)?3988292384^A>>>1:A>>>1,Editor.crcTable[x]=A;Editor.updateCRC=function(g,p,B,K){for(var M=0;M<K;M++)g=Editor.crcTable[(g^p.charCodeAt(B+M))&255]^g>>>8;return g};Editor.crc32=function(g){for(var p=-1,B=0;B<g.length;B++)p=p>>>8^Editor.crcTable[(p^g.charCodeAt(B))&255];return(p^-1)>>>0};Editor.writeGraphModelToPng=function(g,p,B,K,M){function N(W,Y){var Z=+M&&M(qa)}}))}catch(da){null!=M&&M(da)}}),B,W)}catch(ba){null!=M&&M(ba)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var A=v,z=0;8>z;z++)A=1==(A&1)?3988292384^A>>>1:A>>>1,Editor.crcTable[v]=A;Editor.updateCRC=function(g,p,B,K){for(var M=0;M<K;M++)g=Editor.crcTable[(g^p.charCodeAt(B+M))&255]^g>>>8;return g};Editor.crc32=function(g){for(var p=-1,B=0;B<g.length;B++)p=p>>>8^Editor.crcTable[(p^g.charCodeAt(B))&255];return(p^-1)>>>0};Editor.writeGraphModelToPng=function(g,p,B,K,M){function N(W,Y){var Z=V;V+=Y;return W.substring(Z,V)}function R(W){W=N(W,4);return W.charCodeAt(3)+(W.charCodeAt(2)<<8)+(W.charCodeAt(1)<<16)+(W.charCodeAt(0)<<24)}function T(W){return String.fromCharCode(W>>24&255,W>>16&255,W>>8&255,W&255)}g=g.substring(g.indexOf(",")+1);g=window.atob?atob(g):Base64.decode(g,!0);var V=0;if(N(g,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=M&&M();else if(N(g,4),"IHDR"!=N(g,4))null!=M&&M();else{N(g,17);M=g.substring(0,V);do{var X=R(g);if("IDAT"==N(g,4)){M=g.substring(0,V-8);"pHYs"==p&&"dpi"==B?(B=Math.round(K/.0254),B=T(B)+T(B)+String.fromCharCode(1)):B=B+String.fromCharCode(0)+("zTXt"==p?String.fromCharCode(0):"")+K;K=4294967295;K=Editor.updateCRC(K,p,0,4);K=Editor.updateCRC(K,B,0,B.length);M+=T(B.length)+p+B+T(K^4294967295);M+=g.substring(V-8,g.length);break}M+=g.substring(V-8,V-4+X);N(g,X);N(g,4)}while(X);return"data:image/png;base64,"+(window.btoa?btoa(M):Base64.encode(M,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var D=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(g,p){D.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(g,p){var B=null;null!=g.editor.graph.getModel().getParent(p)?B=p.getId():@@ -12908,8 +12908,8 @@ function(g,p,B,K){if(null!=g&&0<g.length&&null!=p&&0<p.length){K=null!=K?K:Graphfunction(g){if(null!=g){var p=mxUtils.getValue(g,"fontSource",null);if(null!=p){var B=mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,null);if(null!=B)try{Graph.addFont(B,decodeURIComponent(p))}catch(K){}}}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;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 m=Graph.prototype.init;Graph.prototype.init=function(){function g(M){p=M}m.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(M){p=null});this.isMouseInsertPoint=function(){return null!=p};var B=this.getInsertPoint;this.getInsertPoint=function(M){return null==p||M?B.apply(this,arguments):this.getPointForEvent(p)};var K=this.layoutManager.getLayout;this.layoutManager.getLayout=function(M){var N=this.graph.getCellStyle(M);if(null!=N&&"rack"==N.childLayout){var R=new mxStackLayout(this.graph,!1);R.gridSize=null!=N.rackUnitSize?parseFloat(N.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;R.marginLeft=N.marginLeft||-0;R.marginRight=N.marginRight||0;R.marginTop=N.marginTop||0;R.marginBottom=N.marginBottom||0;R.allowGaps=N.allowGaps||0;R.horizontal="1"==mxUtils.getValue(N,"horizontalRack","0");R.resizeParent=!1;R.fill=!0;return R}return K.apply(this,arguments)};this.updateGlobalUrlVariables()};var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(g,p){return Graph.processFontStyle(t.apply(this,arguments))};var v=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=-function(g,p,B,K,M,N,R,T,V,X,W,Y){v.apply(this,arguments);Graph.processFontAttributes(Y)};var y=mxText.prototype.redraw;mxText.prototype.redraw=function(){y.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(g,p,B,K){function M(){for(var ha=T.getSelectionCells(),ca=[],ja=0;ja<ha.length;ja++)T.isCellVisible(ha[ja])&&ca.push(ha[ja]);T.setSelectionCells(ca)}function N(ha){T.setHiddenTags(ha?[]:V.slice());+0;R.marginRight=N.marginRight||0;R.marginTop=N.marginTop||0;R.marginBottom=N.marginBottom||0;R.allowGaps=N.allowGaps||0;R.horizontal="1"==mxUtils.getValue(N,"horizontalRack","0");R.resizeParent=!1;R.fill=!0;return R}return K.apply(this,arguments)};this.updateGlobalUrlVariables()};var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(g,p){return Graph.processFontStyle(t.apply(this,arguments))};var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=+function(g,p,B,K,M,N,R,T,V,X,W,Y){x.apply(this,arguments);Graph.processFontAttributes(Y)};var y=mxText.prototype.redraw;mxText.prototype.redraw=function(){y.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(g,p,B,K){function M(){for(var ha=T.getSelectionCells(),ca=[],ja=0;ja<ha.length;ja++)T.isCellVisible(ha[ja])&&ca.push(ha[ja]);T.setSelectionCells(ca)}function N(ha){T.setHiddenTags(ha?[]:V.slice());M();T.refresh()}function R(ha,ca){W.innerText="";if(0<ha.length){var ja=document.createElement("table");ja.setAttribute("cellpadding","2");ja.style.boxSizing="border-box";ja.style.tableLayout="fixed";ja.style.width="100%";var ka=document.createElement("tbody");if(null!=ha&&0<ha.length)for(var ba=0;ba<ha.length;ba++)(function(ea){function fa(){var ia=T.getCellsForTags([ea],null,null,!0);T.isEnabled()?T.setSelectionCells(ia):T.highlightCells(ia,null,null,70)}var da=0>mxUtils.indexOf(T.hiddenTags,ea),qa=document.createElement("tr"),oa=document.createElement("td");oa.style.align="center";oa.style.width="16px";var pa=document.createElement("img");pa.setAttribute("src",da?Editor.visibleImage:Editor.hiddenImage);pa.setAttribute("title",mxResources.get(da?"hideIt":"show",[ea]));mxUtils.setOpacity(pa,da?75:25);pa.className="geAdaptiveAsset";pa.style.verticalAlign="middle";pa.style.cursor="pointer";pa.style.width="16px";if(p||Editor.isDarkMode())pa.style.filter="invert(100%)";oa.appendChild(pa);mxEvent.addListener(pa,"click",function(ia){mxEvent.isShiftDown(ia)?N(0<=mxUtils.indexOf(T.hiddenTags,ea)):(T.toggleHiddenTag(ea),M(),T.refresh());mxEvent.consume(ia)});qa.appendChild(oa);oa=document.createElement("td");oa.style.align="center";oa.style.width="16px";pa=document.createElement("img");pa.setAttribute("src",Editor.selectImage);pa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(pa,da?75:25);pa.className="geAdaptiveAsset";pa.style.verticalAlign="middle";pa.style.cursor="pointer";pa.style.width=@@ -12988,97 +12988,97 @@ mxEvent.addListener(p,"click",function(Ca){Fa.checked=!0;mxEvent.consume(Ca)}));T.style.colorScheme="dark"):(T.classList.remove("geDarkMode"),T.style.colorScheme="light")};g.addListener("darkModeChanged",xa);xa();var Oa=function(Ca,Ea){Ca=Ea.getProperty("dialog");T.parentNode==Ca.container&&(g.editor.removeListener(Oa),g.removeListener(xa))};g.editor.addListener("hideDialog",Oa)}this.container=T};var H=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!=g&&null!=g.src&&Graph.isPageLink(g.src)&&(g={originalSrc:g.src});this.page.viewState.backgroundImage=g}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 H.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&&(g=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=g?g:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.2.6";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&&+this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.2.7";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.enablePlantUml=EditorUi.enableLogging||"1"==urlParams.dev;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 window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={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.logError=function(c,f,k,m,t,v,y){if(null!=c){t=null!=t?t:Error(c);t.stack=null!=t.stack?t.stack:"";v=null!=v?v: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>t.stack.indexOf("extension:")&&0>t.stack.indexOf("<anonymous>:")&&0>t.stack.indexOf("/math4/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+v+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=m?":colno:"+encodeURIComponent(m):-"")+(""!=t.stack?"&stack="+encodeURIComponent(t.stack):""))}catch(F){}try{y||null==window.console||console.error(v,c,f,k,m,t)}catch(F){}}};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"==+topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(c,f,k,m,t,x,y){if(null!=c){t=null!=t?t:Error(c);t.stack=null!=t.stack?t.stack:"";x=null!=x?x: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>t.stack.indexOf("extension:")&&0>t.stack.indexOf("<anonymous>:")&&0>t.stack.indexOf("/math4/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+x+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=m?":colno:"+encodeURIComponent(m):+"")+(""!=t.stack?"&stack="+encodeURIComponent(t.stack):""))}catch(F){}try{y||null==window.console||console.error(x,c,f,k,m,t)}catch(F){}}};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 m=k.getAttribute("width"),t=k.getAttribute("height");k.setAttribute("x",c.getAttribute("x"));k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";0<m&&0<t&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+m+" "+t);var v=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");v.appendChild(k);c.hasAttribute("transform")&&v.setAttribute("transform",-c.getAttribute("transform"));c.parentNode.replaceChild(v,c)}}catch(y){}};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 m=document.implementation.createHTMLDocument(""),t=document.createElement("style"),v=0;v<f.length;v++){t.textContent=f[v].textContent;m.body.appendChild(t);for(var y="",F=-0;F<t.sheet.cssRules.length;F++){var E=t.sheet.cssRules[F];if(null!=E.selectorText){for(var C=E.selectorText.split(","),S=0;S<C.length;S++)C[S]="#"+k+" "+C[S];E.selectorText=C.join(",")}y+=E.cssText+"\n"}f[v].textContent=y}}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>';+if(null!=k&&"svg"==k.nodeName){var m=k.getAttribute("width"),t=k.getAttribute("height");k.setAttribute("x",c.getAttribute("x"));k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";0<m&&0<t&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+m+" "+t);var x=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");x.appendChild(k);c.hasAttribute("transform")&&x.setAttribute("transform",+c.getAttribute("transform"));c.parentNode.replaceChild(x,c)}}catch(y){}};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 m=document.implementation.createHTMLDocument(""),t=document.createElement("style"),x=0;x<f.length;x++){t.textContent=f[x].textContent;m.body.appendChild(t);for(var y="",F=+0;F<t.sheet.cssRules.length;F++){var E=t.sheet.cssRules[F];if(null!=E.selectorText){for(var C=E.selectorText.split(","),S=0;S<C.length;S++)C[S]="#"+k+" "+C[S];E.selectorText=C.join(",")}y+=E.cssText+"\n"}f[x].textContent=y}}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.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.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;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,f,k)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalData=function(c,f){f(localStorage.getItem(c))};EditorUi.prototype.setLocalData=function(c,f,k){localStorage.setItem(c,f);null!=k&&k()};EditorUi.prototype.isLocked=function(){var c=this.getCurrentFile();return null!=c&&c.isLocked()};EditorUi.prototype.removeLocalData=function(c,f){localStorage.removeItem(c);f()};EditorUi.prototype.setShareCursorPosition=function(c){this.shareCursorPosition=c;this.fireEvent(new mxEventObject("shareCursorPositionChanged"))};EditorUi.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||!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 m=null==c||null==f;k=null!=k?k:24;var t=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}),v=this.timeout,y=t.spin,F=null,E=null,-C=mxUtils.bind(this,function(Q){null!=Q&&Q()}),S=this;t.spin=function(Q,O,q,u){u=null!=u?u:v;var I=!1;if(!this.active){var G=Date.now();null!=q&&(F=window.setTimeout(function(){t.stop();F=null;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:E})},u));m&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);Q==document.body&&"1"==urlParams.embedInline&&(Q=S.diagramContainer,c=Q.scrollLeft+Q.clientWidth/2,f=Q.scrollTop++!navigator.onLine||!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 m=null==c||null==f;k=null!=k?k:24;var t=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}),x=this.timeout,y=t.spin,F=null,E=null,+C=mxUtils.bind(this,function(Q){null!=Q&&Q()}),S=this;t.spin=function(Q,O,q,u){u=null!=u?u:x;var I=!1;if(!this.active){var G=Date.now();null!=q&&(F=window.setTimeout(function(){t.stop();F=null;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:E})},u));m&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);Q==document.body&&"1"==urlParams.embedInline&&(Q=S.diagramContainer,c=Q.scrollLeft+Q.clientWidth/2,f=Q.scrollTop+Q.clientHeight/2);y.call(this,Q);"1"==urlParams.embedInline&&null!=t.el&&(t.el.style.marginTop=Q.scrollTop+"px",t.el.style.marginLeft=Q.scrollLeft+"px");this.active=!0;null!=O&&(I=document.createElement("div"),I.className="geSpinnerStatus",I.setAttribute("title",O),Q==document.body?(I.style.left=Math.max(0,c)+"px",I.style.top=Math.max(0,f+66)+"px"):(I.style.left="50%",I.style.top="50%",I.style.marginTop="70px"),"..."!=O.substring(O.length-3,O.length)&&"!"!=O.charAt(O.length-1)&&(O+="..."),I.innerText=O,Q.appendChild(I),t.status=I);this.pause=mxUtils.bind(this,function(){var H=C;this.active&&(u=Math.max(0,u-(Date.now()-G)),H=mxUtils.bind(this,function(g){this.spin(Q,O,q,u);if(null!=g)try{g(),E=mxUtils.bind(this,function(){this.spin(Q,O,q,u);try{g()}catch(p){null!=q&&q(p)}})}catch(p){null!=q&&q(p)}}));this.stop();return H});I=!0}return I};var U=t.stop;t.stop=function(){U.call(this);this.active&&(this.active=!1,null!=F&&(window.clearTimeout(F),F=null),null!=t.status&&null!=t.status.parentNode&&t.status.parentNode.removeChild(t.status),t.status=null)};t.pause=function(){return C};return t};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(m){}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,m=this.editor.graph,t=this;f.getFunction=function(v){if(m.isSelectionEmpty()&&null!=t.pages&&0<t.pages.length){var y=t.getSelectedPageIndex();if(mxEvent.isShiftDown(v)){if(37==-v.keyCode)return function(){0<y&&t.movePage(y,y-1)};if(38==v.keyCode)return function(){0<y&&t.movePage(y,0)};if(39==v.keyCode)return function(){y<t.pages.length-1&&t.movePage(y,y+1)};if(40==v.keyCode)return function(){y<t.pages.length-1&&t.movePage(y,t.pages.length-1)}}else if(mxEvent.isControlDown(v)||mxClient.IS_MAC&&mxEvent.isMetaDown(v)){if(37==v.keyCode)return function(){0<y&&t.selectNextPage(!1)};if(38==v.keyCode)return function(){0<y&&t.selectPage(t.pages[0])};if(39==v.keyCode)return function(){y<-t.pages.length-1&&t.selectNextPage(!0)};if(40==v.keyCode)return function(){y<t.pages.length-1&&t.selectPage(t.pages[t.pages.length-1])}}}return!(65<=v.keyCode&&90>=v.keyCode)||m.isSelectionEmpty()||mxEvent.isAltDown(v)||mxEvent.isShiftDown(v)||mxEvent.isControlDown(v)||mxClient.IS_MAC&&mxEvent.isMetaDown(v)?k.apply(this,arguments):null}}return f};var l=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=l.apply(this,arguments);if(null==f)try{var k=-c.indexOf("<mxfile ");if(0<=k){var m=c.lastIndexOf("</mxfile>");m>k&&(f=c.substring(k,m+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var t=mxUtils.parseXml(c),v=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=v?mxUtils.getXml(v):""}}catch(y){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');+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,m=this.editor.graph,t=this;f.getFunction=function(x){if(m.isSelectionEmpty()&&null!=t.pages&&0<t.pages.length){var y=t.getSelectedPageIndex();if(mxEvent.isShiftDown(x)){if(37==+x.keyCode)return function(){0<y&&t.movePage(y,y-1)};if(38==x.keyCode)return function(){0<y&&t.movePage(y,0)};if(39==x.keyCode)return function(){y<t.pages.length-1&&t.movePage(y,y+1)};if(40==x.keyCode)return function(){y<t.pages.length-1&&t.movePage(y,t.pages.length-1)}}else if(mxEvent.isControlDown(x)||mxClient.IS_MAC&&mxEvent.isMetaDown(x)){if(37==x.keyCode)return function(){0<y&&t.selectNextPage(!1)};if(38==x.keyCode)return function(){0<y&&t.selectPage(t.pages[0])};if(39==x.keyCode)return function(){y<+t.pages.length-1&&t.selectNextPage(!0)};if(40==x.keyCode)return function(){y<t.pages.length-1&&t.selectPage(t.pages[t.pages.length-1])}}}return!(65<=x.keyCode&&90>=x.keyCode)||m.isSelectionEmpty()||mxEvent.isAltDown(x)||mxEvent.isShiftDown(x)||mxEvent.isControlDown(x)||mxClient.IS_MAC&&mxEvent.isMetaDown(x)?k.apply(this,arguments):null}}return f};var l=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=l.apply(this,arguments);if(null==f)try{var k=+c.indexOf("<mxfile ");if(0<=k){var m=c.lastIndexOf("</mxfile>");m>k&&(f=c.substring(k,m+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var t=mxUtils.parseXml(c),x=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=x?mxUtils.getXml(x):""}}catch(y){}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.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 m=null!=this.pages?this.pages.slice():null,t=c.getElementsByTagName("diagram");-if(1<t.length||1==t.length&&t[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var v=t.length-1;0<=v;v--){var y=this.updatePageRoot(new DiagramPage(t[v]));null==y.getName()&&y.setName(mxResources.get("pageWithNumber",[v+1]));k.model.execute(new ChangePage(this,y,0==v?y: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!=m)for(v=0;v<m.length;v++)k.model.execute(new ChangePage(this,m[v],null));var F=this.getCurrentFile();null!=F&&F.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,k,m,t,v,y,F,E,C,S,U,Q){f=null!=+if(1<t.length||1==t.length&&t[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var x=t.length-1;0<=x;x--){var y=this.updatePageRoot(new DiagramPage(t[x]));null==y.getName()&&y.setName(mxResources.get("pageWithNumber",[x+1]));k.model.execute(new ChangePage(this,y,0==x?y: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!=m)for(x=0;x<m.length;x++)k.model.execute(new ChangePage(this,m[x],null));var F=this.getCurrentFile();null!=F&&F.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,k,m,t,x,y,F,E,C,S,U,Q){f=null!=f?f:this.editor.graph;t=null!=t?t:!1;E=null!=E?E:!0;S=null!=S?S:!Editor.defaultCompressed;var O=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var q="_blank";else O=q=m;if(null==c)return"";var u=c;if("mxfile"!=u.nodeName.toLowerCase()){if(S){var I=c.ownerDocument.createElement("diagram");I.setAttribute("name",mxResources.get("pageWithNumber",[1]));I.setAttribute("id",Editor.guid());I.appendChild(c)}else{I=Graph.zapGremlins(mxUtils.getXml(c));u=Graph.compress(I);if(Graph.decompress(u)!=I)return I;I=c.ownerDocument.createElement("diagram");I.setAttribute("name",mxResources.get("pageWithNumber",[1]));I.setAttribute("id",Editor.guid());mxUtils.setTextContent(I,u)}u=c.ownerDocument.createElement("mxfile");u.appendChild(I)}C?(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),u.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),u.setAttribute("version",EditorUi.VERSION),1<u.getElementsByTagName("diagram").length&&-null!=this.pages&&u.setAttribute("pages",this.pages.length));null!=U&&(u=u.cloneNode(!0),u.setAttribute("scale",U));null!=Q&&(u=u.cloneNode(!0),u.setAttribute("border",Q));c=S?mxUtils.getPrettyXml(u):mxUtils.getXml(u);if(!v&&!t&&(y||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(u),f,null!=k?k.getTitle():null,q,O,null==O&&!EditorUi.isElectronApp&&"draw.io"==this.getServiceName());else if(v||!t&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&-k.getMode()!=App.MODE_BROWSER||(m=null),k=this.getSvgFileProperties(u),c=this.getEmbeddedSvg(c,f,m,null,F,E,O,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,m){c=null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var t=this.editor.getGraphXml(c,m);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(E){var C=E.getElementsByTagName("mxGraphModel"),S=0<C.length?C[0]:null;C=E;null==S&&k?(S=mxUtils.getNodeValue(E),-0<S.length&&(S=Graph.decompress(S),null!=S&&0<S.length&&(C=E.cloneNode(!1),C.appendChild(mxUtils.parseXml(S).documentElement)))):null==S||k?C=E.cloneNode(!0):(C=E.cloneNode(!1),mxUtils.setTextContent(C,Graph.compressNode(S)));t.appendChild(C)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(t),t=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var v=this.pages[f],y=v.node;if(v!=this.currentPage)if(v.needsUpdate){var F=-new mxCodec(mxUtils.createXmlDocument());F=F.encode(new mxGraphModel(v.root));this.editor.graph.saveViewState(v.viewState,F,null,m);EditorUi.removeChildNodes(y);y.appendChild(F);delete v.needsUpdate}else m&&(this.updatePageRoot(v),null!=v.viewState.backgroundImage&&null!=v.viewState.backgroundImage.originalSrc&&(F=new mxCodec(mxUtils.createXmlDocument()),F=F.encode(new mxGraphModel(v.root)),this.editor.graph.saveViewState(v.viewState,F,null,m,v),y=y.cloneNode(!1),y.appendChild(F)));c(y)}return t};-EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],m=0;m<c.length;m++){var t=c.charAt(m);0<=EditorUi.ignoredAnonymizedChars.indexOf(t)?k.push(t):isNaN(parseInt(t))?t.toLowerCase()!=t?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):t.toUpperCase()!=t?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(t)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};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(v){c[EditorUi.DIFF_INSERT][f].data=v.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var m in c[EditorUi.DIFF_UPDATE]){var t=c[EditorUi.DIFF_UPDATE][m];null!=t.name&&(t.name=this.anonymizeString(t.name));-null!=t.cells&&(f=mxUtils.bind(this,function(v){var y=t.cells[v];if(null!=y){for(var F in y)null!=y[F].value&&(y[F].value="["+y[F].value.length+"]"),null!=y[F].xmlValue&&(y[F].xmlValue="["+y[F].xmlValue.length+"]"),null!=y[F].style&&(y[F].style="["+y[F].style.length+"]"),mxUtils.isEmptyObject(y[F])&&delete y[F];mxUtils.isEmptyObject(y)&&delete t.cells[v]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(t.cells)&&delete t.cells);mxUtils.isEmptyObject(t)&&delete c[EditorUi.DIFF_UPDATE][m]}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,m,t,v,y,F,E,C,S,U,Q){t=null!=t?t:!0;v=null!=v?v:!1;C=null!=C?C:!Editor.defaultCompressed;var O=this.editor.graph;if((f||!c&&null!=E&&/(\.svg)$/i.test(E.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var q=O.getGlobalVariable;O=this.createTemporaryGraph(O.getStylesheet());O.setBackgroundImage=-this.editor.graph.setBackgroundImage;O.background=this.editor.graph.background;var u=null!=this.pages?this.pages[0]:null;null==u||this.currentPage==u?O.setBackgroundImage(this.editor.graph.backgroundImage):null!=u.viewState&&null!=u.viewState&&O.setBackgroundImage(u.viewState.backgroundImage);O.getGlobalVariable=function(I){return"page"==I&&null!=u?u.getName():"pagenumber"==I?1:q.apply(this,arguments)};document.body.appendChild(O.container);null!=u&&O.model.setRoot(u.root)}y=null!=y?y:this.getXmlFileData(t,-v,C,S);E=null!=E?E:this.getCurrentFile();c=this.createFileData(y,O,E,window.location.href,c,f,k,m,t,F,C,U,Q);O!=this.editor.graph&&O.container.parentNode.removeChild(O.container);return c};EditorUi.prototype.getHtml=function(c,f,k,m,t,v){v=null!=v?v:!0;var y=null,F=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){y=v?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var E=f.view.scale;v=Math.floor(y.x/E-f.view.translate.x);E=Math.floor(y.y/E-f.view.translate.y);y=f.background;null==-t&&(f=this.getBasenames().join(";"),0<f.length&&(F=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",v);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!=m&&c.setAttribute("edit",m));null!=t&&(t=t.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";m=Graph.compress(c);Graph.decompress(m)!=c&&(m=encodeURIComponent(c));-return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&null!=y&&y!=mxConstants.NONE?' style="background-color:'+y+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+-m+"</div>\n</div>\n"+(null==t?'<script type="text/javascript" src="'+F+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,m,t,v){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),-toolbar:"pages zoom layers lightbox"};null!=t?t=t.replace(/&/g,"&"):v&&(c.editor=window.DRAWIO_BASE_URL,c.toolbar+=" editlocal");null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+-(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\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==t?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+-"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,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 m=this.getHashObject(),t=null;this.fileNode=f;this.pages=[];for(var v=0;v<c.length;v++){null==c[v].getAttribute("id")&&c[v].setAttribute("id",v);f=new DiagramPage(c[v]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[v+1]));this.pages.push(f);if(null==m.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=m.pageId&&f.getId()==m.pageId)t=f;if(null==k[f.getId()])k[f.getId()]=-f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=t?t: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 y=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(v=0;v<y.length;v++)f[y[v]]=!0;var F=this.editor.graph.getModel(),E=F.getChildren(F.root);for(v=0;v<E.length;v++){var C=E[v];F.setVisible(C,f[C.id]||!1)}}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,m,t,v,y,F,E,C,S,U,Q,O,q,u,I){try{m=null!=m?m:this.editor.graph.isSelectionEmpty();var G=this.getBaseFilename(!t),-H=G+("xml"==c||"pdf"==c&&S?".drawio":"")+"."+c;if("xml"==c){var g=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,m,t,null,null,null,f);this.saveData(H,c,g,"text/xml")}else if("html"==c)g=this.getHtml2(this.getFileData(!0),this.editor.graph,G),this.saveData(H,c,g,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?H=G+".png":"jpeg"==c&&(H=G+".jpg"),this.saveRequest(H,c,mxUtils.bind(this,function(N,R){try{return this.createDownloadRequest(N,-c,m,R,y,t,F,E,C,S,U,void 0,void 0,!v,Q,O,q,u,I)}catch(T){this.handleError(T)}}));else{var p=null,B=mxUtils.bind(this,function(N){N.length<=MAX_REQUEST_SIZE?this.saveData(H,"svg",N,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==c){var K=this.editor.graph.background;if(y||K==mxConstants.NONE)K=null;var M=this.editor.graph.getSvg(K,null,null,null,null,m);k&&this.editor.graph.addSvgShadow(M);-this.editor.convertImages(M,mxUtils.bind(this,mxUtils.bind(this,function(N){this.spinner.stop();B(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(N))})))}else H=G+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(N){this.spinner.stop();B(N)}),m)}}catch(N){this.handleError(N)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,m,t,v,y,F,E,C,S,U,Q,O,q,u,I,G,H){c=this.downloadRequestBuilder(c,f,k,m,t,v,y,F,E,C,S,U,Q,O,q,u,I,G,H);f="";for(var g in c)k=c[g],null!=k&&-(f+=g+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,m,t,v,y,F,E,C,S,U,Q,O,q,u,I,G,H){var g=this.editor.graph,p=g.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==v?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var B=null,K=null,M=null;if(!EditorUi.isElectronApp&&(p.width*p.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};C=C?"1":"0";"pdf"==f&&-(null!=S?(B=S.from,K=S.to):0==v&&(M="1"));"xmlpng"==f&&(C="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(v=0;v<this.pages.length;v++)if(this.pages[v]==this.currentPage){B=v;break}v=g.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!t?t||null!=v&&v!=mxConstants.NONE||(v="#ffffff"):v=mxConstants.NONE;t={globalVars:g.getExportVariables()};null!=S&&null!=S.from&&(t.globalVars.pagenumber=S.from+1);E&&(t.grid={size:g.gridSize,steps:g.view.gridSteps,color:Editor.isDarkMode()&&-"pdf"==f?mxGraphView.prototype.defaultGridColor:g.view.gridColor});Graph.translateDiagram&&(t.diagramLanguage=Graph.diagramLanguage);return{format:f,from:B,to:K,allPages:M,bg:null!=v?v:mxConstants.NONE,base64:m,embedXml:C,xml:k,filename:null!=c?c:"",extras:JSON.stringify(t),scale:y,border:F,pageMargin:q,w:U&&isFinite(U)?U:null,h:Q&&isFinite(Q)?Q:null,crop:null!=O&&O?"1":"0",fit:null!=u&&u?"1":"0",shadows:null!=H&&H?"1":"0",sheetsAcross:I,sheetsDown:G}};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(m){}}}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(m){}0<k&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=-function(c,f,k){var m=window.location.hash,t=mxUtils.bind(this,function(y){var F=null!=c.data?c.data:"";null!=y&&0<y.length&&(0<F.length&&(F+="\n"),F+=y);y=new LocalFile(this,"csv"!=c.format&&0<F.length?F:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);y.getHash=function(){return m};this.fileLoaded(y);"csv"==c.format&&this.importCsv(F,mxUtils.bind(this,function(Q){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));-if(null!=c.update){var E=null!=c.interval?parseInt(c.interval):6E4,C=null,S=mxUtils.bind(this,function(){var Q=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(O){Q===this.currentPage&&(200<=O.getStatus()&&300>=O.getStatus()?(this.updateDiagram(O.getText()),U()):this.handleError({message:mxResources.get("error")+" "+O.getStatus()}))}),mxUtils.bind(this,function(O){this.handleError(O)}))}),U=mxUtils.bind(this,function(){window.clearTimeout(C);-C=window.setTimeout(S,E)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){U();S()}));U();S()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var v=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(v,mxUtils.bind(this,function(y){t(y)}),mxUtils.bind(this,function(y){null!=k&&k(y)}))}else t("")};EditorUi.prototype.updateDiagram=function(c){function f(g){var p=new mxCellOverlay(g.image||t.warningImage,g.tooltip,g.align,g.valign,g.offset);p.addListener(mxEvent.CLICK,function(B,-K){m.alert(g.tooltip)});return p}var k=null,m=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var t=this.editor.graph,v=t.getModel();v.beginUpdate();var y=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var F=v.getCell(c.getAttribute("id"));if(null!=F){try{var E=c.getAttribute("value");if(null!=E){var C=mxUtils.parseXml(E).documentElement;if(null!=C)if("1"==C.getAttribute("replace-value"))v.setValue(F,C);else for(var S=-C.attributes,U=0;U<S.length;U++)t.setAttributeForCell(F,S[U].nodeName,0<S[U].nodeValue.length?S[U].nodeValue:null)}}catch(g){null!=window.console&&console.log("Error in value for "+F.id+": "+g)}try{var Q=c.getAttribute("style");null!=Q&&t.model.setStyle(F,Q)}catch(g){null!=window.console&&console.log("Error in style for "+F.id+": "+g)}try{var O=c.getAttribute("icon");if(null!=O){var q=0<O.length?JSON.parse(O):null;null!=q&&q.append||t.removeCellOverlays(F);null!=q&&t.addCellOverlay(F,f(q))}}catch(g){null!=-window.console&&console.log("Error in icon for "+F.id+": "+g)}try{var u=c.getAttribute("geometry");if(null!=u){u=JSON.parse(u);var I=t.getCellGeometry(F);if(null!=I){I=I.clone();for(key in u){var G=parseFloat(u[key]);"dx"==key?I.x+=G:"dy"==key?I.y+=G:"dw"==key?I.width+=G:"dh"==key?I.height+=G:I[key]=parseFloat(u[key])}t.model.setGeometry(F,I)}}}catch(g){null!=window.console&&console.log("Error in icon for "+F.id+": "+g)}}}else if("model"==c.nodeName){for(var H=c.firstChild;null!=H&&H.nodeType!=mxConstants.NODETYPE_ELEMENT;)H=-H.nextSibling;null!=H&&(new mxCodec(c.firstChild)).decode(H,v)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(t.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))t.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(y=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{v.endUpdate()}null!=y&&this.chromelessResize&&this.chromelessResize(!0,-y)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var m=k.lastIndexOf(".");0<=m&&(c=k.substring(m),k=k.substring(0,m));if(f){f=k;var t=new Date;k=t.getFullYear();m=t.getMonth()+1;var v=t.getDate(),y=t.getHours(),F=t.getMinutes();t=t.getSeconds();k=f+(" "+(k+"-"+m+"-"+v+"-"+y+"-"+F+"-"+t))}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 m=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var t=!1;this.hideDialog();null!=m&&(m.removeListener(this.descriptorChangedListener),this.logIfModified(m,!0),m.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var v=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);+null!=this.pages&&u.setAttribute("pages",this.pages.length));null!=U&&(u=u.cloneNode(!0),u.setAttribute("scale",U));null!=Q&&(u=u.cloneNode(!0),u.setAttribute("border",Q));c=S?mxUtils.getPrettyXml(u):mxUtils.getXml(u);if(!x&&!t&&(y||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(u),f,null!=k?k.getTitle():null,q,O);else if(x||!t&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(m=null),k=this.getSvgFileProperties(u),+c=this.getEmbeddedSvg(c,f,m,null,F,E,O,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,m){c=null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var t=this.editor.getGraphXml(c,m);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(E){var C=E.getElementsByTagName("mxGraphModel"),S=0<C.length?C[0]:null;C=E;null==S&&k?(S=mxUtils.getNodeValue(E),0<S.length&&(S=Graph.decompress(S),null!=S&&0<S.length&&(C=E.cloneNode(!1),+C.appendChild(mxUtils.parseXml(S).documentElement)))):null==S||k?C=E.cloneNode(!0):(C=E.cloneNode(!1),mxUtils.setTextContent(C,Graph.compressNode(S)));t.appendChild(C)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(t),t=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var x=this.pages[f],y=x.node;if(x!=this.currentPage)if(x.needsUpdate){var F=new mxCodec(mxUtils.createXmlDocument());F=F.encode(new mxGraphModel(x.root));+this.editor.graph.saveViewState(x.viewState,F,null,m);EditorUi.removeChildNodes(y);y.appendChild(F);delete x.needsUpdate}else m&&(this.updatePageRoot(x),null!=x.viewState.backgroundImage&&null!=x.viewState.backgroundImage.originalSrc&&(F=new mxCodec(mxUtils.createXmlDocument()),F=F.encode(new mxGraphModel(x.root)),this.editor.graph.saveViewState(x.viewState,F,null,m,x),y=y.cloneNode(!1),y.appendChild(F)));c(y)}return t};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],m=0;m<c.length;m++){var t=+c.charAt(m);0<=EditorUi.ignoredAnonymizedChars.indexOf(t)?k.push(t):isNaN(parseInt(t))?t.toLowerCase()!=t?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):t.toUpperCase()!=t?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(t)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};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(x){c[EditorUi.DIFF_INSERT][f].data=x.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var m in c[EditorUi.DIFF_UPDATE]){var t=c[EditorUi.DIFF_UPDATE][m];null!=t.name&&(t.name=this.anonymizeString(t.name));null!=t.cells&&(f=mxUtils.bind(this,function(x){var y=t.cells[x];+if(null!=y){for(var F in y)null!=y[F].value&&(y[F].value="["+y[F].value.length+"]"),null!=y[F].xmlValue&&(y[F].xmlValue="["+y[F].xmlValue.length+"]"),null!=y[F].style&&(y[F].style="["+y[F].style.length+"]"),mxUtils.isEmptyObject(y[F])&&delete y[F];mxUtils.isEmptyObject(y)&&delete t.cells[x]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(t.cells)&&delete t.cells);mxUtils.isEmptyObject(t)&&delete c[EditorUi.DIFF_UPDATE][m]}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,m,t,x,y,F,E,C,S,U,Q){t=null!=t?t:!0;x=null!=x?x:!1;C=null!=C?C:!Editor.defaultCompressed;var O=this.editor.graph;if((f||!c&&null!=E&&/(\.svg)$/i.test(E.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var q=O.getGlobalVariable;O=this.createTemporaryGraph(O.getStylesheet());O.setBackgroundImage=this.editor.graph.setBackgroundImage;O.background=this.editor.graph.background;+var u=null!=this.pages?this.pages[0]:null;null==u||this.currentPage==u?O.setBackgroundImage(this.editor.graph.backgroundImage):null!=u.viewState&&null!=u.viewState&&O.setBackgroundImage(u.viewState.backgroundImage);O.getGlobalVariable=function(I){return"page"==I&&null!=u?u.getName():"pagenumber"==I?1:q.apply(this,arguments)};document.body.appendChild(O.container);null!=u&&O.model.setRoot(u.root)}y=null!=y?y:this.getXmlFileData(t,x,C,S);E=null!=E?E:this.getCurrentFile();c=this.createFileData(y,O,E,+window.location.href,c,f,k,m,t,F,C,U,Q);O!=this.editor.graph&&O.container.parentNode.removeChild(O.container);return c};EditorUi.prototype.getHtml=function(c,f,k,m,t,x){x=null!=x?x:!0;var y=null,F=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){y=x?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var E=f.view.scale;x=Math.floor(y.x/E-f.view.translate.x);E=Math.floor(y.y/E-f.view.translate.y);y=f.background;null==t&&(f=this.getBasenames().join(";"),0<f.length&&(F=EditorUi.drawHost++"/embed.js?s="+f));c.setAttribute("x0",x);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!=m&&c.setAttribute("edit",m));null!=t&&(t=t.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";m=Graph.compress(c);Graph.decompress(m)!=c&&(m=encodeURIComponent(c));return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':+"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&null!=y&&y!=mxConstants.NONE?' style="background-color:'+y+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+m+"</div>\n</div>\n"++(null==t?'<script type="text/javascript" src="'+F+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,m,t){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=t&&(t=t.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==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''++t+"'\"/>\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==t?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=+function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,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 m=this.getHashObject(),t=null;this.fileNode=f;this.pages=[];for(var x=0;x<c.length;x++){null==c[x].getAttribute("id")&&c[x].setAttribute("id",x);f=new DiagramPage(c[x]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[x+1]));this.pages.push(f);if(null==m.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=m.pageId&&f.getId()==m.pageId)t=f;if(null==k[f.getId()])k[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=+null!=t?t: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 y=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(x=0;x<y.length;x++)f[y[x]]=!0;var F=this.editor.graph.getModel(),E=F.getChildren(F.root);for(x=0;x<E.length;x++){var C=E[x];F.setVisible(C,f[C.id]||!1)}}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,m,t,x,y,F,E,C,S,U,Q,O,q,u,I){try{m=null!=m?m:this.editor.graph.isSelectionEmpty();var G=this.getBaseFilename(!t),H=G+("xml"==c||"pdf"==c&&S?".drawio":"")+"."++c;if("xml"==c){var g=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,m,t,null,null,null,f);this.saveData(H,c,g,"text/xml")}else if("html"==c)g=this.getHtml2(this.getFileData(!0),this.editor.graph,G),this.saveData(H,c,g,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?H=G+".png":"jpeg"==c&&(H=G+".jpg"),this.saveRequest(H,c,mxUtils.bind(this,function(N,R){try{return this.createDownloadRequest(N,c,m,R,y,t,F,E,C,S,U,void 0,+void 0,!x,Q,O,q,u,I)}catch(T){this.handleError(T)}}));else{var p=null,B=mxUtils.bind(this,function(N){N.length<=MAX_REQUEST_SIZE?this.saveData(H,"svg",N,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==c){var K=this.editor.graph.background;if(y||K==mxConstants.NONE)K=null;var M=this.editor.graph.getSvg(K,null,null,null,null,m);k&&this.editor.graph.addSvgShadow(M);this.editor.convertImages(M,+mxUtils.bind(this,mxUtils.bind(this,function(N){this.spinner.stop();B(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(N))})))}else H=G+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(N){this.spinner.stop();B(N)}),m)}}catch(N){this.handleError(N)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,m,t,x,y,F,E,C,S,U,Q,O,q,u,I,G,H){c=this.downloadRequestBuilder(c,f,k,m,t,x,y,F,E,C,S,U,Q,O,q,u,I,G,H);f="";for(var g in c)k=c[g],null!=k&&(f+=g+"="+encodeURIComponent(k)++"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,m,t,x,y,F,E,C,S,U,Q,O,q,u,I,G,H){var g=this.editor.graph,p=g.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==x?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var B=null,K=null,M=null;if(!EditorUi.isElectronApp&&(p.width*p.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};C=C?"1":"0";"pdf"==f&&(null!=S?(B=S.from,K=S.to):0==x&&+(M="1"));"xmlpng"==f&&(C="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(x=0;x<this.pages.length;x++)if(this.pages[x]==this.currentPage){B=x;break}x=g.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!t?t||null!=x&&x!=mxConstants.NONE||(x="#ffffff"):x=mxConstants.NONE;t={globalVars:g.getExportVariables()};null!=S&&null!=S.from&&(t.globalVars.pagenumber=S.from+1);E&&(t.grid={size:g.gridSize,steps:g.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:+g.view.gridColor});Graph.translateDiagram&&(t.diagramLanguage=Graph.diagramLanguage);return{format:f,from:B,to:K,allPages:M,bg:null!=x?x:mxConstants.NONE,base64:m,embedXml:C,xml:k,filename:null!=c?c:"",extras:JSON.stringify(t),scale:y,border:F,pageMargin:q,w:U&&isFinite(U)?U:null,h:Q&&isFinite(Q)?Q:null,crop:null!=O&&O?"1":"0",fit:null!=u&&u?"1":"0",shadows:null!=H&&H?"1":"0",sheetsAcross:I,sheetsDown:G}};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(m){}}}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(m){}0<k&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,k){var m=window.location.hash,+t=mxUtils.bind(this,function(y){var F=null!=c.data?c.data:"";null!=y&&0<y.length&&(0<F.length&&(F+="\n"),F+=y);y=new LocalFile(this,"csv"!=c.format&&0<F.length?F:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);y.getHash=function(){return m};this.fileLoaded(y);"csv"==c.format&&this.importCsv(F,mxUtils.bind(this,function(Q){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var E=null!=c.interval?+parseInt(c.interval):6E4,C=null,S=mxUtils.bind(this,function(){var Q=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(O){Q===this.currentPage&&(200<=O.getStatus()&&300>=O.getStatus()?(this.updateDiagram(O.getText()),U()):this.handleError({message:mxResources.get("error")+" "+O.getStatus()}))}),mxUtils.bind(this,function(O){this.handleError(O)}))}),U=mxUtils.bind(this,function(){window.clearTimeout(C);C=window.setTimeout(S,+E)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){U();S()}));U();S()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var x=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(x,mxUtils.bind(this,function(y){t(y)}),mxUtils.bind(this,function(y){null!=k&&k(y)}))}else t("")};EditorUi.prototype.updateDiagram=function(c){function f(g){var p=new mxCellOverlay(g.image||t.warningImage,g.tooltip,g.align,g.valign,g.offset);p.addListener(mxEvent.CLICK,function(B,K){m.alert(g.tooltip)});+return p}var k=null,m=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var t=this.editor.graph,x=t.getModel();x.beginUpdate();var y=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var F=x.getCell(c.getAttribute("id"));if(null!=F){try{var E=c.getAttribute("value");if(null!=E){var C=mxUtils.parseXml(E).documentElement;if(null!=C)if("1"==C.getAttribute("replace-value"))x.setValue(F,C);else for(var S=C.attributes,U=0;U<+S.length;U++)t.setAttributeForCell(F,S[U].nodeName,0<S[U].nodeValue.length?S[U].nodeValue:null)}}catch(g){null!=window.console&&console.log("Error in value for "+F.id+": "+g)}try{var Q=c.getAttribute("style");null!=Q&&t.model.setStyle(F,Q)}catch(g){null!=window.console&&console.log("Error in style for "+F.id+": "+g)}try{var O=c.getAttribute("icon");if(null!=O){var q=0<O.length?JSON.parse(O):null;null!=q&&q.append||t.removeCellOverlays(F);null!=q&&t.addCellOverlay(F,f(q))}}catch(g){null!=window.console&&+console.log("Error in icon for "+F.id+": "+g)}try{var u=c.getAttribute("geometry");if(null!=u){u=JSON.parse(u);var I=t.getCellGeometry(F);if(null!=I){I=I.clone();for(key in u){var G=parseFloat(u[key]);"dx"==key?I.x+=G:"dy"==key?I.y+=G:"dw"==key?I.width+=G:"dh"==key?I.height+=G:I[key]=parseFloat(u[key])}t.model.setGeometry(F,I)}}}catch(g){null!=window.console&&console.log("Error in icon for "+F.id+": "+g)}}}else if("model"==c.nodeName){for(var H=c.firstChild;null!=H&&H.nodeType!=mxConstants.NODETYPE_ELEMENT;)H=+H.nextSibling;null!=H&&(new mxCodec(c.firstChild)).decode(H,x)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(t.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))t.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(y=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{x.endUpdate()}null!=y&&this.chromelessResize&&this.chromelessResize(!0,+y)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var m=k.lastIndexOf(".");0<=m&&(c=k.substring(m),k=k.substring(0,m));if(f){f=k;var t=new Date;k=t.getFullYear();m=t.getMonth()+1;var x=t.getDate(),y=t.getHours(),F=t.getMinutes();t=t.getSeconds();k=f+(" "+(k+"-"+m+"-"+x+"-"+y+"-"+F+"-"+t))}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 m=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var t=!1;this.hideDialog();null!=m&&(m.removeListener(this.descriptorChangedListener),this.logIfModified(m,!0),m.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var x=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=m&&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();f||("0"!=urlParams.splash?this.showSplash():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});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(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));t=!0;if(!this.isOffline()&&null!=c.getMode()){var y="1"==urlParams.sketch?"sketch":uiTheme;if(null==y)y="default";else if("sketch"==y||"min"==y)y+=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_"+y})}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(F){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(F){}}catch(F){this.fileLoadedError=F;if(null!=c)try{c.close()}catch(E){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=m?this.fileLoaded(m)||v():v()});f?c():(null!=F.fallbackFileData&&(F.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,-function(){this.hideDialog();var E=new LocalFile(this,F.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(E)})}),this.handleError(F,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else v();return t};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,m=new mxGraphModel,t=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var v=0;v<c.length;v++){this.updatePageRoot(c[v]);var y=c[v].node.cloneNode(!1);y.removeAttribute("name");m.root=c[v].root;-var F=t.encode(m);this.editor.graph.saveViewState(c[v].viewState,F,!0);F.removeAttribute("pageWidth");F.removeAttribute("pageHeight");y.appendChild(F);null!=f&&(f.eltCount+=y.getElementsByTagName("*").length,f.nodeCount+=y.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(y,function(E,C,S,U){return!U||"mxGeometry"!=E.nodeName&&"mxPoint"!=E.nodeName||"x"!=C&&"y"!=C&&"width"!=C&&"height"!=C?U&&"mxCell"==E.nodeName&&"previous"==C?null:S:Math.round(S)},f)<<0}return k};EditorUi.prototype.hashValue=-function(c,f,k){var m=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(m^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var t=0;t<c.attributes.length;t++){var v=c.attributes[t].name,y=null!=f?f(c,v,c.attributes[t].value,!0):c.attributes[t].value;null!=y&&(m^=this.hashValue(v,f,k)+this.hashValue(y,f,k))}}if(null!=c.childNodes)for(t=0;t<c.childNodes.length;t++)m=-(m<<5)-m+this.hashValue(c.childNodes[t],f,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(t=0;t<c.length;t++)f=(f<<5)-f+c.charCodeAt(t)<<0;m^=f}return m};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,m,t,v,y){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&+title:c.getTitle(),mode:c.getMode()})}catch(F){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(F){}}catch(F){this.fileLoadedError=F;if(null!=c)try{c.close()}catch(E){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=m?this.fileLoaded(m)||x():x()});f?c():(null!=F.fallbackFileData&&(F.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,+function(){this.hideDialog();var E=new LocalFile(this,F.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(E)})}),this.handleError(F,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else x();return t};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,m=new mxGraphModel,t=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var x=0;x<c.length;x++){this.updatePageRoot(c[x]);var y=c[x].node.cloneNode(!1);y.removeAttribute("name");m.root=c[x].root;+var F=t.encode(m);this.editor.graph.saveViewState(c[x].viewState,F,!0);F.removeAttribute("pageWidth");F.removeAttribute("pageHeight");y.appendChild(F);null!=f&&(f.eltCount+=y.getElementsByTagName("*").length,f.nodeCount+=y.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(y,function(E,C,S,U){return!U||"mxGeometry"!=E.nodeName&&"mxPoint"!=E.nodeName||"x"!=C&&"y"!=C&&"width"!=C&&"height"!=C?U&&"mxCell"==E.nodeName&&"previous"==C?null:S:Math.round(S)},f)<<0}return k};EditorUi.prototype.hashValue=+function(c,f,k){var m=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(m^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var t=0;t<c.attributes.length;t++){var x=c.attributes[t].name,y=null!=f?f(c,x,c.attributes[t].value,!0):c.attributes[t].value;null!=y&&(m^=this.hashValue(x,f,k)+this.hashValue(y,f,k))}}if(null!=c.childNodes)for(t=0;t<c.childNodes.length;t++)m=+(m<<5)-m+this.hashValue(c.childNodes[t],f,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(t=0;t<c.length;t++)f=(f<<5)-f+c.charCodeAt(t)<<0;m^=f}return m};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,m,t,x,y){};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){null==c&&(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++)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 m=f.previousSibling;k.insertBefore(f,c);k.insertBefore(m,f)}};EditorUi.prototype.loadLibrary=function(c,f){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var m=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,m,k.documentElement.getAttribute("title"),f)}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",m=k+"Window";-if(null==this[m]){var t="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,v=c?t?330:300:240;this[m]=new FindWindow(this,document.body.offsetWidth-(v+20),100,v,c?t?304:288:180,c);this[m].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[m].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});this[m].window.setVisible(!0)}else null==f&&this[m].window.setVisible(!this[m].window.isVisible());null!=f&&(this[m].doSearch(f),-this[m].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,f,k,m){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 v=0;v<this.openLibraries.length;v++)if(this.openLibraries[v].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[v],this.openLibraries);break}t={file:c,images:f,title:k,expand:m};this.openLibraries.push(t)}else this.scratchpad=-c;v=this.sidebar.palettes[c.getHash()];v=null!=v?v[v.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var y=null,F=mxUtils.bind(this,function(G,H){0==G.length&&c.isEditable()?(null==y&&(y=document.createElement("div"),y.className="geDropTarget",mxUtils.write(y,mxResources.get("dragElementsHere"))),H.appendChild(y)):this.addLibraryEntries(G,H)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));-var E=this.sidebar.addPalette(c.getHash(),k,null!=m?m:!0,mxUtils.bind(this,function(G){F(f,G)}));null!=t&&(t.div=E);this.repositionLibrary(v,"L.scratchpad"!=c.getHash());m=E.parentNode.previousSibling;k=m.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&m.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var C=document.createElement("div");C.style.backgroundColor="inherit";m.style.position="relative";var S=document.createElement("img");S.className="geLibraryButton";S.setAttribute("src",+if(null==this[m]){var t="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=c?t?330:300:240;this[m]=new FindWindow(this,document.body.offsetWidth-(x+20),100,x,c?t?304:288:180,c);this[m].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[m].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});this[m].window.setVisible(!0)}else null==f&&this[m].window.setVisible(!this[m].window.isVisible());null!=f&&(this[m].doSearch(f),+this[m].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,f,k,m){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:k,expand:m};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 y=null,F=mxUtils.bind(this,function(G,H){0==G.length&&c.isEditable()?(null==y&&(y=document.createElement("div"),y.className="geDropTarget",mxUtils.write(y,mxResources.get("dragElementsHere"))),H.appendChild(y)):this.addLibraryEntries(G,H)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));+var E=this.sidebar.addPalette(c.getHash(),k,null!=m?m:!0,mxUtils.bind(this,function(G){F(f,G)}));null!=t&&(t.div=E);this.repositionLibrary(x,"L.scratchpad"!=c.getHash());m=E.parentNode.previousSibling;k=m.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&m.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var C=document.createElement("div");C.style.backgroundColor="inherit";m.style.position="relative";var S=document.createElement("img");S.className="geLibraryButton";S.setAttribute("src",Editor.crossImage);S.setAttribute("title",mxResources.get("close"));var U=null;if(".scratchpad"!=c.title||this.closableScratchpad)C.appendChild(S),mxEvent.addListener(S,"click",mxUtils.bind(this,function(G){if(!mxEvent.isConsumed(G)){var H=mxUtils.bind(this,function(){null!=t&&mxUtils.remove(t,this.openLibraries);this.closeLibrary(c)});null!=U?this.confirm(mxResources.get("allChangesLost"),null,H,mxResources.get("cancel"),mxResources.get("discardChanges")):H();mxEvent.consume(G)}}));if(c.isEditable()){var Q=this.editor.graph,O=null;k=mxUtils.bind(this,function(G){this.showLibraryDialog(c.getTitle(),E,f,c,c.getMode());mxEvent.consume(G)});var q=mxUtils.bind(this,function(G){c.setModified(!0);c.isAutosave()?(null!=O&&null!=O.parentNode&&O.parentNode.removeChild(O),O=S.cloneNode(!1),O.setAttribute("src",Editor.spinImage),O.setAttribute("title",mxResources.get("saving")),O.style.cursor="default",O.style.marginRight="2px",O.style.marginTop="-2px",C.insertBefore(O,C.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=O&&null!=O.parentNode&&O.parentNode.removeChild(O)})):null==U&&(U=S.cloneNode(!1),U.setAttribute("src",Editor.saveImage),U.setAttribute("title",mxResources.get("save")),C.insertBefore(U,C.firstChild),mxEvent.addListener(U,"click",mxUtils.bind(this,function(H){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==U||c.isModified()||(U.parentNode.removeChild(U),U=null)});mxEvent.consume(H)})))}),u=mxUtils.bind(this,function(G,@@ -13092,171 +13092,171 @@ Y&&(Y=Editor.extractGraphModelFromPdf(W),null!=Y&&0<Y.length&&(W=Y));if(null!=W)null!=ha&&u(la,new mxRectangle(0,0,ha.width,ha.height),G)}V=!0}catch(ca){null!=window.console&&console.log("error in drop handler:",ca)}V||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=y&&null!=y.parentNode&&0<f.length&&(y.parentNode.removeChild(y),y=null)});null!=T&&null!=N&&EditorUi.isVisioFilename(N)?this.importVisio(T,function(W){X(W,"text/xml")},null,N):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(H,N)&&null!=T?this.isExternalDataComms()?this.parseFile(T,mxUtils.bind(this,function(W){4==W.readyState&&(this.spinner.stop(),200<=W.status&&299>=W.status?X(W.responseText,"text/xml"):this.handleError({message:mxResources.get(413==W.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):X(H,g)}}));G.stopPropagation();G.preventDefault()})),mxEvent.addListener(E,"dragleave",function(G){E.style.cursor="";E.style.backgroundColor="";G.stopPropagation();G.preventDefault()}));S=S.cloneNode(!1);S.setAttribute("src",Editor.editImage);S.setAttribute("title",mxResources.get("edit"));C.insertBefore(S,C.firstChild);mxEvent.addListener(S,"click",k);k=S.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));C.insertBefore(k,C.firstChild);mxEvent.addListener(k,"click",I);".scratchpad"==c.title&&(this.addSelectionToScratchpad=I);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||-(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),k.className="geLibraryButton",C.insertBefore(k,C.firstChild))}m.appendChild(C);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var k=0;k<c.length;k++)try{var m=c[k],t=m.data;if(null!=t){t="data:"==t.substring(0,5)?this.convertDataUri(t):t;var v="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==m.aspect&&(v+="aspect=fixed;");v=v+"image="+t+";";-null!=m.style&&(v+=m.style);f.appendChild(this.sidebar.createVertexTemplate(v,m.w,m.h,"",m.title||"",!1,null,!0))}else if(null!=m.xml){var y=this.stringToCells("<"==m.xml.charAt(0)?m.xml:Graph.decompress(m.xml)),F=0==y.length?mxResources.get("drawingEmpty"):null!=m.title?m.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(y,m.w,m.h,F,!0,null,!0))}}catch(E){F=null!=E.message?mxResources.get("error")+": "+E.message:String(E),v=this.sidebar.createVertexTemplateFromCells(null,m.w,m.h,-F,!0,null,!0),f.appendChild(v)}};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,m,t,v,y){c=new ImageDialog(this,c,f,k,m,-t,v,y);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,m,t,v){var y=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=y?JSON.stringify(JSON.parse(y),null,2):"",mxUtils.bind(this,function(F){if(null!=F)try{if(null!=v&&v(F),F==y)this.hideDialog();else{if(0<F.length){var E=JSON.parse(F);localStorage.setItem(f,JSON.stringify(E))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(C){this.handleError(C)}}),-null,mxResources.get("close"),null,null,null,!0,null,null,t,k,m);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.showBackgroundImageDialog=function(c,f,k,m){c=null!=c?c:mxUtils.bind(this,function(t,v,y,F){v||(t=new ChangePageSetup(this,m?y:null,t),t.ignoreColor=!m,null!=F&&m&&(t.shadowVisible=F),this.editor.graph.model.execute(t))});c=new BackgroundImageDialog(this,c,f,k,m);this.showDialog(c.container,400,-m?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,m,t){c=new LibraryDialog(this,c,f,k,m,t);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(v){v&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var n=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=n.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,m,t,v,y){var F=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{y||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!y||null==window.console||console.error("EditorUi.handleError:",c)}catch(Q){}if(null!=+(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),k.className="geLibraryButton",C.insertBefore(k,C.firstChild))}m.appendChild(C);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var k=0;k<c.length;k++)try{var m=c[k],t=m.data;if(null!=t){t="data:"==t.substring(0,5)?this.convertDataUri(t):t;var x="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==m.aspect&&(x+="aspect=fixed;");x=x+"image="+t+";";+null!=m.style&&(x+=m.style);f.appendChild(this.sidebar.createVertexTemplate(x,m.w,m.h,"",m.title||"",!1,null,!0))}else if(null!=m.xml){var y=this.stringToCells("<"==m.xml.charAt(0)?m.xml:Graph.decompress(m.xml)),F=0==y.length?mxResources.get("drawingEmpty"):null!=m.title?m.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(y,m.w,m.h,F,!0,null,!0))}}catch(E){F=null!=E.message?mxResources.get("error")+": "+E.message:String(E),x=this.sidebar.createVertexTemplateFromCells(null,m.w,m.h,+F,!0,null,!0),f.appendChild(x)}};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,m,t,x,y){c=new ImageDialog(this,c,f,k,m,+t,x,y);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,m,t,x){var y=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=y?JSON.stringify(JSON.parse(y),null,2):"",mxUtils.bind(this,function(F){if(null!=F)try{if(null!=x&&x(F),F==y)this.hideDialog();else{if(0<F.length){var E=JSON.parse(F);localStorage.setItem(f,JSON.stringify(E))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(C){this.handleError(C)}}),+null,mxResources.get("close"),null,null,null,!0,null,null,t,k,m);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.showBackgroundImageDialog=function(c,f,k,m){c=null!=c?c:mxUtils.bind(this,function(t,x,y,F){x||(t=new ChangePageSetup(this,m?y:null,t),t.ignoreColor=!m,null!=F&&m&&(t.shadowVisible=F),this.editor.graph.model.execute(t))});c=new BackgroundImageDialog(this,c,f,k,m);this.showDialog(c.container,400,+m?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,m,t){c=new LibraryDialog(this,c,f,k,m,t);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(x){x&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var n=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=n.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,m,t,x,y){var F=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{y||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!y||null==window.console||console.error("EditorUi.handleError:",c)}catch(Q){}if(null!=E||null!=f){y=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var C=mxResources.get("ok"),S=null;f=null!=f?f:mxResources.get("error");if(null!=E){null!=E.retry&&(C=mxResources.get("cancel"),S=function(){F();E.retry()});if(404==E.code||404==E.status||403==E.code){y=403==E.code?null!=E.message?mxUtils.htmlEntities(E.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=t?t:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?-" ("+this.drive.user.email+")":""),!1);var U=null!=t?null:null!=v?v: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,+" ("+this.drive.user.email+")":""),!1);var U=null!=t?null:null!=x?x: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,y,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+U);null!=m&&m()}),S,mxResources.get("changeUser"),mxUtils.bind(this,function(){function Q(){I.innerText="";for(var G=0;G<O.length;G++){var H=document.createElement("option");mxUtils.write(H,O[G].displayName);H.value=G;I.appendChild(H);H=document.createElement("option");H.innerHTML=" ";mxUtils.write(H,"<"+O[G].email+">");H.setAttribute("disabled","disabled");I.appendChild(H)}H=document.createElement("option");mxUtils.write(H,mxResources.get("addAccount"));H.value=O.length;I.appendChild(H)}var O=this.drive.getUsersList(),q=document.createElement("div"),u=document.createElement("div");u.style.marginBottom="6px";mxUtils.write(u,mxResources.get("changeUser")+": ");q.appendChild(u);var I=document.createElement("select");I.style.width="100%";Q();mxEvent.addListener(I,"change",mxUtils.bind(this,function(){var G=I.value,H=O.length!=G;H&&this.drive.setUser(O[G]);this.drive.authorize(H,mxUtils.bind(this,function(){H||(O=this.drive.getUsersList(),Q())}),mxUtils.bind(this,function(g){this.handleError(g)}),!0)}));q.appendChild(I);q=new CustomDialog(this,q,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(q.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=E.message?y=""==E.message&&null!=E.name?mxUtils.htmlEntities(E.name,!1):mxUtils.htmlEntities(E.message,!1):null!=E.response&&null!=E.response.error?y=mxUtils.htmlEntities(E.response.error,!1):"undefined"!==typeof window.App&&(E.code==App.ERROR_TIMEOUT?y=mxUtils.htmlEntities(mxResources.get("timeout"),!1):E.code==App.ERROR_BUSY?y=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof E&&0<E.length&&(y=mxUtils.htmlEntities(E,!1)))}t=c=null;null!=E&&null!=E.helpLink?(c=mxResources.get("help"),t=mxUtils.bind(this,function(){return this.editor.graph.openLink(E.helpLink)})):null!=E&&null!=E.ownerEmail?(c=mxResources.get("contactOwner"),y+=mxUtils.htmlEntities(" ("+c+": "+E.ownerEmail+")",!1),t=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(E.ownerEmail))})):null!=E&&null!=E.alternateAction&&(c=E.alternateAction.label,t=E.alternateAction.funct);this.showError(f,y,C,k,S,null,null,c,t,null,null,null,m?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,m,t,v){c=null!=c?c:"";var y=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},F=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){y();null!=f&&f()},function(){y();null!=k&&k()},m,t,null,null,null,null,F);this.showDialog(c.container,340,46+F,!0,v);c.init()};EditorUi.prototype.showBanner=function(c,f,k,m,t,v,y,F,E){v=!1;if(!(this.bannerShowing||this["hideBanner"++k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,m,t,x){c=null!=c?c:"";var y=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},F=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){y();null!=f&&f()},function(){y();null!=k&&k()},m,t,null,null,null,null,F);this.showDialog(c.container,340,46+F,!0,x);c.init()};EditorUi.prototype.showBanner=function(c,f,k,m,t,x,y,F,E){x=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){y=null!=y?y:"translate(-50%,120%)";F=null!=F?F:"translate(-50%,0%)";var C=document.createElement("div");C.className="geBtn gePrimaryBtn geBanner"+(t?" geSmallBanner":"");C.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(C.style,"transform",y);mxUtils.setPrefixedStyle(C.style,"transition","all 1000ms ease");null!=E&&mxUtils.setPrefixedStyle(C.style,"transform-origin",E);E=E=document.createElement("img");-E.setAttribute("src",Editor.crossImage);E.setAttribute("title",mxResources.get(m?"doNotShowAgain":"close"));E.setAttribute("border","0");t||(v=document.createElement("img"),v.setAttribute("src",IMAGE_PATH+"/logo.png"),v.setAttribute("border","0"),v.setAttribute("align","absmiddle"),v.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",C.appendChild(v),E.style.cssText=(t?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",+E.setAttribute("src",Editor.crossImage);E.setAttribute("title",mxResources.get(m?"doNotShowAgain":"close"));E.setAttribute("border","0");t||(x=document.createElement("img"),x.setAttribute("src",IMAGE_PATH+"/logo.png"),x.setAttribute("border","0"),x.setAttribute("align","absmiddle"),x.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",C.appendChild(x),E.style.cssText=(t?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",C.appendChild(E));mxUtils.write(C,f);document.body.appendChild(C);this.bannerShowing=!0;t&&(E.className="geLibraryButton",C.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 S=document.createElement("input");S.setAttribute("type","checkbox");S.setAttribute("id","geDoNotShowAgainCheckbox");S.style.marginRight="6px";if(!m){f.appendChild(S);var U=document.createElement("label");U.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(U,mxResources.get("doNotShowAgain"));f.appendChild(U);C.style.paddingBottom=t?"16px":"30px";C.appendChild(f)}var Q=mxUtils.bind(this,function(){null!=C.parentNode&&(C.parentNode.removeChild(C),this.bannerShowing=!1,S.checked||m)&&(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(q){mxEvent.consume(q);-Q()}));var O=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(C.style,"transform",y);window.setTimeout(mxUtils.bind(this,function(){Q()}),1E3)});mxEvent.addListener(C,"click",mxUtils.bind(this,function(q){var u=mxEvent.getSource(q);u!=S&&u!=U?(null!=k&&k(),Q(),mxEvent.consume(q)):O()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(C.style,"transform",F)}),500);window.setTimeout(O,t?5E3:3E4);v=!0}return v};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,m){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<m&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",m));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,m,t){var v="jpeg"==k?"jpg":k;m=this.getBaseFilename(m)+-(null!=f?".drawio":"")+"."+v;c=this.createImageDataUri(c,f,k,t);this.saveData(m,v,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||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,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,m,t,v){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=v?v:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=m?this.base64ToBlob(c,k):new Blob([c],{type:k}),navigator.msSaveOrOpenBlob(c,f);else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==-k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,m);else{var y=document.createElement("a");v=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof y.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var F=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);v=65==(F?parseInt(F[2],10):!1)?!1:v}if(v||this.isOffline()){y.href=URL.createObjectURL(m?this.base64ToBlob(c,k):new Blob([c],{type:k}));v?y.download=f:y.setAttribute("target",-"_blank");document.body.appendChild(y);try{window.setTimeout(function(){URL.revokeObjectURL(y.href)},2E4),y.click(),y.parentNode.removeChild(y)}catch(E){}}else this.createEchoRequest(c,f,k,m,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,m,t,v){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=k?"&mime="+k:"")+(null!=t?"&format="+t:"")+(null!=v?"&base64="+v:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(m?"&binary=1":""))};EditorUi.prototype.saveLocalFile=-function(c,f,k,m,t,v,y,F,E){v=null!=v?v:!1;y=null!=y?y:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);var C=mxUtils.bind(this,function(U,Q,O,q){try{if("_blank"==Q)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,m);else if(null!=k&&"text/html"==k.substring(0,9)){var u=new EmbedDialog(this,c);this.showDialog(u.container,450,240,!0,!0);u.init()}else{var I=window.open("about:blank");null==I?mxUtils.popup(c,!0):(I.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),I.document.close())}else if(Q==-App.MODE_DEVICE||"download"==Q)this.doSaveLocalFile(c,U,k,m,null,F);else if(null!=U&&0<U.length){var G=mxUtils.bind(this,function(H){try{this.exportFile(c,U,k,m,Q,H)}catch(g){this.handleError(g)}});null!=q?G(q):this.pickFolder(Q,G)}}catch(H){this.handleError(H)}});t=[];v||t.push(App.MODE_BROWSER);y||t.push("_blank");var S=new SaveDialog(this,f,mxUtils.bind(this,function(U,Q,O){C(U.value,Q,U,O);this.hideDialog(null,null,S.container)}),t,c,k,m,E);this.showDialog(S.container,420,110,!0,!1,mxUtils.bind(this,-function(){this.hideDialog()}));S.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){var m=window.open("about:blank");if(null==m||null==m.document)mxUtils.popup(c,!0);else{var t="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==f){var v=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=v&&(t="background: "+v+";")}t='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+t+'">';"image/svg+xml"!=f||mxClient.IS_SVG?"image/svg+xml"!=-f||k?(v=k?c:btoa(unescape(encodeURIComponent(c))),m.document.write(t+'<img style="max-width:100%;" src="data:'+f+";base64,"+v+'"/></body></html>')):m.document.write(t+c+"</body></html>"):m.document.write(t+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");m.document.close()}};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){this.tagsDialog=this.tagsComponent=null;var f=c(mxUtils.bind(this,function(m){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 t=f.getBoundingClientRect();this.tagsDialog.style.left=t.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";t=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=t.zIndex;document.body.appendChild(this.tagsDialog);-this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(m)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var m=this.editor.graph.getAllTags();f.style.display=0<m.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()){this.exportDialog=null;var k=c(mxUtils.bind(this,function(m){var t=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",t);null!=this.exportDialog&&-(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)t.apply(this);else{this.exportDialog=document.createElement("div");var v=k.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 y=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});y.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",t);this.editor.exportToCanvas(mxUtils.bind(this,function(F){y.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var E=this.createImageDataUri(F,null,"png");F=document.createElement("img");F.style.maxWidth="140px";F.style.maxHeight="140px";-F.style.cursor="pointer";F.style.backgroundColor="white";F.setAttribute("title",mxResources.get("openInNewWindow"));F.setAttribute("border","0");F.setAttribute("src",E);this.exportDialog.appendChild(F);mxEvent.addListener(F,"click",mxUtils.bind(this,function(){this.openInNewWindow(E.substring(E.indexOf(",")+1),"image/png",!0);t.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(F){y.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),-this.exportDialog=null);this.handleError(F)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(m)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,m,t,v){this.isLocalFileSave()?this.saveLocalFile(k,c,m,t,f,v):this.saveRequest(c,f,mxUtils.bind(this,function(y,F){return this.createEchoRequest(k,y,m,t,f,F)}),k,t,m)};EditorUi.prototype.saveRequest=function(c,f,k,m,t,v,y){y=null!=y?y:!mxClient.IS_IOS||!navigator.standalone;var F=mxUtils.bind(this,-function(C,S,U,Q){if("_blank"==S||null!=C&&0<C.length){var O=k("_blank"==S?null:C,S==App.MODE_DEVICE||"download"==S||null==S||"_blank"==S?"0":"1");null!=O&&(S==App.MODE_DEVICE||"download"==S||"_blank"==S?O.simulate(document,"_blank"):(U=mxUtils.bind(this,function(q){v=null!=v?v:"pdf"==f?"application/pdf":"image/"+f;if(null!=m)try{this.exportFile(m,C,v,!0,S,q)}catch(u){this.handleError(u)}else this.spinner.spin(document.body,mxResources.get("saving"))&&O.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=O.getStatus()&&299>=O.getStatus())try{this.exportFile(O.getText(),C,v,!0,S,q)}catch(u){this.handleError(u)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u)}))}),null!=Q?U(Q):this.pickFolder(S,U)))}});t=[App.MODE_BROWSER];y||t.push("_blank");var E=new SaveDialog(this,c,mxUtils.bind(this,function(C,S,U){F(C.value,S,C,U);this.hideDialog(null,null,E.container)}),t,null,"application/pdf");this.showDialog(E.container,-420,110,!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,m,t,v){};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,m,t,v,-y,F,E,C,S,U,Q,O){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(W){Editor.addRetryToError(W,mxUtils.bind(this,function(){this.exportSvg(c,f,k,m,t,v,y,F,E,C,S,U,Q,O)}));this.handleError(W)})))try{var q=this.editor.graph.isSelectionEmpty();k=null!=k?k:q;var u=f?null:this.editor.graph.background;u==mxConstants.NONE&&(u=null);null==u&&0==f&&(u=this.editor.graph.shapeBackgroundColor);var I=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&-(this.editor.graph.addForeignObjectWarning=function(){});var G=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==S||"dark"==S)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==S;var g=Graph.addFont,p={};Graph.addFont=function(W,Y,Z,aa){g.call(this,W,Y,Z,p)};var B=this.editor.graph.createSvgImageExport(t),K=B.drawCellState;B.drawCellState=function(W,Y){null!=W&&Graph.processFontStyle(W.style);K.apply(this,arguments)};var M=this.editor.graph.getSvg(u,c,y,F,null,-k,null,B,"blank"==C?"_blank":"self"==C?"_top":null,null,!Q,S,U);mxUtils.lightDarkColorSupported=G;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=I;m&&this.editor.graph.addSvgShadow(M);var N=this.getBaseFilename()+(t?".drawio":"")+".svg";O=null!=O?O:mxUtils.bind(this,function(W){this.isLocalFileSave()||W.length<=MAX_REQUEST_SIZE?this.saveData(N,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(W)}))});-var R=mxUtils.bind(this,function(W){this.spinner.stop();t&&W.setAttribute("content",this.getFileData(!0,null,null,null,k,E,null,null,null,null,null,c,y));O(Graph.xmlDeclaration+"\n"+(t?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(W))});this.editor.graph.mathEnabled&&this.editor.addMathCss(M);var T=mxUtils.bind(this,function(W){Editor.replaceSvgDataUris&&v&&EditorUi.embedSvgImages(W);Editor.foreignObjectImages&&Q?this.replaceAlternateContent(W,S,R):R(W)}),V=Graph.customFontElements;-Graph.customFontElements=p;var X=mxUtils.bind(this,function(W){Graph.customFontElements=V;Graph.addFont=g;v&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(W,T,this.thumbImageCache)):T(W)});Q?this.embedFonts(M,X):(this.editor.addFontCss(M),X(M))}catch(W){this.handleError(W)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function m(U,Q,O,q,u){var I=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");-I.setAttribute("x",Q);I.setAttribute("y",O+.5);I.setAttribute("width",q.width);I.setAttribute("height",q.height);null==I.setAttributeNS?I.setAttribute("xlink:href",u):I.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",u);U.replaceChild(I,U.lastChild);F()}function t(){if(y<S.length)S[y++](t)}var v="";f=c.getElementsByTagName("style");for(var y=0;y<f.length;y++)v+=f[y].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var F=mxUtils.bind(this,function(){counter--;0==counter&&k(c)}),E={},-C={},S=[];for(y=0;y<f.length;y++)mxUtils.bind(this,function(U){var Q=U.getElementsByTagName("div");if(0<Q.length)try{var O=Q[0].cloneNode(!0),q=parseInt(O.style.marginLeft),u=parseInt(O.style.paddingTop),I=O.getElementsByTagName("div")[1],G=Q=!1,H=O.style.alignItems,g=O.style.justifyContent;if(null!=O.style.writingMode){var p=O.style.writingMode;G="vertical-"==p.substring(0,9);Q="-rl"==p.substring(p.length-3)}var B=!G&&"1px"==O.style.width||G&&"1px"==O.style.height;if(!G&&"1px"==O.style.height||G&&-"1px"==O.style.width)O.style.alignItems=G&&Q?"unsafe flex-end":"unsafe flex-start";B&&(O.style.justifyContent="unsafe flex-start");O.style.paddingTop="";O.style.marginLeft="";var K=O.outerHTML,M=E[K];null==M&&(O.style.position="absolute",O.style.visibility="hidden",document.body.appendChild(O),p=1,p="1px"==O.style.width?I.offsetWidth:parseInt(O.style.width),B=1,B="1px"==O.style.height?I.offsetHeight:parseInt(O.style.height),document.body.removeChild(O),M=new mxRectangle(q,u,p,B),E[K]=M);"1px"==O.style.height&&-("unsafe center"==H?u-=M.height/2:"unsafe flex-end"==H&&(u-=M.height));if("1px"==O.style.width)if(!G&&"unsafe center"==g||G&&"unsafe center"==H)q-=M.width/2;else if(!G&&"unsafe flex-end"==g||G&&(!Q&&"unsafe flex-end"==H||Q&&"unsafe flex-start"==H))q-=M.width;M=new mxRectangle(q,u,M.width,M.height+parseInt(I.style.fontSize)/4);S.push(mxUtils.bind(this,function(N){var R=C[K];null==R?Graph.htmlToPng(K,M.width,M.height,mxUtils.bind(this,function(T){m(U,q,u,M,T);C[K]=T;N()}),v):(m(U,q,u,M,R),N())}))}catch(N){F()}else F()})(f[y]);-0==counter&&k(c);y=0;t()};EditorUi.prototype.addRadiobox=function(c,f,k,m,t,v,y){return this.addCheckbox(c,k,m,t,v,y,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,m,t,v,y,F){v=null!=v?v:!0;var E=document.createElement("input");E.style.marginRight="8px";E.style.marginTop="16px";E.setAttribute("type",y?"radio":"checkbox");y="geCheckbox-"+Editor.guid();E.id=y;null!=F&&E.setAttribute("name",F);k&&(E.setAttribute("checked","checked"),E.defaultChecked=!0);m&&E.setAttribute("disabled","disabled");-v&&(c.appendChild(E),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",y),c.appendChild(k),t||mxUtils.br(c));return E};EditorUi.prototype.addEditButton=function(c,f){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var m=this.getCurrentFile(),t="";null!=m&&m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER&&(t=window.location.href);var v=document.createElement("select");v.style.maxWidth="200px";v.style.width="auto";v.style.marginLeft=-"8px";v.style.marginRight="10px";v.className="geBtn";m=document.createElement("option");m.setAttribute("value","blank");mxUtils.write(m,mxResources.get("makeCopy"));v.appendChild(m);var y=document.createElement("option");y.setAttribute("value","custom");mxUtils.write(y,mxResources.get("custom")+"...");v.appendChild(y);c.appendChild(v);mxEvent.addListener(v,"change",mxUtils.bind(this,function(){if("custom"==v.value){var F=new FilenameDialog(this,t,mxResources.get("ok"),function(E){null!=E?(t=E,y.setAttribute("title",-E)):(v.value="blank",y.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){v.value="blank"});this.showDialog(F.container,300,80,!0,!1);F.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==f||f.checked)?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?"blank"===v.value?"_blank":t:null},getEditInput:function(){return k},getEditSelect:function(){return v}}};-EditorUi.prototype.addLinkSection=function(c,f){function k(){var F=document.createElement("div");F.style.width="100%";F.style.height="100%";F.style.boxSizing="border-box";null!=v&&v!=mxConstants.NONE?(F.style.border="1px solid black",F.style.backgroundColor=v):(F.style.backgroundPosition="center center",F.style.backgroundRepeat="no-repeat",F.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");y.innerText="";y.appendChild(F)}mxUtils.write(c,mxResources.get("links")+":");var m=document.createElement("select");-m.style.width="100px";m.style.padding="0px";m.style.marginLeft="8px";m.style.marginRight="10px";m.className="geBtn";var t=document.createElement("option");t.setAttribute("value","auto");mxUtils.write(t,mxResources.get("automatic"));m.appendChild(t);t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("openInNewWindow"));m.appendChild(t);t=document.createElement("option");t.setAttribute("value","self");mxUtils.write(t,mxResources.get("openInThisWindow"));-m.appendChild(t);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),m.appendChild(f));c.appendChild(m);mxUtils.write(c,mxResources.get("borderColor")+":");var v="#0000ff",y=null;y=mxUtils.button("",mxUtils.bind(this,function(F){this.pickColor(v||"none",function(E){v=E;k()});mxEvent.consume(F)}));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=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";y.className="geColorBtn";c.appendChild(y);mxUtils.br(c);return{getColor:function(){return v},getTarget:function(){return m.value},focus:function(){m.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,m,t,v){v=null!=v?v:[];k&&(v.push("lightbox=1"),"auto"!=c&&v.push("target="+c),null!=f&&f!=mxConstants.NONE&&v.push("highlight="+("#"==f.charAt(0)?f.substring(1):-f)),null!=m&&0<m.length&&v.push("edit="+encodeURIComponent(m)),t&&v.push("layers=1"),this.editor.graph.foldingEnabled&&v.push("nav=1"));return v};EditorUi.prototype.createLink=function(c,f,k,m,t,v,y,F,E,C,S,U,Q){var O=this.getCurrentFile();E=this.createUrlParameters(c,f,m,t,v,E);c=!0;null!=y?k="#U"+encodeURIComponent(y):F||null==O||""==O.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=-"#"+O.getHash(),c=!1);c&&null!=O&&null!=O.getTitle()&&O.getTitle()!=this.defaultFilename&&E.push("title="+encodeURIComponent(O.getTitle()));C&&1<k.length&&(E.push("open="+k.substring(1)),k="");S&&null!=this.currentPage&&E.push("page-id="+this.currentPage.getId());U&&E.push("transparent=1");null!=Q&&E.push("dark="+Q);return(m&&(null!=y||null!=O&&O.getMode()!=App.MODE_GITHUB&&O.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,m,t,v,y,F,E,C,S,U,Q){this.getBasenames();var O={};""!=t&&t!=mxConstants.NONE&&(O.highlight=t);"auto"!==m&&(O.target=m);C||(O.lightbox=!1);O.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(O.zoom=k/100);k=[];y&&(k.push("pages"),O.resize=!0,null!=this.pages&&null!=this.currentPage&&(O.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),-O.resize=!0);F&&k.push("layers");E&&k.push("tags");null!=Q&&(O["dark-mode"]=Q);0<k.length&&(C&&k.push("lightbox"),O.toolbar=k.join(" "));null!=S&&0<S.length&&(O.edit=S);null!=c?O.url=c:O.xml=this.getFileData(!0,null,null,null,null,!y);f='<div class="mxgraph" style="'+(v?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(O))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";U(f,'<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.showHtmlDialog=function(c,f,k,m){var t=document.createElement("div");t.style.whiteSpace="nowrap";var v=document.createElement("h3");mxUtils.write(v,mxResources.get("html"));v.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";-t.appendChild(v);var y=document.createElement("div");y.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var F=document.createElement("input");F.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";F.setAttribute("value","url");F.setAttribute("type","radio");F.setAttribute("name","type-embedhtmldialog");v=F.cloneNode(!0);v.setAttribute("value","copy");y.appendChild(v);var E=document.createElement("span");mxUtils.write(E,mxResources.get("includeCopyOfMyDiagram"));-y.appendChild(E);mxUtils.br(y);y.appendChild(F);E=document.createElement("span");mxUtils.write(E,mxResources.get("publicDiagramUrl"));y.appendChild(E);var C=this.getCurrentFile();null==k&&null!=C&&C.constructor==window.DriveFile&&(E=document.createElement("a"),E.style.paddingLeft="12px",E.style.color="gray",E.style.cursor="pointer",mxUtils.write(E,mxResources.get("share")),y.appendChild(E),mxEvent.addListener(E,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(C.getId(),-C)})));v.setAttribute("checked","checked");null==k&&F.setAttribute("disabled","disabled");t.appendChild(y);y=380;var S=this.addLinkSection(t),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginTop="16px";E=document.createElement("option");E.setAttribute("value","light");mxUtils.write(E,mxResources.get("light"));U.appendChild(E);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,mxResources.get("dark"));U.appendChild(E);-E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));E.setAttribute("selected","selected");U.appendChild(E);E.setAttribute("selected","selected");mxUtils.write(t,mxResources.get("appearance")+":");t.appendChild(U);mxUtils.br(t);y+=26;var Q=this.addCheckbox(t,mxResources.get("zoom"),!0,null,!0);mxUtils.write(t,":");var O=document.createElement("input");O.setAttribute("type","text");O.style.marginRight="16px";O.style.width="60px";O.style.marginLeft=-"4px";O.style.marginRight="12px";O.value="100%";t.appendChild(O);var q=this.addCheckbox(t,mxResources.get("fit"),!0);E=null!=this.pages&&1<this.pages.length;var u=u=this.addCheckbox(t,mxResources.get("allPages"),E,!E),I=this.addCheckbox(t,mxResources.get("layers"),!0),G=this.addCheckbox(t,mxResources.get("tags"),!0),H=this.addCheckbox(t,mxResources.get("lightbox"),!0),g=null;if(EditorUi.enableHtmlEditOption){g=this.addEditButton(t,H);var p=g.getEditInput();p.style.marginBottom="16px";y+=50;mxEvent.addListener(H,-"change",function(){H.checked?p.removeAttribute("disabled"):p.setAttribute("disabled","disabled");p.checked&&H.checked?g.getEditSelect().removeAttribute("disabled"):g.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,t,mxUtils.bind(this,function(){m(F.checked?k:null,Q.checked,O.value,S.getTarget(),S.getColor(),q.checked,u.checked,I.checked,G.checked,H.checked,null!=g?g.getLink():null,null!=U?U.value:null)}),null,c,f);this.showDialog(c.container,340,y,!0,!0);v.focus()};-EditorUi.prototype.showPublishLinkDialog=function(c,f,k,m,t,v,y,F,E,C,S,U){var Q=document.createElement("div");Q.style.whiteSpace="nowrap";var O=document.createElement("h3");mxUtils.write(O,c||mxResources.get("publish"));O.style.width="100%";O.style.textAlign="center";O.style.marginTop="2px";O.style.marginBottom="20px";Q.appendChild(O);var q=document.createElement("select");c=30;q.className="geBtn";q.style.marginBottom="8px";q.style.marginLeft="0px";q.style.width="100%";q.style.boxSizing="border-box";-if(null==F||""==F.getHash())t=null!=t?t:"https://www.drawio.com/doc/faq/publish-diagram-as-link",O=document.createElement("option"),mxUtils.write(O,mxResources.get("makeCopy")),O.setAttribute("value","copy"),q.appendChild(O);O=document.createElement("option");mxUtils.write(O,mxResources.get("authorizationRequired"));O.setAttribute("value","auth");q.appendChild(O);null!=F&&""!=F.getHash()||O.setAttribute("disabled","disabled");F=document.createElement("option");F.setAttribute("value","public");q.appendChild(F);-null!=y?(mxUtils.write(F,mxResources.get("publicDiagramUrl")),F.setAttribute("title",y),q.value="public"):(mxUtils.write(F,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),F.setAttribute("disabled","disabled"));Q.appendChild(q);mxUtils.br(Q);q.focus();var u=null,I=null;if(null!=f||null!=k)c+=30,mxUtils.write(Q,mxResources.get("width")+":"),u=document.createElement("input"),u.setAttribute("type","text"),u.style.marginRight="16px",u.style.width="50px",u.style.marginLeft=-"6px",u.style.marginRight="16px",u.style.marginBottom="10px",u.value="100%",Q.appendChild(u),mxUtils.write(Q,mxResources.get("height")+":"),I=document.createElement("input"),I.setAttribute("type","text"),I.style.width="50px",I.style.marginLeft="6px",I.style.marginBottom="10px",I.value=k+"px",Q.appendChild(I),mxUtils.br(Q);var G=this.addLinkSection(Q,m),H=C?this.addCheckbox(Q,mxResources.get("transparentBackground"),!1):null;null!=H&&(c+=20);var g=document.createElement("select");g.className="geBtn";-g.style.marginTop="8px";f=document.createElement("option");mxUtils.write(f,mxResources.get("allPages"));f.setAttribute("value","allPages");g.appendChild(f);f=document.createElement("option");mxUtils.write(f,mxResources.get("currentPage"));f.setAttribute("value","currentPage");g.appendChild(f);var p=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,f=null!=this.currentPage?this.currentPage.getName():"",16<f.length&&(f=f.substring(0,16)+"..."),U&&(mxUtils.write(Q,-mxResources.get("pages")+":"),Q.appendChild(g),mxUtils.br(Q),c+=30),p=this.addCheckbox(Q,mxResources.get("selectedPage")+": "+f));var B=document.createElement("select");B.style.maxWidth="260px";B.style.marginLeft="8px";B.style.marginTop="16px";U=document.createElement("option");U.setAttribute("value","0");mxUtils.write(U,mxResources.get("light"));B.appendChild(U);U=document.createElement("option");U.setAttribute("value","1");mxUtils.write(U,mxResources.get("dark"));B.appendChild(U);U=document.createElement("option");-U.setAttribute("value","auto");mxUtils.write(U,mxResources.get("automatic"));U.setAttribute("selected","selected");B.appendChild(U);S&&(mxUtils.write(Q,mxResources.get("appearance")+":"),Q.appendChild(B),mxUtils.br(Q),c+=30);var K=this.addCheckbox(Q,mxResources.get("lightbox"),!0,null,null,!m),M=this.addEditButton(Q,K),N=M.getEditInput();m&&(N.style.marginLeft=K.style.marginLeft,K.style.display="none",c-=20);var R=this.addCheckbox(Q,mxResources.get("layers"),!0);R.style.marginLeft=N.style.marginLeft;-R.style.marginTop="8px";var T=this.addCheckbox(Q,mxResources.get("tags"),!0);T.style.marginLeft=N.style.marginLeft;T.style.marginBottom="16px";T.style.marginTop="16px";mxEvent.addListener(K,"change",function(){K.checked?(R.removeAttribute("disabled"),N.removeAttribute("disabled"),T.removeAttribute("disabled")):(R.setAttribute("disabled","disabled"),N.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"));N.checked&&K.checked?M.getEditSelect().removeAttribute("disabled"):M.getEditSelect().setAttribute("disabled",-"disabled")});m=new CustomDialog(this,Q,mxUtils.bind(this,function(){E(G.getTarget(),G.getColor(),null==p?!1:p.checked,K.checked,M.getLink(),R.checked,null!=u?u.value:null,null!=I?I.value:null,T.checked,q.value,null!=H?H.checked:!1,B.value,"allPages"==g.value)}),null,mxResources.get("create"),t,v);this.showDialog(m.container,340,296+c,!0,!0);null!=u?(u.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?u.select():document.execCommand("selectAll",!1,null)):null==q.parentNode;G.focus()};-EditorUi.prototype.showRemoteExportDialog=function(c,f,k,m,t){var v=document.createElement("div");v.style.whiteSpace="nowrap";var y=document.createElement("h3");mxUtils.write(y,mxResources.get("image"));y.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(t?"10":"4")+"px";v.appendChild(y);if(t){mxUtils.write(v,mxResources.get("zoom")+":");var F=document.createElement("input");F.setAttribute("type","text");F.style.marginRight="16px";F.style.width="60px";F.style.marginLeft=-"4px";F.style.marginRight="12px";F.value=this.lastExportZoom||"100%";v.appendChild(F);mxUtils.write(v,mxResources.get("borderWidth")+":");var E=document.createElement("input");E.setAttribute("type","text");E.style.marginRight="16px";E.style.width="60px";E.style.marginLeft="4px";E.value=this.lastExportBorder||"0";v.appendChild(E);mxUtils.br(v)}var C=this.addCheckbox(v,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),S=m?null:this.addCheckbox(v,mxResources.get("includeCopyOfMyDiagram"),-Editor.defaultIncludeDiagram);y=this.editor.graph;var U=m?null:this.addCheckbox(v,mxResources.get("transparentBackground"),y.background==mxConstants.NONE||null==y.background);null!=U&&(U.style.marginBottom="16px");c=new CustomDialog(this,v,mxUtils.bind(this,function(){var Q=parseInt(F.value)/100||1,O=parseInt(E.value)||0;k(!C.checked,null!=S?S.checked:!1,null!=U?U.checked:!1,Q,O)}),null,c,f);this.showDialog(c.container,300,(t?25:0)+(m?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,-f,k,m,t,v,y,F,E){y=null!=y?y:Editor.defaultIncludeDiagram;var C=document.createElement("div");C.style.whiteSpace="nowrap";var S=this.editor.graph,U="jpeg"==F||"webp"==F?220:320,Q=document.createElement("h3");mxUtils.write(Q,c);Q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";C.appendChild(Q);mxUtils.write(C,mxResources.get("zoom")+":");var O=document.createElement("input");O.setAttribute("type","text");O.style.marginRight="16px";O.style.width="60px";O.style.marginLeft=-"4px";O.style.marginRight="12px";O.value=this.lastExportZoom||"100%";C.appendChild(O);mxUtils.write(C,mxResources.get("borderWidth")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.value=this.lastExportBorder||"0";C.appendChild(q);mxUtils.br(C);var u=this.addCheckbox(C,mxResources.get("selectionOnly"),!1,S.isSelectionEmpty()),I=document.createElement("input");I.style.marginTop="16px";I.style.marginRight=-"8px";I.style.marginLeft="24px";I.setAttribute("disabled","disabled");I.setAttribute("type","checkbox");var G=document.createElement("select");G.style.marginTop="16px";G.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(Q=0;Q<c.length;Q++)if(!S.isSelectionEmpty()||"selectionOnly"!=c[Q]){var H=document.createElement("option");mxUtils.write(H,mxResources.get(c[Q]));H.setAttribute("value",c[Q]);G.appendChild(H)}E?(mxUtils.write(C,mxResources.get("size")+":"),C.appendChild(G),mxUtils.br(C),-U+=26,mxEvent.addListener(G,"change",function(){"selectionOnly"==G.value&&(u.checked=!0)})):v&&(C.appendChild(I),mxUtils.write(C,mxResources.get("crop")),mxUtils.br(C),U+=30,mxEvent.addListener(u,"change",function(){u.checked?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")}));S.isSelectionEmpty()?E&&(u.style.display="none",u.nextSibling.style.display="none",u.nextSibling.nextSibling.style.display="none",U-=30):(G.value="diagram",I.setAttribute("checked","checked"),I.defaultChecked=-!0,mxEvent.addListener(u,"change",function(){G.value=u.checked?"selectionOnly":"diagram"}));var g=this.addCheckbox(C,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=F&&"webp"!=F),p=document.createElement("select");p.style.maxWidth="260px";p.style.marginLeft="8px";p.style.marginTop="16px";v=document.createElement("option");v.setAttribute("value","light");mxUtils.write(v,mxResources.get("light"));p.appendChild(v);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,-mxResources.get("dark"));p.appendChild(E);"svg"==F&&mxUtils.lightDarkColorSupported?(v=document.createElement("option"),v.setAttribute("value","auto"),mxUtils.write(v,mxResources.get("automatic")),v.setAttribute("selected","selected"),p.appendChild(v)):Editor.isDarkMode()?E.setAttribute("selected","selected"):v.setAttribute("selected","selected");mxUtils.write(C,mxResources.get("appearance")+":");C.appendChild(p);mxUtils.br(C);U+=26;var B=this.addCheckbox(C,mxResources.get("shadow"),S.shadowVisible),-K=null;if("png"==F||"jpeg"==F||"webp"==F)K=this.addCheckbox(C,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),U+=30;S=null!=this.pages?this.pages.length:1;var M=this.addCheckbox(C,mxResources.get("includeCopyOfMyDiagram")+(1<S?":":""),y,null,null,"jpeg"!=F&&"webp"!=F),N=document.createElement("select");N.style.maxWidth="260px";N.style.marginLeft="28px";"png"==F||"svg"==F?(y=function(){M.checked?N.removeAttribute("disabled"):N.setAttribute("disabled","disabled")},v=document.createElement("option"),-v.setAttribute("value","allPages"),mxUtils.write(v,mxResources.get("allPages")),N.appendChild(v),v=document.createElement("option"),v.setAttribute("value","currentPage"),mxUtils.write(v,mxResources.get("currentPage")),N.appendChild(v),1<S?(M.style.marginBottom="12px",N.style.marginBottom="16px",C.appendChild(N),mxUtils.br(C),U+=20):M.style.marginBottom="16px",null!=this.lastEmbedInclude&&(N.value=this.lastEmbedInclude),mxEvent.addListener(M,"change",y),y()):M.style.marginBottom="16px";var R=document.createElement("input");-R.style.marginBottom="16px";R.style.marginRight="8px";R.setAttribute("type","checkbox");R.id="geCheckbox-"+Editor.guid();var T=document.createElement("input");T.style.marginBottom="16px";T.style.marginRight="8px";T.setAttribute("type","checkbox");T.id="geCheckbox-"+Editor.guid();f&&(R.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,C.appendChild(R),y=document.createElement("label"),mxUtils.write(y,mxResources.get("embedImages")),y.setAttribute("for",R.id),C.appendChild(y),mxUtils.br(C),-T.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,C.appendChild(T),y=document.createElement("label"),mxUtils.write(y,mxResources.get("embedFonts")),y.setAttribute("for",T.id),C.appendChild(y),mxUtils.br(C),U+=50);var V=document.createElement("select");V.style.maxWidth="260px";V.style.marginLeft="8px";v=document.createElement("option");v.setAttribute("value","auto");mxUtils.write(v,mxResources.get("automatic"));V.appendChild(v);y=document.createElement("option");y.setAttribute("value","blank");-mxUtils.write(y,mxResources.get("openInNewWindow"));V.appendChild(y);y=document.createElement("option");y.setAttribute("value","self");mxUtils.write(y,mxResources.get("openInThisWindow"));V.appendChild(y);y=document.createElement("div");mxUtils.write(y,mxResources.get("LinksLost"));y.style.margin="7px";y.style.display="none";"svg"==F&&(mxUtils.write(C,mxResources.get("links")+":"),C.appendChild(V),C.appendChild(y),mxUtils.br(C),mxUtils.br(C),U+=50);k=new CustomDialog(this,C,mxUtils.bind(this,function(){this.lastExportBorder=-q.value;this.lastExportZoom=O.value;this.lastEmbedImages=R.checked;this.lastEmbedFonts=T.checked;this.lastEmbedInclude=N.value;t(O.value,g.checked,!u.checked,B.checked,M.checked,R.checked&&f,q.value,I.checked,("png"==F||"svg"==F)&&"currentPage"==N.value,V.value,null!=K?K.checked:null,null!=p?p.value:null,G.value,T.checked)}),null,k,m);this.showDialog(k.container,340,U,!0,!0,null,null,null,null,!0);O.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?O.select():document.execCommand("selectAll",-!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,m,t){var v=document.createElement("div");v.style.whiteSpace="nowrap";var y=this.editor.graph;if(null!=f){var F=document.createElement("h3");mxUtils.write(F,f);F.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";v.appendChild(F)}var E=this.addCheckbox(v,mxResources.get("fit"),!0),C=this.addCheckbox(v,mxResources.get("shadow"),y.shadowVisible&&m,!m),S=this.addCheckbox(v,k),U=this.addCheckbox(v,mxResources.get("lightbox"),-!0),Q=this.addEditButton(v,U),O=Q.getEditInput(),q=1<y.model.getChildCount(y.model.getRoot()),u=this.addCheckbox(v,mxResources.get("layers"),q,!q);u.style.marginLeft=O.style.marginLeft;u.style.marginBottom="12px";u.style.marginTop="8px";mxEvent.addListener(U,"change",function(){U.checked?(q&&u.removeAttribute("disabled"),O.removeAttribute("disabled")):(u.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"));O.checked&&U.checked?Q.getEditSelect().removeAttribute("disabled"):Q.getEditSelect().setAttribute("disabled",-"disabled")});f=new CustomDialog(this,v,mxUtils.bind(this,function(){c(E.checked,C.checked,S.checked,U.checked,Q.getLink(),u.checked)}),null,mxResources.get("embed"),t);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,m,t,v,y,F){function E(O){var q=" ",u="";m&&(q=" 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!=S?"&page="+S:"")+(t?"&edit=_blank":"")+(v?"&layers=1":"")+"');}})(this);\"",u+="cursor:pointer;");c&&(u+="max-width:100%;");var I="";k&&(I=' width="'+Math.round(C.width)+'" height="'+Math.round(C.height)+'"');y('<img src="'+O+'"'+I+(""!=u?' style="'+u+'"':"")+q+"/>")}var C=this.editor.graph.getGraphBounds(),S=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(O){var q=m?this.getFileData(!0):-null;O=this.createImageDataUri(O,q,"png");E(O)}),null,null,null,mxUtils.bind(this,function(O){F({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),C.width*C.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var U="";k&&(U="&w="+Math.round(2*C.width)+"&h="+Math.round(2*C.height));var Q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(m?"1":"0")+U+"&xml="+encodeURIComponent(f));Q.send(mxUtils.bind(this,function(){200<=-Q.getStatus()&&299>=Q.getStatus()?E("data:image/png;base64,"+Q.getText()):F({message:mxResources.get("unknownError")})}))}else F({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,m,t,v,y){var F=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),E=F.getElementsByTagName("a");if(null!=E)for(var C=0;C<E.length;C++){var S=E[C].getAttribute("href");null!=S&&"#"==S.charAt(0)&&"_blank"==E[C].getAttribute("target")&&E[C].removeAttribute("target")}m&&-F.setAttribute("content",this.getFileData(!0));f&&this.editor.graph.addSvgShadow(F);if(k){var U=" ",Q="";m&&(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"+(t?"&edit=_blank":"")+(v?"&layers=1":-"")+"');}})(this);\"",Q+="cursor:pointer;");c&&(Q+="max-width:100%;");this.editor.convertImages(F,mxUtils.bind(this,function(O){y('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(O))+'"'+(""!=Q?' style="'+Q+'"':"")+U+"/>")}))}else Q="",m&&(f=this.getSelectedPageIndex(),F.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"+(null!=f?"&page="+f:"")+(t?"&edit=_blank":"")+(v?"&layers=1":"")+"');}}})(this);"),Q+="cursor:pointer;"),c&&(c=parseInt(F.getAttribute("width")),t=parseInt(F.getAttribute("height")),F.setAttribute("viewBox","-0.5 -0.5 "+c+" "+t),Q+="max-width:100%;max-height:"+t+"px;",F.removeAttribute("height")),""!=Q&&F.setAttribute("style",Q),this.editor.addFontCss(F),this.editor.graph.mathEnabled&&this.editor.addMathCss(F),y(mxUtils.getXml(F))};EditorUi.prototype.timeSince=function(c){c=+Q()}));var O=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(C.style,"transform",y);window.setTimeout(mxUtils.bind(this,function(){Q()}),1E3)});mxEvent.addListener(C,"click",mxUtils.bind(this,function(q){var u=mxEvent.getSource(q);u!=S&&u!=U?(null!=k&&k(),Q(),mxEvent.consume(q)):O()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(C.style,"transform",F)}),500);window.setTimeout(O,t?5E3:3E4);x=!0}return x};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,m){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<m&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",m));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,m,t){var x="jpeg"==k?"jpg":k;m=this.getBaseFilename(m)++(null!=f?".drawio":"")+"."+x;c=this.createImageDataUri(c,f,k,t);this.saveData(m,x,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||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,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,m,t,x){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=x?x:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=m?this.base64ToBlob(c,k):new Blob([c],{type:k}),navigator.msSaveOrOpenBlob(c,f);else if(mxClient.IS_IE)k=window.open("about:blank","_blank"),null==+k?mxUtils.popup(c,!0):(k.document.write(c),k.document.close(),k.document.execCommand("SaveAs",!0,f),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,m);else{var y=document.createElement("a");x=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof y.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var F=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);+x=65==(F?parseInt(F[2],10):!1)?!1:x}if(x||this.isOffline()){y.href=URL.createObjectURL(m?this.base64ToBlob(c,k):new Blob([c],{type:k}));x?y.download=f:y.setAttribute("target","_blank");document.body.appendChild(y);try{window.setTimeout(function(){URL.revokeObjectURL(y.href)},2E4),y.click(),y.parentNode.removeChild(y)}catch(E){}}else this.createEchoRequest(c,f,k,m,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,m,t,x){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,+c+(null!=k?"&mime="+k:"")+(null!=t?"&format="+t:"")+(null!=x?"&base64="+x:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(m?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,m,t,x,y,F,E){x=null!=x?x:!1;y=null!=y?y:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);var C=mxUtils.bind(this,function(U,Q,O,q){try{if("_blank"==Q)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,m);else if(null!=k&&"text/html"==k.substring(0,9)){var u=new EmbedDialog(this,c);this.showDialog(u.container,+450,240,!0,!0);u.init()}else{var I=window.open("about:blank");null==I?mxUtils.popup(c,!0):(I.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),I.document.close())}else if(Q==App.MODE_DEVICE||"download"==Q)this.doSaveLocalFile(c,U,k,m,null,F);else if(null!=U&&0<U.length){var G=mxUtils.bind(this,function(H){try{this.exportFile(c,U,k,m,Q,H)}catch(g){this.handleError(g)}});null!=q?G(q):this.pickFolder(Q,G)}}catch(H){this.handleError(H)}});t=[];x||t.push(App.MODE_BROWSER);y||t.push("_blank");+var S=new SaveDialog(this,f,mxUtils.bind(this,function(U,Q,O){C(U.value,Q,U,O);this.hideDialog(null,null,S.container)}),t,c,k,m,E);this.showDialog(S.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));S.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){var m=window.open("about:blank");if(null==m||null==m.document)mxUtils.popup(c,!0);else{var t="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==f){var x=mxUtils.parseXml(c).documentElement.style.backgroundColor;+""!=x&&(t="background: "+x+";")}t='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+t+'">';"image/svg+xml"!=f||mxClient.IS_SVG?"image/svg+xml"!=f||k?(x=k?c:btoa(unescape(encodeURIComponent(c))),m.document.write(t+'<img style="max-width:100%;" src="data:'+f+";base64,"+x+'"/></body></html>')):m.document.write(t+c+"</body></html>"):m.document.write(t+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");m.document.close()}};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){this.tagsDialog=this.tagsComponent=null;var f=c(mxUtils.bind(this,function(m){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 t=f.getBoundingClientRect();this.tagsDialog.style.left=t.left+"px";+this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";t=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=t.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(m)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var m=this.editor.graph.getAllTags();+f.style.display=0<m.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()){this.exportDialog=null;var k=c(mxUtils.bind(this,function(m){var t=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",t);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)t.apply(this);else{this.exportDialog=document.createElement("div");var x=k.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=x.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)++this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=x.zIndex;var y=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});y.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",t);this.editor.exportToCanvas(mxUtils.bind(this,function(F){y.stop();this.exportDialog.style.width=+"auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var E=this.createImageDataUri(F,null,"png");F=document.createElement("img");F.style.maxWidth="140px";F.style.maxHeight="140px";F.style.cursor="pointer";F.style.backgroundColor="white";F.setAttribute("title",mxResources.get("openInNewWindow"));F.setAttribute("border","0");F.setAttribute("src",E);this.exportDialog.appendChild(F);mxEvent.addListener(F,"click",mxUtils.bind(this,function(){this.openInNewWindow(E.substring(E.indexOf(",")++1),"image/png",!0);t.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(F){y.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(F)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(m)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,m,t,x){this.isLocalFileSave()?this.saveLocalFile(k,+c,m,t,f,x):this.saveRequest(c,f,mxUtils.bind(this,function(y,F){return this.createEchoRequest(k,y,m,t,f,F)}),k,t,m)};EditorUi.prototype.saveRequest=function(c,f,k,m,t,x,y){y=null!=y?y:!mxClient.IS_IOS||!navigator.standalone;var F=mxUtils.bind(this,function(C,S,U,Q){if("_blank"==S||null!=C&&0<C.length){var O=k("_blank"==S?null:C,S==App.MODE_DEVICE||"download"==S||null==S||"_blank"==S?"0":"1");null!=O&&(S==App.MODE_DEVICE||"download"==S||"_blank"==S?O.simulate(document,"_blank"):(U=mxUtils.bind(this,+function(q){x=null!=x?x:"pdf"==f?"application/pdf":"image/"+f;if(null!=m)try{this.exportFile(m,C,x,!0,S,q)}catch(u){this.handleError(u)}else this.spinner.spin(document.body,mxResources.get("saving"))&&O.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=O.getStatus()&&299>=O.getStatus())try{this.exportFile(O.getText(),C,x,!0,S,q)}catch(u){this.handleError(u)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u)}))}),+null!=Q?U(Q):this.pickFolder(S,U)))}});t=[App.MODE_BROWSER];y||t.push("_blank");var E=new SaveDialog(this,c,mxUtils.bind(this,function(C,S,U){F(C.value,S,C,U);this.hideDialog(null,null,E.container)}),t,null,"application/pdf");this.showDialog(E.container,420,110,!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,m,t,x){};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,m,t,x,y,F,E,C,S,U,Q,O){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(W){Editor.addRetryToError(W,mxUtils.bind(this,function(){this.exportSvg(c,f,k,m,t,x,y,F,E,C,S,U,Q,O)}));this.handleError(W)})))try{var q=this.editor.graph.isSelectionEmpty();+k=null!=k?k:q;var u=f?null:this.editor.graph.background;u==mxConstants.NONE&&(u=null);null==u&&0==f&&(u=this.editor.graph.shapeBackgroundColor);var I=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var G=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==S||"dark"==S)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==S;var g=Graph.addFont,p={};Graph.addFont=function(W,Y,Z,aa){g.call(this,+W,Y,Z,p)};var B=this.editor.graph.createSvgImageExport(t),K=B.drawCellState;B.drawCellState=function(W,Y){null!=W&&Graph.processFontStyle(W.style);K.apply(this,arguments)};var M=this.editor.graph.getSvg(u,c,y,F,null,k,null,B,"blank"==C?"_blank":"self"==C?"_top":null,null,!Q,S,U);mxUtils.lightDarkColorSupported=G;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=I;m&&this.editor.graph.addSvgShadow(M);var N=this.getBaseFilename()+(t?".drawio":"")+".svg";O=null!=O?O:mxUtils.bind(this,+function(W){this.isLocalFileSave()||W.length<=MAX_REQUEST_SIZE?this.saveData(N,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(W)}))});var R=mxUtils.bind(this,function(W){this.spinner.stop();t&&W.setAttribute("content",this.getFileData(!0,null,null,null,k,E,null,null,null,null,null,c,y));O(Graph.xmlDeclaration+"\n"+(t?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(W))});this.editor.graph.mathEnabled&&+this.editor.addMathCss(M);var T=mxUtils.bind(this,function(W){Editor.replaceSvgDataUris&&x&&EditorUi.embedSvgImages(W);Editor.foreignObjectImages&&Q?this.replaceAlternateContent(W,S,R):R(W)}),V=Graph.customFontElements;Graph.customFontElements=p;var X=mxUtils.bind(this,function(W){Graph.customFontElements=V;Graph.addFont=g;x&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(W,T,this.thumbImageCache)):T(W)});Q?this.embedFonts(M,+X):(this.editor.addFontCss(M),X(M))}catch(W){this.handleError(W)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function m(U,Q,O,q,u){var I=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");I.setAttribute("x",Q);I.setAttribute("y",O+.5);I.setAttribute("width",q.width);I.setAttribute("height",q.height);null==I.setAttributeNS?I.setAttribute("xlink:href",u):I.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",u);U.replaceChild(I,U.lastChild);F()}function t(){if(y<S.length)S[y++](t)}+var x="";f=c.getElementsByTagName("style");for(var y=0;y<f.length;y++)x+=f[y].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var F=mxUtils.bind(this,function(){counter--;0==counter&&k(c)}),E={},C={},S=[];for(y=0;y<f.length;y++)mxUtils.bind(this,function(U){var Q=U.getElementsByTagName("div");if(0<Q.length)try{var O=Q[0].cloneNode(!0),q=parseInt(O.style.marginLeft),u=parseInt(O.style.paddingTop),I=O.getElementsByTagName("div")[1],G=Q=!1,H=O.style.alignItems,g=O.style.justifyContent;+if(null!=O.style.writingMode){var p=O.style.writingMode;G="vertical-"==p.substring(0,9);Q="-rl"==p.substring(p.length-3)}var B=!G&&"1px"==O.style.width||G&&"1px"==O.style.height;if(!G&&"1px"==O.style.height||G&&"1px"==O.style.width)O.style.alignItems=G&&Q?"unsafe flex-end":"unsafe flex-start";B&&(O.style.justifyContent="unsafe flex-start");O.style.paddingTop="";O.style.marginLeft="";var K=O.outerHTML,M=E[K];null==M&&(O.style.position="absolute",O.style.visibility="hidden",document.body.appendChild(O),+p=1,p="1px"==O.style.width?I.offsetWidth:parseInt(O.style.width),B=1,B="1px"==O.style.height?I.offsetHeight:parseInt(O.style.height),document.body.removeChild(O),M=new mxRectangle(q,u,p,B),E[K]=M);"1px"==O.style.height&&("unsafe center"==H?u-=M.height/2:"unsafe flex-end"==H&&(u-=M.height));if("1px"==O.style.width)if(!G&&"unsafe center"==g||G&&"unsafe center"==H)q-=M.width/2;else if(!G&&"unsafe flex-end"==g||G&&(!Q&&"unsafe flex-end"==H||Q&&"unsafe flex-start"==H))q-=M.width;M=new mxRectangle(q,u,+M.width,M.height+parseInt(I.style.fontSize)/4);S.push(mxUtils.bind(this,function(N){var R=C[K];null==R?Graph.htmlToPng(K,M.width,M.height,mxUtils.bind(this,function(T){m(U,q,u,M,T);C[K]=T;N()}),x):(m(U,q,u,M,R),N())}))}catch(N){F()}else F()})(f[y]);0==counter&&k(c);y=0;t()};EditorUi.prototype.addRadiobox=function(c,f,k,m,t,x,y){return this.addCheckbox(c,k,m,t,x,y,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,m,t,x,y,F){x=null!=x?x:!0;var E=document.createElement("input");E.style.marginRight=+"8px";E.style.marginTop="16px";E.setAttribute("type",y?"radio":"checkbox");y="geCheckbox-"+Editor.guid();E.id=y;null!=F&&E.setAttribute("name",F);k&&(E.setAttribute("checked","checked"),E.defaultChecked=!0);m&&E.setAttribute("disabled","disabled");x&&(c.appendChild(E),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",y),c.appendChild(k),t||mxUtils.br(c));return E};EditorUi.prototype.addEditButton=function(c,f){var k=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);+k.style.marginLeft="24px";var m=this.getCurrentFile(),t="";null!=m&&m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER&&(t=window.location.href);var x=document.createElement("select");x.style.maxWidth="200px";x.style.width="auto";x.style.marginLeft="8px";x.style.marginRight="10px";x.className="geBtn";m=document.createElement("option");m.setAttribute("value","blank");mxUtils.write(m,mxResources.get("makeCopy"));x.appendChild(m);var y=document.createElement("option");y.setAttribute("value",+"custom");mxUtils.write(y,mxResources.get("custom")+"...");x.appendChild(y);c.appendChild(x);mxEvent.addListener(x,"change",mxUtils.bind(this,function(){if("custom"==x.value){var F=new FilenameDialog(this,t,mxResources.get("ok"),function(E){null!=E?(t=E,y.setAttribute("title",E)):(x.value="blank",y.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){x.value="blank"});this.showDialog(F.container,300,80,!0,!1);F.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,+function(){k.checked&&(null==f||f.checked)?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return k.checked?"blank"===x.value?"_blank":t:null},getEditInput:function(){return k},getEditSelect:function(){return x}}};EditorUi.prototype.addLinkSection=function(c,f){function k(){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+"')");y.innerText="";y.appendChild(F)}mxUtils.write(c,mxResources.get("links")+":");var m=document.createElement("select");m.style.width="100px";m.style.padding="0px";m.style.marginLeft="8px";m.style.marginRight="10px";m.className="geBtn";var t=document.createElement("option");t.setAttribute("value","auto");mxUtils.write(t,mxResources.get("automatic"));+m.appendChild(t);t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("openInNewWindow"));m.appendChild(t);t=document.createElement("option");t.setAttribute("value","self");mxUtils.write(t,mxResources.get("openInThisWindow"));m.appendChild(t);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),m.appendChild(f));c.appendChild(m);mxUtils.write(c,mxResources.get("borderColor")++":");var x="#0000ff",y=null;y=mxUtils.button("",mxUtils.bind(this,function(F){this.pickColor(x||"none",function(E){x=E;k()});mxEvent.consume(F)}));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=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";y.className="geColorBtn";c.appendChild(y);mxUtils.br(c);return{getColor:function(){return x},getTarget:function(){return m.value},+focus:function(){m.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,m,t,x){x=null!=x?x:[];k&&(x.push("lightbox=1"),"auto"!=c&&x.push("target="+c),null!=f&&f!=mxConstants.NONE&&x.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=m&&0<m.length&&x.push("edit="+encodeURIComponent(m)),t&&x.push("layers=1"),this.editor.graph.foldingEnabled&&x.push("nav=1"));return x};EditorUi.prototype.createLink=function(c,f,k,m,t,x,y,F,E,C,S,U,Q){var O=this.getCurrentFile();E=this.createUrlParameters(c,+f,m,t,x,E);c=!0;null!=y?k="#U"+encodeURIComponent(y):F||null==O||""==O.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="#"+O.getHash(),c=!1);c&&null!=O&&null!=O.getTitle()&&O.getTitle()!=this.defaultFilename&&E.push("title="+encodeURIComponent(O.getTitle()));C&&1<k.length&&(E.push("open="+k.substring(1)),k="");S&&null!=this.currentPage&&E.push("page-id="+this.currentPage.getId());U&&E.push("transparent=1");+null!=Q&&E.push("dark="+Q);return(m&&(null!=y||null!=O&&O.getMode()!=App.MODE_GITHUB&&O.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,m,t,x,y,F,E,C,S,U,Q){this.getBasenames();var O={};""!=t&&t!=mxConstants.NONE&&(O.highlight=t);"auto"!==m&&(O.target=m);C||(O.lightbox=+!1);O.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(O.zoom=k/100);k=[];y&&(k.push("pages"),O.resize=!0,null!=this.pages&&null!=this.currentPage&&(O.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),O.resize=!0);F&&k.push("layers");E&&k.push("tags");null!=Q&&(O["dark-mode"]=Q);0<k.length&&(C&&k.push("lightbox"),O.toolbar=k.join(" "));null!=S&&0<S.length&&(O.edit=S);null!=c?O.url=c:O.xml=this.getFileData(!0,null,null,null,null,!y);f='<div class="mxgraph" style="'++(x?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(O))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";U(f,'<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.showHtmlDialog=function(c,f,k,m){var t=document.createElement("div");t.style.whiteSpace="nowrap";var x=document.createElement("h3");mxUtils.write(x,mxResources.get("html"));x.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";t.appendChild(x);var y=document.createElement("div");y.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var F=document.createElement("input");F.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";+F.setAttribute("value","url");F.setAttribute("type","radio");F.setAttribute("name","type-embedhtmldialog");x=F.cloneNode(!0);x.setAttribute("value","copy");y.appendChild(x);var E=document.createElement("span");mxUtils.write(E,mxResources.get("includeCopyOfMyDiagram"));y.appendChild(E);mxUtils.br(y);y.appendChild(F);E=document.createElement("span");mxUtils.write(E,mxResources.get("publicDiagramUrl"));y.appendChild(E);var C=this.getCurrentFile();null==k&&null!=C&&C.constructor==window.DriveFile&&(E=+document.createElement("a"),E.style.paddingLeft="12px",E.style.color="gray",E.style.cursor="pointer",mxUtils.write(E,mxResources.get("share")),y.appendChild(E),mxEvent.addListener(E,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(C.getId(),C)})));x.setAttribute("checked","checked");null==k&&F.setAttribute("disabled","disabled");t.appendChild(y);y=380;var S=this.addLinkSection(t),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";+U.style.marginTop="16px";E=document.createElement("option");E.setAttribute("value","light");mxUtils.write(E,mxResources.get("light"));U.appendChild(E);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,mxResources.get("dark"));U.appendChild(E);E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));E.setAttribute("selected","selected");U.appendChild(E);E.setAttribute("selected","selected");mxUtils.write(t,mxResources.get("appearance")++":");t.appendChild(U);mxUtils.br(t);y+=26;var Q=this.addCheckbox(t,mxResources.get("zoom"),!0,null,!0);mxUtils.write(t,":");var O=document.createElement("input");O.setAttribute("type","text");O.style.marginRight="16px";O.style.width="60px";O.style.marginLeft="4px";O.style.marginRight="12px";O.value="100%";t.appendChild(O);var q=this.addCheckbox(t,mxResources.get("fit"),!0);E=null!=this.pages&&1<this.pages.length;var u=u=this.addCheckbox(t,mxResources.get("allPages"),E,!E),I=this.addCheckbox(t,mxResources.get("layers"),+!0),G=this.addCheckbox(t,mxResources.get("tags"),!0),H=this.addCheckbox(t,mxResources.get("lightbox"),!0),g=null;if(EditorUi.enableHtmlEditOption){g=this.addEditButton(t,H);var p=g.getEditInput();p.style.marginBottom="16px";y+=50;mxEvent.addListener(H,"change",function(){H.checked?p.removeAttribute("disabled"):p.setAttribute("disabled","disabled");p.checked&&H.checked?g.getEditSelect().removeAttribute("disabled"):g.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,t,mxUtils.bind(this,+function(){m(F.checked?k:null,Q.checked,O.value,S.getTarget(),S.getColor(),q.checked,u.checked,I.checked,G.checked,H.checked,null!=g?g.getLink():null,null!=U?U.value:null)}),null,c,f);this.showDialog(c.container,340,y,!0,!0);x.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,k,m,t,x,y,F,E,C,S,U){var Q=document.createElement("div");Q.style.whiteSpace="nowrap";var O=document.createElement("h3");mxUtils.write(O,c||mxResources.get("publish"));O.style.width="100%";O.style.textAlign="center";+O.style.marginTop="2px";O.style.marginBottom="20px";Q.appendChild(O);var q=document.createElement("select");c=30;q.className="geBtn";q.style.marginBottom="8px";q.style.marginLeft="0px";q.style.width="100%";q.style.boxSizing="border-box";if(null==F||""==F.getHash())t=null!=t?t:"https://www.drawio.com/doc/faq/publish-diagram-as-link",O=document.createElement("option"),mxUtils.write(O,mxResources.get("makeCopy")),O.setAttribute("value","copy"),q.appendChild(O);O=document.createElement("option");mxUtils.write(O,+mxResources.get("authorizationRequired"));O.setAttribute("value","auth");q.appendChild(O);null!=F&&""!=F.getHash()||O.setAttribute("disabled","disabled");F=document.createElement("option");F.setAttribute("value","public");q.appendChild(F);null!=y?(mxUtils.write(F,mxResources.get("publicDiagramUrl")),F.setAttribute("title",y),q.value="public"):(mxUtils.write(F,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),F.setAttribute("disabled","disabled"));Q.appendChild(q);+mxUtils.br(Q);q.focus();var u=null,I=null;if(null!=f||null!=k)c+=30,mxUtils.write(Q,mxResources.get("width")+":"),u=document.createElement("input"),u.setAttribute("type","text"),u.style.marginRight="16px",u.style.width="50px",u.style.marginLeft="6px",u.style.marginRight="16px",u.style.marginBottom="10px",u.value="100%",Q.appendChild(u),mxUtils.write(Q,mxResources.get("height")+":"),I=document.createElement("input"),I.setAttribute("type","text"),I.style.width="50px",I.style.marginLeft="6px",I.style.marginBottom=+"10px",I.value=k+"px",Q.appendChild(I),mxUtils.br(Q);var G=this.addLinkSection(Q,m),H=C?this.addCheckbox(Q,mxResources.get("transparentBackground"),!1):null;null!=H&&(c+=20);var g=document.createElement("select");g.className="geBtn";g.style.marginTop="8px";f=document.createElement("option");mxUtils.write(f,mxResources.get("allPages"));f.setAttribute("value","allPages");g.appendChild(f);f=document.createElement("option");mxUtils.write(f,mxResources.get("currentPage"));f.setAttribute("value","currentPage");+g.appendChild(f);var p=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,f=null!=this.currentPage?this.currentPage.getName():"",16<f.length&&(f=f.substring(0,16)+"..."),U&&(mxUtils.write(Q,mxResources.get("pages")+":"),Q.appendChild(g),mxUtils.br(Q),c+=30),p=this.addCheckbox(Q,mxResources.get("selectedPage")+": "+f));var B=document.createElement("select");B.style.maxWidth="260px";B.style.marginLeft="8px";B.style.marginTop="16px";U=document.createElement("option");+U.setAttribute("value","0");mxUtils.write(U,mxResources.get("light"));B.appendChild(U);U=document.createElement("option");U.setAttribute("value","1");mxUtils.write(U,mxResources.get("dark"));B.appendChild(U);U=document.createElement("option");U.setAttribute("value","auto");mxUtils.write(U,mxResources.get("automatic"));U.setAttribute("selected","selected");B.appendChild(U);S&&(mxUtils.write(Q,mxResources.get("appearance")+":"),Q.appendChild(B),mxUtils.br(Q),c+=30);var K=this.addCheckbox(Q,mxResources.get("lightbox"),+!0,null,null,!m),M=this.addEditButton(Q,K),N=M.getEditInput();m&&(N.style.marginLeft=K.style.marginLeft,K.style.display="none",c-=20);var R=this.addCheckbox(Q,mxResources.get("layers"),!0);R.style.marginLeft=N.style.marginLeft;R.style.marginTop="8px";var T=this.addCheckbox(Q,mxResources.get("tags"),!0);T.style.marginLeft=N.style.marginLeft;T.style.marginBottom="16px";T.style.marginTop="16px";mxEvent.addListener(K,"change",function(){K.checked?(R.removeAttribute("disabled"),N.removeAttribute("disabled"),+T.removeAttribute("disabled")):(R.setAttribute("disabled","disabled"),N.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"));N.checked&&K.checked?M.getEditSelect().removeAttribute("disabled"):M.getEditSelect().setAttribute("disabled","disabled")});m=new CustomDialog(this,Q,mxUtils.bind(this,function(){E(G.getTarget(),G.getColor(),null==p?!1:p.checked,K.checked,M.getLink(),R.checked,null!=u?u.value:null,null!=I?I.value:null,T.checked,q.value,null!=H?H.checked:!1,B.value,"allPages"==+g.value)}),null,mxResources.get("create"),t,x);this.showDialog(m.container,340,296+c,!0,!0);null!=u?(u.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?u.select():document.execCommand("selectAll",!1,null)):null==q.parentNode;G.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,m,t){var x=document.createElement("div");x.style.whiteSpace="nowrap";var y=document.createElement("h3");mxUtils.write(y,mxResources.get("image"));y.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"++(t?"10":"4")+"px";x.appendChild(y);if(t){mxUtils.write(x,mxResources.get("zoom")+":");var F=document.createElement("input");F.setAttribute("type","text");F.style.marginRight="16px";F.style.width="60px";F.style.marginLeft="4px";F.style.marginRight="12px";F.value=this.lastExportZoom||"100%";x.appendChild(F);mxUtils.write(x,mxResources.get("borderWidth")+":");var E=document.createElement("input");E.setAttribute("type","text");E.style.marginRight="16px";E.style.width="60px";E.style.marginLeft="4px";E.value=+this.lastExportBorder||"0";x.appendChild(E);mxUtils.br(x)}var C=this.addCheckbox(x,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),S=m?null:this.addCheckbox(x,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);y=this.editor.graph;var U=m?null:this.addCheckbox(x,mxResources.get("transparentBackground"),y.background==mxConstants.NONE||null==y.background);null!=U&&(U.style.marginBottom="16px");c=new CustomDialog(this,x,mxUtils.bind(this,function(){var Q=+parseInt(F.value)/100||1,O=parseInt(E.value)||0;k(!C.checked,null!=S?S.checked:!1,null!=U?U.checked:!1,Q,O)}),null,c,f);this.showDialog(c.container,300,(t?25:0)+(m?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,m,t,x,y,F,E){y=null!=y?y:Editor.defaultIncludeDiagram;var C=document.createElement("div");C.style.whiteSpace="nowrap";var S=this.editor.graph,U="jpeg"==F||"webp"==F?220:320,Q=document.createElement("h3");mxUtils.write(Q,c);Q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";+C.appendChild(Q);mxUtils.write(C,mxResources.get("zoom")+":");var O=document.createElement("input");O.setAttribute("type","text");O.style.marginRight="16px";O.style.width="60px";O.style.marginLeft="4px";O.style.marginRight="12px";O.value=this.lastExportZoom||"100%";C.appendChild(O);mxUtils.write(C,mxResources.get("borderWidth")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.value=this.lastExportBorder||+"0";C.appendChild(q);mxUtils.br(C);var u=this.addCheckbox(C,mxResources.get("selectionOnly"),!1,S.isSelectionEmpty()),I=document.createElement("input");I.style.marginTop="16px";I.style.marginRight="8px";I.style.marginLeft="24px";I.setAttribute("disabled","disabled");I.setAttribute("type","checkbox");var G=document.createElement("select");G.style.marginTop="16px";G.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(Q=0;Q<c.length;Q++)if(!S.isSelectionEmpty()||"selectionOnly"!=c[Q]){var H=+document.createElement("option");mxUtils.write(H,mxResources.get(c[Q]));H.setAttribute("value",c[Q]);G.appendChild(H)}E?(mxUtils.write(C,mxResources.get("size")+":"),C.appendChild(G),mxUtils.br(C),U+=26,mxEvent.addListener(G,"change",function(){"selectionOnly"==G.value&&(u.checked=!0)})):x&&(C.appendChild(I),mxUtils.write(C,mxResources.get("crop")),mxUtils.br(C),U+=30,mxEvent.addListener(u,"change",function(){u.checked?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")}));S.isSelectionEmpty()?+E&&(u.style.display="none",u.nextSibling.style.display="none",u.nextSibling.nextSibling.style.display="none",U-=30):(G.value="diagram",I.setAttribute("checked","checked"),I.defaultChecked=!0,mxEvent.addListener(u,"change",function(){G.value=u.checked?"selectionOnly":"diagram"}));var g=this.addCheckbox(C,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=F&&"webp"!=F),p=document.createElement("select");p.style.maxWidth="260px";p.style.marginLeft="8px";p.style.marginTop="16px";x=document.createElement("option");+x.setAttribute("value","light");mxUtils.write(x,mxResources.get("light"));p.appendChild(x);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,mxResources.get("dark"));p.appendChild(E);"svg"==F&&mxUtils.lightDarkColorSupported?(x=document.createElement("option"),x.setAttribute("value","auto"),mxUtils.write(x,mxResources.get("automatic")),x.setAttribute("selected","selected"),p.appendChild(x)):Editor.isDarkMode()?E.setAttribute("selected","selected"):x.setAttribute("selected",+"selected");mxUtils.write(C,mxResources.get("appearance")+":");C.appendChild(p);mxUtils.br(C);U+=26;var B=this.addCheckbox(C,mxResources.get("shadow"),S.shadowVisible),K=null;if("png"==F||"jpeg"==F||"webp"==F)K=this.addCheckbox(C,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),U+=30;S=null!=this.pages?this.pages.length:1;var M=this.addCheckbox(C,mxResources.get("includeCopyOfMyDiagram")+(1<S?":":""),y,null,null,"jpeg"!=F&&"webp"!=F),N=document.createElement("select");N.style.maxWidth=+"260px";N.style.marginLeft="28px";"png"==F||"svg"==F?(y=function(){M.checked?N.removeAttribute("disabled"):N.setAttribute("disabled","disabled")},x=document.createElement("option"),x.setAttribute("value","allPages"),mxUtils.write(x,mxResources.get("allPages")),N.appendChild(x),x=document.createElement("option"),x.setAttribute("value","currentPage"),mxUtils.write(x,mxResources.get("currentPage")),N.appendChild(x),1<S?(M.style.marginBottom="12px",N.style.marginBottom="16px",C.appendChild(N),mxUtils.br(C),+U+=20):M.style.marginBottom="16px",null!=this.lastEmbedInclude&&(N.value=this.lastEmbedInclude),mxEvent.addListener(M,"change",y),y()):M.style.marginBottom="16px";var R=document.createElement("input");R.style.marginBottom="16px";R.style.marginRight="8px";R.setAttribute("type","checkbox");R.id="geCheckbox-"+Editor.guid();var T=document.createElement("input");T.style.marginBottom="16px";T.style.marginRight="8px";T.setAttribute("type","checkbox");T.id="geCheckbox-"+Editor.guid();f&&(R.checked=null!=+this.lastEmbedImages?this.lastEmbedImages:!0,C.appendChild(R),y=document.createElement("label"),mxUtils.write(y,mxResources.get("embedImages")),y.setAttribute("for",R.id),C.appendChild(y),mxUtils.br(C),T.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,C.appendChild(T),y=document.createElement("label"),mxUtils.write(y,mxResources.get("embedFonts")),y.setAttribute("for",T.id),C.appendChild(y),mxUtils.br(C),U+=50);var V=document.createElement("select");V.style.maxWidth="260px";V.style.marginLeft=+"8px";x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));V.appendChild(x);y=document.createElement("option");y.setAttribute("value","blank");mxUtils.write(y,mxResources.get("openInNewWindow"));V.appendChild(y);y=document.createElement("option");y.setAttribute("value","self");mxUtils.write(y,mxResources.get("openInThisWindow"));V.appendChild(y);y=document.createElement("div");mxUtils.write(y,mxResources.get("LinksLost"));y.style.margin="7px";+y.style.display="none";"svg"==F&&(mxUtils.write(C,mxResources.get("links")+":"),C.appendChild(V),C.appendChild(y),mxUtils.br(C),mxUtils.br(C),U+=50);k=new CustomDialog(this,C,mxUtils.bind(this,function(){this.lastExportBorder=q.value;this.lastExportZoom=O.value;this.lastEmbedImages=R.checked;this.lastEmbedFonts=T.checked;this.lastEmbedInclude=N.value;t(O.value,g.checked,!u.checked,B.checked,M.checked,R.checked&&f,q.value,I.checked,("png"==F||"svg"==F)&&"currentPage"==N.value,V.value,null!=K?K.checked:+null,null!=p?p.value:null,G.value,T.checked)}),null,k,m);this.showDialog(k.container,340,U,!0,!0,null,null,null,null,!0);O.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?O.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,m,t){var x=document.createElement("div");x.style.whiteSpace="nowrap";var y=this.editor.graph;if(null!=f){var F=document.createElement("h3");mxUtils.write(F,f);F.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";+x.appendChild(F)}var E=this.addCheckbox(x,mxResources.get("fit"),!0),C=this.addCheckbox(x,mxResources.get("shadow"),y.shadowVisible&&m,!m),S=this.addCheckbox(x,k),U=this.addCheckbox(x,mxResources.get("lightbox"),!0),Q=this.addEditButton(x,U),O=Q.getEditInput(),q=1<y.model.getChildCount(y.model.getRoot()),u=this.addCheckbox(x,mxResources.get("layers"),q,!q);u.style.marginLeft=O.style.marginLeft;u.style.marginBottom="12px";u.style.marginTop="8px";mxEvent.addListener(U,"change",function(){U.checked?+(q&&u.removeAttribute("disabled"),O.removeAttribute("disabled")):(u.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"));O.checked&&U.checked?Q.getEditSelect().removeAttribute("disabled"):Q.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,x,mxUtils.bind(this,function(){c(E.checked,C.checked,S.checked,U.checked,Q.getLink(),u.checked)}),null,mxResources.get("embed"),t);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=+function(c,f,k,m,t,x,y,F){function E(O){var q=" ",u="";m&&(q=" 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!=S?"&page="+S:"")+(t?"&edit=_blank":"")+(x?"&layers=1":"")+"');}})(this);\"",u+=+"cursor:pointer;");c&&(u+="max-width:100%;");var I="";k&&(I=' width="'+Math.round(C.width)+'" height="'+Math.round(C.height)+'"');y('<img src="'+O+'"'+I+(""!=u?' style="'+u+'"':"")+q+"/>")}var C=this.editor.graph.getGraphBounds(),S=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(O){var q=m?this.getFileData(!0):null;O=this.createImageDataUri(O,q,"png");E(O)}),null,null,null,mxUtils.bind(this,function(O){F({message:mxResources.get("unknownError")})}),+null,!0,k?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),C.width*C.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var U="";k&&(U="&w="+Math.round(2*C.width)+"&h="+Math.round(2*C.height));var Q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(m?"1":"0")+U+"&xml="+encodeURIComponent(f));Q.send(mxUtils.bind(this,function(){200<=Q.getStatus()&&299>=Q.getStatus()?E("data:image/png;base64,"+Q.getText()):F({message:mxResources.get("unknownError")})}))}else F({message:mxResources.get("drawingTooLarge")})};+EditorUi.prototype.createEmbedSvg=function(c,f,k,m,t,x,y){var F=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),E=F.getElementsByTagName("a");if(null!=E)for(var C=0;C<E.length;C++){var S=E[C].getAttribute("href");null!=S&&"#"==S.charAt(0)&&"_blank"==E[C].getAttribute("target")&&E[C].removeAttribute("target")}m&&F.setAttribute("content",this.getFileData(!0));f&&this.editor.graph.addSvgShadow(F);if(k){var U=" ",Q="";m&&(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"+(t?"&edit=_blank":"")+(x?"&layers=1":"")+"');}})(this);\"",Q+="cursor:pointer;");c&&(Q+="max-width:100%;");this.editor.convertImages(F,mxUtils.bind(this,function(O){y('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(O))+'"'+(""!=Q?' style="'+Q+'"':"")+U+"/>")}))}else Q="",m&&(f=this.getSelectedPageIndex(),F.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"+(null!=f?"&page="+f:"")+(t?"&edit=_blank":"")+(x?"&layers=1":"")+"');}}})(this);"),Q+="cursor:pointer;"),c&&(c=parseInt(F.getAttribute("width")),t=parseInt(F.getAttribute("height")),F.setAttribute("viewBox","-0.5 -0.5 "+c+" "+t),Q+="max-width:100%;max-height:"+t+"px;",F.removeAttribute("height")),""!=Q&&F.setAttribute("style",Q),this.editor.addFontCss(F),this.editor.graph.mathEnabled&&this.editor.addMathCss(F),y(mxUtils.getXml(F))};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 m=c.getElementsByTagName("diagram");if(0<m.length){k=m[0];var t=f.getGlobalVariable;f.getGlobalVariable=function(v){return"page"==v?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==v?1:t.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}m=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(v){}finally{this.editor.graph=m}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 m=parseFloat(c.getAttribute("scale"));!isNaN(m)&&0<m&&(f=m)}c.hasAttribute("border")&&(m=parseInt(c.getAttribute("border")),!isNaN(m)&&0<m&&(k=m))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,m,t){try{var v=this.editor.graph,y=null;if(null!=k&&0<k.length)v=this.createTemporaryGraph(v.getStylesheet()),document.body.appendChild(v.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,-!0),v),y=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){v=this.createTemporaryGraph(v.getStylesheet());var F=v.getGlobalVariable;v.setBackgroundImage=this.editor.graph.setBackgroundImage;var E=this.pages[0];this.currentPage==E?v.setBackgroundImage(this.editor.graph.backgroundImage):null!=E.viewState&&null!=E.viewState&&v.setBackgroundImage(E.viewState.backgroundImage);v.getGlobalVariable=function(C){return"page"==C?E.getName():"pagenumber"==C?1:F.apply(this,arguments)};document.body.appendChild(v.container);-v.model.setRoot(E.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(C){try{null==y&&(y=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var S=C.toDataURL("image/png");S=Editor.writeGraphModelToPng(S,"tEXt","mxfile",encodeURIComponent(y));c(S.substring(S.lastIndexOf(",")+1));v!=this.editor.graph&&v.container.parentNode.removeChild(v.container)}catch(U){null!=f&&f(U)}}),null,null,null,mxUtils.bind(this,function(C){null!=f&&f(C)}),null,null,m,null,v.shadowVisible,null,v,t,null,-null,null,"diagram",null)}catch(C){null!=f&&f(C)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,m,t,v,y,F,E,C,S,U,Q){F=null!=F?F:!0;S=null!=S?S:0;y=null!=E?E:f.background;y==mxConstants.NONE&&(y=null);null==y&&"none"==f.getAdaptiveColors()&&(y="#ffffff");E=this.editor.graph.createSvgImageExport(null!=c);v=f.getSvg(y,C,S,null,null,v,null,E,null,f.shadowVisible||U,null,Q,"diagram");(f.shadowVisible||U)&&f.addSvgShadow(v,null,null,0==S);null!=c&&v.setAttribute("content",c);null!=k&&v.setAttribute("resource",-k);var O=mxUtils.bind(this,function(q){q=(m?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(q);null!=t&&t(q);return q});f.mathEnabled&&this.editor.addMathCss(v);if(null!=t)this.embedFonts(v,mxUtils.bind(this,function(q){F?this.editor.convertImages(q,mxUtils.bind(this,function(u){O(u)})):O(q)}));else return O(v)};EditorUi.prototype.embedFonts=function(c,f){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(k){try{null!=k&&this.editor.addFontCss(c,k),f(c)}catch(m){f(c)}}))}catch(k){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,k,m,t,v,y,F,E,C,S,U,Q){E=null!=E?E:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(q){Editor.addRetryToError(q,mxUtils.bind(this,function(){this.exportImage(c,f,k,m,t,v,y,F,E,C,S,U,Q)}));this.handleError(q)}))){var O=this.editor.graph.isSelectionEmpty();-k=null!=k?k:O;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(q){this.spinner.stop();try{this.saveCanvas(q,t?this.getFileData(!0,null,null,null,k,F,null,null,null,null,null,c,v):null,E,null==this.pages||0==this.pages.length,S)}catch(u){this.handleError(u)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}),null,k,c||1,f,m,null,null,v,y,C,U,Q)}catch(q){this.spinner.stop(),this.handleError(q)}}};-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,m,t,v,y){f=null!=f?f:0;k=null!=k?k:0;var F=[];try{var E=this.editor.graph;if(null!=c&&0<c.length){E.model.beginUpdate();try{var C=mxUtils.parseXml(c);c={};var S=this.editor.extractGraphModel(C.documentElement,-null!=this.pages);if(null!=S&&"mxfile"==S.nodeName&&null!=this.pages){var U=S.getElementsByTagName("diagram");if(1==U.length&&!v){if(S=Editor.parseDiagramNode(U[0]),null!=this.currentPage&&(c[U[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var Q=U[0].getAttribute("name");null!=Q&&""!=Q&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,Q))}}else if(0<U.length){v=[];var O=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[U[0].getAttribute("id")]=-this.pages[0].getId(),Q=U[0].getAttribute("name"),null!=Q&&""!=Q&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],Q)),S=Editor.parseDiagramNode(U[0]),m=!1,O=1);for(;O<U.length;O++){var q=U[O].getAttribute("id");U[O].removeAttribute("id");var u=this.updatePageRoot(new DiagramPage(U[O]));c[q]=U[O].getAttribute("id");var I=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[I+1]));E.model.execute(new ChangePage(this,u,u,I,!0));v.push(u)}this.updatePageLinks(c,-v)}}if(null!=S&&"mxGraphModel"===S.nodeName){F=E.importGraphModel(S,f,k,m);if(null!=F)for(this.addLocalPagesToMapping(c),O=0;O<F.length;O++)this.updatePageLinksForCell(c,F[O]);var G=E.parseBackgroundImage(S.getAttribute("backgroundImage"));if(null!=G&&null!=G.originalSrc){this.updateBackgroundPageLink(c,G);var H=new ChangePageSetup(this,null,G);H.ignoreColor=!0;E.model.execute(H)}}y&&E.pasteCellStyles(E.includeDescendants(F),E.defaultVertexStyle,E.defaultEdgeStyle)}finally{E.model.endUpdate()}}}catch(g){if(t)throw g;+c;else if("mxfile"==c.nodeName){var m=c.getElementsByTagName("diagram");if(0<m.length){k=m[0];var t=f.getGlobalVariable;f.getGlobalVariable=function(x){return"page"==x?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==x?1:t.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}m=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(x){}finally{this.editor.graph=m}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 m=parseFloat(c.getAttribute("scale"));!isNaN(m)&&0<m&&(f=m)}c.hasAttribute("border")&&(m=parseInt(c.getAttribute("border")),!isNaN(m)&&0<m&&(k=m))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,m,t){try{var x=this.editor.graph,y=null;if(null!=k&&0<k.length)x=this.createTemporaryGraph(x.getStylesheet()),document.body.appendChild(x.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,+!0),x),y=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){x=this.createTemporaryGraph(x.getStylesheet());var F=x.getGlobalVariable;x.setBackgroundImage=this.editor.graph.setBackgroundImage;var E=this.pages[0];this.currentPage==E?x.setBackgroundImage(this.editor.graph.backgroundImage):null!=E.viewState&&null!=E.viewState&&x.setBackgroundImage(E.viewState.backgroundImage);x.getGlobalVariable=function(C){return"page"==C?E.getName():"pagenumber"==C?1:F.apply(this,arguments)};document.body.appendChild(x.container);+x.model.setRoot(E.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(C){try{null==y&&(y=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var S=C.toDataURL("image/png");S=Editor.writeGraphModelToPng(S,"tEXt","mxfile",encodeURIComponent(y));c(S.substring(S.lastIndexOf(",")+1));x!=this.editor.graph&&x.container.parentNode.removeChild(x.container)}catch(U){null!=f&&f(U)}}),null,null,null,mxUtils.bind(this,function(C){null!=f&&f(C)}),null,null,m,null,x.shadowVisible,null,x,t,null,+null,null,"diagram",null)}catch(C){null!=f&&f(C)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,m,t,x,y,F,E,C,S,U,Q){F=null!=F?F:!0;S=null!=S?S:0;y=null!=E?E:f.background;y==mxConstants.NONE&&(y=null);null==y&&"none"==f.getAdaptiveColors()&&(y="#ffffff");E=this.editor.graph.createSvgImageExport(null!=c);x=f.getSvg(y,C,S,null,null,x,null,E,null,f.shadowVisible||U,null,Q,"diagram");(f.shadowVisible||U)&&f.addSvgShadow(x,null,null,0==S);null!=c&&x.setAttribute("content",c);null!=k&&x.setAttribute("resource",+k);var O=mxUtils.bind(this,function(q){q=(m?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(q);null!=t&&t(q);return q});f.mathEnabled&&this.editor.addMathCss(x);if(null!=t)this.embedFonts(x,mxUtils.bind(this,function(q){F?this.editor.convertImages(q,mxUtils.bind(this,function(u){O(u)})):O(q)}));else return O(x)};EditorUi.prototype.embedFonts=function(c,f){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(k){try{null!=k&&this.editor.addFontCss(c,k),f(c)}catch(m){f(c)}}))}catch(k){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,k,m,t,x,y,F,E,C,S,U,Q){E=null!=E?E:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(q){Editor.addRetryToError(q,mxUtils.bind(this,function(){this.exportImage(c,f,k,m,t,x,y,F,E,C,S,U,Q)}));this.handleError(q)}))){var O=this.editor.graph.isSelectionEmpty();+k=null!=k?k:O;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(q){this.spinner.stop();try{this.saveCanvas(q,t?this.getFileData(!0,null,null,null,k,F,null,null,null,null,null,c,x):null,E,null==this.pages||0==this.pages.length,S)}catch(u){this.handleError(u)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}),null,k,c||1,f,m,null,null,x,y,C,U,Q)}catch(q){this.spinner.stop(),this.handleError(q)}}};+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,m,t,x,y){f=null!=f?f:0;k=null!=k?k:0;var F=[];try{var E=this.editor.graph;if(null!=c&&0<c.length){E.model.beginUpdate();try{var C=mxUtils.parseXml(c);c={};var S=this.editor.extractGraphModel(C.documentElement,+null!=this.pages);if(null!=S&&"mxfile"==S.nodeName&&null!=this.pages){var U=S.getElementsByTagName("diagram");if(1==U.length&&!x){if(S=Editor.parseDiagramNode(U[0]),null!=this.currentPage&&(c[U[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var Q=U[0].getAttribute("name");null!=Q&&""!=Q&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,Q))}}else if(0<U.length){x=[];var O=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[U[0].getAttribute("id")]=+this.pages[0].getId(),Q=U[0].getAttribute("name"),null!=Q&&""!=Q&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],Q)),S=Editor.parseDiagramNode(U[0]),m=!1,O=1);for(;O<U.length;O++){var q=U[O].getAttribute("id");U[O].removeAttribute("id");var u=this.updatePageRoot(new DiagramPage(U[O]));c[q]=U[O].getAttribute("id");var I=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[I+1]));E.model.execute(new ChangePage(this,u,u,I,!0));x.push(u)}this.updatePageLinks(c,+x)}}if(null!=S&&"mxGraphModel"===S.nodeName){F=E.importGraphModel(S,f,k,m);if(null!=F)for(this.addLocalPagesToMapping(c),O=0;O<F.length;O++)this.updatePageLinksForCell(c,F[O]);var G=E.parseBackgroundImage(S.getAttribute("backgroundImage"));if(null!=G&&null!=G.originalSrc){this.updateBackgroundPageLink(c,G);var H=new ChangePageSetup(this,null,G);H.ignoreColor=!0;E.model.execute(H)}}y&&E.pasteCellStyles(E.includeDescendants(F),E.defaultVertexStyle,E.defaultEdgeStyle)}finally{E.model.endUpdate()}}}catch(g){if(t)throw g;this.handleError(g)}return F};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var k=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=k&&(f.originalSrc="data:page/id,"+k)}}catch(m){}};EditorUi.prototype.updatePageLinksForCell=-function(c,f){var k=document.createElement("div"),m=this.editor.graph,t=m.getLinkForCell(f);null!=t&&m.setLinkForCell(f,this.updatePageLink(c,t));if(m.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(m.getLabel(f));for(var v=k.getElementsByTagName("a"),y=!1,F=0;F<v.length;F++)t=v[F].getAttribute("href"),null!=t&&(v[F].setAttribute("href",this.updatePageLink(c,t)),y=!0);y&&m.labelChanged(f,k.innerHTML)}for(F=0;F<m.model.getChildCount(f);F++)this.updatePageLinksForCell(c,m.model.getChildAt(f,F))};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 m=JSON.parse(f.substring(17));if(null!=m.actions){for(var t=0;t<m.actions.length;t++){var v=m.actions[t];if(null!=v.open&&Graph.isPageLink(v.open)){var y=v.open.substring(v.open.indexOf(",")+1);k=c[y];null!=k?v.open="data:page/id,"+k:null==this.getPageById(y)&&delete v.open}}f="data:action/json,"+JSON.stringify(m)}}catch(F){}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,m,t){var v=mxUtils.bind(this,function(y){this.loadingExtensions=!1;null!=k?k(y):this.handleError(y)});this.createTimeout(null,mxUtils.bind(this,function(y){m=null!=m?m:c.name;var F=mxUtils.bind(this,function(C){y.clear()&&v(C)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var C=this.isRemoteVisioFormat(m);+function(c,f){var k=document.createElement("div"),m=this.editor.graph,t=m.getLinkForCell(f);null!=t&&m.setLinkForCell(f,this.updatePageLink(c,t));if(m.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(m.getLabel(f));for(var x=k.getElementsByTagName("a"),y=!1,F=0;F<x.length;F++)t=x[F].getAttribute("href"),null!=t&&(x[F].setAttribute("href",this.updatePageLink(c,t)),y=!0);y&&m.labelChanged(f,k.innerHTML)}for(F=0;F<m.model.getChildCount(f);F++)this.updatePageLinksForCell(c,m.model.getChildAt(f,F))};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 m=JSON.parse(f.substring(17));if(null!=m.actions){for(var t=0;t<m.actions.length;t++){var x=m.actions[t];if(null!=x.open&&Graph.isPageLink(x.open)){var y=x.open.substring(x.open.indexOf(",")+1);k=c[y];null!=k?x.open="data:page/id,"+k:null==this.getPageById(y)&&delete x.open}}f="data:action/json,"+JSON.stringify(m)}}catch(F){}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,m,t){var x=mxUtils.bind(this,function(y){this.loadingExtensions=!1;null!=k?k(y):this.handleError(y)});this.createTimeout(null,mxUtils.bind(this,function(y){m=null!=m?m:c.name;var F=mxUtils.bind(this,function(C){y.clear()&&x(C)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var C=this.isRemoteVisioFormat(m);try{var S=m.lastIndexOf(".");if(0<=S&&S<m.length)m.substring(S+1).toUpperCase();else{var U=m.lastIndexOf("/");0<=U&&U<m.length&&(m=m.substring(U+1))}}catch(O){}if(C)if(null==VSS_CONVERT_URL||this.isOffline())F({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{C=new FormData;C.append("file1",c,m);var Q=new XMLHttpRequest;Q.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(m)?"?stencil=1":""));Q.responseType="blob";this.addRemoteServiceSecurityCheck(Q);null!=t&&Q.setRequestHeader("x-convert-custom",t);Q.onreadystatechange=mxUtils.bind(this,function(){if(4==Q.readyState&&y.clear())if(200<=Q.status&&299>=Q.status)try{var O=Q.response;if("text/xml"==O.type){var q=new FileReader;q.onload=mxUtils.bind(this,function(u){try{f(u.target.result)}catch(I){F({message:mxResources.get("errorLoadingFile")})}});q.readAsText(O)}else this.doImportVisio(O,f,F,m)}catch(u){F(u)}else try{""==Q.responseType||"text"==Q.responseType?F({message:Q.responseText}):(q=new FileReader,-q.onload=function(){try{F({message:JSON.parse(q.result).Message})}catch(u){null!=q.result&&0<q.result.length?F({message:q.result}):F(u)}},q.readAsText(Q.response))}catch(u){F({})}});Q.send(C)}else if(y.clear())try{this.doImportVisio(c,f,F,m)}catch(O){F(O)}}else F({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,F))}),v)};-EditorUi.prototype.importGraphML=function(c,f,k){var m=mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var v=mxUtils.bind(this,function(F){t.clear()&&m(F)}),y=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,m)}catch(F){v(F)}else v({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||-this.isOffline(!0)?y():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",y,null,null,null,v))}),m)};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 m=mxUtils.bind(this,function(v){k.clear()&&f(v)}),t=mxUtils.bind(this,function(){this.loadingExtensions=-!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||m({message:mxResources.get("unknownError")})}catch(v){m(v)}else m({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(t,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,m))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};-EditorUi.prototype.convertLucidChart=function(c,f,k){var m=mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var v=mxUtils.bind(this,function(F){t.clear()&&m(F)}),y=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if("undefined"!==typeof window.LucidImporter)try{var F=JSON.parse(c);f(LucidImporter.importState(F));try{if(null!=window.console&&"1"==urlParams.test){var E=[(new Date).toISOString(),-"convertLucidChart",F];null!=F.state&&E.push(JSON.parse(F.state));if(null!=F.svgThumbs)for(var C=0;C<F.svgThumbs.length;C++)E.push(Editor.createSvgDataUri(F.svgThumbs[C]));null!=F.thumb&&E.push(F.thumb);console.log.apply(console,E)}}catch(S){}}catch(S){null!=window.console&&console.error(S),v(S)}else v({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(y,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",y,null,null,null,v)},null,null,null,v)},null,null,null,v)},null,null,null,v)},null,null,null,v):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",y,null,null,null,v))}),m)};EditorUi.prototype.createMermaidXml=function(c,f,k,-m,t,v){var y=new Graph(document.createElement("div"));k=y.insertVertex(null,null,null,0,0,m,t,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");y.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=v&&y.setAttributeForCell(k,"templatePrompt",v);c=(new mxCodec).encode(y.getModel());return mxUtils.getXml(c)};EditorUi.prototype.getSvgForXml=function(c){var f=null,k=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(k.container),-(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,k.getModel()),f=k.getSvg(null,null,null,null,null,null,null,null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(k.container)}return f};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k,m,t){var v=0,y=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(F){var E="";if(null!=this.drive&&null!=this.drive.getUser()){var C=this.drive.getUser();+q.onload=function(){try{F({message:JSON.parse(q.result).Message})}catch(u){null!=q.result&&0<q.result.length?F({message:q.result}):F(u)}},q.readAsText(Q.response))}catch(u){F({})}});Q.send(C)}else if(y.clear())try{this.doImportVisio(c,f,F,m)}catch(O){F(O)}}else F({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,F))}),x)};+EditorUi.prototype.importGraphML=function(c,f,k){var m=mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var x=mxUtils.bind(this,function(F){t.clear()&&m(F)}),y=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,m)}catch(F){x(F)}else x({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||+this.isOffline(!0)?y():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",y,null,null,null,x))}),m)};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 m=mxUtils.bind(this,function(x){k.clear()&&f(x)}),t=mxUtils.bind(this,function(){this.loadingExtensions=+!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||m({message:mxResources.get("unknownError")})}catch(x){m(x)}else m({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(t,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,m))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};+EditorUi.prototype.convertLucidChart=function(c,f,k){var m=mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var x=mxUtils.bind(this,function(F){t.clear()&&m(F)}),y=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if("undefined"!==typeof window.LucidImporter)try{var F=JSON.parse(c);f(LucidImporter.importState(F));try{if(null!=window.console&&"1"==urlParams.test){var E=[(new Date).toISOString(),+"convertLucidChart",F];null!=F.state&&E.push(JSON.parse(F.state));if(null!=F.svgThumbs)for(var C=0;C<F.svgThumbs.length;C++)E.push(Editor.createSvgDataUri(F.svgThumbs[C]));null!=F.thumb&&E.push(F.thumb);console.log.apply(console,E)}}catch(S){}}catch(S){null!=window.console&&console.error(S),x(S)}else x({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(y,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",y,null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",y,null,null,null,x))}),m)};EditorUi.prototype.createMermaidXml=function(c,f,k,+m,t,x){var y=new Graph(document.createElement("div"));k=y.insertVertex(null,null,null,0,0,m,t,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+k+";");y.setAttributeForCell(k,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=x&&y.setAttributeForCell(k,"templatePrompt",x);c=(new mxCodec).encode(y.getModel());return mxUtils.getXml(c)};EditorUi.prototype.getSvgForXml=function(c){var f=null,k=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(k.container),+(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,k.getModel()),f=k.getSvg(null,null,null,null,null,null,null,null,null,null,null,null,null,null,!0,!0)}finally{document.body.removeChild(k.container)}return f};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k,m,t){var x=0,y=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(F){var E="";if(null!=this.drive&&null!=this.drive.getUser()){var C=this.drive.getUser();null!=C.email&&0<C.email.indexOf("@")&&(E=C.email.substring(C.email.indexOf("@")+1))}var S={prompt:c,driveDomain:E,options:null!=t?t:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"enableParser",m,"data",[S],"url",["https://www.draw.io/generate/v3"]);var U=Date.now();E=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(S),"POST");var Q=mxUtils.bind(this,function(q){F.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[S],"error",[q],"time",-Date.now()-U+" ms"),k(q))}),O=mxUtils.bind(this,function(q){3>v++?F.clear()&&y():Q(q)});E.send(mxUtils.bind(this,function(q){if(F.isAlive())if(200<=q.getStatus()&&299>=q.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var I=q.getText();try{I=JSON.parse(I),result=I.result}catch(G){result=I}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[S],"response",[I],"time",Date.now()-U+" ms");m?"<"==result.charAt(0)?F.clear()&&(I=Editor.extractGraphModelFromText(result),f(null!=+Date.now()-U+" ms"),k(q))}),O=mxUtils.bind(this,function(q){3>x++?F.clear()&&y():Q(q)});E.send(mxUtils.bind(this,function(q){if(F.isAlive())if(200<=q.getStatus()&&299>=q.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var I=q.getText();try{I=JSON.parse(I),result=I.result}catch(G){result=I}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[S],"response",[I],"time",Date.now()-U+" ms");m?"<"==result.charAt(0)?F.clear()&&(I=Editor.extractGraphModelFromText(result),f(null!=I&&3==I.length?I[1]:result)):this.parseMermaidDiagram(result,null,mxUtils.bind(this,function(G){this.tryAndHandle(mxUtils.bind(this,function(){F.clear()&&f(G)}),Q)}),Q,O,!0):this.generateMermaidImage(result,null,mxUtils.bind(this,function(G,H,g){this.tryAndHandle(mxUtils.bind(this,function(){F.clear()&&f(result,G,H,g)}),Q)}),Q,O)}),Q,!0);else{var u={message:mxResources.get("error")+" "+q.getStatus()};try{u=JSON.parse(q.getText()),null!=u.error&&(u.message=u.error)}catch(I){}Q(u)}}),Q)}),k)});y()};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("%%");f=1<f.length?f:c.split("(Begins)");c=mxUtils.trim(1>=f.length?c:f[1]);f=c.split("\n");var k=1<f.length?f[1]:null;if(null!=k){var m=k.indexOf("-");0<m&&(k=k.substring(0,m))}if(0<f.length&&"mermaid"==mxUtils.trim(f[0])||null!=k&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k))f.shift(),c=mxUtils.trim(f.join("\n")),f=c.split("\n");k=f[0].split(" ")[0].replace(/:$/,"");m=k.indexOf("-");0<m&&(k=k.substring(0,m));0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k)&&(c=null);return c};EditorUi.prototype.isSupportedMermaidDiagramType=function(c){return"graph"==c||"flowchart"==c||"sequencediagram"==c||"classdiagram"==c||"statediagram-v2"==c||"statediagram"==c||"erdiagram"==c||"requirementdiagram"==c||"gitgraph"==c||"mindmap"==c||"journey"==c};EditorUi.prototype.getMermaidDiagramType=-function(c){c=c.split("\n");for(var f=0;f<c.length&&(0==c[f].trim().length||"%%"==c[f].substring(0,2));)f++;if("---"==c[f].trim()){do f++;while(f<c.length&&"---"!=c[f].trim());f++}c=c[f].trim().toLowerCase();f=c.indexOf(" ");return c.substring(0,0<f?f:c.length)};EditorUi.prototype.parseMermaidDiagram=function(c,f,k,m,t,v){var y=!1;v&&"undefined"!==typeof mxMermaidToDrawio&&this.isSupportedMermaidDiagramType(this.getMermaidDiagramType(c))&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(F){y||+function(c){c=c.split("\n");for(var f=0;f<c.length&&(0==c[f].trim().length||"%%"==c[f].substring(0,2));)f++;if("---"==c[f].trim()){do f++;while(f<c.length&&"---"!=c[f].trim());f++}c=c[f].trim().toLowerCase();f=c.indexOf(" ");return c.substring(0,0<f?f:c.length)};EditorUi.prototype.parseMermaidDiagram=function(c,f,k,m,t,x){var y=!1;x&&"undefined"!==typeof mxMermaidToDrawio&&this.isSupportedMermaidDiagramType(this.getMermaidDiagramType(c))&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(F){y||F==this.emptyDiagramXml||(y=!0,k(F))}));this.generateMermaidImage(c,f,mxUtils.bind(this,function(F,E,C){y||(y=!0,k(this.createMermaidXml(c,f,F,E,C)))}),m,t)};EditorUi.prototype.loadMermaid=function(c,f){var k=mxUtils.bind(this,function(t){this.loadingMermaid=!1;f(t)}),m=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(t){k(t)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(m,0):(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",-m,null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",m,null,null,null,k))};EditorUi.prototype.mermaidSvgToDataUri=function(c,f,k,m){try{c=c.replace(/xlink:href/g,"href").replace(/<br>/g,"<br/>");var t=mxUtils.parseXml(c).getElementsByTagName("svg");if(0<t.length&&"error"!=t[0].getAttribute("aria-roledescription")){var v=parseFloat(t[0].getAttribute("width")),y=parseFloat(t[0].getAttribute("height"));if(isNaN(v)||isNaN(y))try{var F=t[0].getAttribute("viewBox").split(/\s+/);-v=parseFloat(F[2]);y=parseFloat(F[3])}catch(E){v=v||100,y=y||100}f(this.convertDataUri(Editor.createSvgDataUri(c)),v,y)}else null!=m?m():k({message:mxResources.get("invalidInput")})}catch(E){k(E)}};EditorUi.prototype.getMermaidConfig=function(c,f){f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;f.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&f.flowchart&&0<=c.indexOf("$$")&&(f.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&-(f.theme="dark");return f};EditorUi.prototype.generateMermaidImage=function(c,f,k,m,t){var v=mxUtils.bind(this,function(y){null!=m?m(y):this.handleError(y)});this.loadMermaid(mxUtils.bind(this,function(){try{mermaid.mermaidAPI.initialize(this.getMermaidConfig(c,f)),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(mxUtils.bind(this,function(y){this.mermaidSvgToDataUri(y.svg,k,m,t)})).catch(mxUtils.bind(this,function(y){this.removeMermaidErrors();"undefined"!==typeof mxMermaidToDrawio&&-mxMermaidToDrawio.resetListeners();null!=t?t(y):v(y)}))}catch(y){v(y)}}),v)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),f=0;f<c.length;f++)null!=c[f].parentNode&&c[f].parentNode.removeChild(c[f])};EditorUi.prototype.generatePlantUmlImage=function(c,f,k,m){function t(F,E,C){c1=F>>2;c2=(F&3)<<4|E>>4;c3=(E&15)<<2|C>>6;c4=C&63;r="";r+=v(c1&63);r+=v(c2&63);r+=v(c3&63);return r+=v(c4&63)}function v(F){if(10>F)return String.fromCharCode(48++m,null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",m,null,null,null,k))};EditorUi.prototype.mermaidSvgToDataUri=function(c,f,k,m){try{c=c.replace(/xlink:href/g,"href").replace(/<br>/g,"<br/>");var t=mxUtils.parseXml(c).getElementsByTagName("svg");if(0<t.length&&"error"!=t[0].getAttribute("aria-roledescription")){var x=parseFloat(t[0].getAttribute("width")),y=parseFloat(t[0].getAttribute("height"));if(isNaN(x)||isNaN(y))try{var F=t[0].getAttribute("viewBox").split(/\s+/);+x=parseFloat(F[2]);y=parseFloat(F[3])}catch(E){x=x||100,y=y||100}f(this.convertDataUri(Editor.createSvgDataUri(c)),x,y)}else null!=m?m():k({message:mxResources.get("invalidInput")})}catch(E){k(E)}};EditorUi.prototype.getMermaidConfig=function(c,f){f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;f.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&f.flowchart&&0<=c.indexOf("$$")&&(f.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&+(f.theme="dark");return f};EditorUi.prototype.generateMermaidImage=function(c,f,k,m,t){var x=mxUtils.bind(this,function(y){null!=m?m(y):this.handleError(y)});this.loadMermaid(mxUtils.bind(this,function(){try{mermaid.mermaidAPI.initialize(this.getMermaidConfig(c,f)),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(mxUtils.bind(this,function(y){this.mermaidSvgToDataUri(y.svg,k,m,t)})).catch(mxUtils.bind(this,function(y){this.removeMermaidErrors();"undefined"!==typeof mxMermaidToDrawio&&+mxMermaidToDrawio.resetListeners();null!=t?t(y):x(y)}))}catch(y){x(y)}}),x)};EditorUi.prototype.removeMermaidErrors=function(){for(var c=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),f=0;f<c.length;f++)null!=c[f].parentNode&&c[f].parentNode.removeChild(c[f])};EditorUi.prototype.generatePlantUmlImage=function(c,f,k,m){function t(F,E,C){c1=F>>2;c2=(F&3)<<4|E>>4;c3=(E&15)<<2|C>>6;c4=C&63;r="";r+=x(c1&63);r+=x(c2&63);r+=x(c3&63);return r+=x(c4&63)}function x(F){if(10>F)return String.fromCharCode(48+F);F-=10;if(26>F)return String.fromCharCode(65+F);F-=26;if(26>F)return String.fromCharCode(97+F);F-=26;return 0==F?"-":1==F?"_":"?"}var y=new XMLHttpRequest;y.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(F){r="";for(i=0;i<F.length;i+=3)r=i+2==F.length?r+t(F.charCodeAt(i),F.charCodeAt(i+1),0):i+1==F.length?r+t(F.charCodeAt(i),0,0):r+t(F.charCodeAt(i),F.charCodeAt(i+1),F.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(y.responseType="blob");y.onload=function(F){if(200<=this.status&&300>this.status)if("txt"==f)k(this.response);else{var E=new FileReader;E.readAsDataURL(this.response);E.onloadend=function(C){var S=new Image;S.onload=function(){try{var U=S.width,Q=S.height;if(0==U&&0==Q){var O=E.result,q=O.indexOf(","),u=decodeURIComponent(escape(atob(O.substring(q+1)))),I=mxUtils.parseXml(u).getElementsByTagName("svg");0<I.length&&(U=parseFloat(I[0].getAttribute("width")),Q=parseFloat(I[0].getAttribute("height")))}k(E.result,-U,Q)}catch(G){m(G)}};S.src=E.result};E.onerror=function(C){m(C)}}else m(F)};y.onerror=function(F){m(F)};y.send()};EditorUi.prototype.insertAsPreText=function(c,f,k){var m=this.editor.graph,t=null;m.getModel().beginUpdate();try{t=m.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),m.updateCellSize(t,!0)}finally{m.getModel().endUpdate()}return t};EditorUi.prototype.insertTextAt=function(c,f,k,m,t,v,y,F){v=null!=v?v:!0;y=null!=y?y:!0;if(null!=c)if(Graph.fileSupport&&+U,Q)}catch(G){m(G)}};S.src=E.result};E.onerror=function(C){m(C)}}else m(F)};y.onerror=function(F){m(F)};y.send()};EditorUi.prototype.insertAsPreText=function(c,f,k){var m=this.editor.graph,t=null;m.getModel().beginUpdate();try{t=m.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),m.updateCellSize(t,!0)}finally{m.getModel().endUpdate()}return t};EditorUi.prototype.insertTextAt=function(c,f,k,m,t,x,y,F){x=null!=x?x:!0;y=null!=y?y:!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(Q){4==Q.readyState&&200<=Q.status&&299>=Q.status&&this.editor.graph.setSelectionCells(this.insertTextAt(Q.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(t||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var E=this.editor.graph;if("data:application/pdf;base64,"==-c.substring(0,28)){var C=Editor.extractGraphModelFromPdf(c);if(null!=C&&0<C.length)return this.importXml(C,f,k,v,!0,F)}if(Editor.isPngDataUrl(c)&&(C=Editor.extractGraphModelFromPng(c),null!=C&&0<C.length))return this.importXml(C,f,k,v,!0,F);if("data:image/svg+xml;"==c.substring(0,19))try{C=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(C=c.substring(c.indexOf(",")+1),C=window.atob&&!mxClient.IS_SF?atob(C):Base64.decode(C,!0)):C=decodeURIComponent(c.substring(c.indexOf(",")+1));var S=this.importXml(C,-f,k,v,!0,F);if(0<S.length)return S}catch(Q){}this.loadImage(c,mxUtils.bind(this,function(Q){if("data:"==c.substring(0,5))this.resizeImage(Q,c,mxUtils.bind(this,function(u,I,G){E.setSelectionCell(E.insertVertex(null,null,"",E.snap(f),E.snap(k),I,G,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(u)+";"))}),y,this.maxImageSize);else{var O=Math.min(1,Math.min(this.maxImageSize/Q.width,this.maxImageSize/Q.height)),+c.substring(0,28)){var C=Editor.extractGraphModelFromPdf(c);if(null!=C&&0<C.length)return this.importXml(C,f,k,x,!0,F)}if(Editor.isPngDataUrl(c)&&(C=Editor.extractGraphModelFromPng(c),null!=C&&0<C.length))return this.importXml(C,f,k,x,!0,F);if("data:image/svg+xml;"==c.substring(0,19))try{C=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(C=c.substring(c.indexOf(",")+1),C=window.atob&&!mxClient.IS_SF?atob(C):Base64.decode(C,!0)):C=decodeURIComponent(c.substring(c.indexOf(",")+1));var S=this.importXml(C,+f,k,x,!0,F);if(0<S.length)return S}catch(Q){}this.loadImage(c,mxUtils.bind(this,function(Q){if("data:"==c.substring(0,5))this.resizeImage(Q,c,mxUtils.bind(this,function(u,I,G){E.setSelectionCell(E.insertVertex(null,null,"",E.snap(f),E.snap(k),I,G,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(u)+";"))}),y,this.maxImageSize);else{var O=Math.min(1,Math.min(this.maxImageSize/Q.width,this.maxImageSize/Q.height)),q=Math.round(Q.width*O);Q=Math.round(Q.height*O);E.setSelectionCell(E.insertVertex(null,null,"",E.snap(f),E.snap(k),q,Q,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var Q=null;E.getModel().beginUpdate();try{Q=E.insertVertex(E.getDefaultParent(),null,c,E.snap(f),E.snap(k),1,1,"text;"+(m?"html=1;":"")),E.updateCellSize(Q),E.fireEvent(new mxEventObject("textInserted","cells",[Q]))}finally{E.getModel().endUpdate()}E.setSelectionCell(Q)}))}else{c=-Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,v,null,F);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(Q){this.editor.graph.setSelectionCells(this.importXml(Q,f,k,v,null,F))}),mxUtils.bind(this,function(Q){this.handleError(Q)}));else{E=this.editor.graph;t=null;E.getModel().beginUpdate();try{t=E.insertVertex(E.getDefaultParent(),null,"",E.snap(f),E.snap(k),1,1,"text;whiteSpace=wrap;"+(m?"html=1;":""));E.fireEvent(new mxEventObject("textInserted",+Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,x,null,F);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(Q){this.editor.graph.setSelectionCells(this.importXml(Q,f,k,x,null,F))}),mxUtils.bind(this,function(Q){this.handleError(Q)}));else{E=this.editor.graph;t=null;E.getModel().beginUpdate();try{t=E.insertVertex(E.getDefaultParent(),null,"",E.snap(f),E.snap(k),1,1,"text;whiteSpace=wrap;"+(m?"html=1;":""));E.fireEvent(new mxEventObject("textInserted","cells",[t]));m&&(c=E.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");t.value=c;E.updateCellSize(t);if(0<this.maxTextWidth&&t.geometry.width>this.maxTextWidth){var U=E.getPreferredSizeForCell(t,this.maxTextWidth);t.geometry.width=U.width;t.geometry.height=U.height}Graph.isLink(t.value)&&E.setLinkForCell(t,t.value);t.geometry.width+=E.gridSize;t.geometry.height+=E.gridSize}finally{E.getModel().endUpdate()}return[t]}}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(y,F){StorageFile.listFiles(this,"F",y,F)});window.openBrowserFile=mxUtils.bind(this,function(y,F,E){StorageFile.getFileContent(this,y,F,E)});window.deleteBrowserFile=mxUtils.bind(this,function(y,F,E){StorageFile.deleteFile(this,y,F,E)});if(!f){var m=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(y){this.hideDialog(y)}));window.openFile.setConsumer(mxUtils.bind(this,-function(y,F){null!=F&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(F)?(y=new Blob([y],{type:"application/octet-stream"}),this.importVisio(y,mxUtils.bind(this,function(E){this.importXml(E,0,0,!0)}),null,F)):this.editor.graph.setSelectionCells(this.importXml(y,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 t=this.dialog,v=t.close;this.dialog.close=mxUtils.bind(this,function(y){Editor.useLocalStorage=-m;v.apply(t,arguments);y&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var m=this,t=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(v){if(mxUtils.isEmptyObject(v.files))k();else{var y=0,F,E=!1;v.forEach(function(C,S){C=S.name.toLowerCase();"diagram/diagram.xml"==C?(E=!0,S.async("string").then(function(U){0==U.indexOf("<mxfile ")?f(U):k()})):0==C.indexOf("versions/")&&-(C=parseInt(C.substr(9)),C>y&&(y=C,F=S))});0<y?F.async("string").then(function(C){(new XMLHttpRequest).upload&&m.isRemoteFileFormat(C,c.name)?m.isOffline()?m.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):m.parseFileData(C,mxUtils.bind(this,function(S){4==S.readyState&&(200<=S.status&&299>=S.status?f(S.responseText):k())}),c.name):k()}):E||k()}},function(v){k(v)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?t():(this.loadingExtensions=!0,-mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,m,t,v,y,F,E,C,S,U){C=null!=C?C:!0;var Q=!1,O=null,q=mxUtils.bind(this,function(u){var I=null;null!=u&&"<mxlibrary"==u.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,u,y)),this.showSidebar()):I=this.importXml(u,k,m,C,null,null!=U?mxEvent.isControlDown(U):null);null!=F&&F(I)});"image"==f.substring(0,5)?(E=!1,"image/png"==f.substring(0,9)&&(S=S?null:this.extractGraphModelFromPng(c),-null!=S&&0<S.length&&(O=this.importXml(S,k,m,C,null,null!=U?mxEvent.isControlDown(U):null),E=!0)),E||(E=this.editor.graph,S=c.indexOf(";"),0<S&&(c=c.substring(0,S)+c.substring(c.indexOf(",",S+1))),C&&E.isGridEnabled()&&(k=E.snap(k),m=E.snap(m)),S="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(S+="editableCssRules=.*;"),O=[E.insertVertex(null,null,"",k,m,t,v,S+"image="+c+";")])):/(\.*<graphml )/.test(c)?+function(y,F){null!=F&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(F)?(y=new Blob([y],{type:"application/octet-stream"}),this.importVisio(y,mxUtils.bind(this,function(E){this.importXml(E,0,0,!0)}),null,F)):this.editor.graph.setSelectionCells(this.importXml(y,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 t=this.dialog,x=t.close;this.dialog.close=mxUtils.bind(this,function(y){Editor.useLocalStorage=+m;x.apply(t,arguments);y&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var m=this,t=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(x){if(mxUtils.isEmptyObject(x.files))k();else{var y=0,F,E=!1;x.forEach(function(C,S){C=S.name.toLowerCase();"diagram/diagram.xml"==C?(E=!0,S.async("string").then(function(U){0==U.indexOf("<mxfile ")?f(U):k()})):0==C.indexOf("versions/")&&+(C=parseInt(C.substr(9)),C>y&&(y=C,F=S))});0<y?F.async("string").then(function(C){(new XMLHttpRequest).upload&&m.isRemoteFileFormat(C,c.name)?m.isOffline()?m.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):m.parseFileData(C,mxUtils.bind(this,function(S){4==S.readyState&&(200<=S.status&&299>=S.status?f(S.responseText):k())}),c.name):k()}):E||k()}},function(x){k(x)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?t():(this.loadingExtensions=!0,+mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,m,t,x,y,F,E,C,S,U){C=null!=C?C:!0;var Q=!1,O=null,q=mxUtils.bind(this,function(u){var I=null;null!=u&&"<mxlibrary"==u.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,u,y)),this.showSidebar()):I=this.importXml(u,k,m,C,null,null!=U?mxEvent.isControlDown(U):null);null!=F&&F(I)});"image"==f.substring(0,5)?(E=!1,"image/png"==f.substring(0,9)&&(S=S?null:this.extractGraphModelFromPng(c),+null!=S&&0<S.length&&(O=this.importXml(S,k,m,C,null,null!=U?mxEvent.isControlDown(U):null),E=!0)),E||(E=this.editor.graph,S=c.indexOf(";"),0<S&&(c=c.substring(0,S)+c.substring(c.indexOf(",",S+1))),C&&E.isGridEnabled()&&(k=E.snap(k),m=E.snap(m)),S="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(S+="editableCssRules=.*;"),O=[E.insertVertex(null,null,"",k,m,t,x,S+"image="+c+";")])):/(\.*<graphml )/.test(c)?(Q=!0,this.importGraphML(c,q)):null!=E&&null!=y&&EditorUi.isVisioFilename(y)?(Q=!0,this.importVisio(E,q)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,y)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(Q=!0,f=mxUtils.bind(this,function(u){4==u.readyState&&(200<=u.status&&299>=u.status?q(u.responseText):null!=F&&(F(null),this.showError(mxResources.get("error"),413==u.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),-null!=c?this.parseFileData(c,f,y):this.parseFile(E,f,y)):0==c.indexOf("PK")&&null!=E?(Q=!0,this.importZipFile(E,q,mxUtils.bind(this,function(){O=this.insertTextAt(this.validateFileData(c),k,m,!0,null,C);F(O)}))):/(\.v(sd|dx))($|\?)/i.test(y)||/(\.vs(s|x))($|\?)/i.test(y)||(O=this.insertTextAt(this.validateFileData(c),k,m,!0,null,C,null,null!=U?mxEvent.isControlDown(U):null));Q||null==F||F(O);return O};EditorUi.prototype.importFiles=function(c,f,k,m,t,v,y,F,E,C,S,U,Q){m=null!=m?m:this.maxImageSize;+null!=c?this.parseFileData(c,f,y):this.parseFile(E,f,y)):0==c.indexOf("PK")&&null!=E?(Q=!0,this.importZipFile(E,q,mxUtils.bind(this,function(){O=this.insertTextAt(this.validateFileData(c),k,m,!0,null,C);F(O)}))):/(\.v(sd|dx))($|\?)/i.test(y)||/(\.vs(s|x))($|\?)/i.test(y)||(O=this.insertTextAt(this.validateFileData(c),k,m,!0,null,C,null,null!=U?mxEvent.isControlDown(U):null));Q||null==F||F(O);return O};EditorUi.prototype.importFiles=function(c,f,k,m,t,x,y,F,E,C,S,U,Q){m=null!=m?m:this.maxImageSize;C=null!=C?C:this.maxImageBytes;var O=null!=f&&null!=k,q=!0;f=null!=f?f:0;k=null!=k?k:0;var u=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var I=S||this.resampleThreshold,G=0;G<c.length;G++)if("image/svg"!==c[G].type.substring(0,9)&&"image/"===c[G].type.substring(0,6)&&c[G].size>I){u=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[k],"maxSize",[m],"maxBytes",[C],"resampleThreshold",[this.resampleThreshold],"largeImages",[u],"crop",[O],"resizeImages",[q],"ignoreEmbeddedXml",[U],"evt",[Q]);var H=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;t=null!=t?t:mxUtils.bind(this,function(T,V,X,W,Y,Z,aa,la,ha){try{if(null!=T&&"<mxlibrary"==T.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,T,aa)),this.showSidebar(),null;this.isCompatibleString(T)&&1==c.length&&null!=Q&&"drop"==Q.type&&this.isBlankFile()&&!this.canUndo()&&(O=!1,W=X=0);return this.importFile(T,V,X,W,Y,Z,aa,la,ha,O,U,Q)}catch(ca){return this.handleError(ca),null}});-v=null!=v?v:mxUtils.bind(this,function(T){g.setSelectionCells(T)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var B=c.length,K=B,M=[],N=mxUtils.bind(this,function(T,V){M[T]=V;if(0==--K){this.spinner.stop();if(null!=F)F(M);else{var X=[];g.getModel().beginUpdate();try{for(T=0;T<M.length;T++){var W=M[T]();null!=W&&(X=X.concat(W))}}finally{g.getModel().endUpdate()}}v(X)}}),R=0;R<B;R++)mxUtils.bind(this,function(T){var V=c[T];if(null!=V){var X=new FileReader;X.onload=mxUtils.bind(this,+x=null!=x?x:mxUtils.bind(this,function(T){g.setSelectionCells(T)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var B=c.length,K=B,M=[],N=mxUtils.bind(this,function(T,V){M[T]=V;if(0==--K){this.spinner.stop();if(null!=F)F(M);else{var X=[];g.getModel().beginUpdate();try{for(T=0;T<M.length;T++){var W=M[T]();null!=W&&(X=X.concat(W))}}finally{g.getModel().endUpdate()}}x(X)}}),R=0;R<B;R++)mxUtils.bind(this,function(T){var V=c[T];if(null!=V){var X=new FileReader;X.onload=mxUtils.bind(this,function(W){if(null==y||y(V))try{if("image/"==V.type.substring(0,6))if("image/svg"==V.type.substring(0,9)){var Y=Graph.clipSvgDataUri(W.target.result),Z=Y.indexOf(","),aa=decodeURIComponent(escape(atob(Y.substring(Z+1)))),la=mxUtils.parseXml(aa),ha=la.getElementsByTagName("svg");if(0<ha.length){var ca=ha[0],ja=U?null:ca.getAttribute("content");null!=ja&&"<"!=ja.charAt(0)&&"%"!=ja.charAt(0)&&(ja=unescape(window.atob?atob(ja):Base64.decode(ja,!0)));null!=ja&&"%"==ja.charAt(0)&&(ja=decodeURIComponent(ja));null==ja||"<mxfile "!==ja.substring(0,8)&&"<mxGraphModel>"!==ja.substring(0,14)&&"<mxGraphModel "!==ja.substring(0,14)?N(T,mxUtils.bind(this,function(){try{if(null!=la){var ea=la.getElementsByTagName("svg");if(0<ea.length){var fa=ea[0],da=fa.getAttribute("width"),qa=fa.getAttribute("height");da=null!=da&&"%"!=da.charAt(da.length-1)?parseFloat(da):NaN;qa=null!=qa&&"%"!=qa.charAt(qa.length-1)?parseFloat(qa):NaN;var oa=fa.getAttribute("viewBox");if(null==oa||0==oa.length)fa.setAttribute("viewBox","0 0 "+da+" "+qa);else if(isNaN(da)||isNaN(qa)){var pa=oa.split(" ");3<pa.length&&(da=parseFloat(pa[2]),qa=parseFloat(pa[3]))}Y=Editor.createSvgDataUri(mxUtils.getXml(fa));var ua=Math.min(1,Math.min(m/Math.max(1,da)),m/Math.max(1,qa)),ia=t(Y,V.type,f+T*p,k+T*p,Math.max(1,Math.round(da*ua)),Math.max(1,Math.round(qa*ua)),V.name);if(null!=ia&&(isNaN(da)||isNaN(qa))){var ma=new Image;ma.onload=mxUtils.bind(this,function(){da=Math.max(1,ma.width);qa=Math.max(1,ma.height);ia[0].geometry.width=da;ia[0].geometry.height=@@ -13264,19 +13264,19 @@ qa;fa.setAttribute("viewBox","0 0 "+da+" "+qa);Y=Editor.createSvgDataUri(mxUtilsif(null!=ka&&0<ka.length){var ba=new Image;ba.src=W.target.result;N(T,mxUtils.bind(this,function(){return t(ka,"text/xml",f+T*p,k+T*p,ba.width,ba.height,V.name)}));Z=!0}}Z||(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(W.target.result,mxUtils.bind(this,function(ea){this.resizeImage(ea,W.target.result,mxUtils.bind(this,function(fa,da,qa){N(T,mxUtils.bind(this,function(){if(null!=fa&&fa.length<C){var oa=q&&this.isResampleImageSize(V.size,S)?Math.min(1,Math.min(m/da,m/qa)):1;return t(fa,V.type,f+T*p,k+T*p,Math.round(da*oa),Math.round(qa*oa),V.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),q,m,S,V.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else Y=W.target.result,t(Y,V.type,f+T*p,k+T*p,240,160,V.name,function(ea){N(T,function(){return ea})},V)}catch(ea){N(T,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ea,V)}else N(T,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(V.name)?t(null,V.type,f+T*p,k+T*p,240,160,V.name,function(W){N(T,function(){return W})},V):"image"==V.type.substring(0,5)||"application/pdf"==V.type?X.readAsDataURL(V):X.readAsText(V)}})(R)});if(u){u=[];for(G=0;G<c.length;G++)u.push(c[G]);-c=u;this.confirmImageResize(function(g){q=g;H()},E)}else H()};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(){},m=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,t=function(v,y){if(v||f)mxSettings.setResizeImages(v?-y:null),mxSettings.save();k();c(y)};null==m||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(v){t(v,!0)},function(v){t(v,!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):t(!1,m)};EditorUi.prototype.parseFile=function(c,f,+c=u;this.confirmImageResize(function(g){q=g;H()},E)}else H()};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(){},m=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,t=function(x,y){if(x||f)mxSettings.setResizeImages(x?+y:null),mxSettings.save();k();c(y)};null==m||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(x){t(x,!0)},function(x){t(x,!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):t(!1,m)};EditorUi.prototype.parseFile=function(c,f,k){k=null!=k?k:c.name;var m=new FileReader;m.onload=mxUtils.bind(this,function(){this.parseFileData(m.result,f,k)});m.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,k){var m=new XMLHttpRequest;m.open("POST",OPEN_URL);m.setRequestHeader("Content-Type","application/x-www-form-urlencoded");m.onreadystatechange=function(){f(m)};m.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(t){}};-EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,m,t,v,y){t=null!=t?t:this.maxImageSize;var F=Math.max(1,c.width),E=Math.max(1,c.height),C=f;if(m&&this.isResampleImageSize(null!=y?y:f.length,v))try{var S=Math.max(F/t,E/t);if(1<S){var U=Math.round(F/S),Q=Math.round(E/S),O=document.createElement("canvas");O.width=U;O.height=Q;O.getContext("2d").drawImage(c,0,0,U,Q);var q=O.toDataURL();if(q.length<f.length){var u=-document.createElement("canvas");u.width=U;u.height=Q;var I=u.toDataURL();q!==I&&(f=q,F=U,E=Q)}}}catch(G){}m&&C!=f&&t>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,m,t/1.5,v,y):k(f,F,E)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var m=new Image;m.onload=function(){m.width=0<m.width?m.width:120;m.height=0<m.height?m.height:120;f(m)};null!=k&&(m.onerror=k);m.src=c}catch(t){if(null!=-k)k(t);else throw t;}};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(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());x.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&+EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,m,t,x,y){t=null!=t?t:this.maxImageSize;var F=Math.max(1,c.width),E=Math.max(1,c.height),C=f;if(m&&this.isResampleImageSize(null!=y?y:f.length,x))try{var S=Math.max(F/t,E/t);if(1<S){var U=Math.round(F/S),Q=Math.round(E/S),O=document.createElement("canvas");O.width=U;O.height=Q;O.getContext("2d").drawImage(c,0,0,U,Q);var q=O.toDataURL();if(q.length<f.length){var u=+document.createElement("canvas");u.width=U;u.height=Q;var I=u.toDataURL();q!==I&&(f=q,F=U,E=Q)}}}catch(G){}m&&C!=f&&t>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,m,t/1.5,x,y):k(f,F,E)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var m=new Image;m.onload=function(){m.width=0<m.width?m.width:120;m.height=0<m.height?m.height:120;f(m)};null!=k&&(m.onerror=k);m.src=c}catch(t){if(null!=+k)k(t);else throw t;}};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(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==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,k=f.isEnabled;f.isEnabled=function(){return k.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(p){var B=p.getEvent();return null==p.getState()&&!mxEvent.isMouseEvent(B)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(B)&&(null==p.getState()||mxEvent.isControlDown(B)||mxEvent.isShiftDown(B))});f.cellEditor.editPlantUmlData=function(p,B,K){var M=JSON.parse(K);B=new SimpleTextareaDialog(c,M.data,function(N){null!=N&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(N,M.format,function(R,T,V){c.spinner.stop();f.getModel().beginUpdate();try{if("txt"==M.format)f.labelChanged(p,"<pre>"+R+"</pre>"),f.updateCellSize(p,!0);else{f.setCellStyles("image",c.convertDataUri(R),[p]);var X=f.model.getGeometry(p);null!=X&&(X=X.clone(),X.width=T,X.height=V,f.cellsResized([p],[X],!1))}f.setAttributeForCell(p,"plantUmlData",JSON.stringify({data:N,format:M.format}))}finally{f.getModel().endUpdate()}},function(R){c.handleError(R)})});c.showDialog(B.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));B.init()};f.cellEditor.editMermaidData=function(p,B,K){var M=JSON.parse(K);B=new SimpleTextareaDialog(c,M.data,function(N){null!=N&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(N,M.config,function(R,T,V){c.spinner.stop();f.getModel().beginUpdate();try{f.setCellStyles("image",R,[p]);var X=f.model.getGeometry(p);null!=X&&(X=X.clone(),X.width=Math.max(X.width,T),X.height=Math.max(X.height,V),f.cellsResized([p],[X],!1));f.setAttributeForCell(p,"mermaidData",JSON.stringify({data:N,config:M.config},null,2))}finally{f.getModel().endUpdate()}},function(R){c.handleError(R)})});c.showDialog(B.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));B.init()};var m=f.cellEditor.startEditing;f.cellEditor.startEditing=function(p,B){try{var K=this.graph.getAttributeForCell(p,"plantUmlData");if(null!=K)this.editPlantUmlData(p,B,K);else if(K=this.graph.getAttributeForCell(p,"mermaidData"),null!=K&&window.isMermaidEnabled)this.editMermaidData(p,B,K);else{var M=f.getCellStyle(p);"1"==mxUtils.getValue(M,"metaEdit","0")?c.showDataDialog(p):m.apply(this,arguments)}}catch(N){c.handleError(N)}};f.getLinkTitle=function(p){return c.getLinkTitle(p)};-f.customLinkClicked=function(p,B){var K=!1;try{var M=this.getGraphBounds();c.handleCustomLink(p,B);K=!0;c.chromelessResize&&!M.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(B))}catch(N){c.handleError(N)}return K};var t=f.parseBackgroundImage;f.parseBackgroundImage=function(p){var B=t.apply(this,arguments);null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src});return B};var v=f.setBackgroundImage;f.setBackgroundImage=function(p){null!=p&&null!=p.originalSrc&&-(p=c.createImageForPageLink(p.originalSrc,c.currentPage,this));v.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(p,B){p=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=p){var K=p.indexOf(",");if(0<K)for(p=p.substring(K+1),B=B.getProperty("patches"),+f.customLinkClicked=function(p,B){var K=!1;try{var M=this.getGraphBounds();c.handleCustomLink(p,B);K=!0;c.chromelessResize&&!M.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(B))}catch(N){c.handleError(N)}return K};var t=f.parseBackgroundImage;f.parseBackgroundImage=function(p){var B=t.apply(this,arguments);null!=B&&null!=B.src&&Graph.isPageLink(B.src)&&(B={originalSrc:B.src});return B};var x=f.setBackgroundImage;f.setBackgroundImage=function(p){null!=p&&null!=p.originalSrc&&+(p=c.createImageForPageLink(p.originalSrc,c.currentPage,this));x.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(p,B){p=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=p){var K=p.indexOf(",");if(0<K)for(p=p.substring(K+1),B=B.getProperty("patches"),K=0;K<B.length;K++)if(null!=B[K][EditorUi.DIFF_UPDATE]&&null!=B[K][EditorUi.DIFF_UPDATE][p]||null!=B[K][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(B[K][EditorUi.DIFF_REMOVE],p)){f.refreshBackgroundImage();break}}}));var y=f.getBackgroundImageObject;f.getBackgroundImageObject=function(p,B,K){var M=y.apply(this,arguments);null!=M&&null!=M.originalSrc&&(M=B?c.createImageForPageLink(M.originalSrc,K,null,!0):{src:M.originalSrc});return M};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 F=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(p){p=null!=p?p:"";"1"==urlParams.dev&&(p+=(0<p.length?"&":"?")+"dev=1");return F.apply(this,arguments)};var E=f.addClickHandler;f.addClickHandler=function(p,B,K){var M=B;B=function(N,R,T){if(null==R){var V=mxEvent.getSource(N);"a"==V.nodeName.toLowerCase()&&(R=V.getAttribute("href"))}null!=R&&f.isCustomLink(R)&&(mxEvent.isTouchEvent(N)||!mxEvent.isPopupTrigger(N))&&f.customLinkClicked(R,T)&&mxEvent.consume(N);null!=M&&M(N,R,T)};E.call(this,p,B,K)};A.apply(this,arguments);this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var C=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(p,B,K){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(p,["zoomIn",@@ -13309,16 +13309,16 @@ this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightbmxUtils.bind(this,function(p,B){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){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));this.lastWindowWidth=c}z.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,m=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(C){mxEvent.getSource(C)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(C),mxEvent.getClientY(C)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var t=document.createElement("div");t.style.position="absolute";t.style.width="10px";t.style.height="10px";t.style.borderRadius="5px";t.style.border="1px solid gray";t.style.background="#ffffff";t.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(t);-this.bottomResizer=t;var v=null,y=null,F=null,E=null;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(C){E=parseInt(this.diagramContainer.style.height);y=mxEvent.getClientY(C);m.popupMenuHandler.hideMenu();mxEvent.consume(C)}));t=t.cloneNode(!1);t.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(t);this.rightResizer=t;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(C){F=parseInt(this.diagramContainer.style.width);v=mxEvent.getClientX(C);m.popupMenuHandler.hideMenu();-mxEvent.consume(C)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(C){var S=!1;null!=v&&(this.diagramContainer.style.width=Math.max(20,F+mxEvent.getClientX(C)-v)+"px",S=!0);null!=y&&(this.diagramContainer.style.height=Math.max(20,E+mxEvent.getClientY(C)-y)+"px",S=!0);S&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),-function(C){null==v&&null==y||mxEvent.consume(C);y=v=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(C){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",+this.bottomResizer=t;var x=null,y=null,F=null,E=null;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(C){E=parseInt(this.diagramContainer.style.height);y=mxEvent.getClientY(C);m.popupMenuHandler.hideMenu();mxEvent.consume(C)}));t=t.cloneNode(!1);t.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(t);this.rightResizer=t;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(C){F=parseInt(this.diagramContainer.style.width);x=mxEvent.getClientX(C);m.popupMenuHandler.hideMenu();+mxEvent.consume(C)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(C){var S=!1;null!=x&&(this.diagramContainer.style.width=Math.max(20,F+mxEvent.getClientX(C)-x)+"px",S=!0);null!=y&&(this.diagramContainer.style.height=Math.max(20,E+mxEvent.getClientY(C)-y)+"px",S=!0);S&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),+function(C){null==x&&null==y||mxEvent.consume(C);y=x=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(C){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(C){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();document.execCommand("selectAll",!1,null)},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=" ";var m=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(v){var y=mxEvent.getSource(v);null==f.container||!f.isEnabled()||f.isMouseDown||-f.isEditing()||null!=this.dialog||"INPUT"==y.nodeName||"TEXTAREA"==y.nodeName||"true"==y.contentEditable||224!=v.keyCode&&(mxClient.IS_MAC||17!=v.keyCode)&&(!mxClient.IS_MAC||91!=v.keyCode&&93!=v.keyCode)||m||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",v=f.container.scrollLeft,y=f.container.scrollTop,f.container.appendChild(k),m=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=v,f.container.scrollTop=y)}));mxEvent.addListener(document,-"keyup",mxUtils.bind(this,function(v){var y=v.keyCode;window.setTimeout(mxUtils.bind(this,function(){!m||224!=y&&17!=y&&91!=y&&93!=y||(m=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(v){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(y){this.handleError(y)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(v){if(f.isEnabled())try{mxClipboard.copy(f),-this.copyCells(k,!0),c()}catch(y){this.handleError(y)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(v){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=v.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(v,k,!0,!0)),!mxEvent.isConsumed(v)){var y=f.container.scrollLeft,F=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=y,f.container.scrollTop=F,Graph.removePasteFormatting(k.firstChild),-this.pasteCells(v,k,!1,!0)}catch(E){this.handleError(E)}}),0)}}catch(E){this.handleError(E)}}),!0);var t=this.isSelectionAllowed;this.isSelectionAllowed=function(v){return mxEvent.getSource(v)==k?!0:t.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=+"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=" ";var m=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(x){var y=mxEvent.getSource(x);null==f.container||!f.isEnabled()||f.isMouseDown||+f.isEditing()||null!=this.dialog||"INPUT"==y.nodeName||"TEXTAREA"==y.nodeName||"true"==y.contentEditable||224!=x.keyCode&&(mxClient.IS_MAC||17!=x.keyCode)&&(!mxClient.IS_MAC||91!=x.keyCode&&93!=x.keyCode)||m||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",x=f.container.scrollLeft,y=f.container.scrollTop,f.container.appendChild(k),m=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=x,f.container.scrollTop=y)}));mxEvent.addListener(document,+"keyup",mxUtils.bind(this,function(x){var y=x.keyCode;window.setTimeout(mxUtils.bind(this,function(){!m||224!=y&&17!=y&&91!=y&&93!=y||(m=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(x){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(y){this.handleError(y)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(x){if(f.isEnabled())try{mxClipboard.copy(f),+this.copyCells(k,!0),c()}catch(y){this.handleError(y)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(x){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=x.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(x,k,!0,!0)),!mxEvent.isConsumed(x)){var y=f.container.scrollLeft,F=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=y,f.container.scrollTop=F,Graph.removePasteFormatting(k.firstChild),+this.pasteCells(x,k,!1,!0)}catch(E){this.handleError(E)}}),0)}}catch(E){this.handleError(E)}}),!0);var t=this.isSelectionAllowed;this.isSelectionAllowed=function(x){return mxEvent.getSource(x)==k?!0:t.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,m=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,m-=this.embedViewport.y):(k+=this.embedViewport.x,m+=this.embedViewport.y));f={x:k,y:m,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 m=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-m.x;c.y-=c.boundingRect.y-m.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,@@ -13334,17 +13334,17 @@ function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{vamxResources.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,m){k=null!=k?k:"geButton";var t=this.menus.get(c);m=this.menubar.addMenu(mxResources.get(c),t.funct,null,m);m.className=k;m.setAttribute("title",mxResources.get(c));this.menus.menuCreated(t,m,k);null!=f&&(m.style.backgroundImage="url("+f+")",m.innerText="");return m};EditorUi.prototype.addButton=function(c,f,k,m){c=this.createToolbarButton(c,f,k);m=null!=m?m:this.container;m.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,k){var m=document.createElement("a");m.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(m.style.backgroundImage="url("+c+")");null!=f&&m.setAttribute("title",f);null!=k&&mxEvent.addListener(m,"click",function(t){"disabled"!=m.getAttribute("disabled")&&k(t);mxEvent.consume(t)});mxEvent.preventDefault(m);return m};EditorUi.prototype.createMenuItem=-function(c,f,k){var m=this.actions.get(c),t=null!=m?m.funct:null,v=this.createToolbarButton(f,mxResources.get(c)+(null!=m&&null!=m.shortcut?" ("+m.shortcut+")":""),t);null==m||k||(c=function(){m.isEnabled()?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),m.addListener("stateChanged",c),c());return v};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=Math.max(10,this.diagramContainer.parentNode.clientWidth--256),k="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),f,60,240,k,mxUtils.bind(this,function(v){v.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var m=this.formatWindow.window.toggleMinimized,t=240;this.formatWindow.window.toggleMinimized=function(){m.apply(this,arguments);-this.minimized?(t=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+t-140+"px"):(this.div.style.width=t+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-t+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(v){mxEvent.getSource(v)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));-this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var v=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,y=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>v||690>y)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var D=EditorUi.prototype.toggleFormatPanel;+function(c,f,k){var m=this.actions.get(c),t=null!=m?m.funct:null,x=this.createToolbarButton(f,mxResources.get(c)+(null!=m&&null!=m.shortcut?" ("+m.shortcut+")":""),t);null==m||k||(c=function(){m.isEnabled()?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),m.addListener("stateChanged",c),c());return x};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=Math.max(10,this.diagramContainer.parentNode.clientWidth-+256),k="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),f,60,240,k,mxUtils.bind(this,function(x){x.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var m=this.formatWindow.window.toggleMinimized,t=240;this.formatWindow.window.toggleMinimized=function(){m.apply(this,arguments);+this.minimized?(t=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+t-140+"px"):(this.div.style.width=t+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-t+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(x){mxEvent.getSource(x)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));+this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,y=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>x||690>y)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var D=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):D.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var f=EditorUi.prototype.hsplitPosition;0==f&&(f=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var k=this.hsplitPosition,m=mxUtils.bind(this,function(){this.hsplitPosition=t;this.refresh();this.diagramContainer.scrollLeft-=k-this.hsplitPosition}),-t=c?f:0,v=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(0)":"translateX(-100%)");0!=t&&m();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 "+v+"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&&m()}),1E3*v)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var P=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():P.apply(this,+t=c?f:0,x=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(0)":"translateX(-100%)");0!=t&&m();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&&m()}),1E3*x)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var P=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():P.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(y,F){var E=this.menus.get(y);y=this.createMenuElement(F,mxUtils.bind(this,function(){E.funct.apply(this,arguments)}));y.setAttribute("title",F);y.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";y.className="geButton";c.parentNode.appendChild(y);return y});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 m=document.createElement("span");k.appendChild(m);var t=f("openLibraryFrom","");t.style.borderLeftWidth="1px";t.style.left="50%";t.style.right="0px";var v=document.createElement("span");t.appendChild(v);this.dependsOnLanguage(mxUtils.bind(this,function(){m.innerHTML="";mxUtils.write(m,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));v.innerHTML=-"";mxUtils.write(v,mxResources.get("openLibraryFrom"));t.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),f="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),k="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=+"click",this.actions.get("openLibrary").funct);else{var k=f("newLibrary","");k.style.left="0px";k.style.right="50%";var m=document.createElement("span");k.appendChild(m);var t=f("openLibraryFrom","");t.style.borderLeftWidth="1px";t.style.left="50%";t.style.right="0px";var x=document.createElement("span");t.appendChild(x);this.dependsOnLanguage(mxUtils.bind(this,function(){m.innerHTML="";mxUtils.write(m,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));x.innerHTML=+"";mxUtils.write(x,mxResources.get("openLibraryFrom"));t.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),f="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),k="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),k&&"1"!=urlParams.embedInline?66:10,k&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-f)/2):56,c-6,f-6,mxUtils.bind(this,function(m){this.createShapesPanel(m)}));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.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();@@ -13355,8 +13355,8 @@ Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.protonull!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,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))),(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 m=this.diagramContainer.getAttribute("data-bounds");if(null!=m){this.diagramContainer.removeAttribute("data-bounds");var t=m.split(" ");m=mxUtils.getDocumentSize();this.diagramContainer.style.top=t[0];this.diagramContainer.style.left=t[1];var v=parseInt(t[2]);t=parseInt(t[3]);v=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,v):v,m.width-80);t=Math.min(null!=-this.minInlineHeight?Math.max(this.minInlineHeight,t):t,m.height-80);this.diagramContainer.style.width=v+"px";this.diagramContainer.style.height=t+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(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=+"0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var m=this.diagramContainer.getAttribute("data-bounds");if(null!=m){this.diagramContainer.removeAttribute("data-bounds");var t=m.split(" ");m=mxUtils.getDocumentSize();this.diagramContainer.style.top=t[0];this.diagramContainer.style.left=t[1];var x=parseInt(t[2]);t=parseInt(t[3]);x=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,x):x,m.width-80);t=Math.min(null!=+this.minInlineHeight?Math.max(this.minInlineHeight,t):t,m.height-80);this.diagramContainer.style.width=x+"px";this.diagramContainer.style.height=t+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(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?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;f.style.visibility="";c.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-@@ -13370,69 +13370,69 @@ mxUtils.bind(this,function(f){f.key==mxSettings.key&&(mxSettings.load(),ColorDiathis.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(f,k){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());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()})}};EditorUi.prototype.writeImageToClipboard=function(c,f,k,m,t,v){m=null!=m?m:"image/png";var y=null==f||null==k?'<img src="'+-c+'">':'<img src="'+c+'" width="'+f+'" height="'+k+'">',F={"text/html":new Blob([y],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(m)&&(F[m]=this.base64ToBlob(c.substring(c.indexOf(",")+1),m));var E=new ClipboardItem(F);navigator.clipboard.write([E]).then(t)["catch"](v);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",k,"type",m,"html",[y],"data",[F],"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){navigator.clipboard.writeText(c)["catch"](f)};EditorUi.prototype.copySvg=function(c,f,k){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var m=this.editor.graph.getSvg(null,k,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);m.setAttribute("content",f);var t=Editor.createSvgDataUri(mxUtils.getXml(m)),v=parseInt(m.getAttribute("width")),-y=parseInt(m.getAttribute("height"));this.writeImageToClipboard(t,v,y,"image/svg+xml",null,mxUtils.bind(this,function(F){this.handleError(F)}))}}catch(F){this.handleError(F)}};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(m,t){try{this.spinner.stop();var v=this.createImageDataUri(m,f,"png"),y=Math.round(parseInt(t.getAttribute("width"))/-k),F=Math.round(parseInt(t.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[k]);this.writeImageToClipboard(v,y,F,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var E=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(v.substring(v.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(m){this.spinner.stop();+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()})}};EditorUi.prototype.writeImageToClipboard=function(c,f,k,m,t,x){m=null!=m?m:"image/png";var y=null==f||null==k?'<img src="'++c+'">':'<img src="'+c+'" width="'+f+'" height="'+k+'">',F={"text/html":new Blob([y],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(m)&&(F[m]=this.base64ToBlob(c.substring(c.indexOf(",")+1),m));var E=new ClipboardItem(F);navigator.clipboard.write([E]).then(t)["catch"](x);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",k,"type",m,"html",[y],"data",[F],"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){navigator.clipboard.writeText(c)["catch"](f)};EditorUi.prototype.copySvg=function(c,f,k){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var m=this.editor.graph.getSvg(null,k,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);m.setAttribute("content",f);var t=Editor.createSvgDataUri(mxUtils.getXml(m)),x=parseInt(m.getAttribute("width")),+y=parseInt(m.getAttribute("height"));this.writeImageToClipboard(t,x,y,"image/svg+xml",null,mxUtils.bind(this,function(F){this.handleError(F)}))}}catch(F){this.handleError(F)}};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(m,t){try{this.spinner.stop();var x=this.createImageDataUri(m,f,"png"),y=Math.round(parseInt(t.getAttribute("width"))/+k),F=Math.round(parseInt(t.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[k]);this.writeImageToClipboard(x,y,F,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var E=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(x.substring(x.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(m){this.spinner.stop();this.handleError(m)}),null,null,k,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(m){this.handleError(m)}};EditorUi.prototype.copyCells=function(c,f){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var m=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),t=mxUtils.getXml(k.encodeCells(m));mxUtils.setTextContent(c,encodeURIComponent(t));f?(k.removeCells(m,!1),k.lastPasteXml=-null):(k.lastPasteXml=t,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,m,t,v){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",-[f],"compat",[k],"evt",[m],"html",[t],"pt",[v]);t=null!=t?t:!0;var y=this.editor.graph,F=null!=v?v:Editor.pasteAtMousePointer&&y.isMouseInsertPoint()?y.getInsertPoint():null;v=null;y.lastPasteXml==c?null==F&&y.pasteCounter++:(y.lastPasteXml=c,y.pasteCounter=0);var E=y.pasteCounter*y.gridSize;if(k||this.isCompatibleString(c)){y.model.beginUpdate();try{if(v=this.importXml(c,E,E),null!=F){var C=y.getBoundingBoxFromGeometry(v,!0);if(null!=C){var S=Math.round(y.snap(F.x)),U=Math.round(y.snap(F.y));y.cellsMoved(v,-S-C.x,U-C.y)}}}finally{y.model.endUpdate()}y.setSelectionCells(v)}else if(f&&1==y.getSelectionCount()){f=y.getStartEditingCell(y.getSelectionCell(),m);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==y.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])y.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{y.model.beginUpdate();try{y.labelChanged(f,c),Graph.isLink(c)&&y.setLinkForCell(f,c)}finally{y.model.endUpdate()}}y.setSelectionCell(f)}else F=null!=F?F:y.getInsertPoint(),y.isMouseInsertPoint()&&-(E=0,y.lastPasteXml==c&&0<y.pasteCounter&&y.pasteCounter--),v=this.insertTextAt(c,F.x+E,F.y+E,t),y.setSelectionCells(v);y.isSelectionEmpty()||(y.scrollCellToVisible(y.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(y.view.getState(y.getSelectionCell())));return v};EditorUi.prototype.pasteCells=function(c,f,k,m){if(!mxEvent.isConsumed(c)){var t=c.clipboardData,v=this.editor.graph,y=!1,F=f;if(k&&null!=t&&t.getData){var E=t.getData("text/plain"),C=!1;if(null!=E&&0<E.length&&"%3CmxGraphModel%3E"==+null):(k.lastPasteXml=t,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,m,t,x){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",+[f],"compat",[k],"evt",[m],"html",[t],"pt",[x]);t=null!=t?t:!0;var y=this.editor.graph,F=null!=x?x:Editor.pasteAtMousePointer&&y.isMouseInsertPoint()?y.getInsertPoint():null;x=null;y.lastPasteXml==c?null==F&&y.pasteCounter++:(y.lastPasteXml=c,y.pasteCounter=0);var E=y.pasteCounter*y.gridSize;if(k||this.isCompatibleString(c)){y.model.beginUpdate();try{if(x=this.importXml(c,E,E),null!=F){var C=y.getBoundingBoxFromGeometry(x,!0);if(null!=C){var S=Math.round(y.snap(F.x)),U=Math.round(y.snap(F.y));y.cellsMoved(x,+S-C.x,U-C.y)}}}finally{y.model.endUpdate()}y.setSelectionCells(x)}else if(f&&1==y.getSelectionCount()){f=y.getStartEditingCell(y.getSelectionCell(),m);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==y.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])y.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{y.model.beginUpdate();try{y.labelChanged(f,c),Graph.isLink(c)&&y.setLinkForCell(f,c)}finally{y.model.endUpdate()}}y.setSelectionCell(f)}else F=null!=F?F:y.getInsertPoint(),y.isMouseInsertPoint()&&+(E=0,y.lastPasteXml==c&&0<y.pasteCounter&&y.pasteCounter--),x=this.insertTextAt(c,F.x+E,F.y+E,t),y.setSelectionCells(x);y.isSelectionEmpty()||(y.scrollCellToVisible(y.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(y.view.getState(y.getSelectionCell())));return x};EditorUi.prototype.pasteCells=function(c,f,k,m){if(!mxEvent.isConsumed(c)){var t=c.clipboardData,x=this.editor.graph,y=!1,F=f;if(k&&null!=t&&t.getData){var E=t.getData("text/plain"),C=!1;if(null!=E&&0<E.length&&"%3CmxGraphModel%3E"==E.substring(0,18))try{var S=decodeURIComponent(E);this.isCompatibleString(S)&&(C=!0,E=S)}catch(G){}C=C?null:t.getData("text/html");null!=C&&0<C.length?(F=this.parseHtmlData(C),y="text/plain"!=F.getAttribute("data-type")):null!=E&&0<E.length&&(F=document.createElement("div"),mxUtils.setTextContent(F,C))}E=F.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(G){var H=this.editor.graph;H.lastPasteXml==G?H.pasteCounter++:(H.lastPasteXml=G,H.pasteCounter=0);var g=H.pasteCounter*H.gridSize;H.setSelectionCells(this.importXml(G,g,g));H.scrollCellToVisible(H.getSelectionCell())}),mxUtils.bind(this,function(G){this.handleError(G)})),mxEvent.consume(c));else{var U=!1,Q="";Q=y?null!=F.textContent&&"<mxfile"==F.textContent.substring(0,7)&&"</mxfile>"==F.textContent.substring(F.textContent.length-9)||"<mxGraphModel"==F.textContent.substring(0,13)&&"</mxGraphModel>"==F.textContent.substring(F.textContent.length-15)?F.textContent.replace(/\u00a0/g," "):F.innerHTML:mxUtils.trim(null==F.innerText?mxUtils.getTextContent(F):F.innerText);try{var O=Q.lastIndexOf("%3E");0<=O&&O<Q.length-3&&(Q=Q.substring(0,O+3))}catch(G){}try{E=F.getElementsByTagName("span"),(S=null!=E&&0<E.length?mxUtils.trim(decodeURIComponent(E[0].textContent)):decodeURIComponent(Q))&&(this.isCompatibleString(S)||0==S.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(U=!0,Q=S)}catch(G){}S=null;try{if(!U&&""==F.textContent)for(O=0;O<t.items.length;O++){var q=t.items[O];if("file"===q.kind){S=q.getAsFile();break}}}catch(G){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[f.outerHTML],"elt",[F.outerHTML],"useEvent",k,"pasteAsLabel",m,"xml",[Q],"compat",U,"asHtml",y,"data",t,"items",[t.items.length],"files",[t.files.length],"types",[JSON.stringify(t.types)],"blob",[S]);try{if(U||null==S)if(null!=Q&&0<Q.length){if(0==-Q.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var I=mxUtils.bind(this,function(){try{Q=(new MiroImporter).importMiroJson(JSON.parse(Q)),this.pasteXml(Q,m,U,c)}catch(G){console.log("Miro import error:",G)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",I):I()}else this.pasteXml(Q,m,U,c,y);mxEvent.consume(c)}else k||(v.lastPasteXml=null,v.pasteCounter=0);else{var u=v.getInsertPoint();this.importFiles([S],u.x,u.y,this.maxImageSize);mxEvent.consume(c)}}catch(G){this.handleError(G)}}}f.innerHTML=-" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,m,t,v,y){if(null!=k){f.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else k=null!=m?m:null!=t?t:v,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,m=!1,t=null,v=0;v<k.types.length;v++)if("text/"===-k.types[v].substring(0,5)){m=!0;break}for(v=0;v<k.items.length;v++){var y=k.items[v];if("file"===y.kind){t=y.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",m,"file",[t],"editing",c.isEditing());var F=mxUtils.bind(this,function(){try{if(!m&&null!=t){if(c.isEditing())this.importFiles([t],0,0,this.maxImageSize,function(C,S,U,Q,O,q){c.insertImage(C,O,q)},function(){},+Q.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var I=mxUtils.bind(this,function(){try{Q=(new MiroImporter).importMiroJson(JSON.parse(Q)),this.pasteXml(Q,m,U,c)}catch(G){console.log("Miro import error:",G)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",I):I()}else this.pasteXml(Q,m,U,c,y);mxEvent.consume(c)}else k||(x.lastPasteXml=null,x.pasteCounter=0);else{var u=x.getInsertPoint();this.importFiles([S],u.x,u.y,this.maxImageSize);mxEvent.consume(c)}}catch(G){this.handleError(G)}}}f.innerHTML=+" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,m,t,x,y){if(null!=k){f.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else k=null!=m?m:null!=t?t:x,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,m=!1,t=null,x=0;x<k.types.length;x++)if("text/"===+k.types[x].substring(0,5)){m=!0;break}for(x=0;x<k.items.length;x++){var y=k.items[x];if("file"===y.kind){t=y.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",m,"file",[t],"editing",c.isEditing());var F=mxUtils.bind(this,function(){try{if(!m&&null!=t){if(c.isEditing())this.importFiles([t],0,0,this.maxImageSize,function(C,S,U,Q,O,q){c.insertImage(C,O,q)},function(){},function(C){return"image/"==C.type.substring(0,6)},function(C){for(var S=0;S<C.length;S++)C[S]()});else{var E=this.editor.graph.getInsertPoint();this.importFiles([t],E.x,E.y,this.maxImageSize)}mxEvent.consume(f)}}catch(C){}});if(!mxEvent.isConsumed(f)&&!m)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(E){this.readTypeFromClipboardData(E,"image/svg+xml",mxUtils.bind(this,function(C){if(null!=C){C=new Blob([C],{type:"image/svg+xml"});var S=this.editor.graph.getInsertPoint();this.importFiles([C],S.x,S.y,this.maxImageSize)}else F()}),"image")}))["catch"](F);else F()}),!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,m){null!=k?c(k):this.readGraphModelFromImageClipboardData(f,mxUtils.bind(this,-function(t,v,y){null!=t?c(t):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,function(F){c(F,v,y,m,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 m=null,t=null;try{var v=this.parseHtmlData(k);if(null!=v){m="text/plain"!=v.getAttribute("data-type")?v.innerHTML:mxUtils.trim(null==v.innerText?mxUtils.getTextContent(v):v.innerText);-try{var y=m.lastIndexOf("%3E");0<=y&&y<m.length-3&&(m=m.substring(0,y+3))}catch(C){}try{null==m&&(k=null,""==v.textContent&&1==v.children.length&&"IMG"==v.firstChild.nodeName&&(k=v.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?t=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&(t=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(C){}try{var F=v.getElementsByTagName("span"),-E=null!=F&&0<F.length?mxUtils.trim(decodeURIComponent(F[0].textContent)):decodeURIComponent(m);this.isCompatibleString(E)&&(m=E)}catch(C){}}}catch(C){}f(this.isCompatibleString(m)?m:null,t)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,m){var t=null;try{null!=k&&(t=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(v){}this.isCompatibleString(t)?f(t):this.readTypeFromClipboardData(c,-"image/png",mxUtils.bind(this,function(v,y){t=Editor.extractGraphModelFromPng("data:image/png;base64,"+v);this.isCompatibleString(t)?f(t):f(null,m,y)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,k){var m=!1;if(null!=c&&0<c.length)for(var t=0;t<c.length&&!m;t++)(function(v){0<=mxUtils.indexOf(v.types,f)&&(m=!0,v.getType(f).then(mxUtils.bind(this,function(y){if("image/png"==f)y.arrayBuffer().then(function(F){k(btoa(Graph.arrayBufferToString(F)),y)})["catch"](function(){k(null)});+function(t,x,y){null!=t?c(t):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,function(F){c(F,x,y,m,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 m=null,t=null;try{var x=this.parseHtmlData(k);if(null!=x){m="text/plain"!=x.getAttribute("data-type")?x.innerHTML:mxUtils.trim(null==x.innerText?mxUtils.getTextContent(x):x.innerText);+try{var y=m.lastIndexOf("%3E");0<=y&&y<m.length-3&&(m=m.substring(0,y+3))}catch(C){}try{null==m&&(k=null,""==x.textContent&&1==x.children.length&&"IMG"==x.firstChild.nodeName&&(k=x.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?t=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&(t=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(C){}try{var F=x.getElementsByTagName("span"),+E=null!=F&&0<F.length?mxUtils.trim(decodeURIComponent(F[0].textContent)):decodeURIComponent(m);this.isCompatibleString(E)&&(m=E)}catch(C){}}}catch(C){}f(this.isCompatibleString(m)?m:null,t)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,m){var t=null;try{null!=k&&(t=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(x){}this.isCompatibleString(t)?f(t):this.readTypeFromClipboardData(c,+"image/png",mxUtils.bind(this,function(x,y){t=Editor.extractGraphModelFromPng("data:image/png;base64,"+x);this.isCompatibleString(t)?f(t):f(null,m,y)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,k){var m=!1;if(null!=c&&0<c.length)for(var t=0;t<c.length&&!m;t++)(function(x){0<=mxUtils.indexOf(x.types,f)&&(m=!0,x.getType(f).then(mxUtils.bind(this,function(y){if("image/png"==f)y.arrayBuffer().then(function(F){k(btoa(Graph.arrayBufferToString(F)),y)})["catch"](function(){k(null)});else y.text().then(mxUtils.bind(this,function(F){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],"data",[c],"type",[f],"result",[F]);k(F,y)}))["catch"](function(){k(null)})}))["catch"](function(){k(null)}))})(c[t]);m||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 m=null==f.firstChild.nextSibling.innerText?mxUtils.getTextContent(f.firstChild.nextSibling):f.firstChild.nextSibling.innerText;m==f.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(f,m),asHtml=!1)}if(""==f.textContent&&(k=f.getElementsByTagName("img"),1==k.length&&(m=k[0].getAttribute("src"),k=null,null!=m))){if(Editor.isPngDataUrl(m)){var t=Editor.extractGraphModelFromPng(m);null!=t&&0<t.length&&(k=t)}else if("data:image/svg+xml;base64,"==m.substring(0,26)){img=this.base64ToBlob(m.substring(m.indexOf(",")+1),"image/svg+xml");m=Graph.getSvgFromDataUri(m);try{t=mxUtils.parseXml(m).documentElement.getAttribute("content"),this.isCompatibleString(t)&&(k=-t)}catch(v){}}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){var m=330;this.editor.graph.isEnabled()&&(m+=40);null!=this.pages&&1<this.pages.length&&(m+=40,this.editor.graph.isEnabled()||(m+=10));null==f||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(m+=20);this.showDialog((new PrintDialog(this,-c,f,k)).container,320,m,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,m=k.graph,t=this.getPageIndex(this.currentPage),v=null!=t?t+1:1,y=mxUtils.bind(this,function(G,H,g,p){var B=G.useCssTransforms,K=G.currentTranslate,M=G.currentScale,N=G.view.translate,R=G.view.scale;G.useCssTransforms&&(G.useCssTransforms=!1,G.currentTranslate=new mxPoint(0,0),G.currentScale=1,G.view.translate=new mxPoint(0,0),G.view.scale=1);var T=G.getGraphBounds(),V=0,X=0,W=mxRectangle.fromRectangle(G.pageFormat),+t)}catch(x){}}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){var m=330;this.editor.graph.isEnabled()&&(m+=40);null!=this.pages&&1<this.pages.length&&(m+=40,this.editor.graph.isEnabled()||(m+=10));null==f||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(m+=20);this.showDialog((new PrintDialog(this,+c,f,k)).container,320,m,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,m=k.graph,t=this.getPageIndex(this.currentPage),x=null!=t?t+1:1,y=mxUtils.bind(this,function(G,H,g,p){var B=G.useCssTransforms,K=G.currentTranslate,M=G.currentScale,N=G.view.translate,R=G.view.scale;G.useCssTransforms&&(G.useCssTransforms=!1,G.currentTranslate=new mxPoint(0,0),G.currentScale=1,G.view.translate=new mxPoint(0,0),G.view.scale=1);var T=G.getGraphBounds(),V=0,X=0,W=mxRectangle.fromRectangle(G.pageFormat),Y=f.fit||f.crop||!G.pageVisible,Z=f.scale;W.width=Math.ceil(W.width*G.pageScale);W.height=Math.ceil(W.height*G.pageScale);var aa=1;if(f.fit){aa=f.sheetsAcross;var la=f.sheetsDown;isNaN(Z)||(W.width=Math.ceil(W.width*Z),W.height=Math.ceil(W.height*Z));aa=Math.min(W.height*la/(T.height/G.view.scale),W.width*aa/(T.width/G.view.scale))}else aa=isNaN(Z)?1:Z;aa*=1;!Y&&G.pageVisible?(Z=G.getPageLayout(),V-=Z.x*W.width,X-=Z.y*W.height):Y=!0;f.crop&&(f.selection&&(T=m.getBoundingBox(m.getSelectionCells())),W.width=(T.width+1)*aa/G.view.scale,W.height=(T.height+1)*aa/G.view.scale);W.width=Math.ceil(1*W.width);W.height=Math.ceil(1*W.height);p=null!=p?"page/id,"+p:null;if(null==H){H=PrintDialog.createPrintPreview(G,aa,null,0,V,X,Y);H.title=this.getBaseFilename(!0);H.pageSelector=!1;H.mathEnabled=!1;V=f.border;isNaN(V)||(H.pageMargin=V);f.selection&&(H.isCellVisible=function(ka){return G.isCellSelected(ka)});var ha=H.writeHead;H.writeHead=function(ka,ba){ba=null!=ba?ba:"";f.shadows||(ba+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(ba+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=k.fontCss&&(ba+=k.fontCss);ha.apply(this,arguments);for(var ea=G.getCustomFonts(),fa=0;fa<ea.length;fa++){var da=ea[fa].name,qa=ea[fa].url;Graph.isCssFontUrl(qa)?ka.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(qa))+'" charset="UTF-8" type="text/css">'):(ka.writeln('<style type="text/css">'),ka.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(da)+'";\nsrc: url("'+mxUtils.htmlEntities(qa)+'");\n}'),ka.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ca=H.drawBackgroundImage;H.drawBackgroundImage=function(ka){ca.apply(this,arguments);null!=ka.node&&(EditorUi.embedSvgImages(ka.node),m.disableSvgLinks(ka.node,function(ba){ba.setAttribute("href","javascript:void(0)")}))}}var ja=H.addGraphFragment;H.addGraphFragment=function(ka,ba,ea,fa,da,qa){ja.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"),pa=0;pa<oa.length;pa++)G.addSvgShadow(oa[pa])};f.grid&&(H.gridSize=G.gridSize,H.gridSteps=G.view.gridSteps,H.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:G.view.gridColor);H.open(null,null,g,!0,p,W,f.selection?G.getSelectionCells():null)}else{T=G.background;if(null==T||""==T||T==mxConstants.NONE)T="#ffffff";H.backgroundColor=T;H.autoOrigin=Y;f.grid&&(H.gridSize=G.gridSize,H.gridSteps=G.view.gridSteps,H.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:G.view.gridColor);H.appendGraph(G,aa,V,X,g,!0,p,W,f.selection?G.getSelectionCells():null);g=G.getCustomFonts();if(null!=H.wnd)for(W=0;W<g.length;W++)V=g[W].name,X=g[W].url,Graph.isCssFontUrl(X)?H.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(H.wnd.document.writeln('<style type="text/css">'),H.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(V)+'";\nsrc: url("'+-mxUtils.htmlEntities(X)+'");\n}'),H.wnd.document.writeln("</style>"))}B&&(G.useCssTransforms=B,G.currentTranslate=K,G.currentScale=M,G.view.translate=N,G.view.scale=R);return H}),F=f.pagesFrom,E=f.pagesTo,C=!f.allPages;t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{C&&(C=f.selection||F==v&&E==v);if(!C&&null!=this.pages&&this.pages.length){C=0;v=this.pages.length-1;f.allPages||(C=parseInt(F)-1,v=parseInt(E)-1);for(var S=C;S<=v;S++){var U=this.pages[S];F=U==this.currentPage?+mxUtils.htmlEntities(X)+'");\n}'),H.wnd.document.writeln("</style>"))}B&&(G.useCssTransforms=B,G.currentTranslate=K,G.currentScale=M,G.view.translate=N,G.view.scale=R);return H}),F=f.pagesFrom,E=f.pagesTo,C=!f.allPages;t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{C&&(C=f.selection||F==x&&E==x);if(!C&&null!=this.pages&&this.pages.length){C=0;x=this.pages.length-1;f.allPages||(C=parseInt(F)-1,x=parseInt(E)-1);for(var S=C;S<=x;S++){var U=this.pages[S];F=U==this.currentPage?m:null;if(null==F){F=this.createTemporaryGraph(m.stylesheet);F.shapeForegroundColor=m.shapeForegroundColor;F.shapeBackgroundColor=m.shapeBackgroundColor;E=!0;var Q=C=!1,O=null,q=null;null==U.viewState&&null==U.root&&this.updatePageRoot(U);null!=U.viewState&&(E=U.viewState.pageVisible,C=U.viewState.mathEnabled,Q=U.viewState.shadowVisible,O=U.viewState.background,q=U.viewState.backgroundImage,F.pageFormat=U.viewState.pageFormat,F.gridSize=U.viewState.gridSize);null!=q&&null!=q.originalSrc&&(q=this.createImageForPageLink(q.originalSrc,U));F.background=O;F.backgroundImage=null!=q?new mxImage(q.src,q.width,q.height,q.x,q.y):null;F.pageVisible=E;F.mathEnabled=C;F.shadowVisible=Q;var u=F.getGraphBounds;F.getGraphBounds=function(){var G=u.apply(this,arguments),H=this.backgroundImage;if(null!=H&&null!=H.width&&null!=H.height){var g=this.view.translate,p=this.view.scale;G=mxRectangle.fromRectangle(G);G.add(new mxRectangle((g.x+H.x)*p,(g.y+H.y)*p,H.width*p,H.height*p))}return G};var I=F.getGlobalVariable;F.getGlobalVariable=function(G){return"page"==-G?U.getName():"pagenumber"==G?S+1:"pagecount"==G?null!=this.pages?this.pages.length:1:I.apply(this,arguments)};document.body.appendChild(F.container);this.updatePageRoot(U);F.model.setRoot(U.root)}t=y(F,t,S!=v,U.getId());F!=m&&F.container.parentNode.removeChild(F.container)}}else t=y(m);null==t||null==t.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(y=t.wnd.document,c||(t.wnd.IMMEDIATE_PRINT=!0),y.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),+G?U.getName():"pagenumber"==G?S+1:"pagecount"==G?null!=this.pages?this.pages.length:1:I.apply(this,arguments)};document.body.appendChild(F.container);this.updatePageRoot(U);F.model.setRoot(U.root)}t=y(F,t,S!=x,U.getId());F!=m&&F.container.parentNode.removeChild(F.container)}}else t=y(m);null==t||null==t.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(y=t.wnd.document,c||(t.wnd.IMMEDIATE_PRINT=!0),y.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),t.closeDocument(),Graph.rewritePageLinks(t.wnd.document,!0),t.mathEnabled||c||PrintDialog.printPreview(t));return t}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(m){null!=f&&(f.parentNode.removeChild(f),f=null);m.stopPropagation();m.preventDefault()}),mxEvent.addListener(c[k],"dragover",mxUtils.bind(this,function(m){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(f=this.highlightElement());m.stopPropagation();m.preventDefault()})),mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(m){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<m.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(m.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(m)&&!mxEvent.isShiftDown(m)):this.openFiles(m.dataTransfer.files,!0);else{var t=this.extractGraphModelFromEvent(m);if(null==-t){var v=null!=m.dataTransfer?m.dataTransfer:m.clipboardData;null!=v&&(10==document.documentMode||11==document.documentMode?t=v.getData("Text"):(t=null,t=0<=mxUtils.indexOf(v.types,"text/uri-list")?m.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(v.types,"text/html")?v.getData("text/html"):null,null!=t&&0<t.length?(v=document.createElement("div"),v.innerHTML=Graph.sanitizeHtml(t),v=v.getElementsByTagName("img"),0<v.length&&(t=v[0].getAttribute("src"))):0<=mxUtils.indexOf(v.types,"text/plain")&&-(t=v.getData("text/plain"))),null!=t&&(Editor.isPngDataUrl(t)?(t=Editor.extractGraphModelFromPng(t),null!=t&&0<t.length&&this.openLocalFile(t,null,!0)):this.isRemoteFileFormat(t)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(t))).send(mxUtils.bind(this,function(y){200<=y.getStatus()&&299>=y.getStatus()?this.openLocalFile(y.getText(),null,!0):this.showError(mxResources.get("error"),413==y.getStatus()?+t){var x=null!=m.dataTransfer?m.dataTransfer:m.clipboardData;null!=x&&(10==document.documentMode||11==document.documentMode?t=x.getData("Text"):(t=null,t=0<=mxUtils.indexOf(x.types,"text/uri-list")?m.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(x.types,"text/html")?x.getData("text/html"):null,null!=t&&0<t.length?(x=document.createElement("div"),x.innerHTML=Graph.sanitizeHtml(t),x=x.getElementsByTagName("img"),0<x.length&&(t=x[0].getAttribute("src"))):0<=mxUtils.indexOf(x.types,"text/plain")&&+(t=x.getData("text/plain"))),null!=t&&(Editor.isPngDataUrl(t)?(t=Editor.extractGraphModelFromPng(t),null!=t&&0<t.length&&this.openLocalFile(t,null,!0)):this.isRemoteFileFormat(t)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(t))).send(mxUtils.bind(this,function(y){200<=y.getStatus()&&299>=y.getStatus()?this.openLocalFile(y.getText(),null,!0):this.showError(mxResources.get("error"),413==y.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(t)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(t):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(t)))))}else this.openLocalFile(t,null,!0)}m.stopPropagation();m.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,k=0;if(null==c){var m=document.body;var t=document.documentElement;-var v=(m.clientWidth||t.clientWidth)-3;m=Math.max(m.clientHeight||0,t.clientHeight)-3}else m=c.getBoundingClientRect(),f=m.top,k=m.left,v=m.width,m=m.height;t=document.createElement("div");t.style.zIndex=mxPopupMenu.prototype.zIndex+2;t.style.border="3px dotted rgb(254, 137, 12)";t.style.pointerEvents="none";t.style.position="absolute";t.style.top=f+"px";t.style.left=k+"px";t.style.width=Math.max(0,v-3)+"px";t.style.height=Math.max(0,m-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(t):-document.body.appendChild(t);return t};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),m=new mxGraphModel;k.decode(f,m);f=m.getChildAt(m.getRoot(),0);for(k=0;k<m.getChildCount(f);k++)c.push(m.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,m,t,v){if(null!=f&&0<f.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,+var x=(m.clientWidth||t.clientWidth)-3;m=Math.max(m.clientHeight||0,t.clientHeight)-3}else m=c.getBoundingClientRect(),f=m.top,k=m.left,x=m.width,m=m.height;t=document.createElement("div");t.style.zIndex=mxPopupMenu.prototype.zIndex+2;t.style.border="3px dotted rgb(254, 137, 12)";t.style.pointerEvents="none";t.style.position="absolute";t.style.top=f+"px";t.style.left=k+"px";t.style.width=Math.max(0,x-3)+"px";t.style.height=Math.max(0,m-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(t):+document.body.appendChild(t);return t};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),m=new mxGraphModel;k.decode(f,m);f=m.getChildAt(m.getRoot(),0);for(k=0;k<m.getChildCount(f);k++)c.push(m.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,m,t,x){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(E){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==E.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,E,f)),this.showSidebar()}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(E,f,m)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(E){this.spinner.stop();y(E)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(E){this.spinner.stop();y(E)}));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(E){4==E.readyState&&(this.spinner.stop(),200<=E.status&&299>=E.status?y(E.responseText):this.handleError({message:mxResources.get(413==E.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(E){this.spinner.stop();this.openLocalFile(E,f,m)}),mxUtils.bind(this,function(E){this.spinner.stop();this.handleError(E)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(E){this.spinner.stop();y(E)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,m)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var F=Editor.extractGraphModelFromPdf(c);null!=-F&&(t=null,m=!0,c=F)}this.spinner.stop();this.openLocalFile(c,f,m,t,null!=t?k:null,v)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=0;k<c.length;k++)mxUtils.bind(this,function(m){var t=new FileReader;t.onload=mxUtils.bind(this,function(v){try{this.openFileHandle(v.target.result,m.name,m,f)}catch(y){this.handleError(y)}});t.onerror=mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v);window.openFile=null});"image"!==-m.type.substring(0,5)&&"application/pdf"!==m.type||"image/svg"===m.type.substring(0,9)?t.readAsText(m):t.readAsDataURL(m)})(c[k])};EditorUi.prototype.openLocalFile=function(c,f,k,m,t,v){var y=this.getCurrentFile(),F=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var E=mxUtils.parseXml(c);null!=E&&(this.editor.setGraphXml(E.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,-k,m,t,v))});if(null!=c&&0<c.length)null==y||!y.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)?F():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)&&null!=y&&y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=y&&y.isModified()?+F&&(t=null,m=!0,c=F)}this.spinner.stop();this.openLocalFile(c,f,m,t,null!=t?k:null,x)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=0;k<c.length;k++)mxUtils.bind(this,function(m){var t=new FileReader;t.onload=mxUtils.bind(this,function(x){try{this.openFileHandle(x.target.result,m.name,m,f)}catch(y){this.handleError(y)}});t.onerror=mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x);window.openFile=null});"image"!==+m.type.substring(0,5)&&"application/pdf"!==m.type||"image/svg"===m.type.substring(0,9)?t.readAsText(m):t.readAsDataURL(m)})(c[k])};EditorUi.prototype.openLocalFile=function(c,f,k,m,t,x){var y=this.getCurrentFile(),F=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var E=mxUtils.parseXml(c);null!=E&&(this.editor.setGraphXml(E.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,+k,m,t,x))});if(null!=c&&0<c.length)null==y||!y.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)?F():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)&&null!=y&&y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=y&&y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()})));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(y){if(null!=y){var F=y.lastIndexOf(".");0<F&&(y=y.substring(F+1,y.length));null==f[y]&&(f[y]=!0)}}var m=this.editor.graph,t=m.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(t[mxConstants.STYLE_SHAPE]));m.model.isEdge(c)&&(k(mxMarker.getPackageForType(t[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(t[mxConstants.STYLE_ENDARROW])));t=m.model.getChildCount(c);for(var v=0;v<t;v++)this.addBasenamesForCell(m.model.getChildAt(c,v),f)};EditorUi.prototype.setGraphEnabled=+function(c,f){function k(y){if(null!=y){var F=y.lastIndexOf(".");0<F&&(y=y.substring(F+1,y.length));null==f[y]&&(f[y]=!0)}}var m=this.editor.graph,t=m.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(t[mxConstants.STYLE_SHAPE]));m.model.isEdge(c)&&(k(mxMarker.getPackageForType(t[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(t[mxConstants.STYLE_ENDARROW])));t=m.model.getChildCount(c);for(var x=0;x<t;x++)this.addBasenamesForCell(m.model.getChildAt(c,x),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.initializeEmbedMode=-function(){this.setGraphEnabled(!1);if((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,m,t){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);if(t)try{var v=this.editor.graph;v.setGridEnabled(!1);-v.pageVisible=!1;var y=v.model.cells,F;for(F in y){var E=y[F];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(C){console.log(C)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();+function(){this.setGraphEnabled(!1);if((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,m,t){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);if(t)try{var x=this.editor.graph;x.setGridEnabled(!1);+x.pageVisible=!1;var y=x.model.cells,F;for(F in y){var E=y[F];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(C){console.log(C)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=m?m:!1;this.updateUi();window.self!==window.top&&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;return{event:c,pageVisible:f.pageVisible,translate:f.view.translate,bounds:f.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:f.view.scale,page:f.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var k=window.opener||window.parent;if(this.editor.modified){var m=f.background;if(null==m||m==mxConstants.NONE)m=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(t){k.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(t)}),"*")}),null,null,!0,m,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(t){c||this.handleError(t)}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,m=!1,t=null,v=mxUtils.bind(this,function(E,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,v);mxEvent.addListener(window,"message",mxUtils.bind(this,function(E){if(E.source==(window.opener||window.parent)){var C=E.data,S=null,U=mxUtils.bind(this,function(ba){if(null!=ba&&"function"===typeof ba.charAt&&"<"!=ba.charAt(0))try{Editor.isPngDataUrl(ba)?ba=Editor.extractGraphModelFromPng(ba):"data:image/svg+xml;base64,"==ba.substring(0,+"*");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(t){c||this.handleError(t)}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,m=!1,t=null,x=mxUtils.bind(this,function(E,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,x);mxEvent.addListener(window,"message",mxUtils.bind(this,function(E){if(E.source==(window.opener||window.parent)){var C=E.data,S=null,U=mxUtils.bind(this,function(ba){if(null!=ba&&"function"===typeof ba.charAt&&"<"!=ba.charAt(0))try{Editor.isPngDataUrl(ba)?ba=Editor.extractGraphModelFromPng(ba):"data:image/svg+xml;base64,"==ba.substring(0,26)?ba=atob(ba.substring(26)):"data:image/svg+xml;utf8,"==ba.substring(0,24)&&(ba=ba.substring(24)),null!=ba&&(""==ba.trim()?ba=null:"%"==ba.charAt(0)?ba=decodeURIComponent(ba):"<"!=ba.charAt(0)&&(ba=Graph.decompress(ba)))}catch(ea){}return ba});if("json"==urlParams.proto){var Q=!1;try{C=JSON.parse(C),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[E],"data",[C])}catch(ba){C=null}try{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.executeLayouts(this.editor.graph.createLayouts(C.layouts));return}if("prompt"==C.action){this.spinner.stop();var O=new FilenameDialog(this,C.defaultValue||"",null!=C.okKey?mxResources.get(C.okKey):C.ok,function(ba){null!=ba?y.postMessage(JSON.stringify({event:"prompt",value:ba,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(O.container,300,80,!0,!1);O.init();return}if("draft"==C.action){var q=U(C.xml);this.spinner.stop();O=new DraftDialog(this,mxResources.get("draftFound",[C.name||this.defaultFilename]),q,mxUtils.bind(this,function(){this.hideDialog();y.postMessage(JSON.stringify({event:"draft",@@ -13463,16 +13463,16 @@ ka=mxUtils.bind(this,function(ba,ea){k=!0;try{c(ba,ea,null,Q)}catch(fa){this.hanthis.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));if("1"==urlParams.returnbounds||"json"==urlParams.proto)ea=this.createLoadMessage("load"),ea.xml=ba,y.postMessage(JSON.stringify(ea),"*");null!=S&&S()});null!=C&&"function"===typeof C.substring&&"data:application/vnd.visio;base64,"==C.substring(0,34)?(U="0M8R4KGxGuE"==C.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(C.substring(C.indexOf(",")+1)),function(ba){ka(ba,E)},mxUtils.bind(this,function(ba){this.handleError(ba)}),U)):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(ba){4==ba.readyState&&(200<=ba.status&&299>=ba.status&&"<mxGraphModel"==ba.responseText.substring(0,13)?ka(ba.responseText,E):this.handleError({message:413==ba.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=C&&"function"===typeof C.substring&&this.isLucidChartData(C)?this.convertLucidChart(C,mxUtils.bind(this,function(ba){ka(ba)}),mxUtils.bind(this,function(ba){this.handleError(ba)})):null==C||"object"!==typeof C||-null==C.format||null==C.data&&null==C.url?(C=U(C),ka(C,E)):this.loadDescriptor(C,mxUtils.bind(this,function(ba){ka(ja(),E)}),mxUtils.bind(this,function(ba){this.handleError(ba,mxResources.get("errorLoadingFile"))}))}}));var y=window.opener||window.parent;v="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";y.postMessage(v,"*");if("json"==urlParams.proto){var F=this.editor.graph.openLink;this.editor.graph.openLink=function(E,C,S){F.apply(this,arguments);y.postMessage(JSON.stringify({event:"openLink",+null==C.format||null==C.data&&null==C.url?(C=U(C),ka(C,E)):this.loadDescriptor(C,mxUtils.bind(this,function(ba){ka(ja(),E)}),mxUtils.bind(this,function(ba){this.handleError(ba,mxResources.get("errorLoadingFile"))}))}}));var y=window.opener||window.parent;x="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";y.postMessage(x,"*");if("json"==urlParams.proto){var F=this.editor.graph.openLink;this.editor.graph.openLink=function(E,C,S){F.apply(this,arguments);y.postMessage(JSON.stringify({event:"openLink",href:E,target:C,allowOpener:S}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,f,k,m){var t=document.createElement("button");t.className="geEmbedBtn geBtn";t.setAttribute("title",c+(null!=k?" ("+k+")":""));mxUtils.write(t,c);m&&t.classList.add("gePrimaryBtn");mxEvent.addListener(t,"click",f);return t};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,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 m=JSON.parse(k);this.executeLayouts(this.editor.graph.createLayouts(m));-this.customLayoutConfig=m;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(k,m){var t=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var v=m.value;m.value=JSON.stringify(JSON.parse(v));m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));m.value=v}catch(y){this.handleError(y)}}));t.setAttribute("title",+this.customLayoutConfig=m;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(k,m){var t=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var x=m.value;m.value=JSON.stringify(JSON.parse(x));m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));m.value=x}catch(y){this.handleError(y)}}));t.setAttribute("title","copy");t.className="geBtn";k.appendChild(t)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(f.container,620,460,!0,!0);f.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(f){var k=mxUtils.bind(this,function(){this.loadingOrgChart=!1;f.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),m=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;f.clear()&&this.handleError(t)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?k():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",k,null,null,null,m)},null,null,null,m)},null,null,null,m)},null,null,null,m):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",-k,null,null,null,m))}),onerror)};EditorUi.prototype.importCsv=function(c,f,k){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}))};EditorUi.prototype.doImportCsv=function(c,f,k){try{var m=c.split("\n"),t=[],v=[],y=[],F={};if(0<m.length){var E={};k=null!=k?k:this.editor.graph;var C=null,S=null,U=null,Q=null,O=null,q=null,u=null,I="whiteSpace=wrap;html=1;",G=null,H=null,g="",p="auto",B="auto",K=!1,M=null,N=null,R=40,T=40,V=100,X=0,W=mxUtils.bind(this,function(){null!=f?+k,null,null,null,m))}),onerror)};EditorUi.prototype.importCsv=function(c,f,k){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}))};EditorUi.prototype.doImportCsv=function(c,f,k){try{var m=c.split("\n"),t=[],x=[],y=[],F={};if(0<m.length){var E={};k=null!=k?k:this.editor.graph;var C=null,S=null,U=null,Q=null,O=null,q=null,u=null,I="whiteSpace=wrap;html=1;",G=null,H=null,g="",p="auto",B="auto",K=!1,M=null,N=null,R=40,T=40,V=100,X=0,W=mxUtils.bind(this,function(){null!=f?f(Oa):(k.setSelectionCells(Oa),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Y=k.getFreeInsertPoint(),Z=Y.x,aa=Y.y;Y=aa;var la=null,ha="auto";H=null;for(var ca=[],ja=null,ka=null,ba=0;ba<m.length&&"#"==m[ba].charAt(0);){c=m[ba].replace(/\r$/,"");for(ba++;ba<m.length&&"\\"==c.charAt(c.length-1)&&"#"==m[ba].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(m[ba].substring(1)),ba++;if("#"!=c.charAt(1)){var ea=c.indexOf(":");if(0<ea){var fa=mxUtils.trim(c.substring(1,ea)),da=mxUtils.trim(c.substring(ea+1));"label"==fa?la=Graph.sanitizeHtml(da):"labelname"==fa&&0<da.length&&"-"!=da?O=da:"labels"==fa&&0<da.length&&"-"!=da?u=JSON.parse(da):"style"==fa?S=da:"parentstyle"==fa?I=da:"unknownStyle"==fa&&"-"!=da?q=da:"stylename"==fa&&0<da.length&&"-"!=da?Q=da:"styles"==fa&&0<da.length&&"-"!=da?U=JSON.parse(da):"vars"==fa&&0<da.length&&"-"!=da?C=JSON.parse(da):"identity"==fa&&0<da.length&&"-"!=da?G=da:"parent"==fa&&0<da.length&&"-"!=da?H=da:"namespace"==fa&&0<da.length&&"-"!=da?g=da:"width"==fa?p=da:"height"==fa?B=da:"collapsed"==fa&&"-"!=da?K="true"==da:"left"==fa&&0<da.length?M=da:"top"==fa&&0<da.length?N=da:"ignore"==fa?ka=da.split(","):"connect"==fa?ca.push(JSON.parse(da)):"link"==fa?ja=da:"padding"==fa?X=parseFloat(da):"edgespacing"==fa?R=parseFloat(da):"nodespacing"==fa?T=parseFloat(da):"levelspacing"==fa?V=parseFloat(da):"layout"==fa&&(ha=da)}}}if(null==m[ba])throw Error(mxResources.get("invalidOrMissingFile"));@@ -13481,7 +13481,7 @@ var qa=this.editor.csvToArray(m[ba].replace(/\r$/,""));ea=c=null;fa=[];for(da=0;fa[ra],pa[ra]);if(null!=O&&null!=u){var za=u[ta.getAttribute(O)];null!=za&&(k.labelChanged(ta,za),null==ia||m||k.cellLabelChanged(ia,za))}if(null!=Q&&null!=U){var Ba=U[ta.getAttribute(Q)];null!=Ba&&(ta.style=Ba)}k.setAttributeForCell(ta,"placeholders","1");ta.style=k.replacePlaceholders(ta,ta.style,C);null==ia||m?k.fireEvent(new mxEventObject("cellsInserted","cells",[ta])):(k.model.setStyle(ia,ta.style),0>mxUtils.indexOf(y,ia)&&y.push(ia),k.fireEvent(new mxEventObject("cellsInserted","cells",[ia])));m=null!=ia;ia=ta;if(!m)for(oa=0;oa<ca.length;oa++)E[ca[oa].to][ia.getAttribute(ca[oa].to)]=ia;null!=ja&&"link"!=ja&&(k.setLinkForCell(ia,ia.getAttribute(ja)),k.setAttributeForCell(ia,ja,null));var Ga=k.getPreferredSizeForCell(ia);H=null!=ea?k.model.getCell(g+pa[ea]):null;if(ia.vertex){ua=null!=H?0:Z;ba=null!=H?0:aa;null!=M&&null!=ia.getAttribute(M)&&(ia.geometry.x=ua+parseFloat(ia.getAttribute(M)));null!=N&&null!=ia.getAttribute(N)&&(ia.geometry.y=ba+parseFloat(ia.getAttribute(N)));var wa="@"==p.charAt(0)?ia.getAttribute(p.substring(1)):null;ia.geometry.width=null!=wa&&"auto"!=wa?parseFloat(ia.getAttribute(p.substring(1))):"auto"==p||"auto"==wa?Ga.width+X:parseFloat(p);var Fa="@"==B.charAt(0)?ia.getAttribute(B.substring(1)):null;ia.geometry.height=null!=Fa&&"auto"!=Fa&&"width"!=B?parseFloat(Fa):"auto"==B||"auto"==Fa?Ga.height+X:"width"==B?ia.geometry.width:parseFloat(B);Y+=ia.geometry.height+T}m?(null==F[ma]&&(F[ma]=[]),F[ma].push(ia)):(t.push(ia),null!=H?(H.style=k.replacePlaceholders(H,I,C),k.addCell(ia,-H),v.push(H)):y.push(k.addCell(ia)))}for(da=0;da<v.length;da++)wa="@"==p.charAt(0)?v[da].getAttribute(p.substring(1)):null,Fa="@"==B.charAt(0)?v[da].getAttribute(B.substring(1)):null,"auto"!=p&&"auto"!=wa||"auto"!=B&&"auto"!=Fa||k.updateGroupBounds([v[da]],X,!0);var xa=y.slice(),Oa=y.slice();for(oa=0;oa<ca.length;oa++){var Ca=ca[oa];for(da=0;da<t.length;da++){ia=t[da];var Ea=mxUtils.bind(this,function(Ya,Ra,Ma){var fb=Ra.getAttribute(Ma.from);if(null!=fb&&""!=fb){fb=fb.split(",");for(var Qa=0;Qa<+H),x.push(H)):y.push(k.addCell(ia)))}for(da=0;da<x.length;da++)wa="@"==p.charAt(0)?x[da].getAttribute(p.substring(1)):null,Fa="@"==B.charAt(0)?x[da].getAttribute(B.substring(1)):null,"auto"!=p&&"auto"!=wa||"auto"!=B&&"auto"!=Fa||k.updateGroupBounds([x[da]],X,!0);var xa=y.slice(),Oa=y.slice();for(oa=0;oa<ca.length;oa++){var Ca=ca[oa];for(da=0;da<t.length;da++){ia=t[da];var Ea=mxUtils.bind(this,function(Ya,Ra,Ma){var fb=Ra.getAttribute(Ma.from);if(null!=fb&&""!=fb){fb=fb.split(",");for(var Qa=0;Qa<fb.length;Qa++){var Ta=E[Ma.to][fb[Qa]];if(null==Ta&&null!=q){Ta=new mxCell(fb[Qa],new mxGeometry(Z,aa,0,0),q);Ta.style=k.replacePlaceholders(Ra,Ta.style,C);var Va=k.getPreferredSizeForCell(Ta);Ta.geometry.width=Va.width+X;Ta.geometry.height=Va.height+X;E[Ma.to][fb[Qa]]=Ta;Ta.vertex=!0;Ta.id=fb[Qa];y.push(k.addCell(Ta))}if(null!=Ta){Va=Ma.label;null!=Ma.fromlabel&&(Va=(Ra.getAttribute(Ma.fromlabel)||"")+(Va||""));null!=Ma.sourcelabel&&(Va=k.replacePlaceholders(Ra,Ma.sourcelabel,C)+(Va||""));null!=Ma.tolabel&&(Va=(Va||"")+(Ta.getAttribute(Ma.tolabel)||""));null!=Ma.targetlabel&&(Va=(Va||"")+k.replacePlaceholders(Ta,Ma.targetlabel,C));var hb="target"==Ma.placeholders==!Ma.invert?Ta:Ya;hb=null!=Ma.style?k.replacePlaceholders(hb,Ma.style,C):k.createCurrentEdgeStyle();Va=k.insertEdge(null,null,Va||"",Ma.invert?Ta:Ya,Ma.invert?Ya:Ta,hb);if(null!=Ma.labels)for(hb=0;hb<Ma.labels.length;hb++){var db=Ma.labels[hb],Xa=new mxCell(db.label||hb,new mxGeometry(null!=db.x?db.x:0,null!=db.y?db.y:0,0,0),"resizable=0;html=1;");Xa.vertex=!0;Xa.connectable=!1;Xa.geometry.relative=!0;null!=db.placeholders&&(Xa.value=k.replacePlaceholders("target"==db.placeholders==!Ma.invert?Ta:Ya,Xa.value,C));if(null!=db.dx||null!=db.dy)Xa.geometry.offset=new mxPoint(null!=db.dx?db.dx:0,null!=db.dy?db.dy:0);Va.insert(Xa)}if(null!=Ma.data)for(var mb in Ma.data)k.setAttributeForCell(Va,mb,Ma.data[mb]);Oa.push(Va);mxUtils.remove(Ma.invert?Ya:Ta,xa)}}}});Ea(ia,ia,Ca);if(null!=F[ia.id])for(ra=0;ra<F[ia.id].length;ra++)Ea(ia,F[ia.id][ra],Ca)}}if(null!=@@ -13501,101 +13501,101 @@ f=this.getCurrentFile(),k=this.getSelectionState(),m=this.isDiagramActive(),t="1this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&m&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length);this.actions.get("addToScratchpad").setEnabled(0<k.cells.length);this.actions.get("createShape").setEnabled(m);this.actions.get("createRevision").setEnabled(m);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(m&&(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(m&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var L=EditorUi.prototype.destroy;-EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);L.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,m,t,v,y,F){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(m,-t,v)),"image/svg+xml");else{var C=c.getFileData(!0,null,null,null,null,!0),S=E.getGraphBounds(),U=Math.floor(S.width*t/E.view.scale),Q=Math.floor(S.height*t/E.view.scale);if(C.length<=MAX_REQUEST_SIZE&&U*Q<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var O={globalVars:E.getExportVariables()};F&&(O.grid={size:E.gridSize,steps:E.view.gridSteps,color:E.view.gridColor});c.saveRequest(f,k,function(q,u){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+-(u||"0")+(null!=q?"&filename="+encodeURIComponent(q):"")+"&extras="+encodeURIComponent(JSON.stringify(O))+(0<y?"&dpi="+y:"")+"&bg="+(null!=m?m:"none")+"&w="+U+"&h="+Q+"&border="+v+"&xml="+encodeURIComponent(C))})}else"png"==k?c.exportImage(t,null==m||"none"==m,!0,!1,!1,v,!0,!1,null,F,y):c.exportImage(t,!1,!0,!1,!1,v,!0,!1,"jpeg",F);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,+EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);L.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,m,t,x,y,F){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(m,+t,x)),"image/svg+xml");else{var C=c.getFileData(!0,null,null,null,null,!0),S=E.getGraphBounds(),U=Math.floor(S.width*t/E.view.scale),Q=Math.floor(S.height*t/E.view.scale);if(C.length<=MAX_REQUEST_SIZE&&U*Q<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var O={globalVars:E.getExportVariables()};F&&(O.grid={size:E.gridSize,steps:E.view.gridSteps,color:E.view.gridColor});c.saveRequest(f,k,function(q,u){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="++(u||"0")+(null!=q?"&filename="+encodeURIComponent(q):"")+"&extras="+encodeURIComponent(JSON.stringify(O))+(0<y?"&dpi="+y:"")+"&bg="+(null!=m?m:"none")+"&w="+U+"&h="+Q+"&border="+x+"&xml="+encodeURIComponent(C))})}else"png"==k?c.exportImage(t,null==m||"none"==m,!0,!1,!1,x,!0,!1,null,F,y):c.exportImage(t,!1,!0,!1,!1,x,!0,!1,"jpeg",F);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 m=c;this.currentPage!=this.pages[k]&&(m=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),m.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+" "+m.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},k=document.createElement("div");k.style.whiteSpace="nowrap";var m=document.createElement("h3");-mxUtils.write(m,mxUtils.htmlEntities(c));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(m);var t=document.createElement("div");t.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";t.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var v={};try{var y=mxSettings.getCustomLibraries();for(c=0;c<y.length;c++){var F=y[c];if("R"==F.substring(0,1)){var E=JSON.parse(decodeURIComponent(F.substring(1)));-v[E[0]]={id:E[0],title:E[1],downloadUrl:E[2]}}}}catch(C){}this.remoteInvoke("getCustomLibraries",null,null,function(C){t.innerText="";if(0==C.length)t.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var S=0;S<C.length;S++){var U=C[S];v[U.id]&&(f[U.id]=U);var Q=this.addCheckbox(t,U.title,v[U.id]);(function(O,q){mxEvent.addListener(q,"change",function(){this.checked?f[O.id]=O:delete f[O.id]})})(U,Q)}},mxUtils.bind(this,-function(C){t.innerText="";var S=document.createElement("div");S.style.padding="8px";S.style.textAlign="center";mxUtils.write(S,mxResources.get("error")+": ");mxUtils.write(S,null!=C&&null!=C.message?C.message:mxResources.get("unknownError"));t.appendChild(S)}));k.appendChild(t);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var C=0,S;for(S in f)null==v[S]&&(C++,mxUtils.bind(this,function(U){this.remoteInvoke("getFileContent",[U.downloadUrl],-null,mxUtils.bind(this,function(Q){C--;0==C&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,Q,U)),this.showSidebar()}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){C--;0==C&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[S]));for(S in v)f[S]||this.closeLibrary(new RemoteLibrary(this,null,v[S]));0==C&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");+mxUtils.write(m,mxUtils.htmlEntities(c));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(m);var t=document.createElement("div");t.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";t.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var x={};try{var y=mxSettings.getCustomLibraries();for(c=0;c<y.length;c++){var F=y[c];if("R"==F.substring(0,1)){var E=JSON.parse(decodeURIComponent(F.substring(1)));+x[E[0]]={id:E[0],title:E[1],downloadUrl:E[2]}}}}catch(C){}this.remoteInvoke("getCustomLibraries",null,null,function(C){t.innerText="";if(0==C.length)t.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var S=0;S<C.length;S++){var U=C[S];x[U.id]&&(f[U.id]=U);var Q=this.addCheckbox(t,U.title,x[U.id]);(function(O,q){mxEvent.addListener(q,"change",function(){this.checked?f[O.id]=O:delete f[O.id]})})(U,Q)}},mxUtils.bind(this,+function(C){t.innerText="";var S=document.createElement("div");S.style.padding="8px";S.style.textAlign="center";mxUtils.write(S,mxResources.get("error")+": ");mxUtils.write(S,null!=C&&null!=C.message?C.message:mxResources.get("unknownError"));t.appendChild(S)}));k.appendChild(t);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var C=0,S;for(S in f)null==x[S]&&(C++,mxUtils.bind(this,function(U){this.remoteInvoke("getFileContent",[U.downloadUrl],+null,mxUtils.bind(this,function(Q){C--;0==C&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,Q,U)),this.showSidebar()}catch(O){this.handleError(O,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){C--;0==C&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[S]));for(S in x)f[S]||this.closeLibrary(new RemoteLibrary(this,null,x[S]));0==C&&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,m,t){var v=-!0,y=window.setTimeout(mxUtils.bind(this,function(){v=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),F=mxUtils.bind(this,function(){window.clearTimeout(y);v&&m.apply(this,arguments)}),E=mxUtils.bind(this,function(){window.clearTimeout(y);v&&t.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:F,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(C,S){var U={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=S?U.error={errResp:S}:null!=C&&(U.resp=C);this.remoteWin.postMessage(JSON.stringify(U),"*")});try{var m=c.funtionName,t=this.remoteInvokableFns[m];if(null!=t&&"function"===typeof this[m]){if(t.allowedDomains){for(var v=!1,y=0;y<t.allowedDomains.length;y++)if(f=="https://"+t.allowedDomains[y]){v=-!0;break}if(!v){k(null,"Invalid Call: "+m+" is not allowed.");return}}var F=c.functionArgs;Array.isArray(F)||(F=[]);if(t.isAsync)F.push(function(){k(Array.prototype.slice.apply(arguments))}),F.push(function(C){k(null,C||"Unkown Error")}),this[m].apply(this,F);else{var E=this[m].apply(this,F);k([E])}}else k(null,"Invalid Call: "+m+" is not found.")}catch(C){k(null,"Invalid Call: An error occurred, "+C.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||-window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var m=k.open("database",2);m.onupgradeneeded=function(t){try{var v=m.result;1>t.oldVersion&&v.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(v.createObjectStore("files",{keyPath:"title"}),v.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(y){null!=f&&f(y)}};m.onsuccess=mxUtils.bind(this,function(t){try{var v=m.result;this.database=v;EditorUi.migrateStorageFiles&&(StorageFile.migrate(v),+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,m,t){var x=+!0,y=window.setTimeout(mxUtils.bind(this,function(){x=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),F=mxUtils.bind(this,function(){window.clearTimeout(y);x&&m.apply(this,arguments)}),E=mxUtils.bind(this,function(){window.clearTimeout(y);x&&t.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:F,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(C,S){var U={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=S?U.error={errResp:S}:null!=C&&(U.resp=C);this.remoteWin.postMessage(JSON.stringify(U),"*")});try{var m=c.funtionName,t=this.remoteInvokableFns[m];if(null!=t&&"function"===typeof this[m]){if(t.allowedDomains){for(var x=!1,y=0;y<t.allowedDomains.length;y++)if(f=="https://"+t.allowedDomains[y]){x=+!0;break}if(!x){k(null,"Invalid Call: "+m+" is not allowed.");return}}var F=c.functionArgs;Array.isArray(F)||(F=[]);if(t.isAsync)F.push(function(){k(Array.prototype.slice.apply(arguments))}),F.push(function(C){k(null,C||"Unkown Error")}),this[m].apply(this,F);else{var E=this[m].apply(this,F);k([E])}}else k(null,"Invalid Call: "+m+" is not found.")}catch(C){k(null,"Invalid Call: An error occurred, "+C.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||+window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var m=k.open("database",2);m.onupgradeneeded=function(t){try{var x=m.result;1>t.oldVersion&&x.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(x.createObjectStore("files",{keyPath:"title"}),x.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(y){null!=f&&f(y)}};m.onsuccess=mxUtils.bind(this,function(t){try{var x=m.result;this.database=x;EditorUi.migrateStorageFiles&&(StorageFile.migrate(x),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(y){if((!y||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var F=document.createElement("iframe");F.style.display="none";F.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(F);var E=!0,C=!1,S,U=0,Q=mxUtils.bind(this,function(){C=!0;this.setDatabaseItem(".drawioMigrated3",!0);F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),O=mxUtils.bind(this,function(){U++;q()}),q=mxUtils.bind(this,function(){try{if(U>=S.length)Q();else{var I=S[U];StorageFile.getFileContent(this,I,mxUtils.bind(this,function(G){null==G||".scratchpad"==I&&G==this.emptyLibraryXml?F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[I]}),"*"):O()}),O)}}catch(G){console.log(G)}}),u=mxUtils.bind(this,function(I){try{this.setDatabaseItem(null,[{title:I.title,size:I.data.length,lastModified:Date.now(),type:I.isLib?"L":"F"},{title:I.title,data:I.data}],O,O,["filesInfo","files"])}catch(G){console.log(G)}});y=mxUtils.bind(this,function(I){try{if(I.source==F.contentWindow){var G={};try{G=JSON.parse(I.data)}catch(H){}"init"==G.event?(F.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),F.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",-funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=G.event||C||(E?null!=G.resp&&0<G.resp.length&&null!=G.resp[0]?(S=G.resp[0],E=!1,q()):Q():null!=G.resp&&0<G.resp.length&&null!=G.resp[0]?u(G.resp[0]):O())}}catch(H){console.log(H)}});window.addEventListener("message",y)}})));c(v);v.onversionchange=function(){v.close()}}catch(y){null!=f?f(y):null!=window.console&&console.warn(y)}});m.onerror=f;m.onblocked=function(){}}catch(t){null!=f?f(t):null!=window.console&&console.error(t)}else null!=-f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,m,t){this.openDatabase(mxUtils.bind(this,function(v){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c],f=[f]);var y=v.transaction(t,"readwrite");y.oncomplete=k;y.onerror=m;for(v=0;v<t.length;v++)y.objectStore(t[v]).put(null!=c&&null!=c[v]?{key:c[v],data:f[v]}:f[v])}catch(F){null!=m&&m(F)}}),m)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=-m||"objects";Array.isArray(m)||(m=[m],c=[c]);var v=t.transaction(m,"readwrite");v.oncomplete=f;v.onerror=k;for(t=0;t<m.length;t++)v.objectStore(m[t]).delete(c[t])}catch(y){null!=k&&k(y)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";var v=t.transaction([m],"readonly").objectStore(m).get(c);v.onsuccess=function(){f(v.result)};v.onerror=k}catch(y){null!=k&&k(y)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,-function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),v=[];t.onsuccess=function(y){null==y.target.result?c(v):(v.push(y.target.result.value),y.target.result.continue())};t.onerror=f}catch(y){null!=f&&f(y)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).getAllKeys();t.onsuccess=function(){c(t.result)};t.onerror=-f}catch(v){null!=f&&f(v)}}),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=+funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=G.event||C||(E?null!=G.resp&&0<G.resp.length&&null!=G.resp[0]?(S=G.resp[0],E=!1,q()):Q():null!=G.resp&&0<G.resp.length&&null!=G.resp[0]?u(G.resp[0]):O())}}catch(H){console.log(H)}});window.addEventListener("message",y)}})));c(x);x.onversionchange=function(){x.close()}}catch(y){null!=f?f(y):null!=window.console&&console.warn(y)}});m.onerror=f;m.onblocked=function(){}}catch(t){null!=f?f(t):null!=window.console&&console.error(t)}else null!=+f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,m,t){this.openDatabase(mxUtils.bind(this,function(x){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c],f=[f]);var y=x.transaction(t,"readwrite");y.oncomplete=k;y.onerror=m;for(x=0;x<t.length;x++)y.objectStore(t[x]).put(null!=c&&null!=c[x]?{key:c[x],data:f[x]}:f[x])}catch(F){null!=m&&m(F)}}),m)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=+m||"objects";Array.isArray(m)||(m=[m],c=[c]);var x=t.transaction(m,"readwrite");x.oncomplete=f;x.onerror=k;for(t=0;t<m.length;t++)x.objectStore(m[t]).delete(c[t])}catch(y){null!=k&&k(y)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";var x=t.transaction([m],"readonly").objectStore(m).get(c);x.onsuccess=function(){f(x.result)};x.onerror=k}catch(y){null!=k&&k(y)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,+function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),x=[];t.onsuccess=function(y){null==y.target.result?c(x):(x.push(y.target.result.value),y.target.result.continue())};t.onerror=f}catch(y){null!=f&&f(y)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).getAllKeys();t.onsuccess=function(){c(t.result)};t.onerror=+f}catch(x){null!=f&&f(x)}}),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 m=this.getCurrentFile();null!=m?m.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,m,t,v,y,F){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,m,t,v,y,F)};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,m,t,v,y,F,E,C,S,U,Q,O,q,u){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,m,t,v,y,F,+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,m,t,x,y,F){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,m,t,x,y,F)};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,m,t,x,y,F,E,C,S,U,Q,O,q,u){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,m,t,x,y,F,E,C,S,U,Q,O,q,u)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,m){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,k,m)};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,m){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,k,m)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,k,m,t){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,k,m,t)};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),m=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<m.length){var t="<mxfile "===m.substring(0,8)||"<?xml"===m.substring(0,5)||"\x3c!--[if IE]>"===m.substring(0,12);m="<mxlibrary>"===m.substring(0,11);(t||m)&&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,n,d,x,A){function z(){for(var u=F.getElementsByTagName("div"),I=0,G=0;G<u.length;G++)"none"!=u[G].style.display&&u[G].parentNode==F&&I++;E.style.display=0==I?"block":"none"}function D(u,I,G,H){function g(){I.removeChild(K);I.removeChild(M);B.style.display="block";p.style.display="block"}t={div:I,comment:u,saveCallback:G,deleteOnCancel:H};var p=I.querySelector(".geCommentTxt"),B=I.querySelector(".geCommentActionsList"),K=document.createElement("textarea");K.className=+var CommentsWindow=function(b,l,n,d,v,A){function z(){for(var u=F.getElementsByTagName("div"),I=0,G=0;G<u.length;G++)"none"!=u[G].style.display&&u[G].parentNode==F&&I++;E.style.display=0==I?"block":"none"}function D(u,I,G,H){function g(){I.removeChild(K);I.removeChild(M);B.style.display="block";p.style.display="block"}t={div:I,comment:u,saveCallback:G,deleteOnCancel:H};var p=I.querySelector(".geCommentTxt"),B=I.querySelector(".geCommentActionsList"),K=document.createElement("textarea");K.className="geCommentEditTxtArea";K.style.minHeight=p.offsetHeight+"px";K.value=u.content;I.insertBefore(K,p);var M=document.createElement("div");M.className="geCommentEditBtns";var N=mxUtils.button(mxResources.get("cancel"),function(){H?(I.parentNode.removeChild(I),z()):g();t=null});N.className="geCommentEditBtn";M.appendChild(N);var R=mxUtils.button(mxResources.get("save"),function(){p.innerText="";u.content=K.value;mxUtils.write(p,u.content);g();G(u);t=null});mxEvent.addListener(K,"keydown",mxUtils.bind(this,function(T){mxEvent.isConsumed(T)||((mxEvent.isControlDown(T)||mxClient.IS_MAC&&mxEvent.isMetaDown(T))&&13==T.keyCode?(R.click(),mxEvent.consume(T)):27==T.keyCode&&(N.click(),mxEvent.consume(T)))}));R.focus();R.className="geCommentEditBtn gePrimaryBtn";M.appendChild(R);I.insertBefore(M,p);B.style.display="none";p.style.display="none";K.focus()}function P(u,I){I.innerText="";u=new Date(u.modifiedDate);var G=b.timeSince(u);null==G&&(G=mxResources.get("lessThanAMinute"));mxUtils.write(I,mxResources.get("timeAgo",[G],"{1} ago"));I.setAttribute("title",u.toLocaleDateString()+" "+u.toLocaleTimeString())}function J(u){var I=document.createElement("img");I.className="geCommentBusyImg";I.src=IMAGE_PATH+"/spin.gif";u.appendChild(I);u.busyImg=I}function L(u){u.style.border="1px solid red";u.busyImg.parentNode==u&&u.removeChild(u.busyImg)}function c(u){u.style.border="";u.busyImg.parentNode==u&&u.removeChild(u.busyImg)}function f(u,I,G,H,g){function p(X,W,Y){var Z=document.createElement("li");Z.className="geCommentAction";var aa=document.createElement("a");aa.className="geCommentActionLnk";mxUtils.write(aa,X);Z.appendChild(aa);mxEvent.addListener(aa,"click",function(la){W(la,u);la.preventDefault();mxEvent.consume(la)});V.appendChild(Z);Y&&(Z.style.display="none")}function B(){function X(Z){W.push(Y);if(null!=Z.replies)for(var aa=0;aa<Z.replies.length;aa++)Y=Y.nextSibling,X(Z.replies[aa])}var W=[],Y=M;X(u);return{pdiv:Y,replies:W}}function K(X,W,Y,Z,aa){function la(){J(ka);u.addReply(ja,function(ba){ja.id=ba;u.replies.push(ja);c(ka);Y&&Y()},function(ba){ha();L(ka);b.handleError(ba,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,aa)}function ha(){D(ja,ka,function(ba){la()},!0)}var ca=B().pdiv,ja=b.newComment(X,b.getCurrentUser());ja.pCommentId=u.id;null==u.replies&&(u.replies=[]);var ka=f(ja,u.replies,ca,H+1);W?ha():la()}if(g||!u.isResolved){E.style.display="none";var M=document.createElement("div");M.className="geCommentContainer";M.setAttribute("data-commentId",u.id);M.style.marginLeft=20*H+-5+"px";u.isResolved&&(v.style.opacity="0.7");var N=document.createElement("div");N.className="geCommentHeader";var R=document.createElement("img");R.className="geCommentUserImg";R.src=null!=u.user&&null!=u.user.pictureUrl?u.user.pictureUrl:Editor.userImage;N.appendChild(R);R=document.createElement("div");R.className="geCommentHeaderTxt";N.appendChild(R);var T=document.createElement("div");T.className="geCommentUsername";mxUtils.write(T,null!=u.user?u.user.displayName:mxResources.get("unknownUser"));+5+"px";u.isResolved&&(x.style.opacity="0.7");var N=document.createElement("div");N.className="geCommentHeader";var R=document.createElement("img");R.className="geCommentUserImg";R.src=null!=u.user&&null!=u.user.pictureUrl?u.user.pictureUrl:Editor.userImage;N.appendChild(R);R=document.createElement("div");R.className="geCommentHeaderTxt";N.appendChild(R);var T=document.createElement("div");T.className="geCommentUsername";mxUtils.write(T,null!=u.user?u.user.displayName:mxResources.get("unknownUser"));R.appendChild(T);T=document.createElement("div");T.className="geCommentDate";T.setAttribute("data-commentId",u.id);P(u,T);R.appendChild(T);M.appendChild(N);N=document.createElement("div");N.className="geCommentTxt";mxUtils.write(N,u.content||"");M.appendChild(N);u.isLocked&&(M.style.opacity="0.5");N=document.createElement("div");N.className="geCommentActions";var V=document.createElement("ul");V.className="geCommentActionsList";N.appendChild(V);k||u.isLocked||0!=H&&!m||p(mxResources.get("reply"),function(){K("",!0)},u.isResolved);R=b.getCurrentUser();null==R||null==u.user||R.id!=u.user.id||k||u.isLocked||(p(mxResources.get("edit"),function(){function X(){D(u,M,function(){J(M);u.editComment(u.content,function(){c(M)},function(W){L(M);X();b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}X()},u.isResolved),p(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){J(M);u.deleteComment(function(X){if(!0===X){X=M.querySelector(".geCommentTxt");X.innerText="";mxUtils.write(X,mxResources.get("msgDeleted"));var W=M.querySelectorAll(".geCommentAction");for(X=0;X<W.length;X++)W[X].parentNode.removeChild(W[X]);c(M);M.style.opacity="0.5"}else{W=B(u).replies;for(X=0;X<W.length;X++)F.removeChild(W[X]);for(X=0;X<I.length;X++)if(I[X]==u){I.splice(X,1);break}E.style.display=0==F.getElementsByTagName("div").length?"block":"none"}},function(X){L(M);b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},u.isResolved));k||u.isLocked||0!=H||p(u.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(X){function W(){var Y=X.target;Y.innerText="";u.isResolved=!u.isResolved;mxUtils.write(Y,u.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Z=u.isResolved?"none":"",aa=B(u).replies,la="light-dark("+(u.isResolved?"ghostWhite":"white")+", transparent)",ha=0;ha<aa.length;ha++){aa[ha].style.backgroundColor=la;for(var ca=aa[ha].querySelectorAll(".geCommentAction"),ja=0;ja<ca.length;ja++)ca[ja]!=Y.parentNode&&(ca[ja].style.display=Z);Q||(aa[ha].style.display="none")}z()}u.isResolved?K(mxResources.get("reOpened")+": ",!0,W,!1,!0):K(mxResources.get("markedAsResolved"),!1,W,!0)});M.appendChild(N);null!=G?F.insertBefore(M,G.nextSibling):F.appendChild(M);for(G=0;null!=u.replies&&G<u.replies.length;G++)N=u.replies[G],N.isResolved=u.isResolved,f(N,u.replies,null,H+1,g);null!=t&&(t.comment.id==u.id?(g=u.content,u.content=t.comment.content,D(u,M,t.saveCallback,t.deleteOnCancel),u.content=g):null==-t.comment.id&&t.comment.pCommentId==u.id&&(F.appendChild(t.div),D(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return M}}var k=!b.canComment(),m=b.canReplyToReplies(),t=null,v=document.createElement("div");v.className="geCommentsWin";var y=EditorUi.compactUi?"26px":"30px",F=document.createElement("div");F.className="geCommentsList";F.style.bottom=parseInt(y)+7+"px";v.appendChild(F);var E=document.createElement("span");E.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(E,+t.comment.id&&t.comment.pCommentId==u.id&&(F.appendChild(t.div),D(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return M}}var k=!b.canComment(),m=b.canReplyToReplies(),t=null,x=document.createElement("div");x.className="geCommentsWin";var y=EditorUi.compactUi?"26px":"30px",F=document.createElement("div");F.className="geCommentsList";F.style.bottom=parseInt(y)+7+"px";x.appendChild(F);var E=document.createElement("span");E.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(E,mxResources.get("noCommentsFound"));var C=document.createElement("div");C.className="geToolbarContainer geCommentsToolbar";C.style.height=y;C.style.padding="3px 4px 4px 4px";y=document.createElement("a");y.className="geButton";if(!k){var S=y.cloneNode();S.style.backgroundImage="url("+Editor.plusImage+")";S.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(S,"click",function(u){function I(){D(G,H,function(g){J(H);b.addComment(g,function(p){g.id=p;O.push(g);c(H)},function(p){L(H);I();b.handleError(p,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var G=b.newComment("",b.getCurrentUser()),H=f(G,O,null,0);I();u.preventDefault();mxEvent.consume(u)});C.appendChild(S)}var U=y.cloneNode();U.style.backgroundImage="url("+Editor.checkImage+")";U.setAttribute("title",mxResources.get("showResolved"));var Q=!1;mxEvent.addListener(U,"click",function(u){(Q=!Q)?U.classList.add("geActiveItem"):U.classList.remove("geActiveItem");q();u.preventDefault();mxEvent.consume(u)});C.appendChild(U);b.commentsRefreshNeeded()&&(S=y.cloneNode(),S.style.backgroundImage="url("+Editor.refreshImage+")",S.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(S,"click",function(u){q();u.preventDefault();mxEvent.consume(u)}),C.appendChild(S));b.commentsSaveNeeded()&&(y=y.cloneNode(),y.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',y.setAttribute("title",mxResources.get("save")),y.className="geButton geAdaptiveAsset",mxEvent.addListener(y,-"click",function(u){A();u.preventDefault();mxEvent.consume(u)}),C.appendChild(y));v.appendChild(C);var O=[],q=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t)try{t.div=t.div.cloneNode(!0);var u=t.div.querySelector(".geCommentEditTxtArea"),I=t.div.querySelector(".geCommentEditBtns");t.comment.content=u.value;u.parentNode.removeChild(u);I.parentNode.removeChild(I)}catch(G){b.handleError(G)}F.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '++"click",function(u){A();u.preventDefault();mxEvent.consume(u)}),C.appendChild(y));x.appendChild(C);var O=[],q=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t)try{t.div=t.div.cloneNode(!0);var u=t.div.querySelector(".geCommentEditTxtArea"),I=t.div.querySelector(".geCommentEditBtns");t.comment.content=u.value;u.parentNode.removeChild(u);I.parentNode.removeChild(I)}catch(G){b.handleError(G)}F.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";m=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(G){function H(g){if(null!=g){g.sort(function(B,K){return new Date(B.modifiedDate)-new Date(K.modifiedDate)});for(var p=0;p<g.length;p++)H(g[p].replies)}}G.sort(function(g,p){return new Date(g.modifiedDate)-new Date(p.modifiedDate)});F.innerText="";F.appendChild(E);E.style.display="block";O=G;for(G=0;G<O.length;G++)H(O[G].replies),f(O[G],O,null,0,Q);null!=t&&null==t.comment.id&&null==t.comment.pCommentId&&(F.appendChild(t.div),D(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(G){F.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(G&&G.message?": "+G.message:""));this.hasError=!0})):F.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});q();this.refreshComments=q;C=mxUtils.bind(this,function(){function u(p){var B=G[p.id];if(null!=B)for(P(p,B),B=0;null!=p.replies&&B<p.replies.length;B++)u(p.replies[B])}if(this.window.isVisible()){for(var I=-F.querySelectorAll(".geCommentDate"),G={},H=0;H<I.length;H++){var g=I[H];G[g.getAttribute("data-commentId")]=g}for(H=0;H<O.length;H++)u(O[H])}});setInterval(C,6E4);this.refreshCommentsTime=C;this.window=new mxWindow(mxResources.get("comments"),v,l,n,d,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,n,d,x,A,z,D,P,J,L){var c=document.createElement("div");c.style.textAlign="center";L=null!=L?L:44;var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight=L+"px";f.style.lineHeight="1.2em";mxUtils.write(f,l);c.appendChild(f);null!=J&&(f=document.createElement("div"),f.style.padding="6px 0 6px 0",l=document.createElement("img"),l.setAttribute("src",J),f.appendChild(l),+F.querySelectorAll(".geCommentDate"),G={},H=0;H<I.length;H++){var g=I[H];G[g.getAttribute("data-commentId")]=g}for(H=0;H<O.length;H++)u(O[H])}});setInterval(C,6E4);this.refreshCommentsTime=C;this.window=new mxWindow(mxResources.get("comments"),x,l,n,d,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,l,n,d,v,A,z,D,P,J,L){var c=document.createElement("div");c.style.textAlign="center";L=null!=L?L:44;var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight=L+"px";f.style.lineHeight="1.2em";mxUtils.write(f,l);c.appendChild(f);null!=J&&(f=document.createElement("div"),f.style.padding="6px 0 6px 0",l=document.createElement("img"),l.setAttribute("src",J),f.appendChild(l),c.appendChild(f));J=document.createElement("div");J.style.textAlign="center";J.style.whiteSpace="nowrap";var k=document.createElement("input");k.setAttribute("type","checkbox");A=mxUtils.button(A||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d(k.checked)});A.className="geBtn";null!=D&&(A.innerHTML=D+"<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&&J.appendChild(A);-var m=mxUtils.button(x||mxResources.get("ok"),function(){b.hideDialog();null!=n&&n(k.checked)});J.appendChild(m);null!=z?(m.innerHTML=z+"<br>"+m.innerHTML+"<br>",m.style.display="inline-block",m.style.paddingBottom="8px",m.style.paddingTop="8px",m.style.height="auto",m.className="geBtn",m.style.width="40%"):m.className="geBtn gePrimaryBtn";b.editor.cancelFirst||J.appendChild(A);c.appendChild(J);P?(J.style.marginTop="10px",f=document.createElement("p"),f.style.marginTop="20px",f.style.marginBottom=-"0px",f.appendChild(k),x=document.createElement("span"),mxUtils.write(x," "+mxResources.get("rememberThisSetting")),f.appendChild(x),c.appendChild(f),mxEvent.addListener(x,"click",function(t){k.checked=!k.checked;mxEvent.consume(t)})):J.style.marginTop="12px";this.init=function(){m.focus()};this.container=c},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};+var m=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=n&&n(k.checked)});J.appendChild(m);null!=z?(m.innerHTML=z+"<br>"+m.innerHTML+"<br>",m.style.display="inline-block",m.style.paddingBottom="8px",m.style.paddingTop="8px",m.style.height="auto",m.className="geBtn",m.style.width="40%"):m.className="geBtn gePrimaryBtn";b.editor.cancelFirst||J.appendChild(A);c.appendChild(J);P?(J.style.marginTop="10px",f=document.createElement("p"),f.style.marginTop="20px",f.style.marginBottom=+"0px",f.appendChild(k),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),f.appendChild(v),c.appendChild(f),mxEvent.addListener(v,"click",function(t){k.checked=!k.checked;mxEvent.consume(t)})):J.style.marginTop="12px";this.init=function(){m.focus()};this.container=c},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(){};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";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};-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,n,d,x){if(null!=l)for(var A=0;A<l.length;A++)null!=l[A]&&(b=this.patchPages(b,l[A],n,d,x));return b};-EditorUi.prototype.patchPages=function(b,l,n,d,x){var A={},z=[],D={},P={},J={},L={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var c in d[EditorUi.DIFF_UPDATE])A[c]=d[EditorUi.DIFF_UPDATE][c];if(null!=l[EditorUi.DIFF_REMOVE])for(d=0;d<l[EditorUi.DIFF_REMOVE].length;d++)P[l[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=l[EditorUi.DIFF_INSERT])for(d=0;d<l[EditorUi.DIFF_INSERT].length;d++)D[l[EditorUi.DIFF_INSERT][d].previous]=l[EditorUi.DIFF_INSERT][d];if(null!=l[EditorUi.DIFF_UPDATE])for(c in l[EditorUi.DIFF_UPDATE])d=+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,n,d,v){if(null!=l)for(var A=0;A<l.length;A++)null!=l[A]&&(b=this.patchPages(b,l[A],n,d,v));return b};+EditorUi.prototype.patchPages=function(b,l,n,d,v){var A={},z=[],D={},P={},J={},L={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var c in d[EditorUi.DIFF_UPDATE])A[c]=d[EditorUi.DIFF_UPDATE][c];if(null!=l[EditorUi.DIFF_REMOVE])for(d=0;d<l[EditorUi.DIFF_REMOVE].length;d++)P[l[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=l[EditorUi.DIFF_INSERT])for(d=0;d<l[EditorUi.DIFF_INSERT].length;d++)D[l[EditorUi.DIFF_INSERT][d].previous]=l[EditorUi.DIFF_INSERT][d];if(null!=l[EditorUi.DIFF_UPDATE])for(c in l[EditorUi.DIFF_UPDATE])d=l[EditorUi.DIFF_UPDATE][c],null!=d.previous&&(L[d.previous]=c);if(null!=b){var f="";for(d=0;d<b.length;d++){var k=b[d].getId();J[k]=b[d];null!=L[f]||P[k]||null!=l[EditorUi.DIFF_UPDATE]&&null!=l[EditorUi.DIFF_UPDATE][k]&&null!=l[EditorUi.DIFF_UPDATE][k].previous||(L[f]=k);f=k}}var m={},t=mxUtils.bind(this,function(y){var F=null!=y?y.getId():"";if(null!=y&&!m[F]){m[F]=!0;z.push(y);var E=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][F]:null;null!=E&&(this.updatePageRoot(y),null!=E.name&&y.setName(E.name),-null!=E.view&&this.patchViewState(y,E.view),null!=E.cells&&this.patchPage(y,E.cells,A[y.getId()],x),!n||null==E.cells&&null==E.view||(y.needsUpdate=!0))}y=L[F];null!=y&&(delete L[F],t(J[y]));y=D[F];null!=y&&(delete D[F],v(y))}),v=mxUtils.bind(this,function(y){y=mxUtils.parseXml(y.data).documentElement;y=new DiagramPage(y);this.updatePageRoot(y);var F=J[y.getId()];null==F?t(y):(this.patchPage(F,this.diffPages([F],[y]),A[F.getId()],x),n&&(F.needsUpdate=!0))});t();for(c in L)t(J[L[c]]),delete L[c];for(c in D)v(D[c]),+null!=E.view&&this.patchViewState(y,E.view),null!=E.cells&&this.patchPage(y,E.cells,A[y.getId()],v),!n||null==E.cells&&null==E.view||(y.needsUpdate=!0))}y=L[F];null!=y&&(delete L[F],t(J[y]));y=D[F];null!=y&&(delete D[F],x(y))}),x=mxUtils.bind(this,function(y){y=mxUtils.parseXml(y.data).documentElement;y=new DiagramPage(y);this.updatePageRoot(y);var F=J[y.getId()];null==F?t(y):(this.patchPage(F,this.diffPages([F],[y]),A[F.getId()],v),n&&(F.needsUpdate=!0))});t();for(c in L)t(J[L[c]]),delete L[c];for(c in D)x(D[c]),delete D[c];return z};EditorUi.prototype.patchViewState=function(b,l){if(null!=b.viewState&&null!=l){b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var n in l)try{this.patchViewStateProperty(b,l,n)}catch(d){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,l,n){b.viewState[n]=JSON.parse(l[n])};-EditorUi.prototype.createParentLookup=function(b,l){function n(J){var L=d[J];null==L&&(L={inserted:[],moved:{}},d[J]=L);return L}var d={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++){var A=l[EditorUi.DIFF_INSERT][x],z=null!=A.parent?A.parent:"",D=null!=A.previous?A.previous:"";n(z).inserted[D]=A}if(null!=l[EditorUi.DIFF_UPDATE])for(var P in l[EditorUi.DIFF_UPDATE])A=l[EditorUi.DIFF_UPDATE][P],null!=A.previous&&(z=A.parent,null==z&&(x=b.getCell(P),null!=x&&(x=-b.getParent(x),null!=x&&(z=x.getId()))),null!=z&&(n(z).moved[A.previous]=P));return d};-EditorUi.prototype.patchPage=function(b,l,n,d){var x=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),A=this.createParentLookup(x,l);x.beginUpdate();try{var z=x.updateEdgeParent,D=new mxDictionary,P=[];x.updateEdgeParent=function(v,y){!D.get(v)&&d&&(D.put(v,!0),P.push(v))};var J=A[""],L=null!=J&&null!=J.inserted?J.inserted[""]:null,c=null;null!=L&&(c=this.getCellForJson(L));if(null==c){var f=null!=J&&null!=J.moved?J.moved[""]:null;null!=f&&(c=x.getCell(f))}null!=c&&(x.setRoot(c),-b.root=c,EditorUi.debug("EditorUi.patchPage: Root changed",c.id));this.patchCellRecursive(b,x,x.root,A,l);if(null!=l[EditorUi.DIFF_REMOVE])for(var k=0;k<l[EditorUi.DIFF_REMOVE].length;k++){f=l[EditorUi.DIFF_REMOVE][k];var m=x.getCell(f);null!=m&&x.remove(m)}if(null!=l[EditorUi.DIFF_UPDATE]){var t=null!=n&&null!=n.cells?n.cells[EditorUi.DIFF_UPDATE]:null;for(f in l[EditorUi.DIFF_UPDATE])m=x.getCell(f),null!=m?this.patchCell(x,m,l[EditorUi.DIFF_UPDATE][f],null!=t?t[f]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",-f,"diff",[l[EditorUi.DIFF_UPDATE][f]])}if(null!=l[EditorUi.DIFF_INSERT])for(k=0;k<l[EditorUi.DIFF_INSERT].length;k++)L=l[EditorUi.DIFF_INSERT][k],m=x.getCell(L.id),null!=m&&(x.setTerminal(m,x.getCell(L.source),!0),x.setTerminal(m,x.getCell(L.target),!1));x.updateEdgeParent=z;if(d&&0<P.length)for(k=0;k<P.length;k++)x.contains(P[k])&&x.updateEdgeParent(P[k])}finally{x.endUpdate()}};-EditorUi.prototype.patchCellRecursive=function(b,l,n,d,x){if(null!=n){var A=d[n.getId()],z=null!=A&&null!=A.inserted?A.inserted:{};A=null!=A&&null!=A.moved?A.moved:{};for(var D=0,P=l.getChildCount(n),J="",L=0;L<P;L++){var c=l.getChildAt(n,L).getId();null==A[J]&&(null==x[EditorUi.DIFF_UPDATE]||null==x[EditorUi.DIFF_UPDATE][c]||null==x[EditorUi.DIFF_UPDATE][c].previous&&null==x[EditorUi.DIFF_UPDATE][c].parent)&&(A[J]=c);J=c}P=mxUtils.bind(this,function(f,k){var m=null!=f?f.getId():"";null==m&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",-"cell",f);null!=f&&k&&(k=l.getCell(m),null!=k&&k!=f&&(f=null));null!=f&&(l.getChildAt(n,D)!=f&&l.add(n,f,D),this.patchCellRecursive(b,l,f,d,x),D++);return m});for(J=[null];0<J.length;)if(L=J.shift(),L=P(null!=L?L.child:null,null!=L?L.insert:!1),c=A[L],null!=c&&(delete A[L],J.push({child:l.getCell(c)})),c=z[L],null!=c&&(delete z[L],J.push({child:this.getCellForJson(c),insert:!0})),0==J.length){for(L in A)J.push({child:l.getCell(A[L])}),delete A[L];for(L in z)J.push({child:this.getCellForJson(z[L]),+EditorUi.prototype.createParentLookup=function(b,l){function n(J){var L=d[J];null==L&&(L={inserted:[],moved:{}},d[J]=L);return L}var d={};if(null!=l[EditorUi.DIFF_INSERT])for(var v=0;v<l[EditorUi.DIFF_INSERT].length;v++){var A=l[EditorUi.DIFF_INSERT][v],z=null!=A.parent?A.parent:"",D=null!=A.previous?A.previous:"";n(z).inserted[D]=A}if(null!=l[EditorUi.DIFF_UPDATE])for(var P in l[EditorUi.DIFF_UPDATE])A=l[EditorUi.DIFF_UPDATE][P],null!=A.previous&&(z=A.parent,null==z&&(v=b.getCell(P),null!=v&&(v=+b.getParent(v),null!=v&&(z=v.getId()))),null!=z&&(n(z).moved[A.previous]=P));return d};+EditorUi.prototype.patchPage=function(b,l,n,d){var v=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),A=this.createParentLookup(v,l);v.beginUpdate();try{var z=v.updateEdgeParent,D=new mxDictionary,P=[];v.updateEdgeParent=function(x,y){!D.get(x)&&d&&(D.put(x,!0),P.push(x))};var J=A[""],L=null!=J&&null!=J.inserted?J.inserted[""]:null,c=null;null!=L&&(c=this.getCellForJson(L));if(null==c){var f=null!=J&&null!=J.moved?J.moved[""]:null;null!=f&&(c=v.getCell(f))}null!=c&&(v.setRoot(c),+b.root=c,EditorUi.debug("EditorUi.patchPage: Root changed",c.id));this.patchCellRecursive(b,v,v.root,A,l);if(null!=l[EditorUi.DIFF_REMOVE])for(var k=0;k<l[EditorUi.DIFF_REMOVE].length;k++){f=l[EditorUi.DIFF_REMOVE][k];var m=v.getCell(f);null!=m&&v.remove(m)}if(null!=l[EditorUi.DIFF_UPDATE]){var t=null!=n&&null!=n.cells?n.cells[EditorUi.DIFF_UPDATE]:null;for(f in l[EditorUi.DIFF_UPDATE])m=v.getCell(f),null!=m?this.patchCell(v,m,l[EditorUi.DIFF_UPDATE][f],null!=t?t[f]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",+f,"diff",[l[EditorUi.DIFF_UPDATE][f]])}if(null!=l[EditorUi.DIFF_INSERT])for(k=0;k<l[EditorUi.DIFF_INSERT].length;k++)L=l[EditorUi.DIFF_INSERT][k],m=v.getCell(L.id),null!=m&&(v.setTerminal(m,v.getCell(L.source),!0),v.setTerminal(m,v.getCell(L.target),!1));v.updateEdgeParent=z;if(d&&0<P.length)for(k=0;k<P.length;k++)v.contains(P[k])&&v.updateEdgeParent(P[k])}finally{v.endUpdate()}};+EditorUi.prototype.patchCellRecursive=function(b,l,n,d,v){if(null!=n){var A=d[n.getId()],z=null!=A&&null!=A.inserted?A.inserted:{};A=null!=A&&null!=A.moved?A.moved:{};for(var D=0,P=l.getChildCount(n),J="",L=0;L<P;L++){var c=l.getChildAt(n,L).getId();null==A[J]&&(null==v[EditorUi.DIFF_UPDATE]||null==v[EditorUi.DIFF_UPDATE][c]||null==v[EditorUi.DIFF_UPDATE][c].previous&&null==v[EditorUi.DIFF_UPDATE][c].parent)&&(A[J]=c);J=c}P=mxUtils.bind(this,function(f,k){var m=null!=f?f.getId():"";null==m&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",+"cell",f);null!=f&&k&&(k=l.getCell(m),null!=k&&k!=f&&(f=null));null!=f&&(l.getChildAt(n,D)!=f&&l.add(n,f,D),this.patchCellRecursive(b,l,f,d,v),D++);return m});for(J=[null];0<J.length;)if(L=J.shift(),L=P(null!=L?L.child:null,null!=L?L.insert:!1),c=A[L],null!=c&&(delete A[L],J.push({child:l.getCell(c)})),c=z[L],null!=c&&(delete z[L],J.push({child:this.getCellForJson(c),insert:!0})),0==J.length){for(L in A)J.push({child:l.getCell(A[L])}),delete A[L];for(L in z)J.push({child:this.getCellForJson(z[L]),insert:!0}),delete z[L]}}};EditorUi.prototype.patchCell=function(b,l,n,d){if(null!=l&&null!=n){if(null==d||null==d.xmlValue&&(null==d.value||""==d.value))"value"in n?b.setValue(l,n.value):null!=n.xmlValue&&b.setValue(l,mxUtils.parseXml(n.xmlValue).documentElement);null!=d&&null!=d.style||null==n.style||b.setStyle(l,n.style);null!=n.visible&&b.setVisible(l,1==n.visible);null!=n.collapsed&&b.setCollapsed(l,1==n.collapsed);null!=n.vertex&&(l.vertex=1==n.vertex);null!=n.edge&&(l.edge=1==n.edge);null!=n.connectable&&(l.connectable=-1==n.connectable);null!=n.geometry&&b.setGeometry(l,this.codec.decode(mxUtils.parseXml(n.geometry).documentElement));null!=n.source&&b.setTerminal(l,b.getCell(n.source),!0);null!=n.target&&b.setTerminal(l,b.getCell(n.target),!1);for(var x in n)this.cellProperties[x]||(l[x]=n[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 n=0;n<b.length;n++){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[n].root));this.editor.graph.saveViewState(b[n].viewState,d);var x=b[n].node.cloneNode(!1);x.appendChild(d);l.appendChild(x)}}return l};EditorUi.prototype.getPagesForXml=function(b){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement)};+1==n.connectable);null!=n.geometry&&b.setGeometry(l,this.codec.decode(mxUtils.parseXml(n.geometry).documentElement));null!=n.source&&b.setTerminal(l,b.getCell(n.source),!0);null!=n.target&&b.setTerminal(l,b.getCell(n.target),!1);for(var v in n)this.cellProperties[v]||(l[v]=n[v])}};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 n=0;n<b.length;n++){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[n].root));this.editor.graph.saveViewState(b[n].viewState,d);var v=b[n].node.cloneNode(!1);v.appendChild(d);l.appendChild(v)}}return l};EditorUi.prototype.getPagesForXml=function(b){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement)};EditorUi.prototype.getPagesForNode=function(b,l){var n=this.editor.extractGraphModel(b,!0,!0);null!=n&&(b=n);l=b.getElementsByTagName(l||"diagram");n=[];if(0<l.length)for(b=0;b<l.length;b++){var d=new DiagramPage(l[b]);this.updatePageRoot(d,!0);n.push(d)}else"mxGraphModel"==b.nodeName&&(d=new DiagramPage(b.ownerDocument.createElement("diagram")),d.setName(mxResources.get("pageWithNumber",[1])),d.node.appendChild(b.cloneNode(!0)),n.push(d));return n};-EditorUi.prototype.diffPages=function(b,l){var n=[],d=[],x={},A={},z={},D=null;if(null!=b&&null!=l){for(var P=0;P<l.length;P++)A[l[P].getId()]={page:l[P],prev:D},D=l[P];D=null;for(P=0;P<b.length;P++){var J=b[P].getId();l=A[J];if(null==l)d.push(J);else{this.updatePageRoot(b[P]);this.updatePageRoot(l.page);var L=this.diffCells(b[P].root,l.page.root),c={};mxUtils.isEmptyObject(L)||(c.cells=L);L=this.diffViewState(b[P],l.page);mxUtils.isEmptyObject(L)||(c.view=L);if((null!=l.prev?null==D:null!=D)||null!=-D&&null!=l.prev&&D.getId()!=l.prev.getId())c.previous=null!=l.prev?l.prev.getId():"";null!=l.page.getName()&&b[P].getName()!=l.page.getName()&&(c.name=l.page.getName());mxUtils.isEmptyObject(c)||(z[J]=c)}delete A[b[P].getId()];D=b[P]}for(J in A)l=A[J],n.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<d.length&&(x[EditorUi.DIFF_REMOVE]=d);0<n.length&&(x[EditorUi.DIFF_INSERT]=n)}return x};-EditorUi.prototype.createCellLookup=function(b,l,n){n=null!=n?n:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):n[b.getId()]={cell:b,prev:l};var d=b.getChildCount();l=null;for(var x=0;x<d;x++){var A=b.getChildAt(x);this.createCellLookup(A,l,n);l=A}return n};-EditorUi.prototype.diffCellRecursive=function(b,l,n,d,x){d=null!=d?d:{};var A=n[b.getId()];delete n[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 z=this.diffCell(b,A.cell);if(null!=z.parent||(null!=A.prev?null==l:null!=l)||null!=l&&null!=A.prev&&l.getId()!=A.prev.getId())z.previous=null!=A.prev?A.prev.getId():"";mxUtils.isEmptyObject(z)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",-b,"diff",z):d[b.getId()]=z)}A=b.getChildCount();l=null;for(z=0;z<A;z++){var D=b.getChildAt(z);this.diffCellRecursive(D,l,n,d,x);l=D}return d};-EditorUi.prototype.diffCells=function(b,l){var n={},d=[],x=this.createCellLookup(l);l.id==b.id?(l=[],b=this.diffCellRecursive(b,null,x,null,l),mxUtils.isEmptyObject(b)||(n[EditorUi.DIFF_UPDATE]=b),0<l.length&&(n[EditorUi.DIFF_REMOVE]=l)):EditorUi.debug("EditorUi.diffCells: Root changed",l.id);for(var A in x)b=x[A],d.push(this.getJsonForCell(b.cell,b.prev));0<d.length&&(n[EditorUi.DIFF_INSERT]=d);return n};-EditorUi.prototype.diffViewState=function(b,l){var n=b.viewState,d=l.viewState,x={};b==this.currentPage&&(n=this.editor.graph.getViewState());l==this.currentPage&&(d=this.editor.graph.getViewState());if(null!=n&&null!=d)for(var A in this.viewStateProperties)this.diffViewStateProperty(n,d,A,x);return x};EditorUi.prototype.diffViewStateProperty=function(b,l,n,d){b=JSON.stringify(this.getViewStateProperty(b,n));l=JSON.stringify(this.getViewStateProperty(l,n));b!=l&&(d[n]=l)};+EditorUi.prototype.diffPages=function(b,l){var n=[],d=[],v={},A={},z={},D=null;if(null!=b&&null!=l){for(var P=0;P<l.length;P++)A[l[P].getId()]={page:l[P],prev:D},D=l[P];D=null;for(P=0;P<b.length;P++){var J=b[P].getId();l=A[J];if(null==l)d.push(J);else{this.updatePageRoot(b[P]);this.updatePageRoot(l.page);var L=this.diffCells(b[P].root,l.page.root),c={};mxUtils.isEmptyObject(L)||(c.cells=L);L=this.diffViewState(b[P],l.page);mxUtils.isEmptyObject(L)||(c.view=L);if((null!=l.prev?null==D:null!=D)||null!=+D&&null!=l.prev&&D.getId()!=l.prev.getId())c.previous=null!=l.prev?l.prev.getId():"";null!=l.page.getName()&&b[P].getName()!=l.page.getName()&&(c.name=l.page.getName());mxUtils.isEmptyObject(c)||(z[J]=c)}delete A[b[P].getId()];D=b[P]}for(J in A)l=A[J],n.push({id:l.page.getId(),data:mxUtils.getXml(l.page.node),previous:null!=l.prev?l.prev.getId():""});mxUtils.isEmptyObject(z)||(v[EditorUi.DIFF_UPDATE]=z);0<d.length&&(v[EditorUi.DIFF_REMOVE]=d);0<n.length&&(v[EditorUi.DIFF_INSERT]=n)}return v};+EditorUi.prototype.createCellLookup=function(b,l,n){n=null!=n?n:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):n[b.getId()]={cell:b,prev:l};var d=b.getChildCount();l=null;for(var v=0;v<d;v++){var A=b.getChildAt(v);this.createCellLookup(A,l,n);l=A}return n};+EditorUi.prototype.diffCellRecursive=function(b,l,n,d,v){d=null!=d?d:{};var A=n[b.getId()];delete n[b.getId()];if(null==A)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):v.push(b.getId());else{var z=this.diffCell(b,A.cell);if(null!=z.parent||(null!=A.prev?null==l:null!=l)||null!=l&&null!=A.prev&&l.getId()!=A.prev.getId())z.previous=null!=A.prev?A.prev.getId():"";mxUtils.isEmptyObject(z)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",+b,"diff",z):d[b.getId()]=z)}A=b.getChildCount();l=null;for(z=0;z<A;z++){var D=b.getChildAt(z);this.diffCellRecursive(D,l,n,d,v);l=D}return d};+EditorUi.prototype.diffCells=function(b,l){var n={},d=[],v=this.createCellLookup(l);l.id==b.id?(l=[],b=this.diffCellRecursive(b,null,v,null,l),mxUtils.isEmptyObject(b)||(n[EditorUi.DIFF_UPDATE]=b),0<l.length&&(n[EditorUi.DIFF_REMOVE]=l)):EditorUi.debug("EditorUi.diffCells: Root changed",l.id);for(var A in v)b=v[A],d.push(this.getJsonForCell(b.cell,b.prev));0<d.length&&(n[EditorUi.DIFF_INSERT]=d);return n};+EditorUi.prototype.diffViewState=function(b,l){var n=b.viewState,d=l.viewState,v={};b==this.currentPage&&(n=this.editor.graph.getViewState());l==this.currentPage&&(d=this.editor.graph.getViewState());if(null!=n&&null!=d)for(var A in this.viewStateProperties)this.diffViewStateProperty(n,d,A,v);return v};EditorUi.prototype.diffViewStateProperty=function(b,l,n,d){b=JSON.stringify(this.getViewStateProperty(b,n));l=JSON.stringify(this.getViewStateProperty(l,n));b!=l&&(d[n]=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,n=b.value;null!=b.xmlValue&&(n=mxUtils.parseXml(b.xmlValue).documentElement);l=new mxCell(n,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 d in b)this.cellProperties[d]||(l[d]=b[d]);return l};EditorUi.prototype.getJsonForCell=function(b,l){var n={id:b.getId()};b.vertex&&(n.vertex=1);b.edge&&(n.edge=1);b.connectable||(n.connectable=0);null!=b.parent&&(n.parent=b.parent.getId());null!=l&&(n.previous=l.getId());null!=b.source&&(n.source=b.source.getId());null!=b.target&&(n.target=b.target.getId());null!=b.style&&(n.style=b.style);null!=b.geometry&&(n.geometry=mxUtils.getXml(this.codec.encode(b.geometry)));b.collapsed&&(n.collapsed=1);b.visible||(n.visible=0);null!=b.value&&("object"===typeof b.value&&"number"===typeof b.value.nodeType&&"string"===typeof b.value.nodeName&&"function"===typeof b.value.getAttribute?n.xmlValue=mxUtils.getXml(b.value):n.value=b.value);for(var d in b)this.cellProperties[d]||"function"===typeof b[d]||(n[d]=b[d]);return n};EditorUi.prototype.diffCell=function(b,l){function n(z){return null!=z&&"object"===typeof z&&"number"===typeof z.nodeType&&"string"===typeof z.nodeName&&"function"===typeof z.getAttribute}var d={};b.vertex!=l.vertex&&(d.vertex=l.vertex?1:0);b.edge!=l.edge&&(d.edge=l.edge?1:0);b.connectable!=l.connectable&&(d.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())d.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())d.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())d.target=null!=l.target?l.target.getId():"";n(b.value)&&n(l.value)?b.value.isEqualNode(l.value)||(d.xmlValue=mxUtils.getXml(l.value)):b.value!=l.value&&(n(l.value)?d.xmlValue=mxUtils.getXml(l.value):d.value=null!=l.value?-l.value:null);b.style!=l.style&&(d.style=l.style);b.visible!=l.visible&&(d.visible=l.visible?1:0);b.collapsed!=l.collapsed&&(d.collapsed=l.collapsed?1:0);if(!this.isObjectEqual(b.geometry,l.geometry,new mxGeometry)){var x=this.codec.encode(l.geometry);null!=x&&(d.geometry=mxUtils.getXml(x))}for(var A in b)this.cellProperties[A]||"function"===typeof b[A]||"function"===typeof l[A]||b[A]==l[A]||(d[A]=void 0===l[A]?null:l[A]);for(A in l)A in b||this.cellProperties[A]||"function"===typeof b[A]||"function"===+l.value:null);b.style!=l.style&&(d.style=l.style);b.visible!=l.visible&&(d.visible=l.visible?1:0);b.collapsed!=l.collapsed&&(d.collapsed=l.collapsed?1:0);if(!this.isObjectEqual(b.geometry,l.geometry,new mxGeometry)){var v=this.codec.encode(l.geometry);null!=v&&(d.geometry=mxUtils.getXml(v))}for(var A in b)this.cellProperties[A]||"function"===typeof b[A]||"function"===typeof l[A]||b[A]==l[A]||(d[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]||(d[A]=void 0===l[A]?null:l[A]);return d};EditorUi.prototype.resolveCrossReferences=function(b,l){var n={};mxUtils.isEmptyObject(l)||(this.adoptTheirPages(b,l,n),this.adoptTheirCells(b,l,n));EditorUi.debug("EditorUi.resolveCrossReferences",[this],"ownDiff",b,"theirDiff",l,"resolve",n);return n};-EditorUi.prototype.adoptTheirPages=function(b,l,n){var d={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++)d[l[EditorUi.DIFF_INSERT][x].id]=l[EditorUi.DIFF_INSERT][x];for(var A in b[EditorUi.DIFF_UPDATE])null!=d[A]&&(null==n[EditorUi.DIFF_INSERT]&&(n[EditorUi.DIFF_INSERT]=[]),null==n[EditorUi.DIFF_UPDATE]&&(n[EditorUi.DIFF_UPDATE]={}),n[EditorUi.DIFF_INSERT].push(d[A]),n[EditorUi.DIFF_UPDATE][A]=b[EditorUi.DIFF_UPDATE][A],delete b[EditorUi.DIFF_UPDATE][A])};-EditorUi.prototype.adoptTheirCells=function(b,l,n){for(var d in b[EditorUi.DIFF_UPDATE]){var x=b[EditorUi.DIFF_UPDATE][d];null!=x.cells&&this.adoptTheirCellsFromPage(x,l,d,n)}};-EditorUi.prototype.adoptTheirCellsFromPage=function(b,l,n,d){var x=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][n]:null;if(null!=x&&null!=x.cells&&null!=x.cells[EditorUi.DIFF_INSERT]){l=x.cells[EditorUi.DIFF_UPDATE];for(var A={},z=0;z<x.cells[EditorUi.DIFF_INSERT].length;z++){var D=x.cells[EditorUi.DIFF_INSERT][z];A[D.id]=D}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==d[EditorUi.DIFF_UPDATE]&&(d[EditorUi.DIFF_UPDATE]={});delete x.inserted;d[EditorUi.DIFF_UPDATE][n]=x}};EditorUi.prototype.resolveOwnInsertedCells=function(b,l,n){if(null!=b)for(var d=0;d<b.length;d++){var x=b[d];null!=x&&(this.adoptParentCell(x.id,null,l,n),this.adoptTerminalCell(x.id,x,l,!0,n),this.adoptTerminalCell(x.id,x,l,!1,n))}};-EditorUi.prototype.resolveOwnUpdatedCells=function(b,l,n,d){if(null!=b)for(var x in b){var A=l[x];null!=A?(d.inserted[x]||(d.cells[EditorUi.DIFF_INSERT].push(A),d.inserted[x]=!0),d.cells[EditorUi.DIFF_UPDATE][x]=b[x]):null!=n&&(A=n[x],null!=A&&(this.adoptParentCell(x,A,l,d),this.adoptTerminalCell(x,A,l,!0,d,x),this.adoptTerminalCell(x,A,l,!1,d,x)))}};-EditorUi.prototype.adoptParentCell=function(b,l,n,d){var x=n[b],A=null!=l?l.parent:null!=x?x.parent:null;null!=A&&this.adoptParentCell(A,null,n,d);null!=x?d.inserted[b]||(d.cells[EditorUi.DIFF_INSERT].push(x),d.inserted[b]=!0):null!=l&&(null==d.cells[EditorUi.DIFF_UPDATE][b]&&(d.cells[EditorUi.DIFF_UPDATE][b]={}),d.cells[EditorUi.DIFF_UPDATE][b]=l)};-EditorUi.prototype.adoptTerminalCell=function(b,l,n,d,x){l=d?l.source:l.target;n=n[l];null!=n&&(x.inserted[l]||(x.cells[EditorUi.DIFF_INSERT].push(n),x.inserted[l]=!0),null==x.cells[EditorUi.DIFF_UPDATE][b]&&(x.cells[EditorUi.DIFF_UPDATE][b]={}),x.cells[EditorUi.DIFF_UPDATE][b][d?"source":"target"]=l)};-EditorUi.prototype.isObjectEqual=function(b,l,n){if(null==b&&null==l)return!0;if(null!=b?null==l:null!=l)return!1;var d=function(x,A){return null==n||n[x]!=A?!0===A?1:A:void 0};return JSON.stringify(b,d)==JSON.stringify(l,d)};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.adoptTheirPages=function(b,l,n){var d={};if(null!=l[EditorUi.DIFF_INSERT])for(var v=0;v<l[EditorUi.DIFF_INSERT].length;v++)d[l[EditorUi.DIFF_INSERT][v].id]=l[EditorUi.DIFF_INSERT][v];for(var A in b[EditorUi.DIFF_UPDATE])null!=d[A]&&(null==n[EditorUi.DIFF_INSERT]&&(n[EditorUi.DIFF_INSERT]=[]),null==n[EditorUi.DIFF_UPDATE]&&(n[EditorUi.DIFF_UPDATE]={}),n[EditorUi.DIFF_INSERT].push(d[A]),n[EditorUi.DIFF_UPDATE][A]=b[EditorUi.DIFF_UPDATE][A],delete b[EditorUi.DIFF_UPDATE][A])};+EditorUi.prototype.adoptTheirCells=function(b,l,n){for(var d in b[EditorUi.DIFF_UPDATE]){var v=b[EditorUi.DIFF_UPDATE][d];null!=v.cells&&this.adoptTheirCellsFromPage(v,l,d,n)}};+EditorUi.prototype.adoptTheirCellsFromPage=function(b,l,n,d){var v=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][n]:null;if(null!=v&&null!=v.cells&&null!=v.cells[EditorUi.DIFF_INSERT]){l=v.cells[EditorUi.DIFF_UPDATE];for(var A={},z=0;z<v.cells[EditorUi.DIFF_INSERT].length;z++){var D=v.cells[EditorUi.DIFF_INSERT][z];A[D.id]=D}v={cells:{}};v.cells[EditorUi.DIFF_INSERT]=[];v.cells[EditorUi.DIFF_UPDATE]={};v.inserted={};this.resolveOwnInsertedCells(b.cells[EditorUi.DIFF_INSERT],A,v);this.resolveOwnUpdatedCells(b.cells[EditorUi.DIFF_UPDATE],+A,l,v);null==d[EditorUi.DIFF_UPDATE]&&(d[EditorUi.DIFF_UPDATE]={});delete v.inserted;d[EditorUi.DIFF_UPDATE][n]=v}};EditorUi.prototype.resolveOwnInsertedCells=function(b,l,n){if(null!=b)for(var d=0;d<b.length;d++){var v=b[d];null!=v&&(this.adoptParentCell(v.id,null,l,n),this.adoptTerminalCell(v.id,v,l,!0,n),this.adoptTerminalCell(v.id,v,l,!1,n))}};+EditorUi.prototype.resolveOwnUpdatedCells=function(b,l,n,d){if(null!=b)for(var v in b){var A=l[v];null!=A?(d.inserted[v]||(d.cells[EditorUi.DIFF_INSERT].push(A),d.inserted[v]=!0),d.cells[EditorUi.DIFF_UPDATE][v]=b[v]):null!=n&&(A=n[v],null!=A&&(this.adoptParentCell(v,A,l,d),this.adoptTerminalCell(v,A,l,!0,d,v),this.adoptTerminalCell(v,A,l,!1,d,v)))}};+EditorUi.prototype.adoptParentCell=function(b,l,n,d){var v=n[b],A=null!=l?l.parent:null!=v?v.parent:null;null!=A&&this.adoptParentCell(A,null,n,d);null!=v?d.inserted[b]||(d.cells[EditorUi.DIFF_INSERT].push(v),d.inserted[b]=!0):null!=l&&(null==d.cells[EditorUi.DIFF_UPDATE][b]&&(d.cells[EditorUi.DIFF_UPDATE][b]={}),d.cells[EditorUi.DIFF_UPDATE][b]=l)};+EditorUi.prototype.adoptTerminalCell=function(b,l,n,d,v){l=d?l.source:l.target;n=n[l];null!=n&&(v.inserted[l]||(v.cells[EditorUi.DIFF_INSERT].push(n),v.inserted[l]=!0),null==v.cells[EditorUi.DIFF_UPDATE][b]&&(v.cells[EditorUi.DIFF_UPDATE][b]={}),v.cells[EditorUi.DIFF_UPDATE][b][d?"source":"target"]=l)};+EditorUi.prototype.isObjectEqual=function(b,l,n){if(null==b&&null==l)return!0;if(null!=b?null==l:null!=l)return!1;var d=function(v,A){return null==n||n[v]!=A?!0===A?1:A:void 0};return JSON.stringify(b,d)==JSON.stringify(l,d)};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))}},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(b){mxSettings.settings.showStartScreen=b},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=[]);0>mxUtils.indexOf(mxSettings.settings.customLibraries,@@ -13610,7 +13610,7 @@ null==mxSettings.settings.search&&(mxSettings.settings.search=!0),null==mxSettin(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,n)}),n=mxUtils.bind(this,function(){this.thread=setTimeout(l,this.delay);this.delay=Math.min(this.maxDelay,this.delay+2E3)});n();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 n=mxUtils.bind(this,function(d){b<this.maxRetries?this.retryPoll(mxUtils.bind(this,function(){this.poll(b+1,l)})):l()});this.file.getLatestVersionId(mxUtils.bind(this,function(d){if(-1!=d){var x=this.file.getCurrentRevisionId();d!=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()}),n)}),n):+DrawioFilePolling.prototype.poll=function(b,l){b=null!=b?b:0;var n=mxUtils.bind(this,function(d){b<this.maxRetries?this.retryPoll(mxUtils.bind(this,function(){this.poll(b+1,l)})):l()});this.file.getLatestVersionId(mxUtils.bind(this,function(d){if(-1!=d){var v=this.file.getCurrentRevisionId();d!=v?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()}),n)}),n):(this.updateStatus(),l())}else l()}),n)};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,@@ -13626,7 +13626,7 @@ DrawioFileSync.prototype.updateRealtime=function(){this.isValidState()&&(this.fithis.p2pCollab=null))};DrawioFileSync.prototype.initRealtime=function(){this.file.theirPages=this.ui.clonePages(this.ui.pages);this.file.ownPages=this.ui.clonePages(this.ui.pages);this.snapshot=this.file.ownPages};DrawioFileSync.prototype.resetRealtime=function(){var b=this.file.getShadowPages();null!=b&&(b=this.ui.diffPages(b,this.file.ownPages),this.file.patch([b]));this.sendLocalChanges();this.cleanup();this.file.theirPages=null;this.snapshot=this.file.ownPages=null};DrawioFileSync.prototype.isConnected=function(){return null!=this.pusher&&null!=this.pusher.connection?"connected"==this.pusher.connection.state:null!=this.polling?this.polling.isConnected():!1};DrawioFileSync.prototype.updateOnlineState=function(){"1"!=urlParams.embedRT&&this.file.fireEvent(new mxEventObject("realtimeStateChanged"))};DrawioFileSync.prototype.updateStatus=function(){this.isConnected()&&null!=this.lastActivity&&(Date.now()-this.lastActivity)/1E3>this.inactivityTimeoutSeconds&&this.stop();this.file.isModified()||this.file.inConflictState||null!=this.file.autosaveThread||this.file.savingFile||this.file.redirectDialogShowing||(this.enabled&&null!=this.ui.statusContainer?(this.ui.updateStatus(mxUtils.bind(this,function(){var b=this.ui.timeSince(new Date(this.lastModified));null==b&&(b=mxResources.get("lessThanAMinute"));-var l=this.lastMessage;this.lastMessage=null;null!=l&&40<l.length&&(l=l.substring(0,40)+"...");var n=this.ui.getNetworkStatus();b=mxResources.get("lastChange",[b]);var d=this.file.isRevisionHistorySupported()?'data-action="revisionHistory" ':"",x=mxUtils.htmlEntities(b)+(this.file.isRevisionHistorySupported()?" - "+mxUtils.htmlEntities(mxResources.get("revisionHistory")):"");this.ui.editor.setStatus("<div "+d+'title="'+x+'">'+mxUtils.htmlEntities(b)+"</div>"+(this.file.isEditable()?this.file.isLocked()?+var l=this.lastMessage;this.lastMessage=null;null!=l&&40<l.length&&(l=l.substring(0,40)+"...");var n=this.ui.getNetworkStatus();b=mxResources.get("lastChange",[b]);var d=this.file.isRevisionHistorySupported()?'data-action="revisionHistory" ':"",v=mxUtils.htmlEntities(b)+(this.file.isRevisionHistorySupported()?" - "+mxUtils.htmlEntities(mxResources.get("revisionHistory")):"");this.ui.editor.setStatus("<div "+d+'title="'+v+'">'+mxUtils.htmlEntities(b)+"</div>"+(this.file.isEditable()?this.file.isLocked()?' <img class="geToolbarButton" data-action="properties" style="margin-left:4px;flex-shrink:0;" src="'+Editor.lockedImage+'"/>':"":'<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>")+(null!=n?'<div class="geStatusBox" title="'+mxUtils.htmlEntities(n)+'">'+mxUtils.htmlEntities(n)+"</div>":"")+(null!=l?' <div class="geStatusBox" data-effect="fade" title="'+mxUtils.htmlEntities(l)+'">'+mxUtils.htmlEntities(l)+"</div>":""))})),this.resetUpdateStatusThread()):this.ui.updateStatus(mxUtils.bind(this,function(){this.file.addAllSavedStatus()})))};DrawioFileSync.prototype.resetUpdateStatusThread=function(){null!=this.updateStatusThread&&window.clearInterval(this.updateStatusThread);null!=this.channel&&(this.updateStatusThread=window.setInterval(mxUtils.bind(this,function(){this.updateStatus()}),Editor.updateStatusInterval))};DrawioFileSync.prototype.installListeners=function(){null!=this.pusher&&null!=this.pusher.connection&&this.pusher.connection.bind("state_change",this.connectionListener);null!=this.channel&&this.channel.bind("changed",this.changeListener)};@@ -13640,42 +13640,42 @@ DrawioFileSync.prototype.fileChangedNotify=function(b,l){if(this.isValidState())this.notifyThread!=n}),!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++,n=this.createMessage({a:"change",c:b,id:l,t:Date.now()});l=!1;null!=this.p2pCollab?this.p2pCollab.sendDiff(n):"1"==urlParams.dev?(n=encodeURIComponent(this.objectToString(n)),0==this.maxSyncMessageSize||n.length<this.maxSyncMessageSize?mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+n):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,A){return x.id<A.id?-1:x.id>A.id?1:0});for(var l=null,n=0;n<this.receivedData.length;n++){var d=JSON.stringify(this.receivedData[n].c);d!=l&&this.doReceiveRemoteChanges(this.receivedData[n].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(v,A){return v.id<A.id?-1:v.id>A.id?1:0});for(var l=null,n=0;n<this.receivedData.length;n++){var d=JSON.stringify(this.receivedData[n].c);d!=l&&this.doReceiveRemoteChanges(this.receivedData[n].c);l=d}}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 n=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(d){this.file.handleFileError(d)}))}),l);EditorUi.debug("DrawioFileSync.scheduleCleanup",[this],"lazy",b,"delay",l,"prev",n,"thread",this.cleanupThread)};-DrawioFileSync.prototype.cleanup=function(b,l,n){var d=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",d,"patches",x,"checkFile",n,"checksum",this.ui.getHashValueForPages(this.ui.pages));-this.file.ignorePatches(x)||this.file.patch(x);n?this.file.getLatestVersion(mxUtils.bind(this,function(A){try{if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()){var z=A.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",A,"patches",x)}null!=b&&b()}catch(D){null!=l&&l(D)}}),l):(document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||+DrawioFileSync.prototype.cleanup=function(b,l,n){var d=this.cleanupThread;window.clearTimeout(this.cleanupThread);this.cleanupThread=null;if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()&&!this.file.isModified()){var v=[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",d,"patches",v,"checkFile",n,"checksum",this.ui.getHashValueForPages(this.ui.pages));+this.file.ignorePatches(v)||this.file.patch(v);n?this.file.getLatestVersion(mxUtils.bind(this,function(A){try{if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()){var z=A.getShadowPages();v=[this.ui.diffPages(this.ui.pages,z),this.ui.diffPages(z,this.file.ownPages)];this.file.ignorePatches(v)||this.file.patch(v);EditorUi.debug("DrawioFileSync.cleanup",[this],"newFile",A,"patches",v)}null!=b&&b()}catch(D){null!=l&&l(D)}}),l):(document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||this.testChecksum(),null!=b&&b())}else null!=b&&(b(),EditorUi.debug("DrawioFileSync.cleanup",[this],"checkFile",n,"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(n){if(!document.hidden){var d=this.ui.getHashValueForPages(n.getShadowPages()),x=n.getDescriptorChecksum(n.getDescriptor()),A=n.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",[n],"rev",A==l,"desc",x==d,"checksum",d);d!=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(n){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(n){if(!document.hidden){var d=this.ui.getHashValueForPages(n.getShadowPages()),v=n.getDescriptorChecksum(n.getDescriptor()),A=n.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",[n],"rev",A==l,"desc",v==d,"checksum",d);d!=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(n){EditorUi.debug("DrawioFileSync.testChecksum",[this],"checksum test error",n)}))};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 n in b[EditorUi.DIFF_UPDATE]){var d=b[EditorUi.DIFF_UPDATE][n];if(null!=d.cells&&null!=d.cells[EditorUi.DIFF_REMOVE]){null==l[EditorUi.DIFF_UPDATE]&&(l[EditorUi.DIFF_UPDATE]={});l[EditorUi.DIFF_UPDATE][n]={};var x=l[EditorUi.DIFF_UPDATE][n];x.cells={};x.cells[EditorUi.DIFF_REMOVE]=d.cells[EditorUi.DIFF_REMOVE]}}return l};-DrawioFileSync.prototype.patchRealtime=function(b,l,n,d){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)),z=(null==n?b:b.concat(n)).concat([A]);this.file.ownPages=this.ui.applyPatches(this.file.ownPages,z,!0,l);mxUtils.isEmptyObject(A)?this.scheduleCleanup(null!=d?!1:null):this.file.fileChanged(!1);EditorUi.debug("DrawioFileSync.patchRealtime",[this],"patches",b,"backup",l,"own",n,-"all",x,"local",A,"applied",z,"immediate",d)}return x};DrawioFileSync.prototype.isRealtimeActive=function(){return this.ui.editor.autosave};+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 n in b[EditorUi.DIFF_UPDATE]){var d=b[EditorUi.DIFF_UPDATE][n];if(null!=d.cells&&null!=d.cells[EditorUi.DIFF_REMOVE]){null==l[EditorUi.DIFF_UPDATE]&&(l[EditorUi.DIFF_UPDATE]={});l[EditorUi.DIFF_UPDATE][n]={};var v=l[EditorUi.DIFF_UPDATE][n];v.cells={};v.cells[EditorUi.DIFF_REMOVE]=d.cells[EditorUi.DIFF_REMOVE]}}return l};+DrawioFileSync.prototype.patchRealtime=function(b,l,n,d){var v=null;if(this.file.isRealtime()){v=this.extractRemove(this.ui.diffPages(this.file.getShadowPages(),this.ui.pages));var A=this.extractRemove(this.extractLocal(v)),z=(null==n?b:b.concat(n)).concat([A]);this.file.ownPages=this.ui.applyPatches(this.file.ownPages,z,!0,l);mxUtils.isEmptyObject(A)?this.scheduleCleanup(null!=d?!1:null):this.file.fileChanged(!1);EditorUi.debug("DrawioFileSync.patchRealtime",[this],"patches",b,"backup",l,"own",n,+"all",v,"local",A,"applied",z,"immediate",d)}return v};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);this.file.ownPages=this.ui.patchPages(this.file.ownPages,l,!0);this.snapshot=b;var n=this.ui.resolveCrossReferences(l,this.ui.diffPages(this.file.ownPages,this.ui.pages));this.file.ownPages=this.ui.patchPages(this.file.ownPages,n,!0);this.isRealtimeActive()&&this.doSendLocalChanges([n,l])}this.localFileWasChanged=!1}catch(d){b=this.file.getCurrentUser(),b=null!=b?b.id:"unknown",EditorUi.logError("Error in sendLocalChanges",null,this.file.getMode()+"."+this.file.getId(),b,d)}};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,n,d,x,A,z){try{this.file.stats.merged++;this.lastModified=new Date;var D=this.file.getDescriptorRevisionId(n);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var P=this.ui.clonePages(this.file.getShadowPages()),J=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(P,this.ui.pages):null,L=this.file.isRealtime()?this.ui.diffPages(P,this.file.ownPages):null;P=this.ui.applyPatches(P,b);var c=null==l?null:this.ui.getHashValueForPages(P);-EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",J,"pending",L,"checksum",l,"current",c,"valid",l==c,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",D,"etag",this.file.getDescriptorEtag(n),"immediate",z);if(null!=l&&l!=c){this.reload(mxUtils.bind(this,function(){null!=d&&d()}),mxUtils.bind(this,function(){null!=x&&x()}),A,null,z);return}this.file.setShadowPages(P);null==this.patchRealtime(b,null,L,z)&&this.file.patch(b,DrawioFile.LAST_WRITE_WINS?-J:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),n);null!=d&&d(!0)}catch(m){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=x&&x(m);try{var f=this.file.getCurrentUser(),k=null!=f?f.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),k,m)}catch(t){}}};-DrawioFileSync.prototype.fileChanged=function(b,l,n,d,x){var A=window.setTimeout(mxUtils.bind(this,function(){null!=n&&n()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",d,"immediate",x,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(z){null!=n&&n()||(this.isValidState()?this.catchup(z,b,l,n,x):null!=l&&l())}),l)):null!=l&&l())}),d?this.cacheReadyDelay:0);return this.notifyThread=+DrawioFileSync.prototype.merge=function(b,l,n,d,v,A,z){try{this.file.stats.merged++;this.lastModified=new Date;var D=this.file.getDescriptorRevisionId(n);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var P=this.ui.clonePages(this.file.getShadowPages()),J=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(P,this.ui.pages):null,L=this.file.isRealtime()?this.ui.diffPages(P,this.file.ownPages):null;P=this.ui.applyPatches(P,b);var c=null==l?null:this.ui.getHashValueForPages(P);+EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",J,"pending",L,"checksum",l,"current",c,"valid",l==c,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",D,"etag",this.file.getDescriptorEtag(n),"immediate",z);if(null!=l&&l!=c){this.reload(mxUtils.bind(this,function(){null!=d&&d()}),mxUtils.bind(this,function(){null!=v&&v()}),A,null,z);return}this.file.setShadowPages(P);null==this.patchRealtime(b,null,L,z)&&this.file.patch(b,DrawioFile.LAST_WRITE_WINS?+J:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),n);null!=d&&d(!0)}catch(m){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=v&&v(m);try{var f=this.file.getCurrentUser(),k=null!=f?f.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),k,m)}catch(t){}}};+DrawioFileSync.prototype.fileChanged=function(b,l,n,d,v){var A=window.setTimeout(mxUtils.bind(this,function(){null!=n&&n()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",d,"immediate",v,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(z){null!=n&&n()||(this.isValidState()?this.catchup(z,b,l,n,v):null!=l&&l())}),l)):null!=l&&l())}),d?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 n=0;n<this.file.ownPages.length;n++)null!=l[n]&&this.ui.getHashValueForPages([this.file.ownPages[n]])!=this.ui.getHashValueForPages([l[n]])&&(this.file.ownPages[n].needsUpdate=!0);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,n,d,x){if(null!=b&&(null==d||!d())){var A=this.file.getCurrentRevisionId(),z=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",A,"to",z,"immediate",x,"valid",this.isValidState());if(A==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)),+DrawioFileSync.prototype.catchup=function(b,l,n,d,v){if(null!=b&&(null==d||!d())){var A=this.file.getCurrentRevisionId(),z=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",A,"to",z,"immediate",v,"valid",this.isValidState());if(A==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 D=this.file.getDescriptorChecksum(b),P=this.file.getDescriptorSecret(b);if(null!=D&&D==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=l&&l(!0);else if(Editor.enableRealtimeCache&&null!=P&&"1"!=urlParams.lockdown){var J=0,L=!1,c=mxUtils.bind(this,function(){if(null==d||!d())if(A!=this.file.getCurrentRevisionId())null!=l&&-l(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var f=!0,k=window.setTimeout(mxUtils.bind(this,function(){f=!1;this.reload(l,n,d,null,x)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(A)+"&to="+encodeURIComponent(z)+(null!=P?"&secret="+encodeURIComponent(P):""),mxUtils.bind(this,function(m){this.file.stats.bytesReceived+=m.getText().length;window.clearTimeout(k);if(f&&(null==d||!d()))if(A!=this.file.getCurrentRevisionId())null!=-l&&l(!0);else if(this.isValidState()){var t=null,v=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[m],"status",m.getStatus(),"cacheReadyRetryCount",J,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=m.getStatus()&&299>=m.getStatus()&&0<m.getText().length)try{var y=JSON.parse(m.getText());if(null!=y&&0<y.length)for(var F=0;F<y.length;F++){var E=this.stringToObject(y[F]);if(E.v>DrawioFileSync.PROTOCOL){L=!0;v=[];break}else if(E.v===DrawioFileSync.PROTOCOL&&null!=E.d)t=E.d.checksum,-v.push(E.d.patch);else{L=!0;v=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[y],"status",L?"failed":"ok","temp",v,"checksum",t)}catch(C){v=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<v.length?(this.file.stats.cacheHits++,this.merge(v,t,b,l,n,d,x)):J<=this.maxCacheReadyRetries-1&&!L&&401!=m.getStatus()&&503!=m.getStatus()&&410!=m.getStatus()?(J++,this.file.stats.cacheMiss++,window.setTimeout(c,(J+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,-this.reload(l,n,d,null,x))}catch(C){null!=n&&n(C)}}else null!=n&&n()}),n)}else null!=n&&n()});window.setTimeout(c,this.cacheReadyDelay)}else this.reload(l,n,d,null,x)}else null!=n&&n()}};DrawioFileSync.prototype.reload=function(b,l,n,d,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)}),n,d,x)};+l(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var f=!0,k=window.setTimeout(mxUtils.bind(this,function(){f=!1;this.reload(l,n,d,null,v)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(A)+"&to="+encodeURIComponent(z)+(null!=P?"&secret="+encodeURIComponent(P):""),mxUtils.bind(this,function(m){this.file.stats.bytesReceived+=m.getText().length;window.clearTimeout(k);if(f&&(null==d||!d()))if(A!=this.file.getCurrentRevisionId())null!=+l&&l(!0);else if(this.isValidState()){var t=null,x=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[m],"status",m.getStatus(),"cacheReadyRetryCount",J,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=m.getStatus()&&299>=m.getStatus()&&0<m.getText().length)try{var y=JSON.parse(m.getText());if(null!=y&&0<y.length)for(var F=0;F<y.length;F++){var E=this.stringToObject(y[F]);if(E.v>DrawioFileSync.PROTOCOL){L=!0;x=[];break}else if(E.v===DrawioFileSync.PROTOCOL&&null!=E.d)t=E.d.checksum,+x.push(E.d.patch);else{L=!0;x=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[y],"status",L?"failed":"ok","temp",x,"checksum",t)}catch(C){x=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<x.length?(this.file.stats.cacheHits++,this.merge(x,t,b,l,n,d,v)):J<=this.maxCacheReadyRetries-1&&!L&&401!=m.getStatus()&&503!=m.getStatus()&&410!=m.getStatus()?(J++,this.file.stats.cacheMiss++,window.setTimeout(c,(J+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,+this.reload(l,n,d,null,v))}catch(C){null!=n&&n(C)}}else null!=n&&n()}),n)}else null!=n&&n()});window.setTimeout(c,this.cacheReadyDelay)}else this.reload(l,n,d,null,v)}else null!=n&&n()}};DrawioFileSync.prototype.reload=function(b,l,n,d,v){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",v);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)}),n,d,v)};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()})),n=this.file.getCurrentRevisionId(),d=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(b)+"&to="+encodeURIComponent(n)+"&msg="+encodeURIComponent(l)+"&data="+encodeURIComponent(d));this.file.stats.bytesSent+=d.length;this.file.stats.msgSent++;EditorUi.debug("DrawioFileSync.descriptorChanged",[this],"from",b,"to",n)}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,n){var d=!0,x=window.setTimeout(mxUtils.bind(this,function(){d=!1;n({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);d&&(200<=A.getStatus()&&299>=A.getStatus()?l(A.getText()):n({code:A.getStatus(),message:"Token Error "+A.getStatus()}))}),n)};+DrawioFileSync.prototype.createToken=function(b,l,n){var d=!0,v=window.setTimeout(mxUtils.bind(this,function(){d=!1;n({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(v);d&&(200<=A.getStatus()&&299>=A.getStatus()?l(A.getText()):n({code:A.getStatus(),message:"Token Error "+A.getStatus()}))}),n)};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,n,d,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 z=this.file.getDescriptorSecret(this.file.getDescriptor()),D=this.createMessage({m:this.lastModified.getTime()}),P=this.file.getDescriptorRevisionId(l),J=this.file.getCurrentRevisionId();if(null!=z&&null!=x&&+DrawioFileSync.prototype.fileSaved=function(b,l,n,d,v,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 z=this.file.getDescriptorSecret(this.file.getDescriptor()),D=this.createMessage({m:this.lastModified.getTime()}),P=this.file.getDescriptorRevisionId(l),J=this.file.getCurrentRevisionId();if(null!=z&&null!=v&&"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var L=this.ui.diffPages(this.file.getShadowPages(),b);l=this.file.getDescriptorSecret(l);A=null!=A?A:this.ui.getHashValueForPages(b);var c=this.objectToString(this.createMessage({patch:L,checksum:A}));this.file.stats.bytesSent+=c.length;this.file.stats.msgSent++;var f=!0,k=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(P)+"&to="+encodeURIComponent(J)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(D)))+(null!=z?"&secret="+encodeURIComponent(z):"")+(null!=l?"&last-secret="+encodeURIComponent(l):"")+(c.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(c):"")+(null!=x?"&token="+encodeURIComponent(x):""),mxUtils.bind(this,function(m){window.clearTimeout(k);f&&(200<=m.getStatus()&&299>=m.getStatus()?(Editor.p2pSyncNotify&&this.notify(D),null!=n&&n()):d({message:mxResources.get("realtimeCollaboration")++"&from="+encodeURIComponent(P)+"&to="+encodeURIComponent(J)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(D)))+(null!=z?"&secret="+encodeURIComponent(z):"")+(null!=l?"&last-secret="+encodeURIComponent(l):"")+(c.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(c):"")+(null!=v?"&token="+encodeURIComponent(v):""),mxUtils.bind(this,function(m){window.clearTimeout(k);f&&(200<=m.getStatus()&&299>=m.getStatus()?(Editor.p2pSyncNotify&&this.notify(D),null!=n&&n()):d({message:mxResources.get("realtimeCollaboration")+(0!=m.getStatus()?": "+m.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",P,"to",J,"etag",this.file.getCurrentEtag(),"diff",L,c.length,"bytes","msg",D,"checksum",A)}else this.notify(D),null!=n&&n(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",P,"to",J,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);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,n){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,n):this.fileChanged(l,n)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=n&&n({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")}))};@@ -13684,14 +13684,14 @@ 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,n){EditorUi.call(this,b,l,null!=n?n:"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,x,A){if("1"==urlParams.openInSameWin||navigator.standalone)null!=A&&A();else{var z=null;try{z=window.open(d)}catch(D){}null==z||void 0===z?this.showDialog((new PopupDialog(this,d,x,A)).container,340,140,!0,!0):null!=x&&x()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(d){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(d)});this.editor.chromeless&&+(new Image).src=mxGraph.prototype.warningImage.src;window.geOpenWindow=mxUtils.bind(this,function(d,v,A){if("1"==urlParams.openInSameWin||navigator.standalone)null!=A&&A();else{var z=null;try{z=window.open(d)}catch(D){}null==z||void 0===z?this.showDialog((new PopupDialog(this,d,v,A)).container,340,140,!0,!0):null!=v&&v()}});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_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=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":"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,n){for(var d=b.length,x=!1,A=0;A<b.length;A++)mxscript(b[A],function(){0!=--d||x||null==l||l()},null,null,null,function(z,D){x=!0;null!=n&&n(Error(z));console.error("Error loading script",z,D,D.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(";"),n=0;n<l.length;n++){var d=mxUtils.trim(l[n]);if("MODE="==d.substring(0,5)){b=d.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};+App.loadScripts=function(b,l,n){for(var d=b.length,v=!1,A=0;A<b.length;A++)mxscript(b[A],function(){0!=--d||v||null==l||l()},null,null,null,function(z,D){v=!0;null!=n&&n(Error(z));console.error("Error loading script",z,D,D.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(";"),n=0;n<l.length;n++){var d=mxUtils.trim(l[n]);if("MODE="==d.substring(0,5)){b=d.substring(5);break}}if(null!=b&&isLocalStorage){var v=new Date;v.setYear(v.getFullYear()-1);document.cookie="MODE=; expires="+v.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||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=@@ -13706,21 +13706,21 @@ mxLanguage))}catch(f){document.body.innerHTML="",c=document.createElement("pre")"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&&!mxClient.IS_IE11&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(y);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,y,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(F){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(F.stack)):(EditorUi.logError(F.message,null,null,null,F),window.setTimeout(function(){alert(F.message)},1))}}mxResources.parse(c[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var k=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=k){EditorUi.debug("Setting configuration",JSON.stringify(k));if(null!=k.merge){var m=localStorage.getItem(Editor.configurationKey);if(null!=-m)try{var t=JSON.parse(m),v;for(v in k.merge)t[v]=k.merge[v];k=t}catch(y){window.location.hash="",alert(y)}else k=k.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(k)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(y){window.location.hash="",alert(y)}1<c.length&&(Graph.prototype.defaultThemes["default-style2"]=c[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=+m)try{var t=JSON.parse(m),x;for(x in k.merge)t[x]=k.merge[x];k=t}catch(y){window.location.hash="",alert(y)}else k=k.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(k)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(y){window.location.hash="",alert(y)}1<c.length&&(Graph.prototype.defaultThemes["default-style2"]=c[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=c[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?f():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],f,function(y){document.body.innerHTML="";var F=document.createElement("pre");mxUtils.write(F,y.stack);document.body.appendChild(F)}))},function(c){c=document.getElementById("geStatus");null!=c&&(c.innerHTML="Error loading page. <a>Please try refreshing.</a>",c.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 if(Editor.loadCompatibleCss(),App.isMainCalled=!0,window.onerror=function(L,c,f,k,m){EditorUi.logError("Global: "+(null!=L?L:""),c,f,k,m,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",L,"\nURL:",c,"\nLine:",f,"\nColumn:",k,"\nError:",m)):console.error("Message:",L,"\nURL:",c,"\nLine:",f,"\nColumn:",k,"\nError:",m);window.setTimeout(function(){alert("Error: "+(null!=L?L:""))},100)},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&&+urlParams.embed||"1"==urlParams.lightbox){var v=document.getElementById("geInfo");null!=v&&v.parentNode.removeChild(v)}"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 A=-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&&(A=z.plugins)}catch(L){}z=urlParams.p;App.initPluginCallback();null!=z&&App.loadPlugins(z.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(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!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var z=JSON.parse(localStorage.getItem(mxSettings.key));null!=z&&(A=z.plugins)}catch(L){}z=urlParams.p;App.initPluginCallback();null!=z&&App.loadPlugins(z.split(";"));if(null!=A&&0<A.length&&"0"!=urlParams.plugins)for(v=0;v<A.length;v++)try{("/"==A[v].charAt(0)&&(A[v]=PLUGINS_BASE_PATH+A[v]),App.isSameDomain(A[v]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(A[v])?null==+App.pluginsLoaded[A[v]]&&(App.pluginsLoaded[A[v]]=!0,App.embedModePluginsCount++,mxscript(A[v])):null!=window.console&&console.log("Unknown plugin:",A[v]):null!=window.console&&console.log("Blocked plugin:",A[v])}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 D=window.opener||window.parent,P=function(L){if(L.source==D)try{var c=JSON.parse(L.data);null!=c&&"configure"==c.action&&(mxEvent.removeListener(window,"message",P),Editor.configure(c.config),mxSettings.load(),null!=c.config.darkColor&&document.body.style.setProperty("--dark-color",c.config.darkColor),c.colorSchemeMeta&&mxmeta("color-scheme","dark light"),n())}catch(f){null!=window.console&&console.log("Error in configure message: "+f,L.data)}};mxEvent.addListener(window,"message",P);D.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 J=localStorage.getItem(Editor.configurationKey);if(null!=J)try{J=JSON.parse(J),null!=J&&(EditorUi.debug("Using local configuration",J),Editor.configure(J),mxSettings.load())}catch(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}}}n()}}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="",A=document.createElement("pre"),mxUtils.write(A,L.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 n=0;n<b.length;n++)if(null!=b[n]&&0<b[n].length)try{if(null!=App.pluginRegistry[b[n]]){var d=PLUGINS_BASE_PATH+App.pluginRegistry[b[n]];null==App.pluginsLoaded[d]&&(App.pluginsLoaded[d]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?l?mxinclude(d):mxscript(d):l?mxinclude(d):mxscript(drawDevUrl+d))}else null!=window.console&&console.log("Unknown plugin:",b[n])}catch(x){null!=window.console&&console.log("Error loading plugin:",-b[n],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.loadPlugins=function(b,l){EditorUi.debug("Loading plugins",b);for(var n=0;n<b.length;n++)if(null!=b[n]&&0<b[n].length)try{if(null!=App.pluginRegistry[b[n]]){var d=PLUGINS_BASE_PATH+App.pluginRegistry[b[n]];null==App.pluginsLoaded[d]&&(App.pluginsLoaded[d]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?l?mxinclude(d):mxscript(d):l?mxinclude(d):mxscript(drawDevUrl+d))}else null!=window.console&&console.log("Unknown plugin:",b[n])}catch(v){null!=window.console&&console.log("Error loading plugin:",+b[n],v)}};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=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"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=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this),null!=this.gitLab&&this.gitLab.addListener("userChanged",@@ -13730,8 +13730,8 @@ this.oneDrive))}catch(z){null!=window.console&&console.log("OneDriveClient disabthis.checkLicense()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(D){null!=window.console&&console.log("DriveClient disabled: "+D.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,z),window.DrawGapiClientCallback=null):z()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=n)});n()}if("1"!=urlParams.embed||"1"==urlParams.db){var d=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=d)});d()}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()})),!(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 A=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});+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()})),!(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 v=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(v)}),function(){Editor.enableRealtimeCache=!1;window.clearTimeout(v)})}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(z){this.appIconClicked(z)}))),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(n){}return!1};@@ -13746,30 +13746,30 @@ App.prototype.showRatingBanner=function(){if(!(this.bannerShowing||this.hideBann"transform","translate(-50%,120%)");mxUtils.setPrefixedStyle(b.style,"transition","all 1s ease");b.className="geBtn gePrimaryBtn";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("border","0");l.style.cssText="position:absolute;right:10px;top:12px;filter:invert(1);padding:6px;margin:-6px;cursor:default;";b.appendChild(l);mxUtils.write(b,"Please rate us");document.body.appendChild(b);var n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.setAttribute("title","1 star");n.setAttribute("style","margin-top:-6px;cursor:pointer;margin-left:8px;");n.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(n);var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.setAttribute("title","2 star");d.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");d.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(d);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 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(d);var v=document.createElement("img");v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.setAttribute("title","3 star");v.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");v.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(v);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 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(D){mxEvent.consume(D);z()}));mxEvent.addListener(n,"click",mxUtils.bind(this,function(D){mxEvent.consume(D);z()}));mxEvent.addListener(d,"click",mxUtils.bind(this,-function(D){mxEvent.consume(D);z()}));mxEvent.addListener(x,"click",mxUtils.bind(this,function(D){mxEvent.consume(D);z()}));mxEvent.addListener(A,"click",mxUtils.bind(this,function(D){mxEvent.consume(D);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,+function(D){mxEvent.consume(D);z()}));mxEvent.addListener(v,"click",mxUtils.bind(this,function(D){mxEvent.consume(D);z()}));mxEvent.addListener(A,"click",mxUtils.bind(this,function(D){mxEvent.consume(D);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,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 n=l.lastIndexOf("@"),d=0<=n?l.substring(n+1):"";b=Editor.crc32(b.id);"gmail.com"!==d.toLowerCase()&&mxUtils.post("/license","domain="+encodeURIComponent(d)+"&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 z=JSON.parse(A);+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 n=l.lastIndexOf("@"),d=0<=n?l.substring(n+1):"";b=Editor.crc32(b.id);"gmail.com"!==d.toLowerCase()&&mxUtils.post("/license","domain="+encodeURIComponent(d)+"&id="+encodeURIComponent(b)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(v){try{if(200<=v.getStatus()&&299>=v.getStatus()){var A=v.getText();if(0<A.length){var z=JSON.parse(A);null!=z&&this.handleLicense(z,d)}}}catch(D){}}))}};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,n){if(isLocalStorage&&null!=localStorage){l=null!=l?l:"";var d=this.getRecent(l);if(null==d)d=[];else for(var x=0;x<d.length;x++)d[x].mode==b.mode&&d[x].id==b.id&&d.splice(x,1);null!=d&&(n=null!=n?n:10,d.unshift(b),d=d.slice(0,n),localStorage.setItem(".recent"+l,JSON.stringify(d)))}};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(n){}return null}};+App.prototype.addRecent=function(b,l,n){if(isLocalStorage&&null!=localStorage){l=null!=l?l:"";var d=this.getRecent(l);if(null==d)d=[];else for(var v=0;v<d.length;v++)d[v].mode==b.mode&&d[v].id==b.id&&d.splice(v,1);null!=d&&(n=null!=n?n:10,d.unshift(b),d=d.slice(0,n),localStorage.setItem(".recent"+l,JSON.stringify(d)))}};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(n){}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,n){n=null!=n?n:0;var d=!1;try{var x=!0,A=window.setTimeout(mxUtils.bind(this,function(){x=!1;l(null)}),this.timeout),z=mxUtils.bind(this,function(O){window.clearTimeout(A);x&&l(O)});null==this.thumbImageCache&&(this.thumbImageCache={});var D=this.editor.graph,P=D.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var J=D.getGlobalVariable;D=this.createTemporaryGraph(D.getStylesheet());D.setBackgroundImage=this.editor.graph.setBackgroundImage;+App.prototype.getThumbnail=function(b,l,n){n=null!=n?n:0;var d=!1;try{var v=!0,A=window.setTimeout(mxUtils.bind(this,function(){v=!1;l(null)}),this.timeout),z=mxUtils.bind(this,function(O){window.clearTimeout(A);v&&l(O)});null==this.thumbImageCache&&(this.thumbImageCache={});var D=this.editor.graph,P=D.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var J=D.getGlobalVariable;D=this.createTemporaryGraph(D.getStylesheet());D.setBackgroundImage=this.editor.graph.setBackgroundImage;var L=this.pages[0];this.currentPage==L?D.setBackgroundImage(P):null!=L.viewState&&null!=L.viewState&&(P=L.viewState.backgroundImage,D.setBackgroundImage(P));D.getGlobalVariable=function(O){return"page"==O?L.getName():"pagenumber"==O?1:J.apply(this,arguments)};D.getGlobalVariable=J;document.body.appendChild(D.container);D.model.setRoot(L.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(O){try{D!=this.editor.graph&&null!=D.container.parentNode&&D.container.parentNode.removeChild(D.container)}catch(q){O=null}z(O)}),b,this.thumbImageCache,"#ffffff",function(){z()},null,null,null,null,null,null,D,n,null,null,null,"diagram",null),d=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var c=document.createElement("canvas"),f=D.getGraphBounds(),k=D.view.translate,m=D.view.scale;null!=P&&(f=mxRectangle.fromRectangle(f),f.add(new mxRectangle((k.x+P.x)*m,(k.y+P.y)*m,P.width*m,P.height*m)));var t=b/f.width;t=Math.min(1,Math.min(3*b/(4*-f.height),t));var v=Math.floor(f.x),y=Math.floor(f.y);c.setAttribute("width",Math.ceil(t*(f.width+4)));c.setAttribute("height",Math.ceil(t*(f.height+4)));var F=c.getContext("2d");F.scale(t,t);F.translate(-v,-y);var E=D.background;if(null==E||""==E||E==mxConstants.NONE)E="#ffffff";F.save();F.fillStyle=E;F.fillRect(v,y,Math.ceil(f.width+4),Math.ceil(f.height+4));F.restore();if(null!=P){var C=new Image;C.src=P.src;F.drawImage(C,P.x*t,P.y*t,P.width*t,P.height*t)}var S=new mxJsCanvas(c),U=new mxAsyncCanvas(this.thumbImageCache);+f.height),t));var x=Math.floor(f.x),y=Math.floor(f.y);c.setAttribute("width",Math.ceil(t*(f.width+4)));c.setAttribute("height",Math.ceil(t*(f.height+4)));var F=c.getContext("2d");F.scale(t,t);F.translate(-x,-y);var E=D.background;if(null==E||""==E||E==mxConstants.NONE)E="#ffffff";F.save();F.fillStyle=E;F.fillRect(x,y,Math.ceil(f.width+4),Math.ceil(f.height+4));F.restore();if(null!=P){var C=new Image;C.src=P.src;F.drawImage(C,P.x*t,P.y*t,P.width*t,P.height*t)}var S=new mxJsCanvas(c),U=new mxAsyncCanvas(this.thumbImageCache);S.images=this.thumbImageCache.images;var Q=new mxImageExport;Q.drawShape=function(O,q){O.shape instanceof mxShape&&O.shape.checkBounds()&&(q.save(),q.translate(.5,.5),O.shape.paint(q),q.translate(-.5,-.5),q.restore())};Q.drawText=function(O,q){};Q.drawState(D.getView().getState(D.model.root),U);U.finish(mxUtils.bind(this,function(){try{Q.drawState(D.getView().getState(D.model.root),S),D!=this.editor.graph&&null!=D.container.parentNode&&D.container.parentNode.removeChild(D.container)}catch(O){c=null}z(c)}));d=!0}}catch(O){d=!1,null!=D&&D!=this.editor.graph&&null!=D.container.parentNode&&D.container.parentNode.removeChild(D.container)}d||window.clearTimeout(A);return d};(function(){var b=EditorUi.prototype.setMode;App.prototype.setMode=function(l,n){b.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var d=this.getCurrentFile();l=null!=d?d.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(n)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(A){}}})();+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(n)try{if(isLocalStorage)localStorage.setItem(".mode",l);else if("undefined"!=typeof Storage){var v=new Date;v.setYear(v.getFullYear()+1);document.cookie="MODE="+l+"; expires="++v.toUTCString()}}catch(A){}}})();App.prototype.appIconClicked=function(b){var l=this.getCurrentFile(),n=null!=l?l.getMode():null;l=null!=l?mxEvent.isAltDown(b)?l.getFolderUrl():l.getFileUrl():null;null!=l?this.openLink(l):n==App.MODE_GOOGLE?this.openLink("https://drive.google.com/?authuser=0"):n==App.MODE_ONEDRIVE?this.openLink("https://onedrive.live.com/"):n==App.MODE_DROPBOX?this.openLink("https://www.dropbox.com/"):n==App.MODE_GITHUB?this.openLink("https://github.com/"):n==App.MODE_GITLAB?this.openLink(DRAWIO_GITLAB_URL):n==App.MODE_TRELLO?this.openLink("https://trello.com/"):n==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(n,d,x){this.spinner.stop();null==d&&(d=urlParams.title,x=!0,d=null!=d?decodeURIComponent(d):this.defaultFilename);0<(Editor.useCanvasForExport?--1:".png"==d.substring(d.length-4))&&(d=d.substring(0,d.length-4)+".drawio");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,n,d):new LocalFile(this,n,d,x))}))}}catch(n){}};App.prototype.loadGapi=function(b){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,b)};+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(n,d,v){this.spinner.stop();null==d&&(d=urlParams.title,v=!0,d=null!=d?decodeURIComponent(d):this.defaultFilename);0<(Editor.useCanvasForExport?+-1:".png"==d.substring(d.length-4))&&(d=d.substring(0,d.length-4)+".drawio");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,n,d):new LocalFile(this,n,d,v))}))}}catch(n){}};App.prototype.loadGapi=function(b){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,b)};App.prototype.load=function(){try{if("1"!=urlParams.embed)try{if(this.spinner.spin(document.body,mxResources.get("starting"))){try{this.stateArg=null!=urlParams.state&&null!=this.drive?JSON.parse(decodeURIComponent(urlParams.state)):null}catch(b){}this.editor.graph.setEnabled(null!=this.getCurrentFile());null!=window.location.hash&&0!=window.location.hash.length||null==this.drive||null==this.stateArg||null==this.stateArg.userId||this.drive.setUserId(this.stateArg.userId);null!=urlParams.fileId?(window.location.hash="G"+urlParams.fileId,window.location.search=this.getSearch(["fileId"])):null==this.drive?(this.mode==App.MODE_GOOGLE&&(this.mode=null),this.start()):this.loadGapi(mxUtils.bind(this,function(){this.start()}))}}catch(b){this.handleError(b)}else this.restoreLibraries(),"1"==urlParams.gapi&&this.loadGapi(function(){})}catch(b){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(b.stack)):(EditorUi.logError(b.message,null,null,null,b),alert(b.message))}};App.prototype.showRefreshDialog=function(b,l){this.showingRefreshDialog||(this.showingRefreshDialog=!0,this.showError(b||mxResources.get("externalChanges"),l||mxResources.get("redirectToNewApp"),mxResources.get("refresh"),mxUtils.bind(this,function(){var n=this.getCurrentFile();null!=n&&n.setModified(!1);this.spinner.spin(document.body,mxResources.get("connecting"));this.editor.graph.setEnabled(!1);window.location.reload()}),null,null,null,null,null,340,180),null!=this.dialog&&null!=this.dialog.container&&@@ -13785,127 +13785,127 @@ f,k,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(this.createTimeout(2E3,mxUtils.bind(this,function(f){this.installMessageHandler(mxUtils.bind(this,function(k,m){m.source==L&&f.clear()&&(this.spinner.stop(),J(k))}))}),mxUtils.bind(this,function(f){this.handleError(f)})))}}else if(null==this.dialog)if("1"==urlParams.demo)c=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=c;else{c=!1;try{c=null!=window.opener&&null!=window.opener.openFile}catch(f){}c?this.spinner.spin(document.body,mxResources.get("loading")):(c=this.getDiagramId(),!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=c&&0!=c.length||this.editor.isChromelessView()?null!=c&&0<c.length?this.loadFile(c,null,null,mxUtils.bind(this,function(){var f=decodeURIComponent(urlParams.viewbox||"");if(""!=f)try{var k=JSON.parse(f);this.editor.graph.fitWindow(k,k.border)}catch(m){console.error(m)}})):"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||-"#create="==window.location.hash.substring(0,8))&&0<d.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(J){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,J,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var L=urlParams.title;L=null!=L?decodeURIComponent(L):+"#create="==window.location.hash.substring(0,8))&&0<d.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var v=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),A=mxUtils.bind(this,function(J){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,J,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var L=urlParams.title;L=null!=L?decodeURIComponent(L):this.defaultFilename;J=this.getServiceCount(!0);isLocalStorage&&J++;var c=4>=J?2:6<J?4:3;L=new CreateDialog(this,L,mxUtils.bind(this,function(f,k){if(null==k){this.hideDialog();var m=Editor.useLocalStorage;this.createFile(0<f.length?f:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=m}else this.pickFolder(k,mxUtils.bind(this,function(t){this.createFile(f,this.getFileData(!0),null,k,null,!0,t)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,c,null,null,null,this.editor.fileExtensions);this.showDialog(L.container,420,J>c?390:280,!0,!1,mxUtils.bind(this,function(f){f&&null==this.getCurrentFile()&&this.showSplash()}));L.init()}});if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))if("{"==d.charAt(0)){this.spinner.stop();d=JSON.parse(d);var z=mxUtils.bind(this,function(J){this.spinner.stop();this.createFile(null!=d.filename?d.filename:this.defaultFilename,J,null,null,mxUtils.bind(this,function(){this.editor.chromeless&&!this.editor.editable||this.actions.get("fitWindow").funct();window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]));window.location.hash="R"+Graph.compress(J)}),!0,null,!0)}),D=d.data;d.compressed&&(D=Graph.decompress(D));if("mermaid"==d.type&&this.spinner.spin(document.body,mxResources.get("loading")))window.isMermaidEnabled?this.parseMermaidDiagram(D,null,mxUtils.bind(this,function(J){z(J)}),mxUtils.bind(this,function(J){this.handleError(J)}),null,!0):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));else if("generate"==d.type&&this.spinner.spin(document.body,mxResources.get("generate")+" '"+D+"'"))this.generateOpenAiMermaidDiagram(D,function(J){z(J)},mxUtils.bind(this,function(J){this.handleError(J,mxResources.get("errorLoadingFile"))}),!0,{complexity:"high"});else if("csv"==d.type){var P=this.createTemporaryGraph(this.editor.graph.getStylesheet());this.importCsv(D,mxUtils.bind(this,function(){var J=new mxCodec;z(mxUtils.getXml(J.encode(P.getModel())))}),-P)}else this.handleError({message:mxResources.get("invalidCallFnNotFound",[d.type])},mxResources.get("errorLoadingFile"))}else try{null!=window.opener&&null!=window.opener[d]?A(window.opener[d]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(J){A(J)},mxUtils.bind(this,function(J){this.handleError(J,mxResources.get("errorLoadingFile"),x)}))}else(null==window.location.hash||1>=window.location.hash.length)&&+P)}else this.handleError({message:mxResources.get("invalidCallFnNotFound",[d.type])},mxResources.get("errorLoadingFile"))}else try{null!=window.opener&&null!=window.opener[d]?A(window.opener[d]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(J){A(J)},mxUtils.bind(this,function(J){this.handleError(J,mxResources.get("errorLoadingFile"),v)}))}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),n())}}catch(J){this.handleError(J)}};App.prototype.openGenerateDialog=function(b){null==this.chatWindow?(this.chatWindow=new ChatWindow(this,224,104,280,320),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.chatWindow.window.setVisible(!0),this.fireEvent(new mxEventObject("chat"))):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(n){this.hideDialog();if(null!=n){var d=this.editor.graph.getFreeInsertPoint(!0);l.setSelectionCells(this.importXml(n,Math.max(d.x,20),Math.max(d.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 n=this.getCurrentFile();null!=n&&(n.fileChanged(),null!=l&&l())}),0)}),null,null,!0)};-App.prototype.filterDrafts=function(b,l,n){function d(){n(x)}var x=[];try{this.getDatabaseItems(mxUtils.bind(this,function(A){EditorUi.debug("App.filterDrafts",[this],"items",A);for(var z=0;z<A.length;z++)try{var D=A[z].key;if(null!=D&&".draft_"==D.substring(0,7)){var P=JSON.parse(A[z].data);null!=P&&"draft"==P.type&&P.aliveCheck!=l&&(null==b&&null==P.fileObject||null!=P.fileObject&&P.fileObject.path==b)&&(P.key=D,x.push(P))}}catch(J){}d()}),d)}catch(A){d()}};+App.prototype.filterDrafts=function(b,l,n){function d(){n(v)}var v=[];try{this.getDatabaseItems(mxUtils.bind(this,function(A){EditorUi.debug("App.filterDrafts",[this],"items",A);for(var z=0;z<A.length;z++)try{var D=A[z].key;if(null!=D&&".draft_"==D.substring(0,7)){var P=JSON.parse(A[z].data);null!=P&&"draft"==P.type&&P.aliveCheck!=l&&(null==b&&null==P.fileObject||null!=P.fileObject&&P.fileObject.path==b)&&(P.key=D,v.push(P))}}catch(J){}d()}),d)}catch(A){d()}};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 n=new Date(l[0].modified);n=new DraftDialog(this,1<l.length?mxResources.get("selectDraft"):mxResources.get("draftFound",-[n.toLocaleDateString()+" "+n.toLocaleTimeString()]),1<l.length?null:l[0].data,mxUtils.bind(this,function(d){this.hideDialog();d=""!=d&&null!=l[d]?d:0;this.loadDraft(l[d].data,mxUtils.bind(this,function(){this.removeDatabaseItem(l[d].key)}))}),mxUtils.bind(this,function(d,x){this.removeDatabaseItem(l[""!=d?d:0].key);null!=x&&x()}),null,null,null,1<l.length?l:null);this.showDialog(n.container,640,480,!0,!1,mxUtils.bind(this,function(d){d&&("0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,+[n.toLocaleDateString()+" "+n.toLocaleTimeString()]),1<l.length?null:l[0].data,mxUtils.bind(this,function(d){this.hideDialog();d=""!=d&&null!=l[d]?d:0;this.loadDraft(l[d].data,mxUtils.bind(this,function(){this.removeDatabaseItem(l[d].key)}))}),mxUtils.bind(this,function(d,v){this.removeDatabaseItem(l[""!=d?d:0].key);null!=v&&v()}),null,null,null,1<l.length?l:null);this.showDialog(n.container,640,480,!0,!1,mxUtils.bind(this,function(d){d&&("0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))}));n.init()}else"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(l){}};-App.prototype.showSplash=function(b){if("1"!=urlParams.noFileMenu){var l=this.getServiceCount(!0),n=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,z){!A&&!z||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")},+App.prototype.showSplash=function(b){if("1"!=urlParams.noFileMenu){var l=this.getServiceCount(!0),n=mxUtils.bind(this,function(){var v=new SplashDialog(this);this.showDialog(v.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:230,!0,!0,mxUtils.bind(this,function(A,z){!A&&!z||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&&n();else{b=4==l?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();n()}),b);this.showDialog(d.container,3>b?200:300,3<l?320:210,!0,!1)}}};App.prototype.addLanguageMenu=function(b,l,n){var d=null;null!=this.menus.get("language")&&(d=document.createElement("div"),this.setElementTitle(d,"language"),d.className="geAdaptiveAsset",d.style.backgroundImage="url("+Editor.globeImage+")",d.style.backgroundPosition="right center",d.style.backgroundRepeat="no-repeat",d.style.backgroundSize="19px 19px",d.style.width="19px",d.style.height="19px",mxUtils.setOpacity(d,40),d.style.position="absolute",d.style.cursor="pointer",d.style.bottom="20px",d.style.right=-null!=n?n:"22px",l&&(d.style.direction="rtl",d.style.textAlign="right",d.style.right=null!=n?n:"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")),d.appendChild(l),l.className="geAdaptiveAsset"),mxEvent.addListener(d,"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 z=mxUtils.getOffset(d);A.popup(z.x,z.y+d.offsetHeight,null,x);this.setCurrentMenu(A)})),b.appendChild(d));return d};-App.prototype.loadFileSystemEntry=function(b,l,n){n=null!=n?n:mxUtils.bind(this,function(d){this.handleError(d)});try{b.getFile().then(mxUtils.bind(this,function(d){var x=new FileReader;x.onload=mxUtils.bind(this,function(A){var z=mxUtils.bind(this,function(D){try{if(null!=l){var P=A.target.result;"image/png"==d.type&&(P=this.extractGraphModelFromPng(P));l(new LocalFile(this,P,d.name,null,b,d,D))}else this.openFileHandle(A.target.result,d.name,d,!1,b,D)}catch(J){n(J)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,-function(D){z("denied"!==D)})):b.createWritable().then(mxUtils.bind(this,function(){z(!0)}),mxUtils.bind(this,function(D){z(!1)}))});x.onerror=n;"image"!==d.type.substring(0,5)&&"application/pdf"!==d.type||"image/svg"===d.type.substring(0,9)?x.readAsText(d):x.readAsDataURL(d)}),n)}catch(d){n(d)}};-App.prototype.createFileSystemOptions=function(b){var l=[],n=null;if(null!=b){var d=b.lastIndexOf(".");0<d&&(n=b.substring(d+1))}for(d=0;d<this.editor.diagramFileTypes.length;d++){var x={description:mxResources.get(this.editor.diagramFileTypes[d].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[d].extension+")":""),accept:{}};x.accept[this.editor.diagramFileTypes[d].mimeType]=["."+this.editor.diagramFileTypes[d].extension];this.editor.diagramFileTypes[d].extension==n?l.splice(0,0,-x):this.editor.diagramFileTypes[d].extension==n?l.splice(0,0,x):l.push(x)}return{types:l,suggestedName:b}};App.prototype.showSaveFilePicker=function(b,l,n){l=null!=l?l:mxUtils.bind(this,function(d){"AbortError"!=d.name&&this.handleError(d)});n=null!=n?n:this.createFileSystemOptions();window.showSaveFilePicker(n).then(mxUtils.bind(this,function(d){null!=d&&d.getFile().then(mxUtils.bind(this,function(x){b(d,x)}),l)}),l)};+null!=n?n:"22px",l&&(d.style.direction="rtl",d.style.textAlign="right",d.style.right=null!=n?n:"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")),d.appendChild(l),l.className="geAdaptiveAsset"),mxEvent.addListener(d,"click",mxUtils.bind(this,function(v){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 z=mxUtils.getOffset(d);A.popup(z.x,z.y+d.offsetHeight,null,v);this.setCurrentMenu(A)})),b.appendChild(d));return d};+App.prototype.loadFileSystemEntry=function(b,l,n){n=null!=n?n:mxUtils.bind(this,function(d){this.handleError(d)});try{b.getFile().then(mxUtils.bind(this,function(d){var v=new FileReader;v.onload=mxUtils.bind(this,function(A){var z=mxUtils.bind(this,function(D){try{if(null!=l){var P=A.target.result;"image/png"==d.type&&(P=this.extractGraphModelFromPng(P));l(new LocalFile(this,P,d.name,null,b,d,D))}else this.openFileHandle(A.target.result,d.name,d,!1,b,D)}catch(J){n(J)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,+function(D){z("denied"!==D)})):b.createWritable().then(mxUtils.bind(this,function(){z(!0)}),mxUtils.bind(this,function(D){z(!1)}))});v.onerror=n;"image"!==d.type.substring(0,5)&&"application/pdf"!==d.type||"image/svg"===d.type.substring(0,9)?v.readAsText(d):v.readAsDataURL(d)}),n)}catch(d){n(d)}};+App.prototype.createFileSystemOptions=function(b){var l=[],n=null;if(null!=b){var d=b.lastIndexOf(".");0<d&&(n=b.substring(d+1))}for(d=0;d<this.editor.diagramFileTypes.length;d++){var v={description:mxResources.get(this.editor.diagramFileTypes[d].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[d].extension+")":""),accept:{}};v.accept[this.editor.diagramFileTypes[d].mimeType]=["."+this.editor.diagramFileTypes[d].extension];this.editor.diagramFileTypes[d].extension==n?l.splice(0,0,+v):this.editor.diagramFileTypes[d].extension==n?l.splice(0,0,v):l.push(v)}return{types:l,suggestedName:b}};App.prototype.showSaveFilePicker=function(b,l,n){l=null!=l?l:mxUtils.bind(this,function(d){"AbortError"!=d.name&&this.handleError(d)});n=null!=n?n:this.createFileSystemOptions();window.showSaveFilePicker(n).then(mxUtils.bind(this,function(d){null!=d&&d.getFile().then(mxUtils.bind(this,function(v){b(d,v)}),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 n=document.createElement("input");n.setAttribute("type","file");mxEvent.addListener(n,"change",mxUtils.bind(this,function(){null!=n.files&&(this.openFiles(n.files),n.type="",n.type="file",n.value="")}));n.style.display="none";document.body.appendChild(n);this.openFileInputElt=n}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,D){StorageFile.listFiles(this,"F",z,D)});window.openBrowserFile=mxUtils.bind(this,function(z,D,P){StorageFile.getFileContent(this,z,D,P)});window.deleteBrowserFile=mxUtils.bind(this,function(z,D,P){StorageFile.deleteFile(this,z,D,P)});var d=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,-function(z,D){var P=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=D.substring(D.length-4)||(D=D.substring(0,D.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,z,D):new LocalFile(this,z,D))}),J=this.getCurrentFile();null!=J&&J.isModified()?this.confirm(mxResources.get("allChangesLost"),null,P,mxResources.get("cancel"),mxResources.get("discardChanges")):P()}));var x=this.dialog,A=x.close;this.dialog.close=mxUtils.bind(this,function(z){Editor.useLocalStorage=-d;A.apply(x,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(z){this.handleError(z)}};+function(z,D){var P=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=D.substring(D.length-4)||(D=D.substring(0,D.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,z,D):new LocalFile(this,z,D))}),J=this.getCurrentFile();null!=J&&J.isModified()?this.confirm(mxResources.get("allChangesLost"),null,P,mxResources.get("cancel"),mxResources.get("discardChanges")):P()}));var v=this.dialog,A=v.close;this.dialog.close=mxUtils.bind(this,function(z){Editor.useLocalStorage=+d;A.apply(v,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(A){try{this.loadLibrary(A);this.showSidebar();try{this.sidebar.palettes[A.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 n=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!=n&&n.pickLibrary(mxUtils.bind(this,function(A,z){null!=z?l(z):this.spinner.spin(document.body,mxResources.get("loading"))&&n.getLibrary(A,mxUtils.bind(this,function(D){this.spinner.stop();l(D)}),mxUtils.bind(this,function(D){this.handleError(D,null!=D?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 A=0;A<d.files.length;A++)mxUtils.bind(this,function(z){var D=new FileReader;D.onload=mxUtils.bind(this,function(P){l(new LocalLibrary(this,P.target.result,z.name))});D.readAsText(z)})(d.files[A]);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(A,z){StorageFile.listFiles(this,"L",A,z)});window.openBrowserFile=mxUtils.bind(this,function(A,z,D){StorageFile.getFileContent(this,A,z,D)});window.deleteBrowserFile=mxUtils.bind(this,function(A,z,D){StorageFile.deleteFile(this,A,z,D)});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,z){l(b==App.MODE_BROWSER?new StorageLibrary(this,-A,z):new LocalLibrary(this,A,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,n,d,x,A,z){try{d=null!=d?d:this.mode;x=null!=x?x:!1;A=null!=A?A:!1;var D=this.createLibraryDataFromImages(l),P=mxUtils.bind(this,function(c){this.spinner.stop();null!=z&&z();this.handleError(c,null!=c?mxResources.get("errorSavingFile"):null)});null==n&&d==App.MODE_DEVICE&&(n=new LocalLibrary(this,D,b));if(null==n)this.pickFolder(d,mxUtils.bind(this,function(c){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?+mxUtils.bind(this,function(A,z){StorageFile.listFiles(this,"L",A,z)});window.openBrowserFile=mxUtils.bind(this,function(A,z,D){StorageFile.getFileContent(this,A,z,D)});window.deleteBrowserFile=mxUtils.bind(this,function(A,z,D){StorageFile.deleteFile(this,A,z,D)});var v=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,z){l(b==App.MODE_BROWSER?new StorageLibrary(this,+A,z):new LocalLibrary(this,A,z))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=v;window.openFile=null})}};+App.prototype.saveLibrary=function(b,l,n,d,v,A,z){try{d=null!=d?d:this.mode;v=null!=v?v:!1;A=null!=A?A:!1;var D=this.createLibraryDataFromImages(l),P=mxUtils.bind(this,function(c){this.spinner.stop();null!=z&&z();this.handleError(c,null!=c?mxResources.get("errorSavingFile"):null)});null==n&&d==App.MODE_DEVICE&&(n=new LocalLibrary(this,D,b));if(null==n)this.pickFolder(d,mxUtils.bind(this,function(c){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(b,D,c,mxUtils.bind(this,function(f){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(f,l)}),P,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,D,mxUtils.bind(this,function(f){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(f,l)}),P,c):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,D,mxUtils.bind(this,function(f){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(f,l)}),P,c):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,D,mxUtils.bind(this,function(f){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(f,l)}),P,c):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,D,mxUtils.bind(this,function(f){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(f,l)}),P,c):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,D,mxUtils.bind(this,function(f){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(f,l)}),P,c):d==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,D,b),mxUtils.bind(this,function(f){this.hideDialog(!0);this.libraryLoaded(f,l)}),P):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));-else if(x||this.spinner.spin(document.body,mxResources.get("saving"))){n.setData(D);var J=mxUtils.bind(this,function(){n.save(!0,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);A||this.libraryLoaded(n,l);null!=z&&z()}),P)});if(b!=n.getTitle()){var L=n.getHash();n.rename(b,mxUtils.bind(this,function(c){n.constructor!=LocalLibrary&&L!=n.getHash()&&(mxSettings.removeCustomLibrary(L),mxSettings.addCustomLibrary(n.getHash()));this.removeLibrarySidebar(L);J()}),P)}else J()}}catch(c){this.handleError(c)}};-App.prototype.saveFile=function(b,l){var n=this.getCurrentFile(),d=this.mode;if(null!=n){var x=mxUtils.bind(this,function(){EditorUi.enableDrafts&&n.removeDraft();this.getCurrentFile()==n||n.isModified()||(n.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==n.getTitle()||null!=n.invalidFileHandle||null==this.mode)if(null!=n&&n.constructor==LocalFile&&-null!=n.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(D,P){n.invalidFileHandle=null;n.fileHandle=D;n.title=P.name;n.desc=P;n.editable=null;this.save(P.name,x)}),null,this.createFileSystemOptions(n.getTitle()));else{b=null!=n.getTitle()?n.getTitle():this.defaultFilename;var A=mxUtils.bind(this,function(D,P,J,L){if(null!=D&&0<D.length)if(/(\.pdf)$/i.test(D))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),-mxUtils.bind(this,function(){J.value=D.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==d&&P==App.MODE_DEVICE)null!=n&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(f,k){n.fileHandle=f;n.mode=App.MODE_DEVICE;n.title=k.name;n.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(D)):(this.setMode(App.MODE_DEVICE),this.save(D,x));else if("download"==P)(new LocalFile(this,null,D)).save();else if("_blank"==P)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(d!=P){var c=mxUtils.bind(this,function(f){var k=this.editor.graph,m=k.getSelectionCells(),t=k.getViewState(),-v=this.currentPage;this.createFile(D,this.getFileData(/(\.xml)$/i.test(D)||0>D.indexOf(".")||/(\.drawio)$/i.test(D),/(\.svg)$/i.test(D),/(\.html)$/i.test(D)),null,P,x,null==this.mode,f,null,null,mxUtils.bind(this,function(){this.restoreViewState(v,t,m)}))});null!=L?c(L):this.pickFolder(P,c)}else null!=P&&this.save(D,x)}),z=!mxClient.IS_IOS||!navigator.standalone;b=new SaveDialog(this,b,mxUtils.bind(this,function(D,P,J){A(D.value,P,D,J);this.hideDialog()}),z?null:["_blank"]);this.showDialog(b.container,-420,150,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));b.init()}else this.save(n.getTitle(),x)}};-App.prototype.loadTemplate=function(b,l,n,d,x){var A=!1,z=b,D=null!=d?d:b;d=/\.png$/i.test(D)||/\.pdf$/i.test(D);var P=EditorUi.isVisioFilename(D);this.editor.isCorsEnabledForUrl(z)||(A=d||P,z="t="+(new Date).getTime(),z=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+z+(A?"&base64=1":""));this.editor.loadUrl(z,mxUtils.bind(this,function(J){try{var L=A?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(J):atob(J):J;if(P||this.isVisioData(L))P||(D=x?this.isRemoteVisioData(L)?"raw.vss":"raw.vssx":+else if(v||this.spinner.spin(document.body,mxResources.get("saving"))){n.setData(D);var J=mxUtils.bind(this,function(){n.save(!0,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);A||this.libraryLoaded(n,l);null!=z&&z()}),P)});if(b!=n.getTitle()){var L=n.getHash();n.rename(b,mxUtils.bind(this,function(c){n.constructor!=LocalLibrary&&L!=n.getHash()&&(mxSettings.removeCustomLibrary(L),mxSettings.addCustomLibrary(n.getHash()));this.removeLibrarySidebar(L);J()}),P)}else J()}}catch(c){this.handleError(c)}};+App.prototype.saveFile=function(b,l){var n=this.getCurrentFile(),d=this.mode;if(null!=n){var v=mxUtils.bind(this,function(){EditorUi.enableDrafts&&n.removeDraft();this.getCurrentFile()==n||n.isModified()||(n.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==n.getTitle()||null!=n.invalidFileHandle||null==this.mode)if(null!=n&&n.constructor==LocalFile&&+null!=n.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(D,P){n.invalidFileHandle=null;n.fileHandle=D;n.title=P.name;n.desc=P;n.editable=null;this.save(P.name,v)}),null,this.createFileSystemOptions(n.getTitle()));else{b=null!=n.getTitle()?n.getTitle():this.defaultFilename;var A=mxUtils.bind(this,function(D,P,J,L){if(null!=D&&0<D.length)if(/(\.pdf)$/i.test(D))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),+mxUtils.bind(this,function(){J.value=D.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==d&&P==App.MODE_DEVICE)null!=n&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(f,k){n.fileHandle=f;n.mode=App.MODE_DEVICE;n.title=k.name;n.desc=k;this.setMode(App.MODE_DEVICE);this.save(k.name,v)}),mxUtils.bind(this,+function(f){"AbortError"!=f.name&&this.handleError(f)}),this.createFileSystemOptions(D)):(this.setMode(App.MODE_DEVICE),this.save(D,v));else if("download"==P)(new LocalFile(this,null,D)).save();else if("_blank"==P)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(d!=P){var c=mxUtils.bind(this,function(f){var k=this.editor.graph,m=k.getSelectionCells(),t=k.getViewState(),+x=this.currentPage;this.createFile(D,this.getFileData(/(\.xml)$/i.test(D)||0>D.indexOf(".")||/(\.drawio)$/i.test(D),/(\.svg)$/i.test(D),/(\.html)$/i.test(D)),null,P,v,null==this.mode,f,null,null,mxUtils.bind(this,function(){this.restoreViewState(x,t,m)}))});null!=L?c(L):this.pickFolder(P,c)}else null!=P&&this.save(D,v)}),z=!mxClient.IS_IOS||!navigator.standalone;b=new SaveDialog(this,b,mxUtils.bind(this,function(D,P,J){A(D.value,P,D,J);this.hideDialog()}),z?null:["_blank"]);this.showDialog(b.container,+420,150,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));b.init()}else this.save(n.getTitle(),v)}};+App.prototype.loadTemplate=function(b,l,n,d,v){var A=!1,z=b,D=null!=d?d:b;d=/\.png$/i.test(D)||/\.pdf$/i.test(D);var P=EditorUi.isVisioFilename(D);this.editor.isCorsEnabledForUrl(z)||(A=d||P,z="t="+(new Date).getTime(),z=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+z+(A?"&base64=1":""));this.editor.loadUrl(z,mxUtils.bind(this,function(J){try{var L=A?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(J):atob(J):J;if(P||this.isVisioData(L))P||(D=v?this.isRemoteVisioData(L)?"raw.vss":"raw.vssx":this.isRemoteVisioData(L)?"raw.vsd":"raw.vsdx"),this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(c){l(c)},n,D);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(L,D))this.isExternalDataComms()?this.parseFileData(L,mxUtils.bind(this,function(c){4==c.readyState&&200<=c.status&&299>=c.status&&"<mxGraphModel"==c.responseText.substring(0,13)&&l(c.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,n);else if(this.isLucidChartData(L))this.convertLucidChart(L,mxUtils.bind(this,function(c){l(c)}),mxUtils.bind(this,function(c){n(c)}));else{if(/(\.png)($|\?)/i.test(D)||Editor.isPngData(L))L=Editor.extractGraphModelFromPng(J);l(L)}}catch(c){n(c)}}),n,/(\.png)($|\?)/i.test(D)||P,null,null,A)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"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):!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 n=l.documentElement.getElementsByTagName("diagram"),d=0;d<n.length;d++){var x=Editor.parseDiagramNode(n[d],!0);null!=x&&(mxUtils.setTextContent(n[d],""),n[d].appendChild(x))}b=mxUtils.getPrettyXml(l.documentElement)}}catch(A){}return b};-App.prototype.createFile=function(b,l,n,d,x,A,z,D,P,J){EditorUi.debug("App.createFile",[this],"title",[b],"data",[l],"libs",[n],"mode",[d]);d=D?null:null!=d?d: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()}),c=mxUtils.bind(this,function(k){L();null==k&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():-null!=k&&this.handleError(k)});try{var f=mxUtils.bind(this,function(k){L();this.fileCreated(k,n,A,x,P,J)});d==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,f,c)):d==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,l,f,c,!1,z):d==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,l,f,c,!1,z):d==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,l,f,c,!1,z):d==App.MODE_DROPBOX&&-null!=this.dropbox?this.dropbox.insertFile(b,l,f,c):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,l,f,c,!1,z):d==App.MODE_BROWSER?StorageFile.insertFile(this,b,l,f,c):!D&&d==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(L(),this.showSaveFilePicker(mxUtils.bind(this,function(k,m){var t=new LocalFile(this,l,m.name,null,k,m);t.saveFile(m.name,!1,mxUtils.bind(this,function(){this.fileCreated(t,n,A,x,P,J)}),c,!0)}),mxUtils.bind(this,function(k){"AbortError"!=k.name&&c(k)}),this.createFileSystemOptions(b))):-(L(),this.fileCreated(new LocalFile(this,l,b,null==d),n,A,x,P,J))}catch(k){L(),this.handleError(k)}}};-App.prototype.fileCreated=function(b,l,n,d,x,A){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[l],"replace",[n]);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 D=b.getData();D=0<D.length?this.editor.extractGraphModel(mxUtils.parseXml(D).documentElement,!0):null;var P=window.location.protocol++App.prototype.uncompressPages=function(b){if(null!=b)try{var l=mxUtils.parseXml(b);if("mxfile"==l.documentElement.nodeName){for(var n=l.documentElement.getElementsByTagName("diagram"),d=0;d<n.length;d++){var v=Editor.parseDiagramNode(n[d],!0);null!=v&&(mxUtils.setTextContent(n[d],""),n[d].appendChild(v))}b=mxUtils.getPrettyXml(l.documentElement)}}catch(A){}return b};+App.prototype.createFile=function(b,l,n,d,v,A,z,D,P,J){EditorUi.debug("App.createFile",[this],"title",[b],"data",[l],"libs",[n],"mode",[d]);d=D?null:null!=d?d: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()}),c=mxUtils.bind(this,function(k){L();null==k&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():+null!=k&&this.handleError(k)});try{var f=mxUtils.bind(this,function(k){L();this.fileCreated(k,n,A,v,P,J)});d==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,f,c)):d==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,l,f,c,!1,z):d==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,l,f,c,!1,z):d==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,l,f,c,!1,z):d==App.MODE_DROPBOX&&+null!=this.dropbox?this.dropbox.insertFile(b,l,f,c):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,l,f,c,!1,z):d==App.MODE_BROWSER?StorageFile.insertFile(this,b,l,f,c):!D&&d==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(L(),this.showSaveFilePicker(mxUtils.bind(this,function(k,m){var t=new LocalFile(this,l,m.name,null,k,m);t.saveFile(m.name,!1,mxUtils.bind(this,function(){this.fileCreated(t,n,A,v,P,J)}),c,!0)}),mxUtils.bind(this,function(k){"AbortError"!=k.name&&c(k)}),this.createFileSystemOptions(b))):+(L(),this.fileCreated(new LocalFile(this,l,b,null==d),n,A,v,P,J))}catch(k){L(),this.handleError(k)}}};+App.prototype.fileCreated=function(b,l,n,d,v,A){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[l],"replace",[n]);var z=window.location.pathname;null!=l&&0<l.length&&(z+="?libs="+l);null!=v&&0<v.length&&(z+="?clibs="+v);z=this.getUrl(z);b.getMode()!=App.MODE_DEVICE&&(z+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var D=b.getData();D=0<D.length?this.editor.extractGraphModel(mxUtils.parseXml(D).documentElement,!0):null;var P=window.location.protocol+"//"+window.location.hostname+z,J=D,L=null;null!=D&&/\.svg$/i.test(b.getTitle())&&(L=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(L.container),J=this.decodeNodeIntoGraph(J,L));b.setData(this.createFileData(D,L,b,P));null!=L&&L.container.parentNode.removeChild(L.container);var c=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(){c();var k=this.getCurrentFile();null==n&&null!=k&&(n=!k.isModified()&&(null==k.getMode()||EditorUi.isElectronApp));-var m=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,A);n&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=l&&this.sidebar.showEntries(l);if(null!=x){for(var v=[],y=x.split(";"),F=0;F<y.length;F++)v.push(decodeURIComponent(y[F]));this.loadLibraries(v)}null!=d&&d()}),t=mxUtils.bind(this,function(){n||null==k||!k.isModified()?m():this.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges"))});+var m=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,A);n&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=l&&this.sidebar.showEntries(l);if(null!=v){for(var x=[],y=v.split(";"),F=0;F<y.length;F++)x.push(decodeURIComponent(y[F]));this.loadLibraries(x)}null!=d&&d()}),t=mxUtils.bind(this,function(){n||null==k||!k.isModified()?m():this.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==n||n?t():(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,t))});b.constructor==LocalFile?f():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){f()}),mxUtils.bind(this,function(k){c();null!=k&&"AbortError"==k.name||this.handleError(k)}))}};-App.prototype.loadFile=function(b,l,n,d,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 P=mxUtils.bind(this,function(k){this.handleError(k,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var m=this.getCurrentFile();window.location.hash=+App.prototype.loadFile=function(b,l,n,d,v){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 P=mxUtils.bind(this,function(k){this.handleError(k,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var m=this.getCurrentFile();window.location.hash=null!=m?m.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(k){null!=k?(this.fileLoaded(new StorageFile(this,k,b)),null!=d&&d()):P({message:mxResources.get("fileNotFound")})}),P)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var k=this.getCurrentFile();window.location.hash=null!=k?k.getHash():""}));else if(null!=n)this.spinner.stop(),this.fileLoaded(n),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("R"==b.charAt(0)){this.spinner.stop();var J=decodeURIComponent(b.substring(1));"<"!=J.charAt(0)&&(J=Graph.decompress(J));J=new LocalFile(this,J,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);J.getHash=function(){return b};this.fileLoaded(J);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(k,m){this.spinner.stop();this.fileLoaded(new EmbedFile(this,k,m));null!=d&&d()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var L=decodeURIComponent(b.substring(1)),c=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=L.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var k=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var m=L.substring(31,L.lastIndexOf("&ex"));this.loadFile("G"+m,l,null,mxUtils.bind(this,function(){var t=this.getCurrentFile();null!=t&&this.editor.chromeless&&!this.editor.editable&&(t.getHash=-function(){return"G"+m},window.location.hash="#"+t.getHash());null!=d&&d()}));return!0}return!1});!k()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",k);return!0});this.loadTemplate(L,mxUtils.bind(this,function(k){this.spinner.stop();if(null!=k&&0<k.length){var m=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var t=L,v=L.lastIndexOf("."),y=t.lastIndexOf("/");v>y&&0<y&&(t=t.substring(y+1,v),v=L.substring(v),Editor.useCanvasForExport||-".png"!=v||(v=".drawio"),".svg"===v||".xml"===v||".html"===v||".png"===v||".drawio"===v)&&(m=t+v)}k=new LocalFile(this,k,null!=urlParams.title?decodeURIComponent(urlParams.title):m,!0);k.getHash=function(){return b};this.fileLoaded(k,!0)?null!=d&&d():c()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else c()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){c()||(this.spinner.stop(),+function(){return"G"+m},window.location.hash="#"+t.getHash());null!=d&&d()}));return!0}return!1});!k()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",k);return!0});this.loadTemplate(L,mxUtils.bind(this,function(k){this.spinner.stop();if(null!=k&&0<k.length){var m=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var t=L,x=L.lastIndexOf("."),y=t.lastIndexOf("/");x>y&&0<y&&(t=t.substring(y+1,x),x=L.substring(x),Editor.useCanvasForExport||+".png"!=x||(x=".drawio"),".svg"===x||".xml"===x||".html"===x||".png"===x||".drawio"===x)&&(m=t+x)}k=new LocalFile(this,k,null!=urlParams.title?decodeURIComponent(urlParams.title):m,!0);k.getHash=function(){return b};this.fileLoaded(k,!0)?null!=d&&d():c()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else c()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){c()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else{var f=this.getModeForChar(b.charAt(0));mxUtils.bind(this,function(){var k=this.getServiceForName(f);if(null==k)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var t=this.getCurrentFile();window.location.hash=null!=-t?t.getHash():""}));else{var m=b.charAt(0);b=decodeURIComponent(b.substring(1));k.getFile(b,mxUtils.bind(this,function(t){this.spinner.stop();this.fileLoaded(t);var v=this.getCurrentFile();if(null==v)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){v.getHash=function(){return m+b};t="#"+v.getHash();try{var y=this.getHashObject();null==y||mxUtils.isEmptyObject(y)||(t=t+"#"+encodeURIComponent(JSON.stringify(y)))}catch(F){}window.location.replace(t)}else t==-v&&null==t.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var F=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+F+'" class="geStatusAlert">'+F+"</div>")}));null!=d&&d()}),mxUtils.bind(this,function(t){null!=window.console&&null!=t&&console.log("error in loadFile:",b,t);var v=mxUtils.bind(this,function(){var y=this.getCurrentFile();null==y?(window.location.hash="",this.showSplash()):window.location.hash="#"+y.getHash()});null==t||"AbortError"!=t.name?this.handleError(t,-null!=t?mxResources.get("errorLoadingFile"):null,v,null,null,"#"+m+b):v()}))}})()}}),z=this.getCurrentFile(),D=mxUtils.bind(this,function(){x||null==z||!z.isModified()?A():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=z&&(window.location.hash=z.getHash())}),A,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==l&&null!=z&&!z.isModified()&&this.isBlankFile()?D():null==z||l?D():this.showDialog((new PopupDialog(this,this.getUrl()++t?t.getHash():""}));else{var m=b.charAt(0);b=decodeURIComponent(b.substring(1));k.getFile(b,mxUtils.bind(this,function(t){this.spinner.stop();this.fileLoaded(t);var x=this.getCurrentFile();if(null==x)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){x.getHash=function(){return m+b};t="#"+x.getHash();try{var y=this.getHashObject();null==y||mxUtils.isEmptyObject(y)||(t=t+"#"+encodeURIComponent(JSON.stringify(y)))}catch(F){}window.location.replace(t)}else t==+x&&null==t.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var F=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+F+'" class="geStatusAlert">'+F+"</div>")}));null!=d&&d()}),mxUtils.bind(this,function(t){null!=window.console&&null!=t&&console.log("error in loadFile:",b,t);var x=mxUtils.bind(this,function(){var y=this.getCurrentFile();null==y?(window.location.hash="",this.showSplash()):window.location.hash="#"+y.getHash()});null==t||"AbortError"!=t.name?this.handleError(t,+null!=t?mxResources.get("errorLoadingFile"):null,x,null,null,"#"+m+b):x()}))}})()}}),z=this.getCurrentFile(),D=mxUtils.bind(this,function(){v||null==z||!z.isModified()?A():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=z&&(window.location.hash=z.getHash())}),A,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==l&&null!=z&&!z.isModified()&&this.isBlankFile()?D():null==z||l?D():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+b,null,D)).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(n){for(var d=0;d<n.length;d++)""!=n[d]&&0>mxUtils.indexOf(l,n[d])&&l.push(n[d])}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 n=mxUtils.bind(this,function(J,L){L||mxSettings.removeCustomLibrary(J);delete this.loadedLibraries[J]}),d=0,x=[],A=0<b.length&&"L.scratchpad"==b[0]?1:0,z=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var J=b.length-1;0<=J;J--)null!=x[J]&&this.loadLibrary(x[J],J<=A);null!=l&&l()}});if(null!=b)for(var D=0;D<b.length;D++){var P=encodeURIComponent(decodeURIComponent(b[D]));-mxUtils.bind(this,function(J,L){if(null!=J&&0<J.length&&null==this.loadedLibraries[J]&&null==this.sidebar.palettes[J]){this.loadedLibraries[J]=!0;d++;var c=mxUtils.bind(this,function(y){x[L]=y;d--;z()}),f=mxUtils.bind(this,function(y){n(J,y);d--;z()}),k=J.substring(0,1);if("L"==k)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var y=decodeURIComponent(J.substring(1));StorageFile.getFileContent(this,y,mxUtils.bind(this,function(F){".scratchpad"==y&&null==+App.prototype.loadLibraries=function(b,l){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var n=mxUtils.bind(this,function(J,L){L||mxSettings.removeCustomLibrary(J);delete this.loadedLibraries[J]}),d=0,v=[],A=0<b.length&&"L.scratchpad"==b[0]?1:0,z=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var J=b.length-1;0<=J;J--)null!=v[J]&&this.loadLibrary(v[J],J<=A);null!=l&&l()}});if(null!=b)for(var D=0;D<b.length;D++){var P=encodeURIComponent(decodeURIComponent(b[D]));+mxUtils.bind(this,function(J,L){if(null!=J&&0<J.length&&null==this.loadedLibraries[J]&&null==this.sidebar.palettes[J]){this.loadedLibraries[J]=!0;d++;var c=mxUtils.bind(this,function(y){v[L]=y;d--;z()}),f=mxUtils.bind(this,function(y){n(J,y);d--;z()}),k=J.substring(0,1);if("L"==k)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var y=decodeURIComponent(J.substring(1));StorageFile.getFileContent(this,y,mxUtils.bind(this,function(F){".scratchpad"==y&&null==F&&(F=this.emptyLibraryXml);null!=F?c(new StorageLibrary(this,F,y)):f()}),f)}catch(F){f()}}),0);else if("U"==k){var m=decodeURIComponent(J.substring(1));this.isOffline()?f(!0):this.loadTemplate(m,mxUtils.bind(this,function(y){null!=y&&0<y.length?c(new UrlLibrary(this,y,m)):f()}),function(){f()},null,!0)}else if("R"==k){k=decodeURIComponent(J.substring(1));try{k=JSON.parse(k);var t={id:k[0],title:k[1],downloadUrl:k[2]};this.remoteInvoke("getFileContent",[t.downloadUrl],null,mxUtils.bind(this,function(y){try{c(new RemoteLibrary(this,-y,t))}catch(F){f()}}),function(){f()})}catch(y){f()}}else if("S"==k&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(J.substring(1)),function(y){c(y)},f)}catch(y){f()}else{var v=null;"G"==k?null!=this.drive&&null!=this.drive.user&&(v=this.drive):"H"==k?null!=this.gitHub&&null!=this.gitHub.getUser()&&(v=this.gitHub):"T"==k?null!=this.trello&&this.trello.isAuthorized()&&(v=this.trello):"D"==k?null!=this.dropbox&&null!=this.dropbox.getUser()&&(v=this.dropbox):"W"==k&&null!=this.oneDrive&&-null!=this.oneDrive.getUser()&&(v=this.oneDrive);null!=v?v.getLibrary(decodeURIComponent(J.substring(1)),mxUtils.bind(this,function(y){try{c(y)}catch(F){f()}}),function(y){f()}):f(!0)}}})(P,D)}z()}};+y,t))}catch(F){f()}}),function(){f()})}catch(y){f()}}else if("S"==k&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(J.substring(1)),function(y){c(y)},f)}catch(y){f()}else{var x=null;"G"==k?null!=this.drive&&null!=this.drive.user&&(x=this.drive):"H"==k?null!=this.gitHub&&null!=this.gitHub.getUser()&&(x=this.gitHub):"T"==k?null!=this.trello&&this.trello.isAuthorized()&&(x=this.trello):"D"==k?null!=this.dropbox&&null!=this.dropbox.getUser()&&(x=this.dropbox):"W"==k&&null!=this.oneDrive&&+null!=this.oneDrive.getUser()&&(x=this.oneDrive);null!=x?x.getLibrary(decodeURIComponent(J.substring(1)),mxUtils.bind(this,function(y){try{c(y)}catch(F){f()}}),function(y){f()}):f(!0)}}})(P,D)}z()}};App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer)if(EditorUi.isElectronApp||this.isOffline()||(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="";var 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 n=document.createElement("img");this.userButton.appendChild(n);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(D){this.toggleUserPanel();var P=this.userButton.getBoundingClientRect(),J=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=P.bottom+"px";this.userPanel.style.right=J-P.right+"px";mxEvent.consume(D)}));var d=document.createElement("img");d.style.position=-"absolute";d.style.width="10px";this.userButton.appendChild(d);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){n=this.userButton.getElementsByTagName("img")[0];d=this.userButton.getElementsByTagName("img")[1];var x=mxResources.get("changeUser"),A=this.getMainUser();null!=A&&null!=A.displayName&&(x=A.displayName);null!=A&&null!=A.pictureUrl?(n.classList.remove("geAdaptiveAsset"),n.src=A.pictureUrl,d.style.top="3px",d.style.right="0"):(n.classList.add("geAdaptiveAsset"),n.src=-Editor.userImage,d.style.top="6px",d.style.right="4px");if(null!=b&&b.isRealtimeEnabled()&&b.isRealtimeSupported()){d.style.display="";n=b.getRealtimeError();var z=b.getRealtimeState();x+=" (";1==z?(d.src=Editor.syncImage,x+=mxResources.get("online")):(d.src=Editor.syncProblemImage,x=null!=n&&null!=n.message?x+n.message:x+mxResources.get("disconnected"));x+=")"}else d.style.display="none",d.src=Editor.cloudImage;this.userButton.setAttribute("title",x);this.userButton.style.display="draw.io"!=this.getServiceName()||+"absolute";d.style.width="10px";this.userButton.appendChild(d);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){n=this.userButton.getElementsByTagName("img")[0];d=this.userButton.getElementsByTagName("img")[1];var v=mxResources.get("changeUser"),A=this.getMainUser();null!=A&&null!=A.displayName&&(v=A.displayName);null!=A&&null!=A.pictureUrl?(n.classList.remove("geAdaptiveAsset"),n.src=A.pictureUrl,d.style.top="3px",d.style.right="0"):(n.classList.add("geAdaptiveAsset"),n.src=+Editor.userImage,d.style.top="6px",d.style.right="4px");if(null!=b&&b.isRealtimeEnabled()&&b.isRealtimeSupported()){d.style.display="";n=b.getRealtimeError();var z=b.getRealtimeState();v+=" (";1==z?(d.src=Editor.syncImage,v+=mxResources.get("online")):(d.src=Editor.syncProblemImage,v=null!=n&&null!=n.message?v+n.message:v+mxResources.get("disconnected"));v+=")"}else d.style.display="none",d.src=Editor.cloudImage;this.userButton.setAttribute("title",v);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 n=null,d=mxUtils.bind(this,function(x){x=x.filter(function(P){return!P.targets||-1<P.targets.indexOf(b)||null!=l&&-1<P.targets.indexOf(l)});for(var A=b+"NotifReadTS",z=isLocalStorage?parseInt(localStorage.getItem(A)):!0,D=0;D<x.length;D++)x[D].isNew=!z||x[D].timestamp>z;this.showNotification(x,A)});try{isLocalStorage&&(n=JSON.parse(localStorage.getItem(".notifCache")))}catch(x){}null==-n||n.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(z,D){return D.timestamp-z.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:A}));this.fetchingNotif=!1;d(A)}catch(z){}}))):d(n.notifs)}};-App.prototype.showNotification=function(b,l){function n(J){var L=document.querySelector(".geNotification-count");null!=L&&(L.innerHTML=J,L.style.display=0==J?"none":"",L=document.querySelector(".geNotification-bell"),L.style.animation=0==J?"none":"",L.className="geNotification-bell"+(0==J?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==J?"none":"")}var d=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var x=d=0;x<b.length;x++)b[x].isNew&&+App.prototype.fetchAndShowNotification=function(b,l){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var n=null,d=mxUtils.bind(this,function(v){v=v.filter(function(P){return!P.targets||-1<P.targets.indexOf(b)||null!=l&&-1<P.targets.indexOf(l)});for(var A=b+"NotifReadTS",z=isLocalStorage?parseInt(localStorage.getItem(A)):!0,D=0;D<v.length;D++)v[D].isNew=!z||v[D].timestamp>z;this.showNotification(v,A)});try{isLocalStorage&&(n=JSON.parse(localStorage.getItem(".notifCache")))}catch(v){}null==+n||n.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(v){if(200<=v.getStatus()&&299>=v.getStatus())try{var A=JSON.parse(v.getText());A.sort(function(z,D){return D.timestamp-z.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:A}));this.fetchingNotif=!1;d(A)}catch(z){}}))):d(n.notifs)}};+App.prototype.showNotification=function(b,l){function n(J){var L=document.querySelector(".geNotification-count");null!=L&&(L.innerHTML=J,L.style.display=0==J?"none":"",L=document.querySelector(".geNotification-bell"),L.style.animation=0==J?"none":"",L.className="geNotification-bell"+(0==J?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==J?"none":"")}var d=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var v=d=0;v<b.length;v++)b[v].isNew&&d++;if(0==d)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 J=this.notificationWin.querySelectorAll(".circle.active"),L=0;L<J.length;L++)J[L].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";d=document.createElement("span");d.className="geNotification-count";this.notificationBtn.appendChild(d);this.notifCount=d;d=document.createElement("div");d.className="geNotification-bell";x=document.createElement("span");x.className="geBell-top";d.appendChild(x);x=document.createElement("span");x.className="geBell-middle";d.appendChild(x);x=document.createElement("span");x.className="geBell-bottom";d.appendChild(x);x=document.createElement("span");x.className="geBell-rad";d.appendChild(x);-this.notificationBtn.appendChild(d);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";d=document.createElement("span");d.className="title";d.textContent=mxResources.get("notifications");x.appendChild(d);d=document.createElement("span");d.className="closeBtn";d.textContent="x";x.appendChild(d);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 J=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=-J.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=J.right-this.notificationWin.clientWidth+"px";n(0)}else A()}));mxEvent.addListener(d,"click",A)}else this.notificationBtn.style.display="";var D=0,P=document.getElementById("geNotifList");if(null!=P){P.innerHTML='<div class="line"></div>';for(x=0;x<b.length;x++)(function(J,L){L.isNew&&D++;var c=document.createElement("div");c.className="notification";J=J.timeSince(new Date(L.timestamp));null==J&&(J=mxResources.get("lessThanAMinute"));-c.innerHTML='<div class="circle'+(L.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[J],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(L.content)+"</p>";L.link&&mxEvent.addListener(c,"click",function(){window.open(L.link,"notifWin")});P.appendChild(c)})(this,b[x]);n(D)}}};-App.prototype.save=function(b,l){var n=this.getCurrentFile(),d=!0,x=mxUtils.bind(this,function(){d&&(d=!1,n.handleFileSuccess(!0),null!=l&&l())}),A=mxUtils.bind(this,function(z){if(d){d=!1;Editor.addRetryToError(z,mxUtils.bind(this,function(){this.save(b,l)}));if(null!=z&&null!=z.retry){var D=z.retry;z.retry=function(){d=!0;try{n.isModified()?D():x()}catch(P){A(P)}}}n.handleFileError(z,null==z||"AbortError"!=z.name)}});if(null!=n&&this.spinner.spin(document.body,mxResources.get("saving"),A,3*this.timeout))try{this.clearStatus(),-this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==n.getTitle()?n.save(!0,x,A):n.saveAs(b,x,A)}catch(z){A(z)}};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_DROPBOX?this.dropbox:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:null};+"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";v=document.createElement("span");v.className="geBell-top";d.appendChild(v);v=document.createElement("span");v.className="geBell-middle";d.appendChild(v);v=document.createElement("span");v.className="geBell-bottom";d.appendChild(v);v=document.createElement("span");v.className="geBell-rad";d.appendChild(v);+this.notificationBtn.appendChild(d);this.notificationWin=document.createElement("div");this.notificationWin.className="geNotifPanel";this.notificationWin.style.display="none";document.body.appendChild(this.notificationWin);v=document.createElement("div");v.className="header";d=document.createElement("span");d.className="title";d.textContent=mxResources.get("notifications");v.appendChild(d);d=document.createElement("span");d.className="closeBtn";d.textContent="x";v.appendChild(d);this.notificationWin.appendChild(v);+v=document.createElement("div");v.className="notifications clearfix";var z=document.createElement("div");z.setAttribute("id","geNotifList");z.style.position="relative";v.appendChild(z);this.notificationWin.appendChild(v);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 J=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=+J.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=J.right-this.notificationWin.clientWidth+"px";n(0)}else A()}));mxEvent.addListener(d,"click",A)}else this.notificationBtn.style.display="";var D=0,P=document.getElementById("geNotifList");if(null!=P){P.innerHTML='<div class="line"></div>';for(v=0;v<b.length;v++)(function(J,L){L.isNew&&D++;var c=document.createElement("div");c.className="notification";J=J.timeSince(new Date(L.timestamp));null==J&&(J=mxResources.get("lessThanAMinute"));+c.innerHTML='<div class="circle'+(L.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[J],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(L.content)+"</p>";L.link&&mxEvent.addListener(c,"click",function(){window.open(L.link,"notifWin")});P.appendChild(c)})(this,b[v]);n(D)}}};+App.prototype.save=function(b,l){var n=this.getCurrentFile(),d=!0,v=mxUtils.bind(this,function(){d&&(d=!1,n.handleFileSuccess(!0),null!=l&&l())}),A=mxUtils.bind(this,function(z){if(d){d=!1;Editor.addRetryToError(z,mxUtils.bind(this,function(){this.save(b,l)}));if(null!=z&&null!=z.retry){var D=z.retry;z.retry=function(){d=!0;try{n.isModified()?D():v()}catch(P){A(P)}}}n.handleFileError(z,null==z||"AbortError"!=z.name)}});if(null!=n&&this.spinner.spin(document.body,mxResources.get("saving"),A,3*this.timeout))try{this.clearStatus(),+this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==n.getTitle()?n.save(!0,v,A):n.saveAs(b,v,A)}catch(z){A(z)}};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_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"):EditorUi.prototype.getTitleForService.apply(this,arguments)};-App.prototype.pickFolder=function(b,l,n,d,x,A){n=null!=n?n:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var z=this.spinner.pause();n&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(D){z();if(D.action==google.picker.Action.PICKED){var P=null;null!=D.docs&&0<D.docs.length&&"folder"==D.docs[0].type&&(P=D.docs[0].id);l(A?D:P)}}),x):n&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(D){z();+App.prototype.pickFolder=function(b,l,n,d,v,A){n=null!=n?n:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var z=this.spinner.pause();n&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(D){z();if(D.action==google.picker.Action.PICKED){var P=null;null!=D.docs&&0<D.docs.length&&"folder"==D.docs[0].type&&(P=D.docs[0].id);l(A?D:P)}}),v):n&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(D){z();if(null!=D&&null!=D.value&&0<D.value.length){var P=OneDriveFile.prototype.getIdOf(D.value[0]);l(A?D:P)}}),d):n&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(D){z();l(D)})):n&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(D){z();l(D)})):n&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(D){z();l(D)})):EditorUi.prototype.pickFolder.apply(this,arguments)};-App.prototype.exportFile=function(b,l,n,d,x,A){x==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(l,d?this.base64ToBlob(b,n):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,A,mxUtils.bind(this,function(z){this.spinner.stop()}),-mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),n,d):x==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(l,d?this.base64ToBlob(b,n):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),!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(z){this.spinner.stop();this.handleError(z)}),!0,A,d):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,A,d):x==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(l,d?this.base64ToBlob(b,-n):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),!1,A):x==App.MODE_BROWSER&&(null!=window.StorageFile&&!d&&this.spinner.spin(document.body,mxResources.get("saving"))?(n="<mxlibrary"==b.substring(0,10)?new StorageLibrary(this,b,l):new StorageFile(this,b,l),StorageFile.doInsertFile(n,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}))):(n=mxUtils.bind(this,+App.prototype.exportFile=function(b,l,n,d,v,A){v==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(l,d?this.base64ToBlob(b,n):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)})):v==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(l,b,A,mxUtils.bind(this,function(z){this.spinner.stop()}),+mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),n,d):v==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(l,d?this.base64ToBlob(b,n):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),!1,A):v==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,A,d):v==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,A,d):v==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(l,d?this.base64ToBlob(b,+n):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),!1,A):v==App.MODE_BROWSER&&(null!=window.StorageFile&&!d&&this.spinner.spin(document.body,mxResources.get("saving"))?(n="<mxlibrary"==b.substring(0,10)?new StorageLibrary(this,b,l):new StorageFile(this,b,l),StorageFile.doInsertFile(n,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}))):(n=mxUtils.bind(this,function(){localStorage.setItem(l,b)}),null==localStorage.getItem(l)?n():this.confirm(mxResources.get("replaceIt",[l]),n)))};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 n=b.isEditable();l.isEnabled()&&!n&&l.reset();l.setEnabled(n);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,n,d){var x=this.spinner.pause();this.showDialog((new AuthDialog(this,b,l,mxUtils.bind(this,function(A){try{null!=n&&n(A,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(A){null!=d&&d(A);A&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};-App.prototype.convertFile=function(b,l,n,d,x,A,z,D){var P=l;/\.svg$/i.test(P)||(P=P.substring(0,l.lastIndexOf("."))+d);var J=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(J=!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);J||(L.responseType="blob");if(D)for(var c in D)L.setRequestHeader(c,D[c]);L.onload=mxUtils.bind(this,function(){if(200<=-L.status&&299>=L.status){var k=null;J?(k=JSON.parse(L.responseText),k=this.base64ToBlob(k.content,"application/octet-stream")):k=new Blob([L.response],{type:"application/octet-stream"});this.importVisio(k,mxUtils.bind(this,function(m){x(new LocalFile(this,m,P,!0))}),A,l)}else null!=A&&A({message:mxResources.get("errorLoadingFile")})});L.onerror=A;L.send()}else{var f=mxUtils.bind(this,function(k){try{if(/\.pdf$/i.test(l)){var m=Editor.extractGraphModelFromPdf(k);null!=m&&0<m.length&&x(new LocalFile(this,-m,P,!0))}else/\.png$/i.test(l)?(m=this.extractGraphModelFromPng(k),null!=m?x(new LocalFile(this,m,P,!0)):x(new LocalFile(this,k,l,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,b)?this.parseFileData(k,mxUtils.bind(this,function(t){4==t.readyState&&(200<=t.status&&299>=t.status?x(new LocalFile(this,t.responseText,P,!0)):null!=A&&A({message:mxResources.get("errorLoadingFile")}))}),l):x(new LocalFile(this,k,P,!0))}catch(t){null!=A&&A(t)}});n=/\.png$/i.test(l)||/\.jpe?g$/i.test(l)||-/\.pdf$/i.test(l)||null!=n&&"image/"==n.substring(0,6);J?mxUtils.get(b,mxUtils.bind(this,function(k){if(200<=k.getStatus()&&299>=k.getStatus()){if(null!=x){k=JSON.parse(k.getText());var m=k.content;"base64"===k.encoding&&(m=/\.png$/i.test(l)?"data:image/png;base64,"+m:/\.pdf$/i.test(l)?"data:application/pdf;base64,"+m:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(m):atob(m));f(m)}}else null!=A&&A({code:App.ERROR_UNKNOWN})}),function(){null!=A&&A({code:App.ERROR_UNKNOWN})},!1,this.timeout,+App.prototype.showAuthDialog=function(b,l,n,d){var v=this.spinner.pause();this.showDialog((new AuthDialog(this,b,l,mxUtils.bind(this,function(A){try{null!=n&&n(A,mxUtils.bind(this,function(){this.hideDialog();v()}))}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(A){null!=d&&d(A);A&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};+App.prototype.convertFile=function(b,l,n,d,v,A,z,D){var P=l;/\.svg$/i.test(P)||(P=P.substring(0,l.lastIndexOf("."))+d);var J=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(J=!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);J||(L.responseType="blob");if(D)for(var c in D)L.setRequestHeader(c,D[c]);L.onload=mxUtils.bind(this,function(){if(200<=+L.status&&299>=L.status){var k=null;J?(k=JSON.parse(L.responseText),k=this.base64ToBlob(k.content,"application/octet-stream")):k=new Blob([L.response],{type:"application/octet-stream"});this.importVisio(k,mxUtils.bind(this,function(m){v(new LocalFile(this,m,P,!0))}),A,l)}else null!=A&&A({message:mxResources.get("errorLoadingFile")})});L.onerror=A;L.send()}else{var f=mxUtils.bind(this,function(k){try{if(/\.pdf$/i.test(l)){var m=Editor.extractGraphModelFromPdf(k);null!=m&&0<m.length&&v(new LocalFile(this,+m,P,!0))}else/\.png$/i.test(l)?(m=this.extractGraphModelFromPng(k),null!=m?v(new LocalFile(this,m,P,!0)):v(new LocalFile(this,k,l,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,b)?this.parseFileData(k,mxUtils.bind(this,function(t){4==t.readyState&&(200<=t.status&&299>=t.status?v(new LocalFile(this,t.responseText,P,!0)):null!=A&&A({message:mxResources.get("errorLoadingFile")}))}),l):v(new LocalFile(this,k,P,!0))}catch(t){null!=A&&A(t)}});n=/\.png$/i.test(l)||/\.jpe?g$/i.test(l)||+/\.pdf$/i.test(l)||null!=n&&"image/"==n.substring(0,6);J?mxUtils.get(b,mxUtils.bind(this,function(k){if(200<=k.getStatus()&&299>=k.getStatus()){if(null!=v){k=JSON.parse(k.getText());var m=k.content;"base64"===k.encoding&&(m=/\.png$/i.test(l)?"data:image/png;base64,"+m:/\.pdf$/i.test(l)?"data:application/pdf;base64,"+m:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(m):atob(m));f(m)}}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})},D):null!=z?z(b,f,A,n):this.editor.loadUrl(b,f,A,n,null,null,null,D)}};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(z){this.appIconClicked(z)}));mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var z=this.getCurrentFile();null!=z&&(z=z.getMode(),z==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):z==App.MODE_DROPBOX?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):z==App.MODE_ONEDRIVE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):z==App.MODE_GITHUB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):z==App.MODE_GITLAB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/gitlab-logo-white.svg)",this.appIcon.style.backgroundSize="90%"):z==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(z){var D=this.getCurrentFile();null!=D&&D.isRenamable()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),this.actions.get("rename").funct());mxEvent.consume(z)}));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);var n=document.createElement("a");n.style.backgroundImage="url('"+Editor.fullscreenImage+"')";n.className="geButton";l.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(z){var D=this.fullscreenMode;"atlas"!=Editor.currentTheme&&"1"!=urlParams.embed&&this.setCompactMode(!D,null,Editor.transitionDelay);this.toggleShapesPanel(D);-this.toggleFormatPanel(D);this.fullscreenMode=!D;n.style.backgroundImage="url('"+(this.fullscreenMode?Editor.fullscreenExitImage:Editor.fullscreenImage)+"')";mxEvent.consume(z)}));mxEvent.preventDefault(n);var d=document.createElement("a");d.className="geButton";l.appendChild(d);mxEvent.addListener(d,"click",mxUtils.bind(this,function(z){this.actions.get("format").funct();mxEvent.consume(z)}));mxEvent.preventDefault(d);var x=mxUtils.bind(this,function(){d.style.backgroundImage=0<this.formatWidth?-"url('"+Editor.rightPanelCloseImage+"')":"url('"+Editor.rightPanelOpenImage+"')"});this.addListener("formatWidthChanged",x);x();var A=document.createElement("a");A.style.backgroundImage="url('"+(this.compactMode?Editor.chevronDownImage:Editor.chevronUpImage)+"')";A.className="geButton";"1"!=urlParams.embed&&"atlas"!=Editor.currentTheme&&(l.appendChild(A),mxEvent.addListener(A,"click",mxUtils.bind(this,function(z){this.setCompactMode(!this.compactMode,!0,Editor.transitionDelay);mxEvent.consume(z)})),+this.toggleFormatPanel(D);this.fullscreenMode=!D;n.style.backgroundImage="url('"+(this.fullscreenMode?Editor.fullscreenExitImage:Editor.fullscreenImage)+"')";mxEvent.consume(z)}));mxEvent.preventDefault(n);var d=document.createElement("a");d.className="geButton";l.appendChild(d);mxEvent.addListener(d,"click",mxUtils.bind(this,function(z){this.actions.get("format").funct();mxEvent.consume(z)}));mxEvent.preventDefault(d);var v=mxUtils.bind(this,function(){d.style.backgroundImage=0<this.formatWidth?+"url('"+Editor.rightPanelCloseImage+"')":"url('"+Editor.rightPanelOpenImage+"')"});this.addListener("formatWidthChanged",v);v();var A=document.createElement("a");A.style.backgroundImage="url('"+(this.compactMode?Editor.chevronDownImage:Editor.chevronUpImage)+"')";A.className="geButton";"1"!=urlParams.embed&&"atlas"!=Editor.currentTheme&&(l.appendChild(A),mxEvent.addListener(A,"click",mxUtils.bind(this,function(z){this.setCompactMode(!this.compactMode,!0,Editor.transitionDelay);mxEvent.consume(z)})),mxEvent.preventDefault(A),!mxClient.IS_FF&&740>=screen.height&&"undefined"!==typeof A.click&&window.setTimeout(mxUtils.bind(this,function(){A.click()}),0),this.addListener("compactModeChanged",mxUtils.bind(this,function(){A.style.backgroundImage="url('"+(this.compactMode?Editor.chevronDownImage:Editor.chevronUpImage)+"')"})));this.dependsOnLanguage(mxUtils.bind(this,function(){this.fname.setAttribute("title",mxResources.get("rename"));n.setAttribute("title",mxResources.get("fullscreen"));A.setAttribute("title",mxResources.get("collapseExpand"));d.setAttribute("title",mxResources.get("format")+" ("+Editor.ctrlKey+"+"+Editor.shiftKey+"+P)")}))}};App.prototype.setCompactMode=function(b,l,n){var d=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container;n=null!=n?n:0;window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.menubarContainer.style,"transition","all "+n+"s ease-in-out");mxUtils.setPrefixedStyle(this.toolbarContainer.style,"transition","all "+n+"s ease-in-out");b?d.classList.add("geCompactMode"):d.classList.remove("geCompactMode");window.setTimeout(mxUtils.bind(this,@@ -13917,24 +13917,24 @@ mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";bfunction(){this.spinner.stop();z()}),2E3)):z()});b=mxUtils.bind(this,function(z){var D=document.createElement("tr"),P=document.createElement("td");P.setAttribute("valig","middle");P.style.height="59px";P.style.width="66px";var J=document.createElement("img");J.setAttribute("width","50");J.setAttribute("height","50");J.setAttribute("border","0");J.setAttribute("src",null!=z.pictureUrl?z.pictureUrl:Editor.userImage);J.style.borderRadius="50%";J.style.margin="4px 8px 0 8px";P.appendChild(J);D.appendChild(P);P=document.createElement("td");P.setAttribute("valign","middle");P.style.whiteSpace="nowrap";P.style.paddingTop="4px";P.style.maxWidth="0";P.style.overflow="hidden";P.style.textOverflow="ellipsis";mxUtils.write(P,z.displayName+(z.isCurrent&&1<n.length?" ("+mxResources.get("default")+")":""));null!=z.email&&(mxUtils.br(P),J=document.createElement("small"),J.style.color="gray",mxUtils.write(J,z.email),P.appendChild(J));J=document.createElement("div");J.style.marginTop="4px";var L=document.createElement("i");mxUtils.write(L,mxResources.get("googleDrive"));J.appendChild(L);P.appendChild(J);D.appendChild(P);z.isCurrent?D.setAttribute("title","User ID: "+z.id):(D.setAttribute("title",mxResources.get("login")+" (User ID: "+z.id+")"),D.style.cursor="pointer",D.style.opacity="0.3",mxEvent.addListener(D,"mouseenter",mxUtils.bind(this,function(){D.style.opacity="1"})),mxEvent.addListener(D,"mouseleave",mxUtils.bind(this,function(){D.style.opacity="0.3"})),mxEvent.addListener(D,"click",mxUtils.bind(this,function(c){this.hideUserPanel();-d(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(f){this.handleError(f)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(c)})));return D});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<n.length;A++)x.appendChild(b(n[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(){d(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();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(D){this.handleError(D)}),!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,D,P,J){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 c=document.createElement("tbody"),f=document.createElement("tr"),k=document.createElement("td");k.setAttribute("valig","top");k.style.width="40px";if(null!=D){var m=document.createElement("img");m.setAttribute("width",+d(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(f){this.handleError(f)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(c)})));return D});l=!0;var v=document.createElement("table");v.style.borderSpacing="0";v.style.fontSize="10pt";v.style.width="100%";v.style.padding="10px";for(var A=0;A<n.length;A++)v.appendChild(b(n[A]));+this.userPanel.appendChild(v);b=document.createElement("div");b.style.textAlign="left";b.style.padding="10px";b.style.whiteSpace="nowrap";b.style.borderTopStyle="solid";b.style.borderTopWidth="1px";v=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"))}))}));+v.className="geBtn";v.style.float="right";b.appendChild(v);v=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var z=this.drive.createAuthWin();z.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(D){this.handleError(D)}),!0,z)}),mxResources.get("closingFile")+"...")}));v.className="geBtn";v.style.margin="0px";+b.appendChild(v);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(z,D,P,J){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 c=document.createElement("tbody"),f=document.createElement("tr"),k=document.createElement("td");k.setAttribute("valig","top");k.style.width="40px";if(null!=D){var m=document.createElement("img");m.setAttribute("width","40");m.setAttribute("height","40");m.setAttribute("border","0");m.setAttribute("src",D);m.style.marginRight="6px";k.appendChild(m)}f.appendChild(k);k=document.createElement("td");k.setAttribute("valign","middle");k.style.whiteSpace="nowrap";k.style.maxWidth="0";k.style.overflow="hidden";k.style.textOverflow="ellipsis";mxUtils.write(k,z.displayName);null!=z.email&&(mxUtils.br(k),D=document.createElement("small"),D.style.color="gray",mxUtils.write(D,z.email),k.appendChild(D));null!=J&&(z=document.createElement("div"),z.style.marginTop="4px",D=document.createElement("i"),mxUtils.write(D,J),z.appendChild(D),k.appendChild(z));f.appendChild(k);c.appendChild(f);L.appendChild(c);this.userPanel.appendChild(L);z=document.createElement("div");z.style.textAlign="center";z.style.padding="10px";z.style.whiteSpace="nowrap";null!=P&&(P=mxUtils.button(mxResources.get("signOut"),P),P.className="geBtn",z.appendChild(P));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 D=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()}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){var D=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()}else this.oneDrive.logout()}),mxResources.get("oneDrive"));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 D=mxUtils.bind(this,function(){this.gitHub.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()}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 D=mxUtils.bind(this,function(){this.gitLab.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()}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 D=mxUtils.bind(this,function(){this.trello.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),-null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()}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()&&+null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()}else this.trello.logout()}),mxResources.get("trello"));"min"==uiTheme&&(v=this.getCurrentFile(),null!=v&&v.isRealtimeEnabled()&&v.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=v.getRealtimeError(),1!=v.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.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.prototype.createHelpLink=function(n){return this.editorUi.createHelpIcon(n)};Menus.prototype.addLinkToItem=function(n,d){null!=n&&n.firstChild.nextSibling.appendChild(this.createHelpLink(d))};-Menus.prototype.removeCustomFont=function(n,d){for(var x=0;x<this.customFonts.length;x++)if(this.customFonts[x].name==n&&this.customFonts[x].url==d){this.customFonts.splice(x,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(n,d){for(var x=0;x<this.customFonts.length;x++)if(this.customFonts[x].name==n&&this.customFonts[x].url==d)return!0;for(x=0;x<this.defaultFonts.length;x++){var A=this.defaultFonts[x];+Menus.prototype.removeCustomFont=function(n,d){for(var v=0;v<this.customFonts.length;v++)if(this.customFonts[v].name==n&&this.customFonts[v].url==d){this.customFonts.splice(v,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(n,d){for(var v=0;v<this.customFonts.length;v++)if(this.customFonts[v].name==n&&this.customFonts[v].url==d)return!0;for(v=0;v<this.defaultFonts.length;v++){var A=this.defaultFonts[v];if("string"!==typeof A&&A.fontFamily==n&&A.fontUrl==d||"string"===typeof A&&A==n&&null==d)return!0}return!1};Menus.prototype.addCustomFont=function(n,d){null==n||this.containsFont(n,d)||(this.customFonts.push({name:n,url:d}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var l=Menus.prototype.init;Menus.prototype.init=function(){function n(q,u,I){d.editor.isExportToCanvas()?d.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(G,H,g,p,B,K,M,N,R,T,V,X,W){var Y=parseInt(G);!isNaN(Y)&&0<Y&&(d.exportImage(Y/100,H&&"png"==q,g,p,B&&"png"==q,M,!N,R,q,V,null,X,W),null!=I&&I(G,H,g,p,B,K,M,N,R,T,V,X,W))}),!0,u,q,!0):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||d.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(G,H,g,p,B){d.downloadFile(H&&"png"==q?"xmlpng":q,null,null,G,null,null,g,p,B)}),!1,!0)}l.apply(this,arguments);-var d=this.editorUi,x=d.editor.graph,A=mxUtils.bind(x,x.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(q){return"file"!=q}));d.actions.addAction("new...",function(){var q=d.isOffline(),u=new NewDialog(d,q,!(d.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));d.showDialog(u.container,q?350:620,q?70:460,!0,!0,function(I){null!=d.sidebar&&d.sidebar.hideTooltip();I&&null==d.getCurrentFile()&&d.showSplash()});u.init()});if(Editor.enableChatGpt&&+var d=this.editorUi,v=d.editor.graph,A=mxUtils.bind(v,v.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(q){return"file"!=q}));d.actions.addAction("new...",function(){var q=d.isOffline(),u=new NewDialog(d,q,!(d.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));d.showDialog(u.container,q?350:620,q?70:460,!0,!0,function(I){null!=d.sidebar&&d.sidebar.hideTooltip();I&&null==d.getCurrentFile()&&d.showSplash()});u.init()});if(Editor.enableChatGpt&&d.isExternalDataComms()&&"draw.io"==d.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled){var z=d.actions.put("generate",new Action("generate",function(){null!=d.chatWindow?d.chatWindow.window.setVisible(!d.chatWindow.window.isVisible()):d.openGenerateDialog("")}));z.isEnabled=function(){return A()};z.setToggleAction(!0);z.setSelectedCallback(function(){return null!=d.chatWindow&&d.chatWindow.window.isVisible()})}d.actions.put("insertTemplate",new Action("template...",function(){d.openTemplateDialog()})).isEnabled=A;z=d.actions.addAction("shareCursor",function(){d.setShareCursorPosition(!d.isShareCursorPosition())});z.setToggleAction(!0);z.setSelectedCallback(function(){return d.isShareCursorPosition()});z=d.actions.addAction("showRemoteCursors",function(){d.setShowRemoteCursors(!d.isShowRemoteCursors())});z.setToggleAction(!0);z.setSelectedCallback(function(){return d.isShowRemoteCursors()});z=d.actions.addAction("points",function(){d.editor.graph.view.setUnit(mxConstants.POINTS)});z.setToggleAction(!0);z.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.POINTS});z=d.actions.addAction("inches",function(){d.editor.graph.view.setUnit(mxConstants.INCHES)});z.setToggleAction(!0);z.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.INCHES});z=d.actions.addAction("millimeters",function(){d.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});z.setToggleAction(!0);z.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.MILLIMETERS});@@ -13942,30 +13942,30 @@ z=d.actions.addAction("meters",function(){d.editor.graph.view.setUnit(mxConstant!0)});z.setToggleAction(!0);z.setSelectedCallback(function(){return d.isTabContainerVisible()});z=d.actions.addAction("ruler",function(){d.setRulerVisible(!d.isRulerVisible())});z.setEnabled(Editor.canvasSupported&&9!=document.documentMode);z.setToggleAction(!0);z.setSelectedCallback(function(){return d.isRulerVisible()});z=d.actions.addAction("fullscreen",function(){if("1"==urlParams.embedInline)d.setInlineFullscreen(!Editor.inlineFullscreen);else{var q=mxUtils.isAncestorNode(document.body,d.container)?d.container:d.editor.graph.container;null!=q&&(null==document.fullscreenElement?(document.body.requestFullscreen(),q.classList.add("geFullscreen")):(document.exitFullscreen(),q.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=d.actions.put("lightMode",new Action("light",function(q){d.setAndPersistDarkMode(!1)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return!d.isAutoDarkMode(!0)&&!Editor.isDarkMode()});z=d.actions.put("darkMode",new Action("dark",function(q){d.setAndPersistDarkMode(!0)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return!d.isAutoDarkMode(!0)&&Editor.isDarkMode()});z=d.actions.put("autoMode",new Action("automatic",function(q){d.setAndPersistDarkMode("auto")}));z.setToggleAction(!0);z.setSelectedCallback(function(){return d.isAutoDarkMode(!0)});-d.actions.addAction("properties...",function(){d.getPublicUrl(d.getCurrentFile(),function(q){q=new FilePropertiesDialog(d,q);d.showDialog(q.container,340,200,!0,!0);q.init()})}).isEnabled=A;window.mxFreehand&&(z=d.actions.put("insertFreehand",new Action("freehand",function(){x.isEnabled()&&(null==d.freehandWindow&&(d.freehandWindow=new FreehandWindow(d,document.body.offsetWidth-420,102,180,126,!0)),x.freehand.isDrawing()?x.freehand.stopDrawing():x.freehand.startDrawing(),d.freehandWindow.window.setVisible(x.freehand.isDrawing()))},+d.actions.addAction("properties...",function(){d.getPublicUrl(d.getCurrentFile(),function(q){q=new FilePropertiesDialog(d,q);d.showDialog(q.container,340,200,!0,!0);q.init()})}).isEnabled=A;window.mxFreehand&&(z=d.actions.put("insertFreehand",new Action("freehand",function(){v.isEnabled()&&(null==d.freehandWindow&&(d.freehandWindow=new FreehandWindow(d,document.body.offsetWidth-420,102,180,126,!0)),v.freehand.isDrawing()?v.freehand.stopDrawing():v.freehand.startDrawing(),d.freehandWindow.window.setVisible(v.freehand.isDrawing()))},null,null,"X")),z.isEnabled=function(){return A()},z.setToggleAction(!0),z.setSelectedCallback(function(){return null!=d.freehandWindow&&d.freehandWindow.window.isVisible()}));d.actions.put("exportXml",new Action("formatXml...",function(){var q=document.createElement("div");q.style.whiteSpace="nowrap";var u=null==d.pages||1>=d.pages.length,I=document.createElement("h3");mxUtils.write(I,mxResources.get("formatXml"));I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";q.appendChild(I);-var G=d.addCheckbox(q,mxResources.get("selectionOnly"),!1,x.isSelectionEmpty()),H=d.addCheckbox(q,mxResources.get("compressed"),Editor.defaultCompressed),g=d.addCheckbox(q,mxResources.get("allPages"),!u,u);g.style.marginBottom="16px";mxEvent.addListener(G,"change",function(){G.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});q=new CustomDialog(d,q,mxUtils.bind(this,function(){d.downloadFile("xml",!H.checked,null,!G.checked,u||!g.checked)}),null,mxResources.get("export"));+var G=d.addCheckbox(q,mxResources.get("selectionOnly"),!1,v.isSelectionEmpty()),H=d.addCheckbox(q,mxResources.get("compressed"),Editor.defaultCompressed),g=d.addCheckbox(q,mxResources.get("allPages"),!u,u);g.style.marginBottom="16px";mxEvent.addListener(G,"change",function(){G.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});q=new CustomDialog(d,q,mxUtils.bind(this,function(){d.downloadFile("xml",!H.checked,null,!G.checked,u||!g.checked)}),null,mxResources.get("export"));d.showDialog(q.container,300,200,!0,!0)}));Editor.enableExportUrl&&d.actions.put("exportUrl",new Action("url...",function(){d.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(q,u,I,G,H,g,p,B,K,M,N,R,T){p=[];G&&K&&p.push("tags=%7B%7D");q=new EmbedDialog(d,d.createLink(q,u,T,G,H,g,null,!0,p,null,I,null,R));d.showDialog(q.container,450,270,!0,!0);q.init()},null,!0,!0)}));d.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){d.getPublicUrl(d.getCurrentFile(),function(q){d.showHtmlDialog(mxResources.get("export"),null,q,function(u,I,G,H,g,p,B,K,M,N,R,T){d.createHtml(u,I,G,H,g,p,B,K,M,N,R,mxUtils.bind(this,function(V,X){var W=d.getBaseFilename(B);V='\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(W)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+V+"\n"+X+"\n</body>\n</html>";d.saveData(W+(".drawio"==W.substring(W.lenth-7)?"":".drawio")+".html","html",V,"text/html")}),T)})})}));d.actions.put("exportPdf",new Action("formatPdf...",function(){d.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!d.isOffline()&&!d.printPdfExport?mxUtils.bind(this,function(q,u){q=null!=d.pages?d.pages.length:1;var I=null==d.pages||1>=d.pages.length,G=d.getPageIndex(d.currentPage);G=null!=G?G+1:1;d.downloadFile("pdf",null,null,!u.selection,I||!u.allPages&&u.pagesFrom==G&&u.pagesTo==G,!u.crop,u.transparent,u.scale,null,u.grid,u.includeCopy,u.allPages||u.pagesFrom==G&&u.pagesTo==G?null:{from:Math.max(0,Math.min(q-1,u.pagesFrom-1)),to:Math.max(0,Math.min(q-1,u.pagesTo-1))},u.border,u.fit,u.sheetsAcross,u.sheetsDown,u.shadows)}):null,mxResources.get("export"))}));d.actions.addAction("open...",function(){d.pickFile()});d.actions.addAction("close",function(){function q(){null!=u&&u.removeDraft();d.fileLoaded(new LocalFile(d,d.emptyDiagramXml))}var u=d.getCurrentFile();null!=u&&u.isModified()?d.confirm(mxResources.get("allChangesLost"),null,q,mxResources.get("cancel"),-mxResources.get("discardChanges")):q()});d.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==x.getSelectionCount()){var q=x.getSelectionCell(),u=x.view.getState(q);null!=u&&null!=u.shape&&null!=u.shape.stencil&&(q=new EditShapeDialog(d,q,mxResources.get("editShape")),d.showDialog(q.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),q.init())}}));d.actions.addAction("revisionHistory...",function(){d.isRevisionHistorySupported()?d.spinner.spin(document.body,mxResources.get("loading"))&&+mxResources.get("discardChanges")):q()});d.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==v.getSelectionCount()){var q=v.getSelectionCell(),u=v.view.getState(q);null!=u&&null!=u.shape&&null!=u.shape.stencil&&(q=new EditShapeDialog(d,q,mxResources.get("editShape")),d.showDialog(q.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),q.init())}}));d.actions.addAction("revisionHistory...",function(){d.isRevisionHistorySupported()?d.spinner.spin(document.body,mxResources.get("loading"))&&d.getRevisions(mxUtils.bind(this,function(q,u){d.spinner.stop();q=new RevisionDialog(d,q,u);d.showDialog(q.container,640,480,!0,!0);q.init()}),mxUtils.bind(this,function(q){d.handleError(null!=q?q:mxResources.get("notAvailable"))})):d.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});d.actions.addAction("createRevision",function(){d.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");z=d.actions.addAction("synchronize",function(){d.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");"none"==DrawioFile.SYNC&&(z.label=mxResources.get("refresh"));d.actions.addAction("upload...",function(){var q=d.getCurrentFile();null!=q&&(window.drawdata=d.getFileData(),q=null!=q.getTitle()?q.getTitle():d.defaultFilename,d.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(d.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(q),null,!0))},null,null,null,navigator.onLine&&"1"!=-urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(z=d.actions.addAction("mathematicalTypesetting",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.mathEnabled=!d.isMathEnabled();x.model.execute(q)}),z.setToggleAction(!0),z.setSelectedCallback(function(){return d.isMathEnabled()}),z.isEnabled=A);z=d.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.adaptiveColors=-"default";x.model.execute(q)}));z.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+")"};z.setToggleAction(!0);z.setSelectedCallback(function(){return null==x.adaptiveColors});z=d.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.adaptiveColors="auto";x.model.execute(q)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"auto"==x.adaptiveColors});-z=d.actions.put("simpleAdaptiveColors",new Action("simple",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.adaptiveColors="simple";x.model.execute(q)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"simple"==x.adaptiveColors});z=d.actions.put("noAdaptiveColors",new Action("none",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.adaptiveColors="none";x.model.execute(q)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"none"==-x.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(q,u){this.addMenuItems(q,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],u)})));isLocalStorage&&(z=d.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());urlParams.splash=mxSettings.getShowStartScreen()?"1":"0";mxSettings.save()}),z.setToggleAction(!0),z.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));-var D=d.actions.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});D.setToggleAction(!0);D.setSelectedCallback(function(){return D.isEnabled()&&d.editor.autosave});d.actions.addAction("editGeometry...",function(){for(var q=x.getSelectionCells(),u=[],I=0;I<q.length;I++)x.getModel().isVertex(q[I])&&u.push(q[I]);0<u.length&&(q=new EditGeometryDialog(d,u),d.showDialog(q.container,200,270,!0,!0),q.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");d.actions.addAction("copyStyle",-function(){if(x.isEnabled()&&1==x.getSelectionCount()){var q=x.getSelectionCell(),u=x.getCellStyle(q,!1);d.copiedStyle={};var I=[],G=[],H;for(H in u)I.push(u[H]),G.push(H);x.copyCellStyles([q],G,I,d.copiedStyle,d.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");d.actions.addAction("pasteStyle",function(){x.isEnabled()&&!x.isSelectionEmpty()&&null!=d.copiedStyle&&x.pasteCellStyles(x.includeDescendants(x.getSelectionCells()),d.copiedStyle,d.copiedStyle,!0)},null,null,Editor.altKey+"+V");+urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(z=d.actions.addAction("mathematicalTypesetting",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.mathEnabled=!d.isMathEnabled();v.model.execute(q)}),z.setToggleAction(!0),z.setSelectedCallback(function(){return d.isMathEnabled()}),z.isEnabled=A);z=d.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.adaptiveColors=+"default";v.model.execute(q)}));z.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+")"};z.setToggleAction(!0);z.setSelectedCallback(function(){return null==v.adaptiveColors});z=d.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.adaptiveColors="auto";v.model.execute(q)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"auto"==v.adaptiveColors});+z=d.actions.put("simpleAdaptiveColors",new Action("simple",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.adaptiveColors="simple";v.model.execute(q)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"simple"==v.adaptiveColors});z=d.actions.put("noAdaptiveColors",new Action("none",function(){var q=new ChangePageSetup(d);q.ignoreColor=!0;q.ignoreImage=!0;q.adaptiveColors="none";v.model.execute(q)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"none"==+v.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(q,u){this.addMenuItems(q,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],u)})));isLocalStorage&&(z=d.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());urlParams.splash=mxSettings.getShowStartScreen()?"1":"0";mxSettings.save()}),z.setToggleAction(!0),z.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));+var D=d.actions.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});D.setToggleAction(!0);D.setSelectedCallback(function(){return D.isEnabled()&&d.editor.autosave});d.actions.addAction("editGeometry...",function(){for(var q=v.getSelectionCells(),u=[],I=0;I<q.length;I++)v.getModel().isVertex(q[I])&&u.push(q[I]);0<u.length&&(q=new EditGeometryDialog(d,u),d.showDialog(q.container,200,270,!0,!0),q.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");d.actions.addAction("copyStyle",+function(){if(v.isEnabled()&&1==v.getSelectionCount()){var q=v.getSelectionCell(),u=v.getCellStyle(q,!1);d.copiedStyle={};var I=[],G=[],H;for(H in u)I.push(u[H]),G.push(H);v.copyCellStyles([q],G,I,d.copiedStyle,d.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");d.actions.addAction("pasteStyle",function(){v.isEnabled()&&!v.isSelectionEmpty()&&null!=d.copiedStyle&&v.pasteCellStyles(v.includeDescendants(v.getSelectionCells()),d.copiedStyle,d.copiedStyle,!0)},null,null,Editor.altKey+"+V");d.actions.put("exportSvg",new Action("formatSvg...",function(){d.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(q,u,I,G,H,g,p,B,K,M,N,R,T,V){q=parseInt(q);d.lastExportSvgEditable=H;!isNaN(q)&&0<q&&d.exportSvg(q/100,u,I,G,H,g,p,!B,K,M,R,T,V)}),!0,d.lastExportSvgEditable,"svg",!0)}));d.actions.put("exportPng",new Action("formatPng...",function(){n("png",d.lastExportPngEditable,function(q,u,I,G,H){d.lastExportPngEditable=-H})}));d.actions.put("exportJpg",new Action("formatJpg...",function(){n("jpeg")}));d.actions.put("exportWebp",new Action("formatWebp...",function(){n("webp")}));z=d.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var q=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells())),u=mxUtils.getXml(0==q.length?d.editor.getGraphXml():x.encodeCells(q));d.copyImage(q,u)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");z.visible=Editor.enableNativeClipboard&&d.editor.isExportToCanvas();-z=d.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var q=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells())),u=mxUtils.getXml(0==q.length?d.editor.getGraphXml():x.encodeCells(q));d.copySvg(q,u)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");z.visible=Editor.enableNativeClipboard&&d.editor.isExportToCanvas();z=d.actions.put("shadowVisible",new Action("shadow",function(){x.setShadowVisible(!x.shadowVisible)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return x.shadowVisible});+H})}));d.actions.put("exportJpg",new Action("formatJpg...",function(){n("jpeg")}));d.actions.put("exportWebp",new Action("formatWebp...",function(){n("webp")}));z=d.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var q=mxUtils.sortCells(v.model.getTopmostCells(v.getSelectionCells())),u=mxUtils.getXml(0==q.length?d.editor.getGraphXml():v.encodeCells(q));d.copyImage(q,u)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");z.visible=Editor.enableNativeClipboard&&d.editor.isExportToCanvas();+z=d.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var q=mxUtils.sortCells(v.model.getTopmostCells(v.getSelectionCells())),u=mxUtils.getXml(0==q.length?d.editor.getGraphXml():v.encodeCells(q));d.copySvg(q,u)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");z.visible=Editor.enableNativeClipboard&&d.editor.isExportToCanvas();z=d.actions.put("shadowVisible",new Action("shadow",function(){v.setShadowVisible(!v.shadowVisible)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return v.shadowVisible});d.actions.put("about",new Action("v"+EditorUi.VERSION,function(q,u){d.isOwnGDriveDomain()&&mxEvent.isShiftDown(u)&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));d.actions.addAction("support...",function(){EditorUi.isElectronApp?d.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):d.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});d.actions.addAction("downloadDesktop...",function(){d.openLink("https://get.diagrams.net/")});d.actions.addAction("exportOptionsDisabled...",function(){d.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});d.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||navigator.standalone?d.openLink("https://app.diagrams.net/shortcuts.svg"):d.openLink("shortcuts.svg")});d.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?d.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):d.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});z=d.actions.addAction("tags",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(d,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){d.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("tags"))):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()}));null==Editor.gptApiKey||null==Editor.gptModels||null==Editor.gptUrl||d.isOffline()||EditorUi.isElectronApp||(z=d.actions.addAction("generate",mxUtils.bind(this,function(){null==d.chatWindow?d.openGenerateDialog():d.chatWindow.window.setVisible(!d.chatWindow.window.isVisible())})),-z.setToggleAction(!0),z.setSelectedCallback(mxUtils.bind(this,function(){return null!=d.chatWindow&&d.chatWindow.window.isVisible()})));z=d.actions.addAction("findReplace",mxUtils.bind(this,function(q,u){d.showSearchWindow(x.isEnabled()&&(null==u||!mxEvent.isShiftDown(u)))}),null,null,Editor.ctrlKey+"+F");z=new Action("exportVsdx",function(){var q=null==d.pages||1>=d.pages.length;if(q)d.exportVisio();else{var u=document.createElement("div");u.style.whiteSpace="nowrap";var I=document.createElement("h3");+z.setToggleAction(!0),z.setSelectedCallback(mxUtils.bind(this,function(){return null!=d.chatWindow&&d.chatWindow.window.isVisible()})));z=d.actions.addAction("findReplace",mxUtils.bind(this,function(q,u){d.showSearchWindow(v.isEnabled()&&(null==u||!mxEvent.isShiftDown(u)))}),null,null,Editor.ctrlKey+"+F");z=new Action("exportVsdx",function(){var q=null==d.pages||1>=d.pages.length;if(q)d.exportVisio();else{var u=document.createElement("div");u.style.whiteSpace="nowrap";var I=document.createElement("h3");mxUtils.write(I,mxResources.get("formatVsdx"));I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";u.appendChild(I);var G=d.addCheckbox(u,mxResources.get("allPages"),!q,q);G.style.marginBottom="16px";q=new CustomDialog(d,u,mxUtils.bind(this,function(){d.exportVisio(!G.checked)}),null,mxResources.get("export"));d.showDialog(q.container,300,130,!0,!0)}});z.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};d.actions.put("exportVsdx",z);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&d.actions.addAction("configuration...",function(){var q=document.createElement("input");q.setAttribute("type","checkbox");q.style.marginRight="8px";q.checked=mxSettings.getShowStartScreen();q.defaultChecked=q.checked;if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||"min"==Editor.currentTheme)){var u=document.createElement("span");u.style.display="flex";u.style.alignItems="center";u.style.cssFloat="right";u.style.cursor="pointer";u.style.userSelect="none";u.style.marginTop="-3px";u.appendChild(q);mxUtils.write(u,mxResources.get("showStartScreen"));mxEvent.addListener(u,"click",function(G){mxEvent.getSource(G)!=q&&(q.checked=!q.checked)});header=u}u=[[mxResources.get("reset"),function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),d.hideDialog(),d.alert(mxResources.get("restartForChangeRequired"))}catch(G){d.handleError(G)}})}]];if(!d.isOfflineApp()&&isLocalStorage&&@@ -13978,16 +13978,16 @@ q.addItem(mxResources.get("orgChart"),null,function(){var I=null,G=20,H=20,g=funmxResources.get("orgChartType")+": ");p.appendChild(B);var K=document.createElement("select");K.style.width="160px";K.style.boxSizing="border-box";B=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var M=0;M<B.length;M++){var N=document.createElement("option");mxUtils.write(N,B[M]);N.value=M;2==M&&N.setAttribute("selected","selected");K.appendChild(N)}mxEvent.addListener(K,"change",function(){I=K.value});p.appendChild(K);B=document.createElement("div");B.style.marginTop="6px";B.style.display="inline-block";B.style.width="180px";mxUtils.write(B,mxResources.get("parentChildSpacing")+": ");p.appendChild(B);var R=document.createElement("input");R.type="number";R.value=G;R.style.width="160px";R.style.boxSizing="border-box";p.appendChild(R);mxEvent.addListener(R,"change",function(){G=R.value});B=document.createElement("div");B.style.marginTop="6px";B.style.display="inline-block";B.style.width="180px";mxUtils.write(B,mxResources.get("siblingSpacing")+": ");p.appendChild(B);var T=document.createElement("input");T.type="number";T.value=H;T.style.width="160px";T.style.boxSizing="border-box";p.appendChild(T);mxEvent.addListener(T,"change",function(){H=T.value});B=mxUtils.button(mxResources.get("custom")+"...",function(){var V=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(K.value),parentChildSpacing:parseInt(R.value),-siblingSpacing:parseInt(T.value)}}];d.hideDialog();d.showCustomLayoutDialog(JSON.stringify(V,null,2))});B.className="geBtn";p=new CustomDialog(d,p,function(){null==I&&(I=2);d.loadOrgChartLayouts(g)},null,null,null,B);d.showDialog(p.container,355,140,!0,!0)},u,null,A());q.addSeparator(u);q.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){d.tryAndHandle(mxUtils.bind(this,function(){var I=new mxParallelEdgeLayout(x);I.checkOverlap=!0;d.prompt(mxResources.get("spacing"),I.spacing,-mxUtils.bind(this,function(G){d.tryAndHandle(mxUtils.bind(this,function(){I.spacing=G;d.executeLayout(function(){I.execute(x.getDefaultParent(),x.isSelectionEmpty()?null:x.getSelectionCells())},!1)}))}))}))}),u);q.addSeparator(u);d.menus.addMenuItem(q,"runLayout",u,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(q,u){if(mxClient.IS_CHROMEAPP||!d.isOffline()&&!navigator.standalone){var I=q.addItem(mxResources.get("search")+":",null,null,u,null,null,!1);+siblingSpacing:parseInt(T.value)}}];d.hideDialog();d.showCustomLayoutDialog(JSON.stringify(V,null,2))});B.className="geBtn";p=new CustomDialog(d,p,function(){null==I&&(I=2);d.loadOrgChartLayouts(g)},null,null,null,B);d.showDialog(p.container,355,140,!0,!0)},u,null,A());q.addSeparator(u);q.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){d.tryAndHandle(mxUtils.bind(this,function(){var I=new mxParallelEdgeLayout(v);I.checkOverlap=!0;d.prompt(mxResources.get("spacing"),I.spacing,+mxUtils.bind(this,function(G){d.tryAndHandle(mxUtils.bind(this,function(){I.spacing=G;d.executeLayout(function(){I.execute(v.getDefaultParent(),v.isSelectionEmpty()?null:v.getSelectionCells())},!1)}))}))}))}),u);q.addSeparator(u);d.menus.addMenuItem(q,"runLayout",u,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(q,u){if(mxClient.IS_CHROMEAPP||!d.isOffline()&&!navigator.standalone){var I=q.addItem(mxResources.get("search")+":",null,null,u,null,null,!1);I.style.cursor="default";var G=document.createElement("input");G.setAttribute("type","text");G.setAttribute("size","25");G.style.borderWidth="1px";G.style.marginLeft="8px";mxEvent.addListener(G,"keydown",mxUtils.bind(this,function(H){var g=mxUtils.trim(G.value);13==H.keyCode&&0<g.length?(this.editorUi.searchHelp(g),G.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==H.keyCode&&(G.value="")}));I.firstChild.nextSibling.appendChild(G);mxEvent.addGestureListeners(G,function(H){document.activeElement!=G&&G.focus();mxEvent.consume(H)},function(H){mxEvent.consume(H)},function(H){mxEvent.consume(H)});window.setTimeout(function(){G.focus()},0);EditorUi.isElectronApp?(d.actions.addAction("website...",function(){d.openLink("https://www.drawio.com")}),d.actions.addAction("check4Updates",function(){d.checkForUpdates()}),d.actions.put("desktopZoomIn",new Action("zoomIn",function(){d.desktopZoomIn()})),d.actions.put("desktopZoomOut",new Action("zoomOut",function(){d.desktopZoomOut()})),d.actions.put("desktopResetZoom",new Action("actualSize",function(){d.desktopResetZoom()})),this.addMenuItems(q,"- keyboardShortcuts quickStart website support -".split(" "),u),"1"!=urlParams.disableUpdate&&this.addMenuItems(q,["check4Updates","-"],u),this.addMenuItems(q,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),u)):this.addMenuItems(q,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),u)}else this.addMenuItems(q,["keyboardShortcuts",-"-","about"],u);"1"==urlParams.test&&(q.addSeparator(u),this.addSubmenu("testDevelop",q,u))})));d.actions.addAction("languageCode...",function(){var q=new FilenameDialog(d,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(u){null!=u&&(Graph.diagramLanguage=0<u.length?u:null,Graph.translateDiagram=!0,x.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");d.showDialog(q.container,340,80,!0,!0);q.init()});this.put("diagramLanguage",-new Menu(mxUtils.bind(this,function(q,u){this.addMenuItems(q,["languageCode","-"],u);u=q.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;x.refresh()},u);Graph.translateDiagram||q.addCheckmark(u,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");d.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!x.isSelectionEmpty()){var q=x.cloneCells(x.getSelectionCells()),-u=x.getBoundingBoxFromGeometry(q,!0);q=x.moveCells(q,-u.x,-u.y);d.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+u.width+", "+u.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(x.encodeCells(q)))+"'),")}}));d.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function q(p){return null==p||null==p.boundingBox||!isNaN(p.boundingBox.x)&&!isNaN(p.boundingBox.y)&&!isNaN(p.boundingBox.width)&&!isNaN(p.boundingBox.height)}var u=x.isSelectionEmpty()?x.getGraphBounds():-x.getBoundingBox(x.getSelectionCells()),I=x.view.translate,G=x.view.scale;x.insertVertex(x.getDefaultParent(),null,"",u.x/G-I.x,u.y/G-I.y,u.width/G,u.height/G,"fillColor=none;strokeColor=red;");var H=0,g=0;x.view.states.visit(function(p,B){p=!0;q(B.shape)||(console.log("invalid shape",B.cell.id,B.shape),p=!1);q(B.text)||(console.log("invalid text",B.cell.id,B.text),p=!1);p||H++;g++});console.log("states checked",g,"invalid",H)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var q=+"-","about"],u);"1"==urlParams.test&&(q.addSeparator(u),this.addSubmenu("testDevelop",q,u))})));d.actions.addAction("languageCode...",function(){var q=new FilenameDialog(d,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(u){null!=u&&(Graph.diagramLanguage=0<u.length?u:null,Graph.translateDiagram=!0,v.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");d.showDialog(q.container,340,80,!0,!0);q.init()});this.put("diagramLanguage",+new Menu(mxUtils.bind(this,function(q,u){this.addMenuItems(q,["languageCode","-"],u);u=q.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;v.refresh()},u);Graph.translateDiagram||q.addCheckmark(u,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");d.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!v.isSelectionEmpty()){var q=v.cloneCells(v.getSelectionCells()),+u=v.getBoundingBoxFromGeometry(q,!0);q=v.moveCells(q,-u.x,-u.y);d.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+u.width+", "+u.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(v.encodeCells(q)))+"'),")}}));d.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function q(p){return null==p||null==p.boundingBox||!isNaN(p.boundingBox.x)&&!isNaN(p.boundingBox.y)&&!isNaN(p.boundingBox.width)&&!isNaN(p.boundingBox.height)}var u=v.isSelectionEmpty()?v.getGraphBounds():+v.getBoundingBox(v.getSelectionCells()),I=v.view.translate,G=v.view.scale;v.insertVertex(v.getDefaultParent(),null,"",u.x/G-I.x,u.y/G-I.y,u.width/G,u.height/G,"fillColor=none;strokeColor=red;");var H=0,g=0;v.view.states.visit(function(p,B){p=!0;q(B.shape)||(console.log("invalid shape",B.cell.id,B.shape),p=!1);q(B.text)||(console.log("invalid text",B.cell.id,B.text),p=!1);p||H++;g++});console.log("states checked",g,"invalid",H)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var q=null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";q=new TextareaDialog(d,"Paste Data:",q,function(u){if(0<u.length)try{var I=function(B){function K(aa){if(null==Z[aa]){if(Z[aa]=!0,null!=R[aa]){for(;0<R[aa].length;){var la=R[aa].pop();K(la)}delete R[aa]}}else mxLog.debug(M+": Visited: "+aa)}var M=B.parentNode.id,N=B.childNodes;B={};for(var R={},T=null,V={},X=0;X<N.length;X++){var W=N[X];if(null!=W.id&&0<W.id.length)if(null==B[W.id]){B[W.id]=W.id;var Y=W.getAttribute("parent");null==Y?null!=T?mxLog.debug(M+": Multiple roots: "+W.id):T=W.id:(null==R[Y]&&(R[Y]=[]),R[Y].push(W.id))}else V[W.id]=W.id}N=Object.keys(V);0<N.length?(N=M+": "+N.length+" Duplicates: "+N.join(", "),mxLog.debug(N+" (see console)")):mxLog.debug(M+": Checked");var Z={};null==T?mxLog.debug(M+": No root"):(K(T),Object.keys(Z).length!=Object.keys(B).length&&(mxLog.debug(M+": Invalid tree: (see console)"),console.log(M+": Invalid tree",R)))};"<"!=u.charAt(0)&&(u=Graph.decompress(u),mxLog.debug("See console for uncompressed XML"),console.log("xml",u));var G=mxUtils.parseXml(u),H=d.getPagesForNode(G.documentElement,"mxGraphModel");if(null!=H&&0<H.length)try{var g=d.getHashValueForPages(H);mxLog.debug("Checksum: ",g)}catch(B){mxLog.debug("Error: ",B.message)}else mxLog.debug("No pages found for checksum");var p=G.getElementsByTagName("root");for(u=0;u<p.length;u++)I(p[u]);mxLog.show()}catch(B){d.handleError(B),null!=window.console&&console.error(B)}});d.showDialog(q.container,@@ -13997,16 +13997,16 @@ d.getCurrentFile();null!=d.pages&&null!=q?d.spinner.spin(document.body,mxResourc"no not match"))},function(u){console.log("Error getLatestVersion",u);d.handleError(u)}):console.log("Checksum: no file or pages")}));d.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var q=d.getCurrentFile();console.log("editorUi",d,"file",q);if(null!=q&&q.isRealtime()){console.log("Checksum ownPages",d.getHashValueForPages(q.ownPages));console.log("Checksum theirPages",d.getHashValueForPages(q.theirPages));console.log("diff ownPages/theirPages",d.diffPages(q.ownPages,q.theirPages));var u=q.getShadowPages();null!=u&&(console.log("Checksum shadowPages",d.getHashValueForPages(u)),console.log("diff shadowPages/ownPages",d.diffPages(u,q.ownPages)),console.log("diff ownPages/shadowPages",d.diffPages(q.ownPages,u)),console.log("diff theirPages/shadowPages",d.diffPages(q.theirPages,u)));null!=q.sync&&null!=q.sync.snapshot&&(console.log("Checksum snapshot",d.getHashValueForPages(q.sync.snapshot)),console.log("diff ownPages/snapshot",d.diffPages(q.ownPages,q.sync.snapshot)),console.log("diff theirPages/snapshot",d.diffPages(q.theirPages,q.sync.snapshot)),null!=d.pages&&console.log("diff snapshot/actualPages",d.diffPages(q.sync.snapshot,d.pages)));null!=d.pages&&(console.log("diff ownPages/actualPages",d.diffPages(q.ownPages,d.pages)),console.log("diff theirPages/actualPages",d.diffPages(q.theirPages,d.pages)))}null!=q&&console.log("Shadow pages",[d.getXmlForPages(q.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 q=d.getCurrentFile();null!=q&&q.isRealtime()&&null!=q.shadowPages&&(console.log("patching actualPages to shadowPages",q.patch([d.diffPages(q.shadowPages,d.pages)])),q.ownPages=d.clonePages(d.pages),q.theirPages=d.clonePages(d.pages),q.shadowPages=d.clonePages(d.pages),null!=q.sync&&(q.sync.snapshot=d.clonePages(d.pages)))}));d.actions.addAction("testOptimize",mxUtils.bind(this,function(){x.model.beginUpdate();try{var q=x.model.cells,u=0,I=-[],G=[],H;for(H in q){var g=q[H],p=x.getCurrentCellStyle(g)[mxConstants.STYLE_IMAGE];null!=p&&"data:"==p.substring(0,5)&&(null==I[p]&&(I[p]=(I[p]||0)+1,u++),G.push(g))}x.setCellStyles(mxConstants.STYLE_IMAGE,null,G);console.log("Removed",u,"image(s) from",G.length,"cell(s): ",[G,I])}finally{x.model.endUpdate()}}));d.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(d,x.getModel())}));d.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var q=new mxImageExport,-u=x.getGraphBounds(),I=x.view.scale,G=mxUtils.createXmlDocument(),H=G.createElement("output");G.appendChild(H);G=new mxXmlCanvas2D(H);G.translate(Math.floor((1-u.x)/I),Math.floor((1-u.y)/I));G.scale(1/I);var g=0,p=G.save;G.save=function(){g++;p.apply(this,arguments)};var B=G.restore;G.restore=function(){g--;B.apply(this,arguments)};var K=q.drawShape;q.drawShape=function(M){mxLog.debug("entering shape",M,g);K.apply(this,arguments);mxLog.debug("leaving shape",M,g)};q.drawState(x.getView().getState(x.model.root),-G);mxLog.show();mxLog.debug(mxUtils.getXml(H));mxLog.debug("stateCounter",g)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var c=null,f=null,k=null,m=null,t=null,v=null,y=null,F=null;d.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=c?(x.view.revalidate=c,c=null):(c=x.view.revalidate,x.view.revalidate=function(){var q=Date.now(),u=c.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",+mxUtils.bind(this,function(){console.log("editorUi",d);var q=d.getCurrentFile();null!=q&&q.isRealtime()&&null!=q.shadowPages&&(console.log("patching actualPages to shadowPages",q.patch([d.diffPages(q.shadowPages,d.pages)])),q.ownPages=d.clonePages(d.pages),q.theirPages=d.clonePages(d.pages),q.shadowPages=d.clonePages(d.pages),null!=q.sync&&(q.sync.snapshot=d.clonePages(d.pages)))}));d.actions.addAction("testOptimize",mxUtils.bind(this,function(){v.model.beginUpdate();try{var q=v.model.cells,u=0,I=+[],G=[],H;for(H in q){var g=q[H],p=v.getCurrentCellStyle(g)[mxConstants.STYLE_IMAGE];null!=p&&"data:"==p.substring(0,5)&&(null==I[p]&&(I[p]=(I[p]||0)+1,u++),G.push(g))}v.setCellStyles(mxConstants.STYLE_IMAGE,null,G);console.log("Removed",u,"image(s) from",G.length,"cell(s): ",[G,I])}finally{v.model.endUpdate()}}));d.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(d,v.getModel())}));d.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var q=new mxImageExport,+u=v.getGraphBounds(),I=v.view.scale,G=mxUtils.createXmlDocument(),H=G.createElement("output");G.appendChild(H);G=new mxXmlCanvas2D(H);G.translate(Math.floor((1-u.x)/I),Math.floor((1-u.y)/I));G.scale(1/I);var g=0,p=G.save;G.save=function(){g++;p.apply(this,arguments)};var B=G.restore;G.restore=function(){g--;B.apply(this,arguments)};var K=q.drawShape;q.drawShape=function(M){mxLog.debug("entering shape",M,g);K.apply(this,arguments);mxLog.debug("leaving shape",M,g)};q.drawState(v.getView().getState(v.model.root),+G);mxLog.show();mxLog.debug(mxUtils.getXml(H));mxLog.debug("stateCounter",g)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var c=null,f=null,k=null,m=null,t=null,x=null,y=null,F=null;d.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=c?(v.view.revalidate=c,c=null):(c=v.view.revalidate,v.view.revalidate=function(){var q=Date.now(),u=c.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-q+" ms","args",arguments);return u});null!=f?(d.selectPage=f,f=null):(f=d.selectPage,d.selectPage=function(){var q=Date.now(),u=f.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-q+" ms","args",arguments);return u});null!=k?(d.diffPages=k,k=null):(k=d.diffPages,d.diffPages=function(){var q=Date.now(),u=k.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-q+" ms","args",arguments);return u});null!=m?(d.patchPages=m,m=null):(m=d.patchPages,d.patchPages=function(){var q=Date.now(),u=m.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-q+" ms","args",arguments);return u});null!=t?(d.clonePages=t,t=null):(t=d.clonePages,d.clonePages=function(){var q=Date.now(),u=t.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-q+" ms","args",arguments);return u});null!=y?(d.getHashValueForPages=y,y=null):(y=d.getHashValueForPages,d.getHashValueForPages=function(){var q=Date.now(),u=y.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-q+" ms","args",arguments);return u});null!=F?(d.resolveCrossReferences=F,F=null):(F=d.resolveCrossReferences,d.resolveCrossReferences=function(){var q=Date.now(),u=F.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-q+" ms","args",arguments);return u});-null!=v?(d.getFileData=v,v=null):(v=d.getFileData,d.getFileData=function(){var q=Date.now(),u=v.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-q+" ms","args",arguments);return u});EditorUi.debug("[Performance]",null!=c?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(q,u){this.addMenuItems(q,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),+null!=x?(d.getFileData=x,x=null):(x=d.getFileData,d.getFileData=function(){var q=Date.now(),u=x.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-q+" ms","args",arguments);return u});EditorUi.debug("[Performance]",null!=c?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(q,u){this.addMenuItems(q,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),u);var I=q.addItem(mxResources.get("testPerformance"),null,function(){d.actions.get("testPerformance").funct()},u);null!=c&&q.addCheckmark(I,Editor.checkmarkImage);this.addMenuItems(q,["-","testShowConsole"],u)})))}d.actions.put("shapes",new Action("moreShapes...",function(q){mxClient.IS_CHROMEAPP||!d.isOffline()?d.showDialog((new MoreShapesDialog(d,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!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(q){x.isEnabled()&&(q=new mxCell("",new mxGeometry(0,0,120,120),d.defaultCustomShapeStyle),q.vertex=!0,q=new EditShapeDialog(d,q,mxResources.get("editShape")),d.showDialog(q.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),q.init())})).isEnabled=A;d.isOffline()||("1"!=urlParams.embed&&(d.actions.put("embedNotion",new Action("notion...",function(){var q=document.createElement("div");q.style.position=+300:280:260,!0,!0)}));d.actions.put("createShape",new Action("shape...",function(q){v.isEnabled()&&(q=new mxCell("",new mxGeometry(0,0,120,120),d.defaultCustomShapeStyle),q.vertex=!0,q=new EditShapeDialog(d,q,mxResources.get("editShape")),d.showDialog(q.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),q.init())})).isEnabled=A;d.isOffline()||("1"!=urlParams.embed&&(d.actions.put("embedNotion",new Action("notion...",function(){var q=document.createElement("div");q.style.position="absolute";q.style.bottom="30px";q.style.textAlign="center";q.style.width="100%";q.style.left="0px";var u=document.createElement("a");u.setAttribute("href","javascript:void(0);");u.setAttribute("target","_blank");u.style.cursor="pointer";mxUtils.write(u,mxResources.get("getNotionChromeExtension"));q.appendChild(u);mxUtils.setPrefixedStyle(u.style,"transition","all 1s ease");mxUtils.setOpacity(u,0);window.setTimeout(function(){mxUtils.setOpacity(u,100)},300);mxEvent.addListener(u,"click",function(I){d.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");mxEvent.consume(I)});d.getPublicUrl(d.getCurrentFile(),function(I){d.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",q,I,d.getCurrentFile(),function(G,H,g,p,B,K,M,N,R,T,V,X){M=["border=0"];R&&M.push("tags=%7B%7D");G=new EmbedDialog(d,d.createLink(G,H,!0,p,B,K,"public"==T?I:null,null,M,null,g,null,X));d.showDialog(G.container,450,240,!0,!0);G.init()},null,!0)})})),d.actions.addAction("microsoftOffice...",function(){d.openLink("https://office.draw.io")})),d.actions.put("embedHtml",new Action("html...",function(){d.getPublicUrl(d.getCurrentFile(),function(q){d.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",q,function(u,I,G,H,g,p,B,K,M,N,R,T){d.createHtml(u,I,G,H,g,p,B,K,M,N,R,mxUtils.bind(this,function(V,X){var W=new EmbedDialog(d,"\x3c!-- "+d.editor.appName+" diagram --\x3e\n"+V+"\n"+X+"\n",null,null,function(){try{var Y=window.open();if(null!=Y&&null!=Y.document){var Z=Y.document;"CSS1Compat"===document.compatMode&&@@ -14014,26 +14014,26 @@ Z.writeln("<!DOCTYPE html>");Z.writeln("<html>");Z.writeln("<head><title>"+encodha.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ha.style.marginLeft="6px";la.appendChild(ha);Y.document.body.insertBefore(la,Y.document.body.firstChild);window.setTimeout(function(){var ca=document.createElement("script");ca.type="text/javascript";ca.src=/<script.*?src="(.*?)"/.exec(X)[1];Z.body.appendChild(ca);la.parentNode.removeChild(la)},20)}}else d.handleError({message:mxResources.get("errorUpdatingPreview")})}catch(ca){d.handleError(ca)}});d.showDialog(W.container,450,240,!0,!0);W.init()}),T)})})})),d.actions.put("liveImage",new Action("Live image...",function(){var q=d.getCurrentFile();null!=q&&d.getPublicUrl(q,function(u){null!=u?(u=new EmbedDialog(d,'<img src="'+(q.constructor!=DriveFile?u:"https://drive.google.com/uc?id="+q.getId())+'"/>'),d.showDialog(u.container,450,240,!0,!0),u.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})})),d.actions.put("embedImage",new Action("image...",function(){d.showEmbedImageDialog(function(q,u,I,G,H,g){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedImage(q,u,I,G,H,g,function(p){d.spinner.stop();p=new EmbedDialog(d,p);d.showDialog(p.container,450,240,!0,!0);p.init()},function(p){d.spinner.stop();d.handleError(p)})},mxResources.get("image"),mxResources.get("retina"),d.editor.isExportToCanvas())})),d.actions.put("embedSvg",new Action("formatSvg...",function(){d.showEmbedImageDialog(function(q,u,I,G,H,g){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedSvg(q,-u,I,G,H,g,function(p){d.spinner.stop();p=new EmbedDialog(d,p);d.showDialog(p.container,450,240,!0,!0);p.init()},function(p){d.spinner.stop();d.handleError(p)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")})),d.actions.put("embedIframe",new Action("iframe...",function(){d.getPublicUrl(d.getCurrentFile(),function(q){var u=x.getGraphBounds();d.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,u.height/x.view.scale))++u,I,G,H,g,function(p){d.spinner.stop();p=new EmbedDialog(d,p);d.showDialog(p.container,450,240,!0,!0);p.init()},function(p){d.spinner.stop();d.handleError(p)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")})),d.actions.put("embedIframe",new Action("iframe...",function(){d.getPublicUrl(d.getCurrentFile(),function(q){var u=v.getGraphBounds();d.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,u.height/v.view.scale))+2,null,null,null,q,d.getCurrentFile(),function(I,G,H,g,p,B,K,M,N,R,T,V){var X=[];N&&X.push("tags=%7B%7D");I=new EmbedDialog(d,'<iframe frameborder="0" style="width:'+K+";height:"+M+';" src="'+d.createLink(I,G,!0,g,p,B,"public"==R?q:null,null,X,null,H,T,V)+'"'+(T?' allowtransparency="true"':"")+"></iframe>");d.showDialog(I.container,450,240,!0,!0);I.init()},!0,!0)})})));d.actions.put("publishLink",new Action("link...",function(){d.getPublicUrl(d.getCurrentFile(),function(q){d.showPublishLinkDialog(null,null,null,null,null,null,q,d.getCurrentFile(),function(u,I,G,H,g,p,B,K,M,N,R,T){B=[];H&&M&&B.push("tags=%7B%7D");u=new EmbedDialog(d,d.createLink(u,I,!0,H,g,p,"public"==N?q:null,null,B,null,G,null,T));d.showDialog(u.container,450,240,!0,!0);u.init()},null,!0)})},null,null,null,!d.isOffline()));if(isLocalStorage||mxClient.IS_CHROMEAPP)z=d.actions.addAction("scratchpad",function(){d.toggleScratchpad()}),z.setToggleAction(!0),z.setSelectedCallback(function(){return null!=d.scratchpad}),"0"!=urlParams.plugins&&d.actions.addAction("plugins...",function(){d.showDialog((new PluginsDialog(d)).container,380,240,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(z=d.actions.addAction("highContrast",function(){d.setAndPersistHighContrast(!d.isHighContrast())}),z.setToggleAction(!0),z.setSelectedCallback(function(){return d.isHighContrast()}));z=d.actions.addAction("search",function(){if(null!=d.sidebar){var q=d.sidebar.isEntryVisible("search");d.sidebar.showPalette("search",-!q);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!q,mxSettings.save())}});z.label=mxResources.get("searchShapes");z.setToggleAction(!0);z.setSelectedCallback(function(){return null!=d.sidebar&&d.sidebar.isEntryVisible("search")});d.actions.get("clearDefaultStyle").funct=function(q){x.isEnabled()&&(d.clearDefaultStyle(),Editor.sketchMode&&d.setSketchMode(!1))};"1"==urlParams.embed&&(d.actions.get("saveAs").setEnabled(!1),d.actions.get("save").funct=function(q){x.isEditing()&&x.stopEditing();+!q);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!q,mxSettings.save())}});z.label=mxResources.get("searchShapes");z.setToggleAction(!0);z.setSelectedCallback(function(){return null!=d.sidebar&&d.sidebar.isEntryVisible("search")});d.actions.get("clearDefaultStyle").funct=function(q){v.isEnabled()&&(d.clearDefaultStyle(),Editor.sketchMode&&d.setSketchMode(!1))};"1"==urlParams.embed&&(d.actions.get("saveAs").setEnabled(!1),d.actions.get("save").funct=function(q){v.isEditing()&&v.stopEditing();var u="0"!=urlParams.pages||null!=d.pages&&1<d.pages.length?d.getFileData(!0):mxUtils.getXml(d.editor.getGraphXml());if("json"==urlParams.proto){var I=d.createLoadMessage("save");I.xml=u;!0!==q||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(I.exit=!0);u=JSON.stringify(I)}(window.opener||window.parent).postMessage(u,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(d.editor.modified=!1,d.clearStatus());q=d.getCurrentFile();null==q||q.constructor==EmbedFile||q.constructor==LocalFile&&null==q.mode||d.saveFile()},d.actions.addAction("saveAndExit",function(){"1"==urlParams.toSvg?d.sendEmbeddedSvgExport():d.actions.get("save").funct(!0)},null,null,Editor.ctrlKey+"+S").label="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),d.actions.addAction("exit",function(){if("1"==urlParams.embedInline)d.sendEmbeddedSvgExport();else{var q=function(){d.editor.modified=!1;var u="json"==urlParams.proto?JSON.stringify({event:"exit",modified:d.editor.modified}):"";(window.opener||window.parent).postMessage(u,"*")};d.editor.modified?d.confirm(mxResources.get("allChangesLost"),null,q,mxResources.get("cancel"),mxResources.get("discardChanges")):q()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(q,u){d.editor.isExportToCanvas()?(this.addMenuItems(q,["exportPng"],u),Editor.jpgSupported&&this.addMenuItems(q,["exportJpg"],u),Editor.webpSupported&&this.addMenuItems(q,["exportWebp"],u)):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(q,["exportPng","exportJpg"],u);this.addMenuItems(q,["exportSvg","-"],u);d.isOffline()||d.printPdfExport?this.addMenuItems(q,["exportPdf"],u):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(q,["exportPdf"],u);!d.vsdxExportEnabled()||mxClient.IS_IE||"undefined"===typeof VsdxExport&&d.isOffline()||this.addMenuItems(q,["exportVsdx"],u);this.addMenuItems(q,["-","exportHtml","exportXml","exportUrl"],u);d.isOffline()||(q.addSeparator(u),this.addMenuItem(q,"export",u).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=Editor.currentTheme||d.isOffline()||this.addMenuItems(q,["publishLink"],u);d.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||d.isOffline()||(q.addSeparator(u),d.menus.addSubmenu("embed",q,u))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(q,u){function I(g){g.pickFile(function(p){d.spinner.spin(document.body,-mxResources.get("loading"))&&g.getFile(p,function(B){var K="data:image/"==B.getData().substring(0,11)?H(B.getTitle()):"text/xml";/\.svg$/i.test(B.getTitle())&&!d.editor.isDataSvg(B.getData())&&(B.setData(Editor.createSvgDataUri(B.getData())),K="image/svg+xml");G(B.getData(),K,B.getTitle())},function(B){d.handleError(B,null!=B?mxResources.get("errorLoadingFile"):null)},g==d.drive)},!0)}var G=mxUtils.bind(this,function(g,p,B){var K=x.view,M=x.getGraphBounds(),N=x.snap(Math.ceil(Math.max(0,M.x/K.scale--K.translate.x)+4*x.gridSize)),R=x.snap(Math.ceil(Math.max(0,(M.y+M.height)/K.scale-K.translate.y)+4*x.gridSize));"data:image/"==g.substring(0,11)?d.loadImage(g,mxUtils.bind(this,function(T){var V=!0,X=mxUtils.bind(this,function(){d.resizeImage(T,g,mxUtils.bind(this,function(W,Y,Z){W=V?Math.min(1,Math.min(d.maxImageSize/Y,d.maxImageSize/Z)):1;d.importFile(g,p,N,R,Math.round(Y*W),Math.round(Z*W),B,function(aa){d.spinner.stop();x.setSelectionCells(aa);x.scrollCellToVisible(x.getSelectionCell())})}),-V)});g.length>d.resampleThreshold?d.confirmImageResize(function(W){V=W;X()}):X()}),mxUtils.bind(this,function(){d.handleError({message:mxResources.get("cannotOpenFile")})})):d.importFile(g,p,N,R,0,0,B,function(T){d.spinner.stop();x.setSelectionCells(T);x.scrollCellToVisible(x.getSelectionCell())})}),H=mxUtils.bind(this,function(g){var p="text/xml";/\.png$/i.test(g)?p="image/png":/\.jpe?g$/i.test(g)?p="image/jpg":/\.gif$/i.test(g)?p="image/gif":/\.pdf$/i.test(g)&&(p="application/pdf");return p});"undefined"!=+mxResources.get("loading"))&&g.getFile(p,function(B){var K="data:image/"==B.getData().substring(0,11)?H(B.getTitle()):"text/xml";/\.svg$/i.test(B.getTitle())&&!d.editor.isDataSvg(B.getData())&&(B.setData(Editor.createSvgDataUri(B.getData())),K="image/svg+xml");G(B.getData(),K,B.getTitle())},function(B){d.handleError(B,null!=B?mxResources.get("errorLoadingFile"):null)},g==d.drive)},!0)}var G=mxUtils.bind(this,function(g,p,B){var K=v.view,M=v.getGraphBounds(),N=v.snap(Math.ceil(Math.max(0,M.x/K.scale-+K.translate.x)+4*v.gridSize)),R=v.snap(Math.ceil(Math.max(0,(M.y+M.height)/K.scale-K.translate.y)+4*v.gridSize));"data:image/"==g.substring(0,11)?d.loadImage(g,mxUtils.bind(this,function(T){var V=!0,X=mxUtils.bind(this,function(){d.resizeImage(T,g,mxUtils.bind(this,function(W,Y,Z){W=V?Math.min(1,Math.min(d.maxImageSize/Y,d.maxImageSize/Z)):1;d.importFile(g,p,N,R,Math.round(Y*W),Math.round(Z*W),B,function(aa){d.spinner.stop();v.setSelectionCells(aa);v.scrollCellToVisible(v.getSelectionCell())})}),+V)});g.length>d.resampleThreshold?d.confirmImageResize(function(W){V=W;X()}):X()}),mxUtils.bind(this,function(){d.handleError({message:mxResources.get("cannotOpenFile")})})):d.importFile(g,p,N,R,0,0,B,function(T){d.spinner.stop();v.setSelectionCells(T);v.scrollCellToVisible(v.getSelectionCell())})}),H=mxUtils.bind(this,function(g){var p="text/xml";/\.png$/i.test(g)?p="image/png":/\.jpe?g$/i.test(g)?p="image/jpg":/\.gif$/i.test(g)?p="image/gif":/\.pdf$/i.test(g)&&(p="application/pdf");return p});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=d.drive?q.addItem(mxResources.get("googleDrive")+"...",null,function(){I(d.drive)},u):d.isModeEnabled(App.MODE_GOOGLE)&&q.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1));d.isModeReady(App.MODE_ONEDRIVE)?q.addItem(mxResources.get("oneDrive")+"...",null,function(){I(d.oneDrive)},u):d.isModeEnabled(App.MODE_ONEDRIVE)&&q.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);d.isModeReady(App.MODE_DROPBOX)?q.addItem(mxResources.get("dropbox")+"...",null,function(){I(d.dropbox)},u):d.isModeEnabled(App.MODE_DROPBOX)&&q.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);q.addSeparator(u);d.isModeReady(App.MODE_GITHUB)&&q.addItem(mxResources.get("github")+"...",null,function(){I(d.gitHub)},u);d.isModeReady(App.MODE_GITLAB)&&q.addItem(mxResources.get("gitlab")+"...",null,function(){I(d.gitLab)},u);d.isModeReady(App.MODE_TRELLO)?q.addItem(mxResources.get("trello")+"...",null,function(){I(d.trello)},u):d.isModeEnabled(App.MODE_TRELLO)&&q.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);q.addSeparator(u);isLocalStorage&&"0"!=urlParams.browser&&q.addItem(mxResources.get("browser")+"...",null,function(){d.importLocalFile(!1)},u);"1"!=urlParams.noDevice&&q.addItem(mxResources.get("device")+"...",null,function(){d.importLocalFile(!0)},u);d.isOffline()||(q.addSeparator(u),q.addItem(mxResources.get("url")+"...",null,function(){var g=new FilenameDialog(d,"",mxResources.get("import"),function(p){if(null!=p&&0<p.length&&d.spinner.spin(document.body,mxResources.get("loading"))){var B=/(\.png)($|\?)/i.test(p)?"image/png":"text/xml";d.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(p),function(K){G(K,B,p)},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==B)}},mxResources.get("url"));d.showDialog(g.container,300,80,!0,!0);g.init()},u))}))).isEnabled=A;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(q,u){var I=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&(750>I&&this.addSubmenu("viewZoom",q,u,mxResources.get("zoom")),460>I&&d.isPageMenuVisible()&&this.addSubmenu("pages",q,u),320>I&&this.addSubmenu("insert",q,u),360>I&&"1"!=urlParams.embed&&"draw.io"==d.getServiceName()&&this.addSubmenu("share",q,u))})));this.put("appearance",new Menu(mxUtils.bind(this,function(q,u){if(d.isAutoDarkModeSupported()){var I=d.menus.addMenuItem(q,"autoMode",u);null!=I&&I.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+")")}this.addMenuItems(q,["lightMode","darkMode","-"],u);I=d.menus.addMenuItem(q,"highContrast",u);(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&d.menus.addLinkToItem(I,"https://github.com/jgraph/drawio/issues/4296")})));d.actions.addAction("addToScratchpad",-function(q){x.isSelectionEmpty()||null==d.addSelectionToScratchpad||d.addSelectionToScratchpad(q)});d.actions.addAction("accounts...",function(){d.toggleUserPanel();d.userPanel.style.right="10px";d.userPanel.style.top="10px"});this.put("theme",new Menu(mxUtils.bind(this,function(q,u){var I="1"==urlParams.sketch?"sketch":mxSettings.getUi(),G=q.addItem(mxResources.get("automatic"),null,function(){d.setCurrentTheme("")},u),H=q.addItem(mxResources.get("classic"),null,function(){d.setCurrentTheme("kennedy")},+function(q){v.isSelectionEmpty()||null==d.addSelectionToScratchpad||d.addSelectionToScratchpad(q)});d.actions.addAction("accounts...",function(){d.toggleUserPanel();d.userPanel.style.right="10px";d.userPanel.style.top="10px"});this.put("theme",new Menu(mxUtils.bind(this,function(q,u){var I="1"==urlParams.sketch?"sketch":mxSettings.getUi(),G=q.addItem(mxResources.get("automatic"),null,function(){d.setCurrentTheme("")},u),H=q.addItem(mxResources.get("classic"),null,function(){d.setCurrentTheme("kennedy")},u),g=!1;if("kennedy"==I||"dark"==I)q.addCheckmark(H,Editor.checkmarkImage),g=!0;for(var p=0;p<Editor.themes.length;p++)mxUtils.bind(this,function(B){H=q.addItem(mxResources.get("min"==B?"minimal":B),null,function(){d.setCurrentTheme(B)},u);I==B&&(q.addCheckmark(H,Editor.checkmarkImage),g=!0);"simple"==B&&q.addSeparator(u)})(Editor.themes[p]);g||q.addCheckmark(G,Editor.checkmarkImage)})));z=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var q=this.editorUi.getCurrentFile();if(null!=q)if(q.constructor==LocalFile&&null!=q.fileHandle)d.showSaveFilePicker(mxUtils.bind(d,function(I,G){q.invalidFileHandle=null;q.fileHandle=I;q.title=G.name;q.desc=G;d.save(G.name)}),null,d.createFileSystemOptions(q.getTitle()));else{var u=null!=q.getTitle()?q.getTitle():this.editorUi.defaultFilename;u=new FilenameDialog(this.editorUi,u,mxResources.get("rename"),mxUtils.bind(this,function(I){null!=I&&0<I.length&&null!=q&&I!=q.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&q.rename(I,mxUtils.bind(this,function(G){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(G){this.editorUi.handleError(G,null!=G?mxResources.get("errorRenamingFile"):null)}))}),q.constructor==DriveFile||q.constructor==StorageFile?mxResources.get("diagramName"):null,function(I){if(null!=I&&0<I.length)return!0;d.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,d.editor.fileExtensions);this.editorUi.showDialog(u.container,@@ -14044,16 +14044,16 @@ null,null,null,null,null,q.getMode());d.showDialog(u.container,420,70,!0,!1,mxUtd.editor.editAsNew(d.getFileData(!0),q,!0,null!=d.currentPage?d.currentPage.getId():null)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var q=d.getCurrentFile();null!=q&&q.share()}catch(u){d.handleError(u)}})).isEnabled=A;this.put("embed",new Menu(mxUtils.bind(this,function(q,u){var I=d.getCurrentFile();null==I||I.getMode()!=App.MODE_GOOGLE&&I.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(I.getTitle())||this.addMenuItems(q,["liveImage","-"],u);this.addMenuItems(q,["embedImage","embedSvg","-","embedHtml"],u);navigator.standalone||d.isOffline()||this.addMenuItems(q,["embedIframe"],u);this.addMenuItems(q,["-","microsoftOffice","-","embedNotion"],u)})));z=function(q){var u=mxResources.get(q)+"...";d.actions.put(q,new Action(u,function(I){if("fromText"==q||"formatSql"==q||"plantUml"==q||"mermaid"==q){var G=new ParseDialog(d,u,q);d.showDialog(G.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280))}else G=new CreateGraphDialog(d,u,q),d.showDialog(G.container,620,420,!0,!1,function(H,g){if(g)return d.confirm(mxResources.get("areYouSure"),function(){d.hideDialog()}),!1;null!=G.graph&&(null!=G.graph.container.parentNode&&G.graph.container.parentNode.removeChild(G.graph.container),G.graph.destroy(),G.graph=null)});G.init()})).isEnabled=A};z("mermaid");z("horizontalFlow");z("verticalFlow");z("horizontalTree");z("verticalTree");z("radialTree");z("organic");z("circle");z("fromText");z("formatSql");("https://plant-aws.diagrams.net"!=window.PLANT_URL||EditorUi.enablePlantUml&&-!d.isOffline())&&z("plantUml");var E=function(q){x.getModel().beginUpdate();try{q=x.addCell(q),x.fireEvent(new mxEventObject("cellsInserted","cells",[q])),x.model.isVertex(q)&&x.isAutoSizeCell(q)&&x.updateCellSize(q)}finally{x.getModel().endUpdate()}x.scrollCellToVisible(q);x.setSelectionCell(q);x.container.focus();x.editAfterInsert&&x.startEditing(q);window.setTimeout(function(){null!=d.hoverIcons&&d.hoverIcons.update(x.view.getState(q))},0);return q},C=function(q,u,I,G,H){q=new mxCell(q,new mxGeometry(0,-0,u,I),G);q.vertex=!0;null==H&&(H=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([q],!0)));q.geometry.x=H.x;q.geometry.y=H.y;return E(q)};d.actions.put("insertText",new Action("text",function(q){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&x.startEditingAtCell(C("Text",60,30,x.appendFontSize(Editor.defaultTextStyle,x.vertexFontSize),null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!x.isMouseInsertPoint()?null:x.getInsertPoint()))},null,null,"A")).isEnabled=A;d.actions.put("insertRectangle",-new Action("rectangle",function(q){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&C("",120,60,"whiteSpace=wrap;html=1;",null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"D")).isEnabled=A;d.actions.put("insertNote",new Action("note",function(q){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&C("",140,160,"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",-null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"S")).isEnabled=A;d.actions.put("insertEllipse",new Action("ellipse",function(q){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&C("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"F")).isEnabled=A;d.actions.put("insertRhombus",new Action("rhombus",function(q){x.isEnabled()&&-!x.isCellLocked(x.getDefaultParent())&&C("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"R")).isEnabled=A;d.actions.put("insertEdge",new Action("line",function(q){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var u=x.defaultEdgeLength;q=null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!x.isMouseInsertPoint()?null:x.getInsertPoint();null==q&&(q=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([I],+!d.isOffline())&&z("plantUml");var E=function(q){v.getModel().beginUpdate();try{q=v.addCell(q),v.fireEvent(new mxEventObject("cellsInserted","cells",[q])),v.model.isVertex(q)&&v.isAutoSizeCell(q)&&v.updateCellSize(q)}finally{v.getModel().endUpdate()}v.scrollCellToVisible(q);v.setSelectionCell(q);v.container.focus();v.editAfterInsert&&v.startEditing(q);window.setTimeout(function(){null!=d.hoverIcons&&d.hoverIcons.update(v.view.getState(q))},0);return q},C=function(q,u,I,G,H){q=new mxCell(q,new mxGeometry(0,+0,u,I),G);q.vertex=!0;null==H&&(H=v.getCenterInsertPoint(v.getBoundingBoxFromGeometry([q],!0)));q.geometry.x=H.x;q.geometry.y=H.y;return E(q)};d.actions.put("insertText",new Action("text",function(q){v.isEnabled()&&!v.isCellLocked(v.getDefaultParent())&&v.startEditingAtCell(C("Text",60,30,v.appendFontSize(Editor.defaultTextStyle,v.vertexFontSize),null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!v.isMouseInsertPoint()?null:v.getInsertPoint()))},null,null,"A")).isEnabled=A;d.actions.put("insertRectangle",+new Action("rectangle",function(q){v.isEnabled()&&!v.isCellLocked(v.getDefaultParent())&&C("",120,60,"whiteSpace=wrap;html=1;",null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!v.isMouseInsertPoint()?null:v.getInsertPoint())},null,null,"D")).isEnabled=A;d.actions.put("insertNote",new Action("note",function(q){v.isEnabled()&&!v.isCellLocked(v.getDefaultParent())&&C("",140,160,"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",+null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!v.isMouseInsertPoint()?null:v.getInsertPoint())},null,null,"S")).isEnabled=A;d.actions.put("insertEllipse",new Action("ellipse",function(q){v.isEnabled()&&!v.isCellLocked(v.getDefaultParent())&&C("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!v.isMouseInsertPoint()?null:v.getInsertPoint())},null,null,"F")).isEnabled=A;d.actions.put("insertRhombus",new Action("rhombus",function(q){v.isEnabled()&&+!v.isCellLocked(v.getDefaultParent())&&C("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!v.isMouseInsertPoint()?null:v.getInsertPoint())},null,null,"R")).isEnabled=A;d.actions.put("insertEdge",new Action("line",function(q){if(v.isEnabled()&&!v.isCellLocked(v.getDefaultParent())){var u=v.defaultEdgeLength;q=null==q||mxEvent.isControlDown(q)||mxEvent.isMetaDown(q)||!v.isMouseInsertPoint()?null:v.getInsertPoint();null==q&&(q=v.getCenterInsertPoint(v.getBoundingBoxFromGeometry([I],!0)));var I=new mxCell("",new mxGeometry(0,0,u,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");I.geometry.setTerminalPoint(q,!0);I.geometry.setTerminalPoint(new mxPoint(q.x+I.geometry.width,q.y),!1);I.geometry.points=[];I.geometry.relative=!0;I.edge=!0;E(I)}},null,null,"C")).isEnabled=A;z=d.actions.put("toggleShapes",new Action("shapes",function(){null!=d.sidebarWindow?d.sidebarWindow.window.setVisible(!d.sidebarWindow.window.isVisible()):d.toggleShapesPanel(!d.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+K"));z.setToggleAction(!0);z.setSelectedCallback(mxUtils.bind(this,function(){return null!=d.sidebarWindow&&d.sidebarWindow.window.isVisible()||null==d.sidebarWindow&&0<d.hsplitPosition}));this.put("insert",new Menu(mxUtils.bind(this,function(q,u){"sketch"==Editor.currentTheme?(d.menus.addMenuItems(q,["toggleShapes"],u),d.menus.addSubmenu("table",q,u),q.addSeparator(u),d.menus.addMenuItems(q,"insertText insertLink - insertImage createShape -".split(" "),u),d.insertTemplateEnabled&&!d.isOffline()&&d.menus.addMenuItems(q,["insertTemplate"],u),window.isMermaidEnabled&&d.menus.addMenuItems(q,["mermaid"],u),d.menus.addMenuItems(q,["-","insertFreehand","generate","-"],u),d.menus.addSubmenu("layout",q,u),d.menus.addSubmenu("insertAdvanced",q,u,mxResources.get("advanced"))):(this.addMenuItems(q,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - insertImage createShape -".split(" "),u),d.insertTemplateEnabled&&!d.isOffline()&&this.addMenuItems(q,["insertTemplate"],u),window.isMermaidEnabled&&this.addMenuItems(q,["mermaid"],u),d.menus.addMenuItems(q,["-","insertFreehand","generate","-"],u),"min"==uiTheme||"simple"==Editor.currentTheme?(this.addSubmenu("layout",q,u),this.addSubmenu("insertLayout",q,u,mxResources.get("insert")),q.addSeparator(u),this.addSubmenu("table",q,u)):this.addSubmenu("insertLayout",q,u,mxResources.get("layout")),this.addSubmenu("insertAdvanced",q,u,mxResources.get("advanced")))})));-this.put("table",new Menu(mxUtils.bind(this,function(q,u){d.menus.addInsertTableCellItem(q,u)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(q,u){this.addMenuItems(q,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),u)})));d.actions.put("csv",new Action(mxResources.get("csv")+"...",function(){x.popupMenuHandler.hideMenu();d.showImportCsvDialog()})).isEnabled=A;this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(q,u){var I=+this.put("table",new Menu(mxUtils.bind(this,function(q,u){d.menus.addInsertTableCellItem(q,u)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(q,u){this.addMenuItems(q,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),u)})));d.actions.put("csv",new Action(mxResources.get("csv")+"...",function(){v.popupMenuHandler.hideMenu();d.showImportCsvDialog()})).isEnabled=A;this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(q,u){var I=["fromText","plantUml","formatSql","csv"];EditorUi.enablePlantUml||I.splice(1,1);this.addMenuItems(q,I,u);"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(q,["-","createShape","editDiagram"],u)})));this.put("openRecent",new Menu(function(q,u){var I=d.getRecent();if(null!=I){for(var G=0;G<I.length;G++)(function(H){var g=H.mode;g==App.MODE_GOOGLE?g="googleDrive":g==App.MODE_ONEDRIVE&&(g="oneDrive");q.addItem(H.title+" ("+mxResources.get(g)+")",null,function(){d.loadFile(H.id)},u)})(I[G]);q.addSeparator(u)}q.addItem(mxResources.get("reset"),null,function(){d.resetRecent()},u)}));this.put("openFrom",new Menu(function(q,u){null!=d.drive?q.addItem(mxResources.get("googleDrive")+"...",null,function(){d.pickFile(App.MODE_GOOGLE)},u):d.isModeEnabled(App.MODE_GOOGLE)&&q.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);d.isModeReady(App.MODE_ONEDRIVE)?q.addItem(mxResources.get("oneDrive")+"...",null,function(){d.pickFile(App.MODE_ONEDRIVE)},u):d.isModeEnabled(App.MODE_ONEDRIVE)&&q.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);d.isModeReady(App.MODE_DROPBOX)?q.addItem(mxResources.get("dropbox")+"...",null,function(){d.pickFile(App.MODE_DROPBOX)},u):d.isModeEnabled(App.MODE_DROPBOX)&&q.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},u,null,!1);q.addSeparator(u);d.isModeReady(App.MODE_GITHUB)&&q.addItem(mxResources.get("github")+"...",@@ -14115,27 +14115,27 @@ DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("namRenamePage.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 MovePage(b,l,n){this.ui=b;this.oldIndex=l;this.newIndex=n}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,l,n){this.ui=b;this.previousPage=this.page=l;null!=l&&(this.ui.updatePageRoot(l),null!=n&&(l.viewState=n))}SelectPage.prototype.execute=function(){var b=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=b){b=this.ui.currentPage;var l=this.ui.editor,n=l.graph;b.isDiagramModified()&&(b.setDiagramModified(!1),EditorUi.removeChildNodes(b.node),b.node.appendChild(l.getGraphXml(!0)));b.viewState=n.getViewState();b.root=n.model.root;null!=b.model&&b.model.rootChanged(b.root);n.view.clear(b.root,!0);n.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=b;b=this.ui.currentPage;-n.model.prefix=Editor.guid()+"-";n.model.rootChanged(b.root);n.setViewState(b.viewState);n.gridEnabled=n.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);l.graph.fireEvent(new mxEventObject(mxEvent.ROOT));l.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(b,l,n,d,x){SelectPage.call(this,b,n);this.relatedPage=l;this.index=d;this.previousIndex=null;this.noSelect=x}mxUtils.extend(ChangePage,SelectPage);+n.model.prefix=Editor.guid()+"-";n.model.rootChanged(b.root);n.setViewState(b.viewState);n.gridEnabled=n.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);l.graph.fireEvent(new mxEventObject(mxEvent.ROOT));l.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(b,l,n,d,v){SelectPage.call(this,b,n);this.relatedPage=l;this.index=d;this.previousIndex=null;this.noSelect=v}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,l){this.ui=b;this.data=l}ReplaceDiagram.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 n=new mxCodec(this.data.ownerDocument),d=new mxGraphModel;n.decode(this.data,d);this.data=l;this.ui.currentPage&&(this.ui.currentPage.viewState=b.getViewState(),this.ui.currentPage.root=d.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(d.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 n=0;n<this.pages.length;n++)if(this.pages[n]==b){l=n;break}return l};EditorUi.prototype.getPageById=function(b,l){l=null!=l?l:this.pages;if(null!=l)for(var n=0;n<l.length;n++)if(l[n].getId()==b)return l[n];return null};-EditorUi.prototype.createImageForPageLink=function(b,l,n,d){var x=b.indexOf(","),A=null;0<x&&(x=this.getPageById(b.substring(x+1)),null!=x&&x!=l&&(A=this.getImageForPage(x,l,n,d),A.originalSrc=b));null==A&&(A={originalSrc:b});return A};+EditorUi.prototype.createImageForPageLink=function(b,l,n,d){var v=b.indexOf(","),A=null;0<v&&(v=this.getPageById(b.substring(v+1)),null!=v&&v!=l&&(A=this.getImageForPage(v,l,n,d),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(),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(),this.scrollToPage())};-EditorUi.prototype.getImageForPage=function(b,l,n,d){n=null!=n?n:this.editor.graph;var x=n.getGlobalVariable;n=this.createTemporaryGraph(n.getStylesheet());var A=this.getPageIndex(null!=l?l:this.currentPage);n.getGlobalVariable=function(D){return"pagenumber"==D?A+1:"page"==D&&null!=l?l.getName():x.apply(this,arguments)};document.body.appendChild(n.container);this.updatePageRoot(b);n.setAdaptiveColors(b.viewState.adaptiveColors);n.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=+EditorUi.prototype.getImageForPage=function(b,l,n,d){n=null!=n?n:this.editor.graph;var v=n.getGlobalVariable;n=this.createTemporaryGraph(n.getStylesheet());var A=this.getPageIndex(null!=l?l:this.currentPage);n.getGlobalVariable=function(D){return"pagenumber"==D?A+1:"page"==D&&null!=l?l.getName():v.apply(this,arguments)};document.body.appendChild(n.container);this.updatePageRoot(b);n.setAdaptiveColors(b.viewState.adaptiveColors);n.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText="";d=n.getSvg(null,null,null,null,null,null,null,null,null,null,d,null,null,null,!0,!0);var z=n.getGraphBounds();document.body.removeChild(n.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(d)),z.width,z.height,z.x,z.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,D){z=D.getProperty("edit").changes;for(D=0;D<z.length;D++)if(z[D]instanceof RenamePage||z[D]instanceof ChangePage||z[D]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==z.length&&z[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var n=b.sizeDidChange,d=null,x=this;b.sizeDidChange=-function(){var z=n.apply(this,arguments);null!=x.currentPage&&d!=x.currentPage&&(d=x.currentPage,x.pageSelected());return z};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);+arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(z,D){z=D.getProperty("edit").changes;for(D=0;D<z.length;D++)if(z[D]instanceof RenamePage||z[D]instanceof ChangePage||z[D]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==z.length&&z[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var n=b.sizeDidChange,d=null,v=this;b.sizeDidChange=+function(){var z=n.apply(this,arguments);null!=v.currentPage&&d!=v.currentPage&&(d=v.currentPage,v.pageSelected());return z};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(z,D){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(z,D){this.scrollToPage();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 n=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),d=null!=b?b:this.currentPage;null!=n&&null!=this.tabScroller&&this.tabScroller.children.length>n&&null!=this.tabScroller.children[n]&&(d!=this.lastScrollPage||l)&&(this.tabScroller.children[n].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[n].className="geTab gePageTab geActivePage",this.lastScrollPage=d)};EditorUi.prototype.restoreViewState=function(b,l,n){b=null!=b?this.getPageById(b.getId()):null;var d=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,l):(d.setViewState(l),this.editor.updateGraphComponents(),d.view.revalidate(),d.sizeDidChange()),d.container.scrollLeft=d.view.translate.x*d.view.scale+l.scrollLeft,d.container.scrollTop=d.view.translate.y*d.view.scale+l.scrollTop,d.restoreSelection(n))};-Graph.prototype.createViewState=function(b){var l=b.getAttribute("page"),n=parseFloat(b.getAttribute("pageScale")),d=parseFloat(b.getAttribute("pageWidth")),x=parseFloat(b.getAttribute("pageHeight")),A=b.getAttribute("background"),z=this.parseBackgroundImage(b.getAttribute("backgroundImage")),D=b.getAttribute("extFonts");if(D)try{D=D.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:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=l?"0"!=l:this.defaultPageVisible,background:null!=A&&0<A.length?A:null,backgroundImage:z,pageScale:isNaN(n)?mxGraph.prototype.pageScale:n,pageFormat:isNaN(d)||isNaN(x)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:-mxSettings.getPageFormat():new mxRectangle(0,0,d,x),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:D||[]}};-Graph.prototype.saveViewState=function(b,l,n,d,x){n||(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"),+Graph.prototype.createViewState=function(b){var l=b.getAttribute("page"),n=parseFloat(b.getAttribute("pageScale")),d=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),A=b.getAttribute("background"),z=this.parseBackgroundImage(b.getAttribute("backgroundImage")),D=b.getAttribute("extFonts");if(D)try{D=D.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:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=l?"0"!=l:this.defaultPageVisible,background:null!=A&&0<A.length?A:null,backgroundImage:z,pageScale:isNaN(n)?mxGraph.prototype.pageScale:n,pageFormat:isNaN(d)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:+mxSettings.getPageFormat():new mxRectangle(0,0,d,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:D||[]}};+Graph.prototype.saveViewState=function(b,l,n,d,v){n||(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);n=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=n&&(l.setAttribute("pageWidth",n.width),l.setAttribute("pageHeight",n.height));null!=b&&(null!=b.background&&l.setAttribute("background",b.background),d=this.getBackgroundImageObject(b.backgroundImage,-d,x),null!=d&&l.setAttribute("backgroundImage",JSON.stringify(d)));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("|"))};+d,v),null!=d&&l.setAttribute("backgroundImage",JSON.stringify(d)));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=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()&&b.pageVisible;this.background=b.background;this.pageScale=b.pageScale;@@ -14143,41 +14143,41 @@ this.pageFormat=b.pageFormat;this.view.currentRoot=b.currentRoot;this.defaultParthis.extFonts[l].url,!0);this.view.scale=null!=b.scale?b.scale:1;null==this.view.currentRoot||this.model.contains(this.view.currentRoot)||(this.view.currentRoot=null);null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer());null!=b.translate&&(this.view.translate=b.translate)}else this.view.currentRoot=null,this.view.scale=1,this.gridEnabled=this.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.foldingEnabled=this.graphHandler.guidesEnabled=!0,this.setShadowVisible(!1,!1),this.defaultParent=null,this.setTooltips(!0),this.setConnectable(!0),this.lastPasteXml=null,this.pasteCounter=0,this.mathEnabled=this.defaultMathEnabled,this.adaptiveColors=null,this.connectionArrowsEnabled=!0,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,l,n){null!=b&&null!=b.scrollLeft&&null!=b.scrollTop&&(this.container.scrollLeft=l*this.view.scale+b.scrollLeft,this.container.scrollTop=n*this.view.scale+b.scrollTop)};-Graph.prototype.addExtFont=function(b,l,n){if(b&&l){var d="extFont_"+b;if(null==document.getElementById(d))if(0==l.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",l,null,d);else{document.getElementsByTagName("head");var x=document.createElement("style");x.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+b+'";\n\tsrc: url("'+l+'");\n}'));x.setAttribute("id",d);document.getElementsByTagName("head")[0].appendChild(x)}if(!n){null==this.extFonts&&(this.extFonts=[]);n=this.extFonts;-d=!0;for(x=0;x<n.length;x++)if(n[x].name==b){d=!1;break}d&&this.extFonts.push({name:b,url:l})}}};+Graph.prototype.addExtFont=function(b,l,n){if(b&&l){var d="extFont_"+b;if(null==document.getElementById(d))if(0==l.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",l,null,d);else{document.getElementsByTagName("head");var v=document.createElement("style");v.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+b+'";\n\tsrc: url("'+l+'");\n}'));v.setAttribute("id",d);document.getElementsByTagName("head")[0].appendChild(v)}if(!n){null==this.extFonts&&(this.extFonts=[]);n=this.extFonts;+d=!0;for(v=0;v<n.length;v++)if(n[v].name==b){d=!1;break}d&&this.extFonts.push({name:b,url:l})}}};EditorUi.prototype.updatePageRoot=function(b,l){if(null==b.root){l=this.editor.extractGraphModel(b.node,null,l);var n=Editor.extractParserError(l);if(n)throw Error(n);null!=l?(b.graphModelNode=l,b.viewState=this.editor.graph.createViewState(l),n=new mxCodec(l.ownerDocument),b.root=n.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(n=Editor.extractParserError(l))throw Error(n);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 n=new mxCodec(b.node.ownerDocument),d=new mxGraphModel;n.decode(b.node,d);n=new mxCodec(l.ownerDocument);var x=new mxGraphModel;n.decode(l,x);this.selectPage(b.page);l=this.diffCells(d.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,n){try{if(b!=this.currentPage){var d=this.editor.graph;d.isEditing()&&d.stopEditing(!1);l=null!=l?l:!1;d.isMouseDown=!1;d.reset();var x=d.model.createUndoableEdit();x.ignoreEdit=!0;var A=new SelectPage(this,b,n);A.execute();x.add(A);x.notify();l||d.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",x))}}catch(z){this.handleError(z)}};+EditorUi.prototype.updateDiagramData=function(b,l){if(null==this.getPageIndex(b.page))this.insertPage(null,null,l);else{var n=new mxCodec(b.node.ownerDocument),d=new mxGraphModel;n.decode(b.node,d);n=new mxCodec(l.ownerDocument);var v=new mxGraphModel;n.decode(l,v);this.selectPage(b.page);l=this.diffCells(d.root,v.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,n){try{if(b!=this.currentPage){var d=this.editor.graph;d.isEditing()&&d.stopEditing(!1);l=null!=l?l:!1;d.isMouseDown=!1;d.reset();var v=d.model.createUndoableEdit();v.ignoreEdit=!0;var A=new SelectPage(this,b,n);A.execute();v.add(A);v.notify();l||d.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",v))}}catch(z){this.handleError(z)}};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,n){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId(),n),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,n){l=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),l);l.setName(null!=b?b:this.createPageName());this.initDiagramNode(l,n);return l};EditorUi.prototype.createPageName=function(){for(var b={},l=0;l<this.pages.length;l++){var n=this.pages[l].getName();null!=n&&0<n.length&&(b[n]=n)}l=this.pages.length;do n=mxResources.get("pageWithNumber",[++l]);while(null!=b[n]);return n};-EditorUi.prototype.removePage=function(b){try{var l=this.editor.graph,n=mxUtils.indexOf(this.pages,b);if(l.isEnabled()&&0<=n){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);l.model.beginUpdate();try{var d=this.currentPage;d==b&&1<this.pages.length?(n==this.pages.length-1?n--:n++,d=this.pages[n]):1>=this.pages.length&&(d=this.insertPage(),l.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));l.model.execute(new ChangePage(this,b,d))}finally{l.model.endUpdate()}}}catch(x){this.handleError(x)}return b};-EditorUi.prototype.duplicatePage=function(b,l){var n=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var x=b.node.cloneNode(!1);x.removeAttribute("id");var A={},z=d.createCellLookup([d.model.root]);n=new DiagramPage(x);n.root=d.cloneCell(d.model.root,null,A);var D=new mxGraphModel;D.prefix=Editor.guid()+"-";D.setRoot(n.root);d.updateCustomLinks(d.createCellMapping(A,z),[n.root]);n.viewState=b==this.currentPage?d.getViewState():b.viewState;this.initDiagramNode(n);+EditorUi.prototype.removePage=function(b){try{var l=this.editor.graph,n=mxUtils.indexOf(this.pages,b);if(l.isEnabled()&&0<=n){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);l.model.beginUpdate();try{var d=this.currentPage;d==b&&1<this.pages.length?(n==this.pages.length-1?n--:n++,d=this.pages[n]):1>=this.pages.length&&(d=this.insertPage(),l.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));l.model.execute(new ChangePage(this,b,d))}finally{l.model.endUpdate()}}}catch(v){this.handleError(v)}return b};+EditorUi.prototype.duplicatePage=function(b,l){var n=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var A={},z=d.createCellLookup([d.model.root]);n=new DiagramPage(v);n.root=d.cloneCell(d.model.root,null,A);var D=new mxGraphModel;D.prefix=Editor.guid()+"-";D.setRoot(n.root);d.updateCustomLinks(d.createCellMapping(A,z),[n.root]);n.viewState=b==this.currentPage?d.getViewState():b.viewState;this.initDiagramNode(n);n.viewState.scale=1;delete n.viewState.scrollLeft;delete n.viewState.scrollTop;delete n.viewState.currentRoot;delete n.viewState.defaultParent;n.setName(l);n=this.insertPage(n,mxUtils.indexOf(this.pages,b)+1)}}catch(P){this.handleError(P)}return n};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=[],n=[],d=0;d<b.length;d++)try{n.push(this.clonePage(b[d]))}catch(x){l.push(mxResources.get("pageWithNumber",[d+1])+": "+x.toString())}if(0<l.length){b=Error(l.join("\n"));try{0<n.length&&(b.fallbackFileData=this.getXmlForPages(n))}catch(x){}throw b;}return n};+EditorUi.prototype.clonePages=function(b){for(var l=[],n=[],d=0;d<b.length;d++)try{n.push(this.clonePage(b[d]))}catch(v){l.push(mxResources.get("pageWithNumber",[d+1])+": "+v.toString())}if(0<l.length){b=Error(l.join("\n"));try{0<n.length&&(b.fallbackFileData=this.getXmlForPages(n))}catch(v){}throw b;}return n};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var l=new DiagramPage(b.node.cloneNode(!0)),n=b==this.currentPage?this.editor.graph.getViewState():b.viewState;l.viewState=mxUtils.clone(n,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(n){null!=n&&0<n.length&&this.editor.graph.model.execute(new RenamePage(this,b,n))}),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.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 n=null,d=0;d<this.pages.length;d++)mxUtils.bind(this,function(x,A){A.className="geTab gePageTab";this.pages[x]==this.currentPage&&A.classList.add("geActivePage");A.setAttribute("draggable",-"true");mxEvent.addListener(A,"dragstart",mxUtils.bind(this,function(z){b.isEnabled()?(mxClient.IS_FF&&z.dataTransfer.setData("Text","<diagram/>"),n=x):mxEvent.consume(z)}));mxEvent.addListener(A,"dragend",mxUtils.bind(this,function(z){n=null;z.stopPropagation();z.preventDefault()}));mxEvent.addListener(A,"dragover",mxUtils.bind(this,function(z){null!=n&&(z.dataTransfer.dropEffect="move");z.stopPropagation();z.preventDefault()}));mxEvent.addListener(A,"drop",mxUtils.bind(this,function(z){null!=n&&-x!=n&&this.movePage(n,x);z.stopPropagation();z.preventDefault()}));l.appendChild(A)})(d,this.createTabForPage(this.pages[d],d+1));d=null!=this.tabScroller?this.tabScroller.scrollLeft:0;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);this.tabScroller=l;this.tabScroller.scrollLeft=d;this.checkTabScrollerOverflow();mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(x){this.checkTabScrollerOverflow()}))}};+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 n=null,d=0;d<this.pages.length;d++)mxUtils.bind(this,function(v,A){A.className="geTab gePageTab";this.pages[v]==this.currentPage&&A.classList.add("geActivePage");A.setAttribute("draggable",+"true");mxEvent.addListener(A,"dragstart",mxUtils.bind(this,function(z){b.isEnabled()?(mxClient.IS_FF&&z.dataTransfer.setData("Text","<diagram/>"),n=v):mxEvent.consume(z)}));mxEvent.addListener(A,"dragend",mxUtils.bind(this,function(z){n=null;z.stopPropagation();z.preventDefault()}));mxEvent.addListener(A,"dragover",mxUtils.bind(this,function(z){null!=n&&(z.dataTransfer.dropEffect="move");z.stopPropagation();z.preventDefault()}));mxEvent.addListener(A,"drop",mxUtils.bind(this,function(z){null!=n&&+v!=n&&this.movePage(n,v);z.stopPropagation();z.preventDefault()}));l.appendChild(A)})(d,this.createTabForPage(this.pages[d],d+1));d=null!=this.tabScroller?this.tabScroller.scrollLeft:0;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);this.tabScroller=l;this.tabScroller.scrollLeft=d;this.checkTabScrollerOverflow();mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(v){this.checkTabScrollerOverflow()}))}};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()};EditorUi.prototype.createTab=function(){var b=document.createElement("div");b.className="geTab";return b};EditorUi.prototype.getShortPageName=function(b){var l=null;null!=b&&(l=b.getName(),null!=l&&36<l.length&&(l=l.substring(0,34)+"..."));return l};EditorUi.prototype.createControlTab=function(b,l,n){var d=this.createTab();d.className="geTab geControlTab";null!=b&&d.setAttribute("title",b);b=document.createElement("div");b.className="geButton";b.style.backgroundImage="url("+l+")";d.appendChild(b);mxEvent.addListener(d,"click",n);return d};EditorUi.prototype.createPageInsertTab=function(){return this.createControlTab(mxResources.get("insertPage"),Editor.plusImage,mxUtils.bind(this,function(b){try{this.insertPage()}catch(l){this.handleError(l)}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,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 n=mxEvent.getClientX(b),d=mxEvent.getClientY(b);l.popup(n,-d,null,b);this.setCurrentMenu(l);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,l){var n=this.createTab(),d=b.getName()||mxResources.get("untitled"),x=b.getId();n.setAttribute("title",d+(null!=x?" ("+x+")":"")+" ["+l+"]");l=document.createElement("span");l.style.maxWidth="160px";l.style.textOverflow="ellipsis";l.style.overflow="hidden";mxUtils.write(l,d);n.appendChild(l);this.addTabListeners(b,n);return n};-EditorUi.prototype.addTabListeners=function(b,l){mxEvent.disableContextMenu(l);var n=this.editor.graph;mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(P){this.renamePage(b);mxEvent.consume(P)}));var d=document.createElement("div");d.style.backgroundImage="url("+Editor.thinExpandImage+")";d.className="geButton";l.appendChild(d);var x=!1,A=!1,z=mxUtils.bind(this,function(P){x=null!=this.currentMenu;A=b==this.currentPage;this.scrollToPage(b);n.isMouseDown||A||this.selectPage(b)}),D=mxUtils.bind(this,-function(P){if(!n.isMouseDown&&(A&&(mxEvent.isTouchEvent(P)||mxEvent.getSource(P)==d)||mxEvent.isPopupTrigger(P))&&(n.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(P)||!x)){var J=new mxPopupMenu(this.createPageMenu(b));J.smartSeparators=!0;J.showDisabled=!0;J.autoExpand=!0;J.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(J,arguments);this.resetCurrentMenu();J.destroy()});var L=mxEvent.getClientX(P),c=mxEvent.getClientY(P);J.popup(L,c,null,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(v,A){this.menus.get("pages").funct(v,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 n=mxEvent.getClientX(b),d=mxEvent.getClientY(b);l.popup(n,+d,null,b);this.setCurrentMenu(l);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,l){var n=this.createTab(),d=b.getName()||mxResources.get("untitled"),v=b.getId();n.setAttribute("title",d+(null!=v?" ("+v+")":"")+" ["+l+"]");l=document.createElement("span");l.style.maxWidth="160px";l.style.textOverflow="ellipsis";l.style.overflow="hidden";mxUtils.write(l,d);n.appendChild(l);this.addTabListeners(b,n);return n};+EditorUi.prototype.addTabListeners=function(b,l){mxEvent.disableContextMenu(l);var n=this.editor.graph;mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(P){this.renamePage(b);mxEvent.consume(P)}));var d=document.createElement("div");d.style.backgroundImage="url("+Editor.thinExpandImage+")";d.className="geButton";l.appendChild(d);var v=!1,A=!1,z=mxUtils.bind(this,function(P){v=null!=this.currentMenu;A=b==this.currentPage;this.scrollToPage(b);n.isMouseDown||A||this.selectPage(b)}),D=mxUtils.bind(this,+function(P){if(!n.isMouseDown&&(A&&(mxEvent.isTouchEvent(P)||mxEvent.getSource(P)==d)||mxEvent.isPopupTrigger(P))&&(n.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(P)||!v)){var J=new mxPopupMenu(this.createPageMenu(b));J.smartSeparators=!0;J.showDisabled=!0;J.autoExpand=!0;J.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(J,arguments);this.resetCurrentMenu();J.destroy()});var L=mxEvent.getClientX(P),c=mxEvent.getClientY(P);J.popup(L,c,null,P);this.setCurrentMenu(J,l)}mxEvent.consume(P)});mxEvent.addGestureListeners(d,z,null,D);mxEvent.addGestureListeners(l,z,null,D)};EditorUi.prototype.createPageMenu=function(b,l){return mxUtils.bind(this,function(n,d){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||n.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()&&(n.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",-[b.getName()]))}),d),n.addSeparator(d),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",n,d,mxResources.get("move")),n.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),d),n.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,l)}),d))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(d,x,A,z,D){x=null!=x?x:!1;null==A&&(A=this.getFoldableCells(this.getSelectionCells(),d));this.stopEditing();this.model.beginUpdate();try{for(var P=A.slice(),J=0;J<A.length;J++)"1"==mxUtils.getValue(this.getCurrentCellStyle(A[J]),"treeFolding","0")&&this.foldTreeCell(d,A[J]);A=P;A=b.apply(this,arguments)}finally{this.model.endUpdate()}return A};Graph.prototype.foldTreeCell=function(d,x){this.model.beginUpdate();try{var A=-[];this.traverse(x,!0,mxUtils.bind(this,function(D,P){var J=null!=P&&this.isTreeEdge(P);J&&A.push(P);D==x||null!=P&&!J||A.push(D);return(null==P||J)&&(D==x||!this.model.isCollapsed(D))}));this.model.setCollapsed(x,d);for(var z=0;z<A.length;z++)this.model.setVisible(A[z],!d)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(d){return!this.isEdgeIgnored(d)};Graph.prototype.getTreeEdges=function(d,x,A,z,D,P){return this.model.filterCells(this.getEdges(d,x,A,z,D,P),mxUtils.bind(this,-function(J){return this.isTreeEdge(J)}))};Graph.prototype.getIncomingTreeEdges=function(d,x){return this.getTreeEdges(d,x,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(d,x){return this.getTreeEdges(d,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 d(H){return t.isVertex(H)&&A(H)}function x(H){var g=!1;null!=H&&(g="1"==+[b.getName()]))}),d),n.addSeparator(d),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",n,d,mxResources.get("move")),n.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),d),n.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,l)}),d))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(d,v,A,z,D){v=null!=v?v:!1;null==A&&(A=this.getFoldableCells(this.getSelectionCells(),d));this.stopEditing();this.model.beginUpdate();try{for(var P=A.slice(),J=0;J<A.length;J++)"1"==mxUtils.getValue(this.getCurrentCellStyle(A[J]),"treeFolding","0")&&this.foldTreeCell(d,A[J]);A=P;A=b.apply(this,arguments)}finally{this.model.endUpdate()}return A};Graph.prototype.foldTreeCell=function(d,v){this.model.beginUpdate();try{var A=+[];this.traverse(v,!0,mxUtils.bind(this,function(D,P){var J=null!=P&&this.isTreeEdge(P);J&&A.push(P);D==v||null!=P&&!J||A.push(D);return(null==P||J)&&(D==v||!this.model.isCollapsed(D))}));this.model.setCollapsed(v,d);for(var z=0;z<A.length;z++)this.model.setVisible(A[z],!d)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(d){return!this.isEdgeIgnored(d)};Graph.prototype.getTreeEdges=function(d,v,A,z,D,P){return this.model.filterCells(this.getEdges(d,v,A,z,D,P),mxUtils.bind(this,+function(J){return this.isTreeEdge(J)}))};Graph.prototype.getIncomingTreeEdges=function(d,v){return this.getTreeEdges(d,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(d,v){return this.getTreeEdges(d,v,!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 d(H){return t.isVertex(H)&&A(H)}function v(H){var g=!1;null!=H&&(g="1"==m.getCurrentCellStyle(H).treeMoving);return g}function A(H){var g=!1;null!=H&&(H=t.getParent(H),g=m.view.getState(H),g="tree"==(null!=g?g.style:m.getCellStyle(H)).containerType);return g}function z(H){var g=!1;null!=H&&(H=t.getParent(H),g=m.view.getState(H),m.view.getState(H),g=null!=(null!=g?g.style:m.getCellStyle(H)).childLayout);return g}function D(H){H=m.view.getState(H);if(null!=H){var g=m.getIncomingTreeEdges(H.cell);if(0<g.length&&(g=m.view.getState(g[0]),null!=g&&(g=g.absolutePoints,null!=g&&0<g.length&&(g=g[g.length-1],null!=g)))){if(g.y==H.y&&Math.abs(g.x-H.getCenterX())<H.width/2)return mxConstants.DIRECTION_SOUTH;if(g.y==H.y+H.height&&Math.abs(g.x-H.getCenterX())<H.width/2)return mxConstants.DIRECTION_NORTH;if(g.x>H.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function P(H,g){g=null!=g?g:!0;m.model.beginUpdate();try{var p=m.model.getParent(H),B=m.getIncomingTreeEdges(H),K=m.cloneCells([B[0],H]);m.model.setTerminal(K[0],m.model.getTerminal(B[0],!0),!0);var M=D(H),N=p.geometry;M==mxConstants.DIRECTION_SOUTH||M==mxConstants.DIRECTION_NORTH?K[1].geometry.x+=g?H.geometry.width+10:-K[1].geometry.width-10:K[1].geometry.y+=g?H.geometry.height+10:-K[1].geometry.height-10;m.view.currentRoot!=p&&(K[1].geometry.x-=N.x,K[1].geometry.y-=N.y);var R=m.view.getState(H),T=m.view.scale;if(null!=R){var V=mxRectangle.fromRectangle(R);M==mxConstants.DIRECTION_SOUTH||M==mxConstants.DIRECTION_NORTH?V.x+=(g?H.geometry.width+10:-K[1].geometry.width-10)*T:V.y+=(g?@@ -14188,25 +14188,25 @@ try{var g=D(H),p=m.getIncomingTreeEdges(H),B=m.cloneCells([p[0],H]);m.model.setT[M[0]],K));B=m.getOutgoingTreeEdges(H);var N=p.geometry;g=[];m.view.currentRoot==p&&(N=new mxRectangle);for(var R=0;R<B.length;R++){var T=m.model.getTerminal(B[R],!1);null!=T&&g.push(T)}var V=m.view.getBounds(g),X=m.view.translate,W=m.view.scale;K==mxConstants.DIRECTION_SOUTH?(M[1].geometry.x=null==V?H.geometry.x+(H.geometry.width-M[1].geometry.width)/2:(V.x+V.width)/W-X.x-N.x+10,M[1].geometry.y+=M[1].geometry.height-N.y+40):K==mxConstants.DIRECTION_NORTH?(M[1].geometry.x=null==V?H.geometry.x+(H.geometry.width-M[1].geometry.width)/2:(V.x+V.width)/W-X.x+-N.x+10,M[1].geometry.y-=M[1].geometry.height+N.y+40):(M[1].geometry.x=K==mxConstants.DIRECTION_WEST?M[1].geometry.x-(M[1].geometry.width+N.x+40):M[1].geometry.x+(M[1].geometry.width-N.x+40),M[1].geometry.y=null==V?H.geometry.y+(H.geometry.height-M[1].geometry.height)/2:(V.y+V.height)/W-X.y+-N.y+10);return m.addCells(M,p)}finally{m.model.endUpdate()}}function c(H,g,p){H=m.getOutgoingTreeEdges(H);p=m.view.getState(p);var B=[];if(null!=p&&null!=H){for(var K=0;K<H.length;K++){var M=m.view.getState(m.model.getTerminal(H[K],!1));null!=M&&(!g&&Math.min(M.x+M.width,p.x+p.width)>=Math.max(M.x,p.x)||g&&Math.min(M.y+M.height,p.y+p.height)>=Math.max(M.y,p.y))&&B.push(M)}B.sort(function(N,R){return g?N.x+N.width-R.x-R.width:N.y+N.height-R.y-R.height})}return B}function f(H,g){var p=D(H),B=g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST;(p==mxConstants.DIRECTION_EAST||p==mxConstants.DIRECTION_WEST)==B&&p!=g?k.actions.get("selectParent").funct():p==-g?(g=m.getOutgoingTreeEdges(H),null!=g&&0<g.length&&m.setSelectionCell(m.model.getTerminal(g[0],!1))):(p=m.getIncomingTreeEdges(H),null!=p&&0<p.length&&(B=c(m.model.getTerminal(p[0],!0),B,H),H=m.view.getState(H),null!=H&&(H=mxUtils.indexOf(B,H),0<=H&&(H+=g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_WEST?-1:1,0<=H&&H<=B.length-1&&m.setSelectionCell(B[H].cell)))))}var k=this,m=k.editor.graph,t=m.getModel(),v=k.menus.createPopupMenu;k.menus.createPopupMenu=function(H,g,p){v.apply(this,arguments);+g?(g=m.getOutgoingTreeEdges(H),null!=g&&0<g.length&&m.setSelectionCell(m.model.getTerminal(g[0],!1))):(p=m.getIncomingTreeEdges(H),null!=p&&0<p.length&&(B=c(m.model.getTerminal(p[0],!0),B,H),H=m.view.getState(H),null!=H&&(H=mxUtils.indexOf(B,H),0<=H&&(H+=g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_WEST?-1:1,0<=H&&H<=B.length-1&&m.setSelectionCell(B[H].cell)))))}var k=this,m=k.editor.graph,t=m.getModel(),x=k.menus.createPopupMenu;k.menus.createPopupMenu=function(H,g,p){x.apply(this,arguments);if(1==m.getSelectionCount()){g=m.getSelectionCell();var B=m.getOutgoingTreeEdges(g);H.addSeparator();0<B.length&&(d(m.getSelectionCell())&&this.addMenuItems(H,["selectChildren"],null,p),this.addMenuItems(H,["selectDescendants"],null,p));d(m.getSelectionCell())?(H.addSeparator(),0<m.getIncomingTreeEdges(g).length&&this.addMenuItems(H,["selectSiblings","selectParent"],null,p)):0<m.model.getEdgeCount(g)&&this.addMenuItems(H,["selectConnections"],null,p)}};k.actions.addAction("selectChildren",function(H){if(m.isEnabled()&&1==m.getSelectionCount()){var g=m.getSelectionCell();H=mxEvent.isControlDown(H)?null:m.getOutgoingTreeEdges(g);if(null!=H&&0<H.length){g=[];for(var p=0;p<H.length;p++)g.push(m.model.getTerminal(H[p],!1));m.setSelectionCells(g)}else m.setSelectionCells(m.model.getChildren(g))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");k.actions.addAction("selectDescendants",function(H){var g=m.getSelectionCell();if(m.isEnabled()&&null!=g){var p=[];mxEvent.isControlDown(H)||m.traverse(g,!0,function(B,K){var M=null!=K&&m.isTreeEdge(K);M&&mxEvent.isControlDown(H)&&p.push(K);(null==K||M)&&p.push(B);return null==K||M});if(0==p.length||1==p.length&&p[0]==g)p=m.model.getDescendants(g);m.setSelectionCells(p)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");k.actions.addAction("selectParent",function(H){var g=m.getSelectionCell();m.isEnabled()&&null!=g&&(H=mxEvent.isControlDown(H)?null:m.getIncomingTreeEdges(g),null!=H&&0<H.length?m.setSelectionCell(m.model.getTerminal(H[0],!0)):m.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");k.actions.addAction("selectSiblings",function(H){if(m.isEnabled()&&1==m.getSelectionCount()){var g=m.getSelectionCell(),p=mxEvent.isControlDown(H)?null:m.getIncomingTreeEdges(g);H=[];if(null!=p&&0<p.length&&(p=m.getOutgoingTreeEdges(m.model.getTerminal(p[0],!0)),null!=p))for(var B=0;B<p.length;B++)H.push(m.model.getTerminal(p[B],!1));0==H.length&&(H=m.model.getChildren(m.model.getParent(g)));m.setSelectionCells(H)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var y=m.removeCells;m.removeCells=function(H,g){g=null!=g?g:!0;null==H&&(H=this.getDeletableCells(this.getSelectionCells()));g&&(H=this.getDeletableCells(this.addAllEdges(H)));for(var p=[],B=0;B<H.length;B++){var K=H[B];t.isEdge(K)&&A(K)&&(p.push(K),K=t.getTerminal(K,!1));if(d(K)){var M=[];m.traverse(K,!0,function(N,R){var T=null!=R&&m.isTreeEdge(R);T&&M.push(R);(null==R||T)&&M.push(N);return null==R||T});0<M.length&&(p=p.concat(M),K=m.getIncomingTreeEdges(H[B]),H=H.concat(K))}else null!=K&&p.push(H[B])}H=p;return y.apply(this,arguments)};k.hoverIcons.getStateAt=function(H,g,p){return d(H.cell)?null:this.graph.view.getState(this.graph.getCellAt(g,p))};var F=m.duplicateCells;m.duplicateCells=function(H,g){H=null!=H?H:this.getSelectionCells();for(var p=H.slice(0),B=0;B<p.length;B++){var K=m.view.getState(p[B]);if(null!=K&&d(K.cell)){var M=m.getIncomingTreeEdges(K.cell);for(K=0;K<M.length;K++)mxUtils.remove(M[K],H)}}this.model.beginUpdate();try{var N=F.call(this,H,g);if(N.length==H.length)for(B=-0;B<H.length;B++)if(d(H[B])){var R=m.getIncomingTreeEdges(N[B]);M=m.getIncomingTreeEdges(H[B]);if(0==R.length&&0<M.length){var T=this.cloneCell(M[0]);this.addEdge(T,m.getDefaultParent(),this.model.getTerminal(M[0],!0),N[B])}}}finally{this.model.endUpdate()}return N};var E=m.moveCells;m.moveCells=function(H,g,p,B,K,M,N){for(var R=null,T=[],V=0;V<H.length;V++)(x(H[V])||d(H[V]))&&!z(H[V])&&this.isCellCollapsed(H[V])?T=T.concat(this.getSubtree(H[V])):T.push(H[V]);H=mxUtils.removeDuplicates(T);this.model.beginUpdate();+0;B<H.length;B++)if(d(H[B])){var R=m.getIncomingTreeEdges(N[B]);M=m.getIncomingTreeEdges(H[B]);if(0==R.length&&0<M.length){var T=this.cloneCell(M[0]);this.addEdge(T,m.getDefaultParent(),this.model.getTerminal(M[0],!0),N[B])}}}finally{this.model.endUpdate()}return N};var E=m.moveCells;m.moveCells=function(H,g,p,B,K,M,N){for(var R=null,T=[],V=0;V<H.length;V++)(v(H[V])||d(H[V]))&&!z(H[V])&&this.isCellCollapsed(H[V])?T=T.concat(this.getSubtree(H[V])):T.push(H[V]);H=mxUtils.removeDuplicates(T);this.model.beginUpdate();try{T=K;var X=this.getCurrentCellStyle(K);if(null!=H&&d(K)&&"1"==mxUtils.getValue(X,"treeFolding","0")){for(V=0;V<H.length;V++)if(d(H[V])||m.model.isEdge(H[V])&&null==m.model.getTerminal(H[V],!0)){K=m.model.getParent(H[V]);break}if(null!=T&&K!=T&&null!=this.view.getState(H[0])){var W=m.getIncomingTreeEdges(H[0]);if(0<W.length){var Y=m.view.getState(m.model.getTerminal(W[0],!0));if(null!=Y){var Z=m.view.getState(T);null!=Z&&(g=(Z.getCenterX()-Y.getCenterX())/m.view.scale,p=(Z.getCenterY()-Y.getCenterY())/m.view.scale)}}}}R=E.apply(this,arguments);if(null!=R&&null!=H&&R.length==H.length)for(V=0;V<R.length;V++)if(this.model.isEdge(R[V]))d(T)&&0>mxUtils.indexOf(R,this.model.getTerminal(R[V],!0))&&this.model.setTerminal(R[V],T,!0);else if(d(H[V])&&(W=m.getIncomingTreeEdges(H[V]),0<W.length))if(!B)d(T)&&0>mxUtils.indexOf(H,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],T,!0);else if(0==m.getIncomingTreeEdges(R[V]).length){X=T;if(null==X||X==m.model.getParent(H[V]))X=m.model.getTerminal(W[0],!0);B=this.cloneCell(W[0]);this.addEdge(B,m.getDefaultParent(),X,R[V])}}finally{this.model.endUpdate()}return R};if(null!=k.sidebar){var C=k.sidebar.dropAndConnect;k.sidebar.dropAndConnect=function(H,g,p,B){var K=m.model,M=null;K.beginUpdate();try{if(M=C.apply(this,arguments),d(H))for(var N=0;N<M.length;N++)if(K.isEdge(M[N])&&null==K.getTerminal(M[N],!0)){K.setTerminal(M[N],H,!0);var R=m.getCellGeometry(M[N]);R.points=null;null!=R.getTerminalPoint(!0)&&R.setTerminalPoint(null,!0)}}finally{K.endUpdate()}return M}}var S={67:k.actions.get("selectChildren"),88:k.actions.get("selectDescendants"),80:k.actions.get("selectParent"),83:k.actions.get("selectSiblings")},U={67:k.actions.get("copyStyle"),86:k.actions.get("pasteStyle")},Q=k.onKeyDown;k.onKeyDown=function(H){try{var g=m.getSelectionCell();if(m.isEnabled()&&!m.isEditing()&&null!=g){var p=mxEvent.isAltDown(H)&&mxEvent.isShiftDown(H)?S[H.keyCode]:mxEvent.isAltDown(H)?U[H.keyCode]:null;null!=p?(p.funct(H),mxEvent.consume(H)):d(g)&&(p=null,0<m.getIncomingTreeEdges(g).length&&(9==H.which?p=mxEvent.isShiftDown(H)?J(g):L(g):13==H.which&&(p=P(g,!mxEvent.isShiftDown(H)))),null!=p&&0<p.length?(1==p.length&&m.model.isEdge(p[0])?m.setSelectionCell(m.model.getTerminal(p[0],!1)):m.setSelectionCell(p[p.length-1]),null!=k.hoverIcons&&k.hoverIcons.update(m.view.getState(g)),m.startEditingAtCell(g),mxEvent.consume(H)):37==H.keyCode?(f(g,mxConstants.DIRECTION_WEST),mxEvent.consume(H)):38==H.keyCode?(f(g,mxConstants.DIRECTION_NORTH),mxEvent.consume(H)):39==H.keyCode?(f(g,mxConstants.DIRECTION_EAST),mxEvent.consume(H)):40==H.keyCode&&(f(g,mxConstants.DIRECTION_SOUTH),mxEvent.consume(H)))}}catch(B){k.handleError(B)}mxEvent.isConsumed(H)||Q.apply(this,arguments)};var O=m.connectVertex;m.connectVertex=function(H,g,p,B,K,M,N){var R=m.getIncomingTreeEdges(H);if(d(H)){var T=D(H),V=T==mxConstants.DIRECTION_EAST||T==mxConstants.DIRECTION_WEST,X=g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST;return T==g||0==R.length?L(H,g):V==X?J(H):P(H,g!=mxConstants.DIRECTION_NORTH&&g!=mxConstants.DIRECTION_WEST)}return O.apply(this,-arguments)};m.getSubtree=function(H){var g=[H];!x(H)&&!d(H)||z(H)||m.traverse(H,!0,function(p,B){var K=null!=B&&m.isTreeEdge(B);K&&0>mxUtils.indexOf(g,B)&&g.push(B);(null==B||K)&&0>mxUtils.indexOf(g,p)&&g.push(p);return null==B||K});return g};var q=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){q.apply(this,arguments);(x(this.state.cell)||d(this.state.cell))&&!z(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?+arguments)};m.getSubtree=function(H){var g=[H];!v(H)&&!d(H)||z(H)||m.traverse(H,!0,function(p,B){var K=null!=B&&m.isTreeEdge(B);K&&0>mxUtils.indexOf(g,B)&&g.push(B);(null==B||K)&&0>mxUtils.indexOf(g,p)&&g.push(p);return null==B||K});return g};var q=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){q.apply(this,arguments);(v(this.state.cell)||d(this.state.cell))&&!z(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(H){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(H),mxEvent.getClientY(H),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(H);this.graph.isMouseDown=!0;k.hoverIcons.reset();mxEvent.consume(H)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var u=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){u.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var I=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(H){I.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=H?"":"none")};var G=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(H,g){G.apply(this,-arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var n=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var d=n.apply(this,arguments),x=this.graph,A=this;return d.concat([this.addEntry("tree container",function(){var z=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");z.vertex=!0;var D=new mxCell("Parent",+arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var n=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var d=n.apply(this,arguments),v=this.graph,A=this;return d.concat([this.addEntry("tree container",function(){var z=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");z.vertex=!0;var D=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');D.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 J=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");J.geometry.relative=!0;J.edge=!0;D.insertEdge(J,!0);P.insertEdge(J,!1);z.insert(J);z.insert(D);z.insert(P);return A.createVertexTemplateFromCells([z],z.geometry.width,z.geometry.height,z.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var z=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");z.vertex=!0;var D=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};');D.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 J=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");@@ -14218,9 +14218,9 @@ z.vertex=!0;return A.createVertexTemplateFromCells([z],z.geometry.width,z.geometz.vertex=!0;var D=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");D.geometry.setTerminalPoint(new mxPoint(-40,40),!0);D.geometry.relative=!0;D.edge=!0;z.insertEdge(D,!1);return A.createVertexTemplateFromCells([z,D],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 D=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");D.geometry.setTerminalPoint(new mxPoint(-40,40),!0);D.geometry.relative=!0;D.edge=!0;z.insertEdge(D,!1);return A.createVertexTemplateFromCells([z,D],z.geometry.width,z.geometry.height,z.value)}),this.addEntry("tree orgchart organization division",function(){var z=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');z.vertex=!0;var D=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(D,"treeRoot","1");D.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 J=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(D,"treeRoot","1");D.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 J=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");J.geometry.relative=!0;J.edge=!0;D.insertEdge(J,!0);P.insertEdge(J,!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 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.relative=-!0;c.edge=!0;D.insertEdge(c,!0);L.insertEdge(c,!1);z.insert(J);z.insert(c);z.insert(D);z.insert(P);z.insert(L);return A.createVertexTemplateFromCells([z],z.geometry.width,z.geometry.height,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 A.createVertexTemplateFromCells([z],+!0;c.edge=!0;D.insertEdge(c,!0);L.insertEdge(c,!1);z.insert(J);z.insert(c);z.insert(D);z.insert(P);z.insert(L);return A.createVertexTemplateFromCells([z],z.geometry.width,z.geometry.height,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"};');v.setAttributeForCell(z,"treeRoot","1");z.vertex=!0;return A.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 D=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");D.geometry.setTerminalPoint(new mxPoint(0,0),!0);D.geometry.relative=!0;D.edge=!0;z.insertEdge(D,!1);return A.createVertexTemplateFromCells([z,D],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 D=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;");D.geometry.setTerminalPoint(new mxPoint(110,-40),!0);D.geometry.relative=!0;D.edge=!0;z.insertEdge(D,!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 J=new mxCell("",new mxGeometry(0,0,0,0),D.style);J.geometry.setTerminalPoint(new mxPoint(110,-40),!0);J.geometry.relative=!0;J.edge=!0;P.insertEdge(J,!1);return A.createVertexTemplateFromCells([D,J,z,P],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;@@ -14231,60 +14231,60 @@ J.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){J.s"none",J.sidebarElt.style.width="210px",J.sidebarElt.style.borderRight="1px solid gray"),L=J.diagramContainer.parentNode,null!=J.sidebarElt.parentNode?(J.sidebarElt.parentNode.removeChild(J.sidebarElt),L.style.left="0px"):(L.parentNode.appendChild(J.sidebarElt),L.style.left=J.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var n=0;try{n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(J){}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 x=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(J,L){null!=L.shortcut&&900>n&&!mxClient.IS_IOS?J.firstChild.nextSibling.setAttribute("title",L.shortcut):x.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 v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(J,L){null!=L.shortcut&&900>n&&!mxClient.IS_IOS?J.firstChild.nextSibling.setAttribute("title",L.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(J){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=J?J:!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 z=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(J){z.apply(this,arguments);if(J){var L=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=L&&null!=this.sidebarWindow&&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(J){var L=this.editor.graph,c=document.createElement("div");c.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(f,k){0<L.getSelectionCount()?(J.appendChild(c),c.innerHTML="Selected: "+L.getSelectionCount()):null!=c.parentNode&&c.parentNode.removeChild(c)}))};var D=!1;EditorUi.prototype.initFormatWindow=function(){if(!D&&null!=this.formatWindow){D=!0;var J=this.formatWindow.window.toggleMinimized,L=240;this.formatWindow.window.toggleMinimized=function(){J.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(c){mxEvent.getSource(c)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var P=EditorUi.prototype.init;EditorUi.prototype.init=function(){function J(B,K,M){var N=m.menus.get(B);K=y.addMenu(mxResources.get(B),mxUtils.bind(this,function(){N.funct.apply(this,arguments)}));K.className="geButton";K.setAttribute("title",mxResources.get(B));m.menus.menuCreated(N,K,"geButton");null!=M&&-(K.style.backgroundImage="url("+M+")",K.innerText="");return K}function L(B,K,M,N,R,T){var V=document.createElement("a");V.className="geButton";v.appendChild(V);null!=T?V.style.backgroundImage="url("+T+")":mxUtils.write(V,B);mxEvent.addListener(V,"click",function(X){"disabled"!=V.getAttribute("disabled")&&K(X);mxEvent.consume(X)});mxEvent.preventDefault(V);null!=N&&V.setAttribute("title",N);null!=R&&(B=function(){R.isEnabled()?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},R.addListener("stateChanged",-B),t.addListener("enabledChanged",B),B());return V}function c(B,K,M){K=document.createElement("div");K.className="geButtonGroup";for(M=0;M<B.length;M++)null!=B[M]&&K.appendChild(B[M]);v.appendChild(K);return K}function f(){n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;v.innerHTML="";var B=1E3>n,K=J("diagram",null,B?Editor.menuImage:null);c([K,L(mxResources.get("shapes"),m.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),m.actions.get("image"),+(K.style.backgroundImage="url("+M+")",K.innerText="");return K}function L(B,K,M,N,R,T){var V=document.createElement("a");V.className="geButton";x.appendChild(V);null!=T?V.style.backgroundImage="url("+T+")":mxUtils.write(V,B);mxEvent.addListener(V,"click",function(X){"disabled"!=V.getAttribute("disabled")&&K(X);mxEvent.consume(X)});mxEvent.preventDefault(V);null!=N&&V.setAttribute("title",N);null!=R&&(B=function(){R.isEnabled()?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},R.addListener("stateChanged",+B),t.addListener("enabledChanged",B),B());return V}function c(B,K,M){K=document.createElement("div");K.className="geButtonGroup";for(M=0;M<B.length;M++)null!=B[M]&&K.appendChild(B[M]);x.appendChild(K);return K}function f(){n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;x.innerHTML="";var B=1E3>n,K=J("diagram",null,B?Editor.menuImage:null);c([K,L(mxResources.get("shapes"),m.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),m.actions.get("image"),B?Editor.shapesImage:null),L(mxResources.get("format"),m.actions.get("format").funct,null,mxResources.get("format")+" ("+m.actions.get("format").shortcut+")",m.actions.get("image"),B?Editor.formatImage:null)]);K=J("insert",!0,B?U:null);c([K,L(mxResources.get("delete"),m.actions.get("delete").funct,null,mxResources.get("delete"),m.actions.get("delete"),B?Editor.trashImage:null)]);t.isEnabled()||K.setAttribute("disabled","disabled");H.setAttribute("title",mxResources.get("undo")+" ("+I.shortcut+")");-g.setAttribute("title",mxResources.get("redo")+" ("+G.shortcut+")");p.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=n&&(c([H,g]),520<=n&&c([p,640<=n?L("",q.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",q,Editor.zoomInImage):null,640<=n?L("",u.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",u,Editor.zoomOutImage):null]));v.appendChild(m.statusContainer);v.appendChild(m.buttonContainer)}P.apply(this,arguments);var k=mxUtils.isAncestorNode(document.body,+g.setAttribute("title",mxResources.get("redo")+" ("+G.shortcut+")");p.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=n&&(c([H,g]),520<=n&&c([p,640<=n?L("",q.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",q,Editor.zoomInImage):null,640<=n?L("",u.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",u,Editor.zoomOutImage):null]));x.appendChild(m.statusContainer);x.appendChild(m.buttonContainer)}P.apply(this,arguments);var k=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=k&&(k.classList.add("geSimple"),k.classList.add("geMinimal"),k.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);if(1E3<=n||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"));EditorUi.windowed&&-1E3<=n&&(b(this,!0),this.formatWindow.window.setVisible(!0));var m=this,t=m.editor.graph;m.toolbar=this.createToolbar(m.createDiv("geToolbar"));var v=document.createElement("div");v.className="geMenubarContainer";var y=new Menubar(m,v),F=m.hideCurrentMenu;m.hideCurrentMenu=function(){F.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var E=m.descriptorChanged;m.descriptorChanged=function(){E.apply(this,arguments);var B=m.getCurrentFile();if(null!=B&&null!=B.getTitle()){var K=B.getMode();-"google"==K?K="googleDrive":"github"==K?K="gitHub":"gitlab"==K?K="gitLab":"onedrive"==K&&(K="oneDrive");K=mxResources.get(K);v.setAttribute("title",B.getTitle()+(null!=K?" ("+K+")":""))}else v.removeAttribute("title")};m.setStatusText(m.editor.getStatus());v.appendChild(m.statusContainer);m.buttonContainer=this.createButtonContainer();v.appendChild(m.buttonContainer);m.menubarContainer=m.buttonContainer;m.tabContainer=this.createTabContainer();var C=this.createZoomInput(!0),S=m.updateTabContainer;+1E3<=n&&(b(this,!0),this.formatWindow.window.setVisible(!0));var m=this,t=m.editor.graph;m.toolbar=this.createToolbar(m.createDiv("geToolbar"));var x=document.createElement("div");x.className="geMenubarContainer";var y=new Menubar(m,x),F=m.hideCurrentMenu;m.hideCurrentMenu=function(){F.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var E=m.descriptorChanged;m.descriptorChanged=function(){E.apply(this,arguments);var B=m.getCurrentFile();if(null!=B&&null!=B.getTitle()){var K=B.getMode();+"google"==K?K="googleDrive":"github"==K?K="gitHub":"gitlab"==K?K="gitLab":"onedrive"==K&&(K="oneDrive");K=mxResources.get(K);x.setAttribute("title",B.getTitle()+(null!=K?" ("+K+")":""))}else x.removeAttribute("title")};m.setStatusText(m.editor.getStatus());x.appendChild(m.statusContainer);m.buttonContainer=this.createButtonContainer();x.appendChild(m.buttonContainer);m.menubarContainer=m.buttonContainer;m.tabContainer=this.createTabContainer();var C=this.createZoomInput(!0),S=m.updateTabContainer;m.updateTabContainer=function(){S.apply(this,arguments);m.tabContainer.appendChild(C)};var U=Editor.addBoxImage;if(null!=m.hoverIcons){var Q=m.hoverIcons.update;m.hoverIcons.update=function(){t.freehand.isDrawing()||Q.apply(this,arguments)}}if(null!=t.freehand){var O=t.freehand.createStyle;t.freehand.createStyle=function(B){return O.apply(this,arguments)+"sketch=0;"}}m.editor.addListener("statusChanged",mxUtils.bind(this,function(){m.setStatusText(m.editor.getStatus())}));m.setStatusText(m.editor.getStatus());var q=m.actions.get("zoomIn"),u=m.actions.get("zoomOut");k=m.actions.get("resetView");var I=m.actions.get("undo"),G=m.actions.get("redo"),H=L("",I.funct,null,"",I,Editor.undoImage),g=L("",G.funct,null,"",G,Editor.redoImage),p=L("",function(B){mxEvent.isAltDown(B)?(m.hideCurrentMenu(),m.actions.get("customZoom").funct()):(m.hideCurrentMenu(),m.actions.get("smartFit").funct());mxEvent.consume(B)},!0,"",k,Editor.zoomFitImage);m.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){l(m,null)});-m.container.appendChild(m.tabContainer);m.container.appendChild(v);m.updateTabContainer();!EditorUi.windowed&&1E3<=n&&b(this,!0);f();m.addListener("lockedChanged",f);m.addListener("languageChanged",f);m.editor.graph.addListener("enabledChanged",f);mxEvent.addListener(window,"resize",function(){f();null!=m.sidebarWindow&&m.sidebarWindow.window.fit();null!=m.formatWindow&&m.formatWindow.window.fit();null!=m.actions.outlineWindow&&m.actions.outlineWindow.window.fit();null!=m.actions.layersWindow&&m.actions.layersWindow.window.fit();-null!=m.menus.chatWindow&&m.menus.chatWindow.window.fit();null!=m.menus.tagsWindow&&m.menus.tagsWindow.window.fit();null!=m.menus.findWindow&&m.menus.findWindow.window.fit();null!=m.menus.findReplaceWindow&&m.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(d,x,A,z){var D=x.y,P=x.x,J=!1,L=!1;if(null!=this.states&&null!=d&&null!=x){var c=this,f=new mxCellState,k=this.graph.getView().scale,m=Math.max(2,this.getGuideTolerance()/2);f.x=d.x+P;f.y=d.y+D;f.width=d.width;f.height=d.height;for(var t=[],v=[],y=0;y<this.states.length;y++){var F=this.states[y];F instanceof mxCellState&&(z||!this.graph.isCellSelected(F.cell))&&((f.x>=F.x&&f.x<=F.x+F.width||F.x>=f.x&&F.x<=f.x+f.width)&&(f.y>-F.y+F.height+4||f.y+f.height+4<F.y)?t.push(F):(f.y>=F.y&&f.y<=F.y+F.height||F.y>=f.y&&F.y<=f.y+f.height)&&(f.x>F.x+F.width+4||f.x+f.width+4<F.x)&&v.push(F))}var E=0,C=0,S=F=0,U=0,Q=0,O=0,q=0,u=5*k;if(1<t.length){t.push(f);t.sort(function(g,p){return g.y-p.y});var I=!1;y=f==t[0];k=f==t[t.length-1];if(!y&&!k)for(y=1;y<t.length-1;y++)if(f==t[y]){k=t[y-1];y=t[y+1];F=C=S=(y.y-k.y-k.height-f.height)/2;break}for(y=0;y<t.length-1;y++){k=t[y];var G=t[y+1],H=f==k||f==G;G=G.y-k.y-k.height;I|=f==k;if(0==C&&0==-E)C=G,E=1;else if(Math.abs(C-G)<=(H||1==y&&I?m:0))E+=1;else if(1<E&&I){t=t.slice(0,y+1);break}else if(3<=t.length-y&&!I)E=0,F=C=0!=S?S:0,t.splice(0,0==y?1:y),y=-1;else break;0!=F||H||(C=F=G)}3==t.length&&t[1]==f&&(F=0)}if(1<v.length){v.push(f);v.sort(function(g,p){return g.x-p.x});I=!1;y=f==v[0];k=f==v[v.length-1];if(!y&&!k)for(y=1;y<v.length-1;y++)if(f==v[y]){k=v[y-1];y=v[y+1];O=Q=q=(y.x-k.x-k.width-f.width)/2;break}for(y=0;y<v.length-1;y++){k=v[y];G=v[y+1];H=f==k||f==G;G=G.x-k.x-k.width;I|=f==k;-if(0==Q&&0==U)Q=G,U=1;else if(Math.abs(Q-G)<=(H||1==y&&I?m:0))U+=1;else if(1<U&&I){v=v.slice(0,y+1);break}else if(3<=v.length-y&&!I)U=0,O=Q=0!=q?q:0,v.splice(0,0==y?1:y),y=-1;else break;0!=O||H||(Q=O=G)}3==v.length&&v[1]==f&&(O=0)}m=function(g,p,B,K){var M=[];if(K){K=u;var N=0}else K=0,N=u;M.push(new mxPoint(g.x-K,g.y-N));M.push(new mxPoint(g.x+K,g.y+N));M.push(g);M.push(p);M.push(new mxPoint(p.x-K,p.y-N));M.push(new mxPoint(p.x+K,p.y+N));if(null!=B)return B.points=M,B;g=new mxPolyline(M,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);g.dialect=mxConstants.DIALECT_SVG;g.pointerEvents=!1;g.init(c.graph.getView().getOverlayPane());return g};Q=function(g,p){if(g&&null!=c.guidesArrHor)for(g=0;g<c.guidesArrHor.length;g++)c.guidesArrHor[g].node.style.visibility="hidden";if(p&&null!=c.guidesArrVer)for(g=0;g<c.guidesArrVer.length;g++)c.guidesArrVer[g].node.style.visibility="hidden"};if(1<U&&U==v.length-1){U=[];q=c.guidesArrHor;J=[];P=0;y=v[0]==f?1:0;I=v[y].y+v[y].height;if(0<O)for(y=0;y<v.length-1;y++)k=-v[y],G=v[y+1],f==k?(P=G.x-k.width-O,J.push(new mxPoint(P+k.width+u,I)),J.push(new mxPoint(G.x-u,I))):f==G?(J.push(new mxPoint(k.x+k.width+u,I)),P=k.x+k.width+O,J.push(new mxPoint(P-u,I))):(J.push(new mxPoint(k.x+k.width+u,I)),J.push(new mxPoint(G.x-u,I)));else k=v[0],y=v[2],P=k.x+k.width+(y.x-k.x-k.width-f.width)/2,J.push(new mxPoint(k.x+k.width+u,I)),J.push(new mxPoint(P-u,I)),J.push(new mxPoint(P+f.width+u,I)),J.push(new mxPoint(y.x-u,I));for(y=0;y<J.length;y+=2)v=J[y],O=J[y+1],v=m(v,O,null!=q?-q[y/2]:null),v.node.style.visibility="visible",v.redraw(),U.push(v);for(y=J.length/2;null!=q&&y<q.length;y++)q[y].destroy();c.guidesArrHor=U;P-=d.x;J=!0}else Q(!0);if(1<E&&E==t.length-1){U=[];q=c.guidesArrVer;L=[];D=0;y=t[0]==f?1:0;E=t[y].x+t[y].width;if(0<F)for(y=0;y<t.length-1;y++)k=t[y],G=t[y+1],f==k?(D=G.y-k.height-F,L.push(new mxPoint(E,D+k.height+u)),L.push(new mxPoint(E,G.y-u))):f==G?(L.push(new mxPoint(E,k.y+k.height+u)),D=k.y+k.height+F,L.push(new mxPoint(E,D-u))):(L.push(new mxPoint(E,k.y+-k.height+u)),L.push(new mxPoint(E,G.y-u)));else k=t[0],y=t[2],D=k.y+k.height+(y.y-k.y-k.height-f.height)/2,L.push(new mxPoint(E,k.y+k.height+u)),L.push(new mxPoint(E,D-u)),L.push(new mxPoint(E,D+f.height+u)),L.push(new mxPoint(E,y.y-u));for(y=0;y<L.length;y+=2)v=L[y],O=L[y+1],v=m(v,O,null!=q?q[y/2]:null,!0),v.node.style.visibility="visible",v.redraw(),U.push(v);for(y=L.length/2;null!=q&&y<q.length;y++)q[y].destroy();c.guidesArrVer=U;D-=d.y;L=!0}else Q(!1,!0)}if(J||L)return f=new mxPoint(P,D),t=b.call(this,-d,f,A,z),J&&!L?f.y=t.y:L&&!J&&(f.x=t.x),t.y!=f.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),t.x!=f.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),f;Q(!0,!0);return b.apply(this,arguments)};var l=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(d){l.call(this,d);var x=this.guidesArrVer,A=this.guidesArrHor;if(null!=x)for(var z=0;z<x.length;z++)x[z].node.style.visibility=d?"visible":"hidden";if(null!=-A)for(z=0;z<A.length;z++)A[z].node.style.visibility=d?"visible":"hidden"};var n=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){n.call(this);var d=this.guidesArrVer,x=this.guidesArrHor;if(null!=d){for(var A=0;A<d.length;A++)d[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,n,d){function x(){var E=b.getDiagramContainerOffset(),C=b.diagramContainer;c.style.top=C.offsetTop-E.y+"px";c.style.left=C.offsetLeft-E.x+"px";c.style.width=(n?0:C.offsetWidth)+P+"px";c.style.height=(n?C.offsetHeight:0)+P+"px"}function A(E,C,S){if(null!=z)return E;var U;return function(){var Q=this,O=arguments,q=S&&!U;clearTimeout(U);U=setTimeout(function(){U=null;S||E.apply(Q,O)},C);q&&E.apply(Q,O)}}var z=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||+m.container.appendChild(m.tabContainer);m.container.appendChild(x);m.updateTabContainer();!EditorUi.windowed&&1E3<=n&&b(this,!0);f();m.addListener("lockedChanged",f);m.addListener("languageChanged",f);m.editor.graph.addListener("enabledChanged",f);mxEvent.addListener(window,"resize",function(){f();null!=m.sidebarWindow&&m.sidebarWindow.window.fit();null!=m.formatWindow&&m.formatWindow.window.fit();null!=m.actions.outlineWindow&&m.actions.outlineWindow.window.fit();null!=m.actions.layersWindow&&m.actions.layersWindow.window.fit();+null!=m.menus.chatWindow&&m.menus.chatWindow.window.fit();null!=m.menus.tagsWindow&&m.menus.tagsWindow.window.fit();null!=m.menus.findWindow&&m.menus.findWindow.window.fit();null!=m.menus.findReplaceWindow&&m.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(d,v,A,z){var D=v.y,P=v.x,J=!1,L=!1;if(null!=this.states&&null!=d&&null!=v){var c=this,f=new mxCellState,k=this.graph.getView().scale,m=Math.max(2,this.getGuideTolerance()/2);f.x=d.x+P;f.y=d.y+D;f.width=d.width;f.height=d.height;for(var t=[],x=[],y=0;y<this.states.length;y++){var F=this.states[y];F instanceof mxCellState&&(z||!this.graph.isCellSelected(F.cell))&&((f.x>=F.x&&f.x<=F.x+F.width||F.x>=f.x&&F.x<=f.x+f.width)&&(f.y>+F.y+F.height+4||f.y+f.height+4<F.y)?t.push(F):(f.y>=F.y&&f.y<=F.y+F.height||F.y>=f.y&&F.y<=f.y+f.height)&&(f.x>F.x+F.width+4||f.x+f.width+4<F.x)&&x.push(F))}var E=0,C=0,S=F=0,U=0,Q=0,O=0,q=0,u=5*k;if(1<t.length){t.push(f);t.sort(function(g,p){return g.y-p.y});var I=!1;y=f==t[0];k=f==t[t.length-1];if(!y&&!k)for(y=1;y<t.length-1;y++)if(f==t[y]){k=t[y-1];y=t[y+1];F=C=S=(y.y-k.y-k.height-f.height)/2;break}for(y=0;y<t.length-1;y++){k=t[y];var G=t[y+1],H=f==k||f==G;G=G.y-k.y-k.height;I|=f==k;if(0==C&&0==+E)C=G,E=1;else if(Math.abs(C-G)<=(H||1==y&&I?m:0))E+=1;else if(1<E&&I){t=t.slice(0,y+1);break}else if(3<=t.length-y&&!I)E=0,F=C=0!=S?S:0,t.splice(0,0==y?1:y),y=-1;else break;0!=F||H||(C=F=G)}3==t.length&&t[1]==f&&(F=0)}if(1<x.length){x.push(f);x.sort(function(g,p){return g.x-p.x});I=!1;y=f==x[0];k=f==x[x.length-1];if(!y&&!k)for(y=1;y<x.length-1;y++)if(f==x[y]){k=x[y-1];y=x[y+1];O=Q=q=(y.x-k.x-k.width-f.width)/2;break}for(y=0;y<x.length-1;y++){k=x[y];G=x[y+1];H=f==k||f==G;G=G.x-k.x-k.width;I|=f==k;+if(0==Q&&0==U)Q=G,U=1;else if(Math.abs(Q-G)<=(H||1==y&&I?m:0))U+=1;else if(1<U&&I){x=x.slice(0,y+1);break}else if(3<=x.length-y&&!I)U=0,O=Q=0!=q?q:0,x.splice(0,0==y?1:y),y=-1;else break;0!=O||H||(Q=O=G)}3==x.length&&x[1]==f&&(O=0)}m=function(g,p,B,K){var M=[];if(K){K=u;var N=0}else K=0,N=u;M.push(new mxPoint(g.x-K,g.y-N));M.push(new mxPoint(g.x+K,g.y+N));M.push(g);M.push(p);M.push(new mxPoint(p.x-K,p.y-N));M.push(new mxPoint(p.x+K,p.y+N));if(null!=B)return B.points=M,B;g=new mxPolyline(M,mxConstants.GUIDE_COLOR,+mxConstants.GUIDE_STROKEWIDTH);g.dialect=mxConstants.DIALECT_SVG;g.pointerEvents=!1;g.init(c.graph.getView().getOverlayPane());return g};Q=function(g,p){if(g&&null!=c.guidesArrHor)for(g=0;g<c.guidesArrHor.length;g++)c.guidesArrHor[g].node.style.visibility="hidden";if(p&&null!=c.guidesArrVer)for(g=0;g<c.guidesArrVer.length;g++)c.guidesArrVer[g].node.style.visibility="hidden"};if(1<U&&U==x.length-1){U=[];q=c.guidesArrHor;J=[];P=0;y=x[0]==f?1:0;I=x[y].y+x[y].height;if(0<O)for(y=0;y<x.length-1;y++)k=+x[y],G=x[y+1],f==k?(P=G.x-k.width-O,J.push(new mxPoint(P+k.width+u,I)),J.push(new mxPoint(G.x-u,I))):f==G?(J.push(new mxPoint(k.x+k.width+u,I)),P=k.x+k.width+O,J.push(new mxPoint(P-u,I))):(J.push(new mxPoint(k.x+k.width+u,I)),J.push(new mxPoint(G.x-u,I)));else k=x[0],y=x[2],P=k.x+k.width+(y.x-k.x-k.width-f.width)/2,J.push(new mxPoint(k.x+k.width+u,I)),J.push(new mxPoint(P-u,I)),J.push(new mxPoint(P+f.width+u,I)),J.push(new mxPoint(y.x-u,I));for(y=0;y<J.length;y+=2)x=J[y],O=J[y+1],x=m(x,O,null!=q?+q[y/2]:null),x.node.style.visibility="visible",x.redraw(),U.push(x);for(y=J.length/2;null!=q&&y<q.length;y++)q[y].destroy();c.guidesArrHor=U;P-=d.x;J=!0}else Q(!0);if(1<E&&E==t.length-1){U=[];q=c.guidesArrVer;L=[];D=0;y=t[0]==f?1:0;E=t[y].x+t[y].width;if(0<F)for(y=0;y<t.length-1;y++)k=t[y],G=t[y+1],f==k?(D=G.y-k.height-F,L.push(new mxPoint(E,D+k.height+u)),L.push(new mxPoint(E,G.y-u))):f==G?(L.push(new mxPoint(E,k.y+k.height+u)),D=k.y+k.height+F,L.push(new mxPoint(E,D-u))):(L.push(new mxPoint(E,k.y++k.height+u)),L.push(new mxPoint(E,G.y-u)));else k=t[0],y=t[2],D=k.y+k.height+(y.y-k.y-k.height-f.height)/2,L.push(new mxPoint(E,k.y+k.height+u)),L.push(new mxPoint(E,D-u)),L.push(new mxPoint(E,D+f.height+u)),L.push(new mxPoint(E,y.y-u));for(y=0;y<L.length;y+=2)x=L[y],O=L[y+1],x=m(x,O,null!=q?q[y/2]:null,!0),x.node.style.visibility="visible",x.redraw(),U.push(x);for(y=L.length/2;null!=q&&y<q.length;y++)q[y].destroy();c.guidesArrVer=U;D-=d.y;L=!0}else Q(!1,!0)}if(J||L)return f=new mxPoint(P,D),t=b.call(this,+d,f,A,z),J&&!L?f.y=t.y:L&&!J&&(f.x=t.x),t.y!=f.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),t.x!=f.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),f;Q(!0,!0);return b.apply(this,arguments)};var l=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(d){l.call(this,d);var v=this.guidesArrVer,A=this.guidesArrHor;if(null!=v)for(var z=0;z<v.length;z++)v[z].node.style.visibility=d?"visible":"hidden";if(null!=+A)for(z=0;z<A.length;z++)A[z].node.style.visibility=d?"visible":"hidden"};var n=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){n.call(this);var d=this.guidesArrVer,v=this.guidesArrHor;if(null!=d){for(var A=0;A<d.length;A++)d[A].destroy();this.guidesArrVer=null}if(null!=v){for(A=0;A<v.length;A++)v[A].destroy();this.guidesArrHor=null}}})();function mxRuler(b,l,n,d){function v(){var E=b.getDiagramContainerOffset(),C=b.diagramContainer;c.style.top=C.offsetTop-E.y+"px";c.style.left=C.offsetLeft-E.x+"px";c.style.width=(n?0:C.offsetWidth)+P+"px";c.style.height=(n?C.offsetHeight:0)+P+"px"}function A(E,C,S){if(null!=z)return E;var U;return function(){var Q=this,O=arguments,q=S&&!U;clearTimeout(U);U=setTimeout(function(){U=null;S||E.apply(Q,O)},C);q&&E.apply(Q,O)}}var z=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,D=window.cancelAnimationFrame||window.mozCancelAnimationFrame,P=this.RULER_THICKNESS,J=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"},c=document.createElement("div");c.className="geRuler";c.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"};c.style[n?"borderRight":"borderBottom"]="0.5px solid "+L.strokeClr;c.style.borderLeft="0.5px solid "+L.strokeClr});this.updateStyle();b.diagramContainer.appendChild(c);mxEvent.disableContextMenu(c);this.editorUiRefresh=b.refresh;b.refresh=function(E){J.editorUiRefresh.apply(b,-arguments);x()};x();var f=document.createElement("canvas");f.width=c.offsetWidth;f.height=c.offsetHeight;c.style.overflow="hidden";f.style.position="relative";c.appendChild(f);var k=f.getContext("2d");this.ui=b;var m=b.editor.graph;this.graph=m;this.container=c;this.canvas=f;var t=function(E,C,S,U,Q){E=Math.round(E);C=Math.round(C);S=Math.round(S);U=Math.round(U);k.beginPath();k.moveTo(E+.5,C+.5);k.lineTo(S+.5,U+.5);k.stroke();Q&&(n?(k.save(),k.translate(E,C),k.rotate(-Math.PI/2),k.fillText(Q,0,0),-k.restore()):k.fillText(Q,E,C))},v=function(){k.clearRect(0,0,f.width,f.height);k.beginPath();k.lineWidth=.7;k.strokeStyle=L.strokeClr;k.setLineDash([]);k.font="9px Arial";k.textAlign="center";var E=m.view.scale,C=m.view.getBackgroundPageBounds(),S=m.view.translate,U=m.pageVisible;S=U?P+(n?C.y-m.container.scrollTop:C.x-m.container.scrollLeft):P+(n?S.y*E-m.container.scrollTop:S.x*E-m.container.scrollLeft);var Q=0;U&&(Q=m.getPageLayout(),Q=n?Q.y*m.pageFormat.height:Q.x*m.pageFormat.width);var O;switch(J.unit){case mxConstants.POINTS:var q=+arguments);v()};v();var f=document.createElement("canvas");f.width=c.offsetWidth;f.height=c.offsetHeight;c.style.overflow="hidden";f.style.position="relative";c.appendChild(f);var k=f.getContext("2d");this.ui=b;var m=b.editor.graph;this.graph=m;this.container=c;this.canvas=f;var t=function(E,C,S,U,Q){E=Math.round(E);C=Math.round(C);S=Math.round(S);U=Math.round(U);k.beginPath();k.moveTo(E+.5,C+.5);k.lineTo(S+.5,U+.5);k.stroke();Q&&(n?(k.save(),k.translate(E,C),k.rotate(-Math.PI/2),k.fillText(Q,0,0),+k.restore()):k.fillText(Q,E,C))},x=function(){k.clearRect(0,0,f.width,f.height);k.beginPath();k.lineWidth=.7;k.strokeStyle=L.strokeClr;k.setLineDash([]);k.font="9px Arial";k.textAlign="center";var E=m.view.scale,C=m.view.getBackgroundPageBounds(),S=m.view.translate,U=m.pageVisible;S=U?P+(n?C.y-m.container.scrollTop:C.x-m.container.scrollLeft):P+(n?S.y*E-m.container.scrollTop:S.x*E-m.container.scrollLeft);var Q=0;U&&(Q=m.getPageLayout(),Q=n?Q.y*m.pageFormat.height:Q.x*m.pageFormat.width);var O;switch(J.unit){case mxConstants.POINTS:var q=O=10;var u=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:O=10;q=mxConstants.PIXELS_PER_MM;u=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:O=20;q=mxConstants.PIXELS_PER_MM;u=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:O=.5>=E||4<=E?8:16,q=mxConstants.PIXELS_PER_INCH/O,u=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var I=q;2<=E?I=q/(2*Math.floor(E/2)):.5>=E&&(I=q*Math.floor(1/E/2)*(J.unit==mxConstants.MILLIMETERS?2:1));q=null;C=U?Math.min(S+(n?C.height:C.width),n?f.height:f.width):n?f.height:f.width;if(U)if(k.fillStyle=L.outBkgClr,n){var G=S-P;0<G&&k.fillRect(0,P,P,G);C<f.height&&k.fillRect(0,C,P,f.height)}else G=S-P,0<G&&k.fillRect(P,0,G,P),C<f.width&&k.fillRect(C,0,f.width,P);k.fillStyle=L.fontClr;for(U=U?S:S%(I*E);U<=C;U+=I*E)if(G=Math.round((U-S)/E/I),!(U<P||G==q)){q=G;var H=null;0==G%O&&(H=J.formatText(Q+G*I)+"");n?t(P-u[Math.abs(G)%O],U,P,U,H):t(U,P-u[Math.abs(G)%O],U,P,H)}k.lineWidth=1;t(n?0:P,n?P:0,P,P);k.fillStyle=L.cornerClr;k.fillRect(0,0,P,P)},-y=-1,F=function(){null!=z?(null!=D&&D(y),y=z(v)):v()};this.drawRuler=F;this.sizeListener=l=A(function(){var E=m.container;n?(E=E.offsetHeight+P,f.height!=E&&(f.height=E,c.style.height=E+"px",F())):(E=E.offsetWidth+P,f.width!=E&&(f.width=E,c.style.width=E+"px",F()))},10);this.pageListener=function(){F()};this.scrollListener=d=A(function(){var E=n?m.container.scrollTop:m.container.scrollLeft;J.lastScroll!=E&&(J.lastScroll=E,F())},10);this.unitListener=function(E,C){J.setUnit(C.getProperty("unit"))};-m.addListener(mxEvent.SIZE,l);m.container.addEventListener("scroll",d);m.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(E){L=E;c.style.background=L.bkgClr;v()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(E,C,S,U){if(n&&4<E.height||!n&&4<E.width){if(null!=J.guidePart)try{k.putImageData(J.guidePart.imgData1,+y=-1,F=function(){null!=z?(null!=D&&D(y),y=z(x)):x()};this.drawRuler=F;this.sizeListener=l=A(function(){var E=m.container;n?(E=E.offsetHeight+P,f.height!=E&&(f.height=E,c.style.height=E+"px",F())):(E=E.offsetWidth+P,f.width!=E&&(f.width=E,c.style.width=E+"px",F()))},10);this.pageListener=function(){F()};this.scrollListener=d=A(function(){var E=n?m.container.scrollTop:m.container.scrollLeft;J.lastScroll!=E&&(J.lastScroll=E,F())},10);this.unitListener=function(E,C){J.setUnit(C.getProperty("unit"))};+m.addListener(mxEvent.SIZE,l);m.container.addEventListener("scroll",d);m.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(E){L=E;c.style.background=L.bkgClr;x()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(E,C,S,U){if(n&&4<E.height||!n&&4<E.width){if(null!=J.guidePart)try{k.putImageData(J.guidePart.imgData1,J.guidePart.x1,J.guidePart.y1),k.putImageData(J.guidePart.imgData2,J.guidePart.x2,J.guidePart.y2),k.putImageData(J.guidePart.imgData3,J.guidePart.x3,J.guidePart.y3)}catch(K){}var Q=J.origGuideMove.apply(this,arguments);try{k.lineWidth=.5;k.strokeStyle=L.guideClr;k.setLineDash([2]);if(n){var O=E.y+Q.y+P-this.graph.container.scrollTop;var q=0;var u=O+E.height/2;var I=P/2;var G=O+E.height;var H=0;var g=k.getImageData(q,O-1,P,3);t(q,O,P,O);O--;var p=k.getImageData(I,u-1,P,3);t(I,u,P,u);u--;var B=k.getImageData(H,G-1,P,3);t(H,G,P,G);G--}else O=0,q=E.x+Q.x+P-this.graph.container.scrollLeft,u=P/2,I=q+E.width/2,G=0,H=q+E.width,g=k.getImageData(q-1,O,3,P),t(q,O,q,P),q--,p=k.getImageData(I-1,u,3,P),t(I,u,I,P),I--,B=k.getImageData(H-1,G,3,P),t(H,G,H,P),H--;if(null==J.guidePart||J.guidePart.x1!=q||J.guidePart.y1!=O)J.guidePart={imgData1:g,x1:q,y1:O,imgData2:p,x2:I,y2:u,imgData3:B,x3:H,y3:G}}catch(K){}}else Q=J.origGuideMove.apply(this,arguments);return Q};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var E=J.origGuideDestroy.apply(this,arguments);if(null!=J.guidePart)try{k.putImageData(J.guidePart.imgData1,J.guidePart.x1,J.guidePart.y1),k.putImageData(J.guidePart.imgData2,J.guidePart.x2,J.guidePart.y2),k.putImageData(J.guidePart.imgData3,J.guidePart.x3,J.guidePart.y3),J.guidePart=null}catch(C){}return E}}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 n=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return n};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(d){var x=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,-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 z=new mxPopupMenu(mxUtils.bind(this,function(J,L){b.menus.addMenuItems(J,["points","inches","millimeters","meters"],L)}));z.smartSeparators=!0;z.showDisabled=!0;z.autoExpand=!0;z.hideMenu=mxUtils.bind(this,+function mxDualRuler(b,l){var n=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return n};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(d){var v=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,+function(A){v=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)||!v){var z=new mxPopupMenu(mxUtils.bind(this,function(J,L){b.menus.addMenuItems(J,["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 D=mxEvent.getClientX(A),P=mxEvent.getClientY(A);z.popup(D,P,null,A);b.setCurrentMenu(z,d)}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 n=mxFreehand.prototype.MILD_SMOOTHING,d=null,x=[],A,z=[],D,P=!1,J=!0,L=!0,c=!0,f=!0,k=[],m=!1,t=!1,v=!1,y="default",F={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},E=!0;this.setClosedPath=function(u){P=u};this.setAutoClose=function(u){J=u};this.setAutoInsert=-function(u){L=u};this.setAutoScroll=function(u){c=u};this.setOpenFill=function(u){f=u};this.setStopClickEnabled=function(u){t=u};this.setSelectInserted=function(u){v=u};this.setSmoothing=function(u){n=u};this.getSmoothing=function(){return n};this.setPerfectFreehandMode=function(u){E=u};this.isPerfectFreehandMode=function(){return E};this.setBrushSize=function(u){F.size=u};this.getBrushSize=function(){return F.size};var C=function(u){m=u;b.getRubberband().setEnabled(!u);b.graphHandler.setSelectEnabled(!u);-b.graphHandler.setMoveEnabled(!u);u?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){C(!0)};this.isDrawing=function(){return m};var S=mxUtils.bind(this,function(u){if(d){var I=D.length,G=t&&0<z.length&&null!=D&&2>D.length;G||z.push.apply(z,D);D=[];z.push(null);x.push(d);d=null;(G||L)&&this.stopDrawing();L&&(!G||2<=I)&&this.startDrawing();mxEvent.consume(u)}}),U=new mxCell;-U.edge=!0;this.getStrokeColor=function(u){var I=null!=y?y:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(U),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=I||u||(I=b.shapeForegroundColor);return I};this.setStrokeColor=function(u){y=u};this.createStyle=function(u){var I=";fillColor=none;";E&&(I=";lineShape=1;");I+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+u+I};this.stopDrawing=function(){if(0<x.length){if(E){for(var u=+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 n=mxFreehand.prototype.MILD_SMOOTHING,d=null,v=[],A,z=[],D,P=!1,J=!0,L=!0,c=!0,f=!0,k=[],m=!1,t=!1,x=!1,y="default",F={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},E=!0;this.setClosedPath=function(u){P=u};this.setAutoClose=function(u){J=u};this.setAutoInsert=+function(u){L=u};this.setAutoScroll=function(u){c=u};this.setOpenFill=function(u){f=u};this.setStopClickEnabled=function(u){t=u};this.setSelectInserted=function(u){x=u};this.setSmoothing=function(u){n=u};this.getSmoothing=function(){return n};this.setPerfectFreehandMode=function(u){E=u};this.isPerfectFreehandMode=function(){return E};this.setBrushSize=function(u){F.size=u};this.getBrushSize=function(){return F.size};var C=function(u){m=u;b.getRubberband().setEnabled(!u);b.graphHandler.setSelectEnabled(!u);+b.graphHandler.setMoveEnabled(!u);u?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){C(!0)};this.isDrawing=function(){return m};var S=mxUtils.bind(this,function(u){if(d){var I=D.length,G=t&&0<z.length&&null!=D&&2>D.length;G||z.push.apply(z,D);D=[];z.push(null);v.push(d);d=null;(G||L)&&this.stopDrawing();L&&(!G||2<=I)&&this.startDrawing();mxEvent.consume(u)}}),U=new mxCell;+U.edge=!0;this.getStrokeColor=function(u){var I=null!=y?y:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(U),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=I||u||(I=b.shapeForegroundColor);return I};this.setStrokeColor=function(u){y=u};this.createStyle=function(u){var I=";fillColor=none;";E&&(I=";lineShape=1;");I+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+u+I};this.stopDrawing=function(){if(0<v.length){if(E){for(var u=[],I=0;I<z.length;I++)null!=z[I]&&u.push([z[I].x,z[I].y]);u=PerfectFreehand.getStroke(u,F);z=[];for(I=0;I<u.length;I++)z.push({x:u[I][0],y:u[I][1]});z.push(null)}u=z[0].x;var G=z[0].x,H=z[0].y,g=z[0].y;for(I=1;I<z.length;I++)null!=z[I]&&(u=Math.max(u,z[I].x),G=Math.min(G,z[I].x),H=Math.max(H,z[I].y),g=Math.min(g,z[I].y));u-=G;H-=g;if(0<u&&0<H){var p=100/u,B=100/H;z.map(function(T){if(null==T)return T;T.x=(T.x-G)*p;T.y=(T.y-g)*B;return T});var K='<shape strokewidth="inherit"><foreground>',M=0;for(I=0;I<z.length;I++){var N=z[I];if(null==N){N=!1;M=z[M];var R=z[I-1];!P&&J&&(N=M.x-R.x,R=M.y-R.y,N=Math.sqrt(N*N+R*R)<=b.tolerance);if(P||N)K+='<line x="'+M.x.toFixed(2)+'" y="'+M.y.toFixed(2)+'"/>';K+="</path>"+(f||P||N?"<fillstroke/>":"<stroke/>");M=I+1}else K=I==M?K+('<path><move x="'+N.x.toFixed(2)+'" y="'+N.y.toFixed(2)+'"/>'):K+('<line x="'+N.x.toFixed(2)+'" y="'+N.y.toFixed(2)+'"/>')}K+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){I=this.createStyle("stencil("+-Graph.compress(K)+")");K=b.view.scale;M=b.view.translate;I=new mxCell("",new mxGeometry(G/K-M.x,g/K-M.y,u/K,H/K),I);I.vertex=1;b.model.beginUpdate();try{I=b.addCell(I),b.fireEvent(new mxEventObject("cellsInserted","cells",[I])),b.fireEvent(new mxEventObject("freehandInserted","cell",I))}finally{b.model.endUpdate()}v&&b.setSelectionCells([I])}}for(I=0;I<x.length;I++)x[I].parentNode.removeChild(x[I]);d=null;x=[];z=[]}C(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(u,I){m&&I.getProperty("event").consume()}));+Graph.compress(K)+")");K=b.view.scale;M=b.view.translate;I=new mxCell("",new mxGeometry(G/K-M.x,g/K-M.y,u/K,H/K),I);I.vertex=1;b.model.beginUpdate();try{I=b.addCell(I),b.fireEvent(new mxEventObject("cellsInserted","cells",[I])),b.fireEvent(new mxEventObject("freehandInserted","cell",I))}finally{b.model.endUpdate()}x&&b.setSelectionCells([I])}}for(I=0;I<v.length;I++)v[I].parentNode.removeChild(v[I]);d=null;v=[];z=[]}C(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(u,I){m&&I.getProperty("event").consume()}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(u,I){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(u=I.getEvent(),m&&!mxEvent.isPopupTrigger(u)&&!mxEvent.isMiddleMouseButton(u)&&!mxEvent.isMultiTouchEvent(u))){var G=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);G=Math.max(1,G*b.view.scale);var H=this.getStrokeColor();d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("fill",E?H:"none");d.setAttribute("pointer-events","none");d.setAttribute("stroke",H);d.setAttribute("stroke-width",G);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(H=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",H=H.split(" ").map(function(g){return parseFloat(g)*G}).join(" "),d.setAttribute("stroke-dasharray",H));k=[];u=Q(u);O(u);A="M"+u.x+" "+u.y;z.push(u);D=[];d.setAttribute("d",E?PerfectFreehand.getSvgPathFromStroke([[u.x,u.y]],F):A);l.appendChild(d);I.consume()}}),mouseMove:mxUtils.bind(this,function(u,I){if(null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){u=I.getEvent();u=Q(u);O(u);var G=q(0);if(G)if(z.push(G),E){var H=[];for(G=0;G<z.length;G++)H.push([z[G].x,z[G].y]);D=[];for(var g=2;g<k.length;g+=2)G=q(g),H.push([G.x,G.y]),D.push(G);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(H,F))}else{A+=" L"+G.x+" "+G.y;H="";D=[];for(g=2;g<k.length;g+=2)G=q(g),H+=" L"+G.x+" "+G.y,D.push(G);d.setAttribute("d",A+H)}c&&(G=b.view.translate,b.scrollRectToVisible((new mxRectangle(u.x-G.x,u.y-G.y)).grow(20)));I.consume()}}),mouseUp:mxUtils.bind(this,function(u,I){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(S(I.getEvent()),I.consume())})});var Q=function(u){return mxUtils.convertPoint(b.container,mxEvent.getClientX(u),mxEvent.getClientY(u))},O=function(u){for(k.push(u);k.length>n;)k.shift()},q=function(u){var I=k.length;if(1===I%2||I>=n){var G=0,H=0,g,p=0;for(g=u;g<I;g++)p++,u=k[g],G+=u.x,H+=u.y;return{x:G/p,y:H/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;DrawioUser=function(b,l,n,d,x){this.id=b;this.email=l;this.displayName=n;this.pictureUrl=d;this.locale=x};DrawioComment=function(b,l,n,d,x,A,z){this.file=b;this.id=l;this.content=n;this.modifiedDate=d;this.createdDate=x;this.isResolved=A;this.user=z;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,l,n,d,x){l()};DrawioComment.prototype.editComment=function(b,l,n){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;+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,n,d,v){this.id=b;this.email=l;this.displayName=n;this.pictureUrl=d;this.locale=v};DrawioComment=function(b,l,n,d,v,A,z){this.file=b;this.id=l;this.content=n;this.modifiedDate=d;this.createdDate=v;this.isResolved=A;this.user=z;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,l,n,d,v){l()};DrawioComment.prototype.editComment=function(b,l,n){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"];LucidImporter={};(function(){function u(f){if(f&&null!=LucidImporter.imgSrcRepl){var p=LucidImporter.imgSrcRepl.attMap;if(p[f])f=p[f];else{p=LucidImporter.imgSrcRepl.imgRepl;for(var n=0;n<p.length;n++){var e=p[n];f=f.replace(e.searchVal,e.replVal)}LucidImporter.hasExtImgs=!0}}return f}function A(f){gb="";try{if(f){var p=null;LucidImporter.advImpConfig&&LucidImporter.advImpConfig.fontMapping&&(p=LucidImporter.advImpConfig.fontMapping[f]);if(p){for(var n in p)gb+=n+"="+p[n]+";";return p.fontFamily?"font-family: "+p.fontFamily:diff --git a/src/main/webapp/js/viewer-static.min.js b/src/main/webapp/js/viewer-static.min.jsindex a78eea495..0411a457d 100644--- a/src/main/webapp/js/viewer-static.min.js+++ b/src/main/webapp/js/viewer-static.min.js@@ -30,7 +30,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:"29.2.6",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"29.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&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||@@ -3500,7 +3500,7 @@ mxEvent.addListener(v,"click",function(ua){pa.checked=!0;mxEvent.consume(ua)}));(Y.classList.add("geDarkMode"),Y.style.colorScheme="dark"):(Y.classList.remove("geDarkMode"),Y.style.colorScheme="light")};k.addListener("darkModeChanged",xa);xa();var ra=function(ua,Ka){ua=Ka.getProperty("dialog");Y.parentNode==ua.container&&(k.editor.removeListener(ra),k.removeListener(xa))};k.editor.addListener("hideDialog",ra)}this.container=Y};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 k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}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&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.2.6";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&&+this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.2.7";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.enablePlantUml=EditorUi.enableLogging||"1"==urlParams.dev;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 window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={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,@@ -3534,14 +3534,14 @@ new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setNaEditorUi.prototype.createFileData=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){g=null!=g?g:this.editor.graph;x=null!=x?x:!1;M=null!=M?M:!0;Z=null!=Z?Z:!Editor.defaultCompressed;var ba=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var na="_blank";else ba=na=n;if(null==c)return"";var ca=c;if("mxfile"!=ca.nodeName.toLowerCase()){if(Z){var ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());ka.appendChild(c)}else{ka=Graph.zapGremlins(mxUtils.getXml(c));ca=Graph.compress(ka);if(Graph.decompress(ca)!=ka)return ka;ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());mxUtils.setTextContent(ka,ca)}ca=c.ownerDocument.createElement("mxfile");ca.appendChild(ka)}K?(ca=ca.cloneNode(!0),ca.removeAttribute("modified"),ca.removeAttribute("host"),ca.removeAttribute("agent"),ca.removeAttribute("etag"),ca.removeAttribute("userAgent"),ca.removeAttribute("version"),ca.removeAttribute("editor"),ca.removeAttribute("type")):(ca.removeAttribute("userAgent"),ca.removeAttribute("modified"),ca.removeAttribute("version"),ca.removeAttribute("editor"),ca.removeAttribute("pages"),ca.removeAttribute("type"),ca.removeAttribute("etag"),mxClient.IS_CHROMEAPP?ca.setAttribute("host","Chrome"):EditorUi.isElectronApp?ca.setAttribute("host","Electron"):ca.setAttribute("host",window.location.hostname),ca.setAttribute("agent",null!=navigator.userAgent?-navigator.userAgent:navigator.appVersion),ca.setAttribute("version",EditorUi.VERSION),1<ca.getElementsByTagName("diagram").length&&null!=this.pages&&ca.setAttribute("pages",this.pages.length));null!=ja&&(ca=ca.cloneNode(!0),ca.setAttribute("scale",ja));null!=da&&(ca=ca.cloneNode(!0),ca.setAttribute("border",da));c=Z?mxUtils.getPrettyXml(ca):mxUtils.getXml(ca);if(!F&&!x&&(G||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(ca),g,null!=l?l.getTitle():null,na,ba,null==ba&&!EditorUi.isElectronApp&&-"draw.io"==this.getServiceName());else if(F||!x&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(ca),c=this.getEmbeddedSvg(c,g,n,null,L,M,ba,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,n){c=null!=c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=-function(M){var K=M.getElementsByTagName("mxGraphModel"),Z=0<K.length?K[0]:null;K=M;null==Z&&l?(Z=mxUtils.getNodeValue(M),0<Z.length&&(Z=Graph.decompress(Z),null!=Z&&0<Z.length&&(K=M.cloneNode(!1),K.appendChild(mxUtils.parseXml(Z).documentElement)))):null==Z||l?K=M.cloneNode(!0):(K=M.cloneNode(!1),mxUtils.setTextContent(K,Graph.compressNode(Z)));x.appendChild(K)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);-else for(g=0;g<this.pages.length;g++){var F=this.pages[g],G=F.node;if(F!=this.currentPage)if(F.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(F.root));this.editor.graph.saveViewState(F.viewState,L,null,n);EditorUi.removeChildNodes(G);G.appendChild(L);delete F.needsUpdate}else n&&(this.updatePageRoot(F),null!=F.viewState.backgroundImage&&null!=F.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(F.root)),-this.editor.graph.saveViewState(F.viewState,L,null,n,F),G=G.cloneNode(!1),G.appendChild(L)));c(G)}return x};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],n=0;n<c.length;n++){var x=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?l.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*-Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(F){c[EditorUi.DIFF_INSERT][g].data=F.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var x=-c[EditorUi.DIFF_UPDATE][n];null!=x.name&&(x.name=this.anonymizeString(x.name));null!=x.cells&&(g=mxUtils.bind(this,function(F){var G=x.cells[F];if(null!=G){for(var L in G)null!=G[L].value&&(G[L].value="["+G[L].value.length+"]"),null!=G[L].xmlValue&&(G[L].xmlValue="["+G[L].xmlValue.length+"]"),null!=G[L].style&&(G[L].style="["+G[L].style.length+"]"),mxUtils.isEmptyObject(G[L])&&delete G[L];mxUtils.isEmptyObject(G)&&delete x.cells[F]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&-delete x.cells);mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){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,g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=+navigator.userAgent:navigator.appVersion),ca.setAttribute("version",EditorUi.VERSION),1<ca.getElementsByTagName("diagram").length&&null!=this.pages&&ca.setAttribute("pages",this.pages.length));null!=ja&&(ca=ca.cloneNode(!0),ca.setAttribute("scale",ja));null!=da&&(ca=ca.cloneNode(!0),ca.setAttribute("border",da));c=Z?mxUtils.getPrettyXml(ca):mxUtils.getXml(ca);if(!F&&!x&&(G||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(ca),g,null!=l?l.getTitle():null,na,ba);else if(F||!x&&+null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(ca),c=this.getEmbeddedSvg(c,g,n,null,L,M,ba,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,n){c=null!=c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(M){var K=M.getElementsByTagName("mxGraphModel"),+Z=0<K.length?K[0]:null;K=M;null==Z&&l?(Z=mxUtils.getNodeValue(M),0<Z.length&&(Z=Graph.decompress(Z),null!=Z&&0<Z.length&&(K=M.cloneNode(!1),K.appendChild(mxUtils.parseXml(Z).documentElement)))):null==Z||l?K=M.cloneNode(!0):(K=M.cloneNode(!1),mxUtils.setTextContent(K,Graph.compressNode(Z)));x.appendChild(K)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var F=this.pages[g],+G=F.node;if(F!=this.currentPage)if(F.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(F.root));this.editor.graph.saveViewState(F.viewState,L,null,n);EditorUi.removeChildNodes(G);G.appendChild(L);delete F.needsUpdate}else n&&(this.updatePageRoot(F),null!=F.viewState.backgroundImage&&null!=F.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(F.root)),this.editor.graph.saveViewState(F.viewState,L,null,+n,F),G=G.cloneNode(!1),G.appendChild(L)));c(G)}return x};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],n=0;n<c.length;n++){var x=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?l.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=+function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(F){c[EditorUi.DIFF_INSERT][g].data=F.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var x=c[EditorUi.DIFF_UPDATE][n];+null!=x.name&&(x.name=this.anonymizeString(x.name));null!=x.cells&&(g=mxUtils.bind(this,function(F){var G=x.cells[F];if(null!=G){for(var L in G)null!=G[L].value&&(G[L].value="["+G[L].value.length+"]"),null!=G[L].xmlValue&&(G[L].xmlValue="["+G[L].xmlValue.length+"]"),null!=G[L].style&&(G[L].style="["+G[L].style.length+"]"),mxUtils.isEmptyObject(G[L])&&delete G[L];mxUtils.isEmptyObject(G)&&delete x.cells[F]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);+mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){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,g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(c,g){g=c.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&g[l].setAttribute("value","["+g[l].getAttribute("value").length+"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length+"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){x=null!=x?x:!0;F=null!=F?F:!1;K=null!=K?K:!Editor.defaultCompressed;var ba=this.editor.graph;if((g||!c&&null!=M&&/(\.svg)$/i.test(M.getTitle()))&&null!=this.pages&&this.currentPage!=@@ -3550,14 +3550,14 @@ ka?1:na.apply(this,arguments)};document.body.appendChild(ba.container);null!=ca&var M=g.view.scale;F=Math.floor(G.x/M-g.view.translate.x);M=Math.floor(G.y/M-g.view.translate.y);G=g.background;null==x&&(g=this.getBasenames().join(";"),0<g.length&&(L=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",F);c.setAttribute("y0",M)}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!=x&&(x=x.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=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!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=G&&G!=mxConstants.NONE?' style="background-color:'+G+';">':">")+'\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==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,g,l,n,x,F){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=x?x=x.replace(/&/g,"&"):F&&(c.editor=window.DRAWIO_BASE_URL,c.toolbar+=" editlocal");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!=l?"<title>"+mxUtils.htmlEntities(l)+"</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="'+g+'">\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.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",-[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var n=this.getHashObject(),x=null;this.fileNode=g;this.pages=[];for(var F=0;F<c.length;F++){null==c[F].getAttribute("id")&&c[F].setAttribute("id",F);g=new DiagramPage(c[F]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[F+1]));this.pages.push(g);-if(null==n.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||null!=n.pageId&&g.getId()==n.pageId)x=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",-[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var G=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(F=0;F<G.length;F++)g[G[F]]=!0;var L=this.editor.graph.getModel(),M=L.getChildren(L.root);for(F=0;F<M.length;F++){var K=M[F];L.setVisible(K,g[K.id]||!1)}}catch(Z){}};EditorUi.prototype.getBaseFilename=-function(c){var g=this.getCurrentFile();g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=-function(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba,na,ca,ka){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var aa=this.getBaseFilename(!x),V=aa+("xml"==c||"pdf"==c&&Z?".drawio":"")+"."+c;if("xml"==c){var k=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,x,null,null,null,g);this.saveData(V,c,k,"text/xml")}else if("html"==c)k=this.getHtml2(this.getFileData(!0),this.editor.graph,aa),this.saveData(V,c,k,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==+EditorUi.prototype.getHtml2=function(c,g,l,n,x){g=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!=l?"<title>"+mxUtils.htmlEntities(l)+"</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="'+g+'">\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.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")++" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var n=this.getHashObject(),x=null;this.fileNode=g;this.pages=[];for(var F=0;F<c.length;F++){null==c[F].getAttribute("id")&&c[F].setAttribute("id",F);g=new DiagramPage(c[F]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[F+1]));this.pages.push(g);if(null==n.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||+null!=n.pageId&&g.getId()==n.pageId)x=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);+this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var G=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(F=0;F<G.length;F++)g[G[F]]=!0;var L=this.editor.graph.getModel(),M=L.getChildren(L.root);for(F=0;F<M.length;F++){var K=M[F];L.setVisible(K,g[K.id]||!1)}}catch(Z){}};EditorUi.prototype.getBaseFilename=function(c){var g=this.getCurrentFile();+g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=function(c,g,l,n,x,+F,G,L,M,K,Z,ja,da,ba,na,ca,ka){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var aa=this.getBaseFilename(!x),V=aa+("xml"==c||"pdf"==c&&Z?".drawio":"")+"."+c;if("xml"==c){var k=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,x,null,null,null,g);this.saveData(V,c,k,"text/xml")}else if("html"==c)k=this.getHtml2(this.getFileData(!0),this.editor.graph,aa),this.saveData(V,c,k,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?V=aa+".png":"jpeg"==c&&(V=aa+".jpg"),this.saveRequest(V,c,mxUtils.bind(this,function(W,U){try{return this.createDownloadRequest(W,c,n,U,G,x,L,M,K,Z,ja,void 0,void 0,!F,da,ba,na,ca,ka)}catch(Y){this.handleError(Y)}}));else{var v=null,J=mxUtils.bind(this,function(W){W.length<=MAX_REQUEST_SIZE?this.saveData(V,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(v)}))});if("svg"==c){var N=this.editor.graph.background;if(G||N==mxConstants.NONE)N=null;var T=this.editor.graph.getSvg(N,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(T);this.editor.convertImages(T,mxUtils.bind(this,mxUtils.bind(this,function(W){this.spinner.stop();J(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(W))})))}else V=aa+".svg",v=this.getFileData(!1,!0,null,mxUtils.bind(this,function(W){this.spinner.stop();J(W)}),n)}}catch(W){this.handleError(W)}};EditorUi.prototype.createDownloadRequest=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba,na,ca,ka,aa,V){c=this.downloadRequestBuilder(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba,na,ca,ka,aa,V);g="";for(var k in c)l=c[k],null!=l&&(g+=k+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba,na,ca,ka,aa,V){var k=this.editor.graph,v=k.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==F?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var J=null,N=null,T=null;if(!EditorUi.isElectronApp&&@@ -3627,86 +3627,86 @@ n)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettimxEvent.consume(na)):ba()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(K.style,"transform",L)}),500);window.setTimeout(ba,x?5E3:3E4);F=!0}return F};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,g,l,n){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<n&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,g,l,n,x){var F="jpeg"==l?"jpg":l;n=this.getBaseFilename(n)+(null!=g?".drawio":"")+"."+F;c=this.createImageDataUri(c,g,l,x);this.saveData(n,F,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,g){c=new TextareaDialog(this,c,g,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,g,l,n,x,F){"text/xml"!=l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||-/(\.html)$/i.test(g)||(g=g+"."+(null!=F?F:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=n?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,l,n);else{var G=document.createElement("a");F=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof G.download;if(mxClient.IS_GC&&null!=-navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);F=65==(L?parseInt(L[2],10):!1)?!1:F}if(F||this.isOffline()){G.href=URL.createObjectURL(n?this.base64ToBlob(c,l):new Blob([c],{type:l}));F?G.download=g:G.setAttribute("target","_blank");document.body.appendChild(G);try{window.setTimeout(function(){URL.revokeObjectURL(G.href)},2E4),G.click(),G.parentNode.removeChild(G)}catch(M){}}else this.createEchoRequest(c,g,l,n,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=-function(c,g,l,n,x,F){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=F?"&base64="+F:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,g,l,n,x,F,G,L,M){F=null!=F?F:!1;G=null!=G?G:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var K=mxUtils.bind(this,function(ja,da,ba,na){try{if("_blank"==da)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,-l,n);else if(null!=l&&"text/html"==l.substring(0,9)){var ca=new EmbedDialog(this,c);this.showDialog(ca.container,450,240,!0,!0);ca.init()}else{var ka=window.open("about:blank");null==ka?mxUtils.popup(c,!0):(ka.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),ka.document.close())}else if(da==App.MODE_DEVICE||"download"==da)this.doSaveLocalFile(c,ja,l,n,null,L);else if(null!=ja&&0<ja.length){var aa=mxUtils.bind(this,function(V){try{this.exportFile(c,ja,l,n,da,V)}catch(k){this.handleError(k)}});-null!=na?aa(na):this.pickFolder(da,aa)}}catch(V){this.handleError(V)}});x=[];F||x.push(App.MODE_BROWSER);G||x.push("_blank");var Z=new SaveDialog(this,g,mxUtils.bind(this,function(ja,da,ba){K(ja.value,da,ja,ba);this.hideDialog(null,null,Z.container)}),x,c,l,n,M);this.showDialog(Z.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Z.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var x=-"background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var F=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=F&&(x="background: "+F+";")}x='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+x+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||l?(F=l?c:btoa(unescape(encodeURIComponent(c))),n.document.write(x+'<img style="max-width:100%;" src="data:'+g+";base64,"+F+'"/></body></html>')):n.document.write(x+c+"</body></html>"):-n.document.write(x+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");n.document.close()}};var t=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){this.tagsDialog=this.tagsComponent=null;var g=c(mxUtils.bind(this,function(n){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 x=g.getBoundingClientRect();this.tagsDialog.style.left=x.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=x.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),-Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();g.style.display=0<n.length?"":"none"}))}t.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()){this.exportDialog=null;var l=c(mxUtils.bind(this,function(n){var x=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",x);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)x.apply(this);-else{this.exportDialog=document.createElement("div");var F=l.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=F.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";F=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=F.zIndex;var G=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});G.spin(this.exportDialog);document.body.appendChild(this.exportDialog);-mxEvent.addListener(this.editor.graph.container,"click",x);this.editor.exportToCanvas(mxUtils.bind(this,function(L){G.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var M=this.createImageDataUri(L,null,"png");L=document.createElement("img");L.style.maxWidth="140px";L.style.maxHeight="140px";L.style.cursor="pointer";L.style.backgroundColor="white";L.setAttribute("title",mxResources.get("openInNewWindow"));L.setAttribute("border",-"0");L.setAttribute("src",M);this.exportDialog.appendChild(L);mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.openInNewWindow(M.substring(M.indexOf(",")+1),"image/png",!0);x.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(L){G.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(L)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),-Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,n,x,F){this.isLocalFileSave()?this.saveLocalFile(l,c,n,x,g,F):this.saveRequest(c,g,mxUtils.bind(this,function(G,L){return this.createEchoRequest(l,G,n,x,g,L)}),l,x,n)};EditorUi.prototype.saveRequest=function(c,g,l,n,x,F,G){G=null!=G?G:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,function(K,Z,ja,da){if("_blank"==Z||null!=K&&0<K.length){var ba=l("_blank"==Z?null:K,Z==App.MODE_DEVICE||"download"==-Z||null==Z||"_blank"==Z?"0":"1");null!=ba&&(Z==App.MODE_DEVICE||"download"==Z||"_blank"==Z?ba.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(na){F=null!=F?F:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,K,F,!0,Z,na)}catch(ca){this.handleError(ca)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ba.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=ba.getStatus()&&299>=ba.getStatus())try{this.exportFile(ba.getText(),K,F,!0,Z,na)}catch(ca){this.handleError(ca)}else this.handleError({message:mxResources.get("errorSavingFile")})}),-mxUtils.bind(this,function(ca){this.spinner.stop();this.handleError(ca)}))}),null!=da?ja(da):this.pickFolder(Z,ja)))}});x=[App.MODE_BROWSER];G||x.push("_blank");var M=new SaveDialog(this,c,mxUtils.bind(this,function(K,Z,ja){L(K.value,Z,K,ja);this.hideDialog(null,null,M.container)}),x,null,"application/pdf");this.showDialog(M.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));M.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=-function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,g,l,n,x,F){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,-g,l,n,x,F,G,L,M,K,Z,ja,da,ba)}));this.handleError(la)})))try{var na=this.editor.graph.isSelectionEmpty();l=null!=l?l:na;var ca=g?null:this.editor.graph.background;ca==mxConstants.NONE&&(ca=null);null==ca&&0==g&&(ca=this.editor.graph.shapeBackgroundColor);var ka=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var aa=mxUtils.lightDarkColorSupported,V=mxUtils.preferDarkColor;if("light"==Z||"dark"==Z)mxUtils.lightDarkColorSupported=-!1,mxUtils.preferDarkColor="dark"==Z;var k=Graph.addFont,v={};Graph.addFont=function(la,qa,ya,wa){k.call(this,la,qa,ya,v)};var J=this.editor.graph.createSvgImageExport(x),N=J.drawCellState;J.drawCellState=function(la,qa){null!=la&&Graph.processFontStyle(la.style);N.apply(this,arguments)};var T=this.editor.graph.getSvg(ca,c,G,L,null,l,null,J,"blank"==K?"_blank":"self"==K?"_top":null,null,!da,Z,ja);mxUtils.lightDarkColorSupported=aa;mxUtils.preferDarkColor=V;this.editor.graph.addForeignObjectWarning=-ka;n&&this.editor.graph.addSvgShadow(T);var W=this.getBaseFilename()+(x?".drawio":"")+".svg";ba=null!=ba?ba:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=MAX_REQUEST_SIZE?this.saveData(W,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var U=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,l,M,null,-null,null,null,null,c,G));ba(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(T);var Y=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&F&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&da?this.replaceAlternateContent(la,Z,U):U(la)}),fa=Graph.customFontElements;Graph.customFontElements=v;var oa=mxUtils.bind(this,function(la){Graph.customFontElements=fa;Graph.addFont=k;F&&!this.isOffline()&&-Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,Y,this.thumbImageCache)):Y(la)});da?this.embedFonts(T,oa):(this.editor.addFontCss(T),oa(T))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function n(ja,da,ba,na,ca){var ka=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ka.setAttribute("x",da);ka.setAttribute("y",ba+.5);ka.setAttribute("width",na.width);ka.setAttribute("height",-na.height);null==ka.setAttributeNS?ka.setAttribute("xlink:href",ca):ka.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ca);ja.replaceChild(ka,ja.lastChild);L()}function x(){if(G<Z.length)Z[G++](x)}var F="";g=c.getElementsByTagName("style");for(var G=0;G<g.length;G++)F+=g[G].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var L=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),M={},K={},Z=[];for(G=0;G<g.length;G++)mxUtils.bind(this,function(ja){var da=ja.getElementsByTagName("div");-if(0<da.length)try{var ba=da[0].cloneNode(!0),na=parseInt(ba.style.marginLeft),ca=parseInt(ba.style.paddingTop),ka=ba.getElementsByTagName("div")[1],aa=da=!1,V=ba.style.alignItems,k=ba.style.justifyContent;if(null!=ba.style.writingMode){var v=ba.style.writingMode;aa="vertical-"==v.substring(0,9);da="-rl"==v.substring(v.length-3)}var J=!aa&&"1px"==ba.style.width||aa&&"1px"==ba.style.height;if(!aa&&"1px"==ba.style.height||aa&&"1px"==ba.style.width)ba.style.alignItems=aa&&da?"unsafe flex-end":"unsafe flex-start";-J&&(ba.style.justifyContent="unsafe flex-start");ba.style.paddingTop="";ba.style.marginLeft="";var N=ba.outerHTML,T=M[N];null==T&&(ba.style.position="absolute",ba.style.visibility="hidden",document.body.appendChild(ba),v=1,v="1px"==ba.style.width?ka.offsetWidth:parseInt(ba.style.width),J=1,J="1px"==ba.style.height?ka.offsetHeight:parseInt(ba.style.height),document.body.removeChild(ba),T=new mxRectangle(na,ca,v,J),M[N]=T);"1px"==ba.style.height&&("unsafe center"==V?ca-=T.height/2:"unsafe flex-end"==-V&&(ca-=T.height));if("1px"==ba.style.width)if(!aa&&"unsafe center"==k||aa&&"unsafe center"==V)na-=T.width/2;else if(!aa&&"unsafe flex-end"==k||aa&&(!da&&"unsafe flex-end"==V||da&&"unsafe flex-start"==V))na-=T.width;T=new mxRectangle(na,ca,T.width,T.height+parseInt(ka.style.fontSize)/4);Z.push(mxUtils.bind(this,function(W){var U=K[N];null==U?Graph.htmlToPng(N,T.width,T.height,mxUtils.bind(this,function(Y){n(ja,na,ca,T,Y);K[N]=Y;W()}),F):(n(ja,na,ca,T,U),W())}))}catch(W){L()}else L()})(g[G]);0==counter&&-l(c);G=0;x()};EditorUi.prototype.addRadiobox=function(c,g,l,n,x,F,G){return this.addCheckbox(c,l,n,x,F,G,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,n,x,F,G,L){F=null!=F?F:!0;var M=document.createElement("input");M.style.marginRight="8px";M.style.marginTop="16px";M.setAttribute("type",G?"radio":"checkbox");G="geCheckbox-"+Editor.guid();M.id=G;null!=L&&M.setAttribute("name",L);l&&(M.setAttribute("checked","checked"),M.defaultChecked=!0);n&&M.setAttribute("disabled","disabled");F&&(c.appendChild(M),-l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",G),c.appendChild(l),x||mxUtils.br(c));return M};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var n=this.getCurrentFile(),x="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(x=window.location.href);var F=document.createElement("select");F.style.maxWidth="200px";F.style.width="auto";F.style.marginLeft="8px";F.style.marginRight=-"10px";F.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));F.appendChild(n);var G=document.createElement("option");G.setAttribute("value","custom");mxUtils.write(G,mxResources.get("custom")+"...");F.appendChild(G);c.appendChild(F);mxEvent.addListener(F,"change",mxUtils.bind(this,function(){if("custom"==F.value){var L=new FilenameDialog(this,x,mxResources.get("ok"),function(M){null!=M?(x=M,G.setAttribute("title",M)):(F.value=-"blank",G.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){F.value="blank"});this.showDialog(L.container,300,80,!0,!1);L.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===F.value?"_blank":x:null},getEditInput:function(){return l},getEditSelect:function(){return F}}};EditorUi.prototype.addLinkSection=-function(c,g){function l(){var L=document.createElement("div");L.style.width="100%";L.style.height="100%";L.style.boxSizing="border-box";null!=F&&F!=mxConstants.NONE?(L.style.border="1px solid black",L.style.backgroundColor=F):(L.style.backgroundPosition="center center",L.style.backgroundRepeat="no-repeat",L.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");G.innerText="";G.appendChild(L)}mxUtils.write(c,mxResources.get("links")+":");var n=document.createElement("select");n.style.width=-"100px";n.style.padding="0px";n.style.marginLeft="8px";n.style.marginRight="10px";n.className="geBtn";var x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));n.appendChild(x);-g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var F="#0000ff",G=null;G=mxUtils.button("",mxUtils.bind(this,function(L){this.pickColor(F||"none",function(M){F=M;l()});mxEvent.consume(L)}));l();G.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";G.style.marginLeft="4px";G.style.height="22px";G.style.width=-"22px";G.style.position="relative";G.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";G.className="geColorBtn";c.appendChild(G);mxUtils.br(c);return{getColor:function(){return F},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,n,x,F){F=null!=F?F:[];l&&(F.push("lightbox=1"),"auto"!=c&&F.push("target="+c),null!=g&&g!=mxConstants.NONE&&F.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=n&&0<n.length&&-F.push("edit="+encodeURIComponent(n)),x&&F.push("layers=1"),this.editor.graph.foldingEnabled&&F.push("nav=1"));return F};EditorUi.prototype.createLink=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){var ba=this.getCurrentFile();M=this.createUrlParameters(c,g,n,x,F,M);c=!0;null!=G?l="#U"+encodeURIComponent(G):L||null==ba||""==ba.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="#"+ba.getHash(),c=-!1);c&&null!=ba&&null!=ba.getTitle()&&ba.getTitle()!=this.defaultFilename&&M.push("title="+encodeURIComponent(ba.getTitle()));K&&1<l.length&&(M.push("open="+l.substring(1)),l="");Z&&null!=this.currentPage&&M.push("page-id="+this.currentPage.getId());ja&&M.push("transparent=1");null!=da&&M.push("dark="+da);return(n&&(null!=G||null!=ba&&ba.getMode()!=App.MODE_GITHUB&&ba.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?-EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<M.length?"?"+M.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){this.getBasenames();var ba={};""!=x&&x!=mxConstants.NONE&&(ba.highlight=x);"auto"!==n&&(ba.target=n);K||(ba.lightbox=!1);ba.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(ba.zoom=l/100);l=[];G&&(l.push("pages"),ba.resize=!0,null!=this.pages&&null!=this.currentPage&&(ba.page=mxUtils.indexOf(this.pages,this.currentPage)));-g&&(l.push("zoom"),ba.resize=!0);L&&l.push("layers");M&&l.push("tags");null!=da&&(ba["dark-mode"]=da);0<l.length&&(K&&l.push("lightbox"),ba.toolbar=l.join(" "));null!=Z&&0<Z.length&&(ba.edit=Z);null!=c?ba.url=c:ba.xml=this.getFileData(!0,null,null,null,null,!G);g='<div class="mxgraph" style="'+(F?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ba))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<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.showHtmlDialog=function(c,g,l,n){var x=document.createElement("div");x.style.whiteSpace="nowrap";var F=document.createElement("h3");mxUtils.write(F,mxResources.get("html"));F.style.cssText=-"width:100%;text-align:center;margin-top:0px;margin-bottom:12px";x.appendChild(F);var G=document.createElement("div");G.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name","type-embedhtmldialog");F=L.cloneNode(!0);F.setAttribute("value","copy");G.appendChild(F);var M=document.createElement("span");-mxUtils.write(M,mxResources.get("includeCopyOfMyDiagram"));G.appendChild(M);mxUtils.br(G);G.appendChild(L);M=document.createElement("span");mxUtils.write(M,mxResources.get("publicDiagramUrl"));G.appendChild(M);var K=this.getCurrentFile();null==l&&null!=K&&K.constructor==window.DriveFile&&(M=document.createElement("a"),M.style.paddingLeft="12px",M.style.color="gray",M.style.cursor="pointer",mxUtils.write(M,mxResources.get("share")),G.appendChild(M),mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.hideDialog();-this.drive.showPermissions(K.getId(),K)})));F.setAttribute("checked","checked");null==l&&L.setAttribute("disabled","disabled");x.appendChild(G);G=380;var Z=this.addLinkSection(x),ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";ja.style.marginTop="16px";M=document.createElement("option");M.setAttribute("value","light");mxUtils.write(M,mxResources.get("light"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,-mxResources.get("dark"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","auto");mxUtils.write(M,mxResources.get("automatic"));M.setAttribute("selected","selected");ja.appendChild(M);M.setAttribute("selected","selected");mxUtils.write(x,mxResources.get("appearance")+":");x.appendChild(ja);mxUtils.br(x);G+=26;var da=this.addCheckbox(x,mxResources.get("zoom"),!0,null,!0);mxUtils.write(x,":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight=-"16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value="100%";x.appendChild(ba);var na=this.addCheckbox(x,mxResources.get("fit"),!0);M=null!=this.pages&&1<this.pages.length;var ca=ca=this.addCheckbox(x,mxResources.get("allPages"),M,!M),ka=this.addCheckbox(x,mxResources.get("layers"),!0),aa=this.addCheckbox(x,mxResources.get("tags"),!0),V=this.addCheckbox(x,mxResources.get("lightbox"),!0),k=null;if(EditorUi.enableHtmlEditOption){k=this.addEditButton(x,V);var v=-k.getEditInput();v.style.marginBottom="16px";G+=50;mxEvent.addListener(V,"change",function(){V.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");v.checked&&V.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,x,mxUtils.bind(this,function(){n(L.checked?l:null,da.checked,ba.value,Z.getTarget(),Z.getColor(),na.checked,ca.checked,ka.checked,aa.checked,V.checked,null!=k?k.getLink():null,null!=ja?-ja.value:null)}),null,c,g);this.showDialog(c.container,340,G,!0,!0);F.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,n,x,F,G,L,M,K,Z,ja){var da=document.createElement("div");da.style.whiteSpace="nowrap";var ba=document.createElement("h3");mxUtils.write(ba,c||mxResources.get("publish"));ba.style.width="100%";ba.style.textAlign="center";ba.style.marginTop="2px";ba.style.marginBottom="20px";da.appendChild(ba);var na=document.createElement("select");c=30;na.className="geBtn";na.style.marginBottom=-"8px";na.style.marginLeft="0px";na.style.width="100%";na.style.boxSizing="border-box";if(null==L||""==L.getHash())x=null!=x?x:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ba=document.createElement("option"),mxUtils.write(ba,mxResources.get("makeCopy")),ba.setAttribute("value","copy"),na.appendChild(ba);ba=document.createElement("option");mxUtils.write(ba,mxResources.get("authorizationRequired"));ba.setAttribute("value","auth");na.appendChild(ba);null!=L&&""!=L.getHash()||ba.setAttribute("disabled",-"disabled");L=document.createElement("option");L.setAttribute("value","public");na.appendChild(L);null!=G?(mxUtils.write(L,mxResources.get("publicDiagramUrl")),L.setAttribute("title",G),na.value="public"):(mxUtils.write(L,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),L.setAttribute("disabled","disabled"));da.appendChild(na);mxUtils.br(da);na.focus();var ca=null,ka=null;if(null!=g||null!=l)c+=30,mxUtils.write(da,mxResources.get("width")+":"),ca=document.createElement("input"),-ca.setAttribute("type","text"),ca.style.marginRight="16px",ca.style.width="50px",ca.style.marginLeft="6px",ca.style.marginRight="16px",ca.style.marginBottom="10px",ca.value="100%",da.appendChild(ca),mxUtils.write(da,mxResources.get("height")+":"),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.style.width="50px",ka.style.marginLeft="6px",ka.style.marginBottom="10px",ka.value=l+"px",da.appendChild(ka),mxUtils.br(da);var aa=this.addLinkSection(da,n),V=K?this.addCheckbox(da,mxResources.get("transparentBackground"),-!1):null;null!=V&&(c+=20);var k=document.createElement("select");k.className="geBtn";k.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");k.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");k.appendChild(g);var v=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?-this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(da,mxResources.get("pages")+":"),da.appendChild(k),mxUtils.br(da),c+=30),v=this.addCheckbox(da,mxResources.get("selectedPage")+": "+g));var J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft="8px";J.style.marginTop="16px";ja=document.createElement("option");ja.setAttribute("value","0");mxUtils.write(ja,mxResources.get("light"));J.appendChild(ja);ja=document.createElement("option");-ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));J.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected","selected");J.appendChild(ja);Z&&(mxUtils.write(da,mxResources.get("appearance")+":"),da.appendChild(J),mxUtils.br(da),c+=30);var N=this.addCheckbox(da,mxResources.get("lightbox"),!0,null,null,!n),T=this.addEditButton(da,N),W=T.getEditInput();n&&(W.style.marginLeft=N.style.marginLeft,-N.style.display="none",c-=20);var U=this.addCheckbox(da,mxResources.get("layers"),!0);U.style.marginLeft=W.style.marginLeft;U.style.marginTop="8px";var Y=this.addCheckbox(da,mxResources.get("tags"),!0);Y.style.marginLeft=W.style.marginLeft;Y.style.marginBottom="16px";Y.style.marginTop="16px";mxEvent.addListener(N,"change",function(){N.checked?(U.removeAttribute("disabled"),W.removeAttribute("disabled"),Y.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),W.setAttribute("disabled",-"disabled"),Y.setAttribute("disabled","disabled"));W.checked&&N.checked?T.getEditSelect().removeAttribute("disabled"):T.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,da,mxUtils.bind(this,function(){M(aa.getTarget(),aa.getColor(),null==v?!1:v.checked,N.checked,T.getLink(),U.checked,null!=ca?ca.value:null,null!=ka?ka.value:null,Y.checked,na.value,null!=V?V.checked:!1,J.value,"allPages"==k.value)}),null,mxResources.get("create"),x,F);this.showDialog(n.container,340,296+-c,!0,!0);null!=ca?(ca.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ca.select():document.execCommand("selectAll",!1,null)):null==na.parentNode;aa.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,g,l,n,x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var G=document.createElement("h3");mxUtils.write(G,mxResources.get("image"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(x?"10":"4")+"px";F.appendChild(G);if(x){mxUtils.write(F,-mxResources.get("zoom")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";L.style.width="60px";L.style.marginLeft="4px";L.style.marginRight="12px";L.value=this.lastExportZoom||"100%";F.appendChild(L);mxUtils.write(F,mxResources.get("borderWidth")+":");var M=document.createElement("input");M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.value=this.lastExportBorder||"0";F.appendChild(M);mxUtils.br(F)}var K=-this.addCheckbox(F,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Z=n?null:this.addCheckbox(F,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);G=this.editor.graph;var ja=n?null:this.addCheckbox(F,mxResources.get("transparentBackground"),G.background==mxConstants.NONE||null==G.background);null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,F,mxUtils.bind(this,function(){var da=parseInt(L.value)/100||1,ba=parseInt(M.value)||0;l(!K.checked,-null!=Z?Z.checked:!1,null!=ja?ja.checked:!1,da,ba)}),null,c,g);this.showDialog(c.container,300,(x?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,n,x,F,G,L,M){G=null!=G?G:Editor.defaultIncludeDiagram;var K=document.createElement("div");K.style.whiteSpace="nowrap";var Z=this.editor.graph,ja="jpeg"==L||"webp"==L?220:320,da=document.createElement("h3");mxUtils.write(da,c);da.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";K.appendChild(da);-mxUtils.write(K,mxResources.get("zoom")+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value=this.lastExportZoom||"100%";K.appendChild(ba);mxUtils.write(K,mxResources.get("borderWidth")+":");var na=document.createElement("input");na.setAttribute("type","text");na.style.marginRight="16px";na.style.width="60px";na.style.marginLeft="4px";na.value=this.lastExportBorder||-"0";K.appendChild(na);mxUtils.br(K);var ca=this.addCheckbox(K,mxResources.get("selectionOnly"),!1,Z.isSelectionEmpty()),ka=document.createElement("input");ka.style.marginTop="16px";ka.style.marginRight="8px";ka.style.marginLeft="24px";ka.setAttribute("disabled","disabled");ka.setAttribute("type","checkbox");var aa=document.createElement("select");aa.style.marginTop="16px";aa.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(da=0;da<c.length;da++)if(!Z.isSelectionEmpty()||"selectionOnly"!=-c[da]){var V=document.createElement("option");mxUtils.write(V,mxResources.get(c[da]));V.setAttribute("value",c[da]);aa.appendChild(V)}M?(mxUtils.write(K,mxResources.get("size")+":"),K.appendChild(aa),mxUtils.br(K),ja+=26,mxEvent.addListener(aa,"change",function(){"selectionOnly"==aa.value&&(ca.checked=!0)})):F&&(K.appendChild(ka),mxUtils.write(K,mxResources.get("crop")),mxUtils.br(K),ja+=30,mxEvent.addListener(ca,"change",function(){ca.checked?ka.removeAttribute("disabled"):ka.setAttribute("disabled",-"disabled")}));Z.isSelectionEmpty()?M&&(ca.style.display="none",ca.nextSibling.style.display="none",ca.nextSibling.nextSibling.style.display="none",ja-=30):(aa.value="diagram",ka.setAttribute("checked","checked"),ka.defaultChecked=!0,mxEvent.addListener(ca,"change",function(){aa.value=ca.checked?"selectionOnly":"diagram"}));var k=this.addCheckbox(K,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=L&&"webp"!=L),v=document.createElement("select");v.style.maxWidth="260px";v.style.marginLeft=-"8px";v.style.marginTop="16px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));v.appendChild(F);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));v.appendChild(M);"svg"==L&&mxUtils.lightDarkColorSupported?(F=document.createElement("option"),F.setAttribute("value","auto"),mxUtils.write(F,mxResources.get("automatic")),F.setAttribute("selected","selected"),v.appendChild(F)):Editor.isDarkMode()?-M.setAttribute("selected","selected"):F.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("appearance")+":");K.appendChild(v);mxUtils.br(K);ja+=26;var J=this.addCheckbox(K,mxResources.get("shadow"),Z.shadowVisible),N=null;if("png"==L||"jpeg"==L||"webp"==L)N=this.addCheckbox(K,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;Z=null!=this.pages?this.pages.length:1;var T=this.addCheckbox(K,mxResources.get("includeCopyOfMyDiagram")+(1<Z?":":""),G,null,-null,"jpeg"!=L&&"webp"!=L),W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="28px";"png"==L||"svg"==L?(G=function(){T.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},F=document.createElement("option"),F.setAttribute("value","allPages"),mxUtils.write(F,mxResources.get("allPages")),W.appendChild(F),F=document.createElement("option"),F.setAttribute("value","currentPage"),mxUtils.write(F,mxResources.get("currentPage")),W.appendChild(F),1<Z?(T.style.marginBottom=-"12px",W.style.marginBottom="16px",K.appendChild(W),mxUtils.br(K),ja+=20):T.style.marginBottom="16px",null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(T,"change",G),G()):T.style.marginBottom="16px";var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");U.id="geCheckbox-"+Editor.guid();var Y=document.createElement("input");Y.style.marginBottom="16px";Y.style.marginRight="8px";Y.setAttribute("type",-"checkbox");Y.id="geCheckbox-"+Editor.guid();g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,K.appendChild(U),G=document.createElement("label"),mxUtils.write(G,mxResources.get("embedImages")),G.setAttribute("for",U.id),K.appendChild(G),mxUtils.br(K),Y.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,K.appendChild(Y),G=document.createElement("label"),mxUtils.write(G,mxResources.get("embedFonts")),G.setAttribute("for",Y.id),K.appendChild(G),mxUtils.br(K),ja+=50);var fa=document.createElement("select");-fa.style.maxWidth="260px";fa.style.marginLeft="8px";F=document.createElement("option");F.setAttribute("value","auto");mxUtils.write(F,mxResources.get("automatic"));fa.appendChild(F);G=document.createElement("option");G.setAttribute("value","blank");mxUtils.write(G,mxResources.get("openInNewWindow"));fa.appendChild(G);G=document.createElement("option");G.setAttribute("value","self");mxUtils.write(G,mxResources.get("openInThisWindow"));fa.appendChild(G);G=document.createElement("div");mxUtils.write(G,-mxResources.get("LinksLost"));G.style.margin="7px";G.style.display="none";"svg"==L&&(mxUtils.write(K,mxResources.get("links")+":"),K.appendChild(fa),K.appendChild(G),mxUtils.br(K),mxUtils.br(K),ja+=50);l=new CustomDialog(this,K,mxUtils.bind(this,function(){this.lastExportBorder=na.value;this.lastExportZoom=ba.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=Y.checked;this.lastEmbedInclude=W.value;x(ba.value,k.checked,!ca.checked,J.checked,T.checked,U.checked&&g,na.value,ka.checked,("png"==-L||"svg"==L)&&"currentPage"==W.value,fa.value,null!=N?N.checked:null,null!=v?v.value:null,aa.value,Y.checked)}),null,l,n);this.showDialog(l.container,340,ja,!0,!0,null,null,null,null,!0);ba.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ba.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,l,n,x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var G=this.editor.graph;if(null!=g){var L=document.createElement("h3");-mxUtils.write(L,g);L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";F.appendChild(L)}var M=this.addCheckbox(F,mxResources.get("fit"),!0),K=this.addCheckbox(F,mxResources.get("shadow"),G.shadowVisible&&n,!n),Z=this.addCheckbox(F,l),ja=this.addCheckbox(F,mxResources.get("lightbox"),!0),da=this.addEditButton(F,ja),ba=da.getEditInput(),na=1<G.model.getChildCount(G.model.getRoot()),ca=this.addCheckbox(F,mxResources.get("layers"),na,!na);ca.style.marginLeft=ba.style.marginLeft;-ca.style.marginBottom="12px";ca.style.marginTop="8px";mxEvent.addListener(ja,"change",function(){ja.checked?(na&&ca.removeAttribute("disabled"),ba.removeAttribute("disabled")):(ca.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));ba.checked&&ja.checked?da.getEditSelect().removeAttribute("disabled"):da.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,F,mxUtils.bind(this,function(){c(M.checked,K.checked,Z.checked,ja.checked,da.getLink(),ca.checked)}),-null,mxResources.get("embed"),x);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,n,x,F,G,L){function M(ba){var na=" ",ca="";n&&(na=" 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!=Z?"&page="+Z:"")+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}})(this);\"",ca+="cursor:pointer;");c&&(ca+="max-width:100%;");var ka="";l&&(ka=' width="'+Math.round(K.width)+'" height="'+Math.round(K.height)+'"');G('<img src="'+ba+'"'+ka+(""!=ca?' style="'+ca+'"':"")+na+"/>")}var K=this.editor.graph.getGraphBounds(),Z=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ba){var na=n?this.getFileData(!0):null;ba=this.createImageDataUri(ba,-na,"png");M(ba)}),null,null,null,mxUtils.bind(this,function(ba){L({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),K.width*K.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var ja="";l&&(ja="&w="+Math.round(2*K.width)+"&h="+Math.round(2*K.height));var da=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+ja+"&xml="+encodeURIComponent(g));da.send(mxUtils.bind(this,function(){200<=da.getStatus()&&299>=-da.getStatus()?M("data:image/png;base64,"+da.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,n,x,F,G){var L=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),M=L.getElementsByTagName("a");if(null!=M)for(var K=0;K<M.length;K++){var Z=M[K].getAttribute("href");null!=Z&&"#"==Z.charAt(0)&&"_blank"==M[K].getAttribute("target")&&M[K].removeAttribute("target")}n&&+/(\.html)$/i.test(g)||(g=g+"."+(null!=F?F:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=n?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,+l,n);else{var G=document.createElement("a");F=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof G.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);F=65==(L?parseInt(L[2],10):!1)?!1:F}if(F||this.isOffline()){G.href=URL.createObjectURL(n?this.base64ToBlob(c,l):new Blob([c],{type:l}));F?G.download=g:G.setAttribute("target","_blank");document.body.appendChild(G);try{window.setTimeout(function(){URL.revokeObjectURL(G.href)},+2E4),G.click(),G.parentNode.removeChild(G)}catch(M){}}else this.createEchoRequest(c,g,l,n,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,l,n,x,F){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=F?"&base64="+F:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,g,l,n,x,F,G,L,M){F=null!=F?F:!1;G=null!=G?G:"vsdx"!=x&&(!mxClient.IS_IOS||+!navigator.standalone);var K=mxUtils.bind(this,function(ja,da,ba,na){try{if("_blank"==da)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,n);else if(null!=l&&"text/html"==l.substring(0,9)){var ca=new EmbedDialog(this,c);this.showDialog(ca.container,450,240,!0,!0);ca.init()}else{var ka=window.open("about:blank");null==ka?mxUtils.popup(c,!0):(ka.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),ka.document.close())}else if(da==App.MODE_DEVICE||"download"==da)this.doSaveLocalFile(c,+ja,l,n,null,L);else if(null!=ja&&0<ja.length){var aa=mxUtils.bind(this,function(V){try{this.exportFile(c,ja,l,n,da,V)}catch(k){this.handleError(k)}});null!=na?aa(na):this.pickFolder(da,aa)}}catch(V){this.handleError(V)}});x=[];F||x.push(App.MODE_BROWSER);G||x.push("_blank");var Z=new SaveDialog(this,g,mxUtils.bind(this,function(ja,da,ba){K(ja.value,da,ja,ba);this.hideDialog(null,null,Z.container)}),x,c,l,n,M);this.showDialog(Z.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));+Z.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var x="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var F=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=F&&(x="background: "+F+";")}x='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+x+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||l?(F=l?c:btoa(unescape(encodeURIComponent(c))),+n.document.write(x+'<img style="max-width:100%;" src="data:'+g+";base64,"+F+'"/></body></html>')):n.document.write(x+c+"</body></html>"):n.document.write(x+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");n.document.close()}};var t=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){this.tagsDialog=this.tagsComponent=null;var g=c(mxUtils.bind(this,function(n){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 x=g.getBoundingClientRect();this.tagsDialog.style.left=x.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=x.zIndex;document.body.appendChild(this.tagsDialog);+this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();g.style.display=0<n.length?"":"none"}))}t.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()){this.exportDialog=null;var l=c(mxUtils.bind(this,function(n){var x=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",x);null!=this.exportDialog&&+(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)x.apply(this);else{this.exportDialog=document.createElement("div");var F=l.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=F.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";F=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=F.zIndex;var G=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});G.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",x);this.editor.exportToCanvas(mxUtils.bind(this,function(L){G.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var M=this.createImageDataUri(L,null,"png");L=document.createElement("img");L.style.maxWidth="140px";L.style.maxHeight="140px";+L.style.cursor="pointer";L.style.backgroundColor="white";L.setAttribute("title",mxResources.get("openInNewWindow"));L.setAttribute("border","0");L.setAttribute("src",M);this.exportDialog.appendChild(L);mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.openInNewWindow(M.substring(M.indexOf(",")+1),"image/png",!0);x.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(L){G.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),+this.exportDialog=null);this.handleError(L)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,n,x,F){this.isLocalFileSave()?this.saveLocalFile(l,c,n,x,g,F):this.saveRequest(c,g,mxUtils.bind(this,function(G,L){return this.createEchoRequest(l,G,n,x,g,L)}),l,x,n)};EditorUi.prototype.saveRequest=function(c,g,l,n,x,F,G){G=null!=G?G:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,+function(K,Z,ja,da){if("_blank"==Z||null!=K&&0<K.length){var ba=l("_blank"==Z?null:K,Z==App.MODE_DEVICE||"download"==Z||null==Z||"_blank"==Z?"0":"1");null!=ba&&(Z==App.MODE_DEVICE||"download"==Z||"_blank"==Z?ba.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(na){F=null!=F?F:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,K,F,!0,Z,na)}catch(ca){this.handleError(ca)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ba.send(mxUtils.bind(this,function(){this.spinner.stop();+if(200<=ba.getStatus()&&299>=ba.getStatus())try{this.exportFile(ba.getText(),K,F,!0,Z,na)}catch(ca){this.handleError(ca)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(ca){this.spinner.stop();this.handleError(ca)}))}),null!=da?ja(da):this.pickFolder(Z,ja)))}});x=[App.MODE_BROWSER];G||x.push("_blank");var M=new SaveDialog(this,c,mxUtils.bind(this,function(K,Z,ja){L(K.value,Z,K,ja);this.hideDialog(null,null,M.container)}),x,null,"application/pdf");this.showDialog(M.container,+420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));M.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,g,l,n,x,F){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,n,x,F,+G,L,M,K,Z,ja,da,ba){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba)}));this.handleError(la)})))try{var na=this.editor.graph.isSelectionEmpty();l=null!=l?l:na;var ca=g?null:this.editor.graph.background;ca==mxConstants.NONE&&(ca=null);null==ca&&0==g&&(ca=this.editor.graph.shapeBackgroundColor);var ka=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var aa=mxUtils.lightDarkColorSupported,V=mxUtils.preferDarkColor;if("light"==Z||"dark"==Z)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Z;var k=Graph.addFont,v={};Graph.addFont=function(la,qa,ya,wa){k.call(this,la,qa,ya,v)};var J=this.editor.graph.createSvgImageExport(x),N=J.drawCellState;J.drawCellState=function(la,qa){null!=la&&Graph.processFontStyle(la.style);N.apply(this,arguments)};var T=this.editor.graph.getSvg(ca,+c,G,L,null,l,null,J,"blank"==K?"_blank":"self"==K?"_top":null,null,!da,Z,ja);mxUtils.lightDarkColorSupported=aa;mxUtils.preferDarkColor=V;this.editor.graph.addForeignObjectWarning=ka;n&&this.editor.graph.addSvgShadow(T);var W=this.getBaseFilename()+(x?".drawio":"")+".svg";ba=null!=ba?ba:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=MAX_REQUEST_SIZE?this.saveData(W,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,+function(){mxUtils.popup(la)}))});var U=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,l,M,null,null,null,null,null,c,G));ba(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(T);var Y=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&F&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&da?this.replaceAlternateContent(la,+Z,U):U(la)}),fa=Graph.customFontElements;Graph.customFontElements=v;var oa=mxUtils.bind(this,function(la){Graph.customFontElements=fa;Graph.addFont=k;F&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,Y,this.thumbImageCache)):Y(la)});da?this.embedFonts(T,oa):(this.editor.addFontCss(T),oa(T))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function n(ja,da,ba,na,ca){var ka=mxUtils.createElementNs(c.ownerDocument,+mxConstants.NS_SVG,"image");ka.setAttribute("x",da);ka.setAttribute("y",ba+.5);ka.setAttribute("width",na.width);ka.setAttribute("height",na.height);null==ka.setAttributeNS?ka.setAttribute("xlink:href",ca):ka.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ca);ja.replaceChild(ka,ja.lastChild);L()}function x(){if(G<Z.length)Z[G++](x)}var F="";g=c.getElementsByTagName("style");for(var G=0;G<g.length;G++)F+=g[G].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var L=mxUtils.bind(this,function(){counter--;+0==counter&&l(c)}),M={},K={},Z=[];for(G=0;G<g.length;G++)mxUtils.bind(this,function(ja){var da=ja.getElementsByTagName("div");if(0<da.length)try{var ba=da[0].cloneNode(!0),na=parseInt(ba.style.marginLeft),ca=parseInt(ba.style.paddingTop),ka=ba.getElementsByTagName("div")[1],aa=da=!1,V=ba.style.alignItems,k=ba.style.justifyContent;if(null!=ba.style.writingMode){var v=ba.style.writingMode;aa="vertical-"==v.substring(0,9);da="-rl"==v.substring(v.length-3)}var J=!aa&&"1px"==ba.style.width||aa&&"1px"==+ba.style.height;if(!aa&&"1px"==ba.style.height||aa&&"1px"==ba.style.width)ba.style.alignItems=aa&&da?"unsafe flex-end":"unsafe flex-start";J&&(ba.style.justifyContent="unsafe flex-start");ba.style.paddingTop="";ba.style.marginLeft="";var N=ba.outerHTML,T=M[N];null==T&&(ba.style.position="absolute",ba.style.visibility="hidden",document.body.appendChild(ba),v=1,v="1px"==ba.style.width?ka.offsetWidth:parseInt(ba.style.width),J=1,J="1px"==ba.style.height?ka.offsetHeight:parseInt(ba.style.height),document.body.removeChild(ba),+T=new mxRectangle(na,ca,v,J),M[N]=T);"1px"==ba.style.height&&("unsafe center"==V?ca-=T.height/2:"unsafe flex-end"==V&&(ca-=T.height));if("1px"==ba.style.width)if(!aa&&"unsafe center"==k||aa&&"unsafe center"==V)na-=T.width/2;else if(!aa&&"unsafe flex-end"==k||aa&&(!da&&"unsafe flex-end"==V||da&&"unsafe flex-start"==V))na-=T.width;T=new mxRectangle(na,ca,T.width,T.height+parseInt(ka.style.fontSize)/4);Z.push(mxUtils.bind(this,function(W){var U=K[N];null==U?Graph.htmlToPng(N,T.width,T.height,mxUtils.bind(this,+function(Y){n(ja,na,ca,T,Y);K[N]=Y;W()}),F):(n(ja,na,ca,T,U),W())}))}catch(W){L()}else L()})(g[G]);0==counter&&l(c);G=0;x()};EditorUi.prototype.addRadiobox=function(c,g,l,n,x,F,G){return this.addCheckbox(c,l,n,x,F,G,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,n,x,F,G,L){F=null!=F?F:!0;var M=document.createElement("input");M.style.marginRight="8px";M.style.marginTop="16px";M.setAttribute("type",G?"radio":"checkbox");G="geCheckbox-"+Editor.guid();M.id=G;null!=L&&M.setAttribute("name",L);l&&+(M.setAttribute("checked","checked"),M.defaultChecked=!0);n&&M.setAttribute("disabled","disabled");F&&(c.appendChild(M),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",G),c.appendChild(l),x||mxUtils.br(c));return M};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var n=this.getCurrentFile(),x="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(x=window.location.href);+var F=document.createElement("select");F.style.maxWidth="200px";F.style.width="auto";F.style.marginLeft="8px";F.style.marginRight="10px";F.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));F.appendChild(n);var G=document.createElement("option");G.setAttribute("value","custom");mxUtils.write(G,mxResources.get("custom")+"...");F.appendChild(G);c.appendChild(F);mxEvent.addListener(F,"change",mxUtils.bind(this,function(){if("custom"==+F.value){var L=new FilenameDialog(this,x,mxResources.get("ok"),function(M){null!=M?(x=M,G.setAttribute("title",M)):(F.value="blank",G.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){F.value="blank"});this.showDialog(L.container,300,80,!0,!1);L.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?+"blank"===F.value?"_blank":x:null},getEditInput:function(){return l},getEditSelect:function(){return F}}};EditorUi.prototype.addLinkSection=function(c,g){function l(){var L=document.createElement("div");L.style.width="100%";L.style.height="100%";L.style.boxSizing="border-box";null!=F&&F!=mxConstants.NONE?(L.style.border="1px solid black",L.style.backgroundColor=F):(L.style.backgroundPosition="center center",L.style.backgroundRepeat="no-repeat",L.style.backgroundImage="url('"+Dialog.prototype.closeImage++"')");G.innerText="";G.appendChild(L)}mxUtils.write(c,mxResources.get("links")+":");var n=document.createElement("select");n.style.width="100px";n.style.padding="0px";n.style.marginLeft="8px";n.style.marginRight="10px";n.className="geBtn";var x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));n.appendChild(x);+x=document.createElement("option");x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));n.appendChild(x);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var F="#0000ff",G=null;G=mxUtils.button("",mxUtils.bind(this,function(L){this.pickColor(F||"none",function(M){F=M;l()});+mxEvent.consume(L)}));l();G.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";G.style.marginLeft="4px";G.style.height="22px";G.style.width="22px";G.style.position="relative";G.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";G.className="geColorBtn";c.appendChild(G);mxUtils.br(c);return{getColor:function(){return F},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,n,x,F){F=null!=F?F:[];l&&(F.push("lightbox=1"),+"auto"!=c&&F.push("target="+c),null!=g&&g!=mxConstants.NONE&&F.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=n&&0<n.length&&F.push("edit="+encodeURIComponent(n)),x&&F.push("layers=1"),this.editor.graph.foldingEnabled&&F.push("nav=1"));return F};EditorUi.prototype.createLink=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){var ba=this.getCurrentFile();M=this.createUrlParameters(c,g,n,x,F,M);c=!0;null!=G?l="#U"+encodeURIComponent(G):L||null==ba||""==ba.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="#"+ba.getHash(),c=!1);c&&null!=ba&&null!=ba.getTitle()&&ba.getTitle()!=this.defaultFilename&&M.push("title="+encodeURIComponent(ba.getTitle()));K&&1<l.length&&(M.push("open="+l.substring(1)),l="");Z&&null!=this.currentPage&&M.push("page-id="+this.currentPage.getId());ja&&M.push("transparent=1");null!=da&&M.push("dark="+da);return(n&&(null!=G||null!=ba&&ba.getMode()!=App.MODE_GITHUB&&ba.getMode()!=+App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<M.length?"?"+M.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){this.getBasenames();var ba={};""!=x&&x!=mxConstants.NONE&&(ba.highlight=x);"auto"!==n&&(ba.target=n);K||(ba.lightbox=!1);ba.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(ba.zoom=l/100);+l=[];G&&(l.push("pages"),ba.resize=!0,null!=this.pages&&null!=this.currentPage&&(ba.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),ba.resize=!0);L&&l.push("layers");M&&l.push("tags");null!=da&&(ba["dark-mode"]=da);0<l.length&&(K&&l.push("lightbox"),ba.toolbar=l.join(" "));null!=Z&&0<Z.length&&(ba.edit=Z);null!=c?ba.url=c:ba.xml=this.getFileData(!0,null,null,null,null,!G);g='<div class="mxgraph" style="'+(F?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'++mxUtils.htmlEntities(JSON.stringify(ba))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<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.showHtmlDialog=function(c,g,l,n){var x=document.createElement("div");+x.style.whiteSpace="nowrap";var F=document.createElement("h3");mxUtils.write(F,mxResources.get("html"));F.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";x.appendChild(F);var G=document.createElement("div");G.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name",+"type-embedhtmldialog");F=L.cloneNode(!0);F.setAttribute("value","copy");G.appendChild(F);var M=document.createElement("span");mxUtils.write(M,mxResources.get("includeCopyOfMyDiagram"));G.appendChild(M);mxUtils.br(G);G.appendChild(L);M=document.createElement("span");mxUtils.write(M,mxResources.get("publicDiagramUrl"));G.appendChild(M);var K=this.getCurrentFile();null==l&&null!=K&&K.constructor==window.DriveFile&&(M=document.createElement("a"),M.style.paddingLeft="12px",M.style.color="gray",M.style.cursor=+"pointer",mxUtils.write(M,mxResources.get("share")),G.appendChild(M),mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(K.getId(),K)})));F.setAttribute("checked","checked");null==l&&L.setAttribute("disabled","disabled");x.appendChild(G);G=380;var Z=this.addLinkSection(x),ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";ja.style.marginTop="16px";M=document.createElement("option");M.setAttribute("value","light");+mxUtils.write(M,mxResources.get("light"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","auto");mxUtils.write(M,mxResources.get("automatic"));M.setAttribute("selected","selected");ja.appendChild(M);M.setAttribute("selected","selected");mxUtils.write(x,mxResources.get("appearance")+":");x.appendChild(ja);mxUtils.br(x);G+=26;var da=this.addCheckbox(x,+mxResources.get("zoom"),!0,null,!0);mxUtils.write(x,":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value="100%";x.appendChild(ba);var na=this.addCheckbox(x,mxResources.get("fit"),!0);M=null!=this.pages&&1<this.pages.length;var ca=ca=this.addCheckbox(x,mxResources.get("allPages"),M,!M),ka=this.addCheckbox(x,mxResources.get("layers"),!0),aa=this.addCheckbox(x,mxResources.get("tags"),+!0),V=this.addCheckbox(x,mxResources.get("lightbox"),!0),k=null;if(EditorUi.enableHtmlEditOption){k=this.addEditButton(x,V);var v=k.getEditInput();v.style.marginBottom="16px";G+=50;mxEvent.addListener(V,"change",function(){V.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");v.checked&&V.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,x,mxUtils.bind(this,function(){n(L.checked?l:null,da.checked,+ba.value,Z.getTarget(),Z.getColor(),na.checked,ca.checked,ka.checked,aa.checked,V.checked,null!=k?k.getLink():null,null!=ja?ja.value:null)}),null,c,g);this.showDialog(c.container,340,G,!0,!0);F.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,n,x,F,G,L,M,K,Z,ja){var da=document.createElement("div");da.style.whiteSpace="nowrap";var ba=document.createElement("h3");mxUtils.write(ba,c||mxResources.get("publish"));ba.style.width="100%";ba.style.textAlign="center";ba.style.marginTop="2px";+ba.style.marginBottom="20px";da.appendChild(ba);var na=document.createElement("select");c=30;na.className="geBtn";na.style.marginBottom="8px";na.style.marginLeft="0px";na.style.width="100%";na.style.boxSizing="border-box";if(null==L||""==L.getHash())x=null!=x?x:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ba=document.createElement("option"),mxUtils.write(ba,mxResources.get("makeCopy")),ba.setAttribute("value","copy"),na.appendChild(ba);ba=document.createElement("option");mxUtils.write(ba,+mxResources.get("authorizationRequired"));ba.setAttribute("value","auth");na.appendChild(ba);null!=L&&""!=L.getHash()||ba.setAttribute("disabled","disabled");L=document.createElement("option");L.setAttribute("value","public");na.appendChild(L);null!=G?(mxUtils.write(L,mxResources.get("publicDiagramUrl")),L.setAttribute("title",G),na.value="public"):(mxUtils.write(L,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),L.setAttribute("disabled","disabled"));da.appendChild(na);+mxUtils.br(da);na.focus();var ca=null,ka=null;if(null!=g||null!=l)c+=30,mxUtils.write(da,mxResources.get("width")+":"),ca=document.createElement("input"),ca.setAttribute("type","text"),ca.style.marginRight="16px",ca.style.width="50px",ca.style.marginLeft="6px",ca.style.marginRight="16px",ca.style.marginBottom="10px",ca.value="100%",da.appendChild(ca),mxUtils.write(da,mxResources.get("height")+":"),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.style.width="50px",ka.style.marginLeft=+"6px",ka.style.marginBottom="10px",ka.value=l+"px",da.appendChild(ka),mxUtils.br(da);var aa=this.addLinkSection(da,n),V=K?this.addCheckbox(da,mxResources.get("transparentBackground"),!1):null;null!=V&&(c+=20);var k=document.createElement("select");k.className="geBtn";k.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");k.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));+g.setAttribute("value","currentPage");k.appendChild(g);var v=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(da,mxResources.get("pages")+":"),da.appendChild(k),mxUtils.br(da),c+=30),v=this.addCheckbox(da,mxResources.get("selectedPage")+": "+g));var J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft="8px";J.style.marginTop=+"16px";ja=document.createElement("option");ja.setAttribute("value","0");mxUtils.write(ja,mxResources.get("light"));J.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));J.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected","selected");J.appendChild(ja);Z&&(mxUtils.write(da,mxResources.get("appearance")+":"),da.appendChild(J),+mxUtils.br(da),c+=30);var N=this.addCheckbox(da,mxResources.get("lightbox"),!0,null,null,!n),T=this.addEditButton(da,N),W=T.getEditInput();n&&(W.style.marginLeft=N.style.marginLeft,N.style.display="none",c-=20);var U=this.addCheckbox(da,mxResources.get("layers"),!0);U.style.marginLeft=W.style.marginLeft;U.style.marginTop="8px";var Y=this.addCheckbox(da,mxResources.get("tags"),!0);Y.style.marginLeft=W.style.marginLeft;Y.style.marginBottom="16px";Y.style.marginTop="16px";mxEvent.addListener(N,"change",+function(){N.checked?(U.removeAttribute("disabled"),W.removeAttribute("disabled"),Y.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),Y.setAttribute("disabled","disabled"));W.checked&&N.checked?T.getEditSelect().removeAttribute("disabled"):T.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,da,mxUtils.bind(this,function(){M(aa.getTarget(),aa.getColor(),null==v?!1:v.checked,N.checked,T.getLink(),U.checked,null!=ca?+ca.value:null,null!=ka?ka.value:null,Y.checked,na.value,null!=V?V.checked:!1,J.value,"allPages"==k.value)}),null,mxResources.get("create"),x,F);this.showDialog(n.container,340,296+c,!0,!0);null!=ca?(ca.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ca.select():document.execCommand("selectAll",!1,null)):null==na.parentNode;aa.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,g,l,n,x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var G=document.createElement("h3");+mxUtils.write(G,mxResources.get("image"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(x?"10":"4")+"px";F.appendChild(G);if(x){mxUtils.write(F,mxResources.get("zoom")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";L.style.width="60px";L.style.marginLeft="4px";L.style.marginRight="12px";L.value=this.lastExportZoom||"100%";F.appendChild(L);mxUtils.write(F,mxResources.get("borderWidth")+":");var M=document.createElement("input");+M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.value=this.lastExportBorder||"0";F.appendChild(M);mxUtils.br(F)}var K=this.addCheckbox(F,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Z=n?null:this.addCheckbox(F,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);G=this.editor.graph;var ja=n?null:this.addCheckbox(F,mxResources.get("transparentBackground"),G.background==mxConstants.NONE||null==G.background);+null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,F,mxUtils.bind(this,function(){var da=parseInt(L.value)/100||1,ba=parseInt(M.value)||0;l(!K.checked,null!=Z?Z.checked:!1,null!=ja?ja.checked:!1,da,ba)}),null,c,g);this.showDialog(c.container,300,(x?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,n,x,F,G,L,M){G=null!=G?G:Editor.defaultIncludeDiagram;var K=document.createElement("div");K.style.whiteSpace="nowrap";var Z=this.editor.graph,ja="jpeg"==L||"webp"==+L?220:320,da=document.createElement("h3");mxUtils.write(da,c);da.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";K.appendChild(da);mxUtils.write(K,mxResources.get("zoom")+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value=this.lastExportZoom||"100%";K.appendChild(ba);mxUtils.write(K,mxResources.get("borderWidth")+":");var na=document.createElement("input");+na.setAttribute("type","text");na.style.marginRight="16px";na.style.width="60px";na.style.marginLeft="4px";na.value=this.lastExportBorder||"0";K.appendChild(na);mxUtils.br(K);var ca=this.addCheckbox(K,mxResources.get("selectionOnly"),!1,Z.isSelectionEmpty()),ka=document.createElement("input");ka.style.marginTop="16px";ka.style.marginRight="8px";ka.style.marginLeft="24px";ka.setAttribute("disabled","disabled");ka.setAttribute("type","checkbox");var aa=document.createElement("select");aa.style.marginTop=+"16px";aa.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(da=0;da<c.length;da++)if(!Z.isSelectionEmpty()||"selectionOnly"!=c[da]){var V=document.createElement("option");mxUtils.write(V,mxResources.get(c[da]));V.setAttribute("value",c[da]);aa.appendChild(V)}M?(mxUtils.write(K,mxResources.get("size")+":"),K.appendChild(aa),mxUtils.br(K),ja+=26,mxEvent.addListener(aa,"change",function(){"selectionOnly"==aa.value&&(ca.checked=!0)})):F&&(K.appendChild(ka),mxUtils.write(K,mxResources.get("crop")),+mxUtils.br(K),ja+=30,mxEvent.addListener(ca,"change",function(){ca.checked?ka.removeAttribute("disabled"):ka.setAttribute("disabled","disabled")}));Z.isSelectionEmpty()?M&&(ca.style.display="none",ca.nextSibling.style.display="none",ca.nextSibling.nextSibling.style.display="none",ja-=30):(aa.value="diagram",ka.setAttribute("checked","checked"),ka.defaultChecked=!0,mxEvent.addListener(ca,"change",function(){aa.value=ca.checked?"selectionOnly":"diagram"}));var k=this.addCheckbox(K,mxResources.get("transparentBackground"),+!1,null,null,"jpeg"!=L&&"webp"!=L),v=document.createElement("select");v.style.maxWidth="260px";v.style.marginLeft="8px";v.style.marginTop="16px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));v.appendChild(F);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));v.appendChild(M);"svg"==L&&mxUtils.lightDarkColorSupported?(F=document.createElement("option"),F.setAttribute("value","auto"),+mxUtils.write(F,mxResources.get("automatic")),F.setAttribute("selected","selected"),v.appendChild(F)):Editor.isDarkMode()?M.setAttribute("selected","selected"):F.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("appearance")+":");K.appendChild(v);mxUtils.br(K);ja+=26;var J=this.addCheckbox(K,mxResources.get("shadow"),Z.shadowVisible),N=null;if("png"==L||"jpeg"==L||"webp"==L)N=this.addCheckbox(K,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;Z=+null!=this.pages?this.pages.length:1;var T=this.addCheckbox(K,mxResources.get("includeCopyOfMyDiagram")+(1<Z?":":""),G,null,null,"jpeg"!=L&&"webp"!=L),W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="28px";"png"==L||"svg"==L?(G=function(){T.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},F=document.createElement("option"),F.setAttribute("value","allPages"),mxUtils.write(F,mxResources.get("allPages")),W.appendChild(F),F=document.createElement("option"),+F.setAttribute("value","currentPage"),mxUtils.write(F,mxResources.get("currentPage")),W.appendChild(F),1<Z?(T.style.marginBottom="12px",W.style.marginBottom="16px",K.appendChild(W),mxUtils.br(K),ja+=20):T.style.marginBottom="16px",null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(T,"change",G),G()):T.style.marginBottom="16px";var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");U.id="geCheckbox-"++Editor.guid();var Y=document.createElement("input");Y.style.marginBottom="16px";Y.style.marginRight="8px";Y.setAttribute("type","checkbox");Y.id="geCheckbox-"+Editor.guid();g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,K.appendChild(U),G=document.createElement("label"),mxUtils.write(G,mxResources.get("embedImages")),G.setAttribute("for",U.id),K.appendChild(G),mxUtils.br(K),Y.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,K.appendChild(Y),G=document.createElement("label"),+mxUtils.write(G,mxResources.get("embedFonts")),G.setAttribute("for",Y.id),K.appendChild(G),mxUtils.br(K),ja+=50);var fa=document.createElement("select");fa.style.maxWidth="260px";fa.style.marginLeft="8px";F=document.createElement("option");F.setAttribute("value","auto");mxUtils.write(F,mxResources.get("automatic"));fa.appendChild(F);G=document.createElement("option");G.setAttribute("value","blank");mxUtils.write(G,mxResources.get("openInNewWindow"));fa.appendChild(G);G=document.createElement("option");+G.setAttribute("value","self");mxUtils.write(G,mxResources.get("openInThisWindow"));fa.appendChild(G);G=document.createElement("div");mxUtils.write(G,mxResources.get("LinksLost"));G.style.margin="7px";G.style.display="none";"svg"==L&&(mxUtils.write(K,mxResources.get("links")+":"),K.appendChild(fa),K.appendChild(G),mxUtils.br(K),mxUtils.br(K),ja+=50);l=new CustomDialog(this,K,mxUtils.bind(this,function(){this.lastExportBorder=na.value;this.lastExportZoom=ba.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=+Y.checked;this.lastEmbedInclude=W.value;x(ba.value,k.checked,!ca.checked,J.checked,T.checked,U.checked&&g,na.value,ka.checked,("png"==L||"svg"==L)&&"currentPage"==W.value,fa.value,null!=N?N.checked:null,null!=v?v.value:null,aa.value,Y.checked)}),null,l,n);this.showDialog(l.container,340,ja,!0,!0,null,null,null,null,!0);ba.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ba.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,l,n,+x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var G=this.editor.graph;if(null!=g){var L=document.createElement("h3");mxUtils.write(L,g);L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";F.appendChild(L)}var M=this.addCheckbox(F,mxResources.get("fit"),!0),K=this.addCheckbox(F,mxResources.get("shadow"),G.shadowVisible&&n,!n),Z=this.addCheckbox(F,l),ja=this.addCheckbox(F,mxResources.get("lightbox"),!0),da=this.addEditButton(F,ja),ba=da.getEditInput(),+na=1<G.model.getChildCount(G.model.getRoot()),ca=this.addCheckbox(F,mxResources.get("layers"),na,!na);ca.style.marginLeft=ba.style.marginLeft;ca.style.marginBottom="12px";ca.style.marginTop="8px";mxEvent.addListener(ja,"change",function(){ja.checked?(na&&ca.removeAttribute("disabled"),ba.removeAttribute("disabled")):(ca.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));ba.checked&&ja.checked?da.getEditSelect().removeAttribute("disabled"):da.getEditSelect().setAttribute("disabled",+"disabled")});g=new CustomDialog(this,F,mxUtils.bind(this,function(){c(M.checked,K.checked,Z.checked,ja.checked,da.getLink(),ca.checked)}),null,mxResources.get("embed"),x);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,n,x,F,G,L){function M(ba){var na=" ",ca="";n&&(na=" 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!=Z?"&page="+Z:"")+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}})(this);\"",ca+="cursor:pointer;");c&&(ca+="max-width:100%;");var ka="";l&&(ka=' width="'+Math.round(K.width)+'" height="'+Math.round(K.height)+'"');G('<img src="'+ba+'"'+ka+(""!=ca?' style="'+ca+'"':"")+na+"/>")}var K=this.editor.graph.getGraphBounds(),Z=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ba){var na=n?this.getFileData(!0):+null;ba=this.createImageDataUri(ba,na,"png");M(ba)}),null,null,null,mxUtils.bind(this,function(ba){L({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),K.width*K.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var ja="";l&&(ja="&w="+Math.round(2*K.width)+"&h="+Math.round(2*K.height));var da=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+ja+"&xml="+encodeURIComponent(g));da.send(mxUtils.bind(this,function(){200<=+da.getStatus()&&299>=da.getStatus()?M("data:image/png;base64,"+da.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,n,x,F,G){var L=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),M=L.getElementsByTagName("a");if(null!=M)for(var K=0;K<M.length;K++){var Z=M[K].getAttribute("href");null!=Z&&"#"==Z.charAt(0)&&"_blank"==M[K].getAttribute("target")&&M[K].removeAttribute("target")}n&&L.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(L);if(l){var ja=" ",da="";n&&(ja="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"+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}})(this);\"",da+="cursor:pointer;");c&&(da+="max-width:100%;");this.editor.convertImages(L,mxUtils.bind(this,function(ba){G('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ba))+'"'+(""!=da?' style="'+da+'"':"")+ja+"/>")}))}else da="",n&&(g=this.getSelectedPageIndex(),L.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"+(null!=g?"&page="+g:"")+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}}})(this);"),da+="cursor:pointer;"),c&&(c=parseInt(L.getAttribute("width")),x=parseInt(L.getAttribute("height")),L.setAttribute("viewBox","-0.5 -0.5 "+c+" "+x),da+="max-width:100%;max-height:"+x+"px;",L.removeAttribute("height")),""!=da&&L.setAttribute("style",da),this.editor.addFontCss(L),this.editor.graph.mathEnabled&&this.editor.addMathCss(L),G(mxUtils.getXml(L))};EditorUi.prototype.timeSince=@@ -4213,15 +4213,15 @@ Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-sGraphViewer.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.init=function(b,f,m){GraphViewer.initCss();this.graphConfig=null!=m?m:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.autoCrop=null!=this.graphConfig["auto-crop"]?this.graphConfig["auto-crop"]:this.autoCrop;this.autoOrigin=null!=this.graphConfig["auto-origin"]?this.graphConfig["auto-origin"]:this.autoOrigin;this.allowZoomOut=null!=this.graphConfig["allow-zoom-out"]?this.graphConfig["allow-zoom-out"]:this.allowZoomOut;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;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.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.editEnabled=0<=mxUtils.indexOf(this.toolbarItems,"editlocal");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.editor=null;var t=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=f&&(this.xmlDocument=f.ownerDocument,-this.xmlNode=f,this.xml=mxUtils.getXml(f),null!=b)){var y=mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var I=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?I.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(I.style.padding="8px");I.style.forcedColorAdjust="none";I.style.boxSizing="border-box";I.style.overflow="visible";-this.graph.fit=function(){};this.graph.sizeDidChange=function(){var x=this.view.graphBounds,F=this.view.translate;I.setAttribute("viewBox",x.x+F.x-this.panDx+" "+(x.y+F.y-this.panDy)+" "+(x.width+1)+" "+(x.height+1));this.container.style.backgroundColor=I.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",x))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(x){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.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=f)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(x){}this.graph.getImageFromBundles=function(x){return t.getImageUrl(x)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,-null,!0);if("mxfile"==this.xmlNode.nodeName){var D=this.xmlNode.getElementsByTagName("diagram");if(0<D.length){if(null!=this.pageId)for(S=0;S<D.length;S++)if(this.pageId==D[S].getAttribute("id")){this.currentPage=S;break}var P=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(x){var F=D[t.currentPage];return"page"==x?F.getAttribute("name")||"Page-"+(t.currentPage+1):"pagenumber"==x?t.currentPage+1:"pagecount"==x?D.length:P.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=-function(x){this.handlingResize||(this.currentPage=mxUtils.mod(x,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(x){x=this.getIndexById(x);var F=0<=x;F&&this.selectPage(x);return F};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});var g=this.graph.setBackgroundImage;this.graph.setBackgroundImage=-function(x){if(null!=x&&Graph.isPageLink(x.src)){var F=x.src,G=F.indexOf(",");0<G&&(G=t.getIndexById(F.substring(G+1)),0<=G&&(x=t.getImageForGraphModel(Editor.parseDiagramNode(t.diagrams[G])),x.originalSrc=F))}g.apply(this,arguments)};var l=this.graph.getGraphBounds;this.graph.getGraphBounds=function(x){var F=l.apply(this,arguments);x=this.backgroundImage;if(null!=x){var G=this.view.translate,L=this.view.scale;F=mxRectangle.fromRectangle(F);F.add(new mxRectangle((G.x+x.x)*L,(G.y+x.y)*L,x.width*L,-x.height*L))}return F};this.addListener("xmlNodeChanged",S);S();urlParams.page=t.currentPage;S=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,S=this.setLayersVisible(),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.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.editor=null;var t=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=f&&(this.xmlDocument=f.ownerDocument,this.xmlNode=f,this.xml=mxUtils.getXml(f),null!=b)){var y=+mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var I=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?I.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(I.style.padding="8px");I.style.forcedColorAdjust="none";I.style.boxSizing="border-box";I.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var x=+this.view.graphBounds,F=this.view.translate;I.setAttribute("viewBox",x.x+F.x-this.panDx+" "+(x.y+F.y-this.panDy)+" "+(x.width+1)+" "+(x.height+1));this.container.style.backgroundColor=I.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",x))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(x){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.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=f)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(x){}this.graph.getImageFromBundles=function(x){return t.getImageUrl(x)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var D=+this.xmlNode.getElementsByTagName("diagram");if(0<D.length){if(null!=this.pageId)for(S=0;S<D.length;S++)if(this.pageId==D[S].getAttribute("id")){this.currentPage=S;break}var P=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(x){var F=D[t.currentPage];return"page"==x?F.getAttribute("name")||"Page-"+(t.currentPage+1):"pagenumber"==x?t.currentPage+1:"pagecount"==x?D.length:P.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(x){this.handlingResize||(this.currentPage=+mxUtils.mod(x,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(x){x=this.getIndexById(x);var F=0<=x;F&&this.selectPage(x);return F};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});var g=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(x){if(null!=x&&+Graph.isPageLink(x.src)){var F=x.src,G=F.indexOf(",");0<G&&(G=t.getIndexById(F.substring(G+1)),0<=G&&(x=t.getImageForGraphModel(Editor.parseDiagramNode(t.diagrams[G])),x.originalSrc=F))}g.apply(this,arguments)};var l=this.graph.getGraphBounds;this.graph.getGraphBounds=function(x){var F=l.apply(this,arguments);x=this.backgroundImage;if(null!=x){var G=this.view.translate,L=this.view.scale;F=mxRectangle.fromRectangle(F);F.add(new mxRectangle((G.x+x.x)*L,(G.y+x.y)*L,x.width*L,x.height*L))}return F};this.addListener("xmlNodeChanged",+S);S();urlParams.page=t.currentPage;S=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,S=this.setLayersVisible(),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(x){return!mxEvent.isPopupTrigger(x.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!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(x,F){try{if(Graph.isPageLink(x)){var G=x.indexOf(",");t.selectPageById(x.substring(G+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var L=this.getGraphBounds();this.handleCustomLink(x,F);L.equals(this.getGraphBounds())||t.crop()}}catch(M){alert(M.message)}return!0};var n=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return n.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 q=@@ -4262,12 +4262,11 @@ g.style.fontSize="11px";g.style.overflowY="auto";g.style.maxHeight=this.graph.cofunction(){K.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"});K.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"}}else if("tags"==G){if(this.tagsEnabled){var Z=P(mxUtils.bind(this,function(ba){null==l&&(l=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),l.div.getElementsByTagName("div")[0].style.position="",l.div.style.maxHeight="160px",l.div.style.maxWidth="120px",l.div.style.padding="2px",l.div.style.overflow="auto",l.div.style.height="auto",l.div.style.position="fixed",l.div.style.fontFamily=GraphViewer.cssFontFamily,l.div.style.fontSize="11px",l.div.style.backgroundColor="#eee",l.div.style.color="#000",l.div.style.border="1px solid #d0d0d0",l.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(l.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(l.div,85));if(null!=n)n.parentNode.removeChild(n),n=null;else{n=l.div;n.style.position="absolute";mxEvent.addListener(n,"mouseleave",function(){null!=n&&(n.parentNode.removeChild(n),n=null)});ba=Z.getBoundingClientRect();var na=mxUtils.getDocumentScrollOrigin(document);n.style.left=na.x+ba.left-1+"px";n.style.top=na.y+ba.bottom-2+"px";document.body.appendChild(n);l.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");c.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){Z.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=n&&0==this.graph.getAllTags().length&&(n.parentNode.removeChild(n),n=null)}));Z.style.display=0<this.graph.getAllTags().length?"inline-flex":-"none"}}else"lightbox"==G?this.lightboxEnabled&&P(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ba){alert(ba.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):"editlocal"==G?this.editEnabled&&null!=this.graphConfig.editor&&P(mxUtils.bind(this,function(){try{window.location.href=this.graphConfig.editor+"#R"+encodeURIComponent(this.xml)}catch(ba){alert(ba.message)}}),Editor.editImage,mxResources.get("edit")||"Edit"):null!=this.graphConfig["toolbar-buttons"]&&-(G=this.graphConfig["toolbar-buttons"][G],null!=G&&(G.elem=P(null==G.enabled||G.enabled?G.handler:function(){},G.image,G.title,G.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*D);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),f.appendChild(m),this.filename=m);this.minToolbarWidth=34*D;var ja=b.style.border,da=mxUtils.bind(this,function(){f.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";f.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ba=b.getBoundingClientRect(),-na=mxUtils.getScrollOrigin(document.body);na="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-na.x,top:-na.y};ba={left:ba.left-na.left,top:ba.top-na.top,bottom:ba.bottom-na.top,right:ba.right-na.left};f.style.left=ba.left+"px";"bottom"==this.graphConfig["toolbar-position"]?f.style.top=ba.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(f.style.marginTop=-this.toolbarHeight+"px",f.style.top=ba.top+1+"px"):f.style.top=ba.top+"px";"1px solid transparent"==-ja&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(f);var ca=mxUtils.bind(this,function(){null!=f.parentNode&&f.parentNode.removeChild(f);null!=n&&(n.parentNode.removeChild(n),n=null);null!=g&&(g.parentNode.removeChild(g),g=null);b.style.border=ja});mxEvent.addListener(document,"mousemove",function(ka){for(ka=mxEvent.getSource(ka);null!=ka;){if(ka==b||ka==f||ka==g||ka==n)return;ka=ka.parentNode}ca()});mxEvent.addListener(document.body,"mouseleave",function(ka){ca()})}else f.style.top=--this.toolbarHeight+"px",b.appendChild(f)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",da):da();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=f.parentNode&&da()})).observe(b)};+"none"}}else"lightbox"==G?this.lightboxEnabled&&P(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ba){alert(ba.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(G=this.graphConfig["toolbar-buttons"][G],null!=G&&(G.elem=P(null==G.enabled||G.enabled?G.handler:function(){},G.image,G.title,G.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*D);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),f.appendChild(m),this.filename=m);this.minToolbarWidth=34*D;var ja=b.style.border,+da=mxUtils.bind(this,function(){f.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";f.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ba=b.getBoundingClientRect(),na=mxUtils.getScrollOrigin(document.body);na="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-na.x,top:-na.y};ba={left:ba.left-na.left,top:ba.top-na.top,bottom:ba.bottom-na.top,right:ba.right-na.left};f.style.left=+ba.left+"px";"bottom"==this.graphConfig["toolbar-position"]?f.style.top=ba.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(f.style.marginTop=-this.toolbarHeight+"px",f.style.top=ba.top+1+"px"):f.style.top=ba.top+"px";"1px solid transparent"==ja&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(f);var ca=mxUtils.bind(this,function(){null!=f.parentNode&&f.parentNode.removeChild(f);null!=n&&(n.parentNode.removeChild(n),n=null);null!=g&&(g.parentNode.removeChild(g),g=null);+b.style.border=ja});mxEvent.addListener(document,"mousemove",function(ka){for(ka=mxEvent.getSource(ka);null!=ka;){if(ka==b||ka==f||ka==g||ka==n)return;ka=ka.parentNode}ca()});mxEvent.addListener(document.body,"mouseleave",function(ka){ca()})}else f.style.top=-this.toolbarHeight+"px",b.appendChild(f)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",da):da();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=f.parentNode&&da()})).observe(b)};GraphViewer.prototype.createToolbarButton=function(b,f,m,t){var y=document.createElement("div");y.style.borderRight="1px solid #d0d0d0";y.style.display="inline-flex";y.style.alignItems="center";y.style.padding="6px";mxEvent.addListener(y,"click",b);null!=m&&y.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",f);b.style.width="18px";b.className="geAdaptiveAsset";null==t||t?(mxEvent.addListener(y,"mouseenter",function(){y.style.backgroundColor="light-dark(#dddddd,#333333)"}),mxEvent.addListener(y,"mouseleave",function(){y.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),y.style.cursor="pointer"):mxUtils.setOpacity(y,30);y.appendChild(b);return y};GraphViewer.prototype.disableButton=function(b,f){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"}),f&&m.elem.setAttribute("title",f))};diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.jsindex 6b14dcc65..3097e1c4e 100644--- a/src/main/webapp/js/viewer.min.js+++ b/src/main/webapp/js/viewer.min.js@@ -30,7 +30,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:"29.2.6",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"29.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&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||@@ -3500,7 +3500,7 @@ mxEvent.addListener(v,"click",function(ua){pa.checked=!0;mxEvent.consume(ua)}));(Y.classList.add("geDarkMode"),Y.style.colorScheme="dark"):(Y.classList.remove("geDarkMode"),Y.style.colorScheme="light")};k.addListener("darkModeChanged",xa);xa();var ra=function(ua,Ka){ua=Ka.getProperty("dialog");Y.parentNode==ua.container&&(k.editor.removeListener(ra),k.removeListener(xa))};k.editor.addListener("hideDialog",ra)}this.container=Y};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 k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}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&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.2.6";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&&+this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="29.2.7";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.enablePlantUml=EditorUi.enableLogging||"1"==urlParams.dev;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 window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={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,@@ -3534,14 +3534,14 @@ new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setNaEditorUi.prototype.createFileData=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){g=null!=g?g:this.editor.graph;x=null!=x?x:!1;M=null!=M?M:!0;Z=null!=Z?Z:!Editor.defaultCompressed;var ba=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var na="_blank";else ba=na=n;if(null==c)return"";var ca=c;if("mxfile"!=ca.nodeName.toLowerCase()){if(Z){var ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());ka.appendChild(c)}else{ka=Graph.zapGremlins(mxUtils.getXml(c));ca=Graph.compress(ka);if(Graph.decompress(ca)!=ka)return ka;ka=c.ownerDocument.createElement("diagram");ka.setAttribute("name",mxResources.get("pageWithNumber",[1]));ka.setAttribute("id",Editor.guid());mxUtils.setTextContent(ka,ca)}ca=c.ownerDocument.createElement("mxfile");ca.appendChild(ka)}K?(ca=ca.cloneNode(!0),ca.removeAttribute("modified"),ca.removeAttribute("host"),ca.removeAttribute("agent"),ca.removeAttribute("etag"),ca.removeAttribute("userAgent"),ca.removeAttribute("version"),ca.removeAttribute("editor"),ca.removeAttribute("type")):(ca.removeAttribute("userAgent"),ca.removeAttribute("modified"),ca.removeAttribute("version"),ca.removeAttribute("editor"),ca.removeAttribute("pages"),ca.removeAttribute("type"),ca.removeAttribute("etag"),mxClient.IS_CHROMEAPP?ca.setAttribute("host","Chrome"):EditorUi.isElectronApp?ca.setAttribute("host","Electron"):ca.setAttribute("host",window.location.hostname),ca.setAttribute("agent",null!=navigator.userAgent?-navigator.userAgent:navigator.appVersion),ca.setAttribute("version",EditorUi.VERSION),1<ca.getElementsByTagName("diagram").length&&null!=this.pages&&ca.setAttribute("pages",this.pages.length));null!=ja&&(ca=ca.cloneNode(!0),ca.setAttribute("scale",ja));null!=da&&(ca=ca.cloneNode(!0),ca.setAttribute("border",da));c=Z?mxUtils.getPrettyXml(ca):mxUtils.getXml(ca);if(!F&&!x&&(G||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(ca),g,null!=l?l.getTitle():null,na,ba,null==ba&&!EditorUi.isElectronApp&&-"draw.io"==this.getServiceName());else if(F||!x&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(ca),c=this.getEmbeddedSvg(c,g,n,null,L,M,ba,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,n){c=null!=c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=-function(M){var K=M.getElementsByTagName("mxGraphModel"),Z=0<K.length?K[0]:null;K=M;null==Z&&l?(Z=mxUtils.getNodeValue(M),0<Z.length&&(Z=Graph.decompress(Z),null!=Z&&0<Z.length&&(K=M.cloneNode(!1),K.appendChild(mxUtils.parseXml(Z).documentElement)))):null==Z||l?K=M.cloneNode(!0):(K=M.cloneNode(!1),mxUtils.setTextContent(K,Graph.compressNode(Z)));x.appendChild(K)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);-else for(g=0;g<this.pages.length;g++){var F=this.pages[g],G=F.node;if(F!=this.currentPage)if(F.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(F.root));this.editor.graph.saveViewState(F.viewState,L,null,n);EditorUi.removeChildNodes(G);G.appendChild(L);delete F.needsUpdate}else n&&(this.updatePageRoot(F),null!=F.viewState.backgroundImage&&null!=F.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(F.root)),-this.editor.graph.saveViewState(F.viewState,L,null,n,F),G=G.cloneNode(!1),G.appendChild(L)));c(G)}return x};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],n=0;n<c.length;n++){var x=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?l.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*-Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(F){c[EditorUi.DIFF_INSERT][g].data=F.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var x=-c[EditorUi.DIFF_UPDATE][n];null!=x.name&&(x.name=this.anonymizeString(x.name));null!=x.cells&&(g=mxUtils.bind(this,function(F){var G=x.cells[F];if(null!=G){for(var L in G)null!=G[L].value&&(G[L].value="["+G[L].value.length+"]"),null!=G[L].xmlValue&&(G[L].xmlValue="["+G[L].xmlValue.length+"]"),null!=G[L].style&&(G[L].style="["+G[L].style.length+"]"),mxUtils.isEmptyObject(G[L])&&delete G[L];mxUtils.isEmptyObject(G)&&delete x.cells[F]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&-delete x.cells);mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){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,g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=+navigator.userAgent:navigator.appVersion),ca.setAttribute("version",EditorUi.VERSION),1<ca.getElementsByTagName("diagram").length&&null!=this.pages&&ca.setAttribute("pages",this.pages.length));null!=ja&&(ca=ca.cloneNode(!0),ca.setAttribute("scale",ja));null!=da&&(ca=ca.cloneNode(!0),ca.setAttribute("border",da));c=Z?mxUtils.getPrettyXml(ca):mxUtils.getXml(ca);if(!F&&!x&&(G||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(ca),g,null!=l?l.getTitle():null,na,ba);else if(F||!x&&+null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(ca),c=this.getEmbeddedSvg(c,g,n,null,L,M,ba,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,l,n){c=null!=c?c:!0;g=null!=g?g:!1;l=null!=l?l:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(M){var K=M.getElementsByTagName("mxGraphModel"),+Z=0<K.length?K[0]:null;K=M;null==Z&&l?(Z=mxUtils.getNodeValue(M),0<Z.length&&(Z=Graph.decompress(Z),null!=Z&&0<Z.length&&(K=M.cloneNode(!1),K.appendChild(mxUtils.parseXml(Z).documentElement)))):null==Z||l?K=M.cloneNode(!0):(K=M.cloneNode(!1),mxUtils.setTextContent(K,Graph.compressNode(Z)));x.appendChild(K)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var F=this.pages[g],+G=F.node;if(F!=this.currentPage)if(F.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(F.root));this.editor.graph.saveViewState(F.viewState,L,null,n);EditorUi.removeChildNodes(G);G.appendChild(L);delete F.needsUpdate}else n&&(this.updatePageRoot(F),null!=F.viewState.backgroundImage&&null!=F.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(F.root)),this.editor.graph.saveViewState(F.viewState,L,null,+n,F),G=G.cloneNode(!1),G.appendChild(L)));c(G)}return x};EditorUi.prototype.anonymizeString=function(c,g){for(var l=[],n=0;n<c.length;n++){var x=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?l.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?l.push(" "):l.push("?"):l.push(g?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=+function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(l)}catch(F){c[EditorUi.DIFF_INSERT][g].data=F.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var x=c[EditorUi.DIFF_UPDATE][n];+null!=x.name&&(x.name=this.anonymizeString(x.name));null!=x.cells&&(g=mxUtils.bind(this,function(F){var G=x.cells[F];if(null!=G){for(var L in G)null!=G[L].value&&(G[L].value="["+G[L].value.length+"]"),null!=G[L].xmlValue&&(G[L].xmlValue="["+G[L].xmlValue.length+"]"),null!=G[L].style&&(G[L].style="["+G[L].style.length+"]"),mxUtils.isEmptyObject(G[L])&&delete G[L];mxUtils.isEmptyObject(G)&&delete x.cells[F]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);+mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){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,g));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],g)};EditorUi.prototype.anonymizeNode=function(c,g){g=c.getElementsByTagName("mxCell");for(var l=0;l<g.length;l++)null!=g[l].getAttribute("value")&&g[l].setAttribute("value","["+g[l].getAttribute("value").length+"]"),null!=g[l].getAttribute("xmlValue")&&g[l].setAttribute("xmlValue","["+g[l].getAttribute("xmlValue").length+"]"),null!=g[l].getAttribute("style")&&g[l].setAttribute("style","["+g[l].getAttribute("style").length+"]"),null!=g[l].parentNode&&"root"!=g[l].parentNode.nodeName&&null!=g[l].parentNode.parentNode&&(g[l].setAttribute("id",g[l].parentNode.getAttribute("id")),g[l].parentNode.parentNode.replaceChild(g[l],g[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();g.handleFileError(l,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){g.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){x=null!=x?x:!0;F=null!=F?F:!1;K=null!=K?K:!Editor.defaultCompressed;var ba=this.editor.graph;if((g||!c&&null!=M&&/(\.svg)$/i.test(M.getTitle()))&&null!=this.pages&&this.currentPage!=@@ -3550,14 +3550,14 @@ ka?1:na.apply(this,arguments)};document.body.appendChild(ba.container);null!=ca&var M=g.view.scale;F=Math.floor(G.x/M-g.view.translate.x);M=Math.floor(G.y/M-g.view.translate.y);G=g.background;null==x&&(g=this.getBasenames().join(";"),0<g.length&&(L=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",F);c.setAttribute("y0",M)}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!=x&&(x=x.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=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!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=G&&G!=mxConstants.NONE?' style="background-color:'+G+';">':">")+'\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==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,g,l,n,x,F){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=x?x=x.replace(/&/g,"&"):F&&(c.editor=window.DRAWIO_BASE_URL,c.toolbar+=" editlocal");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!=l?"<title>"+mxUtils.htmlEntities(l)+"</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="'+g+'">\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.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",-[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var n=this.getHashObject(),x=null;this.fileNode=g;this.pages=[];for(var F=0;F<c.length;F++){null==c[F].getAttribute("id")&&c[F].setAttribute("id",F);g=new DiagramPage(c[F]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[F+1]));this.pages.push(g);-if(null==n.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||null!=n.pageId&&g.getId()==n.pageId)x=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",-[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var G=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(F=0;F<G.length;F++)g[G[F]]=!0;var L=this.editor.graph.getModel(),M=L.getChildren(L.root);for(F=0;F<M.length;F++){var K=M[F];L.setVisible(K,g[K.id]||!1)}}catch(Z){}};EditorUi.prototype.getBaseFilename=-function(c){var g=this.getCurrentFile();g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=-function(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba,na,ca,ka){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var aa=this.getBaseFilename(!x),V=aa+("xml"==c||"pdf"==c&&Z?".drawio":"")+"."+c;if("xml"==c){var k=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,x,null,null,null,g);this.saveData(V,c,k,"text/xml")}else if("html"==c)k=this.getHtml2(this.getFileData(!0),this.editor.graph,aa),this.saveData(V,c,k,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==+EditorUi.prototype.getHtml2=function(c,g,l,n,x){g=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!=l?"<title>"+mxUtils.htmlEntities(l)+"</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="'+g+'">\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.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,l=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[g],"cause",[l]),Error(mxResources.get("notADiagramFile")++" ("+l+")");c=null!=g?this.editor.extractGraphModel(g,!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),l={},0<c.length)){var n=this.getHashObject(),x=null;this.fileNode=g;this.pages=[];for(var F=0;F<c.length;F++){null==c[F].getAttribute("id")&&c[F].setAttribute("id",F);g=new DiagramPage(c[F]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[F+1]));this.pages.push(g);if(null==n.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||+null!=n.pageId&&g.getId()==n.pageId)x=g;if(null==l[g.getId()])l[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);+this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var G=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(F=0;F<G.length;F++)g[G[F]]=!0;var L=this.editor.graph.getModel(),M=L.getChildren(L.root);for(F=0;F<M.length;F++){var K=M[F];L.setVisible(K,g[K.id]||!1)}}catch(Z){}};EditorUi.prototype.getBaseFilename=function(c){var g=this.getCurrentFile();+g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=function(c,g,l,n,x,+F,G,L,M,K,Z,ja,da,ba,na,ca,ka){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var aa=this.getBaseFilename(!x),V=aa+("xml"==c||"pdf"==c&&Z?".drawio":"")+"."+c;if("xml"==c){var k=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,x,null,null,null,g);this.saveData(V,c,k,"text/xml")}else if("html"==c)k=this.getHtml2(this.getFileData(!0),this.editor.graph,aa),this.saveData(V,c,k,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==c?V=aa+".png":"jpeg"==c&&(V=aa+".jpg"),this.saveRequest(V,c,mxUtils.bind(this,function(W,U){try{return this.createDownloadRequest(W,c,n,U,G,x,L,M,K,Z,ja,void 0,void 0,!F,da,ba,na,ca,ka)}catch(Y){this.handleError(Y)}}));else{var v=null,J=mxUtils.bind(this,function(W){W.length<=MAX_REQUEST_SIZE?this.saveData(V,"svg",W,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(v)}))});if("svg"==c){var N=this.editor.graph.background;if(G||N==mxConstants.NONE)N=null;var T=this.editor.graph.getSvg(N,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(T);this.editor.convertImages(T,mxUtils.bind(this,mxUtils.bind(this,function(W){this.spinner.stop();J(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(W))})))}else V=aa+".svg",v=this.getFileData(!1,!0,null,mxUtils.bind(this,function(W){this.spinner.stop();J(W)}),n)}}catch(W){this.handleError(W)}};EditorUi.prototype.createDownloadRequest=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba,na,ca,ka,aa,V){c=this.downloadRequestBuilder(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba,na,ca,ka,aa,V);g="";for(var k in c)l=c[k],null!=l&&(g+=k+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba,na,ca,ka,aa,V){var k=this.editor.graph,v=k.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==F?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var J=null,N=null,T=null;if(!EditorUi.isElectronApp&&@@ -3627,86 +3627,86 @@ n)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettimxEvent.consume(na)):ba()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(K.style,"transform",L)}),500);window.setTimeout(ba,x?5E3:3E4);F=!0}return F};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,g,l,n){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<n&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,g,l,n,x){var F="jpeg"==l?"jpg":l;n=this.getBaseFilename(n)+(null!=g?".drawio":"")+"."+F;c=this.createImageDataUri(c,g,l,x);this.saveData(n,F,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,g){c=new TextareaDialog(this,c,g,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,g,l,n,x,F){"text/xml"!=l||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||-/(\.html)$/i.test(g)||(g=g+"."+(null!=F?F:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=n?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,l,n);else{var G=document.createElement("a");F=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof G.download;if(mxClient.IS_GC&&null!=-navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);F=65==(L?parseInt(L[2],10):!1)?!1:F}if(F||this.isOffline()){G.href=URL.createObjectURL(n?this.base64ToBlob(c,l):new Blob([c],{type:l}));F?G.download=g:G.setAttribute("target","_blank");document.body.appendChild(G);try{window.setTimeout(function(){URL.revokeObjectURL(G.href)},2E4),G.click(),G.parentNode.removeChild(G)}catch(M){}}else this.createEchoRequest(c,g,l,n,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=-function(c,g,l,n,x,F){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=F?"&base64="+F:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,g,l,n,x,F,G,L,M){F=null!=F?F:!1;G=null!=G?G:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var K=mxUtils.bind(this,function(ja,da,ba,na){try{if("_blank"==da)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,-l,n);else if(null!=l&&"text/html"==l.substring(0,9)){var ca=new EmbedDialog(this,c);this.showDialog(ca.container,450,240,!0,!0);ca.init()}else{var ka=window.open("about:blank");null==ka?mxUtils.popup(c,!0):(ka.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),ka.document.close())}else if(da==App.MODE_DEVICE||"download"==da)this.doSaveLocalFile(c,ja,l,n,null,L);else if(null!=ja&&0<ja.length){var aa=mxUtils.bind(this,function(V){try{this.exportFile(c,ja,l,n,da,V)}catch(k){this.handleError(k)}});-null!=na?aa(na):this.pickFolder(da,aa)}}catch(V){this.handleError(V)}});x=[];F||x.push(App.MODE_BROWSER);G||x.push("_blank");var Z=new SaveDialog(this,g,mxUtils.bind(this,function(ja,da,ba){K(ja.value,da,ja,ba);this.hideDialog(null,null,Z.container)}),x,c,l,n,M);this.showDialog(Z.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Z.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var x=-"background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var F=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=F&&(x="background: "+F+";")}x='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+x+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||l?(F=l?c:btoa(unescape(encodeURIComponent(c))),n.document.write(x+'<img style="max-width:100%;" src="data:'+g+";base64,"+F+'"/></body></html>')):n.document.write(x+c+"</body></html>"):-n.document.write(x+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");n.document.close()}};var t=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){this.tagsDialog=this.tagsComponent=null;var g=c(mxUtils.bind(this,function(n){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 x=g.getBoundingClientRect();this.tagsDialog.style.left=x.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=x.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),-Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();g.style.display=0<n.length?"":"none"}))}t.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()){this.exportDialog=null;var l=c(mxUtils.bind(this,function(n){var x=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",x);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)x.apply(this);-else{this.exportDialog=document.createElement("div");var F=l.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=F.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";F=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=F.zIndex;var G=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});G.spin(this.exportDialog);document.body.appendChild(this.exportDialog);-mxEvent.addListener(this.editor.graph.container,"click",x);this.editor.exportToCanvas(mxUtils.bind(this,function(L){G.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var M=this.createImageDataUri(L,null,"png");L=document.createElement("img");L.style.maxWidth="140px";L.style.maxHeight="140px";L.style.cursor="pointer";L.style.backgroundColor="white";L.setAttribute("title",mxResources.get("openInNewWindow"));L.setAttribute("border",-"0");L.setAttribute("src",M);this.exportDialog.appendChild(L);mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.openInNewWindow(M.substring(M.indexOf(",")+1),"image/png",!0);x.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(L){G.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(L)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),-Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,n,x,F){this.isLocalFileSave()?this.saveLocalFile(l,c,n,x,g,F):this.saveRequest(c,g,mxUtils.bind(this,function(G,L){return this.createEchoRequest(l,G,n,x,g,L)}),l,x,n)};EditorUi.prototype.saveRequest=function(c,g,l,n,x,F,G){G=null!=G?G:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,function(K,Z,ja,da){if("_blank"==Z||null!=K&&0<K.length){var ba=l("_blank"==Z?null:K,Z==App.MODE_DEVICE||"download"==-Z||null==Z||"_blank"==Z?"0":"1");null!=ba&&(Z==App.MODE_DEVICE||"download"==Z||"_blank"==Z?ba.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(na){F=null!=F?F:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,K,F,!0,Z,na)}catch(ca){this.handleError(ca)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ba.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=ba.getStatus()&&299>=ba.getStatus())try{this.exportFile(ba.getText(),K,F,!0,Z,na)}catch(ca){this.handleError(ca)}else this.handleError({message:mxResources.get("errorSavingFile")})}),-mxUtils.bind(this,function(ca){this.spinner.stop();this.handleError(ca)}))}),null!=da?ja(da):this.pickFolder(Z,ja)))}});x=[App.MODE_BROWSER];G||x.push("_blank");var M=new SaveDialog(this,c,mxUtils.bind(this,function(K,Z,ja){L(K.value,Z,K,ja);this.hideDialog(null,null,M.container)}),x,null,"application/pdf");this.showDialog(M.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));M.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=-function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,g,l,n,x,F){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,-g,l,n,x,F,G,L,M,K,Z,ja,da,ba)}));this.handleError(la)})))try{var na=this.editor.graph.isSelectionEmpty();l=null!=l?l:na;var ca=g?null:this.editor.graph.background;ca==mxConstants.NONE&&(ca=null);null==ca&&0==g&&(ca=this.editor.graph.shapeBackgroundColor);var ka=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var aa=mxUtils.lightDarkColorSupported,V=mxUtils.preferDarkColor;if("light"==Z||"dark"==Z)mxUtils.lightDarkColorSupported=-!1,mxUtils.preferDarkColor="dark"==Z;var k=Graph.addFont,v={};Graph.addFont=function(la,qa,ya,wa){k.call(this,la,qa,ya,v)};var J=this.editor.graph.createSvgImageExport(x),N=J.drawCellState;J.drawCellState=function(la,qa){null!=la&&Graph.processFontStyle(la.style);N.apply(this,arguments)};var T=this.editor.graph.getSvg(ca,c,G,L,null,l,null,J,"blank"==K?"_blank":"self"==K?"_top":null,null,!da,Z,ja);mxUtils.lightDarkColorSupported=aa;mxUtils.preferDarkColor=V;this.editor.graph.addForeignObjectWarning=-ka;n&&this.editor.graph.addSvgShadow(T);var W=this.getBaseFilename()+(x?".drawio":"")+".svg";ba=null!=ba?ba:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=MAX_REQUEST_SIZE?this.saveData(W,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var U=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,l,M,null,-null,null,null,null,c,G));ba(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(T);var Y=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&F&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&da?this.replaceAlternateContent(la,Z,U):U(la)}),fa=Graph.customFontElements;Graph.customFontElements=v;var oa=mxUtils.bind(this,function(la){Graph.customFontElements=fa;Graph.addFont=k;F&&!this.isOffline()&&-Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,Y,this.thumbImageCache)):Y(la)});da?this.embedFonts(T,oa):(this.editor.addFontCss(T),oa(T))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function n(ja,da,ba,na,ca){var ka=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ka.setAttribute("x",da);ka.setAttribute("y",ba+.5);ka.setAttribute("width",na.width);ka.setAttribute("height",-na.height);null==ka.setAttributeNS?ka.setAttribute("xlink:href",ca):ka.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ca);ja.replaceChild(ka,ja.lastChild);L()}function x(){if(G<Z.length)Z[G++](x)}var F="";g=c.getElementsByTagName("style");for(var G=0;G<g.length;G++)F+=g[G].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var L=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),M={},K={},Z=[];for(G=0;G<g.length;G++)mxUtils.bind(this,function(ja){var da=ja.getElementsByTagName("div");-if(0<da.length)try{var ba=da[0].cloneNode(!0),na=parseInt(ba.style.marginLeft),ca=parseInt(ba.style.paddingTop),ka=ba.getElementsByTagName("div")[1],aa=da=!1,V=ba.style.alignItems,k=ba.style.justifyContent;if(null!=ba.style.writingMode){var v=ba.style.writingMode;aa="vertical-"==v.substring(0,9);da="-rl"==v.substring(v.length-3)}var J=!aa&&"1px"==ba.style.width||aa&&"1px"==ba.style.height;if(!aa&&"1px"==ba.style.height||aa&&"1px"==ba.style.width)ba.style.alignItems=aa&&da?"unsafe flex-end":"unsafe flex-start";-J&&(ba.style.justifyContent="unsafe flex-start");ba.style.paddingTop="";ba.style.marginLeft="";var N=ba.outerHTML,T=M[N];null==T&&(ba.style.position="absolute",ba.style.visibility="hidden",document.body.appendChild(ba),v=1,v="1px"==ba.style.width?ka.offsetWidth:parseInt(ba.style.width),J=1,J="1px"==ba.style.height?ka.offsetHeight:parseInt(ba.style.height),document.body.removeChild(ba),T=new mxRectangle(na,ca,v,J),M[N]=T);"1px"==ba.style.height&&("unsafe center"==V?ca-=T.height/2:"unsafe flex-end"==-V&&(ca-=T.height));if("1px"==ba.style.width)if(!aa&&"unsafe center"==k||aa&&"unsafe center"==V)na-=T.width/2;else if(!aa&&"unsafe flex-end"==k||aa&&(!da&&"unsafe flex-end"==V||da&&"unsafe flex-start"==V))na-=T.width;T=new mxRectangle(na,ca,T.width,T.height+parseInt(ka.style.fontSize)/4);Z.push(mxUtils.bind(this,function(W){var U=K[N];null==U?Graph.htmlToPng(N,T.width,T.height,mxUtils.bind(this,function(Y){n(ja,na,ca,T,Y);K[N]=Y;W()}),F):(n(ja,na,ca,T,U),W())}))}catch(W){L()}else L()})(g[G]);0==counter&&-l(c);G=0;x()};EditorUi.prototype.addRadiobox=function(c,g,l,n,x,F,G){return this.addCheckbox(c,l,n,x,F,G,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,n,x,F,G,L){F=null!=F?F:!0;var M=document.createElement("input");M.style.marginRight="8px";M.style.marginTop="16px";M.setAttribute("type",G?"radio":"checkbox");G="geCheckbox-"+Editor.guid();M.id=G;null!=L&&M.setAttribute("name",L);l&&(M.setAttribute("checked","checked"),M.defaultChecked=!0);n&&M.setAttribute("disabled","disabled");F&&(c.appendChild(M),-l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",G),c.appendChild(l),x||mxUtils.br(c));return M};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var n=this.getCurrentFile(),x="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(x=window.location.href);var F=document.createElement("select");F.style.maxWidth="200px";F.style.width="auto";F.style.marginLeft="8px";F.style.marginRight=-"10px";F.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));F.appendChild(n);var G=document.createElement("option");G.setAttribute("value","custom");mxUtils.write(G,mxResources.get("custom")+"...");F.appendChild(G);c.appendChild(F);mxEvent.addListener(F,"change",mxUtils.bind(this,function(){if("custom"==F.value){var L=new FilenameDialog(this,x,mxResources.get("ok"),function(M){null!=M?(x=M,G.setAttribute("title",M)):(F.value=-"blank",G.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){F.value="blank"});this.showDialog(L.container,300,80,!0,!1);L.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===F.value?"_blank":x:null},getEditInput:function(){return l},getEditSelect:function(){return F}}};EditorUi.prototype.addLinkSection=-function(c,g){function l(){var L=document.createElement("div");L.style.width="100%";L.style.height="100%";L.style.boxSizing="border-box";null!=F&&F!=mxConstants.NONE?(L.style.border="1px solid black",L.style.backgroundColor=F):(L.style.backgroundPosition="center center",L.style.backgroundRepeat="no-repeat",L.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");G.innerText="";G.appendChild(L)}mxUtils.write(c,mxResources.get("links")+":");var n=document.createElement("select");n.style.width=-"100px";n.style.padding="0px";n.style.marginLeft="8px";n.style.marginRight="10px";n.className="geBtn";var x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));n.appendChild(x);-g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var F="#0000ff",G=null;G=mxUtils.button("",mxUtils.bind(this,function(L){this.pickColor(F||"none",function(M){F=M;l()});mxEvent.consume(L)}));l();G.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";G.style.marginLeft="4px";G.style.height="22px";G.style.width=-"22px";G.style.position="relative";G.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";G.className="geColorBtn";c.appendChild(G);mxUtils.br(c);return{getColor:function(){return F},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,n,x,F){F=null!=F?F:[];l&&(F.push("lightbox=1"),"auto"!=c&&F.push("target="+c),null!=g&&g!=mxConstants.NONE&&F.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=n&&0<n.length&&-F.push("edit="+encodeURIComponent(n)),x&&F.push("layers=1"),this.editor.graph.foldingEnabled&&F.push("nav=1"));return F};EditorUi.prototype.createLink=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){var ba=this.getCurrentFile();M=this.createUrlParameters(c,g,n,x,F,M);c=!0;null!=G?l="#U"+encodeURIComponent(G):L||null==ba||""==ba.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="#"+ba.getHash(),c=-!1);c&&null!=ba&&null!=ba.getTitle()&&ba.getTitle()!=this.defaultFilename&&M.push("title="+encodeURIComponent(ba.getTitle()));K&&1<l.length&&(M.push("open="+l.substring(1)),l="");Z&&null!=this.currentPage&&M.push("page-id="+this.currentPage.getId());ja&&M.push("transparent=1");null!=da&&M.push("dark="+da);return(n&&(null!=G||null!=ba&&ba.getMode()!=App.MODE_GITHUB&&ba.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?-EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<M.length?"?"+M.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){this.getBasenames();var ba={};""!=x&&x!=mxConstants.NONE&&(ba.highlight=x);"auto"!==n&&(ba.target=n);K||(ba.lightbox=!1);ba.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(ba.zoom=l/100);l=[];G&&(l.push("pages"),ba.resize=!0,null!=this.pages&&null!=this.currentPage&&(ba.page=mxUtils.indexOf(this.pages,this.currentPage)));-g&&(l.push("zoom"),ba.resize=!0);L&&l.push("layers");M&&l.push("tags");null!=da&&(ba["dark-mode"]=da);0<l.length&&(K&&l.push("lightbox"),ba.toolbar=l.join(" "));null!=Z&&0<Z.length&&(ba.edit=Z);null!=c?ba.url=c:ba.xml=this.getFileData(!0,null,null,null,null,!G);g='<div class="mxgraph" style="'+(F?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ba))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<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.showHtmlDialog=function(c,g,l,n){var x=document.createElement("div");x.style.whiteSpace="nowrap";var F=document.createElement("h3");mxUtils.write(F,mxResources.get("html"));F.style.cssText=-"width:100%;text-align:center;margin-top:0px;margin-bottom:12px";x.appendChild(F);var G=document.createElement("div");G.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name","type-embedhtmldialog");F=L.cloneNode(!0);F.setAttribute("value","copy");G.appendChild(F);var M=document.createElement("span");-mxUtils.write(M,mxResources.get("includeCopyOfMyDiagram"));G.appendChild(M);mxUtils.br(G);G.appendChild(L);M=document.createElement("span");mxUtils.write(M,mxResources.get("publicDiagramUrl"));G.appendChild(M);var K=this.getCurrentFile();null==l&&null!=K&&K.constructor==window.DriveFile&&(M=document.createElement("a"),M.style.paddingLeft="12px",M.style.color="gray",M.style.cursor="pointer",mxUtils.write(M,mxResources.get("share")),G.appendChild(M),mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.hideDialog();-this.drive.showPermissions(K.getId(),K)})));F.setAttribute("checked","checked");null==l&&L.setAttribute("disabled","disabled");x.appendChild(G);G=380;var Z=this.addLinkSection(x),ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";ja.style.marginTop="16px";M=document.createElement("option");M.setAttribute("value","light");mxUtils.write(M,mxResources.get("light"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,-mxResources.get("dark"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","auto");mxUtils.write(M,mxResources.get("automatic"));M.setAttribute("selected","selected");ja.appendChild(M);M.setAttribute("selected","selected");mxUtils.write(x,mxResources.get("appearance")+":");x.appendChild(ja);mxUtils.br(x);G+=26;var da=this.addCheckbox(x,mxResources.get("zoom"),!0,null,!0);mxUtils.write(x,":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight=-"16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value="100%";x.appendChild(ba);var na=this.addCheckbox(x,mxResources.get("fit"),!0);M=null!=this.pages&&1<this.pages.length;var ca=ca=this.addCheckbox(x,mxResources.get("allPages"),M,!M),ka=this.addCheckbox(x,mxResources.get("layers"),!0),aa=this.addCheckbox(x,mxResources.get("tags"),!0),V=this.addCheckbox(x,mxResources.get("lightbox"),!0),k=null;if(EditorUi.enableHtmlEditOption){k=this.addEditButton(x,V);var v=-k.getEditInput();v.style.marginBottom="16px";G+=50;mxEvent.addListener(V,"change",function(){V.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");v.checked&&V.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,x,mxUtils.bind(this,function(){n(L.checked?l:null,da.checked,ba.value,Z.getTarget(),Z.getColor(),na.checked,ca.checked,ka.checked,aa.checked,V.checked,null!=k?k.getLink():null,null!=ja?-ja.value:null)}),null,c,g);this.showDialog(c.container,340,G,!0,!0);F.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,n,x,F,G,L,M,K,Z,ja){var da=document.createElement("div");da.style.whiteSpace="nowrap";var ba=document.createElement("h3");mxUtils.write(ba,c||mxResources.get("publish"));ba.style.width="100%";ba.style.textAlign="center";ba.style.marginTop="2px";ba.style.marginBottom="20px";da.appendChild(ba);var na=document.createElement("select");c=30;na.className="geBtn";na.style.marginBottom=-"8px";na.style.marginLeft="0px";na.style.width="100%";na.style.boxSizing="border-box";if(null==L||""==L.getHash())x=null!=x?x:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ba=document.createElement("option"),mxUtils.write(ba,mxResources.get("makeCopy")),ba.setAttribute("value","copy"),na.appendChild(ba);ba=document.createElement("option");mxUtils.write(ba,mxResources.get("authorizationRequired"));ba.setAttribute("value","auth");na.appendChild(ba);null!=L&&""!=L.getHash()||ba.setAttribute("disabled",-"disabled");L=document.createElement("option");L.setAttribute("value","public");na.appendChild(L);null!=G?(mxUtils.write(L,mxResources.get("publicDiagramUrl")),L.setAttribute("title",G),na.value="public"):(mxUtils.write(L,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),L.setAttribute("disabled","disabled"));da.appendChild(na);mxUtils.br(da);na.focus();var ca=null,ka=null;if(null!=g||null!=l)c+=30,mxUtils.write(da,mxResources.get("width")+":"),ca=document.createElement("input"),-ca.setAttribute("type","text"),ca.style.marginRight="16px",ca.style.width="50px",ca.style.marginLeft="6px",ca.style.marginRight="16px",ca.style.marginBottom="10px",ca.value="100%",da.appendChild(ca),mxUtils.write(da,mxResources.get("height")+":"),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.style.width="50px",ka.style.marginLeft="6px",ka.style.marginBottom="10px",ka.value=l+"px",da.appendChild(ka),mxUtils.br(da);var aa=this.addLinkSection(da,n),V=K?this.addCheckbox(da,mxResources.get("transparentBackground"),-!1):null;null!=V&&(c+=20);var k=document.createElement("select");k.className="geBtn";k.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");k.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");k.appendChild(g);var v=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?-this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(da,mxResources.get("pages")+":"),da.appendChild(k),mxUtils.br(da),c+=30),v=this.addCheckbox(da,mxResources.get("selectedPage")+": "+g));var J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft="8px";J.style.marginTop="16px";ja=document.createElement("option");ja.setAttribute("value","0");mxUtils.write(ja,mxResources.get("light"));J.appendChild(ja);ja=document.createElement("option");-ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));J.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected","selected");J.appendChild(ja);Z&&(mxUtils.write(da,mxResources.get("appearance")+":"),da.appendChild(J),mxUtils.br(da),c+=30);var N=this.addCheckbox(da,mxResources.get("lightbox"),!0,null,null,!n),T=this.addEditButton(da,N),W=T.getEditInput();n&&(W.style.marginLeft=N.style.marginLeft,-N.style.display="none",c-=20);var U=this.addCheckbox(da,mxResources.get("layers"),!0);U.style.marginLeft=W.style.marginLeft;U.style.marginTop="8px";var Y=this.addCheckbox(da,mxResources.get("tags"),!0);Y.style.marginLeft=W.style.marginLeft;Y.style.marginBottom="16px";Y.style.marginTop="16px";mxEvent.addListener(N,"change",function(){N.checked?(U.removeAttribute("disabled"),W.removeAttribute("disabled"),Y.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),W.setAttribute("disabled",-"disabled"),Y.setAttribute("disabled","disabled"));W.checked&&N.checked?T.getEditSelect().removeAttribute("disabled"):T.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,da,mxUtils.bind(this,function(){M(aa.getTarget(),aa.getColor(),null==v?!1:v.checked,N.checked,T.getLink(),U.checked,null!=ca?ca.value:null,null!=ka?ka.value:null,Y.checked,na.value,null!=V?V.checked:!1,J.value,"allPages"==k.value)}),null,mxResources.get("create"),x,F);this.showDialog(n.container,340,296+-c,!0,!0);null!=ca?(ca.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ca.select():document.execCommand("selectAll",!1,null)):null==na.parentNode;aa.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,g,l,n,x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var G=document.createElement("h3");mxUtils.write(G,mxResources.get("image"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(x?"10":"4")+"px";F.appendChild(G);if(x){mxUtils.write(F,-mxResources.get("zoom")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";L.style.width="60px";L.style.marginLeft="4px";L.style.marginRight="12px";L.value=this.lastExportZoom||"100%";F.appendChild(L);mxUtils.write(F,mxResources.get("borderWidth")+":");var M=document.createElement("input");M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.value=this.lastExportBorder||"0";F.appendChild(M);mxUtils.br(F)}var K=-this.addCheckbox(F,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Z=n?null:this.addCheckbox(F,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);G=this.editor.graph;var ja=n?null:this.addCheckbox(F,mxResources.get("transparentBackground"),G.background==mxConstants.NONE||null==G.background);null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,F,mxUtils.bind(this,function(){var da=parseInt(L.value)/100||1,ba=parseInt(M.value)||0;l(!K.checked,-null!=Z?Z.checked:!1,null!=ja?ja.checked:!1,da,ba)}),null,c,g);this.showDialog(c.container,300,(x?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,n,x,F,G,L,M){G=null!=G?G:Editor.defaultIncludeDiagram;var K=document.createElement("div");K.style.whiteSpace="nowrap";var Z=this.editor.graph,ja="jpeg"==L||"webp"==L?220:320,da=document.createElement("h3");mxUtils.write(da,c);da.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";K.appendChild(da);-mxUtils.write(K,mxResources.get("zoom")+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value=this.lastExportZoom||"100%";K.appendChild(ba);mxUtils.write(K,mxResources.get("borderWidth")+":");var na=document.createElement("input");na.setAttribute("type","text");na.style.marginRight="16px";na.style.width="60px";na.style.marginLeft="4px";na.value=this.lastExportBorder||-"0";K.appendChild(na);mxUtils.br(K);var ca=this.addCheckbox(K,mxResources.get("selectionOnly"),!1,Z.isSelectionEmpty()),ka=document.createElement("input");ka.style.marginTop="16px";ka.style.marginRight="8px";ka.style.marginLeft="24px";ka.setAttribute("disabled","disabled");ka.setAttribute("type","checkbox");var aa=document.createElement("select");aa.style.marginTop="16px";aa.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(da=0;da<c.length;da++)if(!Z.isSelectionEmpty()||"selectionOnly"!=-c[da]){var V=document.createElement("option");mxUtils.write(V,mxResources.get(c[da]));V.setAttribute("value",c[da]);aa.appendChild(V)}M?(mxUtils.write(K,mxResources.get("size")+":"),K.appendChild(aa),mxUtils.br(K),ja+=26,mxEvent.addListener(aa,"change",function(){"selectionOnly"==aa.value&&(ca.checked=!0)})):F&&(K.appendChild(ka),mxUtils.write(K,mxResources.get("crop")),mxUtils.br(K),ja+=30,mxEvent.addListener(ca,"change",function(){ca.checked?ka.removeAttribute("disabled"):ka.setAttribute("disabled",-"disabled")}));Z.isSelectionEmpty()?M&&(ca.style.display="none",ca.nextSibling.style.display="none",ca.nextSibling.nextSibling.style.display="none",ja-=30):(aa.value="diagram",ka.setAttribute("checked","checked"),ka.defaultChecked=!0,mxEvent.addListener(ca,"change",function(){aa.value=ca.checked?"selectionOnly":"diagram"}));var k=this.addCheckbox(K,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=L&&"webp"!=L),v=document.createElement("select");v.style.maxWidth="260px";v.style.marginLeft=-"8px";v.style.marginTop="16px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));v.appendChild(F);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));v.appendChild(M);"svg"==L&&mxUtils.lightDarkColorSupported?(F=document.createElement("option"),F.setAttribute("value","auto"),mxUtils.write(F,mxResources.get("automatic")),F.setAttribute("selected","selected"),v.appendChild(F)):Editor.isDarkMode()?-M.setAttribute("selected","selected"):F.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("appearance")+":");K.appendChild(v);mxUtils.br(K);ja+=26;var J=this.addCheckbox(K,mxResources.get("shadow"),Z.shadowVisible),N=null;if("png"==L||"jpeg"==L||"webp"==L)N=this.addCheckbox(K,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;Z=null!=this.pages?this.pages.length:1;var T=this.addCheckbox(K,mxResources.get("includeCopyOfMyDiagram")+(1<Z?":":""),G,null,-null,"jpeg"!=L&&"webp"!=L),W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="28px";"png"==L||"svg"==L?(G=function(){T.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},F=document.createElement("option"),F.setAttribute("value","allPages"),mxUtils.write(F,mxResources.get("allPages")),W.appendChild(F),F=document.createElement("option"),F.setAttribute("value","currentPage"),mxUtils.write(F,mxResources.get("currentPage")),W.appendChild(F),1<Z?(T.style.marginBottom=-"12px",W.style.marginBottom="16px",K.appendChild(W),mxUtils.br(K),ja+=20):T.style.marginBottom="16px",null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(T,"change",G),G()):T.style.marginBottom="16px";var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");U.id="geCheckbox-"+Editor.guid();var Y=document.createElement("input");Y.style.marginBottom="16px";Y.style.marginRight="8px";Y.setAttribute("type",-"checkbox");Y.id="geCheckbox-"+Editor.guid();g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,K.appendChild(U),G=document.createElement("label"),mxUtils.write(G,mxResources.get("embedImages")),G.setAttribute("for",U.id),K.appendChild(G),mxUtils.br(K),Y.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,K.appendChild(Y),G=document.createElement("label"),mxUtils.write(G,mxResources.get("embedFonts")),G.setAttribute("for",Y.id),K.appendChild(G),mxUtils.br(K),ja+=50);var fa=document.createElement("select");-fa.style.maxWidth="260px";fa.style.marginLeft="8px";F=document.createElement("option");F.setAttribute("value","auto");mxUtils.write(F,mxResources.get("automatic"));fa.appendChild(F);G=document.createElement("option");G.setAttribute("value","blank");mxUtils.write(G,mxResources.get("openInNewWindow"));fa.appendChild(G);G=document.createElement("option");G.setAttribute("value","self");mxUtils.write(G,mxResources.get("openInThisWindow"));fa.appendChild(G);G=document.createElement("div");mxUtils.write(G,-mxResources.get("LinksLost"));G.style.margin="7px";G.style.display="none";"svg"==L&&(mxUtils.write(K,mxResources.get("links")+":"),K.appendChild(fa),K.appendChild(G),mxUtils.br(K),mxUtils.br(K),ja+=50);l=new CustomDialog(this,K,mxUtils.bind(this,function(){this.lastExportBorder=na.value;this.lastExportZoom=ba.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=Y.checked;this.lastEmbedInclude=W.value;x(ba.value,k.checked,!ca.checked,J.checked,T.checked,U.checked&&g,na.value,ka.checked,("png"==-L||"svg"==L)&&"currentPage"==W.value,fa.value,null!=N?N.checked:null,null!=v?v.value:null,aa.value,Y.checked)}),null,l,n);this.showDialog(l.container,340,ja,!0,!0,null,null,null,null,!0);ba.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ba.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,l,n,x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var G=this.editor.graph;if(null!=g){var L=document.createElement("h3");-mxUtils.write(L,g);L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";F.appendChild(L)}var M=this.addCheckbox(F,mxResources.get("fit"),!0),K=this.addCheckbox(F,mxResources.get("shadow"),G.shadowVisible&&n,!n),Z=this.addCheckbox(F,l),ja=this.addCheckbox(F,mxResources.get("lightbox"),!0),da=this.addEditButton(F,ja),ba=da.getEditInput(),na=1<G.model.getChildCount(G.model.getRoot()),ca=this.addCheckbox(F,mxResources.get("layers"),na,!na);ca.style.marginLeft=ba.style.marginLeft;-ca.style.marginBottom="12px";ca.style.marginTop="8px";mxEvent.addListener(ja,"change",function(){ja.checked?(na&&ca.removeAttribute("disabled"),ba.removeAttribute("disabled")):(ca.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));ba.checked&&ja.checked?da.getEditSelect().removeAttribute("disabled"):da.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,F,mxUtils.bind(this,function(){c(M.checked,K.checked,Z.checked,ja.checked,da.getLink(),ca.checked)}),-null,mxResources.get("embed"),x);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,n,x,F,G,L){function M(ba){var na=" ",ca="";n&&(na=" 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!=Z?"&page="+Z:"")+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}})(this);\"",ca+="cursor:pointer;");c&&(ca+="max-width:100%;");var ka="";l&&(ka=' width="'+Math.round(K.width)+'" height="'+Math.round(K.height)+'"');G('<img src="'+ba+'"'+ka+(""!=ca?' style="'+ca+'"':"")+na+"/>")}var K=this.editor.graph.getGraphBounds(),Z=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ba){var na=n?this.getFileData(!0):null;ba=this.createImageDataUri(ba,-na,"png");M(ba)}),null,null,null,mxUtils.bind(this,function(ba){L({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),K.width*K.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var ja="";l&&(ja="&w="+Math.round(2*K.width)+"&h="+Math.round(2*K.height));var da=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+ja+"&xml="+encodeURIComponent(g));da.send(mxUtils.bind(this,function(){200<=da.getStatus()&&299>=-da.getStatus()?M("data:image/png;base64,"+da.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,n,x,F,G){var L=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),M=L.getElementsByTagName("a");if(null!=M)for(var K=0;K<M.length;K++){var Z=M[K].getAttribute("href");null!=Z&&"#"==Z.charAt(0)&&"_blank"==M[K].getAttribute("target")&&M[K].removeAttribute("target")}n&&+/(\.html)$/i.test(g)||(g=g+"."+(null!=F?F:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=n?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,g),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,+l,n);else{var G=document.createElement("a");F=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof G.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);F=65==(L?parseInt(L[2],10):!1)?!1:F}if(F||this.isOffline()){G.href=URL.createObjectURL(n?this.base64ToBlob(c,l):new Blob([c],{type:l}));F?G.download=g:G.setAttribute("target","_blank");document.body.appendChild(G);try{window.setTimeout(function(){URL.revokeObjectURL(G.href)},+2E4),G.click(),G.parentNode.removeChild(G)}catch(M){}}else this.createEchoRequest(c,g,l,n,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,l,n,x,F){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=x?"&format="+x:"")+(null!=F?"&base64="+F:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,g,l,n,x,F,G,L,M){F=null!=F?F:!1;G=null!=G?G:"vsdx"!=x&&(!mxClient.IS_IOS||+!navigator.standalone);var K=mxUtils.bind(this,function(ja,da,ba,na){try{if("_blank"==da)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,n);else if(null!=l&&"text/html"==l.substring(0,9)){var ca=new EmbedDialog(this,c);this.showDialog(ca.container,450,240,!0,!0);ca.init()}else{var ka=window.open("about:blank");null==ka?mxUtils.popup(c,!0):(ka.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),ka.document.close())}else if(da==App.MODE_DEVICE||"download"==da)this.doSaveLocalFile(c,+ja,l,n,null,L);else if(null!=ja&&0<ja.length){var aa=mxUtils.bind(this,function(V){try{this.exportFile(c,ja,l,n,da,V)}catch(k){this.handleError(k)}});null!=na?aa(na):this.pickFolder(da,aa)}}catch(V){this.handleError(V)}});x=[];F||x.push(App.MODE_BROWSER);G||x.push("_blank");var Z=new SaveDialog(this,g,mxUtils.bind(this,function(ja,da,ba){K(ja.value,da,ja,ba);this.hideDialog(null,null,Z.container)}),x,c,l,n,M);this.showDialog(Z.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));+Z.init()};EditorUi.prototype.openInNewWindow=function(c,g,l){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var x="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var F=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=F&&(x="background: "+F+";")}x='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+x+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||l?(F=l?c:btoa(unescape(encodeURIComponent(c))),+n.document.write(x+'<img style="max-width:100%;" src="data:'+g+";base64,"+F+'"/></body></html>')):n.document.write(x+c+"</body></html>"):n.document.write(x+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");n.document.close()}};var t=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){this.tagsDialog=this.tagsComponent=null;var g=c(mxUtils.bind(this,function(n){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 x=g.getBoundingClientRect();this.tagsDialog.style.left=x.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=x.zIndex;document.body.appendChild(this.tagsDialog);+this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();g.style.display=0<n.length?"":"none"}))}t.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()){this.exportDialog=null;var l=c(mxUtils.bind(this,function(n){var x=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",x);null!=this.exportDialog&&+(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)x.apply(this);else{this.exportDialog=document.createElement("div");var F=l.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=F.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";F=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=F.zIndex;var G=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});G.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",x);this.editor.exportToCanvas(mxUtils.bind(this,function(L){G.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var M=this.createImageDataUri(L,null,"png");L=document.createElement("img");L.style.maxWidth="140px";L.style.maxHeight="140px";+L.style.cursor="pointer";L.style.backgroundColor="white";L.setAttribute("title",mxResources.get("openInNewWindow"));L.setAttribute("border","0");L.setAttribute("src",M);this.exportDialog.appendChild(L);mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.openInNewWindow(M.substring(M.indexOf(",")+1),"image/png",!0);x.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(L){G.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),+this.exportDialog=null);this.handleError(L)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,l,n,x,F){this.isLocalFileSave()?this.saveLocalFile(l,c,n,x,g,F):this.saveRequest(c,g,mxUtils.bind(this,function(G,L){return this.createEchoRequest(l,G,n,x,g,L)}),l,x,n)};EditorUi.prototype.saveRequest=function(c,g,l,n,x,F,G){G=null!=G?G:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,+function(K,Z,ja,da){if("_blank"==Z||null!=K&&0<K.length){var ba=l("_blank"==Z?null:K,Z==App.MODE_DEVICE||"download"==Z||null==Z||"_blank"==Z?"0":"1");null!=ba&&(Z==App.MODE_DEVICE||"download"==Z||"_blank"==Z?ba.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(na){F=null!=F?F:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,K,F,!0,Z,na)}catch(ca){this.handleError(ca)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ba.send(mxUtils.bind(this,function(){this.spinner.stop();+if(200<=ba.getStatus()&&299>=ba.getStatus())try{this.exportFile(ba.getText(),K,F,!0,Z,na)}catch(ca){this.handleError(ca)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(ca){this.spinner.stop();this.handleError(ca)}))}),null!=da?ja(da):this.pickFolder(Z,ja)))}});x=[App.MODE_BROWSER];G||x.push("_blank");var M=new SaveDialog(this,c,mxUtils.bind(this,function(K,Z,ja){L(K.value,Z,K,ja);this.hideDialog(null,null,M.container)}),x,null,"application/pdf");this.showDialog(M.container,+420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));M.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,g,l,n,x,F){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,g,l){g(null)};EditorUi.prototype.exportSvg=function(c,g,l,n,x,F,+G,L,M,K,Z,ja,da,ba){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,g,l,n,x,F,G,L,M,K,Z,ja,da,ba)}));this.handleError(la)})))try{var na=this.editor.graph.isSelectionEmpty();l=null!=l?l:na;var ca=g?null:this.editor.graph.background;ca==mxConstants.NONE&&(ca=null);null==ca&&0==g&&(ca=this.editor.graph.shapeBackgroundColor);var ka=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var aa=mxUtils.lightDarkColorSupported,V=mxUtils.preferDarkColor;if("light"==Z||"dark"==Z)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Z;var k=Graph.addFont,v={};Graph.addFont=function(la,qa,ya,wa){k.call(this,la,qa,ya,v)};var J=this.editor.graph.createSvgImageExport(x),N=J.drawCellState;J.drawCellState=function(la,qa){null!=la&&Graph.processFontStyle(la.style);N.apply(this,arguments)};var T=this.editor.graph.getSvg(ca,+c,G,L,null,l,null,J,"blank"==K?"_blank":"self"==K?"_top":null,null,!da,Z,ja);mxUtils.lightDarkColorSupported=aa;mxUtils.preferDarkColor=V;this.editor.graph.addForeignObjectWarning=ka;n&&this.editor.graph.addSvgShadow(T);var W=this.getBaseFilename()+(x?".drawio":"")+".svg";ba=null!=ba?ba:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=MAX_REQUEST_SIZE?this.saveData(W,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,+function(){mxUtils.popup(la)}))});var U=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,l,M,null,null,null,null,null,c,G));ba(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(T);var Y=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&F&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&da?this.replaceAlternateContent(la,+Z,U):U(la)}),fa=Graph.customFontElements;Graph.customFontElements=v;var oa=mxUtils.bind(this,function(la){Graph.customFontElements=fa;Graph.addFont=k;F&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,Y,this.thumbImageCache)):Y(la)});da?this.embedFonts(T,oa):(this.editor.addFontCss(T),oa(T))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,g,l){function n(ja,da,ba,na,ca){var ka=mxUtils.createElementNs(c.ownerDocument,+mxConstants.NS_SVG,"image");ka.setAttribute("x",da);ka.setAttribute("y",ba+.5);ka.setAttribute("width",na.width);ka.setAttribute("height",na.height);null==ka.setAttributeNS?ka.setAttribute("xlink:href",ca):ka.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ca);ja.replaceChild(ka,ja.lastChild);L()}function x(){if(G<Z.length)Z[G++](x)}var F="";g=c.getElementsByTagName("style");for(var G=0;G<g.length;G++)F+=g[G].innerHTML;g=c.getElementsByTagName("switch");counter=g.length;var L=mxUtils.bind(this,function(){counter--;+0==counter&&l(c)}),M={},K={},Z=[];for(G=0;G<g.length;G++)mxUtils.bind(this,function(ja){var da=ja.getElementsByTagName("div");if(0<da.length)try{var ba=da[0].cloneNode(!0),na=parseInt(ba.style.marginLeft),ca=parseInt(ba.style.paddingTop),ka=ba.getElementsByTagName("div")[1],aa=da=!1,V=ba.style.alignItems,k=ba.style.justifyContent;if(null!=ba.style.writingMode){var v=ba.style.writingMode;aa="vertical-"==v.substring(0,9);da="-rl"==v.substring(v.length-3)}var J=!aa&&"1px"==ba.style.width||aa&&"1px"==+ba.style.height;if(!aa&&"1px"==ba.style.height||aa&&"1px"==ba.style.width)ba.style.alignItems=aa&&da?"unsafe flex-end":"unsafe flex-start";J&&(ba.style.justifyContent="unsafe flex-start");ba.style.paddingTop="";ba.style.marginLeft="";var N=ba.outerHTML,T=M[N];null==T&&(ba.style.position="absolute",ba.style.visibility="hidden",document.body.appendChild(ba),v=1,v="1px"==ba.style.width?ka.offsetWidth:parseInt(ba.style.width),J=1,J="1px"==ba.style.height?ka.offsetHeight:parseInt(ba.style.height),document.body.removeChild(ba),+T=new mxRectangle(na,ca,v,J),M[N]=T);"1px"==ba.style.height&&("unsafe center"==V?ca-=T.height/2:"unsafe flex-end"==V&&(ca-=T.height));if("1px"==ba.style.width)if(!aa&&"unsafe center"==k||aa&&"unsafe center"==V)na-=T.width/2;else if(!aa&&"unsafe flex-end"==k||aa&&(!da&&"unsafe flex-end"==V||da&&"unsafe flex-start"==V))na-=T.width;T=new mxRectangle(na,ca,T.width,T.height+parseInt(ka.style.fontSize)/4);Z.push(mxUtils.bind(this,function(W){var U=K[N];null==U?Graph.htmlToPng(N,T.width,T.height,mxUtils.bind(this,+function(Y){n(ja,na,ca,T,Y);K[N]=Y;W()}),F):(n(ja,na,ca,T,U),W())}))}catch(W){L()}else L()})(g[G]);0==counter&&l(c);G=0;x()};EditorUi.prototype.addRadiobox=function(c,g,l,n,x,F,G){return this.addCheckbox(c,l,n,x,F,G,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,l,n,x,F,G,L){F=null!=F?F:!0;var M=document.createElement("input");M.style.marginRight="8px";M.style.marginTop="16px";M.setAttribute("type",G?"radio":"checkbox");G="geCheckbox-"+Editor.guid();M.id=G;null!=L&&M.setAttribute("name",L);l&&+(M.setAttribute("checked","checked"),M.defaultChecked=!0);n&&M.setAttribute("disabled","disabled");F&&(c.appendChild(M),l=document.createElement("label"),mxUtils.write(l,g),l.setAttribute("for",G),c.appendChild(l),x||mxUtils.br(c));return M};EditorUi.prototype.addEditButton=function(c,g){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var n=this.getCurrentFile(),x="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(x=window.location.href);+var F=document.createElement("select");F.style.maxWidth="200px";F.style.width="auto";F.style.marginLeft="8px";F.style.marginRight="10px";F.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));F.appendChild(n);var G=document.createElement("option");G.setAttribute("value","custom");mxUtils.write(G,mxResources.get("custom")+"...");F.appendChild(G);c.appendChild(F);mxEvent.addListener(F,"change",mxUtils.bind(this,function(){if("custom"==+F.value){var L=new FilenameDialog(this,x,mxResources.get("ok"),function(M){null!=M?(x=M,G.setAttribute("title",M)):(F.value="blank",G.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){F.value="blank"});this.showDialog(L.container,300,80,!0,!1);L.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==g||g.checked)?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?+"blank"===F.value?"_blank":x:null},getEditInput:function(){return l},getEditSelect:function(){return F}}};EditorUi.prototype.addLinkSection=function(c,g){function l(){var L=document.createElement("div");L.style.width="100%";L.style.height="100%";L.style.boxSizing="border-box";null!=F&&F!=mxConstants.NONE?(L.style.border="1px solid black",L.style.backgroundColor=F):(L.style.backgroundPosition="center center",L.style.backgroundRepeat="no-repeat",L.style.backgroundImage="url('"+Dialog.prototype.closeImage++"')");G.innerText="";G.appendChild(L)}mxUtils.write(c,mxResources.get("links")+":");var n=document.createElement("select");n.style.width="100px";n.style.padding="0px";n.style.marginLeft="8px";n.style.marginRight="10px";n.className="geBtn";var x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));n.appendChild(x);+x=document.createElement("option");x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));n.appendChild(x);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var F="#0000ff",G=null;G=mxUtils.button("",mxUtils.bind(this,function(L){this.pickColor(F||"none",function(M){F=M;l()});+mxEvent.consume(L)}));l();G.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";G.style.marginLeft="4px";G.style.height="22px";G.style.width="22px";G.style.position="relative";G.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";G.className="geColorBtn";c.appendChild(G);mxUtils.br(c);return{getColor:function(){return F},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,l,n,x,F){F=null!=F?F:[];l&&(F.push("lightbox=1"),+"auto"!=c&&F.push("target="+c),null!=g&&g!=mxConstants.NONE&&F.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=n&&0<n.length&&F.push("edit="+encodeURIComponent(n)),x&&F.push("layers=1"),this.editor.graph.foldingEnabled&&F.push("nav=1"));return F};EditorUi.prototype.createLink=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){var ba=this.getCurrentFile();M=this.createUrlParameters(c,g,n,x,F,M);c=!0;null!=G?l="#U"+encodeURIComponent(G):L||null==ba||""==ba.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="#"+ba.getHash(),c=!1);c&&null!=ba&&null!=ba.getTitle()&&ba.getTitle()!=this.defaultFilename&&M.push("title="+encodeURIComponent(ba.getTitle()));K&&1<l.length&&(M.push("open="+l.substring(1)),l="");Z&&null!=this.currentPage&&M.push("page-id="+this.currentPage.getId());ja&&M.push("transparent=1");null!=da&&M.push("dark="+da);return(n&&(null!=G||null!=ba&&ba.getMode()!=App.MODE_GITHUB&&ba.getMode()!=+App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<M.length?"?"+M.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,g,l,n,x,F,G,L,M,K,Z,ja,da){this.getBasenames();var ba={};""!=x&&x!=mxConstants.NONE&&(ba.highlight=x);"auto"!==n&&(ba.target=n);K||(ba.lightbox=!1);ba.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(ba.zoom=l/100);+l=[];G&&(l.push("pages"),ba.resize=!0,null!=this.pages&&null!=this.currentPage&&(ba.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(l.push("zoom"),ba.resize=!0);L&&l.push("layers");M&&l.push("tags");null!=da&&(ba["dark-mode"]=da);0<l.length&&(K&&l.push("lightbox"),ba.toolbar=l.join(" "));null!=Z&&0<Z.length&&(ba.edit=Z);null!=c?ba.url=c:ba.xml=this.getFileData(!0,null,null,null,null,!G);g='<div class="mxgraph" style="'+(F?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'++mxUtils.htmlEntities(JSON.stringify(ba))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<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.showHtmlDialog=function(c,g,l,n){var x=document.createElement("div");+x.style.whiteSpace="nowrap";var F=document.createElement("h3");mxUtils.write(F,mxResources.get("html"));F.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";x.appendChild(F);var G=document.createElement("div");G.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var L=document.createElement("input");L.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name",+"type-embedhtmldialog");F=L.cloneNode(!0);F.setAttribute("value","copy");G.appendChild(F);var M=document.createElement("span");mxUtils.write(M,mxResources.get("includeCopyOfMyDiagram"));G.appendChild(M);mxUtils.br(G);G.appendChild(L);M=document.createElement("span");mxUtils.write(M,mxResources.get("publicDiagramUrl"));G.appendChild(M);var K=this.getCurrentFile();null==l&&null!=K&&K.constructor==window.DriveFile&&(M=document.createElement("a"),M.style.paddingLeft="12px",M.style.color="gray",M.style.cursor=+"pointer",mxUtils.write(M,mxResources.get("share")),G.appendChild(M),mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(K.getId(),K)})));F.setAttribute("checked","checked");null==l&&L.setAttribute("disabled","disabled");x.appendChild(G);G=380;var Z=this.addLinkSection(x),ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";ja.style.marginTop="16px";M=document.createElement("option");M.setAttribute("value","light");+mxUtils.write(M,mxResources.get("light"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));ja.appendChild(M);M=document.createElement("option");M.setAttribute("value","auto");mxUtils.write(M,mxResources.get("automatic"));M.setAttribute("selected","selected");ja.appendChild(M);M.setAttribute("selected","selected");mxUtils.write(x,mxResources.get("appearance")+":");x.appendChild(ja);mxUtils.br(x);G+=26;var da=this.addCheckbox(x,+mxResources.get("zoom"),!0,null,!0);mxUtils.write(x,":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value="100%";x.appendChild(ba);var na=this.addCheckbox(x,mxResources.get("fit"),!0);M=null!=this.pages&&1<this.pages.length;var ca=ca=this.addCheckbox(x,mxResources.get("allPages"),M,!M),ka=this.addCheckbox(x,mxResources.get("layers"),!0),aa=this.addCheckbox(x,mxResources.get("tags"),+!0),V=this.addCheckbox(x,mxResources.get("lightbox"),!0),k=null;if(EditorUi.enableHtmlEditOption){k=this.addEditButton(x,V);var v=k.getEditInput();v.style.marginBottom="16px";G+=50;mxEvent.addListener(V,"change",function(){V.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");v.checked&&V.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,x,mxUtils.bind(this,function(){n(L.checked?l:null,da.checked,+ba.value,Z.getTarget(),Z.getColor(),na.checked,ca.checked,ka.checked,aa.checked,V.checked,null!=k?k.getLink():null,null!=ja?ja.value:null)}),null,c,g);this.showDialog(c.container,340,G,!0,!0);F.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,l,n,x,F,G,L,M,K,Z,ja){var da=document.createElement("div");da.style.whiteSpace="nowrap";var ba=document.createElement("h3");mxUtils.write(ba,c||mxResources.get("publish"));ba.style.width="100%";ba.style.textAlign="center";ba.style.marginTop="2px";+ba.style.marginBottom="20px";da.appendChild(ba);var na=document.createElement("select");c=30;na.className="geBtn";na.style.marginBottom="8px";na.style.marginLeft="0px";na.style.width="100%";na.style.boxSizing="border-box";if(null==L||""==L.getHash())x=null!=x?x:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ba=document.createElement("option"),mxUtils.write(ba,mxResources.get("makeCopy")),ba.setAttribute("value","copy"),na.appendChild(ba);ba=document.createElement("option");mxUtils.write(ba,+mxResources.get("authorizationRequired"));ba.setAttribute("value","auth");na.appendChild(ba);null!=L&&""!=L.getHash()||ba.setAttribute("disabled","disabled");L=document.createElement("option");L.setAttribute("value","public");na.appendChild(L);null!=G?(mxUtils.write(L,mxResources.get("publicDiagramUrl")),L.setAttribute("title",G),na.value="public"):(mxUtils.write(L,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),L.setAttribute("disabled","disabled"));da.appendChild(na);+mxUtils.br(da);na.focus();var ca=null,ka=null;if(null!=g||null!=l)c+=30,mxUtils.write(da,mxResources.get("width")+":"),ca=document.createElement("input"),ca.setAttribute("type","text"),ca.style.marginRight="16px",ca.style.width="50px",ca.style.marginLeft="6px",ca.style.marginRight="16px",ca.style.marginBottom="10px",ca.value="100%",da.appendChild(ca),mxUtils.write(da,mxResources.get("height")+":"),ka=document.createElement("input"),ka.setAttribute("type","text"),ka.style.width="50px",ka.style.marginLeft=+"6px",ka.style.marginBottom="10px",ka.value=l+"px",da.appendChild(ka),mxUtils.br(da);var aa=this.addLinkSection(da,n),V=K?this.addCheckbox(da,mxResources.get("transparentBackground"),!1):null;null!=V&&(c+=20);var k=document.createElement("select");k.className="geBtn";k.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");k.appendChild(g);g=document.createElement("option");mxUtils.write(g,mxResources.get("currentPage"));+g.setAttribute("value","currentPage");k.appendChild(g);var v=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(da,mxResources.get("pages")+":"),da.appendChild(k),mxUtils.br(da),c+=30),v=this.addCheckbox(da,mxResources.get("selectedPage")+": "+g));var J=document.createElement("select");J.style.maxWidth="260px";J.style.marginLeft="8px";J.style.marginTop=+"16px";ja=document.createElement("option");ja.setAttribute("value","0");mxUtils.write(ja,mxResources.get("light"));J.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));J.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected","selected");J.appendChild(ja);Z&&(mxUtils.write(da,mxResources.get("appearance")+":"),da.appendChild(J),+mxUtils.br(da),c+=30);var N=this.addCheckbox(da,mxResources.get("lightbox"),!0,null,null,!n),T=this.addEditButton(da,N),W=T.getEditInput();n&&(W.style.marginLeft=N.style.marginLeft,N.style.display="none",c-=20);var U=this.addCheckbox(da,mxResources.get("layers"),!0);U.style.marginLeft=W.style.marginLeft;U.style.marginTop="8px";var Y=this.addCheckbox(da,mxResources.get("tags"),!0);Y.style.marginLeft=W.style.marginLeft;Y.style.marginBottom="16px";Y.style.marginTop="16px";mxEvent.addListener(N,"change",+function(){N.checked?(U.removeAttribute("disabled"),W.removeAttribute("disabled"),Y.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),Y.setAttribute("disabled","disabled"));W.checked&&N.checked?T.getEditSelect().removeAttribute("disabled"):T.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,da,mxUtils.bind(this,function(){M(aa.getTarget(),aa.getColor(),null==v?!1:v.checked,N.checked,T.getLink(),U.checked,null!=ca?+ca.value:null,null!=ka?ka.value:null,Y.checked,na.value,null!=V?V.checked:!1,J.value,"allPages"==k.value)}),null,mxResources.get("create"),x,F);this.showDialog(n.container,340,296+c,!0,!0);null!=ca?(ca.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ca.select():document.execCommand("selectAll",!1,null)):null==na.parentNode;aa.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,g,l,n,x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var G=document.createElement("h3");+mxUtils.write(G,mxResources.get("image"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(x?"10":"4")+"px";F.appendChild(G);if(x){mxUtils.write(F,mxResources.get("zoom")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";L.style.width="60px";L.style.marginLeft="4px";L.style.marginRight="12px";L.value=this.lastExportZoom||"100%";F.appendChild(L);mxUtils.write(F,mxResources.get("borderWidth")+":");var M=document.createElement("input");+M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.value=this.lastExportBorder||"0";F.appendChild(M);mxUtils.br(F)}var K=this.addCheckbox(F,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Z=n?null:this.addCheckbox(F,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);G=this.editor.graph;var ja=n?null:this.addCheckbox(F,mxResources.get("transparentBackground"),G.background==mxConstants.NONE||null==G.background);+null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,F,mxUtils.bind(this,function(){var da=parseInt(L.value)/100||1,ba=parseInt(M.value)||0;l(!K.checked,null!=Z?Z.checked:!1,null!=ja?ja.checked:!1,da,ba)}),null,c,g);this.showDialog(c.container,300,(x?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,l,n,x,F,G,L,M){G=null!=G?G:Editor.defaultIncludeDiagram;var K=document.createElement("div");K.style.whiteSpace="nowrap";var Z=this.editor.graph,ja="jpeg"==L||"webp"==+L?220:320,da=document.createElement("h3");mxUtils.write(da,c);da.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";K.appendChild(da);mxUtils.write(K,mxResources.get("zoom")+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value=this.lastExportZoom||"100%";K.appendChild(ba);mxUtils.write(K,mxResources.get("borderWidth")+":");var na=document.createElement("input");+na.setAttribute("type","text");na.style.marginRight="16px";na.style.width="60px";na.style.marginLeft="4px";na.value=this.lastExportBorder||"0";K.appendChild(na);mxUtils.br(K);var ca=this.addCheckbox(K,mxResources.get("selectionOnly"),!1,Z.isSelectionEmpty()),ka=document.createElement("input");ka.style.marginTop="16px";ka.style.marginRight="8px";ka.style.marginLeft="24px";ka.setAttribute("disabled","disabled");ka.setAttribute("type","checkbox");var aa=document.createElement("select");aa.style.marginTop=+"16px";aa.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(da=0;da<c.length;da++)if(!Z.isSelectionEmpty()||"selectionOnly"!=c[da]){var V=document.createElement("option");mxUtils.write(V,mxResources.get(c[da]));V.setAttribute("value",c[da]);aa.appendChild(V)}M?(mxUtils.write(K,mxResources.get("size")+":"),K.appendChild(aa),mxUtils.br(K),ja+=26,mxEvent.addListener(aa,"change",function(){"selectionOnly"==aa.value&&(ca.checked=!0)})):F&&(K.appendChild(ka),mxUtils.write(K,mxResources.get("crop")),+mxUtils.br(K),ja+=30,mxEvent.addListener(ca,"change",function(){ca.checked?ka.removeAttribute("disabled"):ka.setAttribute("disabled","disabled")}));Z.isSelectionEmpty()?M&&(ca.style.display="none",ca.nextSibling.style.display="none",ca.nextSibling.nextSibling.style.display="none",ja-=30):(aa.value="diagram",ka.setAttribute("checked","checked"),ka.defaultChecked=!0,mxEvent.addListener(ca,"change",function(){aa.value=ca.checked?"selectionOnly":"diagram"}));var k=this.addCheckbox(K,mxResources.get("transparentBackground"),+!1,null,null,"jpeg"!=L&&"webp"!=L),v=document.createElement("select");v.style.maxWidth="260px";v.style.marginLeft="8px";v.style.marginTop="16px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));v.appendChild(F);M=document.createElement("option");M.setAttribute("value","dark");mxUtils.write(M,mxResources.get("dark"));v.appendChild(M);"svg"==L&&mxUtils.lightDarkColorSupported?(F=document.createElement("option"),F.setAttribute("value","auto"),+mxUtils.write(F,mxResources.get("automatic")),F.setAttribute("selected","selected"),v.appendChild(F)):Editor.isDarkMode()?M.setAttribute("selected","selected"):F.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("appearance")+":");K.appendChild(v);mxUtils.br(K);ja+=26;var J=this.addCheckbox(K,mxResources.get("shadow"),Z.shadowVisible),N=null;if("png"==L||"jpeg"==L||"webp"==L)N=this.addCheckbox(K,mxResources.get("grid"),!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;Z=+null!=this.pages?this.pages.length:1;var T=this.addCheckbox(K,mxResources.get("includeCopyOfMyDiagram")+(1<Z?":":""),G,null,null,"jpeg"!=L&&"webp"!=L),W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="28px";"png"==L||"svg"==L?(G=function(){T.checked?W.removeAttribute("disabled"):W.setAttribute("disabled","disabled")},F=document.createElement("option"),F.setAttribute("value","allPages"),mxUtils.write(F,mxResources.get("allPages")),W.appendChild(F),F=document.createElement("option"),+F.setAttribute("value","currentPage"),mxUtils.write(F,mxResources.get("currentPage")),W.appendChild(F),1<Z?(T.style.marginBottom="12px",W.style.marginBottom="16px",K.appendChild(W),mxUtils.br(K),ja+=20):T.style.marginBottom="16px",null!=this.lastEmbedInclude&&(W.value=this.lastEmbedInclude),mxEvent.addListener(T,"change",G),G()):T.style.marginBottom="16px";var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";U.setAttribute("type","checkbox");U.id="geCheckbox-"++Editor.guid();var Y=document.createElement("input");Y.style.marginBottom="16px";Y.style.marginRight="8px";Y.setAttribute("type","checkbox");Y.id="geCheckbox-"+Editor.guid();g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,K.appendChild(U),G=document.createElement("label"),mxUtils.write(G,mxResources.get("embedImages")),G.setAttribute("for",U.id),K.appendChild(G),mxUtils.br(K),Y.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,K.appendChild(Y),G=document.createElement("label"),+mxUtils.write(G,mxResources.get("embedFonts")),G.setAttribute("for",Y.id),K.appendChild(G),mxUtils.br(K),ja+=50);var fa=document.createElement("select");fa.style.maxWidth="260px";fa.style.marginLeft="8px";F=document.createElement("option");F.setAttribute("value","auto");mxUtils.write(F,mxResources.get("automatic"));fa.appendChild(F);G=document.createElement("option");G.setAttribute("value","blank");mxUtils.write(G,mxResources.get("openInNewWindow"));fa.appendChild(G);G=document.createElement("option");+G.setAttribute("value","self");mxUtils.write(G,mxResources.get("openInThisWindow"));fa.appendChild(G);G=document.createElement("div");mxUtils.write(G,mxResources.get("LinksLost"));G.style.margin="7px";G.style.display="none";"svg"==L&&(mxUtils.write(K,mxResources.get("links")+":"),K.appendChild(fa),K.appendChild(G),mxUtils.br(K),mxUtils.br(K),ja+=50);l=new CustomDialog(this,K,mxUtils.bind(this,function(){this.lastExportBorder=na.value;this.lastExportZoom=ba.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=+Y.checked;this.lastEmbedInclude=W.value;x(ba.value,k.checked,!ca.checked,J.checked,T.checked,U.checked&&g,na.value,ka.checked,("png"==L||"svg"==L)&&"currentPage"==W.value,fa.value,null!=N?N.checked:null,null!=v?v.value:null,aa.value,Y.checked)}),null,l,n);this.showDialog(l.container,340,ja,!0,!0,null,null,null,null,!0);ba.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ba.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,l,n,+x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var G=this.editor.graph;if(null!=g){var L=document.createElement("h3");mxUtils.write(L,g);L.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";F.appendChild(L)}var M=this.addCheckbox(F,mxResources.get("fit"),!0),K=this.addCheckbox(F,mxResources.get("shadow"),G.shadowVisible&&n,!n),Z=this.addCheckbox(F,l),ja=this.addCheckbox(F,mxResources.get("lightbox"),!0),da=this.addEditButton(F,ja),ba=da.getEditInput(),+na=1<G.model.getChildCount(G.model.getRoot()),ca=this.addCheckbox(F,mxResources.get("layers"),na,!na);ca.style.marginLeft=ba.style.marginLeft;ca.style.marginBottom="12px";ca.style.marginTop="8px";mxEvent.addListener(ja,"change",function(){ja.checked?(na&&ca.removeAttribute("disabled"),ba.removeAttribute("disabled")):(ca.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));ba.checked&&ja.checked?da.getEditSelect().removeAttribute("disabled"):da.getEditSelect().setAttribute("disabled",+"disabled")});g=new CustomDialog(this,F,mxUtils.bind(this,function(){c(M.checked,K.checked,Z.checked,ja.checked,da.getLink(),ca.checked)}),null,mxResources.get("embed"),x);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,l,n,x,F,G,L){function M(ba){var na=" ",ca="";n&&(na=" 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!=Z?"&page="+Z:"")+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}})(this);\"",ca+="cursor:pointer;");c&&(ca+="max-width:100%;");var ka="";l&&(ka=' width="'+Math.round(K.width)+'" height="'+Math.round(K.height)+'"');G('<img src="'+ba+'"'+ka+(""!=ca?' style="'+ca+'"':"")+na+"/>")}var K=this.editor.graph.getGraphBounds(),Z=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ba){var na=n?this.getFileData(!0):+null;ba=this.createImageDataUri(ba,na,"png");M(ba)}),null,null,null,mxUtils.bind(this,function(ba){L({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),K.width*K.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var ja="";l&&(ja="&w="+Math.round(2*K.width)+"&h="+Math.round(2*K.height));var da=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+ja+"&xml="+encodeURIComponent(g));da.send(mxUtils.bind(this,function(){200<=+da.getStatus()&&299>=da.getStatus()?M("data:image/png;base64,"+da.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,l,n,x,F,G){var L=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),M=L.getElementsByTagName("a");if(null!=M)for(var K=0;K<M.length;K++){var Z=M[K].getAttribute("href");null!=Z&&"#"==Z.charAt(0)&&"_blank"==M[K].getAttribute("target")&&M[K].removeAttribute("target")}n&&L.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(L);if(l){var ja=" ",da="";n&&(ja="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"+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}})(this);\"",da+="cursor:pointer;");c&&(da+="max-width:100%;");this.editor.convertImages(L,mxUtils.bind(this,function(ba){G('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ba))+'"'+(""!=da?' style="'+da+'"':"")+ja+"/>")}))}else da="",n&&(g=this.getSelectedPageIndex(),L.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"+(null!=g?"&page="+g:"")+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}}})(this);"),da+="cursor:pointer;"),c&&(c=parseInt(L.getAttribute("width")),x=parseInt(L.getAttribute("height")),L.setAttribute("viewBox","-0.5 -0.5 "+c+" "+x),da+="max-width:100%;max-height:"+x+"px;",L.removeAttribute("height")),""!=da&&L.setAttribute("style",da),this.editor.addFontCss(L),this.editor.graph.mathEnabled&&this.editor.addMathCss(L),G(mxUtils.getXml(L))};EditorUi.prototype.timeSince=@@ -4213,15 +4213,15 @@ Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-sGraphViewer.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.init=function(b,f,m){GraphViewer.initCss();this.graphConfig=null!=m?m:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.autoCrop=null!=this.graphConfig["auto-crop"]?this.graphConfig["auto-crop"]:this.autoCrop;this.autoOrigin=null!=this.graphConfig["auto-origin"]?this.graphConfig["auto-origin"]:this.autoOrigin;this.allowZoomOut=null!=this.graphConfig["allow-zoom-out"]?this.graphConfig["allow-zoom-out"]:this.allowZoomOut;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;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.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.editEnabled=0<=mxUtils.indexOf(this.toolbarItems,"editlocal");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.editor=null;var t=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=f&&(this.xmlDocument=f.ownerDocument,-this.xmlNode=f,this.xml=mxUtils.getXml(f),null!=b)){var y=mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var I=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?I.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(I.style.padding="8px");I.style.forcedColorAdjust="none";I.style.boxSizing="border-box";I.style.overflow="visible";-this.graph.fit=function(){};this.graph.sizeDidChange=function(){var x=this.view.graphBounds,F=this.view.translate;I.setAttribute("viewBox",x.x+F.x-this.panDx+" "+(x.y+F.y-this.panDy)+" "+(x.width+1)+" "+(x.height+1));this.container.style.backgroundColor=I.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",x))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(x){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.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=f)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(x){}this.graph.getImageFromBundles=function(x){return t.getImageUrl(x)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,-null,!0);if("mxfile"==this.xmlNode.nodeName){var D=this.xmlNode.getElementsByTagName("diagram");if(0<D.length){if(null!=this.pageId)for(S=0;S<D.length;S++)if(this.pageId==D[S].getAttribute("id")){this.currentPage=S;break}var P=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(x){var F=D[t.currentPage];return"page"==x?F.getAttribute("name")||"Page-"+(t.currentPage+1):"pagenumber"==x?t.currentPage+1:"pagecount"==x?D.length:P.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=-function(x){this.handlingResize||(this.currentPage=mxUtils.mod(x,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(x){x=this.getIndexById(x);var F=0<=x;F&&this.selectPage(x);return F};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});var g=this.graph.setBackgroundImage;this.graph.setBackgroundImage=-function(x){if(null!=x&&Graph.isPageLink(x.src)){var F=x.src,G=F.indexOf(",");0<G&&(G=t.getIndexById(F.substring(G+1)),0<=G&&(x=t.getImageForGraphModel(Editor.parseDiagramNode(t.diagrams[G])),x.originalSrc=F))}g.apply(this,arguments)};var l=this.graph.getGraphBounds;this.graph.getGraphBounds=function(x){var F=l.apply(this,arguments);x=this.backgroundImage;if(null!=x){var G=this.view.translate,L=this.view.scale;F=mxRectangle.fromRectangle(F);F.add(new mxRectangle((G.x+x.x)*L,(G.y+x.y)*L,x.width*L,-x.height*L))}return F};this.addListener("xmlNodeChanged",S);S();urlParams.page=t.currentPage;S=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,S=this.setLayersVisible(),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.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.editor=null;var t=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=f&&(this.xmlDocument=f.ownerDocument,this.xmlNode=f,this.xml=mxUtils.getXml(f),null!=b)){var y=+mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var I=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?I.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(I.style.padding="8px");I.style.forcedColorAdjust="none";I.style.boxSizing="border-box";I.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var x=+this.view.graphBounds,F=this.view.translate;I.setAttribute("viewBox",x.x+F.x-this.panDx+" "+(x.y+F.y-this.panDy)+" "+(x.width+1)+" "+(x.height+1));this.container.style.backgroundColor=I.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",x))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(x){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.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=f)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(x){}this.graph.getImageFromBundles=function(x){return t.getImageUrl(x)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var D=+this.xmlNode.getElementsByTagName("diagram");if(0<D.length){if(null!=this.pageId)for(S=0;S<D.length;S++)if(this.pageId==D[S].getAttribute("id")){this.currentPage=S;break}var P=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(x){var F=D[t.currentPage];return"page"==x?F.getAttribute("name")||"Page-"+(t.currentPage+1):"pagenumber"==x?t.currentPage+1:"pagecount"==x?D.length:P.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(x){this.handlingResize||(this.currentPage=+mxUtils.mod(x,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(x){x=this.getIndexById(x);var F=0<=x;F&&this.selectPage(x);return F};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});var g=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(x){if(null!=x&&+Graph.isPageLink(x.src)){var F=x.src,G=F.indexOf(",");0<G&&(G=t.getIndexById(F.substring(G+1)),0<=G&&(x=t.getImageForGraphModel(Editor.parseDiagramNode(t.diagrams[G])),x.originalSrc=F))}g.apply(this,arguments)};var l=this.graph.getGraphBounds;this.graph.getGraphBounds=function(x){var F=l.apply(this,arguments);x=this.backgroundImage;if(null!=x){var G=this.view.translate,L=this.view.scale;F=mxRectangle.fromRectangle(F);F.add(new mxRectangle((G.x+x.x)*L,(G.y+x.y)*L,x.width*L,x.height*L))}return F};this.addListener("xmlNodeChanged",+S);S();urlParams.page=t.currentPage;S=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,S=this.setLayersVisible(),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(x){return!mxEvent.isPopupTrigger(x.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!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(x,F){try{if(Graph.isPageLink(x)){var G=x.indexOf(",");t.selectPageById(x.substring(G+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var L=this.getGraphBounds();this.handleCustomLink(x,F);L.equals(this.getGraphBounds())||t.crop()}}catch(M){alert(M.message)}return!0};var n=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return n.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 q=@@ -4262,12 +4262,11 @@ g.style.fontSize="11px";g.style.overflowY="auto";g.style.maxHeight=this.graph.cofunction(){K.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"});K.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"}}else if("tags"==G){if(this.tagsEnabled){var Z=P(mxUtils.bind(this,function(ba){null==l&&(l=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),l.div.getElementsByTagName("div")[0].style.position="",l.div.style.maxHeight="160px",l.div.style.maxWidth="120px",l.div.style.padding="2px",l.div.style.overflow="auto",l.div.style.height="auto",l.div.style.position="fixed",l.div.style.fontFamily=GraphViewer.cssFontFamily,l.div.style.fontSize="11px",l.div.style.backgroundColor="#eee",l.div.style.color="#000",l.div.style.border="1px solid #d0d0d0",l.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(l.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(l.div,85));if(null!=n)n.parentNode.removeChild(n),n=null;else{n=l.div;n.style.position="absolute";mxEvent.addListener(n,"mouseleave",function(){null!=n&&(n.parentNode.removeChild(n),n=null)});ba=Z.getBoundingClientRect();var na=mxUtils.getDocumentScrollOrigin(document);n.style.left=na.x+ba.left-1+"px";n.style.top=na.y+ba.bottom-2+"px";document.body.appendChild(n);l.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");c.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){Z.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=n&&0==this.graph.getAllTags().length&&(n.parentNode.removeChild(n),n=null)}));Z.style.display=0<this.graph.getAllTags().length?"inline-flex":-"none"}}else"lightbox"==G?this.lightboxEnabled&&P(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ba){alert(ba.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):"editlocal"==G?this.editEnabled&&null!=this.graphConfig.editor&&P(mxUtils.bind(this,function(){try{window.location.href=this.graphConfig.editor+"#R"+encodeURIComponent(this.xml)}catch(ba){alert(ba.message)}}),Editor.editImage,mxResources.get("edit")||"Edit"):null!=this.graphConfig["toolbar-buttons"]&&-(G=this.graphConfig["toolbar-buttons"][G],null!=G&&(G.elem=P(null==G.enabled||G.enabled?G.handler:function(){},G.image,G.title,G.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*D);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),f.appendChild(m),this.filename=m);this.minToolbarWidth=34*D;var ja=b.style.border,da=mxUtils.bind(this,function(){f.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";f.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ba=b.getBoundingClientRect(),-na=mxUtils.getScrollOrigin(document.body);na="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-na.x,top:-na.y};ba={left:ba.left-na.left,top:ba.top-na.top,bottom:ba.bottom-na.top,right:ba.right-na.left};f.style.left=ba.left+"px";"bottom"==this.graphConfig["toolbar-position"]?f.style.top=ba.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(f.style.marginTop=-this.toolbarHeight+"px",f.style.top=ba.top+1+"px"):f.style.top=ba.top+"px";"1px solid transparent"==-ja&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(f);var ca=mxUtils.bind(this,function(){null!=f.parentNode&&f.parentNode.removeChild(f);null!=n&&(n.parentNode.removeChild(n),n=null);null!=g&&(g.parentNode.removeChild(g),g=null);b.style.border=ja});mxEvent.addListener(document,"mousemove",function(ka){for(ka=mxEvent.getSource(ka);null!=ka;){if(ka==b||ka==f||ka==g||ka==n)return;ka=ka.parentNode}ca()});mxEvent.addListener(document.body,"mouseleave",function(ka){ca()})}else f.style.top=--this.toolbarHeight+"px",b.appendChild(f)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",da):da();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=f.parentNode&&da()})).observe(b)};+"none"}}else"lightbox"==G?this.lightboxEnabled&&P(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ba){alert(ba.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(G=this.graphConfig["toolbar-buttons"][G],null!=G&&(G.elem=P(null==G.enabled||G.enabled?G.handler:function(){},G.image,G.title,G.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*D);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),f.appendChild(m),this.filename=m);this.minToolbarWidth=34*D;var ja=b.style.border,+da=mxUtils.bind(this,function(){f.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";f.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ba=b.getBoundingClientRect(),na=mxUtils.getScrollOrigin(document.body);na="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-na.x,top:-na.y};ba={left:ba.left-na.left,top:ba.top-na.top,bottom:ba.bottom-na.top,right:ba.right-na.left};f.style.left=+ba.left+"px";"bottom"==this.graphConfig["toolbar-position"]?f.style.top=ba.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(f.style.marginTop=-this.toolbarHeight+"px",f.style.top=ba.top+1+"px"):f.style.top=ba.top+"px";"1px solid transparent"==ja&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(f);var ca=mxUtils.bind(this,function(){null!=f.parentNode&&f.parentNode.removeChild(f);null!=n&&(n.parentNode.removeChild(n),n=null);null!=g&&(g.parentNode.removeChild(g),g=null);+b.style.border=ja});mxEvent.addListener(document,"mousemove",function(ka){for(ka=mxEvent.getSource(ka);null!=ka;){if(ka==b||ka==f||ka==g||ka==n)return;ka=ka.parentNode}ca()});mxEvent.addListener(document.body,"mouseleave",function(ka){ca()})}else f.style.top=-this.toolbarHeight+"px",b.appendChild(f)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",da):da();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=f.parentNode&&da()})).observe(b)};GraphViewer.prototype.createToolbarButton=function(b,f,m,t){var y=document.createElement("div");y.style.borderRight="1px solid #d0d0d0";y.style.display="inline-flex";y.style.alignItems="center";y.style.padding="6px";mxEvent.addListener(y,"click",b);null!=m&&y.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",f);b.style.width="18px";b.className="geAdaptiveAsset";null==t||t?(mxEvent.addListener(y,"mouseenter",function(){y.style.backgroundColor="light-dark(#dddddd,#333333)"}),mxEvent.addListener(y,"mouseleave",function(){y.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),y.style.cursor="pointer"):mxUtils.setOpacity(y,30);y.appendChild(b);return y};GraphViewer.prototype.disableButton=function(b,f){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"}),f&&m.elem.setAttribute("title",f))};diff --git a/src/main/webapp/mxgraph/mxClient.js b/src/main/webapp/mxgraph/mxClient.jsindex 757780f57..36a15557d 100644--- a/src/main/webapp/mxgraph/mxClient.js+++ b/src/main/webapp/mxgraph/mxClient.js@@ -1,4 +1,4 @@-var mxClient={VERSION:"29.2.6",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+var mxClient={VERSION:"29.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&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||diff --git a/src/main/webapp/service-worker.js b/src/main/webapp/service-worker.jsindex f6b6db37e..691829645 100644--- a/src/main/webapp/service-worker.js+++ b/src/main/webapp/service-worker.js@@ -1,2 +1,2 @@-if(!self.define){let e,i={};const s=(s,a)=>(s=new URL(s+".js",a).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(a,r)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(i[c])return;let o={};const n=e=>s(e,c),d={module:{uri:c},exports:o,require:n};i[c]=Promise.all(a.map((e=>d[e]||n(e)))).then((e=>(r(...e),o)))}}define(["./workbox-acfd85e3"],(function(e){"use strict";self.skipWaiting(),e.precacheAndRoute([{url:"js/bootstrap.js",revision:"f5b111b20ae08f69d46e5699e1f9a7c4"},{url:"js/main.js",revision:"a8d40469d3d72ab4b11059362f3dd825"},{url:"js/app.min.js",revision:"37dd19bcd233f7076db1a183296035d3"},{url:"js/extensions.min.js",revision:"9dbd8436c45fb61a4db5893540cbac0b"},{url:"js/orgchart.min.js",revision:"619d8c4dab47b81868916df31f55478b"},{url:"js/stencils.min.js",revision:"4c955b95c4308b0414578762513424d2"},{url:"js/shapes-14-6-5.min.js",revision:"6ce46f345044bdb3cde439bd81b37952"},{url:"js/math-print.js",revision:"ad9cf0f2f2b614eac58ea72499c1017f"},{url:"index.html",revision:"9de11c65ec13b24c73ace7042bc529cc"},{url:"open.html",revision:"d71816b3b00e769fc6019fcdd6921662"},{url:"shortcuts.svg",revision:"2381dd779ce6cfee954042a7f784c7e6"},{url:"styles/fonts/ArchitectsDaughter-Regular.ttf",revision:"31c2153c0530e32553b31a49b3d70736"},{url:"styles/grapheditor.css",revision:"ed4a663eb787c135a04e5f6c97bdaa47"},{url:"styles/high-contrast.css",revision:"4ecc9f6d08787a9e2d29dacf7aadd1ca"},{url:"js/dropbox/Dropbox-sdk.min.js",revision:"4b9842892aa37b156db0a8364b7a83b0"},{url:"js/onedrive/OneDrive.js",revision:"e863f5e6833892f22492211663e3efe9"},{url:"js/viewer-static.min.js",revision:"d449b8d8edd9775752aa9c6ab331ed65"},{url:"connect/jira/editor-1-3-3.html",revision:"41dc8af9576b47f359cff19fff7a41c2"},{url:"connect/jira/viewerPanel-1-3-12.html",revision:"4836f5e4308abe57830e441518364f23"},{url:"connect/jira/viewerPanel2.html",revision:"0dd1ee1343a46b5c03aedbc587450b84"},{url:"connect/jira/fullScreenViewer-1-3-3.html",revision:"abed474e47c0c41a5ad2366b4828f77a"},{url:"connect/jira/viewerPanel.js",revision:"85011efa68d638da560871ee2ab3a6fe"},{url:"connect/jira/spinner.gif",revision:"7d857ab9d86123e93d74d48e958fe743"},{url:"connect/jira/editor.js",revision:"3dc56c6566abaa7af151a8359e5bb556"},{url:"connect/jira/fullscreen-viewer-init.js",revision:"07043c1ee868dd425f7876da94bbc307"},{url:"connect/jira/fullscreen-viewer.js",revision:"a6be96b8ddc5a25196925713cf34d571"},{url:"plugins/connectJira.js",revision:"db54dba28f9f2510a00411a410c837a0"},{url:"plugins/cConf-comments.js",revision:"e4a4b5a0fb22393693d3b62968c50644"},{url:"plugins/cConf-1-4-8.js",revision:"f576f603a4a7755b37e1c4d332358ce1"},{url:"connect/confluence/connectUtils-1-4-8.js",revision:"ec3bc85db1e4451f87e63e23a0c36611"},{url:"connect/new_common/cac.js",revision:"443fb416a407b8a183d0c8f4ecf68808"},{url:"connect/gdrive_common/gac.js",revision:"ac3a28fa16c3e6a36af854fcfc018a81"},{url:"connect/onedrive_common/ac.js",revision:"37c626698573f4419ab9f7ecd7b4bb01"},{url:"connect/confluence/viewer-init.js",revision:"c5e51e32ac74414d8d518af83ee2781f"},{url:"connect/confluence/viewer.js",revision:"e6e7d871e09a377391e690f37da03445"},{url:"connect/confluence/viewer-1-4-42.html",revision:"69c1bca25fd4889bf832e8441c972268"},{url:"connect/confluence/macroEditor-1-4-8.html",revision:"4ad77ae3f08c19eddac932b2fa8c7068"},{url:"connect/confluence/includeDiagram-1-4-8.js",revision:"489bc44e46d6481277c3f2a5d81a2db6"},{url:"connect/confluence/includeDiagram.html",revision:"01b04b3f54f1e2e63fcf1df033d24519"},{url:"connect/confluence/macro-editor.js",revision:"b9000d6c20f30e4068f83bd0b56965ca"},{url:"math4/es5/ui/safe.js",revision:"540f14866ef7df930e923d164c211137"},{url:"math4/es5/core.js",revision:"366284f7ce6a80244ceaa3b8ee3e54e9"},{url:"math4/es5/input/tex/extensions/bbm.js",revision:"513ce4c980aacdcc90feec0713be74b1"},{url:"math4/es5/input/tex/extensions/html.js",revision:"51ffc0406fb08ecf28c53e72afe0a0ed"},{url:"math4/es5/input/tex/extensions/extpfeil.js",revision:"f272a36c89a652be5c65f28e353838b0"},{url:"math4/es5/input/tex/extensions/action.js",revision:"2a74c19cfefb234c2734e792c957c9a1"},{url:"math4/es5/input/tex/extensions/boldsymbol.js",revision:"f90dceccbe95e6404fde4f00eed2c8dd"},{url:"math4/es5/input/tex/extensions/cases.js",revision:"65cd3750c7490ac93cc68e52f74a1dab"},{url:"math4/es5/input/tex/extensions/colortbl.js",revision:"bfd4ec3e12e214119393fa61b0259f5d"},{url:"math4/es5/input/tex/extensions/verb.js",revision:"33057675c209f0b42365bcceb5288a44"},{url:"math4/es5/input/tex/extensions/unicode.js",revision:"92918f71eb0c857b36b138de9408eadc"},{url:"math4/es5/input/tex/extensions/cancel.js",revision:"3c69ed47f602c9052d603449f9d244ac"},{url:"math4/es5/input/tex/extensions/enclose.js",revision:"dceb251e090a0f9468eb668a2d2568d9"},{url:"math4/es5/input/tex/extensions/units.js",revision:"633ff0c3f4a982ee184fbca414d36425"},{url:"math4/es5/input/tex/extensions/color.js",revision:"2c905b4c025088fb367bfd66f7d67ba5"},{url:"math4/es5/input/tex/extensions/mathtools.js",revision:"7edddab4e756cd10637aeae4de404d75"},{url:"math4/es5/input/tex/extensions/begingroup.js",revision:"aa419405c6ad13e8b85137dcbd1c09dd"},{url:"math4/es5/input/tex/extensions/braket.js",revision:"598978a618d13df0329d00f242e7e7e9"},{url:"math4/es5/input/tex/extensions/dsfont.js",revision:"d4f5cb1231efc15a5a781366c0a6af6e"},{url:"math4/es5/input/tex/extensions/bbox.js",revision:"4036e6a76633738052eef578586f247a"},{url:"math4/es5/input/tex/extensions/amscd.js",revision:"c23bc24168bb563253bb1ef914e3ca32"},{url:"math4/es5/input/tex/extensions/textcomp.js",revision:"acdd5a6d8572b3693161533a5735671a"},{url:"math4/es5/input/tex/extensions/bussproofs.js",revision:"9e58e843a9ed1f94eee376e151d8eb58"},{url:"math4/es5/input/tex/extensions/bboldx.js",revision:"af20cca3c8cb6caa5e8544ab19d8679e"},{url:"math4/es5/input/tex/extensions/physics.js",revision:"82dfb1226c4797981024f28728cc5e1d"},{url:"math4/es5/input/tex/extensions/centernot.js",revision:"3e60d55d414becf276ae7874d935ba7e"},{url:"math4/es5/input/tex/extensions/gensymb.js",revision:"893f6dc84ea72d6e7cc2cca82d593aee"},{url:"math4/es5/input/tex/extensions/upgreek.js",revision:"8ec88557d9ffc45da864b9b2621439d7"},{url:"math4/es5/input/tex/extensions/empheq.js",revision:"0d474e9e342009b916cab0740be6ce1a"},{url:"math4/es5/input/tex/extensions/mhchem.js",revision:"9bfe80f6dd048c146c428aa40520f948"},{url:"math4/es5/input/asciimath.js",revision:"1937743af3c6d3ebc2813ea06cbf64cf"},{url:"math4/es5/input/tex.js",revision:"699c55bfd58543a167ac2377b7854c9c"},{url:"math4/es5/startup.js",revision:"89ab8999231997a2bf1e8729972ad276"},{url:"math4/es5/output/svg.js",revision:"517ba224cf88d8dd44c72fa492fcfa10"},{url:"math4/es5/fonts/mathjax-bbm-font-extension/svg.js",revision:"e0d34b8b0319e9e24e05185d7c6b3792"},{url:"math4/es5/fonts/mathjax-tex-font/svg.js",revision:"0a1b18e9e32f8870c8114a1735a64c42"},{url:"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js",revision:"afa2753bd8d3f58c6bc505f3804f4d96"},{url:"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js",revision:"f627b03dcf17ea1a9c0858980f9420f8"},{url:"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js",revision:"bd5e3b97cf0ee565f5288cfcbfea71f3"},{url:"resources/dia.txt",revision:"a4729b9a37dec1735a5b08b5c91771af"},{url:"resources/dia_am.txt",revision:"259a948c27b27a286a0bf2d76e3b9d8d"},{url:"resources/dia_ar.txt",revision:"56e2a17d0bc9a5aabfbd81bde6a366d9"},{url:"resources/dia_bg.txt",revision:"cc06a434b1e2bb224b06a1139adf5209"},{url:"resources/dia_bn.txt",revision:"16167545c0bb7f87221f69fc77c34b6c"},{url:"resources/dia_bs.txt",revision:"3b716d105871dd9cf25b5f73a80215cc"},{url:"resources/dia_ca.txt",revision:"34427ea1e52ea4608cdf4ab82fb1d0d3"},{url:"resources/dia_cs.txt",revision:"b155b354ace03ee78529ca081faccc98"},{url:"resources/dia_da.txt",revision:"2df28b4f0846caa39d9aea907d7b57c7"},{url:"resources/dia_de.txt",revision:"1904b0776af3be5b82159b826c3325cc"},{url:"resources/dia_el.txt",revision:"e4d12f6e9bc7e65a1a213949319937ea"},{url:"resources/dia_eo.txt",revision:"5f049d8603b0d8d983d1f77eadffcd82"},{url:"resources/dia_es.txt",revision:"81b54555792af4cfcab1231dd3b40d84"},{url:"resources/dia_et.txt",revision:"a60e315625676a7eb50a7cd83d049dda"},{url:"resources/dia_eu.txt",revision:"65befcd5722ec968390c6ed14549d98b"},{url:"resources/dia_fa.txt",revision:"3d2410c140948bc70f519e118a7cdaec"},{url:"resources/dia_fi.txt",revision:"e07efa83a635d381825a69d6f1331801"},{url:"resources/dia_fil.txt",revision:"e858695961fcd5a0f2f2f6d4a0397e02"},{url:"resources/dia_fr.txt",revision:"c358afd2c60b5abf4a0b670d19c452ef"},{url:"resources/dia_gl.txt",revision:"afbd61ed70166fa7293d7dd241065ea6"},{url:"resources/dia_gu.txt",revision:"0b7f0d63665fe0253e160aa4d75ef12c"},{url:"resources/dia_he.txt",revision:"dac7b75a977dabe6f74d4b52491d31be"},{url:"resources/dia_hi.txt",revision:"c7b7d695d7f18c29cf1e206df6225cfe"},{url:"resources/dia_hr.txt",revision:"db109e88eab935c112b800faaebc2af2"},{url:"resources/dia_hu.txt",revision:"f0c9b46856ce2151593e1a8335647e39"},{url:"resources/dia_id.txt",revision:"0bc77e258aa01eda99920f16842522b5"},{url:"resources/dia_it.txt",revision:"2e857aebd83e2378407aba045583417d"},{url:"resources/dia_ja.txt",revision:"2e5082f34188f2c9e974d2a4ba690172"},{url:"resources/dia_kn.txt",revision:"7d80dd8c5f97b3ca7a93918a5f7effa8"},{url:"resources/dia_ko.txt",revision:"82242262baa7ccc0104b13ecd4f571b8"},{url:"resources/dia_lt.txt",revision:"7c87793413f4f497505db44b076c733e"},{url:"resources/dia_lv.txt",revision:"3c8c5cd5a63c8bacce0a02994481bd65"},{url:"resources/dia_ml.txt",revision:"ab9bd05d5a46f3a015c7cc78e9f9ce06"},{url:"resources/dia_mr.txt",revision:"2b9f8a936f6405fb75fcb32ae45cf532"},{url:"resources/dia_ms.txt",revision:"79efb5bbd6783cda403d86715a99fb1f"},{url:"resources/dia_my.txt",revision:"0b83f270c50b612b0fc331c0e185ca18"},{url:"resources/dia_nl.txt",revision:"6dc36a1afc4ef55e4d3542b0068159eb"},{url:"resources/dia_no.txt",revision:"bd8851d66ed0d0ddd6a1a2737872fe6c"},{url:"resources/dia_pl.txt",revision:"337fcc17dc1ecfd33da52fa20ccb510d"},{url:"resources/dia_pt-br.txt",revision:"b46225c7aba6f036fa7cd07f2f1bd36a"},{url:"resources/dia_pt.txt",revision:"b7955cf38fcb6685c17a18f0871aad10"},{url:"resources/dia_ro.txt",revision:"e5166c4a3a92f93b695bf05f18d012e0"},{url:"resources/dia_ru.txt",revision:"c8e52ef80990393b236bc21330e00f47"},{url:"resources/dia_si.txt",revision:"a89e725f42df43032ae7d3d21fed5309"},{url:"resources/dia_sk.txt",revision:"cf1f190adc8c3ba422e2e0034ab544ae"},{url:"resources/dia_sl.txt",revision:"e855e026a5eed3c6f66a5625fb007250"},{url:"resources/dia_sr.txt",revision:"e689adb77e19f9c69e4d43f4718469b4"},{url:"resources/dia_sv.txt",revision:"3a4b84baaaafc800b7866ffb4ecaaec6"},{url:"resources/dia_sw.txt",revision:"824f2a2aecc773e6ecbb26b713307c87"},{url:"resources/dia_ta.txt",revision:"7ec22334bd9e4b348388bf78f70bdf10"},{url:"resources/dia_te.txt",revision:"c098647bf0c52373e6098f6f3dd5a6e1"},{url:"resources/dia_th.txt",revision:"18703430dbccc50af3e374c93dadefe8"},{url:"resources/dia_tr.txt",revision:"aa82b3302c7c4875f8b2810de2f04db9"},{url:"resources/dia_uk.txt",revision:"b0c32b3ac364827dbf531c42c7210201"},{url:"resources/dia_vi.txt",revision:"c9862c2e37a1891b91f0ff23662c8969"},{url:"resources/dia_zh-tw.txt",revision:"dd3df77fe1a64808fdabe86d4064a84f"},{url:"resources/dia_zh.txt",revision:"57228ad690560909ff5218a60115bc0b"},{url:"favicon.ico",revision:"b2bf17349e4b50ce4ba311f079f8bf7d"},{url:"images/manifest.json",revision:"421b4fae5b46499348d194e1f93558c3"},{url:"images/logo.png",revision:"e4e0d092abdb1e668b5ec41a7fe0713c"},{url:"images/drawlogo.svg",revision:"4bf4d14ebcf072d8bd4c5a1c89e88fc6"},{url:"images/drawlogo48.png",revision:"8b13428373aca67b895364d025f42417"},{url:"images/drawlogo-gray.svg",revision:"0aabacbc0873816e1e09e4736ae44c7d"},{url:"images/drawlogo-text-bottom.svg",revision:"f6c438823ab31f290940bd4feb8dd9c2"},{url:"images/logo-flat-small.png",revision:"4b178e59ff499d6dd1894fc498b59877"},{url:"images/apple-touch-icon.png",revision:"732c29e21332a926318a7005d21ec450"},{url:"images/icon-192-maskable.png",revision:"47e006d0ce4a35eb5beaa97f0c2bfed0"},{url:"images/icon-192.png",revision:"d022403d52435d76afec82c4e24a17ef"},{url:"images/icon-512-maskable.png",revision:"cf152feeb01fb21f3148a71a3540266e"},{url:"images/icon-512.png",revision:"a3a0df7e7a385244b74073f81ecc45de"},{url:"images/delete.png",revision:"5f2350f2fd20f1a229637aed32ed8f29"},{url:"images/droptarget.png",revision:"bbf7f563fb6784de1ce96f329519b043"},{url:"images/logo-flat.png",revision:"038070ab43aee6e54a791211859fc67b"},{url:"images/google-drive-logo.svg",revision:"5d9f2f5bbc7dcc252730a0072bb23059"},{url:"images/onedrive-logo.svg",revision:"3645b344ec0634c1290dd58d7dc87b97"},{url:"images/dropbox-logo.svg",revision:"e6be408c77cf9c82d41ac64fa854280a"},{url:"images/github-logo.svg",revision:"a1a999b69a275eac0cb918360ac05ae1"},{url:"images/gitlab-logo.svg",revision:"0faea8c818899e58533e153c44b10517"},{url:"images/trello-logo.svg",revision:"006fd0d7d70d7e95dc691674cb12e044"},{url:"images/osa_drive-harddisk.png",revision:"b954e1ae772087c5b4c6ae797e1f9649"},{url:"images/osa_database.png",revision:"c350d9d9b95f37b6cfe798b40ede5fb0"},{url:"images/google-drive-logo-white.svg",revision:"f329d8b1be7778515a85b93fc35d9f26"},{url:"images/dropbox-logo-white.svg",revision:"4ea8299ac3bc31a16f199ee3aec223bf"},{url:"images/onedrive-logo-white.svg",revision:"b3602fa0fc947009cff3f33a581cff4d"},{url:"images/github-logo-white.svg",revision:"537b1127b3ca0f95b45782d1304fb77a"},{url:"images/gitlab-logo-white.svg",revision:"5fede9ac2f394c716b8c23e3fddc3910"},{url:"images/trello-logo-white-orange.svg",revision:"e2a0a52ba3766682f138138d10a75eb5"},{url:"images/logo-confluence.png",revision:"ed1e55d44ae5eba8f999aba2c93e8331"},{url:"images/logo-jira.png",revision:"f8d460555a0d1f87cfd901e940666629"},{url:"images/spin.gif",revision:"487cbb40b9ced439aa1ad914e816d773"},{url:"images/aui-wait.gif",revision:"5a474bcbd8d2f2826f03d10ea44bf60e"},{url:"mxgraph/css/common.css",revision:"81d1704d5ab9207e2e5c7fc84379dc1a"}],{ignoreURLParametersMatching:[/.*/]})}));+if(!self.define){let e,i={};const s=(s,a)=>(s=new URL(s+".js",a).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(a,r)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(i[c])return;let o={};const n=e=>s(e,c),d={module:{uri:c},exports:o,require:n};i[c]=Promise.all(a.map((e=>d[e]||n(e)))).then((e=>(r(...e),o)))}}define(["./workbox-acfd85e3"],(function(e){"use strict";self.skipWaiting(),e.precacheAndRoute([{url:"js/bootstrap.js",revision:"f5b111b20ae08f69d46e5699e1f9a7c4"},{url:"js/main.js",revision:"a8d40469d3d72ab4b11059362f3dd825"},{url:"js/app.min.js",revision:"8ffd2058a5406c340a8ef9b78afe93a8"},{url:"js/extensions.min.js",revision:"9dbd8436c45fb61a4db5893540cbac0b"},{url:"js/orgchart.min.js",revision:"619d8c4dab47b81868916df31f55478b"},{url:"js/stencils.min.js",revision:"4c955b95c4308b0414578762513424d2"},{url:"js/shapes-14-6-5.min.js",revision:"6ce46f345044bdb3cde439bd81b37952"},{url:"js/math-print.js",revision:"ad9cf0f2f2b614eac58ea72499c1017f"},{url:"index.html",revision:"9de11c65ec13b24c73ace7042bc529cc"},{url:"open.html",revision:"d71816b3b00e769fc6019fcdd6921662"},{url:"shortcuts.svg",revision:"2381dd779ce6cfee954042a7f784c7e6"},{url:"styles/fonts/ArchitectsDaughter-Regular.ttf",revision:"31c2153c0530e32553b31a49b3d70736"},{url:"styles/grapheditor.css",revision:"ed4a663eb787c135a04e5f6c97bdaa47"},{url:"styles/high-contrast.css",revision:"4ecc9f6d08787a9e2d29dacf7aadd1ca"},{url:"js/dropbox/Dropbox-sdk.min.js",revision:"4b9842892aa37b156db0a8364b7a83b0"},{url:"js/onedrive/OneDrive.js",revision:"e863f5e6833892f22492211663e3efe9"},{url:"js/viewer-static.min.js",revision:"9ff8dcc57b8cae6faea421cfee3f3f49"},{url:"connect/jira/editor-1-3-3.html",revision:"41dc8af9576b47f359cff19fff7a41c2"},{url:"connect/jira/viewerPanel-1-3-12.html",revision:"4836f5e4308abe57830e441518364f23"},{url:"connect/jira/viewerPanel2.html",revision:"0dd1ee1343a46b5c03aedbc587450b84"},{url:"connect/jira/fullScreenViewer-1-3-3.html",revision:"abed474e47c0c41a5ad2366b4828f77a"},{url:"connect/jira/viewerPanel.js",revision:"85011efa68d638da560871ee2ab3a6fe"},{url:"connect/jira/spinner.gif",revision:"7d857ab9d86123e93d74d48e958fe743"},{url:"connect/jira/editor.js",revision:"3dc56c6566abaa7af151a8359e5bb556"},{url:"connect/jira/fullscreen-viewer-init.js",revision:"07043c1ee868dd425f7876da94bbc307"},{url:"connect/jira/fullscreen-viewer.js",revision:"a6be96b8ddc5a25196925713cf34d571"},{url:"plugins/connectJira.js",revision:"db54dba28f9f2510a00411a410c837a0"},{url:"plugins/cConf-comments.js",revision:"e4a4b5a0fb22393693d3b62968c50644"},{url:"plugins/cConf-1-4-8.js",revision:"f576f603a4a7755b37e1c4d332358ce1"},{url:"connect/confluence/connectUtils-1-4-8.js",revision:"ec3bc85db1e4451f87e63e23a0c36611"},{url:"connect/new_common/cac.js",revision:"443fb416a407b8a183d0c8f4ecf68808"},{url:"connect/gdrive_common/gac.js",revision:"ac3a28fa16c3e6a36af854fcfc018a81"},{url:"connect/onedrive_common/ac.js",revision:"37c626698573f4419ab9f7ecd7b4bb01"},{url:"connect/confluence/viewer-init.js",revision:"c5e51e32ac74414d8d518af83ee2781f"},{url:"connect/confluence/viewer.js",revision:"e6e7d871e09a377391e690f37da03445"},{url:"connect/confluence/viewer-1-4-42.html",revision:"69c1bca25fd4889bf832e8441c972268"},{url:"connect/confluence/macroEditor-1-4-8.html",revision:"4ad77ae3f08c19eddac932b2fa8c7068"},{url:"connect/confluence/includeDiagram-1-4-8.js",revision:"489bc44e46d6481277c3f2a5d81a2db6"},{url:"connect/confluence/includeDiagram.html",revision:"01b04b3f54f1e2e63fcf1df033d24519"},{url:"connect/confluence/macro-editor.js",revision:"b9000d6c20f30e4068f83bd0b56965ca"},{url:"math4/es5/ui/safe.js",revision:"540f14866ef7df930e923d164c211137"},{url:"math4/es5/core.js",revision:"366284f7ce6a80244ceaa3b8ee3e54e9"},{url:"math4/es5/input/tex/extensions/bbm.js",revision:"513ce4c980aacdcc90feec0713be74b1"},{url:"math4/es5/input/tex/extensions/html.js",revision:"51ffc0406fb08ecf28c53e72afe0a0ed"},{url:"math4/es5/input/tex/extensions/extpfeil.js",revision:"f272a36c89a652be5c65f28e353838b0"},{url:"math4/es5/input/tex/extensions/action.js",revision:"2a74c19cfefb234c2734e792c957c9a1"},{url:"math4/es5/input/tex/extensions/boldsymbol.js",revision:"f90dceccbe95e6404fde4f00eed2c8dd"},{url:"math4/es5/input/tex/extensions/cases.js",revision:"65cd3750c7490ac93cc68e52f74a1dab"},{url:"math4/es5/input/tex/extensions/colortbl.js",revision:"bfd4ec3e12e214119393fa61b0259f5d"},{url:"math4/es5/input/tex/extensions/verb.js",revision:"33057675c209f0b42365bcceb5288a44"},{url:"math4/es5/input/tex/extensions/unicode.js",revision:"92918f71eb0c857b36b138de9408eadc"},{url:"math4/es5/input/tex/extensions/cancel.js",revision:"3c69ed47f602c9052d603449f9d244ac"},{url:"math4/es5/input/tex/extensions/enclose.js",revision:"dceb251e090a0f9468eb668a2d2568d9"},{url:"math4/es5/input/tex/extensions/units.js",revision:"633ff0c3f4a982ee184fbca414d36425"},{url:"math4/es5/input/tex/extensions/color.js",revision:"2c905b4c025088fb367bfd66f7d67ba5"},{url:"math4/es5/input/tex/extensions/mathtools.js",revision:"7edddab4e756cd10637aeae4de404d75"},{url:"math4/es5/input/tex/extensions/begingroup.js",revision:"aa419405c6ad13e8b85137dcbd1c09dd"},{url:"math4/es5/input/tex/extensions/braket.js",revision:"598978a618d13df0329d00f242e7e7e9"},{url:"math4/es5/input/tex/extensions/dsfont.js",revision:"d4f5cb1231efc15a5a781366c0a6af6e"},{url:"math4/es5/input/tex/extensions/bbox.js",revision:"4036e6a76633738052eef578586f247a"},{url:"math4/es5/input/tex/extensions/amscd.js",revision:"c23bc24168bb563253bb1ef914e3ca32"},{url:"math4/es5/input/tex/extensions/textcomp.js",revision:"acdd5a6d8572b3693161533a5735671a"},{url:"math4/es5/input/tex/extensions/bussproofs.js",revision:"9e58e843a9ed1f94eee376e151d8eb58"},{url:"math4/es5/input/tex/extensions/bboldx.js",revision:"af20cca3c8cb6caa5e8544ab19d8679e"},{url:"math4/es5/input/tex/extensions/physics.js",revision:"82dfb1226c4797981024f28728cc5e1d"},{url:"math4/es5/input/tex/extensions/centernot.js",revision:"3e60d55d414becf276ae7874d935ba7e"},{url:"math4/es5/input/tex/extensions/gensymb.js",revision:"893f6dc84ea72d6e7cc2cca82d593aee"},{url:"math4/es5/input/tex/extensions/upgreek.js",revision:"8ec88557d9ffc45da864b9b2621439d7"},{url:"math4/es5/input/tex/extensions/empheq.js",revision:"0d474e9e342009b916cab0740be6ce1a"},{url:"math4/es5/input/tex/extensions/mhchem.js",revision:"9bfe80f6dd048c146c428aa40520f948"},{url:"math4/es5/input/asciimath.js",revision:"1937743af3c6d3ebc2813ea06cbf64cf"},{url:"math4/es5/input/tex.js",revision:"699c55bfd58543a167ac2377b7854c9c"},{url:"math4/es5/startup.js",revision:"89ab8999231997a2bf1e8729972ad276"},{url:"math4/es5/output/svg.js",revision:"517ba224cf88d8dd44c72fa492fcfa10"},{url:"math4/es5/fonts/mathjax-bbm-font-extension/svg.js",revision:"e0d34b8b0319e9e24e05185d7c6b3792"},{url:"math4/es5/fonts/mathjax-tex-font/svg.js",revision:"0a1b18e9e32f8870c8114a1735a64c42"},{url:"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js",revision:"afa2753bd8d3f58c6bc505f3804f4d96"},{url:"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js",revision:"f627b03dcf17ea1a9c0858980f9420f8"},{url:"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js",revision:"bd5e3b97cf0ee565f5288cfcbfea71f3"},{url:"resources/dia.txt",revision:"a4729b9a37dec1735a5b08b5c91771af"},{url:"resources/dia_am.txt",revision:"259a948c27b27a286a0bf2d76e3b9d8d"},{url:"resources/dia_ar.txt",revision:"56e2a17d0bc9a5aabfbd81bde6a366d9"},{url:"resources/dia_bg.txt",revision:"cc06a434b1e2bb224b06a1139adf5209"},{url:"resources/dia_bn.txt",revision:"16167545c0bb7f87221f69fc77c34b6c"},{url:"resources/dia_bs.txt",revision:"3b716d105871dd9cf25b5f73a80215cc"},{url:"resources/dia_ca.txt",revision:"34427ea1e52ea4608cdf4ab82fb1d0d3"},{url:"resources/dia_cs.txt",revision:"b155b354ace03ee78529ca081faccc98"},{url:"resources/dia_da.txt",revision:"2df28b4f0846caa39d9aea907d7b57c7"},{url:"resources/dia_de.txt",revision:"1904b0776af3be5b82159b826c3325cc"},{url:"resources/dia_el.txt",revision:"e4d12f6e9bc7e65a1a213949319937ea"},{url:"resources/dia_eo.txt",revision:"5f049d8603b0d8d983d1f77eadffcd82"},{url:"resources/dia_es.txt",revision:"81b54555792af4cfcab1231dd3b40d84"},{url:"resources/dia_et.txt",revision:"a60e315625676a7eb50a7cd83d049dda"},{url:"resources/dia_eu.txt",revision:"65befcd5722ec968390c6ed14549d98b"},{url:"resources/dia_fa.txt",revision:"3d2410c140948bc70f519e118a7cdaec"},{url:"resources/dia_fi.txt",revision:"e07efa83a635d381825a69d6f1331801"},{url:"resources/dia_fil.txt",revision:"e858695961fcd5a0f2f2f6d4a0397e02"},{url:"resources/dia_fr.txt",revision:"c358afd2c60b5abf4a0b670d19c452ef"},{url:"resources/dia_gl.txt",revision:"afbd61ed70166fa7293d7dd241065ea6"},{url:"resources/dia_gu.txt",revision:"0b7f0d63665fe0253e160aa4d75ef12c"},{url:"resources/dia_he.txt",revision:"dac7b75a977dabe6f74d4b52491d31be"},{url:"resources/dia_hi.txt",revision:"c7b7d695d7f18c29cf1e206df6225cfe"},{url:"resources/dia_hr.txt",revision:"db109e88eab935c112b800faaebc2af2"},{url:"resources/dia_hu.txt",revision:"f0c9b46856ce2151593e1a8335647e39"},{url:"resources/dia_id.txt",revision:"0bc77e258aa01eda99920f16842522b5"},{url:"resources/dia_it.txt",revision:"2e857aebd83e2378407aba045583417d"},{url:"resources/dia_ja.txt",revision:"2e5082f34188f2c9e974d2a4ba690172"},{url:"resources/dia_kn.txt",revision:"7d80dd8c5f97b3ca7a93918a5f7effa8"},{url:"resources/dia_ko.txt",revision:"82242262baa7ccc0104b13ecd4f571b8"},{url:"resources/dia_lt.txt",revision:"7c87793413f4f497505db44b076c733e"},{url:"resources/dia_lv.txt",revision:"3c8c5cd5a63c8bacce0a02994481bd65"},{url:"resources/dia_ml.txt",revision:"ab9bd05d5a46f3a015c7cc78e9f9ce06"},{url:"resources/dia_mr.txt",revision:"2b9f8a936f6405fb75fcb32ae45cf532"},{url:"resources/dia_ms.txt",revision:"79efb5bbd6783cda403d86715a99fb1f"},{url:"resources/dia_my.txt",revision:"0b83f270c50b612b0fc331c0e185ca18"},{url:"resources/dia_nl.txt",revision:"6dc36a1afc4ef55e4d3542b0068159eb"},{url:"resources/dia_no.txt",revision:"bd8851d66ed0d0ddd6a1a2737872fe6c"},{url:"resources/dia_pl.txt",revision:"337fcc17dc1ecfd33da52fa20ccb510d"},{url:"resources/dia_pt-br.txt",revision:"b46225c7aba6f036fa7cd07f2f1bd36a"},{url:"resources/dia_pt.txt",revision:"b7955cf38fcb6685c17a18f0871aad10"},{url:"resources/dia_ro.txt",revision:"e5166c4a3a92f93b695bf05f18d012e0"},{url:"resources/dia_ru.txt",revision:"c8e52ef80990393b236bc21330e00f47"},{url:"resources/dia_si.txt",revision:"a89e725f42df43032ae7d3d21fed5309"},{url:"resources/dia_sk.txt",revision:"cf1f190adc8c3ba422e2e0034ab544ae"},{url:"resources/dia_sl.txt",revision:"e855e026a5eed3c6f66a5625fb007250"},{url:"resources/dia_sr.txt",revision:"e689adb77e19f9c69e4d43f4718469b4"},{url:"resources/dia_sv.txt",revision:"3a4b84baaaafc800b7866ffb4ecaaec6"},{url:"resources/dia_sw.txt",revision:"824f2a2aecc773e6ecbb26b713307c87"},{url:"resources/dia_ta.txt",revision:"7ec22334bd9e4b348388bf78f70bdf10"},{url:"resources/dia_te.txt",revision:"c098647bf0c52373e6098f6f3dd5a6e1"},{url:"resources/dia_th.txt",revision:"18703430dbccc50af3e374c93dadefe8"},{url:"resources/dia_tr.txt",revision:"aa82b3302c7c4875f8b2810de2f04db9"},{url:"resources/dia_uk.txt",revision:"b0c32b3ac364827dbf531c42c7210201"},{url:"resources/dia_vi.txt",revision:"c9862c2e37a1891b91f0ff23662c8969"},{url:"resources/dia_zh-tw.txt",revision:"dd3df77fe1a64808fdabe86d4064a84f"},{url:"resources/dia_zh.txt",revision:"57228ad690560909ff5218a60115bc0b"},{url:"favicon.ico",revision:"b2bf17349e4b50ce4ba311f079f8bf7d"},{url:"images/manifest.json",revision:"421b4fae5b46499348d194e1f93558c3"},{url:"images/logo.png",revision:"e4e0d092abdb1e668b5ec41a7fe0713c"},{url:"images/drawlogo.svg",revision:"4bf4d14ebcf072d8bd4c5a1c89e88fc6"},{url:"images/drawlogo48.png",revision:"8b13428373aca67b895364d025f42417"},{url:"images/drawlogo-gray.svg",revision:"0aabacbc0873816e1e09e4736ae44c7d"},{url:"images/drawlogo-text-bottom.svg",revision:"f6c438823ab31f290940bd4feb8dd9c2"},{url:"images/logo-flat-small.png",revision:"4b178e59ff499d6dd1894fc498b59877"},{url:"images/apple-touch-icon.png",revision:"732c29e21332a926318a7005d21ec450"},{url:"images/icon-192-maskable.png",revision:"47e006d0ce4a35eb5beaa97f0c2bfed0"},{url:"images/icon-192.png",revision:"d022403d52435d76afec82c4e24a17ef"},{url:"images/icon-512-maskable.png",revision:"cf152feeb01fb21f3148a71a3540266e"},{url:"images/icon-512.png",revision:"a3a0df7e7a385244b74073f81ecc45de"},{url:"images/delete.png",revision:"5f2350f2fd20f1a229637aed32ed8f29"},{url:"images/droptarget.png",revision:"bbf7f563fb6784de1ce96f329519b043"},{url:"images/logo-flat.png",revision:"038070ab43aee6e54a791211859fc67b"},{url:"images/google-drive-logo.svg",revision:"5d9f2f5bbc7dcc252730a0072bb23059"},{url:"images/onedrive-logo.svg",revision:"3645b344ec0634c1290dd58d7dc87b97"},{url:"images/dropbox-logo.svg",revision:"e6be408c77cf9c82d41ac64fa854280a"},{url:"images/github-logo.svg",revision:"a1a999b69a275eac0cb918360ac05ae1"},{url:"images/gitlab-logo.svg",revision:"0faea8c818899e58533e153c44b10517"},{url:"images/trello-logo.svg",revision:"006fd0d7d70d7e95dc691674cb12e044"},{url:"images/osa_drive-harddisk.png",revision:"b954e1ae772087c5b4c6ae797e1f9649"},{url:"images/osa_database.png",revision:"c350d9d9b95f37b6cfe798b40ede5fb0"},{url:"images/google-drive-logo-white.svg",revision:"f329d8b1be7778515a85b93fc35d9f26"},{url:"images/dropbox-logo-white.svg",revision:"4ea8299ac3bc31a16f199ee3aec223bf"},{url:"images/onedrive-logo-white.svg",revision:"b3602fa0fc947009cff3f33a581cff4d"},{url:"images/github-logo-white.svg",revision:"537b1127b3ca0f95b45782d1304fb77a"},{url:"images/gitlab-logo-white.svg",revision:"5fede9ac2f394c716b8c23e3fddc3910"},{url:"images/trello-logo-white-orange.svg",revision:"e2a0a52ba3766682f138138d10a75eb5"},{url:"images/logo-confluence.png",revision:"ed1e55d44ae5eba8f999aba2c93e8331"},{url:"images/logo-jira.png",revision:"f8d460555a0d1f87cfd901e940666629"},{url:"images/spin.gif",revision:"487cbb40b9ced439aa1ad914e816d773"},{url:"images/aui-wait.gif",revision:"5a474bcbd8d2f2826f03d10ea44bf60e"},{url:"mxgraph/css/common.css",revision:"81d1704d5ab9207e2e5c7fc84379dc1a"}],{ignoreURLParametersMatching:[/.*/]})}));//# sourceMappingURL=service-worker.js.mapdiff --git a/src/main/webapp/service-worker.js.map b/src/main/webapp/service-worker.js.mapindex 63e724a66..ead28666f 100644--- a/src/main/webapp/service-worker.js.map+++ b/src/main/webapp/service-worker.js.map@@ -1 +1 @@-{"version":3,"file":"service-worker.js","sources":["../../../../../../private/var/folders/w3/8z182_j14fbd1p8pn7nc032h0000gn/T/74392b900aa14e3f14157905a7df7883/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/davidbenson/.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"js/bootstrap.js\",\n \"revision\": \"f5b111b20ae08f69d46e5699e1f9a7c4\"\n },\n {\n \"url\": \"js/main.js\",\n \"revision\": \"a8d40469d3d72ab4b11059362f3dd825\"\n },\n {\n \"url\": \"js/app.min.js\",\n \"revision\": \"37dd19bcd233f7076db1a183296035d3\"\n },\n {\n \"url\": \"js/extensions.min.js\",\n \"revision\": \"9dbd8436c45fb61a4db5893540cbac0b\"\n },\n {\n \"url\": \"js/orgchart.min.js\",\n \"revision\": \"619d8c4dab47b81868916df31f55478b\"\n },\n {\n \"url\": \"js/stencils.min.js\",\n \"revision\": \"4c955b95c4308b0414578762513424d2\"\n },\n {\n \"url\": \"js/shapes-14-6-5.min.js\",\n \"revision\": \"6ce46f345044bdb3cde439bd81b37952\"\n },\n {\n \"url\": \"js/math-print.js\",\n \"revision\": \"ad9cf0f2f2b614eac58ea72499c1017f\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"9de11c65ec13b24c73ace7042bc529cc\"\n },\n {\n \"url\": \"open.html\",\n \"revision\": \"d71816b3b00e769fc6019fcdd6921662\"\n },\n {\n \"url\": \"shortcuts.svg\",\n \"revision\": \"2381dd779ce6cfee954042a7f784c7e6\"\n },\n {\n \"url\": \"styles/fonts/ArchitectsDaughter-Regular.ttf\",\n \"revision\": \"31c2153c0530e32553b31a49b3d70736\"\n },\n {\n \"url\": \"styles/grapheditor.css\",\n \"revision\": \"ed4a663eb787c135a04e5f6c97bdaa47\"\n },\n {\n \"url\": \"styles/high-contrast.css\",\n \"revision\": \"4ecc9f6d08787a9e2d29dacf7aadd1ca\"\n },\n {\n \"url\": \"js/dropbox/Dropbox-sdk.min.js\",\n \"revision\": \"4b9842892aa37b156db0a8364b7a83b0\"\n },\n {\n \"url\": \"js/onedrive/OneDrive.js\",\n \"revision\": \"e863f5e6833892f22492211663e3efe9\"\n },\n {\n \"url\": \"js/viewer-static.min.js\",\n \"revision\": \"d449b8d8edd9775752aa9c6ab331ed65\"\n },\n {\n \"url\": \"connect/jira/editor-1-3-3.html\",\n \"revision\": \"41dc8af9576b47f359cff19fff7a41c2\"\n },\n {\n \"url\": \"connect/jira/viewerPanel-1-3-12.html\",\n \"revision\": \"4836f5e4308abe57830e441518364f23\"\n },\n {\n \"url\": \"connect/jira/viewerPanel2.html\",\n \"revision\": \"0dd1ee1343a46b5c03aedbc587450b84\"\n },\n {\n \"url\": \"connect/jira/fullScreenViewer-1-3-3.html\",\n \"revision\": \"abed474e47c0c41a5ad2366b4828f77a\"\n },\n {\n \"url\": \"connect/jira/viewerPanel.js\",\n \"revision\": \"85011efa68d638da560871ee2ab3a6fe\"\n },\n {\n \"url\": \"connect/jira/spinner.gif\",\n \"revision\": \"7d857ab9d86123e93d74d48e958fe743\"\n },\n {\n \"url\": \"connect/jira/editor.js\",\n \"revision\": \"3dc56c6566abaa7af151a8359e5bb556\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer-init.js\",\n \"revision\": \"07043c1ee868dd425f7876da94bbc307\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer.js\",\n \"revision\": \"a6be96b8ddc5a25196925713cf34d571\"\n },\n {\n \"url\": \"plugins/connectJira.js\",\n \"revision\": \"db54dba28f9f2510a00411a410c837a0\"\n },\n {\n \"url\": \"plugins/cConf-comments.js\",\n \"revision\": \"e4a4b5a0fb22393693d3b62968c50644\"\n },\n {\n \"url\": \"plugins/cConf-1-4-8.js\",\n \"revision\": \"f576f603a4a7755b37e1c4d332358ce1\"\n },\n {\n \"url\": \"connect/confluence/connectUtils-1-4-8.js\",\n \"revision\": \"ec3bc85db1e4451f87e63e23a0c36611\"\n },\n {\n \"url\": \"connect/new_common/cac.js\",\n \"revision\": \"443fb416a407b8a183d0c8f4ecf68808\"\n },\n {\n \"url\": \"connect/gdrive_common/gac.js\",\n \"revision\": \"ac3a28fa16c3e6a36af854fcfc018a81\"\n },\n {\n \"url\": \"connect/onedrive_common/ac.js\",\n \"revision\": \"37c626698573f4419ab9f7ecd7b4bb01\"\n },\n {\n \"url\": \"connect/confluence/viewer-init.js\",\n \"revision\": \"c5e51e32ac74414d8d518af83ee2781f\"\n },\n {\n \"url\": \"connect/confluence/viewer.js\",\n \"revision\": \"e6e7d871e09a377391e690f37da03445\"\n },\n {\n \"url\": \"connect/confluence/viewer-1-4-42.html\",\n \"revision\": \"69c1bca25fd4889bf832e8441c972268\"\n },\n {\n \"url\": \"connect/confluence/macroEditor-1-4-8.html\",\n \"revision\": \"4ad77ae3f08c19eddac932b2fa8c7068\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram-1-4-8.js\",\n \"revision\": \"489bc44e46d6481277c3f2a5d81a2db6\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram.html\",\n \"revision\": \"01b04b3f54f1e2e63fcf1df033d24519\"\n },\n {\n \"url\": \"connect/confluence/macro-editor.js\",\n \"revision\": \"b9000d6c20f30e4068f83bd0b56965ca\"\n },\n {\n \"url\": \"math4/es5/ui/safe.js\",\n \"revision\": \"540f14866ef7df930e923d164c211137\"\n },\n {\n \"url\": \"math4/es5/core.js\",\n \"revision\": \"366284f7ce6a80244ceaa3b8ee3e54e9\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bbm.js\",\n \"revision\": \"513ce4c980aacdcc90feec0713be74b1\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/html.js\",\n \"revision\": \"51ffc0406fb08ecf28c53e72afe0a0ed\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/extpfeil.js\",\n \"revision\": \"f272a36c89a652be5c65f28e353838b0\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/action.js\",\n \"revision\": \"2a74c19cfefb234c2734e792c957c9a1\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/boldsymbol.js\",\n \"revision\": \"f90dceccbe95e6404fde4f00eed2c8dd\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/cases.js\",\n \"revision\": \"65cd3750c7490ac93cc68e52f74a1dab\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/colortbl.js\",\n \"revision\": \"bfd4ec3e12e214119393fa61b0259f5d\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/verb.js\",\n \"revision\": \"33057675c209f0b42365bcceb5288a44\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/unicode.js\",\n \"revision\": \"92918f71eb0c857b36b138de9408eadc\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/cancel.js\",\n \"revision\": \"3c69ed47f602c9052d603449f9d244ac\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/enclose.js\",\n \"revision\": \"dceb251e090a0f9468eb668a2d2568d9\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/units.js\",\n \"revision\": \"633ff0c3f4a982ee184fbca414d36425\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/color.js\",\n \"revision\": \"2c905b4c025088fb367bfd66f7d67ba5\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/mathtools.js\",\n \"revision\": \"7edddab4e756cd10637aeae4de404d75\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/begingroup.js\",\n \"revision\": \"aa419405c6ad13e8b85137dcbd1c09dd\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/braket.js\",\n \"revision\": \"598978a618d13df0329d00f242e7e7e9\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/dsfont.js\",\n \"revision\": \"d4f5cb1231efc15a5a781366c0a6af6e\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bbox.js\",\n \"revision\": \"4036e6a76633738052eef578586f247a\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/amscd.js\",\n \"revision\": \"c23bc24168bb563253bb1ef914e3ca32\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/textcomp.js\",\n \"revision\": \"acdd5a6d8572b3693161533a5735671a\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bussproofs.js\",\n \"revision\": \"9e58e843a9ed1f94eee376e151d8eb58\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bboldx.js\",\n \"revision\": \"af20cca3c8cb6caa5e8544ab19d8679e\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/physics.js\",\n \"revision\": \"82dfb1226c4797981024f28728cc5e1d\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/centernot.js\",\n \"revision\": \"3e60d55d414becf276ae7874d935ba7e\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/gensymb.js\",\n \"revision\": \"893f6dc84ea72d6e7cc2cca82d593aee\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/upgreek.js\",\n \"revision\": \"8ec88557d9ffc45da864b9b2621439d7\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/empheq.js\",\n \"revision\": \"0d474e9e342009b916cab0740be6ce1a\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/mhchem.js\",\n \"revision\": \"9bfe80f6dd048c146c428aa40520f948\"\n },\n {\n \"url\": \"math4/es5/input/asciimath.js\",\n \"revision\": \"1937743af3c6d3ebc2813ea06cbf64cf\"\n },\n {\n \"url\": \"math4/es5/input/tex.js\",\n \"revision\": \"699c55bfd58543a167ac2377b7854c9c\"\n },\n {\n \"url\": \"math4/es5/startup.js\",\n \"revision\": \"89ab8999231997a2bf1e8729972ad276\"\n },\n {\n \"url\": \"math4/es5/output/svg.js\",\n \"revision\": \"517ba224cf88d8dd44c72fa492fcfa10\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-bbm-font-extension/svg.js\",\n \"revision\": \"e0d34b8b0319e9e24e05185d7c6b3792\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-tex-font/svg.js\",\n \"revision\": \"0a1b18e9e32f8870c8114a1735a64c42\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js\",\n \"revision\": \"afa2753bd8d3f58c6bc505f3804f4d96\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js\",\n \"revision\": \"f627b03dcf17ea1a9c0858980f9420f8\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js\",\n \"revision\": \"bd5e3b97cf0ee565f5288cfcbfea71f3\"\n },\n {\n \"url\": \"resources/dia.txt\",\n \"revision\": \"a4729b9a37dec1735a5b08b5c91771af\"\n },\n {\n \"url\": \"resources/dia_am.txt\",\n \"revision\": \"259a948c27b27a286a0bf2d76e3b9d8d\"\n },\n {\n \"url\": \"resources/dia_ar.txt\",\n \"revision\": \"56e2a17d0bc9a5aabfbd81bde6a366d9\"\n },\n {\n \"url\": \"resources/dia_bg.txt\",\n \"revision\": \"cc06a434b1e2bb224b06a1139adf5209\"\n },\n {\n \"url\": \"resources/dia_bn.txt\",\n \"revision\": \"16167545c0bb7f87221f69fc77c34b6c\"\n },\n {\n \"url\": \"resources/dia_bs.txt\",\n \"revision\": \"3b716d105871dd9cf25b5f73a80215cc\"\n },\n {\n \"url\": \"resources/dia_ca.txt\",\n \"revision\": \"34427ea1e52ea4608cdf4ab82fb1d0d3\"\n },\n {\n \"url\": \"resources/dia_cs.txt\",\n \"revision\": \"b155b354ace03ee78529ca081faccc98\"\n },\n {\n \"url\": \"resources/dia_da.txt\",\n \"revision\": \"2df28b4f0846caa39d9aea907d7b57c7\"\n },\n {\n \"url\": \"resources/dia_de.txt\",\n \"revision\": \"1904b0776af3be5b82159b826c3325cc\"\n },\n {\n \"url\": \"resources/dia_el.txt\",\n \"revision\": \"e4d12f6e9bc7e65a1a213949319937ea\"\n },\n {\n \"url\": \"resources/dia_eo.txt\",\n \"revision\": \"5f049d8603b0d8d983d1f77eadffcd82\"\n },\n {\n \"url\": \"resources/dia_es.txt\",\n \"revision\": \"81b54555792af4cfcab1231dd3b40d84\"\n },\n {\n \"url\": \"resources/dia_et.txt\",\n \"revision\": \"a60e315625676a7eb50a7cd83d049dda\"\n },\n {\n \"url\": \"resources/dia_eu.txt\",\n \"revision\": \"65befcd5722ec968390c6ed14549d98b\"\n },\n {\n \"url\": \"resources/dia_fa.txt\",\n \"revision\": \"3d2410c140948bc70f519e118a7cdaec\"\n },\n {\n \"url\": \"resources/dia_fi.txt\",\n \"revision\": \"e07efa83a635d381825a69d6f1331801\"\n },\n {\n \"url\": \"resources/dia_fil.txt\",\n \"revision\": \"e858695961fcd5a0f2f2f6d4a0397e02\"\n },\n {\n \"url\": \"resources/dia_fr.txt\",\n \"revision\": \"c358afd2c60b5abf4a0b670d19c452ef\"\n },\n {\n \"url\": \"resources/dia_gl.txt\",\n \"revision\": \"afbd61ed70166fa7293d7dd241065ea6\"\n },\n {\n \"url\": \"resources/dia_gu.txt\",\n \"revision\": \"0b7f0d63665fe0253e160aa4d75ef12c\"\n },\n {\n \"url\": \"resources/dia_he.txt\",\n \"revision\": \"dac7b75a977dabe6f74d4b52491d31be\"\n },\n {\n \"url\": \"resources/dia_hi.txt\",\n \"revision\": \"c7b7d695d7f18c29cf1e206df6225cfe\"\n },\n {\n \"url\": \"resources/dia_hr.txt\",\n \"revision\": \"db109e88eab935c112b800faaebc2af2\"\n },\n {\n \"url\": \"resources/dia_hu.txt\",\n \"revision\": \"f0c9b46856ce2151593e1a8335647e39\"\n },\n {\n \"url\": \"resources/dia_id.txt\",\n \"revision\": \"0bc77e258aa01eda99920f16842522b5\"\n },\n {\n \"url\": \"resources/dia_it.txt\",\n \"revision\": \"2e857aebd83e2378407aba045583417d\"\n },\n {\n \"url\": \"resources/dia_ja.txt\",\n \"revision\": \"2e5082f34188f2c9e974d2a4ba690172\"\n },\n {\n \"url\": \"resources/dia_kn.txt\",\n \"revision\": \"7d80dd8c5f97b3ca7a93918a5f7effa8\"\n },\n {\n \"url\": \"resources/dia_ko.txt\",\n \"revision\": \"82242262baa7ccc0104b13ecd4f571b8\"\n },\n {\n \"url\": \"resources/dia_lt.txt\",\n \"revision\": \"7c87793413f4f497505db44b076c733e\"\n },\n {\n \"url\": \"resources/dia_lv.txt\",\n \"revision\": \"3c8c5cd5a63c8bacce0a02994481bd65\"\n },\n {\n \"url\": \"resources/dia_ml.txt\",\n \"revision\": \"ab9bd05d5a46f3a015c7cc78e9f9ce06\"\n },\n {\n \"url\": \"resources/dia_mr.txt\",\n \"revision\": \"2b9f8a936f6405fb75fcb32ae45cf532\"\n },\n {\n \"url\": \"resources/dia_ms.txt\",\n \"revision\": \"79efb5bbd6783cda403d86715a99fb1f\"\n },\n {\n \"url\": \"resources/dia_my.txt\",\n \"revision\": \"0b83f270c50b612b0fc331c0e185ca18\"\n },\n {\n \"url\": \"resources/dia_nl.txt\",\n \"revision\": \"6dc36a1afc4ef55e4d3542b0068159eb\"\n },\n {\n \"url\": \"resources/dia_no.txt\",\n \"revision\": \"bd8851d66ed0d0ddd6a1a2737872fe6c\"\n },\n {\n \"url\": \"resources/dia_pl.txt\",\n \"revision\": \"337fcc17dc1ecfd33da52fa20ccb510d\"\n },\n {\n \"url\": \"resources/dia_pt-br.txt\",\n \"revision\": \"b46225c7aba6f036fa7cd07f2f1bd36a\"\n },\n {\n \"url\": \"resources/dia_pt.txt\",\n \"revision\": \"b7955cf38fcb6685c17a18f0871aad10\"\n },\n {\n \"url\": \"resources/dia_ro.txt\",\n \"revision\": \"e5166c4a3a92f93b695bf05f18d012e0\"\n },\n {\n \"url\": \"resources/dia_ru.txt\",\n \"revision\": \"c8e52ef80990393b236bc21330e00f47\"\n },\n {\n \"url\": \"resources/dia_si.txt\",\n \"revision\": \"a89e725f42df43032ae7d3d21fed5309\"\n },\n {\n \"url\": \"resources/dia_sk.txt\",\n \"revision\": \"cf1f190adc8c3ba422e2e0034ab544ae\"\n },\n {\n \"url\": \"resources/dia_sl.txt\",\n \"revision\": \"e855e026a5eed3c6f66a5625fb007250\"\n },\n {\n \"url\": \"resources/dia_sr.txt\",\n \"revision\": \"e689adb77e19f9c69e4d43f4718469b4\"\n },\n {\n \"url\": \"resources/dia_sv.txt\",\n \"revision\": \"3a4b84baaaafc800b7866ffb4ecaaec6\"\n },\n {\n \"url\": \"resources/dia_sw.txt\",\n \"revision\": \"824f2a2aecc773e6ecbb26b713307c87\"\n },\n {\n \"url\": \"resources/dia_ta.txt\",\n \"revision\": \"7ec22334bd9e4b348388bf78f70bdf10\"\n },\n {\n \"url\": \"resources/dia_te.txt\",\n \"revision\": \"c098647bf0c52373e6098f6f3dd5a6e1\"\n },\n {\n \"url\": \"resources/dia_th.txt\",\n \"revision\": \"18703430dbccc50af3e374c93dadefe8\"\n },\n {\n \"url\": \"resources/dia_tr.txt\",\n \"revision\": \"aa82b3302c7c4875f8b2810de2f04db9\"\n },\n {\n \"url\": \"resources/dia_uk.txt\",\n \"revision\": \"b0c32b3ac364827dbf531c42c7210201\"\n },\n {\n \"url\": \"resources/dia_vi.txt\",\n \"revision\": \"c9862c2e37a1891b91f0ff23662c8969\"\n },\n {\n \"url\": \"resources/dia_zh-tw.txt\",\n \"revision\": \"dd3df77fe1a64808fdabe86d4064a84f\"\n },\n {\n \"url\": \"resources/dia_zh.txt\",\n \"revision\": \"57228ad690560909ff5218a60115bc0b\"\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"b2bf17349e4b50ce4ba311f079f8bf7d\"\n },\n {\n \"url\": \"images/manifest.json\",\n \"revision\": \"421b4fae5b46499348d194e1f93558c3\"\n },\n {\n \"url\": \"images/logo.png\",\n \"revision\": \"e4e0d092abdb1e668b5ec41a7fe0713c\"\n },\n {\n \"url\": \"images/drawlogo.svg\",\n \"revision\": \"4bf4d14ebcf072d8bd4c5a1c89e88fc6\"\n },\n {\n \"url\": \"images/drawlogo48.png\",\n \"revision\": \"8b13428373aca67b895364d025f42417\"\n },\n {\n \"url\": \"images/drawlogo-gray.svg\",\n \"revision\": \"0aabacbc0873816e1e09e4736ae44c7d\"\n },\n {\n \"url\": \"images/drawlogo-text-bottom.svg\",\n \"revision\": \"f6c438823ab31f290940bd4feb8dd9c2\"\n },\n {\n \"url\": \"images/logo-flat-small.png\",\n \"revision\": \"4b178e59ff499d6dd1894fc498b59877\"\n },\n {\n \"url\": \"images/apple-touch-icon.png\",\n \"revision\": \"732c29e21332a926318a7005d21ec450\"\n },\n {\n \"url\": \"images/icon-192-maskable.png\",\n \"revision\": \"47e006d0ce4a35eb5beaa97f0c2bfed0\"\n },\n {\n \"url\": \"images/icon-192.png\",\n \"revision\": \"d022403d52435d76afec82c4e24a17ef\"\n },\n {\n \"url\": \"images/icon-512-maskable.png\",\n \"revision\": \"cf152feeb01fb21f3148a71a3540266e\"\n },\n {\n \"url\": \"images/icon-512.png\",\n \"revision\": \"a3a0df7e7a385244b74073f81ecc45de\"\n },\n {\n \"url\": \"images/delete.png\",\n \"revision\": \"5f2350f2fd20f1a229637aed32ed8f29\"\n },\n {\n \"url\": \"images/droptarget.png\",\n \"revision\": \"bbf7f563fb6784de1ce96f329519b043\"\n },\n {\n \"url\": \"images/logo-flat.png\",\n \"revision\": \"038070ab43aee6e54a791211859fc67b\"\n },\n {\n \"url\": \"images/google-drive-logo.svg\",\n \"revision\": \"5d9f2f5bbc7dcc252730a0072bb23059\"\n },\n {\n \"url\": \"images/onedrive-logo.svg\",\n \"revision\": \"3645b344ec0634c1290dd58d7dc87b97\"\n },\n {\n \"url\": \"images/dropbox-logo.svg\",\n \"revision\": \"e6be408c77cf9c82d41ac64fa854280a\"\n },\n {\n \"url\": \"images/github-logo.svg\",\n \"revision\": \"a1a999b69a275eac0cb918360ac05ae1\"\n },\n {\n \"url\": \"images/gitlab-logo.svg\",\n \"revision\": \"0faea8c818899e58533e153c44b10517\"\n },\n {\n \"url\": \"images/trello-logo.svg\",\n \"revision\": \"006fd0d7d70d7e95dc691674cb12e044\"\n },\n {\n \"url\": \"images/osa_drive-harddisk.png\",\n \"revision\": \"b954e1ae772087c5b4c6ae797e1f9649\"\n },\n {\n \"url\": \"images/osa_database.png\",\n \"revision\": \"c350d9d9b95f37b6cfe798b40ede5fb0\"\n },\n {\n \"url\": \"images/google-drive-logo-white.svg\",\n \"revision\": \"f329d8b1be7778515a85b93fc35d9f26\"\n },\n {\n \"url\": \"images/dropbox-logo-white.svg\",\n \"revision\": \"4ea8299ac3bc31a16f199ee3aec223bf\"\n },\n {\n \"url\": \"images/onedrive-logo-white.svg\",\n \"revision\": \"b3602fa0fc947009cff3f33a581cff4d\"\n },\n {\n \"url\": \"images/github-logo-white.svg\",\n \"revision\": \"537b1127b3ca0f95b45782d1304fb77a\"\n },\n {\n \"url\": \"images/gitlab-logo-white.svg\",\n \"revision\": \"5fede9ac2f394c716b8c23e3fddc3910\"\n },\n {\n \"url\": \"images/trello-logo-white-orange.svg\",\n \"revision\": \"e2a0a52ba3766682f138138d10a75eb5\"\n },\n {\n \"url\": \"images/logo-confluence.png\",\n \"revision\": \"ed1e55d44ae5eba8f999aba2c93e8331\"\n },\n {\n \"url\": \"images/logo-jira.png\",\n \"revision\": \"f8d460555a0d1f87cfd901e940666629\"\n },\n {\n \"url\": \"images/spin.gif\",\n \"revision\": \"487cbb40b9ced439aa1ad914e816d773\"\n },\n {\n \"url\": \"images/aui-wait.gif\",\n \"revision\": \"5a474bcbd8d2f2826f03d10ea44bf60e\"\n },\n {\n \"url\": \"mxgraph/css/common.css\",\n \"revision\": \"81d1704d5ab9207e2e5c7fc84379dc1a\"\n }\n], {\n \"ignoreURLParametersMatching\": [/.*/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,cAULC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC"}\ No newline at end of file+{"version":3,"file":"service-worker.js","sources":["../../../../../../private/var/folders/w3/8z182_j14fbd1p8pn7nc032h0000gn/T/e594453f28709df1b660cbe954a98c4d/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/davidbenson/.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"js/bootstrap.js\",\n \"revision\": \"f5b111b20ae08f69d46e5699e1f9a7c4\"\n },\n {\n \"url\": \"js/main.js\",\n \"revision\": \"a8d40469d3d72ab4b11059362f3dd825\"\n },\n {\n \"url\": \"js/app.min.js\",\n \"revision\": \"8ffd2058a5406c340a8ef9b78afe93a8\"\n },\n {\n \"url\": \"js/extensions.min.js\",\n \"revision\": \"9dbd8436c45fb61a4db5893540cbac0b\"\n },\n {\n \"url\": \"js/orgchart.min.js\",\n \"revision\": \"619d8c4dab47b81868916df31f55478b\"\n },\n {\n \"url\": \"js/stencils.min.js\",\n \"revision\": \"4c955b95c4308b0414578762513424d2\"\n },\n {\n \"url\": \"js/shapes-14-6-5.min.js\",\n \"revision\": \"6ce46f345044bdb3cde439bd81b37952\"\n },\n {\n \"url\": \"js/math-print.js\",\n \"revision\": \"ad9cf0f2f2b614eac58ea72499c1017f\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"9de11c65ec13b24c73ace7042bc529cc\"\n },\n {\n \"url\": \"open.html\",\n \"revision\": \"d71816b3b00e769fc6019fcdd6921662\"\n },\n {\n \"url\": \"shortcuts.svg\",\n \"revision\": \"2381dd779ce6cfee954042a7f784c7e6\"\n },\n {\n \"url\": \"styles/fonts/ArchitectsDaughter-Regular.ttf\",\n \"revision\": \"31c2153c0530e32553b31a49b3d70736\"\n },\n {\n \"url\": \"styles/grapheditor.css\",\n \"revision\": \"ed4a663eb787c135a04e5f6c97bdaa47\"\n },\n {\n \"url\": \"styles/high-contrast.css\",\n \"revision\": \"4ecc9f6d08787a9e2d29dacf7aadd1ca\"\n },\n {\n \"url\": \"js/dropbox/Dropbox-sdk.min.js\",\n \"revision\": \"4b9842892aa37b156db0a8364b7a83b0\"\n },\n {\n \"url\": \"js/onedrive/OneDrive.js\",\n \"revision\": \"e863f5e6833892f22492211663e3efe9\"\n },\n {\n \"url\": \"js/viewer-static.min.js\",\n \"revision\": \"9ff8dcc57b8cae6faea421cfee3f3f49\"\n },\n {\n \"url\": \"connect/jira/editor-1-3-3.html\",\n \"revision\": \"41dc8af9576b47f359cff19fff7a41c2\"\n },\n {\n \"url\": \"connect/jira/viewerPanel-1-3-12.html\",\n \"revision\": \"4836f5e4308abe57830e441518364f23\"\n },\n {\n \"url\": \"connect/jira/viewerPanel2.html\",\n \"revision\": \"0dd1ee1343a46b5c03aedbc587450b84\"\n },\n {\n \"url\": \"connect/jira/fullScreenViewer-1-3-3.html\",\n \"revision\": \"abed474e47c0c41a5ad2366b4828f77a\"\n },\n {\n \"url\": \"connect/jira/viewerPanel.js\",\n \"revision\": \"85011efa68d638da560871ee2ab3a6fe\"\n },\n {\n \"url\": \"connect/jira/spinner.gif\",\n \"revision\": \"7d857ab9d86123e93d74d48e958fe743\"\n },\n {\n \"url\": \"connect/jira/editor.js\",\n \"revision\": \"3dc56c6566abaa7af151a8359e5bb556\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer-init.js\",\n \"revision\": \"07043c1ee868dd425f7876da94bbc307\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer.js\",\n \"revision\": \"a6be96b8ddc5a25196925713cf34d571\"\n },\n {\n \"url\": \"plugins/connectJira.js\",\n \"revision\": \"db54dba28f9f2510a00411a410c837a0\"\n },\n {\n \"url\": \"plugins/cConf-comments.js\",\n \"revision\": \"e4a4b5a0fb22393693d3b62968c50644\"\n },\n {\n \"url\": \"plugins/cConf-1-4-8.js\",\n \"revision\": \"f576f603a4a7755b37e1c4d332358ce1\"\n },\n {\n \"url\": \"connect/confluence/connectUtils-1-4-8.js\",\n \"revision\": \"ec3bc85db1e4451f87e63e23a0c36611\"\n },\n {\n \"url\": \"connect/new_common/cac.js\",\n \"revision\": \"443fb416a407b8a183d0c8f4ecf68808\"\n },\n {\n \"url\": \"connect/gdrive_common/gac.js\",\n \"revision\": \"ac3a28fa16c3e6a36af854fcfc018a81\"\n },\n {\n \"url\": \"connect/onedrive_common/ac.js\",\n \"revision\": \"37c626698573f4419ab9f7ecd7b4bb01\"\n },\n {\n \"url\": \"connect/confluence/viewer-init.js\",\n \"revision\": \"c5e51e32ac74414d8d518af83ee2781f\"\n },\n {\n \"url\": \"connect/confluence/viewer.js\",\n \"revision\": \"e6e7d871e09a377391e690f37da03445\"\n },\n {\n \"url\": \"connect/confluence/viewer-1-4-42.html\",\n \"revision\": \"69c1bca25fd4889bf832e8441c972268\"\n },\n {\n \"url\": \"connect/confluence/macroEditor-1-4-8.html\",\n \"revision\": \"4ad77ae3f08c19eddac932b2fa8c7068\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram-1-4-8.js\",\n \"revision\": \"489bc44e46d6481277c3f2a5d81a2db6\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram.html\",\n \"revision\": \"01b04b3f54f1e2e63fcf1df033d24519\"\n },\n {\n \"url\": \"connect/confluence/macro-editor.js\",\n \"revision\": \"b9000d6c20f30e4068f83bd0b56965ca\"\n },\n {\n \"url\": \"math4/es5/ui/safe.js\",\n \"revision\": \"540f14866ef7df930e923d164c211137\"\n },\n {\n \"url\": \"math4/es5/core.js\",\n \"revision\": \"366284f7ce6a80244ceaa3b8ee3e54e9\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bbm.js\",\n \"revision\": \"513ce4c980aacdcc90feec0713be74b1\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/html.js\",\n \"revision\": \"51ffc0406fb08ecf28c53e72afe0a0ed\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/extpfeil.js\",\n \"revision\": \"f272a36c89a652be5c65f28e353838b0\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/action.js\",\n \"revision\": \"2a74c19cfefb234c2734e792c957c9a1\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/boldsymbol.js\",\n \"revision\": \"f90dceccbe95e6404fde4f00eed2c8dd\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/cases.js\",\n \"revision\": \"65cd3750c7490ac93cc68e52f74a1dab\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/colortbl.js\",\n \"revision\": \"bfd4ec3e12e214119393fa61b0259f5d\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/verb.js\",\n \"revision\": \"33057675c209f0b42365bcceb5288a44\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/unicode.js\",\n \"revision\": \"92918f71eb0c857b36b138de9408eadc\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/cancel.js\",\n \"revision\": \"3c69ed47f602c9052d603449f9d244ac\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/enclose.js\",\n \"revision\": \"dceb251e090a0f9468eb668a2d2568d9\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/units.js\",\n \"revision\": \"633ff0c3f4a982ee184fbca414d36425\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/color.js\",\n \"revision\": \"2c905b4c025088fb367bfd66f7d67ba5\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/mathtools.js\",\n \"revision\": \"7edddab4e756cd10637aeae4de404d75\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/begingroup.js\",\n \"revision\": \"aa419405c6ad13e8b85137dcbd1c09dd\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/braket.js\",\n \"revision\": \"598978a618d13df0329d00f242e7e7e9\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/dsfont.js\",\n \"revision\": \"d4f5cb1231efc15a5a781366c0a6af6e\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bbox.js\",\n \"revision\": \"4036e6a76633738052eef578586f247a\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/amscd.js\",\n \"revision\": \"c23bc24168bb563253bb1ef914e3ca32\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/textcomp.js\",\n \"revision\": \"acdd5a6d8572b3693161533a5735671a\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bussproofs.js\",\n \"revision\": \"9e58e843a9ed1f94eee376e151d8eb58\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/bboldx.js\",\n \"revision\": \"af20cca3c8cb6caa5e8544ab19d8679e\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/physics.js\",\n \"revision\": \"82dfb1226c4797981024f28728cc5e1d\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/centernot.js\",\n \"revision\": \"3e60d55d414becf276ae7874d935ba7e\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/gensymb.js\",\n \"revision\": \"893f6dc84ea72d6e7cc2cca82d593aee\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/upgreek.js\",\n \"revision\": \"8ec88557d9ffc45da864b9b2621439d7\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/empheq.js\",\n \"revision\": \"0d474e9e342009b916cab0740be6ce1a\"\n },\n {\n \"url\": \"math4/es5/input/tex/extensions/mhchem.js\",\n \"revision\": \"9bfe80f6dd048c146c428aa40520f948\"\n },\n {\n \"url\": \"math4/es5/input/asciimath.js\",\n \"revision\": \"1937743af3c6d3ebc2813ea06cbf64cf\"\n },\n {\n \"url\": \"math4/es5/input/tex.js\",\n \"revision\": \"699c55bfd58543a167ac2377b7854c9c\"\n },\n {\n \"url\": \"math4/es5/startup.js\",\n \"revision\": \"89ab8999231997a2bf1e8729972ad276\"\n },\n {\n \"url\": \"math4/es5/output/svg.js\",\n \"revision\": \"517ba224cf88d8dd44c72fa492fcfa10\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-bbm-font-extension/svg.js\",\n \"revision\": \"e0d34b8b0319e9e24e05185d7c6b3792\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-tex-font/svg.js\",\n \"revision\": \"0a1b18e9e32f8870c8114a1735a64c42\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-bboldx-font-extension/svg.js\",\n \"revision\": \"afa2753bd8d3f58c6bc505f3804f4d96\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-dsfont-font-extension/svg.js\",\n \"revision\": \"f627b03dcf17ea1a9c0858980f9420f8\"\n },\n {\n \"url\": \"math4/es5/fonts/mathjax-mhchem-font-extension/svg.js\",\n \"revision\": \"bd5e3b97cf0ee565f5288cfcbfea71f3\"\n },\n {\n \"url\": \"resources/dia.txt\",\n \"revision\": \"a4729b9a37dec1735a5b08b5c91771af\"\n },\n {\n \"url\": \"resources/dia_am.txt\",\n \"revision\": \"259a948c27b27a286a0bf2d76e3b9d8d\"\n },\n {\n \"url\": \"resources/dia_ar.txt\",\n \"revision\": \"56e2a17d0bc9a5aabfbd81bde6a366d9\"\n },\n {\n \"url\": \"resources/dia_bg.txt\",\n \"revision\": \"cc06a434b1e2bb224b06a1139adf5209\"\n },\n {\n \"url\": \"resources/dia_bn.txt\",\n \"revision\": \"16167545c0bb7f87221f69fc77c34b6c\"\n },\n {\n \"url\": \"resources/dia_bs.txt\",\n \"revision\": \"3b716d105871dd9cf25b5f73a80215cc\"\n },\n {\n \"url\": \"resources/dia_ca.txt\",\n \"revision\": \"34427ea1e52ea4608cdf4ab82fb1d0d3\"\n },\n {\n \"url\": \"resources/dia_cs.txt\",\n \"revision\": \"b155b354ace03ee78529ca081faccc98\"\n },\n {\n \"url\": \"resources/dia_da.txt\",\n \"revision\": \"2df28b4f0846caa39d9aea907d7b57c7\"\n },\n {\n \"url\": \"resources/dia_de.txt\",\n \"revision\": \"1904b0776af3be5b82159b826c3325cc\"\n },\n {\n \"url\": \"resources/dia_el.txt\",\n \"revision\": \"e4d12f6e9bc7e65a1a213949319937ea\"\n },\n {\n \"url\": \"resources/dia_eo.txt\",\n \"revision\": \"5f049d8603b0d8d983d1f77eadffcd82\"\n },\n {\n \"url\": \"resources/dia_es.txt\",\n \"revision\": \"81b54555792af4cfcab1231dd3b40d84\"\n },\n {\n \"url\": \"resources/dia_et.txt\",\n \"revision\": \"a60e315625676a7eb50a7cd83d049dda\"\n },\n {\n \"url\": \"resources/dia_eu.txt\",\n \"revision\": \"65befcd5722ec968390c6ed14549d98b\"\n },\n {\n \"url\": \"resources/dia_fa.txt\",\n \"revision\": \"3d2410c140948bc70f519e118a7cdaec\"\n },\n {\n \"url\": \"resources/dia_fi.txt\",\n \"revision\": \"e07efa83a635d381825a69d6f1331801\"\n },\n {\n \"url\": \"resources/dia_fil.txt\",\n \"revision\": \"e858695961fcd5a0f2f2f6d4a0397e02\"\n },\n {\n \"url\": \"resources/dia_fr.txt\",\n \"revision\": \"c358afd2c60b5abf4a0b670d19c452ef\"\n },\n {\n \"url\": \"resources/dia_gl.txt\",\n \"revision\": \"afbd61ed70166fa7293d7dd241065ea6\"\n },\n {\n \"url\": \"resources/dia_gu.txt\",\n \"revision\": \"0b7f0d63665fe0253e160aa4d75ef12c\"\n },\n {\n \"url\": \"resources/dia_he.txt\",\n \"revision\": \"dac7b75a977dabe6f74d4b52491d31be\"\n },\n {\n \"url\": \"resources/dia_hi.txt\",\n \"revision\": \"c7b7d695d7f18c29cf1e206df6225cfe\"\n },\n {\n \"url\": \"resources/dia_hr.txt\",\n \"revision\": \"db109e88eab935c112b800faaebc2af2\"\n },\n {\n \"url\": \"resources/dia_hu.txt\",\n \"revision\": \"f0c9b46856ce2151593e1a8335647e39\"\n },\n {\n \"url\": \"resources/dia_id.txt\",\n \"revision\": \"0bc77e258aa01eda99920f16842522b5\"\n },\n {\n \"url\": \"resources/dia_it.txt\",\n \"revision\": \"2e857aebd83e2378407aba045583417d\"\n },\n {\n \"url\": \"resources/dia_ja.txt\",\n \"revision\": \"2e5082f34188f2c9e974d2a4ba690172\"\n },\n {\n \"url\": \"resources/dia_kn.txt\",\n \"revision\": \"7d80dd8c5f97b3ca7a93918a5f7effa8\"\n },\n {\n \"url\": \"resources/dia_ko.txt\",\n \"revision\": \"82242262baa7ccc0104b13ecd4f571b8\"\n },\n {\n \"url\": \"resources/dia_lt.txt\",\n \"revision\": \"7c87793413f4f497505db44b076c733e\"\n },\n {\n \"url\": \"resources/dia_lv.txt\",\n \"revision\": \"3c8c5cd5a63c8bacce0a02994481bd65\"\n },\n {\n \"url\": \"resources/dia_ml.txt\",\n \"revision\": \"ab9bd05d5a46f3a015c7cc78e9f9ce06\"\n },\n {\n \"url\": \"resources/dia_mr.txt\",\n \"revision\": \"2b9f8a936f6405fb75fcb32ae45cf532\"\n },\n {\n \"url\": \"resources/dia_ms.txt\",\n \"revision\": \"79efb5bbd6783cda403d86715a99fb1f\"\n },\n {\n \"url\": \"resources/dia_my.txt\",\n \"revision\": \"0b83f270c50b612b0fc331c0e185ca18\"\n },\n {\n \"url\": \"resources/dia_nl.txt\",\n \"revision\": \"6dc36a1afc4ef55e4d3542b0068159eb\"\n },\n {\n \"url\": \"resources/dia_no.txt\",\n \"revision\": \"bd8851d66ed0d0ddd6a1a2737872fe6c\"\n },\n {\n \"url\": \"resources/dia_pl.txt\",\n \"revision\": \"337fcc17dc1ecfd33da52fa20ccb510d\"\n },\n {\n \"url\": \"resources/dia_pt-br.txt\",\n \"revision\": \"b46225c7aba6f036fa7cd07f2f1bd36a\"\n },\n {\n \"url\": \"resources/dia_pt.txt\",\n \"revision\": \"b7955cf38fcb6685c17a18f0871aad10\"\n },\n {\n \"url\": \"resources/dia_ro.txt\",\n \"revision\": \"e5166c4a3a92f93b695bf05f18d012e0\"\n },\n {\n \"url\": \"resources/dia_ru.txt\",\n \"revision\": \"c8e52ef80990393b236bc21330e00f47\"\n },\n {\n \"url\": \"resources/dia_si.txt\",\n \"revision\": \"a89e725f42df43032ae7d3d21fed5309\"\n },\n {\n \"url\": \"resources/dia_sk.txt\",\n \"revision\": \"cf1f190adc8c3ba422e2e0034ab544ae\"\n },\n {\n \"url\": \"resources/dia_sl.txt\",\n \"revision\": \"e855e026a5eed3c6f66a5625fb007250\"\n },\n {\n \"url\": \"resources/dia_sr.txt\",\n \"revision\": \"e689adb77e19f9c69e4d43f4718469b4\"\n },\n {\n \"url\": \"resources/dia_sv.txt\",\n \"revision\": \"3a4b84baaaafc800b7866ffb4ecaaec6\"\n },\n {\n \"url\": \"resources/dia_sw.txt\",\n \"revision\": \"824f2a2aecc773e6ecbb26b713307c87\"\n },\n {\n \"url\": \"resources/dia_ta.txt\",\n \"revision\": \"7ec22334bd9e4b348388bf78f70bdf10\"\n },\n {\n \"url\": \"resources/dia_te.txt\",\n \"revision\": \"c098647bf0c52373e6098f6f3dd5a6e1\"\n },\n {\n \"url\": \"resources/dia_th.txt\",\n \"revision\": \"18703430dbccc50af3e374c93dadefe8\"\n },\n {\n \"url\": \"resources/dia_tr.txt\",\n \"revision\": \"aa82b3302c7c4875f8b2810de2f04db9\"\n },\n {\n \"url\": \"resources/dia_uk.txt\",\n \"revision\": \"b0c32b3ac364827dbf531c42c7210201\"\n },\n {\n \"url\": \"resources/dia_vi.txt\",\n \"revision\": \"c9862c2e37a1891b91f0ff23662c8969\"\n },\n {\n \"url\": \"resources/dia_zh-tw.txt\",\n \"revision\": \"dd3df77fe1a64808fdabe86d4064a84f\"\n },\n {\n \"url\": \"resources/dia_zh.txt\",\n \"revision\": \"57228ad690560909ff5218a60115bc0b\"\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"b2bf17349e4b50ce4ba311f079f8bf7d\"\n },\n {\n \"url\": \"images/manifest.json\",\n \"revision\": \"421b4fae5b46499348d194e1f93558c3\"\n },\n {\n \"url\": \"images/logo.png\",\n \"revision\": \"e4e0d092abdb1e668b5ec41a7fe0713c\"\n },\n {\n \"url\": \"images/drawlogo.svg\",\n \"revision\": \"4bf4d14ebcf072d8bd4c5a1c89e88fc6\"\n },\n {\n \"url\": \"images/drawlogo48.png\",\n \"revision\": \"8b13428373aca67b895364d025f42417\"\n },\n {\n \"url\": \"images/drawlogo-gray.svg\",\n \"revision\": \"0aabacbc0873816e1e09e4736ae44c7d\"\n },\n {\n \"url\": \"images/drawlogo-text-bottom.svg\",\n \"revision\": \"f6c438823ab31f290940bd4feb8dd9c2\"\n },\n {\n \"url\": \"images/logo-flat-small.png\",\n \"revision\": \"4b178e59ff499d6dd1894fc498b59877\"\n },\n {\n \"url\": \"images/apple-touch-icon.png\",\n \"revision\": \"732c29e21332a926318a7005d21ec450\"\n },\n {\n \"url\": \"images/icon-192-maskable.png\",\n \"revision\": \"47e006d0ce4a35eb5beaa97f0c2bfed0\"\n },\n {\n \"url\": \"images/icon-192.png\",\n \"revision\": \"d022403d52435d76afec82c4e24a17ef\"\n },\n {\n \"url\": \"images/icon-512-maskable.png\",\n \"revision\": \"cf152feeb01fb21f3148a71a3540266e\"\n },\n {\n \"url\": \"images/icon-512.png\",\n \"revision\": \"a3a0df7e7a385244b74073f81ecc45de\"\n },\n {\n \"url\": \"images/delete.png\",\n \"revision\": \"5f2350f2fd20f1a229637aed32ed8f29\"\n },\n {\n \"url\": \"images/droptarget.png\",\n \"revision\": \"bbf7f563fb6784de1ce96f329519b043\"\n },\n {\n \"url\": \"images/logo-flat.png\",\n \"revision\": \"038070ab43aee6e54a791211859fc67b\"\n },\n {\n \"url\": \"images/google-drive-logo.svg\",\n \"revision\": \"5d9f2f5bbc7dcc252730a0072bb23059\"\n },\n {\n \"url\": \"images/onedrive-logo.svg\",\n \"revision\": \"3645b344ec0634c1290dd58d7dc87b97\"\n },\n {\n \"url\": \"images/dropbox-logo.svg\",\n \"revision\": \"e6be408c77cf9c82d41ac64fa854280a\"\n },\n {\n \"url\": \"images/github-logo.svg\",\n \"revision\": \"a1a999b69a275eac0cb918360ac05ae1\"\n },\n {\n \"url\": \"images/gitlab-logo.svg\",\n \"revision\": \"0faea8c818899e58533e153c44b10517\"\n },\n {\n \"url\": \"images/trello-logo.svg\",\n \"revision\": \"006fd0d7d70d7e95dc691674cb12e044\"\n },\n {\n \"url\": \"images/osa_drive-harddisk.png\",\n \"revision\": \"b954e1ae772087c5b4c6ae797e1f9649\"\n },\n {\n \"url\": \"images/osa_database.png\",\n \"revision\": \"c350d9d9b95f37b6cfe798b40ede5fb0\"\n },\n {\n \"url\": \"images/google-drive-logo-white.svg\",\n \"revision\": \"f329d8b1be7778515a85b93fc35d9f26\"\n },\n {\n \"url\": \"images/dropbox-logo-white.svg\",\n \"revision\": \"4ea8299ac3bc31a16f199ee3aec223bf\"\n },\n {\n \"url\": \"images/onedrive-logo-white.svg\",\n \"revision\": \"b3602fa0fc947009cff3f33a581cff4d\"\n },\n {\n \"url\": \"images/github-logo-white.svg\",\n \"revision\": \"537b1127b3ca0f95b45782d1304fb77a\"\n },\n {\n \"url\": \"images/gitlab-logo-white.svg\",\n \"revision\": \"5fede9ac2f394c716b8c23e3fddc3910\"\n },\n {\n \"url\": \"images/trello-logo-white-orange.svg\",\n \"revision\": \"e2a0a52ba3766682f138138d10a75eb5\"\n },\n {\n \"url\": \"images/logo-confluence.png\",\n \"revision\": \"ed1e55d44ae5eba8f999aba2c93e8331\"\n },\n {\n \"url\": \"images/logo-jira.png\",\n \"revision\": \"f8d460555a0d1f87cfd901e940666629\"\n },\n {\n \"url\": \"images/spin.gif\",\n \"revision\": \"487cbb40b9ced439aa1ad914e816d773\"\n },\n {\n \"url\": \"images/aui-wait.gif\",\n \"revision\": \"5a474bcbd8d2f2826f03d10ea44bf60e\"\n },\n {\n \"url\": \"mxgraph/css/common.css\",\n \"revision\": \"81d1704d5ab9207e2e5c7fc84379dc1a\"\n }\n], {\n \"ignoreURLParametersMatching\": [/.*/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,cAULC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,+CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC"}\ No newline at end of file