From ba79760406f58ef0fff32cd20696feb22810e7ab Mon Sep 17 00:00:00 2001 From: Gaudenz Alder <gaudenz@jgraph.com> Date: Tue, 26 Jun 2018 16:41:55 +0200 Subject: [PATCH] 8.8.7 release Former-commit-id: 9c86bba29e9ad61a6faa373776360acf86b5872c --- ChangeLog | 8 + Dockerfile | 13 - README.md | 10 - VERSION | 2 +- src/main/webapp/cache.manifest | 2 +- src/main/webapp/js/app.min.js | 517 ++++---- src/main/webapp/js/atlas-viewer.min.js | 1041 +++++++++-------- src/main/webapp/js/atlas.min.js | 497 ++++---- src/main/webapp/js/diagramly/App.js | 29 +- src/main/webapp/js/diagramly/Dialogs.js | 13 +- src/main/webapp/js/diagramly/Editor.js | 18 +- src/main/webapp/js/diagramly/EditorUi.js | 40 +- src/main/webapp/js/diagramly/Init.js | 1 - src/main/webapp/js/diagramly/Menus.js | 4 +- src/main/webapp/js/diagramly/Minimal.js | 4 +- .../js/diagramly/sidebar/Sidebar-WebIcons.js | 2 +- src/main/webapp/js/embed-static.min.js | 2 +- src/main/webapp/js/mxgraph/EditorUi.js | 16 +- src/main/webapp/js/reader.min.js | 2 +- src/main/webapp/js/viewer.min.js | 1041 +++++++++-------- src/main/webapp/plugins/text.js | 5 +- src/main/webapp/plugins/webcola/cola.min.js | 4 + .../plugins/webcola/mxWebColaAdaptor.js | 763 ++++++++++++ .../webapp/plugins/webcola/mxWebColaLayout.js | 303 +++++ src/main/webapp/plugins/webcola/webcola.js | 31 + 25 files changed, 2738 insertions(+), 1630 deletions(-) delete mode 100644 Dockerfile create mode 100644 src/main/webapp/plugins/webcola/cola.min.js create mode 100644 src/main/webapp/plugins/webcola/mxWebColaAdaptor.js create mode 100644 src/main/webapp/plugins/webcola/mxWebColaLayout.js create mode 100644 src/main/webapp/plugins/webcola/webcola.js diff --git a/ChangeLog b/ChangeLog index ca0fd1086..f9ea33c45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +26-JUN-2018: 8.8.7 + +- Fixes custom content view in Confluence Cloud +- Disables click sidebar collapse +- Uses inline window for text plugin +- Adds showStartScreen in Chrome App +- Disables plantUML when offline + 21-JUN-2018: 8.8.6 - Improves detection of gliffy macro in conf cloud diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3e9442cf2..000000000 --- a/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM frekele/ant:1.10.3-jdk8 as BUILD -RUN mkdir /usr/build -COPY src /usr/build/src -COPY etc /usr/build/etc -COPY war /usr/build/war -COPY VERSION /usr/build -RUN cd /usr/build/etc/build/ -RUN ant -file /usr/build/etc/build/build.xml war - -FROM tomcat:9.0 as TARGET -COPY --from=BUILD /usr/build/build/draw.war /usr/local/tomcat/webapps/ -EXPOSE 8080 -CMD ["catalina.sh", "run"] \ No newline at end of file diff --git a/README.md b/README.md index c716e6fd0..bebadf742 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,6 @@ A development guide is being started on the GitHub project wiki. There is a [dra The [mxGraph documentation](https://jgraph.github.io/mxgraph/) provides a lot of the docs for the bottom part of the stack. There is an [mxgraph tag on SO](http://stackoverflow.com/questions/tagged/mxgraph). - -Docker ------- -After successful build, from the project directory run -```bash -docker build -t draw . -docker run -d -p 8888:8080 draw -``` -Now the app will be accessible at http://localhost:8888/draw/?https=0 - Running ------- The simplest way to run draw.io initially is to fork this project, [publish the master branch to GitHub pages](https://help.github.com/categories/github-pages-basics/) and the [pages sites](https://jgraph.github.io/drawio/src/main/webapp/index.html) will have the full editor functionality (sans the integrations). diff --git a/VERSION b/VERSION index 9c832b104..ec562ebfd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.8.6 \ No newline at end of file +8.8.7 \ No newline at end of file diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest index eb30b1d9e..da207a349 100644 --- a/src/main/webapp/cache.manifest +++ b/src/main/webapp/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 06/21/2018 06:20 PM +# 06/26/2018 04:33 PM app.html index.html?offline=1 diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index 0294b35d9..518e5ca20 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -103,7 +103,7 @@ window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Ba ko:"í•œêµì–´",ja:"日本語",zh:"ä¸æ–‡ï¼ˆä¸å›½ï¼‰","zh-tw":"ä¸æ–‡ï¼ˆå°ç£ï¼‰"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} (function(){if("undefined"!==typeof JSON&&isLocalStorage)try{var a=localStorage.getItem(".drawio-config"),b=!0;null!=a&&(b=JSON.parse(a).showStartScreen);0==b&&(urlParams.splash="0")}catch(c){}a=urlParams["export"];null!=a&&("http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";b=window.location.host;"test.draw.io"!=b&&(a=b.length-7,b=b.lastIndexOf("draw.io",a),-1!==b&&b===a&&(window.DRAWIO_LOG_URL="https://log.draw.io"))})(); -if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.analytics="0",urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");window.urlParams=window.urlParams||{};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"; +if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");window.urlParams=window.urlParams||{};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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"3.9.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT: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:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.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/")&& @@ -2067,8 +2067,8 @@ this.getCssClassForMarker("end",b.currentEdgeStyle.shape,b.currentEdgeStyle[mxCo this.toolbar.setFontSize(c)}),b.getSelectionModel().addListener(mxEvent.CHANGE,a),b.getModel().addListener(mxEvent.CHANGE,a));b.addListener(mxEvent.CELLS_ADDED,function(a,c){var d=c.getProperty("cells"),e=c.getProperty("parent");b.getModel().isLayer(e)&&!b.isCellVisible(e)&&null!=d&&0<d.length&&b.getModel().setVisible(e,!0)});this.gestureHandler=mxUtils.bind(this,function(a){null!=this.currentMenu&&mxEvent.getSource(a)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document, this.gestureHandler);this.resizeHandler=mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window, "scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){b.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){b.view.validateBackground()}));b.addListener("gridSizeChanged",mxUtils.bind(this,function(){b.isGridEnabled()&&b.view.validateBackground()}));this.editor.resetGraph();this.init();this.open()}; -mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=34;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.editButtonLink=null;EditorUi.prototype.hsplitPosition=640>=screen.width?118:208;EditorUi.prototype.allowAnimation=!0; -EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4; +mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=34;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.hsplitPosition=640>=screen.width?118:208;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2; +EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1; EditorUi.prototype.init=function(){var a=this.editor.graph;mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(a){this.onKeyDown(a)}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(a){this.onKeyPress(a)}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})); var c=a.setDefaultParent,d=this;this.editor.graph.setDefaultParent=function(){c.apply(this,arguments);d.updateActionStates()};a.editLink=d.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()};EditorUi.prototype.onKeyDown=function(a){var c=this.editor.graph;9==a.which&&c.isEnabled()&&!mxEvent.isAltDown(a)&&(c.isEditing()?c.stopEditing(!1):c.selectCell(!mxEvent.isShiftDown(a)),mxEvent.consume(a))}; EditorUi.prototype.onKeyPress=function(a){var c=this.editor.graph;!this.isImmediateEditingEvent(a)||c.isEditing()||c.isSelectionEmpty()||0===a.which||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(c.escape(),c.startEditing(),mxClient.IS_FF&&(c=c.cellEditor,c.textarea.innerHTML=String.fromCharCode(a.which),a=document.createRange(),a.selectNodeContents(c.textarea),a.collapse(!1),c=window.getSelection(),c.removeAllRanges(),c.addRange(a)))}; @@ -2150,7 +2150,8 @@ this.container.appendChild(this.sidebarFooterContainer);this.container.appendChi !0,0,mxUtils.bind(this,function(a){this.hsplitPosition=a;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";420>screen.width&&(a.style.maxWidth=Math.max(20,screen.width-320)+"px",a.style.overflow="hidden");return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a};EditorUi.prototype.createToolbar=function(a){return new Toolbar(this,a)}; EditorUi.prototype.createSidebar=function(a){return new Sidebar(this,a)};EditorUi.prototype.createFormat=function(a){return new Format(this,a)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(a){var c=document.createElement("div");c.className=a;return c}; EditorUi.prototype.addSplitHandler=function(a,c,d,b){function f(a){if(null!=h){var e=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));b(Math.max(0,g+(c?e.x-h.x:h.y-e.y)-d));mxEvent.consume(a);g!=m()&&(k=!0,l=null)}}function e(a){f(a);h=g=null}var h=null,g=null,k=!0,l=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var m=mxUtils.bind(this,function(){var b=parseInt(c?a.style.left:a.style.bottom);c||(b=b+d-this.footerHeight);return b});mxEvent.addGestureListeners(a,function(a){h=new mxPoint(mxEvent.getClientX(a), -mxEvent.getClientY(a));g=m();k=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",function(a){if(!k){var c=null!=l?l-d:0;l=m();b(c);mxEvent.consume(a)}});mxEvent.addGestureListeners(document,null,f,e);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,f,e)})};EditorUi.prototype.showDialog=function(a,c,d,b,f,e,h){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,c,d,b,f,e,h);this.dialogs.push(this.dialog)}; +mxEvent.getClientY(a));g=m();k=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){if(!k&&this.hsplitClickEnabled){var c=null!=l?l-d:0;l=m();b(c);mxEvent.consume(a)}}));mxEvent.addGestureListeners(document,null,f,e);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,f,e)})}; +EditorUi.prototype.showDialog=function(a,c,d,b,f,e,h){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,c,d,b,f,e,h);this.dialogs.push(this.dialog)}; EditorUi.prototype.hideDialog=function(a){null!=this.dialogs&&0<this.dialogs.length&&(this.dialogs.pop().close(a),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&this.editor.graph.container.focus(),mxUtils.clearSelection(),this.editor.fireEvent(new mxEventObject("hideDialog")))}; EditorUi.prototype.pickColor=function(a,c){var d=this.editor.graph,b=d.cellEditor.saveSelection(),f=new ColorDialog(this,a||"none",function(a){d.cellEditor.restoreSelection(b);c(a)},function(){d.cellEditor.restoreSelection(b)});this.showDialog(f.container,230,430,!0,!1);f.init()}; EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})}; @@ -6822,7 +6823,7 @@ null,null,this.getTagsForStencil("mxgraph.weblogos","blogger","web logos logo"). 66,65,"","Crowd",null,null,this.getTagsForStencil("mxgraph.weblogos","crowd logo","web logos logo").join(" ")),this.createVertexTemplateEntry("image;image=img/lib/atlassian/Crucible_Logo.svg;",61,61,"","Crucible",null,null,this.getTagsForStencil("mxgraph.weblogos","crucible logo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dealsplus;fillColor=#935492",76,.2*333,"","Dealsplus",null,null,this.getTagsForStencil("mxgraph.weblogos","dealsplus","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ "designfloat;strokeColor=none",72,72,"","Designfloat",null,null,this.getTagsForStencil("mxgraph.weblogos","designfloat","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"deviantart;fillColor=#009544;strokeColor=none;",62,86.4,"","Deviantart",null,null,this.getTagsForStencil("mxgraph.weblogos","deviantart","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"digg;fillColor=#ffffff",58,56,"","Digg",null,null,this.getTagsForStencil("mxgraph.weblogos","digg","web logos logo").join(" ")), this.createVertexTemplateEntry(a+"diigo;fillColor=#2973D2;strokeColor=none",61.2,68.8,"","Diigo",null,null,this.getTagsForStencil("mxgraph.weblogos","diiigo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dopplr;fillColor=#F9634D;strokeColor=none",102.4,102.4,"","Dopplr",null,null,this.getTagsForStencil("mxgraph.weblogos","dopplr","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"drawio2;fillColor=#1A5BA3",52.2,70.8,"","Draw.io",null,null,this.getTagsForStencil("mxgraph.weblogos", -"drawio draw io draw.io","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"drawio3;fillColor=#1A5BA3;fontSize=15;fontColor=#1A5BA3;fontStyle=1",52.2,52.2,'draw<font color="#f08707">.io</font>',"Draw.io",null,null,this.getTagsForStencil("mxgraph.weblogos","drawio draw io draw.io","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dribbble;fillColor=#EB548D",67.4,67.2,"","Dribbble",null,null,this.getTagsForStencil("mxgraph.weblogos","dribbble","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ +"drawio draw io draw.io","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"drawio3;fillColor=#1A5BA3;fontSize=15;fontColor=#1A5BA3;fontStyle=1",52.2,52.2,'draw.<font color="#f08707">io</font>',"Draw.io",null,null,this.getTagsForStencil("mxgraph.weblogos","drawio draw io draw.io","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dribbble;fillColor=#EB548D",67.4,67.2,"","Dribbble",null,null,this.getTagsForStencil("mxgraph.weblogos","dribbble","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ "dropbox;fillColor=#0287EA",73.4,62,"","Dropbox2",null,null,this.getTagsForStencil("mxgraph.weblogos","dropbox","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"drupal",60.6,69,"","Drupal",null,null,this.getTagsForStencil("mxgraph.weblogos","drupal","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dzone",.2*438,61.2,"","Dzone",null,null,this.getTagsForStencil("mxgraph.weblogos","dzone","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"ebay",81.2,34.4,"","Ebay", null,null,this.getTagsForStencil("mxgraph.weblogos","ebay","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"edmodo;fillColor=#276CB0;strokeColor=none",69.2,73.8,"","Edmodo",null,null,this.getTagsForStencil("mxgraph.weblogos","edmodo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"evernote;fillColor=#3F3F3F",.2*317,75.2,"","Evernote",null,null,this.getTagsForStencil("mxgraph.weblogos","evernote","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"fancy;fillColor=#6DB3E3", 39.2,79,"","Fancy",null,null,this.getTagsForStencil("mxgraph.weblogos","fancy","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"fark;fillColor=#B1B0C7;gradientColor=#ffffff;strokeColor=#B1B0C7",44.2,70.2,"","Fark",null,null,this.getTagsForStencil("mxgraph.weblogos","fark","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"fashiolista",.2*388,73.2,"","Fashiolista",null,null,this.getTagsForStencil("mxgraph.weblogos","fashiolista","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ @@ -6923,15 +6924,15 @@ g=mxUtils.button(g||mxResources.get("cancel"),function(){a.hideDialog();null!=d& e.style.height="auto",e.className="geBtn",e.style.width="40%"):e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||k.appendChild(g);f.appendChild(k);l?(k.style.marginTop="10px",k=document.createElement("p"),k.style.marginTop="20px",k.appendChild(n),h=document.createElement("span"),mxUtils.write(h," "+mxResources.get("rememberThisSetting")),k.appendChild(h),f.appendChild(k),mxEvent.addListener(h,"click",function(a){n.checked=!n.checked;mxEvent.consume(a)})):k.style.marginTop="16px";this.container= f},ErrorDialog=function(a,b,c,d,e,g,h,m,l,f,k){l=null!=l?l:!0;var n=document.createElement("div");n.style.textAlign="center";if(null!=b){var t=document.createElement("div");t.style.padding="0px";t.style.margin="0px";t.style.fontSize="18px";t.style.paddingBottom="16px";t.style.marginBottom="16px";t.style.borderBottom="1px solid #c0c0c0";t.style.color="gray";mxUtils.write(t,b);n.appendChild(t)}b=document.createElement("div");b.style.padding="6px";b.innerHTML=c;n.appendChild(b);c=document.createElement("div"); c.style.marginTop="16px";c.style.textAlign="center";null!=g&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();g()}),b.className="geBtn",c.appendChild(b),c.style.textAlign="center");null!=f&&(f=mxUtils.button(f,function(){null!=k&&k()}),f.className="geBtn",c.appendChild(f));var u=mxUtils.button(d,function(){l&&a.hideDialog();null!=e&&e()});u.className="geBtn";c.appendChild(u);null!=h&&(d=mxUtils.button(h,function(){l&&a.hideDialog();null!=m&&m()}),d.className="geBtn gePrimaryBtn", -c.appendChild(d));this.init=function(){u.focus()};n.appendChild(c);this.container=n},EmbedDialog=function(a,b,c,d,e){d=document.createElement("div");var g=/^https?:\/\//.test(b)||/^mailto:\/\//.test(b);mxUtils.write(d,mxResources.get(5E5>b.length?g?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);var h=document.createElement("div");h.style.position="absolute";h.style.top="30px";h.style.right="30px";h.style.color="gray";mxUtils.write(h,a.formatFileSize(b.length));d.appendChild(h);var m=document.createElement("textarea"); -m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("autocapitalize","off");m.setAttribute("spellcheck","false");m.style.marginTop="10px";m.style.resize="none";m.style.height="150px";m.style.width="440px";m.style.border="1px solid gray";m.value=mxResources.get("updatingDocument");d.appendChild(m);mxUtils.br(d);this.init=function(){window.setTimeout(function(){5E5>b.length?(m.value=b,m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS? -m.select():document.execCommand("selectAll",!1,null)):(m.setAttribute("readonly","true"),m.value=b.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};h=document.createElement("div");h.style.position="absolute";h.style.bottom="36px";h.style.right="32px";var l=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!g||navigator.standalone||!(g||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(l=mxUtils.button(mxResources.get(5E5>b.length?"preview":"openInNewWindow"), -function(){var d=5E5>b.length?m.value:b;if(null!=e)e(d);else if(g)try{var f=a.openLink(d);null!=f&&(null==c||0<c)&&window.setTimeout(mxUtils.bind(this,function(){null!=f&&null!=f.location.href&&f.location.href.substring(0,8)!=d.substring(0,8)&&(f.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),c||500)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}else{var k=window.open().document;k.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+ -'</title><meta charset="utf-8"></head><body>'+b+"</body></html>");k.close()}}),l.className="geBtn",h.appendChild(l));if(!g||7500<b.length){var f=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",b,"text/plain")});f.className="geBtn";h.appendChild(f)}if(g&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>b.length){var k=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(m.value);a.openLink(b)}catch(t){a.handleError({message:t.message|| -mxResources.get("drawingTooLarge")})}}),f=document.createElement("img");f.setAttribute("src",Editor.facebookImage);f.setAttribute("width","18");f.setAttribute("height","18");f.setAttribute("border","0");k.appendChild(f);k.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");k.style.verticalAlign="bottom";k.style.paddingTop="4px";k.style.minWidth="46px";k.className="geBtn";h.appendChild(k)}7168>b.length&&(k=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+ -encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(m.value);a.openLink(b)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),f=document.createElement("img"),f.setAttribute("src",Editor.tweetImage),f.setAttribute("width","18"),f.setAttribute("height","18"),f.setAttribute("border","0"),f.style.marginBottom="5px",k.appendChild(f),k.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),k.style.verticalAlign= -"bottom",k.style.paddingTop="4px",k.style.minWidth="46px",k.className="geBtn",h.appendChild(k))}f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});h.appendChild(f);k=mxUtils.button(mxResources.get("copy"),function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>b.length?mxClient.IS_SF||null!=document.documentMode? -f.className="geBtn gePrimaryBtn":(h.appendChild(k),k.className="geBtn gePrimaryBtn",f.className="geBtn"):(h.appendChild(l),f.className="geBtn",l.className="geBtn gePrimaryBtn");d.appendChild(h);this.container=d};EmbedDialog.showPreviewOption=!0; +c.appendChild(d));this.init=function(){u.focus()};n.appendChild(c);this.container=n},EmbedDialog=function(a,b,c,d,e,g){d=document.createElement("div");var h=/^https?:\/\//.test(b)||/^mailto:\/\//.test(b);null!=g?mxUtils.write(d,g):mxUtils.write(d,mxResources.get(5E5>b.length?h?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);g=document.createElement("div");g.style.position="absolute";g.style.top="30px";g.style.right="30px";g.style.color="gray";mxUtils.write(g,a.formatFileSize(b.length));d.appendChild(g); +var m=document.createElement("textarea");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("autocapitalize","off");m.setAttribute("spellcheck","false");m.style.marginTop="10px";m.style.resize="none";m.style.height="150px";m.style.width="440px";m.style.border="1px solid gray";m.value=mxResources.get("updatingDocument");d.appendChild(m);mxUtils.br(d);this.init=function(){window.setTimeout(function(){5E5>b.length?(m.value=b,m.focus(),mxClient.IS_GC||mxClient.IS_FF|| +5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):(m.setAttribute("readonly","true"),m.value=b.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};g=document.createElement("div");g.style.position="absolute";g.style.bottom="36px";g.style.right="32px";var l=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!h||navigator.standalone||!(h||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(l=mxUtils.button(mxResources.get(5E5> +b.length?"preview":"openInNewWindow"),function(){var d=5E5>b.length?m.value:b;if(null!=e)e(d);else if(h)try{var f=a.openLink(d);null!=f&&(null==c||0<c)&&window.setTimeout(mxUtils.bind(this,function(){null!=f&&null!=f.location.href&&f.location.href.substring(0,8)!=d.substring(0,8)&&(f.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),c||500)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}else{var k=window.open().document;k.writeln("<html><head><title>"+ +encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+b+"</body></html>");k.close()}}),l.className="geBtn",g.appendChild(l));if(!h||7500<b.length){var f=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",b,"text/plain")});f.className="geBtn";g.appendChild(f)}if(h&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>b.length){var k=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+ +encodeURIComponent(m.value);a.openLink(b)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),f=document.createElement("img");f.setAttribute("src",Editor.facebookImage);f.setAttribute("width","18");f.setAttribute("height","18");f.setAttribute("border","0");k.appendChild(f);k.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");k.style.verticalAlign="bottom";k.style.paddingTop="4px";k.style.minWidth="46px";k.className="geBtn";g.appendChild(k)}7168> +b.length&&(k=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(m.value);a.openLink(b)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),f=document.createElement("img"),f.setAttribute("src",Editor.tweetImage),f.setAttribute("width","18"),f.setAttribute("height","18"),f.setAttribute("border","0"),f.style.marginBottom="5px",k.appendChild(f),k.setAttribute("title", +mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),k.style.verticalAlign="bottom",k.style.paddingTop="4px",k.style.minWidth="46px",k.className="geBtn",g.appendChild(k))}f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.appendChild(f);k=mxUtils.button(mxResources.get("copy"),function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))}); +5E5>b.length?mxClient.IS_SF||null!=document.documentMode?f.className="geBtn gePrimaryBtn":(g.appendChild(k),k.className="geBtn gePrimaryBtn",f.className="geBtn"):(g.appendChild(l),f.className="geBtn",l.className="geBtn gePrimaryBtn");d.appendChild(g);this.container=d};EmbedDialog.showPreviewOption=!0; var GoogleSitesDialog=function(a,b){function c(){var a=null!=w.getTitle()?w.getTitle():this.defaultFilename;if(E.checked&&""!=t.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(t.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<B.length&&(b+="&s="+B);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(A.checked?"1":"0");b+="&resize="+ (p.checked?"1":"0");b+="&x0="+Number(k.value);b+="&y0="+l;e.mathEnabled&&(b+="&math=1");C.checked?b+="&edit=_blank":x.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));f.value=b}else w.constructor==DriveFile||w.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=t.value?b+=encodeURIComponent(mxUtils.htmlEntities(t.value))+"&type=3":(b+=w.getHash().substring(1),b=w.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+ encodeURIComponent(a)),""!=n.value&&(a=parseInt(n.value)+parseInt(k.value),b+="&height="+a),f.value=b):f.value=""}var d=document.createElement("div"),e=a.editor.graph,g=e.getGraphBounds(),h=e.view.scale,m=Math.floor(g.x/h-e.view.translate.x),l=Math.floor(g.y/h-e.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var f=document.createElement("input");f.setAttribute("type","text");f.style.marginBottom="8px";f.style.marginTop="2px";f.style.width="410px";d.appendChild(f); @@ -7106,7 +7107,7 @@ h=document.createElement("tr"),m=document.createElement("td");m.style.whiteSpace k.select()};f.appendChild(k);h.appendChild(l);h.appendChild(f);g.appendChild(h);h=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value="0";f.appendChild(n);h.appendChild(l);h.appendChild(f);g.appendChild(h);h=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("right")+ ":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value="0";f.appendChild(t);h.appendChild(l);h.appendChild(f);g.appendChild(h);h=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("bottom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value="0";f.appendChild(u);h.appendChild(l);h.appendChild(f);g.appendChild(h);h=document.createElement("tr"); l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("circle")+":");h.appendChild(l);var q=document.createElement("input");q.setAttribute("type","checkbox");f.appendChild(q);h.appendChild(f);g.appendChild(h);e.appendChild(g);d.appendChild(e);var e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=new Image,x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),d=b.getContext("2d"),f=v.width, -e=v.height,g=parseInt(k.value),h=parseInt(n.value),f=Math.max(1,f-g-parseInt(t.value)),e=Math.max(1,e-h-parseInt(u.value));b.width=f;b.height=e;q.checked&&(d.fillStyle="#000000",d.arc(f/2,e/2,Math.min(f/2,e/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(v,g,h,f,e,0,0,f,e);c(b.toDataURL())});x.setAttribute("disabled","disabled");v.onload=function(){x.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+": "+v.width+" "+mxResources.get("height")+ +e=v.height,g=parseInt(k.value),x=parseInt(n.value),f=Math.max(1,f-g-parseInt(t.value)),e=Math.max(1,e-x-parseInt(u.value));b.width=f;b.height=e;q.checked&&(d.fillStyle="#000000",d.arc(f/2,e/2,Math.min(f/2,e/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(v,g,x,f,e,0,0,f,e);c(b.toDataURL())});x.setAttribute("disabled","disabled");v.onload=function(){x.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+": "+v.width+" "+mxResources.get("height")+ ": "+v.height)};v.src=b;mxEvent.addListener(d,"keypress",function(a){13==a.keyCode&&x.click()});b=document.createElement("div");b.style.marginTop="20px";b.style.textAlign="right";a.editor.cancelFirst?(b.appendChild(e),b.appendChild(x)):(b.appendChild(x),b.appendChild(e));d.appendChild(b);this.container=d},EditGeometryDialog=function(a,b){var c=a.editor.graph,d=1==b.length?c.getCellGeometry(b[0]):null,e=document.createElement("div"),g=document.createElement("table"),h=document.createElement("tbody"), m=document.createElement("tr"),l=document.createElement("td"),f=document.createElement("td");g.style.paddingLeft="6px";mxUtils.write(l,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value=null!=d?d.x:"";this.init=function(){k.focus();k.select()};f.appendChild(k);m.appendChild(l);m.appendChild(f);h.appendChild(m);m=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("top")+ ":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=d?d.y:"";f.appendChild(n);m.appendChild(l);m.appendChild(f);h.appendChild(m);m=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("width")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=d?d.width:"";f.appendChild(t);m.appendChild(l);m.appendChild(f);h.appendChild(m); @@ -7186,8 +7187,8 @@ function(a){this.editorUi.actions.get("editShape").funct()})),b.setAttribute("ti "3";Graph.prototype.edgeMode="move"!=urlParams.edge;var t=Graph.prototype.init;Graph.prototype.init=function(){function a(a){b=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)b=mxUtils.clone(a)}t.apply(this,arguments);var b=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){b=null});this.isMouseInsertPoint=function(){return null!=b};var c=this.getInsertPoint; this.getInsertPoint=function(){return null!=b?this.getPointForEvent(b):c.apply(this,arguments)};var d=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var b=this.graph.view.getState(a),b=null!=b?b.style:this.graph.getCellStyle(a);if("undefined"!=typeof mxRackContainer&&"rack"==b.childLayout){var c=new mxStackLayout(this.graph,!1);c.setChildGeometry=function(a,b){b.height=Math.max(b.height,20);if(1<b.height/20){var c=b.height%20;b.height+=10<c?20-c:-c}this.graph.getModel().setGeometry(a, b)};c.fill=!0;c.unitSize=mxRackContainer.unitSize|20;c.marginLeft=b.marginLeft||0;c.marginRight=b.marginRight||0;c.marginTop=b.marginTop||0;c.marginBottom=b.marginBottom||0;c.resizeParent=!1;return c}return d.apply(this,arguments)}};var u=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){u.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"==a.substring(0,17)&&(a=JSON.parse(a.substring(17)),null!=a.actions)){for(var b= -0;b<a.actions.length;b++)null!=a.actions[b].open&&(this.isCustomLink(a.actions[b].open)?this.customLinkClicked(a.actions[b].open):this.openLink(a.actions[b].open));this.model.beginUpdate();try{for(b=0;b<a.actions.length;b++)this.handleLinkAction(a.actions[b])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var b=[];null!=a.select&&this.isEnabled()&&(b=this.getCellsForAction(a.select),this.setSelectionCells(b));null!=a.scroll&&(b=this.getCellsForAction(a.scroll));null!= -a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.highlight&&(b=this.getCellsForAction(a.highlight),this.highlightCells(b,a.highlight.color,a.highlight.duration,a.highlight.opacity));0<b.length&&this.scrollCellToVisible(b[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))}; +0;b<a.actions.length;b++)null!=a.actions[b].open&&(this.isCustomLink(a.actions[b].open)?this.customLinkClicked(a.actions[b].open):this.openLink(a.actions[b].open));this.model.beginUpdate();try{for(b=0;b<a.actions.length;b++)this.handleLinkAction(a.actions[b])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var b=[];null!=a.select&&this.isEnabled()&&(b=this.getCellsForAction(a.select),this.setSelectionCells(b));null!=a.highlight&&(b=this.getCellsForAction(a.highlight), +this.highlightCells(b,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.scroll&&(b=this.getCellsForAction(a.scroll));0<b.length&&this.scrollCellToVisible(b[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))}; Graph.prototype.getCellsById=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++)if("*"==a[c])var d=this.getDefaultParent(),b=b.concat(this.model.filterDescendants(function(a){return a!=d},d));else{var f=this.model.getCell(a[c]);null!=f&&b.push(f)}return b};Graph.prototype.getCellsForTags=function(a,b,c){var d=[];if(null!=a){b=null!=b?b:this.model.getDescendants(this.model.getRoot());c=null!=c?c:"tags";for(var f=0;f<b.length;f++)if(this.model.isVertex(b[f])||this.model.isEdge(b[f])){var k= null!=b[f].value&&"object"==typeof b[f].value?mxUtils.trim(b[f].value.getAttribute(c)||""):"",e=!0;if(0<k.length)for(var k=k.toLowerCase().split(" "),n=0;n<a.length&&e;n++)var p=mxUtils.trim(a[n]).toLowerCase(),e=e&&(0==p.length||0<=mxUtils.indexOf(k,p));else e=0==a.length;e&&d.push(b[f])}}return d};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],!this.model.isVisible(a[b]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible= function(a,b){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],b)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,b,c,d){for(var f=0;f<a.length;f++)this.highlightCell(a[f],b,c,d)};Graph.prototype.highlightCell=function(a,b,c,d){b=null!=b?b:mxConstants.DEFAULT_VALID_COLOR;c=null!=c?c:1E3;a=this.view.getState(a);if(null!=a){var f=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),k=new mxCellHighlight(this,b,f,!1);null!= @@ -7223,7 +7224,7 @@ k.appendChild(h);e=document.createElement("div");e.style.cssText="text-align:rig d(!1)}),q.className="geBtn",e.appendChild(q));q=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});q.className="geBtn gePrimaryBtn";e.appendChild(q);a.editor.cancelFirst||e.appendChild(h);k.appendChild(e);this.container=k};var v=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background= this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(v.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!= this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})(); -(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,d){d.ui=a.ui;return c};a.afterDecode=function(a,c,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.8.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>'; +(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,d){d.ui=a.ui;return c};a.afterDecode=function(a,c,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.8.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";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.sidebarFooterHeight=36;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.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport= !1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(u){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport= @@ -7274,25 +7275,25 @@ function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData( a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if(null==a){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c= this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};}; EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(b,c){if(0==b.length&&a.isEditable())null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style, -"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),c.appendChild(f);else for(var d=0;d<b.length;d++){var e=b[d],k=e.data;if(null!=k){var k=this.convertDataUri(k),n="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(n+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(n+"image="+k,e.w,e.h,"",e.title||"",!1, +"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),c.appendChild(f);else for(var d=0;d<b.length;d++){var e=b[d],k=e.data;if(null!=k){var k=this.convertDataUri(k),g="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(g+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(g+"image="+k,e.w,e.h,"",e.title||"",!1, !1,!0))}else null!=e.xml&&(k=this.stringToCells(this.editor.graph.decompress(e.xml)),0<k.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(k,e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var k=0;k<b.length;k++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+= -"aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[k]);c=null!=c&&0<c.length?c:a.getTitle();var n=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);var g= -n.parentNode.previousSibling;c=g.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&g.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var p=document.createElement("div");p.style.position="absolute";p.style.right="0px";p.style.top="0px";p.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(p.style.backgroundColor="inherit");g.style.position="relative";var h=document.createElement("img");h.setAttribute("src",Dialog.prototype.closeImage);h.setAttribute("title", +"aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[k]);c=null!=c&&0<c.length?c:a.getTitle();var g=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);var n= +g.parentNode.previousSibling;c=n.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&n.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var p=document.createElement("div");p.style.position="absolute";p.style.right="0px";p.style.top="0px";p.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(p.style.backgroundColor="inherit");n.style.position="relative";var h=document.createElement("img");h.setAttribute("src",Dialog.prototype.closeImage);h.setAttribute("title", mxResources.get("close"));h.setAttribute("valign","absmiddle");h.setAttribute("border","0");h.style.margin="0 3px";var m=null;if(".scratchpad"!=a.title||this.closableScratchpad)p.appendChild(h),mxEvent.addListener(h,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=m?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var l= -this.editor.graph,w=null,J=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),n,b,a,a.getMode());mxEvent.consume(c)}),y=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=w&&null!=w.parentNode&&w.parentNode.removeChild(w),w=h.cloneNode(!1),w.setAttribute("src",Editor.spinImage),w.setAttribute("title",mxResources.get("saving")),w.style.cursor="default",w.style.marginRight="2px",w.style.marginTop="-2px",p.insertBefore(w,p.firstChild),g.style.paddingRight=18*p.childNodes.length+ -"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=w&&null!=w.parentNode&&(w.parentNode.removeChild(w),g.style.paddingRight=18*p.childNodes.length+"px")})):null==m&&(m=h.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),p.insertBefore(m,p.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==m||a.isModified()|| -(g.style.paddingRight=18*p.childNodes.length+"px",m.parentNode.removeChild(m),m=null)});mxEvent.consume(c)})),g.style.paddingRight=18*p.childNodes.length+"px")}),D=mxUtils.bind(this,function(a,c,d,e){a=l.cloneCells(mxUtils.sortCells(l.model.getTopmostCells(a)));for(var k=0;k<a.length;k++){var g=l.getCellGeometry(a[k]);null!=g&&g.translate(-c.x,-c.y)}n.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))), +this.editor.graph,w=null,J=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),g,b,a,a.getMode());mxEvent.consume(c)}),y=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=w&&null!=w.parentNode&&w.parentNode.removeChild(w),w=h.cloneNode(!1),w.setAttribute("src",Editor.spinImage),w.setAttribute("title",mxResources.get("saving")),w.style.cursor="default",w.style.marginRight="2px",w.style.marginTop="-2px",p.insertBefore(w,p.firstChild),n.style.paddingRight=18*p.childNodes.length+ +"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=w&&null!=w.parentNode&&(w.parentNode.removeChild(w),n.style.paddingRight=18*p.childNodes.length+"px")})):null==m&&(m=h.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),p.insertBefore(m,p.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==m||a.isModified()|| +(n.style.paddingRight=18*p.childNodes.length+"px",m.parentNode.removeChild(m),m=null)});mxEvent.consume(c)})),n.style.paddingRight=18*p.childNodes.length+"px")}),D=mxUtils.bind(this,function(a,c,d,e){a=l.cloneCells(mxUtils.sortCells(l.model.getTopmostCells(a)));for(var k=0;k<a.length;k++){var n=l.getCellGeometry(a[k]);null!=n&&n.translate(-c.x,-c.y)}g.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))), w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);y(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(l.isSelectionEmpty())l.getRubberband().isActive()?(l.getRubberband().execute(a),l.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=l.getSelectionCells(),c=l.view.getBounds(b),d=l.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=l.view.translate.x; -c.y-=l.view.translate.y;D(b,c)}mxEvent.consume(a)});n.style.border="3px solid transparent";mxEvent.addGestureListeners(n,function(){},mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.panningManager&&null!=l.graphHandler.shape&&(l.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":n.style.border="3px dotted rgb(254, 137, 12)",n.style.cursor="copy",l.panningManager.stop(),l.autoScroll=!1,null!=l.graphHandler.guide&&l.graphHandler.guide.setVisible(!1), -null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.panningManager&&null!=l.graphHandler&&(n.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),n.style.cursor="default",this.sidebar.showTooltips=!0,l.panningManager.stop(),l.graphHandler.reset(),l.isMouseDown=!1,l.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(n,"mouseleave",mxUtils.bind(this,function(a){l.isMouseDown&& -null!=l.graphHandler.shape&&(l.graphHandler.shape.node.style.visibility="visible",n.style.border="3px solid transparent",n.style.cursor="",l.autoScroll=!0,null!=l.graphHandler.guide&&l.graphHandler.guide.setVisible(!0),null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(n,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":n.style.border="3px dotted rgb(254, 137, 12)"; -a.dataTransfer.dropEffect="copy";n.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(n,"drop",mxUtils.bind(this,function(a){n.style.border="3px solid transparent";n.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,k,g,p,h,m,t,l){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+ -this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,h),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,p,h),a,mxEvent.isAltDown(a)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var v=!1,q=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(k.documentElement));e(g,n);b=b.concat(g);y(a); -this.spinner.stop();v=!0}catch(U){}else if("mxfile"==k.documentElement.nodeName)try{for(var p=k.documentElement.getElementsByTagName("diagram"),k=0;k<p.length;k++){var g=mxUtils.getTextContent(p[k]),h=this.stringToCells(this.editor.graph.decompress(g)),m=this.editor.graph.getBoundingBoxFromGeometry(h);D(h,new mxRectangle(0,0,m.width,m.height),a)}v=!0}catch(U){null!=window.console&&console.log("error in drop handler:",U)}}v||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")})); +c.y-=l.view.translate.y;D(b,c)}mxEvent.consume(a)});g.style.border="3px solid transparent";mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.panningManager&&null!=l.graphHandler.shape&&(l.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":g.style.border="3px dotted rgb(254, 137, 12)",g.style.cursor="copy",l.panningManager.stop(),l.autoScroll=!1,null!=l.graphHandler.guide&&l.graphHandler.guide.setVisible(!1), +null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.panningManager&&null!=l.graphHandler&&(g.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),g.style.cursor="default",this.sidebar.showTooltips=!0,l.panningManager.stop(),l.graphHandler.reset(),l.isMouseDown=!1,l.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(a){l.isMouseDown&& +null!=l.graphHandler.shape&&(l.graphHandler.shape.node.style.visibility="visible",g.style.border="3px solid transparent",g.style.cursor="",l.autoScroll=!0,null!=l.graphHandler.guide&&l.graphHandler.guide.setVisible(!0),null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":g.style.border="3px dotted rgb(254, 137, 12)"; +a.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(a){g.style.border="3px solid transparent";g.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,k,n,p,h,m,t,l){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+ +this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,h),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,p,h),a,mxEvent.isAltDown(a)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var v=!1,q=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(k.documentElement));e(n,g);b=b.concat(n);y(a); +this.spinner.stop();v=!0}catch(U){}else if("mxfile"==k.documentElement.nodeName)try{for(var p=k.documentElement.getElementsByTagName("diagram"),k=0;k<p.length;k++){var n=mxUtils.getTextContent(p[k]),h=this.stringToCells(this.editor.graph.decompress(n)),m=this.editor.graph.getBoundingBoxFromGeometry(h);D(h,new mxRectangle(0,0,m.width,m.height),a)}v=!0}catch(U){null!=window.console&&console.log("error in drop handler:",U)}}v||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")})); null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=l&&null!=m&&(/(\.vsdx?)($|\?)/i.test(m)||/(\.vssx)($|\?)/i.test(m))?this.importVisio(l,function(a){q(a,"text/xml")},null,m):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,m)&&null!=l?this.parseFile(l,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?q(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge": -"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):q(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(n,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(n.style.border="3px solid transparent",n.style.cursor="");a.stopPropagation();a.preventDefault()}));h=h.cloneNode(!1);h.setAttribute("src",Editor.editImage);h.setAttribute("title",mxResources.get("edit"));p.insertBefore(h,p.firstChild);mxEvent.addListener(h,"click",J);mxEvent.addListener(n, -"dblclick",function(a){mxEvent.getSource(a)==n&&J(a)});c=h.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));p.insertBefore(c,p.firstChild);mxEvent.addListener(c,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c, -mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),p.insertBefore(c,p.firstChild))}g.appendChild(p);g.style.paddingRight=18*p.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter"); +"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):q(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(g.style.border="3px solid transparent",g.style.cursor="");a.stopPropagation();a.preventDefault()}));h=h.cloneNode(!1);h.setAttribute("src",Editor.editImage);h.setAttribute("title",mxResources.get("edit"));p.insertBefore(h,p.firstChild);mxEvent.addListener(h,"click",J);mxEvent.addListener(g, +"dblclick",function(a){mxEvent.getSource(a)==g&&J(a)});c=h.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));p.insertBefore(c,p.firstChild);mxEvent.addListener(c,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c, +mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),p.insertBefore(c,p.firstChild))}n.appendChild(p);n.style.paddingRight=18*p.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter"); if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme? (mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding= 5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4", @@ -7327,27 +7328,27 @@ mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor. "disabled");g&&(a.appendChild(f),c=document.createElement("span"),mxUtils.write(c,b),a.appendChild(c),e||mxUtils.br(a),mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){"disabled"!=f.getAttribute("disabled")&&(f.checked=!f.checked,mxEvent.consume(a))})));return f};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&& (f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"== e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return c}, -getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=f&&f!=mxConstants.NONE?"border:1px solid black;background-color:"+f:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft= -"8px";d.style.marginRight="10px";d.className="geBtn";var e=document.createElement("option");e.setAttribute("value","auto");mxUtils.write(e,mxResources.get("automatic"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("openInNewWindow"));d.appendChild(e);e=document.createElement("option");e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));d.appendChild(e);b&&(e=document.createElement("option"),e.setAttribute("value", -"frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(e));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var f="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(f||"none",function(a){f=a;c()});mxEvent.consume(a)}));c();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE|| -mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return f},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,g,h,m){var f=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&k.push("edit="+encodeURIComponent(e)),g&& +getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft= +"8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value", +"frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE|| +mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,g,h,m){var f=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&k.push("edit="+encodeURIComponent(e)),g&& k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&k.push("page="+a);break}a=!0;null!=h?c="#U"+encodeURIComponent(h):(f=this.getCurrentFile(),m||null==f||f.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+f.getHash(),a=!1)); a&&null!=f&&null!=f.getTitle()&&f.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,e,g,h,m,l,p,A){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);l||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled; c=parseInt(c);isNaN(c)||100==c||(f.zoom=c/100);c=[];h&&(c.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),f.resize=!0);m&&c.push("layers");0<c.length&&(l&&c.push("lightbox"),f.toolbar=c.join(" "));null!=p&&0<p.length&&(f.edit=p);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,null,null,!h);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+ -mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";A(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var e=document.createElement("div");e.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";e.appendChild(f);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");f=g.cloneNode(!0);f.setAttribute("value", -"copy");k.appendChild(f);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(n);mxUtils.br(k);k.appendChild(g);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));k.appendChild(n);var p=this.getCurrentFile();null==c&&null!=p&&p.constructor==window.DriveFile&&(n=document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")), -k.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(p.getId())})));f.setAttribute("checked","checked");null==c&&g.setAttribute("disabled","disabled");e.appendChild(k);var h=this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");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="100%";e.appendChild(l);var t=this.addCheckbox(e,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,J=J=this.addCheckbox(e,mxResources.get("allPages"),k,!k),y=this.addCheckbox(e,mxResources.get("layers"),!0),D=this.addCheckbox(e,mxResources.get("lightbox"),!0),H=this.addEditButton(e,D),z=H.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&D.checked? -H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(g.checked?c:null,m.checked,l.value,h.getTarget(),h.getColor(),t.checked,J.checked,y.checked,D.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=document.createElement("h3"); +mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";A(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3"); +mxUtils.write(e,mxResources.get("html"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(e);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");e=g.cloneNode(!0);e.setAttribute("value", +"copy");k.appendChild(e);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(n);mxUtils.br(k);k.appendChild(g);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));k.appendChild(n);var p=this.getCurrentFile();null==c&&null!=p&&p.constructor==window.DriveFile&&(n=document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")), +k.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(p.getId())})));e.setAttribute("checked","checked");null==c&&g.setAttribute("disabled","disabled");f.appendChild(k);var h=this.addLinkSection(f),m=this.addCheckbox(f,mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");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="100%";f.appendChild(l);var t=this.addCheckbox(f,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,J=J=this.addCheckbox(f,mxResources.get("allPages"),k,!k),y=this.addCheckbox(f,mxResources.get("layers"),!0),D=this.addCheckbox(f,mxResources.get("lightbox"),!0),H=this.addEditButton(f,D),z=H.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&D.checked? +H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,m.checked,l.value,h.getTarget(),h.getColor(),t.checked,J.checked,y.checked,D.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=document.createElement("h3"); mxUtils.write(k,a||mxResources.get("link"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(k);var n=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=n&&n.constructor==window.DriveFile&&!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;"; var h=document.createElement("div");h.style.whiteSpace="normal";mxUtils.write(h,mxResources.get("linkAccountRequired"));p.appendChild(h);h=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(n.getId())}));h.style.marginTop="12px";h.className="geBtn";p.appendChild(h);f.appendChild(p);h=document.createElement("a");h.style.paddingLeft="12px";h.style.color="gray";h.style.fontSize="11px";h.setAttribute("href","javascript:void(0);");mxUtils.write(h,mxResources.get("check")); p.appendChild(h);mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,l=null;if(null!=c||null!=d)a+=30,mxUtils.write(f,mxResources.get("width")+":"),m=document.createElement("input"), m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",f.appendChild(m),mxUtils.write(f,mxResources.get("height")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.width="50px",l.style.marginLeft="6px",l.style.marginBottom="10px",l.value=d+"px",f.appendChild(l),mxUtils.br(f);var t=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var q=null; if(null==n||n.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var u=this.addCheckbox(f,mxResources.get("lightbox"),!0),D=this.addEditButton(f,u),H=D.getEditInput(),z=this.addCheckbox(f,mxResources.get("layers"),!0);z.style.marginLeft=H.style.marginLeft;z.style.marginBottom="16px";z.style.marginTop="8px";mxEvent.addListener(u,"change",function(){u.checked?(z.removeAttribute("disabled"),H.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),H.setAttribute("disabled", "disabled"));H.checked&&u.checked?D.getEditSelect().removeAttribute("disabled"):D.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(t.getTarget(),t.getColor(),null==q?!0:q.checked,u.checked,D.getLink(),z.checked,null!=m?m.value:null,null!=l?l.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select(): -document.execCommand("selectAll",!1,null)):t.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(f);var k=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"), -!0),f=this.editor.graph,n=d?null:this.addCheckbox(e,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=n&&(n.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!k.checked,null!=g?g.checked:!1,null!=n?n.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,g,h,m){h=null!=h?h:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var k= +document.execCommand("selectAll",!1,null)):t.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("image"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(e);var k=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"), +!0),e=this.editor.graph,n=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=n&&(n.style.marginBottom="16px");a=new CustomDialog(this,f,mxUtils.bind(this,function(){c(!k.checked,null!=g?g.checked:!1,null!=n?n.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,g,h,m){h=null!=h?h:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var k= this.editor.graph,n="jpeg"==m?196:300,l=document.createElement("h3");mxUtils.write(l,a);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";f.appendChild(l);mxUtils.write(f,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";f.appendChild(t);mxUtils.write(f,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";f.appendChild(q);mxUtils.br(f);var v=this.addCheckbox(f,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=m),u=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight= "8px";x.style.marginLeft="24px";x.setAttribute("disabled","disabled");x.setAttribute("type","checkbox");g&&(f.appendChild(x),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),n+=26,mxEvent.addListener(u,"change",function(){u.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var H=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible),z=document.createElement("input");z.style.marginTop= @@ -7362,15 +7363,15 @@ EditorUi.prototype.createEmbedSvg=function(a,b,c,d,e,g,h){var f=this.editor.grap (e?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");a&&(l+="max-width:100%;");this.convertImages(f,mxUtils.bind(this,function(a){h('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=l?' style="'+l+'"':"")+m+"/>")}))}else l="",d&&(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('https://www.draw.io/?client=1&lightbox=1"+ (e?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),l+="cursor:pointer;"),a&&(a=parseInt(f.getAttribute("width")),b=parseInt(f.getAttribute("height")),f.setAttribute("viewBox","0 0 "+a+" "+b),l+="max-width:100%;max-height:"+b+"px;",f.removeAttribute("height")),""!=l&&f.setAttribute("style",l),h(mxUtils.getXml(f))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");b=Math.floor(a/2592E3);if(1<b)return b+ " "+mxResources.get("months");b=Math.floor(a/86400);if(1<b)return b+" "+mxResources.get("days");b=Math.floor(a/3600);if(1<b)return b+" "+mxResources.get("hours");b=Math.floor(a/60);return 1<b?b+" "+mxResources.get("minutes"):1==b?b+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,c,d){d()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0< -d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(q){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){var d=this.editor.graph, -e=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),e=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),f=d.getGlobalVariable,k=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(d.container); -d.model.setRoot(k.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==e&&(e=this.getFileData(!0));var f=c.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(f.substring(f.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(p){null!=b&&b(p)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg= +d.length){var c=d[0],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(q){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){var d=this.editor.graph, +f=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),f=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),e=d.getGlobalVariable,k=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container); +d.model.setRoot(k.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0));var e=c.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(p){null!=b&&b(p)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg= function(a,b,c,d,e,g,h){h=b.background;h==mxConstants.NONE&&(h=null);b=b.getSvg(h,null,null,null,null,g);null!=a&&b.setAttribute("content",a);null!=c&&b.setAttribute("resource",c);if(null!=e)this.convertImages(b,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+ mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,h,m,l){l=null!=l?l:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,m):null,l)}catch(E){"Invalid image"==E.message?this.downloadFile(l):this.handleError(E)}}),null, -this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,h)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},f=mxUtils.bind(this,function(){if(0==d){for(var f=[c[0]],k=1;k<c.length;k++){var g= -c[k].indexOf(")");f.push('url("');f.push(e[b(c[k].substring(0,g))]);f.push('"'+c[k].substring(g))}this.editor.resolvedFontCss=f.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var h=c[g].indexOf(")"),m=null,p=c[g].indexOf("format(",h);0<p&&(m=b(c[g].substring(p+7,c[g].indexOf(")",p))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))b= -"application/x-font-opentype";else if("woff"==m||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==m||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==m||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==m||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){e[a]=b;d--;f()}),mxUtils.bind(this, -function(a){d--;f()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,h)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,h,m,l,p,A,E,B,w){g=null!=g?g:!0;E=null!=E?E:this.editor.graph;B=null!=B?B:0;var f=l?null:E.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==l&&(f=this.editor.graph.defaultPageBackgroundColor);this.convertImages(E.getSvg(f,null,null,w,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this, +this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,h)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,f={},e=mxUtils.bind(this,function(){if(0==d){for(var e=[c[0]],k=1;k<c.length;k++){var g= +c[k].indexOf(")");e.push('url("');e.push(f[b(c[k].substring(0,g))]);e.push('"'+c[k].substring(g))}this.editor.resolvedFontCss=e.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var h=c[g].indexOf(")"),m=null,p=c[g].indexOf("format(",h);0<p&&(m=b(c[g].substring(p+7,c[g].indexOf(")",p))));mxUtils.bind(this,function(a){if(null==f[a]){f[a]=a;d++;var b="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))b= +"application/x-font-opentype";else if("woff"==m||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==m||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==m||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==m||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this, +function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,h)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,h,m,l,p,A,E,B,w){g=null!=g?g:!0;E=null!=E?E:this.editor.graph;B=null!=B?B:0;var f=l?null:E.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==l&&(f=this.editor.graph.defaultPageBackgroundColor);this.convertImages(E.getSvg(f,null,null,w,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this, function(){try{var k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),h=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=b&&(m=g?Math.min(1,Math.min(3*b/(4*h),b/p)):b/p);p=Math.ceil(m*p)+2*B;h=Math.ceil(m*h)+2*B;k.setAttribute("width",p);k.setAttribute("height",h);var n=k.getContext("2d");null!=f&&(n.beginPath(),n.rect(0,0,p,h),n.fillStyle=f,n.fill());n.scale(m,m);mxClient.IS_SF?window.setTimeout(function(){n.drawImage(d,B/m,B/m);a(k)},0):(n.drawImage(d,B/m,B/m),a(k))}catch(M){null!= e&&e(M)}});d.onerror=function(a){null!=e&&e(a)};try{p&&this.editor.graph.addSvgShadow(c);var k=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(E,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(z){null!=e&&e(z)}}),c,A)};EditorUi.prototype.createImageUrlConverter= function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var e="http://"==d.substring(0,7)||"https://"==d.substring(0,8);e&&!navigator.onLine?d=c.svgBrokenImage.src:!e||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(d)?"chrome-extension://"!=d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null== @@ -7383,122 +7384,122 @@ null!=this.pages);if(null!=h&&"mxfile"==h.nodeName&&null!=this.pages){var p=h.ge h.nodeName&&(f=k.importGraphModel(h,b,c,d))}}catch(B){throw e||this.handleError(B,mxResources.get("invalidOrMissingFile")),B;}return f};EditorUi.prototype.importVisio=function(a,b,c,d){d=null!=d?d:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var e=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(d)&&null!=VSD_CONVERT_URL){var e=new FormData;e.append("file1",a,d);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);f.responseType= "blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response,b,c)}catch(x){c(x)}else c({})});f.send(e)}else try{this.doImportVisio(a,b,c)}catch(x){c(x)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(k){this.handleError(k)}}); "undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,d,e){var f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,d,e)}catch(v){this.handleError(v)}finally{null!=e&&e()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(f,0):(this.loadingExtensions=!0,"1"==urlParams.dev? -mxscript("js/diagramly/Extensions.js",f):mxscript("js/extensions.min.js",f))};EditorUi.prototype.insertLucidChart=function(a,b,c,d,e){e=JSON.parse(a);a=[];if(null!=e.state){e=JSON.parse(e.state);for(var f in e.Pages)a.push(e.Pages[f]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(e);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,c,d),null!=this.pages){var k=this.currentPage; -for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(k)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,c,d,e,g,h){g=null!=g?g:!0;h=null!=h?h:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText, +mxscript("js/diagramly/Extensions.js",f):mxscript("js/extensions.min.js",f))};EditorUi.prototype.insertLucidChart=function(a,b,c,d,e){e=JSON.parse(a);a=[];if(null!=e.state){e=JSON.parse(e.state);for(var f in e.Pages)a.push(e.Pages[f]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(e);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,c,d),null!=this.pages){var g=this.currentPage; +for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(g)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,c,d,e,g,h){g=null!=g?g:!0;h=null!=h?h:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText, b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var f=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var k=this.extractGraphModelFromPng(a),p=this.importXml(k,b,c,g,!0);if(0<p.length)return p}if("data:image/svg+xml;"==a.substring(0,19))try{if(k=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(k=a.substring(a.indexOf(",")+1),k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0)):k=decodeURIComponent(a.substring(a.indexOf(",")+ 1)),p=this.importXml(k,b,c,g,!0),0<p.length)return p}catch(A){}this.loadImage(a,mxUtils.bind(this,function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,e){f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),d,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),h,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/ -d.height)),k=Math.round(d.width*e);d=Math.round(d.height*e);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),k,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,a,f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.updateCellSize(e),f.fireEvent(new mxEventObject("textInserted","cells", -[e]))}finally{f.getModel().endUpdate()}f.setSelectionCell(e)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,g);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,g);else{f=this.editor.graph;e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,"",f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.fireEvent(new mxEventObject("textInserted","cells",[e])),e.value= -a,f.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(e.value)&&f.setLinkForCell(e,e.value),e.geometry.width+=f.gridSize,e.geometry.height+=f.gridSize}finally{f.getModel().endUpdate()}return[e]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+ -" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input"); -c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(b)){var c=new Blob([a],{type:"application/octet-stream"}); -this.importVisio(c,mxUtils.bind(this,function(a){this.importXml(a)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,c,d,e,g,h,m,l,p, -A){p=null!=p?p:!0;var f=!1,k=null,n=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,h)):b=this.importXml(a,c,d,p);null!=m&&m(b)});"image"==b.substring(0,5)?(l=!1,"image/png"==b.substring(0,9)&&(b=A?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,d,p),l=!0)),l||(k=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),p&&k.isGridEnabled()&&(c=k.snap(c),d= -k.snap(d)),k=[k.insertVertex(null,null,"",c,d,e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,d,p);null!=m&&m(a)})):null!=l&&null!=h&&(/(\.vsdx?)($|\?)/i.test(h)||/(\.vssx)($|\?)/i.test(h))?(f=!0,this.importVisio(l,n)):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(a,h)?(f=!0,this.parseFile(null!=l?l:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?n(a.responseText):null!=m&&m(null))}),h)):/(\.vsd)($|\?)/i.test(h)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,p));f||null==m||m(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,f,g;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,h,m,l,p,A,E){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;p=null!=p?p:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,n=!1;if(!mxClient.IS_CHROMEAPP&& -null!=a)for(var t=A||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>t){n=!0;break}var v=mxUtils.bind(this,function(){var n=this.editor.graph,l=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,k,h,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,d,e,g,k,h,p,f,E)});g=null!=g?g:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body, -mxResources.get("loading")))for(var t=a.length,q=t,v=[],u=mxUtils.bind(this,function(a,b){v[a]=b;if(0==--q){this.spinner.stop();if(null!=m)m(v);else{var c=[];n.getModel().beginUpdate();try{for(var d=0;d<v.length;d++){var e=v[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}g(c)}}),x=0;x<t;x++)mxUtils.bind(this,function(f){var g=a[f],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var m= -a.target.result,t=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(t+1)))),v=mxUtils.parseXml(q),q=v.getElementsByTagName("svg");if(0<q.length){var q=q[0],z=E?null:q.getAttribute("content");null!=z&&"<"!=z.charAt(0)&&"%"!=z.charAt(0)&&(z=unescape(window.atob?atob(z):Base64.decode(z,!0)));null!=z&&"%"==z.charAt(0)&&(z=decodeURIComponent(z));null==z||"<mxfile "!==z.substring(0,8)&&"<mxGraphModel "!==z.substring(0,14)?u(f,mxUtils.bind(this,function(){try{if(m.substring(0,t+1),null!=v){var a= -v.getElementsByTagName("svg");if(0<a.length){var h=a[0],p=parseFloat(h.getAttribute("width")),A=parseFloat(h.getAttribute("height")),q=h.getAttribute("viewBox");if(null==q||0==q.length)h.setAttribute("viewBox","0 0 "+p+" "+A);else if(isNaN(p)||isNaN(A)){var u=q.split(" ");3<u.length&&(p=parseFloat(u[2]),A=parseFloat(u[3]))}m=this.createSvgDataUri(mxUtils.getXml(h));var z=Math.min(1,Math.min(d/Math.max(1,p)),d/Math.max(1,A)),x=e(m,g.type,b+f*l,c+f*l,Math.max(1,Math.round(p*z)),Math.max(1,Math.round(A* -z)),g.name,k);if(isNaN(p)||isNaN(A)){var E=new Image;E.onload=mxUtils.bind(this,function(){p=Math.max(1,E.width);A=Math.max(1,E.height);x[0].geometry.width=p;x[0].geometry.height=A;h.setAttribute("viewBox","0 0 "+p+" "+A);m=this.createSvgDataUri(mxUtils.getXml(h));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));n.setCellStyles("image",m,[x[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(h))}return x}}}catch(da){}return null})):u(f,mxUtils.bind(this,function(){return e(z, -"text/xml",b+f*l,c+f*l,0,0,g.name)}))}}else{q=!1;if("image/png"==g.type){var x=E?null:this.extractGraphModelFromPng(a.target.result);if(null!=x&&0<x.length){var J=new Image;J.src=a.target.result;u(f,mxUtils.bind(this,function(){return e(x,"text/xml",b+f*l,c+f*l,J.width,J.height,g.name)}));q=!0}}q||(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(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,m,n){u(f,mxUtils.bind(this,function(){if(null!=h&&h.length<p){var t=k&&this.isResampleImage(a.target.result,A)?Math.min(1,Math.min(d/m,d/n)):1;return e(h,g.type,b+f*l,c+f*l,Math.round(m*t),Math.round(n*t),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,A)}),mxUtils.bind(this, -function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*l,c+f*l,240,160,g.name,function(a){u(f,function(){return a})})});/(\.vsdx?)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?e(null,g.type,b+f*l,c+f*l,240,160,g.name,function(a){u(f,function(){return a})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g):m.readAsText(g)})(x)});n?this.confirmImageResize(function(a){k=a;v()},l):v()};EditorUi.prototype.confirmImageResize=function(a, -b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!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?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length> -b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,g){e=null!=e?e:this.maxImageSize;var f=Math.max(1,a.width),k=Math.max(1,a.height);if(d&&this.isResampleImage(b,g))try{var h=Math.max(f/e,k/e);if(1<h){var p=Math.round(f/h),m=Math.round(k/h),n=document.createElement("canvas");n.width=p;n.height=m;n.getContext("2d").drawImage(a,0,0,p,m);var l=n.toDataURL();if(l.length<b.length){var t=document.createElement("canvas");t.width=p;t.height=m;var q=t.toDataURL();l!==q&&(b=l,f=p,k=m)}}}catch(y){}c(b,f,k)}; -EditorUi.prototype.crcTable=[];for(var c=0;256>c;c++)for(var d=c,e=0;8>e;e++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[c]=d;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^b[c+e])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a, -b,c,d,e){function f(a,b){var c=h;h+=b;return a.substring(c,h)}function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var h=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,h);do{var p= -g(a);if("IDAT"==f(a,4)){e=a.substring(0,h-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=k(c.length)+b+c+k(d^4294967295);e+=a.substring(h-8,a.length);break}e+=a.substring(h-8,h-4+p);f(a,p);f(a,4)}while(p);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF? -atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(u){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&& -"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var g=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){try{a.handleCustomLink(b)}catch(H){a.handleError(H)}};this.isOffline()|| -"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var c=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var d=0;d<a.pages.length;d++)if(a.pages[d]==a.currentPage){0<d&&(b+=(0<b.length?"&":"?")+"page="+d);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return c.apply(this,arguments)};var d=b.addClickHandler;b.addClickHandler= -function(a,c,e){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null==c||!b.isCustomLink(c)||!mxEvent.isTouchEvent(a)&&mxEvent.isPopupTrigger(a)||(b.customLinkClicked(c),mxEvent.consume(a));null!=f&&f(a,c)};d.call(this,a,c,e)};g.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!= -a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var e=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:e.apply(this,arguments)};var h=b.createLinkForHint;b.createLinkForHint=function(a,c){null!=a&&b.isCustomLink(a)&&(c=b.getLinkTitle(a));var d=h.call(this,a,c);null!=a&&b.isCustomLink(a)&&mxEvent.addListener(d, -"click",function(c){b.customLinkClicked(a);mxEvent.consume(c)});return d};var m=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var e=c.getAttribute("href");if(null==e||!b.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))m.apply(this,arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(e),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!= -c.getTitle()?c.getTitle():b);return b};var l=this.actions.get("print");l.setEnabled(!mxClient.IS_IOS||!navigator.standalone);l.visible=l.isEnabled();if(!this.editor.chromeless||this.editor.editable){var C=function(){window.setTimeout(function(){p.innerHTML=" ";p.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry", -!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()], -0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var k=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(Z){}}),!1);var p=document.createElement("div");p.style.position="absolute";p.style.whiteSpace="nowrap";p.style.overflow="hidden";p.style.display="block";p.contentEditable=!0;mxUtils.setOpacity(p, -0);p.style.width="1px";p.style.height="1px";p.innerHTML=" ";var A=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)|| -A||(p.style.left=b.container.scrollLeft+10+"px",p.style.top=b.container.scrollTop+10+"px",b.container.appendChild(p),A=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){p.focus();document.execCommand("selectAll",!1,null)},0):(p.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!A||224!=c&&17!=c&&91!=c||(A=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(), -p.parentNode.removeChild(p),mxUtils.clearSelection())}),0)}));mxEvent.addListener(p,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(p),C())}));mxEvent.addListener(p,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(this.copyCells(p,!0),C())}));mxEvent.addListener(p,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(p.innerHTML=" ",p.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,p);p.innerHTML= -" "}),0))}),!0);var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==p?!0:E.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!= -d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a, -f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c), -d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){l=document.createElement("div");l.style.position="absolute"; -l.style.top="95px";l.style.left="250px";l.style.width="2000px";l.style.height="30px";l.style.background="whiteSmoke";document.body.appendChild(l);var B=document.createElement("div");B.style.position="absolute";B.style.top="125px";B.style.left="220px";B.style.width="30px";B.style.height="1000px";B.style.background="whiteSmoke";document.body.appendChild(B);var w=document.createElement("div");w.style.position="absolute";w.style.top="95px";w.style.left="220px";w.style.width="30px";w.style.height="30px"; -w.style.background="whiteSmoke";document.body.appendChild(w);this.vRuler=new mxRuler(this.editor.graph,B,!0);this.hRuler=new mxRuler(this.editor.graph,l,!1)}if("1"==urlParams.test){l=document.getElementById("geFooter");null!=l&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden", -this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),l.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility= -"visible"}else this.styleInput.style.visibility="hidden"})));var J=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:J.apply(this,arguments)}}l=document.getElementById("geInfo");null!=l&&l.parentNode.removeChild(l);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var y=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=y&&(y.parentNode.removeChild(y),y=null),a.stopPropagation(),a.preventDefault())}); -mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==y&&(!mxClient.IS_IE||10<document.documentMode)&&(y=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=y&&(y.parentNode.removeChild(y),y=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale, -f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var h= -a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=h;var p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(h=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(h=c[0].getAttribute("href")));var m=!0,n=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(h,f,g,!0,p,null,m))});p&&h.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;n()},mxEvent.isControlDown(a)): -n()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+k+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(k, -f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");0<c&&(b=this.getPageById(a.substring(c+1)),b=null!=b? -b.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(b=mxResources.get("action"));return b};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");(a=this.getPageById(a.substring(b+1)))&&this.selectPage(a)}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors= -mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()); -this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged", -mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(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.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d, -!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS|| -8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var g=e.lastIndexOf("%3E");0<=g&&g<e.length-3&&(e=e.substring(0,g+3))}catch(C){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(f=!0,e=k)}catch(C){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e, -c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(C){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave", -function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()|| -"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types, -"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)? -(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))}; -EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var f=document.documentElement;d=(e.clientWidth||f.clientWidth)-3;e=Math.max(e.clientHeight||0,f.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;f=document.createElement("div");f.style.zIndex=mxPopupMenu.prototype.zIndex+2;f.style.border="3px dotted rgb(254, 137, 12)";f.style.pointerEvents="none";f.style.position="absolute";f.style.top=b+"px";f.style.left=c+"px";f.style.width= -Math.max(0,d-3)+"px";f.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(f):document.body.appendChild(f);return f};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles= -function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&& -"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(A){this.handleError(A,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx?)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this, -function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()})); -else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop(); -this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a, -b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"), -null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1, -a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=d.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(d.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility= -a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1), -null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&& -this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!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(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,f=mxUtils.bind(this,function(a, -b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&& -(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(L){}return a}if(f.source==(window.opener||window.parent)){var p=f.data;if("json"==urlParams.proto){try{p=JSON.parse(p)}catch(F){p=null}if(null==p)return;if("dialog"==p.action){this.showError(null!=p.titleKey?mxResources.get(p.titleKey):p.title,null!=p.messageKey?mxResources.get(p.messageKey):p.message,null!=p.buttonKey?mxResources.get(p.buttonKey):p.button);null!=p.modified&& -(this.editor.modified=p.modified);return}if("prompt"==p.action){this.spinner.stop();var k=new FilenameDialog(this,p.defaultValue||"",null!=p.okKey?mxResources.get(p.okKey):null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",value:a,message:p}),"*")},null!=p.titleKey?mxResources.get(p.titleKey):p.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==p.action){k=null;k="data:image/png;base64,"==p.xml.substring(0,22)?this.extractGraphModelFromPng(p.xml):h(p.xml); -this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[p.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",message:p}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:p}),"*")}),p.editKey?mxResources.get(p.editKey):null,p.discardKey?mxResources.get(p.discardKey):null,p.ignore?mxUtils.bind(this,function(){this.hideDialog(); -g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:p}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(F){g.postMessage(JSON.stringify({event:"draft",error:F.toString(),message:p}),"*")}return}if("template"==p.action){this.spinner.stop();var k=1==p.enableRecent,m=1==p.enableSearch,k=new NewDialog(this,!1,null!=p.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=p.callback? -g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,k?mxUtils.bind(this,function(a){this.recentReadyCallback=a;g.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;g.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template", -docUrl:a,info:b,name:c}),"*")});this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();return}if("searchDocsList"==p.action)this.searchReadyCallback(p.list,p.errorMsg);else if("recentDocsList"==p.action)this.recentReadyCallback(p.list,p.errorMsg);else{if("status"==p.action){null!=p.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(p.messageKey))):null!=p.message&&this.editor.setStatus(mxUtils.htmlEntities(p.message)); -null!=p.modified&&(this.editor.modified=p.modified);return}if("spinner"==p.action){var l=null!=p.messageKey?mxResources.get(p.messageKey):p.message;null==p.show||p.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==p.action){if("png"==p.format||"xmlpng"==p.format){if(null==p.spin&&null==p.spinKey||this.spinner.spin(document.body,null!=p.spinKey?mxResources.get(p.spinKey):p.spin)){var n=null!=p.xml?p.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph, -t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=p.format;b.message=p;b.data=a;b.xml=encodeURIComponent(n);g.postMessage(JSON.stringify(b),"*")}),v=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==p.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!= -this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),u=q.getGlobalVariable,z=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){v(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){v(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+ -("xmlpng"==p.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):v(null)}),mxUtils.bind(this,function(){v(null)}))}}else{null!=p.xml&&0<p.xml.length&&this.setFileData(p.xml);l=this.createLoadMessage("export");if("html2"==p.format||"html"==p.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),l.xml=mxUtils.getXml(k),l.data= -this.getFileData(null,null,!0,null,null,null,k),l.format=p.format;else if("html"==p.format)n=this.editor.getGraphXml(),l.data=this.getHtml(n,this.editor.graph),l.xml=mxUtils.getXml(n),l.format=p.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);l.xml=this.getFileData(!0);l.format="svg";if(p.embedImages||null==p.embedImages){if(null==p.spin&&null==p.spinKey||this.spinner.spin(document.body,null!=p.spinKey?mxResources.get(p.spinKey):p.spin))this.editor.graph.setEnabled(!1), -"xmlsvg"==p.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(l),"*")}));return}k="xmlsvg"==p.format?this.getEmbeddedSvg(this.getFileData(!0), -this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}g.postMessage(JSON.stringify(l),"*")}return}if("load"==p.action)d=1==p.autosave,this.hideDialog(),null!=p.modified&&null==urlParams.modified&&(urlParams.modified=p.modified),null!=p.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=p.saveAndExit),null!=p.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,p.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight= -"12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),p=null!=p.xmlpng?this.extractGraphModelFromPng(p.xmlpng):null!=p.xml&&"data:image/png;base64,"==p.xml.substring(0,22)?this.extractGraphModelFromPng(p.xml):p.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage", -data:JSON.stringify(p)}),"*");return}}}p=h(p);c=!0;try{a(p,f)}catch(F){this.handleError(F)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var x=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=x();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=x();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d, -"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged", -b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme? -"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"), -mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight= -"20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}), -null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,h="",k="auto",p="auto",m=null,l=null,B=40,w=40,J=0,y=this.editor.graph;y.getGraphBounds();for(var D=function(){null!=b?b(aa):(y.setSelectionCells(aa),y.scrollCellToVisible(y.getSelectionCell()))},H=y.getFreeInsertPoint(),z=H.x,I=H.y,H=I,F=null, -L="auto",M=[],X=null,Z=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var S=a.indexOf(":");if(0<S){var O=mxUtils.trim(a.substring(1,S)),G=mxUtils.trim(a.substring(S+1));"label"==O?F=y.sanitizeHtml(G):"style"==O?f=G:"identity"==O&&0<G.length&&"-"!=G?g=G:"namespace"==O&&0<G.length&&"-"!=G?h=G:"width"==O?k=G:"height"==O?p=G:"left"==O&&0<G.length? -m=G:"top"==O&&0<G.length?l=G:"ignore"==O?Z=G.split(","):"connect"==O?M.push(JSON.parse(G)):"link"==O?X=G:"padding"==O?J=parseFloat(G):"edgespacing"==O?B=parseFloat(G):"nodespacing"==O?w=parseFloat(G):"layout"==O&&(L=G)}}}var W=this.editor.csvToArray(c[N]),S=null;if(null!=g)for(var R=0;R<W.length;R++)if(g==W[R]){S=R;break}null==F&&(F="%"+W[0]+"%");if(null!=M)for(var T=0;T<M.length;T++)null==e[M[T].to]&&(e[M[T].to]={});y.model.beginUpdate();try{for(R=N+1;R<c.length;R++){var V=this.editor.csvToArray(c[R]); -if(V.length==W.length){var K=null,Q=null!=S?h+V[S]:null;null!=Q&&(K=y.model.getCell(Q));null==K&&(K=new mxCell(F,new mxGeometry(z,H,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=Q);for(var P=0;P<V.length;P++)y.setAttributeForCell(K,W[P],V[P]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(T=0;T<M.length;T++)e[M[T].to][K.getAttribute(M[T].to)]=K;null!=X&&"link"!=X&&(y.setLinkForCell(K,K.getAttribute(X)),y.setAttributeForCell(K,X,null));y.fireEvent(new mxEventObject("cellsInserted", -"cells",[K]));var ba=this.editor.graph.getPreferredSizeForCell(K);K.vertex&&(null!=m&&null!=K.getAttribute(m)&&(K.geometry.x=z+parseFloat(K.getAttribute(m))),null!=l&&null!=K.getAttribute(l)&&(K.geometry.y=I+parseFloat(K.getAttribute(l))),"@"==k.charAt(0)&&null!=K.getAttribute(k.substring(1))?K.geometry.width=parseFloat(K.getAttribute(k.substring(1))):K.geometry.width="auto"==k?ba.width+J:parseFloat(k),"@"==p.charAt(0)&&null!=K.getAttribute(p.substring(1))?K.geometry.height=parseFloat(K.getAttribute(p.substring(1))): -K.geometry.height="auto"==p?ba.height+J:parseFloat(p),H+=K.geometry.height+w);d.push(y.addCell(K))}}for(var U=d.slice(),aa=d.slice(),T=0;T<M.length;T++)for(var Y=M[T],R=0;R<d.length;R++){var K=d[R],ia=K.getAttribute(Y.from);if(null!=ia){y.setAttributeForCell(K,Y.from,null);for(var ja=ia.split(","),P=0;P<ja.length;P++){var ca=e[Y.to][ja[P]];null!=ca&&(F=Y.label,null!=Y.fromlabel&&(F=(K.getAttribute(Y.fromlabel)||"")+(F||"")),null!=Y.tolabel&&(F=(F||"")+(ca.getAttribute(Y.tolabel)||"")),aa.push(y.insertEdge(null, -null,F||"",Y.invert?ca:K,Y.invert?K:ca,Y.style||y.createCurrentEdgeStyle())),mxUtils.remove(Y.invert?K:ca,U))}}}if(null!=Z)for(R=0;R<d.length;R++)for(K=d[R],P=0;P<Z.length;P++)y.setAttributeForCell(K,mxUtils.trim(Z[P]),null);var fa=new mxParallelEdgeLayout(y);fa.spacing=B;var ka=function(){fa.execute(y.getDefaultParent());for(var a=0;a<d.length;a++){var b=y.getCellGeometry(d[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==k&&(b.width=Math.round(y.snap(b.width)));"auto"==p&&(b.height= -Math.round(y.snap(b.height)))}};if("circle"==L){var da=new mxCircleLayout(y);da.resetEdges=!1;var la=da.isVertexIgnored;da.isVertexIgnored=function(a){return la.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ka()},!0,D);D=null}else if("horizontaltree"==L||"verticaltree"==L||"auto"==L&&aa.length==2*d.length-1&&1==U.length){y.view.validate();var ga=new mxCompactTreeLayout(y,"horizontaltree"==L);ga.levelDistance=w;ga.edgeRouting=!1;ga.resetEdges= -!1;this.executeLayout(function(){ga.execute(y.getDefaultParent(),0<U.length?U[0]:null)},!0,D);D=null}else if("horizontalflow"==L||"verticalflow"==L||"auto"==L&&1==U.length){y.view.validate();var ha=new mxHierarchicalLayout(y,"horizontalflow"==L?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ha.intraCellSpacing=w;ha.disableEdgeStyle=!1;this.executeLayout(function(){ha.execute(y.getDefaultParent(),aa);y.moveCells(aa,z,I)},!0,D);D=null}else if("organic"==L||"auto"==L&&aa.length>d.length){y.view.validate(); -var ea=new mxFastOrganicLayout(y);ea.forceConstant=3*w;ea.resetEdges=!1;var na=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return na.apply(this,arguments)||0>mxUtils.indexOf(d,a)};fa=new mxParallelEdgeLayout(y);fa.spacing=B;this.executeLayout(function(){ea.execute(y.getDefaultParent());ka()},!0,D);D=null}this.hideDialog()}finally{y.model.endUpdate()}null!=D&&D()}}catch(ma){this.handleError(ma)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&& -null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&& -(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var h=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=h.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a= -this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2* -a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a, -8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= +d.height)),g=Math.round(d.width*e);d=Math.round(d.height*e);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),g,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,a,f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.updateCellSize(e),f.fireEvent(new mxEventObject("textInserted","cells", +[e]))}finally{f.getModel().endUpdate()}f.setSelectionCell(e)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,g);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,c,g);else{f=this.editor.graph;e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,"",f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.fireEvent(new mxEventObject("textInserted","cells",[e])),"<"==a.charAt(0)&& +a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),e.value=a,f.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(e.value)&&f.setLinkForCell(e,e.value),e.geometry.width+=f.gridSize,e.geometry.height+=f.gridSize}finally{f.getModel().endUpdate()}return[e]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1; +do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11|| +0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a, +b){if(null!=b&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(b)){var c=new Blob([a],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(a){this.importXml(a)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(e,arguments);a&&null==this.getCurrentFile()&& +"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,c,d,e,g,h,m,l,p,A){p=null!=p?p:!0;var f=!1,k=null,n=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,h)):b=this.importXml(a,c,d,p);null!=m&&m(b)});"image"==b.substring(0,5)?(l=!1,"image/png"==b.substring(0,9)&&(b=A?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,d,p),l=!0)),l||(k=this.editor.graph,b=a.indexOf(";"), +0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),p&&k.isGridEnabled()&&(c=k.snap(c),d=k.snap(d)),k=[k.insertVertex(null,null,"",c,d,e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,d,p);null!=m&&m(a)})):null!=l&&null!=h&&(/(\.vsdx?)($|\?)/i.test(h)||/(\.vssx)($|\?)/i.test(h))? +(f=!0,this.importVisio(l,n)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,h)?(f=!0,this.parseFile(null!=l?l:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?n(a.responseText):null!=m&&m(null))}),h)):/(\.vsd)($|\?)/i.test(h)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,p));f||null==m||m(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,f,g;c<d;){e= +a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f& +15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,h,m,l,p,A,E){b=null!=b?b:0;c=null!= +c?c:0;d=null!=d?d:this.maxImageSize;p=null!=p?p:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,n=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var t=A||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>t){n=!0;break}var v=mxUtils.bind(this,function(){var n=this.editor.graph,l=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,k,h,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null): +this.importFile(a,b,c,d,e,g,k,h,p,f,E)});g=null!=g?g:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var t=a.length,q=t,v=[],u=mxUtils.bind(this,function(a,b){v[a]=b;if(0==--q){this.spinner.stop();if(null!=m)m(v);else{var c=[];n.getModel().beginUpdate();try{for(var d=0;d<v.length;d++){var e=v[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}g(c)}}),x=0;x<t;x++)mxUtils.bind(this,function(f){var g=a[f],m=new FileReader; +m.onload=mxUtils.bind(this,function(a){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var m=a.target.result,t=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(t+1)))),v=mxUtils.parseXml(q),q=v.getElementsByTagName("svg");if(0<q.length){var q=q[0],z=E?null:q.getAttribute("content");null!=z&&"<"!=z.charAt(0)&&"%"!=z.charAt(0)&&(z=unescape(window.atob?atob(z):Base64.decode(z,!0)));null!=z&&"%"==z.charAt(0)&&(z=decodeURIComponent(z));null==z||"<mxfile "!== +z.substring(0,8)&&"<mxGraphModel "!==z.substring(0,14)?u(f,mxUtils.bind(this,function(){try{if(m.substring(0,t+1),null!=v){var a=v.getElementsByTagName("svg");if(0<a.length){var h=a[0],p=parseFloat(h.getAttribute("width")),A=parseFloat(h.getAttribute("height")),q=h.getAttribute("viewBox");if(null==q||0==q.length)h.setAttribute("viewBox","0 0 "+p+" "+A);else if(isNaN(p)||isNaN(A)){var u=q.split(" ");3<u.length&&(p=parseFloat(u[2]),A=parseFloat(u[3]))}m=this.createSvgDataUri(mxUtils.getXml(h));var z= +Math.min(1,Math.min(d/Math.max(1,p)),d/Math.max(1,A)),x=e(m,g.type,b+f*l,c+f*l,Math.max(1,Math.round(p*z)),Math.max(1,Math.round(A*z)),g.name,k);if(isNaN(p)||isNaN(A)){var E=new Image;E.onload=mxUtils.bind(this,function(){p=Math.max(1,E.width);A=Math.max(1,E.height);x[0].geometry.width=p;x[0].geometry.height=A;h.setAttribute("viewBox","0 0 "+p+" "+A);m=this.createSvgDataUri(mxUtils.getXml(h));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));n.setCellStyles("image",m, +[x[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(h))}return x}}}catch(da){}return null})):u(f,mxUtils.bind(this,function(){return e(z,"text/xml",b+f*l,c+f*l,0,0,g.name)}))}}else{q=!1;if("image/png"==g.type){var x=E?null:this.extractGraphModelFromPng(a.target.result);if(null!=x&&0<x.length){var J=new Image;J.src=a.target.result;u(f,mxUtils.bind(this,function(){return e(x,"text/xml",b+f*l,c+f*l,J.width,J.height,g.name)}));q=!0}}q||(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(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,m,n){u(f,mxUtils.bind(this,function(){if(null!=h&&h.length<p){var t=k&&this.isResampleImage(a.target.result,A)?Math.min(1,Math.min(d/m,d/n)):1;return e(h,g.type,b+f*l,c+f*l,Math.round(m* +t),Math.round(n*t),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,A)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*l,c+f*l,240,160,g.name,function(a){u(f,function(){return a})})});/(\.vsdx?)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?e(null,g.type,b+f*l,c+f*l,240,160,g.name,function(a){u(f,function(){return a})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g): +m.readAsText(g)})(x)});n?this.confirmImageResize(function(a){k=a;v()},l):v()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)}, +function(a){e(a,!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?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange= +function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,g){e=null!=e?e:this.maxImageSize;var f=Math.max(1,a.width),k=Math.max(1,a.height);if(d&&this.isResampleImage(b,g))try{var h=Math.max(f/e,k/e);if(1<h){var p=Math.round(f/h),m=Math.round(k/h),n=document.createElement("canvas");n.width=p;n.height=m;n.getContext("2d").drawImage(a,0,0,p,m);var l=n.toDataURL();if(l.length<b.length){var t= +document.createElement("canvas");t.width=p;t.height=m;var q=t.toDataURL();l!==q&&(b=l,f=p,k=m)}}}catch(y){}c(b,f,k)};EditorUi.prototype.crcTable=[];for(var c=0;256>c;c++)for(var d=c,e=0;8>e;e++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[c]=d;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^b[c+e])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b= +b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=h;h+=b;return a.substring(c,h)}function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var h=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13, +10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,h);do{var p=g(a);if("IDAT"==f(a,4)){e=a.substring(0,h-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=k(c.length)+b+c+k(d^4294967295);e+=a.substring(h-8,a.length);break}e+=a.substring(h-8,h-4+p);f(a,p);f(a,4)}while(p);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng= +function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b|| +"IDAT"==c)return!0}))}catch(u){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var g=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)}; +b.customLinkClicked=function(b){try{a.handleCustomLink(b)}catch(H){a.handleError(H)}};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var c=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var d=0;d<a.pages.length;d++)if(a.pages[d]==a.currentPage){0<d&&(b+=(0<b.length?"&":"?")+"page="+d);break}"1"==urlParams.dev&& +(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return c.apply(this,arguments)};var d=b.addClickHandler;b.addClickHandler=function(a,c,e){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null==c||!b.isCustomLink(c)||!mxEvent.isTouchEvent(a)&&mxEvent.isPopupTrigger(a)||(b.customLinkClicked(c),mxEvent.consume(a));null!=f&&f(a,c)};d.call(this,a,c,e)};g.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement, +null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var e=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:e.apply(this,arguments)};var h=b.createLinkForHint;b.createLinkForHint=function(a,c){null!= +a&&b.isCustomLink(a)&&(c=b.getLinkTitle(a));var d=h.call(this,a,c);null!=a&&b.isCustomLink(a)&&mxEvent.addListener(d,"click",function(c){b.customLinkClicked(a);mxEvent.consume(c)});return d};var m=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var e=c.getAttribute("href");if(null==e||!b.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))m.apply(this,arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(e),b.getRubberband().reset();mxEvent.consume(d)}}; +this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var l=this.actions.get("print");l.setEnabled(!mxClient.IS_IOS||!navigator.standalone);l.visible=l.isEnabled();if(!this.editor.chromeless||this.editor.editable){var C=function(){window.setTimeout(function(){p.innerHTML=" ";p.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0, +"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"=== +c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var k=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(Z){}}),!1);var p=document.createElement("div"); +p.style.position="absolute";p.style.whiteSpace="nowrap";p.style.overflow="hidden";p.style.display="block";p.contentEditable=!0;mxUtils.setOpacity(p,0);p.style.width="1px";p.style.height="1px";p.innerHTML=" ";var A=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()|| +null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||A||(p.style.left=b.container.scrollLeft+10+"px",p.style.top=b.container.scrollTop+10+"px",b.container.appendChild(p),A=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){p.focus();document.execCommand("selectAll",!1,null)},0):(p.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c= +a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!A||224!=c&&17!=c&&91!=c||(A=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),p.parentNode.removeChild(p),mxUtils.clearSelection())}),0)}));mxEvent.addListener(p,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(p),C())}));mxEvent.addListener(p,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(this.copyCells(p,!0),C())}));mxEvent.addListener(p,"paste",mxUtils.bind(this,function(a){b.isEnabled()&& +!b.isCellLocked(b.getDefaultParent())&&(p.innerHTML=" ",p.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,p);p.innerHTML=" "}),0))}),!0);var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==p?!0:E.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED, +mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d), +d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d= +Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain")); +a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){l=document.createElement("div");l.style.position="absolute";l.style.top="95px";l.style.left="250px";l.style.width="2000px";l.style.height="30px";l.style.background="whiteSmoke";document.body.appendChild(l);var B=document.createElement("div");B.style.position="absolute";B.style.top="125px";B.style.left="220px";B.style.width="30px";B.style.height="1000px";B.style.background="whiteSmoke";document.body.appendChild(B); +var w=document.createElement("div");w.style.position="absolute";w.style.top="95px";w.style.left="220px";w.style.width="30px";w.style.height="30px";w.style.background="whiteSmoke";document.body.appendChild(w);this.vRuler=new mxRuler(this.editor.graph,B,!0);this.hRuler=new mxRuler(this.editor.graph,l,!1)}if("1"==urlParams.test){l=document.getElementById("geFooter");null!=l&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute", +this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),l.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c= +this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var J=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:J.apply(this,arguments)}}l=document.getElementById("geInfo");null!=l&&l.parentNode.removeChild(l);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var y=null;mxEvent.addListener(b.container, +"dragleave",function(a){b.isEnabled()&&(null!=y&&(y.parentNode.removeChild(y),y=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==y&&(!mxClient.IS_IE||10<document.documentMode)&&(y=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=y&&(y.parentNode.removeChild(y),y=null);if(b.isEnabled()){var c= +mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale,f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages); +if(null!=c)b.setSelectionCells(this.importXml(c,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var h=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=h;var p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(h=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(h=c[0].getAttribute("href")));var m=!0,n=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(h, +f,g,!0,p,null,m))});p&&h.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;n()},mxEvent.isControlDown(a)):n()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ +k+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(k,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0, +13)){var c=a.indexOf(",");0<c&&(b=this.getPageById(a.substring(c+1)),b=null!=b?b.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(b=mxResources.get("action"));return b};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");(a=this.getPageById(a.substring(b+1)))&&this.selectPage(a)}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage|| +mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle); +mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this, +function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave= +mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(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.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML= +"";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d= +c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var g=e.lastIndexOf("%3E");0<=g&&g<e.length-3&&(e=e.substring(0,g+3))}catch(C){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(f=!0,e= +k)}catch(C){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell())); +try{mxEvent.consume(a)}catch(C){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement()); +a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null== +c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))), +null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP? +"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var f=document.documentElement;d=(e.clientWidth||f.clientWidth)-3;e=Math.max(e.clientHeight||0,f.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;f=document.createElement("div");f.style.zIndex= +mxPopupMenu.prototype.zIndex+2;f.style.border="3px dotted rgb(254, 137, 12)";f.style.pointerEvents="none";f.style.position="absolute";f.style.top=b+"px";f.style.left=c+"px";f.style.width=Math.max(0,d-3)+"px";f.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(f):document.body.appendChild(f);return f};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a= +[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&& +(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(A){this.handleError(A,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx?)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a, +mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&& +(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}else"image/png"== +a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d= +mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c))});null!=a&&0<a.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile= +null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c); +return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=d.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(d.model.getChildAt(a, +f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&& +this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0); +null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!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(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}}; +EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,f=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"== +a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(L){}return a}if(f.source==(window.opener||window.parent)){var p=f.data;if("json"==urlParams.proto){try{p=JSON.parse(p)}catch(F){p=null}if(null==p)return;if("dialog"==p.action){this.showError(null!=p.titleKey?mxResources.get(p.titleKey):p.title,null!=p.messageKey?mxResources.get(p.messageKey): +p.message,null!=p.buttonKey?mxResources.get(p.buttonKey):p.button);null!=p.modified&&(this.editor.modified=p.modified);return}if("prompt"==p.action){this.spinner.stop();var k=new FilenameDialog(this,p.defaultValue||"",null!=p.okKey?mxResources.get(p.okKey):null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",value:a,message:p}),"*")},null!=p.titleKey?mxResources.get(p.titleKey):p.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==p.action){k=null;k="data:image/png;base64,"== +p.xml.substring(0,22)?this.extractGraphModelFromPng(p.xml):h(p.xml);this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[p.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",message:p}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:p}),"*")}),p.editKey?mxResources.get(p.editKey):null,p.discardKey?mxResources.get(p.discardKey): +null,p.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:p}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(F){g.postMessage(JSON.stringify({event:"draft",error:F.toString(),message:p}),"*")}return}if("template"==p.action){this.spinner.stop();var k=1==p.enableRecent,m=1==p.enableSearch,k=new NewDialog(this,!1,null!=p.callback,mxUtils.bind(this, +function(b,c){b=b||this.emptyDiagramXml;null!=p.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,k?mxUtils.bind(this,function(a){this.recentReadyCallback=a;g.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;g.postMessage(JSON.stringify({event:"searchDocs", +searchStr:a}),"*")}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();return}if("searchDocsList"==p.action)this.searchReadyCallback(p.list,p.errorMsg);else if("recentDocsList"==p.action)this.recentReadyCallback(p.list,p.errorMsg);else{if("status"==p.action){null!=p.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(p.messageKey))): +null!=p.message&&this.editor.setStatus(mxUtils.htmlEntities(p.message));null!=p.modified&&(this.editor.modified=p.modified);return}if("spinner"==p.action){var l=null!=p.messageKey?mxResources.get(p.messageKey):p.message;null==p.show||p.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==p.action){if("png"==p.format||"xmlpng"==p.format){if(null==p.spin&&null==p.spinKey||this.spinner.spin(document.body,null!=p.spinKey?mxResources.get(p.spinKey):p.spin)){var n=null!=p.xml? +p.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=p.format;b.message=p;b.data=a;b.xml=encodeURIComponent(n);g.postMessage(JSON.stringify(b),"*")}),v=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==p.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));q!=this.editor.graph&& +q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),u=q.getGlobalVariable,z=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){v(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this, +function(){v(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==p.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):v(null)}),mxUtils.bind(this,function(){v(null)}))}}else{null!=p.xml&&0<p.xml.length&&this.setFileData(p.xml);l=this.createLoadMessage("export");if("html2"==p.format||"html"==p.format&&("0"!= +urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),l.xml=mxUtils.getXml(k),l.data=this.getFileData(null,null,!0,null,null,null,k),l.format=p.format;else if("html"==p.format)n=this.editor.getGraphXml(),l.data=this.getHtml(n,this.editor.graph),l.xml=mxUtils.getXml(n),l.format=p.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);l.xml=this.getFileData(!0);l.format="svg";if(p.embedImages||null==p.embedImages){if(null== +p.spin&&null==p.spinKey||this.spinner.spin(document.body,null!=p.spinKey?mxResources.get(p.spinKey):p.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==p.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data= +this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(l),"*")}));return}k="xmlsvg"==p.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}g.postMessage(JSON.stringify(l),"*")}return}if("load"==p.action)d=1==p.autosave,this.hideDialog(),null!=p.modified&&null==urlParams.modified&&(urlParams.modified=p.modified),null!=p.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=p.saveAndExit), +null!=p.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,p.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),p=null!=p.xmlpng? +this.extractGraphModelFromPng(p.xmlpng):null!=p.xml&&"data:image/png;base64,"==p.xml.substring(0,22)?this.extractGraphModelFromPng(p.xml):p.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(p)}),"*");return}}}p=h(p);c=!0;try{a(p,f)}catch(F){this.handleError(F)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var x=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}); +e=x();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=x();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged", +b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons= +function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b, +"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b, +mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&& +(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,h="",k="auto",p="auto",m=null,l=null,B=40,w=40,J=0,y=this.editor.graph;y.getGraphBounds();for(var D= +function(){null!=b?b(aa):(y.setSelectionCells(aa),y.scrollCellToVisible(y.getSelectionCell()))},H=y.getFreeInsertPoint(),z=H.x,I=H.y,H=I,F=null,L="auto",M=[],X=null,Z=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var S=a.indexOf(":");if(0<S){var O=mxUtils.trim(a.substring(1,S)),G=mxUtils.trim(a.substring(S+1));"label"==O?F=y.sanitizeHtml(G): +"style"==O?f=G:"identity"==O&&0<G.length&&"-"!=G?g=G:"namespace"==O&&0<G.length&&"-"!=G?h=G:"width"==O?k=G:"height"==O?p=G:"left"==O&&0<G.length?m=G:"top"==O&&0<G.length?l=G:"ignore"==O?Z=G.split(","):"connect"==O?M.push(JSON.parse(G)):"link"==O?X=G:"padding"==O?J=parseFloat(G):"edgespacing"==O?B=parseFloat(G):"nodespacing"==O?w=parseFloat(G):"layout"==O&&(L=G)}}}var W=this.editor.csvToArray(c[N]),S=null;if(null!=g)for(var R=0;R<W.length;R++)if(g==W[R]){S=R;break}null==F&&(F="%"+W[0]+"%");if(null!= +M)for(var T=0;T<M.length;T++)null==e[M[T].to]&&(e[M[T].to]={});y.model.beginUpdate();try{for(R=N+1;R<c.length;R++){var V=this.editor.csvToArray(c[R]);if(V.length==W.length){var K=null,Q=null!=S?h+V[S]:null;null!=Q&&(K=y.model.getCell(Q));null==K&&(K=new mxCell(F,new mxGeometry(z,H,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=Q);for(var P=0;P<V.length;P++)y.setAttributeForCell(K,W[P],V[P]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(T=0;T<M.length;T++)e[M[T].to][K.getAttribute(M[T].to)]= +K;null!=X&&"link"!=X&&(y.setLinkForCell(K,K.getAttribute(X)),y.setAttributeForCell(K,X,null));y.fireEvent(new mxEventObject("cellsInserted","cells",[K]));var ba=this.editor.graph.getPreferredSizeForCell(K);K.vertex&&(null!=m&&null!=K.getAttribute(m)&&(K.geometry.x=z+parseFloat(K.getAttribute(m))),null!=l&&null!=K.getAttribute(l)&&(K.geometry.y=I+parseFloat(K.getAttribute(l))),"@"==k.charAt(0)&&null!=K.getAttribute(k.substring(1))?K.geometry.width=parseFloat(K.getAttribute(k.substring(1))):K.geometry.width= +"auto"==k?ba.width+J:parseFloat(k),"@"==p.charAt(0)&&null!=K.getAttribute(p.substring(1))?K.geometry.height=parseFloat(K.getAttribute(p.substring(1))):K.geometry.height="auto"==p?ba.height+J:parseFloat(p),H+=K.geometry.height+w);d.push(y.addCell(K))}}for(var U=d.slice(),aa=d.slice(),T=0;T<M.length;T++)for(var Y=M[T],R=0;R<d.length;R++){var K=d[R],ia=K.getAttribute(Y.from);if(null!=ia){y.setAttributeForCell(K,Y.from,null);for(var ja=ia.split(","),P=0;P<ja.length;P++){var ca=e[Y.to][ja[P]];null!=ca&& +(F=Y.label,null!=Y.fromlabel&&(F=(K.getAttribute(Y.fromlabel)||"")+(F||"")),null!=Y.tolabel&&(F=(F||"")+(ca.getAttribute(Y.tolabel)||"")),aa.push(y.insertEdge(null,null,F||"",Y.invert?ca:K,Y.invert?K:ca,Y.style||y.createCurrentEdgeStyle())),mxUtils.remove(Y.invert?K:ca,U))}}}if(null!=Z)for(R=0;R<d.length;R++)for(K=d[R],P=0;P<Z.length;P++)y.setAttributeForCell(K,mxUtils.trim(Z[P]),null);var fa=new mxParallelEdgeLayout(y);fa.spacing=B;var ka=function(){fa.execute(y.getDefaultParent());for(var a=0;a< +d.length;a++){var b=y.getCellGeometry(d[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==k&&(b.width=Math.round(y.snap(b.width)));"auto"==p&&(b.height=Math.round(y.snap(b.height)))}};if("circle"==L){var da=new mxCircleLayout(y);da.resetEdges=!1;var la=da.isVertexIgnored;da.isVertexIgnored=function(a){return la.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ka()},!0,D);D=null}else if("horizontaltree"==L||"verticaltree"== +L||"auto"==L&&aa.length==2*d.length-1&&1==U.length){y.view.validate();var ga=new mxCompactTreeLayout(y,"horizontaltree"==L);ga.levelDistance=w;ga.edgeRouting=!1;ga.resetEdges=!1;this.executeLayout(function(){ga.execute(y.getDefaultParent(),0<U.length?U[0]:null)},!0,D);D=null}else if("horizontalflow"==L||"verticalflow"==L||"auto"==L&&1==U.length){y.view.validate();var ha=new mxHierarchicalLayout(y,"horizontalflow"==L?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ha.intraCellSpacing=w;ha.disableEdgeStyle= +!1;this.executeLayout(function(){ha.execute(y.getDefaultParent(),aa);y.moveCells(aa,z,I)},!0,D);D=null}else if("organic"==L||"auto"==L&&aa.length>d.length){y.view.validate();var ea=new mxFastOrganicLayout(y);ea.forceConstant=3*w;ea.resetEdges=!1;var na=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return na.apply(this,arguments)||0>mxUtils.indexOf(d,a)};fa=new mxParallelEdgeLayout(y);fa.spacing=B;this.executeLayout(function(){ea.execute(y.getDefaultParent());ka()},!0,D);D=null}this.hideDialog()}finally{y.model.endUpdate()}null!= +D&&D()}}catch(ma){this.handleError(ma)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "), +d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var h=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=h.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&& +null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width* +b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/ +a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient|| c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled(); this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(c);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(c), @@ -7512,7 +7513,7 @@ this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").set this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility); this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.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(a,b,c,d,e,g){var f=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(f.getSvg(d,e,g)),"image/svg+xml");else{var h=a.getFileData(!0,null,null,null, -null,!0),k=f.getGraphBounds(),p=Math.floor(k.width*e/f.view.scale),m=Math.floor(k.height*e/f.view.scale);h.length<=MAX_REQUEST_SIZE&&p*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+p+"&h="+m+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor}, +null,!0),m=f.getGraphBounds(),p=Math.floor(m.width*e/f.view.scale),k=Math.floor(m.height*e/f.view.scale);h.length<=MAX_REQUEST_SIZE&&p*k<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+p+"&h="+k+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor}, setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries= a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins= a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle}, @@ -7907,14 +7908,14 @@ mxResources.get("close"));a.innerHTML=mxResources.get("close");b.appendChild(a); App.prototype.start=function(){this.bg.parentNode.removeChild(this.bg);this.restoreLibraries();this.spinner.stop();try{if("1"!=urlParams.client&&"1"!=urlParams.embed&&mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(a){try{var b=this.getDiagramId(),c=this.getCurrentFile();null!=c&&c.getHash()==b||this.loadFile(b,!0)}catch(m){null!=document.body&&this.handleError(m,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!= a?a.getHash():""}))}})),(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var a=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var a=mxUtils.bind(this,function(a){"data:image/png;base64,"==a.substring(0,22)&&(a=this.extractGraphModelFromPng(a));var b=urlParams.title,b=null!=b?decodeURIComponent(b): this.defaultFilename;a=new LocalFile(this,a,b,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(a.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(a);this.getCurrentFile().setModified(!this.editor.chromeless)}),b=window.opener||window.parent;if(b!=window){var c=urlParams.create;null!=c?a(b[decodeURIComponent(c)]):(c=urlParams.data,null!=c?a(decodeURIComponent(c)):this.installMessageHandler(mxUtils.bind(this,function(c,d){d.source==b&&a(c)})))}}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){}if(c)this.spinner.spin(document.body,mxResources.get("loading"));else if(c=this.getDiagramId(),"0"!=urlParams.splash||null!=c&&0!=c.length)this.loadFile(this.getDiagramId());else{var d=this.getDraft(),l=null!=d?d.data:this.getFileData(),c=Editor.useLocalStorage;this.createFile(this.defaultFilename, -l,null,null,null,null,null,!0);Editor.useLocalStorage=c;null!=d&&(c=this.getCurrentFile(),null!=c&&c.addUnsavedStatus())}}});null!=this.drive&&this.defineCustomObjects();var b=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=b&&0<b.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var c=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create", -"title"]))}),d=mxUtils.bind(this,function(a){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,a,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var b=urlParams.title,b=null!=b?decodeURIComponent(b):this.defaultFilename;a=this.getServiceCount(!0);var c=4>=a?4:3,b=new CreateDialog(this,b,mxUtils.bind(this,function(a,b){if(null==b){this.hideDialog();var c=Editor.useLocalStorage;this.createFile(0<a.length?a:this.defaultFilename,this.getFileData(),null, -null,null,null,null,!0);Editor.useLocalStorage=c}else this.createFile(a,this.getFileData(!0),null,b)}),null,null,null,null,"1"==urlParams.browser,null,null,!0,c);this.showDialog(b.container,380,a>c?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),b=decodeURIComponent(b);if("http://"!=b.substring(0,7)&&"https://"!=b.substring(0,8))try{null!=window.opener&&null!=window.opener[b]?d(window.opener[b]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(e){this.handleError(e, -mxResources.get("errorLoadingFile"))}else this.loadTemplate(b,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),c)}))}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.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? -(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):a()}}catch(e){this.handleError(e)}}; +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){}if(c)this.spinner.spin(document.body,mxResources.get("loading"));else if(c=this.getDiagramId(),"0"!=urlParams.splash||null!=c&&0!=c.length)this.loadFile(c);else if(!mxClient.IS_CHROMEAPP){var d=this.getDraft(),l=null!=d?d.data:this.getFileData(),c=Editor.useLocalStorage; +this.createFile(this.defaultFilename,l,null,null,null,null,null,!0);Editor.useLocalStorage=c;null!=d&&(c=this.getCurrentFile(),null!=c&&c.addUnsavedStatus())}}});null!=this.drive&&this.defineCustomObjects();var b=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=b&&0<b.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var c=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&& +(window.location.search=this.getSearch(["create","title"]))}),d=mxUtils.bind(this,function(a){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,a,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var b=urlParams.title,b=null!=b?decodeURIComponent(b):this.defaultFilename;a=this.getServiceCount(!0);var c=4>=a?4:3,b=new CreateDialog(this,b,mxUtils.bind(this,function(a,b){if(null==b){this.hideDialog();var c=Editor.useLocalStorage;this.createFile(0<a.length? +a:this.defaultFilename,this.getFileData(),null,null,null,null,null,!0);Editor.useLocalStorage=c}else this.createFile(a,this.getFileData(!0),null,b)}),null,null,null,null,"1"==urlParams.browser,null,null,!0,c);this.showDialog(b.container,380,a>c?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),b=decodeURIComponent(b);if("http://"!=b.substring(0,7)&&"https://"!=b.substring(0,8))try{null!=window.opener&&null!=window.opener[b]?d(window.opener[b]): +this.handleError(null,mxResources.get("errorLoadingFile"))}catch(e){this.handleError(e,mxResources.get("errorLoadingFile"))}else this.loadTemplate(b,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),c)}))}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.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?(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):a()}}catch(e){this.handleError(e)}}; App.prototype.showSplash=function(a){var b=this.getServiceCount(!0,!0),c=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,2>b||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,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(null==this.mode||a){a=4==b?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();c()}),a);this.showDialog(d.container,3>a?260:300,4<=b?420:300,!0,!1);d.init()}else null==urlParams.create&&c()}; +mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&c();else{a=4==b?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();c()}),a);this.showDialog(d.container,3>a?260:300,4<=b?420:300,!0,!1);d.init()}}; App.prototype.addLanguageMenu=function(a,b){var c=null;if((!this.isOfflineApp()||mxClient.IS_CHROMEAPP)&&null!=this.menus.get("language")){c=document.createElement("div");c.setAttribute("title",mxResources.get("language"));c.className="geIcon geSprite geSprite-globe";c.style.position="absolute";c.style.cursor="pointer";c.style.bottom="20px";c.style.right="20px";if(b){c.style.direction="rtl";c.style.textAlign="right";c.style.right="24px";var d=document.createElement("span");d.style.display="inline-block"; d.style.fontSize="12px";d.style.margin="5px 24px 0 0";d.style.color="gray";mxUtils.write(d,mxResources.get("language"));c.appendChild(d)}mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(this.menus.get("language").funct);b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var d=mxUtils.getOffset(c); b.popup(d.x,d.y+c.offsetHeight,null,a);this.setCurrentMenu(b)}));a.appendChild(c)}return c}; @@ -8027,84 +8028,84 @@ DriveFile&&b.constructor!=DropboxFile||null==a.drive&&b.constructor==DriveFile|| fileSize:c.size,getXml:function(d,e){a.dropbox.readFile({path:b.stat.path_lower,rev:c.rev},d,e)},getUrl:function(){return a.getUrl(window.location.pathname+"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var f=new RevisionDialog(a,d);a.showDialog(f.container,640,480,!0,!0);f.init()}catch(y){a.handleError(y)}}));c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop(); for(var d=0;d<c.items.length;d++)(function(d){d.getXml=function(e,f){a.drive.executeRequest(gapi.client.drive.revisions.get({fileId:b.getId(),revisionId:c.items[c.items.length-1]===d?b.desc.headRevisionId:d.id}),function(b){a.drive.getXmlFile(b,null,function(a){e(a.getData())},function(a){f(a)})},function(a){f(a)})};d.getUrl=function(){return a.getUrl(window.location.pathname+"?rev="+d.id+"&chrome=0&edit=_blank")+window.location.hash}})(c.items[d]);d=new RevisionDialog(a,c.items);a.showDialog(d.container, 640,480,!0,!0);d.init()},function(b){a.spinner.stop();a.handleError(b)})});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");a.actions.addAction("upload...",function(){var b=a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,a.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b)))}); -if("undefined"!==typeof MathJax){var k=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();c.model.execute(b)});k.setToggleAction(!0);k.setSelectedCallback(function(){return a.isMathEnabled()});k.isEnabled=g}isLocalStorage&&(k=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),k.setToggleAction(!0),k.setSelectedCallback(function(){return mxSettings.getShowStartScreen()})); -var n=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});n.setToggleAction(!0);n.setSelectedCallback(function(){return n.isEnabled()&&a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=c.getSelectionCells(),d=[],e=0;e<b.length;e++)c.getModel().isVertex(b[e])&&d.push(b[e]);0<d.length&&(b=new EditGeometryDialog(a,d),a.showDialog(b.container,180,180,!0,!0),b.init())},null,null,Editor.ctrlKey+"+Shift+M");var t="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize startStill startArrow startSize arcSize".split(" "); -a.actions.addAction("copyStyle",function(){var b=c.view.getState(c.getSelectionCell());if(c.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=c.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],d=0;d<b.length;d++){var e=b[d],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f),e=e.substring(f+1);null==a.copiedStyle[g]&&"none"==e&&(a.copiedStyle[g]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(c.isEnabled()&&!c.isSelectionEmpty()&& -null!=a.copiedStyle){c.getModel().beginUpdate();try{for(var b=c.getSelectionCells(),d=0;d<b.length;d++)for(var e=c.view.getState(b[d]),f=0;f<t.length;f++){var g=t[f],h=a.copiedStyle[g];e.style[g]!=h&&c.setCellStyles(g,h,[b[d]])}}finally{c.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container, -320,170,!0,!0);b.init()}}));a.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,h,!k,m)}),!0,!1,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this, -function(b,c,d){a.downloadFile(c?"xmlpng":"png",null,null,b,null,null,d)}))}));a.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,e,!1,h,!k,!1,"jpeg")}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone|| -a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(b,c){a.downloadFile("jpeg",null,null,b)}),!0)}));k=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){c.setShadowVisible(!c.shadowVisible)}));k.setToggleAction(!0);k.setSelectedCallback(function(){return c.shadowVisible});var u=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){u||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){u=!1}), -u=!0)},null,null,"F1"));a.actions.addAction("userManual...",function(){a.openLink("https://support.draw.io/display/DO/Draw.io+Online+User+Manual")});a.actions.addAction("support...",function(){a.openLink("https://about.draw.io/support/")});a.actions.addAction("exportOptionsDisabled...",function(){a.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});a.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp? -a.openLink("https://www.draw.io/shortcuts.svg"):mxClient.IS_SVG?a.openLink("shortcuts.svg"):a.openLink("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")});a.actions.addAction("feedback...",function(){var b=new FeedbackDialog(a);a.showDialog(b.container,610,360,!0,!0);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});k=a.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow= -new TagsWindow(a,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));k.setToggleAction(!0);k.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&& -this.tagsWindow.window.isVisible()}));k=a.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(a,document.body.offsetWidth-300,110,240,140),this.findWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())})); -k.setToggleAction(!0);k.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){a.exportVisio()}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",new Menu(mxUtils.bind(this,function(b,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=b.addItem(e, -null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var q=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=q.apply(this,arguments);if(null!= -b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,d){if(!mxClient.IS_CHROMEAPP&& -a.isOffline())this.addMenuItems(b,["about"],d);else{var e=b.addItem("Search:",null,null,d,null,null,!1);e.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";e.style.cursor="default";var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","25");f.style.marginLeft="8px";mxEvent.addListener(f,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(f.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+ -encodeURIComponent(b)),f.value="",this.editorUi.logEvent({category:"Help",action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&&(f.value="")}));e.firstChild.nextSibling.appendChild(f);mxEvent.addGestureListeners(f,function(a){document.activeElement!=f&&f.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){f.focus()},0);this.addMenuItems(b, -["-","quickStart","userManual","keyboardShortcuts","-"],d);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],d);this.addMenuItems(b,["support","-"],d);a.isOffline()||EditorUi.isElectronApp||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["download"],d);navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["offline"],d);this.addMenuItems(b,["-","about"],d)}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch", -mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})), -mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],d));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this, -function(){var a=c.getGraphBounds(),b=c.view.translate,e=c.view.scale;c.insertVertex(d,null,"",a.x/e-b.x,a.y/e-b.y,a.width/e,a.height/e,"fillColor=none;strokeColor=red;")})),mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){c.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+c.compress(mxUtils.getXml(c.encodeCells(c.getSelectionCells())))+"', width, height, 'Title');"))})), -this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],d),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=c.getGraphBounds(),d=c.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-b.x)/d),Math.floor((1-b.y)/d));e.scale(1/d);var g=0,h=e.save;e.save=function(){g++;h.apply(this,arguments)};var k= -e.restore;e.restore=function(){g--;k.apply(this,arguments)};var p=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);p.apply(this,arguments);mxLog.debug("leaving shape",a,g)};a.drawState(c.getView().getState(c.model.root),e);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),this.addMenuItems(b,["testXmlImageExport"],d),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"), -this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed),console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel", -mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&a.spinner.spin(document.body,mxResources.get("export"))&&(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&& -299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel","testDownloadRtModel"],d),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-", -"testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(c.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a, -b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,g,h,k,p,m){a.createHtml(b,c,d,e,f,g,h,k,p,m,mxUtils.bind(this,function(b,c){var d= -new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft= -"26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f,a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)}, -20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a,EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+ -"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f, -g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=c.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"), -null,"100%",Math.ceil((b.y+b.height-c.view.translate.y)/c.view.scale)+2,function(b,c,d,e,f,g,h,k){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(p){a.spinner.stop();p=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+h+";height:"+k+';" src="'+a.createLink(b,c,d,e,f,g,p)+'"></iframe>');a.showDialog(p.container,440,240,!0,!0);p.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null, -null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(h){a.spinner.stop();h=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,h));a.showDialog(h.container,440,240,!0,!0);h.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop(); -b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)k=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),k.setToggleAction(!0),k.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,170,!0,!1)});k=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&& -(mxSettings.settings.search=!b,mxSettings.save())});k.setToggleAction(!0);k.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){c.isEditing()&&c.stopEditing();var d="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var e=a.createLoadMessage("save");e.xml=d;b&&(e.exit=!0);d=JSON.stringify(e)}(window.opener||window.parent).postMessage(d, -"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"), -null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone|| -this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(b, -d){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=k(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");g(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var g=mxUtils.bind(this,function(b,d,e){var f=c.view,g=c.getGraphBounds(),h=c.snap(Math.ceil(Math.max(0, -g.x/f.scale-f.translate.x)+4*c.gridSize)),k=c.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*c.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,m=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,m,l){f=g?Math.min(1,Math.min(a.maxImageSize/m,a.maxImageSize/l)):1;a.importFile(b,d,h,k,Math.round(m*f),Math.round(l*f),e,function(b){a.spinner.stop();c.setSelectionCells(b);c.scrollCellToVisible(c.getSelectionCell())})}), -g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;m()}):m()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,d,h,k,0,0,e,function(b){a.spinner.stop();c.setSelectionCells(b);c.scrollCellToVisible(c.getSelectionCell())})}),k=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!= -typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},d):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},d):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){}, -d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},d):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},d):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+ -"...",null,function(){a.importLocalFile(!1)},d);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},d);a.isOffline()||(b.addSeparator(d),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){g(a, -c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})).isEnabled=g;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&"min"!=uiTheme&&b.addCheckmark(d,Editor.checkmarkImage); -d=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save(); -a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));k=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&& -b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));k.isEnabled=function(){return this.enabled&& -g.apply(this,arguments)};k.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body, -mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"), -null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))})); -this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())})); -this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var v=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml)&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b= -new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},x=function(a,b,d,e){var f=c.isMouseInsertPoint()?c.getInsertPoint():c.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,d),e);a.vertex=!0;c.getModel().beginUpdate();try{a=c.addCell(a),c.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{c.getModel().endUpdate()}c.scrollCellToVisible(a); -c.setSelectionCell(a);c.container.focus();c.editAfterInsert&&c.startEditing(a);return a};a.actions.addAction("insertText",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&c.startEditingAtCell(x("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=g;a.actions.addAction("insertRectangle",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&& -x("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=g;a.actions.addAction("insertEllipse",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=g;a.actions.addAction("insertRhombus",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=g;var C=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"== -c[d]?a.addSeparator(b):v(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);C(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this, -function(a,b){C(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()}, -c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+ -" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c); -isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP? -"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+ -" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+ -"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+ -"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)})),this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+ -"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+ -" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)}, -c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(y){a.handleError(y,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(), -a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view", -new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&& -(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!= -urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage&&(d=this.addMenuItem(b,"plugins",c),a.isOffline()||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430"));b.addSeparator(c);d=this.addMenuItem(b,"tags",c);a.isOffline()&&!mxClient.IS_CHROMEAPP|| -this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966")})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b, -["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile? -this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary", -b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var c=Menus.prototype.menuCreated;Menus.prototype.menuCreated=function(a,b){if(480>=screen.width&&a==this.get("help")){b.style.paddingRight= -"0px";b.style.paddingLeft="0px";b.innerHTML="";var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);b.appendChild(d)}c.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; +if("undefined"!==typeof MathJax){var k=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();c.model.execute(b)});k.setToggleAction(!0);k.setSelectedCallback(function(){return a.isMathEnabled()});k.isEnabled=g}if(isLocalStorage||mxClient.IS_CHROMEAPP)k=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),k.setToggleAction(!0), +k.setSelectedCallback(function(){return mxSettings.getShowStartScreen()});var n=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});n.setToggleAction(!0);n.setSelectedCallback(function(){return n.isEnabled()&&a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=c.getSelectionCells(),d=[],e=0;e<b.length;e++)c.getModel().isVertex(b[e])&&d.push(b[e]);0<d.length&&(b=new EditGeometryDialog(a,d),a.showDialog(b.container,180,180,!0,!0),b.init())}, +null,null,Editor.ctrlKey+"+Shift+M");var t="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize startStill startArrow startSize arcSize".split(" ");a.actions.addAction("copyStyle",function(){var b=c.view.getState(c.getSelectionCell()); +if(c.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=c.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],d=0;d<b.length;d++){var e=b[d],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f),e=e.substring(f+1);null==a.copiedStyle[g]&&"none"==e&&(a.copiedStyle[g]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(c.isEnabled()&&!c.isSelectionEmpty()&&null!=a.copiedStyle){c.getModel().beginUpdate();try{for(var b=c.getSelectionCells(),d= +0;d<b.length;d++)for(var e=c.view.getState(b[d]),f=0;f<t.length;f++){var g=t[f],h=a.copiedStyle[g];e.style[g]!=h&&c.setCellStyles(g,h,[b[d]])}}finally{c.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container,320,170,!0,!0);b.init()}}));a.actions.put("exportPng",new Action(mxResources.get("formatPng")+ +"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,h,!k,m)}),!0,!1,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(b,c,d){a.downloadFile(c?"xmlpng":"png",null,null,b,null,null,d)}))}));a.actions.put("exportJpg", +new Action(mxResources.get("formatJpg")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,e,!1,h,!k,!1,"jpeg")}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(b,c){a.downloadFile("jpeg", +null,null,b)}),!0)}));k=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){c.setShadowVisible(!c.shadowVisible)}));k.setToggleAction(!0);k.setSelectedCallback(function(){return c.shadowVisible});var u=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){u||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){u=!1}),u=!0)},null,null,"F1"));a.actions.addAction("userManual...",function(){a.openLink("https://support.draw.io/display/DO/Draw.io+Online+User+Manual")}); +a.actions.addAction("support...",function(){a.openLink("https://about.draw.io/support/")});a.actions.addAction("exportOptionsDisabled...",function(){a.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});a.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?a.openLink("https://www.draw.io/shortcuts.svg"):mxClient.IS_SVG?a.openLink("shortcuts.svg"):a.openLink("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")}); +a.actions.addAction("feedback...",function(){var b=new FeedbackDialog(a);a.showDialog(b.container,610,360,!0,!0);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});k=a.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(a,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide", +function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));k.setToggleAction(!0);k.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));k=a.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(a,document.body.offsetWidth-300,110,240,140), +this.findWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));k.setToggleAction(!0);k.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx", +new Action(mxResources.get("formatVsdx")+" (beta)...",function(){a.exportVisio()}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",new Menu(mxUtils.bind(this,function(b,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=b.addItem(e,null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}), +c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var q=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=q.apply(this,arguments);if(null!=b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>', +c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,d){if(!mxClient.IS_CHROMEAPP&&a.isOffline())this.addMenuItems(b,["about"],d);else{var e=b.addItem("Search:",null,null,d,null,null,!1);e.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";e.style.cursor="default";var f=document.createElement("input"); +f.setAttribute("type","text");f.setAttribute("size","25");f.style.marginLeft="8px";mxEvent.addListener(f,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(f.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+encodeURIComponent(b)),f.value="",this.editorUi.logEvent({category:"Help",action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&& +(f.value="")}));e.firstChild.nextSibling.appendChild(f);mxEvent.addGestureListeners(f,function(a){document.activeElement!=f&&f.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){f.focus()},0);this.addMenuItems(b,["-","quickStart","userManual","keyboardShortcuts","-"],d);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],d);this.addMenuItems(b,["support","-"],d);a.isOffline()||EditorUi.isElectronApp||navigator.standalone|| +"1"==urlParams.embed||this.addMenuItems(b,["download"],d);navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["offline"],d);this.addMenuItems(b,["-","about"],d)}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})), +mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS); +this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],d));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=c.getGraphBounds(),b=c.view.translate,e=c.view.scale;c.insertVertex(d,null,"",a.x/e-b.x,a.y/e-b.y,a.width/e,a.height/e,"fillColor=none;strokeColor=red;")})),mxResources.parse("createSidebarEntry=Create sidebar entry"), +this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){c.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+c.compress(mxUtils.getXml(c.encodeCells(c.getSelectionCells())))+"', width, height, 'Title');"))})),this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],d),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=c.getGraphBounds(), +d=c.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-b.x)/d),Math.floor((1-b.y)/d));e.scale(1/d);var g=0,h=e.save;e.save=function(){g++;h.apply(this,arguments)};var p=e.restore;e.restore=function(){g--;p.apply(this,arguments)};var k=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);k.apply(this,arguments);mxLog.debug("leaving shape",a,g)};a.drawState(c.getView().getState(c.model.root),e);mxLog.show(); +mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),this.addMenuItems(b,["testXmlImageExport"],d),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed), +console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&a.spinner.spin(document.body,mxResources.get("export"))&&(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+ +b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel", +"testDownloadRtModel"],d),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-","testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a, +!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(c.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(), +function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,g,h,k,p,m){a.createHtml(b,c,d,e,f,g,h,k,p,m,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>'); +d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft="26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f, +a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)},20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a, +EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})}, +mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")})); +a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=c.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-c.view.translate.y)/c.view.scale)+2,function(b,c,d,e,f,g,h,k){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(p){a.spinner.stop();p=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+h+";height:"+k+';" src="'+a.createLink(b,c,d,e,f,g,p)+'"></iframe>'); +a.showDialog(p.container,440,240,!0,!0);p.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(h){a.spinner.stop();h=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,h));a.showDialog(h.container,440,240,!0,!0);h.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")}); +a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)k=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),k.setToggleAction(!0),k.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container, +360,170,!0,!1)});k=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});k.setToggleAction(!0);k.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){c.isEditing()&&c.stopEditing();var d="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml()); +if("json"==urlParams.proto){var e=a.createLoadMessage("save");e.xml=d;b&&(e.exit=!0);d=JSON.stringify(e)}(window.opener||window.parent).postMessage(d,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit", +modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b, +["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")}))); +this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(b,d){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=k(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");g(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"): +null)},b==a.drive)},!0)}var g=mxUtils.bind(this,function(b,d,e){var f=c.view,g=c.getGraphBounds(),h=c.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*c.gridSize)),k=c.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*c.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,m=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,m,l){f=g?Math.min(1,Math.min(a.maxImageSize/m,a.maxImageSize/l)):1;a.importFile(b,d, +h,k,Math.round(m*f),Math.round(l*f),e,function(b){a.spinner.stop();c.setSelectionCells(b);c.scrollCellToVisible(c.getSelectionCell())})}),g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;m()}):m()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,d,h,k,0,0,e,function(b){a.spinner.stop();c.setSelectionCells(b);c.scrollCellToVisible(c.getSelectionCell())})}),k=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)? +b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},d):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+ +"...",null,function(){e(a.dropbox)},d):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},d):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},d):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+ +"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.importLocalFile(!1)},d);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},d);a.isOffline()||(b.addSeparator(d),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c= +/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){g(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})).isEnabled=g;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))}, +c);"atlas"!=uiTheme&&"dark"!=uiTheme&&"min"!=uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage); +d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));k=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!= +a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok")); +return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));k.isEnabled=function(){return this.enabled&&g.apply(this,arguments)};k.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this, +function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0), +null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&& +b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this, +function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var v=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&& +!a.isOffline())&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},x=function(a,b,d,e){var f=c.isMouseInsertPoint()?c.getInsertPoint():c.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,d),e);a.vertex=!0;c.getModel().beginUpdate();try{a=c.addCell(a), +c.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{c.getModel().endUpdate()}c.scrollCellToVisible(a);c.setSelectionCell(a);c.container.focus();c.editAfterInsert&&c.startEditing(a);return a};a.actions.addAction("insertText",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&c.startEditingAtCell(x("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled= +g;a.actions.addAction("insertRectangle",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&x("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=g;a.actions.addAction("insertEllipse",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=g;a.actions.addAction("insertRhombus",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled= +g;var C=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):v(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);C(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null, +function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){C(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]); +b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+ +"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+ +" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&& +(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...", +null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+ +" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+ +"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)})),this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+ +"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!= +a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+ +"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<= +c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(y){a.handleError(y,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))}))); +this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c); +mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d, +"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage&&(d=this.addMenuItem(b,"plugins",c),a.isOffline()||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430"));b.addSeparator(c); +d=this.addMenuItem(b,"tags",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966")})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "), +c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent", +b,c);null!=d&&d.constructor==DriveFile?this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish", +b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var c=Menus.prototype.menuCreated;Menus.prototype.menuCreated=function(a, +b){if(480>=screen.width&&a==this.get("help")){b.style.paddingRight="0px";b.style.paddingLeft="0px";b.innerHTML="";var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);b.appendChild(d)}c.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,c){this.ui=a;this.page=b;this.previous=this.name=c}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; function MovePage(a,b,c){this.ui=a;this.oldIndex=b;this.newIndex=c}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))} @@ -8225,12 +8226,12 @@ EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a mxResources.get("text");c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("insertRectangle").label=mxResources.get("rectangle");c.actions.get("insertEllipse").label=mxResources.get("ellipse");c.actions.get("insertRhombus").label=mxResources.get("rhombus");c.actions.get("insertImage").label=mxResources.get("image")+"...";c.actions.get("insertLink").label=mxResources.get("link")+"...";c.actions.get("createShape").label=mxResources.get("shape")+"...";c.actions.get("outline").label= mxResources.get("outline")+"...";c.actions.get("layers").label=mxResources.get("layers")+"...";c.actions.put("importFile",new Action("File...",function(){d.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",function(){null!=a.files&&c.importFiles(a.files,null,null,c.maxImageSize)});a.click()}));c.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();c.showImportCsvDialog()})); c.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(c,"Insert from Text");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(c,"Insert from Text","formatSql");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){b(c)}));c.actions.put("toggleFormat",new Action(mxResources.get("format")+ -"...",function(){a(c)}));EditorUi.enablePlantUml&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,b){c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,"new open - save saveAs -".split(" "),b):"1"==urlParams.embed? -(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,["saveAndExit"],b),a.addSeparator(b)):(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile&&(c.menus.addMenuItems(a,["-","share"],b),null!=d.realtime&&c.menus.addMenuItems(a,["chatWindowTitle"],b),a.addSeparator(b));c.menus.addMenuItems(a,["-","outline", -"layers","-","find"],b);d=this.addMenuItem(a,"tags",b);c.isOffline()&&!mxClient.IS_CHROMEAPP||c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(b);mxClient.IS_IOS&&navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,b){f.apply(this, -arguments);a.addSeparator(b);c.menus.addSubmenu("openRecent",a,b)}}this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],b):c.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],b);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||c.menus.addMenuItems(a,["-","revisionHistory"],b);c.menus.addMenuItems(a,["-","autosave"],b)})));var g= -this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){g.funct(a,b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=h&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips","pageScale"], -b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);if(!c.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(b);var d=c.menus.addMenuItem(a,"plugins",b);c.isOffline()||c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText createShape plantUml - importCsv formatSql editDiagram".split(" "), +"...",function(){a(c)}));EditorUi.enablePlantUml&&!c.isOffline()&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,b){c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,"new open - save saveAs -".split(" "), +b):"1"==urlParams.embed?(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,["saveAndExit"],b),a.addSeparator(b)):(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile&&(c.menus.addMenuItems(a,["-","share"],b),null!=d.realtime&&c.menus.addMenuItems(a,["chatWindowTitle"],b),a.addSeparator(b));c.menus.addMenuItems(a, +["-","outline","layers","-","find"],b);d=this.addMenuItem(a,"tags",b);c.isOffline()&&!mxClient.IS_CHROMEAPP||c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(b);mxClient.IS_IOS&&navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a, +b){f.apply(this,arguments);a.addSeparator(b);c.menus.addSubmenu("openRecent",a,b)}}this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],b):c.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],b);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||c.menus.addMenuItems(a,["-","revisionHistory"],b);c.menus.addMenuItems(a,["-","autosave"], +b)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){g.funct(a,b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=h&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips", +"pageScale"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);if(!c.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(b);var d=c.menus.addMenuItem(a,"plugins",b);c.isOffline()||c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "), b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "), l=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):l(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "), b)})))};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=f.menus.get(a),g=k.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height="30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));f.menus.menuCreated(e,g,"geMenuItem");null!=c? diff --git a/src/main/webapp/js/atlas-viewer.min.js b/src/main/webapp/js/atlas-viewer.min.js index 7c94a57df..e5449186d 100644 --- a/src/main/webapp/js/atlas-viewer.min.js +++ b/src/main/webapp/js/atlas-viewer.min.js @@ -104,7 +104,7 @@ window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Ba ko:"í•œêµì–´",ja:"日本語",zh:"ä¸æ–‡ï¼ˆä¸å›½ï¼‰","zh-tw":"ä¸æ–‡ï¼ˆå°ç£ï¼‰"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} (function(){if("undefined"!==typeof JSON&&isLocalStorage)try{var a=localStorage.getItem(".drawio-config"),b=!0;null!=a&&(b=JSON.parse(a).showStartScreen);0==b&&(urlParams.splash="0")}catch(c){}a=urlParams["export"];null!=a&&("http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";b=window.location.host;"test.draw.io"!=b&&(a=b.length-7,b=b.lastIndexOf("draw.io",a),-1!==b&&b===a&&(window.DRAWIO_LOG_URL="https://log.draw.io"))})(); -if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.analytics="0",urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");window.urlParams=window.urlParams||{};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"; +if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");window.urlParams=window.urlParams||{};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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"3.9.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT: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:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.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/")&& @@ -1950,7 +1950,7 @@ x.style.color=.5>.213*this.rgb[0]+.715*this.rgb[1]+.072*this.rgb[2]?"#FFF":"#000 this.rgb[1]=b;var e=null===c?this.rgb[2]:this.rgb[2]=c,f=Math.min(Math.min(a,b),e);c=Math.max(Math.max(a,b),e);var g=c-f;0===g?a=[null,0,c]:(a=a===f?3+(e-b)/g:b===f?5+(a-e)/g:1+(b-a)/g,a=[6===a?0:a,g/c,c]);null!==a[0]&&(this.hsv[0]=a[0]);0!==a[2]&&(this.hsv[1]=a[1]);this.hsv[2]=a[2];this.exportColor(d)};this.fromString=function(a,b){var c=a.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);return c?(6===c[1].length?this.fromRGB(parseInt(c[1].substr(0,2),16)/255,parseInt(c[1].substr(2,2),16)/255,parseInt(c[1].substr(4, 2),16)/255,b):this.fromRGB(parseInt(c[1].charAt(0)+c[1].charAt(0),16)/255,parseInt(c[1].charAt(1)+c[1].charAt(1),16)/255,parseInt(c[1].charAt(2)+c[1].charAt(2),16)/255,b),!0):!1};this.toString=function(){return(256|Math.round(255*this.rgb[0])).toString(16).substr(1)+(256|Math.round(255*this.rgb[1])).toString(16).substr(1)+(256|Math.round(255*this.rgb[2])).toString(16).substr(1)};var r=this,t="hvs"===this.pickerMode.toLowerCase()?1:0,u=jscolor.fetchElement(this.valueElement),x=jscolor.fetchElement(this.styleElement), y=!1,A=!1,z=1,v=2,B=4,C=8;u&&(q=function(){r.fromString(u.value,z);p()},jscolor.addEvent(u,"keyup",q),jscolor.addEvent(u,"input",q),jscolor.addEvent(u,"blur",l),u.setAttribute("autocomplete","off"));x&&(x.jscStyle={backgroundImage:x.style.backgroundImage,backgroundColor:x.style.backgroundColor,color:x.style.color});switch(t){case 0:jscolor.requireImage("hs.png");break;case 1:jscolor.requireImage("hv.png")}this.importColor()}};jscolor.install(); -Editor=function(a,d,e,b,k){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=b||this.createGraph(d,e);this.editable=null!=k?k:!a;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(a){this.status=a;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus= +Editor=function(a,d,e,b,h){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=b||this.createGraph(d,e);this.editable=null!=h?h:!a;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(a){this.status=a;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus= function(){return this.status};this.graphChangeListener=function(a,b){var d=null!=b?b.getProperty("edit"):null;null!=d&&d.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};Editor.pageCounter=0; (function(){try{for(var a=window;null!=a.opener&&"undefined"!==typeof a.opener.Editor&&!isNaN(a.opener.Editor.pageCounter)&&a.opener!=a;)a=a.opener;null!=a&&(a.Editor.pageCounter++,Editor.pageCounter=a.Editor.pageCounter)}catch(d){}})();Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS; Editor.helpImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC5BxTwAAAAH3RSTlMAlUF8boNQIE0LBgOgkGlHNSwqFIx/dGVUOjApmV9ezNACSAAAAIVJREFUGNNtjNsOgzAMQ5NeoVcKDAZs+//PXLKI8YKlWvaRU7jXuFpb9qsbdK05XILUiE8JHQox1Pv3OgFUzf1AGqWqUg+QBwLF0YAeegBlCNgRWOpB5vUfTCmeoHQ/wNdy0jLH/cM+b+wLTw4n/7ACEmHVVy8h6qy8V7MNcGowWpsNbvUFcGUEdSi1s/oAAAAASUVORK5CYII=":IMAGE_PATH+ @@ -1983,14 +1983,14 @@ this.updateGraphComponents();this.fireEvent(new mxEventObject("resetGraphView")) Editor.prototype.getGraphXml=function(a){a=(null!=a?a:1)?(new mxCodec(mxUtils.createXmlDocument())).encode(this.graph.getModel()):this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));if(0!=this.graph.view.translate.x||0!=this.graph.view.translate.y)a.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),a.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);a.setAttribute("grid",this.graph.isGridEnabled()?"1":"0");a.setAttribute("gridSize", this.graph.gridSize);a.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");a.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");a.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0");a.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");a.setAttribute("fold",this.graph.foldingEnabled?"1":"0");a.setAttribute("page",this.graph.pageVisible?"1":"0");a.setAttribute("pageScale",this.graph.pageScale);a.setAttribute("pageWidth",this.graph.pageFormat.width); a.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&a.setAttribute("background",this.graph.background);return a};Editor.prototype.updateGraphComponents=function(){var a=this.graph;null!=a.container&&(a.view.validateBackground(),a.container.style.overflow=a.scrollbars?"auto":"hidden",this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(a){this.modified=a};Editor.prototype.setFilename=function(a){this.filename=a}; -Editor.prototype.createUndoManager=function(){var a=this.graph,d=new mxUndoManager;this.undoListener=function(a,e){d.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,d){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(b,d){for(var e=a.getSelectionCellsForChanges(d.getProperty("edit").changes),k=a.getModel(),q=[],v=0;v<e.length;v++)(k.isVertex(e[v])||k.isEdge(e[v]))&&null!=a.view.getState(e[v])&& +Editor.prototype.createUndoManager=function(){var a=this.graph,d=new mxUndoManager;this.undoListener=function(a,e){d.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,d){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(b,d){for(var e=a.getSelectionCellsForChanges(d.getProperty("edit").changes),h=a.getModel(),q=[],v=0;v<e.length;v++)(h.isVertex(e[v])||h.isEdge(e[v]))&&null!=a.view.getState(e[v])&& q.push(e[v]);a.setSelectionCells(q)};d.addListener(mxEvent.UNDO,e);d.addListener(mxEvent.REDO,e);return d};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()}; OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)}; -function Dialog(a,d,e,b,k,m,p,q){var v=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(v=80);e+=v;b+=v;var c=e,f=b,g=Math.max(document.body.clientHeight,document.documentElement.clientHeight),u=Math.max(1,Math.round((document.body.clientWidth-e-64)/2)),t=Math.max(1,Math.round((g-b-a.footerHeight)/3));mxClient.IS_QUIRKS||(d.style.maxHeight="100%");e=Math.min(e,document.body.scrollWidth-64);b=Math.min(b,g-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&& -(this.bg=a.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=g+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var h=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=h.x+"px";this.bg.style.top=h.y+"px";u+=h.x;t+=h.y;k&&document.body.appendChild(this.bg);var n=a.createDiv("geDialog");k=this.getPosition(u,t, -e,b);u=k.x;t=k.y;n.style.width=e+"px";n.style.height=b+"px";n.style.left=u+"px";n.style.top=t+"px";n.style.zIndex=this.zIndex;n.appendChild(d);document.body.appendChild(n);!q&&d.clientHeight>n.clientHeight-64&&(d.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=t+14+"px",m.style.left=u+e+38-v+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click", +function Dialog(a,d,e,b,h,m,p,q){var v=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(v=80);e+=v;b+=v;var c=e,f=b,g=Math.max(document.body.clientHeight,document.documentElement.clientHeight),u=Math.max(1,Math.round((document.body.clientWidth-e-64)/2)),t=Math.max(1,Math.round((g-b-a.footerHeight)/3));mxClient.IS_QUIRKS||(d.style.maxHeight="100%");e=Math.min(e,document.body.scrollWidth-64);b=Math.min(b,g-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&& +(this.bg=a.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=g+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var l=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=l.x+"px";this.bg.style.top=l.y+"px";u+=l.x;t+=l.y;h&&document.body.appendChild(this.bg);var n=a.createDiv("geDialog");h=this.getPosition(u,t, +e,b);u=h.x;t=h.y;n.style.width=e+"px";n.style.height=b+"px";n.style.left=u+"px";n.style.top=t+"px";n.style.zIndex=this.zIndex;n.appendChild(d);document.body.appendChild(n);!q&&d.clientHeight>n.clientHeight-64&&(d.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=t+14+"px",m.style.left=u+e+38-v+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click", mxUtils.bind(this,function(){a.hideDialog(!0)})),document.body.appendChild(m),this.dialogImg=m,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){g=Math.max(document.body.clientHeight,document.documentElement.clientHeight);this.bg.style.height=g+"px";u=Math.max(1,Math.round((document.body.clientWidth-e-64)/2));t=Math.max(1,Math.round((g-b-a.footerHeight)/3));e=Math.min(c,document.body.scrollWidth-64);b= -Math.min(f,g-64);var l=this.getPosition(u,t,e,b);u=l.x;t=l.y;n.style.left=u+"px";n.style.top=t+"px";n.style.width=e+"px";n.style.height=b+"px";!q&&d.clientHeight>n.clientHeight-64&&(d.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=t+14+"px",this.dialogImg.style.left=u+e+38-v+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=p;this.container=n;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white"; +Math.min(f,g-64);var k=this.getPosition(u,t,e,b);u=k.x;t=k.y;n.style.left=u+"px";n.style.top=t+"px";n.style.width=e+"px";n.style.height=b+"px";!q&&d.clientHeight>n.clientHeight-64&&(d.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=t+14+"px",this.dialogImg.style.left=u+e+38-v+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=p;this.container=n;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white"; Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1; Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+ "/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png"; @@ -2001,30 +2001,30 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+ "/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,d){return new mxPoint(a,d)};Dialog.prototype.close=function(a){null!=this.onDialogClose&&(this.onDialogClose(a),this.onDialogClose=null);null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)}; var PrintDialog=function(a,d){this.create(a,d)}; -PrintDialog.prototype.create=function(a){function d(a){var b=q.checked||c.checked,d=parseInt(g.value)/100;isNaN(d)&&(d=1,g.value="100%");var d=.75*d,l=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,u=1/e.pageScale;if(b){var r=q.checked?1:parseInt(f.value);isNaN(r)||(u=mxUtils.getScaleForPageCount(r,e,l))}e.getGraphBounds();var t=r=0,l=mxRectangle.fromRectangle(l);l.width=Math.ceil(l.width*d);l.height=Math.ceil(l.height*d);u*=d;!b&&e.pageVisible?(d=e.getPageLayout(),r-=d.x*l.width,t-=d.y*l.height): -b=!0;b=PrintDialog.createPrintPreview(e,u,l,0,r,t,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,b,k,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var p=document.createElement("tbody");b=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var v=document.createElement("span");mxUtils.write(v," "+mxResources.get("fitPage")); -k.appendChild(v);mxEvent.addListener(v,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});b.appendChild(k);p.appendChild(b);b=b.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);v=document.createElement("span");mxUtils.write(v," "+mxResources.get("posterPrint")+":");k.appendChild(v);mxEvent.addListener(v, -"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});b.appendChild(k);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(f);mxUtils.write(k," "+mxResources.get("pages")+" (max)");b.appendChild(k);p.appendChild(b);mxEvent.addListener(c,"change", -function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});b=b.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");b.appendChild(k);k=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";k.appendChild(g);b.appendChild(k);p.appendChild(b);b=document.createElement("tr");k=document.createElement("td");k.colSpan=2; -k.style.paddingTop="20px";k.setAttribute("align","right");v=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});v.className="geBtn";a.editor.cancelFirst&&k.appendChild(v);if(PrintDialog.previewEnabled){var u=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)});u.className="geBtn";k.appendChild(u)}u=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});u.className="geBtn gePrimaryBtn";k.appendChild(u);a.editor.cancelFirst|| -k.appendChild(v);b.appendChild(k);p.appendChild(b);m.appendChild(p);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var d=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(d,500):d()}}; -PrintDialog.createPrintPreview=function(a,d,e,b,k,m,p){d=new mxPrintPreview(a,d,e,b,k,m);d.title=mxResources.get("preview");d.printBackgroundImage=!0;d.autoOrigin=p;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";d.backgroundColor=a;var q=d.writeHead;d.writeHead=function(a){q.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return d}; +PrintDialog.prototype.create=function(a){function d(a){var b=q.checked||c.checked,d=parseInt(g.value)/100;isNaN(d)&&(d=1,g.value="100%");var d=.75*d,k=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,u=1/e.pageScale;if(b){var r=q.checked?1:parseInt(f.value);isNaN(r)||(u=mxUtils.getScaleForPageCount(r,e,k))}e.getGraphBounds();var t=r=0,k=mxRectangle.fromRectangle(k);k.width=Math.ceil(k.width*d);k.height=Math.ceil(k.height*d);u*=d;!b&&e.pageVisible?(d=e.getPageLayout(),r-=d.x*k.width,t-=d.y*k.height): +b=!0;b=PrintDialog.createPrintPreview(e,u,k,0,r,t,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,b,h,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var p=document.createElement("tbody");b=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");h=document.createElement("td");h.setAttribute("colspan","2");h.style.fontSize="10pt";h.appendChild(q);var v=document.createElement("span");mxUtils.write(v," "+mxResources.get("fitPage")); +h.appendChild(v);mxEvent.addListener(v,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});b.appendChild(h);p.appendChild(b);b=b.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");h=document.createElement("td");h.style.fontSize="10pt";h.appendChild(c);v=document.createElement("span");mxUtils.write(v," "+mxResources.get("posterPrint")+":");h.appendChild(v);mxEvent.addListener(v, +"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});b.appendChild(h);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";h=document.createElement("td");h.style.fontSize="10pt";h.appendChild(f);mxUtils.write(h," "+mxResources.get("pages")+" (max)");b.appendChild(h);p.appendChild(b);mxEvent.addListener(c,"change", +function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});b=b.cloneNode(!1);h=document.createElement("td");mxUtils.write(h,mxResources.get("pageScale")+":");b.appendChild(h);h=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";h.appendChild(g);b.appendChild(h);p.appendChild(b);b=document.createElement("tr");h=document.createElement("td");h.colSpan=2; +h.style.paddingTop="20px";h.setAttribute("align","right");v=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});v.className="geBtn";a.editor.cancelFirst&&h.appendChild(v);if(PrintDialog.previewEnabled){var u=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)});u.className="geBtn";h.appendChild(u)}u=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});u.className="geBtn gePrimaryBtn";h.appendChild(u);a.editor.cancelFirst|| +h.appendChild(v);b.appendChild(h);p.appendChild(b);m.appendChild(p);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var d=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(d,500):d()}}; +PrintDialog.createPrintPreview=function(a,d,e,b,h,m,p){d=new mxPrintPreview(a,d,e,b,h,m);d.title=mxResources.get("preview");d.printBackgroundImage=!0;d.autoOrigin=p;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";d.backgroundColor=a;var q=d.writeHead;d.writeHead=function(a){q.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return d}; PrintDialog.previewEnabled=!0; -var PageSetupDialog=function(a){function d(){null==f||f==mxConstants.NONE?(c.style.backgroundColor="",c.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(c.style.backgroundColor=f,c.style.backgroundImage="")}function e(){null==t?(u.removeAttribute("title"),u.style.fontSize="",u.innerHTML=mxResources.get("change")+"..."):(u.setAttribute("title",t.src),u.style.fontSize="11px",u.innerHTML=t.src.substring(0,42)+"...")}var b=a.editor.graph,k,m,p=document.createElement("table");p.style.width= -"100%";p.style.height="100%";var q=document.createElement("tbody");k=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");k.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var v=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",b.pageFormat);k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td"); -mxUtils.write(m,mxResources.get("background")+":");k.appendChild(m);m=document.createElement("td");m.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var c=document.createElement("button");c.style.width="18px";c.style.height="18px";c.style.marginRight="20px";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";var f=b.background;d();mxEvent.addListener(c,"click",function(c){a.pickColor(f||"none",function(a){f=a;d()});mxEvent.consume(c)}); -m.appendChild(c);mxUtils.write(m,mxResources.get("gridSize")+":");var g=document.createElement("input");g.setAttribute("type","number");g.setAttribute("min","0");g.style.width="40px";g.style.marginLeft="6px";g.value=b.getGridSize();m.appendChild(g);mxEvent.addListener(g,"change",function(){var a=parseInt(g.value);g.value=Math.max(1,isNaN(a)?b.getGridSize():a)});k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+ -":");k.appendChild(m);m=document.createElement("td");var u=document.createElement("a");u.style.textDecoration="underline";u.style.cursor="pointer";u.style.color="#a0a0a0";var t=b.backgroundImage;mxEvent.addListener(u,"click",function(c){a.showBackgroundImageDialog(function(a){t=a;e()});mxEvent.consume(c)});e();m.appendChild(u);k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var h= -mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&m.appendChild(h);var n=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.gridSize!==g.value&&b.setGridSize(parseInt(g.value));var c=new ChangePageSetup(a,f,t,v.get());c.ignoreColor=b.background==f;c.ignoreImage=(null!=b.backgroundImage?b.backgroundImage.src:null)===(null!=t?t.src:null);b.pageFormat.width==c.previousFormat.width&&b.pageFormat.height==c.previousFormat.height&& -c.ignoreColor&&c.ignoreImage||b.model.execute(c)});n.className="geBtn gePrimaryBtn";m.appendChild(n);a.editor.cancelFirst||m.appendChild(h);k.appendChild(m);q.appendChild(k);p.appendChild(q);this.container=p}; -PageSetupDialog.addPageFormatPanel=function(a,d,e,b){function k(a,c,b){if(b||g!=document.activeElement&&u!=document.activeElement){a=!1;for(c=0;c<h.length;c++)b=h[c],r?"custom"==b.key&&(q.value=b.key,r=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&& +var PageSetupDialog=function(a){function d(){null==f||f==mxConstants.NONE?(c.style.backgroundColor="",c.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(c.style.backgroundColor=f,c.style.backgroundImage="")}function e(){null==t?(u.removeAttribute("title"),u.style.fontSize="",u.innerHTML=mxResources.get("change")+"..."):(u.setAttribute("title",t.src),u.style.fontSize="11px",u.innerHTML=t.src.substring(0,42)+"...")}var b=a.editor.graph,h,m,p=document.createElement("table");p.style.width= +"100%";p.style.height="100%";var q=document.createElement("tbody");h=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");h.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var v=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",b.pageFormat);h.appendChild(m);q.appendChild(h);h=document.createElement("tr");m=document.createElement("td"); +mxUtils.write(m,mxResources.get("background")+":");h.appendChild(m);m=document.createElement("td");m.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var c=document.createElement("button");c.style.width="18px";c.style.height="18px";c.style.marginRight="20px";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";var f=b.background;d();mxEvent.addListener(c,"click",function(c){a.pickColor(f||"none",function(a){f=a;d()});mxEvent.consume(c)}); +m.appendChild(c);mxUtils.write(m,mxResources.get("gridSize")+":");var g=document.createElement("input");g.setAttribute("type","number");g.setAttribute("min","0");g.style.width="40px";g.style.marginLeft="6px";g.value=b.getGridSize();m.appendChild(g);mxEvent.addListener(g,"change",function(){var a=parseInt(g.value);g.value=Math.max(1,isNaN(a)?b.getGridSize():a)});h.appendChild(m);q.appendChild(h);h=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+ +":");h.appendChild(m);m=document.createElement("td");var u=document.createElement("a");u.style.textDecoration="underline";u.style.cursor="pointer";u.style.color="#a0a0a0";var t=b.backgroundImage;mxEvent.addListener(u,"click",function(c){a.showBackgroundImageDialog(function(a){t=a;e()});mxEvent.consume(c)});e();m.appendChild(u);h.appendChild(m);q.appendChild(h);h=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var l= +mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst&&m.appendChild(l);var n=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.gridSize!==g.value&&b.setGridSize(parseInt(g.value));var c=new ChangePageSetup(a,f,t,v.get());c.ignoreColor=b.background==f;c.ignoreImage=(null!=b.backgroundImage?b.backgroundImage.src:null)===(null!=t?t.src:null);b.pageFormat.width==c.previousFormat.width&&b.pageFormat.height==c.previousFormat.height&& +c.ignoreColor&&c.ignoreImage||b.model.execute(c)});n.className="geBtn gePrimaryBtn";m.appendChild(n);a.editor.cancelFirst||m.appendChild(l);h.appendChild(m);q.appendChild(h);p.appendChild(q);this.container=p}; +PageSetupDialog.addPageFormatPanel=function(a,d,e,b){function h(a,c,b){if(b||g!=document.activeElement&&u!=document.activeElement){a=!1;for(c=0;c<l.length;c++)b=l[c],r?"custom"==b.key&&(q.value=b.key,r=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&& e.height==b.format.height?(q.value=b.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==b.format.height&&e.height==b.format.width&&(q.value=b.key,m.removeAttribute("checked"),m.defaultChecked=!1,m.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(v.style.display="",f.style.display="none"):(g.value=e.width/100,u.value=e.height/100,m.setAttribute("checked","checked"), q.value="custom",v.style.display="none",f.style.display="")}}d="format-"+d;var m=document.createElement("input");m.setAttribute("name",d);m.setAttribute("type","radio");m.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",d);p.setAttribute("type","radio");p.setAttribute("value","landscape");var q=document.createElement("select");q.style.marginBottom="8px";q.style.width="202px";var v=document.createElement("div");v.style.marginLeft="4px";v.style.width="210px"; v.style.height="24px";m.style.marginRight="6px";v.appendChild(m);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));v.appendChild(d);p.style.marginLeft="10px";p.style.marginRight="6px";v.appendChild(p);var c=document.createElement("span");c.style.width="100px";mxUtils.write(c,mxResources.get("landscape"));v.appendChild(c);var f=document.createElement("div");f.style.marginLeft="4px";f.style.width="210px";f.style.height="24px";var g=document.createElement("input"); -g.setAttribute("size","7");g.style.textAlign="right";f.appendChild(g);mxUtils.write(f," in x ");var u=document.createElement("input");u.setAttribute("size","7");u.style.textAlign="right";f.appendChild(u);mxUtils.write(f," in");v.style.display="none";f.style.display="none";for(var t={},h=PageSetupDialog.getFormats(),n=0;n<h.length;n++){var l=h[n];t[l.key]=l;var w=document.createElement("option");w.setAttribute("value",l.key);mxUtils.write(w,l.title);q.appendChild(w)}var r=!1;k();a.appendChild(q);mxUtils.br(a); +g.setAttribute("size","7");g.style.textAlign="right";f.appendChild(g);mxUtils.write(f," in x ");var u=document.createElement("input");u.setAttribute("size","7");u.style.textAlign="right";f.appendChild(u);mxUtils.write(f," in");v.style.display="none";f.style.display="none";for(var t={},l=PageSetupDialog.getFormats(),n=0;n<l.length;n++){var k=l[n];t[k.key]=k;var w=document.createElement("option");w.setAttribute("value",k.key);mxUtils.write(w,k.title);q.appendChild(w)}var r=!1;h();a.appendChild(q);mxUtils.br(a); a.appendChild(v);a.appendChild(f);var y=e,D=function(a,c){var d=t[q.value];null!=d.format?(g.value=d.format.width/100,u.value=d.format.height/100,f.style.display="none",v.style.display=""):(v.style.display="none",f.style.display="");isNaN(parseFloat(g.value))&&(g.value=e.width/100);isNaN(parseFloat(u.value))&&(u.value=e.height/100);d=new mxRectangle(0,0,Math.floor(100*parseFloat(g.value)),Math.floor(100*parseFloat(u.value)));"custom"!=q.value&&p.checked&&(d=new mxRectangle(0,0,d.height,d.width)); c&&r||d.width==y.width&&d.height==y.height||(y=d,null!=b&&b(y))};mxEvent.addListener(d,"click",function(a){m.checked=!0;D(a);mxEvent.consume(a)});mxEvent.addListener(c,"click",function(a){p.checked=!0;D(a);mxEvent.consume(a)});mxEvent.addListener(g,"blur",D);mxEvent.addListener(g,"click",D);mxEvent.addListener(u,"blur",D);mxEvent.addListener(u,"click",D);mxEvent.addListener(p,"change",D);mxEvent.addListener(m,"change",D);mxEvent.addListener(q,"change",function(a){r="custom"==q.value;D(a,!0)});D(); -return{set:function(a){e=a;k(null,null,!0)},get:function(){return y},widthInput:g,heightInput:u}}; +return{set:function(a){e=a;h(null,null,!0)},get:function(){return y},widthInput:g,heightInput:u}}; PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:"US-Tabloid (279 mm x 432 mm)",format:new mxRectangle(0,0,1100,1700)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)", format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"custom",title:mxResources.get("custom"),format:null}]}; (function(){mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph;if(null!=a.container&&!a.transparentBackground){if(a.pageVisible){var b=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var c=a.container.firstChild;null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.nextSibling;null!=c&&(this.backgroundPageShape=this.createBackgroundPageShape(b),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect= @@ -2034,33 +2034,33 @@ null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackground f="url("+this.gridImage+")";var e=c=0;null!=a.view.backgroundPageShape&&(e=this.getBackgroundPageBounds(),c=1+e.x,e=1+e.y);d=-Math.round(d-mxUtils.mod(this.translate.x*this.scale-c,d))+"px "+-Math.round(d-mxUtils.mod(this.translate.y*this.scale-e,d))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=d,a.view.backgroundPageShape.node.style.backgroundImage=f,a.view.backgroundPageShape.node.style.backgroundColor= b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=d,c.style.backgroundColor=b,c.style.backgroundImage=f)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],g=1;g<this.gridSteps;g++){var e=g*b;d.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+ c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+d.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,d){a.apply(this,arguments);if(null!=this.shiftPreview1){var c= -this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,g=this.view.translate,e=this.pageFormat,t=d*this.pageScale,h=this.view.getBackgroundPageBounds();b=h.width;c=h.height;var n= -new mxRectangle(d*g.x,d*g.y,e.width*t,e.height*t),l=(a=a&&Math.min(n.width,n.height)>this.minPageBreakDist)?Math.ceil(c/n.height)-1:0,w=a?Math.ceil(b/n.width)-1:0,r=h.x+b,q=h.y+c;null==this.horizontalPageBreaks&&0<l&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<w&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?l:w,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(h.x),Math.round(h.y+(b+1)*n.height)), -new mxPoint(Math.round(r),Math.round(h.y+(b+1)*n.height))]:[new mxPoint(Math.round(h.x+(b+1)*n.width),Math.round(h.y)),new mxPoint(Math.round(h.x+(b+1)*n.width),Math.round(q))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)}; +this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,g=this.view.translate,e=this.pageFormat,t=d*this.pageScale,l=this.view.getBackgroundPageBounds();b=l.width;c=l.height;var n= +new mxRectangle(d*g.x,d*g.y,e.width*t,e.height*t),k=(a=a&&Math.min(n.width,n.height)>this.minPageBreakDist)?Math.ceil(c/n.height)-1:0,w=a?Math.ceil(b/n.width)-1:0,r=l.x+b,q=l.y+c;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<w&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?k:w,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+(b+1)*n.height)), +new mxPoint(Math.round(r),Math.round(l.y+(b+1)*n.height))]:[new mxPoint(Math.round(l.x+(b+1)*n.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(b+1)*n.width),Math.round(q))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)}; var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){for(var f=0;f<b.length;f++)if(this.graph.getModel().isVertex(b[f])){var g=this.graph.getCellGeometry(b[f]);if(null!=g&&g.relative)return!1}return d.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()? !0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,g=this.graph.pageScale,e=d.width*g,d=d.height*g,g=Math.floor(Math.min(0,b)/e),t=Math.floor(Math.min(0, c)/d);return new mxRectangle(this.scale*(this.translate.x+g*e),this.scale*(this.translate.y+t*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/e)-g)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-t)*d)};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,d){b.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft= -a+"px",this.view.backgroundPageShape.node.style.marginTop=d+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,g,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=m.apply(this,arguments),g=b.getParent(d); +a+"px",this.view.backgroundPageShape.node.style.marginTop=d+"px")};var h=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,g,e){var f=h.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=m.apply(this,arguments),g=b.getParent(d); if(null==c||c!=d&&c!=g)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(g)&&b.isVertex(g)&&!this.graph.isContainer(g);)d=g,g=this.graph.getModel().getParent(d);return d};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=p.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),g=d.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&d.isVertex(g)){c=!0;break}g=d.getParent(g)}return c};mxGraphHandler.prototype.selectDelayed= function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var c=this.graph.view.getState(b);if(null==c||!a.isSource(c.control))for(var c=this.graph.getModel(),d=c.getParent(b);!this.graph.isCellSelected(d)&&c.isVertex(d);)b=d,d=c.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),c=b.getParent(a);b.isVertex(c)&&!this.graph.isContainer(c);)this.graph.isCellSelected(c)&& (a=c),c=b.getParent(c);return a}})();EditorUi=function(a,d,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=d||document.body;var b=this.editor.graph;b.lightbox=e;mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src); -this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,b.isEnabled=function(){return!1},b.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||b.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown= -k,this.toolbarContainer.onselectstart=k,this.toolbarContainer.onmousedown=k,this.diagramContainer.onselectstart=k,this.diagramContainer.onmousedown=k,this.sidebarContainer.onselectstart=k,this.sidebarContainer.onmousedown=k,this.formatContainer.onselectstart=k,this.formatContainer.onmousedown=k,this.footerContainer.onselectstart=k,this.footerContainer.onmousedown=k,null!=this.tabContainer&&(this.tabContainer.onselectstart=k));!this.editor.chromeless||this.editor.editable?(d=function(a){var c=mxEvent.getSource(a); -if("A"==c.nodeName)for(;null!=c;){if("geHint"==c.className)return!0;c=c.parentNode}return k(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",d):this.diagramContainer.oncontextmenu=d):b.panningHandler.usePopupTrigger=!1;b.init(this.diagramContainer);mxClient.IS_SVG&&null!=b.view.getDrawPane()&&(d=b.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons(); +this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,b.isEnabled=function(){return!1},b.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var h=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||b.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=h,this.menubarContainer.onmousedown= +h,this.toolbarContainer.onselectstart=h,this.toolbarContainer.onmousedown=h,this.diagramContainer.onselectstart=h,this.diagramContainer.onmousedown=h,this.sidebarContainer.onselectstart=h,this.sidebarContainer.onmousedown=h,this.formatContainer.onselectstart=h,this.formatContainer.onmousedown=h,this.footerContainer.onselectstart=h,this.footerContainer.onmousedown=h,null!=this.tabContainer&&(this.tabContainer.onselectstart=h));!this.editor.chromeless||this.editor.editable?(d=function(a){var c=mxEvent.getSource(a); +if("A"==c.nodeName)for(;null!=c;){if("geHint"==c.className)return!0;c=c.parentNode}return h(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",d):this.diagramContainer.oncontextmenu=d):b.panningHandler.usePopupTrigger=!1;b.init(this.diagramContainer);mxClient.IS_SVG&&null!=b.view.getDrawPane()&&(d=b.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons(); mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var c=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(a)-c.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-c.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var m=!1,p=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(a,c){return m||p.apply(this,arguments)};this.keydownHandler= mxUtils.bind(this,function(a){32==a.which?(m=!0,this.hoverIcons.reset(),b.container.style.cursor="move",b.isEditing()||mxEvent.getSource(a)!=b.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog()});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){b.container.style.cursor="";m=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var q=b.panningHandler.isForcePanningEvent;b.panningHandler.isForcePanningEvent= function(a){return q.apply(this,arguments)||m||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var v=b.cellEditor.isStopEditingEvent;b.cellEditor.isStopEditingEvent=function(a){return v.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxClient.IS_SF&&mxEvent.isShiftDown(a))}; -var c=!1,f=null,g=null,u=null,t=mxUtils.bind(this,function(){if(null!=this.toolbar&&c!=b.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,d=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),d.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==u)this.toolbar.createTextToolbar();else{for(var l=0;l<u.length;l++)this.toolbar.container.appendChild(u[l]);this.toolbar.fontMenu=f;this.toolbar.sizeMenu= -g}c=b.cellEditor.isContentEditing();f=a;g=e;u=d}}),h=this,n=b.cellEditor.startEditing;b.cellEditor.startEditing=function(){n.apply(this,arguments);t();if(b.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=b.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=h.toolbar)){var d=c.fontFamily;"'"==d.charAt(0)&&(d=d.substring(1));"'"==d.charAt(d.length-1)&&(d= -d.substring(0,d.length-1));h.toolbar.setFontName(d);h.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(b.cellEditor.textarea,"input",c);mxEvent.addListener(b.cellEditor.textarea,"touchend",c);mxEvent.addListener(b.cellEditor.textarea,"mouseup",c);mxEvent.addListener(b.cellEditor.textarea,"keyup",c);c()}};var l=b.cellEditor.stopEditing;b.cellEditor.stopEditing=function(a,c){l.apply(this,arguments);t()};b.container.setAttribute("tabindex","0");b.container.style.cursor="default"; +var c=!1,f=null,g=null,u=null,t=mxUtils.bind(this,function(){if(null!=this.toolbar&&c!=b.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,d=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),d.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==u)this.toolbar.createTextToolbar();else{for(var k=0;k<u.length;k++)this.toolbar.container.appendChild(u[k]);this.toolbar.fontMenu=f;this.toolbar.sizeMenu= +g}c=b.cellEditor.isContentEditing();f=a;g=e;u=d}}),l=this,n=b.cellEditor.startEditing;b.cellEditor.startEditing=function(){n.apply(this,arguments);t();if(b.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=b.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=l.toolbar)){var d=c.fontFamily;"'"==d.charAt(0)&&(d=d.substring(1));"'"==d.charAt(d.length-1)&&(d= +d.substring(0,d.length-1));l.toolbar.setFontName(d);l.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(b.cellEditor.textarea,"input",c);mxEvent.addListener(b.cellEditor.textarea,"touchend",c);mxEvent.addListener(b.cellEditor.textarea,"mouseup",c);mxEvent.addListener(b.cellEditor.textarea,"keyup",c);c()}};var k=b.cellEditor.stopEditing;b.cellEditor.stopEditing=function(a,c){k.apply(this,arguments);t()};b.container.setAttribute("tabindex","0");b.container.style.cursor="default"; if(window.self===window.top&&null!=b.container.parentNode)try{b.container.focus()}catch(x){}var w=b.fireMouseEvent;b.fireMouseEvent=function(a,c,b){a==mxEvent.MOUSE_DOWN&&this.container.focus();w.apply(this,arguments)};b.popupMenuHandler.autoExpand=!0;null!=this.menus&&(b.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,b){this.menus.createPopupMenu(a,c,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){b.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a); -this.getKeyHandler=function(){return keyHandler};var r="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),y="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=b.view.getState(a);if(null!=c){a=a.clone();a.style="";a=b.getCellStyle(a);var d=[],f=[],g;for(g in c.style)a[g]!=c.style[g]&&(d.push(c.style[g]),f.push(g));g=b.getModel().getStyle(c.cell);for(var e=null!=g?g.split(";"):[],l=0;l<e.length;l++){var u=e[l], -h=u.indexOf("=");0<=h&&(g=u.substring(0,h),u=u.substring(h+1),null!=a[g]&&"none"==u&&(d.push(u),f.push(g)))}b.getModel().isEdge(c.cell)?b.currentEdgeStyle={}:b.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",d,"cells",[c.cell]))}};this.clearDefaultStyle=function(){b.currentEdgeStyle=mxUtils.clone(b.defaultEdgeStyle);b.currentVertexStyle=mxUtils.clone(b.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var D= +this.getKeyHandler=function(){return keyHandler};var r="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),y="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=b.view.getState(a);if(null!=c){a=a.clone();a.style="";a=b.getCellStyle(a);var d=[],f=[],g;for(g in c.style)a[g]!=c.style[g]&&(d.push(c.style[g]),f.push(g));g=b.getModel().getStyle(c.cell);for(var e=null!=g?g.split(";"):[],k=0;k<e.length;k++){var u=e[k], +l=u.indexOf("=");0<=l&&(g=u.substring(0,l),u=u.substring(l+1),null!=a[g]&&"none"==u&&(d.push(u),f.push(g)))}b.getModel().isEdge(c.cell)?b.currentEdgeStyle={}:b.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",d,"cells",[c.cell]))}};this.clearDefaultStyle=function(){b.currentEdgeStyle=mxUtils.clone(b.defaultEdgeStyle);b.currentVertexStyle=mxUtils.clone(b.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var D= ["fontFamily","fontSize","fontColor"],z="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),G=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],D,["opacity"],["align"],["html"]];for(a=0;a<G.length;a++)for(d=0;d<G[a].length;d++)r.push(G[a][d]);for(a=0;a<y.length;a++)0>mxUtils.indexOf(r,y[a])&&r.push(y[a]);var E=function(a,c){var d=b.getModel(); -d.beginUpdate();try{if(c)for(var f=d.isEdge(u),g=f?b.currentEdgeStyle:b.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var l=g[f[e]];null!=l&&b.setCellStyles(f[e],l,a)}else for(l=0;l<a.length;l++){for(var u=a[l],h=d.getStyle(u),n=null!=h?h.split(";"):[],t=r.slice(),e=0;e<n.length;e++){var w=n[e],z=w.indexOf("=");if(0<=z){var k=w.substring(0,z),q=mxUtils.indexOf(t,k);0<=q&&t.splice(q,1);for(var D=0;D<G.length;D++){var x=G[D];if(0<=mxUtils.indexOf(x,k))for(var p=0;p< -x.length;p++){var m=mxUtils.indexOf(t,x[p]);0<=m&&t.splice(m,1)}}}}for(var g=(f=d.isEdge(u))?b.currentEdgeStyle:b.currentVertexStyle,v=d.getStyle(u),e=0;e<t.length;e++){var k=t[e],J=g[k];null==J||"shape"==k&&!f||f&&!(0>mxUtils.indexOf(y,k))||(v=mxUtils.setStyle(v,k,J))}d.setStyle(u,v)}}finally{d.endUpdate()}};b.addListener("cellsInserted",function(a,c){E(c.getProperty("cells"))});b.addListener("textInserted",function(a,c){E(c.getProperty("cells"),!0)});b.connectionHandler.addListener(mxEvent.CONNECT, -function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));E(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var d=c.getProperty("cells"),f=!1,g=!1;if(0<d.length)for(var e=0;e<d.length&&(f=b.getModel().isVertex(d[e])||f,!(g=b.getModel().isEdge(d[e])||g)||!f);e++);else g=f=!0;for(var d=c.getProperty("keys"),l=c.getProperty("values"),e=0;e<d.length;e++){var u=0<=mxUtils.indexOf(D,d[e]);if("strokeColor"!=d[e]||null!=l[e]&&"none"!= -l[e])if(0<=mxUtils.indexOf(y,d[e]))g||0<=mxUtils.indexOf(z,d[e])?null==l[e]?delete b.currentEdgeStyle[d[e]]:b.currentEdgeStyle[d[e]]=l[e]:f&&0<=mxUtils.indexOf(r,d[e])&&(null==l[e]?delete b.currentVertexStyle[d[e]]:b.currentVertexStyle[d[e]]=l[e]);else if(0<=mxUtils.indexOf(r,d[e])){if(f||u)null==l[e]?delete b.currentVertexStyle[d[e]]:b.currentVertexStyle[d[e]]=l[e];if(g||u||0<=mxUtils.indexOf(z,d[e]))null==l[e]?delete b.currentEdgeStyle[d[e]]:b.currentEdgeStyle[d[e]]=l[e]}}null!=this.toolbar&&(this.toolbar.setFontName(b.currentVertexStyle.fontFamily|| +d.beginUpdate();try{if(c)for(var f=d.isEdge(u),g=f?b.currentEdgeStyle:b.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var k=g[f[e]];null!=k&&b.setCellStyles(f[e],k,a)}else for(k=0;k<a.length;k++){for(var u=a[k],l=d.getStyle(u),n=null!=l?l.split(";"):[],t=r.slice(),e=0;e<n.length;e++){var w=n[e],z=w.indexOf("=");if(0<=z){var h=w.substring(0,z),q=mxUtils.indexOf(t,h);0<=q&&t.splice(q,1);for(var D=0;D<G.length;D++){var x=G[D];if(0<=mxUtils.indexOf(x,h))for(var p=0;p< +x.length;p++){var m=mxUtils.indexOf(t,x[p]);0<=m&&t.splice(m,1)}}}}for(var g=(f=d.isEdge(u))?b.currentEdgeStyle:b.currentVertexStyle,v=d.getStyle(u),e=0;e<t.length;e++){var h=t[e],J=g[h];null==J||"shape"==h&&!f||f&&!(0>mxUtils.indexOf(y,h))||(v=mxUtils.setStyle(v,h,J))}d.setStyle(u,v)}}finally{d.endUpdate()}};b.addListener("cellsInserted",function(a,c){E(c.getProperty("cells"))});b.addListener("textInserted",function(a,c){E(c.getProperty("cells"),!0)});b.connectionHandler.addListener(mxEvent.CONNECT, +function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));E(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var d=c.getProperty("cells"),f=!1,g=!1;if(0<d.length)for(var e=0;e<d.length&&(f=b.getModel().isVertex(d[e])||f,!(g=b.getModel().isEdge(d[e])||g)||!f);e++);else g=f=!0;for(var d=c.getProperty("keys"),k=c.getProperty("values"),e=0;e<d.length;e++){var u=0<=mxUtils.indexOf(D,d[e]);if("strokeColor"!=d[e]||null!=k[e]&&"none"!= +k[e])if(0<=mxUtils.indexOf(y,d[e]))g||0<=mxUtils.indexOf(z,d[e])?null==k[e]?delete b.currentEdgeStyle[d[e]]:b.currentEdgeStyle[d[e]]=k[e]:f&&0<=mxUtils.indexOf(r,d[e])&&(null==k[e]?delete b.currentVertexStyle[d[e]]:b.currentVertexStyle[d[e]]=k[e]);else if(0<=mxUtils.indexOf(r,d[e])){if(f||u)null==k[e]?delete b.currentVertexStyle[d[e]]:b.currentVertexStyle[d[e]]=k[e];if(g||u||0<=mxUtils.indexOf(z,d[e]))null==k[e]?delete b.currentEdgeStyle[d[e]]:b.currentEdgeStyle[d[e]]=k[e]}}null!=this.toolbar&&(this.toolbar.setFontName(b.currentVertexStyle.fontFamily|| Menus.prototype.defaultFont),this.toolbar.setFontSize(b.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==b.currentEdgeStyle.edgeStyle&&"1"==b.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==b.currentEdgeStyle.edgeStyle||"none"==b.currentEdgeStyle.edgeStyle||null==b.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"== b.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==b.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==b.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==b.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==b.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==b.currentEdgeStyle.shape? "geSprite geSprite-linkedge":"flexArrow"==b.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==b.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",b.currentEdgeStyle.shape,b.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(b.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className= @@ -2068,8 +2068,8 @@ this.getCssClassForMarker("end",b.currentEdgeStyle.shape,b.currentEdgeStyle[mxCo this.toolbar.setFontSize(c)}),b.getSelectionModel().addListener(mxEvent.CHANGE,a),b.getModel().addListener(mxEvent.CHANGE,a));b.addListener(mxEvent.CELLS_ADDED,function(a,c){var d=c.getProperty("cells"),f=c.getProperty("parent");b.getModel().isLayer(f)&&!b.isCellVisible(f)&&null!=d&&0<d.length&&b.getModel().setVisible(f,!0)});this.gestureHandler=mxUtils.bind(this,function(a){null!=this.currentMenu&&mxEvent.getSource(a)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document, this.gestureHandler);this.resizeHandler=mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window, "scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){b.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){b.view.validateBackground()}));b.addListener("gridSizeChanged",mxUtils.bind(this,function(){b.isGridEnabled()&&b.view.validateBackground()}));this.editor.resetGraph();this.init();this.open()}; -mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=34;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.editButtonLink=null;EditorUi.prototype.hsplitPosition=640>=screen.width?118:208;EditorUi.prototype.allowAnimation=!0; -EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4; +mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=34;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.hsplitPosition=640>=screen.width?118:208;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2; +EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1; EditorUi.prototype.init=function(){var a=this.editor.graph;mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(a){this.onKeyDown(a)}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(a){this.onKeyPress(a)}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})); var d=a.setDefaultParent,e=this;this.editor.graph.setDefaultParent=function(){d.apply(this,arguments);e.updateActionStates()};a.editLink=e.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()};EditorUi.prototype.onKeyDown=function(a){var d=this.editor.graph;9==a.which&&d.isEnabled()&&!mxEvent.isAltDown(a)&&(d.isEditing()?d.stopEditing(!1):d.selectCell(!mxEvent.isShiftDown(a)),mxEvent.consume(a))}; EditorUi.prototype.onKeyPress=function(a){var d=this.editor.graph;!this.isImmediateEditingEvent(a)||d.isEditing()||d.isSelectionEmpty()||0===a.which||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(d.escape(),d.startEditing(),mxClient.IS_FF&&(d=d.cellEditor,d.textarea.innerHTML=String.fromCharCode(a.which),a=document.createRange(),a.selectNodeContents(d.textarea),a.collapse(!1),d=window.getSelection(),d.removeAllRanges(),d.addRange(a)))}; @@ -2080,25 +2080,25 @@ a+"openthin":e==mxConstants.ARROW_BLOCK?"1"==b?"geSprite geSprite-"+a+"block":"g a+"ermany":"ERoneToMany"==e?"geSprite geSprite-"+a+"eronetomany":"ERzeroToOne"==e?"geSprite geSprite-"+a+"eroneopt":"ERzeroToMany"==e?"geSprite geSprite-"+a+"ermanyopt":"geSprite geSprite-noarrow"};EditorUi.prototype.createMenus=function(){return null}; EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,d=this.actions.get("paste"),e=this.actions.get("pasteHere");d.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));e.setEnabled(d.isEnabled())}; EditorUi.prototype.initClipboard=function(){var a=this,d=mxClipboard.cut;mxClipboard.cut=function(b){b.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);a.updatePasteActionStates()};var e=mxClipboard.copy;mxClipboard.copy=function(d){d.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):e.apply(this,arguments);a.updatePasteActionStates()};var b=mxClipboard.paste;mxClipboard.paste=function(d){var e=null;d.cellEditor.isContentEditing()?document.execCommand("paste", -!1,null):e=b.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(d,b){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20; +!1,null):e=b.apply(this,arguments);a.updatePasteActionStates();return e};var h=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){h.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(d,b){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20; EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),c=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*c.width),this.scale*(this.translate.y+a.y*c.height),this.scale*a.width*c.width, -this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,d){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var d=null,e=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(c,d,b,f){if(null!=a.container){b=null!=b?b:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),l=a.view.translate,u=a.view.scale,h=mxRectangle.fromRectangle(g); -h.x=h.x/u-l.x;h.y=h.y/u-l.y;h.width/=u;h.height/=u;var l=a.container.scrollTop,n=a.container.scrollLeft,r=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)r+=3;var t=a.container.offsetWidth-r,r=a.container.offsetHeight-r;c=c?Math.max(.3,Math.min(d||1,t/h.width)):u;d=(t-c*h.width)/2/c;var w=0==this.lightboxVerticalDivider?0:(r-c*h.height)/this.lightboxVerticalDivider/c;e&&(d=Math.max(d,0),w=Math.max(w,0));if(e||g.width<t||g.height<r)a.view.scaleAndTranslate(c, -Math.floor(d-h.x),Math.floor(w-h.y)),a.container.scrollTop=l*c/u,a.container.scrollLeft=n*c/u;else if(0!=b||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+b/u),Math.floor(g.y+f/u))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var b=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",b);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",b)});this.editor.addListener("resetGraphView", +this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,d){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var d=null,e=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(c,d,b,f){if(null!=a.container){b=null!=b?b:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),k=a.view.translate,u=a.view.scale,l=mxRectangle.fromRectangle(g); +l.x=l.x/u-k.x;l.y=l.y/u-k.y;l.width/=u;l.height/=u;var k=a.container.scrollTop,n=a.container.scrollLeft,r=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)r+=3;var t=a.container.offsetWidth-r,r=a.container.offsetHeight-r;c=c?Math.max(.3,Math.min(d||1,t/l.width)):u;d=(t-c*l.width)/2/c;var w=0==this.lightboxVerticalDivider?0:(r-c*l.height)/this.lightboxVerticalDivider/c;e&&(d=Math.max(d,0),w=Math.max(w,0));if(e||g.width<t||g.height<r)a.view.scaleAndTranslate(c, +Math.floor(d-l.x),Math.floor(w-l.y)),a.container.scrollTop=k*c/u,a.container.scrollLeft=n*c/u;else if(0!=b||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+b/u),Math.floor(g.y+f/u))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var b=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",b);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",b)});this.editor.addListener("resetGraphView", mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(c){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(c){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace= -"nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var k=mxUtils.bind(this,function(){var c=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]|| -0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",k);k();var m=0,k=mxUtils.bind(this,function(a,c,d){m++;var b=document.createElement("span");b.style.paddingLeft="8px";b.style.paddingRight="8px";b.style.cursor="pointer";mxEvent.addListener(b,"click",a);null!=d&&b.setAttribute("title",d);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);b.appendChild(a);this.chromelessToolbar.appendChild(b); -return b}),p=k(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.fontFamily="Helvetica,Arial";q.style.marginTop="8px";q.style.color="#ffffff";this.chromelessToolbar.appendChild(q);var v=k(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")), +"nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var h=mxUtils.bind(this,function(){var c=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]|| +0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",h);h();var m=0,h=mxUtils.bind(this,function(a,c,d){m++;var b=document.createElement("span");b.style.paddingLeft="8px";b.style.paddingRight="8px";b.style.cursor="pointer";mxEvent.addListener(b,"click",a);null!=d&&b.setAttribute("title",d);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);b.appendChild(a);this.chromelessToolbar.appendChild(b); +return b}),p=h(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.fontFamily="Helvetica,Arial";q.style.marginTop="8px";q.style.color="#ffffff";this.chromelessToolbar.appendChild(q);var v=h(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")), c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(q.innerHTML="",mxUtils.write(q,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});p.style.paddingLeft="0px";p.style.paddingRight="4px";v.style.paddingLeft="4px";v.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(v.style.display="",p.style.display="",q.style.display="inline-block"):(v.style.display="none",p.style.display= -"none",q.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);k(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");k(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");k(mxUtils.bind(this,function(c){a.isLightboxView()?(1==a.view.scale? +"none",q.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);h(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");h(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");h(mxUtils.bind(this,function(c){a.isLightboxView()?(1==a.view.scale? this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var g=null,u=null,t=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);g=null;u=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";u= -null}),600)}),a||200)}),h=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var n=k(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog, +null}),600)}),a||200)}),l=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var n=h(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog, "mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var d=n.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily="Helvetica,Arial";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.color="#ffffff"; -mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=d.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=d.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),l=a.getModel();l.addListener(mxEvent.CHANGE,function(){n.style.display=1<l.getChildCount(l.root)? -"":"none"})}this.addChromelessToolbarItems(k);null!=this.editor.editButtonLink&&k(mxUtils.bind(this,function(c){"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(c)}),Editor.editLargeImage,mxResources.get("edit"));!a.lightbox||"1"!=urlParams.close&&this.container==document.body||k(mxUtils.bind(this,function(a){"1"==urlParams.close?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage, -mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||h(30),t())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)}); -mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?t():h(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?t():h(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||h(30)}));var w=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,d){this.startX= -d.getGraphX();this.startY=d.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,d){mxEvent.isTouchEvent(d.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<w&&Math.abs(this.scrollTop-a.container.scrollTop)<w&&Math.abs(this.startX-d.getGraphX())<w&&Math.abs(this.startY-d.getGraphY())<w&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?t():h(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var r= +mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=d.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=d.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),k=a.getModel();k.addListener(mxEvent.CHANGE,function(){n.style.display=1<k.getChildCount(k.root)? +"":"none"})}this.addChromelessToolbarItems(h);null!=this.editor.editButtonLink&&h(mxUtils.bind(this,function(c){"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(c)}),Editor.editLargeImage,mxResources.get("edit"));!a.lightbox||"1"!=urlParams.close&&this.container==document.body||h(mxUtils.bind(this,function(a){"1"==urlParams.close?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage, +mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||l(30),t())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)}); +mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?t():l(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?t():l(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||l(30)}));var w=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,d){this.startX= +d.getGraphX();this.startY=d.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,d){mxEvent.isTouchEvent(d.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<w&&Math.abs(this.scrollTop-a.container.scrollTop)<w&&Math.abs(this.startX-d.getGraphX())<w&&Math.abs(this.startY-d.getGraphY())<w&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?t():l(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var r= a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}r.apply(this,arguments)};var y=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),d=this.getPagePadding(),b=this.getPageSize(),f=Math.ceil(2*d.x+c.width* b.width),g=Math.ceil(2*d.y+c.height*b.height),e=a.minimumGraphSize;if(null==e||e.width!=f||e.height!=g)a.minimumGraphSize=new mxRectangle(0,0,f,g);f=d.x-c.x*b.width;d=d.y-c.y*b.height;this.autoTranslate||this.view.translate.x==f&&this.view.translate.y==d?y.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0=c.y,c=a.view.translate.x,b=a.view.translate.y,a.view.setTranslate(f,d),a.container.scrollLeft+=Math.round((f-c)*a.view.scale),a.container.scrollTop+=Math.round((d-b)*a.view.scale), this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var D=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor= @@ -2120,28 +2120,28 @@ EditorUi.prototype.resetScrollbars=function(){var a=this.editor.graph;if(!this.e 1;d=a.getGraphBounds();0<d.width&&0<d.height&&(d.x>a.container.scrollLeft+.9*a.container.clientWidth&&(a.container.scrollLeft=Math.min(d.x+d.width-a.container.clientWidth,d.x-10)),d.y>a.container.scrollTop+.9*a.container.clientHeight&&(a.container.scrollTop=Math.min(d.y+d.height-a.container.clientHeight,d.y-10)))}else{var d=a.getGraphBounds(),e=Math.max(d.width,a.scrollTileSize.width*a.view.scale);a.container.scrollTop=Math.floor(Math.max(0,d.y-Math.max(20,(a.container.clientHeight-Math.max(d.height, a.scrollTileSize.height*a.view.scale))/4)));a.container.scrollLeft=Math.floor(Math.max(0,d.x-Math.max(0,(a.container.clientWidth-e)/2)))}else a.pageVisible?(d=a.view.getBackgroundPageBounds(),a.view.setTranslate(Math.floor(Math.max(0,(a.container.clientWidth-d.width)/2)-d.x),Math.floor(Math.max(0,(a.container.clientHeight-d.height)/2)-d.y))):(d=a.getGraphBounds(),a.view.setTranslate(Math.floor(Math.max(0,Math.max(0,(a.container.clientWidth-d.width)/2)-d.x)),Math.floor(Math.max(0,Math.max(20,(a.container.clientHeight- d.height)/4))-d.y)))}; -EditorUi.prototype.setPageVisible=function(a){var d=this.editor.graph,e=mxUtils.hasScrollbars(d.container),b=0,k=0;e&&(b=d.view.translate.x*d.view.scale-d.container.scrollLeft,k=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=a;d.pageBreaksVisible=a;d.preferPageSize=a;d.view.validateBackground();e&&(a=d.getSelectionCells(),d.clearSelection(),d.setSelectionCells(a));d.sizeDidChange();e&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-b,d.container.scrollTop=d.view.translate.y* -d.view.scale-k);this.fireEvent(new mxEventObject("pageViewChanged"))};function ChangePageSetup(a,d,e,b){this.ui=a;this.previousColor=this.color=d;this.previousImage=this.image=e;this.previousFormat=this.format=b;this.ignoreImage=this.ignoreColor=!1} +EditorUi.prototype.setPageVisible=function(a){var d=this.editor.graph,e=mxUtils.hasScrollbars(d.container),b=0,h=0;e&&(b=d.view.translate.x*d.view.scale-d.container.scrollLeft,h=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=a;d.pageBreaksVisible=a;d.preferPageSize=a;d.view.validateBackground();e&&(a=d.getSelectionCells(),d.clearSelection(),d.setSelectionCells(a));d.sizeDidChange();e&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-b,d.container.scrollTop=d.view.translate.y* +d.view.scale-h);this.fireEvent(new mxEventObject("pageViewChanged"))};function ChangePageSetup(a,d,e,b){this.ui=a;this.previousColor=this.color=d;this.previousImage=this.image=e;this.previousFormat=this.format=b;this.ignoreImage=this.ignoreColor=!1} ChangePageSetup.prototype.execute=function(){var a=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var d=a.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=d}this.ignoreImage||(this.image=this.previousImage,d=a.backgroundImage,this.ui.setBackgroundImage(this.previousImage),this.previousImage=d);null!=this.previousFormat&&(this.format=this.previousFormat,d=a.pageFormat,this.previousFormat.width!=d.width||this.previousFormat.height!=d.height)&&(this.ui.setPageFormat(this.previousFormat), this.previousFormat=d);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled)};(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.afterDecode=function(a,e,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);return b};mxCodecRegistry.register(a)})(); EditorUi.prototype.setBackgroundColor=function(a){this.editor.graph.background=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(a){this.editor.graph.foldingEnabled=a;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))}; EditorUi.prototype.setPageFormat=function(a){this.editor.graph.pageFormat=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(a){this.editor.graph.pageScale=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))}; EditorUi.prototype.setGridColor=function(a){this.editor.graph.view.gridColor=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))}; -EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),d=this.actions.get("redo"),e=this.editor.undoManager,b=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());d.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,b);e.addListener(mxEvent.UNDO,b);e.addListener(mxEvent.REDO,b);e.addListener(mxEvent.CLEAR,b);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);b()};var m=this.editor.graph.cellEditor.stopEditing; +EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),d=this.actions.get("redo"),e=this.editor.undoManager,b=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());d.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,b);e.addListener(mxEvent.UNDO,b);e.addListener(mxEvent.REDO,b);e.addListener(mxEvent.CLEAR,b);var h=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){h.apply(this,arguments);b()};var m=this.editor.graph.cellEditor.stopEditing; this.editor.graph.cellEditor.stopEditing=function(a,d){m.apply(this,arguments);b()};b()}; -EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,d=!a.isSelectionEmpty(),e=!1,b=!1,k=a.getSelectionCells();if(null!=k)for(var m=0;m<k.length;m++){var p=k[m];a.getModel().isEdge(p)&&(b=!0);a.getModel().isVertex(p)&&(e=!0);if(b&&e)break}k="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(m= -0;m<k.length;m++)this.actions.get(k[m]).setEnabled(d);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("copySize").setEnabled(1==a.getSelectionCount());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(b);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);b=e&&1== +EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,d=!a.isSelectionEmpty(),e=!1,b=!1,h=a.getSelectionCells();if(null!=h)for(var m=0;m<h.length;m++){var p=h[m];a.getModel().isEdge(p)&&(b=!0);a.getModel().isVertex(p)&&(e=!0);if(b&&e)break}h="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(m= +0;m<h.length;m++)this.actions.get(h[m]).setEnabled(d);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("copySize").setEnabled(1==a.getSelectionCount());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(b);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);b=e&&1== a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||b&&!a.isContainer(a.getSelectionCell()));this.actions.get("ungroup").setEnabled(1==a.getSelectionCount()&&(0<a.getModel().getChildCount(a.getSelectionCell())||b&&a.isContainer(a.getSelectionCell())));this.actions.get("removeFromGroup").setEnabled(b&&a.getModel().isVertex(a.getModel().getParent(a.getSelectionCell())));a.view.getState(a.getSelectionCell());this.menus.get("navigation").setEnabled(d||null!=a.view.currentRoot); this.actions.get("collapsible").setEnabled(e&&(a.isContainer(a.getSelectionCell())||0<a.model.getChildCount(a.getSelectionCell())));this.actions.get("home").setEnabled(null!=a.view.currentRoot);this.actions.get("exitGroup").setEnabled(null!=a.view.currentRoot);this.actions.get("enterGroup").setEnabled(1==a.getSelectionCount()&&a.isValidRoot(a.getSelectionCell()));d=1==a.getSelectionCount()&&a.isCellFoldable(a.getSelectionCell());this.actions.get("expand").setEnabled(d);this.actions.get("collapse").setEnabled(d); this.actions.get("editLink").setEnabled(1==a.getSelectionCount());this.actions.get("openLink").setEnabled(1==a.getSelectionCount()&&null!=a.getLinkForCell(a.getSelectionCell()));this.actions.get("guides").setEnabled(a.isEnabled());this.actions.get("grid").setEnabled(!this.editor.chromeless||this.editor.editable);d=a.isEnabled()&&!a.isCellLocked(a.getDefaultParent());this.menus.get("layout").setEnabled(d);this.menus.get("insert").setEnabled(d);this.menus.get("direction").setEnabled(d&&e);this.menus.get("align").setEnabled(d&& e&&1<a.getSelectionCount());this.menus.get("distribute").setEnabled(d&&e&&1<a.getSelectionCount());this.actions.get("selectVertices").setEnabled(d);this.actions.get("selectEdges").setEnabled(d);this.actions.get("selectAll").setEnabled(d);this.actions.get("selectNone").setEnabled(d);this.updatePasteActionStates()}; -EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var d=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,b=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,b=d?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var k=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&& -(k=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var m=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),p=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",p+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",p+=this.toolbarHeight);0<p&&!mxClient.IS_QUIRKS&&(p+=1);var q=0;if(null!=this.sidebarFooterContainer){var v= -this.footerHeight+k,q=Math.max(0,Math.min(b-p-v,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=q+"px";this.sidebarFooterContainer.style.bottom=v+"px"}v=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=p+"px";this.sidebarContainer.style.width=m+"px";this.formatContainer.style.top=p+"px";this.formatContainer.style.width=v+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left= -null!=this.hsplit.parentNode?m+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+k+"px";this.hsplit.style.left=m+"px";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);d?(this.menubarContainer.style.width=e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width, +EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var d=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,b=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,b=d?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var h=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&& +(h=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var m=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),p=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",p+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",p+=this.toolbarHeight);0<p&&!mxClient.IS_QUIRKS&&(p+=1);var q=0;if(null!=this.sidebarFooterContainer){var v= +this.footerHeight+h,q=Math.max(0,Math.min(b-p-v,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=q+"px";this.sidebarFooterContainer.style.bottom=v+"px"}v=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=p+"px";this.sidebarContainer.style.width=m+"px";this.formatContainer.style.top=p+"px";this.formatContainer.style.width=v+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left= +null!=this.hsplit.parentNode?m+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+h+"px";this.hsplit.style.left=m+"px";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);d?(this.menubarContainer.style.width=e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width, d=Math.max(0,b-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=d-q+"px",this.formatContainer.style.height=d+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-m-this.splitSize-v)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,q=Math.max(0,b-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&(this.tabContainer.style.width=this.diagramContainer.style.width,this.tabContainer.style.bottom= -this.footerHeight+k+"px",q-=this.tabContainer.clientHeight),this.diagramContainer.style.height=q+"px",this.hsplit.style.height=q+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=k+"px"),this.diagramContainer.style.right=v+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+k+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+q+k+"px",this.formatContainer.style.bottom= -this.footerHeight+k+"px",this.diagramContainer.style.bottom=this.footerHeight+k+e+"px");a&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null}; +this.footerHeight+h+"px",q-=this.tabContainer.clientHeight),this.diagramContainer.style.height=q+"px",this.hsplit.style.height=q+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=h+"px"),this.diagramContainer.style.right=v+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+h+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+q+h+"px",this.formatContainer.style.bottom= +this.footerHeight+h+"px",this.diagramContainer.style.bottom=this.footerHeight+h+e+"px");a&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null}; EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer");this.toolbarContainer=this.createDiv("geToolbarContainer");this.sidebarContainer=this.createDiv("geSidebarContainer");this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer");this.diagramContainer=this.createDiv("geDiagramContainer");this.footerContainer=this.createDiv("geFooterContainer");this.hsplit=this.createDiv("geHsplit");this.hsplit.setAttribute("title",mxResources.get("collapseExpand")); this.menubarContainer.style.top="0px";this.menubarContainer.style.left="0px";this.menubarContainer.style.right="0px";this.toolbarContainer.style.left="0px";this.toolbarContainer.style.right="0px";this.sidebarContainer.style.left="0px";this.formatContainer.style.right="0px";this.formatContainer.style.zIndex="1";this.diagramContainer.style.right=(null!=this.format?this.formatWidth:0)+"px";this.footerContainer.style.left="0px";this.footerContainer.style.right="0px";this.footerContainer.style.bottom= "0px";this.footerContainer.style.zIndex=mxPopupMenu.prototype.zIndex-2;this.hsplit.style.width=this.splitSize+"px";if(this.sidebarFooterContainer=this.createSidebarFooterContainer())this.sidebarFooterContainer.style.left="0px";this.editor.chromeless?this.diagramContainer.style.border="none":this.tabContainer=this.createTabContainer()};EditorUi.prototype.createSidebarFooterContainer=function(){return null}; @@ -2150,56 +2150,57 @@ this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContaine this.container.appendChild(this.sidebarFooterContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit, !0,0,mxUtils.bind(this,function(a){this.hsplitPosition=a;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";420>screen.width&&(a.style.maxWidth=Math.max(20,screen.width-320)+"px",a.style.overflow="hidden");return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a};EditorUi.prototype.createToolbar=function(a){return new Toolbar(this,a)}; EditorUi.prototype.createSidebar=function(a){return new Sidebar(this,a)};EditorUi.prototype.createFormat=function(a){return new Format(this,a)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(a){var d=document.createElement("div");d.className=a;return d}; -EditorUi.prototype.addSplitHandler=function(a,d,e,b){function k(a){if(null!=p){var g=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));b(Math.max(0,q+(d?g.x-p.x:p.y-g.y)-e));mxEvent.consume(a);q!=f()&&(v=!0,c=null)}}function m(a){k(a);p=q=null}var p=null,q=null,v=!0,c=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var f=mxUtils.bind(this,function(){var c=parseInt(d?a.style.left:a.style.bottom);d||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){p=new mxPoint(mxEvent.getClientX(a), -mxEvent.getClientY(a));q=f();v=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",function(a){if(!v){var d=null!=c?c-e:0;c=f();b(d);mxEvent.consume(a)}});mxEvent.addGestureListeners(document,null,k,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,m)})};EditorUi.prototype.showDialog=function(a,d,e,b,k,m,p){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,d,e,b,k,m,p);this.dialogs.push(this.dialog)}; +EditorUi.prototype.addSplitHandler=function(a,d,e,b){function h(a){if(null!=p){var g=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));b(Math.max(0,q+(d?g.x-p.x:p.y-g.y)-e));mxEvent.consume(a);q!=f()&&(v=!0,c=null)}}function m(a){h(a);p=q=null}var p=null,q=null,v=!0,c=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var f=mxUtils.bind(this,function(){var c=parseInt(d?a.style.left:a.style.bottom);d||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){p=new mxPoint(mxEvent.getClientX(a), +mxEvent.getClientY(a));q=f();v=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){if(!v&&this.hsplitClickEnabled){var d=null!=c?c-e:0;c=f();b(d);mxEvent.consume(a)}}));mxEvent.addGestureListeners(document,null,h,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,h,m)})}; +EditorUi.prototype.showDialog=function(a,d,e,b,h,m,p){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,d,e,b,h,m,p);this.dialogs.push(this.dialog)}; EditorUi.prototype.hideDialog=function(a){null!=this.dialogs&&0<this.dialogs.length&&(this.dialogs.pop().close(a),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&this.editor.graph.container.focus(),mxUtils.clearSelection(),this.editor.fireEvent(new mxEventObject("hideDialog")))}; -EditorUi.prototype.pickColor=function(a,d){var e=this.editor.graph,b=e.cellEditor.saveSelection(),k=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(b);d(a)},function(){e.cellEditor.restoreSelection(b)});this.showDialog(k.container,230,430,!0,!1);k.init()}; +EditorUi.prototype.pickColor=function(a,d){var e=this.editor.graph,b=e.cellEditor.saveSelection(),h=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(b);d(a)},function(){e.cellEditor.restoreSelection(b)});this.showDialog(h.container,230,430,!0,!1);h.init()}; EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})}; -EditorUi.prototype.extractGraphModelFromHtml=function(a){var d=null;try{var e=a.indexOf("<mxGraphModel ");if(0<=e){var b=a.lastIndexOf("</mxGraphModel>");b>e&&(d=a.substring(e,b+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(k){}return d}; +EditorUi.prototype.extractGraphModelFromHtml=function(a){var d=null;try{var e=a.indexOf("<mxGraphModel ");if(0<=e){var b=a.lastIndexOf("</mxGraphModel>");b>e&&(d=a.substring(e,b+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(h){}return d}; EditorUi.prototype.extractGraphModelFromEvent=function(a){var d=null,e=null;null!=a&&(a=null!=a.dataTransfer?a.dataTransfer:a.clipboardData,null!=a&&(10==document.documentMode||11==document.documentMode?e=a.getData("Text"):(e=0<=mxUtils.indexOf(a.types,"text/html")?a.getData("text/html"):null,mxUtils.indexOf(a.types,null==e||0==e.length)&&(e=a.getData("text/plain"))),null!=e&&(e=this.editor.graph.zapGremlins(mxUtils.trim(e)),a=this.extractGraphModelFromHtml(e),null!=a&&(e=a))));null!=e&&this.isCompatibleString(e)&& (d=e);return d};EditorUi.prototype.isCompatibleString=function(a){return!1};EditorUi.prototype.saveFile=function(a){a||null==this.editor.filename?(a=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(a){this.save(a)}),null,mxUtils.bind(this,function(a){if(null!=a&&0<a.length)return!0;mxUtils.confirm(mxResources.get("invalidName"));return!1})),this.showDialog(a.container,300,100,!0,!0),a.init()):this.save(this.editor.getOrCreateFilename())}; EditorUi.prototype.save=function(a){if(null!=a){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(a)&&!mxUtils.confirm(mxResources.get("replaceIt",[a])))return;localStorage.setItem(a,d);this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}else if(d.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(a)+"&xml="+encodeURIComponent(d))).simulate(document, "_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(d);return}this.editor.setModified(!1);this.editor.setFilename(a);this.updateDocumentTitle()}catch(e){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}}; -EditorUi.prototype.executeLayout=function(a,d,e){var b=this.editor.graph;if(b.isEnabled()){b.getModel().beginUpdate();try{a()}catch(k){throw k;}finally{this.allowAnimation&&d&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(b),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){b.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(b.getModel().endUpdate(),null!=e&&e())}}}; -EditorUi.prototype.showImageDialog=function(a,d,e,b){b=this.editor.graph.cellEditor;var k=b.saveSelection(),m=mxUtils.prompt(a,d);b.restoreSelection(k);if(null!=m&&0<m.length){var p=new Image;p.onload=function(){e(m,p.width,p.height)};p.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};p.src=m}else e(null)};EditorUi.prototype.showLinkDialog=function(a,d,e){a=new LinkDialog(this,a,d,e);this.showDialog(a.container,420,90,!0,!0);a.init()}; +EditorUi.prototype.executeLayout=function(a,d,e){var b=this.editor.graph;if(b.isEnabled()){b.getModel().beginUpdate();try{a()}catch(h){throw h;}finally{this.allowAnimation&&d&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(b),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){b.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(b.getModel().endUpdate(),null!=e&&e())}}}; +EditorUi.prototype.showImageDialog=function(a,d,e,b){b=this.editor.graph.cellEditor;var h=b.saveSelection(),m=mxUtils.prompt(a,d);b.restoreSelection(h);if(null!=m&&0<m.length){var p=new Image;p.onload=function(){e(m,p.width,p.height)};p.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};p.src=m}else e(null)};EditorUi.prototype.showLinkDialog=function(a,d,e){a=new LinkDialog(this,a,d,e);this.showDialog(a.container,420,90,!0,!0);a.init()}; EditorUi.prototype.showDataDialog=function(a){null!=a&&(a=new EditDataDialog(this,a),this.showDialog(a.container,340,340,!0,!1,null,!1),a.init())}; EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var d=mxUtils.prompt(mxResources.get("backgroundImage"),"");if(null!=d&&0<d.length){var e=new Image;e.onload=function(){a(new mxImage(d,e.width,e.height))};e.onerror=function(){a(null);mxUtils.alert(mxResources.get("fileNotFound"))};e.src=d}else a(null)}; EditorUi.prototype.setBackgroundImage=function(a){this.editor.graph.setBackgroundImage(a);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(a,d,e){mxUtils.confirm(a)?null!=d&&d():null!=e&&e()}; EditorUi.prototype.createOutline=function(a){var d=new mxOutline(this.editor.graph);d.border=20;mxEvent.addListener(window,"resize",function(){d.update()});this.addListener("pageFormatChanged",function(){d.update()});return d}; EditorUi.prototype.createKeyHandler=function(a){function d(a,c,d){p.push(function(){if(!b.isSelectionEmpty()&&b.isEnabled())if(c=null!=c?c:1,d){b.getModel().beginUpdate();try{for(var f=b.getSelectionCells(),g=0;g<f.length;g++)if(b.getModel().isVertex(f[g])&&b.isCellResizable(f[g])){var e=b.getCellGeometry(f[g]);null!=e&&(e=e.clone(),37==a?e.width=Math.max(0,e.width-c):38==a?e.height=Math.max(0,e.height-c):39==a?e.width+=c:40==a&&(e.height+=c),b.getModel().setGeometry(f[g],e))}}finally{b.getModel().endUpdate()}}else f= b.getSelectionCell(),g=b.model.getParent(f),e=null,1==b.getSelectionCount()&&b.model.isVertex(f)&&null!=b.layoutManager&&!b.isCellLocked(f)&&(e=b.layoutManager.getLayout(g)),null!=e&&e.constructor==mxStackLayout?(e=g.getIndex(f),37==a||38==a?b.model.add(g,f,Math.max(0,e-1)):39!=a&&40!=a||b.model.add(g,f,Math.min(b.model.getChildCount(g),e+1))):(g=f=0,37==a?f=-c:38==a?g=-c:39==a?f=c:40==a&&(g=c),b.moveCells(b.getMovableCells(b.getSelectionCells()),f,g))});null!=q&&window.clearTimeout(q);q=window.setTimeout(function(){if(0< -p.length){b.getModel().beginUpdate();try{for(var a=0;a<p.length;a++)p[a]();p=[]}finally{b.getModel().endUpdate()}b.scrollCellToVisible(b.getSelectionCell())}},200)}var e=this,b=this.editor.graph,k=new mxKeyHandler(b),m=k.isEventIgnored;k.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&& -!mxClient.IS_SF)&&m.apply(this,arguments)};k.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};k.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var p=[],q=null,v={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},c=k.getFunction,f={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"), +p.length){b.getModel().beginUpdate();try{for(var a=0;a<p.length;a++)p[a]();p=[]}finally{b.getModel().endUpdate()}b.scrollCellToVisible(b.getSelectionCell())}},200)}var e=this,b=this.editor.graph,h=new mxKeyHandler(b),m=h.isEventIgnored;h.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&& +!mxClient.IS_SF)&&m.apply(this,arguments)};h.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};h.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var p=[],q=null,v={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},c=h.getFunction,f={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"), 76:this.actions.get("editLink"),80:this.actions.get("connectionPoints"),84:this.actions.get("editTooltip"),86:this.actions.get("pasteSize"),88:this.actions.get("copySize")};mxKeyHandler.prototype.getFunction=function(a){if(b.isEnabled()){if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){var g=f[a.keyCode];if(null!=g)return g.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){b.selectParentCell()}:function(){b.selectChildCell()};if(null!=v[a.keyCode]&&!b.isSelectionEmpty())if(mxEvent.isShiftDown(a)&& mxEvent.isAltDown(a)){if(b.model.isVertex(b.getSelectionCell()))return function(){var c=b.connectVertex(b.getSelectionCell(),v[a.keyCode],b.defaultEdgeLength,a,!0);null!=c&&0<c.length&&(1==c.length&&b.model.isEdge(c[0])?b.setSelectionCell(b.model.getTerminal(c[0],!1)):b.setSelectionCell(c[c.length-1]),b.scrollCellToVisible(b.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(b.getSelectionCell())))}}else return this.isControlDown(a)?function(){d(a.keyCode,mxEvent.isShiftDown(a)? -b.gridSize:null,!0)}:function(){d(a.keyCode,mxEvent.isShiftDown(a)?b.gridSize:null)}}return c.apply(this,arguments)};k.bindAction=mxUtils.bind(this,function(a,c,d,b){var f=this.actions.get(d);null!=f&&(d=function(){f.isEnabled()&&f.funct()},c?b?k.bindControlShiftKey(a,d):k.bindControlKey(a,d):b?k.bindShiftKey(a,d):k.bindKey(a,d))});var g=k.escape;k.escape=function(a){g.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){b.exitGroup()});k.bindControlShiftKey(35,function(){b.enterGroup()}); -k.bindKey(36,function(){b.home()});k.bindKey(35,function(){b.refresh()});k.bindAction(107,!0,"zoomIn");k.bindAction(109,!0,"zoomOut");k.bindAction(80,!0,"print");k.bindAction(79,!0,"outline",!0);k.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)k.bindControlKey(36,function(){b.isEnabled()&&b.foldCells(!0)}),k.bindControlKey(35,function(){b.isEnabled()&&b.foldCells(!1)}),k.bindControlKey(13,function(){b.isEnabled()&&b.setSelectionCells(b.duplicateCells(b.getSelectionCells(), -!1))}),k.bindAction(8,!1,"delete"),k.bindAction(8,!0,"deleteAll"),k.bindAction(46,!1,"delete"),k.bindAction(46,!0,"deleteAll"),k.bindAction(72,!0,"resetView"),k.bindAction(72,!0,"fitWindow",!0),k.bindAction(74,!0,"fitPage"),k.bindAction(74,!0,"fitTwoPages",!0),k.bindAction(48,!0,"customZoom"),k.bindAction(82,!0,"turn"),k.bindAction(82,!0,"clearDefaultStyle",!0),k.bindAction(83,!0,"save"),k.bindAction(83,!0,"saveAs",!0),k.bindAction(65,!0,"selectAll"),k.bindAction(65,!0,"selectNone",!0),k.bindAction(73, -!0,"selectVertices",!0),k.bindAction(69,!0,"selectEdges",!0),k.bindAction(69,!0,"editStyle"),k.bindAction(66,!0,"bold"),k.bindAction(66,!0,"toBack",!0),k.bindAction(70,!0,"toFront",!0),k.bindAction(68,!0,"duplicate"),k.bindAction(68,!0,"setAsDefaultStyle",!0),k.bindAction(90,!0,"undo"),k.bindAction(89,!0,"autosize",!0),k.bindAction(88,!0,"cut"),k.bindAction(67,!0,"copy"),k.bindAction(86,!0,"paste"),k.bindAction(71,!0,"group"),k.bindAction(77,!0,"editData"),k.bindAction(71,!0,"grid",!0),k.bindAction(73, -!0,"italic"),k.bindAction(76,!0,"lockUnlock"),k.bindAction(76,!0,"layers",!0),k.bindAction(80,!0,"formatPanel",!0),k.bindAction(85,!0,"underline"),k.bindAction(85,!0,"ungroup",!0),k.bindAction(190,!0,"superscript"),k.bindAction(188,!0,"subscript"),k.bindKey(13,function(){b.isEnabled()&&b.startEditingAtCell()}),k.bindKey(113,function(){b.isEnabled()&&b.startEditingAtCell()});mxClient.IS_WIN?k.bindAction(89,!0,"redo"):k.bindAction(90,!0,"redo",!0);return k}; +b.gridSize:null,!0)}:function(){d(a.keyCode,mxEvent.isShiftDown(a)?b.gridSize:null)}}return c.apply(this,arguments)};h.bindAction=mxUtils.bind(this,function(a,c,d,b){var f=this.actions.get(d);null!=f&&(d=function(){f.isEnabled()&&f.funct()},c?b?h.bindControlShiftKey(a,d):h.bindControlKey(a,d):b?h.bindShiftKey(a,d):h.bindKey(a,d))});var g=h.escape;h.escape=function(a){g.apply(this,arguments)};h.enter=function(){};h.bindControlShiftKey(36,function(){b.exitGroup()});h.bindControlShiftKey(35,function(){b.enterGroup()}); +h.bindKey(36,function(){b.home()});h.bindKey(35,function(){b.refresh()});h.bindAction(107,!0,"zoomIn");h.bindAction(109,!0,"zoomOut");h.bindAction(80,!0,"print");h.bindAction(79,!0,"outline",!0);h.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)h.bindControlKey(36,function(){b.isEnabled()&&b.foldCells(!0)}),h.bindControlKey(35,function(){b.isEnabled()&&b.foldCells(!1)}),h.bindControlKey(13,function(){b.isEnabled()&&b.setSelectionCells(b.duplicateCells(b.getSelectionCells(), +!1))}),h.bindAction(8,!1,"delete"),h.bindAction(8,!0,"deleteAll"),h.bindAction(46,!1,"delete"),h.bindAction(46,!0,"deleteAll"),h.bindAction(72,!0,"resetView"),h.bindAction(72,!0,"fitWindow",!0),h.bindAction(74,!0,"fitPage"),h.bindAction(74,!0,"fitTwoPages",!0),h.bindAction(48,!0,"customZoom"),h.bindAction(82,!0,"turn"),h.bindAction(82,!0,"clearDefaultStyle",!0),h.bindAction(83,!0,"save"),h.bindAction(83,!0,"saveAs",!0),h.bindAction(65,!0,"selectAll"),h.bindAction(65,!0,"selectNone",!0),h.bindAction(73, +!0,"selectVertices",!0),h.bindAction(69,!0,"selectEdges",!0),h.bindAction(69,!0,"editStyle"),h.bindAction(66,!0,"bold"),h.bindAction(66,!0,"toBack",!0),h.bindAction(70,!0,"toFront",!0),h.bindAction(68,!0,"duplicate"),h.bindAction(68,!0,"setAsDefaultStyle",!0),h.bindAction(90,!0,"undo"),h.bindAction(89,!0,"autosize",!0),h.bindAction(88,!0,"cut"),h.bindAction(67,!0,"copy"),h.bindAction(86,!0,"paste"),h.bindAction(71,!0,"group"),h.bindAction(77,!0,"editData"),h.bindAction(71,!0,"grid",!0),h.bindAction(73, +!0,"italic"),h.bindAction(76,!0,"lockUnlock"),h.bindAction(76,!0,"layers",!0),h.bindAction(80,!0,"formatPanel",!0),h.bindAction(85,!0,"underline"),h.bindAction(85,!0,"ungroup",!0),h.bindAction(190,!0,"superscript"),h.bindAction(188,!0,"subscript"),h.bindKey(13,function(){b.isEnabled()&&b.startEditingAtCell()}),h.bindKey(113,function(){b.isEnabled()&&b.startEditingAtCell()});mxClient.IS_WIN?h.bindAction(89,!0,"redo"):h.bindAction(90,!0,"redo",!0);return h}; EditorUi.prototype.destroy=function(){null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&& (mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window, "scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(var a=0;a<this.destroyFunctions.length;a++)this.destroyFunctions[a]();this.destroyFunctions=null}for(var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog],a=0;a<d.length;a++)null!=d[a]&&null!=d[a].parentNode&&d[a].parentNode.removeChild(d[a])};"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0);mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1; (function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(d){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1; mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]"; -Graph=function(a,d,e,b,k){mxGraph.call(this,a,d,e,b);this.themes=k||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;d=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=a.indexOf("/",d+2),0<d&&(this.domainUrl=a.substring(0,d)),d=a.lastIndexOf("/"),0<d&&(this.domainPathUrl=a.substring(0,d+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a); +Graph=function(a,d,e,b,h){mxGraph.call(this,a,d,e,b);this.themes=h||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;d=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=a.indexOf("/",d+2),0<d&&(this.domainUrl=a.substring(0,d)),d=a.lastIndexOf("/"),0<d&&(this.domainPathUrl=a.substring(0,d+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a); return"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]};if(this.edgeMode){var m=null,p=null,q=null,v=null,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,d){if("mouseDown"==d.getProperty("eventName")&&this.isEnabled()){var b=d.getProperty("event");if(!mxEvent.isControlDown(b.getEvent())&&!mxEvent.isShiftDown(b.getEvent())){var f=b.getState();null!=f&&this.model.isEdge(f.cell)&&(m=new mxPoint(b.getGraphX(),b.getGraphY()),c=this.isCellSelected(f.cell),q=f,p=b,null!= f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,b.getGraphX(),b.getGraphY())?v=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(v=f.getHandleForEvent(b))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,d){var b=this.selectionCellsHandler.handlers.map,f;for(f in b)if(null!=b[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(d.getEvent())&& -!mxEvent.isShiftDown(d.getEvent())&&!mxEvent.isAltDown(d.getEvent()))if(f=this.tolerance,null!=m&&null!=q&&null!=p){if(b=q,Math.abs(m.x-d.getGraphX())>f||Math.abs(m.y-d.getGraphY())>f){this.isCellSelected(b.cell)||this.setSelectionCell(b.cell);var g=this.selectionCellsHandler.getHandler(b.cell);if(null!=g&&null!=g.bends&&0<g.bends.length){var e=g.getHandleForEvent(p),l=this.view.getEdgeStyle(b);f=l==mxEdgeStyle.EntityRelation;c||v!=mxEvent.LABEL_HANDLE||(e=v);if(f&&0!=e&&e!=g.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f|| -null==b.visibleSourceState&&null==b.visibleTargetState||(this.graphHandler.reset(),d.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=b.visibleSourceState||e==g.bends.length-1||null!=b.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=b.absolutePoints,null!=f&&(null==l&&null==e||l==mxEdgeStyle.OrthConnector)&&(e=v,null==e&&(e=new mxRectangle(m.x,m.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)? -e=g.bends.length-1:null!=l&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(b,m.x,m.y),e=null==l?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),g.start(d.getGraphX(),d.getGraphX(),e),v=m=p=q=null,c=!1,d.consume(),this.graphHandler.reset()}}}else if(b=d.getState(),null!=b&&this.model.isEdge(b.cell)){g=null;f=b.absolutePoints;if(null!=f)if(e=new mxRectangle(d.getGraphX(), -d.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,d.getGraphX(),d.getGraphY()))g="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))g="pointer";else if(null!=b.visibleSourceState||null!=b.visibleTargetState)l=this.view.getEdgeStyle(b),g="crosshair",l!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(b)&&(l=mxUtils.findNearestSegment(b,d.getGraphX(),d.getGraphY()), -l<f.length-1&&0<=l&&(g=0==Math.round(f[l].x-f[l+1].x)?"col-resize":"row-resize"));null!=g&&b.setCursor(g)}}),mouseUp:mxUtils.bind(this,function(a,c){v=m=p=q=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0); +!mxEvent.isShiftDown(d.getEvent())&&!mxEvent.isAltDown(d.getEvent()))if(f=this.tolerance,null!=m&&null!=q&&null!=p){if(b=q,Math.abs(m.x-d.getGraphX())>f||Math.abs(m.y-d.getGraphY())>f){this.isCellSelected(b.cell)||this.setSelectionCell(b.cell);var g=this.selectionCellsHandler.getHandler(b.cell);if(null!=g&&null!=g.bends&&0<g.bends.length){var e=g.getHandleForEvent(p),k=this.view.getEdgeStyle(b);f=k==mxEdgeStyle.EntityRelation;c||v!=mxEvent.LABEL_HANDLE||(e=v);if(f&&0!=e&&e!=g.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f|| +null==b.visibleSourceState&&null==b.visibleTargetState||(this.graphHandler.reset(),d.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=b.visibleSourceState||e==g.bends.length-1||null!=b.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=b.absolutePoints,null!=f&&(null==k&&null==e||k==mxEdgeStyle.OrthConnector)&&(e=v,null==e&&(e=new mxRectangle(m.x,m.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)? +e=g.bends.length-1:null!=k&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(b,m.x,m.y),e=null==k?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),g.start(d.getGraphX(),d.getGraphX(),e),v=m=p=q=null,c=!1,d.consume(),this.graphHandler.reset()}}}else if(b=d.getState(),null!=b&&this.model.isEdge(b.cell)){g=null;f=b.absolutePoints;if(null!=f)if(e=new mxRectangle(d.getGraphX(), +d.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,d.getGraphX(),d.getGraphY()))g="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))g="pointer";else if(null!=b.visibleSourceState||null!=b.visibleTargetState)k=this.view.getEdgeStyle(b),g="crosshair",k!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(b)&&(k=mxUtils.findNearestSegment(b,d.getGraphX(),d.getGraphY()), +k<f.length-1&&0<=k&&(g=0==Math.round(f[k].x-f[k+1].x)?"col-resize":"row-resize"));null!=g&&b.setCursor(g)}}),mouseUp:mxUtils.bind(this,function(a,c){v=m=p=q=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0); this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(a,c){return!1};this.alternateEdgeStyle="vertical";null==b&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates= -function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],d=this.graph.pageFormat,b=this.graph.pageScale,e=d.width*b,d=d.height*b,b=this.graph.view.translate,g=this.graph.view.scale,l=this.graph.getPageLayout(),h=0;h<l.width;h++)c.push(new mxRectangle(((l.x+h)*e+b.x)*g,(l.y*d+b.y)*g,e*g,d*g));for(h=0;h<l.height;h++)c.push(new mxRectangle((l.x*e+b.x)*g,((l.y+h)*d+b.y)*g,e*g,d*g));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor= +function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],d=this.graph.pageFormat,b=this.graph.pageScale,e=d.width*b,d=d.height*b,b=this.graph.view.translate,g=this.graph.view.scale,k=this.graph.getPageLayout(),l=0;l<k.width;l++)c.push(new mxRectangle(((k.x+l)*e+b.x)*g,(k.y*d+b.y)*g,e*g,d*g));for(l=0;l<k.height;l++)c.push(new mxRectangle((k.x*e+b.x)*g,((k.y+l)*d+b.y)*g,e*g,d*g));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor= function(a,c){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var c=mxGraphHandler.prototype.getCells.apply(this,arguments),d=[],b=0;b<c.length;b++){var f=this.graph.view.getState(c[b]),f=null!=f?f.style:this.graph.getCellStyle(c[b]); "1"==mxUtils.getValue(f,"part","0")?(f=this.graph.model.getParent(c[b]),this.graph.model.isVertex(f)&&0>mxUtils.indexOf(c,f)&&d.push(f)):d.push(c[b])}return d};this.connectionHandler.createTargetVertex=function(a,c){var d=this.graph.view.getState(c),d=null!=d?d.style:this.graph.getCellStyle(c);mxUtils.getValue(d,"part",!1)&&(d=this.graph.model.getParent(c),this.graph.model.isVertex(d)&&(c=d));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var g=new mxRubberband(this); -this.getRubberband=function(){return g};var u=(new Date).getTime(),t=0,h=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;h.apply(this,arguments);a!=this.currentState?(u=(new Date).getTime(),t=0):t=(new Date).getTime()-u};var n=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<t||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style, -"outlineConnect","1"))&&n.apply(this,arguments)};var l=this.isToggleEvent;this.isToggleEvent=function(a){return l.apply(this,arguments)||mxEvent.isShiftDown(a)};var w=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return w.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var r=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&& +this.getRubberband=function(){return g};var u=(new Date).getTime(),t=0,l=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;l.apply(this,arguments);a!=this.currentState?(u=(new Date).getTime(),t=0):t=(new Date).getTime()-u};var n=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<t||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style, +"outlineConnect","1"))&&n.apply(this,arguments)};var k=this.isToggleEvent;this.isToggleEvent=function(a){return k.apply(this,arguments)||mxEvent.isShiftDown(a)};var w=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return w.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var r=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&& (r=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=r)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var y=this.click;this.click=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);if(this.isEnabled()&&!c||a.isConsumed())return y.apply(this, arguments);c=c?a.sourceState.cell:a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&(this.isCustomLink(c)?this.customLinkClicked(c):this.openLink(c)))};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(c?a.sourceState.cell:a.getCell())};var D=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()||this.isCellLocked(a)){if(null!= -this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return D.apply(this,arguments)};this.selectRegion=function(a,c){var d=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(d,c);return d};this.getAllCells=function(a,c,d,b,f,g){g=null!=g?g:[];if(0<d||0<b){var e=this.getModel(),l=a+d,h=c+b;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var u=e.getChildCount(f),r=0;r<u;r++){var n=e.getChildAt(f,r),t=this.view.getState(n);if(null!= -t&&this.isCellVisible(n)&&"1"!=mxUtils.getValue(t.style,"locked","0")){var w=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0;0!=w&&(t=mxUtils.getBoundingBox(t,w));(e.isEdge(n)||e.isVertex(n))&&t.x>=a&&t.y+t.height<=h&&t.y>=c&&t.x+t.width<=l&&g.push(n);this.getAllCells(a,c,d,b,n,g)}}}return g};var z=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,d){return this.graph.isCellSelected(a)?!1:z.apply(this,arguments)};this.isCellLocked=function(a){for(a= +this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return D.apply(this,arguments)};this.selectRegion=function(a,c){var d=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(d,c);return d};this.getAllCells=function(a,c,d,b,f,g){g=null!=g?g:[];if(0<d||0<b){var e=this.getModel(),k=a+d,l=c+b;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var u=e.getChildCount(f),r=0;r<u;r++){var n=e.getChildAt(f,r),t=this.view.getState(n);if(null!= +t&&this.isCellVisible(n)&&"1"!=mxUtils.getValue(t.style,"locked","0")){var w=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0;0!=w&&(t=mxUtils.getBoundingBox(t,w));(e.isEdge(n)||e.isVertex(n))&&t.x>=a&&t.y+t.height<=l&&t.y>=c&&t.x+t.width<=k&&g.push(n);this.getAllCells(a,c,d,b,n,g)}}}return g};var z=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,d){return this.graph.isCellSelected(a)?!1:z.apply(this,arguments)};this.isCellLocked=function(a){for(a= this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var G=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var d=c.getProperty("event").getState();G=null==d||this.isSelectionEmpty()||this.isCellSelected(d.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var d= c.getProperty("event"),b=c.getProperty("cell");null==b?(d=mxUtils.convertPoint(this.container,mxEvent.getClientX(d),mxEvent.getClientY(d)),g.start(d.x,d.y)):null!=G?this.addSelectionCells(G):1<this.getSelectionCount()&&this.isCellSelected(b)&&this.removeSelectionCell(b);G=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE, mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var E=this.updateMouseEvent;this.updateMouseEvent=function(a){a=E.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state=null);return a}}}; @@ -2208,7 +2209,7 @@ Graph.createSvgImage=function(a,d,e){e=unescape(encodeURIComponent('<!DOCTYPE sv Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.defaultScrollbars=!mxClient.IS_IOS;Graph.prototype.defaultPageVisible=!0;Graph.prototype.lightbox=!1;Graph.prototype.defaultPageBackgroundColor="#ffffff";Graph.prototype.defaultPageBorderColor="#ffffff";Graph.prototype.defaultGraphBackground="#ffffff";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400); Graph.prototype.transparentBackground=!0;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}]+)%","g");Graph.prototype.absoluteUrlPattern=/^(?:[a-z]+:)?\/\//i;Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?decodeURIComponent(urlParams.base):(window!=window.top?document.referrer:document.location.toString()).split("#")[0]; Graph.prototype.editAfterInsert=!1; -Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var d=a.view.graph.tolerance,k=!0,m=null,p=mxUtils.bind(this,function(a){k=!0;m=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),q=mxUtils.bind(this,function(a){k=k&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<d&&Math.abs(m.y-mxEvent.getClientY(a))<d}),v=mxUtils.bind(this,function(c){if(k)for(var d=mxEvent.getSource(c);null!= +Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var d=a.view.graph.tolerance,h=!0,m=null,p=mxUtils.bind(this,function(a){h=!0;m=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),q=mxUtils.bind(this,function(a){h=h&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<d&&Math.abs(m.y-mxEvent.getClientY(a))<d}),v=mxUtils.bind(this,function(c){if(h)for(var d=mxEvent.getSource(c);null!= d&&d!=e.node;){if("a"==d.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,d,c);break}d=d.parentNode}});mxEvent.addGestureListeners(e.node,p,q,v);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};Graph.prototype.isLightboxView=function(){return this.lightbox}; Graph.prototype.labelLinkClicked=function(a,d,e){d=d.getAttribute("href");if(null!=d&&!this.isCustomLink(d)&&mxEvent.isLeftMouseButton(e)&&!mxEvent.isPopupTrigger(e)||mxEvent.isTouchEvent(e)){if(!this.isEnabled()||this.isCellLocked(a.cell))a=this.isBlankLink(d)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(d),a);mxEvent.consume(e)}}; Graph.prototype.openLink=function(a,d){var e=window;if("_self"==d&&window!=window.top)window.location.href=a;else if(a.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==a.charAt(this.baseUrl.length)&&"_top"==d&&window==window.top){var b=a.split("#")[1];window.location.hash=="#"+b&&(window.location.hash="");window.location.hash=b}else e=window.open(a,d);return e};Graph.prototype.getLinkTitle=function(a){return a.substring(a.lastIndexOf("/")+1)}; @@ -2218,41 +2219,41 @@ Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutMana "resizeLast","0"),d.spacing=a.stackSpacing||d.spacing,d.border=a.stackBorder||d.border,d.marginLeft=a.marginLeft||0,d.marginRight=a.marginRight||0,d.marginTop=a.marginTop||0,d.marginBottom=a.marginBottom||0,d.fill=!0,d):"treeLayout"==a.childLayout?(d=new mxCompactTreeLayout(this.graph),d.horizontal="1"==mxUtils.getValue(a,"horizontalTree","1"),d.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),d.groupPadding=mxUtils.getValue(a,"parentPadding",20),d.levelDistance=mxUtils.getValue(a,"treeLevelDistance", 30),d.maintainParentLocation=!0,d.edgeRouting=!1,d.resetEdges=!1,d):"flowLayout"==a.childLayout?(d=new mxHierarchicalLayout(this.graph,mxUtils.getValue(a,"flowOrientation",mxConstants.DIRECTION_EAST)),d.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),d.parentBorder=mxUtils.getValue(a,"parentPadding",20),d.maintainParentLocation=!0,d.intraCellSpacing=mxUtils.getValue(a,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),d.interRankCellSpacing=mxUtils.getValue(a,"interRankCellSpacing", mxHierarchicalLayout.prototype.interRankCellSpacing),d.interHierarchySpacing=mxUtils.getValue(a,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),d.parallelEdgeSpacing=mxUtils.getValue(a,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),d):null}};Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize}; -Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),d=this.getGraphBounds();if(0==d.width||0==d.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(d.x/this.view.scale-this.view.translate.x),b=Math.ceil(d.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),m=Math.floor(b/a.height);return new mxRectangle(k,m,Math.ceil((e+Math.floor(d.width/this.view.scale))/a.width)-k,Math.ceil((b+Math.floor(d.height/this.view.scale))/a.height)-m)}; +Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),d=this.getGraphBounds();if(0==d.width||0==d.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(d.x/this.view.scale-this.view.translate.x),b=Math.ceil(d.y/this.view.scale-this.view.translate.y),h=Math.floor(e/a.width),m=Math.floor(b/a.height);return new mxRectangle(h,m,Math.ceil((e+Math.floor(d.width/this.view.scale))/a.width)-h,Math.ceil((b+Math.floor(d.height/this.view.scale))/a.height)-m)}; Graph.prototype.sanitizeHtml=function(a,d){return html_sanitize(a,function(a){return null!=a&&"javascript:"!==a.toString().toLowerCase().substring(0,11)?a:null},function(a){return a})};Graph.prototype.updatePlaceholders=function(){var a=!1,d;for(d in this.model.cells){var e=this.model.cells[d];this.isReplacePlaceholders(e)&&(this.view.invalidate(e,!1,!1),a=!0)}a&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(a){return null!=a.value&&"object"==typeof a.value&&"1"==a.value.getAttribute("placeholders")}; Graph.prototype.isZoomWheelEvent=function(a){return mxEvent.isAltDown(a)||mxEvent.isControlDown(a)&&!mxClient.IS_MAC};Graph.prototype.isTransparentClickEvent=function(a){return mxEvent.isAltDown(a)};Graph.prototype.isIgnoreTerminalEvent=function(a){return mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)};Graph.prototype.isSplitTarget=function(a,d,e){return!this.model.isEdge(d[0])&&!mxEvent.isAltDown(e)&&!mxEvent.isShiftDown(e)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)}; Graph.prototype.getLabel=function(a){var d=mxGraph.prototype.getLabel.apply(this,arguments);null!=d&&this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder")&&(d=this.replacePlaceholders(a,d));return d};Graph.prototype.isLabelMovable=function(a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(d,"labelMovable","0")))}; Graph.prototype.setGridSize=function(a){this.gridSize=a;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.getGlobalVariable=function(a){var d=null;"date"==a?d=(new Date).toLocaleDateString():"time"==a?d=(new Date).toLocaleTimeString():"timestamp"==a?d=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),d=this.formatDate(new Date,a));return d}; Graph.prototype.formatDate=function(a,d,e){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy", -shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var b=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,p=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)|| -/\d/.test(a)||(d=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");d=String(b.masks[d]||d||b.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),e=!0);var q=e?"getUTC":"get",v=a[q+"Date"](),c=a[q+"Day"](),f=a[q+"Month"](),g=a[q+"FullYear"](),u=a[q+"Hours"](),t=a[q+"Minutes"](),h=a[q+"Seconds"](),q=a[q+"Milliseconds"](),n=e?0:a.getTimezoneOffset(),l={d:v,dd:p(v),ddd:b.i18n.dayNames[c],dddd:b.i18n.dayNames[c+7],m:f+1,mm:p(f+1),mmm:b.i18n.monthNames[f],mmmm:b.i18n.monthNames[f+ -12],yy:String(g).slice(2),yyyy:g,h:u%12||12,hh:p(u%12||12),H:u,HH:p(u),M:t,MM:p(t),s:h,ss:p(h),l:p(q,3),L:p(99<q?Math.round(q/10):q),t:12>u?"a":"p",tt:12>u?"am":"pm",T:12>u?"A":"P",TT:12>u?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0<n?"-":"+")+p(100*Math.floor(Math.abs(n)/60)+Math.abs(n)%60,4),S:["th","st","nd","rd"][3<v%10?0:(10!=v%100-v%10)*v%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in l?l[a]:a.slice(1, +shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var b=this.dateFormatCache,h=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,p=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)|| +/\d/.test(a)||(d=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");d=String(b.masks[d]||d||b.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),e=!0);var q=e?"getUTC":"get",v=a[q+"Date"](),c=a[q+"Day"](),f=a[q+"Month"](),g=a[q+"FullYear"](),u=a[q+"Hours"](),t=a[q+"Minutes"](),l=a[q+"Seconds"](),q=a[q+"Milliseconds"](),n=e?0:a.getTimezoneOffset(),k={d:v,dd:p(v),ddd:b.i18n.dayNames[c],dddd:b.i18n.dayNames[c+7],m:f+1,mm:p(f+1),mmm:b.i18n.monthNames[f],mmmm:b.i18n.monthNames[f+ +12],yy:String(g).slice(2),yyyy:g,h:u%12||12,hh:p(u%12||12),H:u,HH:p(u),M:t,MM:p(t),s:l,ss:p(l),l:p(q,3),L:p(99<q?Math.round(q/10):q),t:12>u?"a":"p",tt:12>u?"am":"pm",T:12>u?"A":"P",TT:12>u?"AM":"PM",Z:e?"UTC":(String(a).match(h)||[""]).pop().replace(m,""),o:(0<n?"-":"+")+p(100*Math.floor(Math.abs(n)/60)+Math.abs(n)%60,4),S:["th","st","nd","rd"][3<v%10?0:(10!=v%100-v%10)*v%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in k?k[a]:a.slice(1, a.length-1)})}; -Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var d=this.getModel(),e=d.getChildCount(d.root),b=0;b<e;b++)mxUtils.bind(this,function(b){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var k=document.createElement("input");k.style.display="inline-block";k.setAttribute("type","checkbox");d.isVisible(b)&&(k.setAttribute("checked","checked"), -k.defaultChecked=!0);e.appendChild(k);var q=this.convertValueToString(b)||mxResources.get("background")||"Background";e.setAttribute("title",q);mxUtils.write(e,q);a.appendChild(e);mxEvent.addListener(k,"click",function(){null!=k.getAttribute("checked")?k.removeAttribute("checked"):k.setAttribute("checked","checked");d.setVisible(b,k.checked)})})(d.getChildAt(d.root,b));return a}; -Graph.prototype.replacePlaceholders=function(a,d){var e=[];if(null!=d){for(var b=0;match=this.placeholderPattern.exec(d);){var k=match[0];if(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var m=null;if(match.index>b&&"%"==d.charAt(match.index-1))m=k.substring(1);else{var p=k.substring(1,k.length-1);if(0>p.indexOf("{"))for(var q=a;null==m&&null!=q;)null!=q.value&&"object"==typeof q.value&&(m=q.hasAttribute(p)?null!=q.getAttribute(p)?q.getAttribute(p):"":null),q=this.model.getParent(q);null==m&&(m=this.getGlobalVariable(p))}e.push(d.substring(b, -match.index)+(null!=m?m:k));b=match.index+k.length}}e.push(d.substring(b))}return e.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,d,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(d)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)}; -Graph.prototype.connectVertex=function(a,d,e,b,k,m){m=m?m:!1;var p=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);d==mxConstants.DIRECTION_NORTH?(p.x+=a.geometry.width/2,p.y-=e):d==mxConstants.DIRECTION_SOUTH?(p.x+=a.geometry.width/2,p.y+=a.geometry.height+e):(p.x=d==mxConstants.DIRECTION_WEST?p.x-e:p.x+(a.geometry.width+e),p.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a)); -var q=this.view.scale,v=this.view.translate,c=v.x*q,v=v.y*q;this.model.isVertex(e.cell)&&(c=e.x,v=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(p.x+=a.parent.geometry.x,p.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(b)&&!k?null:this.getCellAt(c+p.x*q,v+p.y*q);this.model.isAncestor(m,a)&&(m=null);for(e=m;null!=e;){if(this.isCellLocked(e)){m=null;break}e=this.model.getParent(e)}null!=m&&(e=this.view.getState(a),q=this.view.getState(m),null!=e&&null!=q&&mxUtils.intersects(e,q)&&(m= -null));if(k=!mxEvent.isShiftDown(b)||k)d==mxConstants.DIRECTION_NORTH?p.y-=a.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?p.y+=a.geometry.height/2:p.x=d==mxConstants.DIRECTION_WEST?p.x-a.geometry.width/2:p.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(e=this.getModel().getParent(m),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(m=e));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;e=[];this.model.beginUpdate();try{q=m;if(null==q&&k){for(var c=a,f=this.getCellGeometry(a);null!= -f&&f.relative;)c=this.getModel().getParent(c),f=this.getCellGeometry(c);var g=this.view.getState(c),u=null!=g?g.style:this.getCellStyle(c);if(mxUtils.getValue(u,"part",!1)){var t=this.model.getParent(c);this.model.isVertex(t)&&(c=t)}q=this.duplicateCells([c],!1)[0];f=this.getCellGeometry(q);null!=f&&(f.x=p.x-f.width/2,f.y=p.y-f.height/2)}f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(a)));var h=mxEvent.isControlDown(b)&&k||null==m&&null!=f&&f.constructor==mxStackLayout? -null:this.insertEdge(this.model.getParent(a),null,"",a,q,this.createCurrentEdgeStyle());if(null!=h&&this.connectionHandler.insertBeforeSource){var n=null;for(b=a;null!=b.parent&&null!=b.geometry&&b.geometry.relative&&b.parent!=h.parent;)b=this.model.getParent(b);null!=b&&null!=b.parent&&b.parent==h.parent&&(n=b.parent.getIndex(b),this.model.add(b.parent,h,n))}null==m&&null!=q&&null!=f&&null!=a.parent&&f.constructor==mxStackLayout&&d==mxConstants.DIRECTION_WEST&&(n=a.parent.getIndex(a),this.model.add(a.parent, -q,n));null!=h&&e.push(h);null==m&&null!=q&&e.push(q);null==q&&null!=h&&h.geometry.setTerminalPoint(p,!1);null!=h&&this.fireEvent(new mxEventObject("cellsInserted","cells",[h]))}finally{this.model.endUpdate()}return e}; +Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var d=this.getModel(),e=d.getChildCount(d.root),b=0;b<e;b++)mxUtils.bind(this,function(b){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var h=document.createElement("input");h.style.display="inline-block";h.setAttribute("type","checkbox");d.isVisible(b)&&(h.setAttribute("checked","checked"), +h.defaultChecked=!0);e.appendChild(h);var q=this.convertValueToString(b)||mxResources.get("background")||"Background";e.setAttribute("title",q);mxUtils.write(e,q);a.appendChild(e);mxEvent.addListener(h,"click",function(){null!=h.getAttribute("checked")?h.removeAttribute("checked"):h.setAttribute("checked","checked");d.setVisible(b,h.checked)})})(d.getChildAt(d.root,b));return a}; +Graph.prototype.replacePlaceholders=function(a,d){var e=[];if(null!=d){for(var b=0;match=this.placeholderPattern.exec(d);){var h=match[0];if(2<h.length&&"%label%"!=h&&"%tooltip%"!=h){var m=null;if(match.index>b&&"%"==d.charAt(match.index-1))m=h.substring(1);else{var p=h.substring(1,h.length-1);if(0>p.indexOf("{"))for(var q=a;null==m&&null!=q;)null!=q.value&&"object"==typeof q.value&&(m=q.hasAttribute(p)?null!=q.getAttribute(p)?q.getAttribute(p):"":null),q=this.model.getParent(q);null==m&&(m=this.getGlobalVariable(p))}e.push(d.substring(b, +match.index)+(null!=m?m:h));b=match.index+h.length}}e.push(d.substring(b))}return e.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,d,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(d)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)}; +Graph.prototype.connectVertex=function(a,d,e,b,h,m){m=m?m:!1;var p=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);d==mxConstants.DIRECTION_NORTH?(p.x+=a.geometry.width/2,p.y-=e):d==mxConstants.DIRECTION_SOUTH?(p.x+=a.geometry.width/2,p.y+=a.geometry.height+e):(p.x=d==mxConstants.DIRECTION_WEST?p.x-e:p.x+(a.geometry.width+e),p.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a)); +var q=this.view.scale,v=this.view.translate,c=v.x*q,v=v.y*q;this.model.isVertex(e.cell)&&(c=e.x,v=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(p.x+=a.parent.geometry.x,p.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(b)&&!h?null:this.getCellAt(c+p.x*q,v+p.y*q);this.model.isAncestor(m,a)&&(m=null);for(e=m;null!=e;){if(this.isCellLocked(e)){m=null;break}e=this.model.getParent(e)}null!=m&&(e=this.view.getState(a),q=this.view.getState(m),null!=e&&null!=q&&mxUtils.intersects(e,q)&&(m= +null));if(h=!mxEvent.isShiftDown(b)||h)d==mxConstants.DIRECTION_NORTH?p.y-=a.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?p.y+=a.geometry.height/2:p.x=d==mxConstants.DIRECTION_WEST?p.x-a.geometry.width/2:p.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(e=this.getModel().getParent(m),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(m=e));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;e=[];this.model.beginUpdate();try{q=m;if(null==q&&h){for(var c=a,f=this.getCellGeometry(a);null!= +f&&f.relative;)c=this.getModel().getParent(c),f=this.getCellGeometry(c);var g=this.view.getState(c),u=null!=g?g.style:this.getCellStyle(c);if(mxUtils.getValue(u,"part",!1)){var t=this.model.getParent(c);this.model.isVertex(t)&&(c=t)}q=this.duplicateCells([c],!1)[0];f=this.getCellGeometry(q);null!=f&&(f.x=p.x-f.width/2,f.y=p.y-f.height/2)}f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(a)));var l=mxEvent.isControlDown(b)&&h||null==m&&null!=f&&f.constructor==mxStackLayout? +null:this.insertEdge(this.model.getParent(a),null,"",a,q,this.createCurrentEdgeStyle());if(null!=l&&this.connectionHandler.insertBeforeSource){var n=null;for(b=a;null!=b.parent&&null!=b.geometry&&b.geometry.relative&&b.parent!=l.parent;)b=this.model.getParent(b);null!=b&&null!=b.parent&&b.parent==l.parent&&(n=b.parent.getIndex(b),this.model.add(b.parent,l,n))}null==m&&null!=q&&null!=f&&null!=a.parent&&f.constructor==mxStackLayout&&d==mxConstants.DIRECTION_WEST&&(n=a.parent.getIndex(a),this.model.add(a.parent, +q,n));null!=l&&e.push(l);null==m&&null!=q&&e.push(q);null==q&&null!=l&&l.geometry.setTerminalPoint(p,!1);null!=l&&this.fireEvent(new mxEventObject("cellsInserted","cells",[l]))}finally{this.model.endUpdate()}return e}; Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),d=[],e,b;for(b in this.model.cells)if(e=this.model.cells[b],this.model.isVertex(e)||this.model.isEdge(e))this.isHtmlLabel(e)?(a.innerHTML=this.getLabel(e),e=mxUtils.extractTextWithWhitespace([a])):e=this.getLabel(e),e=mxUtils.trim(e.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<e.length&&d.push(e);return d.join(" ")}; Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var d=a.getAttribute("placeholder"),e=a,b=null;null==b&&null!=e;)null!=e.value&&"object"==typeof e.value&&(b=e.hasAttribute(d)?null!=e.getAttribute(d)?e.getAttribute(d):"":null),e=this.model.getParent(e);return b||""}return a.value.getAttribute("label")}return mxGraph.prototype.convertValueToString.apply(this,arguments)}; Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),null!=a&&"javascript:"===a.toLowerCase().substring(0,11)&&(a=a.substring(11)),a):null}; Graph.prototype.getCellStyle=function(a){var d=mxGraph.prototype.getCellStyle.apply(this,arguments);if(null!=a&&null!=this.layoutManager){var e=this.model.getParent(a);this.model.isVertex(e)&&this.isCellCollapsed(a)&&(e=this.layoutManager.getLayout(e),null!=e&&e.constructor==mxStackLayout&&(d[mxConstants.STYLE_HORIZONTAL]=!e.horizontal))}return d}; Graph.prototype.updateAlternateBounds=function(a,d,e){if(null!=a&&null!=d&&null!=this.layoutManager&&null!=d.alternateBounds){var b=this.layoutManager.getLayout(this.model.getParent(a));null!=b&&b.constructor==mxStackLayout&&(b.horizontal?d.alternateBounds.height=0:d.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)}; -Graph.prototype.foldCells=function(a,d,e,b,k){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var m=0;m<e.length;m++){var p=this.view.getState(e[m]),q=this.getCellGeometry(e[m]);if(null!=p&&null!=q){var v=Math.round(q.width-p.width/this.view.scale),c=Math.round(q.height-p.height/this.view.scale);if(0!=c||0!=v){var f=this.model.getParent(e[m]),g=this.layoutManager.getLayout(f); -null==g?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(p,f,v,c):null!=k&&mxEvent.isAltDown(k)||g.constructor!=mxStackLayout||g.resizeLast||this.resizeParentStacks(f,g,v,c)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}}; -Graph.prototype.moveSiblings=function(a,d,e,b){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,d,!0,!0);for(d=0;d<k.length;d++)if(k[d]!=a.cell){var m=this.view.getState(k[d]),p=this.getCellGeometry(k[d]);null!=m&&null!=p&&(p=p.clone(),p.translate(Math.round(e*Math.max(0,Math.min(1,(m.x-a.x)/a.width))),Math.round(b*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(k[d],p))}}finally{this.model.endUpdate()}}; -Graph.prototype.resizeParentStacks=function(a,d,e,b){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var k=d.horizontal;null!=a&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==k&&!d.resizeLast;){var m=this.getCellGeometry(a),p=this.view.getState(a);null!=p&&null!=m&&(m=m.clone(),d.horizontal?m.width+=e+Math.min(0,p.width/this.view.scale-m.width):m.height+=b+Math.min(0,p.height/this.view.scale-m.height),this.model.setGeometry(a, +Graph.prototype.foldCells=function(a,d,e,b,h){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var m=0;m<e.length;m++){var p=this.view.getState(e[m]),q=this.getCellGeometry(e[m]);if(null!=p&&null!=q){var v=Math.round(q.width-p.width/this.view.scale),c=Math.round(q.height-p.height/this.view.scale);if(0!=c||0!=v){var f=this.model.getParent(e[m]),g=this.layoutManager.getLayout(f); +null==g?null!=h&&this.isMoveCellsEvent(h)&&this.moveSiblings(p,f,v,c):null!=h&&mxEvent.isAltDown(h)||g.constructor!=mxStackLayout||g.resizeLast||this.resizeParentStacks(f,g,v,c)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}}; +Graph.prototype.moveSiblings=function(a,d,e,b){this.model.beginUpdate();try{var h=this.getCellsBeyond(a.x,a.y,d,!0,!0);for(d=0;d<h.length;d++)if(h[d]!=a.cell){var m=this.view.getState(h[d]),p=this.getCellGeometry(h[d]);null!=m&&null!=p&&(p=p.clone(),p.translate(Math.round(e*Math.max(0,Math.min(1,(m.x-a.x)/a.width))),Math.round(b*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(h[d],p))}}finally{this.model.endUpdate()}}; +Graph.prototype.resizeParentStacks=function(a,d,e,b){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var h=d.horizontal;null!=a&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==h&&!d.resizeLast;){var m=this.getCellGeometry(a),p=this.view.getState(a);null!=p&&null!=m&&(m=m.clone(),d.horizontal?m.width+=e+Math.min(0,p.width/this.view.scale-m.width):m.height+=b+Math.min(0,p.height/this.view.scale-m.height),this.model.setGeometry(a, m));a=this.model.getParent(a);d=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=d.container:"1"==d.container};Graph.prototype.isCellConnectable=function(a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return null!=d.connectable?"0"!=d.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)}; Graph.prototype.selectAll=function(a){a=a||this.getDefaultParent();this.isCellLocked(a)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(a,d,e){e=e||this.getDefaultParent();this.isCellLocked(e)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,d,e){e=e||this.getDefaultParent();return this.isCellLocked(e)?null:mxGraph.prototype.getSwimlaneAt.apply(this,arguments)}; Graph.prototype.isCellFoldable=function(a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return this.foldingEnabled&&!this.isCellLocked(a)&&(this.isContainer(a)&&"0"!=d.collapsible||!this.isContainer(a)&&"1"==d.collapsible)};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()}; Graph.prototype.zoom=function(a,d){a=Math.max(.01,Math.min(this.view.scale*a,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)}; -Graph.prototype.getTooltipForCell=function(a){var d="";if(mxUtils.isNode(a.value)){var e=a.value.getAttribute("tooltip");if(null!=e)null!=e&&this.isReplacePlaceholders(a)&&(e=this.replacePlaceholders(a,e)),d=this.sanitizeHtml(e);else{e=["label","tooltip","placeholders","placeholder"];a=a.value.attributes;var b=[];this.isEnabled()&&e.push("link");for(var k=0;k<a.length;k++)0>mxUtils.indexOf(e,a[k].nodeName)&&0<a[k].nodeValue.length&&b.push({name:a[k].nodeName,value:a[k].nodeValue});b.sort(function(a, -d){return a.name<d.name?-1:a.name>d.name?1:0});for(k=0;k<b.length;k++)"link"==b[k].name&&this.isCustomLink(b[k].value)||(d+=("link"!=b[k].name?b[k].name+":":"")+mxUtils.htmlEntities(b[k].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1))}}return d};Graph.prototype.stringToBytes=function(a){for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=a.charCodeAt(e);return d};Graph.prototype.bytesToString=function(a){for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);return d.join("")}; +Graph.prototype.getTooltipForCell=function(a){var d="";if(mxUtils.isNode(a.value)){var e=a.value.getAttribute("tooltip");if(null!=e)null!=e&&this.isReplacePlaceholders(a)&&(e=this.replacePlaceholders(a,e)),d=this.sanitizeHtml(e);else{e=["label","tooltip","placeholders","placeholder"];a=a.value.attributes;var b=[];this.isEnabled()&&e.push("link");for(var h=0;h<a.length;h++)0>mxUtils.indexOf(e,a[h].nodeName)&&0<a[h].nodeValue.length&&b.push({name:a[h].nodeName,value:a[h].nodeValue});b.sort(function(a, +d){return a.name<d.name?-1:a.name>d.name?1:0});for(h=0;h<b.length;h++)"link"==b[h].name&&this.isCustomLink(b[h].value)||(d+=("link"!=b[h].name?b[h].name+":":"")+mxUtils.htmlEntities(b[h].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1))}}return d};Graph.prototype.stringToBytes=function(a){for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=a.charCodeAt(e);return d};Graph.prototype.bytesToString=function(a){for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);return d.join("")}; Graph.prototype.compress=function(a){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=this.bytesToString(pako.deflateRaw(encodeURIComponent(a)));return window.btoa?btoa(a):Base64.encode(a,!0)};Graph.prototype.decompress=function(a){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=window.atob?atob(a):Base64.decode(a,!0);return this.zapGremlins(decodeURIComponent(this.bytesToString(pako.inflateRaw(a))))}; Graph.prototype.zapGremlins=function(a){for(var d=[],e=0;e<a.length;e++){var b=a.charCodeAt(e);(32<=b||9==b||10==b||13==b)&&d.push(a.charAt(e))}return d.join("")};HoverIcons=function(a){this.graph=a;this.init()};HoverIcons.prototype.arrowSpacing=6;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;HoverIcons.prototype.cssCursor="copy"; HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.triangleUp=mxClient.IS_SVG?Graph.createSvgImage(26,14,'<path d="m 1 14 L 13 1 L 26 14 z" stroke="#fff" fill="#007dfc"/>'):new mxImage(IMAGE_PATH+"/triangle-up.png",26,14);HoverIcons.prototype.triangleRight=mxClient.IS_SVG?Graph.createSvgImage(14,26,'<path d="m 1 1 L 14 13 L 1 26 z" stroke="#fff" fill="#007dfc"/>'):new mxImage(IMAGE_PATH+"/triangle-right.png",14,26); @@ -2273,13 +2274,13 @@ this.activeArrow=e,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redire this.resetActiveArrow()}));return e};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};HoverIcons.prototype.getDirection=function(){var a=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?a=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?a=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(a=mxConstants.DIRECTION_WEST);return a}; HoverIcons.prototype.visitNodes=function(a){for(var d=0;d<this.elts.length;d++)null!=this.elts[d]&&a(this.elts[d])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(a){null!=a.parentNode&&a.parentNode.removeChild(a)})};HoverIcons.prototype.setDisplay=function(a){this.visitNodes(function(d){d.style.display=a})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState}; HoverIcons.prototype.drag=function(a,d,e){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,d,e),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,a=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=a&&a.setHandlesVisible(!1))};HoverIcons.prototype.getStateAt=function(a,d,e){return this.graph.view.getState(this.graph.getCellAt(d,e))}; -HoverIcons.prototype.click=function(a,d,e){var b=e.getEvent(),k=e.getGraphX(),m=e.getGraphY(),k=this.getStateAt(a,k,m);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(b)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,d,this.graph.defaultEdgeLength,b),this.graph.selectCellsForConnectVertex(a,b,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(b)?this.update(this.getState(this.graph.view.getState(a[1]))): -this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a)):(this.graph.setSelectionCell(k.cell),this.reset());e.consume()};HoverIcons.prototype.reset=function(a){null!=a&&!a||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null}; +HoverIcons.prototype.click=function(a,d,e){var b=e.getEvent(),h=e.getGraphX(),m=e.getGraphY(),h=this.getStateAt(a,h,m);null==h||!this.graph.model.isEdge(h.cell)||mxEvent.isControlDown(b)||h.getVisibleTerminalState(!0)!=a&&h.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,d,this.graph.defaultEdgeLength,b),this.graph.selectCellsForConnectVertex(a,b,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(b)?this.update(this.getState(this.graph.view.getState(a[1]))): +this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a)):(this.graph.setSelectionCell(h.cell),this.reset());e.consume()};HoverIcons.prototype.reset=function(a){null!=a&&!a||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null}; HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var a=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(a=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));a.grow(this.graph.tolerance);a.grow(this.arrowSpacing); var d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);null!=d&&(a.x-=d.horizontalOffset/2,a.y-=d.verticalOffset/2,a.width+=d.horizontalOffset,a.height+=d.verticalOffset,null!=d.rotationShape&&null!=d.rotationShape.node&&"hidden"!=d.rotationShape.node.style.visibility&&"none"!=d.rotationShape.node.style.display&&null!=d.rotationShape.boundingBox&&a.add(d.rotationShape.boundingBox));this.arrowUp.style.left=Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance)+ "px";this.arrowUp.style.top=Math.round(a.y-this.triangleUp.height-this.tolerance)+"px";mxUtils.setOpacity(this.arrowUp,this.inactiveOpacity);this.arrowRight.style.left=Math.round(a.x+a.width-this.tolerance)+"px";this.arrowRight.style.top=Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance)+"px";mxUtils.setOpacity(this.arrowRight,this.inactiveOpacity);this.arrowDown.style.left=this.arrowUp.style.left;this.arrowDown.style.top=Math.round(a.y+a.height-this.tolerance)+ "px";mxUtils.setOpacity(this.arrowDown,this.inactiveOpacity);this.arrowLeft.style.left=Math.round(a.x-this.triangleLeft.width-this.tolerance)+"px";this.arrowLeft.style.top=this.arrowRight.style.top;mxUtils.setOpacity(this.arrowLeft,this.inactiveOpacity);if(this.checkCollisions){var d=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()),e=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),b=this.graph.getCellAt(this.currentState.getCenterX(), -a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=d&&d==e&&e==b&&b==a&&(a=b=e=d=null);var k=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,d){var b=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==b||null==k||b.height<6*k.height&&b.width<6*k.width)?d.style.visibility="hidden":d.style.visibility="visible"}); +a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=d&&d==e&&e==b&&b==a&&(a=b=e=d=null);var h=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,d){var b=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==b||null==h||b.height<6*h.height&&b.width<6*h.width)?d.style.visibility="hidden":d.style.visibility="visible"}); m(d,this.arrowRight);m(e,this.arrowLeft);m(b,this.arrowUp);m(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title", mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}}; HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(d){null!=d.parentNode&&(d=new mxRectangle(d.offsetLeft,d.offsetTop,d.offsetWidth,d.offsetHeight),null==a?a=d:a.add(d))});return a}; @@ -2289,23 +2290,23 @@ this.setDisplay("");null!=this.currentState&&this.currentState!=a&&b<this.activa this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a}; (function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,c){var b=this.getState(a);null!=b&&this.graph.model.isEdge(b.cell)&&null!=b.style&&1!=b.style[mxConstants.STYLE_CURVED]&&!b.invalid&&this.updateLineJumps(b)&&this.graph.cellRenderer.redraw(b,!1,this.isRendering());b=d.apply(this,arguments);null!= b&&this.graph.model.isEdge(b.cell)&&1!=b.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(b);return b};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,c){return e.apply(this,arguments)||null!=a.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.routedPoints,a.routedPoints)};var b=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){b.apply(this,arguments);this.graph.model.isEdge(a.cell)&&1!=a.style[mxConstants.STYLE_CURVED]&& -this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var c=a.absolutePoints;if(Graph.lineJumpsEnabled){var d=null!=a.routedPoints,b=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var e=function(c,d,f){var e=new mxPoint(d,f);e.type=c;b.push(e);e=null!=a.routedPoints?a.routedPoints[b.length-1]:null;return null==e||e.type!=c||e.x!=d||e.y!=f},t=.5*this.scale,d=!1,b=[],h=0;h<c.length-1;h++){for(var n=c[h+1],l=c[h],w=[],r=c[h+2];h< -c.length-2&&mxUtils.ptSegDistSq(l.x,l.y,r.x,r.y,n.x,n.y)<1*this.scale*this.scale;)n=r,h++,r=c[h+2];for(var d=e(0,l.x,l.y)||d,k=0;k<this.validEdges.length;k++){var q=this.validEdges[k],z=q.absolutePoints;if(null!=z&&mxUtils.intersects(a,q)&&"1"!=q.style.noJump)for(q=0;q<z.length-1;q++){for(var p=z[q+1],m=z[q],r=z[q+2];q<z.length-2&&mxUtils.ptSegDistSq(m.x,m.y,r.x,r.y,p.x,p.y)<1*this.scale*this.scale;)p=r,q++,r=z[q+2];r=mxUtils.intersection(l.x,l.y,n.x,n.y,m.x,m.y,p.x,p.y);if(null!=r&&(Math.abs(r.x- -m.x)>t||Math.abs(r.y-m.y)>t)&&(Math.abs(r.x-p.x)>t||Math.abs(r.y-p.y)>t)){p=r.x-l.x;m=r.y-l.y;r={distSq:p*p+m*m,x:r.x,y:r.y};for(p=0;p<w.length;p++)if(w[p].distSq>r.distSq){w.splice(p,0,r);r=null;break}null==r||0!=w.length&&w[w.length-1].x===r.x&&w[w.length-1].y===r.y||w.push(r)}}}for(q=0;q<w.length;q++)d=e(1,w[q].x,w[q].y)||d}r=c[c.length-1];d=e(0,r.x,r.y)||d}a.routedPoints=b;return d}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,d){this.routedPoints= -null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),h,n=!0,l=null,w=null;h=[];var r=null;a.begin();for(var y=0;y<this.state.routedPoints.length;y++){var q= -this.state.routedPoints[y],z=new mxPoint(q.x/this.scale,q.y/this.scale);0==y?z=c[0]:y==this.state.routedPoints.length-1&&(z=c[c.length-1]);var p=!1;if(null!=l&&1==q.type){var m=this.state.routedPoints[y+1],q=m.x/this.scale-z.x,m=m.y/this.scale-z.y,q=q*q+m*m;null==r&&(r=new mxPoint(z.x-l.x,z.y-l.y),w=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/w,r.y=r.y*f/w);q>f*f&&0<w&&(q=l.x-z.x,m=l.y-z.y,q=q*q+m*m,q>f*f&&(p=new mxPoint(z.x-r.x,z.y-r.y),q=new mxPoint(z.x+r.x,z.y+r.y),h.push(p),this.addPoints(a,h,d,b,!1, -null,n),h=0>Math.round(r.x)||0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,n=!1,"sharp"==e?(a.lineTo(p.x-r.y*h,p.y+r.x*h),a.lineTo(q.x-r.y*h,q.y+r.x*h),a.lineTo(q.x,q.y)):"arc"==e?(h*=1.3,a.curveTo(p.x-r.y*h,p.y+r.x*h,q.x-r.y*h,q.y+r.x*h,q.x,q.y)):(a.moveTo(q.x,q.y),n=!0),h=[q],p=!0))}else r=null;p||(h.push(z),l=z)}this.addPoints(a,h,d,b,!1,null,n);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,c,d,b){if(null==c||null== -a||"1"!=c.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{c=this.getTerminalPort(a,c,b);var f=this.getNextPoint(a,d,b),e=this.graph.isOrthogonal(a),g=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),n=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=g)var l=Math.cos(-g),w=Math.sin(-g),f=mxUtils.getRotatedPoint(f,l,w,n);l=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);l+=parseFloat(a.style[b?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| -0);f=this.getPerimeterPoint(c,f,0==g&&e,l);0!=g&&(l=Math.cos(g),w=Math.sin(g),f=mxUtils.getRotatedPoint(f,l,w,n));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,c,d,b,f),b)}};mxGraphView.prototype.snapToAnchorPoint=function(a,c,d,b,e){if(null!=c&&null!=a){a=this.graph.getAllConnectionConstraints(c);b=d=null;if(null!=a)for(var f=0;f<a.length;f++){var g=this.graph.getConnectionPoint(c,a[f]);if(null!=g){var n=(g.x-e.x)*(g.x-e.x)+(g.y-e.y)*(g.y-e.y);if(null==b||n<b)d=g,b=n}}null!=d&&(e=d)}return e}; +this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var c=a.absolutePoints;if(Graph.lineJumpsEnabled){var d=null!=a.routedPoints,b=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var e=function(c,d,f){var e=new mxPoint(d,f);e.type=c;b.push(e);e=null!=a.routedPoints?a.routedPoints[b.length-1]:null;return null==e||e.type!=c||e.x!=d||e.y!=f},t=.5*this.scale,d=!1,b=[],l=0;l<c.length-1;l++){for(var n=c[l+1],k=c[l],w=[],r=c[l+2];l< +c.length-2&&mxUtils.ptSegDistSq(k.x,k.y,r.x,r.y,n.x,n.y)<1*this.scale*this.scale;)n=r,l++,r=c[l+2];for(var d=e(0,k.x,k.y)||d,h=0;h<this.validEdges.length;h++){var q=this.validEdges[h],z=q.absolutePoints;if(null!=z&&mxUtils.intersects(a,q)&&"1"!=q.style.noJump)for(q=0;q<z.length-1;q++){for(var p=z[q+1],m=z[q],r=z[q+2];q<z.length-2&&mxUtils.ptSegDistSq(m.x,m.y,r.x,r.y,p.x,p.y)<1*this.scale*this.scale;)p=r,q++,r=z[q+2];r=mxUtils.intersection(k.x,k.y,n.x,n.y,m.x,m.y,p.x,p.y);if(null!=r&&(Math.abs(r.x- +m.x)>t||Math.abs(r.y-m.y)>t)&&(Math.abs(r.x-p.x)>t||Math.abs(r.y-p.y)>t)){p=r.x-k.x;m=r.y-k.y;r={distSq:p*p+m*m,x:r.x,y:r.y};for(p=0;p<w.length;p++)if(w[p].distSq>r.distSq){w.splice(p,0,r);r=null;break}null==r||0!=w.length&&w[w.length-1].x===r.x&&w[w.length-1].y===r.y||w.push(r)}}}for(q=0;q<w.length;q++)d=e(1,w[q].x,w[q].y)||d}r=c[c.length-1];d=e(0,r.x,r.y)||d}a.routedPoints=b;return d}return!1};var h=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,d){this.routedPoints= +null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)h.apply(this,arguments);else{var b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),l,n=!0,k=null,w=null;l=[];var r=null;a.begin();for(var y=0;y<this.state.routedPoints.length;y++){var q= +this.state.routedPoints[y],z=new mxPoint(q.x/this.scale,q.y/this.scale);0==y?z=c[0]:y==this.state.routedPoints.length-1&&(z=c[c.length-1]);var p=!1;if(null!=k&&1==q.type){var m=this.state.routedPoints[y+1],q=m.x/this.scale-z.x,m=m.y/this.scale-z.y,q=q*q+m*m;null==r&&(r=new mxPoint(z.x-k.x,z.y-k.y),w=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/w,r.y=r.y*f/w);q>f*f&&0<w&&(q=k.x-z.x,m=k.y-z.y,q=q*q+m*m,q>f*f&&(p=new mxPoint(z.x-r.x,z.y-r.y),q=new mxPoint(z.x+r.x,z.y+r.y),l.push(p),this.addPoints(a,l,d,b,!1, +null,n),l=0>Math.round(r.x)||0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,n=!1,"sharp"==e?(a.lineTo(p.x-r.y*l,p.y+r.x*l),a.lineTo(q.x-r.y*l,q.y+r.x*l),a.lineTo(q.x,q.y)):"arc"==e?(l*=1.3,a.curveTo(p.x-r.y*l,p.y+r.x*l,q.x-r.y*l,q.y+r.x*l,q.x,q.y)):(a.moveTo(q.x,q.y),n=!0),l=[q],p=!0))}else r=null;p||(l.push(z),k=z)}this.addPoints(a,l,d,b,!1,null,n);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,c,d,b){if(null==c||null== +a||"1"!=c.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{c=this.getTerminalPort(a,c,b);var f=this.getNextPoint(a,d,b),e=this.graph.isOrthogonal(a),g=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),n=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=g)var k=Math.cos(-g),w=Math.sin(-g),f=mxUtils.getRotatedPoint(f,k,w,n);k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[b?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| +0);f=this.getPerimeterPoint(c,f,0==g&&e,k);0!=g&&(k=Math.cos(g),w=Math.sin(g),f=mxUtils.getRotatedPoint(f,k,w,n));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,c,d,b,f),b)}};mxGraphView.prototype.snapToAnchorPoint=function(a,c,d,b,e){if(null!=c&&null!=a){a=this.graph.getAllConnectionConstraints(c);b=d=null;if(null!=a)for(var f=0;f<a.length;f++){var g=this.graph.getConnectionPoint(c,a[f]);if(null!=g){var n=(g.x-e.x)*(g.x-e.x)+(g.y-e.y)*(g.y-e.y);if(null==b||n<b)d=g,b=n}}null!=d&&(e=d)}return e}; var p=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,c,d){var b=p.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=d.state&&(b=d.state.view.graph.replacePlaceholders(d.state.cell,b));return b};var q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var c=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"stencil("==c.substring(0,8))try{var d= c.substring(8,c.length-1),b=mxUtils.parseXml(a.view.graph.decompress(d));return new mxShape(new mxStencil(b.documentElement))}catch(u){null!=window.console&&console.log("Error in shape: "+u)}}return q.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[]; -mxStencilRegistry.getStencil=function(a){var d=mxStencilRegistry.stencils[a];if(null==d&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){d=mxStencilRegistry.libraries[e];if(null!=d){if(null==mxStencilRegistry.packages[e]){for(var b=0;b<d.length;b++){var k=d[b];if(".xml"==k.toLowerCase().substring(k.length-4,k.length))mxStencilRegistry.loadStencilSet(k,null);else if(".js"==k.toLowerCase().substring(k.length-3,k.length))try{if(mxStencilRegistry.allowEval){var m= -mxUtils.load(k);null!=m&&200<=m.getStatus()&&299>=m.getStatus()&&eval.call(window,m.getText())}}catch(p){null!=window.console&&console.log("error in getStencil:",k,p)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);d=mxStencilRegistry.stencils[a]}}return d}; +mxStencilRegistry.getStencil=function(a){var d=mxStencilRegistry.stencils[a];if(null==d&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){d=mxStencilRegistry.libraries[e];if(null!=d){if(null==mxStencilRegistry.packages[e]){for(var b=0;b<d.length;b++){var h=d[b];if(".xml"==h.toLowerCase().substring(h.length-4,h.length))mxStencilRegistry.loadStencilSet(h,null);else if(".js"==h.toLowerCase().substring(h.length-3,h.length))try{if(mxStencilRegistry.allowEval){var m= +mxUtils.load(h);null!=m&&200<=m.getStatus()&&299>=m.getStatus()&&eval.call(window,m.getText())}}catch(p){null!=window.console&&console.log("error in getStencil:",h,p)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);d=mxStencilRegistry.stencils[a]}}return d}; mxStencilRegistry.getBasenameForStencil=function(a){var d=null;if(null!=a&&(a=a.split("."),0<a.length&&"mxgraph"==a[0]))for(var d=a[1],e=2;e<a.length-1;e++)d+="/"+a[e];return d}; -mxStencilRegistry.loadStencilSet=function(a,d,e,b){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var m=!1;if(null==k)try{if(b){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(b){null!=b&&null!=b.documentElement&&(mxStencilRegistry.packages[a]=b,m=!0,mxStencilRegistry.parseStencilSet(b.documentElement,d,m))}));return}k=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=k;m=!0}catch(p){null!=window.console&&console.log("error in loadStencilSet:",a,p)}null!=k&&null!= -k.documentElement&&mxStencilRegistry.parseStencilSet(k.documentElement,d,m)}};mxStencilRegistry.loadStencil=function(a,d){if(null!=d)mxUtils.get(a,mxUtils.bind(this,function(a){d(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var d=0;d<a.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[d]).documentElement)}; -mxStencilRegistry.parseStencilSet=function(a,d,e){if("stencils"==a.nodeName)for(var b=a.firstChild;null!=b;)"shapes"==b.nodeName&&mxStencilRegistry.parseStencilSet(b,d,e),b=b.nextSibling;else{e=null!=e?e:!0;var b=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=b;){if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=b.getAttribute("name"),null!=a)){var k=k.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+m.toLowerCase(),new mxStencil(b));if(null!=d){var p=b.getAttribute("w"), -q=b.getAttribute("h"),p=null==p?80:parseInt(p,10),q=null==q?80:parseInt(q,10);d(k,m,a,p,q)}}b=b.nextSibling}}}; +mxStencilRegistry.loadStencilSet=function(a,d,e,b){var h=mxStencilRegistry.packages[a];if(null!=e&&e||null==h){var m=!1;if(null==h)try{if(b){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(b){null!=b&&null!=b.documentElement&&(mxStencilRegistry.packages[a]=b,m=!0,mxStencilRegistry.parseStencilSet(b.documentElement,d,m))}));return}h=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=h;m=!0}catch(p){null!=window.console&&console.log("error in loadStencilSet:",a,p)}null!=h&&null!= +h.documentElement&&mxStencilRegistry.parseStencilSet(h.documentElement,d,m)}};mxStencilRegistry.loadStencil=function(a,d){if(null!=d)mxUtils.get(a,mxUtils.bind(this,function(a){d(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var d=0;d<a.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[d]).documentElement)}; +mxStencilRegistry.parseStencilSet=function(a,d,e){if("stencils"==a.nodeName)for(var b=a.firstChild;null!=b;)"shapes"==b.nodeName&&mxStencilRegistry.parseStencilSet(b,d,e),b=b.nextSibling;else{e=null!=e?e:!0;var b=a.firstChild,h="";a=a.getAttribute("name");for(null!=a&&(h=a+".");null!=b;){if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=b.getAttribute("name"),null!=a)){var h=h.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(h+m.toLowerCase(),new mxStencil(b));if(null!=d){var p=b.getAttribute("w"), +q=b.getAttribute("h"),p=null==p?80:parseInt(p,10),q=null==q?80:parseInt(q,10);d(h,m,a,p,q)}}b=b.nextSibling}}}; "undefined"!=typeof mxVertexHandler&&function(){function a(){var a=document.createElement("div");a.className="geHint";a.style.whiteSpace="nowrap";a.style.position="absolute";return a}mxConstants.HANDLE_FILLCOLOR="#99ccff";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR= "#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_OPACITY=30;mxConstants.HIGHLIGHT_SIZE=8;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(a){return!mxEvent.isAltDown(a)};var d=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(a){return mxEvent.isControlDown(a)|| d.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxEllipse(null,this.highlightColor,this.highlightColor,0);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(a){a=this.graph.createCurrentEdgeStyle();a=this.graph.createEdge(null,null,null,null,null,a);a=new mxCellState(this.graph.view,a,this.graph.getCellStyle(a)); @@ -2313,16 +2314,16 @@ for(var c in this.graph.currentEdgeStyle)a.style[c]=this.graph.currentEdgeStyle[ a.getCell=mxUtils.bind(this,function(a){var d=c.apply(this,arguments);this.error=null;return d});return a};mxConnectionHandler.prototype.isCellEnabled=function(a){return!this.graph.isCellLocked(a)};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){var a="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";";null!=this.currentEdgeStyle.shape&& (a+="shape="+this.currentEdgeStyle.shape+";");null!=this.currentEdgeStyle.curved&&(a+="curved="+this.currentEdgeStyle.curved+";");null!=this.currentEdgeStyle.rounded&&(a+="rounded="+this.currentEdgeStyle.rounded+";");null!=this.currentEdgeStyle.comic&&(a+="comic="+this.currentEdgeStyle.comic+";");null!=this.currentEdgeStyle.jumpStyle&&(a+="jumpStyle="+this.currentEdgeStyle.jumpStyle+";");null!=this.currentEdgeStyle.jumpSize&&(a+="jumpSize="+this.currentEdgeStyle.jumpSize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&& null!=this.currentEdgeStyle.elbow&&(a+="elbow="+this.currentEdgeStyle.elbow+";");return a=null!=this.currentEdgeStyle.html?a+("html="+this.currentEdgeStyle.html+";"):a+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var a=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=a&&(new mxCodec(a.ownerDocument)).decode(a,this.getStylesheet())}; -Graph.prototype.importGraphModel=function(a,c,d,b){c=null!=c?c:0;d=null!=d?d:0;var f=[],e=new mxGraphModel;(new mxCodec(a.ownerDocument)).decode(a,e);a=e.getChildCount(e.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var g={},l=0;l<a;l++){var h=e.getChildAt(e.getRoot(),l);if(1!=a||this.isCellLocked(this.getDefaultParent()))h=this.importCells([h],0,0,this.model.getRoot(),null,g)[0],r=this.model.getChildren(h),this.moveCells(r,c,d),f=f.concat(r);else var r= -e.getChildren(h),f=f.concat(this.importCells(r,c,d,this.getDefaultParent(),null,g))}if(b){this.isGridEnabled()&&(c=this.snap(c),d=this.snap(d));var n=this.getBoundingBoxFromGeometry(f,!0);null!=n&&this.moveCells(f,c-n.x,d-n.y)}}finally{this.model.endUpdate()}return f};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var d=mxUtils.getValue(a.style,"points",null);if(null!=d){var b=[];try{for(var f=JSON.parse(d),d=0;d<f.length;d++){var e=f[d];b.push(new mxConnectionConstraint(new mxPoint(e[0], +Graph.prototype.importGraphModel=function(a,c,d,b){c=null!=c?c:0;d=null!=d?d:0;var f=[],e=new mxGraphModel;(new mxCodec(a.ownerDocument)).decode(a,e);a=e.getChildCount(e.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var g={},k=0;k<a;k++){var l=e.getChildAt(e.getRoot(),k);if(1!=a||this.isCellLocked(this.getDefaultParent()))l=this.importCells([l],0,0,this.model.getRoot(),null,g)[0],r=this.model.getChildren(l),this.moveCells(r,c,d),f=f.concat(r);else var r= +e.getChildren(l),f=f.concat(this.importCells(r,c,d,this.getDefaultParent(),null,g))}if(b){this.isGridEnabled()&&(c=this.snap(c),d=this.snap(d));var n=this.getBoundingBoxFromGeometry(f,!0);null!=n&&this.moveCells(f,c-n.x,d-n.y)}}finally{this.model.endUpdate()}return f};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var d=mxUtils.getValue(a.style,"points",null);if(null!=d){var b=[];try{for(var f=JSON.parse(d),d=0;d<f.length;d++){var e=f[d];b.push(new mxConnectionConstraint(new mxPoint(e[0], e[1]),2<e.length?"0"!=e[2]:!0))}}catch(O){}return b}if(null!=a.shape)if(null!=a.shape.stencil){if(null!=a.shape.stencil)return a.shape.stencil.constraints}else if(null!=a.shape.constraints)return a.shape.constraints}return null};Graph.prototype.flipEdge=function(a){if(null!=a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);null!=c&&(c=mxUtils.getValue(c,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL, this.setCellStyles(mxConstants.STYLE_ELBOW,c,[a]))}};Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),d=0,b=0;b<c;b++){var f=this.model.getChildAt(a,b);this.model.isVertex(f)&&(f=this.getCellGeometry(f),null==f||f.relative||d++)}return 0<d||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this, arguments)&&"0"!=mxUtils.getValue(c,"dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=this.layoutManager){var d=this.model.getParent(a);null!=d&&(d=this.layoutManager.getLayout(d),null!=d&&d.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell= -function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),d=[];c.beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(c.isEdge(f)){var e=c.getTerminal(f,!0),g=c.getTerminal(f,!1);c.setTerminal(f,g,!0);c.setTerminal(f,e,!1);var l=c.getGeometry(f);if(null!=l){l=l.clone();null!=l.points&&l.points.reverse(); -var h=l.getTerminalPoint(!0),r=l.getTerminalPoint(!1);l.setTerminalPoint(h,!1);l.setTerminalPoint(r,!0);c.setGeometry(f,l);var n=this.view.getState(f),u=this.view.getState(e),t=this.view.getState(g);if(null!=n){var w=null!=u?this.getConnectionConstraint(n,u,!0):null,Q=null!=t?this.getConnectionConstraint(n,t,!1):null;this.setConnectionConstraint(f,e,!0,Q);this.setConnectionConstraint(f,g,!1,w)}d.push(f)}}else if(c.isVertex(f)&&(l=this.getCellGeometry(f),null!=l)){l=l.clone();l.x+=l.width/2-l.height/ -2;l.y+=l.height/2-l.width/2;var q=l.width;l.width=l.height;l.height=q;c.setGeometry(f,l);var k=this.view.getState(f);if(null!=k){var y=k.style[mxConstants.STYLE_DIRECTION]||"east";"east"==y?y="south":"south"==y?y="west":"west"==y?y="north":"north"==y&&(y="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,y,[f])}d.push(f)}}}finally{c.endUpdate()}return d};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&& +function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),d=[];c.beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(c.isEdge(f)){var e=c.getTerminal(f,!0),g=c.getTerminal(f,!1);c.setTerminal(f,g,!0);c.setTerminal(f,e,!1);var k=c.getGeometry(f);if(null!=k){k=k.clone();null!=k.points&&k.points.reverse(); +var l=k.getTerminalPoint(!0),r=k.getTerminalPoint(!1);k.setTerminalPoint(l,!1);k.setTerminalPoint(r,!0);c.setGeometry(f,k);var n=this.view.getState(f),u=this.view.getState(e),t=this.view.getState(g);if(null!=n){var w=null!=u?this.getConnectionConstraint(n,u,!0):null,Q=null!=t?this.getConnectionConstraint(n,t,!1):null;this.setConnectionConstraint(f,e,!0,Q);this.setConnectionConstraint(f,g,!1,w)}d.push(f)}}else if(c.isVertex(f)&&(k=this.getCellGeometry(f),null!=k)){k=k.clone();k.x+=k.width/2-k.height/ +2;k.y+=k.height/2-k.width/2;var q=k.width;k.width=k.height;k.height=q;c.setGeometry(f,k);var h=this.view.getState(f);if(null!=h){var y=h.style[mxConstants.STYLE_DIRECTION]||"east";"east"==y?y="south":"south"==y?y="west":"west"==y?y="north":"north"==y&&(y="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,y,[f])}d.push(f)}}}finally{c.endUpdate()}return d};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&& null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);if(0<c.length)for(var d=0;d<c.length;d++)this.isReplacePlaceholders(c[d])&&this.view.invalidate(c[d],!1,!1)}};Graph.prototype.replaceElement=function(a,c){for(var d=a.ownerDocument.createElement(null!=c?c:"span"),b=Array.prototype.slice.call(a.attributes);attr=b.pop();)d.setAttribute(attr.nodeName,attr.nodeValue);d.innerHTML=a.innerHTML;a.parentNode.replaceChild(d,a)};Graph.prototype.updateLabelElements=function(a, -c,d){a=null!=a?a:this.getSelectionCells();for(var b=document.createElement("div"),f=0;f<a.length;f++)if(this.isHtmlLabel(a[f])){var e=this.convertValueToString(a[f]);if(null!=e&&0<e.length){b.innerHTML=e;for(var g=b.getElementsByTagName(null!=d?d:"*"),l=0;l<g.length;l++)c(g[l]);b.innerHTML!=e&&this.cellLabelChanged(a[f],b.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,c,d){c=this.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&& +c,d){a=null!=a?a:this.getSelectionCells();for(var b=document.createElement("div"),f=0;f<a.length;f++)if(this.isHtmlLabel(a[f])){var e=this.convertValueToString(a[f]);if(null!=e&&0<e.length){b.innerHTML=e;for(var g=b.getElementsByTagName(null!=d?d:"*"),k=0;k<g.length;k++)c(g[k]);b.innerHTML!=e&&this.cellLabelChanged(a[f],b.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,c,d){c=this.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&& null!=a.getAttribute("placeholder"))for(var b=a.getAttribute("placeholder"),f=a;null!=f;){if(f==this.model.getRoot()||null!=f.value&&"object"==typeof f.value&&f.hasAttribute(b)){this.setAttributeForCell(f,b,c);break}f=this.model.getParent(f)}var e=a.value.cloneNode(!0);e.setAttribute("label",c);c=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=new mxDictionary,d=0;d<a.length;d++)c.put(a[d],!0); for(var b=[],d=0;d<a.length;d++){var f=this.model.getParent(a[d]);null==f||c.get(f)||(c.put(f,!0),b.push(f))}for(d=0;d<b.length;d++)if(f=this.view.getState(b[d]),null!=f&&(this.model.isEdge(f.cell)||this.model.isVertex(f.cell))&&this.isCellDeletable(f.cell)){var e=mxUtils.getValue(f.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(f.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&g==mxConstants.NONE){e=!0;for(g=0;g<this.model.getChildCount(f.cell)&& e;g++)c.get(this.model.getChildAt(f.cell,g))||(e=!1);e&&a.push(f.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],d=0;d<a.length;d++)if(this.isCellDeletable(a[d])){var b=this.view.getState(a[d]);if(null!=b){var f=mxUtils.getValue(b.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),b=mxUtils.getValue(b.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);f==mxConstants.NONE&&b==mxConstants.NONE&&c.push(a[d])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this, @@ -2333,24 +2334,24 @@ if(null!=a&&!this.model.isVertex(c)){var b=this.model.isEdge(c)?this.view.getSta c=this.getGraphBounds(),d=this.getInsertPoint(),b=this.snap(Math.round(Math.max(d.x,c.x/a.scale-a.translate.x+(0==c.width?2*this.gridSize:0)))),a=this.snap(Math.round(Math.max(d.y,(c.y+c.height)/a.scale-a.translate.y+2*this.gridSize)));return new mxPoint(b,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,d){var b=new mxCell;b.value="Text";b.style="text;html=1;resizable=0;points=[];";b.geometry=new mxGeometry(0,0,0,0);b.vertex=!0;if(null!=d){b.style+= "align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";b.geometry.relative=!0;b.connectable=!1;var f=this.view.getRelativePoint(d,a,c);b.geometry.x=Math.round(1E4*f.x)/1E4;b.geometry.y=Math.round(f.y);b.geometry.offset=new mxPoint(0,0);var f=this.view.getPoint(d,b.geometry),e=this.view.scale;b.geometry.offset=new mxPoint(Math.round((a-f.x)/e),Math.round((c-f.y)/e))}else b.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",f=this.view.translate,b.geometry.width=40,b.geometry.height= 20,b.geometry.x=Math.round(a/this.view.scale)-f.x,b.geometry.y=Math.round(c/this.view.scale)-f.y;this.getModel().beginUpdate();try{this.addCells([b],null!=d?d.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[b])),this.autoSizeCell(b)}finally{this.getModel().endUpdate()}return b};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler= -function(a,c,d){var b=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var d=0;d<a.length;d++){var b=this.getAbsoluteUrl(a[d].getAttribute("href"));null!=b&&(a[d].setAttribute("href",b),null!=c&&mxEvent.addGestureListeners(a[d],null,null,c))}});this.model.addListener(mxEvent.CHANGE,b);b();var f=this.container.style.cursor,e=this.getTolerance(),g=this,l={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g, +function(a,c,d){var b=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var d=0;d<a.length;d++){var b=this.getAbsoluteUrl(a[d].getAttribute("href"));null!=b&&(a[d].setAttribute("href",b),null!=c&&mxEvent.addGestureListeners(a[d],null,null,c))}});this.model.addListener(mxEvent.CHANGE,b);b();var f=this.container.style.cursor,e=this.getTolerance(),g=this,k={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g, a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){var c=a.sourceState;if(null==c||null==g.getLinkForCell(c.cell))a=g.getCellAt(a.getGraphX(),a.getGraphY(),null,null,null,function(a,c,d){return null==g.getLinkForCell(a.cell)}),c=g.view.getState(a);c!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=c,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(a,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft= g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(c)},mouseMove:function(a,c){if(g.isMouseDown){if(null!=this.currentLink){var d=Math.abs(this.startX-c.getGraphX()),b=Math.abs(this.startY-c.getGraphY());(d>e||b>e)&&this.clear()}}else{for(d=c.getSource();null!=d&&"a"!=d.nodeName.toLowerCase();)d=d.parentNode;null!=d?this.clear():(null!=g.tooltipHandler&&null!=this.currentLink&& -null!=this.currentState&&g.tooltipHandler.reset(c,!0,this.currentState),(null==this.currentState||c.getState()!=this.currentState&&null!=c.sourceState||!g.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c))}},mouseUp:function(a,b){for(var f=b.getSource(),l=b.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==b.sourceState||!b.isSource(b.sourceState.control))&& -((mxEvent.isLeftMouseButton(l)||mxEvent.isMiddleMouseButton(l))&&!mxEvent.isPopupTrigger(l)||mxEvent.isTouchEvent(l))&&(null!=this.currentLink?(f=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==c||c(l,this.currentLink),mxEvent.isConsumed(l)||(l=mxEvent.isMiddleMouseButton(l)?"_blank":f?g.linkTarget:"_top",g.openLink(this.currentLink,l),b.consume())):null!=d&&!b.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)< +null!=this.currentState&&g.tooltipHandler.reset(c,!0,this.currentState),(null==this.currentState||c.getState()!=this.currentState&&null!=c.sourceState||!g.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c))}},mouseUp:function(a,b){for(var f=b.getSource(),k=b.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==b.sourceState||!b.isSource(b.sourceState.control))&& +((mxEvent.isLeftMouseButton(k)||mxEvent.isMiddleMouseButton(k))&&!mxEvent.isPopupTrigger(k)||mxEvent.isTouchEvent(k))&&(null!=this.currentLink?(f=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==c||c(k,this.currentLink),mxEvent.isConsumed(k)||(k=mxEvent.isMiddleMouseButton(k)?"_blank":f?g.linkTarget:"_top",g.openLink(this.currentLink,k),b.consume())):null!=d&&!b.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)< e&&Math.abs(this.startX-b.getGraphX())<e&&Math.abs(this.startY-b.getGraphY())<e&&d(b.getEvent()));this.clear()},activate:function(a){this.currentLink=g.getAbsoluteUrl(g.getLinkForCell(a.cell));null!=this.currentLink&&(g.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=g.container&&(g.container.style.cursor=f);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide();null!=g.tooltipHandler&&g.tooltipHandler.hide()}}; -g.click=function(a){};g.addMouseListener(l);mxEvent.addListener(document,"mouseleave",function(a){l.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var d=this.getModel(),b=this.gridSize,f=[];d.beginUpdate();try{for(var e=this.cloneCells(a,!1),g=0;g<a.length;g++){var l=d.getParent(a[g]),h=this.moveCells([e[g]],b,b,!1)[0];f.push(h);if(c)d.add(l,e[g]);else{var r=l.getIndex(a[g]);d.add(l,e[g],r+1)}}}finally{d.endUpdate()}return f}; +g.click=function(a){};g.addMouseListener(k);mxEvent.addListener(document,"mouseleave",function(a){k.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var d=this.getModel(),b=this.gridSize,f=[];d.beginUpdate();try{for(var e=this.cloneCells(a,!1),g=0;g<a.length;g++){var k=d.getParent(a[g]),l=this.moveCells([e[g]],b,b,!1)[0];f.push(l);if(c)d.add(k,e[g]);else{var r=k.getIndex(a[g]);d.add(k,e[g],r+1)}}}finally{d.endUpdate()}return f}; Graph.prototype.insertImage=function(a,c,d){if(null!=a){for(var b=this.cellEditor.textarea.getElementsByTagName("img"),f=[],e=0;e<b.length;e++)f.push(b[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==f.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=f[e-1]){a[e].setAttribute("width",c);a[e].setAttribute("height",d);break}}};Graph.prototype.insertLink=function(a){0==a.length?document.execCommand("unlink",!1):document.execCommand("createlink", !1,mxUtils.trim(a))};Graph.prototype.isCellResizable=function(a){var c=mxGraph.prototype.isCellResizable.apply(this,arguments),d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return c||"0"!=mxUtils.getValue(d,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==d[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,c){null==c&&(c=this.getSelectionCells());if(null!=c&&1<c.length){for(var d=[],b=null,f=null,e=0;e<c.length;e++)if(this.getModel().isVertex(c[e])){var g=this.view.getState(c[e]); -if(null!=g){var l=a?g.getCenterX():g.getCenterY(),b=null!=b?Math.max(b,l):l,f=null!=f?Math.min(f,l):l;d.push(g)}}if(2<d.length){d.sort(function(c,d){return a?c.x-d.x:c.y-d.y});g=this.view.translate;l=this.view.scale;f=f/l-(a?g.x:g.y);b=b/l-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var h=(b-f)/(d.length-1),b=f,e=1;e<d.length-1;e++){var r=this.view.getState(this.model.getParent(d[e].cell)),n=this.getCellGeometry(d[e].cell),b=b+h;null!=n&&null!=r&&(n=n.clone(),a?n.x=Math.round(b-n.width/2)-r.origin.x: +if(null!=g){var k=a?g.getCenterX():g.getCenterY(),b=null!=b?Math.max(b,k):k,f=null!=f?Math.min(f,k):k;d.push(g)}}if(2<d.length){d.sort(function(c,d){return a?c.x-d.x:c.y-d.y});g=this.view.translate;k=this.view.scale;f=f/k-(a?g.x:g.y);b=b/k-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var l=(b-f)/(d.length-1),b=f,e=1;e<d.length-1;e++){var r=this.view.getState(this.model.getParent(d[e].cell)),n=this.getCellGeometry(d[e].cell),b=b+l;null!=n&&null!=r&&(n=n.clone(),a?n.x=Math.round(b-n.width/2)-r.origin.x: n.y=Math.round(b-n.height/2)-r.origin.y,this.getModel().setGeometry(d[e].cell,n))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var c=this.cloneCells(a),d=new mxDictionary,b=0;b<a.length;b++)d.put(a[b],!0);for(b=0;b<c.length;b++){var f=this.view.getState(a[b]);if(null!=f){var e=this.getCellGeometry(c[b]);null==e||!e.relative||this.model.isEdge(a[b])|| -d.get(this.model.getParent(a[b]))||(e.relative=!1,e.x=f.x/f.view.scale-f.view.translate.x,e.y=f.y/f.view.scale-f.view.translate.y)}}d=new mxCodec;f=new mxGraphModel;e=f.getChildAt(f.getRoot(),0);for(b=0;b<a.length;b++)f.add(e,c[b]);return d.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,d,b,f,e,g,l){c=null!=c?c:1;d=null!=d?d:0; -f=null!=f?f:!0;e=null!=e?e:!0;g=null!=g?g:!0;b=e||b?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==b)throw Error(mxResources.get("drawingEmpty"));var h=this.view.scale,n=mxUtils.createXmlDocument(),r=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=r.style?r.style.backgroundColor=a:r.setAttribute("style","background-color:"+a));null==n.createElementNS?(r.setAttribute("xmlns",mxConstants.NS_SVG),r.setAttribute("xmlns:xlink", -mxConstants.NS_XLINK)):r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/h;r.setAttribute("width",Math.max(1,Math.ceil(b.width*a)+2*d)+"px");r.setAttribute("height",Math.max(1,Math.ceil(b.height*a)+2*d)+"px");r.setAttribute("version","1.1");var u=r;f&&(u=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),u.setAttribute("transform","translate(0.5,0.5)"),r.appendChild(u));n.appendChild(r);n=this.createSvgCanvas(u);n.foOffset= -f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((d/c-b.x)/h),Math.floor((d/c-b.y)/h));var t=document.createElement("textarea"),w=n.createAlternateContent;n.createAlternateContent=function(a,c,d,b,f,e,g,l,h,n,r,u,q){var k=this.state;if(null!=this.foAltText&&(0==b||0!=k.fontSize&&e.length<5*b/k.fontSize)){var y=this.createElement("text");y.setAttribute("x",Math.round(b/2));y.setAttribute("y",Math.round((f+k.fontSize)/2));y.setAttribute("fill",k.fontColor||"black");y.setAttribute("text-anchor", -"middle");y.setAttribute("font-size",Math.round(k.fontSize)+"px");y.setAttribute("font-family",k.fontFamily);(k.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold");(k.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");(k.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.setAttribute("text-decoration","underline");try{return t.innerHTML=e,y.textContent=t.value,y}catch(Ba){return w.apply(this, -arguments)}}else return w.apply(this,arguments)};d=this.backgroundImage;null!=d&&(f=h/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,d.width*f,d.height*f),mxUtils.intersects(b,f)&&n.image(c.x,c.y,d.width,d.height,d.src,!0));n.scale(a);n.textEnabled=g;l=null!=l?l:this.createSvgImageExport();var q=l.drawCellState;l.drawCellState=function(a,c){for(var d=a.view.graph,b=d.isCellSelected(a.cell),f=d.model.getParent(a.cell);!e&&!b&&null!=f;)b=d.isCellSelected(f),f=d.model.getParent(f);(e||b)&&q.apply(this, -arguments)};l.drawState(this.getView().getState(this.model.root),n);return r};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,d){for(;null!=a&&a.nodeName!=c;){if(a== +d.get(this.model.getParent(a[b]))||(e.relative=!1,e.x=f.x/f.view.scale-f.view.translate.x,e.y=f.y/f.view.scale-f.view.translate.y)}}d=new mxCodec;f=new mxGraphModel;e=f.getChildAt(f.getRoot(),0);for(b=0;b<a.length;b++)f.add(e,c[b]);return d.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,d,b,f,e,g,k){c=null!=c?c:1;d=null!=d?d:0; +f=null!=f?f:!0;e=null!=e?e:!0;g=null!=g?g:!0;b=e||b?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==b)throw Error(mxResources.get("drawingEmpty"));var l=this.view.scale,n=mxUtils.createXmlDocument(),r=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=r.style?r.style.backgroundColor=a:r.setAttribute("style","background-color:"+a));null==n.createElementNS?(r.setAttribute("xmlns",mxConstants.NS_SVG),r.setAttribute("xmlns:xlink", +mxConstants.NS_XLINK)):r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/l;r.setAttribute("width",Math.max(1,Math.ceil(b.width*a)+2*d)+"px");r.setAttribute("height",Math.max(1,Math.ceil(b.height*a)+2*d)+"px");r.setAttribute("version","1.1");var u=r;f&&(u=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),u.setAttribute("transform","translate(0.5,0.5)"),r.appendChild(u));n.appendChild(r);n=this.createSvgCanvas(u);n.foOffset= +f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((d/c-b.x)/l),Math.floor((d/c-b.y)/l));var t=document.createElement("textarea"),w=n.createAlternateContent;n.createAlternateContent=function(a,c,d,b,f,e,g,k,l,n,r,u,q){var h=this.state;if(null!=this.foAltText&&(0==b||0!=h.fontSize&&e.length<5*b/h.fontSize)){var y=this.createElement("text");y.setAttribute("x",Math.round(b/2));y.setAttribute("y",Math.round((f+h.fontSize)/2));y.setAttribute("fill",h.fontColor||"black");y.setAttribute("text-anchor", +"middle");y.setAttribute("font-size",Math.round(h.fontSize)+"px");y.setAttribute("font-family",h.fontFamily);(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold");(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");(h.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.setAttribute("text-decoration","underline");try{return t.innerHTML=e,y.textContent=t.value,y}catch(Ba){return w.apply(this, +arguments)}}else return w.apply(this,arguments)};d=this.backgroundImage;null!=d&&(f=l/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,d.width*f,d.height*f),mxUtils.intersects(b,f)&&n.image(c.x,c.y,d.width,d.height,d.src,!0));n.scale(a);n.textEnabled=g;k=null!=k?k:this.createSvgImageExport();var q=k.drawCellState;k.drawCellState=function(a,c){for(var d=a.view.graph,b=d.isCellSelected(a.cell),f=d.model.getParent(a.cell);!e&&!b&&null!=f;)b=d.isCellSelected(f),f=d.model.getParent(f);(e||b)&&q.apply(this, +arguments)};k.drawState(this.getView().getState(this.model.root),n);return r};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,d){for(;null!=a&&a.nodeName!=c;){if(a== d)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){var d=document.createRange();d.selectNode(a);c.removeAllRanges();c.addRange(d)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),d=c.createRange(),d.setEndPoint("StartToStart",a),d.select())};Graph.prototype.insertRow=function(a,c){for(var d=a.tBodies[0],b=0<d.rows.length?d.rows[0].cells.length:1,d=d.insertRow(c), f=0;f<b;f++)mxUtils.br(d.insertCell(-1));return d.cells[0]};Graph.prototype.deleteRow=function(a,c){a.tBodies[0].deleteRow(c)};Graph.prototype.insertColumn=function(a,c){var d=a.tHead;if(null!=d)for(var b=0;b<d.rows.length;b++){var f=document.createElement("th");d.rows[b].appendChild(f);mxUtils.br(f)}d=a.tBodies[0];for(b=0;b<d.rows.length;b++)f=d.rows[b].insertCell(c),mxUtils.br(f);return d.rows[0].cells[0<=c?c:d.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var d= a.tBodies[0].rows,b=0;b<d.length;b++)d[b].cells.length>c&&d[b].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){c=c.getRangeAt(0);c.deleteContents();var d=document.createElement("div");d.innerHTML=a;a=document.createDocumentFragment();for(var b;b=d.firstChild;)lastNode=a.appendChild(b);c.insertNode(a)}}else(c=document.selection)&&"Control"!=c.type&&c.createRange().pasteHTML(a)};Graph.prototype.createLinkForHint= @@ -2358,17 +2359,17 @@ function(a,c){c=null!=c?c:a;var d=document.createElement("a");d.setAttribute("hr c){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(c){c=a.apply(this,arguments);if(mxEvent.isTouchEvent(c.getEvent())&&null==c.getState()){var d=this.getCellAt(c.graphX,c.graphY);null!=d&&this.isSwimlane(d)&&this.hitsSwimlaneContent(d,c.graphX,c.graphY)||(c.state=this.view.getState(d),null!=c.state&&null!=c.state.shape&&(this.container.style.cursor=c.state.shape.node.style.cursor))}null==c.getState()&&this.isEnabled()&&(this.container.style.cursor="default"); return c};var c=!1,d=!1,b=!1,f=this.fireMouseEvent;this.fireMouseEvent=function(a,e,g){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),c=this.isCellSelected(e.getCell()),d=this.isSelectionEmpty(),b=this.popupMenuHandler.isMenuShowing());f.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,f){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==f.getState()||!f.isSource(f.getState().control))&&(this.popupMenuHandler.popupTrigger||!b&&!mxEvent.isMouseEvent(f.getEvent())&& (d&&null==f.getCell()&&this.isSelectionEmpty()||c&&this.isCellSelected(f.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount){for(var c=[],d=0,b=a.rangeCount;d<b;++d)c.push(a.getRangeAt(d));return c}}else if(document.selection&& -document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,d=a.length;c<d;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(F){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br", -"1"));k.apply(this,arguments)};var m=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?m.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var p=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){p.apply(this, +document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,d=a.length;c<d;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(F){}};var h=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br", +"1"));h.apply(this,arguments)};var m=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?m.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var p=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){p.apply(this, arguments);var d=this.graph.view.getState(a);this.textarea.className=null!=d&&1==d.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);var d=this.graph.getModel().getParent(a),b=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(d)&&null!=b&&b.relative||this.graph.getModel().isEdge(a)?mxClient.IS_QUIRKS?this.textarea.style.border="gray dotted 1px":this.textarea.style.outline=mxClient.IS_IE|| mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?"gray dotted 1px":"":mxClient.IS_QUIRKS&&(this.textarea.style.outline="none",this.textarea.style.border="")};var q=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(a){function c(a,d){d.originalNode=a;a=a.firstChild;for(var b=d.firstChild;null!=a&&null!=b;)c(a,b),a=a.nextSibling,b=b.nextSibling;return d}function d(a,c){if(null!=a)if(c.originalNode!=a)b(a);else for(a=a.firstChild,c=c.firstChild;null!=a;){var f= a.nextSibling;null==c?b(a):(d(a,c),c=c.nextSibling);a=f}}function b(a){for(var c=a.firstChild;null!=c;){var d=c.nextSibling;b(c);c=d}1==a.nodeType&&("BR"===a.nodeName||null!=a.firstChild)||3==a.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(a)).length?(3==a.nodeType&&mxUtils.setTextContent(a,mxUtils.getTextContent(a).replace(/\n|\r/g,"")),1==a.nodeType&&(a.removeAttribute("style"),a.removeAttribute("class"),a.removeAttribute("width"),a.removeAttribute("cellpadding"),a.removeAttribute("cellspacing"), a.removeAttribute("border"))):a.parentNode.removeChild(a)}q.apply(this,arguments);mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var b=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){d(this.textarea,b)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell),c=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br", -"1"),d=this.saveSelection();if(this.codeViewMode){l=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<l.length&&"\n"==l.charAt(l.length-1)&&(l=l.substring(0,l.length-1));l=this.graph.sanitizeHtml(c?l.replace(/\n/g,"<br/>"):l,!0);this.textarea.className="mxCellEditor geContentEditable";var b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style, +"1"),d=this.saveSelection();if(this.codeViewMode){k=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<k.length&&"\n"==k.charAt(k.length-1)&&(k=k.substring(0,k.length-1));k=this.graph.sanitizeHtml(c?k.replace(/\n/g,"<br/>"):k,!0);this.textarea.className="mxCellEditor geContentEditable";var b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style, mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,g=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,a=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT; -this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=e?"bold":"normal";this.textarea.style.fontStyle=g?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=l&&(this.textarea.innerHTML=l,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode= -!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var l=mxUtils.htmlEntities(this.textarea.innerHTML);mxClient.IS_QUIRKS||8==document.documentMode||(l=mxUtils.replaceTrailingNewlines(l,"<div><br></div>"));l=this.graph.sanitizeHtml(c?l.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):l,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var b=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT? -Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=l&&(this.textarea.innerHTML=l);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState); +this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=e?"bold":"normal";this.textarea.style.fontStyle=g?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=k&&(this.textarea.innerHTML=k,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode= +!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var k=mxUtils.htmlEntities(this.textarea.innerHTML);mxClient.IS_QUIRKS||8==document.documentMode||(k=mxUtils.replaceTrailingNewlines(k,"<div><br></div>"));k=this.graph.sanitizeHtml(c?k.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):k,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var b=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT? +Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=k&&(this.textarea.innerHTML=k);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState); this.switchSelectionState=d;this.resize()};var v=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,c){if(null!=this.textarea)if(a=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=a){var d=a.view.scale;this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*d;this.bounds.height=60*d;var b=null!=a.text?a.text.margin:null;null==b&&(b=mxUtils.getAlignmentAsPoint(mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=b.x*this.bounds.width;this.bounds.y+=b.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/d)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/d)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/d)+(this.textarea.offsetHeight- this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*d);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/d)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*d);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxClient.IS_VML?this.textarea.style.zoom=d:mxUtils.setPrefixedStyle(this.textarea.style, @@ -2394,13 +2395,13 @@ Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop);mxClient.IS_SVG||((n if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-24,mxConstraintHandler.prototype.getTolerance=function(a){return mxEvent.isMouseEvent(a.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return null== a.getState()&&!mxEvent.isMouseEvent(c)||mxEvent.isPopupTrigger(c)&&(null==a.getState()||mxEvent.isControlDown(c)||mxEvent.isShiftDown(c))};var t=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,c){t.apply(this,arguments);mxEvent.isTouchEvent(c.getEvent())&&this.graph.isCellSelected(c.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return mxEvent.isLeftMouseButton(c)&& (this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(c)&&!mxEvent.isShiftDown(c))||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,c){var d=null!=this.div&&"none"!=this.div.style.display,b=null,f=null,e=null,g=null;null!=this.first&& -null!=this.currentX&&null!=this.currentY&&(b=this.first.x,f=this.first.y,e=(this.currentX-b)/this.graph.view.scale,g=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(d){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,this.y,this.width,this.height),l= -this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(l)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(l=this.graph.getCellsBeyond(b,f,this.graph.getDefaultParent(),!0,!0),d=0;d<l.length;d++)if(this.graph.isCellMovable(l[d])){var h=this.graph.view.getState(l[d]),n=this.graph.getCellGeometry(l[d]);null!=h&&null!=n&&(n=n.clone(),n.translate(e,g),this.graph.model.setGeometry(l[d],n))}}finally{this.graph.model.endUpdate()}}else e=new mxRectangle(this.x,this.y, +null!=this.currentX&&null!=this.currentY&&(b=this.first.x,f=this.first.y,e=(this.currentX-b)/this.graph.view.scale,g=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(d){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,this.y,this.width,this.height),k= +this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(k)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(k=this.graph.getCellsBeyond(b,f,this.graph.getDefaultParent(),!0,!0),d=0;d<k.length;d++)if(this.graph.isCellMovable(k[d])){var l=this.graph.view.getState(k[d]),n=this.graph.getCellGeometry(k[d]);null!=l&&null!=n&&(n=n.clone(),n.translate(e,g),this.graph.model.setGeometry(k[d],n))}}finally{this.graph.model.endUpdate()}}else e=new mxRectangle(this.x,this.y, this.width,this.height),this.graph.selectRegion(e,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var d=mxUtils.getScrollOrigin(this.graph.container),b=mxUtils.getOffset(this.graph.container);d.x-=b.x;d.y-=b.y;var b=c.getX()+d.x,d=c.getY()+d.y,f=this.first.x-b,e=this.first.y-d,g=this.graph.tolerance;if(null!=this.div||Math.abs(f)>g||Math.abs(e)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(b,d), this.isSpaceEvent(c)?(b=this.x+this.width,d=this.y+this.height,f=this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(this.width=this.graph.snap(this.width/f)*f,this.height=this.graph.snap(this.height/f)*f,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=b-this.width),this.y<this.first.y&&(this.y=d-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left= this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height= -Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var h=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);h.apply(this, -arguments)};var n=(new Date).getTime(),l=0,w=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,d,b){w.apply(this,arguments);d!=this.currentTerminalState?(n=(new Date).getTime(),l=0):l=(new Date).getTime()-n;this.currentTerminalState=d};var r=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<l||(null==this.currentTerminalState|| +Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var l=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);l.apply(this, +arguments)};var n=(new Date).getTime(),k=0,w=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,d,b){w.apply(this,arguments);d!=this.currentTerminalState?(n=(new Date).getTime(),k=0):k=(new Date).getTime()-n;this.currentTerminalState=d};var r=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<k||(null==this.currentTerminalState|| "0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&r.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var d=null!=a&&0==a,b=this.state.getVisibleTerminalState(d),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,b,d):null,d=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(d), f):null)?this.fixedHandleImage:null!=f&&null!=b?this.terminalHandleImage:this.handleImage;if(null!=d)return d=new mxImageShape(new mxRectangle(0,0,d.width,d.height),d.src),d.preserveImageAspect=!1,d;d=mxConstants.HANDLE_SIZE;this.preferHtml&&--d;return new mxRectangleShape(new mxRectangle(0,0,d,d),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var y=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,c,d){this.handleImage=c==mxEvent.ROTATION_HANDLE? HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return y.apply(this,arguments)};var D=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),d=c.getParent(a[0]),b=this.graph.getCellGeometry(a[0]);if(c.isEdge(d)&&null!=b&&b.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return D.apply(this, @@ -2421,17 +2422,17 @@ c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this. function(){I.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var R=mxEdgeHandler.prototype.redrawHandles; mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(R.apply(this),null!=this.state&&null!=this.linkHint)){var a=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(a=new mxRectangle(a.x,a.y,a.width,a.height),a.add(this.state.text.bounds));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(a.y+a.height+6+this.state.view.graph.tolerance)+"px"}};var Y=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset= function(){Y.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var aa=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){aa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler), -this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function d(){mxActor.call(this)}function e(){mxCylinder.call(this)}function b(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function m(){mxActor.call(this)}function p(){mxCylinder.call(this)}function q(){mxActor.call(this)}function v(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function u(){mxActor.call(this)}function t(){mxActor.call(this)}function h(a,c){this.canvas= -a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,h.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,h.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,h.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,h.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo; -this.canvas.curveTo=mxUtils.bind(this,h.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,h.prototype.arcTo)}function n(){mxRectangleShape.call(this)}function l(){mxRectangleShape.call(this)}function w(){mxActor.call(this)}function r(){mxActor.call(this)}function y(){mxActor.call(this)}function D(){mxRectangleShape.call(this)}function z(){mxRectangleShape.call(this)}function G(){mxCylinder.call(this)}function E(){mxShape.call(this)}function x(){mxShape.call(this)} +this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function d(){mxActor.call(this)}function e(){mxCylinder.call(this)}function b(){mxCylinder.call(this)}function h(){mxCylinder.call(this)}function m(){mxActor.call(this)}function p(){mxCylinder.call(this)}function q(){mxActor.call(this)}function v(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function u(){mxActor.call(this)}function t(){mxActor.call(this)}function l(a,c){this.canvas= +a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo; +this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo)}function n(){mxRectangleShape.call(this)}function k(){mxRectangleShape.call(this)}function w(){mxActor.call(this)}function r(){mxActor.call(this)}function y(){mxActor.call(this)}function D(){mxRectangleShape.call(this)}function z(){mxRectangleShape.call(this)}function G(){mxCylinder.call(this)}function E(){mxShape.call(this)}function x(){mxShape.call(this)} function J(){mxEllipse.call(this)}function H(){mxShape.call(this)}function B(){mxShape.call(this)}function N(){mxRectangleShape.call(this)}function C(){mxShape.call(this)}function I(){mxShape.call(this)}function R(){mxShape.call(this)}function Y(){mxCylinder.call(this)}function aa(){mxDoubleEllipse.call(this)}function Q(){mxDoubleEllipse.call(this)}function S(){mxArrowConnector.call(this);this.spacing=0}function K(){mxArrowConnector.call(this);this.spacing=0}function F(){mxActor.call(this)}function V(){mxRectangleShape.call(this)} function L(){mxActor.call(this)}function O(){mxActor.call(this)}function X(){mxActor.call(this)}function A(){mxActor.call(this)}function W(){mxActor.call(this)}function P(){mxActor.call(this)}function da(){mxActor.call(this)}function T(){mxActor.call(this)}function Z(){mxActor.call(this)}function U(){mxActor.call(this)}function ma(){mxEllipse.call(this)}function na(){mxEllipse.call(this)}function ca(){mxEllipse.call(this)}function ia(){mxRhombus.call(this)}function qa(){mxEllipse.call(this)}function ea(){mxEllipse.call(this)} -function ra(){mxEllipse.call(this)}function fa(){mxEllipse.call(this)}function ja(){mxActor.call(this)}function ba(){mxActor.call(this)}function ka(){mxActor.call(this)}function ga(){mxConnector.call(this)}function Aa(a,c,d,b,f,e,g,l,h,n){g+=h;var pa=b.clone();b.x-=f*(2*g+h);b.y-=e*(2*g+h);f*=g+h;e*=g+h;return function(){a.ellipse(pa.x-f-g,pa.y-e-g,2*g,2*g);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b, +function ra(){mxEllipse.call(this)}function fa(){mxEllipse.call(this)}function ja(){mxActor.call(this)}function ba(){mxActor.call(this)}function ka(){mxActor.call(this)}function ga(){mxConnector.call(this)}function Aa(a,c,d,b,f,e,g,k,n,l){g+=n;var pa=b.clone();b.x-=f*(2*g+n);b.y-=e*(2*g+n);f*=g+n;e*=g+n;return function(){a.ellipse(pa.x-f-g,pa.y-e-g,2*g,2*g);l?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b, Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(c,f),a.lineTo(c,c),a.lineTo(0,0),a.moveTo(c,c),a.lineTo(b,c)):(a.moveTo(0,0),a.lineTo(b-c,0),a.lineTo(b,c),a.lineTo(b,f),a.lineTo(c,f),a.lineTo(0,f-c),a.lineTo(0,0),a.close());a.end()};a.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?(a=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(a,a,0,0)):null};mxCellRenderer.registerShape("cube", a);var xa=Math.tan(mxUtils.toRadians(30)),oa=(.5-xa)/2;mxUtils.extend(d,mxActor);d.prototype.size=20;d.prototype.redrawPath=function(a,c,d,b,f){c=Math.min(b,f/xa);a.translate((b-c)/2,(f-c)/2+c/4);a.moveTo(0,.25*c);a.lineTo(.5*c,c*oa);a.lineTo(c,.25*c);a.lineTo(.5*c,(.5-oa)*c);a.lineTo(0,.25*c);a.close();a.end()};mxCellRenderer.registerShape("isoRectangle",d);mxUtils.extend(e,mxCylinder);e.prototype.size=20;e.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.min(b,f/(.5+xa));e?(a.moveTo(0,.25*c),a.lineTo(.5* c,(.5-oa)*c),a.lineTo(c,.25*c),a.moveTo(.5*c,(.5-oa)*c),a.lineTo(.5*c,(1-oa)*c)):(a.translate((b-c)/2,(f-c)/2),a.moveTo(0,.25*c),a.lineTo(.5*c,c*oa),a.lineTo(c,.25*c),a.lineTo(c,.75*c),a.lineTo(.5*c,(1-oa)*c),a.lineTo(0,.75*c),a.close());a.end()};mxCellRenderer.registerShape("isoCube",e);mxUtils.extend(b,mxCylinder);b.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.min(f/2,Math.round(f/8)+this.strokewidth-1);if(e&&null!=this.fill||!e&&null==this.fill)a.moveTo(0,c),a.curveTo(0,2*c,b,2*c,b,c),e|| (a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,b,2*c,b,c),e||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,b,2*c,b,c),e||(a.stroke(),a.begin()),a.translate(0,-c);e||(a.moveTo(0,c),a.curveTo(0,-c/3,b,-c/3,b,c),a.lineTo(b,f-c),a.curveTo(b,f+c/3,0,f+c/3,0,f-c),a.close())};b.prototype.getLabelMargins=function(a){return new mxRectangle(0,2.5*Math.min(a.height/2,Math.round(a.height/8)+this.strokewidth-1)*this.scale,0,0)};mxCellRenderer.registerShape("datastore", -b);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(b-c,0),a.lineTo(b-c,c),a.lineTo(b,c)):(a.moveTo(0,0),a.lineTo(b-c,0),a.lineTo(b,c),a.lineTo(b,f),a.lineTo(0,f),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.registerShape("note",k);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,d,b,f){a.moveTo(0,0);a.quadTo(b/2,.5*f,b,0);a.quadTo(.5* +b);mxUtils.extend(h,mxCylinder);h.prototype.size=30;h.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(b-c,0),a.lineTo(b-c,c),a.lineTo(b,c)):(a.moveTo(0,0),a.lineTo(b-c,0),a.lineTo(b,c),a.lineTo(b,f),a.lineTo(0,f),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.registerShape("note",h);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,d,b,f){a.moveTo(0,0);a.quadTo(b/2,.5*f,b,0);a.quadTo(.5* b,f/2,b,f);a.quadTo(b/2,.5*f,0,f);a.quadTo(.5*b,f/2,0,0);a.end()};mxCellRenderer.registerShape("switch",m);mxUtils.extend(p,mxCylinder);p.prototype.tabWidth=60;p.prototype.tabHeight=20;p.prototype.tabPosition="right";p.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));d=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var g=mxUtils.getValue(this.style,"tabPosition",this.tabPosition); e?"left"==g?(a.moveTo(0,d),a.lineTo(c,d)):(a.moveTo(b-c,d),a.lineTo(b,d)):("left"==g?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,d),a.lineTo(b,d)):(a.moveTo(0,d),a.lineTo(b-c,d),a.lineTo(b-c,0),a.lineTo(b,0)),a.lineTo(b,f),a.lineTo(0,f),a.lineTo(0,d),a.close());a.end()};mxCellRenderer.registerShape("folder",p);mxUtils.extend(q,mxActor);q.prototype.size=30;q.prototype.redrawPath=function(a,c,d,b,f){c=Math.max(0,Math.min(b,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d=mxUtils.getValue(this.style, mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(b,0),new mxPoint(b,f),new mxPoint(0,f),new mxPoint(0,c)],this.isRounded,d,!0);a.end()};mxCellRenderer.registerShape("card",q);mxUtils.extend(v,mxActor);v.prototype.size=.4;v.prototype.redrawPath=function(a,c,d,b,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(b/4,1.4*c,b/2,c/2);a.quadTo(3*b/4,c*(1-1.4),b,c/2);a.lineTo(b,f-c/2);a.quadTo(3* @@ -2441,48 +2442,48 @@ a.end()};mxCellRenderer.registerShape("document",c);var Ba=mxCylinder.prototype. mxActor);f.prototype.size=.2;f.prototype.redrawPath=function(a,c,d,b,f){c=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(b,0),new mxPoint(b-c,f)],this.isRounded,d,!0);a.end()};mxCellRenderer.registerShape("parallelogram",f);mxUtils.extend(g,mxActor);g.prototype.size=.2;g.prototype.redrawPath=function(a,c,d,b,f){c=b* Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(b-c,0),new mxPoint(b,f)],this.isRounded,d,!0)};mxCellRenderer.registerShape("trapezoid",g);mxUtils.extend(u,mxActor);u.prototype.size=.5;u.prototype.redrawPath=function(a,c,d,b,f){a.setFillColor(null);c=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size", this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(b,0),new mxPoint(c,0),new mxPoint(c,f/2),new mxPoint(0,f/2),new mxPoint(c,f/2),new mxPoint(c,f),new mxPoint(b,f)],this.isRounded,d,!1);a.end()};mxCellRenderer.registerShape("curlyBracket",u);mxUtils.extend(t,mxActor);t.prototype.redrawPath=function(a,c,d,b,f){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=b/5;a.rect(0,0,c,f);a.fillAndStroke();a.rect(2*c,0,c,f);a.fillAndStroke(); -a.rect(4*c,0,c,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",t);h.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;this.firstX=a;this.firstY=c};h.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};h.prototype.quadTo=function(a,c,d,b){this.originalQuadTo.apply(this.canvas, -arguments);this.lastX=d;this.lastY=b};h.prototype.curveTo=function(a,c,d,b,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};h.prototype.arcTo=function(a,c,d,b,f,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=g};h.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var d=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},b=Math.abs(a-this.lastX),f=Math.abs(c-this.lastY),e=Math.sqrt(b*b+f*f);if(2>e){this.originalLineTo.apply(this.canvas, -arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(e/10),l=this.defaultVariation;5>g&&(g=5,l/=3);for(var pa=d(a-this.lastX)*b/g,d=d(c-this.lastY)*f/g,b=b/e,f=f/e,e=0;e<g;e++){var h=(Math.random()-.5)*l;this.originalLineTo.call(this.canvas,pa*e+this.lastX-h*f,d*e+this.lastY-h*b)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};h.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo= -this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var Fa=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new h(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Fa.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(), +a.rect(4*c,0,c,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",t);l.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;this.firstX=a;this.firstY=c};l.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};l.prototype.quadTo=function(a,c,d,b){this.originalQuadTo.apply(this.canvas, +arguments);this.lastX=d;this.lastY=b};l.prototype.curveTo=function(a,c,d,b,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};l.prototype.arcTo=function(a,c,d,b,f,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=g};l.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var d=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},b=Math.abs(a-this.lastX),f=Math.abs(c-this.lastY),e=Math.sqrt(b*b+f*f);if(2>e){this.originalLineTo.apply(this.canvas, +arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(e/10),k=this.defaultVariation;5>g&&(g=5,k/=3);for(var pa=d(a-this.lastX)*b/g,d=d(c-this.lastY)*f/g,b=b/e,f=f/e,e=0;e<g;e++){var n=(Math.random()-.5)*k;this.originalLineTo.call(this.canvas,pa*e+this.lastX-n*f,d*e+this.lastY-n*b)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo= +this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var Fa=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new l(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Fa.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(), delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var Ga=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Ga.apply(this,arguments)};var Ha=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,c,d,b,f){if(null==a.handJiggle)Ha.apply(this,arguments);else{var e=!0;null!=this.style&&(e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS, "1"));if(e||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)e||null!=this.fill&&this.fill!=mxConstants.NONE||(a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?e=Math.min(b/2,Math.min(f/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.min(b* e,f*e)),a.moveTo(c+e,d),a.lineTo(c+b-e,d),a.quadTo(c+b,d,c+b,d+e),a.lineTo(c+b,d+f-e),a.quadTo(c+b,d+f,c+b-e,d+f),a.lineTo(c+e,d+f),a.quadTo(c,d+f,c,d+f-e),a.lineTo(c,d+e),a.quadTo(c,d,c+e,d)):(a.moveTo(c,d),a.lineTo(c+b,d),a.lineTo(c+b,d+f),a.lineTo(c,d+f),a.lineTo(c,d)),a.close(),a.end(),a.fillAndStroke()}};var Ia=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,c,d,b,f){null==a.handJiggle&&Ia.apply(this,arguments)};mxUtils.extend(n,mxRectangleShape); n.prototype.size=.1;n.prototype.isHtmlAllowed=function(){return!1};n.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var c=a.width,d=a.height;a=new mxRectangle(a.x,a.y,c,d);var b=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE, 100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,b=Math.max(b,Math.min(c*f,d*f));a.x+=Math.round(b);a.width-=Math.round(2*b)}return a};n.prototype.paintForeground=function(a,c,d,b,f){var e=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(b*g,f*g));e=Math.round(e);a.begin();a.moveTo(c+e,d);a.lineTo(c+e,d+f);a.moveTo(c+b- -e,d);a.lineTo(c+b-e,d+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",n);mxUtils.extend(l,mxRectangleShape);l.prototype.paintBackground=function(a,c,d,b,f){a.setFillColor(mxConstants.NONE);a.rect(c,d,b,f);a.fill()};l.prototype.paintForeground=function(a,c,d,b,f){};mxCellRenderer.registerShape("transparent",l);mxUtils.extend(w,mxHexagon);w.prototype.size=30;w.prototype.position=.5;w.prototype.position2=.5;w.prototype.base= +e,d);a.lineTo(c+b-e,d+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",n);mxUtils.extend(k,mxRectangleShape);k.prototype.paintBackground=function(a,c,d,b,f){a.setFillColor(mxConstants.NONE);a.rect(c,d,b,f);a.fill()};k.prototype.paintForeground=function(a,c,d,b,f){};mxCellRenderer.registerShape("transparent",k);mxUtils.extend(w,mxHexagon);w.prototype.size=30;w.prototype.position=.5;w.prototype.position2=.5;w.prototype.base= 20;w.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};w.prototype.redrawPath=function(a,c,d,b,f){c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var e=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),g=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style, -"position2",this.position2)))),l=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(a,[new mxPoint(0,0),new mxPoint(b,0),new mxPoint(b,f-d),new mxPoint(Math.min(b,e+l),f-d),new mxPoint(g,f),new mxPoint(Math.max(0,e),f-d),new mxPoint(0,f-d)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",w);mxUtils.extend(r,mxActor);r.prototype.size=.2;r.prototype.fixedSize=20;r.prototype.redrawPath=function(a,c,d,b,f){c="0"!=mxUtils.getValue(this.style, +"position2",this.position2)))),k=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(a,[new mxPoint(0,0),new mxPoint(b,0),new mxPoint(b,f-d),new mxPoint(Math.min(b,e+k),f-d),new mxPoint(g,f),new mxPoint(Math.max(0,e),f-d),new mxPoint(0,f-d)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",w);mxUtils.extend(r,mxActor);r.prototype.size=.2;r.prototype.fixedSize=20;r.prototype.redrawPath=function(a,c,d,b,f){c="0"!=mxUtils.getValue(this.style, "fixedSize","0")?Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(b-c,0),new mxPoint(b,f/2),new mxPoint(b-c,f),new mxPoint(0,f),new mxPoint(c,f/2)],this.isRounded,d,!0);a.end()};mxCellRenderer.registerShape("step",r);mxUtils.extend(y,mxHexagon);y.prototype.size= .25;y.prototype.redrawPath=function(a,c,d,b,f){c=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(b-c,0),new mxPoint(b,.5*f),new mxPoint(b-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],this.isRounded,d,!0)};mxCellRenderer.registerShape("hexagon",y);mxUtils.extend(D,mxRectangleShape);D.prototype.isHtmlAllowed=function(){return!1};D.prototype.paintForeground= function(a,c,d,b,f){var e=Math.min(b/5,f/5)+1;a.begin();a.moveTo(c+b/2,d+e);a.lineTo(c+b/2,d+f-e);a.moveTo(c+e,d+f/2);a.lineTo(c+b-e,d+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",D);var Ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+ c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,d,b,f){Ca.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var e=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;d+=e;b-=2*e;f-=2*e;0<b&&0<f&&(a.setShadow(!1),Ca.apply(this,[a,c,d,b,f]))}};mxUtils.extend(z,mxRectangleShape);z.prototype.isHtmlAllowed=function(){return!1};z.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2, this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};z.prototype.paintForeground=function(a,c,d,b,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;d+=e;b-=2*e;f-=2*e;0<b&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,g;do{g=mxCellRenderer.defaultShapes[this.style["symbol"+ -e]];if(null!=g){var l=this.style["symbol"+e+"Align"],pa=this.style["symbol"+e+"VerticalAlign"],h=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],r=this.style["symbol"+e+"Spacing"]||0,u=this.style["symbol"+e+"VSpacing"]||r,t=this.style["symbol"+e+"ArcSpacing"];null!=t&&(t*=this.getArcSize(b+this.strokewidth,f+this.strokewidth),r+=t,u+=t);var t=c,w=d,t=l==mxConstants.ALIGN_CENTER?t+(b-h)/2:l==mxConstants.ALIGN_RIGHT?t+(b-h-r):t+r,w=pa==mxConstants.ALIGN_MIDDLE?w+(f-n)/2:pa==mxConstants.ALIGN_BOTTOM? -w+(f-n-u):w+u;a.save();l=new g;l.style=this.style;g.prototype.paintVertexShape.call(l,a,t,w,h,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",z);mxUtils.extend(G,mxCylinder);G.prototype.redrawPath=function(a,c,d,b,f,e){e?(a.moveTo(0,0),a.lineTo(b/2,f/2),a.lineTo(b,0),a.end()):(a.moveTo(0,0),a.lineTo(b,0),a.lineTo(b,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",G);mxUtils.extend(E,mxShape); +e]];if(null!=g){var k=this.style["symbol"+e+"Align"],pa=this.style["symbol"+e+"VerticalAlign"],n=this.style["symbol"+e+"Width"],l=this.style["symbol"+e+"Height"],r=this.style["symbol"+e+"Spacing"]||0,u=this.style["symbol"+e+"VSpacing"]||r,t=this.style["symbol"+e+"ArcSpacing"];null!=t&&(t*=this.getArcSize(b+this.strokewidth,f+this.strokewidth),r+=t,u+=t);var t=c,w=d,t=k==mxConstants.ALIGN_CENTER?t+(b-n)/2:k==mxConstants.ALIGN_RIGHT?t+(b-n-r):t+r,w=pa==mxConstants.ALIGN_MIDDLE?w+(f-l)/2:pa==mxConstants.ALIGN_BOTTOM? +w+(f-l-u):w+u;a.save();k=new g;k.style=this.style;g.prototype.paintVertexShape.call(k,a,t,w,n,l);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",z);mxUtils.extend(G,mxCylinder);G.prototype.redrawPath=function(a,c,d,b,f,e){e?(a.moveTo(0,0),a.lineTo(b/2,f/2),a.lineTo(b,0),a.end()):(a.moveTo(0,0),a.lineTo(b,0),a.lineTo(b,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",G);mxUtils.extend(E,mxShape); E.prototype.paintBackground=function(a,c,d,b,f){a.translate(c,d);a.ellipse(b/4,0,b/2,f/4);a.fillAndStroke();a.begin();a.moveTo(b/2,f/4);a.lineTo(b/2,2*f/3);a.moveTo(b/2,f/3);a.lineTo(0,f/3);a.moveTo(b/2,f/3);a.lineTo(b,f/3);a.moveTo(b/2,2*f/3);a.lineTo(0,f);a.moveTo(b/2,2*f/3);a.lineTo(b,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlActor",E);mxUtils.extend(x,mxShape);x.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};x.prototype.paintBackground=function(a, c,d,b,f){a.translate(c,d);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(b/6,f/2);a.end();a.stroke();a.ellipse(b/6,0,5*b/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",x);mxUtils.extend(J,mxEllipse);J.prototype.paintVertexShape=function(a,c,d,b,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+b/8,d+f);a.lineTo(c+7*b/8,d+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",J);mxUtils.extend(H, mxShape);H.prototype.paintVertexShape=function(a,c,d,b,f){a.translate(c,d);a.begin();a.moveTo(b,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(b,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",H);mxUtils.extend(B,mxShape);B.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};B.prototype.paintBackground=function(a,c,d,b,f){a.translate(c,d);a.begin();a.moveTo(3*b/8,f/8*1.1);a.lineTo(5*b/8,0);a.end();a.stroke();a.ellipse(0,f/8,b,7*f/8);a.fillAndStroke()}; B.prototype.paintForeground=function(a,c,d,b,f){a.begin();a.moveTo(3*b/8,f/8*1.1);a.lineTo(5*b/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",B);mxUtils.extend(N,mxRectangleShape);N.prototype.size=40;N.prototype.isHtmlAllowed=function(){return!1};N.prototype.getLabelBounds=function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,c)};N.prototype.paintBackground=function(a,c,d,b, f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),g=mxUtils.getValue(this.style,"participant");null==g||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,d,b,e):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=N&&(g=new g,g.apply(this.state),a.save(),g.paintVertexShape(a,c,d,b,e),a.restore()));e<f&&(a.setDashed(!0),a.begin(),a.moveTo(c+b/2,d+e),a.lineTo(c+b/2,d+f),a.end(),a.stroke())};N.prototype.paintForeground=function(a, c,d,b,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,d,b,Math.min(f,e))};mxCellRenderer.registerShape("umlLifeline",N);mxUtils.extend(C,mxShape);C.prototype.width=60;C.prototype.height=30;C.prototype.corner=10;C.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style, -"height",this.height)*this.scale))};C.prototype.paintBackground=function(a,c,d,b,f){var e=this.corner,g=Math.min(b,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),l=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),h=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);h!=mxConstants.NONE&&(a.setFillColor(h),a.rect(c,d,b,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!= -mxConstants.NONE?(this.getGradientBounds(a,c,d,b,f),a.setGradient(this.fill,this.gradient,c,d,b,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,d);a.lineTo(c+g,d);a.lineTo(c+g,d+Math.max(0,l-1.5*e));a.lineTo(c+Math.max(0,g-e),d+l);a.lineTo(c,d+l);a.close();a.fillAndStroke();a.begin();a.moveTo(c+g,d);a.lineTo(c+b,d);a.lineTo(c+b,d+f);a.lineTo(c,d+f);a.lineTo(c,d+l);a.stroke()};mxCellRenderer.registerShape("umlFrame",C);mxPerimeter.LifelinePerimeter=function(a,c,d,b){b=N.prototype.size; +"height",this.height)*this.scale))};C.prototype.paintBackground=function(a,c,d,b,f){var e=this.corner,g=Math.min(b,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),k=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),n=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);n!=mxConstants.NONE&&(a.setFillColor(n),a.rect(c,d,b,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!= +mxConstants.NONE?(this.getGradientBounds(a,c,d,b,f),a.setGradient(this.fill,this.gradient,c,d,b,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,d);a.lineTo(c+g,d);a.lineTo(c+g,d+Math.max(0,k-1.5*e));a.lineTo(c+Math.max(0,g-e),d+k);a.lineTo(c,d+k);a.close();a.fillAndStroke();a.begin();a.moveTo(c+g,d);a.lineTo(c+b,d);a.lineTo(c+b,d+f);a.lineTo(c,d+f);a.lineTo(c,d+k);a.stroke()};mxCellRenderer.registerShape("umlFrame",C);mxPerimeter.LifelinePerimeter=function(a,c,d,b){b=N.prototype.size; null!=c&&(b=mxUtils.getValue(c.style,"size",b)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;d.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+b,d.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(a,c,d,b){b=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter); mxPerimeter.BackbonePerimeter=function(a,c,d,b){b=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;null!=c.style.backboneSize&&(b+=parseFloat(c.style.backboneSize)*c.view.scale/2-1);if("south"==c.style[mxConstants.STYLE_DIRECTION]||"north"==c.style[mxConstants.STYLE_DIRECTION])return d.x<a.getCenterX()&&(b=-1*(b+1)),new mxPoint(a.getCenterX()+b,Math.min(a.y+a.height,Math.max(a.y,d.y)));d.y<a.getCenterY()&&(b=-1*(b+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,d.x)), a.getCenterY()+b)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,c,d,b){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(c.style,"size",w.prototype.size))*c.view.scale))),c.style),c,d,b)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,c,d,b){var e=f.prototype.size; -null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,l=a.y,h=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(e=n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+h,l+e),new mxPoint(g+h,l+n),new mxPoint(g,l+n-e),new mxPoint(g,l)]):(e=h*Math.max(0,Math.min(1,e)),l=[new mxPoint(g+e,l),new mxPoint(g+h,l),new mxPoint(g+h-e,l+n),new mxPoint(g, -l+n),new mxPoint(g+e,l)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);b&&(d.x<g||d.x>g+h?a.y=d.y:a.x=d.x);return mxUtils.getPerimeterPoint(l,a,d)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,d,b){var f=g.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,l=a.y,h=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST; -c==mxConstants.DIRECTION_EAST?(f=h*Math.max(0,Math.min(1,f)),l=[new mxPoint(e+f,l),new mxPoint(e+h-f,l),new mxPoint(e+h,l+n),new mxPoint(e,l+n),new mxPoint(e+f,l)]):c==mxConstants.DIRECTION_WEST?(f=h*Math.max(0,Math.min(1,f)),l=[new mxPoint(e,l),new mxPoint(e+h,l),new mxPoint(e+h-f,l+n),new mxPoint(e+f,l+n),new mxPoint(e,l)]):c==mxConstants.DIRECTION_NORTH?(f=n*Math.max(0,Math.min(1,f)),l=[new mxPoint(e,l+f),new mxPoint(e+h,l),new mxPoint(e+h,l+n),new mxPoint(e,l+n-f),new mxPoint(e,l+f)]):(f=n*Math.max(0, -Math.min(1,f)),l=[new mxPoint(e,l),new mxPoint(e+h,l+f),new mxPoint(e+h,l+n-f),new mxPoint(e,l+n),new mxPoint(e,l)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);b&&(d.x<e||d.x>e+h?a.y=d.y:a.x=d.x);return mxUtils.getPerimeterPoint(l,a,d)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,d,b){var f="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=f?r.prototype.fixedSize:r.prototype.size;null!=c&&(e=mxUtils.getValue(c.style, -"size",e));var g=a.x,l=a.y,h=a.width,n=a.height,u=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(h,e)):h*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+h-f,l),new mxPoint(g+h,a),new mxPoint(g+h-f,l+n),new mxPoint(g,l+n),new mxPoint(g+f,a),new mxPoint(g,l)]):c==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(h,e)):h*Math.max(0, -Math.min(1,e)),l=[new mxPoint(g+f,l),new mxPoint(g+h,l),new mxPoint(g+h-f,a),new mxPoint(g+h,l+n),new mxPoint(g+f,l+n),new mxPoint(g,a),new mxPoint(g+f,l)]):c==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+f),new mxPoint(u,l),new mxPoint(g+h,l+f),new mxPoint(g+h,l+n),new mxPoint(u,l+n-f),new mxPoint(g,l+n),new mxPoint(g,l+f)]):(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(u,l+f),new mxPoint(g+ -h,l),new mxPoint(g+h,l+n-f),new mxPoint(u,l+n),new mxPoint(g,l+n-f),new mxPoint(g,l)]);u=new mxPoint(u,a);b&&(d.x<g||d.x>g+h?u.y=d.y:u.x=d.x);return mxUtils.getPerimeterPoint(l,u,d)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,d,b){var f=y.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,g=a.y,l=a.width,h=a.height,n=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION, -mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(f=h*Math.max(0,Math.min(1,f)),g=[new mxPoint(n,g),new mxPoint(e+l,g+f),new mxPoint(e+l,g+h-f),new mxPoint(n,g+h),new mxPoint(e,g+h-f),new mxPoint(e,g+f),new mxPoint(n,g)]):(f=l*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+f,g),new mxPoint(e+l-f,g),new mxPoint(e+l,a),new mxPoint(e+l-f,g+h),new mxPoint(e+f,g+h),new mxPoint(e,a),new mxPoint(e+f,g)]);n=new mxPoint(n,a);b&&(d.x<e||d.x>e+ -l?n.y=d.y:n.x=d.x);return mxUtils.getPerimeterPoint(g,n,d)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(I,mxShape);I.prototype.size=10;I.prototype.paintBackground=function(a,c,d,b,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,d);a.ellipse((b-e)/2,0,e,e);a.fillAndStroke();a.begin();a.moveTo(b/2,e);a.lineTo(b/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",I);mxUtils.extend(R,mxShape);R.prototype.size= +null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,k=a.y,n=a.width,l=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(e=l*Math.max(0,Math.min(1,e)),k=[new mxPoint(g,k),new mxPoint(g+n,k+e),new mxPoint(g+n,k+l),new mxPoint(g,k+l-e),new mxPoint(g,k)]):(e=n*Math.max(0,Math.min(1,e)),k=[new mxPoint(g+e,k),new mxPoint(g+n,k),new mxPoint(g+n-e,k+l),new mxPoint(g, +k+l),new mxPoint(g+e,k)]);l=a.getCenterX();a=a.getCenterY();a=new mxPoint(l,a);b&&(d.x<g||d.x>g+n?a.y=d.y:a.x=d.x);return mxUtils.getPerimeterPoint(k,a,d)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,d,b){var f=g.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,k=a.y,n=a.width,l=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST; +c==mxConstants.DIRECTION_EAST?(f=n*Math.max(0,Math.min(1,f)),k=[new mxPoint(e+f,k),new mxPoint(e+n-f,k),new mxPoint(e+n,k+l),new mxPoint(e,k+l),new mxPoint(e+f,k)]):c==mxConstants.DIRECTION_WEST?(f=n*Math.max(0,Math.min(1,f)),k=[new mxPoint(e,k),new mxPoint(e+n,k),new mxPoint(e+n-f,k+l),new mxPoint(e+f,k+l),new mxPoint(e,k)]):c==mxConstants.DIRECTION_NORTH?(f=l*Math.max(0,Math.min(1,f)),k=[new mxPoint(e,k+f),new mxPoint(e+n,k),new mxPoint(e+n,k+l),new mxPoint(e,k+l-f),new mxPoint(e,k+f)]):(f=l*Math.max(0, +Math.min(1,f)),k=[new mxPoint(e,k),new mxPoint(e+n,k+f),new mxPoint(e+n,k+l-f),new mxPoint(e,k+l),new mxPoint(e,k)]);l=a.getCenterX();a=a.getCenterY();a=new mxPoint(l,a);b&&(d.x<e||d.x>e+n?a.y=d.y:a.x=d.x);return mxUtils.getPerimeterPoint(k,a,d)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,d,b){var f="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=f?r.prototype.fixedSize:r.prototype.size;null!=c&&(e=mxUtils.getValue(c.style, +"size",e));var g=a.x,k=a.y,n=a.width,l=a.height,u=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),k=[new mxPoint(g,k),new mxPoint(g+n-f,k),new mxPoint(g+n,a),new mxPoint(g+n-f,k+l),new mxPoint(g,k+l),new mxPoint(g+f,a),new mxPoint(g,k)]):c==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0, +Math.min(1,e)),k=[new mxPoint(g+f,k),new mxPoint(g+n,k),new mxPoint(g+n-f,a),new mxPoint(g+n,k+l),new mxPoint(g+f,k+l),new mxPoint(g,a),new mxPoint(g+f,k)]):c==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(l,e)):l*Math.max(0,Math.min(1,e)),k=[new mxPoint(g,k+f),new mxPoint(u,k),new mxPoint(g+n,k+f),new mxPoint(g+n,k+l),new mxPoint(u,k+l-f),new mxPoint(g,k+l),new mxPoint(g,k+f)]):(f=f?Math.max(0,Math.min(l,e)):l*Math.max(0,Math.min(1,e)),k=[new mxPoint(g,k),new mxPoint(u,k+f),new mxPoint(g+ +n,k),new mxPoint(g+n,k+l-f),new mxPoint(u,k+l),new mxPoint(g,k+l-f),new mxPoint(g,k)]);u=new mxPoint(u,a);b&&(d.x<g||d.x>g+n?u.y=d.y:u.x=d.x);return mxUtils.getPerimeterPoint(k,u,d)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,d,b){var f=y.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,g=a.y,k=a.width,n=a.height,l=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION, +mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(f=n*Math.max(0,Math.min(1,f)),g=[new mxPoint(l,g),new mxPoint(e+k,g+f),new mxPoint(e+k,g+n-f),new mxPoint(l,g+n),new mxPoint(e,g+n-f),new mxPoint(e,g+f),new mxPoint(l,g)]):(f=k*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+f,g),new mxPoint(e+k-f,g),new mxPoint(e+k,a),new mxPoint(e+k-f,g+n),new mxPoint(e+f,g+n),new mxPoint(e,a),new mxPoint(e+f,g)]);l=new mxPoint(l,a);b&&(d.x<e||d.x>e+ +k?l.y=d.y:l.x=d.x);return mxUtils.getPerimeterPoint(g,l,d)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(I,mxShape);I.prototype.size=10;I.prototype.paintBackground=function(a,c,d,b,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,d);a.ellipse((b-e)/2,0,e,e);a.fillAndStroke();a.begin();a.moveTo(b/2,e);a.lineTo(b/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",I);mxUtils.extend(R,mxShape);R.prototype.size= 10;R.prototype.inset=2;R.prototype.paintBackground=function(a,c,d,b,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size)),g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,d);a.begin();a.moveTo(b/2,e+g);a.lineTo(b/2,f);a.end();a.stroke();a.begin();a.moveTo((b-e)/2-g,e/2);a.quadTo((b-e)/2-g,e+g,b/2,e+g);a.quadTo((b+e)/2+g,e+g,(b+e)/2+g,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",R);mxUtils.extend(Y,mxCylinder);Y.prototype.jettyWidth= -32;Y.prototype.jettyHeight=12;Y.prototype.redrawPath=function(a,c,d,b,f,e){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));d=g/2;var g=d+g/2,l=.3*f-c/2,h=.7*f-c/2;e?(a.moveTo(d,l),a.lineTo(g,l),a.lineTo(g,l+c),a.lineTo(d,l+c),a.moveTo(d,h),a.lineTo(g,h),a.lineTo(g,h+c),a.lineTo(d,h+c)):(a.moveTo(d,0),a.lineTo(b,0),a.lineTo(b,f),a.lineTo(d,f),a.lineTo(d,h+c),a.lineTo(0,h+c),a.lineTo(0,h),a.lineTo(d, -h),a.lineTo(d,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(d,l),a.close());a.end()};mxCellRenderer.registerShape("component",Y);mxUtils.extend(aa,mxDoubleEllipse);aa.prototype.outerStroke=!0;aa.prototype.paintVertexShape=function(a,c,d,b,f){var e=Math.min(4,Math.min(b/5,f/5));0<b&&0<f&&(a.ellipse(c+e,d+e,b-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,d,b,f),a.stroke())};mxCellRenderer.registerShape("endState",aa);mxUtils.extend(Q,aa);Q.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState", +32;Y.prototype.jettyHeight=12;Y.prototype.redrawPath=function(a,c,d,b,f,e){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));d=g/2;var g=d+g/2,k=.3*f-c/2,n=.7*f-c/2;e?(a.moveTo(d,k),a.lineTo(g,k),a.lineTo(g,k+c),a.lineTo(d,k+c),a.moveTo(d,n),a.lineTo(g,n),a.lineTo(g,n+c),a.lineTo(d,n+c)):(a.moveTo(d,0),a.lineTo(b,0),a.lineTo(b,f),a.lineTo(d,f),a.lineTo(d,n+c),a.lineTo(0,n+c),a.lineTo(0,n),a.lineTo(d, +n),a.lineTo(d,k+c),a.lineTo(0,k+c),a.lineTo(0,k),a.lineTo(d,k),a.close());a.end()};mxCellRenderer.registerShape("component",Y);mxUtils.extend(aa,mxDoubleEllipse);aa.prototype.outerStroke=!0;aa.prototype.paintVertexShape=function(a,c,d,b,f){var e=Math.min(4,Math.min(b/5,f/5));0<b&&0<f&&(a.ellipse(c+e,d+e,b-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,d,b,f),a.stroke())};mxCellRenderer.registerShape("endState",aa);mxUtils.extend(Q,aa);Q.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState", Q);mxUtils.extend(S,mxArrowConnector);S.prototype.defaultWidth=4;S.prototype.isOpenEnded=function(){return!0};S.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};S.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",S);mxUtils.extend(K,mxArrowConnector);K.prototype.defaultWidth=10;K.prototype.defaultArrowWidth=20;K.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+ mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};K.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};K.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",K);mxUtils.extend(F,mxActor);F.prototype.size=30;F.prototype.redrawPath=function(a,c,d,b,f){c=Math.min(f,parseFloat(mxUtils.getValue(this.style, "size",this.size)));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(0,c),new mxPoint(b,0),new mxPoint(b,f)],this.isRounded,d,!0);a.end()};mxCellRenderer.registerShape("manualInput",F);mxUtils.extend(V,mxRectangleShape);V.prototype.dx=20;V.prototype.dy=20;V.prototype.isHtmlAllowed=function(){return!1};V.prototype.paintForeground=function(a,c,d,b,f){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e= @@ -2505,32 +2506,32 @@ a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(c+b/2,d),a.l function(a,c,d,b,f){c=Math.min(f,b);var e=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(f-e)/2;d=c+e;var g=(b-e)/2,e=g+e;a.moveTo(0,c);a.lineTo(g,c);a.lineTo(g,0);a.lineTo(e,0);a.lineTo(e,c);a.lineTo(b,c);a.lineTo(b,d);a.lineTo(e,d);a.lineTo(e,f);a.lineTo(g,f);a.lineTo(g,d);a.lineTo(0,d);a.close();a.end()};mxCellRenderer.registerShape("cross",ba);mxUtils.extend(ka,mxActor);ka.prototype.size=.25;ka.prototype.redrawPath=function(a,c,d,b,f){c=Math.min(b,f/2); d=Math.min(b-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*b);a.moveTo(0,f/2);a.lineTo(d,0);a.lineTo(b-c,0);a.quadTo(b,0,b,f/2);a.quadTo(b,f,b-c,f);a.lineTo(d,f);a.close();a.end()};mxCellRenderer.registerShape("display",ka);mxUtils.extend(ga,mxConnector);ga.prototype.origPaintEdgeShape=ga.prototype.paintEdgeShape;ga.prototype.paintEdgeShape=function(a,c,d){for(var b=[],f=0;f<c.length;f++)b.push(mxUtils.clone(c[f]));var f=a.state.dashed,e=a.state.fixDash;ga.prototype.origPaintEdgeShape.apply(this, [a,b,d]);3<=a.state.strokeWidth&&(b=mxUtils.getValue(this.style,"fillColor",null),null!=b&&(a.setStrokeColor(b),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(f,e),ga.prototype.origPaintEdgeShape.apply(this,[a,c,d])))};mxCellRenderer.registerShape("filledEdge",ga);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),d=a.apply(this,arguments);"umlFrame"==c.style.shape&& -d.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return d}}();mxMarker.addMarker("dash",function(a,c,d,b,f,e,g,l,h,n){var r=f*(g+h+1),u=e*(g+h+1);return function(){a.begin();a.moveTo(b.x-r/2-u/2,b.y-u/2+r/2);a.lineTo(b.x+u/2-3*r/2,b.y-3*u/2-r/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,d,b,f,e,g,l,h,n){var r=f*(g+h+1),u=e*(g+h+1);return function(){a.begin();a.moveTo(b.x-r/2-u/2,b.y-u/2+r/2);a.lineTo(b.x+u/2-3*r/2,b.y-3*u/2-r/2);a.moveTo(b.x- -r/2+u/2,b.y-u/2-r/2);a.lineTo(b.x-u/2-3*r/2,b.y-3*u/2+r/2);a.stroke()}});mxMarker.addMarker("circle",Aa);mxMarker.addMarker("circlePlus",function(a,c,b,d,f,e,g,l,h,n){var r=d.clone(),u=Aa.apply(this,arguments),t=f*(g+2*h),w=e*(g+2*h);return function(){u.apply(this,arguments);a.begin();a.moveTo(r.x-f*h,r.y-e*h);a.lineTo(r.x-2*t+f*h,r.y-2*w+e*h);a.moveTo(r.x-t-w+e*h,r.y-w+t-f*h);a.lineTo(r.x+w-t-e*h,r.y-w-t+f*h);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,d,f,e,g,l,h,n){c=f*h*1.118;b=e* -h*1.118;f*=g+h;e*=g+h;var r=d.clone();r.x-=c;r.y-=b;d.x+=1*-f-c;d.y+=1*-e-b;return function(){a.begin();a.moveTo(r.x,r.y);l?a.lineTo(r.x-f-e/2,r.y-e+f/2):a.lineTo(r.x+e/2-f,r.y-e-f/2);a.lineTo(r.x-f,r.y-e);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,d,b,f,e,g,l,h,n,r){e*=l+n;g*=l+n;var u=f.clone();return function(){c.begin();c.moveTo(u.x,u.y);h?c.lineTo(u.x-e-g/a,u.y-g+e/a):c.lineTo(u.x+g/a-e,u.y-g-e/a);c.stroke()}}}(2));if("undefined"!== -typeof mxVertexHandler){var Da=function(a,c,d){return sa(a,["width"],c,function(c,b,f,e,g){g=a.shape.getEdgeWidth()*a.view.scale+d;return new mxPoint(e.x+b*c/4+f*g/2,e.y+f*c/4-b*g/2)},function(c,b,f,e,g,l){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));a.style.width=Math.round(2*c)/a.view.scale-d})},sa=function(a,c,d,b,f){return M(a,c,function(c){var f=a.absolutePoints,e=f.length-1;c=a.view.translate;var g=a.view.scale,l=d?f[0]:f[e],f=d?f[1]:f[e-1],e=f.x-l.x,h=f.y-l.y,n=Math.sqrt(e*e+h* -h),l=b.call(this,n,e/n,h/n,l,f);return new mxPoint(l.x/g-c.x,l.y/g-c.y)},function(c,b,e){var g=a.absolutePoints,l=g.length-1;c=a.view.translate;var h=a.view.scale,n=d?g[0]:g[l],g=d?g[1]:g[l-1],l=g.x-n.x,r=g.y-n.y,u=Math.sqrt(l*l+r*r);b.x=(b.x+c.x)*h;b.y=(b.y+c.y)*h;f.call(this,u,l/u,r/u,n,g,b,e)})},la=function(a){return function(c){return[M(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",A.prototype.arrowWidth))),d=Math.max(0,Math.min(a, +d.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return d}}();mxMarker.addMarker("dash",function(a,c,d,b,f,e,g,k,n,l){var r=f*(g+n+1),u=e*(g+n+1);return function(){a.begin();a.moveTo(b.x-r/2-u/2,b.y-u/2+r/2);a.lineTo(b.x+u/2-3*r/2,b.y-3*u/2-r/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,d,b,f,e,g,k,n,l){var r=f*(g+n+1),u=e*(g+n+1);return function(){a.begin();a.moveTo(b.x-r/2-u/2,b.y-u/2+r/2);a.lineTo(b.x+u/2-3*r/2,b.y-3*u/2-r/2);a.moveTo(b.x- +r/2+u/2,b.y-u/2-r/2);a.lineTo(b.x-u/2-3*r/2,b.y-3*u/2+r/2);a.stroke()}});mxMarker.addMarker("circle",Aa);mxMarker.addMarker("circlePlus",function(a,c,b,d,f,e,g,k,n,l){var r=d.clone(),u=Aa.apply(this,arguments),t=f*(g+2*n),w=e*(g+2*n);return function(){u.apply(this,arguments);a.begin();a.moveTo(r.x-f*n,r.y-e*n);a.lineTo(r.x-2*t+f*n,r.y-2*w+e*n);a.moveTo(r.x-t-w+e*n,r.y-w+t-f*n);a.lineTo(r.x+w-t-e*n,r.y-w-t+f*n);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,d,f,e,g,k,n,l){c=f*n*1.118;b=e* +n*1.118;f*=g+n;e*=g+n;var r=d.clone();r.x-=c;r.y-=b;d.x+=1*-f-c;d.y+=1*-e-b;return function(){a.begin();a.moveTo(r.x,r.y);k?a.lineTo(r.x-f-e/2,r.y-e+f/2):a.lineTo(r.x+e/2-f,r.y-e-f/2);a.lineTo(r.x-f,r.y-e);a.close();l?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,d,b,f,e,g,k,n,l,r){e*=k+l;g*=k+l;var u=f.clone();return function(){c.begin();c.moveTo(u.x,u.y);n?c.lineTo(u.x-e-g/a,u.y-g+e/a):c.lineTo(u.x+g/a-e,u.y-g-e/a);c.stroke()}}}(2));if("undefined"!== +typeof mxVertexHandler){var Da=function(a,c,d){return sa(a,["width"],c,function(c,b,f,e,g){g=a.shape.getEdgeWidth()*a.view.scale+d;return new mxPoint(e.x+b*c/4+f*g/2,e.y+f*c/4-b*g/2)},function(c,b,f,e,g,k){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));a.style.width=Math.round(2*c)/a.view.scale-d})},sa=function(a,c,d,b,f){return M(a,c,function(c){var f=a.absolutePoints,e=f.length-1;c=a.view.translate;var g=a.view.scale,k=d?f[0]:f[e],f=d?f[1]:f[e-1],e=f.x-k.x,n=f.y-k.y,l=Math.sqrt(e*e+n* +n),k=b.call(this,l,e/l,n/l,k,f);return new mxPoint(k.x/g-c.x,k.y/g-c.y)},function(c,b,e){var g=a.absolutePoints,k=g.length-1;c=a.view.translate;var n=a.view.scale,l=d?g[0]:g[k],g=d?g[1]:g[k-1],k=g.x-l.x,r=g.y-l.y,u=Math.sqrt(k*k+r*r);b.x=(b.x+c.x)*n;b.y=(b.y+c.y)*n;f.call(this,u,k/u,r/u,l,g,b,e)})},la=function(a){return function(c){return[M(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",A.prototype.arrowWidth))),d=Math.max(0,Math.min(a, mxUtils.getValue(this.state.style,"arrowSize",A.prototype.arrowSize)));return new mxPoint(c.x+(1-d)*c.width,c.y+(1-b)*c.height/2)},function(c,b){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(c.y+c.height/2-b.y)/c.height*2));this.state.style.arrowSize=Math.max(0,Math.min(a,(c.x+c.width-b.x)/c.width))})]}},ya=function(a,c,b){return function(d){var f=[M(d,["size"],function(b){var d=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style,"size",c)))))*a; return new mxPoint(b.x+d,b.y+d)},function(c,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(c.width,b.x-c.x),Math.min(c.height,b.y-c.y)))/a)})];b&&mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&f.push(ha(d));return f}},ua=function(a,c,b,d,f){b=null!=b?b:1;return function(e){var g=[M(e,["size"],function(c){var b=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,d=parseFloat(mxUtils.getValue(this.state.style,"size",b?f:a));return new mxPoint(c.x+Math.max(0, Math.min(c.width,d*(b?1:c.width))),c.getCenterY())},function(a,c,d){var g=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=g?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));g&&!mxEvent.isAltDown(d.getEvent())&&(a=e.view.graph.snap(a));this.state.style.size=a},null,d)];c&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&g.push(ha(e));return g}},Ea=function(a){return function(c){var b=[M(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style, "size",g.prototype.size))));return new mxPoint(c.x+b*c.width*.75,c.y+c.height/4)},function(c,b){this.state.style.size=Math.max(0,Math.min(a,(b.x-c.x)/(.75*c.width)))},null,!0)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ha(c));return b}},ta=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ha(a));return c}},ha=function(a,c){return M(a,[mxConstants.STYLE_ARCSIZE],function(b){var d=null!=c?c:b.height/8;if("1"==mxUtils.getValue(a.style, mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var f=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,f),b.y+d)}f=Math.max(0,parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(b.x+b.width-Math.min(Math.max(b.width/2,b.height/2),Math.min(b.width,b.height)*f),b.y+d)},function(c,b,d){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)? -this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},M=function(a,c,b,d,f,e){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};g.getPosition=b;g.setPosition=d;g.ignoreGrid=null!=f?f:!0;if(e){var l=g.positionChanged;g.positionChanged= -function(){l.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},za={link:function(a){return[Da(a,!0,10),Da(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(sa(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style, -mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,l,h){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(h.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= -a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(h.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(sa(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/ -5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,l,h){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(h.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= -a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(h.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(sa(a, -["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,l,h){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]= -Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(h.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(h.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(sa(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE], -!1,function(c,b,d,f,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,l,h){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/ -3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(h.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(h.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)- +this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},M=function(a,c,b,d,f,e){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};g.getPosition=b;g.setPosition=d;g.ignoreGrid=null!=f?f:!0;if(e){var k=g.positionChanged;g.positionChanged= +function(){k.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},za={link:function(a){return[Da(a,!0,10),Da(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(sa(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style, +mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,k,n){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,k.x,k.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(n.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= +a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(n.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(sa(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/ +5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,k,n){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,k.x,k.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(n.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= +a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(n.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(sa(a, +["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,k,n){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,k.x,k.y);a.style[mxConstants.STYLE_ENDSIZE]= +Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(n.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(n.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(sa(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE], +!1,function(c,b,d,f,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,k,n){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,k.x,k.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/ +3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(n.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(n.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)- parseFloat(a.style.startWidth))<c&&(a.style.endWidth=a.style.startWidth))})));return b},swimlane:function(a){var c=[M(a,[mxConstants.STYLE_STARTSIZE],function(c){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(c.getCenterX(),c.y+Math.max(0,Math.min(c.height,b))):new mxPoint(c.x+Math.max(0,Math.min(c.width,b)),c.getCenterY())},function(c,b){a.style[mxConstants.STYLE_STARTSIZE]= 1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(c.height,b.y-c.y))):Math.round(Math.max(0,Math.min(c.width,b.x-c.x)))})];if(mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED)){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));c.push(ha(a,b/2))}return c},label:ta(),ext:ta(),rectangle:ta(),triangle:ta(),rhombus:ta(),umlLifeline:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.height, parseFloat(mxUtils.getValue(this.state.style,"size",N.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))},!1)]},umlFrame:function(a){return[M(a,["width","height"],function(a){var c=Math.max(C.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,"width",C.prototype.width))),b=Math.max(1.5*C.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",C.prototype.height))); return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(C.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*C.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},process:function(a){var c=[M(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,"size",n.prototype.size))));return new mxPoint(a.x+a.width*c,a.y+a.height/4)},function(a,c){this.state.style.size=Math.max(0,Math.min(.5, (c.x-a.x)/a.width))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ha(a));return c},cross:function(a){return[M(a,["size"],function(a){var c=Math.min(a.width,a.height),c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",ba.prototype.size)))*c/2;return new mxPoint(a.getCenterX()-c,a.getCenterY()-c)},function(a,c){var b=Math.min(a.width,a.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,a.getCenterY()-c.y)/b*2,Math.max(0,a.getCenterX()-c.x)/b*2)))})]}, -note:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",k.prototype.size)))));return new mxPoint(a.x+a.width-c,a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-c.x),Math.min(a.height,c.y-a.y))))})]},manualInput:function(a){var c=[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",F.prototype.size))); +note:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",h.prototype.size)))));return new mxPoint(a.x+a.width-c,a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-c.x),Math.min(a.height,c.y-a.y))))})]},manualInput:function(a){var c=[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",F.prototype.size))); return new mxPoint(a.x+a.width/4,a.y+3*c/4)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,4*(c.y-a.y)/3)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ha(a));return c},dataStorage:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",P.prototype.size))));return new mxPoint(a.x+(1-c)*a.width,a.getCenterY())},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.x+a.width- c.x)/a.width))})]},callout:function(a){var c=[M(a,["size","position"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",w.prototype.size))),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",w.prototype.position)));mxUtils.getValue(this.state.style,"base",w.prototype.base);return new mxPoint(a.x+b*a.width,a.y+a.height-c)},function(a,c){mxUtils.getValue(this.state.style,"base",w.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(a.height, a.y+a.height-c.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(c.x-a.x)/a.width)))/100}),M(a,["position2"],function(a){var c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",w.prototype.position2)));return new mxPoint(a.x+c*a.width,a.y+a.height)},function(a,c){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(c.x-a.x)/a.width)))/100}),M(a,["base"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",w.prototype.size))), @@ -2543,12 +2544,12 @@ Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",p.proto Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",v.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c*a.height/2)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(c.y-a.y)/a.height*2))})]},offPageConnector:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",U.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-c)*a.height)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+ a.height-c.y)/a.height))})]},step:ua(r.prototype.size,!0,null,!0,r.prototype.fixedSize),hexagon:ua(y.prototype.size,!0,.5,!0),curlyBracket:ua(u.prototype.size,!1),display:ua(ka.prototype.size,!1),cube:ya(1,a.prototype.size,!1),card:ya(.5,q.prototype.size,!0),loopLimit:ya(.5,Z.prototype.size,!0),trapezoid:Ea(.5),parallelogram:Ea(1)};Graph.createHandle=M;Graph.handleFactory=za;mxVertexHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var a= this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_RECTANGLE);a=za[a];if(null!=a)return a(this.state)}return null};mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_CONNECTOR);a=za[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle= -function(){},Graph.handleFactory={};var va=new mxPoint(1,0),wa=new mxPoint(1,0),la=mxUtils.toRadians(-30),va=mxUtils.getRotatedPoint(va,Math.cos(la),Math.sin(la)),la=mxUtils.toRadians(-150),wa=mxUtils.getRotatedPoint(wa,Math.cos(la),Math.sin(la));mxEdgeStyle.IsometricConnector=function(a,c,b,d,f){var e=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,l=g[0],g=g[g.length-1];null!=d&&(d=e.transformControlPoint(a,d));null==l&&null!=c&&(l=new mxPoint(c.getCenterX(),c.getCenterY()));null== -g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var h=va.x,n=va.y,r=wa.x,u=wa.y,t="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=l){a=function(a,c,b){a-=w.x;var d=c-w.y;c=(u*a-r*d)/(h*u-n*r);a=(n*a-h*d)/(n*r-h*u);t?(b&&(w=new mxPoint(w.x+h*c,w.y+n*c),f.push(w)),w=new mxPoint(w.x+r*a,w.y+u*a)):(b&&(w=new mxPoint(w.x+r*a,w.y+u*a),f.push(w)),w=new mxPoint(w.x+h*c,w.y+n*c));f.push(w)};var w=l;null==d&&(d=new mxPoint(l.x+(g.x-l.x)/2,l.y+(g.y-l.y)/2));a(d.x,d.y, +function(){},Graph.handleFactory={};var va=new mxPoint(1,0),wa=new mxPoint(1,0),la=mxUtils.toRadians(-30),va=mxUtils.getRotatedPoint(va,Math.cos(la),Math.sin(la)),la=mxUtils.toRadians(-150),wa=mxUtils.getRotatedPoint(wa,Math.cos(la),Math.sin(la));mxEdgeStyle.IsometricConnector=function(a,c,b,d,f){var e=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,k=g[0],g=g[g.length-1];null!=d&&(d=e.transformControlPoint(a,d));null==k&&null!=c&&(k=new mxPoint(c.getCenterX(),c.getCenterY()));null== +g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var n=va.x,l=va.y,r=wa.x,u=wa.y,t="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=k){a=function(a,c,b){a-=w.x;var d=c-w.y;c=(u*a-r*d)/(n*u-l*r);a=(l*a-n*d)/(l*r-n*u);t?(b&&(w=new mxPoint(w.x+n*c,w.y+l*c),f.push(w)),w=new mxPoint(w.x+r*a,w.y+u*a)):(b&&(w=new mxPoint(w.x+r*a,w.y+u*a),f.push(w)),w=new mxPoint(w.x+n*c,w.y+l*c));f.push(w)};var w=k;null==d&&(d=new mxPoint(k.x+(g.x-k.x)/2,k.y+(g.y-k.y)/2));a(d.x,d.y, !0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Ja=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Ja.apply(this,arguments)};d.prototype.constraints=[];e.prototype.constraints=[];w.prototype.constraints=[];mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5, 0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)]; mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints= -mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;D.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.constraints=mxRectangleShape.prototype.constraints;q.prototype.constraints=mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;p.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;P.prototype.constraints= +mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;D.prototype.constraints=mxRectangleShape.prototype.constraints;h.prototype.constraints=mxRectangleShape.prototype.constraints;q.prototype.constraints=mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;p.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;P.prototype.constraints= mxRectangleShape.prototype.constraints;ma.prototype.constraints=mxEllipse.prototype.constraints;na.prototype.constraints=mxEllipse.prototype.constraints;ca.prototype.constraints=mxEllipse.prototype.constraints;fa.prototype.constraints=mxEllipse.prototype.constraints;F.prototype.constraints=mxRectangleShape.prototype.constraints;ja.prototype.constraints=mxRectangleShape.prototype.constraints;ka.prototype.constraints=mxRectangleShape.prototype.constraints;Z.prototype.constraints=mxRectangleShape.prototype.constraints; U.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1, .7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];E.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1, @@ -2566,12 +2567,12 @@ U.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.protot .5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];A.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];W.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ba.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1, .5),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];N.prototype.constraints=null;da.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];T.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175, .25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()} -Actions.prototype.init=function(){function a(a){b.escape();var d=b.getDeletableCells(b.getSelectionCells());if(null!=d&&0<d.length){var c=b.model.getParents(d);b.removeCells(d,a);if(null!=c){a=[];for(d=0;d<c.length;d++)b.model.contains(c[d])&&(b.model.isVertex(c[d])||b.model.isEdge(c[d]))&&a.push(c[d]);b.setSelectionCells(a)}}}var d=this.editorUi,e=d.editor,b=e.graph,k=function(){return Action.prototype.isEnabled.apply(this,arguments)&&b.isEnabled()};this.addAction("new...",function(){b.openLink(d.getUrl())}); +Actions.prototype.init=function(){function a(a){b.escape();var d=b.getDeletableCells(b.getSelectionCells());if(null!=d&&0<d.length){var c=b.model.getParents(d);b.removeCells(d,a);if(null!=c){a=[];for(d=0;d<c.length;d++)b.model.contains(c[d])&&(b.model.isVertex(c[d])||b.model.isEdge(c[d]))&&a.push(c[d]);b.setSelectionCells(a)}}}var d=this.editorUi,e=d.editor,b=e.graph,h=function(){return Action.prototype.isEnabled.apply(this,arguments)&&b.isEnabled()};this.addAction("new...",function(){b.openLink(d.getUrl())}); this.addAction("open...",function(){window.openNew=!0;window.openKey="open";d.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){d.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var c=mxUtils.parseXml(a);e.graph.setSelectionCells(e.graph.importGraphModel(c.documentElement))}catch(f){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+f.message)}}));d.showDialog((new OpenDialog(this)).container, -320,220,!0,!0,function(){window.openFile=null})}).isEnabled=k;this.addAction("save",function(){d.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=k;this.addAction("saveAs...",function(){d.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=k;this.addAction("export...",function(){d.showDialog((new ExportDialog(d)).container,300,230,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(d);d.showDialog(a.container,620,420,!0,!1);a.init()});this.addAction("pageSetup...", -function(){d.showDialog((new PageSetupDialog(d)).container,320,220,!0,!0)}).isEnabled=k;this.addAction("print...",function(){d.showDialog((new PrintDialog(d)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(b,null,10,10)});this.addAction("undo",function(){d.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){d.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut", +320,220,!0,!0,function(){window.openFile=null})}).isEnabled=h;this.addAction("save",function(){d.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=h;this.addAction("saveAs...",function(){d.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=h;this.addAction("export...",function(){d.showDialog((new ExportDialog(d)).container,300,230,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(d);d.showDialog(a.container,620,420,!0,!1);a.init()});this.addAction("pageSetup...", +function(){d.showDialog((new PageSetupDialog(d)).container,320,220,!0,!0)}).isEnabled=h;this.addAction("print...",function(){d.showDialog((new PrintDialog(d)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(b,null,10,10)});this.addAction("undo",function(){d.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){d.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut", function(){mxClipboard.cut(b)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){mxClipboard.copy(b)},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&mxClipboard.paste(b)},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(a){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){b.getModel().beginUpdate();try{var d=mxClipboard.paste(b);if(null!=d){a=!0;for(var c=0;c<d.length&& -a;c++)a=a&&b.model.isEdge(d[c]);var f=b.view.translate,e=b.view.scale,u=f.x,t=f.y,f=null;if(1==d.length&&a){var h=b.getCellGeometry(d[0]);null!=h&&(f=h.getTerminalPoint(!0))}f=null!=f?f:b.getBoundingBoxFromGeometry(d,a);if(null!=f){var n=Math.round(b.snap(b.popupMenuHandler.triggerX/e-u)),l=Math.round(b.snap(b.popupMenuHandler.triggerY/e-t));b.cellsMoved(d,n-f.x,l-f.y)}}}finally{b.getModel().endUpdate()}}});this.addAction("copySize",function(a){a=b.getSelectionCell();b.isEnabled()&&null!=a&&b.getModel().isVertex(a)&& +a;c++)a=a&&b.model.isEdge(d[c]);var f=b.view.translate,e=b.view.scale,u=f.x,t=f.y,f=null;if(1==d.length&&a){var l=b.getCellGeometry(d[0]);null!=l&&(f=l.getTerminalPoint(!0))}f=null!=f?f:b.getBoundingBoxFromGeometry(d,a);if(null!=f){var n=Math.round(b.snap(b.popupMenuHandler.triggerX/e-u)),k=Math.round(b.snap(b.popupMenuHandler.triggerY/e-t));b.cellsMoved(d,n-f.x,k-f.y)}}}finally{b.getModel().endUpdate()}}});this.addAction("copySize",function(a){a=b.getSelectionCell();b.isEnabled()&&null!=a&&b.getModel().isVertex(a)&& (a=b.getCellGeometry(a),null!=a&&(d.copiedSize=new mxRectangle(a.x,a.y,a.width,a.height)))},null,null,"Alt+Shit+X");this.addAction("pasteSize",function(a){if(b.isEnabled()&&!b.isSelectionEmpty()&&null!=d.copiedSize){b.getModel().beginUpdate();try{var e=b.getSelectionCells();for(a=0;a<e.length;a++)if(b.getModel().isVertex(e[a])){var c=b.getCellGeometry(e[a]);null!=c&&(c=c.clone(),c.width=d.copiedSize.width,c.height=d.copiedSize.height,b.getModel().setGeometry(e[a],c))}}finally{b.getModel().endUpdate()}}}, null,null,"Alt+Shit+V");this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");this.addAction("deleteAll",function(){a(!0)},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){b.setSelectionCells(b.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){b.turnShapes(b.getSelectionCells())},null,null,Editor.ctrlKey+"+R"));this.addAction("selectVertices", function(){b.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){b.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){b.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){b.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!b.isSelectionEmpty()){b.getModel().beginUpdate();try{var a=b.isCellMovable(b.getSelectionCell())?1:0;b.toggleCellStyles(mxConstants.STYLE_MOVABLE, @@ -2581,8 +2582,8 @@ null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){b.fo d.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=d.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var b=a.getSelectionCell(),c="";if(mxUtils.isNode(b.value)){var f=b.value.getAttribute("tooltip");null!=f&&(c=f)}c=new TextareaDialog(d,mxResources.get("editTooltip")+":",c,function(c){a.setTooltipForCell(b,c)});d.showDialog(c.container,320,200,!0,!0);c.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=b.getLinkForCell(b.getSelectionCell()); null!=a&&b.openLink(a)});this.addAction("editLink...",function(){var a=d.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var b=a.getSelectionCell(),c=a.getLinkForCell(b)||"";d.showLinkDialog(c,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(b,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.addAction("insertLink...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&d.showLinkDialog("",mxResources.get("insert"),function(a,d){a=mxUtils.trim(a);if(0<a.length){var c= null,f=b.getLinkTitle(a);null!=d&&0<d.length&&(c=d[0].iconUrl,f=d[0].name||d[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));var e=b.getFreeInsertPoint(),c=new mxCell(f,new mxGeometry(e.x,e.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:"spacing=10;"));c.vertex=!0;b.setLinkForCell(c,a);b.cellSizeUpdated(c,!0);b.getModel().beginUpdate();try{c=b.addCell(c), -b.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{b.getModel().endUpdate()}b.setSelectionCell(c);b.scrollCellToVisible(b.getSelectionCell())}})}).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=d.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var b=a.getSelectedElement(),c=a.getParentByName(b,"A",a.cellEditor.textarea),f="";if(null==c&&null!=b&&null!=b.getElementsByTagName)for(var e=b.getElementsByTagName("a"),u=0;u<e.length&&null==c;u++)e[u].textContent== -b.textContent&&(a.selectNode(e[u]),c=e[u]);null!=c&&"A"==c.nodeName&&(f=c.getAttribute("href")||"");var t=a.cellEditor.saveSelection();d.showLinkDialog(f,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(t);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=b.getSelectionCells();if(null!=a){b.getModel().beginUpdate();try{for(var d=0;d<a.length;d++){var c= +b.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{b.getModel().endUpdate()}b.setSelectionCell(c);b.scrollCellToVisible(b.getSelectionCell())}})}).isEnabled=h;this.addAction("link...",mxUtils.bind(this,function(){var a=d.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var b=a.getSelectedElement(),c=a.getParentByName(b,"A",a.cellEditor.textarea),f="";if(null==c&&null!=b&&null!=b.getElementsByTagName)for(var e=b.getElementsByTagName("a"),u=0;u<e.length&&null==c;u++)e[u].textContent== +b.textContent&&(a.selectNode(e[u]),c=e[u]);null!=c&&"A"==c.nodeName&&(f=c.getAttribute("href")||"");var t=a.cellEditor.saveSelection();d.showLinkDialog(f,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(t);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=h;this.addAction("autosize",function(){var a=b.getSelectionCells();if(null!=a){b.getModel().beginUpdate();try{for(var d=0;d<a.length;d++){var c= a[d];if(b.getModel().getChildCount(c))b.updateGroupBounds([c],20);else{var f=b.view.getState(c),e=b.getCellGeometry(c);b.getModel().isVertex(c)&&null!=f&&null!=f.text&&null!=e&&b.isWrapping(c)?(e=e.clone(),e.height=f.text.boundingBox.height/b.view.scale,b.getModel().setGeometry(c,e)):b.updateCellSize(c)}}}finally{b.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=b.getView().getState(b.getSelectionCell());if(null!=a){var e="1";b.stopEditing(); b.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,c=b.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var f=document.createElement("div");f.innerHTML=c;c=mxUtils.extractTextWithWhitespace(f.childNodes);b.cellLabelChanged(a.cell,c)}else c=mxUtils.htmlEntities(b.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>")),b.cellLabelChanged(a.cell,b.sanitizeHtml(c)); b.setCellStyles("html",e);d.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=b.getView().getState(b.getSelectionCell()),d="wrap";b.stopEditing();null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(d=null);b.setCellStyles(mxConstants.STYLE_WHITE_SPACE,d)});this.addAction("rotation",function(){var a="0",e=b.getView().getState(b.getSelectionCell()); @@ -2593,9 +2594,9 @@ a.y*b.view.scale-1,b.container.scrollLeft=Math.min(a.x*b.view.scale,(b.container b.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*b.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi, parseInt(100*b.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&d.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var m=null,m=this.addAction("grid",function(){b.setGridEnabled(!b.isGridEnabled());d.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");m.setToggleAction(!0);m.setSelectedCallback(function(){return b.isGridEnabled()});m.setEnabled(!1); m=this.addAction("guides",function(){b.graphHandler.guidesEnabled=!b.graphHandler.guidesEnabled;d.fireEvent(new mxEventObject("guidesEnabledChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.graphHandler.guidesEnabled});m.setEnabled(!1);m=this.addAction("tooltips",function(){b.tooltipHandler.setEnabled(!b.tooltipHandler.isEnabled())});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.tooltipHandler.isEnabled()});m=this.addAction("collapseExpand",function(){var a= -new ChangePageSetup(d);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!b.foldingEnabled;b.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.foldingEnabled});m.isEnabled=k;m=this.addAction("scrollbars",function(){d.setScrollbars(!d.hasScrollbars())});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){d.setPageVisible(!b.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return b.pageVisible}); +new ChangePageSetup(d);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!b.foldingEnabled;b.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.foldingEnabled});m.isEnabled=h;m=this.addAction("scrollbars",function(){d.setScrollbars(!d.hasScrollbars())});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){d.setPageVisible(!b.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return b.pageVisible}); m=this.addAction("connectionArrows",function(){b.connectionArrowsEnabled=!b.connectionArrowsEnabled;d.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");m.setToggleAction(!0);m.setSelectedCallback(function(){return b.connectionArrowsEnabled});m=this.addAction("connectionPoints",function(){b.setConnectable(!b.connectionHandler.isEnabled());d.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(function(){return b.connectionHandler.isEnabled()}); -m=this.addAction("copyConnect",function(){b.connectionHandler.setCreateTarget(!b.connectionHandler.isCreateTarget());d.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.connectionHandler.isCreateTarget()});m.isEnabled=k;m=this.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.editor.autosave});m.isEnabled=k;m.visible=!1;this.addAction("help",function(){var a= +m=this.addAction("copyConnect",function(){b.connectionHandler.setCreateTarget(!b.connectionHandler.isCreateTarget());d.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.connectionHandler.isCreateTarget()});m.isEnabled=h;m=this.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.editor.autosave});m.isEnabled=h;m.visible=!1;this.addAction("help",function(){var a= "";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);b.openLink(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(d.showDialog((new AboutDialog(d)).container,320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));m=mxUtils.bind(this,function(a,d,c,f){return this.addAction(a,function(){if(null!=c&&b.cellEditor.isContentEditing())c();else{b.stopEditing(!1);b.getModel().beginUpdate();try{b.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE, d),(d&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?b.updateLabelElements(b.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&b.replaceElement(a)}):(d&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?b.updateLabelElements(b.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&b.replaceElement(a)}):(d&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.updateLabelElements(b.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&& b.replaceElement(a)})}finally{b.getModel().endUpdate()}}},null,null,f)});m("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");m("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");m("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){d.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")}); @@ -2611,13 +2612,13 @@ mxUtils.bind(this,function(){var a=b.getSelectionCells();if(null!=a&&0<a.length) b.getCellGeometry(a);g=Math.round(b.snap(b.popupMenuHandler.triggerX/f-g));f=Math.round(b.snap(b.popupMenuHandler.triggerY/f-c));d.addPointAt(d.state,g,f)}}});this.addAction("removeWaypoint",function(){var a=d.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=b.getSelectionCells();if(null!=a){a=b.addAllEdges(a);b.getModel().beginUpdate();try{for(var d=0;d<a.length;d++){var c=a[d];if(b.getModel().isEdge(c)){var f= b.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,b.getModel().setGeometry(c,f))}}}finally{b.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this,function(){b.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){b.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...", function(){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=b.getView().getState(b.getSelectionCell()),c="";null!=e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=b.cellEditor.saveSelection();d.showImageDialog(a,c,function(a,c,d){if(b.cellEditor.isContentEditing())b.cellEditor.restoreSelection(f),b.insertImage(a,c,d);else{var e=b.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;b.getModel().beginUpdate(); -try{if(0==e.length){var l=b.getFreeInsertPoint(),g=e=[b.insertVertex(b.getDefaultParent(),null,"",l.x,l.y,c,d,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];b.fireEvent(new mxEventObject("cellsInserted","cells",g))}b.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var u=b.view.getState(e[0]),r=null!=u?u.style:b.getCellStyle(e[0]);"image"!=r[mxConstants.STYLE_SHAPE]&&"label"!=r[mxConstants.STYLE_SHAPE]?b.setCellStyles(mxConstants.STYLE_SHAPE,"image", -e):0==a.length&&b.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==b.getSelectionCount()&&null!=c&&null!=d){var t=e[0],k=b.getModel().getGeometry(t);null!=k&&(k=k.clone(),k.width=c,k.height=d,b.getModel().setGeometry(t,k))}}finally{b.getModel().endUpdate()}null!=g&&(b.setSelectionCells(g),b.scrollCellToVisible(g[0]))}}},b.cellEditor.isContentEditing(),!b.cellEditor.isContentEditing())}}).isEnabled=k;this.addAction("insertImage...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&& -(b.clearSelection(),d.actions.get("image").funct())}).isEnabled=k;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(d,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){d.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("layers"))): +try{if(0==e.length){var k=b.getFreeInsertPoint(),g=e=[b.insertVertex(b.getDefaultParent(),null,"",k.x,k.y,c,d,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];b.fireEvent(new mxEventObject("cellsInserted","cells",g))}b.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var u=b.view.getState(e[0]),r=null!=u?u.style:b.getCellStyle(e[0]);"image"!=r[mxConstants.STYLE_SHAPE]&&"label"!=r[mxConstants.STYLE_SHAPE]?b.setCellStyles(mxConstants.STYLE_SHAPE,"image", +e):0==a.length&&b.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==b.getSelectionCount()&&null!=c&&null!=d){var t=e[0],h=b.getModel().getGeometry(t);null!=h&&(h=h.clone(),h.width=c,h.height=d,b.getModel().setGeometry(t,h))}}finally{b.getModel().endUpdate()}null!=g&&(b.setSelectionCells(g),b.scrollCellToVisible(g[0]))}}},b.cellEditor.isContentEditing(),!b.cellEditor.isContentEditing())}}).isEnabled=h;this.addAction("insertImage...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&& +(b.clearSelection(),d.actions.get("image").funct())}).isEnabled=h;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(d,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){d.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("layers"))): this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));m=this.addAction("formatPanel",mxUtils.bind(this,function(){d.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return 0<d.formatWidth}));m=this.addAction("outline", mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(d,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){d.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null, -null,Editor.ctrlKey+"+Shift+O");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,d,e,b,k){var m;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),m=mxResources.get(a)+"..."):m=mxResources.get(a);return this.put(a,new Action(m,d,e,b,k))};Actions.prototype.put=function(a,d){return this.actions[a]=d};Actions.prototype.get=function(a){return this.actions[a]}; -function Action(a,d,e,b,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(d);this.enabled=null!=e?e:!0;this.iconCls=b;this.shortcut=k;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled}; +null,Editor.ctrlKey+"+Shift+O");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,d,e,b,h){var m;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),m=mxResources.get(a)+"..."):m=mxResources.get(a);return this.put(a,new Action(m,d,e,b,h))};Actions.prototype.put=function(a,d){return this.actions[a]=d};Actions.prototype.get=function(a){return this.actions[a]}; +function Action(a,d,e,b,h){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(d);this.enabled=null!=e?e:!0;this.iconCls=b;this.shortcut=h;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled}; Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(a,d){mxEventSource.call(this);this.ui=a;this.data=d||""};mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))}; DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,d,e,b){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};DrawioFile.prototype.saveAs=function(a,d,e){};DrawioFile.prototype.saveFile=function(a,d,e,b){};DrawioFile.prototype.getPublicUrl=function(a){a(null)}; DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,d,e){};DrawioFile.prototype.isMovable=function(){return!1}; @@ -2631,8 +2632,8 @@ DrawioFile.prototype.autosave=function(a,d,e,b){null==this.lastAutosave&&(this.l mxUtils.bind(this,function(a){null!=b&&b(a)}))}else null!=e&&e(null)}),a)};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 a=(new Date).getTime();return null==this.lastAutosaveRevision||a-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay}; DrawioFile.prototype.close=function(a){this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,d){if(null!=a&&null!=d){var e=a.lastIndexOf("."),b=0<e?a.substring(e):"",e=d.lastIndexOf(".");return b===(0<e?d.substring(e):"")}return a==d}; DrawioFile.prototype.destroy=function(){this.clearAutosave();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)};LocalFile=function(a,d,e,b){DrawioFile.call(this,a,d);this.title=e;this.mode=b?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,d,e){this.saveAs(this.title,d,e)};LocalFile.prototype.saveAs=function(a,d,e){this.saveFile(a,!1,d,e)}; -LocalFile.prototype.saveFile=function(a,d,e,b){this.title=a;this.updateFileData();d=this.getData();var k=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),m=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,k?"image/png":"text/xml",k);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+ -(k?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});k?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a)}),b,this.ui.getCurrentFile()!=this?this.getData():null):m(d)};LocalFile.prototype.rename=function(a,d,e){this.title=a;this.descriptorChanged();null!=d&&d()}; +LocalFile.prototype.saveFile=function(a,d,e,b){this.title=a;this.updateFileData();d=this.getData();var h=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),m=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,h?"image/png":"text/xml",h);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+ +(h?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});h?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a)}),b,this.ui.getCurrentFile()!=this?this.getData():null):m(d)};LocalFile.prototype.rename=function(a,d,e){this.title=a;this.descriptorChanged();null!=d&&d()}; LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,d){this.setModified(!0);this.addUnsavedStatus()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener)};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC": IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=": IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==": @@ -2656,7 +2657,7 @@ function(){b.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&null!= {jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],"HTML-CSS":{imageFont:null},TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}});MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};Editor.MathJaxRender=function(a){"undefined"!== typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var b=Editor.prototype.init;Editor.prototype.init=function(){b.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,c){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var d=document.getElementsByTagName("script");if(null!=d&&0<d.length){var f=document.createElement("script"); f.type="text/javascript";f.src=a;d[0].parentNode.appendChild(f)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;var c=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,function(a,b,d,f){void 0!== -b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.replace(/\\"/g,'"')):void 0!==f&&c.push(f);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var k=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){k.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var m=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){m.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&& +b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.replace(/\\"/g,'"')):void 0!==f&&c.push(f);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var h=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){h.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var m=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){m.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&& (EditDataDialog.getDisplayIdForCell=function(a,c){var b=null;null!=a.editor.graph.getModel().getParent(c)?b=c.getId():null!=a.currentPage&&(b=a.currentPage.getId());return b});if(null!=window.StyleFormatPanel){var p=Format.prototype.init;Format.prototype.init=function(){p.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless? q.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile();return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var v=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=v.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,d=this.createOption(mxResources.get("shadow"), function(){return b.shadowVisible},function(a){var d=new ChangePageSetup(c);d.ignoreColor=!0;d.ignoreImage=!0;d.shadowVisible=a;b.model.execute(d)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});Editor.shadowOptionEnabled||(d.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(d,60));a.appendChild(d)}return a};var c=DiagramFormatPanel.prototype.addOptions; @@ -2670,18 +2671,18 @@ mxUtils.button("",function(c){d.getModel().beginUpdate();try{var b=d.getSelectio "#000000"),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,null));d.getModel().setStyle(b[c],f)}}finally{d.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";null!=a?(null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?c.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":c.style.backgroundImage="linear-gradient("+ a.fill+" 0px,"+a.gradient+" 100%)":c.style.backgroundColor=a.fill,c.style.border="1px solid "+a.stroke):(c.style.backgroundColor="#ffffff",c.style.border="1px solid #000000");f.appendChild(c)}f.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(f),c(a[b])}function b(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var d=this.editorUi.editor.graph,f=document.createElement("div");f.style.whiteSpace= "nowrap";f.style.paddingLeft="24px";f.style.paddingRight="20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(f);var e="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var g=document.createElement("div");g.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);"; -mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var l=document.createElement("div");l.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);"; -1<this.defaultColorSchemes.length&&(a.appendChild(g),a.appendChild(l));mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(g);b(l);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&& +mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var k=document.createElement("div");k.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);"; +1<this.defaultColorSchemes.length&&(a.appendChild(g),a.appendChild(k));mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(g);b(k);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&& (b=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var d=this.editorUi.editor.graph,f=d.view.getState(d.getSelectionCell());1==d.getSelectionCount()&&null!=f&&null!=f.shape&&null!=f.shape.stencil?(c=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this, function(a){this.editorUi.actions.get("editShape").funct()})),c.setAttribute("title",mxResources.get("editShape")),c.style.marginBottom="2px",null==b?c.style.width="202px":(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c)):c.image&&(c=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),c.setAttribute("title",mxResources.get("editImage")),c.style.marginBottom="2px",null==b?c.style.width="202px": (b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c));return a}}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.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize= "3";Graph.prototype.edgeMode="move"!=urlParams.edge;var u=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}u.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint; this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(this,arguments)};var d=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var c=this.graph.view.getState(a),c=null!=c?c.style:this.graph.getCellStyle(a);if("undefined"!=typeof mxRackContainer&&"rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,c){c.height=Math.max(c.height,20);if(1<c.height/20){var b=c.height%20;c.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a, c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.resizeParent=!1;return b}return d.apply(this,arguments)}};var t=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){t.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"==a.substring(0,17)&&(a=JSON.parse(a.substring(17)),null!=a.actions)){for(var c= -0;c<a.actions.length;c++)null!=a.actions[c].open&&(this.isCustomLink(a.actions[c].open)?this.customLinkClicked(a.actions[c].open):this.openLink(a.actions[c].open));this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)this.handleLinkAction(a.actions[c])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var c=[];null!=a.select&&this.isEnabled()&&(c=this.getCellsForAction(a.select),this.setSelectionCells(c));null!=a.scroll&&(c=this.getCellsForAction(a.scroll));null!= -a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.highlight&&(c=this.getCellsForAction(a.highlight),this.highlightCells(c,a.highlight.color,a.highlight.duration,a.highlight.opacity));0<c.length&&this.scrollCellToVisible(c[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))}; +0;c<a.actions.length;c++)null!=a.actions[c].open&&(this.isCustomLink(a.actions[c].open)?this.customLinkClicked(a.actions[c].open):this.openLink(a.actions[c].open));this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)this.handleLinkAction(a.actions[c])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var c=[];null!=a.select&&this.isEnabled()&&(c=this.getCellsForAction(a.select),this.setSelectionCells(c));null!=a.highlight&&(c=this.getCellsForAction(a.highlight), +this.highlightCells(c,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.scroll&&(c=this.getCellsForAction(a.scroll));0<c.length&&this.scrollCellToVisible(c[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))}; Graph.prototype.getCellsById=function(a){var c=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var d=this.getDefaultParent(),c=c.concat(this.model.filterDescendants(function(a){return a!=d},d));else{var f=this.model.getCell(a[b]);null!=f&&c.push(f)}return c};Graph.prototype.getCellsForTags=function(a,c,b){var d=[];if(null!=a){c=null!=c?c:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var f=0;f<c.length;f++)if(this.model.isVertex(c[f])||this.model.isEdge(c[f])){var e= -null!=c[f].value&&"object"==typeof c[f].value?mxUtils.trim(c[f].value.getAttribute(b)||""):"",g=!0;if(0<e.length)for(var e=e.toLowerCase().split(" "),l=0;l<a.length&&g;l++)var h=mxUtils.trim(a[l]).toLowerCase(),g=g&&(0==h.length||0<=mxUtils.indexOf(e,h));else g=0==a.length;g&&d.push(c[f])}}return d};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],!this.model.isVisible(a[c]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible= +null!=c[f].value&&"object"==typeof c[f].value?mxUtils.trim(c[f].value.getAttribute(b)||""):"",g=!0;if(0<e.length)for(var e=e.toLowerCase().split(" "),k=0;k<a.length&&g;k++)var n=mxUtils.trim(a[k]).toLowerCase(),g=g&&(0==n.length||0<=mxUtils.indexOf(e,n));else g=0==a.length;g&&d.push(c[f])}}return d};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],!this.model.isVisible(a[c]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible= function(a,c){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],c)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,c,b,d){for(var f=0;f<a.length;f++)this.highlightCell(a[f],c,b,d)};Graph.prototype.highlightCell=function(a,c,b,d){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var f=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),e=new mxCellHighlight(this,c,f,!1);null!= d&&(e.opacity=d);e.highlight(a);window.setTimeout(function(){null!=e.shape&&(mxUtils.setPrefixedStyle(e.shape.node.style,"transition","all 1200ms ease-in-out"),e.shape.node.style.opacity=0);window.setTimeout(function(){e.destroy()},1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;var d=a.ownerDocument,f=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"filter"):d.createElement("filter");f.setAttribute("id",this.shadowId);var e=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG, "feGaussianBlur"):d.createElement("feGaussianBlur");e.setAttribute("in","SourceAlpha");e.setAttribute("stdDeviation",this.svgShadowBlur);e.setAttribute("result","blur");f.appendChild(e);e=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feOffset"):d.createElement("feOffset");e.setAttribute("in","blur");e.setAttribute("dx",this.svgShadowSize);e.setAttribute("dy",this.svgShadowSize);e.setAttribute("result","offsetBlur");f.appendChild(e);e=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG, @@ -2695,47 +2696,47 @@ c,b=0;do c=this.model.getChildAt(this.model.root,b);while(b++<a&&"1"==mxUtils.ge [SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl= [SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js", STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c= -null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var h=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,d,f,e,g,n,u,t){if(null!=b&&null==mxMarker.markers[b]){var l=this.getPackageForType(b);null!=l&&mxStencilRegistry.getStencil(l)}return h.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){w.value=Math.max(1,Math.min(h,Math.max(parseInt(w.value),parseInt(k.value))));k.value=Math.max(1,Math.min(h, -Math.min(parseInt(w.value),parseInt(k.value))))}function d(c){function b(c,b,f){var e=c.getGraphBounds(),g=0,h=0,l=da.get(),n=1/c.pageScale,u=v.checked;if(u)var n=parseInt(W.value),t=parseInt(P.value),n=Math.min(l.height*t/(e.height/c.view.scale),l.width*n/(e.width/c.view.scale));else n=parseInt(q.value)/(100*c.pageScale),isNaN(n)&&(d=1/c.pageScale,q.value="100 %");l=mxRectangle.fromRectangle(l);l.width=Math.ceil(l.width*d);l.height=Math.ceil(l.height*d);n*=d;!u&&c.pageVisible?(e=c.getPageLayout(), -g-=e.x*l.width,h-=e.y*l.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(c,n,l,0,g,h,u);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var r=b.writeHead;b.writeHead=function(c){r.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var k=b.renderPage;b.renderPage=function(a,c,b,d,f,e){var g=k.apply(this,arguments);this.graph.mathEnabled? -this.mathEnabled=!0:g.className="geDisableMathJax";return g}}b.open(null,null,f,!0)}else{l=c.background;if(null==l||""==l||l==mxConstants.NONE)l="#ffffff";b.backgroundColor=l;b.autoOrigin=u;b.appendGraph(c,n,g,h,f,!0)}return b}var d=parseInt(T.value)/100;isNaN(d)&&(d=1,T.value="100 %");var d=.75*d,e=k.value,g=w.value,h=!u.checked,n=null;h&&(h=e==l&&g==l);if(!h&&null!=a.pages&&a.pages.length){var t=0,h=a.pages.length-1;u.checked||(t=parseInt(e)-1,h=parseInt(g)-1);for(var r=t;r<=h;r++){var m=a.pages[r], +null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var l=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,d,f,e,g,n,u,t){if(null!=b&&null==mxMarker.markers[b]){var k=this.getPackageForType(b);null!=k&&mxStencilRegistry.getStencil(k)}return l.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){w.value=Math.max(1,Math.min(n,Math.max(parseInt(w.value),parseInt(h.value))));h.value=Math.max(1,Math.min(n, +Math.min(parseInt(w.value),parseInt(h.value))))}function d(c){function b(c,b,f){var e=c.getGraphBounds(),g=0,n=0,k=da.get(),l=1/c.pageScale,u=v.checked;if(u)var l=parseInt(W.value),t=parseInt(P.value),l=Math.min(k.height*t/(e.height/c.view.scale),k.width*l/(e.width/c.view.scale));else l=parseInt(q.value)/(100*c.pageScale),isNaN(l)&&(d=1/c.pageScale,q.value="100 %");k=mxRectangle.fromRectangle(k);k.width=Math.ceil(k.width*d);k.height=Math.ceil(k.height*d);l*=d;!u&&c.pageVisible?(e=c.getPageLayout(), +g-=e.x*k.width,n-=e.y*k.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(c,l,k,0,g,n,u);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var r=b.writeHead;b.writeHead=function(c){r.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var h=b.renderPage;b.renderPage=function(a,c,b,d,f,e){var g=h.apply(this,arguments);this.graph.mathEnabled? +this.mathEnabled=!0:g.className="geDisableMathJax";return g}}b.open(null,null,f,!0)}else{k=c.background;if(null==k||""==k||k==mxConstants.NONE)k="#ffffff";b.backgroundColor=k;b.autoOrigin=u;b.appendGraph(c,l,g,n,f,!0)}return b}var d=parseInt(T.value)/100;isNaN(d)&&(d=1,T.value="100 %");var d=.75*d,e=h.value,g=w.value,n=!u.checked,l=null;n&&(n=e==k&&g==k);if(!n&&null!=a.pages&&a.pages.length){var t=0,n=a.pages.length-1;u.checked||(t=parseInt(e)-1,n=parseInt(g)-1);for(var r=t;r<=n;r++){var m=a.pages[r], e=m==a.currentPage?f:null;if(null==e){var e=a.createTemporaryGraph(f.getStylesheet()),g=!0,t=!1,p=null,y=null;null==m.viewState&&null==m.mapping&&null==m.root&&a.updatePageRoot(m);null!=m.viewState?(g=m.viewState.pageVisible,t=m.viewState.mathEnabled,p=m.viewState.background,y=m.viewState.backgroundImage):null!=m.mapping&&null!=m.mapping.diagramMap&&(t="0"!=m.mapping.diagramMap.get("mathEnabled"),p=m.mapping.diagramMap.get("background"),y=m.mapping.diagramMap.get("backgroundImage"),y=null!=y&&0<y.length? -JSON.parse(y):null);e.background=p;e.backgroundImage=null!=y?new mxImage(y.src,y.width,y.height):null;e.pageVisible=g;e.mathEnabled=t;var B=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?r+1:B.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(m);e.model.setRoot(m.root)}n=b(e,n,r!=h);e!=f&&e.container.parentNode.removeChild(e.container)}}else n=b(f);n.mathEnabled&&(h=n.wnd.document,h.writeln('<script type="text/x-mathjax-config">'), -h.writeln("MathJax.Hub.Config({"),h.writeln('messageStyle: "none",'),h.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),h.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),h.writeln('"HTML-CSS": {'),h.writeln("imageFont: null"),h.writeln("},"),h.writeln("TeX: {"),h.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),h.writeln("},"),h.writeln("tex2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("},"), -h.writeln("asciimath2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("}"),h.writeln("});"),c&&(h.writeln("MathJax.Hub.Queue(function () {"),h.writeln("window.print();"),h.writeln("});")),h.writeln("\x3c/script>"),h.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>'));n.closeDocument();!n.mathEnabled&&c&&PrintDialog.printPreview(n)}var f=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");g.style.width="100%"; -g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var h=1,l=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");n.appendChild(u);g=document.createElement("span");mxUtils.write(g, -mxResources.get("printAllPages"));n.appendChild(g);mxUtils.br(n);var t=u.cloneNode(!0);u.setAttribute("checked","checked");t.setAttribute("value","range");n.appendChild(t);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");n.appendChild(g);var k=document.createElement("input");k.style.cssText="margin:0 8px 0 8px;";k.setAttribute("value","1");k.setAttribute("type","number");k.setAttribute("min","1");k.style.width="50px";n.appendChild(k);g=document.createElement("span"); -mxUtils.write(g,mxResources.get("to"));n.appendChild(g);var w=k.cloneNode(!0);n.appendChild(w);mxEvent.addListener(k,"focus",function(){t.checked=!0});mxEvent.addListener(w,"focus",function(){t.checked=!0});mxEvent.addListener(k,"change",b);mxEvent.addListener(w,"change",b);if(null!=a.pages&&(h=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){l=g+1;k.value=l;w.value=l;break}k.setAttribute("max",h);w.setAttribute("max",h);1<h&&e.appendChild(n);var m=document.createElement("div"); +JSON.parse(y):null);e.background=p;e.backgroundImage=null!=y?new mxImage(y.src,y.width,y.height):null;e.pageVisible=g;e.mathEnabled=t;var B=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?r+1:B.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(m);e.model.setRoot(m.root)}l=b(e,l,r!=n);e!=f&&e.container.parentNode.removeChild(e.container)}}else l=b(f);l.mathEnabled&&(n=l.wnd.document,n.writeln('<script type="text/x-mathjax-config">'), +n.writeln("MathJax.Hub.Config({"),n.writeln('messageStyle: "none",'),n.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),n.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),n.writeln('"HTML-CSS": {'),n.writeln("imageFont: null"),n.writeln("},"),n.writeln("TeX: {"),n.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),n.writeln("},"),n.writeln("tex2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("},"), +n.writeln("asciimath2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("}"),n.writeln("});"),c&&(n.writeln("MathJax.Hub.Queue(function () {"),n.writeln("window.print();"),n.writeln("});")),n.writeln("\x3c/script>"),n.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>'));l.closeDocument();!l.mathEnabled&&c&&PrintDialog.printPreview(l)}var f=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");g.style.width="100%"; +g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var n=1,k=1,l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");l.appendChild(u);g=document.createElement("span");mxUtils.write(g, +mxResources.get("printAllPages"));l.appendChild(g);mxUtils.br(l);var t=u.cloneNode(!0);u.setAttribute("checked","checked");t.setAttribute("value","range");l.appendChild(t);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");l.appendChild(g);var h=document.createElement("input");h.style.cssText="margin:0 8px 0 8px;";h.setAttribute("value","1");h.setAttribute("type","number");h.setAttribute("min","1");h.style.width="50px";l.appendChild(h);g=document.createElement("span"); +mxUtils.write(g,mxResources.get("to"));l.appendChild(g);var w=h.cloneNode(!0);l.appendChild(w);mxEvent.addListener(h,"focus",function(){t.checked=!0});mxEvent.addListener(w,"focus",function(){t.checked=!0});mxEvent.addListener(h,"change",b);mxEvent.addListener(w,"change",b);if(null!=a.pages&&(n=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){k=g+1;h.value=k;w.value=k;break}h.setAttribute("max",n);w.setAttribute("max",n);1<n&&e.appendChild(l);var m=document.createElement("div"); m.style.marginBottom="10px";var p=document.createElement("input");p.style.marginRight="8px";p.setAttribute("value","adjust");p.setAttribute("type","radio");p.setAttribute("name","printZoom");m.appendChild(p);g=document.createElement("span");mxUtils.write(g,mxResources.get("adjustTo"));m.appendChild(g);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","100 %");q.style.width="50px";m.appendChild(q);mxEvent.addListener(q,"focus",function(){p.checked=!0}); -e.appendChild(m);var n=n.cloneNode(!1),v=p.cloneNode(!0);v.setAttribute("value","fit");p.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(v);n.appendChild(g);m=document.createElement("table");m.style.display="inline-block";var Q=document.createElement("tbody"),S=document.createElement("tr"),K=S.cloneNode(!0),F=document.createElement("td"),V=F.cloneNode(!0),L=F.cloneNode(!0),O=F.cloneNode(!0), +e.appendChild(m);var l=l.cloneNode(!1),v=p.cloneNode(!0);v.setAttribute("value","fit");p.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(v);l.appendChild(g);m=document.createElement("table");m.style.display="inline-block";var Q=document.createElement("tbody"),S=document.createElement("tr"),K=S.cloneNode(!0),F=document.createElement("td"),V=F.cloneNode(!0),L=F.cloneNode(!0),O=F.cloneNode(!0), X=F.cloneNode(!0),A=F.cloneNode(!0);F.style.textAlign="right";O.style.textAlign="right";mxUtils.write(F,mxResources.get("fitTo"));var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","1");W.setAttribute("min","1");W.setAttribute("type","number");W.style.width="40px";V.appendChild(W);g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsAcross"));L.appendChild(g);mxUtils.write(O,mxResources.get("fitToBy"));var P=W.cloneNode(!0);X.appendChild(P); -mxEvent.addListener(W,"focus",function(){v.checked=!0});mxEvent.addListener(P,"focus",function(){v.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));A.appendChild(g);S.appendChild(F);S.appendChild(V);S.appendChild(L);K.appendChild(O);K.appendChild(X);K.appendChild(A);Q.appendChild(S);Q.appendChild(K);m.appendChild(Q);n.appendChild(m);e.appendChild(n);n=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom= -"12px";mxUtils.write(g,mxResources.get("paperSize"));n.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var da=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));n.appendChild(g);var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value","100 %");T.style.width="60px";n.appendChild(T); -e.appendChild(n);g=document.createElement("div");g.style.cssText="text-align:right;margin:62px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&g.appendChild(n);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",g.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog(); -d(!1)}),m.className="geBtn",g.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});m.className="geBtn gePrimaryBtn";g.appendChild(m);a.editor.cancelFirst||g.appendChild(n);e.appendChild(g);this.container=e};var n=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background= +mxEvent.addListener(W,"focus",function(){v.checked=!0});mxEvent.addListener(P,"focus",function(){v.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));A.appendChild(g);S.appendChild(F);S.appendChild(V);S.appendChild(L);K.appendChild(O);K.appendChild(X);K.appendChild(A);Q.appendChild(S);Q.appendChild(K);m.appendChild(Q);l.appendChild(m);e.appendChild(l);l=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom= +"12px";mxUtils.write(g,mxResources.get("paperSize"));l.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var da=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);l.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));l.appendChild(g);var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value","100 %");T.style.width="60px";l.appendChild(T); +e.appendChild(l);g=document.createElement("div");g.style.cssText="text-align:right;margin:62px 0 0 0;";l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst&&g.appendChild(l);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",g.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog(); +d(!1)}),m.className="geBtn",g.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});m.className="geBtn gePrimaryBtn";g.appendChild(m);a.editor.cancelFirst||g.appendChild(l);e.appendChild(g);this.container=e};var n=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background= this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(n.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!= this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})(); (function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};a.afterDecode=function(a,e,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="@DRAWIO-VERSION@";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";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.sidebarFooterHeight=36;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.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport= !1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(t){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport= -null!=a&&6<a.length}catch(h){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(t){}try{b=document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(t){}})(); +null!=a&&6<a.length}catch(l){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(t){}try{b=document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(t){}})(); EditorUi.prototype.openLink=function(a,b){return this.editor.graph.openLink(a,b)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh(); this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12, length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color="white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",g.style.paddingLeft="10px",g.style.paddingRight= "10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),g.innerHTML=e+"...",d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0, b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+ (a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(u){}return!1}; -var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var t=mxUtils.parseXml(c),h=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!= -h?mxUtils.getXml(h):""}catch(n){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate(); -try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,h,0==e?h:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"), -this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,e,t,h,n,l,k,r){b=null!= -b?b:this.editor.graph;t=null!=t?t:!1;k=null!=k?k:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var u=b.zapGremlins(mxUtils.getXml(a)),g=b.compress(u);if(b.decompress(g)!=u)return u;u=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(u,g);g=a.ownerDocument.createElement("mxfile");g.appendChild(u)}r?(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"), -g.removeAttribute("editor"),g.removeAttribute("type")):(g.setAttribute("userAgent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("editor","www.draw.io"),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!h&&!t&&(n||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(h||!t&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!= -App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,l,k,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var f=0;f<this.pages.length;f++){var e=this.pages[f].mapping; -this.currentPage!=this.pages[f]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[f].node,d),e.needsUpdate=!1);c.appendChild(this.pages[f].node)}}return c};EditorUi.prototype.getFileData=function(a,b,d,e,t,h,n,l,k){t=null!=t?t:!0;n=null!=n?n:this.getXmlFileData(t,null!=h?h:!1);k=null!=k?k:this.getCurrentFile();h=this.editor.graph; -if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=k&&/(\.svg)$/i.test(k.getTitle()))){h=this.createTemporaryGraph(h.getStylesheet());var c=h.getGlobalVariable,f=this.pages[0];h.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:c.apply(this,arguments)};document.body.appendChild(h.container);h.model.setRoot(f.root)}a=this.createFileData(n,h,k,window.location.href,a,b,d,e,t,l);h!=this.editor.graph&&h.container.parentNode.removeChild(h.container);return a}; -EditorUi.prototype.getHtml=function(a,b,d,e,t,h){h=null!=h?h:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=h?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),g=b.view.scale;h=Math.floor(c.x/g-b.view.translate.x);g=Math.floor(c.y/g-b.view.translate.y);c=b.background;null==t&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",h);a.setAttribute("y0",g)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom", +var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var t=mxUtils.parseXml(c),l=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!= +l?mxUtils.getXml(l):""}catch(n){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate(); +try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var l=this.updatePageRoot(new DiagramPage(d[e]));null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,l,0==e?l:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"), +this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,e,t,l,n,k,h,r){b=null!= +b?b:this.editor.graph;t=null!=t?t:!1;h=null!=h?h:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var u=b.zapGremlins(mxUtils.getXml(a)),g=b.compress(u);if(b.decompress(g)!=u)return u;u=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(u,g);g=a.ownerDocument.createElement("mxfile");g.appendChild(u)}r?(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"), +g.removeAttribute("editor"),g.removeAttribute("type")):(g.setAttribute("userAgent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("editor","www.draw.io"),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!l&&!t&&(n||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(l||!t&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!= +App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,k,h,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var f=0;f<this.pages.length;f++){var e=this.pages[f].mapping; +this.currentPage!=this.pages[f]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[f].node,d),e.needsUpdate=!1);c.appendChild(this.pages[f].node)}}return c};EditorUi.prototype.getFileData=function(a,b,d,e,t,l,n,k,h){t=null!=t?t:!0;n=null!=n?n:this.getXmlFileData(t,null!=l?l:!1);h=null!=h?h:this.getCurrentFile();l=this.editor.graph; +if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=h&&/(\.svg)$/i.test(h.getTitle()))){l=this.createTemporaryGraph(l.getStylesheet());var c=l.getGlobalVariable,f=this.pages[0];l.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:c.apply(this,arguments)};document.body.appendChild(l.container);l.model.setRoot(f.root)}a=this.createFileData(n,l,h,window.location.href,a,b,d,e,t,k);l!=this.editor.graph&&l.container.parentNode.removeChild(l.container);return a}; +EditorUi.prototype.getHtml=function(a,b,d,e,t,l){l=null!=l?l:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=l?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),g=b.view.scale;l=Math.floor(c.x/g-b.view.translate.x);g=Math.floor(c.y/g-b.view.translate.y);c=b.background;null==t&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",l);a.setAttribute("y0",g)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom", "1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=t&&(t=t.replace(/&/g,"&"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";e=this.editor.graph.compress(a);this.editor.graph.decompress(e)!=a&&(e=encodeURIComponent(a));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!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+"</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="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,e,t){null!=t&&(t=t.replace(/&/g,"&"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages, @@ -2743,48 +2744,48 @@ this.currentPage));return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compati mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==t?'<script type="text/javascript" src="https://www.draw.io/js/viewer.min.js">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;var c=null!=a&&0<a.length? mxUtils.parseXml(a).documentElement:null;a=null!=c?this.editor.extractGraphModel(c,!0):null;null!=a&&(c=a);if(null!=c&&"mxfile"==c.nodeName&&(a=c.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<a.length||1==a.length&&a[0].hasAttribute("name"))){this.fileNode=c;this.pages=[];for(c=0;c<a.length;c++){var b=new DiagramPage(a[c]);null==b.getName()&&b.setName(mxResources.get("pageWithNumber",[c+1]));this.pages.push(b)}this.currentPage=this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page|| 0))];c=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=c&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(c);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var c=this.getCurrentFile(),c=null!=c&&null!= -c.getTitle()?c.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(c)||/(\.html)$/i.test(c)||/(\.svg)$/i.test(c)||/(\.png)$/i.test(c))c=c.substring(0,c.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(c=c+"-"+this.currentPage.getName());return c};EditorUi.prototype.downloadFile=function(a,b,d,e,t,h,n){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!t), +c.getTitle()?c.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(c)||/(\.html)$/i.test(c)||/(\.svg)$/i.test(c)||/(\.png)$/i.test(c))c=c.substring(0,c.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(c=c+"-"+this.currentPage.getName());return c};EditorUi.prototype.downloadFile=function(a,b,d,e,t,l,n){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!t), f=c+"."+a;if("xml"==a){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,t));this.saveData(f,a,g,"text/xml")}else if("html"==a)g=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,g,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var d= -this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var f=this.createDownloadRequest(c,a,e,b,n);this.editor.graph.pageVisible=d;return f}catch(B){this.handleError(B)}}));else{var u=null,k=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(u)}))});if("svg"==a){var m=this.editor.graph.background;if(n||m== -mxConstants.NONE)m=null;var p=this.editor.graph.getSvg(m,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(p);this.convertImages(p,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();k('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else f=c+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();k(a)}),e)}}catch(E){this.handleError(E)}}; +this.editor.graph.pageVisible;null!=l&&(this.editor.graph.pageVisible=l);var f=this.createDownloadRequest(c,a,e,b,n);this.editor.graph.pageVisible=d;return f}catch(B){this.handleError(B)}}));else{var u=null,h=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(u)}))});if("svg"==a){var m=this.editor.graph.background;if(n||m== +mxConstants.NONE)m=null;var p=this.editor.graph.getSvg(m,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(p);this.convertImages(p,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();h('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else f=c+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();h(a)}),e)}}catch(E){this.handleError(E)}}; EditorUi.prototype.createDownloadRequest=function(a,b,d,e,t){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,"xmlpng"!=b);var f="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(var g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){f="&from="+g;break}g=this.editor.graph.background;"png"==b&&t&&(g=mxConstants.NONE); return new mxXmlRequest(EXPORT_URL,"format="+b+f+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,d){var c=window.location.hash,f=mxUtils.bind(this,function(d){var f=null!=a.data?a.data:"";null!=d&&0<d.length&&(0<f.length&&(f+="\n"),f+=d);d=new LocalFile(this,"csv"!=a.format&&0<f.length?f:this.emptyDiagramXml, -null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);d.getHash=function(){return c};this.fileLoaded(d);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?parseInt(a.interval):6E4,g=null,h=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())), -mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),n()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),n=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(h,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){n();h()}));n();h()}null!=b&&b()});if(null!=a.url){var e=a.url;/^https?:\/\//.test(e)&&!this.isCorsEnabledForUrl(e)&& +null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);d.getHash=function(){return c};this.fileLoaded(d);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?parseInt(a.interval):6E4,g=null,n=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())), +mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),l()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),l=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(n,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){l();n()}));l();n()}null!=b&&b()});if(null!=a.url){var e=a.url;/^https?:\/\//.test(e)&&!this.isCorsEnabledForUrl(e)&& (e=PROXY_URL+"?url="+encodeURIComponent(a.url));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else f(a.data)};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||d.warningImage,a.tooltip,a.align,a.valign,a.offset);c.addListener(mxEvent.CLICK,function(c,b){editorUi.alert(a.tooltip)});return c}var b=null;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var d= -this.editor.graph,e=d.getModel();e.beginUpdate();var h=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var n=e.getCell(a.getAttribute("id"));if(null!=n){try{var l=a.getAttribute("value");if(null!=l){var k=mxUtils.parseXml(l).documentElement;if(null!=k)if("1"==k.getAttribute("replace-value"))e.setValue(n,k);else for(var r=k.attributes,m=0;m<r.length;m++)d.setAttributeForCell(n,r[m].nodeName,0<r[m].nodeValue.length?r[m].nodeValue:null)}}catch(B){null!=window.console&&console.log("Error in value for "+ +this.editor.graph,e=d.getModel();e.beginUpdate();var l=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var n=e.getCell(a.getAttribute("id"));if(null!=n){try{var k=a.getAttribute("value");if(null!=k){var h=mxUtils.parseXml(k).documentElement;if(null!=h)if("1"==h.getAttribute("replace-value"))e.setValue(n,h);else for(var r=h.attributes,m=0;m<r.length;m++)d.setAttributeForCell(n,r[m].nodeName,0<r[m].nodeValue.length?r[m].nodeValue:null)}}catch(B){null!=window.console&&console.log("Error in value for "+ n.id+": "+B)}try{var p=a.getAttribute("style");null!=p&&d.model.setStyle(n,p)}catch(B){null!=window.console&&console.log("Error in style for "+n.id+": "+B)}try{var q=a.getAttribute("icon");if(null!=q){var v=0<q.length?JSON.parse(q):null;null!=v&&v.append||d.removeCellOverlays(n);null!=v&&d.addCellOverlay(n,c(v))}}catch(B){null!=window.console&&console.log("Error in icon for "+n.id+": "+B)}try{var E=a.getAttribute("geometry");if(null!=E){var E=JSON.parse(E),x=d.getCellGeometry(n);if(null!=x){x=x.clone(); for(key in E){var J=parseFloat(E[key]);"dx"==key?x.x+=J:"dy"==key?x.y+=J:"dw"==key?x.width+=J:"dh"==key?x.height+=J:x[key]=parseFloat(E[key])}d.model.setGeometry(n,x)}}}catch(B){null!=window.console&&console.log("Error in icon for "+n.id+": "+B)}}}else if("model"==a.nodeName){for(var H=a.firstChild;null!=H&&H.nodeType!=mxConstants.NODETYPE_ELEMENT;)H=H.nextSibling;null!=H&&(new mxCodec(a.firstChild)).decode(H,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(d.view.scale=parseFloat(a.getAttribute("scale"))), -a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(h=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=h&&this.chromelessResize&&this.chromelessResize(!0,h)}return b};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener), +a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(l=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=l&&this.chromelessResize&&this.chromelessResize(!0,l)}return b};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener), b.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=b&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename"))); this.updateUi();this.showSplash()});if(null!=a)try{this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+ "</span>"));!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();this.editor.fireEvent(new mxEventObject("fileLoaded"));c=!0;this.isOffline()||null==a.getMode()||this.logEvent({category:"File",action:"open",label:a.getMode()});if(this.mode==a.getMode()&&a.getMode()!= App.MODE_DEVICE&&null!=a.getMode())try{this.addRecent({id:a.getHash(),title:a.getTitle(),mode:a.getMode()})}catch(t){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(t){}}catch(t){null!=window.console&&console.log("error in fileLoaded:",a,t);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+ -(null!=t&&null!=t.message?":err:"+encodeURIComponent(t.message):"")+(null!=t&&null!=t.stack?"&stack="+encodeURIComponent(t.stack):"")}catch(h){}this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.descriptorChanged= -function(){};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,t,h,n){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad= +(null!=t&&null!=t.message?":err:"+encodeURIComponent(t.message):"")+(null!=t&&null!=t.stack?"&stack="+encodeURIComponent(t.stack):"")}catch(l){}this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.descriptorChanged= +function(){};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,t,l,n){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad= function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!= a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b= this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};}; EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){if(0==c.length&&a.isEditable())null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style, -"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f);else for(var d=0;d<c.length;d++){var e=c[d],g=e.data;if(null!=g){var g=this.convertDataUri(g),h="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(h+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(h+"image="+g,e.w,e.h,"",e.title||"",!1, +"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f);else for(var d=0;d<c.length;d++){var e=c[d],g=e.data;if(null!=g){var g=this.convertDataUri(g),n="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(n+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(n+"image="+g,e.w,e.h,"",e.title||"",!1, !1,!0))}else null!=e.xml&&(g=this.stringToCells(this.editor.graph.decompress(e.xml)),0<g.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(g,e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+= -"aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var l=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var k= -l.parentNode.previousSibling;d=k.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&k.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var r=document.createElement("div");r.style.position="absolute";r.style.right="0px";r.style.top="0px";r.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(r.style.backgroundColor="inherit");k.style.position="relative";var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title", +"aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var h= +k.parentNode.previousSibling;d=h.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&h.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var r=document.createElement("div");r.style.position="absolute";r.style.right="0px";r.style.top="0px";r.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(r.style.backgroundColor="inherit");h.style.position="relative";var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title", mxResources.get("close"));m.setAttribute("valign","absmiddle");m.setAttribute("border","0");m.style.margin="0 3px";var p=null;if(".scratchpad"!=a.title||this.closableScratchpad)r.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=p?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var q= -this.editor.graph,v=null,E=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),l,b,a,a.getMode());mxEvent.consume(c)}),x=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v),v=m.cloneNode(!1),v.setAttribute("src",Editor.spinImage),v.setAttribute("title",mxResources.get("saving")),v.style.cursor="default",v.style.marginRight="2px",v.style.marginTop="-2px",r.insertBefore(v,r.firstChild),k.style.paddingRight=18*r.childNodes.length+ -"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=v&&null!=v.parentNode&&(v.parentNode.removeChild(v),k.style.paddingRight=18*r.childNodes.length+"px")})):null==p&&(p=m.cloneNode(!1),p.setAttribute("src",IMAGE_PATH+"/download.png"),p.setAttribute("title",mxResources.get("save")),r.insertBefore(p,r.firstChild),mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==p||a.isModified()|| -(k.style.paddingRight=18*r.childNodes.length+"px",p.parentNode.removeChild(p),p=null)});mxEvent.consume(c)})),k.style.paddingRight=18*r.childNodes.length+"px")}),J=mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var h=q.getCellGeometry(a[g]);null!=h&&h.translate(-c.x,-c.y)}l.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))), +this.editor.graph,v=null,E=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),x=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v),v=m.cloneNode(!1),v.setAttribute("src",Editor.spinImage),v.setAttribute("title",mxResources.get("saving")),v.style.cursor="default",v.style.marginRight="2px",v.style.marginTop="-2px",r.insertBefore(v,r.firstChild),h.style.paddingRight=18*r.childNodes.length+ +"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=v&&null!=v.parentNode&&(v.parentNode.removeChild(v),h.style.paddingRight=18*r.childNodes.length+"px")})):null==p&&(p=m.cloneNode(!1),p.setAttribute("src",IMAGE_PATH+"/download.png"),p.setAttribute("title",mxResources.get("save")),r.insertBefore(p,r.firstChild),mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==p||a.isModified()|| +(h.style.paddingRight=18*r.childNodes.length+"px",p.parentNode.removeChild(p),p=null)});mxEvent.consume(c)})),h.style.paddingRight=18*r.childNodes.length+"px")}),J=mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var n=q.getCellGeometry(a[g]);null!=n&&n.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))), w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);x(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=q.getSelectionCells(),b=q.view.getBounds(c),d=q.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=q.view.translate.x; -b.y-=q.view.translate.y;J(c,b)}mxEvent.consume(a)});l.style.border="3px solid transparent";mxEvent.addGestureListeners(l,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":l.style.border="3px dotted rgb(254, 137, 12)",l.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1), -null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(l.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),l.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(l,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&& -null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",l.style.border="3px solid transparent",l.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(l,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":l.style.border="3px dotted rgb(254, 137, 12)"; -a.dataTransfer.dropEffect="copy";l.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(l,"drop",mxUtils.bind(this,function(a){l.style.border="3px solid transparent";l.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,h,n,u,r,t,k){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+ -this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,n,u),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,n,u),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var m=!1,p=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,l);b=b.concat(h);x(a); -this.spinner.stop();m=!0}catch(T){}else if("mxfile"==g.documentElement.nodeName)try{for(var n=g.documentElement.getElementsByTagName("diagram"),g=0;g<n.length;g++){var h=mxUtils.getTextContent(n[g]),u=this.stringToCells(this.editor.graph.decompress(h)),r=this.editor.graph.getBoundingBoxFromGeometry(u);J(u,new mxRectangle(0,0,r.width,r.height),a)}m=!0}catch(T){null!=window.console&&console.log("error in drop handler:",T)}}m||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")})); -null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=k&&null!=r&&(/(\.vsdx?)($|\?)/i.test(r)||/(\.vssx)($|\?)/i.test(r))?this.importVisio(k,function(a){p(a,"text/xml")},null,r):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,r)&&null!=k?this.parseFile(k,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?p(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge": -"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):p(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(l,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(l.style.border="3px solid transparent",l.style.cursor="");a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));r.insertBefore(m,r.firstChild);mxEvent.addListener(m,"click",E);mxEvent.addListener(l, -"dblclick",function(a){mxEvent.getSource(a)==l&&E(a)});d=m.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));r.insertBefore(d,r.firstChild);mxEvent.addListener(d,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d, -mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(d,r.firstChild))}k.appendChild(r);k.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter"); +b.y-=q.view.translate.y;J(c,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1), +null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&& +null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)"; +a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,n,l,u,r,t,h){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+ +this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,l,u),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,l,u),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var m=!1,p=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(g.documentElement));e(n,k);b=b.concat(n);x(a); +this.spinner.stop();m=!0}catch(T){}else if("mxfile"==g.documentElement.nodeName)try{for(var l=g.documentElement.getElementsByTagName("diagram"),g=0;g<l.length;g++){var n=mxUtils.getTextContent(l[g]),u=this.stringToCells(this.editor.graph.decompress(n)),r=this.editor.graph.getBoundingBoxFromGeometry(u);J(u,new mxRectangle(0,0,r.width,r.height),a)}m=!0}catch(T){null!=window.console&&console.log("error in drop handler:",T)}}m||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")})); +null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=h&&null!=r&&(/(\.vsdx?)($|\?)/i.test(r)||/(\.vssx)($|\?)/i.test(r))?this.importVisio(h,function(a){p(a,"text/xml")},null,r):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,r)&&null!=h?this.parseFile(h,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?p(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge": +"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):p(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border="3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));r.insertBefore(m,r.firstChild);mxEvent.addListener(m,"click",E);mxEvent.addListener(k, +"dblclick",function(a){mxEvent.getSource(a)==k&&E(a)});d=m.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));r.insertBefore(d,r.firstChild);mxEvent.addListener(d,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d, +mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(d,r.firstChild))}h.appendChild(r);h.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter"); if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme? (mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding= 5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4", @@ -2794,217 +2795,217 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM !0;this.editor.graph.model.execute(a)});var c=new BackgroundImageDialog(this,mxUtils.bind(this,function(c){a(c)}));this.showDialog(c.container,360,200,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(a,b,d,e,t){a=new LibraryDialog(this,a,b,d,e,t);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer"); a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d){var c=null!=this.spinner&&null!= this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),g=function(){c();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden")); -else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var l=window.location.hash;null!=l&&"#G"==l.substring(0,2)&&(l=l.substring(2),a+=' <a href="https://drive.google.com/open?id='+l+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a= -mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,d,g)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,t,h,n,l,k,r,m,p){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,t,h,n,p,l,k);this.showDialog(a.container,r||340,m||150,!0,!1);a.init()};EditorUi.prototype.alert= +else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2),a+=' <a href="https://drive.google.com/open?id='+k+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a= +mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,d,g)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,t,l,n,k,h,r,m,p){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,t,l,n,p,k,h);this.showDialog(a.container,r||340,m||150,!0,!1);a.init()};EditorUi.prototype.alert= function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,t){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,t)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile}; EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b)))); return c};EditorUi.prototype.saveCanvas=function(a,b,d){var c="jpeg"==d?"jpg":d,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!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&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS}; EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,t){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,d):new Blob([a],{type:d}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)d=window.open("about:blank","_blank"),null==d?mxUtils.popup(a,!0):(d.document.write(a),d.document.close(),d.document.execCommand("SaveAs",!0,b),d.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height= "380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof c.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),f=65==(g?parseInt(g[2],10):!1)?!1:f;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,d):new Blob([a],{type:d}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c); -try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(w){}}else this.createEchoRequest(a,b,d,e,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,t,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=t?"&format="+t:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b= -b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),n=0;n<f;++n){for(var l=1024*n,k=Math.min(l+1024,d),r=Array(k-l),m=0;l<k;++m,++l)r[m]=c[l].charCodeAt(0);e[n]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,t,h,n){h=null!=h?h:!1;n=null!=n?n:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);t=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)|| +try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(w){}}else this.createEchoRequest(a,b,d,e,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,t,l){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=t?"&format="+t:"")+(null!=l?"&base64="+l:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b= +b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),n=0;n<f;++n){for(var k=1024*n,h=Math.min(k+1024,d),r=Array(h-k),m=0;k<h;++m,++k)r[m]=c[k].charCodeAt(0);e[n]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,t,l,n){l=null!=l?l:!1;n=null!=n?n:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);t=this.getServiceCount(l);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)|| "image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE||"download"==b?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(D){this.handleError(D)}}))}catch(y){this.handleError(y)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"), -mxResources.get("download"),!1,h,n,null,1<t,4<t&&(!h||6>t)?3:4,a,d,e);this.showDialog(b.container,420,t==(mxClient.IS_IOS?0:1)?160:4<t?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+ +mxResources.get("download"),!1,l,n,null,1<t,4<t&&(!l||6>t)?3:4,a,d,e);this.showDialog(b.container,420,t==(mxClient.IS_IOS?0:1)?160:4<t?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+ '"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,!0)};var d=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog), this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";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,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog); this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this, function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}d.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,d,e,t){this.isLocalFileSave()?this.saveLocalFile(d, -a,e,t,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,t,b,c)}),d,t,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,t,h,n){n=null!=n?n:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||"download"==c||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"download"==c||"_blank"==c?f.simulate(document, -"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,h,!0,c,d)}catch(z){this.handleError(z)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,c,d)}catch(z){this.handleError(z)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop(); -this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,n,null,1<c,4<c?3:4,e,h,t);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,t,h){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,t,h,n,l,k){if(this.spinner.spin(document.body, -mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,n,l,null,d);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(a){this.spinner.stop();t&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,k));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS? +a,e,t,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,t,b,c)}),d,t,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,t,l,n){n=null!=n?n:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||"download"==c||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"download"==c||"_blank"==c?f.simulate(document, +"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){l=null!=l?l:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,l,!0,c,d)}catch(z){this.handleError(z)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,l,!0,c,d)}catch(z){this.handleError(z)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop(); +this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,n,null,1<c,4<c?3:4,e,l,t);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,t,l){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,t,l,n,k,h){if(this.spinner.spin(document.body, +mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,n,k,null,d);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(a){this.spinner.stop();t&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,h));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS? c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(c)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"), -mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,u,this.thumbImageCache)):u(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,t,h){h=null!=h?h:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled", -"disabled");h&&(a.appendChild(c),d=document.createElement("span"),mxUtils.write(d,b),a.appendChild(d),t||mxUtils.br(a),mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){"disabled"!=c.getAttribute("disabled")&&(c.checked=!c.checked,mxEvent.consume(a))})));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&& +mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){l?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,u,this.thumbImageCache)):u(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,t,l){l=null!=l?l:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled", +"disabled");l&&(a.appendChild(c),d=document.createElement("span"),mxUtils.write(d,b),a.appendChild(d),t||mxUtils.br(a),mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){"disabled"!=c.getAttribute("disabled")&&(c.checked=!c.checked,mxEvent.consume(a))})));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&& (f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"== e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return c}, getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){n.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft= "8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value", "frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",n=null,n=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();n.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";n.style.marginLeft="4px";n.style.height="22px";n.style.width="22px";n.style.position="relative";n.style.top=mxClient.IS_IE|| -mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";n.className="geColorBtn";a.appendChild(n);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,k,h,n,l){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=k&&0<k.length&&f.push("edit="+encodeURIComponent(k)),h&& -f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=n?d="#U"+encodeURIComponent(n):(c=this.getCurrentFile(),l||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1)); -a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,k,h,n,l,m,r,p){this.getBasenames();var c={};""!=k&&k!=mxConstants.NONE&&(c.highlight=k);"auto"!==e&&(c.target=e);m||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled; -d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];n&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);l&&d.push("layers");0<d.length&&(m&&d.push("lightbox"),c.toolbar=d.join(" "));null!=r&&0<r.length&&(c.edit=r);null!=a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!n);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+ +mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";n.className="geColorBtn";a.appendChild(n);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,h,l,n,k){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=h&&0<h.length&&f.push("edit="+encodeURIComponent(h)),l&& +f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=n?d="#U"+encodeURIComponent(n):(c=this.getCurrentFile(),k||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1)); +a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,h,l,n,k,m,r,p){this.getBasenames();var c={};""!=h&&h!=mxConstants.NONE&&(c.highlight=h);"auto"!==e&&(c.target=e);m||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled; +d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];n&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);k&&d.push("layers");0<d.length&&(m&&d.push("lightbox"),c.toolbar=d.join(" "));null!=r&&0<r.length&&(c.edit=r);null!=a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!n);b='<div class="mxgraph" style="'+(l?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+ mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";p(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.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";c.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 k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(k);mxUtils.br(g);g.appendChild(l);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));g.appendChild(k);var r=this.getCurrentFile();null==d&&null!=r&&r.constructor==window.DriveFile&&(k=document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")), -g.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==d&&l.setAttribute("disabled","disabled");c.appendChild(g);var u=this.addLinkSection(c),m=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight= +mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value", +"copy");g.appendChild(f);var h=document.createElement("span");mxUtils.write(h,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(h);mxUtils.br(g);g.appendChild(k);h=document.createElement("span");mxUtils.write(h,mxResources.get("publicDiagramUrl"));g.appendChild(h);var r=this.getCurrentFile();null==d&&null!=r&&r.constructor==window.DriveFile&&(h=document.createElement("a"),h.style.paddingLeft="12px",h.style.color="gray",h.setAttribute("href","javascript:void(0);"),mxUtils.write(h,mxResources.get("share")), +g.appendChild(h),mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(g);var u=this.addLinkSection(c),m=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");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%";c.appendChild(p);var q=this.addCheckbox(c,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,E=E=this.addCheckbox(c,mxResources.get("allPages"),g,!g),x=this.addCheckbox(c,mxResources.get("layers"),!0),v=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,v),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(v,"change",function(){v.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&v.checked? -H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(l.checked?d:null,m.checked,p.value,u.getTarget(),u.getColor(),q.checked,E.checked,x.checked,v.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,k,h){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3"); +H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,m.checked,p.value,u.getTarget(),u.getColor(),q.checked,E.checked,x.checked,v.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,h,l){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3"); mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",r=document.createElement("div");r.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;"; var u=document.createElement("div");u.style.whiteSpace="normal";mxUtils.write(u,mxResources.get("linkAccountRequired"));r.appendChild(u);u=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));u.style.marginTop="12px";u.className="geBtn";r.appendChild(u);c.appendChild(r);u=document.createElement("a");u.style.paddingLeft="12px";u.style.color="gray";u.style.fontSize="11px";u.setAttribute("href","javascript:void(0);");mxUtils.write(u,mxResources.get("check")); r.appendChild(u);mxEvent.addListener(u,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var t=null,m=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),t=document.createElement("input"), -t.setAttribute("type","text"),t.style.marginRight="16px",t.style.width="50px",t.style.marginLeft="6px",t.style.marginRight="16px",t.style.marginBottom="10px",t.value="100%",c.appendChild(t),mxUtils.write(c,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=e+"px",c.appendChild(m),mxUtils.br(c);var p=this.addLinkSection(c,h);d=null!=this.pages&&1<this.pages.length;var q=null; +t.setAttribute("type","text"),t.style.marginRight="16px",t.style.width="50px",t.style.marginLeft="6px",t.style.marginRight="16px",t.style.marginBottom="10px",t.value="100%",c.appendChild(t),mxUtils.write(c,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=e+"px",c.appendChild(m),mxUtils.br(c);var p=this.addLinkSection(c,l);d=null!=this.pages&&1<this.pages.length;var q=null; if(null==g||g.constructor!=window.DriveFile||b)q=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var x=this.addCheckbox(c,mxResources.get("lightbox"),!0),v=this.addEditButton(c,x),H=v.getEditInput(),B=this.addCheckbox(c,mxResources.get("layers"),!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(x,"change",function(){x.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled", -"disabled"));H.checked&&x.checked?v.getEditSelect().removeAttribute("disabled"):v.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){k(p.getTarget(),p.getColor(),null==q?!0:q.checked,x.checked,v.getLink(),B.checked,null!=t?t.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=t?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select(): -document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var g=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),l=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"), -!0),f=this.editor.graph,k=e?null:this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!g.checked,null!=l?l.checked:!1,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,k,h,n,l){n=null!=n?n:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f= -this.editor.graph,g="jpeg"==l?196:300,u=document.createElement("h3");mxUtils.write(u,a);u.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(u);mxUtils.write(c,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";c.appendChild(t);mxUtils.write(c,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";c.appendChild(m);mxUtils.br(c);var p=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=l),q=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),v=document.createElement("input");v.style.marginTop="16px";v.style.marginRight= -"8px";v.style.marginLeft="24px";v.setAttribute("disabled","disabled");v.setAttribute("type","checkbox");h&&(c.appendChild(v),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),g+=26,mxEvent.addListener(q,"change",function(){q.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(v.setAttribute("checked","checked"),v.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),B=document.createElement("input");B.style.marginTop= -"16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(c.appendChild(B),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=26);var N=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),n,null,null,"jpeg"!=l),C=null!=this.pages&&1<this.pages.length,I=this.addCheckbox(c,C?mxResources.get("allPages"):"",C,!C,null,"jpeg"!=l);I.style.marginLeft="24px";I.style.marginBottom="16px";C||(I.style.visibility= -"hidden");mxEvent.addListener(N,"change",function(){N.checked&&C?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")});n&&C||I.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=m.value;this.lastExportZoom=t.value;k(t.value,p.checked,!q.checked,H.checked,N.checked,B.checked,m.value,v.checked,!I.checked)}),null,d,e);this.showDialog(a.container,340,g,!0,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| -mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(g)}var u=this.addCheckbox(c,mxResources.get("fit"),!0),r=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e, +"disabled"));H.checked&&x.checked?v.getEditSelect().removeAttribute("disabled"):v.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){h(p.getTarget(),p.getColor(),null==q?!0:q.checked,x.checked,v.getLink(),B.checked,null!=t?t.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=t?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select(): +document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var g=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"), +!0),f=this.editor.graph,h=e?null:this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=h&&(h.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!g.checked,null!=k?k.checked:!1,null!=h?h.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,h,l,n,k){n=null!=n?n:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f= +this.editor.graph,g="jpeg"==k?196:300,u=document.createElement("h3");mxUtils.write(u,a);u.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(u);mxUtils.write(c,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";c.appendChild(t);mxUtils.write(c,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";c.appendChild(m);mxUtils.br(c);var p=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=k),q=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),v=document.createElement("input");v.style.marginTop="16px";v.style.marginRight= +"8px";v.style.marginLeft="24px";v.setAttribute("disabled","disabled");v.setAttribute("type","checkbox");l&&(c.appendChild(v),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),g+=26,mxEvent.addListener(q,"change",function(){q.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(v.setAttribute("checked","checked"),v.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),B=document.createElement("input");B.style.marginTop= +"16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(c.appendChild(B),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=26);var N=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),n,null,null,"jpeg"!=k),C=null!=this.pages&&1<this.pages.length,I=this.addCheckbox(c,C?mxResources.get("allPages"):"",C,!C,null,"jpeg"!=k);I.style.marginLeft="24px";I.style.marginBottom="16px";C||(I.style.visibility= +"hidden");mxEvent.addListener(N,"change",function(){N.checked&&C?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")});n&&C||I.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=m.value;this.lastExportZoom=t.value;h(t.value,p.checked,!q.checked,H.checked,N.checked,B.checked,m.value,v.checked,!I.checked)}),null,d,e);this.showDialog(a.container,340,g,!0,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| +mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,h){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(g)}var u=this.addCheckbox(c,mxResources.get("fit"),!0),r=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e, !e),t=this.addCheckbox(c,d),m=this.addCheckbox(c,mxResources.get("lightbox"),!0),p=this.addEditButton(c,m),q=p.getEditInput(),v=1<f.model.getChildCount(f.model.getRoot()),x=this.addCheckbox(c,mxResources.get("layers"),v,!v);x.style.marginLeft=q.style.marginLeft;x.style.marginBottom="12px";x.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(v&&x.removeAttribute("disabled"),q.removeAttribute("disabled")):(x.setAttribute("disabled","disabled"),q.setAttribute("disabled","disabled")); -q.checked&&m.checked?p.getEditSelect().removeAttribute("disabled"):p.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(u.checked,r.checked,t.checked,m.checked,p.getLink(),x.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,k,h,n,l){function c(c){var b=" ",g="";e&&(b=" 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('https://www.draw.io/?client=1&lightbox=1"+ -(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var l="";d&&(l=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');n('<img src="'+c+'"'+l+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}), -null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";d&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var u=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));u.send(mxUtils.bind(this,function(){200<=u.getStatus()&&299>=u.getStatus()?c("data:image/png;base64,"+u.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})}; -EditorUi.prototype.createEmbedSvg=function(a,b,d,e,k,h,n){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var u=f[g].getAttribute("href");null!=u&&"#"==u.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var t=" ",m="";e&&(t="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ -(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");a&&(m+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){n('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=m?' style="'+m+'"':"")+t+"/>")}))}else m="",e&&(c.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('https://www.draw.io/?client=1&lightbox=1"+ -(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}}})(this);"),m+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),m+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=m&&c.setAttribute("style",m),n(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");c=Math.floor(a/2592E3);if(1<c)return c+ +q.checked&&m.checked?p.getEditSelect().removeAttribute("disabled"):p.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(u.checked,r.checked,t.checked,m.checked,p.getLink(),x.checked)}),null,mxResources.get("embed"),h);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,h,l,n,k){function c(c){var b=" ",g="";e&&(b=" 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('https://www.draw.io/?client=1&lightbox=1"+ +(h?"&edit=_blank":"")+(l?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var k="";d&&(k=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');n('<img src="'+c+'"'+k+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){k({message:mxResources.get("unknownError")})}), +null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";d&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var u=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));u.send(mxUtils.bind(this,function(){200<=u.getStatus()&&299>=u.getStatus()?c("data:image/png;base64,"+u.getText()):k({message:mxResources.get("unknownError")})}))}else k({message:mxResources.get("drawingTooLarge")})}; +EditorUi.prototype.createEmbedSvg=function(a,b,d,e,h,l,n){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var u=f[g].getAttribute("href");null!=u&&"#"==u.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var t=" ",m="";e&&(t="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ +(h?"&edit=_blank":"")+(l?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");a&&(m+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){n('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=m?' style="'+m+'"':"")+t+"/>")}))}else m="",e&&(c.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('https://www.draw.io/?client=1&lightbox=1"+ +(h?"&edit=_blank":"")+(l?"&layers=1":"")+"');}}})(this);"),m+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),m+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=m&&c.setAttribute("style",m),n(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");c=Math.floor(a/2592E3);if(1<c)return c+ " "+mxResources.get("months");c=Math.floor(a/86400);if(1<c)return c+" "+mxResources.get("days");c=Math.floor(a/3600);if(1<c)return c+" "+mxResources.get("hours");c=Math.floor(a/60);return 1<c?c+" "+mxResources.get("minutes"):1==c?c+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,d,e){e()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0< -d.length){var c=d[0],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(h){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph, +d.length){var c=d[0],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(l){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph, f=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),f=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),e=c.getGlobalVariable,g=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(c.container); c.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==f&&(f=this.getFileData(!0));var e=d.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(r){null!=b&&b(r)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg= -function(a,b,d,e,k,h,n){n=b.background;n==mxConstants.NONE&&(n=null);b=b.getSvg(n,null,null,null,null,h);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=k)this.convertImages(b,mxUtils.bind(this,function(a){k((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+ -mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,k,h,n,l,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,k?this.getFileData(!0,null,null,null,d,l):null,m)}catch(D){"Invalid image"==D.message?this.downloadFile(m):this.handleError(D)}}),null, -this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,h,n)}catch(y){this.spinner.stop(),this.handleError(y)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},h=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],g=1;g<b.length;g++){var h= -b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,h))]);f.push('"'+b[g].substring(h))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var n=1;n<b.length;n++){var l=b[n].indexOf(")"),k=null,r=b[n].indexOf("format(",l);0<r&&(k=c(b[n].substring(r+7,b[n].indexOf(")",r))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==k||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==k||"embedded-opentype"==k||/(\.otf)($|\?)/i.test(a))c= -"application/x-font-opentype";else if("woff"==k||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==k||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==k||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==k||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;h()}),mxUtils.bind(this, -function(a){d--;h()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[n].substring(0,l)),k)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,k,h,n,l,m,r,p,q,v,G){h=null!=h?h:!0;q=null!=q?q:this.editor.graph;v=null!=v?v:0;var c=m?null:q.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==m&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(q.getSvg(c,null,null,G,null,null!=n?n:!0),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this, -function(){try{var f=document.createElement("canvas"),g=parseInt(d.getAttribute("width")),n=parseInt(d.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=h?Math.min(1,Math.min(3*b/(4*n),b/g)):b/g);g=Math.ceil(l*g)+2*v;n=Math.ceil(l*n)+2*v;f.setAttribute("width",g);f.setAttribute("height",n);var r=f.getContext("2d");null!=c&&(r.beginPath(),r.rect(0,0,g,n),r.fillStyle=c,r.fill());r.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){r.drawImage(e,v/l,v/l);a(f)},0):(r.drawImage(e,v/l,v/l),a(f))}catch(R){null!= -k&&k(R)}});e.onerror=function(a){null!=k&&k(a)};try{r&&this.editor.graph.addSvgShadow(d);var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(q,d,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(B){null!=k&&k(B)}}),d,p)};EditorUi.prototype.createImageUrlConverter= +function(a,b,d,e,h,l,n){n=b.background;n==mxConstants.NONE&&(n=null);b=b.getSvg(n,null,null,null,null,l);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=h)this.convertImages(b,mxUtils.bind(this,function(a){h((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+ +mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,h,l,n,k,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,h?this.getFileData(!0,null,null,null,d,k):null,m)}catch(D){"Invalid image"==D.message?this.downloadFile(m):this.handleError(D)}}),null, +this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,l,n)}catch(y){this.spinner.stop(),this.handleError(y)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},l=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],g=1;g<b.length;g++){var n= +b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,n))]);f.push('"'+b[g].substring(n))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var n=1;n<b.length;n++){var k=b[n].indexOf(")"),h=null,r=b[n].indexOf("format(",k);0<r&&(h=c(b[n].substring(r+7,b[n].indexOf(")",r))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==h||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==h||"embedded-opentype"==h||/(\.otf)($|\?)/i.test(a))c= +"application/x-font-opentype";else if("woff"==h||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==h||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==h||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==h||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;l()}),mxUtils.bind(this, +function(a){d--;l()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[n].substring(0,k)),h)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,h,l,n,k,m,r,p,q,v,G){l=null!=l?l:!0;q=null!=q?q:this.editor.graph;v=null!=v?v:0;var c=m?null:q.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==m&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(q.getSvg(c,null,null,G,null,null!=n?n:!0),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this, +function(){try{var f=document.createElement("canvas"),g=parseInt(d.getAttribute("width")),n=parseInt(d.getAttribute("height"));k=null!=k?k:1;null!=b&&(k=l?Math.min(1,Math.min(3*b/(4*n),b/g)):b/g);g=Math.ceil(k*g)+2*v;n=Math.ceil(k*n)+2*v;f.setAttribute("width",g);f.setAttribute("height",n);var r=f.getContext("2d");null!=c&&(r.beginPath(),r.rect(0,0,g,n),r.fillStyle=c,r.fill());r.scale(k,k);mxClient.IS_SF?window.setTimeout(function(){r.drawImage(e,v/k,v/k);a(f)},0):(r.drawImage(e,v/k,v/k),a(f))}catch(R){null!= +h&&h(R)}});e.onerror=function(a){null!=h&&h(a)};try{r&&this.editor.graph.addSvgShadow(d);var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(q,d,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(B){null!=h&&h(B)}}),d,p)};EditorUi.prototype.createImageUrlConverter= function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,d=this;a.convert=function(c){if(null!=c){var e="http://"==c.substring(0,7)||"https://"==c.substring(0,8);e&&!navigator.onLine?c=d.svgBrokenImage.src:!e||c.substring(0,a.baseUrl.length)==a.baseUrl||d.crossOriginImages&&d.isCorsEnabledForUrl(c)?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null== -e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var h=a.getElementsByTagName(d),l=0;l<h.length;l++)mxUtils.bind(this,function(d){var h=e.convert(d.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var l=f[h];null==l?(c++,this.convertImageToDataUri(h,function(e){null!=e&&(f[h]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,l)}else null!=h&&d.setAttribute(g,h)})(h[l])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl= -function(a,b,d,e,k,h){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]= -String.fromCharCode(a[f]);e=e.join("")}h=null!=h?h:"data:image/png;base64,";e=h+this.base64Encode(e)}b(e)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){k&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(w){null!=d&&d(w)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)|| +e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var n=a.getElementsByTagName(d),k=0;k<n.length;k++)mxUtils.bind(this,function(d){var n=e.convert(d.getAttribute(g));if(null!=n&&"data:"!=n.substring(0,5)){var k=f[n];null==k?(c++,this.convertImageToDataUri(n,function(e){null!=e&&(f[n]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,k)}else null!=n&&d.setAttribute(g,n)})(n[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl= +function(a,b,d,e,h,l){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);h=null!=h?h:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]= +String.fromCharCode(a[f]);e=e.join("")}l=null!=l?l:"data:image/png;base64,";e=l+this.base64Encode(e)}b(e)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){h&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(w){null!=d&&d(w)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)|| "https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image, -d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d");a.height=c.height;a.width=c.width;e.drawImage(c,0,0);try{b(a.toDataURL())}catch(n){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,k){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),m=this.editor.extractGraphModel(g.documentElement, +d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d");a.height=c.height;a.width=c.width;e.drawImage(c,0,0);try{b(a.toDataURL())}catch(n){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,h){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),m=this.editor.extractGraphModel(g.documentElement, null!=this.pages);if(null!=m&&"mxfile"==m.nodeName&&null!=this.pages){var r=m.getElementsByTagName("diagram");if(1==r.length)m=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(r[0]))).documentElement;else if(1<r.length){f.model.beginUpdate();try{for(a=0;a<r.length;a++){var u=this.updatePageRoot(new DiagramPage(r[a])),t=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[t+1]));f.model.execute(new ChangePage(this,u,u,t))}}finally{f.model.endUpdate()}}}null!=m&&"mxGraphModel"=== -m.nodeName&&(c=f.importGraphModel(m,b,d,e))}}catch(z){throw k||this.handleError(z,mxResources.get("invalidOrMissingFile")),z;}return c};EditorUi.prototype.importVisio=function(a,b,d,e){e=null!=e?e:a.name;d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(e)&&null!=VSD_CONVERT_URL){var c=new FormData;c.append("file1",a,e);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);f.responseType= -"blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response,b,d)}catch(l){d(l)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d)}catch(l){d(l)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}}); -"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,d,e,k){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,k)}catch(n){this.handleError(n)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev? -mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,k){k=JSON.parse(a);a=[];if(null!=k.state){k=JSON.parse(k.state);for(var c in k.Pages)a.push(k.Pages[c]);a.sort(function(a,c){return a.Properties.Order<c.Properties.Order?-1:a.Properties.Order>c.Properties.Order?1:0})}else a.push(k);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage; -for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,d,e,k,h,n){h=null!=h?h:!0;n=null!=n?n:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText, -b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+ -1)),g=this.importXml(f,b,d,h,!0),0<g.length)return g}catch(y){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),n,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/ +m.nodeName&&(c=f.importGraphModel(m,b,d,e))}}catch(z){throw h||this.handleError(z,mxResources.get("invalidOrMissingFile")),z;}return c};EditorUi.prototype.importVisio=function(a,b,d,e){e=null!=e?e:a.name;d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(e)&&null!=VSD_CONVERT_URL){var c=new FormData;c.append("file1",a,e);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);f.responseType= +"blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response,b,d)}catch(k){d(k)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d)}catch(k){d(k)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}}); +"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,d,e,h){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,h)}catch(n){this.handleError(n)}finally{null!=h&&h()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev? +mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,h){h=JSON.parse(a);a=[];if(null!=h.state){h=JSON.parse(h.state);for(var c in h.Pages)a.push(h.Pages[c]);a.sort(function(a,c){return a.Properties.Order<c.Properties.Order?-1:a.Properties.Order>c.Properties.Order?1:0})}else a.push(h);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage; +for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,d,e,h,l,n){l=null!=l?l:!0;n=null!=n?n:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText, +b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(h||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,l,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+ +1)),g=this.importXml(f,b,d,l,!0),0<g.length)return g}catch(y){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),n,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/ e.height)),g=Math.round(e.width*f);e=Math.round(e.height*f);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),g,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells", -[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,h);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,h);else{c=this.editor.graph;k=null;c.getModel().beginUpdate();try{k=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value= -a,c.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(k.value)&&c.setLinkForCell(k,k.value),k.geometry.width+=c.gridSize,k.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[k]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1;do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+ -" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input"); -c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,c){if(null!=c&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(c)){var b=new Blob([a],{type:"application/octet-stream"}); -this.importVisio(b,mxUtils.bind(this,function(a){this.importXml(a)}),null,c)}else this.editor.graph.setSelectionCells(this.importXml(a))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,d,e,k,h,n,l,m,r, -p){r=null!=r?r:!0;var c=!1,f=null,g=mxUtils.bind(this,function(a){var c=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,n)):c=this.importXml(a,d,e,r);null!=l&&l(c)});"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=p?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,r),m=!0)),m||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),r&&f.isGridEnabled()&&(d=f.snap(d),e= -f.snap(e)),f=[f.insertVertex(null,null,"",d,e,k,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,r);null!=l&&l(a)})):null!=m&&null!=n&&(/(\.vsdx?)($|\?)/i.test(n)||/(\.vssx)($|\?)/i.test(n))?(c=!0,this.importVisio(m,g)):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(a,n)?(c=!0,this.parseFile(null!=m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=l&&l(null))}),n)):/(\.vsd)($|\?)/i.test(n)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,r));c||null==l||l(f);return f};EditorUi.prototype.base64Encode=function(a){for(var c="",b=0,d=a.length,e,h,n;b<d;){e=a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);c+="==";break}h=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);c+="=";break}n=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(n&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n&63)}return c};EditorUi.prototype.importFiles=function(a,b,d,e,k,h,n,l,m,r,p,q){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&& -null!=a)for(var u=p||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>u){g=!0;break}var v=mxUtils.bind(this,function(){var g=this.editor.graph,m=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,d,e,f,g,h,l,n){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,d,e,f,g,h,l,n,c,q)});h=null!=h?h:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body, -mxResources.get("loading")))for(var u=a.length,t=u,v=[],y=mxUtils.bind(this,function(a,c){v[a]=c;if(0==--t){this.spinner.stop();if(null!=l)l(v);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<v.length;d++){var e=v[d]();null!=e&&(b=b.concat(e))}}finally{g.getModel().endUpdate()}}h(b)}}),x=0;x<u;x++)mxUtils.bind(this,function(c){var h=a[c],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==n||n(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var l= -a.target.result,u=l.indexOf(","),t=decodeURIComponent(escape(atob(l.substring(u+1)))),B=mxUtils.parseXml(t),t=B.getElementsByTagName("svg");if(0<t.length){var t=t[0],v=q?null:t.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?y(c,mxUtils.bind(this,function(){try{if(l.substring(0,u+1),null!=B){var a= -B.getElementsByTagName("svg");if(0<a.length){var n=a[0],r=parseFloat(n.getAttribute("width")),t=parseFloat(n.getAttribute("height")),p=n.getAttribute("viewBox");if(null==p||0==p.length)n.setAttribute("viewBox","0 0 "+r+" "+t);else if(isNaN(r)||isNaN(t)){var q=p.split(" ");3<q.length&&(r=parseFloat(q[2]),t=parseFloat(q[3]))}l=this.createSvgDataUri(mxUtils.getXml(n));var v=Math.min(1,Math.min(e/Math.max(1,r)),e/Math.max(1,t)),C=k(l,h.type,b+c*m,d+c*m,Math.max(1,Math.round(r*v)),Math.max(1,Math.round(t* -v)),h.name,f);if(isNaN(r)||isNaN(t)){var y=new Image;y.onload=mxUtils.bind(this,function(){r=Math.max(1,y.width);t=Math.max(1,y.height);C[0].geometry.width=r;C[0].geometry.height=t;n.setAttribute("viewBox","0 0 "+r+" "+t);l=this.createSvgDataUri(mxUtils.getXml(n));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));g.setCellStyles("image",l,[C[0]])});y.src=this.createSvgDataUri(mxUtils.getXml(n))}return C}}}catch(ea){}return null})):y(c,mxUtils.bind(this,function(){return k(v, -"text/xml",b+c*m,d+c*m,0,0,h.name)}))}}else{t=!1;if("image/png"==h.type){var C=q?null:this.extractGraphModelFromPng(a.target.result);if(null!=C&&0<C.length){var x=new Image;x.src=a.target.result;y(c,mxUtils.bind(this,function(){return k(C,"text/xml",b+c*m,d+c*m,x.width,x.height,h.name)}));t=!0}}t||(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(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,l,n){y(c,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var u=f&&this.isResampleImage(a.target.result,p)?Math.min(1,Math.min(e/l,e/n)):1;return k(g,h.type,b+c*m,d+c*m,Math.round(l*u),Math.round(n*u),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,p)}),mxUtils.bind(this, -function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,h.type,b+c*m,d+c*m,240,160,h.name,function(a){y(c,function(){return a})})});/(\.vsdx?)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)?k(null,h.type,b+c*m,d+c*m,240,160,h.name,function(a){y(c,function(){return a})},h):"image"==h.type.substring(0,5)?l.readAsDataURL(h):l.readAsText(h)})(x)});g?this.confirmImageResize(function(a){f=a;v()},m):v()};EditorUi.prototype.confirmImageResize=function(a, -b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!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?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length> -b};EditorUi.prototype.resizeImage=function(a,b,d,e,k,h){k=null!=k?k:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,h))try{var g=Math.max(c/k,f/k);if(1<g){var r=Math.round(c/g),m=Math.round(f/g),u=document.createElement("canvas");u.width=r;u.height=m;u.getContext("2d").drawImage(a,0,0,r,m);var t=u.toDataURL();if(t.length<b.length){var p=document.createElement("canvas");p.width=r;p.height=m;var q=p.toDataURL();t!==q&&(b=t,c=r,f=m)}}}catch(x){}d(b,c,f)}; -EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var b=e,k=0;8>k;k++)b=1==(b&1)?3988292384^b>>>1:b>>>1,EditorUi.prototype.crcTable[e]=b;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c=c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a, -b,d,e,k){function c(a,c){var b=m;m+=c;return a.substring(b,m)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var m=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(c(a,4),"IHDR"!=c(a,4))null!=k&&k();else{c(a,17);k=a.substring(0,m);do{var r= -f(a);if("IDAT"==c(a,4)){k=a.substring(0,m-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);k+=g(d.length)+b+d+g(e^4294967295);k+=a.substring(m-8,a.length);break}k+=a.substring(m-8,m-4+r);c(a,r);c(a,4)}while(r);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var c=null;try{var b=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF? -atob(b):Base64.decode(b,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,b,e){a=d.substring(a+8,a+8+e);"zTXt"==b?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(c=a))):"tEXt"==b&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(c=a[1]));if(null!=c||"IDAT"==b)return!0}))}catch(t){}null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));null!=c&& -"%"==c.charAt(0)&&(c=decodeURIComponent(c));return c};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var m=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(c){return a.getLinkTitle(c)};b.customLinkClicked=function(c){try{a.handleCustomLink(c)}catch(H){a.handleError(H)}};this.isOffline()|| -"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(c){c=null!=c?c:"";if(null!=a.pages&&null!=a.currentPage)for(var b=0;b<a.pages.length;b++)if(a.pages[b]==a.currentPage){0<b&&(c+=(0<c.length?"&":"?")+"page="+b);break}"1"==urlParams.dev&&(c+=(0<c.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=b.addClickHandler;b.addClickHandler= -function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null==c||!b.isCustomLink(c)||!mxEvent.isTouchEvent(a)&&mxEvent.isPopupTrigger(a)||(b.customLinkClicked(c),mxEvent.consume(a));null!=f&&f(a,c)};e.call(this,a,c,d)};m.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!= -a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var k=b.getGlobalVariable;b.getGlobalVariable=function(c){return"page"==c&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==c?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:k.apply(this,arguments)};var h=b.createLinkForHint;b.createLinkForHint=function(a,c){null!=a&&b.isCustomLink(a)&&(c=b.getLinkTitle(a));var d=h.call(this,a,c);null!=a&&b.isCustomLink(a)&&mxEvent.addListener(d, -"click",function(c){b.customLinkClicked(a);mxEvent.consume(c)});return d};var n=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var e=c.getAttribute("href");if(null==e||!b.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))n.apply(this,arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(e),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var c=a.defaultFilename,b=a.getCurrentFile();null!=b&&(c=null!= -b.getTitle()?b.getTitle():c);return c};var l=this.actions.get("print");l.setEnabled(!mxClient.IS_IOS||!navigator.standalone);l.visible=l.isEnabled();if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){r.innerHTML=" ";r.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry", -!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var c=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var b=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<b.types.length;e++)if("text/"===b.types[e].substring(0,5)){d=!0;break}if(!d){var f=b.items;for(index in f){var g=f[index];if("file"===g.kind){if(c.isEditing())this.importFiles([g.getAsFile()], -0,0,this.maxImageSize,function(a,b,d,e,f,g){c.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(aa){}}),!1);var r=document.createElement("div");r.style.position="absolute";r.style.whiteSpace="nowrap";r.style.overflow="hidden";r.style.display="block";r.contentEditable=!0;mxUtils.setOpacity(r, -0);r.style.width="1px";r.style.height="1px";r.innerHTML=" ";var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)|| -q||(r.style.left=b.container.scrollLeft+10+"px",r.style.top=b.container.scrollTop+10+"px",b.container.appendChild(r),q=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){r.focus();document.execCommand("selectAll",!1,null)},0):(r.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=c&&17!=c&&91!=c||(q=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(), -r.parentNode.removeChild(r),mxUtils.clearSelection())}),0)}));mxEvent.addListener(r,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(r),p())}));mxEvent.addListener(r,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(this.copyCells(r,!0),p())}));mxEvent.addListener(r,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(r.innerHTML=" ",r.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,r);r.innerHTML= -" "}),0))}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==r?!0:v.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var c=this.editor.graph,b=c.cellEditor.text2,d=null;null!=b&&(mxEvent.addListener(b,"dragleave",function(a){null!= -d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(b));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,b,d,e,f,g){c.insertImage(a, -f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var b=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b)?this.loadImage(decodeURIComponent(b),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));c.insertImage(decodeURIComponent(b), -d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){l=document.createElement("div");l.style.position="absolute"; -l.style.top="95px";l.style.left="250px";l.style.width="2000px";l.style.height="30px";l.style.background="whiteSmoke";document.body.appendChild(l);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px";z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z);var G=document.createElement("div");G.style.position="absolute";G.style.top="95px";G.style.left="220px";G.style.width="30px";G.style.height="30px"; -G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,l,!1)}if("1"==urlParams.test){l=document.getElementById("geFooter");null!=l&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden", -this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),l.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,c){if(0<this.editor.graph.getSelectionCount()){var b=this.editor.graph.getSelectionCell(),b=this.editor.graph.getModel().getStyle(b);this.styleInput.value=b||"";this.styleInput.style.visibility= -"visible"}else this.styleInput.style.visibility="hidden"})));var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:E.apply(this,arguments)}}l=document.getElementById("geInfo");null!=l&&l.parentNode.removeChild(l);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var x=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=x&&(x.parentNode.removeChild(x),x=null),a.stopPropagation(),a.preventDefault())}); -mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==x&&(!mxClient.IS_IE||10<document.documentMode)&&(x=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=x&&(x.parentNode.removeChild(x),x=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale, -f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l= -a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var n=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(n=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var k=!0,r=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(l,f,g,!0,n,null,k))});n&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){k=a;r()},mxEvent.isControlDown(a)): -r()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(h, -f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var c=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");0<b&&(c=this.getPageById(a.substring(b+1)),c=null!=c? -c.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(c=mxResources.get("action"));return c};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");(a=this.getPageById(a.substring(c+1)))&&this.selectPage(a)}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors= -mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()); -this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged", -mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(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.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d, -!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS|| -8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var n=e.lastIndexOf("%3E");0<=n&&n<e.length-3&&(e=e.substring(0,n+3))}catch(w){}try{var c=b.getElementsByTagName("span"),l=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(l)&&(f=!0,e=l)}catch(w){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e, -c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(w){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var c=null,b=0;b<a.length;b++)mxEvent.addListener(a[b],"dragleave", -function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[b],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==c&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(c=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[b],"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(this.editor.graph.isEnabled()|| -"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var b=this.extractGraphModelFromEvent(a);if(null==b){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?b=d.getData("Text"):(b=null,b=0<=mxUtils.indexOf(d.types, -"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=b&&0<b.length?(d=document.createElement("div"),d.innerHTML=b,d=d.getElementsByTagName("img"),0<d.length&&(b=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(b=d.getData("text/plain"))),null!=b&&("data:image/png;base64,"==b.substring(0,22)?(b=this.extractGraphModelFromPng(b),null!=b&&0<b.length&&this.openLocalFile(b,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(b)? -(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(b))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(b)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))))}else this.openLocalFile(b,null,!0)}a.stopPropagation();a.preventDefault()}))}; -EditorUi.prototype.highlightElement=function(a){var c=0,b=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else c=a.offsetTop,b=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=c+"px";h.style.left=b+"px";h.style.width= -Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var c=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=c){var b=new mxCodec(c.ownerDocument),d=new mxGraphModel;b.decode(c,d);c=d.getChildAt(d.getRoot(),0);for(b=0;b<d.getChildCount(c);b++)a.push(d.getChildAt(c,b))}return a};EditorUi.prototype.openFiles= -function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&& -"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx?)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this, -function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()})); -else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop(); -this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c=mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a, -b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"), -null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],d;for(d in a)b.push(d);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1, -a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=d.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(d.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility= -a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1), -null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&& -this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=d?d:!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(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var c=this.editor.graph;return{event:a,pageVisible:c.pageVisible,translate:c.view.translate,scale:c.view.scale,page:c.view.getBackgroundPageBounds(),bounds:c.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var c=null,b=!1,d=!1,e=null,h=mxUtils.bind(this,function(a, -c){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&& -(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(C){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&& -(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml); -this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog(); -k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(C){k.postMessage(JSON.stringify({event:"draft",error:C.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();var l=1==h.enableRecent,n=1==h.enableSearch,l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(c,b){c=c||this.emptyDiagramXml;null!=h.callback? -k.postMessage(JSON.stringify({event:"template",xml:c,blank:c==this.emptyDiagramXml,name:b}),"*"):(a(c,f,c!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,n?mxUtils.bind(this,function(a,c){this.searchReadyCallback=c;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,c,b){k.postMessage(JSON.stringify({event:"template", -docUrl:a,info:c,name:b}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list,h.errorMsg);else{if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message)); -null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var p=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph, -u=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var c=this.createLoadMessage("export");c.format=h.format;c.message=h;c.data=a;c.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(c),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);u(a)});if(this.isExportToCanvas()){if(null!= -this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),v=q.getGlobalVariable,B=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?B.getName():"pagenumber"==a?1:v.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+ -("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?u("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data= -this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)p=this.editor.getGraphXml(),m.data=this.getHtml(p,this.editor.graph),m.xml=mxUtils.getXml(p),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1), -"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0), -this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight= -"12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage", -data:JSON.stringify(h)}),"*");return}}}h=g(h);b=!0;try{a(h,f)}catch(C){this.handleError(C)}b=!1;null!=urlParams.modified&&this.editor.setStatus("");var N=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=N();d&&null==c&&(c=mxUtils.bind(this,function(a,c){var d=N();if(d!=e&&!b){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d, -"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,c),this.editor.graph.addListener("gridSizeChanged",c),this.editor.graph.addListener("shadowVisibleChanged",c),this.addListener("pageFormatChanged",c),this.addListener("pageScaleChanged",c),this.addListener("backgroundColorChanged",c),this.addListener("backgroundImageChanged",c),this.addListener("foldingEnabledChanged",c),this.addListener("mathEnabledChanged",c),this.addListener("gridEnabledChanged",c),this.addListener("guidesEnabledChanged", -c),this.addListener("pageViewChanged",c));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme? -"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"), -mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight= -"20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}), -null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,k=null,l="",m="auto",p="auto",q=null,v=null,z=40,G=40,E=0,x=this.editor.graph;x.getGraphBounds();for(var J=function(){null!=b?b(Z):(x.setSelectionCells(Z),x.scrollCellToVisible(x.getSelectionCell()))},H=x.getFreeInsertPoint(),B=H.x,N=H.y,H=N,C=null,I= -"auto",R=[],Y=null,aa=null,Q=0;Q<c.length&&"#"==c[Q].charAt(0);){a=c[Q];for(Q++;Q<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Q].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[Q].substring(1)),Q++;if("#"!=a.charAt(1)){var S=a.indexOf(":");if(0<S){var K=mxUtils.trim(a.substring(1,S)),F=mxUtils.trim(a.substring(S+1));"label"==K?C=x.sanitizeHtml(F):"style"==K?f=F:"identity"==K&&0<F.length&&"-"!=F?k=F:"namespace"==K&&0<F.length&&"-"!=F?l=F:"width"==K?m=F:"height"==K?p=F:"left"==K&&0<F.length? -q=F:"top"==K&&0<F.length?v=F:"ignore"==K?aa=F.split(","):"connect"==K?R.push(JSON.parse(F)):"link"==K?Y=F:"padding"==K?E=parseFloat(F):"edgespacing"==K?z=parseFloat(F):"nodespacing"==K?G=parseFloat(F):"layout"==K&&(I=F)}}}var V=this.editor.csvToArray(c[Q]),S=null;if(null!=k)for(var L=0;L<V.length;L++)if(k==V[L]){S=L;break}null==C&&(C="%"+V[0]+"%");if(null!=R)for(var O=0;O<R.length;O++)null==e[R[O].to]&&(e[R[O].to]={});x.model.beginUpdate();try{for(L=Q+1;L<c.length;L++){var X=this.editor.csvToArray(c[L]); -if(X.length==V.length){var A=null,W=null!=S?l+X[S]:null;null!=W&&(A=x.model.getCell(W));null==A&&(A=new mxCell(C,new mxGeometry(B,H,0,0),f||"whiteSpace=wrap;html=1;"),A.vertex=!0,A.id=W);for(var P=0;P<X.length;P++)x.setAttributeForCell(A,V[P],X[P]);x.setAttributeForCell(A,"placeholders","1");A.style=x.replacePlaceholders(A,A.style);for(O=0;O<R.length;O++)e[R[O].to][A.getAttribute(R[O].to)]=A;null!=Y&&"link"!=Y&&(x.setLinkForCell(A,A.getAttribute(Y)),x.setAttributeForCell(A,Y,null));x.fireEvent(new mxEventObject("cellsInserted", -"cells",[A]));var da=this.editor.graph.getPreferredSizeForCell(A);A.vertex&&(null!=q&&null!=A.getAttribute(q)&&(A.geometry.x=B+parseFloat(A.getAttribute(q))),null!=v&&null!=A.getAttribute(v)&&(A.geometry.y=N+parseFloat(A.getAttribute(v))),"@"==m.charAt(0)&&null!=A.getAttribute(m.substring(1))?A.geometry.width=parseFloat(A.getAttribute(m.substring(1))):A.geometry.width="auto"==m?da.width+E:parseFloat(m),"@"==p.charAt(0)&&null!=A.getAttribute(p.substring(1))?A.geometry.height=parseFloat(A.getAttribute(p.substring(1))): -A.geometry.height="auto"==p?da.height+E:parseFloat(p),H+=A.geometry.height+G);d.push(x.addCell(A))}}for(var T=d.slice(),Z=d.slice(),O=0;O<R.length;O++)for(var U=R[O],L=0;L<d.length;L++){var A=d[L],ma=A.getAttribute(U.from);if(null!=ma){x.setAttributeForCell(A,U.from,null);for(var na=ma.split(","),P=0;P<na.length;P++){var ca=e[U.to][na[P]];null!=ca&&(C=U.label,null!=U.fromlabel&&(C=(A.getAttribute(U.fromlabel)||"")+(C||"")),null!=U.tolabel&&(C=(C||"")+(ca.getAttribute(U.tolabel)||"")),Z.push(x.insertEdge(null, -null,C||"",U.invert?ca:A,U.invert?A:ca,U.style||x.createCurrentEdgeStyle())),mxUtils.remove(U.invert?A:ca,T))}}}if(null!=aa)for(L=0;L<d.length;L++)for(A=d[L],P=0;P<aa.length;P++)x.setAttributeForCell(A,mxUtils.trim(aa[P]),null);var ia=new mxParallelEdgeLayout(x);ia.spacing=z;var qa=function(){ia.execute(x.getDefaultParent());for(var a=0;a<d.length;a++){var b=x.getCellGeometry(d[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==m&&(b.width=Math.round(x.snap(b.width)));"auto"==p&& -(b.height=Math.round(x.snap(b.height)))}};if("circle"==I){var ea=new mxCircleLayout(x);ea.resetEdges=!1;var ra=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ea.execute(x.getDefaultParent());qa()},!0,J);J=null}else if("horizontaltree"==I||"verticaltree"==I||"auto"==I&&Z.length==2*d.length-1&&1==T.length){x.view.validate();var fa=new mxCompactTreeLayout(x,"horizontaltree"==I);fa.levelDistance=G;fa.edgeRouting= -!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(),0<T.length?T[0]:null)},!0,J);J=null}else if("horizontalflow"==I||"verticalflow"==I||"auto"==I&&1==T.length){x.view.validate();var ja=new mxHierarchicalLayout(x,"horizontalflow"==I?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=G;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(x.getDefaultParent(),Z);x.moveCells(Z,B,N)},!0,J);J=null}else if("organic"==I||"auto"==I&&Z.length> -d.length){x.view.validate();var ba=new mxFastOrganicLayout(x);ba.forceConstant=3*G;ba.resetEdges=!1;var ka=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return ka.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ia=new mxParallelEdgeLayout(x);ia.spacing=z;this.executeLayout(function(){ba.execute(x.getDefaultParent());qa()},!0,J);J=null}this.hideDialog()}finally{x.model.endUpdate()}null!=J&&J()}}catch(ga){this.handleError(ga)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&& -"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c, -d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var p=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=p.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a= -this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2* -a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a, -8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= +[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,l);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,l);else{c=this.editor.graph;h=null;c.getModel().beginUpdate();try{h=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[h])),"<"==a.charAt(0)&& +a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),h.value=a,c.updateCellSize(h),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(h.value)&&c.setLinkForCell(h,h.value),h.geometry.width+=c.gridSize,h.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[h]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1; +do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11|| +0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a, +c){if(null!=c&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(c)){var b=new Blob([a],{type:"application/octet-stream"});this.importVisio(b,mxUtils.bind(this,function(a){this.importXml(a)}),null,c)}else this.editor.graph.setSelectionCells(this.importXml(a))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(e,arguments);a&&null==this.getCurrentFile()&& +"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,d,e,h,l,n,k,m,r,p){r=null!=r?r:!0;var c=!1,f=null,g=mxUtils.bind(this,function(a){var c=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,n)):c=this.importXml(a,d,e,r);null!=k&&k(c)});"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=p?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,r),m=!0)),m||(f=this.editor.graph,b=a.indexOf(";"), +0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),r&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,h,l,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,r);null!=k&&k(a)})):null!=m&&null!=n&&(/(\.vsdx?)($|\?)/i.test(n)||/(\.vssx)($|\?)/i.test(n))? +(c=!0,this.importVisio(m,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,n)?(c=!0,this.parseFile(null!=m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=k&&k(null))}),n)):/(\.vsd)($|\?)/i.test(n)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,r));c||null==k||k(f);return f};EditorUi.prototype.base64Encode=function(a){for(var c="",b=0,d=a.length,e,l,n;b<d;){e= +a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);c+="==";break}l=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(l&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l& +15)<<2);c+="=";break}n=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(l&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l&15)<<2|(n&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n&63)}return c};EditorUi.prototype.importFiles=function(a,b,d,e,h,l,n,k,m,r,p,q){b=null!=b?b:0;d=null!= +d?d:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var u=p||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>u){g=!0;break}var v=mxUtils.bind(this,function(){var g=this.editor.graph,m=g.gridSize;h=null!=h?h:mxUtils.bind(this,function(a,b,d,e,f,g,n,k,l){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,n)),null): +this.importFile(a,b,d,e,f,g,n,k,l,c,q)});l=null!=l?l:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var u=a.length,t=u,v=[],y=mxUtils.bind(this,function(a,c){v[a]=c;if(0==--t){this.spinner.stop();if(null!=k)k(v);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<v.length;d++){var e=v[d]();null!=e&&(b=b.concat(e))}}finally{g.getModel().endUpdate()}}l(b)}}),x=0;x<u;x++)mxUtils.bind(this,function(c){var k=a[c],l=new FileReader; +l.onload=mxUtils.bind(this,function(a){if(null==n||n(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var l=a.target.result,u=l.indexOf(","),t=decodeURIComponent(escape(atob(l.substring(u+1)))),B=mxUtils.parseXml(t),t=B.getElementsByTagName("svg");if(0<t.length){var t=t[0],v=q?null:t.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&(v=decodeURIComponent(v));null==v||"<mxfile "!== +v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?y(c,mxUtils.bind(this,function(){try{if(l.substring(0,u+1),null!=B){var a=B.getElementsByTagName("svg");if(0<a.length){var n=a[0],r=parseFloat(n.getAttribute("width")),t=parseFloat(n.getAttribute("height")),p=n.getAttribute("viewBox");if(null==p||0==p.length)n.setAttribute("viewBox","0 0 "+r+" "+t);else if(isNaN(r)||isNaN(t)){var q=p.split(" ");3<q.length&&(r=parseFloat(q[2]),t=parseFloat(q[3]))}l=this.createSvgDataUri(mxUtils.getXml(n));var v= +Math.min(1,Math.min(e/Math.max(1,r)),e/Math.max(1,t)),C=h(l,k.type,b+c*m,d+c*m,Math.max(1,Math.round(r*v)),Math.max(1,Math.round(t*v)),k.name,f);if(isNaN(r)||isNaN(t)){var y=new Image;y.onload=mxUtils.bind(this,function(){r=Math.max(1,y.width);t=Math.max(1,y.height);C[0].geometry.width=r;C[0].geometry.height=t;n.setAttribute("viewBox","0 0 "+r+" "+t);l=this.createSvgDataUri(mxUtils.getXml(n));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));g.setCellStyles("image",l, +[C[0]])});y.src=this.createSvgDataUri(mxUtils.getXml(n))}return C}}}catch(ea){}return null})):y(c,mxUtils.bind(this,function(){return h(v,"text/xml",b+c*m,d+c*m,0,0,k.name)}))}}else{t=!1;if("image/png"==k.type){var C=q?null:this.extractGraphModelFromPng(a.target.result);if(null!=C&&0<C.length){var x=new Image;x.src=a.target.result;y(c,mxUtils.bind(this,function(){return h(C,"text/xml",b+c*m,d+c*m,x.width,x.height,k.name)}));t=!0}}t||(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(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,n,l){y(c,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var u=f&&this.isResampleImage(a.target.result,p)?Math.min(1,Math.min(e/n,e/l)):1;return h(g,k.type,b+c*m,d+c*m,Math.round(n* +u),Math.round(l*u),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,p)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else h(a.target.result,k.type,b+c*m,d+c*m,240,160,k.name,function(a){y(c,function(){return a})})});/(\.vsdx?)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name)?h(null,k.type,b+c*m,d+c*m,240,160,k.name,function(a){y(c,function(){return a})},k):"image"==k.type.substring(0,5)?l.readAsDataURL(k): +l.readAsText(k)})(x)});g?this.confirmImageResize(function(a){f=a;v()},m):v()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)}, +function(a){e(a,!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?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange= +function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,h,l){h=null!=h?h:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,l))try{var g=Math.max(c/h,f/h);if(1<g){var r=Math.round(c/g),m=Math.round(f/g),u=document.createElement("canvas");u.width=r;u.height=m;u.getContext("2d").drawImage(a,0,0,r,m);var t=u.toDataURL();if(t.length<b.length){var p= +document.createElement("canvas");p.width=r;p.height=m;var q=p.toDataURL();t!==q&&(b=t,c=r,f=m)}}}catch(x){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var b=e,h=0;8>h;h++)b=1==(b&1)?3988292384^b>>>1:b>>>1,EditorUi.prototype.crcTable[e]=b;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c= +c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,h){function c(a,c){var b=m;m+=c;return a.substring(b,m)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var m=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13, +10,26,10))null!=h&&h();else if(c(a,4),"IHDR"!=c(a,4))null!=h&&h();else{c(a,17);h=a.substring(0,m);do{var r=f(a);if("IDAT"==c(a,4)){h=a.substring(0,m-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);h+=g(d.length)+b+d+g(e^4294967295);h+=a.substring(m-8,a.length);break}h+=a.substring(m-8,m-4+r);c(a,r);c(a,4)}while(r);return"data:image/png;base64,"+(window.btoa?btoa(h):Base64.encode(h,!0))}};EditorUi.prototype.extractGraphModelFromPng= +function(a){var c=null;try{var b=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(b):Base64.decode(b,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,b,e){a=d.substring(a+8,a+8+e);"zTXt"==b?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(c=a))):"tEXt"==b&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(c=a[1]));if(null!=c|| +"IDAT"==b)return!0}))}catch(t){}null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));return c};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var m=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(c){return a.getLinkTitle(c)}; +b.customLinkClicked=function(c){try{a.handleCustomLink(c)}catch(H){a.handleError(H)}};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(c){c=null!=c?c:"";if(null!=a.pages&&null!=a.currentPage)for(var b=0;b<a.pages.length;b++)if(a.pages[b]==a.currentPage){0<b&&(c+=(0<c.length?"&":"?")+"page="+b);break}"1"==urlParams.dev&& +(c+=(0<c.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null==c||!b.isCustomLink(c)||!mxEvent.isTouchEvent(a)&&mxEvent.isPopupTrigger(a)||(b.customLinkClicked(c),mxEvent.consume(a));null!=f&&f(a,c)};e.call(this,a,c,d)};m.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement, +null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=b.getGlobalVariable;b.getGlobalVariable=function(c){return"page"==c&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==c?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:h.apply(this,arguments)};var l=b.createLinkForHint;b.createLinkForHint=function(a,c){null!= +a&&b.isCustomLink(a)&&(c=b.getLinkTitle(a));var d=l.call(this,a,c);null!=a&&b.isCustomLink(a)&&mxEvent.addListener(d,"click",function(c){b.customLinkClicked(a);mxEvent.consume(c)});return d};var n=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var e=c.getAttribute("href");if(null==e||!b.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))n.apply(this,arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(e),b.getRubberband().reset();mxEvent.consume(d)}}; +this.editor.getOrCreateFilename=function(){var c=a.defaultFilename,b=a.getCurrentFile();null!=b&&(c=null!=b.getTitle()?b.getTitle():c);return c};var k=this.actions.get("print");k.setEnabled(!mxClient.IS_IOS||!navigator.standalone);k.visible=k.isEnabled();if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){r.innerHTML=" ";r.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0, +"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var c=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var b=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<b.types.length;e++)if("text/"=== +b.types[e].substring(0,5)){d=!0;break}if(!d){var f=b.items;for(index in f){var g=f[index];if("file"===g.kind){if(c.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,b,d,e,f,g){c.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()});else{var n=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],n.x,n.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(aa){}}),!1);var r=document.createElement("div"); +r.style.position="absolute";r.style.whiteSpace="nowrap";r.style.overflow="hidden";r.style.display="block";r.contentEditable=!0;mxUtils.setOpacity(r,0);r.style.width="1px";r.style.height="1px";r.innerHTML=" ";var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()|| +null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||q||(r.style.left=b.container.scrollLeft+10+"px",r.style.top=b.container.scrollTop+10+"px",b.container.appendChild(r),q=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){r.focus();document.execCommand("selectAll",!1,null)},0):(r.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c= +a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=c&&17!=c&&91!=c||(q=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),r.parentNode.removeChild(r),mxUtils.clearSelection())}),0)}));mxEvent.addListener(r,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(r),p())}));mxEvent.addListener(r,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(this.copyCells(r,!0),p())}));mxEvent.addListener(r,"paste",mxUtils.bind(this,function(a){b.isEnabled()&& +!b.isCellLocked(b.getDefaultParent())&&(r.innerHTML=" ",r.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,r);r.innerHTML=" "}),0))}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==r?!0:v.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED, +mxUtils.bind(this,function(a){var c=this.editor.graph,b=c.cellEditor.text2,d=null;null!=b&&(mxEvent.addListener(b,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(b));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d), +d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,b,d,e,f,g){c.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var b=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b)?this.loadImage(decodeURIComponent(b),mxUtils.bind(this,function(a){var d= +Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));c.insertImage(decodeURIComponent(b),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain")); +a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){k=document.createElement("div");k.style.position="absolute";k.style.top="95px";k.style.left="250px";k.style.width="2000px";k.style.height="30px";k.style.background="whiteSmoke";document.body.appendChild(k);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px";z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z); +var G=document.createElement("div");G.style.position="absolute";G.style.top="95px";G.style.left="220px";G.style.width="30px";G.style.height="30px";G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,k,!1)}if("1"==urlParams.test){k=document.getElementById("geFooter");null!=k&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute", +this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),k.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,c){if(0<this.editor.graph.getSelectionCount()){var b= +this.editor.graph.getSelectionCell(),b=this.editor.graph.getModel().getStyle(b);this.styleInput.value=b||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:E.apply(this,arguments)}}k=document.getElementById("geInfo");null!=k&&k.parentNode.removeChild(k);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var x=null;mxEvent.addListener(b.container, +"dragleave",function(a){b.isEnabled()&&(null!=x&&(x.parentNode.removeChild(x),x=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==x&&(!mxClient.IS_IE||10<document.documentMode)&&(x=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=x&&(x.parentNode.removeChild(x),x=null);if(b.isEnabled()){var c= +mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale,f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var n=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages); +if(null!=c)b.setSelectionCells(this.importXml(c,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=k;var l=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(l=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var h=!0,r=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k, +f,g,!0,l,null,h))});l&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){h=a;r()},mxEvent.isControlDown(a)):r()}else null!=n&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(n)?this.loadImage(decodeURIComponent(n),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ +n+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(n,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var c=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0, +13)){var b=a.indexOf(",");0<b&&(c=this.getPageById(a.substring(b+1)),c=null!=c?c.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(c=mxResources.get("action"));return c};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");(a=this.getPageById(a.substring(c+1)))&&this.selectPage(a)}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage|| +mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle); +mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this, +function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave= +mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(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.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML= +"";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d= +c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var n=e.lastIndexOf("%3E");0<=n&&n<e.length-3&&(e=e.substring(0,n+3))}catch(w){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(f=!0,e= +k)}catch(w){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell())); +try{mxEvent.consume(a)}catch(w){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var c=null,b=0;b<a.length;b++)mxEvent.addListener(a[b],"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[b],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==c&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(c=this.highlightElement()); +a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[b],"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var b=this.extractGraphModelFromEvent(a);if(null== +b){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?b=d.getData("Text"):(b=null,b=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=b&&0<b.length?(d=document.createElement("div"),d.innerHTML=b,d=d.getElementsByTagName("img"),0<d.length&&(b=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(b=d.getData("text/plain"))), +null!=b&&("data:image/png;base64,"==b.substring(0,22)?(b=this.extractGraphModelFromPng(b),null!=b&&0<b.length&&this.openLocalFile(b,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(b)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(b))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(b)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP? +"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))))}else this.openLocalFile(b,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var c=0,b=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else c=a.offsetTop,b=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex= +mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=c+"px";h.style.left=b+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var c=this.editor.extractGraphModel(a.documentElement);a= +[];if(null!=c){var b=new mxCodec(c.ownerDocument),d=new mxGraphModel;b.decode(c,d);c=d.getChildAt(d.getRoot(),0);for(b=0;b<d.getChildCount(c);b++)a.push(d.getChildAt(c,b))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&& +(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx?)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a, +mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&& +(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else"image/png"== +a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c= +mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile= +null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],d;for(d in a)b.push(d); +return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=d.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(d.model.getChildAt(a, +f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&& +this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0); +null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=d?d:!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(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var c=this.editor.graph;return{event:a,pageVisible:c.pageVisible,translate:c.view.translate,scale:c.view.scale,page:c.view.getBackgroundPageBounds(),bounds:c.getGraphBounds()}}; +EditorUi.prototype.installMessageHandler=function(a){var c=null,b=!1,d=!1,e=null,h=mxUtils.bind(this,function(a,c){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"== +a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(C){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey): +h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var k=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&n.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==h.action){k=null;k="data:image/png;base64,"== +h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();n.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();n.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey): +null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();n.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(C){n.postMessage(JSON.stringify({event:"draft",error:C.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();var k=1==h.enableRecent,l=1==h.enableSearch,k=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this, +function(c,b){c=c||this.emptyDiagramXml;null!=h.callback?n.postMessage(JSON.stringify({event:"template",xml:c,blank:c==this.emptyDiagramXml,name:b}),"*"):(a(c,f,c!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,k?mxUtils.bind(this,function(a){this.recentReadyCallback=a;n.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,l?mxUtils.bind(this,function(a,c){this.searchReadyCallback=c;n.postMessage(JSON.stringify({event:"searchDocs", +searchStr:a}),"*")}):null,function(a,c,b){n.postMessage(JSON.stringify({event:"template",docUrl:a,info:c,name:b}),"*")});this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();return}if("searchDocsList"==h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list,h.errorMsg);else{if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))): +null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var p=null!=h.xml? +h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,u=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var c=this.createLoadMessage("export");c.format=h.format;c.message=h;c.data=a;c.xml=encodeURIComponent(p);n.postMessage(JSON.stringify(c),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&& +q.container.parentNode.removeChild(q.container);u(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),v=q.getGlobalVariable,B=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?B.getName():"pagenumber"==a?1:v.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this, +function(){t(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?u("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!= +urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),m.xml=mxUtils.getXml(k),m.data=this.getFileData(null,null,!0,null,null,null,k),m.format=h.format;else if("html"==h.format)p=this.editor.getGraphXml(),m.data=this.getHtml(p,this.editor.graph),m.xml=mxUtils.getXml(p),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);m.xml=this.getFileData(!0);m.format="svg";if(h.embedImages||null==h.embedImages){if(null== +h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);n.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data= +this.createSvgDataUri(mxUtils.getXml(a));n.postMessage(JSON.stringify(m),"*")}));return}k="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));m.data=this.createSvgDataUri(k)}n.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit), +null!=h.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),h=null!=h.xmlpng? +this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{n.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}}h=g(h);b=!0;try{a(h,f)}catch(C){this.handleError(C)}b=!1;null!=urlParams.modified&&this.editor.setStatus("");var N=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}); +e=N();d&&null==c&&(c=mxUtils.bind(this,function(a,c){var d=N();if(d!=e&&!b){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,c),this.editor.graph.addListener("gridSizeChanged",c),this.editor.graph.addListener("shadowVisibleChanged",c),this.addListener("pageFormatChanged",c),this.addListener("pageScaleChanged",c),this.addListener("backgroundColorChanged",c),this.addListener("backgroundImageChanged", +c),this.addListener("foldingEnabledChanged",c),this.addListener("mathEnabledChanged",c),this.addListener("gridEnabledChanged",c),this.addListener("guidesEnabledChanged",c),this.addListener("pageViewChanged",c));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||n.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var n=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";n.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons= +function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b, +"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b, +mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&& +(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,h=null,k="",m="auto",p="auto",q=null,v=null,z=40,G=40,E=0,x=this.editor.graph;x.getGraphBounds();for(var J= +function(){null!=b?b(Z):(x.setSelectionCells(Z),x.scrollCellToVisible(x.getSelectionCell()))},H=x.getFreeInsertPoint(),B=H.x,N=H.y,H=N,C=null,I="auto",R=[],Y=null,aa=null,Q=0;Q<c.length&&"#"==c[Q].charAt(0);){a=c[Q];for(Q++;Q<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Q].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[Q].substring(1)),Q++;if("#"!=a.charAt(1)){var S=a.indexOf(":");if(0<S){var K=mxUtils.trim(a.substring(1,S)),F=mxUtils.trim(a.substring(S+1));"label"==K?C=x.sanitizeHtml(F):"style"== +K?f=F:"identity"==K&&0<F.length&&"-"!=F?h=F:"namespace"==K&&0<F.length&&"-"!=F?k=F:"width"==K?m=F:"height"==K?p=F:"left"==K&&0<F.length?q=F:"top"==K&&0<F.length?v=F:"ignore"==K?aa=F.split(","):"connect"==K?R.push(JSON.parse(F)):"link"==K?Y=F:"padding"==K?E=parseFloat(F):"edgespacing"==K?z=parseFloat(F):"nodespacing"==K?G=parseFloat(F):"layout"==K&&(I=F)}}}var V=this.editor.csvToArray(c[Q]),S=null;if(null!=h)for(var L=0;L<V.length;L++)if(h==V[L]){S=L;break}null==C&&(C="%"+V[0]+"%");if(null!=R)for(var O= +0;O<R.length;O++)null==e[R[O].to]&&(e[R[O].to]={});x.model.beginUpdate();try{for(L=Q+1;L<c.length;L++){var X=this.editor.csvToArray(c[L]);if(X.length==V.length){var A=null,W=null!=S?k+X[S]:null;null!=W&&(A=x.model.getCell(W));null==A&&(A=new mxCell(C,new mxGeometry(B,H,0,0),f||"whiteSpace=wrap;html=1;"),A.vertex=!0,A.id=W);for(var P=0;P<X.length;P++)x.setAttributeForCell(A,V[P],X[P]);x.setAttributeForCell(A,"placeholders","1");A.style=x.replacePlaceholders(A,A.style);for(O=0;O<R.length;O++)e[R[O].to][A.getAttribute(R[O].to)]= +A;null!=Y&&"link"!=Y&&(x.setLinkForCell(A,A.getAttribute(Y)),x.setAttributeForCell(A,Y,null));x.fireEvent(new mxEventObject("cellsInserted","cells",[A]));var da=this.editor.graph.getPreferredSizeForCell(A);A.vertex&&(null!=q&&null!=A.getAttribute(q)&&(A.geometry.x=B+parseFloat(A.getAttribute(q))),null!=v&&null!=A.getAttribute(v)&&(A.geometry.y=N+parseFloat(A.getAttribute(v))),"@"==m.charAt(0)&&null!=A.getAttribute(m.substring(1))?A.geometry.width=parseFloat(A.getAttribute(m.substring(1))):A.geometry.width= +"auto"==m?da.width+E:parseFloat(m),"@"==p.charAt(0)&&null!=A.getAttribute(p.substring(1))?A.geometry.height=parseFloat(A.getAttribute(p.substring(1))):A.geometry.height="auto"==p?da.height+E:parseFloat(p),H+=A.geometry.height+G);d.push(x.addCell(A))}}for(var T=d.slice(),Z=d.slice(),O=0;O<R.length;O++)for(var U=R[O],L=0;L<d.length;L++){var A=d[L],ma=A.getAttribute(U.from);if(null!=ma){x.setAttributeForCell(A,U.from,null);for(var na=ma.split(","),P=0;P<na.length;P++){var ca=e[U.to][na[P]];null!=ca&& +(C=U.label,null!=U.fromlabel&&(C=(A.getAttribute(U.fromlabel)||"")+(C||"")),null!=U.tolabel&&(C=(C||"")+(ca.getAttribute(U.tolabel)||"")),Z.push(x.insertEdge(null,null,C||"",U.invert?ca:A,U.invert?A:ca,U.style||x.createCurrentEdgeStyle())),mxUtils.remove(U.invert?A:ca,T))}}}if(null!=aa)for(L=0;L<d.length;L++)for(A=d[L],P=0;P<aa.length;P++)x.setAttributeForCell(A,mxUtils.trim(aa[P]),null);var ia=new mxParallelEdgeLayout(x);ia.spacing=z;var qa=function(){ia.execute(x.getDefaultParent());for(var a=0;a< +d.length;a++){var b=x.getCellGeometry(d[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==m&&(b.width=Math.round(x.snap(b.width)));"auto"==p&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==I){var ea=new mxCircleLayout(x);ea.resetEdges=!1;var ra=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ea.execute(x.getDefaultParent());qa()},!0,J);J=null}else if("horizontaltree"==I||"verticaltree"== +I||"auto"==I&&Z.length==2*d.length-1&&1==T.length){x.view.validate();var fa=new mxCompactTreeLayout(x,"horizontaltree"==I);fa.levelDistance=G;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(),0<T.length?T[0]:null)},!0,J);J=null}else if("horizontalflow"==I||"verticalflow"==I||"auto"==I&&1==T.length){x.view.validate();var ja=new mxHierarchicalLayout(x,"horizontalflow"==I?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=G;ja.disableEdgeStyle= +!1;this.executeLayout(function(){ja.execute(x.getDefaultParent(),Z);x.moveCells(Z,B,N)},!0,J);J=null}else if("organic"==I||"auto"==I&&Z.length>d.length){x.view.validate();var ba=new mxFastOrganicLayout(x);ba.forceConstant=3*G;ba.resetEdges=!1;var ka=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return ka.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ia=new mxParallelEdgeLayout(x);ia.spacing=z;this.executeLayout(function(){ba.execute(x.getDefaultParent());qa()},!0,J);J=null}this.hideDialog()}finally{x.model.endUpdate()}null!= +J&&J()}}catch(ga){this.handleError(ga)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "), +d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var p=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=p.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&& +null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width* +b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/ +a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient|| c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled(); this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d), this.menus.get("newLibrary").setEnabled(d));a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&& this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin= -"4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b= +"4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,h=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b= "";break;case e.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b= -'<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement= +'<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement= function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var q=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){q.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b); this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b); this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility); this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=d&&d.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var v=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&& -(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);v.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,k,h){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,k,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null, -null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*k/c.view.scale),p=Math.floor(g.height*k/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+p+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; +(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);v.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null, +null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),p=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+p+"&border="+l+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,d,e){this.ui=a;this.page=d;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; function MovePage(a,d,e){this.ui=a;this.oldIndex=d;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; function SelectPage(a,d){this.ui=a;this.previousPage=this.page=d;this.neverShown=!0;null!=d&&(this.neverShown=null==d.viewState,this.ui.updatePageRoot(d))} @@ -3015,9 +3016,9 @@ EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var d=0;d<thi EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,d=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var b=this.tabContainer.style.height;this.tabContainer.style.height= null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":"30px";b!=this.tabContainer.style.height&&this.refresh(!1)}d.apply(a.view,arguments)});var e=null,b=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=e&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft= a.view.translate.x*a.view.scale+b.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+b.viewState.scrollTop),e=b);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?1!=MathJax.Hub.queue.pending||null==this.editor||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){this.editor.graph.refresh()})):"undefined"===typeof Editor.MathJaxClear||null!=this.editor&&this.editor.graph.mathEnabled|| -Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,d){for(var e=d.getProperty("edit").changes,k=0;k<e.length;k++)if(e[k]instanceof SelectPage||e[k]instanceof RenamePage||e[k]instanceof MovePage||e[k]instanceof mxRootChange){b();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}; -Graph.prototype.createViewState=function(a){var d=a.getAttribute("page"),e=a.getAttribute("pageScale"),b=a.getAttribute("pageWidth"),k=a.getAttribute("pageHeight"),m=a.getAttribute("background"),p=a.getAttribute("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"== -a.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=m&&0<m.length?m:this.defaultGraphBackground,backgroundImage:null!=p?new mxImage(p.src,p.width,p.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=b&&null!=k?new mxRectangle(0,0,parseFloat(b),parseFloat(k)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"== +Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,d){for(var e=d.getProperty("edit").changes,h=0;h<e.length;h++)if(e[h]instanceof SelectPage||e[h]instanceof RenamePage||e[h]instanceof MovePage||e[h]instanceof mxRootChange){b();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}; +Graph.prototype.createViewState=function(a){var d=a.getAttribute("page"),e=a.getAttribute("pageScale"),b=a.getAttribute("pageWidth"),h=a.getAttribute("pageHeight"),m=a.getAttribute("background"),p=a.getAttribute("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"== +a.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=m&&0<m.length?m:this.defaultGraphBackground,backgroundImage:null!=p?new mxImage(p.src,p.width,p.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=b&&null!=h?new mxRectangle(0,0,parseFloat(b),parseFloat(h)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"== a.getAttribute("math"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1}}; 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}}; @@ -3033,8 +3034,8 @@ EditorUi.prototype.duplicatePage=function(a,d){var e=this.editor.graph,b=null;e. EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var d=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(d){null!=d&&0<d.length&&this.editor.graph.model.execute(new RenamePage(this,a,d))}),mxResources.get("rename"));this.showDialog(d.container,300,80,!0,!0);d.init()}return a};EditorUi.prototype.movePage=function(a,d){this.editor.graph.model.execute(new MovePage(this,a,d))}; EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#dcdcdc";a.style.position="absolute";a.style.whiteSpace="nowrap";a.style.overflow="hidden";a.style.height="0px";return a}; EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,d=document.createElement("div");d.style.position="relative";d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";d.style.verticalAlign="top";d.style.height=this.tabContainer.style.height;d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.fontSize="12px";d.style.marginLeft="30px";for(var e=this.editor.isChromelessView()?29:59,b=Math.min(140,Math.max(20,(this.tabContainer.clientWidth- -e)/this.pages.length)+1),k=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(b,e){this.pages[b]==this.currentPage?(e.className="geActivePage",e.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",e.style.fontWeight="bold",e.style.borderTopStyle="none"):e.className="geInactivePage";e.setAttribute("draggable","true");mxEvent.addListener(e,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),k=b):mxEvent.consume(c)}));mxEvent.addListener(e, -"dragend",mxUtils.bind(this,function(a){k=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){null!=k&&b!=k&&this.movePage(k,b);a.stopPropagation();a.preventDefault()}));d.appendChild(e)})(m,this.createTabForPage(this.pages[m],b,this.pages[m]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(d); +e)/this.pages.length)+1),h=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(b,e){this.pages[b]==this.currentPage?(e.className="geActivePage",e.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",e.style.fontWeight="bold",e.style.borderTopStyle="none"):e.className="geInactivePage";e.setAttribute("draggable","true");mxEvent.addListener(e,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),h=b):mxEvent.consume(c)}));mxEvent.addListener(e, +"dragend",mxUtils.bind(this,function(a){h=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){null!=h&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){null!=h&&b!=h&&this.movePage(h,b);a.stopPropagation();a.preventDefault()}));d.appendChild(e)})(m,this.createTabForPage(this.pages[m],b,this.pages[m]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(d); b=this.createPageMenuTab();this.tabContainer.appendChild(b);b=null;this.isPageInsertTabVisible()&&(b=this.createPageInsertTab(),this.tabContainer.appendChild(b));if(d.clientWidth>this.tabContainer.clientWidth-e){null!=b&&(b.style.position="absolute",b.style.right="0px",d.style.marginRight="30px");var p=this.createControlTab(4," ❮ ");p.style.position="absolute";p.style.right=this.editor.chromeless?"29px":"55px";p.style.fontSize="13pt";this.tabContainer.appendChild(p);var q=this.createControlTab(4, " ❯");q.style.position="absolute";q.style.right=this.editor.chromeless?"0px":"29px";q.style.fontSize="13pt";this.tabContainer.appendChild(q);var v=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));d.style.width=v+"px";mxEvent.addListener(p,"click",mxUtils.bind(this,function(a){d.scrollLeft-=Math.max(20,v-20);mxUtils.setOpacity(p,0<d.scrollLeft?100:50);mxUtils.setOpacity(q,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(p, 0<d.scrollLeft?100:50);mxUtils.setOpacity(q,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.addListener(q,"click",mxUtils.bind(this,function(a){d.scrollLeft+=Math.max(20,v-20);mxUtils.setOpacity(p,0<d.scrollLeft?100:50);mxUtils.setOpacity(q,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()}; @@ -3043,49 +3044,49 @@ d.style.cursor="move";d.style.color="gray";a&&(mxEvent.addListener(d,"mouseenter EditorUi.prototype.createControlTab=function(a,d){var e=this.createTab(!0);e.style.paddingTop=a+"px";e.style.cursor="pointer";e.style.width="30px";e.style.lineHeight="30px";e.innerHTML=d;null!=e.firstChild&&null!=e.firstChild.style&&mxUtils.setOpacity(e.firstChild,40);return e}; EditorUi.prototype.createPageMenuTab=function(){var a=this.createControlTab(3,'<div class="geSprite geSprite-dots" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var d=0;d<this.pages.length;d++)mxUtils.bind(this, function(c){var d=a.addItem(this.pages[c].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[c])}),b);this.pages[c]==this.currentPage&&a.addCheckmark(d,Editor.checkmarkImage)})(d);if(this.editor.graph.isEnabled()){a.addSeparator(b);a.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),b);var e=this.currentPage;null!=e&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(e)}),b),a.addItem(mxResources.get("rename"), -null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxEvent.getClientX(a),k=mxEvent.getClientY(a);d.popup(b,k,null,a);this.setCurrentMenu(d); +null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxEvent.getClientX(a),h=mxEvent.getClientY(a);d.popup(b,h,null,a);this.setCurrentMenu(d); mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a}; EditorUi.prototype.createTabForPage=function(a,d,e){e=this.createTab(e);var b=a.getName();e.setAttribute("title",b);mxUtils.write(e,b);e.style.maxWidth=d+"px";e.style.width=d+"px";this.addTabListeners(a,e);42<d&&(e.style.textOverflow="ellipsis");return e}; -EditorUi.prototype.addTabListeners=function(a,d){mxEvent.disableContextMenu(d);var e=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var b=!1,k=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(d){b=null!=this.currentMenu;k=a==this.currentPage;e.isMouseDown||k||this.selectPage(a)}),null,mxUtils.bind(this,function(m){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(m)&&k||mxEvent.isPopupTrigger(m))){e.popupMenuHandler.hideMenu(); +EditorUi.prototype.addTabListeners=function(a,d){mxEvent.disableContextMenu(d);var e=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var b=!1,h=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(d){b=null!=this.currentMenu;h=a==this.currentPage;e.isMouseDown||h||this.selectPage(a)}),null,mxUtils.bind(this,function(m){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(m)&&h||mxEvent.isPopupTrigger(m))){e.popupMenuHandler.hideMenu(); this.hideCurrentMenu();if(!mxEvent.isTouchEvent(m)||!b){var p=new mxPopupMenu(this.createPageMenu(a));p.div.className+=" geMenubarMenu";p.smartSeparators=!0;p.showDisabled=!0;p.autoExpand=!0;p.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(p,arguments);this.resetCurrentMenu();p.destroy()});var q=mxEvent.getClientX(m),v=mxEvent.getClientY(m);p.popup(q,v,null,m);this.setCurrentMenu(p,d)}mxEvent.consume(m)}}))}; EditorUi.prototype.createPageMenu=function(a,d){return mxUtils.bind(this,function(e,b){e.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),b);e.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),b);e.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,d)}),b);e.addSeparator(b);e.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a, mxResources.get("copyOf",[a.getName()]))}),b)})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(d){a.apply(this,arguments);this.updateTabContainer()}})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};mxCodecRegistry.register(a)})(); (function(){var a=new mxObjectCodec(new RenamePage,["ui","page","previous"]);a.afterEncode=function(a,e,b){b.setAttribute("page",e.page.getId());return b};a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};a.afterDecode=function(a,e,b){b.page=a.ui.getPageById(e.getAttribute("page"));b.previous=b.name;return b};mxCodecRegistry.register(a)})(); (function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" "));a.afterEncode=function(a,e,b){b.setAttribute("relatedPage",e.relatedPage.getId());null==e.index&&(b.setAttribute("name",e.relatedPage.getName()),null!=e.relatedPage.root&&a.encodeCell(e.relatedPage.root,b));return b};a.beforeDecode=function(a,e,b){b.ui=a.ui;b.relatedPage=b.ui.getPageById(e.getAttribute("relatedPage"));if(null==b.relatedPage){var d=document.createElement("diagram");d.setAttribute("id", e.getAttribute("relatedPage"));d.setAttribute("name",e.getAttribute("name"));b.relatedPage=new DiagramPage(d);e=e.cloneNode(!0);d=e.firstChild;if(null!=d)for(b.relatedPage.root=a.decodeCell(d,!1),b=d.nextSibling,d.parentNode.removeChild(d),d=b;null!=d;){b=d.nextSibling;if(d.nodeType==mxConstants.NODETYPE_ELEMENT){var m=d.getAttribute("id");null==a.lookup(m)&&a.decodeCell(d)}d.parentNode.removeChild(d);d=b}}return e};a.afterDecode=function(a,e,b){b.index=b.previousIndex;return b};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",d=Graph.prototype.foldCells; -Graph.prototype.foldCells=function(a,b,e,q,v){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],g=0;g<e.length;g++){var k=this.view.getState(e[g]),m=null!=k?k.style:this.getCellStyle(e[g]);"1"==mxUtils.getValue(m,"treeFolding","0")&&(this.traverse(e[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[g]&&f.push(a);return a==e[g]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[g], -a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=c;e=d.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return n.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=n.getParent(a),b=h.view.getState(a),h.view.getState(a),b="tree"==(null!=b?b.style:h.getCellStyle(a)).containerType); -return b}function e(a){var b=!1;null!=a&&(a=n.getParent(a),b=h.view.getState(a),h.view.getState(a),b=null!=(null!=b?b.style:h.getCellStyle(a)).childLayout);return b}function q(a){a=h.view.getState(a);if(null!=a){var b=h.getIncomingEdges(a.cell);if(0<b.length&&(b=h.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())< -a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function v(a,b){b=null!=b?b:!0;h.model.beginUpdate();try{var c=h.model.getParent(a),d=h.getIncomingEdges(a),e=h.cloneCells([d[0],a]);h.model.setTerminal(e[0],h.model.getTerminal(d[0],!0),!0);var f=q(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+ -10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);h.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var l=h.view.getState(a),k=h.view.scale;if(null!=l){var n=mxRectangle.fromRectangle(l);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*k:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*k;var m=h.getOutgoingEdges(h.model.getTerminal(d[0], -!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,r=g=d=0;r<m.length;r++){var t=h.model.getTerminal(m[r],!1);if(f==q(t)){var u=h.view.getState(t);t!=a&&null!=u&&(p&&b!=u.getCenterX()<l.getCenterX()||!p&&b!=u.getCenterY()<l.getCenterY())&&mxUtils.intersects(n,u)&&(d=10+Math.max(d,(Math.min(n.x+n.width,u.x+u.width)-Math.max(n.x,u.x))/k),g=10+Math.max(g,(Math.min(n.y+n.height,u.y+u.height)-Math.max(n.y,u.y))/k))}}p?g=0:d=0;for(r=0;r<m.length;r++)if(t=h.model.getTerminal(m[r], -!1),f==q(t)&&(u=h.view.getState(t),t!=a&&null!=u&&(p&&b!=u.getCenterX()<l.getCenterX()||!p&&b!=u.getCenterY()<l.getCenterY()))){var v=[];h.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});h.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return h.addCells(e,c)}finally{h.model.endUpdate()}}function c(a){h.model.beginUpdate();try{var b=q(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(c[0],d[1],!1);h.model.setTerminal(d[0],d[1],!0);h.model.setTerminal(d[0],a,!1); -var e=h.model.getParent(a),f=e.geometry,g=[];h.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);h.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var l=a.geometry.width+40,k=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?l=0:b==mxConstants.DIRECTION_NORTH?(l=0,k=-40):b==mxConstants.DIRECTION_WEST?(l=-40,k=0):b==mxConstants.DIRECTION_EAST&&(k=0);h.moveCells(g,l,k);return h.addCells(d,e)}finally{h.model.endUpdate()}}function f(a){h.model.beginUpdate();try{var b= -h.model.getParent(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(d[0],a,!0);var c=h.getOutgoingEdges(a),e=b.geometry,f=[];h.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var l=h.model.getTerminal(c[g],!1);null!=l&&f.push(l)}var k=h.view.getBounds(f),n=q(a),m=h.view.translate,p=h.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-m.x-e.x+10,d[1].geometry.y+=a.geometry.height- -e.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-m.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=n==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==k?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-m.y+-e.y+10);return h.addCells(d,b)}finally{h.model.endUpdate()}}function g(a, -b,c){a=h.getOutgoingEdges(a);c=h.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=h.view.getState(h.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function u(a,b){var c=q(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST|| -c==mxConstants.DIRECTION_WEST)==d&&c!=b?t.actions.get("selectParent").funct():c==b?(d=h.getOutgoingEdges(a),null!=d&&0<d.length&&h.setSelectionCell(h.model.getTerminal(d[0],!1))):(c=h.getIncomingEdges(a),null!=c&&0<c.length&&(d=g(h.model.getTerminal(c[0],!0),d,a),c=h.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&h.setSelectionCell(d[c].cell)))))}var t=this,h=t.editor.graph,n=h.getModel();mxResources.parse("selectChildren=Select Children"); -mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var l=t.menus.createPopupMenu;t.menus.createPopupMenu=function(a,c,d){l.apply(this,arguments);if(1==h.getSelectionCount()){c=h.getSelectionCell();var e=h.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(h.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(h.getSelectionCell())&& -(a.addSeparator(),0<h.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};t.actions.addAction("selectChildren",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),a=h.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(h.model.getTerminal(a[c],!1));h.setSelectionCells(b)}}},null,null,"Alt+Shift+X");t.actions.addAction("selectSiblings",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(), -a=h.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=h.getOutgoingEdges(h.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(h.model.getTerminal(a[c],!1));h.setSelectionCells(b)}}},null,null,"Alt+Shift+S");t.actions.addAction("selectParent",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),a=h.getIncomingEdges(a);null!=a&&0<a.length&&h.setSelectionCell(h.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");t.actions.addAction("selectDescendants", -function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),b=[];h.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});h.setSelectionCells(b)}},null,null,"Alt+Shift+T");var w=h.removeCells;h.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];n.isEdge(g)&&d(g)&&(e.push(g),g=n.getTerminal(g,!1));b(g)?(h.traverse(g,!0, -function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=h.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return w.apply(this,arguments)};t.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var r=h.duplicateCells;h.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=h.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=h.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f], -a)}this.model.beginUpdate();try{var l=r.call(this,a,c);if(l.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=h.getIncomingEdges(l[e]),g=h.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var n=this.cloneCells([g[0]])[0];this.addEdge(n,h.getDefaultParent(),this.model.getTerminal(g[0],!0),l[e])}}}finally{this.model.endUpdate()}return l};var y=h.moveCells;h.moveCells=function(a,c,d,e,f,g,l){var k=null;this.model.beginUpdate();try{var n=f,m=this.view.getState(f),p=null!=m?m.style:this.getCellStyle(f); -if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var r=0;r<a.length;r++)if(b(a[r])||h.model.isEdge(a[r])&&null==h.model.getTerminal(a[r],!0)){f=h.model.getParent(a[r]);break}if(null!=n&&f!=n&&null!=this.view.getState(a[0])){var q=h.getIncomingEdges(a[0]);if(0<q.length){var t=h.view.getState(h.model.getTerminal(q[0],!0));if(null!=t){var u=h.view.getState(n);null!=u&&(c=(u.getCenterX()-t.getCenterX())/h.view.scale,d=(u.getCenterY()-t.getCenterY())/h.view.scale)}}}}k=y.apply(this,arguments); -if(null!=k&&null!=a&&k.length==a.length)for(r=0;r<k.length;r++)if(this.model.isEdge(k[r]))b(n)&&0>mxUtils.indexOf(k,this.model.getTerminal(k[r],!0))&&this.model.setTerminal(k[r],n,!0);else if(b(a[r])&&(q=h.getIncomingEdges(a[r]),0<q.length))if(!e)b(n)&&0>mxUtils.indexOf(a,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],n,!0);else if(0==h.getIncomingEdges(k[r]).length){m=n;if(null==m||m==h.model.getParent(a[r]))m=h.model.getTerminal(q[0],!0);e=this.cloneCells([q[0]])[0];this.addEdge(e, -h.getDefaultParent(),m,k[r])}}finally{this.model.endUpdate()}return k};if(null!=t.sidebar){var D=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(a,c,d,e){var f=h.model,g=null;f.beginUpdate();try{if(g=D.apply(this,arguments),b(a))for(var l=0;l<g.length;l++)if(f.isEdge(g[l])&&null==f.getTerminal(g[l],!0)){f.setTerminal(g[l],a,!0);var k=h.getCellGeometry(g[l]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var z={88:t.actions.get("selectChildren"), -84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},G=t.onKeyDown;t.onKeyDown=function(a){try{if(h.isEnabled()&&!h.isEditing()&&b(h.getSelectionCell())&&1==h.getSelectionCount()){var d=null;0<h.getIncomingEdges(h.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(h.getSelectionCell()):f(h.getSelectionCell()):13==a.which&&(d=v(h.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&h.model.isEdge(d[0])?h.setSelectionCell(h.model.getTerminal(d[0], -!1)):h.setSelectionCell(d[d.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(h.view.getState(h.getSelectionCell())),h.startEditingAtCell(h.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=z[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(u(h.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(u(h.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(u(h.getSelectionCell(), -mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(u(h.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(I){console.log("error",I)}mxEvent.isConsumed(a)||G.apply(this,arguments)};var E=h.connectVertex;h.connectVertex=function(a,d,e,g,l,k){var n=h.getIncomingEdges(a);return b(a)&&0<n.length?(e=q(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,l=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==l?c(a):v(a,d!=mxConstants.DIRECTION_NORTH&& -d!=mxConstants.DIRECTION_WEST)):E.call(this,a,d,e,g,l,k)};h.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&h.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var x=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){x.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"), +Graph.prototype.foldCells=function(a,b,e,q,v){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],g=0;g<e.length;g++){var h=this.view.getState(e[g]),m=null!=h?h.style:this.getCellStyle(e[g]);"1"==mxUtils.getValue(m,"treeFolding","0")&&(this.traverse(e[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[g]&&f.push(a);return a==e[g]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[g], +a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=c;e=d.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return n.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=n.getParent(a),b=l.view.getState(a),l.view.getState(a),b="tree"==(null!=b?b.style:l.getCellStyle(a)).containerType); +return b}function e(a){var b=!1;null!=a&&(a=n.getParent(a),b=l.view.getState(a),l.view.getState(a),b=null!=(null!=b?b.style:l.getCellStyle(a)).childLayout);return b}function q(a){a=l.view.getState(a);if(null!=a){var b=l.getIncomingEdges(a.cell);if(0<b.length&&(b=l.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())< +a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function v(a,b){b=null!=b?b:!0;l.model.beginUpdate();try{var c=l.model.getParent(a),d=l.getIncomingEdges(a),e=l.cloneCells([d[0],a]);l.model.setTerminal(e[0],l.model.getTerminal(d[0],!0),!0);var f=q(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+ +10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);l.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var h=l.view.getState(a),n=l.view.scale;if(null!=h){var k=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?k.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*n:k.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*n;var m=l.getOutgoingEdges(l.model.getTerminal(d[0], +!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,r=g=d=0;r<m.length;r++){var t=l.model.getTerminal(m[r],!1);if(f==q(t)){var u=l.view.getState(t);t!=a&&null!=u&&(p&&b!=u.getCenterX()<h.getCenterX()||!p&&b!=u.getCenterY()<h.getCenterY())&&mxUtils.intersects(k,u)&&(d=10+Math.max(d,(Math.min(k.x+k.width,u.x+u.width)-Math.max(k.x,u.x))/n),g=10+Math.max(g,(Math.min(k.y+k.height,u.y+u.height)-Math.max(k.y,u.y))/n))}}p?g=0:d=0;for(r=0;r<m.length;r++)if(t=l.model.getTerminal(m[r], +!1),f==q(t)&&(u=l.view.getState(t),t!=a&&null!=u&&(p&&b!=u.getCenterX()<h.getCenterX()||!p&&b!=u.getCenterY()<h.getCenterY()))){var v=[];l.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});l.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return l.addCells(e,c)}finally{l.model.endUpdate()}}function c(a){l.model.beginUpdate();try{var b=q(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],a]);l.model.setTerminal(c[0],d[1],!1);l.model.setTerminal(d[0],d[1],!0);l.model.setTerminal(d[0],a,!1); +var e=l.model.getParent(a),f=e.geometry,g=[];l.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);l.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var h=a.geometry.width+40,n=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?h=0:b==mxConstants.DIRECTION_NORTH?(h=0,n=-40):b==mxConstants.DIRECTION_WEST?(h=-40,n=0):b==mxConstants.DIRECTION_EAST&&(n=0);l.moveCells(g,h,n);return l.addCells(d,e)}finally{l.model.endUpdate()}}function f(a){l.model.beginUpdate();try{var b= +l.model.getParent(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],a]);l.model.setTerminal(d[0],a,!0);var c=l.getOutgoingEdges(a),e=b.geometry,f=[];l.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var h=l.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var n=l.view.getBounds(f),k=q(a),m=l.view.translate,p=l.view.scale;k==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==n?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(n.x+n.width)/p-m.x-e.x+10,d[1].geometry.y+=a.geometry.height- +e.y+40):k==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==n?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(n.x+n.width)/p-m.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=k==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==n?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(n.y+n.height)/p-m.y+-e.y+10);return l.addCells(d,b)}finally{l.model.endUpdate()}}function g(a, +b,c){a=l.getOutgoingEdges(a);c=l.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=l.view.getState(l.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function u(a,b){var c=q(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST|| +c==mxConstants.DIRECTION_WEST)==d&&c!=b?t.actions.get("selectParent").funct():c==b?(d=l.getOutgoingEdges(a),null!=d&&0<d.length&&l.setSelectionCell(l.model.getTerminal(d[0],!1))):(c=l.getIncomingEdges(a),null!=c&&0<c.length&&(d=g(l.model.getTerminal(c[0],!0),d,a),c=l.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&l.setSelectionCell(d[c].cell)))))}var t=this,l=t.editor.graph,n=l.getModel();mxResources.parse("selectChildren=Select Children"); +mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var k=t.menus.createPopupMenu;t.menus.createPopupMenu=function(a,c,d){k.apply(this,arguments);if(1==l.getSelectionCount()){c=l.getSelectionCell();var e=l.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(l.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(l.getSelectionCell())&& +(a.addSeparator(),0<l.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};t.actions.addAction("selectChildren",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),a=l.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(l.model.getTerminal(a[c],!1));l.setSelectionCells(b)}}},null,null,"Alt+Shift+X");t.actions.addAction("selectSiblings",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(), +a=l.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=l.getOutgoingEdges(l.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(l.model.getTerminal(a[c],!1));l.setSelectionCells(b)}}},null,null,"Alt+Shift+S");t.actions.addAction("selectParent",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),a=l.getIncomingEdges(a);null!=a&&0<a.length&&l.setSelectionCell(l.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");t.actions.addAction("selectDescendants", +function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),b=[];l.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});l.setSelectionCells(b)}},null,null,"Alt+Shift+T");var w=l.removeCells;l.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];n.isEdge(g)&&d(g)&&(e.push(g),g=n.getTerminal(g,!1));b(g)?(l.traverse(g,!0, +function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=l.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return w.apply(this,arguments)};t.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var r=l.duplicateCells;l.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=l.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=l.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f], +a)}this.model.beginUpdate();try{var h=r.call(this,a,c);if(h.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var n=l.getIncomingEdges(h[e]),g=l.getIncomingEdges(a[e]);if(0==n.length&&0<g.length){var k=this.cloneCells([g[0]])[0];this.addEdge(k,l.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var y=l.moveCells;l.moveCells=function(a,c,d,e,f,g,h){var n=null;this.model.beginUpdate();try{var k=f,m=this.view.getState(f),p=null!=m?m.style:this.getCellStyle(f); +if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var r=0;r<a.length;r++)if(b(a[r])||l.model.isEdge(a[r])&&null==l.model.getTerminal(a[r],!0)){f=l.model.getParent(a[r]);break}if(null!=k&&f!=k&&null!=this.view.getState(a[0])){var q=l.getIncomingEdges(a[0]);if(0<q.length){var t=l.view.getState(l.model.getTerminal(q[0],!0));if(null!=t){var u=l.view.getState(k);null!=u&&(c=(u.getCenterX()-t.getCenterX())/l.view.scale,d=(u.getCenterY()-t.getCenterY())/l.view.scale)}}}}n=y.apply(this,arguments); +if(null!=n&&null!=a&&n.length==a.length)for(r=0;r<n.length;r++)if(this.model.isEdge(n[r]))b(k)&&0>mxUtils.indexOf(n,this.model.getTerminal(n[r],!0))&&this.model.setTerminal(n[r],k,!0);else if(b(a[r])&&(q=l.getIncomingEdges(a[r]),0<q.length))if(!e)b(k)&&0>mxUtils.indexOf(a,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],k,!0);else if(0==l.getIncomingEdges(n[r]).length){m=k;if(null==m||m==l.model.getParent(a[r]))m=l.model.getTerminal(q[0],!0);e=this.cloneCells([q[0]])[0];this.addEdge(e, +l.getDefaultParent(),m,n[r])}}finally{this.model.endUpdate()}return n};if(null!=t.sidebar){var D=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(a,c,d,e){var f=l.model,g=null;f.beginUpdate();try{if(g=D.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var n=l.getCellGeometry(g[h]);n.points=null;null!=n.getTerminalPoint(!0)&&n.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var z={88:t.actions.get("selectChildren"), +84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},G=t.onKeyDown;t.onKeyDown=function(a){try{if(l.isEnabled()&&!l.isEditing()&&b(l.getSelectionCell())&&1==l.getSelectionCount()){var d=null;0<l.getIncomingEdges(l.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(l.getSelectionCell()):f(l.getSelectionCell()):13==a.which&&(d=v(l.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&l.model.isEdge(d[0])?l.setSelectionCell(l.model.getTerminal(d[0], +!1)):l.setSelectionCell(d[d.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(l.view.getState(l.getSelectionCell())),l.startEditingAtCell(l.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=z[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(u(l.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(u(l.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(u(l.getSelectionCell(), +mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(u(l.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(I){console.log("error",I)}mxEvent.isConsumed(a)||G.apply(this,arguments)};var E=l.connectVertex;l.connectVertex=function(a,d,e,g,h,n){var k=l.getIncomingEdges(a);return b(a)&&0<k.length?(e=q(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,h=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==h?c(a):v(a,d!=mxConstants.DIRECTION_NORTH&& +d!=mxConstants.DIRECTION_WEST)):E.call(this,a,d,e,g,h,n)};l.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&l.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var x=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){x.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"), this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells); this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var J=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){J.apply(this,arguments);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 H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var b=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=b.apply(this,arguments),d=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container", function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;"); b.vertex=!0;var d=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");c.geometry.relative=!0;c.edge=!0;b.insertEdge(c,!0);d.insertEdge(c,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;"); -e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var k=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");k.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); -m.geometry.relative=!0;m.edge=!0;b.insertEdge(m,!0);k.insertEdge(m,!1);var h=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");h.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); -n.geometry.relative=!0;n.edge=!0;b.insertEdge(n,!0);h.insertEdge(n,!1);a.insert(c);a.insert(g);a.insert(m);a.insert(n);a.insert(b);a.insert(d);a.insert(e);a.insert(k);a.insert(h);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a], +e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var h=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");h.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); +m.geometry.relative=!0;m.edge=!0;b.insertEdge(m,!0);h.insertEdge(m,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");l.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); +n.geometry.relative=!0;n.edge=!0;b.insertEdge(n,!0);l.insertEdge(n,!1);a.insert(c);a.insert(g);a.insert(m);a.insert(n);a.insert(b);a.insert(d);a.insert(e);a.insert(h);a.insert(l);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a], a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap branch",function(){var a=new mxCell("Branch",new mxGeometry(0,0,80,20),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap sub topic",function(){var a=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0, 0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Organization", @@ -3094,14 +3095,14 @@ b.insertEdge(c,!0);e.insertEdge(c,!1);var f=new mxCell("Division",new mxGeometry a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree root",function(){var a=new mxCell("Organization",new mxGeometry(0,0,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");d.setAttributeForCell(a,"treeRoot","1");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree division",function(){var a=new mxCell("Division",new mxGeometry(20,40,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;"); a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");b.geometry.setTerminalPoint(new mxPoint(0,0),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree sub sections",function(){var a=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;"); a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");b.geometry.setTerminalPoint(new mxPoint(110,-40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);var d=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0, -0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");c.geometry.setTerminalPoint(new mxPoint(110,-40),!0);c.geometry.relative=!0;c.edge=!0;d.insertEdge(c,!1);return sb.createVertexTemplateFromCells([b,c,a,d],220,60,"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new k(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(546,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&& -a.formatWindow.window.fit()}function d(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,266);a.sidebarWindow=new k(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;"; +0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");c.geometry.setTerminalPoint(new mxPoint(110,-40),!0);c.geometry.relative=!0;c.edge=!0;d.insertEdge(c,!1);return sb.createVertexTemplateFromCells([b,c,a,d],220,60,"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new h(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(546,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&& +a.formatWindow.window.fit()}function d(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,266);a.sidebarWindow=new h(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;"; g.className="geTitle";b.appendChild(g);return g}var d=document.createElement("div");d.style.cssText="position:absolute;left:0;right:0;border-top:1px solid lightgray;height:24px;bottom:31px;text-align:center;cursor:pointer;padding:6px 0 0 0;";d.className="geTitle";mxUtils.write(d,mxResources.get("moreShapes"));b.appendChild(d);mxEvent.addListener(d,"click",function(){a.actions.get("shapes").funct()});var e=new Menubar(a,b);if(!Editor.enableCustomLibraries||"1"==urlParams.embed&&"1"!=urlParams.libraries)d.style.bottom= "0";else if(null!=a.actions.get("newLibrary")){d=document.createElement("div");d.style.cssText="position:absolute;left:0px;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;";d.className="geTitle";var f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("newLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("newLibrary").funct);d=document.createElement("div"); d.style.cssText="position:absolute;left:50%;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;border-left: 1px solid lightgray;";d.className="geTitle";f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("openLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("openLibrary").funct)}else d=c("newLibrary",mxResources.get("newLibrary")),d.style.left= "0",d=c("openLibraryFrom",mxResources.get("openLibraryFrom")),d.style.borderLeft="1px solid lightgray",d.style.left="50%";b.appendChild(a.sidebar.container);b.style.overflow="hidden";return b});a.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);a.sidebarWindow.window.setVisible(!0);a.getLocalData("sidebar",function(b){a.sidebar.showEntries(b,null,!0)});a.restoreLibraries()}else a.sidebarWindow.window.setVisible(!a.sidebarWindow.window.isVisible());a.sidebarWindow.window.isVisible()&&a.sidebarWindow.window.fit()} if("1"!=urlParams.lightbox&&"0"!=urlParams.chrome){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;try{var b=document.createElement("style");b.type="text/css";b.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0;}html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }.geDialog input, .geToolbarContainer input, .mxWindow input {padding:2px !important;display:inline-block !important; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }.mxWindow .geColorBtn, .geDialog .geColorBtn { background: none !important; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-color: rgb(216, 216, 216); }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.geBtn:hover, .mxWindow button.geBtn:hover, .geDialog button.geBtn:hover { box-shadow: none; border-color: rgb(216, 216, 216); }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:2px; padding: 0 2px 4px 2px; } .geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px 0 2px 0; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }a.geMenuItem:active { opacity: 0.4; }.geToolbarContainer { background:#fff !important; }div.mxWindow .geSidebarContainer .geTitle { background-color:#fdfdfd; }div.mxWindow .geSidebarContainer .geTitle:hover { background-color:#fafafa; }div.geSidebar { background-color: #fff !important;}div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:#fff !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow * { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: rgb(249, 249, 249) !important; color:lightgray !important; } html div.geActivePage { background: white !important;color: #353535 !important; } html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.5) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: #353535; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: #29b6f2; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: #fff !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }"; -document.getElementsByTagName("head")[0].appendChild(b)}catch(n){}var k=function(a,b,c,d,e,f,g){a=document.createElement("div");a.className="geSidebarContainer";a.style.position="absolute";a.style.width="100%";a.style.height="100%";a.style.border="1px solid whiteSmoke";a.style.overflowX="hidden";a.style.overflowY="auto";g(a);this.window=new mxWindow(b,a,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0); +document.getElementsByTagName("head")[0].appendChild(b)}catch(n){}var h=function(a,b,c,d,e,f,g){a=document.createElement("div");a.className="geSidebarContainer";a.style.position="absolute";a.style.width="100%";a.style.height="100%";a.style.border="1px solid whiteSmoke";a.style.overflowX="hidden";a.style.overflowY="auto";g(a);this.window=new mxWindow(b,a,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0); this.window.setLocation=function(a,b){var c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)}};Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src; mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#C0C0C0" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxVertexHandler.prototype.handleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/>'); mxEdgeHandler.prototype.handleImage=mxVertexHandler.prototype.handleImage;mxEdgeHandler.prototype.terminalHandleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/><circle cx="8" cy="8" r="3" stroke="#ffffff" fill="#29b6f2"/>');mxEdgeHandler.prototype.fixedHandleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/><path d="m 6 6 L 10 10 M 6 10 L 10 6" stroke="#ffffff"/>');mxConstraintHandler.prototype.pointImage= @@ -3125,20 +3126,20 @@ EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a mxResources.get("text");b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";b.actions.get("insertRectangle").label=mxResources.get("rectangle");b.actions.get("insertEllipse").label=mxResources.get("ellipse");b.actions.get("insertRhombus").label=mxResources.get("rhombus");b.actions.get("insertImage").label=mxResources.get("image")+"...";b.actions.get("insertLink").label=mxResources.get("link")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label= mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importFile",new Action("File...",function(){c.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",function(){null!=a.files&&b.importFiles(a.files,null,null,b.maxImageSize)});a.click()}));b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){c.popupMenuHandler.hideMenu();b.showImportCsvDialog()})); b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(b,"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){d(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+ -"...",function(){a(b)}));EditorUi.enablePlantUml&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,"new open - save saveAs -".split(" "),c):"1"==urlParams.embed? -(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile&&(b.menus.addMenuItems(a,["-","share"],c),null!=d.realtime&&b.menus.addMenuItems(a,["chatWindowTitle"],c),a.addSeparator(c));b.menus.addMenuItems(a,["-","outline", -"layers","-","find"],c);d=this.addMenuItem(a,"tags",c);b.isOffline()&&!mxClient.IS_CHROMEAPP||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,c){f.apply(this, -arguments);a.addSeparator(c);b.menus.addSubmenu("openRecent",a,c)}}this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],c):b.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||b.menus.addMenuItems(a,["-","revisionHistory"],c);b.menus.addMenuItems(a,["-","autosave"],c)})));var g= -this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){g.funct(a,c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=h&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","pageScale"], -c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);if(!b.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(c);var d=b.menus.addMenuItem(a,"plugins",c);b.isOffline()||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText createShape plantUml - importCsv formatSql editDiagram".split(" "), -c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.menus.addSubmenu("importFrom",a,c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",a,c);b.menus.addSubmenu("insertAdvanced",a,c)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "), -m=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):m(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "), -c)})))};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=f.menus.get(a),g=m.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height="30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));f.menus.menuCreated(e,g,"geMenuItem");null!=c? +"...",function(){a(b)}));EditorUi.enablePlantUml&&!b.isOffline()&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,"new open - save saveAs -".split(" "), +c):"1"==urlParams.embed?(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile&&(b.menus.addMenuItems(a,["-","share"],c),null!=d.realtime&&b.menus.addMenuItems(a,["chatWindowTitle"],c),a.addSeparator(c));b.menus.addMenuItems(a, +["-","outline","layers","-","find"],c);d=this.addMenuItem(a,"tags",c);b.isOffline()&&!mxClient.IS_CHROMEAPP||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a, +c){f.apply(this,arguments);a.addSeparator(c);b.menus.addSubmenu("openRecent",a,c)}}this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],c):b.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||b.menus.addMenuItems(a,["-","revisionHistory"],c);b.menus.addMenuItems(a,["-","autosave"], +c)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){g.funct(a,c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=h&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips", +"pageScale"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);if(!b.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(c);var d=b.menus.addMenuItem(a,"plugins",c);b.isOffline()||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "), +c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.menus.addSubmenu("importFrom",a,c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",a,c);b.menus.addSubmenu("insertAdvanced",a,c)})));var l="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "), +m=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<l.length;c++)"-"==l[c]?a.addSeparator(b):m(a,b,mxResources.get(l[c])+"...",l[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "), +c)})))};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=f.menus.get(a),g=m.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height="30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));f.menus.menuCreated(e,g,"geMenuItem");null!=c? (g.style.backgroundImage="url("+c+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px",g.innerHTML="",mxUtils.setOpacity(g,d||40)):b||(g.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",g.style.backgroundPosition="right 6px center",g.style.backgroundRepeat="no-repeat",g.style.paddingRight="22px");return g}function b(a,b,c,d,e,f){var g=document.createElement("a");g.setAttribute("href","javascript:void(0)"); -g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";k.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&& +g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";h.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&& b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);mxUtils.setOpacity(g,null!=f?40:100);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),mxUtils.setOpacity(g,null!=f?40:100),g.style.cursor=""):(g.setAttribute("disabled","disabled"),mxUtils.setOpacity(g,null!=f?10:20),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function c(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block"; -b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));k.appendChild(b);return b}h.apply(this,arguments);var d=document.createElement("div");d.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";d.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries? -"63px":"32px";this.sidebar=this.createSidebar(d);var f=this,g=f.editor.graph;f.toolbar=this.createToolbar(f.createDiv("geToolbar"));f.defaultLibraryName=mxResources.get("untitledLibrary");var k=document.createElement("div");k.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var m=new Menubar(f,k);(d=900>e)||a("diagram");c([d?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg", +b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));h.appendChild(b);return b}l.apply(this,arguments);var d=document.createElement("div");d.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";d.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries? +"63px":"32px";this.sidebar=this.createSidebar(d);var f=this,g=f.editor.graph;f.toolbar=this.createToolbar(f.createDiv("geToolbar"));f.defaultLibraryName=mxResources.get("untitledLibrary");var h=document.createElement("div");h.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var m=new Menubar(f,h);(d=900>e)||a("diagram");c([d?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg", 100):null,b(mxResources.get("shapes"),f.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),f.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),f.actions.get("toggleFormat").funct,null,mxResources.get("format")+ " ("+f.actions.get("formatPanel").shortcut+")",f.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==": null)]);var p=a("insert",!0,d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null,40);c([p,b(mxResources.get("delete"),f.actions.get("delete").funct,null,mxResources.get("delete"),f.actions.get("delete"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==": @@ -3148,69 +3149,69 @@ c([b("",function(){g.popupMenuHandler.hideMenu();var a=g.view.scale,b=g.view.tra 640<=e?b("",d.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",d,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="): null,640<=e?b("",q.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",q,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="): null])}}f.statusContainer=f.createStatusContainer();f.statusContainer.style.position="relative";f.statusContainer.style.maxWidth="";f.statusContainer.style.marginTop="7px";f.statusContainer.style.marginLeft="6px";f.statusContainer.style.color="gray";f.statusContainer.style.cursor="default";f.editor.addListener("statusChanged",mxUtils.bind(this,function(){f.setStatusText(f.editor.getStatus())}));var u=f.descriptorChanged;f.descriptorChanged=function(){u.apply(this,arguments);var a=f.getCurrentFile(); -if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);k.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else k.removeAttribute("title")};f.setStatusText(f.editor.getStatus());k.appendChild(f.statusContainer);f.buttonContainer=document.createElement("div");f.buttonContainer.style.cssText="position:absolute;right:40px;top:12px;white-space:nowrap;";k.appendChild(f.buttonContainer);f.menubarContainer= +if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);h.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else h.removeAttribute("title")};f.setStatusText(f.editor.getStatus());h.appendChild(f.statusContainer);f.buttonContainer=document.createElement("div");f.buttonContainer.style.cssText="position:absolute;right:40px;top:12px;white-space:nowrap;";h.appendChild(f.buttonContainer);f.menubarContainer= f.buttonContainer;d=this.menus.get("language");null!=d&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&480<=e&&(p=m.addMenu("",d.funct),p.setAttribute("title",mxResources.get("language")),p.style.backgroundImage="url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTEuOTkgMkM2LjQ3IDIgMiA2LjQ4IDIgMTJzNC40NyAxMCA5Ljk5IDEwQzE3LjUyIDIyIDIyIDE3LjUyIDIyIDEyUzE3LjUyIDIgMTEuOTkgMnptNi45MyA2aC0yLjk1Yy0uMzItMS4yNS0uNzgtMi40NS0xLjM4LTMuNTYgMS44NC42MyAzLjM3IDEuOTEgNC4zMyAzLjU2ek0xMiA0LjA0Yy44MyAxLjIgMS40OCAyLjUzIDEuOTEgMy45NmgtMy44MmMuNDMtMS40MyAxLjA4LTIuNzYgMS45MS0zLjk2ek00LjI2IDE0QzQuMSAxMy4zNiA0IDEyLjY5IDQgMTJzLjEtMS4zNi4yNi0yaDMuMzhjLS4wOC42Ni0uMTQgMS4zMi0uMTQgMiAwIC42OC4wNiAxLjM0LjE0IDJINC4yNnptLjgyIDJoMi45NWMuMzIgMS4yNS43OCAyLjQ1IDEuMzggMy41Ni0xLjg0LS42My0zLjM3LTEuOS00LjMzLTMuNTZ6bTIuOTUtOEg1LjA4Yy45Ni0xLjY2IDIuNDktMi45MyA0LjMzLTMuNTZDOC44MSA1LjU1IDguMzUgNi43NSA4LjAzIDh6TTEyIDE5Ljk2Yy0uODMtMS4yLTEuNDgtMi41My0xLjkxLTMuOTZoMy44MmMtLjQzIDEuNDMtMS4wOCAyLjc2LTEuOTEgMy45NnpNMTQuMzQgMTRIOS42NmMtLjA5LS42Ni0uMTYtMS4zMi0uMTYtMiAwLS42OC4wNy0xLjM1LjE2LTJoNC42OGMuMDkuNjUuMTYgMS4zMi4xNiAyIDAgLjY4LS4wNyAxLjM0LS4xNiAyem0uMjUgNS41NmMuNi0xLjExIDEuMDYtMi4zMSAxLjM4LTMuNTZoMi45NWMtLjk2IDEuNjUtMi40OSAyLjkzLTQuMzMgMy41NnpNMTYuMzYgMTRjLjA4LS42Ni4xNC0xLjMyLjE0LTIgMC0uNjgtLjA2LTEuMzQtLjE0LTJoMy4zOGMuMTYuNjQuMjYgMS4zMS4yNiAycy0uMSAxLjM2LS4yNiAyaC0zLjM4eiIvPjwvc3ZnPg==)", -p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="24px 24px",p.style.position="absolute",p.style.height="24px",p.style.width="24px",p.style.zIndex="1",p.style.top="11px",p.style.right="14px",mxUtils.setOpacity(p,30),k.appendChild(p));f.tabContainer=document.createElement("div");f.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;"; +p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="24px 24px",p.style.position="absolute",p.style.height="24px",p.style.width="24px",p.style.zIndex="1",p.style.top="11px",p.style.right="14px",mxUtils.setOpacity(p,30),h.appendChild(p));f.tabContainer=document.createElement("div");f.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;"; d=f.diagramContainer.parentNode;q=document.createElement("div");q.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";f.diagramContainer.style.top="47px";f.diagramContainer.style.bottom="30px";t=f.menus.get("viewZoom");if(null!=t){this.tabContainer.style.right="70px";p=m.addMenu("100%",t.funct);p.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");p.style.whiteSpace="nowrap";p.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";p.style.backgroundPosition= "right 6px center";p.style.backgroundRepeat="no-repeat";p.style.paddingRight="10px";p.style.display="block";p.style.position="absolute";p.style.textDecoration="none";p.style.textDecoration="none";p.style.right="0px";p.style.bottom="0px";p.style.overflow="hidden";p.style.textAlign="center";p.style.color="#000";p.style.fontSize="12px";p.style.color="#707070";p.style.width="59px";p.style.borderTop="1px solid lightgray";p.style.borderLeft="1px solid lightgray";p.style.height=parseInt(f.tabContainer.style.height)- 1+"px";p.style.lineHeight=parseInt(f.tabContainer.style.height)+1+"px";q.appendChild(p);t=mxUtils.bind(this,function(){p.innerHTML=Math.round(100*f.editor.graph.view.scale)+"%"});f.editor.graph.view.addListener(mxEvent.EVENT_SCALE,t);f.editor.addListener("resetGraphView",t);f.editor.addListener("pageSelected",t);var v=f.setGraphEnabled;f.setGraphEnabled=function(){v.apply(this,arguments);null!=this.tabContainer&&(p.style.visibility=this.tabContainer.style.visibility)}}q.appendChild(f.tabContainer); -q.appendChild(k);q.appendChild(f.diagramContainer);d.appendChild(q);f.updateTabContainer();mxEvent.addListener(window,"resize",function(){null!=f.sidebarWindow&&f.sidebarWindow.window.fit();null!=f.formatWindow&&f.formatWindow.window.fit();null!=f.actions.outlineWindow&&f.actions.outlineWindow.window.fit();null!=f.actions.layersWindow&&f.actions.layersWindow.window.fit();null!=f.menus.tagsWindow&&f.menus.tagsWindow.window.fit();null!=f.menus.findWindow&&f.menus.findWindow.window.fit()})}}}; +q.appendChild(h);q.appendChild(f.diagramContainer);d.appendChild(q);f.updateTabContainer();mxEvent.addListener(window,"resize",function(){null!=f.sidebarWindow&&f.sidebarWindow.window.fit();null!=f.formatWindow&&f.formatWindow.window.fit();null!=f.actions.outlineWindow&&f.actions.outlineWindow.window.fit();null!=f.actions.layersWindow&&f.actions.layersWindow.window.fit();null!=f.menus.tagsWindow&&f.menus.tagsWindow.window.fit();null!=f.menus.findWindow&&f.menus.findWindow.window.fit()})}}}; (function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();mxResources.parse("# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\naboutDrawio=About draw.io\naccessDenied=Access Denied\naction=Action\nactualSize=Actual Size\nadd=Add\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Borderwidth\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangesNotSaved=Changes have not been saved\nchatJoined={1} has joined\nchatLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncompressed=Compressed\ncommitMessage=Commit Message\ncsv=CSV\ndark=Dark\ndraftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * \" |\ncheck=Check\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nerror=Error\nerrorDeletingFile=Error Deleting File\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file.\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google's servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named '{1}'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target='_blank' href='{1}'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwrite=File was changed. Overwrite changes?\noverwrite=Overwrite\nfilename=Filename\nfileExists=File already exists\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have read access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngeneral=General\ngithub=GitHub\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngooglePlus=Google+\ngoogleSites=Google Sites\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn't be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = \"\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target=\"_blank\" href=\"https://support.draw.io/display/DFCS/Licensing+your+draw.io+plugin\">page</a>.\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after page refresh.\nlaneColor=Lanecolor\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for '{1}'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn't been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\npaste=Paste\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\nprint=Print\nprintAllPages=Print All Pages\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you've made a few changes while offline. We're sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendMessage=Send\nsendYourFeedbackToDrawIo=Send your feedback to draw.io\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save. \nsetAsDefaultStyle=Set as Default Style\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareLink=Link for shared editing\nsharp=Sharp\nshow=Show\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click to expand. Drag and drop shapes into the diagram. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsize=Size\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstandard=Standard\nstarting=Starting\nstraight=Straight\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page.\nturn=Rotate 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\n");Graph.prototype.defaultThemes[Graph.prototype.defaultThemeName]=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="#ffffff"/><add as="strokeColor" value="#000000"/><add as="fontColor" value="#000000"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#ffffff"/><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="#000000"/><add as="fontColor" value="#000000"/></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><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="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="#ffffff"/><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="#ffffff"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="white"/><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="#ffffff"/></add></mxStylesheet>').documentElement; Graph.prototype.defaultThemes.darkTheme=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="#2a2a2a"/><add as="strokeColor" value="#f0f0f0"/><add as="fontColor" value="#f0f0f0"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#2a2a2a"/><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="#f0f0f0"/><add as="fontColor" value="#f0f0f0"/></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="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="#2a2a2a"/><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="#2a2a2a"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="#2a2a2a"/><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="#2a2a2a"/></add></mxStylesheet>').documentElement;GraphViewer=function(a,d,e){this.init(a,d,e)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="https://www.draw.io/";GraphViewer.prototype.imageBaseUrl="https://www.draw.io/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?28:30;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;GraphViewer.prototype.autoFit=!0;GraphViewer.prototype.allowZoomIn=!1; GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0; GraphViewer.prototype.init=function(a,d,e){this.graphConfig=null!=e?e:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;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.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialWidth=null!=a?a.style.width:null;this.widthIsEmpty=null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.editor=null;if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d), null!=a)){var b=mxUtils.bind(this,function(){this.graph=new Graph(a);this.graph.transparentBackground=!1;this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(a){return!0});this.lightboxClickEnabled&&(a.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);var b=this;this.graph.getImageFromBundles=function(a){return b.getImageUrl(a)}; -mxClient.IS_SVG&&this.editor.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==d.nodeName){var e=d.getElementsByTagName("diagram");if(0<e.length){var k=this.graph.getGlobalVariable,b=this;this.graph.getGlobalVariable=function(a){var c=e[b.currentPage];return"page"==a?c.getAttribute("name")||"Page-"+(b.currentPage+1):"pagenumber"==a?b.currentPage+1:k.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(a){this.currentPage=mxUtils.mod(a,this.diagrams.length); +mxClient.IS_SVG&&this.editor.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==d.nodeName){var e=d.getElementsByTagName("diagram");if(0<e.length){var h=this.graph.getGlobalVariable,b=this;this.graph.getGlobalVariable=function(a){var c=e[b.currentPage];return"page"==a?c.getAttribute("name")||"Page-"+(b.currentPage+1):"pagenumber"==a?b.currentPage+1:h.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(a){this.currentPage=mxUtils.mod(a,this.diagrams.length); this.updateGraphXml(mxUtils.parseXml(this.graph.decompress(mxUtils.getTextContent(this.diagrams[this.currentPage]))).documentElement)};this.selectPageById=function(a){for(var b=0;b<this.diagrams.length;b++)if(this.diagrams[b].getAttribute("id")==a){this.selectPage(b);break}};var f=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)});this.addListener("xmlNodeChanged", f);f();urlParams.page=b.currentPage;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8,this.graph.view.scale=this.graphConfig.zoom||1}finally{this.graph.getModel().endUpdate()}this.graph.panningHandler.useLeftButtonForPanning=!0;this.graph.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())&&"auto"==this.graph.container.style.overflow}; this.graph.panningHandler.usePopupTrigger=!1;this.graph.panningHandler.pinchEnabled=!1;this.graph.panningHandler.ignoreCell=!0;this.graph.setPanning(!1);this.addSizeHandler();this.showLayers(this.graph);this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};b=this;this.graph.customLinkClicked=function(a){if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");b.selectPageById(a.substring(c+ -1))}else this.handleCustomLink(a)};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",this.graphConfig.title);this.fireEvent(new mxEventObject("render"))});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var k=this.getObservableParent(a),m=new e(mxUtils.bind(this,function(d){0<a.offsetWidth&&(m.disconnect(),b())}));m.observe(k, +1))}else this.handleCustomLink(a)};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",this.graphConfig.title);this.fireEvent(new mxEventObject("render"))});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var h=this.getObservableParent(a),m=new e(mxUtils.bind(this,function(d){0<a.offsetWidth&&(m.disconnect(),b())}));m.observe(h, {attributes:!0})}else b()}};GraphViewer.prototype.getObservableParent=function(a){for(a=a.parentNode;a!=document.body&&null!=a.parentNode&&"none"!==mxUtils.getCurrentStyle(a).display;)a=a.parentNode;return a};GraphViewer.prototype.getImageUrl=function(a){null!=a&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10)&&("/"==a.charAt(0)&&(a=a.substring(1,a.length)),a=this.imageBaseUrl+a);return a}; GraphViewer.prototype.setXmlNode=function(a){this.xmlDocument=a.ownerDocument;this.xml=mxUtils.getXml(a);this.xmlNode=a;this.updateGraphXml(a);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(a){null==this.xmlNode&&(this.xmlDocument=a.ownerDocument,this.xml=mxUtils.getXml(a),this.xmlNode=a);this.setGraphXml(a)};GraphViewer.prototype.updateGraphXml=function(a){this.setGraphXml(a);this.fireEvent(new mxEventObject("graphChanged"))}; GraphViewer.prototype.setGraphXml=function(a){null!=this.graph&&(this.graph.view.translate=new mxPoint,this.graph.view.scale=1,this.graph.getModel().clear(),this.editor.setGraphXml(a),this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph(),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale})}; GraphViewer.prototype.addSizeHandler=function(){var a=this.graph.container,d=this.graph.getGraphBounds(),e=!1;a.style.overflow="hidden";var b=mxUtils.bind(this,function(){if(!e){e=!0;var b=this.graph.getGraphBounds();a.style.overflow=a.offsetWidth<=b.width+2*this.graph.border*this.graph.view.scale?"auto":"hidden";if(null!=this.toolbar){var b=a.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x, -top:-c.y},b={left:b.left-c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),k=null,m=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==k||m||(m=!0,this.graph.maxFitScale= -null!=b?b:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,b.height+2*this.graph.border+1),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=c,window.setTimeout(function(){m=!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",b),this.graph.addListener("size", -b)):new ResizeSensor(this.graph.container,b));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,100,1),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,d.width+2*this.graph.border),this.updateContainerHeight(a,d.height+2*this.graph.border+1),!this.zoomEnabled&&this.autoFit){var p=k=null,b=mxUtils.bind(this,function(){window.clearTimeout(p);m||(p=window.setTimeout(mxUtils.bind(this, +top:-c.y},b={left:b.left-c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),h=null,m=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==h||m||(m=!0,this.graph.maxFitScale= +null!=b?b:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,b.height+2*this.graph.border+1),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},h=c,window.setTimeout(function(){m=!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",b),this.graph.addListener("size", +b)):new ResizeSensor(this.graph.container,b));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,100,1),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,d.width+2*this.graph.border),this.updateContainerHeight(a,d.height+2*this.graph.border+1),!this.zoomEnabled&&this.autoFit){var p=h=null,b=mxUtils.bind(this,function(){window.clearTimeout(p);m||(p=window.setTimeout(mxUtils.bind(this, this.fitGraph),100))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?mxEvent.addListener(window,"resize",b):new ResizeSensor(this.graph.container,b))}else mxClient.IS_QUIRKS||9>=document.documentMode||this.graph.addListener("size",b);var q=mxUtils.bind(this,function(){var b=a.style.minWidth;this.widthIsEmpty&&(a.style.minWidth="100%");if(0<a.offsetWidth&&(this.allowZoomIn||d.width+2*this.graph.border>a.offsetWidth||d.height+2*this.graph.border>this.graphConfig["max-height"])){var c= -null;null!=this.graphConfig["max-height"]&&(c=this.graphConfig["max-height"]/(d.height+2*this.graph.border));this.fitGraph(c)}else this.graph.view.setTranslate(Math.floor((this.graph.border-d.x)/this.graph.view.scale),Math.floor((this.graph.border-d.y)/this.graph.view.scale)),k=a.offsetWidth;a.style.minWidth=b});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(q,0):q();this.positionGraph=function(){d=this.graph.getGraphBounds();k=null;q()}}; +null;null!=this.graphConfig["max-height"]&&(c=this.graphConfig["max-height"]/(d.height+2*this.graph.border));this.fitGraph(c)}else this.graph.view.setTranslate(Math.floor((this.graph.border-d.x)/this.graph.view.scale),Math.floor((this.graph.border-d.y)/this.graph.view.scale)),h=a.offsetWidth;a.style.minWidth=b});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(q,0):q();this.positionGraph=function(){d=this.graph.getGraphBounds();h=null;q()}}; GraphViewer.prototype.updateContainerWidth=function(a,d){a.style.width=d+"px"};GraphViewer.prototype.updateContainerHeight=function(a,d){if(this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||mxClient.IS_QUIRKS||8==document.documentMode)a.style.height=d+"px"}; -GraphViewer.prototype.showLayers=function(a,d){var e=this.graphConfig.layers;if(null!=e||null!=d)if(e=null!=e?e.split(" "):null,null!=d||0<e.length){var b=null!=d?d.getModel():null,k=a.getModel();k.beginUpdate();try{for(var m=k.getChildCount(k.root),p=0;p<m;p++)k.setVisible(k.getChildAt(k.root,p),null!=d?b.isVisible(b.getChildAt(b.root,p)):!1);if(null==b)for(p=0;p<e.length;p++)k.setVisible(k.getChildAt(k.root,parseInt(e[p])),!0)}finally{k.endUpdate()}}}; +GraphViewer.prototype.showLayers=function(a,d){var e=this.graphConfig.layers;if(null!=e||null!=d)if(e=null!=e?e.split(" "):null,null!=d||0<e.length){var b=null!=d?d.getModel():null,h=a.getModel();h.beginUpdate();try{for(var m=h.getChildCount(h.root),p=0;p<m;p++)h.setVisible(h.getChildAt(h.root,p),null!=d?b.isVisible(b.getChildAt(b.root,p)):!1);if(null==b)for(p=0;p<e.length;p++)h.setVisible(h.getChildAt(h.root,parseInt(e[p])),!0)}finally{h.endUpdate()}}}; GraphViewer.prototype.addToolbar=function(){function a(a,b,c,d){var g=document.createElement("div");g.style.borderRight="1px solid #d0d0d0";g.style.padding="3px 6px 3px 6px";mxEvent.addListener(g,"click",a);null!=c&&g.setAttribute("title",c);g.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==d||d?(mxEvent.addListener(g,"mouseenter",function(){g.style.backgroundColor="#ddd"}),mxEvent.addListener(g,"mouseleave", function(){g.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),g.style.cursor="pointer"):mxUtils.setOpacity(g,30);g.appendChild(a);e.appendChild(g);f++;return g}var d=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?d.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(d.style.marginTop=this.toolbarHeight+"px");var e=d.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box"; -e.style.whiteSpace="nowrap";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var b=null,k=null,m=mxUtils.bind(this,function(a){null!=b&&(window.clearTimeout(b),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);b=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e, -0);b=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),p=mxUtils.bind(this,function(a){null!=b&&(window.clearTimeout(b),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(p(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove": +e.style.whiteSpace="nowrap";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var b=null,h=null,m=mxUtils.bind(this,function(a){null!=b&&(window.clearTimeout(b),fadeThead=null);null!=h&&(window.clearTimeout(h),fadeThead2=null);b=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e, +0);b=null;h=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";h=null}),100)}),a||200)}),p=mxUtils.bind(this,function(a){null!=b&&(window.clearTimeout(b),fadeThead=null);null!=h&&(window.clearTimeout(h),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(p(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove": "mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){p(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(a){p(100);mxEvent.consume(a)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||p(30)}));var q=this.graph,v=q.getTolerance();q.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft= -q.container.scrollLeft;this.scrollTop=q.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-q.container.scrollLeft)<v&&Math.abs(this.scrollTop-q.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.style.opacity||0)?m():p(30))}})}for(var c=this.toolbarItems,f=0,g=null,u=null,t=0;t<c.length;t++){var h=c[t];if("pages"==h){u=d.ownerDocument.createElement("div"); -u.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(u,70);var n=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");n.style.borderRightStyle="none";n.style.paddingLeft="0px";n.style.paddingRight="0px";e.appendChild(u);var l=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+ -1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");l.style.paddingLeft="0px";l.style.paddingRight="0px";h=mxUtils.bind(this,function(){u.innerHTML="";mxUtils.write(u,this.currentPage+1+" / "+this.diagrams.length);u.style.display=1<this.diagrams.length?"inline-block":"none";n.style.display=u.style.display;l.style.display=u.style.display});this.addListener("graphChanged",h);h()}else if("zoom"==h)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage, -mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==h){if(this.layersEnabled){var w=this.graph.getModel(),r=a(mxUtils.bind(this,function(a){if(null!=g)g.parentNode.removeChild(g), +q.container.scrollLeft;this.scrollTop=q.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-q.container.scrollLeft)<v&&Math.abs(this.scrollTop-q.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.style.opacity||0)?m():p(30))}})}for(var c=this.toolbarItems,f=0,g=null,u=null,t=0;t<c.length;t++){var l=c[t];if("pages"==l){u=d.ownerDocument.createElement("div"); +u.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(u,70);var n=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");n.style.borderRightStyle="none";n.style.paddingLeft="0px";n.style.paddingRight="0px";e.appendChild(u);var k=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+ +1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");k.style.paddingLeft="0px";k.style.paddingRight="0px";l=mxUtils.bind(this,function(){u.innerHTML="";mxUtils.write(u,this.currentPage+1+" / "+this.diagrams.length);u.style.display=1<this.diagrams.length?"inline-block":"none";n.style.display=u.style.display;k.style.display=u.style.display});this.addListener("graphChanged",l);l()}else if("zoom"==l)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage, +mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==l){if(this.layersEnabled){var w=this.graph.getModel(),r=a(mxUtils.bind(this,function(a){if(null!=g)g.parentNode.removeChild(g), g=null;else{g=this.graph.createLayersDialog();mxEvent.addListener(g,"mouseleave",function(){g.parentNode.removeChild(g);g=null});a=r.getBoundingClientRect();g.style.width="140px";g.style.padding="2px 0px 2px 0px";g.style.border="1px solid #d0d0d0";g.style.backgroundColor="#eee";g.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";g.style.fontSize="11px";g.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(g,80);var b=mxUtils.getDocumentScrollOrigin(document);g.style.left=b.x+a.left+ -"px";g.style.top=b.y+a.bottom+"px";document.body.appendChild(g)}}),Editor.layersImage,mxResources.get("layers")||"Layers");w.addListener(mxEvent.CHANGE,function(){r.style.display=1<w.getChildCount(w.root)?"inline-block":"none"});r.style.display=1<w.getChildCount(w.root)?"inline-block":"none"}}else"lightbox"==h?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(h=this.graphConfig["toolbar-buttons"][h], -null!=h&&a(null==h.enabled||h.enabled?h.handler:function(){},h.image,h.title,h.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*f);null!=this.graphConfig.title&&(c=d.ownerDocument.createElement("div"),c.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",c.setAttribute("title",this.graphConfig.title),mxUtils.write(c,this.graphConfig.title),mxUtils.setOpacity(c, +"px";g.style.top=b.y+a.bottom+"px";document.body.appendChild(g)}}),Editor.layersImage,mxResources.get("layers")||"Layers");w.addListener(mxEvent.CHANGE,function(){r.style.display=1<w.getChildCount(w.root)?"inline-block":"none"});r.style.display=1<w.getChildCount(w.root)?"inline-block":"none"}}else"lightbox"==l?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(l=this.graphConfig["toolbar-buttons"][l], +null!=l&&a(null==l.enabled||l.enabled?l.handler:function(){},l.image,l.title,l.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*f);null!=this.graphConfig.title&&(c=d.ownerDocument.createElement("div"),c.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",c.setAttribute("title",this.graphConfig.title),mxUtils.write(c,this.graphConfig.title),mxUtils.setOpacity(c, 70),e.appendChild(c));this.minToolbarWidth=34*f;var y=d.style.border,c=mxUtils.bind(this,function(){var a=d.getBoundingClientRect(),b=mxUtils.getScrollOrigin(document.body),b="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-b.x,top:-b.y},a={left:a.left-b.left,top:a.top-b.top,bottom:a.bottom-b.top,right:a.right-b.left};e.style.left=a.left+"px";e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,d.offsetWidth)+"px"; e.style.border="1px solid #d0d0d0";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=a.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=a.top+1+"px"):e.style.top=a.top+"px";"1px solid transparent"==y&&(d.style.border="1px solid #d0d0d0");document.body.appendChild(e);var c=mxUtils.bind(this,function(){1!=this.graphConfig["toolbar-nohide"]&&(null!=e.parentNode&&e.parentNode.removeChild(e),null!=g&&(g.parentNode.removeChild(g), g=null),d.style.border=y)});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==d||a==e||a==g)return;a=a.parentNode}c()});mxEvent.addListener(document,"mouseleave",function(a){c()})});mxEvent.addListener(d,"mouseenter",c)}; -GraphViewer.prototype.addClickHandler=function(a,d){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,b){if(null==b){var k=mxEvent.getSource(e);"a"==k.nodeName.toLowerCase()&&(b=k.getAttribute("href"))}null!=d?null==b||a.isExternalProtocol(b)||a.isBlankLink(b)||window.setTimeout(function(){d.destroy()},0):null==b||null!=d||!a.isCustomLink(b)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)||(a.customLinkClicked(b),mxEvent.consume(e))}), +GraphViewer.prototype.addClickHandler=function(a,d){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,b){if(null==b){var h=mxEvent.getSource(e);"a"==h.nodeName.toLowerCase()&&(b=h.getAttribute("href"))}null!=d?null==b||a.isExternalProtocol(b)||a.isBlankLink(b)||window.setTimeout(function(){d.destroy()},0):null==b||null!=d||!a.isCustomLink(b)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)||(a.customLinkClicked(b),mxEvent.consume(e))}), mxUtils.bind(this,function(a){null!=d||!this.lightboxClickEnabled||mxEvent.isTouchEvent(a)&&0!=this.toolbarItems.length||this.showLightbox()}))}; GraphViewer.prototype.showLightbox=function(a,d,e){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){a=null!=a?a:null!=this.graphConfig.editable?this.graphConfig.editable:!0;e={client:1,lightbox:1,target:null!=e?e:"blank"};a&&(e.edit=this.graphConfig.edit||"_blank");if(null!=d?d:1)e.close=1;this.layersEnabled&&(e.layers=1);null!=this.graphConfig&&0!=this.graphConfig.nav&&(e.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&& (e.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(e.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(a){"ready"==a.data&&a.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):e.data=encodeURIComponent(this.xml);a="www.draw.io";"1"==urlParams.dev&&(e.dev="1",e.drawdev= "1",a="test.draw.io");this.lightboxWindow=window.open("https://"+a+"/#P"+encodeURIComponent(JSON.stringify(e)))}else this.lightboxWindow.focus();else this.showLocalLightbox()}; GraphViewer.prototype.showLocalLightbox=function(){var a=mxUtils.getDocumentScrollOrigin(document),d=document.createElement("div");mxClient.IS_QUIRKS?(d.style.position="absolute",d.style.left=a.x+"px",d.style.top=a.y+"px",d.style.width=document.body.offsetWidth+"px",d.style.height=document.body.offsetHeight+"px"):d.style.cssText="position:fixed;top:0;left:0;bottom:0;right:0;";d.style.zIndex=this.lightboxZIndex;d.style.backgroundColor="#000000";mxUtils.setOpacity(d,70);document.body.appendChild(d); var e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("src",Editor.closeImage);mxClient.IS_QUIRKS?(e.style.position="absolute",e.style.right="32px",e.style.top=a.y+32+"px"):e.style.cssText="position:fixed;top:32px;right:32px;";e.style.cursor="pointer";mxEvent.addListener(e,"click",function(){b.destroy()});urlParams.pages="1";urlParams.page=this.currentPage;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";if(null==document.documentMode|| -10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var b=new EditorUi(new Editor(!0),document.createElement("div"),!0);b.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";b.refresh=function(){};var k=mxUtils.bind(this,function(a){27==a.keyCode&& -b.destroy()}),m=b.destroy;b.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(d);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var p=b.editor.graph,q=p.container;q.style.overflow="hidden";this.lightboxChrome?(q.style.border="1px solid #c0c0c0",q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",k)):(d.style.display="none",e.style.display="none"); +10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var b=new EditorUi(new Editor(!0),document.createElement("div"),!0);b.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";b.refresh=function(){};var h=mxUtils.bind(this,function(a){27==a.keyCode&& +b.destroy()}),m=b.destroy;b.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",h);document.body.removeChild(d);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var p=b.editor.graph,q=p.container;q.style.overflow="hidden";this.lightboxChrome?(q.style.border="1px solid #c0c0c0",q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",h)):(d.style.display="none",e.style.display="none"); var v=this;p.getImageFromBundles=function(a){return v.getImageUrl(a)};var c=b.createTemporaryGraph;b.createTemporaryGraph=function(){var a=c.apply(this,arguments);a.getImageFromBundles=function(a){return v.getImageUrl(a)};return a};this.graphConfig.move&&(p.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(q.style,"border-radius","4px"),q.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";mxClient.IS_SF||mxClient.IS_EDGE|| (mxUtils.setPrefixedStyle(q.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(q.style,"transition","all .25s ease-in-out"));this.addClickHandler(p,b);window.setTimeout(mxUtils.bind(this,function(){q.style.outline="none";q.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(q);document.body.appendChild(e);b.setFileData(this.xml);mxUtils.setPrefixedStyle(q.style,"transform","rotateY(0deg)");b.chromelessToolbar.style.bottom="60px";b.chromelessToolbar.style.zIndex= this.lightboxZIndex;document.body.appendChild(b.chromelessToolbar);b.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});mxClient.IS_QUIRKS&&(q.style.position="absolute",q.style.display="block",q.style.left=a.x+"px",q.style.top=a.y+"px",q.style.width=document.body.clientWidth-80+"px",q.style.height=document.body.clientHeight-80+"px",q.style.backgroundColor="white",b.chromelessToolbar.style.display="block",b.chromelessToolbar.style.position="absolute",b.chromelessToolbar.style.bottom="", b.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");b.lightboxFit();b.chromelessResize();this.showLayers(p,this.graph);mxEvent.addListener(d,"click",function(){b.destroy()})}),0);return b};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(e){throw a.innerHTML=e.message,e;}})}; -GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var d=document.getElementsByClassName(a);a=[];for(var e=0;e<d.length;e++)a.push(d[e]);return a}for(var b=document.getElementsByTagName("*"),d=[],e=0;e<b.length;e++){var k=b[e].className;null!=k&&0<k.length&&(k=k.split(" "),0<=mxUtils.indexOf(k,a)&&d.push(b[e]))}return d}; -GraphViewer.createViewerForElement=function(a,d){var e=a.getAttribute("data-mxgraph");if(null!=e){var b=JSON.parse(e),k=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,b);null!=d&&d(e)};null!=b.url?GraphViewer.getUrl(b.url,function(a){k(a)}):k(b.xml)}}; +GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var d=document.getElementsByClassName(a);a=[];for(var e=0;e<d.length;e++)a.push(d[e]);return a}for(var b=document.getElementsByTagName("*"),d=[],e=0;e<b.length;e++){var h=b[e].className;null!=h&&0<h.length&&(h=h.split(" "),0<=mxUtils.indexOf(h,a)&&d.push(b[e]))}return d}; +GraphViewer.createViewerForElement=function(a,d){var e=a.getAttribute("data-mxgraph");if(null!=e){var b=JSON.parse(e),h=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,b);null!=d&&d(e)};null!=b.url?GraphViewer.getUrl(b.url,function(a){h(a)}):h(b.xml)}}; GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type="text/css";a.innerHTML="div.mxTooltip {\n-webkit-box-shadow: 3px 3px 12px #C0C0C0;\n-moz-box-shadow: 3px 3px 12px #C0C0C0;\nbox-shadow: 3px 3px 12px #C0C0C0;\nbackground: #FFFFCC;\nborder-style: solid;\nborder-width: 1px;\nborder-color: black;\nfont-family: Arial;\nfont-size: 8pt;\nposition: absolute;\ncursor: default;\npadding: 4px;\ncolor: black;}\ntd.mxPopupMenuIcon div {\nwidth:16px;\nheight:16px;}\nhtml div.mxPopupMenu {\n-webkit-box-shadow:2px 2px 3px #d5d5d5;\n-moz-box-shadow:2px 2px 3px #d5d5d5;\nbox-shadow:2px 2px 3px #d5d5d5;\n_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d0d0d0',Positive='true');\nbackground:white;\nposition:absolute;\nborder:3px solid #e7e7e7;\npadding:3px;}\nhtml table.mxPopupMenu {\nborder-collapse:collapse;\nmargin:0px;}\nhtml td.mxPopupMenuItem {\npadding:7px 30px 7px 30px;\nfont-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;}\nhtml td.mxPopupMenuIcon {\nbackground-color:white;\npadding:0px;}\ntd.mxPopupMenuIcon .geIcon {\npadding:2px;\npadding-bottom:4px;\nmargin:2px;\nborder:1px solid transparent;\nopacity:0.5;\n_width:26px;\n_height:26px;}\ntd.mxPopupMenuIcon .geIcon:hover {\nborder:1px solid gray;\nborder-radius:2px;\nopacity:1;}\nhtml tr.mxPopupMenuItemHover {\nbackground-color: #eeeeee;\ncolor: black;}\ntable.mxPopupMenu hr {\ncolor:#cccccc;\nbackground-color:#cccccc;\nborder:none;\nheight:1px;}\ntable.mxPopupMenu tr {\tfont-size:4pt;}\n.geDialog { font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;\nborder:none;\nmargin:0px;}\n.geDialog {\tposition:absolute;\tbackground:white;\toverflow:hidden;\tpadding:30px;\tborder:1px solid #acacac;\t-webkit-box-shadow:0px 0px 2px 2px #d5d5d5;\t-moz-box-shadow:0px 0px 2px 2px #d5d5d5;\tbox-shadow:0px 0px 2px 2px #d5d5d5;\t_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d5d5d5', Positive='true');\tz-index: 2;}.geDialogClose {\tposition:absolute;\twidth:9px;\theight:9px;\topacity:0.5;\tcursor:pointer;\t_filter:alpha(opacity=50);}.geDialogClose:hover {\topacity:1;}.geDialogTitle {\tbox-sizing:border-box;\twhite-space:nowrap;\tbackground:rgb(229, 229, 229);\tborder-bottom:1px solid rgb(192, 192, 192);\tfont-size:15px;\tfont-weight:bold;\ttext-align:center;\tcolor:rgb(35, 86, 149);}.geDialogFooter {\tbackground:whiteSmoke;\twhite-space:nowrap;\ttext-align:right;\tbox-sizing:border-box;\tborder-top:1px solid #e5e5e5;\tcolor:darkGray;}\n.geBtn {\tbackground-color: #f5f5f5;\tborder-radius: 2px;\tborder: 1px solid #d8d8d8;\tcolor: #333;\tcursor: default;\tfont-size: 11px;\tfont-weight: bold;\theight: 29px;\tline-height: 27px;\tmargin: 0 0 0 8px;\tmin-width: 72px;\toutline: 0;\tpadding: 0 8px;\tcursor: pointer;}.geBtn:hover, .geBtn:focus {\t-webkit-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\t-moz-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tbox-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tborder: 1px solid #c6c6c6;\tbackground-color: #f8f8f8;\tbackground-image: linear-gradient(#f8f8f8 0px,#f1f1f1 100%);\tcolor: #111;}.geBtn:disabled {\topacity: .5;}.gePrimaryBtn {\tbackground-color: #4d90fe;\tbackground-image: linear-gradient(#4d90fe 0px,#4787ed 100%);\tborder: 1px solid #3079ed;\tcolor: #fff;}.gePrimaryBtn:hover, .gePrimaryBtn:focus {\tbackground-color: #357ae8;\tbackground-image: linear-gradient(#4d90fe 0px,#357ae8 100%);\tborder: 1px solid #2f5bb7;\tcolor: #fff;}.gePrimaryBtn:disabled {\topacity: .5;}";document.getElementsByTagName("head")[0].appendChild(a)}catch(d){}}; GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,d,e){if(null!=GraphViewer.cachedUrls[a])d(GraphViewer.cachedUrls[a]);else{var b=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;b.open("GET",a);b.onload=function(){d(null!=b.getText?b.getText():b.responseText)};b.onerror=e;b.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0; -(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},d=function(e,b){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function p(b,c){if(!b.resizedAttached)b.resizedAttached= -new k,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>'; +(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},d=function(e,b){function h(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function p(b,c){if(!b.resizedAttached)b.resizedAttached= +new h,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>'; b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var p=!1,r=function(){b.resizedAttached&&(p&&(b.resizedAttached.call(),p=!1),a(r))};a(r);var q,u,v,G,E=function(){if((v=b.offsetWidth)!=q||(G=b.offsetHeight)!=u)p=!0,q=v,u=G;g()},x=function(a,b,c){a.attachEvent? a.attachEvent("on"+b,c):a.addEventListener(b,c)};x(d,"scroll",E);x(f,"scroll",E)}var q=function(){GraphViewer.resizeSensorEnabled&&b()},v=Object.prototype.toString.call(e),c="[object Array]"===v||"[object NodeList]"===v||"[object HTMLCollection]"===v||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(c)for(var v=0,f=e.length;v<f;v++)p(e[v],q);else p(e,q);this.detach=function(){if(c)for(var a=0,b=e.length;a<b;a++)d.detach(e[a]);else d.detach(e)}}; d.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=d})(); diff --git a/src/main/webapp/js/atlas.min.js b/src/main/webapp/js/atlas.min.js index 89def13ac..fd99417bc 100644 --- a/src/main/webapp/js/atlas.min.js +++ b/src/main/webapp/js/atlas.min.js @@ -103,7 +103,7 @@ window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Ba ko:"í•œêµì–´",ja:"日本語",zh:"ä¸æ–‡ï¼ˆä¸å›½ï¼‰","zh-tw":"ä¸æ–‡ï¼ˆå°ç£ï¼‰"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} (function(){if("undefined"!==typeof JSON&&isLocalStorage)try{var a=localStorage.getItem(".drawio-config"),b=!0;null!=a&&(b=JSON.parse(a).showStartScreen);0==b&&(urlParams.splash="0")}catch(c){}a=urlParams["export"];null!=a&&("http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";b=window.location.host;"test.draw.io"!=b&&(a=b.length-7,b=b.lastIndexOf("draw.io",a),-1!==b&&b===a&&(window.DRAWIO_LOG_URL="https://log.draw.io"))})(); -if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.analytics="0",urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");window.urlParams=window.urlParams||{};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"; +if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");window.urlParams=window.urlParams||{};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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"3.9.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT: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:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.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/")&& @@ -2067,8 +2067,8 @@ this.getCssClassForMarker("end",b.currentEdgeStyle.shape,b.currentEdgeStyle[mxCo this.toolbar.setFontSize(c)}),b.getSelectionModel().addListener(mxEvent.CHANGE,a),b.getModel().addListener(mxEvent.CHANGE,a));b.addListener(mxEvent.CELLS_ADDED,function(a,c){var d=c.getProperty("cells"),e=c.getProperty("parent");b.getModel().isLayer(e)&&!b.isCellVisible(e)&&null!=d&&0<d.length&&b.getModel().setVisible(e,!0)});this.gestureHandler=mxUtils.bind(this,function(a){null!=this.currentMenu&&mxEvent.getSource(a)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document, this.gestureHandler);this.resizeHandler=mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window, "scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){b.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){b.view.validateBackground()}));b.addListener("gridSizeChanged",mxUtils.bind(this,function(){b.isGridEnabled()&&b.view.validateBackground()}));this.editor.resetGraph();this.init();this.open()}; -mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=34;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.editButtonLink=null;EditorUi.prototype.hsplitPosition=640>=screen.width?118:208;EditorUi.prototype.allowAnimation=!0; -EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4; +mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=34;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.hsplitPosition=640>=screen.width?118:208;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2; +EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1; EditorUi.prototype.init=function(){var a=this.editor.graph;mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(a){this.onKeyDown(a)}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(a){this.onKeyPress(a)}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})); var c=a.setDefaultParent,d=this;this.editor.graph.setDefaultParent=function(){c.apply(this,arguments);d.updateActionStates()};a.editLink=d.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()};EditorUi.prototype.onKeyDown=function(a){var c=this.editor.graph;9==a.which&&c.isEnabled()&&!mxEvent.isAltDown(a)&&(c.isEditing()?c.stopEditing(!1):c.selectCell(!mxEvent.isShiftDown(a)),mxEvent.consume(a))}; EditorUi.prototype.onKeyPress=function(a){var c=this.editor.graph;!this.isImmediateEditingEvent(a)||c.isEditing()||c.isSelectionEmpty()||0===a.which||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(c.escape(),c.startEditing(),mxClient.IS_FF&&(c=c.cellEditor,c.textarea.innerHTML=String.fromCharCode(a.which),a=document.createRange(),a.selectNodeContents(c.textarea),a.collapse(!1),c=window.getSelection(),c.removeAllRanges(),c.addRange(a)))}; @@ -2150,7 +2150,8 @@ this.container.appendChild(this.sidebarFooterContainer);this.container.appendChi !0,0,mxUtils.bind(this,function(a){this.hsplitPosition=a;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";420>screen.width&&(a.style.maxWidth=Math.max(20,screen.width-320)+"px",a.style.overflow="hidden");return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a};EditorUi.prototype.createToolbar=function(a){return new Toolbar(this,a)}; EditorUi.prototype.createSidebar=function(a){return new Sidebar(this,a)};EditorUi.prototype.createFormat=function(a){return new Format(this,a)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(a){var c=document.createElement("div");c.className=a;return c}; EditorUi.prototype.addSplitHandler=function(a,c,d,b){function f(a){if(null!=h){var e=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));b(Math.max(0,g+(c?e.x-h.x:h.y-e.y)-d));mxEvent.consume(a);g!=m()&&(k=!0,l=null)}}function e(a){f(a);h=g=null}var h=null,g=null,k=!0,l=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var m=mxUtils.bind(this,function(){var b=parseInt(c?a.style.left:a.style.bottom);c||(b=b+d-this.footerHeight);return b});mxEvent.addGestureListeners(a,function(a){h=new mxPoint(mxEvent.getClientX(a), -mxEvent.getClientY(a));g=m();k=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",function(a){if(!k){var c=null!=l?l-d:0;l=m();b(c);mxEvent.consume(a)}});mxEvent.addGestureListeners(document,null,f,e);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,f,e)})};EditorUi.prototype.showDialog=function(a,c,d,b,f,e,h){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,c,d,b,f,e,h);this.dialogs.push(this.dialog)}; +mxEvent.getClientY(a));g=m();k=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){if(!k&&this.hsplitClickEnabled){var c=null!=l?l-d:0;l=m();b(c);mxEvent.consume(a)}}));mxEvent.addGestureListeners(document,null,f,e);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,f,e)})}; +EditorUi.prototype.showDialog=function(a,c,d,b,f,e,h){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,c,d,b,f,e,h);this.dialogs.push(this.dialog)}; EditorUi.prototype.hideDialog=function(a){null!=this.dialogs&&0<this.dialogs.length&&(this.dialogs.pop().close(a),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&this.editor.graph.container.focus(),mxUtils.clearSelection(),this.editor.fireEvent(new mxEventObject("hideDialog")))}; EditorUi.prototype.pickColor=function(a,c){var d=this.editor.graph,b=d.cellEditor.saveSelection(),f=new ColorDialog(this,a||"none",function(a){d.cellEditor.restoreSelection(b);c(a)},function(){d.cellEditor.restoreSelection(b)});this.showDialog(f.container,230,430,!0,!1);f.init()}; EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})}; @@ -6822,7 +6823,7 @@ null,null,this.getTagsForStencil("mxgraph.weblogos","blogger","web logos logo"). 66,65,"","Crowd",null,null,this.getTagsForStencil("mxgraph.weblogos","crowd logo","web logos logo").join(" ")),this.createVertexTemplateEntry("image;image=img/lib/atlassian/Crucible_Logo.svg;",61,61,"","Crucible",null,null,this.getTagsForStencil("mxgraph.weblogos","crucible logo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dealsplus;fillColor=#935492",76,.2*333,"","Dealsplus",null,null,this.getTagsForStencil("mxgraph.weblogos","dealsplus","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ "designfloat;strokeColor=none",72,72,"","Designfloat",null,null,this.getTagsForStencil("mxgraph.weblogos","designfloat","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"deviantart;fillColor=#009544;strokeColor=none;",62,86.4,"","Deviantart",null,null,this.getTagsForStencil("mxgraph.weblogos","deviantart","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"digg;fillColor=#ffffff",58,56,"","Digg",null,null,this.getTagsForStencil("mxgraph.weblogos","digg","web logos logo").join(" ")), this.createVertexTemplateEntry(a+"diigo;fillColor=#2973D2;strokeColor=none",61.2,68.8,"","Diigo",null,null,this.getTagsForStencil("mxgraph.weblogos","diiigo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dopplr;fillColor=#F9634D;strokeColor=none",102.4,102.4,"","Dopplr",null,null,this.getTagsForStencil("mxgraph.weblogos","dopplr","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"drawio2;fillColor=#1A5BA3",52.2,70.8,"","Draw.io",null,null,this.getTagsForStencil("mxgraph.weblogos", -"drawio draw io draw.io","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"drawio3;fillColor=#1A5BA3;fontSize=15;fontColor=#1A5BA3;fontStyle=1",52.2,52.2,'draw<font color="#f08707">.io</font>',"Draw.io",null,null,this.getTagsForStencil("mxgraph.weblogos","drawio draw io draw.io","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dribbble;fillColor=#EB548D",67.4,67.2,"","Dribbble",null,null,this.getTagsForStencil("mxgraph.weblogos","dribbble","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ +"drawio draw io draw.io","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"drawio3;fillColor=#1A5BA3;fontSize=15;fontColor=#1A5BA3;fontStyle=1",52.2,52.2,'draw.<font color="#f08707">io</font>',"Draw.io",null,null,this.getTagsForStencil("mxgraph.weblogos","drawio draw io draw.io","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dribbble;fillColor=#EB548D",67.4,67.2,"","Dribbble",null,null,this.getTagsForStencil("mxgraph.weblogos","dribbble","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ "dropbox;fillColor=#0287EA",73.4,62,"","Dropbox2",null,null,this.getTagsForStencil("mxgraph.weblogos","dropbox","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"drupal",60.6,69,"","Drupal",null,null,this.getTagsForStencil("mxgraph.weblogos","drupal","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"dzone",.2*438,61.2,"","Dzone",null,null,this.getTagsForStencil("mxgraph.weblogos","dzone","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"ebay",81.2,34.4,"","Ebay", null,null,this.getTagsForStencil("mxgraph.weblogos","ebay","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"edmodo;fillColor=#276CB0;strokeColor=none",69.2,73.8,"","Edmodo",null,null,this.getTagsForStencil("mxgraph.weblogos","edmodo","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"evernote;fillColor=#3F3F3F",.2*317,75.2,"","Evernote",null,null,this.getTagsForStencil("mxgraph.weblogos","evernote","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"fancy;fillColor=#6DB3E3", 39.2,79,"","Fancy",null,null,this.getTagsForStencil("mxgraph.weblogos","fancy","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"fark;fillColor=#B1B0C7;gradientColor=#ffffff;strokeColor=#B1B0C7",44.2,70.2,"","Fark",null,null,this.getTagsForStencil("mxgraph.weblogos","fark","web logos logo").join(" ")),this.createVertexTemplateEntry(a+"fashiolista",.2*388,73.2,"","Fashiolista",null,null,this.getTagsForStencil("mxgraph.weblogos","fashiolista","web logos logo").join(" ")),this.createVertexTemplateEntry(a+ @@ -6897,7 +6898,7 @@ StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,argum StorageLibrary.prototype.isRenamable=function(a,d,f){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,d,f){StorageFile.call(this,a,d,f);a=f;d=a.lastIndexOf("/");0<=d&&(a=a.substring(d+1));this.fname=a};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(a,d,f){return!1};UrlLibrary.prototype.saveAs=function(a,d,f){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,d,f){function c(c,x,u,k,v,q){function w(){mxEvent.addListener(t,"click",null!=q?q:function(){u!=App.MODE_GOOGLE||a.isDriveDomain()?u==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,b.checked);d()})):(a.setMode(u,b.checked),d()):window.location.hostname=DriveClient.prototype.newAppHostname})}var t=document.createElement("a");t.style.overflow="hidden";t.style.display= mxClient.IS_QUIRKS?"inline":"inline-block";t.className="geBaseButton";t.style.boxSizing="border-box";t.style.fontSize="11px";t.style.position="relative";t.style.margin="4px";t.style.padding="8px 10px 12px 10px";t.style.width="88px";t.style.height="100px";t.style.whiteSpace="nowrap";t.setAttribute("title",x);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");var A=document.createElement("div");A.style.textOverflow="ellipsis";A.style.overflow="hidden";if(null!=c){var g=document.createElement("img"); g.setAttribute("src",c);g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";t.appendChild(g)}else A.style.paddingTop="5px",A.style.whiteSpace="normal",mxClient.IS_IOS?(t.style.padding="0px 10px 20px 10px",t.style.top="6px"):mxClient.IS_FF&&(A.style.paddingTop="0px",A.style.marginTop="-2px");t.appendChild(A);mxUtils.write(A,x);if(null!=v)for(c=0;c<v.length;c++)mxUtils.br(A),mxUtils.write(A,v[c]);if(null!=k&&null==a[k]){g.style.visibility= -"hidden";mxUtils.setOpacity(A,10);var F=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});F.spin(t);var h=window.setTimeout(function(){null==a[k]&&(F.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(h),mxUtils.setOpacity(A,100),g.style.visibility="",F.stop(),w(),"drive"==k&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else w(); +"hidden";mxUtils.setOpacity(A,10);var h=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});h.spin(t);var F=window.setTimeout(function(){null==a[k]&&(h.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(F),mxUtils.setOpacity(A,100),g.style.visibility="",h.stop(),w(),"drive"==k&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else w(); p.appendChild(t);++e>=f&&(mxUtils.br(p),e=0)}f=null!=f?f:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace="nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var h=a.addLanguageMenu(g,!0);null!=h&&(h.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){h=document.createElement("a");h.setAttribute("href","https://about.draw.io/support/");h.setAttribute("title",mxResources.get("help"));h.setAttribute("target","_blank");h.style.position= "absolute";h.style.textDecoration="none";h.style.cursor="pointer";h.style.fontSize="12px";h.style.bottom="28px";h.style.left="26px";h.style.color="gray";var m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("valign","bottom");m.setAttribute("src",Editor.helpImage);m.style.marginRight="2px";h.appendChild(m);mxUtils.write(h,mxResources.get("help"));g.appendChild(h)}var n=document.createElement("div");n.style.position="absolute";n.style.cursor="pointer";n.style.fontSize="12px"; n.style.bottom="28px";n.style.color="gray";mxUtils.write(n,mxResources.get("decideLater"));a.isOfflineApp()?n.style.right="20px":(mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,0)"),n.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)n.style.marginLeft=-Math.round(n.clientWidth/2)+"px"};g.appendChild(n);mxEvent.addListener(n,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null, @@ -6923,15 +6924,15 @@ h=mxUtils.button(h||mxResources.get("cancel"),function(){a.hideDialog();null!=c& g.style.height="auto",g.className="geBtn",g.style.width="40%"):g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(h);b.appendChild(e);p?(e.style.marginTop="10px",e=document.createElement("p"),e.style.marginTop="20px",e.appendChild(l),m=document.createElement("span"),mxUtils.write(m," "+mxResources.get("rememberThisSetting")),e.appendChild(m),b.appendChild(e),mxEvent.addListener(m,"click",function(b){l.checked=!l.checked;mxEvent.consume(b)})):e.style.marginTop="16px";this.container= b},ErrorDialog=function(a,d,f,c,g,h,m,n,p,b,e){p=null!=p?p:!0;var l=document.createElement("div");l.style.textAlign="center";if(null!=d){var q=document.createElement("div");q.style.padding="0px";q.style.margin="0px";q.style.fontSize="18px";q.style.paddingBottom="16px";q.style.marginBottom="16px";q.style.borderBottom="1px solid #c0c0c0";q.style.color="gray";mxUtils.write(q,d);l.appendChild(q)}d=document.createElement("div");d.style.padding="6px";d.innerHTML=f;l.appendChild(d);f=document.createElement("div"); f.style.marginTop="16px";f.style.textAlign="center";null!=h&&(d=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();h()}),d.className="geBtn",f.appendChild(d),f.style.textAlign="center");null!=b&&(b=mxUtils.button(b,function(){null!=e&&e()}),b.className="geBtn",f.appendChild(b));var u=mxUtils.button(c,function(){p&&a.hideDialog();null!=g&&g()});u.className="geBtn";f.appendChild(u);null!=m&&(c=mxUtils.button(m,function(){p&&a.hideDialog();null!=n&&n()}),c.className="geBtn gePrimaryBtn", -f.appendChild(c));this.init=function(){u.focus()};l.appendChild(f);this.container=l},EmbedDialog=function(a,d,f,c,g){c=document.createElement("div");var h=/^https?:\/\//.test(d)||/^mailto:\/\//.test(d);mxUtils.write(c,mxResources.get(5E5>d.length?h?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(c);var m=document.createElement("div");m.style.position="absolute";m.style.top="30px";m.style.right="30px";m.style.color="gray";mxUtils.write(m,a.formatFileSize(d.length));c.appendChild(m);var n=document.createElement("textarea"); -n.setAttribute("autocomplete","off");n.setAttribute("autocorrect","off");n.setAttribute("autocapitalize","off");n.setAttribute("spellcheck","false");n.style.marginTop="10px";n.style.resize="none";n.style.height="150px";n.style.width="440px";n.style.border="1px solid gray";n.value=mxResources.get("updatingDocument");c.appendChild(n);mxUtils.br(c);this.init=function(){window.setTimeout(function(){5E5>d.length?(n.value=d,n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS? -n.select():document.execCommand("selectAll",!1,null)):(n.setAttribute("readonly","true"),n.value=d.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};m=document.createElement("div");m.style.position="absolute";m.style.bottom="36px";m.style.right="32px";var p=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!h||navigator.standalone||!(h||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(p=mxUtils.button(mxResources.get(5E5>d.length?"preview":"openInNewWindow"), -function(){var b=5E5>d.length?n.value:d;if(null!=g)g(b);else if(h)try{var e=a.openLink(b);null!=e&&(null==f||0<f)&&window.setTimeout(mxUtils.bind(this,function(){null!=e&&null!=e.location.href&&e.location.href.substring(0,8)!=b.substring(0,8)&&(e.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),f||500)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}else{var c=window.open().document;c.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+ -'</title><meta charset="utf-8"></head><body>'+d+"</body></html>");c.close()}}),p.className="geBtn",m.appendChild(p));if(!h||7500<d.length){var b=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",d,"text/plain")});b.className="geBtn";m.appendChild(b)}if(h&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>d.length){var e=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(n.value);a.openLink(b)}catch(q){a.handleError({message:q.message|| -mxResources.get("drawingTooLarge")})}}),b=document.createElement("img");b.setAttribute("src",Editor.facebookImage);b.setAttribute("width","18");b.setAttribute("height","18");b.setAttribute("border","0");e.appendChild(b);e.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");e.style.verticalAlign="bottom";e.style.paddingTop="4px";e.style.minWidth="46px";e.className="geBtn";m.appendChild(e)}7168>d.length&&(e=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+ -encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(n.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),b=document.createElement("img"),b.setAttribute("src",Editor.tweetImage),b.setAttribute("width","18"),b.setAttribute("height","18"),b.setAttribute("border","0"),b.style.marginBottom="5px",e.appendChild(b),e.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),e.style.verticalAlign= -"bottom",e.style.paddingTop="4px",e.style.minWidth="46px",e.className="geBtn",m.appendChild(e))}b=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});m.appendChild(b);e=mxUtils.button(mxResources.get("copy"),function(){n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>d.length?mxClient.IS_SF||null!=document.documentMode? -b.className="geBtn gePrimaryBtn":(m.appendChild(e),e.className="geBtn gePrimaryBtn",b.className="geBtn"):(m.appendChild(p),b.className="geBtn",p.className="geBtn gePrimaryBtn");c.appendChild(m);this.container=c};EmbedDialog.showPreviewOption=!0; +f.appendChild(c));this.init=function(){u.focus()};l.appendChild(f);this.container=l},EmbedDialog=function(a,d,f,c,g,h){c=document.createElement("div");var m=/^https?:\/\//.test(d)||/^mailto:\/\//.test(d);null!=h?mxUtils.write(c,h):mxUtils.write(c,mxResources.get(5E5>d.length?m?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(c);h=document.createElement("div");h.style.position="absolute";h.style.top="30px";h.style.right="30px";h.style.color="gray";mxUtils.write(h,a.formatFileSize(d.length));c.appendChild(h); +var n=document.createElement("textarea");n.setAttribute("autocomplete","off");n.setAttribute("autocorrect","off");n.setAttribute("autocapitalize","off");n.setAttribute("spellcheck","false");n.style.marginTop="10px";n.style.resize="none";n.style.height="150px";n.style.width="440px";n.style.border="1px solid gray";n.value=mxResources.get("updatingDocument");c.appendChild(n);mxUtils.br(c);this.init=function(){window.setTimeout(function(){5E5>d.length?(n.value=d,n.focus(),mxClient.IS_GC||mxClient.IS_FF|| +5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):(n.setAttribute("readonly","true"),n.value=d.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};h=document.createElement("div");h.style.position="absolute";h.style.bottom="36px";h.style.right="32px";var p=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!m||navigator.standalone||!(m||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(p=mxUtils.button(mxResources.get(5E5> +d.length?"preview":"openInNewWindow"),function(){var b=5E5>d.length?n.value:d;if(null!=g)g(b);else if(m)try{var e=a.openLink(b);null!=e&&(null==f||0<f)&&window.setTimeout(mxUtils.bind(this,function(){null!=e&&null!=e.location.href&&e.location.href.substring(0,8)!=b.substring(0,8)&&(e.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),f||500)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}else{var c=window.open().document;c.writeln("<html><head><title>"+ +encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+d+"</body></html>");c.close()}}),p.className="geBtn",h.appendChild(p));if(!m||7500<d.length){var b=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",d,"text/plain")});b.className="geBtn";h.appendChild(b)}if(m&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>d.length){var e=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+ +encodeURIComponent(n.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),b=document.createElement("img");b.setAttribute("src",Editor.facebookImage);b.setAttribute("width","18");b.setAttribute("height","18");b.setAttribute("border","0");e.appendChild(b);e.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");e.style.verticalAlign="bottom";e.style.paddingTop="4px";e.style.minWidth="46px";e.className="geBtn";h.appendChild(e)}7168> +d.length&&(e=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(n.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),b=document.createElement("img"),b.setAttribute("src",Editor.tweetImage),b.setAttribute("width","18"),b.setAttribute("height","18"),b.setAttribute("border","0"),b.style.marginBottom="5px",e.appendChild(b),e.setAttribute("title", +mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),e.style.verticalAlign="bottom",e.style.paddingTop="4px",e.style.minWidth="46px",e.className="geBtn",h.appendChild(e))}b=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});h.appendChild(b);e=mxUtils.button(mxResources.get("copy"),function(){n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))}); +5E5>d.length?mxClient.IS_SF||null!=document.documentMode?b.className="geBtn gePrimaryBtn":(h.appendChild(e),e.className="geBtn gePrimaryBtn",b.className="geBtn"):(h.appendChild(p),b.className="geBtn",p.className="geBtn gePrimaryBtn");c.appendChild(h);this.container=c};EmbedDialog.showPreviewOption=!0; var GoogleSitesDialog=function(a,d){function f(){var a=null!=y.getTitle()?y.getTitle():this.defaultFilename;if(F.checked&&""!=q.value){var c="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(q.value));null!=a&&(c+="&title="+encodeURIComponent(a));0<C.length&&(c+="&s="+C);""!=u.value&&"0"!=u.value&&(c+="&border="+u.value);""!=l.value&&(c+="&height="+l.value);c+="&pan="+(t.checked?"1":"0");c+="&zoom="+(w.checked?"1":"0");c+="&fit="+(v.checked?"1":"0");c+="&resize="+ (k.checked?"1":"0");c+="&x0="+Number(e.value);c+="&y0="+p;g.mathEnabled&&(c+="&math=1");A.checked?c+="&edit=_blank":x.checked&&(c+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));b.value=c}else y.constructor==DriveFile||y.constructor==DropboxFile?(c="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=q.value?c+=encodeURIComponent(mxUtils.htmlEntities(q.value))+"&type=3":(c+=y.getHash().substring(1),c=y.constructor==DropboxFile?c+"&type=2":c+"&type=1"),null!=a&&(c+="&title="+ encodeURIComponent(a)),""!=l.value&&(a=parseInt(l.value)+parseInt(e.value),c+="&height="+a),b.value=c):b.value=""}var c=document.createElement("div"),g=a.editor.graph,h=g.getGraphBounds(),m=g.view.scale,n=Math.floor(h.x/m-g.view.translate.x),p=Math.floor(h.y/m-g.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var b=document.createElement("input");b.setAttribute("type","text");b.style.marginBottom="8px";b.style.marginTop="2px";b.style.width="410px";c.appendChild(b); @@ -7186,8 +7187,8 @@ function(b){this.editorUi.actions.get("editShape").funct()})),a.setAttribute("ti "3";Graph.prototype.edgeMode="move"!=urlParams.edge;var q=Graph.prototype.init;Graph.prototype.init=function(){function b(b){a=b;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)a=mxUtils.clone(b)}q.apply(this,arguments);var a=null;mxEvent.addListener(this.container,"mouseenter",b);mxEvent.addListener(this.container,"mousemove",b);mxEvent.addListener(this.container,"mouseleave",function(b){a=null});this.isMouseInsertPoint=function(){return null!=a};var e=this.getInsertPoint; this.getInsertPoint=function(){return null!=a?this.getPointForEvent(a):e.apply(this,arguments)};var c=this.layoutManager.getLayout;this.layoutManager.getLayout=function(b){var a=this.graph.view.getState(b),a=null!=a?a.style:this.graph.getCellStyle(b);if("undefined"!=typeof mxRackContainer&&"rack"==a.childLayout){var e=new mxStackLayout(this.graph,!1);e.setChildGeometry=function(b,a){a.height=Math.max(a.height,20);if(1<a.height/20){var e=a.height%20;a.height+=10<e?20-e:-e}this.graph.getModel().setGeometry(b, a)};e.fill=!0;e.unitSize=mxRackContainer.unitSize|20;e.marginLeft=a.marginLeft||0;e.marginRight=a.marginRight||0;e.marginTop=a.marginTop||0;e.marginBottom=a.marginBottom||0;e.resizeParent=!1;return e}return c.apply(this,arguments)}};var u=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){u.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(b){if("data:action/json,"==b.substring(0,17)&&(b=JSON.parse(b.substring(17)),null!=b.actions)){for(var a= -0;a<b.actions.length;a++)null!=b.actions[a].open&&(this.isCustomLink(b.actions[a].open)?this.customLinkClicked(b.actions[a].open):this.openLink(b.actions[a].open));this.model.beginUpdate();try{for(a=0;a<b.actions.length;a++)this.handleLinkAction(b.actions[a])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(b){var a=[];null!=b.select&&this.isEnabled()&&(a=this.getCellsForAction(b.select),this.setSelectionCells(a));null!=b.scroll&&(a=this.getCellsForAction(b.scroll));null!= -b.toggle&&this.toggleCells(this.getCellsForAction(b.toggle));null!=b.show&&this.setCellsVisible(this.getCellsForAction(b.show),!0);null!=b.hide&&this.setCellsVisible(this.getCellsForAction(b.hide),!1);null!=b.highlight&&(a=this.getCellsForAction(b.highlight),this.highlightCells(a,b.highlight.color,b.highlight.duration,b.highlight.opacity));0<a.length&&this.scrollCellToVisible(a[0])};Graph.prototype.getCellsForAction=function(b){return this.getCellsById(b.cells).concat(this.getCellsForTags(b.tags))}; +0;a<b.actions.length;a++)null!=b.actions[a].open&&(this.isCustomLink(b.actions[a].open)?this.customLinkClicked(b.actions[a].open):this.openLink(b.actions[a].open));this.model.beginUpdate();try{for(a=0;a<b.actions.length;a++)this.handleLinkAction(b.actions[a])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(b){var a=[];null!=b.select&&this.isEnabled()&&(a=this.getCellsForAction(b.select),this.setSelectionCells(a));null!=b.highlight&&(a=this.getCellsForAction(b.highlight), +this.highlightCells(a,b.highlight.color,b.highlight.duration,b.highlight.opacity));null!=b.toggle&&this.toggleCells(this.getCellsForAction(b.toggle));null!=b.show&&this.setCellsVisible(this.getCellsForAction(b.show),!0);null!=b.hide&&this.setCellsVisible(this.getCellsForAction(b.hide),!1);null!=b.scroll&&(a=this.getCellsForAction(b.scroll));0<a.length&&this.scrollCellToVisible(a[0])};Graph.prototype.getCellsForAction=function(b){return this.getCellsById(b.cells).concat(this.getCellsForTags(b.tags))}; Graph.prototype.getCellsById=function(b){var a=[];if(null!=b)for(var e=0;e<b.length;e++)if("*"==b[e])var c=this.getDefaultParent(),a=a.concat(this.model.filterDescendants(function(b){return b!=c},c));else{var l=this.model.getCell(b[e]);null!=l&&a.push(l)}return a};Graph.prototype.getCellsForTags=function(b,a,e){var c=[];if(null!=b){a=null!=a?a:this.model.getDescendants(this.model.getRoot());e=null!=e?e:"tags";for(var k=0;k<a.length;k++)if(this.model.isVertex(a[k])||this.model.isEdge(a[k])){var l= null!=a[k].value&&"object"==typeof a[k].value?mxUtils.trim(a[k].value.getAttribute(e)||""):"",f=!0;if(0<l.length)for(var l=l.toLowerCase().split(" "),d=0;d<b.length&&f;d++)var q=mxUtils.trim(b[d]).toLowerCase(),f=f&&(0==q.length||0<=mxUtils.indexOf(l,q));else f=0==b.length;f&&c.push(a[k])}}return c};Graph.prototype.toggleCells=function(b){this.model.beginUpdate();try{for(var a=0;a<b.length;a++)this.model.setVisible(b[a],!this.model.isVisible(b[a]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible= function(b,a){this.model.beginUpdate();try{for(var e=0;e<b.length;e++)this.model.setVisible(b[e],a)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(b,a,e,c){for(var k=0;k<b.length;k++)this.highlightCell(b[k],a,e,c)};Graph.prototype.highlightCell=function(b,a,e,c){a=null!=a?a:mxConstants.DEFAULT_VALID_COLOR;e=null!=e?e:1E3;b=this.view.getState(b);if(null!=b){var k=Math.max(5,mxUtils.getValue(b.style,mxConstants.STYLE_STROKEWIDTH,1)+4),l=new mxCellHighlight(this,a,k,!1);null!= @@ -7203,27 +7204,27 @@ a,e=0;do a=this.model.getChildAt(this.model.root,e);while(e++<b&&"1"==mxUtils.ge [SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl= [SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js", STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(b){var a= -null;null!=b&&0<b.length&&("ER"==b.substring(0,2)?a="mxgraph.er":"sysML"==b.substring(0,5)&&(a="mxgraph.sysml"));return a};var t=mxMarker.createMarker;mxMarker.createMarker=function(b,a,e,c,l,f,d,q,u,g){if(null!=e&&null==mxMarker.markers[e]){var k=this.getPackageForType(e);null!=k&&mxStencilRegistry.getStencil(k)}return t.apply(this,arguments)};PrintDialog.prototype.create=function(b,a){function e(){m.value=Math.max(1,Math.min(q,Math.max(parseInt(m.value),parseInt(h.value))));h.value=Math.max(1,Math.min(q, -Math.min(parseInt(m.value),parseInt(h.value))))}function c(a){function e(a,e,k){var l=a.getGraphBounds(),d=0,f=0,q=ba.get(),g=1/a.pageScale,u=A.checked;if(u)var g=parseInt(Q.value),v=parseInt(P.value),g=Math.min(q.height*v/(l.height/a.view.scale),q.width*g/(l.width/a.view.scale));else g=parseInt(p.value)/(100*a.pageScale),isNaN(g)&&(c=1/a.pageScale,p.value="100 %");q=mxRectangle.fromRectangle(q);q.width=Math.ceil(q.width*c);q.height=Math.ceil(q.height*c);g*=c;!u&&a.pageVisible?(l=a.getPageLayout(), +null;null!=b&&0<b.length&&("ER"==b.substring(0,2)?a="mxgraph.er":"sysML"==b.substring(0,5)&&(a="mxgraph.sysml"));return a};var t=mxMarker.createMarker;mxMarker.createMarker=function(b,a,e,c,l,f,d,q,u,g){if(null!=e&&null==mxMarker.markers[e]){var k=this.getPackageForType(e);null!=k&&mxStencilRegistry.getStencil(k)}return t.apply(this,arguments)};PrintDialog.prototype.create=function(b,a){function e(){x.value=Math.max(1,Math.min(q,Math.max(parseInt(x.value),parseInt(h.value))));h.value=Math.max(1,Math.min(q, +Math.min(parseInt(x.value),parseInt(h.value))))}function c(a){function e(a,e,k){var l=a.getGraphBounds(),d=0,f=0,q=ba.get(),g=1/a.pageScale,u=A.checked;if(u)var g=parseInt(Q.value),v=parseInt(P.value),g=Math.min(q.height*v/(l.height/a.view.scale),q.width*g/(l.width/a.view.scale));else g=parseInt(p.value)/(100*a.pageScale),isNaN(g)&&(c=1/a.pageScale,p.value="100 %");q=mxRectangle.fromRectangle(q);q.width=Math.ceil(q.width*c);q.height=Math.ceil(q.height*c);g*=c;!u&&a.pageVisible?(l=a.getPageLayout(), d-=l.x*q.width,f-=l.y*q.height):u=!0;if(null==e){e=PrintDialog.createPrintPreview(a,g,q,0,d,f,u);e.pageSelector=!1;e.mathEnabled=!1;a=b.getCurrentFile();null!=a&&(e.title=a.getTitle());var w=e.writeHead;e.writeHead=function(a){w.apply(this,arguments);null!=b.editor.fontCss&&(a.writeln('<style type="text/css">'),a.writeln(b.editor.fontCss),a.writeln("</style>"))};if("undefined"!==typeof MathJax){var t=e.renderPage;e.renderPage=function(b,a,e,c,k,l){var d=t.apply(this,arguments);this.graph.mathEnabled? -this.mathEnabled=!0:d.className="geDisableMathJax";return d}}e.open(null,null,k,!0)}else{q=a.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";e.backgroundColor=q;e.autoOrigin=u;e.appendGraph(a,g,d,f,k,!0)}return e}var c=parseInt(U.value)/100;isNaN(c)&&(c=1,U.value="100 %");var c=.75*c,k=h.value,d=m.value,f=!t.checked,q=null;f&&(f=k==u&&d==u);if(!f&&null!=b.pages&&b.pages.length){var g=0,f=b.pages.length-1;t.checked||(g=parseInt(k)-1,f=parseInt(d)-1);for(var v=g;v<=f;v++){var w=b.pages[v], -k=w==b.currentPage?l:null;if(null==k){var k=b.createTemporaryGraph(l.getStylesheet()),d=!0,g=!1,x=null,n=null;null==w.viewState&&null==w.mapping&&null==w.root&&b.updatePageRoot(w);null!=w.viewState?(d=w.viewState.pageVisible,g=w.viewState.mathEnabled,x=w.viewState.background,n=w.viewState.backgroundImage):null!=w.mapping&&null!=w.mapping.diagramMap&&(g="0"!=w.mapping.diagramMap.get("mathEnabled"),x=w.mapping.diagramMap.get("background"),n=w.mapping.diagramMap.get("backgroundImage"),n=null!=n&&0<n.length? -JSON.parse(n):null);k.background=x;k.backgroundImage=null!=n?new mxImage(n.src,n.width,n.height):null;k.pageVisible=d;k.mathEnabled=g;var B=k.getGlobalVariable;k.getGlobalVariable=function(b){return"page"==b?w.getName():"pagenumber"==b?v+1:B.apply(this,arguments)};document.body.appendChild(k.container);b.updatePageRoot(w);k.model.setRoot(w.root)}q=e(k,q,v!=f);k!=l&&k.container.parentNode.removeChild(k.container)}}else q=e(l);q.mathEnabled&&(f=q.wnd.document,f.writeln('<script type="text/x-mathjax-config">'), +this.mathEnabled=!0:d.className="geDisableMathJax";return d}}e.open(null,null,k,!0)}else{q=a.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";e.backgroundColor=q;e.autoOrigin=u;e.appendGraph(a,g,d,f,k,!0)}return e}var c=parseInt(U.value)/100;isNaN(c)&&(c=1,U.value="100 %");var c=.75*c,k=h.value,d=x.value,f=!t.checked,q=null;f&&(f=k==u&&d==u);if(!f&&null!=b.pages&&b.pages.length){var g=0,f=b.pages.length-1;t.checked||(g=parseInt(k)-1,f=parseInt(d)-1);for(var v=g;v<=f;v++){var w=b.pages[v], +k=w==b.currentPage?l:null;if(null==k){var k=b.createTemporaryGraph(l.getStylesheet()),d=!0,g=!1,m=null,n=null;null==w.viewState&&null==w.mapping&&null==w.root&&b.updatePageRoot(w);null!=w.viewState?(d=w.viewState.pageVisible,g=w.viewState.mathEnabled,m=w.viewState.background,n=w.viewState.backgroundImage):null!=w.mapping&&null!=w.mapping.diagramMap&&(g="0"!=w.mapping.diagramMap.get("mathEnabled"),m=w.mapping.diagramMap.get("background"),n=w.mapping.diagramMap.get("backgroundImage"),n=null!=n&&0<n.length? +JSON.parse(n):null);k.background=m;k.backgroundImage=null!=n?new mxImage(n.src,n.width,n.height):null;k.pageVisible=d;k.mathEnabled=g;var B=k.getGlobalVariable;k.getGlobalVariable=function(b){return"page"==b?w.getName():"pagenumber"==b?v+1:B.apply(this,arguments)};document.body.appendChild(k.container);b.updatePageRoot(w);k.model.setRoot(w.root)}q=e(k,q,v!=f);k!=l&&k.container.parentNode.removeChild(k.container)}}else q=e(l);q.mathEnabled&&(f=q.wnd.document,f.writeln('<script type="text/x-mathjax-config">'), f.writeln("MathJax.Hub.Config({"),f.writeln('messageStyle: "none",'),f.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),f.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),f.writeln('"HTML-CSS": {'),f.writeln("imageFont: null"),f.writeln("},"),f.writeln("TeX: {"),f.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),f.writeln("},"),f.writeln("tex2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("},"), f.writeln("asciimath2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("}"),f.writeln("});"),a&&(f.writeln("MathJax.Hub.Queue(function () {"),f.writeln("window.print();"),f.writeln("});")),f.writeln("\x3c/script>"),f.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>'));q.closeDocument();!q.mathEnabled&&a&&PrintDialog.printPreview(q)}var l=b.editor.graph,f=document.createElement("div"),d=document.createElement("h3");d.style.width="100%"; d.style.textAlign="center";d.style.marginTop="0px";mxUtils.write(d,a||mxResources.get("print"));f.appendChild(d);var q=1,u=1,g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","all");t.setAttribute("type","radio");t.setAttribute("name","pages-printdialog");g.appendChild(t);d=document.createElement("span");mxUtils.write(d, mxResources.get("printAllPages"));g.appendChild(d);mxUtils.br(g);var w=t.cloneNode(!0);t.setAttribute("checked","checked");w.setAttribute("value","range");g.appendChild(w);d=document.createElement("span");mxUtils.write(d,mxResources.get("pages")+":");g.appendChild(d);var h=document.createElement("input");h.style.cssText="margin:0 8px 0 8px;";h.setAttribute("value","1");h.setAttribute("type","number");h.setAttribute("min","1");h.style.width="50px";g.appendChild(h);d=document.createElement("span"); -mxUtils.write(d,mxResources.get("to"));g.appendChild(d);var m=h.cloneNode(!0);g.appendChild(m);mxEvent.addListener(h,"focus",function(){w.checked=!0});mxEvent.addListener(m,"focus",function(){w.checked=!0});mxEvent.addListener(h,"change",e);mxEvent.addListener(m,"change",e);if(null!=b.pages&&(q=b.pages.length,null!=b.currentPage))for(d=0;d<b.pages.length;d++)if(b.currentPage==b.pages[d]){u=d+1;h.value=u;m.value=u;break}h.setAttribute("max",q);m.setAttribute("max",q);1<q&&f.appendChild(g);var x=document.createElement("div"); -x.style.marginBottom="10px";var n=document.createElement("input");n.style.marginRight="8px";n.setAttribute("value","adjust");n.setAttribute("type","radio");n.setAttribute("name","printZoom");x.appendChild(n);d=document.createElement("span");mxUtils.write(d,mxResources.get("adjustTo"));x.appendChild(d);var p=document.createElement("input");p.style.cssText="margin:0 8px 0 8px;";p.setAttribute("value","100 %");p.style.width="50px";x.appendChild(p);mxEvent.addListener(p,"focus",function(){n.checked=!0}); -f.appendChild(x);var g=g.cloneNode(!1),A=n.cloneNode(!0);A.setAttribute("value","fit");n.setAttribute("checked","checked");d=document.createElement("div");d.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";d.appendChild(A);g.appendChild(d);x=document.createElement("table");x.style.display="inline-block";var N=document.createElement("tbody"),S=document.createElement("tr"),O=S.cloneNode(!0),G=document.createElement("td"),W=G.cloneNode(!0),R=G.cloneNode(!0),T=G.cloneNode(!0), +mxUtils.write(d,mxResources.get("to"));g.appendChild(d);var x=h.cloneNode(!0);g.appendChild(x);mxEvent.addListener(h,"focus",function(){w.checked=!0});mxEvent.addListener(x,"focus",function(){w.checked=!0});mxEvent.addListener(h,"change",e);mxEvent.addListener(x,"change",e);if(null!=b.pages&&(q=b.pages.length,null!=b.currentPage))for(d=0;d<b.pages.length;d++)if(b.currentPage==b.pages[d]){u=d+1;h.value=u;x.value=u;break}h.setAttribute("max",q);x.setAttribute("max",q);1<q&&f.appendChild(g);var m=document.createElement("div"); +m.style.marginBottom="10px";var n=document.createElement("input");n.style.marginRight="8px";n.setAttribute("value","adjust");n.setAttribute("type","radio");n.setAttribute("name","printZoom");m.appendChild(n);d=document.createElement("span");mxUtils.write(d,mxResources.get("adjustTo"));m.appendChild(d);var p=document.createElement("input");p.style.cssText="margin:0 8px 0 8px;";p.setAttribute("value","100 %");p.style.width="50px";m.appendChild(p);mxEvent.addListener(p,"focus",function(){n.checked=!0}); +f.appendChild(m);var g=g.cloneNode(!1),A=n.cloneNode(!0);A.setAttribute("value","fit");n.setAttribute("checked","checked");d=document.createElement("div");d.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";d.appendChild(A);g.appendChild(d);m=document.createElement("table");m.style.display="inline-block";var N=document.createElement("tbody"),S=document.createElement("tr"),O=S.cloneNode(!0),G=document.createElement("td"),W=G.cloneNode(!0),R=G.cloneNode(!0),T=G.cloneNode(!0), V=G.cloneNode(!0),I=G.cloneNode(!0);G.style.textAlign="right";T.style.textAlign="right";mxUtils.write(G,mxResources.get("fitTo"));var Q=document.createElement("input");Q.style.cssText="margin:0 8px 0 8px;";Q.setAttribute("value","1");Q.setAttribute("min","1");Q.setAttribute("type","number");Q.style.width="40px";W.appendChild(Q);d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsAcross"));R.appendChild(d);mxUtils.write(T,mxResources.get("fitToBy"));var P=Q.cloneNode(!0);V.appendChild(P); -mxEvent.addListener(Q,"focus",function(){A.checked=!0});mxEvent.addListener(P,"focus",function(){A.checked=!0});d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsDown"));I.appendChild(d);S.appendChild(G);S.appendChild(W);S.appendChild(R);O.appendChild(T);O.appendChild(V);O.appendChild(I);N.appendChild(S);N.appendChild(O);x.appendChild(N);g.appendChild(x);f.appendChild(g);g=document.createElement("div");d=document.createElement("div");d.style.fontWeight="bold";d.style.marginBottom= +mxEvent.addListener(Q,"focus",function(){A.checked=!0});mxEvent.addListener(P,"focus",function(){A.checked=!0});d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsDown"));I.appendChild(d);S.appendChild(G);S.appendChild(W);S.appendChild(R);O.appendChild(T);O.appendChild(V);O.appendChild(I);N.appendChild(S);N.appendChild(O);m.appendChild(N);g.appendChild(m);f.appendChild(g);g=document.createElement("div");d=document.createElement("div");d.style.fontWeight="bold";d.style.marginBottom= "12px";mxUtils.write(d,mxResources.get("paperSize"));g.appendChild(d);d=document.createElement("div");d.style.marginBottom="12px";var ba=PageSetupDialog.addPageFormatPanel(d,"printdialog",b.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);g.appendChild(d);d=document.createElement("span");mxUtils.write(d,mxResources.get("pageScale"));g.appendChild(d);var U=document.createElement("input");U.style.cssText="margin:0 8px 0 8px;";U.setAttribute("value","100 %");U.style.width="60px";g.appendChild(U); -f.appendChild(g);d=document.createElement("div");d.style.cssText="text-align:right;margin:62px 0 0 0;";g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});g.className="geBtn";b.editor.cancelFirst&&d.appendChild(g);b.isOffline()||(x=mxUtils.button(mxResources.get("help"),function(){l.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),x.className="geBtn",d.appendChild(x));PrintDialog.previewEnabled&&(x=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog(); -c(!1)}),x.className="geBtn",d.appendChild(x));x=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();c(!0)});x.className="geBtn gePrimaryBtn";d.appendChild(x);b.editor.cancelFirst||d.appendChild(g);f.appendChild(d);this.container=f};var w=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background= +f.appendChild(g);d=document.createElement("div");d.style.cssText="text-align:right;margin:62px 0 0 0;";g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});g.className="geBtn";b.editor.cancelFirst&&d.appendChild(g);b.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){l.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",d.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog(); +c(!1)}),m.className="geBtn",d.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();c(!0)});m.className="geBtn gePrimaryBtn";d.appendChild(m);b.editor.cancelFirst||d.appendChild(g);f.appendChild(d);this.container=f};var w=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background= this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(w.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!= this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})(); -(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,f,c){c.ui=a.ui;return f};a.afterDecode=function(a,f,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.8.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>'; +(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,f,c){c.ui=a.ui;return f};a.afterDecode=function(a,f,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.8.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";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.sidebarFooterHeight=36;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.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport= !1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var b=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!b.getContext||!b.getContext("2d"))}catch(u){}try{var a=document.createElement("canvas"),c=new Image;c.onload=function(){try{a.getContext("2d").drawImage(c,0,0);var b=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport= @@ -7286,10 +7287,10 @@ w:c.width,h:c.height};null!=k&&(b.title=k);a.push(b);z(e);null!=d&&null!=d.paren c.y-=n.view.translate.y;D(a,c)}mxEvent.consume(b)});g.style.border="3px solid transparent";mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(b){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="hidden",null!=d?d.style.border="3px dotted rgb(254, 137, 12)":g.style.border="3px dotted rgb(254, 137, 12)",g.style.cursor="copy",n.panningManager.stop(),n.autoScroll=!1,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!1), null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(b))}),mxUtils.bind(this,function(b){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler&&(g.style.border="3px solid transparent",null!=d&&(d.style.border="3px dotted lightGray"),g.style.cursor="default",this.sidebar.showTooltips=!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,L(b),mxEvent.consume(b))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(b){n.isMouseDown&& null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="visible",g.style.border="3px solid transparent",g.style.cursor="",n.autoScroll=!0,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!0),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="visible"),null!=d&&(d.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(b){null!=d?d.style.border="3px dotted rgb(254, 137, 12)":g.style.border="3px dotted rgb(254, 137, 12)"; -b.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(b){g.style.border="3px solid transparent";g.style.cursor="";null!=d&&(d.style.border="3px dotted lightGray");0<b.dataTransfer.files.length&&this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,e,k,l,q,v,w,u,t){if(null!=c&&"image/"==e.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+ -this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,v),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,q,v),b,mxEvent.isAltDown(b)?null:w.substring(0,w.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null);else{var h=!1,m=mxUtils.bind(this,function(c,e){if(null!=c&&"text/xml"==e){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(k.documentElement));f(l,g);a=a.concat(l);z(b); -this.spinner.stop();h=!0}catch(U){}else if("mxfile"==k.documentElement.nodeName)try{for(var q=k.documentElement.getElementsByTagName("diagram"),k=0;k<q.length;k++){var l=mxUtils.getTextContent(q[k]),v=this.stringToCells(this.editor.graph.decompress(l)),w=this.editor.graph.getBoundingBoxFromGeometry(v);D(v,new mxRectangle(0,0,w.width,w.height),b)}h=!0}catch(U){null!=window.console&&console.log("error in drop handler:",U)}}h||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")})); -null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)});null!=t&&null!=w&&(/(\.vsdx?)($|\?)/i.test(w)||/(\.vssx)($|\?)/i.test(w))?this.importVisio(t,function(b){m(b,"text/xml")},null,w):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,w)&&null!=t?this.parseFile(t,mxUtils.bind(this,function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?m(b.responseText,"text/xml"):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge": +b.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(b){g.style.border="3px solid transparent";g.style.cursor="";null!=d&&(d.style.border="3px dotted lightGray");0<b.dataTransfer.files.length&&this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,e,k,l,q,v,w,u,h){if(null!=c&&"image/"==e.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+ +this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,v),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,q,v),b,mxEvent.isAltDown(b)?null:w.substring(0,w.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null);else{var t=!1,m=mxUtils.bind(this,function(c,e){if(null!=c&&"text/xml"==e){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(k.documentElement));f(l,g);a=a.concat(l);z(b); +this.spinner.stop();t=!0}catch(U){}else if("mxfile"==k.documentElement.nodeName)try{for(var q=k.documentElement.getElementsByTagName("diagram"),k=0;k<q.length;k++){var l=mxUtils.getTextContent(q[k]),v=this.stringToCells(this.editor.graph.decompress(l)),w=this.editor.graph.getBoundingBoxFromGeometry(v);D(v,new mxRectangle(0,0,w.width,w.height),b)}t=!0}catch(U){null!=window.console&&console.log("error in drop handler:",U)}}t||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")})); +null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)});null!=h&&null!=w&&(/(\.vsdx?)($|\?)/i.test(w)||/(\.vssx)($|\?)/i.test(w))?this.importVisio(h,function(b){m(b,"text/xml")},null,w):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,w)&&null!=h?this.parseFile(h,mxUtils.bind(this,function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?m(b.responseText,"text/xml"):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge": "invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):m(c,e)}}));b.stopPropagation();b.preventDefault()})),mxEvent.addListener(g,"dragleave",function(b){null!=d?d.style.border="3px dotted lightGray":(g.style.border="3px solid transparent",g.style.cursor="");b.stopPropagation();b.preventDefault()}));v=v.cloneNode(!1);v.setAttribute("src",Editor.editImage);v.setAttribute("title",mxResources.get("edit"));k.insertBefore(v,k.firstChild);mxEvent.addListener(v,"click",K);mxEvent.addListener(g, "dblclick",function(b){mxEvent.getSource(b)==g&&K(b)});c=v.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));k.insertBefore(c,k.firstChild);mxEvent.addListener(c,"click",L);this.isOffline()||".scratchpad"!=b.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c, mxUtils.bind(this,function(b){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(b)})),k.insertBefore(c,k.firstChild))}h.appendChild(k);h.style.paddingRight=18*k.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var b=document.getElementById("geFooter"); @@ -7318,12 +7319,12 @@ this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exp "4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=e.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";e=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=e.zIndex;var d=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});d.spin(this.exportDialog); this.exportToCanvas(mxUtils.bind(this,function(b){d.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var a=this.createImageDataUri(b,null,"png");b=document.createElement("img");b.style.maxWidth="140px";b.style.maxHeight="140px";b.style.cursor="pointer";b.setAttribute("title",mxResources.get("openInNewWindow"));b.setAttribute("border","0");b.setAttribute("src",a);this.exportDialog.appendChild(b);mxEvent.addListener(b,"click",mxUtils.bind(this, function(){this.openInNewWindow(a.substring(a.indexOf(",")+1),"image/png",!0);c.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(b)}),Editor.cameraLargeImage,mxResources.get("export"))}d.apply(this,arguments)};EditorUi.prototype.saveData=function(b,a,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c, -b,d,f,a):this.saveRequest(b,a,mxUtils.bind(this,function(b,e){return this.createEchoRequest(c,b,d,f,a,e)}),c,f,d)};EditorUi.prototype.saveRequest=function(b,a,c,d,f,g,w){w=null!=w?w:!mxClient.IS_IOS||!navigator.standalone;var e=this.getServiceCount(!1);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){if("_blank"==e||null!=b&&0<b.length){var k=c("_blank"==e?null:b,e==App.MODE_DEVICE||"download"==e||null==e||"_blank"==e?"0":"1");null!=k&&(e==App.MODE_DEVICE||"download"==e||"_blank"==e?k.simulate(document, +b,d,f,a):this.saveRequest(b,a,mxUtils.bind(this,function(b,e){return this.createEchoRequest(c,b,d,f,a,e)}),c,f,d)};EditorUi.prototype.saveRequest=function(b,a,c,d,f,g,h){h=null!=h?h:!mxClient.IS_IOS||!navigator.standalone;var e=this.getServiceCount(!1);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){if("_blank"==e||null!=b&&0<b.length){var k=c("_blank"==e?null:b,e==App.MODE_DEVICE||"download"==e||null==e||"_blank"==e?"0":"1");null!=k&&(e==App.MODE_DEVICE||"download"==e||"_blank"==e?k.simulate(document, "_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==a?"application/pdf":"image/"+a;if(null!=d)try{this.exportFile(d,b,g,!0,e,c)}catch(C){this.handleError(C)}else this.spinner.spin(document.body,mxResources.get("saving"))&&k.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=k.getStatus()&&299>=k.getStatus())try{this.exportFile(k.getText(),b,g,!0,e,c)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(b){this.spinner.stop(); -this.handleError(b)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,w,null,1<e,4<e?3:4,d,g,f);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(b,a,c,d,f,g){};EditorUi.prototype.pickFolder=function(b,a,c){a(null)};EditorUi.prototype.exportSvg=function(b,a,c,d,f,g,w,h,m){if(this.spinner.spin(document.body, -mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=a?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==a&&(e="#ffffff");var l=this.editor.graph.getSvg(e,b,w,h,null,c);d&&this.editor.graph.addSvgShadow(l);var q=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(b){this.spinner.stop();f&&b.setAttribute("content",this.getFileData(!0,null,null,null,c,m));if(null!=this.editor.fontCss){var a=b.ownerDocument,a=null!=a.createElementNS? +this.handleError(b)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,h,null,1<e,4<e?3:4,d,g,f);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(b,a,c,d,f,g){};EditorUi.prototype.pickFolder=function(b,a,c){a(null)};EditorUi.prototype.exportSvg=function(b,a,c,d,f,g,h,m,n){if(this.spinner.spin(document.body, +mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=a?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==a&&(e="#ffffff");var l=this.editor.graph.getSvg(e,b,h,m,null,c);d&&this.editor.graph.addSvgShadow(l);var q=this.getBaseFilename()+".svg",w=mxUtils.bind(this,function(b){this.spinner.stop();f&&b.setAttribute("content",this.getFileData(!0,null,null,null,c,n));if(null!=this.editor.fontCss){var a=b.ownerDocument,a=null!=a.createElementNS? a.createElementNS(mxConstants.NS_SVG,"style"):a.createElement("style");a.setAttribute("type","text/css");mxUtils.setTextContent(a,this.editor.fontCss);b.getElementsByTagName("defs")[0].appendChild(a)}var e='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(b);this.isLocalFileSave()||e.length<=MAX_REQUEST_SIZE?this.saveData(q,"svg",e,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"), -mxUtils.bind(this,function(){mxUtils.popup(e)}))});this.convertMath(this.editor.graph,l,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(l,u,this.thumbImageCache)):u(l)}))}};EditorUi.prototype.addCheckbox=function(b,a,c,d,f,g){g=null!=g?g:!0;var e=document.createElement("input");e.style.marginRight="8px";e.style.marginTop="16px";e.setAttribute("type","checkbox");c&&(e.setAttribute("checked","checked"),e.defaultChecked=!0);d&&e.setAttribute("disabled", +mxUtils.bind(this,function(){mxUtils.popup(e)}))});this.convertMath(this.editor.graph,l,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(l,w,this.thumbImageCache)):w(l)}))}};EditorUi.prototype.addCheckbox=function(b,a,c,d,f,g){g=null!=g?g:!0;var e=document.createElement("input");e.style.marginRight="8px";e.style.marginTop="16px";e.setAttribute("type","checkbox");c&&(e.setAttribute("checked","checked"),e.defaultChecked=!0);d&&e.setAttribute("disabled", "disabled");g&&(b.appendChild(e),c=document.createElement("span"),mxUtils.write(c,a),b.appendChild(c),f||mxUtils.br(b),mxEvent.addListener(c,"click",mxUtils.bind(this,function(b){"disabled"!=e.getAttribute("disabled")&&(e.checked=!e.checked,mxEvent.consume(b))})));return e};EditorUi.prototype.addEditButton=function(b,a){var c=this.addCheckbox(b,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var e=this.getCurrentFile(),d="";null!=e&&e.getMode()!=App.MODE_DEVICE&&e.getMode()!=App.MODE_BROWSER&& (d=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("makeCopy"));f.appendChild(e);e=document.createElement("option");e.setAttribute("value","custom");mxUtils.write(e,mxResources.get("custom")+"...");f.appendChild(e);b.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if("custom"== f.value){var b=new FilenameDialog(this,d,mxResources.get("ok"),function(b){null!=b?d=b:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.value="blank"});this.showDialog(b.container,300,80,!0,!1);b.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==a||a.checked)?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")}));mxUtils.br(b);return{getLink:function(){return c.checked?"blank"===f.value?"_blank":d:null},getEditInput:function(){return c}, @@ -7343,19 +7344,19 @@ L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("di mxUtils.write(l,b||mxResources.get("link"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(l);var q=this.getCurrentFile(),l="https://desk.draw.io/support/solutions/articles/16000051941";b=0;if(null!=q&&q.constructor==window.DriveFile&&!a){b=80;var l="https://desk.draw.io/support/solutions/articles/16000039384",k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;"; var v=document.createElement("div");v.style.whiteSpace="normal";mxUtils.write(v,mxResources.get("linkAccountRequired"));k.appendChild(v);v=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(q.getId())}));v.style.marginTop="12px";v.className="geBtn";k.appendChild(v);e.appendChild(k);v=document.createElement("a");v.style.paddingLeft="12px";v.style.color="gray";v.style.fontSize="11px";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("check")); k.appendChild(v);mxEvent.addListener(v,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(b){this.spinner.stop();b=new ErrorDialog(this,null,mxResources.get(null!=b?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(b.container,300,80,!0,!1);b.init()}))}))}var h=null,m=null;if(null!=c||null!=d)b+=30,mxUtils.write(e,mxResources.get("width")+":"),h=document.createElement("input"), -h.setAttribute("type","text"),h.style.marginRight="16px",h.style.width="50px",h.style.marginLeft="6px",h.style.marginRight="16px",h.style.marginBottom="10px",h.value="100%",e.appendChild(h),mxUtils.write(e,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=d+"px",e.appendChild(m),mxUtils.br(e);var u=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var n=null; -if(null==q||q.constructor!=window.DriveFile||a)n=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var t=this.addCheckbox(e,mxResources.get("lightbox"),!0),p=this.addEditButton(e,t),L=p.getEditInput(),B=this.addCheckbox(e,mxResources.get("layers"),!0);B.style.marginLeft=L.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(t,"change",function(){t.checked?(B.removeAttribute("disabled"),L.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),L.setAttribute("disabled", -"disabled"));L.checked&&t.checked?p.getEditSelect().removeAttribute("disabled"):p.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){f(u.getTarget(),u.getColor(),null==n?!0:n.checked,t.checked,p.getLink(),B.checked,null!=h?h.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),l);this.showDialog(a.container,340,254+b,!0,!0);null!=h?(h.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?h.select(): -document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(f);var g=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),l=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"), -!0),f=this.editor.graph,q=d?null:this.addCheckbox(e,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=q&&(q.style.marginBottom="16px");b=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!g.checked,null!=l?l.checked:!1,null!=q?q.checked:!1)}),null,b,a);this.showDialog(b.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(b,a,c,d,f,g,h,m){h=null!=h?h:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var k= +h.setAttribute("type","text"),h.style.marginRight="16px",h.style.width="50px",h.style.marginLeft="6px",h.style.marginRight="16px",h.style.marginBottom="10px",h.value="100%",e.appendChild(h),mxUtils.write(e,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=d+"px",e.appendChild(m),mxUtils.br(e);var n=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var u=null; +if(null==q||q.constructor!=window.DriveFile||a)u=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var t=this.addCheckbox(e,mxResources.get("lightbox"),!0),p=this.addEditButton(e,t),L=p.getEditInput(),B=this.addCheckbox(e,mxResources.get("layers"),!0);B.style.marginLeft=L.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(t,"change",function(){t.checked?(B.removeAttribute("disabled"),L.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),L.setAttribute("disabled", +"disabled"));L.checked&&t.checked?p.getEditSelect().removeAttribute("disabled"):p.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){f(n.getTarget(),n.getColor(),null==u?!0:u.checked,t.checked,p.getLink(),B.checked,null!=h?h.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),l);this.showDialog(a.container,340,254+b,!0,!0);null!=h?(h.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?h.select(): +document.execCommand("selectAll",!1,null)):n.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(f);var g=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),l=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"), +!0),f=this.editor.graph,h=d?null:this.addCheckbox(e,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=h&&(h.style.marginBottom="16px");b=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!g.checked,null!=l?l.checked:!1,null!=h?h.checked:!1)}),null,b,a);this.showDialog(b.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(b,a,c,d,f,g,h,m){h=null!=h?h:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var k= this.editor.graph,l="jpeg"==m?196:300,q=document.createElement("h3");mxUtils.write(q,b);q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(q);mxUtils.write(e,mxResources.get("zoom")+":");var w=document.createElement("input");w.setAttribute("type","text");w.style.marginRight="16px";w.style.width="60px";w.style.marginLeft="4px";w.style.marginRight="12px";w.value=this.lastExportZoom||"100%";e.appendChild(w);mxUtils.write(e,mxResources.get("borderWidth")+":"); var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.value=this.lastExportBorder||"0";e.appendChild(n);mxUtils.br(e);var u=this.addCheckbox(e,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=m),t=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),p=document.createElement("input");p.style.marginTop="16px";p.style.marginRight= "8px";p.style.marginLeft="24px";p.setAttribute("disabled","disabled");p.setAttribute("type","checkbox");g&&(e.appendChild(p),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),l+=26,mxEvent.addListener(t,"change",function(){t.checked?p.removeAttribute("disabled"):p.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(p.setAttribute("checked","checked"),p.defaultChecked=!0);var x=this.addCheckbox(e,mxResources.get("shadow"),k.shadowVisible),B=document.createElement("input");B.style.marginTop= "16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");a&&(e.appendChild(B),mxUtils.write(e,mxResources.get("embedImages")),mxUtils.br(e),l+=26);var H=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=m),E=null!=this.pages&&1<this.pages.length,J=this.addCheckbox(e,E?mxResources.get("allPages"):"",E,!E,null,"jpeg"!=m);J.style.marginLeft="24px";J.style.marginBottom="16px";E||(J.style.visibility= "hidden");mxEvent.addListener(H,"change",function(){H.checked&&E?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});h&&E||J.setAttribute("disabled","disabled");b=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=n.value;this.lastExportZoom=w.value;f(w.value,u.checked,!t.checked,x.checked,H.checked,B.checked,n.value,p.checked,!J.checked)}),null,c,d);this.showDialog(b.container,340,l,!0,!0);w.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| -mxClient.IS_QUIRKS?w.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(b,a,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=this.editor.graph;if(null!=a){var l=document.createElement("h3");mxUtils.write(l,a);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(l)}var q=this.addCheckbox(e,mxResources.get("fit"),!0),k=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible&&d, -!d),v=this.addCheckbox(e,c),h=this.addCheckbox(e,mxResources.get("lightbox"),!0),m=this.addEditButton(e,h),n=m.getEditInput(),u=1<g.model.getChildCount(g.model.getRoot()),p=this.addCheckbox(e,mxResources.get("layers"),u,!u);p.style.marginLeft=n.style.marginLeft;p.style.marginBottom="12px";p.style.marginTop="8px";mxEvent.addListener(h,"change",function(){h.checked?(u&&p.removeAttribute("disabled"),n.removeAttribute("disabled")):(p.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled")); -n.checked&&h.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){b(q.checked,k.checked,v.checked,h.checked,m.getLink(),p.checked)}),null,mxResources.get("embed"),f);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,f,g,h,m){function e(a){var e=" ",l="";d&&(e=" 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('https://www.draw.io/?client=1&lightbox=1"+ +mxClient.IS_QUIRKS?w.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(b,a,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=this.editor.graph;if(null!=a){var l=document.createElement("h3");mxUtils.write(l,a);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(l)}var h=this.addCheckbox(e,mxResources.get("fit"),!0),k=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible&&d, +!d),v=this.addCheckbox(e,c),q=this.addCheckbox(e,mxResources.get("lightbox"),!0),m=this.addEditButton(e,q),n=m.getEditInput(),u=1<g.model.getChildCount(g.model.getRoot()),p=this.addCheckbox(e,mxResources.get("layers"),u,!u);p.style.marginLeft=n.style.marginLeft;p.style.marginBottom="12px";p.style.marginTop="8px";mxEvent.addListener(q,"change",function(){q.checked?(u&&p.removeAttribute("disabled"),n.removeAttribute("disabled")):(p.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled")); +n.checked&&q.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){b(h.checked,k.checked,v.checked,q.checked,m.getLink(),p.checked)}),null,mxResources.get("embed"),f);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,f,g,h,m){function e(a){var e=" ",l="";d&&(e=" 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('https://www.draw.io/?client=1&lightbox=1"+ (f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");b&&(l+="max-width:100%;");var v="";c&&(v=' width="'+Math.round(k.width)+'" height="'+Math.round(k.height)+'"');h('<img src="'+a+'"'+v+(""!=l?' style="'+l+'"':"")+e+"/>")}var k=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(b){var a=d?this.getFileData(!0):null;b=this.createImageDataUri(b,a,"png");e(b)}),null,null,null,mxUtils.bind(this,function(b){m({message:mxResources.get("unknownError")})}), null,!0,c?2:1,null,a);else if(a=this.getFileData(!0),k.width*k.height<=MAX_AREA&&a.length<=MAX_REQUEST_SIZE){var l="";c&&(l="&w="+Math.round(2*k.width)+"&h="+Math.round(2*k.height));var q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+l+"&xml="+encodeURIComponent(a));q.send(mxUtils.bind(this,function(){200<=q.getStatus()&&299>=q.getStatus()?e("data:image/png;base64,"+q.getText()):m({message:mxResources.get("unknownError")})}))}else m({message:mxResources.get("drawingTooLarge")})}; EditorUi.prototype.createEmbedSvg=function(b,a,c,d,f,g,h){var e=this.editor.graph.getSvg(),l=e.getElementsByTagName("a");if(null!=l)for(var k=0;k<l.length;k++){var v=l[k].getAttribute("href");null!=v&&"#"==v.charAt(0)&&"_blank"==l[k].getAttribute("target")&&l[k].removeAttribute("target")}d&&e.setAttribute("content",this.getFileData(!0));a&&this.editor.graph.addSvgShadow(e);if(c){var q=" ",m="";d&&(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('https://www.draw.io/?client=1&lightbox=1"+ @@ -7388,117 +7389,117 @@ for(a=1;a<b.length;a++)this.insertPage(),this.pasteLucidChart(b[a]);this.selectP a,c,!0))}));else if("data:"==b.substring(0,5)||!this.isOffline()&&(f||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b))){var e=this.editor.graph;if("data:image/png;base64,"==b.substring(0,22)){var l=this.extractGraphModelFromPng(b),k=this.importXml(l,a,c,g,!0);if(0<k.length)return k}if("data:image/svg+xml;"==b.substring(0,19))try{if(l=null,"data:image/svg+xml;base64,"==b.substring(0,26)?(l=b.substring(b.indexOf(",")+1),l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0)):l=decodeURIComponent(b.substring(b.indexOf(",")+ 1)),k=this.importXml(l,a,c,g,!0),0<k.length)return k}catch(v){}this.loadImage(b,mxUtils.bind(this,function(d){if("data:"==b.substring(0,5))this.resizeImage(d,b,mxUtils.bind(this,function(b,d,f){e.setSelectionCell(e.insertVertex(null,null,"",e.snap(a),e.snap(c),d,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(b)+";"))}),h,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/ d.height)),k=Math.round(d.width*f);d=Math.round(d.height*f);e.setSelectionCell(e.insertVertex(null,null,"",e.snap(a),e.snap(c),k,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b+";"))}}),mxUtils.bind(this,function(){var f=null;e.getModel().beginUpdate();try{f=e.insertVertex(e.getDefaultParent(),null,b,e.snap(a),e.snap(c),1,1,"text;"+(d?"html=1;":"")),e.updateCellSize(f),e.fireEvent(new mxEventObject("textInserted","cells", -[f]))}finally{e.getModel().endUpdate()}e.setSelectionCell(f)}))}else{b=this.editor.graph.zapGremlins(mxUtils.trim(b));if(this.isCompatibleString(b))return this.importXml(b,a,c,g);if(0<b.length)if('{"state":"{\\"Properties\\":'==b.substring(0,26))this.importLucidChart(b,a,c,g);else{e=this.editor.graph;f=null;e.getModel().beginUpdate();try{f=e.insertVertex(e.getDefaultParent(),null,"",e.snap(a),e.snap(c),1,1,"text;"+(d?"html=1;":"")),e.fireEvent(new mxEventObject("textInserted","cells",[f])),f.value= -b,e.updateCellSize(f),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(f.value)&&e.setLinkForCell(f,f.value),f.geometry.width+=e.gridSize,f.geometry.height+=e.gridSize}finally{e.getModel().endUpdate()}return[f]}}return[]};EditorUi.prototype.formatFileSize=function(b){var a=-1;do b/=1024,a++;while(1024<b);return Math.max(b,.1).toFixed(1)+ -" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[a]};EditorUi.prototype.convertDataUri=function(b){if("data:"==b.substring(0,5)){var a=b.indexOf(";");0<a&&(b=b.substring(0,a)+b.substring(b.indexOf(",",a+1)))}return b};EditorUi.prototype.isRemoteFileFormat=function(b,a){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(b)};EditorUi.prototype.importLocalFile=function(b,a){if(b&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input"); -c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!a){var e=Editor.useLocalStorage;Editor.useLocalStorage=!b}window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,a){if(null!=a&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(a)){var c=new Blob([b],{type:"application/octet-stream"}); -this.importVisio(c,mxUtils.bind(this,function(b){this.importXml(b)}),null,a)}else this.editor.graph.setSelectionCells(this.importXml(b))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!a){var d=this.dialog,f=d.close;this.dialog.close=mxUtils.bind(this,function(b){Editor.useLocalStorage=e;f.apply(d,arguments);b&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(b,a,c,d,f,g,h,m,n,k, -v){k=null!=k?k:!0;var e=!1,l=null,q=mxUtils.bind(this,function(b){var a=null;null!=b&&"<mxlibrary"==b.substring(0,10)?this.loadLibrary(new LocalLibrary(this,b,h)):a=this.importXml(b,c,d,k);null!=m&&m(a)});"image"==a.substring(0,5)?(n=!1,"image/png"==a.substring(0,9)&&(a=v?null:this.extractGraphModelFromPng(b),null!=a&&0<a.length&&(l=this.importXml(a,c,d,k),n=!0)),n||(l=this.editor.graph,a=b.indexOf(";"),0<a&&(b=b.substring(0,a)+b.substring(b.indexOf(",",a+1))),k&&l.isGridEnabled()&&(c=l.snap(c),d= -l.snap(d)),l=[l.insertVertex(null,null,"",c,d,f,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b+";")])):/(\.*<graphml )/.test(b)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(b,mxUtils.bind(this,function(b){b=this.importXml(b,c,d,k);null!=m&&m(b)})):null!=n&&null!=h&&(/(\.vsdx?)($|\?)/i.test(h)||/(\.vssx)($|\?)/i.test(h))?(e=!0,this.importVisio(n,q)):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(b,h)?(e=!0,this.parseFile(null!=n?n:new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){4==b.readyState&&(200<=b.status&&299>=b.status?q(b.responseText):null!=m&&m(null))}),h)):/(\.vsd)($|\?)/i.test(h)||(l=this.insertTextAt(this.validateFileData(b),c,d,!0,null,k));e||null==m||m(l);return l};EditorUi.prototype.base64Encode=function(b){for(var a="",c=0,d=b.length,f,g,h;c<d;){f=b.charCodeAt(c++)&255;if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>> -2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);a+="==";break}g=b.charCodeAt(c++);if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);a+="=";break}h=b.charCodeAt(c++);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>> -2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(h&192)>>6);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h&63)}return a};EditorUi.prototype.importFiles=function(b,a,c,d,f,g,h,m,n,k,v,p){a=null!=a?a:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;k=null!=k?k:this.maxImageBytes;var e=null!=a&&null!=c,l=!0,q=!1;if(!mxClient.IS_CHROMEAPP&& -null!=b)for(var w=v||this.resampleThreshold,t=0;t<b.length;t++)if("image/"==b[t].type.substring(0,6)&&b[t].size>w){q=!0;break}var u=mxUtils.bind(this,function(){var q=this.editor.graph,n=q.gridSize;f=null!=f?f:mxUtils.bind(this,function(b,a,c,d,f,k,g,l,h){return null!=b&&"<mxlibrary"==b.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,b,g)),null):this.importFile(b,a,c,d,f,k,g,l,h,e,p)});g=null!=g?g:mxUtils.bind(this,function(b){q.setSelectionCells(b)});if(this.spinner.spin(document.body, -mxResources.get("loading")))for(var w=b.length,t=w,u=[],x=mxUtils.bind(this,function(b,a){u[b]=a;if(0==--t){this.spinner.stop();if(null!=m)m(u);else{var c=[];q.getModel().beginUpdate();try{for(var e=0;e<u.length;e++){var d=u[e]();null!=d&&(c=c.concat(d))}}finally{q.getModel().endUpdate()}}g(c)}}),F=0;F<w;F++)mxUtils.bind(this,function(e){var g=b[e],m=new FileReader;m.onload=mxUtils.bind(this,function(b){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var m= -b.target.result,w=m.indexOf(","),t=decodeURIComponent(escape(atob(m.substring(w+1)))),u=mxUtils.parseXml(t),t=u.getElementsByTagName("svg");if(0<t.length){var t=t[0],B=p?null:t.getAttribute("content");null!=B&&"<"!=B.charAt(0)&&"%"!=B.charAt(0)&&(B=unescape(window.atob?atob(B):Base64.decode(B,!0)));null!=B&&"%"==B.charAt(0)&&(B=decodeURIComponent(B));null==B||"<mxfile "!==B.substring(0,8)&&"<mxGraphModel "!==B.substring(0,14)?x(e,mxUtils.bind(this,function(){try{if(m.substring(0,w+1),null!=u){var b= -u.getElementsByTagName("svg");if(0<b.length){var k=b[0],h=parseFloat(k.getAttribute("width")),v=parseFloat(k.getAttribute("height")),p=k.getAttribute("viewBox");if(null==p||0==p.length)k.setAttribute("viewBox","0 0 "+h+" "+v);else if(isNaN(h)||isNaN(v)){var t=p.split(" ");3<t.length&&(h=parseFloat(t[2]),v=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(k));var B=Math.min(1,Math.min(d/Math.max(1,h)),d/Math.max(1,v)),x=f(m,g.type,a+e*n,c+e*n,Math.max(1,Math.round(h*B)),Math.max(1,Math.round(v* -B)),g.name,l);if(isNaN(h)||isNaN(v)){var E=new Image;E.onload=mxUtils.bind(this,function(){h=Math.max(1,E.width);v=Math.max(1,E.height);x[0].geometry.width=h;x[0].geometry.height=v;k.setAttribute("viewBox","0 0 "+h+" "+v);m=this.createSvgDataUri(mxUtils.getXml(k));var b=m.indexOf(";");0<b&&(m=m.substring(0,b)+m.substring(m.indexOf(",",b+1)));q.setCellStyles("image",m,[x[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(k))}return x}}}catch(da){}return null})):x(e,mxUtils.bind(this,function(){return f(B, -"text/xml",a+e*n,c+e*n,0,0,g.name)}))}}else{t=!1;if("image/png"==g.type){var E=p?null:this.extractGraphModelFromPng(b.target.result);if(null!=E&&0<E.length){var F=new Image;F.src=b.target.result;x(e,mxUtils.bind(this,function(){return f(E,"text/xml",a+e*n,c+e*n,F.width,F.height,g.name)}));t=!0}}t||(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(b.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,b.target.result,mxUtils.bind(this,function(h,m,q){x(e,mxUtils.bind(this,function(){if(null!=h&&h.length<k){var w=l&&this.isResampleImage(b.target.result,v)?Math.min(1,Math.min(d/m,d/q)):1;return f(h,g.type,a+e*n,c+e*n,Math.round(m*w),Math.round(q*w),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),l,d,v)}),mxUtils.bind(this, -function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else f(b.target.result,g.type,a+e*n,c+e*n,240,160,g.name,function(b){x(e,function(){return b})})});/(\.vsdx?)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?f(null,g.type,a+e*n,c+e*n,240,160,g.name,function(b){x(e,function(){return b})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g):m.readAsText(g)})(F)});q?this.confirmImageResize(function(b){l=b;u()},n):u()};EditorUi.prototype.confirmImageResize=function(b, -a){a=null!=a?a:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,d=function(e,d){if(e||a)mxSettings.setResizeImages(e?d:null),mxSettings.save();c();b(d)};null==e||a?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(b){d(b,!0)},function(b){d(b,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+ -'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):d(!1,e)};EditorUi.prototype.parseFile=function(b,a,c){c=null!=c?c:b.name;var e=new FormData;e.append("format","xml");e.append("upfile",b,c);var d=new XMLHttpRequest;d.open("POST",OPEN_URL);d.onreadystatechange=function(){a(d)};d.send(e)};EditorUi.prototype.isResampleImage=function(b,a){a=null!=a?a:this.resampleThreshold;return b.length> -a};EditorUi.prototype.resizeImage=function(b,a,c,d,f,g){f=null!=f?f:this.maxImageSize;var e=Math.max(1,b.width),l=Math.max(1,b.height);if(d&&this.isResampleImage(a,g))try{var h=Math.max(e/f,l/f);if(1<h){var k=Math.round(e/h),m=Math.round(l/h),n=document.createElement("canvas");n.width=k;n.height=m;n.getContext("2d").drawImage(b,0,0,k,m);var q=n.toDataURL();if(q.length<a.length){var p=document.createElement("canvas");p.width=k;p.height=m;var t=p.toDataURL();q!==t&&(a=q,e=k,l=m)}}}catch(z){}c(a,e,l)}; -EditorUi.prototype.crcTable=[];for(var f=0;256>f;f++)for(var c=f,g=0;8>g;g++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[f]=c;EditorUi.prototype.updateCRC=function(b,a,c,d){for(var e=0;e<d;e++)b=EditorUi.prototype.crcTable[(b^a[c+e])&255]^b>>>8;return b};EditorUi.prototype.crc32=function(b){this.crcTable=this.crcTable||this.createCrcTable();for(var a=-1,c=0;c<b.length;c++)a=a>>>8^this.crcTable[(a^b.charCodeAt(c))&255];return(a^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(b, -a,c,d,f){function e(b,a){var c=h;h+=a;return b.substring(c,h)}function g(b){b=e(b,4);return b.charCodeAt(3)+(b.charCodeAt(2)<<8)+(b.charCodeAt(1)<<16)+(b.charCodeAt(0)<<24)}function l(b){return String.fromCharCode(b>>24&255,b>>16&255,b>>8&255,b&255)}b=b.substring(b.indexOf(",")+1);b=window.atob?atob(b):Base64.decode(b,!0);var h=0;if(e(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=f&&f();else if(e(b,4),"IHDR"!=e(b,4))null!=f&&f();else{e(b,17);f=b.substring(0,h);do{var k= -g(b);if("IDAT"==e(b,4)){f=b.substring(0,h-8);c=c+String.fromCharCode(0)+("zTXt"==a?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,a,0,4);d=this.updateCRC(d,c,0,c.length);f+=l(c.length)+a+c+l(d^4294967295);f+=b.substring(h-8,b.length);break}f+=b.substring(h-8,h-4+k);e(b,k);e(b,4)}while(k);return"data:image/png;base64,"+(window.btoa?btoa(f):Base64.encode(f,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(b){var a=null;try{var c=b.substring(b.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF? -atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(b,c,e){b=d.substring(b+8,b+8+e);"zTXt"==c?(e=b.indexOf(String.fromCharCode(0)),"mxGraphModel"==b.substring(0,e)&&(b=this.editor.graph.bytesToString(pako.inflateRaw(b.substring(e+2))).replace(/\+/g," "),null!=b&&0<b.length&&(a=b))):"tEXt"==c&&(b=b.split(String.fromCharCode(0)),1<b.length&&"mxGraphModel"==b[0]&&(a=b[1]));if(null!=a||"IDAT"==c)return!0}))}catch(u){}null!=a&&"%"==a.charAt(0)&&(a=decodeURIComponent(a));null!=a&& -"%"==a.charAt(0)&&(a=decodeURIComponent(a));return a};EditorUi.prototype.loadImage=function(b,a,c){var e=new Image;e.onload=function(){a(e)};null!=c&&(e.onerror=c);e.src=b};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,a=this.editor.graph;a.getLinkTitle=function(a){return b.getLinkTitle(a)};a.customLinkClicked=function(a){try{b.handleCustomLink(a)}catch(L){b.handleError(L)}};this.isOffline()|| -"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var c=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var e=0;e<b.pages.length;e++)if(b.pages[e]==b.currentPage){0<e&&(a+=(0<a.length?"&":"?")+"page="+e);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return c.apply(this,arguments)};var d=a.addClickHandler;a.addClickHandler= -function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!a.isCustomLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a.customLinkClicked(c),mxEvent.consume(b));null!=f&&f(b,c)};d.call(this,b,c,e)};h.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(a.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!= -b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var f=a.getGlobalVariable;a.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:f.apply(this,arguments)};var g=a.createLinkForHint;a.createLinkForHint=function(b,c){null!=b&&a.isCustomLink(b)&&(c=a.getLinkTitle(b));var e=g.call(this,b,c);null!=b&&a.isCustomLink(b)&&mxEvent.addListener(e, -"click",function(c){a.customLinkClicked(b);mxEvent.consume(c)});return e};var m=a.labelLinkClicked;a.labelLinkClicked=function(b,c,e){var d=c.getAttribute("href");if(null==d||!a.isCustomLink(d)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))m.apply(this,arguments);else{if(!a.isEnabled()||null!=b&&a.isCellLocked(b.cell))a.customLinkClicked(d),a.getRubberband().reset();mxEvent.consume(e)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!= -c.getTitle()?c.getTitle():a);return a};var n=this.actions.get("print");n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry", -!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||a.container.addEventListener("paste",mxUtils.bind(this,function(b){var a=this.editor.graph;if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,e=!1,d=0;d<c.types.length;d++)if("text/"===c.types[d].substring(0,5)){e=!0;break}if(!e){var f=c.items;for(index in f){var k=f[index];if("file"===k.kind){if(a.isEditing())this.importFiles([k.getAsFile()], -0,0,this.maxImageSize,function(b,c,e,d,f,k){a.insertImage(b,f,k)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()});else{var g=this.editor.graph.getInsertPoint();this.importFiles([k.getAsFile()],g.x,g.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(Z){}}),!1);var k=document.createElement("div");k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.contentEditable=!0;mxUtils.setOpacity(k, -0);k.style.width="1px";k.style.height="1px";k.innerHTML=" ";var v=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(b){var c=mxEvent.getSource(b);null==a.container||!a.isEnabled()||a.isMouseDown||a.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==b.keyCode||!mxClient.IS_MAC&&17==b.keyCode||mxClient.IS_MAC&&91==b.keyCode)|| -v||(k.style.left=a.container.scrollLeft+10+"px",k.style.top=a.container.scrollTop+10+"px",a.container.appendChild(k),v=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){k.focus();document.execCommand("selectAll",!1,null)},0):(k.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(b){var c=b.keyCode;window.setTimeout(mxUtils.bind(this,function(){!v||224!=c&&17!=c&&91!=c||(v=!1,a.isEditing()||null!=this.dialog||null==a.container||a.container.focus(), -k.parentNode.removeChild(k),mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(b){a.isEnabled()&&(mxClipboard.copy(a),this.copyCells(k),p())}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(b){a.isEnabled()&&(this.copyCells(k,!0),p())}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(b){a.isEnabled()&&!a.isCellLocked(a.getDefaultParent())&&(k.innerHTML=" ",k.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(b,k);k.innerHTML= -" "}),0))}),!0);var F=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==k?!0:F.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(b){var a=this.editor.graph,c=a.cellEditor.text2,e=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(b){null!= -e&&(e.parentNode.removeChild(e),e=null);b.stopPropagation();b.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==e&&(!mxClient.IS_IE||10<document.documentMode)&&(e=this.highlightElement(c));b.stopPropagation();b.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=e&&(e.parentNode.removeChild(e),e=null);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,function(b,c,e,d,f,k){a.insertImage(b, -f,k)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()},mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(b){var e=Math.max(1,b.width);b=Math.max(1,b.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,e)),d/Math.max(1,b));a.insertImage(decodeURIComponent(c), -e*d,b*d)})):document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"));b.stopPropagation();b.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){n=document.createElement("div");n.style.position="absolute"; -n.style.top="95px";n.style.left="250px";n.style.width="2000px";n.style.height="30px";n.style.background="whiteSmoke";document.body.appendChild(n);var C=document.createElement("div");C.style.position="absolute";C.style.top="125px";C.style.left="220px";C.style.width="30px";C.style.height="1000px";C.style.background="whiteSmoke";document.body.appendChild(C);var y=document.createElement("div");y.style.position="absolute";y.style.top="95px";y.style.left="220px";y.style.width="30px";y.style.height="30px"; -y.style.background="whiteSmoke";document.body.appendChild(y);this.vRuler=new mxRuler(this.editor.graph,C,!0);this.hRuler=new mxRuler(this.editor.graph,n,!1)}if("1"==urlParams.test){n=document.getElementById("geFooter");null!=n&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden", -this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),n.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(b,a){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility= -"visible"}else this.styleInput.style.visibility="hidden"})));var K=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==this.styleInput?!0:K.apply(this,arguments)}}n=document.getElementById("geInfo");null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var z=null;mxEvent.addListener(a.container,"dragleave",function(b){a.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),z=null),b.stopPropagation(),b.preventDefault())}); -mxEvent.addListener(a.container,"dragover",mxUtils.bind(this,function(b){null==z&&(!mxClient.IS_IE||10<document.documentMode)&&(z=this.highlightElement(a.container));null!=this.sidebar&&this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()}));mxEvent.addListener(a.container,"drop",mxUtils.bind(this,function(b){null!=z&&(z.parentNode.removeChild(z),z=null);if(a.isEnabled()){var c=mxUtils.convertPoint(a.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),e=a.view.translate,d=a.view.scale, -f=c.x/d-e.x,k=c.y/d-e.y;mxEvent.isAltDown(b)&&(k=f=0);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,f,k,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(b),null,null,mxEvent.isShiftDown(b));else{var g=0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")?b.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(b,null!=this.pages);if(null!=c)a.setSelectionCells(this.importXml(c,f,k,!0));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")){var l= -b.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var h=null,e=c.getElementsByTagName("img");null!=e&&1==e.length?(l=e[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(h=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var m=!0,v=mxUtils.bind(this,function(){a.setSelectionCells(this.insertTextAt(l,f,k,!0,h,null,m))});h&&l.length>this.resampleThreshold?this.confirmImageResize(function(b){m=b;v()},mxEvent.isControlDown(b)): -v()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(b){var c=Math.max(1,b.width);b=Math.max(1,b.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,c)),e/Math.max(1,b));a.setSelectionCell(a.insertVertex(null,null,"",f,k,c*e,b*e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+g+";"))}),mxUtils.bind(this,function(b){a.setSelectionCells(this.insertTextAt(g, -f,k,!0))})):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&a.setSelectionCells(this.insertTextAt(b.dataTransfer.getData("text/plain"),f,k,!0))}}b.stopPropagation();b.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(b){var a=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==b.substring(0,13)){var c=b.indexOf(",");0<c&&(a=this.getPageById(b.substring(c+1)),a=null!=a? -a.getName():mxResources.get("pageNotFound"))}else"data:"==b.substring(0,5)&&(a=mxResources.get("action"));return a};EditorUi.prototype.handleCustomLink=function(b){if("data:page/id,"==b.substring(0,13)){var a=b.indexOf(",");(b=this.getPageById(b.substring(a+1)))&&this.selectPage(b)}else this.editor.graph.handleCustomLink(b)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors= -mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(b,a){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()); -this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(b,a){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(b,a){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged", -mxUtils.bind(this,function(b,a){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(b,a){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(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.copyCells=function(b,a){var c=this.editor.graph;if(c.isSelectionEmpty())b.innerHTML="";else{var e=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),d=mxUtils.getXml(this.editor.graph.encodeCells(e));mxUtils.setTextContent(b,encodeURIComponent(d));a?(c.removeCells(e, -!1),c.lastPasteXml=null):(c.lastPasteXml=d,c.pasteCounter=0);b.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(b,a){if(!mxEvent.isConsumed(b)){var c=a.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var e=c[0].getAttribute("data-lucid-content");null!=e&&0<e.length&&(this.importLucidChart(e,0,0),mxEvent.consume(b))}else{var e=this.editor.graph,d=mxUtils.trim(mxClient.IS_QUIRKS|| -8==document.documentMode?mxUtils.getTextContent(a):a.textContent),f=!1;try{var g=d.lastIndexOf("%3E");0<=g&&g<d.length-3&&(d=d.substring(0,g+3))}catch(A){}try{var c=a.getElementsByTagName("span"),h=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(d);this.isCompatibleString(h)&&(f=!0,d=h)}catch(A){}e.lastPasteXml==d?e.pasteCounter++:(e.lastPasteXml=d,e.pasteCounter=0);c=e.pasteCounter*e.gridSize;if(null!=d&&0<d.length&&(f||this.isCompatibleString(d)?e.setSelectionCells(this.importXml(d, -c,c)):(f=e.getInsertPoint(),e.isMouseInsertPoint()&&(c=0,e.lastPasteXml==d&&0<e.pasteCounter&&e.pasteCounter--),e.setSelectionCells(this.insertTextAt(d,f.x+c,f.y+c,!0))),!e.isSelectionEmpty())){e.scrollCellToVisible(e.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(e.view.getState(e.getSelectionCell()));try{mxEvent.consume(b)}catch(A){}}}}};EditorUi.prototype.addFileDropHandler=function(b){if(Graph.fileSupport)for(var a=null,c=0;c<b.length;c++)mxEvent.addListener(b[c],"dragleave", -function(b){null!=a&&(a.parentNode.removeChild(a),a=null);b.stopPropagation();b.preventDefault()}),mxEvent.addListener(b[c],"dragover",mxUtils.bind(this,function(b){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==a&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(a=this.highlightElement());b.stopPropagation();b.preventDefault()})),mxEvent.addListener(b[c],"drop",mxUtils.bind(this,function(b){null!=a&&(a.parentNode.removeChild(a),a=null);if(this.editor.graph.isEnabled()|| -"1"!=urlParams.embed)if(0<b.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(b)&&!mxEvent.isShiftDown(b)):this.openFiles(b.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(b);if(null==c){var e=null!=b.dataTransfer?b.dataTransfer:b.clipboardData;null!=e&&(10==document.documentMode||11==document.documentMode?c=e.getData("Text"):(c=null,c=0<=mxUtils.indexOf(e.types, -"text/uri-list")?b.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(e.types,"text/html")?e.getData("text/html"):null,null!=c&&0<c.length?(e=document.createElement("div"),e.innerHTML=c,e=e.getElementsByTagName("img"),0<e.length&&(c=e[0].getAttribute("src"))):0<=mxUtils.indexOf(e.types,"text/plain")&&(c=e.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)? -(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&this.openLocalFile(b.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}b.stopPropagation();b.preventDefault()}))}; -EditorUi.prototype.highlightElement=function(b){var a=0,c=0,d,f;if(null==b){f=document.body;var g=document.documentElement;d=(f.clientWidth||g.clientWidth)-3;f=Math.max(f.clientHeight||0,g.clientHeight)-3}else a=b.offsetTop,c=b.offsetLeft,d=b.clientWidth,f=b.clientHeight;g=document.createElement("div");g.style.zIndex=mxPopupMenu.prototype.zIndex+2;g.style.border="3px dotted rgb(254, 137, 12)";g.style.pointerEvents="none";g.style.position="absolute";g.style.top=a+"px";g.style.left=c+"px";g.style.width= -Math.max(0,d-3)+"px";g.style.height=Math.max(0,f-3)+"px";null!=b&&b.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(g):document.body.appendChild(g);return g};EditorUi.prototype.stringToCells=function(b){b=mxUtils.parseXml(b);var a=this.editor.extractGraphModel(b.documentElement);b=[];if(null!=a){var c=new mxCodec(a.ownerDocument),d=new mxGraphModel;c.decode(a,d);a=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(a);c++)b.push(d.getChildAt(a,c))}return b};EditorUi.prototype.openFiles= -function(b,a){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<b.length;c++)mxUtils.bind(this,function(b){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var e=c.target.result,d=b.name;if(null!=d&&0<d.length){!this.useCanvasForExport&&/(\.png)$/i.test(d)&&(d=d.substring(0,d.length-4)+".xml");var f=mxUtils.bind(this,function(b){d=0<=d.lastIndexOf(".")?d.substring(0,d.lastIndexOf("."))+".xml":d+".xml";if("<mxlibrary"==b.substring(0,10)){null==this.getCurrentFile()&& -"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,a);try{this.loadLibrary(new LocalLibrary(this,b,d))}catch(v){this.handleError(v,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(b,d,a)});if(/(\.vsdx?)($|\?)/i.test(d)||/(\.vssx)($|\?)/i.test(d))this.importVisio(b,mxUtils.bind(this,function(b){this.spinner.stop();f(b)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(e,d))this.parseFile(b,mxUtils.bind(this, -function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?f(b.responseText):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==e.substring(0,26))/(\.json)$/i.test(d)&&(d=d.substring(0,d.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,d,a),this.importLucidChart(e,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()})); -else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,a);try{this.loadLibrary(new LocalLibrary(this,c.target.result,b.name))}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}}else"image/png"==b.type.substring(0,9)&&(e=this.extractGraphModelFromPng(e)),this.spinner.stop(),this.openLocalFile(e,d,a)}});c.onerror=mxUtils.bind(this,function(b){this.spinner.stop(); -this.handleError(b);window.openFile=null});"image"===b.type.substring(0,5)&&"image/svg"!==b.type.substring(0,9)?c.readAsDataURL(b):c.readAsText(b)})(b[c])};EditorUi.prototype.openLocalFile=function(b,a,c){var e=this.getCurrentFile(),d=mxUtils.bind(this,function(){window.openFile=null;if(null==a&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var e=mxUtils.parseXml(b);null!=e&&(this.editor.setGraphXml(e.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,b, -a||this.defaultFilename,c))});null!=b&&0<b.length&&(null==e||!e.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?d():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=e&&e.isModified()?this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b,a),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"), -null,d,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var b={};if(null!=this.pages)for(var a=0;a<this.pages.length;a++)this.updatePageRoot(this.pages[a]),this.addBasenamesForCell(this.pages[a].root,b);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),b);var a=[],c;for(c in b)a.push(c);return a};EditorUi.prototype.addBasenamesForCell=function(b,a){function c(b){if(null!=b){var c=b.lastIndexOf(".");0<c&&(b=b.substring(c+1, -b.length));null==a[b]&&(a[b]=!0)}}var e=this.editor.graph,d=e.getCellStyle(b);c(mxStencilRegistry.getBasenameForStencil(d[mxConstants.STYLE_SHAPE]));e.model.isEdge(b)&&(c(mxMarker.getPackageForType(d[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(d[mxConstants.STYLE_ENDARROW])));for(var d=e.model.getChildCount(b),f=0;f<d;f++)this.addBasenamesForCell(e.model.getChildAt(b,f),a)};EditorUi.prototype.setGraphEnabled=function(b){this.diagramContainer.style.visibility=b?"":"hidden";this.formatContainer.style.visibility= -b?"":"hidden";this.sidebarFooterContainer.style.display=b?"":"none";this.sidebarContainer.style.display=b?"":"none";this.hsplit.style.display=b?"":"none";this.editor.graph.setEnabled(b);null!=this.tabContainer&&(this.tabContainer.style.visibility=b?"":"hidden");b||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1), -null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(b,a,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=b&&0<b.length?(this.setFileData(b),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&& -this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!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(b,a){null!=b?b.getPublicUrl(a):a(null)};EditorUi.prototype.createLoadMessage=function(b){var a=this.editor.graph;return{event:b,pageVisible:a.pageVisible,translate:a.view.translate,scale:a.view.scale,page:a.view.getBackgroundPageBounds(),bounds:a.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(b){var a=null,c=!1,d=!1,f=null,g=mxUtils.bind(this,function(b, -a){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){function g(b){if(null!=b&&"function"===typeof b.charAt&&"<"!=b.charAt(0))try{"data:image/svg+xml;base64,"==b.substring(0,26)?b=atob(b.substring(26)):"data:image/svg+xml;utf8,"==b.substring(0,24)&& -(b=b.substring(24)),null!=b&&("%"==b.charAt(0)?b=decodeURIComponent(b):"<"!=b.charAt(0)&&(b=this.editor.graph.decompress(b)))}catch(J){}return b}if(e.source==(window.opener||window.parent)){var k=e.data;if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(E){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&& -(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();var l=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):null,function(b){null!=b&&h.postMessage(JSON.stringify({event:"prompt",value:b,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){l=null;l="data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):g(k.xml); -this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null,k.ignore?mxUtils.bind(this,function(){this.hideDialog(); -h.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));try{l.init()}catch(E){h.postMessage(JSON.stringify({event:"draft",error:E.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var l=1==k.enableRecent,m=1==k.enableSearch,l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(a,c){a=a||this.emptyDiagramXml;null!=k.callback? -h.postMessage(JSON.stringify({event:"template",xml:a,blank:a==this.emptyDiagramXml,name:c}),"*"):(b(a,e,a!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(b){this.recentReadyCallback=b;h.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(b,a){this.searchReadyCallback=a;h.postMessage(JSON.stringify({event:"searchDocs",searchStr:b}),"*")}):null,function(b,a,c){h.postMessage(JSON.stringify({event:"template", -docUrl:b,info:a,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==k.action)this.searchReadyCallback(k.list,k.errorMsg);else if("recentDocsList"==k.action)this.recentReadyCallback(k.list,k.errorMsg);else{if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message)); -null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var n=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,n):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var p=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph, -w=mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();var a=this.createLoadMessage("export");a.format=k.format;a.message=k;a.data=b;a.xml=encodeURIComponent(p);h.postMessage(JSON.stringify(a),"*")}),t=mxUtils.bind(this,function(b){null==b&&(b=Editor.blankImage);"xmlpng"==k.format&&(b=this.writeGraphModelToPng(b,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);w(b)});if(this.isExportToCanvas()){if(null!= -this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),u=q.getGlobalVariable,B=this.pages[0];q.getGlobalVariable=function(b){return"page"==b?B.getName():"pagenumber"==b?1:u.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,function(b){t(b.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+ -("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?w("data:image/png;base64,"+b.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data= -this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)p=this.editor.getGraphXml(),n.data=this.getHtml(p,this.editor.graph),n.xml=mxUtils.getXml(p),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1), -"xmlsvg"==k.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(b);h.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(b));h.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0), -this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}h.postMessage(JSON.stringify(n),"*")}return}if("load"==k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight= -"12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):null!=k.xml&&"data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):k.xml;else{h.postMessage(JSON.stringify({error:"unknownMessage", -data:JSON.stringify(k)}),"*");return}}}k=g(k);c=!0;try{b(k,e)}catch(E){this.handleError(E)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var x=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=x();d&&null==a&&(a=mxUtils.bind(this,function(b,a){var e=x();if(e!=f&&!c){var d=this.createLoadMessage("autosave");d.xml=e;e=JSON.stringify(d);(window.opener||window.parent).postMessage(e, -"*")}f=e}),this.editor.graph.model.addListener(mxEvent.CHANGE,a),this.editor.graph.addListener("gridSizeChanged",a),this.editor.graph.addListener("shadowVisibleChanged",a),this.addListener("pageFormatChanged",a),this.addListener("pageScaleChanged",a),this.addListener("backgroundColorChanged",a),this.addListener("backgroundImageChanged",a),this.addListener("foldingEnabledChanged",a),this.addListener("mathEnabledChanged",a),this.addListener("gridEnabledChanged",a),this.addListener("guidesEnabledChanged", -a),this.addListener("pageViewChanged",a));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||h.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var h=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";h.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var b=document.createElement("div");b.style.display="inline-block";b.style.position="absolute";b.style.paddingTop="atlas"==uiTheme? -"2px":"3px";b.style.paddingLeft="8px";b.style.paddingBottom="2px";var a=document.createElement("button");mxUtils.write(a,mxResources.get("save"));a.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");a.className="geBigButton";a.style.fontSize="12px";a.style.padding="4px 6px 4px 6px";a.style.borderRadius="3px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));b.appendChild(a);"1"==urlParams.saveAndExit&&(a=document.createElement("a"), -mxUtils.write(a,mxResources.get("saveAndExit")),a.setAttribute("title",mxResources.get("saveAndExit")),a.style.fontSize="12px",a.style.marginLeft="6px",a.style.padding="4px",a.style.cursor="pointer",mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),b.appendChild(a));a=document.createElement("a");mxUtils.write(a,mxResources.get("exit"));a.setAttribute("title",mxResources.get("exit"));a.style.fontSize="12px";a.style.marginLeft="6px";a.style.marginRight= -"20px";a.style.padding="4px";a.style.cursor="pointer";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));b.appendChild(a);this.toolbar.container.appendChild(b);this.toolbar.staticElements.push(b);b.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(b){this.importCsv(b)}), -null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(b,a){try{var c=b.split("\n"),e=[];if(0<c.length){var d={},f=null,g=null,h="",m="auto",k="auto",n=null,p=null,C=40,y=40,K=0,z=this.editor.graph;z.getGraphBounds();for(var D=function(){null!=a?a(aa):(z.setSelectionCells(aa),z.scrollCellToVisible(z.getSelectionCell()))},L=z.getFreeInsertPoint(),B=L.x,H=L.y,L=H,E=null, -J="auto",M=[],X=null,Z=null,N=0;N<c.length&&"#"==c[N].charAt(0);){b=c[N];for(N++;N<c.length&&"\\"==b.charAt(b.length-1)&&"#"==c[N].charAt(0);)b=b.substring(0,b.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=b.charAt(1)){var S=b.indexOf(":");if(0<S){var O=mxUtils.trim(b.substring(1,S)),G=mxUtils.trim(b.substring(S+1));"label"==O?E=z.sanitizeHtml(G):"style"==O?f=G:"identity"==O&&0<G.length&&"-"!=G?g=G:"namespace"==O&&0<G.length&&"-"!=G?h=G:"width"==O?m=G:"height"==O?k=G:"left"==O&&0<G.length? -n=G:"top"==O&&0<G.length?p=G:"ignore"==O?Z=G.split(","):"connect"==O?M.push(JSON.parse(G)):"link"==O?X=G:"padding"==O?K=parseFloat(G):"edgespacing"==O?C=parseFloat(G):"nodespacing"==O?y=parseFloat(G):"layout"==O&&(J=G)}}}var W=this.editor.csvToArray(c[N]),S=null;if(null!=g)for(var R=0;R<W.length;R++)if(g==W[R]){S=R;break}null==E&&(E="%"+W[0]+"%");if(null!=M)for(var T=0;T<M.length;T++)null==d[M[T].to]&&(d[M[T].to]={});z.model.beginUpdate();try{for(R=N+1;R<c.length;R++){var V=this.editor.csvToArray(c[R]); -if(V.length==W.length){var I=null,Q=null!=S?h+V[S]:null;null!=Q&&(I=z.model.getCell(Q));null==I&&(I=new mxCell(E,new mxGeometry(B,L,0,0),f||"whiteSpace=wrap;html=1;"),I.vertex=!0,I.id=Q);for(var P=0;P<V.length;P++)z.setAttributeForCell(I,W[P],V[P]);z.setAttributeForCell(I,"placeholders","1");I.style=z.replacePlaceholders(I,I.style);for(T=0;T<M.length;T++)d[M[T].to][I.getAttribute(M[T].to)]=I;null!=X&&"link"!=X&&(z.setLinkForCell(I,I.getAttribute(X)),z.setAttributeForCell(I,X,null));z.fireEvent(new mxEventObject("cellsInserted", -"cells",[I]));var ba=this.editor.graph.getPreferredSizeForCell(I);I.vertex&&(null!=n&&null!=I.getAttribute(n)&&(I.geometry.x=B+parseFloat(I.getAttribute(n))),null!=p&&null!=I.getAttribute(p)&&(I.geometry.y=H+parseFloat(I.getAttribute(p))),"@"==m.charAt(0)&&null!=I.getAttribute(m.substring(1))?I.geometry.width=parseFloat(I.getAttribute(m.substring(1))):I.geometry.width="auto"==m?ba.width+K:parseFloat(m),"@"==k.charAt(0)&&null!=I.getAttribute(k.substring(1))?I.geometry.height=parseFloat(I.getAttribute(k.substring(1))): -I.geometry.height="auto"==k?ba.height+K:parseFloat(k),L+=I.geometry.height+y);e.push(z.addCell(I))}}for(var U=e.slice(),aa=e.slice(),T=0;T<M.length;T++)for(var Y=M[T],R=0;R<e.length;R++){var I=e[R],ia=I.getAttribute(Y.from);if(null!=ia){z.setAttributeForCell(I,Y.from,null);for(var ja=ia.split(","),P=0;P<ja.length;P++){var ca=d[Y.to][ja[P]];null!=ca&&(E=Y.label,null!=Y.fromlabel&&(E=(I.getAttribute(Y.fromlabel)||"")+(E||"")),null!=Y.tolabel&&(E=(E||"")+(ca.getAttribute(Y.tolabel)||"")),aa.push(z.insertEdge(null, -null,E||"",Y.invert?ca:I,Y.invert?I:ca,Y.style||z.createCurrentEdgeStyle())),mxUtils.remove(Y.invert?I:ca,U))}}}if(null!=Z)for(R=0;R<e.length;R++)for(I=e[R],P=0;P<Z.length;P++)z.setAttributeForCell(I,mxUtils.trim(Z[P]),null);var fa=new mxParallelEdgeLayout(z);fa.spacing=C;var ka=function(){fa.execute(z.getDefaultParent());for(var b=0;b<e.length;b++){var a=z.getCellGeometry(e[b]);a.x=Math.round(z.snap(a.x));a.y=Math.round(z.snap(a.y));"auto"==m&&(a.width=Math.round(z.snap(a.width)));"auto"==k&&(a.height= -Math.round(z.snap(a.height)))}};if("circle"==J){var da=new mxCircleLayout(z);da.resetEdges=!1;var la=da.isVertexIgnored;da.isVertexIgnored=function(b){return la.apply(this,arguments)||0>mxUtils.indexOf(e,b)};this.executeLayout(function(){da.execute(z.getDefaultParent());ka()},!0,D);D=null}else if("horizontaltree"==J||"verticaltree"==J||"auto"==J&&aa.length==2*e.length-1&&1==U.length){z.view.validate();var ga=new mxCompactTreeLayout(z,"horizontaltree"==J);ga.levelDistance=y;ga.edgeRouting=!1;ga.resetEdges= -!1;this.executeLayout(function(){ga.execute(z.getDefaultParent(),0<U.length?U[0]:null)},!0,D);D=null}else if("horizontalflow"==J||"verticalflow"==J||"auto"==J&&1==U.length){z.view.validate();var ha=new mxHierarchicalLayout(z,"horizontalflow"==J?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ha.intraCellSpacing=y;ha.disableEdgeStyle=!1;this.executeLayout(function(){ha.execute(z.getDefaultParent(),aa);z.moveCells(aa,B,H)},!0,D);D=null}else if("organic"==J||"auto"==J&&aa.length>e.length){z.view.validate(); -var ea=new mxFastOrganicLayout(z);ea.forceConstant=3*y;ea.resetEdges=!1;var na=ea.isVertexIgnored;ea.isVertexIgnored=function(b){return na.apply(this,arguments)||0>mxUtils.indexOf(e,b)};fa=new mxParallelEdgeLayout(z);fa.spacing=C;this.executeLayout(function(){ea.execute(z.getDefaultParent());ka()},!0,D);D=null}this.hideDialog()}finally{z.model.endUpdate()}null!=D&&D()}}catch(ma){this.handleError(ma)}};EditorUi.prototype.getSearch=function(b){var a="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&& -null!=b&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(b,d)&&null!=urlParams[d]&&(a+=c+d+"="+urlParams[d],c="&")}else a=window.location.search;return a};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var a=0<b.indexOf("?")?1:0;if("1"==urlParams.offline)b+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&& -(b=0==a?b+"?":b+"&",null!=urlParams[d]&&(b+=d+"="+urlParams[d],a++))}return b};EditorUi.prototype.showLinkDialog=function(b,a,c){b=new LinkDialog(this,b,a,c,!0);this.showDialog(b.container,480,130,!0,!0);b.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(b){var a=m.apply(this,arguments),c=this.editor.graph,d=a.getSourceGraphBounds;a.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var b= -this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*b.x/a),Math.ceil(this.source.minimumGraphSize.height-2*b.y/a))}return d.apply(this,arguments)};var f=a.getSourceContainerSize;a.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*a-2* -b.x),Math.ceil(this.source.minimumGraphSize.height*a-2*b.y))}return f.apply(this,arguments)};a.getOutlineOffset=function(b){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var e=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(a.outline.container.clientWidth/b-(this.source.minimumGraphSize.width-2*e.x))/2)-e.x),Math.round(Math.max(0,(a.outline.container.clientHeight/b-(this.source.minimumGraphSize.height-2*e.y))/2)-e.y-5/b))}return new mxPoint(8/b, -8/b)};var g=a.init;a.init=function(){g.apply(this,arguments);a.outline.view.getBackgroundPageBounds=function(){var b=c.getPageLayout(),a=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+b.x*a.width),this.scale*(this.translate.y+b.y*a.height),this.scale*b.width*a.width,this.scale*b.height*a.height)};a.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(b,c){var e=c.getProperty("change"),d=a.source,f=a.outline;f.pageScale=d.pageScale;f.pageFormat= +[f]))}finally{e.getModel().endUpdate()}e.setSelectionCell(f)}))}else{b=this.editor.graph.zapGremlins(mxUtils.trim(b));if(this.isCompatibleString(b))return this.importXml(b,a,c,g);if(0<b.length)if('{"state":"{\\"Properties\\":'==b.substring(0,26))this.importLucidChart(b,a,c,g);else{e=this.editor.graph;f=null;e.getModel().beginUpdate();try{f=e.insertVertex(e.getDefaultParent(),null,"",e.snap(a),e.snap(c),1,1,"text;"+(d?"html=1;":"")),e.fireEvent(new mxEventObject("textInserted","cells",[f])),"<"==b.charAt(0)&& +b.indexOf(">")==b.length-1&&(b=mxUtils.htmlEntities(b)),f.value=b,e.updateCellSize(f),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(f.value)&&e.setLinkForCell(f,f.value),f.geometry.width+=e.gridSize,f.geometry.height+=e.gridSize}finally{e.getModel().endUpdate()}return[f]}}return[]};EditorUi.prototype.formatFileSize=function(b){var a=-1; +do b/=1024,a++;while(1024<b);return Math.max(b,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[a]};EditorUi.prototype.convertDataUri=function(b){if("data:"==b.substring(0,5)){var a=b.indexOf(";");0<a&&(b=b.substring(0,a)+b.substring(b.indexOf(",",a+1)))}return b};EditorUi.prototype.isRemoteFileFormat=function(b,a){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(b)};EditorUi.prototype.importLocalFile=function(b,a){if(b&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11|| +0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!a){var e=Editor.useLocalStorage;Editor.useLocalStorage=!b}window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));window.openFile.setConsumer(mxUtils.bind(this,function(b, +a){if(null!=a&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(a)){var c=new Blob([b],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(b){this.importXml(b)}),null,a)}else this.editor.graph.setSelectionCells(this.importXml(b))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!a){var d=this.dialog,f=d.close;this.dialog.close=mxUtils.bind(this,function(b){Editor.useLocalStorage=e;f.apply(d,arguments);b&&null==this.getCurrentFile()&& +"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(b,a,c,d,f,g,h,m,n,k,v){k=null!=k?k:!0;var e=!1,l=null,q=mxUtils.bind(this,function(b){var a=null;null!=b&&"<mxlibrary"==b.substring(0,10)?this.loadLibrary(new LocalLibrary(this,b,h)):a=this.importXml(b,c,d,k);null!=m&&m(a)});"image"==a.substring(0,5)?(n=!1,"image/png"==a.substring(0,9)&&(a=v?null:this.extractGraphModelFromPng(b),null!=a&&0<a.length&&(l=this.importXml(a,c,d,k),n=!0)),n||(l=this.editor.graph,a=b.indexOf(";"), +0<a&&(b=b.substring(0,a)+b.substring(b.indexOf(",",a+1))),k&&l.isGridEnabled()&&(c=l.snap(c),d=l.snap(d)),l=[l.insertVertex(null,null,"",c,d,f,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b+";")])):/(\.*<graphml )/.test(b)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(b,mxUtils.bind(this,function(b){b=this.importXml(b,c,d,k);null!=m&&m(b)})):null!=n&&null!=h&&(/(\.vsdx?)($|\?)/i.test(h)||/(\.vssx)($|\?)/i.test(h))? +(e=!0,this.importVisio(n,q)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,h)?(e=!0,this.parseFile(null!=n?n:new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){4==b.readyState&&(200<=b.status&&299>=b.status?q(b.responseText):null!=m&&m(null))}),h)):/(\.vsd)($|\?)/i.test(h)||(l=this.insertTextAt(this.validateFileData(b),c,d,!0,null,k));e||null==m||m(l);return l};EditorUi.prototype.base64Encode=function(b){for(var a="",c=0,d=b.length,f,g,h;c<d;){f= +b.charCodeAt(c++)&255;if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);a+="==";break}g=b.charCodeAt(c++);if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g& +15)<<2);a+="=";break}h=b.charCodeAt(c++);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(h&192)>>6);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h&63)}return a};EditorUi.prototype.importFiles=function(b,a,c,d,f,g,h,m,n,k,v,p){a=null!=a?a:0;c=null!= +c?c:0;d=null!=d?d:this.maxImageSize;k=null!=k?k:this.maxImageBytes;var e=null!=a&&null!=c,l=!0,q=!1;if(!mxClient.IS_CHROMEAPP&&null!=b)for(var w=v||this.resampleThreshold,t=0;t<b.length;t++)if("image/"==b[t].type.substring(0,6)&&b[t].size>w){q=!0;break}var u=mxUtils.bind(this,function(){var n=this.editor.graph,q=n.gridSize;f=null!=f?f:mxUtils.bind(this,function(b,a,c,d,f,k,g,l,h){return null!=b&&"<mxlibrary"==b.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,b,g)),null): +this.importFile(b,a,c,d,f,k,g,l,h,e,p)});g=null!=g?g:mxUtils.bind(this,function(b){n.setSelectionCells(b)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var w=b.length,t=w,u=[],x=mxUtils.bind(this,function(b,a){u[b]=a;if(0==--t){this.spinner.stop();if(null!=m)m(u);else{var c=[];n.getModel().beginUpdate();try{for(var e=0;e<u.length;e++){var d=u[e]();null!=d&&(c=c.concat(d))}}finally{n.getModel().endUpdate()}}g(c)}}),F=0;F<w;F++)mxUtils.bind(this,function(e){var g=b[e],m=new FileReader; +m.onload=mxUtils.bind(this,function(b){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var m=b.target.result,w=m.indexOf(","),t=decodeURIComponent(escape(atob(m.substring(w+1)))),u=mxUtils.parseXml(t),t=u.getElementsByTagName("svg");if(0<t.length){var t=t[0],B=p?null:t.getAttribute("content");null!=B&&"<"!=B.charAt(0)&&"%"!=B.charAt(0)&&(B=unescape(window.atob?atob(B):Base64.decode(B,!0)));null!=B&&"%"==B.charAt(0)&&(B=decodeURIComponent(B));null==B||"<mxfile "!== +B.substring(0,8)&&"<mxGraphModel "!==B.substring(0,14)?x(e,mxUtils.bind(this,function(){try{if(m.substring(0,w+1),null!=u){var b=u.getElementsByTagName("svg");if(0<b.length){var k=b[0],h=parseFloat(k.getAttribute("width")),v=parseFloat(k.getAttribute("height")),p=k.getAttribute("viewBox");if(null==p||0==p.length)k.setAttribute("viewBox","0 0 "+h+" "+v);else if(isNaN(h)||isNaN(v)){var t=p.split(" ");3<t.length&&(h=parseFloat(t[2]),v=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(k));var B= +Math.min(1,Math.min(d/Math.max(1,h)),d/Math.max(1,v)),x=f(m,g.type,a+e*q,c+e*q,Math.max(1,Math.round(h*B)),Math.max(1,Math.round(v*B)),g.name,l);if(isNaN(h)||isNaN(v)){var E=new Image;E.onload=mxUtils.bind(this,function(){h=Math.max(1,E.width);v=Math.max(1,E.height);x[0].geometry.width=h;x[0].geometry.height=v;k.setAttribute("viewBox","0 0 "+h+" "+v);m=this.createSvgDataUri(mxUtils.getXml(k));var b=m.indexOf(";");0<b&&(m=m.substring(0,b)+m.substring(m.indexOf(",",b+1)));n.setCellStyles("image",m, +[x[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(k))}return x}}}catch(da){}return null})):x(e,mxUtils.bind(this,function(){return f(B,"text/xml",a+e*q,c+e*q,0,0,g.name)}))}}else{t=!1;if("image/png"==g.type){var E=p?null:this.extractGraphModelFromPng(b.target.result);if(null!=E&&0<E.length){var F=new Image;F.src=b.target.result;x(e,mxUtils.bind(this,function(){return f(E,"text/xml",a+e*q,c+e*q,F.width,F.height,g.name)}));t=!0}}t||(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(b.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,b.target.result,mxUtils.bind(this,function(h,m,n){x(e,mxUtils.bind(this,function(){if(null!=h&&h.length<k){var w=l&&this.isResampleImage(b.target.result,v)?Math.min(1,Math.min(d/m,d/n)):1;return f(h,g.type,a+e*q,c+e*q,Math.round(m* +w),Math.round(n*w),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),l,d,v)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else f(b.target.result,g.type,a+e*q,c+e*q,240,160,g.name,function(b){x(e,function(){return b})})});/(\.vsdx?)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?f(null,g.type,a+e*q,c+e*q,240,160,g.name,function(b){x(e,function(){return b})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g): +m.readAsText(g)})(F)});q?this.confirmImageResize(function(b){l=b;u()},n):u()};EditorUi.prototype.confirmImageResize=function(b,a){a=null!=a?a:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,d=function(e,d){if(e||a)mxSettings.setResizeImages(e?d:null),mxSettings.save();c();b(d)};null==e||a?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(b){d(b,!0)}, +function(b){d(b,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):d(!1,e)};EditorUi.prototype.parseFile=function(b,a,c){c=null!=c?c:b.name;var e=new FormData;e.append("format","xml");e.append("upfile",b,c);var d=new XMLHttpRequest;d.open("POST",OPEN_URL);d.onreadystatechange= +function(){a(d)};d.send(e)};EditorUi.prototype.isResampleImage=function(b,a){a=null!=a?a:this.resampleThreshold;return b.length>a};EditorUi.prototype.resizeImage=function(b,a,c,d,f,g){f=null!=f?f:this.maxImageSize;var e=Math.max(1,b.width),l=Math.max(1,b.height);if(d&&this.isResampleImage(a,g))try{var h=Math.max(e/f,l/f);if(1<h){var k=Math.round(e/h),m=Math.round(l/h),n=document.createElement("canvas");n.width=k;n.height=m;n.getContext("2d").drawImage(b,0,0,k,m);var q=n.toDataURL();if(q.length<a.length){var p= +document.createElement("canvas");p.width=k;p.height=m;var t=p.toDataURL();q!==t&&(a=q,e=k,l=m)}}}catch(z){}c(a,e,l)};EditorUi.prototype.crcTable=[];for(var f=0;256>f;f++)for(var c=f,g=0;8>g;g++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[f]=c;EditorUi.prototype.updateCRC=function(b,a,c,d){for(var e=0;e<d;e++)b=EditorUi.prototype.crcTable[(b^a[c+e])&255]^b>>>8;return b};EditorUi.prototype.crc32=function(b){this.crcTable=this.crcTable||this.createCrcTable();for(var a=-1,c=0;c<b.length;c++)a= +a>>>8^this.crcTable[(a^b.charCodeAt(c))&255];return(a^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(b,a,c,d,f){function e(b,a){var c=h;h+=a;return b.substring(c,h)}function g(b){b=e(b,4);return b.charCodeAt(3)+(b.charCodeAt(2)<<8)+(b.charCodeAt(1)<<16)+(b.charCodeAt(0)<<24)}function l(b){return String.fromCharCode(b>>24&255,b>>16&255,b>>8&255,b&255)}b=b.substring(b.indexOf(",")+1);b=window.atob?atob(b):Base64.decode(b,!0);var h=0;if(e(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13, +10,26,10))null!=f&&f();else if(e(b,4),"IHDR"!=e(b,4))null!=f&&f();else{e(b,17);f=b.substring(0,h);do{var k=g(b);if("IDAT"==e(b,4)){f=b.substring(0,h-8);c=c+String.fromCharCode(0)+("zTXt"==a?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,a,0,4);d=this.updateCRC(d,c,0,c.length);f+=l(c.length)+a+c+l(d^4294967295);f+=b.substring(h-8,b.length);break}f+=b.substring(h-8,h-4+k);e(b,k);e(b,4)}while(k);return"data:image/png;base64,"+(window.btoa?btoa(f):Base64.encode(f,!0))}};EditorUi.prototype.extractGraphModelFromPng= +function(b){var a=null;try{var c=b.substring(b.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(b,c,e){b=d.substring(b+8,b+8+e);"zTXt"==c?(e=b.indexOf(String.fromCharCode(0)),"mxGraphModel"==b.substring(0,e)&&(b=this.editor.graph.bytesToString(pako.inflateRaw(b.substring(e+2))).replace(/\+/g," "),null!=b&&0<b.length&&(a=b))):"tEXt"==c&&(b=b.split(String.fromCharCode(0)),1<b.length&&"mxGraphModel"==b[0]&&(a=b[1]));if(null!=a|| +"IDAT"==c)return!0}))}catch(u){}null!=a&&"%"==a.charAt(0)&&(a=decodeURIComponent(a));null!=a&&"%"==a.charAt(0)&&(a=decodeURIComponent(a));return a};EditorUi.prototype.loadImage=function(b,a,c){var e=new Image;e.onload=function(){a(e)};null!=c&&(e.onerror=c);e.src=b};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,a=this.editor.graph;a.getLinkTitle=function(a){return b.getLinkTitle(a)}; +a.customLinkClicked=function(a){try{b.handleCustomLink(a)}catch(L){b.handleError(L)}};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var c=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var e=0;e<b.pages.length;e++)if(b.pages[e]==b.currentPage){0<e&&(a+=(0<a.length?"&":"?")+"page="+e);break}"1"==urlParams.dev&& +(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return c.apply(this,arguments)};var d=a.addClickHandler;a.addClickHandler=function(b,c,e){var f=c;c=function(b,c){if(null==c){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(c=e.getAttribute("href"))}null==c||!a.isCustomLink(c)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a.customLinkClicked(c),mxEvent.consume(b));null!=f&&f(b,c)};d.call(this,b,c,e)};h.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(a.view.canvas.ownerSVGElement, +null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var f=a.getGlobalVariable;a.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:f.apply(this,arguments)};var g=a.createLinkForHint;a.createLinkForHint=function(b,c){null!= +b&&a.isCustomLink(b)&&(c=a.getLinkTitle(b));var e=g.call(this,b,c);null!=b&&a.isCustomLink(b)&&mxEvent.addListener(e,"click",function(c){a.customLinkClicked(b);mxEvent.consume(c)});return e};var m=a.labelLinkClicked;a.labelLinkClicked=function(b,c,e){var d=c.getAttribute("href");if(null==d||!a.isCustomLink(d)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e))m.apply(this,arguments);else{if(!a.isEnabled()||null!=b&&a.isCellLocked(b.cell))a.customLinkClicked(d),a.getRubberband().reset();mxEvent.consume(e)}}; +this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var n=this.actions.get("print");n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0, +"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||a.container.addEventListener("paste",mxUtils.bind(this,function(b){var a=this.editor.graph;if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,e=!1,d=0;d<c.types.length;d++)if("text/"=== +c.types[d].substring(0,5)){e=!0;break}if(!e){var f=c.items;for(index in f){var k=f[index];if("file"===k.kind){if(a.isEditing())this.importFiles([k.getAsFile()],0,0,this.maxImageSize,function(b,c,e,d,f,k){a.insertImage(b,f,k)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()});else{var g=this.editor.graph.getInsertPoint();this.importFiles([k.getAsFile()],g.x,g.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(Z){}}),!1);var k=document.createElement("div"); +k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.contentEditable=!0;mxUtils.setOpacity(k,0);k.style.width="1px";k.style.height="1px";k.innerHTML=" ";var v=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(b){var c=mxEvent.getSource(b);null==a.container||!a.isEnabled()||a.isMouseDown||a.isEditing()|| +null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==b.keyCode||!mxClient.IS_MAC&&17==b.keyCode||mxClient.IS_MAC&&91==b.keyCode)||v||(k.style.left=a.container.scrollLeft+10+"px",k.style.top=a.container.scrollTop+10+"px",a.container.appendChild(k),v=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){k.focus();document.execCommand("selectAll",!1,null)},0):(k.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(b){var c= +b.keyCode;window.setTimeout(mxUtils.bind(this,function(){!v||224!=c&&17!=c&&91!=c||(v=!1,a.isEditing()||null!=this.dialog||null==a.container||a.container.focus(),k.parentNode.removeChild(k),mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(b){a.isEnabled()&&(mxClipboard.copy(a),this.copyCells(k),p())}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(b){a.isEnabled()&&(this.copyCells(k,!0),p())}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(b){a.isEnabled()&& +!a.isCellLocked(a.getDefaultParent())&&(k.innerHTML=" ",k.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(b,k);k.innerHTML=" "}),0))}),!0);var F=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==k?!0:F.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED, +mxUtils.bind(this,function(b){var a=this.editor.graph,c=a.cellEditor.text2,e=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(b){null!=e&&(e.parentNode.removeChild(e),e=null);b.stopPropagation();b.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==e&&(!mxClient.IS_IE||10<document.documentMode)&&(e=this.highlightElement(c));b.stopPropagation();b.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=e&&(e.parentNode.removeChild(e), +e=null);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,function(b,c,e,d,f,k){a.insertImage(b,f,k)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()},mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(b){var e= +Math.max(1,b.width);b=Math.max(1,b.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,e)),d/Math.max(1,b));a.insertImage(decodeURIComponent(c),e*d,b*d)})):document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain")); +b.stopPropagation();b.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){n=document.createElement("div");n.style.position="absolute";n.style.top="95px";n.style.left="250px";n.style.width="2000px";n.style.height="30px";n.style.background="whiteSmoke";document.body.appendChild(n);var C=document.createElement("div");C.style.position="absolute";C.style.top="125px";C.style.left="220px";C.style.width="30px";C.style.height="1000px";C.style.background="whiteSmoke";document.body.appendChild(C); +var y=document.createElement("div");y.style.position="absolute";y.style.top="95px";y.style.left="220px";y.style.width="30px";y.style.height="30px";y.style.background="whiteSmoke";document.body.appendChild(y);this.vRuler=new mxRuler(this.editor.graph,C,!0);this.hRuler=new mxRuler(this.editor.graph,n,!1)}if("1"==urlParams.test){n=document.getElementById("geFooter");null!=n&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute", +this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),n.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(b,a){if(0<this.editor.graph.getSelectionCount()){var c= +this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var K=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==this.styleInput?!0:K.apply(this,arguments)}}n=document.getElementById("geInfo");null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var z=null;mxEvent.addListener(a.container, +"dragleave",function(b){a.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),z=null),b.stopPropagation(),b.preventDefault())});mxEvent.addListener(a.container,"dragover",mxUtils.bind(this,function(b){null==z&&(!mxClient.IS_IE||10<document.documentMode)&&(z=this.highlightElement(a.container));null!=this.sidebar&&this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()}));mxEvent.addListener(a.container,"drop",mxUtils.bind(this,function(b){null!=z&&(z.parentNode.removeChild(z),z=null);if(a.isEnabled()){var c= +mxUtils.convertPoint(a.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),e=a.view.translate,d=a.view.scale,f=c.x/d-e.x,k=c.y/d-e.y;mxEvent.isAltDown(b)&&(k=f=0);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,f,k,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(b),null,null,mxEvent.isShiftDown(b));else{var g=0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")?b.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(b,null!=this.pages); +if(null!=c)a.setSelectionCells(this.importXml(c,f,k,!0));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")){var l=b.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var h=null,e=c.getElementsByTagName("img");null!=e&&1==e.length?(l=e[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(h=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var m=!0,v=mxUtils.bind(this,function(){a.setSelectionCells(this.insertTextAt(l, +f,k,!0,h,null,m))});h&&l.length>this.resampleThreshold?this.confirmImageResize(function(b){m=b;v()},mxEvent.isControlDown(b)):v()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(b){var c=Math.max(1,b.width);b=Math.max(1,b.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,c)),e/Math.max(1,b));a.setSelectionCell(a.insertVertex(null,null,"",f,k,c*e,b*e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ +g+";"))}),mxUtils.bind(this,function(b){a.setSelectionCells(this.insertTextAt(g,f,k,!0))})):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&a.setSelectionCells(this.insertTextAt(b.dataTransfer.getData("text/plain"),f,k,!0))}}b.stopPropagation();b.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(b){var a=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==b.substring(0, +13)){var c=b.indexOf(",");0<c&&(a=this.getPageById(b.substring(c+1)),a=null!=a?a.getName():mxResources.get("pageNotFound"))}else"data:"==b.substring(0,5)&&(a=mxResources.get("action"));return a};EditorUi.prototype.handleCustomLink=function(b){if("data:page/id,"==b.substring(0,13)){var a=b.indexOf(",");(b=this.getPageById(b.substring(a+1)))&&this.selectPage(b)}else this.editor.graph.handleCustomLink(b)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage|| +mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(b,a){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle); +mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(b,a){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this, +function(b,a){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(b,a){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(b,a){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave= +mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(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.copyCells=function(b,a){var c=this.editor.graph;if(c.isSelectionEmpty())b.innerHTML= +"";else{var e=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),d=mxUtils.getXml(this.editor.graph.encodeCells(e));mxUtils.setTextContent(b,encodeURIComponent(d));a?(c.removeCells(e,!1),c.lastPasteXml=null):(c.lastPasteXml=d,c.pasteCounter=0);b.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(b,a){if(!mxEvent.isConsumed(b)){var c=a.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var e= +c[0].getAttribute("data-lucid-content");null!=e&&0<e.length&&(this.importLucidChart(e,0,0),mxEvent.consume(b))}else{var e=this.editor.graph,d=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(a):a.textContent),f=!1;try{var g=d.lastIndexOf("%3E");0<=g&&g<d.length-3&&(d=d.substring(0,g+3))}catch(A){}try{var c=a.getElementsByTagName("span"),h=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(d);this.isCompatibleString(h)&&(f=!0,d= +h)}catch(A){}e.lastPasteXml==d?e.pasteCounter++:(e.lastPasteXml=d,e.pasteCounter=0);c=e.pasteCounter*e.gridSize;if(null!=d&&0<d.length&&(f||this.isCompatibleString(d)?e.setSelectionCells(this.importXml(d,c,c)):(f=e.getInsertPoint(),e.isMouseInsertPoint()&&(c=0,e.lastPasteXml==d&&0<e.pasteCounter&&e.pasteCounter--),e.setSelectionCells(this.insertTextAt(d,f.x+c,f.y+c,!0))),!e.isSelectionEmpty())){e.scrollCellToVisible(e.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(e.view.getState(e.getSelectionCell())); +try{mxEvent.consume(b)}catch(A){}}}}};EditorUi.prototype.addFileDropHandler=function(b){if(Graph.fileSupport)for(var a=null,c=0;c<b.length;c++)mxEvent.addListener(b[c],"dragleave",function(b){null!=a&&(a.parentNode.removeChild(a),a=null);b.stopPropagation();b.preventDefault()}),mxEvent.addListener(b[c],"dragover",mxUtils.bind(this,function(b){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==a&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(a=this.highlightElement()); +b.stopPropagation();b.preventDefault()})),mxEvent.addListener(b[c],"drop",mxUtils.bind(this,function(b){null!=a&&(a.parentNode.removeChild(a),a=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<b.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(b)&&!mxEvent.isShiftDown(b)):this.openFiles(b.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(b);if(null== +c){var e=null!=b.dataTransfer?b.dataTransfer:b.clipboardData;null!=e&&(10==document.documentMode||11==document.documentMode?c=e.getData("Text"):(c=null,c=0<=mxUtils.indexOf(e.types,"text/uri-list")?b.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(e.types,"text/html")?e.getData("text/html"):null,null!=c&&0<c.length?(e=document.createElement("div"),e.innerHTML=c,e=e.getElementsByTagName("img"),0<e.length&&(c=e[0].getAttribute("src"))):0<=mxUtils.indexOf(e.types,"text/plain")&&(c=e.getData("text/plain"))), +null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&this.openLocalFile(b.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP? +"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}b.stopPropagation();b.preventDefault()}))};EditorUi.prototype.highlightElement=function(b){var a=0,c=0,d,f;if(null==b){f=document.body;var g=document.documentElement;d=(f.clientWidth||g.clientWidth)-3;f=Math.max(f.clientHeight||0,g.clientHeight)-3}else a=b.offsetTop,c=b.offsetLeft,d=b.clientWidth,f=b.clientHeight;g=document.createElement("div");g.style.zIndex= +mxPopupMenu.prototype.zIndex+2;g.style.border="3px dotted rgb(254, 137, 12)";g.style.pointerEvents="none";g.style.position="absolute";g.style.top=a+"px";g.style.left=c+"px";g.style.width=Math.max(0,d-3)+"px";g.style.height=Math.max(0,f-3)+"px";null!=b&&b.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(g):document.body.appendChild(g);return g};EditorUi.prototype.stringToCells=function(b){b=mxUtils.parseXml(b);var a=this.editor.extractGraphModel(b.documentElement);b= +[];if(null!=a){var c=new mxCodec(a.ownerDocument),d=new mxGraphModel;c.decode(a,d);a=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(a);c++)b.push(d.getChildAt(a,c))}return b};EditorUi.prototype.openFiles=function(b,a){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<b.length;c++)mxUtils.bind(this,function(b){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var e=c.target.result,d=b.name;if(null!=d&&0<d.length){!this.useCanvasForExport&&/(\.png)$/i.test(d)&& +(d=d.substring(0,d.length-4)+".xml");var f=mxUtils.bind(this,function(b){d=0<=d.lastIndexOf(".")?d.substring(0,d.lastIndexOf("."))+".xml":d+".xml";if("<mxlibrary"==b.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,a);try{this.loadLibrary(new LocalLibrary(this,b,d))}catch(v){this.handleError(v,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(b,d,a)});if(/(\.vsdx?)($|\?)/i.test(d)||/(\.vssx)($|\?)/i.test(d))this.importVisio(b, +mxUtils.bind(this,function(b){this.spinner.stop();f(b)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(e,d))this.parseFile(b,mxUtils.bind(this,function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?f(b.responseText):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==e.substring(0,26))/(\.json)$/i.test(d)&& +(d=d.substring(0,d.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,d,a),this.importLucidChart(e,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,a);try{this.loadLibrary(new LocalLibrary(this,c.target.result,b.name))}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}}else"image/png"== +b.type.substring(0,9)&&(e=this.extractGraphModelFromPng(e)),this.spinner.stop(),this.openLocalFile(e,d,a)}});c.onerror=mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b);window.openFile=null});"image"===b.type.substring(0,5)&&"image/svg"!==b.type.substring(0,9)?c.readAsDataURL(b):c.readAsText(b)})(b[c])};EditorUi.prototype.openLocalFile=function(b,a,c){var e=this.getCurrentFile(),d=mxUtils.bind(this,function(){window.openFile=null;if(null==a&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var e= +mxUtils.parseXml(b);null!=e&&(this.editor.setGraphXml(e.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,b,a||this.defaultFilename,c))});null!=b&&0<b.length&&(null==e||!e.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?d():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=e&&e.isModified()?this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile= +null}),window.openFile.setData(b,a),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var b={};if(null!=this.pages)for(var a=0;a<this.pages.length;a++)this.updatePageRoot(this.pages[a]),this.addBasenamesForCell(this.pages[a].root,b);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),b);var a=[],c;for(c in b)a.push(c); +return a};EditorUi.prototype.addBasenamesForCell=function(b,a){function c(b){if(null!=b){var c=b.lastIndexOf(".");0<c&&(b=b.substring(c+1,b.length));null==a[b]&&(a[b]=!0)}}var e=this.editor.graph,d=e.getCellStyle(b);c(mxStencilRegistry.getBasenameForStencil(d[mxConstants.STYLE_SHAPE]));e.model.isEdge(b)&&(c(mxMarker.getPackageForType(d[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(d[mxConstants.STYLE_ENDARROW])));for(var d=e.model.getChildCount(b),f=0;f<d;f++)this.addBasenamesForCell(e.model.getChildAt(b, +f),a)};EditorUi.prototype.setGraphEnabled=function(b){this.diagramContainer.style.visibility=b?"":"hidden";this.formatContainer.style.visibility=b?"":"hidden";this.sidebarFooterContainer.style.display=b?"":"none";this.sidebarContainer.style.display=b?"":"none";this.hsplit.style.display=b?"":"none";this.editor.graph.setEnabled(b);null!=this.tabContainer&&(this.tabContainer.style.visibility=b?"":"hidden");b||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&& +this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(b,a,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0); +null!=b&&0<b.length?(this.setFileData(b),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!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(b,a){null!=b?b.getPublicUrl(a):a(null)};EditorUi.prototype.createLoadMessage=function(b){var a=this.editor.graph;return{event:b,pageVisible:a.pageVisible,translate:a.view.translate,scale:a.view.scale,page:a.view.getBackgroundPageBounds(),bounds:a.getGraphBounds()}}; +EditorUi.prototype.installMessageHandler=function(b){var a=null,c=!1,d=!1,f=null,g=mxUtils.bind(this,function(b,a){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){function g(b){if(null!=b&&"function"===typeof b.charAt&&"<"!=b.charAt(0))try{"data:image/svg+xml;base64,"== +b.substring(0,26)?b=atob(b.substring(26)):"data:image/svg+xml;utf8,"==b.substring(0,24)&&(b=b.substring(24)),null!=b&&("%"==b.charAt(0)?b=decodeURIComponent(b):"<"!=b.charAt(0)&&(b=this.editor.graph.decompress(b)))}catch(J){}return b}if(e.source==(window.opener||window.parent)){var k=e.data;if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(E){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey): +k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();var l=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):null,function(b){null!=b&&h.postMessage(JSON.stringify({event:"prompt",value:b,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){l=null;l="data:image/png;base64,"== +k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):g(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey): +null,k.ignore?mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));try{l.init()}catch(E){h.postMessage(JSON.stringify({event:"draft",error:E.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var l=1==k.enableRecent,m=1==k.enableSearch,l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this, +function(a,c){a=a||this.emptyDiagramXml;null!=k.callback?h.postMessage(JSON.stringify({event:"template",xml:a,blank:a==this.emptyDiagramXml,name:c}),"*"):(b(a,e,a!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(b){this.recentReadyCallback=b;h.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(b,a){this.searchReadyCallback=a;h.postMessage(JSON.stringify({event:"searchDocs", +searchStr:b}),"*")}):null,function(b,a,c){h.postMessage(JSON.stringify({event:"template",docUrl:b,info:a,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==k.action)this.searchReadyCallback(k.list,k.errorMsg);else if("recentDocsList"==k.action)this.recentReadyCallback(k.list,k.errorMsg);else{if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))): +null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var n=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,n):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var p=null!=k.xml? +k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,w=mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();var a=this.createLoadMessage("export");a.format=k.format;a.message=k;a.data=b;a.xml=encodeURIComponent(p);h.postMessage(JSON.stringify(a),"*")}),t=mxUtils.bind(this,function(b){null==b&&(b=Editor.blankImage);"xmlpng"==k.format&&(b=this.writeGraphModelToPng(b,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&& +q.container.parentNode.removeChild(q.container);w(b)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),u=q.getGlobalVariable,B=this.pages[0];q.getGlobalVariable=function(b){return"page"==b?B.getName():"pagenumber"==b?1:u.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,function(b){t(b.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this, +function(){t(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?w("data:image/png;base64,"+b.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!= +urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)p=this.editor.getGraphXml(),n.data=this.getHtml(p,this.editor.graph),n.xml=mxUtils.getXml(p),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null== +k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==k.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(b);h.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data= +this.createSvgDataUri(mxUtils.getXml(b));h.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}h.postMessage(JSON.stringify(n),"*")}return}if("load"==k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit), +null!=k.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),k=null!=k.xmlpng? +this.extractGraphModelFromPng(k.xmlpng):null!=k.xml&&"data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):k.xml;else{h.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}}k=g(k);c=!0;try{b(k,e)}catch(E){this.handleError(E)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var x=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}); +f=x();d&&null==a&&(a=mxUtils.bind(this,function(b,a){var e=x();if(e!=f&&!c){var d=this.createLoadMessage("autosave");d.xml=e;e=JSON.stringify(d);(window.opener||window.parent).postMessage(e,"*")}f=e}),this.editor.graph.model.addListener(mxEvent.CHANGE,a),this.editor.graph.addListener("gridSizeChanged",a),this.editor.graph.addListener("shadowVisibleChanged",a),this.addListener("pageFormatChanged",a),this.addListener("pageScaleChanged",a),this.addListener("backgroundColorChanged",a),this.addListener("backgroundImageChanged", +a),this.addListener("foldingEnabledChanged",a),this.addListener("mathEnabledChanged",a),this.addListener("gridEnabledChanged",a),this.addListener("guidesEnabledChanged",a),this.addListener("pageViewChanged",a));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||h.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var h=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";h.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons= +function(){if(null!=this.menubar){var b=document.createElement("div");b.style.display="inline-block";b.style.position="absolute";b.style.paddingTop="atlas"==uiTheme?"2px":"3px";b.style.paddingLeft="8px";b.style.paddingBottom="2px";var a=document.createElement("button");mxUtils.write(a,mxResources.get("save"));a.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");a.className="geBigButton";a.style.fontSize="12px";a.style.padding="4px 6px 4px 6px";a.style.borderRadius="3px";mxEvent.addListener(a, +"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));b.appendChild(a);"1"==urlParams.saveAndExit&&(a=document.createElement("a"),mxUtils.write(a,mxResources.get("saveAndExit")),a.setAttribute("title",mxResources.get("saveAndExit")),a.style.fontSize="12px",a.style.marginLeft="6px",a.style.padding="4px",a.style.cursor="pointer",mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),b.appendChild(a));a=document.createElement("a");mxUtils.write(a, +mxResources.get("exit"));a.setAttribute("title",mxResources.get("exit"));a.style.fontSize="12px";a.style.marginLeft="6px";a.style.marginRight="20px";a.style.padding="4px";a.style.cursor="pointer";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));b.appendChild(a);this.toolbar.container.appendChild(b);this.toolbar.staticElements.push(b);b.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&& +(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(b){this.importCsv(b)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(b,a){try{var c=b.split("\n"),e=[];if(0<c.length){var d={},f=null,g=null,h="",m="auto",k="auto",n=null,p=null,C=40,y=40,K=0,z=this.editor.graph;z.getGraphBounds();for(var D= +function(){null!=a?a(aa):(z.setSelectionCells(aa),z.scrollCellToVisible(z.getSelectionCell()))},L=z.getFreeInsertPoint(),B=L.x,H=L.y,L=H,E=null,J="auto",M=[],X=null,Z=null,N=0;N<c.length&&"#"==c[N].charAt(0);){b=c[N];for(N++;N<c.length&&"\\"==b.charAt(b.length-1)&&"#"==c[N].charAt(0);)b=b.substring(0,b.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=b.charAt(1)){var S=b.indexOf(":");if(0<S){var O=mxUtils.trim(b.substring(1,S)),G=mxUtils.trim(b.substring(S+1));"label"==O?E=z.sanitizeHtml(G): +"style"==O?f=G:"identity"==O&&0<G.length&&"-"!=G?g=G:"namespace"==O&&0<G.length&&"-"!=G?h=G:"width"==O?m=G:"height"==O?k=G:"left"==O&&0<G.length?n=G:"top"==O&&0<G.length?p=G:"ignore"==O?Z=G.split(","):"connect"==O?M.push(JSON.parse(G)):"link"==O?X=G:"padding"==O?K=parseFloat(G):"edgespacing"==O?C=parseFloat(G):"nodespacing"==O?y=parseFloat(G):"layout"==O&&(J=G)}}}var W=this.editor.csvToArray(c[N]),S=null;if(null!=g)for(var R=0;R<W.length;R++)if(g==W[R]){S=R;break}null==E&&(E="%"+W[0]+"%");if(null!= +M)for(var T=0;T<M.length;T++)null==d[M[T].to]&&(d[M[T].to]={});z.model.beginUpdate();try{for(R=N+1;R<c.length;R++){var V=this.editor.csvToArray(c[R]);if(V.length==W.length){var I=null,Q=null!=S?h+V[S]:null;null!=Q&&(I=z.model.getCell(Q));null==I&&(I=new mxCell(E,new mxGeometry(B,L,0,0),f||"whiteSpace=wrap;html=1;"),I.vertex=!0,I.id=Q);for(var P=0;P<V.length;P++)z.setAttributeForCell(I,W[P],V[P]);z.setAttributeForCell(I,"placeholders","1");I.style=z.replacePlaceholders(I,I.style);for(T=0;T<M.length;T++)d[M[T].to][I.getAttribute(M[T].to)]= +I;null!=X&&"link"!=X&&(z.setLinkForCell(I,I.getAttribute(X)),z.setAttributeForCell(I,X,null));z.fireEvent(new mxEventObject("cellsInserted","cells",[I]));var ba=this.editor.graph.getPreferredSizeForCell(I);I.vertex&&(null!=n&&null!=I.getAttribute(n)&&(I.geometry.x=B+parseFloat(I.getAttribute(n))),null!=p&&null!=I.getAttribute(p)&&(I.geometry.y=H+parseFloat(I.getAttribute(p))),"@"==m.charAt(0)&&null!=I.getAttribute(m.substring(1))?I.geometry.width=parseFloat(I.getAttribute(m.substring(1))):I.geometry.width= +"auto"==m?ba.width+K:parseFloat(m),"@"==k.charAt(0)&&null!=I.getAttribute(k.substring(1))?I.geometry.height=parseFloat(I.getAttribute(k.substring(1))):I.geometry.height="auto"==k?ba.height+K:parseFloat(k),L+=I.geometry.height+y);e.push(z.addCell(I))}}for(var U=e.slice(),aa=e.slice(),T=0;T<M.length;T++)for(var Y=M[T],R=0;R<e.length;R++){var I=e[R],ia=I.getAttribute(Y.from);if(null!=ia){z.setAttributeForCell(I,Y.from,null);for(var ja=ia.split(","),P=0;P<ja.length;P++){var ca=d[Y.to][ja[P]];null!=ca&& +(E=Y.label,null!=Y.fromlabel&&(E=(I.getAttribute(Y.fromlabel)||"")+(E||"")),null!=Y.tolabel&&(E=(E||"")+(ca.getAttribute(Y.tolabel)||"")),aa.push(z.insertEdge(null,null,E||"",Y.invert?ca:I,Y.invert?I:ca,Y.style||z.createCurrentEdgeStyle())),mxUtils.remove(Y.invert?I:ca,U))}}}if(null!=Z)for(R=0;R<e.length;R++)for(I=e[R],P=0;P<Z.length;P++)z.setAttributeForCell(I,mxUtils.trim(Z[P]),null);var fa=new mxParallelEdgeLayout(z);fa.spacing=C;var ka=function(){fa.execute(z.getDefaultParent());for(var b=0;b< +e.length;b++){var a=z.getCellGeometry(e[b]);a.x=Math.round(z.snap(a.x));a.y=Math.round(z.snap(a.y));"auto"==m&&(a.width=Math.round(z.snap(a.width)));"auto"==k&&(a.height=Math.round(z.snap(a.height)))}};if("circle"==J){var da=new mxCircleLayout(z);da.resetEdges=!1;var la=da.isVertexIgnored;da.isVertexIgnored=function(b){return la.apply(this,arguments)||0>mxUtils.indexOf(e,b)};this.executeLayout(function(){da.execute(z.getDefaultParent());ka()},!0,D);D=null}else if("horizontaltree"==J||"verticaltree"== +J||"auto"==J&&aa.length==2*e.length-1&&1==U.length){z.view.validate();var ga=new mxCompactTreeLayout(z,"horizontaltree"==J);ga.levelDistance=y;ga.edgeRouting=!1;ga.resetEdges=!1;this.executeLayout(function(){ga.execute(z.getDefaultParent(),0<U.length?U[0]:null)},!0,D);D=null}else if("horizontalflow"==J||"verticalflow"==J||"auto"==J&&1==U.length){z.view.validate();var ha=new mxHierarchicalLayout(z,"horizontalflow"==J?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ha.intraCellSpacing=y;ha.disableEdgeStyle= +!1;this.executeLayout(function(){ha.execute(z.getDefaultParent(),aa);z.moveCells(aa,B,H)},!0,D);D=null}else if("organic"==J||"auto"==J&&aa.length>e.length){z.view.validate();var ea=new mxFastOrganicLayout(z);ea.forceConstant=3*y;ea.resetEdges=!1;var na=ea.isVertexIgnored;ea.isVertexIgnored=function(b){return na.apply(this,arguments)||0>mxUtils.indexOf(e,b)};fa=new mxParallelEdgeLayout(z);fa.spacing=C;this.executeLayout(function(){ea.execute(z.getDefaultParent());ka()},!0,D);D=null}this.hideDialog()}finally{z.model.endUpdate()}null!= +D&&D()}}catch(ma){this.handleError(ma)}};EditorUi.prototype.getSearch=function(b){var a="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=b&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(b,d)&&null!=urlParams[d]&&(a+=c+d+"="+urlParams[d],c="&")}else a=window.location.search;return a};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var a=0<b.indexOf("?")?1:0;if("1"==urlParams.offline)b+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "), +d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(b=0==a?b+"?":b+"&",null!=urlParams[d]&&(b+=d+"="+urlParams[d],a++))}return b};EditorUi.prototype.showLinkDialog=function(b,a,c){b=new LinkDialog(this,b,a,c,!0);this.showDialog(b.container,480,130,!0,!0);b.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(b){var a=m.apply(this,arguments),c=this.editor.graph,d=a.getSourceGraphBounds;a.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&& +null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*b.x/a),Math.ceil(this.source.minimumGraphSize.height-2*b.y/a))}return d.apply(this,arguments)};var f=a.getSourceContainerSize;a.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width* +a-2*b.x),Math.ceil(this.source.minimumGraphSize.height*a-2*b.y))}return f.apply(this,arguments)};a.getOutlineOffset=function(b){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var e=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(a.outline.container.clientWidth/b-(this.source.minimumGraphSize.width-2*e.x))/2)-e.x),Math.round(Math.max(0,(a.outline.container.clientHeight/b-(this.source.minimumGraphSize.height-2*e.y))/2)-e.y-5/b))}return new mxPoint(8/ +b,8/b)};var g=a.init;a.init=function(){g.apply(this,arguments);a.outline.view.getBackgroundPageBounds=function(){var b=c.getPageLayout(),a=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+b.x*a.width),this.scale*(this.translate.y+b.y*a.height),this.scale*b.width*a.width,this.scale*b.height*a.height)};a.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(b,c){var e=c.getProperty("change"),d=a.source,f=a.outline;f.pageScale=d.pageScale;f.pageFormat= d.pageFormat;f.background=d.background;f.pageVisible=d.pageVisible;f.background=d.background;var g=mxUtils.getCurrentStyle(d.container);f.container.style.backgroundColor=g.backgroundColor;null!=d.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=d.view.backgroundPageShape.fill);a.outline.view.clear(e.previousPage.root,!0);a.outline.view.validate()});return a};EditorUi.prototype.getServiceCount=function(b,a){var c=0;null==this.drive&&"function"!==typeof window.DriveClient|| c++;a||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;a||null==this.gitHub||c++;a||null==this.trello&&"function"!==typeof window.TrelloClient||c++;b&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var b=this.getCurrentFile(),a=null!=b||"1"==urlParams.embed&&this.editor.graph.isEnabled(); this.menus.get("viewPanels").setEnabled(a);this.menus.get("viewZoom").setEnabled(a);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==b||b.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(c);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(c), @@ -7512,7 +7513,7 @@ this.actions.get("editData").setEnabled(a);this.actions.get("shadowVisible").set this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(a&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(a&&(null==c||!c.isRestricted()));this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility); this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());b=b.view.getState(b.getSelectionCell());this.actions.get("editShape").setEnabled(a&&null!=b&&null!=b.shape&&null!=b.shape.stencil)};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&& (this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(b,a,c,d,f,g){var e=b.editor.graph;if("xml"==c)b.hideDialog(),b.saveData(a,"xml",mxUtils.getXml(b.editor.getGraphXml()),"text/xml");else if("svg"==c)b.hideDialog(),b.saveData(a,"svg",mxUtils.getXml(e.getSvg(d,f,g)),"image/svg+xml");else{var h=b.getFileData(!0,null,null,null, -null,!0),l=e.getGraphBounds(),k=Math.floor(l.width*f/e.view.scale),m=Math.floor(l.height*f/e.view.scale);h.length<=MAX_REQUEST_SIZE&&k*m<MAX_AREA?(b.hideDialog(),b.saveRequest(a,c,function(b,a){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(a||"0")+(null!=b?"&filename="+encodeURIComponent(b):"")+"&bg="+(null!=d?d:"none")+"&w="+k+"&h="+m+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor}, +null,!0),m=e.getGraphBounds(),k=Math.floor(m.width*f/e.view.scale),l=Math.floor(m.height*f/e.view.scale);h.length<=MAX_REQUEST_SIZE&&k*l<MAX_AREA?(b.hideDialog(),b.saveRequest(a,c,function(b,a){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(a||"0")+(null!=b?"&filename="+encodeURIComponent(b):"")+"&bg="+(null!=d?d:"none")+"&w="+k+"&h="+l+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor}, setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries= a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins= a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle}, @@ -7591,14 +7592,14 @@ mxResources.get("close"));a.innerHTML=mxResources.get("close");d.appendChild(a); App.prototype.start=function(){this.bg.parentNode.removeChild(this.bg);this.restoreLibraries();this.spinner.stop();try{if("1"!=urlParams.client&&"1"!=urlParams.embed&&mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(a){try{var c=this.getDiagramId(),d=this.getCurrentFile();null!=d&&d.getHash()==c||this.loadFile(c,!0)}catch(n){null!=document.body&&this.handleError(n,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!= a?a.getHash():""}))}})),(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var a=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var a=mxUtils.bind(this,function(b){"data:image/png;base64,"==b.substring(0,22)&&(b=this.extractGraphModelFromPng(b));var a=urlParams.title,a=null!=a?decodeURIComponent(a): this.defaultFilename;b=new LocalFile(this,b,a,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(b.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(b);this.getCurrentFile().setModified(!this.editor.chromeless)}),c=window.opener||window.parent;if(c!=window){var d=urlParams.create;null!=d?a(c[decodeURIComponent(d)]):(d=urlParams.data,null!=d?a(decodeURIComponent(d)):this.installMessageHandler(mxUtils.bind(this,function(b,d){d.source==c&&a(b)})))}}else if(null== -this.dialog)if("1"==urlParams.demo)d=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=d;else{d=!1;try{d=null!=window.opener&&null!=window.opener.openFile}catch(b){}if(d)this.spinner.spin(document.body,mxResources.get("loading"));else if(d=this.getDiagramId(),"0"!=urlParams.splash||null!=d&&0!=d.length)this.loadFile(this.getDiagramId());else{var f=this.getDraft(),p=null!=f?f.data:this.getFileData(),d=Editor.useLocalStorage;this.createFile(this.defaultFilename, -p,null,null,null,null,null,!0);Editor.useLocalStorage=d;null!=f&&(d=this.getCurrentFile(),null!=d&&d.addUnsavedStatus())}}});null!=this.drive&&this.defineCustomObjects();var d=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=d&&0<d.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create", -"title"]))}),c=mxUtils.bind(this,function(a){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,a,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var c=urlParams.title,c=null!=c?decodeURIComponent(c):this.defaultFilename;a=this.getServiceCount(!0);var d=4>=a?4:3,c=new CreateDialog(this,c,mxUtils.bind(this,function(a,c){if(null==c){this.hideDialog();var b=Editor.useLocalStorage;this.createFile(0<a.length?a:this.defaultFilename,this.getFileData(),null, -null,null,null,null,!0);Editor.useLocalStorage=b}else this.createFile(a,this.getFileData(!0),null,c)}),null,null,null,null,"1"==urlParams.browser,null,null,!0,d);this.showDialog(c.container,380,a>d?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));c.init()}}),d=decodeURIComponent(d);if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))try{null!=window.opener&&null!=window.opener[d]?c(window.opener[d]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(g){this.handleError(g, -mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(a){c(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),f)}))}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.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? -(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):a()}}catch(g){this.handleError(g)}}; +this.dialog)if("1"==urlParams.demo)d=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=d;else{d=!1;try{d=null!=window.opener&&null!=window.opener.openFile}catch(b){}if(d)this.spinner.spin(document.body,mxResources.get("loading"));else if(d=this.getDiagramId(),"0"!=urlParams.splash||null!=d&&0!=d.length)this.loadFile(d);else if(!mxClient.IS_CHROMEAPP){var f=this.getDraft(),p=null!=f?f.data:this.getFileData(),d=Editor.useLocalStorage; +this.createFile(this.defaultFilename,p,null,null,null,null,null,!0);Editor.useLocalStorage=d;null!=f&&(d=this.getCurrentFile(),null!=d&&d.addUnsavedStatus())}}});null!=this.drive&&this.defineCustomObjects();var d=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=d&&0<d.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&& +(window.location.search=this.getSearch(["create","title"]))}),c=mxUtils.bind(this,function(a){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,a,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var c=urlParams.title,c=null!=c?decodeURIComponent(c):this.defaultFilename;a=this.getServiceCount(!0);var d=4>=a?4:3,c=new CreateDialog(this,c,mxUtils.bind(this,function(a,c){if(null==c){this.hideDialog();var b=Editor.useLocalStorage;this.createFile(0<a.length? +a:this.defaultFilename,this.getFileData(),null,null,null,null,null,!0);Editor.useLocalStorage=b}else this.createFile(a,this.getFileData(!0),null,c)}),null,null,null,null,"1"==urlParams.browser,null,null,!0,d);this.showDialog(c.container,380,a>d?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));c.init()}}),d=decodeURIComponent(d);if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))try{null!=window.opener&&null!=window.opener[d]?c(window.opener[d]): +this.handleError(null,mxResources.get("errorLoadingFile"))}catch(g){this.handleError(g,mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(a){c(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),f)}))}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.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?(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):a()}}catch(g){this.handleError(g)}}; App.prototype.showSplash=function(a){var d=this.getServiceCount(!0,!0),f=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,2>d||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,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(null==this.mode||a){a=4==d?2:3;var c=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();f()}),a);this.showDialog(c.container,3>a?260:300,4<=d?420:300,!0,!1);c.init()}else null==urlParams.create&&f()}; +mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&f();else{a=4==d?2:3;var c=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();f()}),a);this.showDialog(c.container,3>a?260:300,4<=d?420:300,!0,!1);c.init()}}; App.prototype.addLanguageMenu=function(a,d){var f=null;if((!this.isOfflineApp()||mxClient.IS_CHROMEAPP)&&null!=this.menus.get("language")){f=document.createElement("div");f.setAttribute("title",mxResources.get("language"));f.className="geIcon geSprite geSprite-globe";f.style.position="absolute";f.style.cursor="pointer";f.style.bottom="20px";f.style.right="20px";if(d){f.style.direction="rtl";f.style.textAlign="right";f.style.right="24px";var c=document.createElement("span");c.style.display="inline-block"; c.style.fontSize="12px";c.style.margin="5px 24px 0 0";c.style.color="gray";mxUtils.write(c,mxResources.get("language"));f.appendChild(c)}mxEvent.addListener(f,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var c=new mxPopupMenu(this.menus.get("language").funct);c.div.className+=" geMenubarMenu";c.smartSeparators=!0;c.showDisabled=!0;c.autoExpand=!0;c.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(c,arguments);c.destroy()});var d=mxUtils.getOffset(f); c.popup(d.x,d.y+f.offsetHeight,null,a);this.setCurrentMenu(c)}));a.appendChild(f)}return f}; @@ -7711,84 +7712,84 @@ DriveFile&&b.constructor!=DropboxFile||null==a.drive&&b.constructor==DriveFile|| fileSize:c.size,getXml:function(d,e){a.dropbox.readFile({path:b.stat.path_lower,rev:c.rev},d,e)},getUrl:function(){return a.getUrl(window.location.pathname+"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var f=new RevisionDialog(a,d);a.showDialog(f.container,640,480,!0,!0);f.init()}catch(z){a.handleError(z)}}));c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop(); for(var d=0;d<c.items.length;d++)(function(d){d.getXml=function(e,f){a.drive.executeRequest(gapi.client.drive.revisions.get({fileId:b.getId(),revisionId:c.items[c.items.length-1]===d?b.desc.headRevisionId:d.id}),function(b){a.drive.getXmlFile(b,null,function(a){e(a.getData())},function(a){f(a)})},function(a){f(a)})};d.getUrl=function(){return a.getUrl(window.location.pathname+"?rev="+d.id+"&chrome=0&edit=_blank")+window.location.hash}})(c.items[d]);d=new RevisionDialog(a,c.items);a.showDialog(d.container, 640,480,!0,!0);d.init()},function(b){a.spinner.stop();a.handleError(b)})});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");a.actions.addAction("upload...",function(){var b=a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,a.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b)))}); -if("undefined"!==typeof MathJax){var e=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();f.model.execute(b)});e.setToggleAction(!0);e.setSelectedCallback(function(){return a.isMathEnabled()});e.isEnabled=h}isLocalStorage&&(e=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),e.setToggleAction(!0),e.setSelectedCallback(function(){return mxSettings.getShowStartScreen()})); -var l=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return l.isEnabled()&&a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=f.getSelectionCells(),c=[],d=0;d<b.length;d++)f.getModel().isVertex(b[d])&&c.push(b[d]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,180,180,!0,!0),b.init())},null,null,Editor.ctrlKey+"+Shift+M");var q="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize startStill startArrow startSize arcSize".split(" "); -a.actions.addAction("copyStyle",function(){var b=f.view.getState(f.getSelectionCell());if(f.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=f.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],c=0;c<b.length;c++){var d=b[c],e=d.indexOf("=");if(0<=e){var g=d.substring(0,e),d=d.substring(e+1);null==a.copiedStyle[g]&&"none"==d&&(a.copiedStyle[g]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(f.isEnabled()&&!f.isSelectionEmpty()&& -null!=a.copiedStyle){f.getModel().beginUpdate();try{for(var b=f.getSelectionCells(),c=0;c<b.length;c++)for(var d=f.view.getState(b[c]),e=0;e<q.length;e++){var g=q[e],h=a.copiedStyle[g];d.style[g]!=h&&f.setCellStyles(g,h,[b[c]])}}finally{f.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container, -320,170,!0,!0);b.init()}}));a.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,l,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,h,!l,m)}),!0,!1,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this, -function(b,c,d){a.downloadFile(c?"xmlpng":"png",null,null,b,null,null,d)}))}));a.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,l,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,e,!1,h,!l,!1,"jpeg")}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone|| -a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(b,c){a.downloadFile("jpeg",null,null,b)}),!0)}));e=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){f.setShadowVisible(!f.shadowVisible)}));e.setToggleAction(!0);e.setSelectedCallback(function(){return f.shadowVisible});var u=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){u||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){u=!1}), -u=!0)},null,null,"F1"));a.actions.addAction("userManual...",function(){a.openLink("https://support.draw.io/display/DO/Draw.io+Online+User+Manual")});a.actions.addAction("support...",function(){a.openLink("https://about.draw.io/support/")});a.actions.addAction("exportOptionsDisabled...",function(){a.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});a.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp? -a.openLink("https://www.draw.io/shortcuts.svg"):mxClient.IS_SVG?a.openLink("shortcuts.svg"):a.openLink("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")});a.actions.addAction("feedback...",function(){var b=new FeedbackDialog(a);a.showDialog(b.container,610,360,!0,!0);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});e=a.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow= -new TagsWindow(a,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&& -this.tagsWindow.window.isVisible()}));e=a.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(a,document.body.offsetWidth-300,110,240,140),this.findWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())})); -e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){a.exportVisio()}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",new Menu(mxUtils.bind(this,function(b,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=b.addItem(e, -null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var t=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=t.apply(this,arguments);if(null!= -b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,c){if(!mxClient.IS_CHROMEAPP&& -a.isOffline())this.addMenuItems(b,["about"],c);else{var d=b.addItem("Search:",null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var e=document.createElement("input");e.setAttribute("type","text");e.setAttribute("size","25");e.style.marginLeft="8px";mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(e.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+ -encodeURIComponent(b)),e.value="",this.editorUi.logEvent({category:"Help",action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&&(e.value="")}));d.firstChild.nextSibling.appendChild(e);mxEvent.addGestureListeners(e,function(a){document.activeElement!=e&&e.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){e.focus()},0);this.addMenuItems(b, -["-","quickStart","userManual","keyboardShortcuts","-"],c);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],c);this.addMenuItems(b,["support","-"],c);a.isOffline()||EditorUi.isElectronApp||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["download"],c);navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["offline"],c);this.addMenuItems(b,["-","about"],c)}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch", -mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})), -mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this, -function(){var a=f.getGraphBounds(),b=f.view.translate,d=f.view.scale;f.insertVertex(c,null,"",a.x/d-b.x,a.y/d-b.y,a.width/d,a.height/d,"fillColor=none;strokeColor=red;")})),mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){f.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+f.compress(mxUtils.getXml(f.encodeCells(f.getSelectionCells())))+"', width, height, 'Title');"))})), -this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],c),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=f.getGraphBounds(),c=f.view.scale,d=mxUtils.createXmlDocument(),e=d.createElement("output");d.appendChild(e);d=new mxXmlCanvas2D(e);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/c);var k=0,g=d.save;d.save=function(){k++;g.apply(this,arguments)};var h= -d.restore;d.restore=function(){k--;h.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,k);l.apply(this,arguments);mxLog.debug("leaving shape",a,k)};a.drawState(f.getView().getState(f.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",k)})),this.addMenuItems(b,["testXmlImageExport"],c),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"), -this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed),console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel", -mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&a.spinner.spin(document.body,mxResources.get("export"))&&(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&& -299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel","testDownloadRtModel"],c),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-", -"testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(f.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a, -b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,k,g,h,l,m){a.createHtml(b,c,d,e,f,k,g,h,l,m,mxUtils.bind(this,function(b,c){var d= -new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft= -"26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f,a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)}, -20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a,EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+ -"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f, -g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=f.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"), -null,"100%",Math.ceil((b.y+b.height-f.view.translate.y)/f.view.scale)+2,function(b,c,d,e,f,k,g,h){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(l){a.spinner.stop();l=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+g+";height:"+h+';" src="'+a.createLink(b,c,d,e,f,k,l)+'"></iframe>');a.showDialog(l.container,440,240,!0,!0);l.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null, -null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(k){a.spinner.stop();k=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,k));a.showDialog(k.container,440,240,!0,!0);k.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop(); -b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)e=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),e.setToggleAction(!0),e.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,170,!0,!1)});e=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&& -(mxSettings.settings.search=!b,mxSettings.save())});e.setToggleAction(!0);e.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){f.isEditing()&&f.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var d=a.createLoadMessage("save");d.xml=c;b&&(d.exit=!0);c=JSON.stringify(d)}(window.opener||window.parent).postMessage(c, -"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"), -null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone|| -this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(c, -d){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=g(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");k(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var k=mxUtils.bind(this,function(b,c,d){var e=f.view,k=f.getGraphBounds(),g=f.snap(Math.ceil(Math.max(0, -k.x/e.scale-e.translate.x)+4*f.gridSize)),h=f.snap(Math.ceil(Math.max(0,(k.y+k.height)/e.scale-e.translate.y)+4*f.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(e){var k=!0,l=mxUtils.bind(this,function(){a.resizeImage(e,b,mxUtils.bind(this,function(e,l,m){e=k?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c,g,h,Math.round(l*e),Math.round(m*e),d,function(b){a.spinner.stop();f.setSelectionCells(b);f.scrollCellToVisible(f.getSelectionCell())})}), -k)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){k=a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,g,h,0,0,d,function(b){a.spinner.stop();f.setSelectionCells(b);f.scrollCellToVisible(f.getSelectionCell())})}),g=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!= -typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){}, -d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+ -"...",null,function(){a.importLocalFile(!1)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){k(a, -c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})).isEnabled=h;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&"min"!=uiTheme&&b.addCheckmark(d,Editor.checkmarkImage); -d=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save(); -a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));e=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&& -b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));e.isEnabled=function(){return this.enabled&& -h.apply(this,arguments)};e.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body, -mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"), -null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))})); -this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())})); -this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var w=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml)&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b= -new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},x=function(a,b,c,d){var e=f.isMouseInsertPoint()?f.getInsertPoint():f.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(e.x,e.y,b,c),d);a.vertex=!0;f.getModel().beginUpdate();try{a=f.addCell(a),f.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{f.getModel().endUpdate()}f.scrollCellToVisible(a); -f.setSelectionCell(a);f.container.focus();f.editAfterInsert&&f.startEditing(a);return a};a.actions.addAction("insertText",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&f.startEditingAtCell(x("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=h;a.actions.addAction("insertRectangle",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&& -x("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=h;a.actions.addAction("insertEllipse",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=h;a.actions.addAction("insertRhombus",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=h;var A=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"== -c[d]?a.addSeparator(b):w(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);A(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this, -function(a,b){A(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()}, -c)}));this.put("openFrom",new Menu(function(c,d){null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+ -" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d); -isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP? -"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(c,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+ -" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+ -"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+ -"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},d)})),this.put("openLibraryFrom",new Menu(function(c,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+ -"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+ -" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)}, -d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(z){a.handleError(z,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(), -a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view", -new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&& -(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!= -urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage&&(d=this.addMenuItem(b,"plugins",c),a.isOffline()||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430"));b.addSeparator(c);d=this.addMenuItem(b,"tags",c);a.isOffline()&&!mxClient.IS_CHROMEAPP|| -this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966")})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b, -["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile? -this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary", -b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var f=Menus.prototype.menuCreated;Menus.prototype.menuCreated=function(a,d){if(480>=screen.width&&a==this.get("help")){d.style.paddingRight= -"0px";d.style.paddingLeft="0px";d.innerHTML="";var c=document.createElement("img");c.setAttribute("border","0");c.setAttribute("valign","bottom");c.setAttribute("src",Editor.helpImage);d.appendChild(c)}f.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; +if("undefined"!==typeof MathJax){var e=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();f.model.execute(b)});e.setToggleAction(!0);e.setSelectedCallback(function(){return a.isMathEnabled()});e.isEnabled=h}if(isLocalStorage||mxClient.IS_CHROMEAPP)e=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),e.setToggleAction(!0), +e.setSelectedCallback(function(){return mxSettings.getShowStartScreen()});var l=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return l.isEnabled()&&a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=f.getSelectionCells(),c=[],d=0;d<b.length;d++)f.getModel().isVertex(b[d])&&c.push(b[d]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,180,180,!0,!0),b.init())}, +null,null,Editor.ctrlKey+"+Shift+M");var q="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize startStill startArrow startSize arcSize".split(" ");a.actions.addAction("copyStyle",function(){var b=f.view.getState(f.getSelectionCell()); +if(f.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=f.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],c=0;c<b.length;c++){var d=b[c],e=d.indexOf("=");if(0<=e){var g=d.substring(0,e),d=d.substring(e+1);null==a.copiedStyle[g]&&"none"==d&&(a.copiedStyle[g]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(f.isEnabled()&&!f.isSelectionEmpty()&&null!=a.copiedStyle){f.getModel().beginUpdate();try{for(var b=f.getSelectionCells(),c= +0;c<b.length;c++)for(var d=f.view.getState(b[c]),e=0;e<q.length;e++){var g=q[e],h=a.copiedStyle[g];d.style[g]!=h&&f.setCellStyles(g,h,[b[c]])}}finally{f.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container,320,170,!0,!0);b.init()}}));a.actions.put("exportPng",new Action(mxResources.get("formatPng")+ +"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,l,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,h,!l,m)}),!0,!1,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(b,c,d){a.downloadFile(c?"xmlpng":"png",null,null,b,null,null,d)}))}));a.actions.put("exportJpg", +new Action(mxResources.get("formatJpg")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,l,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,e,!1,h,!l,!1,"jpeg")}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(b,c){a.downloadFile("jpeg", +null,null,b)}),!0)}));e=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){f.setShadowVisible(!f.shadowVisible)}));e.setToggleAction(!0);e.setSelectedCallback(function(){return f.shadowVisible});var u=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){u||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){u=!1}),u=!0)},null,null,"F1"));a.actions.addAction("userManual...",function(){a.openLink("https://support.draw.io/display/DO/Draw.io+Online+User+Manual")}); +a.actions.addAction("support...",function(){a.openLink("https://about.draw.io/support/")});a.actions.addAction("exportOptionsDisabled...",function(){a.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});a.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?a.openLink("https://www.draw.io/shortcuts.svg"):mxClient.IS_SVG?a.openLink("shortcuts.svg"):a.openLink("https://www.draw.io/?lightbox=1#Uhttps%3A%2F%2Fwww.draw.io%2Fshortcuts.svg")}); +a.actions.addAction("feedback...",function(){var b=new FeedbackDialog(a);a.showDialog(b.container,610,360,!0,!0);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});e=a.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(a,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide", +function(){a.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));e=a.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(a,document.body.offsetWidth-300,110,240,140), +this.findWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));a.actions.put("exportVsdx", +new Action(mxResources.get("formatVsdx")+" (beta)...",function(){a.exportVisio()}));if(mxClient.IS_CHROMEAPP||isLocalStorage&&"1"!=urlParams.offline)if(this.put("language",new Menu(mxUtils.bind(this,function(b,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=b.addItem(e,null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);a.alert(mxResources.get("restartForChangeRequired"))}), +c),(d==mxLanguage||""==d&&null==mxLanguage)&&b.addCheckmark(f,Editor.checkmarkImage));return f});d("");b.addSeparator(c);for(var e in mxLanguageMap)d(e)}))),"atlas"!=uiTheme){var t=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=t.apply(this,arguments);if(null!=b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>', +c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,c){if(!mxClient.IS_CHROMEAPP&&a.isOffline())this.addMenuItems(b,["about"],c);else{var d=b.addItem("Search:",null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var e=document.createElement("input"); +e.setAttribute("type","text");e.setAttribute("size","25");e.style.marginLeft="8px";mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(e.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+encodeURIComponent(b)),e.value="",this.editorUi.logEvent({category:"Help",action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&& +(e.value="")}));d.firstChild.nextSibling.appendChild(e);mxEvent.addGestureListeners(e,function(a){document.activeElement!=e&&e.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){e.focus()},0);this.addMenuItems(b,["-","quickStart","userManual","keyboardShortcuts","-"],c);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],c);this.addMenuItems(b,["support","-"],c);a.isOffline()||EditorUi.isElectronApp||navigator.standalone|| +"1"==urlParams.embed||this.addMenuItems(b,["download"],c);navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["offline"],c);this.addMenuItems(b,["-","about"],c)}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})), +mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS); +this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=f.getGraphBounds(),b=f.view.translate,d=f.view.scale;f.insertVertex(c,null,"",a.x/d-b.x,a.y/d-b.y,a.width/d,a.height/d,"fillColor=none;strokeColor=red;")})),mxResources.parse("createSidebarEntry=Create sidebar entry"), +this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){f.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+f.compress(mxUtils.getXml(f.encodeCells(f.getSelectionCells())))+"', width, height, 'Title');"))})),this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],c),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=f.getGraphBounds(), +c=f.view.scale,d=mxUtils.createXmlDocument(),e=d.createElement("output");d.appendChild(e);d=new mxXmlCanvas2D(e);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/c);var k=0,g=d.save;d.save=function(){k++;g.apply(this,arguments)};var h=d.restore;d.restore=function(){k--;h.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,k);l.apply(this,arguments);mxLog.debug("leaving shape",a,k)};a.drawState(f.getView().getState(f.model.root),d);mxLog.show(); +mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",k)})),this.addMenuItems(b,["testXmlImageExport"],c),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed), +console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&a.spinner.spin(document.body,mxResources.get("export"))&&(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+ +b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel", +"testDownloadRtModel"],c),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-","testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a, +!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(f.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(), +function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,k,g,h,l,m){a.createHtml(b,c,d,e,f,k,g,h,l,m,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>'); +d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft="26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f, +a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)},20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a, +EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})}, +mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")})); +a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=f.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-f.view.translate.y)/f.view.scale)+2,function(b,c,d,e,f,k,g,h){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(l){a.spinner.stop();l=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+g+";height:"+h+';" src="'+a.createLink(b,c,d,e,f,k,l)+'"></iframe>'); +a.showDialog(l.container,440,240,!0,!0);l.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(k){a.spinner.stop();k=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,k));a.showDialog(k.container,440,240,!0,!0);k.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")}); +a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)e=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),e.setToggleAction(!0),e.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container, +360,170,!0,!1)});e=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});e.setToggleAction(!0);e.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){f.isEditing()&&f.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml()); +if("json"==urlParams.proto){var d=a.createLoadMessage("save");d.xml=c;b&&(d.exit=!0);c=JSON.stringify(d)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit", +modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b, +["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")}))); +this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(c,d){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=g(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");k(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"): +null)},b==a.drive)},!0)}var k=mxUtils.bind(this,function(b,c,d){var e=f.view,k=f.getGraphBounds(),g=f.snap(Math.ceil(Math.max(0,k.x/e.scale-e.translate.x)+4*f.gridSize)),h=f.snap(Math.ceil(Math.max(0,(k.y+k.height)/e.scale-e.translate.y)+4*f.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(e){var k=!0,l=mxUtils.bind(this,function(){a.resizeImage(e,b,mxUtils.bind(this,function(e,l,m){e=k?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c, +g,h,Math.round(l*e),Math.round(m*e),d,function(b){a.spinner.stop();f.setSelectionCells(b);f.scrollCellToVisible(f.getSelectionCell())})}),k)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){k=a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,g,h,0,0,d,function(b){a.spinner.stop();f.setSelectionCells(b);f.scrollCellToVisible(f.getSelectionCell())})}),g=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)? +b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+ +"...",null,function(){e(a.dropbox)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+ +"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.importLocalFile(!1)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c= +/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){k(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})).isEnabled=h;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))}, +c);"atlas"!=uiTheme&&"dark"!=uiTheme&&"min"!=uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage); +d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));e=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!= +a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok")); +return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));e.isEnabled=function(){return this.enabled&&h.apply(this,arguments)};e.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this, +function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0), +null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&& +b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this, +function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var w=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&& +!a.isOffline())&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},x=function(a,b,c,d){var e=f.isMouseInsertPoint()?f.getInsertPoint():f.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(e.x,e.y,b,c),d);a.vertex=!0;f.getModel().beginUpdate();try{a=f.addCell(a), +f.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{f.getModel().endUpdate()}f.scrollCellToVisible(a);f.setSelectionCell(a);f.container.focus();f.editAfterInsert&&f.startEditing(a);return a};a.actions.addAction("insertText",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&f.startEditingAtCell(x("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled= +h;a.actions.addAction("insertRectangle",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=h;a.actions.addAction("insertEllipse",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=h;a.actions.addAction("insertRhombus",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled= +h;var A=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):w(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);A(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null, +function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){A(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]); +b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(c,d){null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+ +"...",null,function(){a.pickFile(App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+ +" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&& +(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(c,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...", +null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+ +" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+ +"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},d)})),this.put("openLibraryFrom",new Menu(function(c,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+ +"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!= +a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+ +"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<= +c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(z){a.handleError(z,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})));this.put("edit",new Menu(mxUtils.bind(this,function(b,a){this.addMenuItems(b,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))}))); +this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c); +mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d, +"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage&&(d=this.addMenuItem(b,"plugins",c),a.isOffline()||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430"));b.addSeparator(c); +d=this.addMenuItem(b,"tags",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966")})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "), +c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent", +b,c);null!=d&&d.constructor==DriveFile?this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish", +b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var f=Menus.prototype.menuCreated;Menus.prototype.menuCreated=function(a, +d){if(480>=screen.width&&a==this.get("help")){d.style.paddingRight="0px";d.style.paddingLeft="0px";d.innerHTML="";var c=document.createElement("img");c.setAttribute("border","0");c.setAttribute("valign","bottom");c.setAttribute("src",Editor.helpImage);d.appendChild(c)}f.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,d,f){this.ui=a;this.page=d;this.previous=this.name=f}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; function MovePage(a,d,f){this.ui=a;this.oldIndex=d;this.newIndex=f}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; function SelectPage(a,d){this.ui=a;this.previousPage=this.page=d;this.neverShown=!0;null!=d&&(this.neverShown=null==d.viewState,this.ui.updatePageRoot(d))} @@ -7909,12 +7910,12 @@ EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a mxResources.get("text");b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";b.actions.get("insertRectangle").label=mxResources.get("rectangle");b.actions.get("insertEllipse").label=mxResources.get("ellipse");b.actions.get("insertRhombus").label=mxResources.get("rhombus");b.actions.get("insertImage").label=mxResources.get("image")+"...";b.actions.get("insertLink").label=mxResources.get("link")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label= mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importFile",new Action("File...",function(){c.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",function(){null!=a.files&&b.importFiles(a.files,null,null,b.maxImageSize)});a.click()}));b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){c.popupMenuHandler.hideMenu();b.showImportCsvDialog()})); b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(b,"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){d(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+ -"...",function(){a(b)}));EditorUi.enablePlantUml&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,"new open - save saveAs -".split(" "),c):"1"==urlParams.embed? -(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile&&(b.menus.addMenuItems(a,["-","share"],c),null!=d.realtime&&b.menus.addMenuItems(a,["chatWindowTitle"],c),a.addSeparator(c));b.menus.addMenuItems(a,["-","outline", -"layers","-","find"],c);d=this.addMenuItem(a,"tags",c);b.isOffline()&&!mxClient.IS_CHROMEAPP||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,c){f.apply(this, -arguments);a.addSeparator(c);b.menus.addSubmenu("openRecent",a,c)}}this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],c):b.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||b.menus.addMenuItems(a,["-","revisionHistory"],c);b.menus.addMenuItems(a,["-","autosave"],c)})));var g= -this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){g.funct(a,c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=h&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","pageScale"], -c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);if(!b.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(c);var d=b.menus.addMenuItem(a,"plugins",c);b.isOffline()||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText createShape plantUml - importCsv formatSql editDiagram".split(" "), +"...",function(){a(b)}));EditorUi.enablePlantUml&&!b.isOffline()&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,"new open - save saveAs -".split(" "), +c):"1"==urlParams.embed?(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile&&(b.menus.addMenuItems(a,["-","share"],c),null!=d.realtime&&b.menus.addMenuItems(a,["chatWindowTitle"],c),a.addSeparator(c));b.menus.addMenuItems(a, +["-","outline","layers","-","find"],c);d=this.addMenuItem(a,"tags",c);b.isOffline()&&!mxClient.IS_CHROMEAPP||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a, +c){f.apply(this,arguments);a.addSeparator(c);b.menus.addSubmenu("openRecent",a,c)}}this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],c):b.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||b.menus.addMenuItems(a,["-","revisionHistory"],c);b.menus.addMenuItems(a,["-","autosave"], +c)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){g.funct(a,c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=h&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips", +"pageScale"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);if(!b.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(c);var d=b.menus.addMenuItem(a,"plugins",c);b.isOffline()||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "), c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.menus.addSubmenu("importFrom",a,c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",a,c);b.menus.addSubmenu("insertAdvanced",a,c)})));var l="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "), m=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<l.length;c++)"-"==l[c]?a.addSeparator(b):m(a,b,mxResources.get(l[c])+"...",l[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "), c)})))};var t=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var f=e.menus.get(a),g=l.addMenu(mxResources.get(a),mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height="30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));e.menus.menuCreated(f,g,"geMenuItem");null!=c? diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.js index 219dda7f7..1d0d42599 100644 --- a/src/main/webapp/js/diagramly/App.js +++ b/src/main/webapp/js/diagramly/App.js @@ -2164,26 +2164,29 @@ App.prototype.start = function() if (urlParams['splash'] == '0' && (id == null || id.length == 0)) { - var draft = this.getDraft(); - var fileData = (draft != null) ? draft.data : this.getFileData(); - var prev = Editor.useLocalStorage; - this.createFile(this.defaultFilename, fileData, null, null, null, null, null, true); - Editor.useLocalStorage = prev; - - // Draft was used so the user should save the file - if (draft != null) + if (!mxClient.IS_CHROMEAPP) { - var file = this.getCurrentFile(); + var draft = this.getDraft(); + var fileData = (draft != null) ? draft.data : this.getFileData(); + var prev = Editor.useLocalStorage; + this.createFile(this.defaultFilename, fileData, null, null, null, null, null, true); + Editor.useLocalStorage = prev; - if (file != null) + // Draft was used so the user should save the file + if (draft != null) { - file.addUnsavedStatus(); + var file = this.getCurrentFile(); + + if (file != null) + { + file.addUnsavedStatus(); + } } } } else { - this.loadFile(this.getDiagramId()); + this.loadFile(id); } } } @@ -2364,7 +2367,7 @@ App.prototype.showSplash = function(force) this.showSplash(); })); } - else if (this.mode == null || force) + else if (!mxClient.IS_CHROMEAPP && (this.mode == null || force)) { var rowLimit = (serviceCount == 4) ? 2 : 3; diff --git a/src/main/webapp/js/diagramly/Dialogs.js b/src/main/webapp/js/diagramly/Dialogs.js index 226cf8d36..26a73d569 100644 --- a/src/main/webapp/js/diagramly/Dialogs.js +++ b/src/main/webapp/js/diagramly/Dialogs.js @@ -960,7 +960,7 @@ var ErrorDialog = function(editorUi, title, message, buttonText, fn, retry, butt /** * Constructs a new embed dialog */ -var EmbedDialog = function(editorUi, result, timeout, ignoreSize, previewFn) +var EmbedDialog = function(editorUi, result, timeout, ignoreSize, previewFn, title) { var div = document.createElement('div'); var maxSize = 500000; @@ -970,8 +970,15 @@ var EmbedDialog = function(editorUi, result, timeout, ignoreSize, previewFn) // Checks if result is a link var validUrl = /^https?:\/\//.test(result) || /^mailto:\/\//.test(result); - mxUtils.write(div, mxResources.get((result.length < maxSize) ? - ((validUrl) ? 'link' : 'mainEmbedNotice') : 'preview') + ':'); + if (title != null) + { + mxUtils.write(div, title); + } + else + { + mxUtils.write(div, mxResources.get((result.length < maxSize) ? + ((validUrl) ? 'link' : 'mainEmbedNotice') : 'preview') + ':'); + } mxUtils.br(div); var size = document.createElement('div'); diff --git a/src/main/webapp/js/diagramly/Editor.js b/src/main/webapp/js/diagramly/Editor.js index 697b29901..edb62aa9f 100644 --- a/src/main/webapp/js/diagramly/Editor.js +++ b/src/main/webapp/js/diagramly/Editor.js @@ -1486,12 +1486,14 @@ cells = this.getCellsForAction(action.select); this.setSelectionCells(cells); } - - if (action.scroll != null) + + if (action.highlight != null) { - cells = this.getCellsForAction(action.scroll); + cells = this.getCellsForAction(action.highlight); + this.highlightCells(cells, action.highlight.color, + action.highlight.duration, action.highlight.opacity); } - + if (action.toggle != null) { this.toggleCells(this.getCellsForAction(action.toggle)); @@ -1507,13 +1509,11 @@ this.setCellsVisible(this.getCellsForAction(action.hide), false); } - if (action.highlight != null) + if (action.scroll != null) { - cells = this.getCellsForAction(action.highlight); - this.highlightCells(cells, action.highlight.color, - action.highlight.duration, action.highlight.opacity); + cells = this.getCellsForAction(action.scroll); } - + if (cells.length > 0) { this.scrollCellToVisible(cells[0]); diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.js index dc9cc0ae9..ab6cf8cd8 100644 --- a/src/main/webapp/js/diagramly/EditorUi.js +++ b/src/main/webapp/js/diagramly/EditorUi.js @@ -6190,25 +6190,31 @@ { // Fires cellsInserted to apply the current style to the inserted text. // This requires the value to be empty when the event is fired. - cell = graph.insertVertex(graph.getDefaultParent(), null, '', + cell = graph.insertVertex(graph.getDefaultParent(), null, '', graph.snap(dx), graph.snap(dy), 1, 1, 'text;' + ((html) ? 'html=1;' : '')); - graph.fireEvent(new mxEventObject('textInserted', 'cells', [cell])); - - // Apply value and updates the cell size to fit the text block - cell.value = text; - graph.updateCellSize(cell); - - // See http://stackoverflow.com/questions/6927719/url-regex-does-not-work-in-javascript - var regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i; + graph.fireEvent(new mxEventObject('textInserted', 'cells', [cell])); - if (regexp.test(cell.value)) - { - graph.setLinkForCell(cell, cell.value); - } - - // Adds spacing - cell.geometry.width += graph.gridSize; - cell.geometry.height += graph.gridSize; + // Single tag is converted + if (text.charAt(0) == '<' && text.indexOf('>') == text.length - 1) + { + text = mxUtils.htmlEntities(text); + } + + // Apply value and updates the cell size to fit the text block + cell.value = text; + graph.updateCellSize(cell); + + // See http://stackoverflow.com/questions/6927719/url-regex-does-not-work-in-javascript + var regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i; + + if (regexp.test(cell.value)) + { + graph.setLinkForCell(cell, cell.value); + } + + // Adds spacing + cell.geometry.width += graph.gridSize; + cell.geometry.height += graph.gridSize; } finally { diff --git a/src/main/webapp/js/diagramly/Init.js b/src/main/webapp/js/diagramly/Init.js index 212433336..5556da5f1 100644 --- a/src/main/webapp/js/diagramly/Init.js +++ b/src/main/webapp/js/diagramly/Init.js @@ -244,7 +244,6 @@ function setCurrentXml(data, filename) // Enables offline mode if (urlParams['offline'] == '1' || urlParams['demo'] == '1' || urlParams['stealth'] == '1' || urlParams['local'] == '1') { - urlParams['analytics'] = '0'; urlParams['picker'] = '0'; urlParams['gapi'] = '0'; urlParams['db'] = '0'; diff --git a/src/main/webapp/js/diagramly/Menus.js b/src/main/webapp/js/diagramly/Menus.js index b269953f6..7ba237840 100644 --- a/src/main/webapp/js/diagramly/Menus.js +++ b/src/main/webapp/js/diagramly/Menus.js @@ -420,7 +420,7 @@ action.isEnabled = isGraphEnabled; } - if (isLocalStorage) + if (isLocalStorage || mxClient.IS_CHROMEAPP) { var action = editorUi.actions.addAction('showStartScreen', function() { @@ -1957,7 +1957,7 @@ var addInsertItem = function(menu, parent, title, method) { - if (method != 'plantUml' || EditorUi.enablePlantUml) + if (method != 'plantUml' || (EditorUi.enablePlantUml && !editorUi.isOffline())) { menu.addItem(title, null, mxUtils.bind(this, function() { diff --git a/src/main/webapp/js/diagramly/Minimal.js b/src/main/webapp/js/diagramly/Minimal.js index 27b8417c9..84ae8546f 100644 --- a/src/main/webapp/js/diagramly/Minimal.js +++ b/src/main/webapp/js/diagramly/Minimal.js @@ -696,7 +696,7 @@ EditorUi.initMinimalTheme = function() toggleFormat(ui); })); - if (EditorUi.enablePlantUml) + if (EditorUi.enablePlantUml && !ui.isOffline()) { ui.actions.put('plantUml', new Action(mxResources.get('plantUml') + '...', function() { @@ -868,7 +868,7 @@ EditorUi.initMinimalTheme = function() this.put('insertAdvanced', new Menu(mxUtils.bind(this, function(menu, parent) { - ui.menus.addMenuItems(menu, ['importText', 'createShape', 'plantUml', '-', 'importCsv', 'formatSql', 'editDiagram'], parent); + ui.menus.addMenuItems(menu, ['importText', 'plantUml', '-', 'formatSql', 'importCsv', '-', 'createShape', 'editDiagram'], parent); }))); mxResources.parse('insertLayout=' + mxResources.get('layout')); diff --git a/src/main/webapp/js/diagramly/sidebar/Sidebar-WebIcons.js b/src/main/webapp/js/diagramly/sidebar/Sidebar-WebIcons.js index 823375116..914b71efa 100644 --- a/src/main/webapp/js/diagramly/sidebar/Sidebar-WebIcons.js +++ b/src/main/webapp/js/diagramly/sidebar/Sidebar-WebIcons.js @@ -468,7 +468,7 @@ this.createVertexTemplateEntry(s + 'drawio2;fillColor=#1A5BA3', w * 261, h * 354, '', 'Draw.io', null, null, this.getTagsForStencil(gn, 'drawio draw io draw.io', dt).join(' ')), this.createVertexTemplateEntry(s + 'drawio3;fillColor=#1A5BA3;fontSize=15;fontColor=#1A5BA3;fontStyle=1', - w * 261, h * 261, 'draw<font color="#f08707">.io</font>', 'Draw.io', null, null, this.getTagsForStencil(gn, 'drawio draw io draw.io', dt).join(' ')), + w * 261, h * 261, 'draw.<font color="#f08707">io</font>', 'Draw.io', null, null, this.getTagsForStencil(gn, 'drawio draw io draw.io', dt).join(' ')), this.createVertexTemplateEntry(s + 'dribbble;fillColor=#EB548D', w * 337, h * 336, '', 'Dribbble', null, null, this.getTagsForStencil(gn, 'dribbble', dt).join(' ')), this.createVertexTemplateEntry(s + 'dropbox;fillColor=#0287EA', diff --git a/src/main/webapp/js/embed-static.min.js b/src/main/webapp/js/embed-static.min.js index 1b5bf8e2d..2763b3a77 100644 --- a/src/main/webapp/js/embed-static.min.js +++ b/src/main/webapp/js/embed-static.min.js @@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})}); "function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.8.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& +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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.8.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT: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:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.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:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")|| diff --git a/src/main/webapp/js/mxgraph/EditorUi.js b/src/main/webapp/js/mxgraph/EditorUi.js index 401c50051..dbb5d4a3c 100644 --- a/src/main/webapp/js/mxgraph/EditorUi.js +++ b/src/main/webapp/js/mxgraph/EditorUi.js @@ -975,11 +975,6 @@ EditorUi.prototype.footerHeight = 28; */ EditorUi.prototype.sidebarFooterHeight = 34; -/** - * Specifies the link for the edit button in chromeless mode. - */ -EditorUi.prototype.editButtonLink = null; - /** * Specifies the position of the horizontal split bar. Default is 208 or 118 for * screen widths <= 640px. @@ -1001,6 +996,11 @@ EditorUi.prototype.lightboxMaxFitScale = 2; */ EditorUi.prototype.lightboxVerticalDivider = 4; +/** + * Specifies if single click on horizontal split should collapse sidebar. Default is false. + */ +EditorUi.prototype.hsplitClickEnabled = false; + /** * Installs the listeners to update the action states. */ @@ -3247,16 +3247,16 @@ EditorUi.prototype.addSplitHandler = function(elt, horizontal, dx, onChange) mxEvent.consume(evt); }); - mxEvent.addListener(elt, 'click', function(evt) + mxEvent.addListener(elt, 'click', mxUtils.bind(this, function(evt) { - if (!ignoreClick) + if (!ignoreClick && this.hsplitClickEnabled) { var next = (last != null) ? last - dx : 0; last = getValue(); onChange(next); mxEvent.consume(evt); } - }); + })); mxEvent.addGestureListeners(document, null, moveHandler, dropHandler); diff --git a/src/main/webapp/js/reader.min.js b/src/main/webapp/js/reader.min.js index 3644de615..335627586 100644 --- a/src/main/webapp/js/reader.min.js +++ b/src/main/webapp/js/reader.min.js @@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})}); "function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.8.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& +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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.8.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT: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:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.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:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")|| diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js index 59f393c8e..8b97000b6 100644 --- a/src/main/webapp/js/viewer.min.js +++ b/src/main/webapp/js/viewer.min.js @@ -104,7 +104,7 @@ window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Ba ko:"í•œêµì–´",ja:"日本語",zh:"ä¸æ–‡ï¼ˆä¸å›½ï¼‰","zh-tw":"ä¸æ–‡ï¼ˆå°ç£ï¼‰"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}return a}(); function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} (function(){if("undefined"!==typeof JSON&&isLocalStorage)try{var a=localStorage.getItem(".drawio-config"),b=!0;null!=a&&(b=JSON.parse(a).showStartScreen);0==b&&(urlParams.splash="0")}catch(c){}a=urlParams["export"];null!=a&&("http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";b=window.location.host;"test.draw.io"!=b&&(a=b.length-7,b=b.lastIndexOf("draw.io",a),-1!==b&&b===a&&(window.DRAWIO_LOG_URL="https://log.draw.io"))})(); -if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.analytics="0",urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");window.urlParams=window.urlParams||{};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"; +if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");window.urlParams=window.urlParams||{};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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"3.9.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT: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:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.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/")&& @@ -1950,7 +1950,7 @@ x.style.color=.5>.213*this.rgb[0]+.715*this.rgb[1]+.072*this.rgb[2]?"#FFF":"#000 this.rgb[1]=b;var e=null===c?this.rgb[2]:this.rgb[2]=c,f=Math.min(Math.min(a,b),e);c=Math.max(Math.max(a,b),e);var g=c-f;0===g?a=[null,0,c]:(a=a===f?3+(e-b)/g:b===f?5+(a-e)/g:1+(b-a)/g,a=[6===a?0:a,g/c,c]);null!==a[0]&&(this.hsv[0]=a[0]);0!==a[2]&&(this.hsv[1]=a[1]);this.hsv[2]=a[2];this.exportColor(d)};this.fromString=function(a,b){var c=a.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);return c?(6===c[1].length?this.fromRGB(parseInt(c[1].substr(0,2),16)/255,parseInt(c[1].substr(2,2),16)/255,parseInt(c[1].substr(4, 2),16)/255,b):this.fromRGB(parseInt(c[1].charAt(0)+c[1].charAt(0),16)/255,parseInt(c[1].charAt(1)+c[1].charAt(1),16)/255,parseInt(c[1].charAt(2)+c[1].charAt(2),16)/255,b),!0):!1};this.toString=function(){return(256|Math.round(255*this.rgb[0])).toString(16).substr(1)+(256|Math.round(255*this.rgb[1])).toString(16).substr(1)+(256|Math.round(255*this.rgb[2])).toString(16).substr(1)};var r=this,t="hvs"===this.pickerMode.toLowerCase()?1:0,u=jscolor.fetchElement(this.valueElement),x=jscolor.fetchElement(this.styleElement), y=!1,A=!1,z=1,v=2,B=4,C=8;u&&(q=function(){r.fromString(u.value,z);p()},jscolor.addEvent(u,"keyup",q),jscolor.addEvent(u,"input",q),jscolor.addEvent(u,"blur",l),u.setAttribute("autocomplete","off"));x&&(x.jscStyle={backgroundImage:x.style.backgroundImage,backgroundColor:x.style.backgroundColor,color:x.style.color});switch(t){case 0:jscolor.requireImage("hs.png");break;case 1:jscolor.requireImage("hv.png")}this.importColor()}};jscolor.install(); -Editor=function(a,d,e,b,k){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=b||this.createGraph(d,e);this.editable=null!=k?k:!a;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(a){this.status=a;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus= +Editor=function(a,d,e,b,h){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=b||this.createGraph(d,e);this.editable=null!=h?h:!a;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(a){this.status=a;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus= function(){return this.status};this.graphChangeListener=function(a,b){var d=null!=b?b.getProperty("edit"):null;null!=d&&d.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};Editor.pageCounter=0; (function(){try{for(var a=window;null!=a.opener&&"undefined"!==typeof a.opener.Editor&&!isNaN(a.opener.Editor.pageCounter)&&a.opener!=a;)a=a.opener;null!=a&&(a.Editor.pageCounter++,Editor.pageCounter=a.Editor.pageCounter)}catch(d){}})();Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS; Editor.helpImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC5BxTwAAAAH3RSTlMAlUF8boNQIE0LBgOgkGlHNSwqFIx/dGVUOjApmV9ezNACSAAAAIVJREFUGNNtjNsOgzAMQ5NeoVcKDAZs+//PXLKI8YKlWvaRU7jXuFpb9qsbdK05XILUiE8JHQox1Pv3OgFUzf1AGqWqUg+QBwLF0YAeegBlCNgRWOpB5vUfTCmeoHQ/wNdy0jLH/cM+b+wLTw4n/7ACEmHVVy8h6qy8V7MNcGowWpsNbvUFcGUEdSi1s/oAAAAASUVORK5CYII=":IMAGE_PATH+ @@ -1983,14 +1983,14 @@ this.updateGraphComponents();this.fireEvent(new mxEventObject("resetGraphView")) Editor.prototype.getGraphXml=function(a){a=(null!=a?a:1)?(new mxCodec(mxUtils.createXmlDocument())).encode(this.graph.getModel()):this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));if(0!=this.graph.view.translate.x||0!=this.graph.view.translate.y)a.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),a.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);a.setAttribute("grid",this.graph.isGridEnabled()?"1":"0");a.setAttribute("gridSize", this.graph.gridSize);a.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");a.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");a.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0");a.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");a.setAttribute("fold",this.graph.foldingEnabled?"1":"0");a.setAttribute("page",this.graph.pageVisible?"1":"0");a.setAttribute("pageScale",this.graph.pageScale);a.setAttribute("pageWidth",this.graph.pageFormat.width); a.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&a.setAttribute("background",this.graph.background);return a};Editor.prototype.updateGraphComponents=function(){var a=this.graph;null!=a.container&&(a.view.validateBackground(),a.container.style.overflow=a.scrollbars?"auto":"hidden",this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(a){this.modified=a};Editor.prototype.setFilename=function(a){this.filename=a}; -Editor.prototype.createUndoManager=function(){var a=this.graph,d=new mxUndoManager;this.undoListener=function(a,e){d.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,d){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(b,d){for(var e=a.getSelectionCellsForChanges(d.getProperty("edit").changes),k=a.getModel(),q=[],v=0;v<e.length;v++)(k.isVertex(e[v])||k.isEdge(e[v]))&&null!=a.view.getState(e[v])&& +Editor.prototype.createUndoManager=function(){var a=this.graph,d=new mxUndoManager;this.undoListener=function(a,e){d.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,d){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(b,d){for(var e=a.getSelectionCellsForChanges(d.getProperty("edit").changes),h=a.getModel(),q=[],v=0;v<e.length;v++)(h.isVertex(e[v])||h.isEdge(e[v]))&&null!=a.view.getState(e[v])&& q.push(e[v]);a.setSelectionCells(q)};d.addListener(mxEvent.UNDO,e);d.addListener(mxEvent.REDO,e);return d};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()}; OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)}; -function Dialog(a,d,e,b,k,m,p,q){var v=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(v=80);e+=v;b+=v;var c=e,f=b,g=Math.max(document.body.clientHeight,document.documentElement.clientHeight),u=Math.max(1,Math.round((document.body.clientWidth-e-64)/2)),t=Math.max(1,Math.round((g-b-a.footerHeight)/3));mxClient.IS_QUIRKS||(d.style.maxHeight="100%");e=Math.min(e,document.body.scrollWidth-64);b=Math.min(b,g-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&& -(this.bg=a.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=g+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var h=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=h.x+"px";this.bg.style.top=h.y+"px";u+=h.x;t+=h.y;k&&document.body.appendChild(this.bg);var n=a.createDiv("geDialog");k=this.getPosition(u,t, -e,b);u=k.x;t=k.y;n.style.width=e+"px";n.style.height=b+"px";n.style.left=u+"px";n.style.top=t+"px";n.style.zIndex=this.zIndex;n.appendChild(d);document.body.appendChild(n);!q&&d.clientHeight>n.clientHeight-64&&(d.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=t+14+"px",m.style.left=u+e+38-v+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click", +function Dialog(a,d,e,b,h,m,p,q){var v=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(v=80);e+=v;b+=v;var c=e,f=b,g=Math.max(document.body.clientHeight,document.documentElement.clientHeight),u=Math.max(1,Math.round((document.body.clientWidth-e-64)/2)),t=Math.max(1,Math.round((g-b-a.footerHeight)/3));mxClient.IS_QUIRKS||(d.style.maxHeight="100%");e=Math.min(e,document.body.scrollWidth-64);b=Math.min(b,g-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&& +(this.bg=a.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=g+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var l=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=l.x+"px";this.bg.style.top=l.y+"px";u+=l.x;t+=l.y;h&&document.body.appendChild(this.bg);var n=a.createDiv("geDialog");h=this.getPosition(u,t, +e,b);u=h.x;t=h.y;n.style.width=e+"px";n.style.height=b+"px";n.style.left=u+"px";n.style.top=t+"px";n.style.zIndex=this.zIndex;n.appendChild(d);document.body.appendChild(n);!q&&d.clientHeight>n.clientHeight-64&&(d.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=t+14+"px",m.style.left=u+e+38-v+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click", mxUtils.bind(this,function(){a.hideDialog(!0)})),document.body.appendChild(m),this.dialogImg=m,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){g=Math.max(document.body.clientHeight,document.documentElement.clientHeight);this.bg.style.height=g+"px";u=Math.max(1,Math.round((document.body.clientWidth-e-64)/2));t=Math.max(1,Math.round((g-b-a.footerHeight)/3));e=Math.min(c,document.body.scrollWidth-64);b= -Math.min(f,g-64);var l=this.getPosition(u,t,e,b);u=l.x;t=l.y;n.style.left=u+"px";n.style.top=t+"px";n.style.width=e+"px";n.style.height=b+"px";!q&&d.clientHeight>n.clientHeight-64&&(d.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=t+14+"px",this.dialogImg.style.left=u+e+38-v+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=p;this.container=n;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white"; +Math.min(f,g-64);var k=this.getPosition(u,t,e,b);u=k.x;t=k.y;n.style.left=u+"px";n.style.top=t+"px";n.style.width=e+"px";n.style.height=b+"px";!q&&d.clientHeight>n.clientHeight-64&&(d.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=t+14+"px",this.dialogImg.style.left=u+e+38-v+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=p;this.container=n;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white"; Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1; Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+ "/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png"; @@ -2001,30 +2001,30 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+ "/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,d){return new mxPoint(a,d)};Dialog.prototype.close=function(a){null!=this.onDialogClose&&(this.onDialogClose(a),this.onDialogClose=null);null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)}; var PrintDialog=function(a,d){this.create(a,d)}; -PrintDialog.prototype.create=function(a){function d(a){var b=q.checked||c.checked,d=parseInt(g.value)/100;isNaN(d)&&(d=1,g.value="100%");var d=.75*d,l=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,u=1/e.pageScale;if(b){var r=q.checked?1:parseInt(f.value);isNaN(r)||(u=mxUtils.getScaleForPageCount(r,e,l))}e.getGraphBounds();var t=r=0,l=mxRectangle.fromRectangle(l);l.width=Math.ceil(l.width*d);l.height=Math.ceil(l.height*d);u*=d;!b&&e.pageVisible?(d=e.getPageLayout(),r-=d.x*l.width,t-=d.y*l.height): -b=!0;b=PrintDialog.createPrintPreview(e,u,l,0,r,t,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,b,k,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var p=document.createElement("tbody");b=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var v=document.createElement("span");mxUtils.write(v," "+mxResources.get("fitPage")); -k.appendChild(v);mxEvent.addListener(v,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});b.appendChild(k);p.appendChild(b);b=b.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);v=document.createElement("span");mxUtils.write(v," "+mxResources.get("posterPrint")+":");k.appendChild(v);mxEvent.addListener(v, -"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});b.appendChild(k);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(f);mxUtils.write(k," "+mxResources.get("pages")+" (max)");b.appendChild(k);p.appendChild(b);mxEvent.addListener(c,"change", -function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});b=b.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");b.appendChild(k);k=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";k.appendChild(g);b.appendChild(k);p.appendChild(b);b=document.createElement("tr");k=document.createElement("td");k.colSpan=2; -k.style.paddingTop="20px";k.setAttribute("align","right");v=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});v.className="geBtn";a.editor.cancelFirst&&k.appendChild(v);if(PrintDialog.previewEnabled){var u=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)});u.className="geBtn";k.appendChild(u)}u=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});u.className="geBtn gePrimaryBtn";k.appendChild(u);a.editor.cancelFirst|| -k.appendChild(v);b.appendChild(k);p.appendChild(b);m.appendChild(p);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var d=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(d,500):d()}}; -PrintDialog.createPrintPreview=function(a,d,e,b,k,m,p){d=new mxPrintPreview(a,d,e,b,k,m);d.title=mxResources.get("preview");d.printBackgroundImage=!0;d.autoOrigin=p;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";d.backgroundColor=a;var q=d.writeHead;d.writeHead=function(a){q.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return d}; +PrintDialog.prototype.create=function(a){function d(a){var b=q.checked||c.checked,d=parseInt(g.value)/100;isNaN(d)&&(d=1,g.value="100%");var d=.75*d,k=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,u=1/e.pageScale;if(b){var r=q.checked?1:parseInt(f.value);isNaN(r)||(u=mxUtils.getScaleForPageCount(r,e,k))}e.getGraphBounds();var t=r=0,k=mxRectangle.fromRectangle(k);k.width=Math.ceil(k.width*d);k.height=Math.ceil(k.height*d);u*=d;!b&&e.pageVisible?(d=e.getPageLayout(),r-=d.x*k.width,t-=d.y*k.height): +b=!0;b=PrintDialog.createPrintPreview(e,u,k,0,r,t,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,b,h,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var p=document.createElement("tbody");b=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");h=document.createElement("td");h.setAttribute("colspan","2");h.style.fontSize="10pt";h.appendChild(q);var v=document.createElement("span");mxUtils.write(v," "+mxResources.get("fitPage")); +h.appendChild(v);mxEvent.addListener(v,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});b.appendChild(h);p.appendChild(b);b=b.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");h=document.createElement("td");h.style.fontSize="10pt";h.appendChild(c);v=document.createElement("span");mxUtils.write(v," "+mxResources.get("posterPrint")+":");h.appendChild(v);mxEvent.addListener(v, +"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});b.appendChild(h);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";h=document.createElement("td");h.style.fontSize="10pt";h.appendChild(f);mxUtils.write(h," "+mxResources.get("pages")+" (max)");b.appendChild(h);p.appendChild(b);mxEvent.addListener(c,"change", +function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});b=b.cloneNode(!1);h=document.createElement("td");mxUtils.write(h,mxResources.get("pageScale")+":");b.appendChild(h);h=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";h.appendChild(g);b.appendChild(h);p.appendChild(b);b=document.createElement("tr");h=document.createElement("td");h.colSpan=2; +h.style.paddingTop="20px";h.setAttribute("align","right");v=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});v.className="geBtn";a.editor.cancelFirst&&h.appendChild(v);if(PrintDialog.previewEnabled){var u=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)});u.className="geBtn";h.appendChild(u)}u=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});u.className="geBtn gePrimaryBtn";h.appendChild(u);a.editor.cancelFirst|| +h.appendChild(v);b.appendChild(h);p.appendChild(b);m.appendChild(p);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var d=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(d,500):d()}}; +PrintDialog.createPrintPreview=function(a,d,e,b,h,m,p){d=new mxPrintPreview(a,d,e,b,h,m);d.title=mxResources.get("preview");d.printBackgroundImage=!0;d.autoOrigin=p;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";d.backgroundColor=a;var q=d.writeHead;d.writeHead=function(a){q.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return d}; PrintDialog.previewEnabled=!0; -var PageSetupDialog=function(a){function d(){null==f||f==mxConstants.NONE?(c.style.backgroundColor="",c.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(c.style.backgroundColor=f,c.style.backgroundImage="")}function e(){null==t?(u.removeAttribute("title"),u.style.fontSize="",u.innerHTML=mxResources.get("change")+"..."):(u.setAttribute("title",t.src),u.style.fontSize="11px",u.innerHTML=t.src.substring(0,42)+"...")}var b=a.editor.graph,k,m,p=document.createElement("table");p.style.width= -"100%";p.style.height="100%";var q=document.createElement("tbody");k=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");k.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var v=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",b.pageFormat);k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td"); -mxUtils.write(m,mxResources.get("background")+":");k.appendChild(m);m=document.createElement("td");m.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var c=document.createElement("button");c.style.width="18px";c.style.height="18px";c.style.marginRight="20px";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";var f=b.background;d();mxEvent.addListener(c,"click",function(c){a.pickColor(f||"none",function(a){f=a;d()});mxEvent.consume(c)}); -m.appendChild(c);mxUtils.write(m,mxResources.get("gridSize")+":");var g=document.createElement("input");g.setAttribute("type","number");g.setAttribute("min","0");g.style.width="40px";g.style.marginLeft="6px";g.value=b.getGridSize();m.appendChild(g);mxEvent.addListener(g,"change",function(){var a=parseInt(g.value);g.value=Math.max(1,isNaN(a)?b.getGridSize():a)});k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+ -":");k.appendChild(m);m=document.createElement("td");var u=document.createElement("a");u.style.textDecoration="underline";u.style.cursor="pointer";u.style.color="#a0a0a0";var t=b.backgroundImage;mxEvent.addListener(u,"click",function(c){a.showBackgroundImageDialog(function(a){t=a;e()});mxEvent.consume(c)});e();m.appendChild(u);k.appendChild(m);q.appendChild(k);k=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var h= -mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&m.appendChild(h);var n=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.gridSize!==g.value&&b.setGridSize(parseInt(g.value));var c=new ChangePageSetup(a,f,t,v.get());c.ignoreColor=b.background==f;c.ignoreImage=(null!=b.backgroundImage?b.backgroundImage.src:null)===(null!=t?t.src:null);b.pageFormat.width==c.previousFormat.width&&b.pageFormat.height==c.previousFormat.height&& -c.ignoreColor&&c.ignoreImage||b.model.execute(c)});n.className="geBtn gePrimaryBtn";m.appendChild(n);a.editor.cancelFirst||m.appendChild(h);k.appendChild(m);q.appendChild(k);p.appendChild(q);this.container=p}; -PageSetupDialog.addPageFormatPanel=function(a,d,e,b){function k(a,c,b){if(b||g!=document.activeElement&&u!=document.activeElement){a=!1;for(c=0;c<h.length;c++)b=h[c],r?"custom"==b.key&&(q.value=b.key,r=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&& +var PageSetupDialog=function(a){function d(){null==f||f==mxConstants.NONE?(c.style.backgroundColor="",c.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(c.style.backgroundColor=f,c.style.backgroundImage="")}function e(){null==t?(u.removeAttribute("title"),u.style.fontSize="",u.innerHTML=mxResources.get("change")+"..."):(u.setAttribute("title",t.src),u.style.fontSize="11px",u.innerHTML=t.src.substring(0,42)+"...")}var b=a.editor.graph,h,m,p=document.createElement("table");p.style.width= +"100%";p.style.height="100%";var q=document.createElement("tbody");h=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");h.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var v=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",b.pageFormat);h.appendChild(m);q.appendChild(h);h=document.createElement("tr");m=document.createElement("td"); +mxUtils.write(m,mxResources.get("background")+":");h.appendChild(m);m=document.createElement("td");m.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var c=document.createElement("button");c.style.width="18px";c.style.height="18px";c.style.marginRight="20px";c.style.backgroundPosition="center center";c.style.backgroundRepeat="no-repeat";var f=b.background;d();mxEvent.addListener(c,"click",function(c){a.pickColor(f||"none",function(a){f=a;d()});mxEvent.consume(c)}); +m.appendChild(c);mxUtils.write(m,mxResources.get("gridSize")+":");var g=document.createElement("input");g.setAttribute("type","number");g.setAttribute("min","0");g.style.width="40px";g.style.marginLeft="6px";g.value=b.getGridSize();m.appendChild(g);mxEvent.addListener(g,"change",function(){var a=parseInt(g.value);g.value=Math.max(1,isNaN(a)?b.getGridSize():a)});h.appendChild(m);q.appendChild(h);h=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+ +":");h.appendChild(m);m=document.createElement("td");var u=document.createElement("a");u.style.textDecoration="underline";u.style.cursor="pointer";u.style.color="#a0a0a0";var t=b.backgroundImage;mxEvent.addListener(u,"click",function(c){a.showBackgroundImageDialog(function(a){t=a;e()});mxEvent.consume(c)});e();m.appendChild(u);h.appendChild(m);q.appendChild(h);h=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var l= +mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst&&m.appendChild(l);var n=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.gridSize!==g.value&&b.setGridSize(parseInt(g.value));var c=new ChangePageSetup(a,f,t,v.get());c.ignoreColor=b.background==f;c.ignoreImage=(null!=b.backgroundImage?b.backgroundImage.src:null)===(null!=t?t.src:null);b.pageFormat.width==c.previousFormat.width&&b.pageFormat.height==c.previousFormat.height&& +c.ignoreColor&&c.ignoreImage||b.model.execute(c)});n.className="geBtn gePrimaryBtn";m.appendChild(n);a.editor.cancelFirst||m.appendChild(l);h.appendChild(m);q.appendChild(h);p.appendChild(q);this.container=p}; +PageSetupDialog.addPageFormatPanel=function(a,d,e,b){function h(a,c,b){if(b||g!=document.activeElement&&u!=document.activeElement){a=!1;for(c=0;c<l.length;c++)b=l[c],r?"custom"==b.key&&(q.value=b.key,r=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&& e.height==b.format.height?(q.value=b.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==b.format.height&&e.height==b.format.width&&(q.value=b.key,m.removeAttribute("checked"),m.defaultChecked=!1,m.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(v.style.display="",f.style.display="none"):(g.value=e.width/100,u.value=e.height/100,m.setAttribute("checked","checked"), q.value="custom",v.style.display="none",f.style.display="")}}d="format-"+d;var m=document.createElement("input");m.setAttribute("name",d);m.setAttribute("type","radio");m.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",d);p.setAttribute("type","radio");p.setAttribute("value","landscape");var q=document.createElement("select");q.style.marginBottom="8px";q.style.width="202px";var v=document.createElement("div");v.style.marginLeft="4px";v.style.width="210px"; v.style.height="24px";m.style.marginRight="6px";v.appendChild(m);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));v.appendChild(d);p.style.marginLeft="10px";p.style.marginRight="6px";v.appendChild(p);var c=document.createElement("span");c.style.width="100px";mxUtils.write(c,mxResources.get("landscape"));v.appendChild(c);var f=document.createElement("div");f.style.marginLeft="4px";f.style.width="210px";f.style.height="24px";var g=document.createElement("input"); -g.setAttribute("size","7");g.style.textAlign="right";f.appendChild(g);mxUtils.write(f," in x ");var u=document.createElement("input");u.setAttribute("size","7");u.style.textAlign="right";f.appendChild(u);mxUtils.write(f," in");v.style.display="none";f.style.display="none";for(var t={},h=PageSetupDialog.getFormats(),n=0;n<h.length;n++){var l=h[n];t[l.key]=l;var w=document.createElement("option");w.setAttribute("value",l.key);mxUtils.write(w,l.title);q.appendChild(w)}var r=!1;k();a.appendChild(q);mxUtils.br(a); +g.setAttribute("size","7");g.style.textAlign="right";f.appendChild(g);mxUtils.write(f," in x ");var u=document.createElement("input");u.setAttribute("size","7");u.style.textAlign="right";f.appendChild(u);mxUtils.write(f," in");v.style.display="none";f.style.display="none";for(var t={},l=PageSetupDialog.getFormats(),n=0;n<l.length;n++){var k=l[n];t[k.key]=k;var w=document.createElement("option");w.setAttribute("value",k.key);mxUtils.write(w,k.title);q.appendChild(w)}var r=!1;h();a.appendChild(q);mxUtils.br(a); a.appendChild(v);a.appendChild(f);var y=e,D=function(a,c){var d=t[q.value];null!=d.format?(g.value=d.format.width/100,u.value=d.format.height/100,f.style.display="none",v.style.display=""):(v.style.display="none",f.style.display="");isNaN(parseFloat(g.value))&&(g.value=e.width/100);isNaN(parseFloat(u.value))&&(u.value=e.height/100);d=new mxRectangle(0,0,Math.floor(100*parseFloat(g.value)),Math.floor(100*parseFloat(u.value)));"custom"!=q.value&&p.checked&&(d=new mxRectangle(0,0,d.height,d.width)); c&&r||d.width==y.width&&d.height==y.height||(y=d,null!=b&&b(y))};mxEvent.addListener(d,"click",function(a){m.checked=!0;D(a);mxEvent.consume(a)});mxEvent.addListener(c,"click",function(a){p.checked=!0;D(a);mxEvent.consume(a)});mxEvent.addListener(g,"blur",D);mxEvent.addListener(g,"click",D);mxEvent.addListener(u,"blur",D);mxEvent.addListener(u,"click",D);mxEvent.addListener(p,"change",D);mxEvent.addListener(m,"change",D);mxEvent.addListener(q,"change",function(a){r="custom"==q.value;D(a,!0)});D(); -return{set:function(a){e=a;k(null,null,!0)},get:function(){return y},widthInput:g,heightInput:u}}; +return{set:function(a){e=a;h(null,null,!0)},get:function(){return y},widthInput:g,heightInput:u}}; PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:"US-Tabloid (279 mm x 432 mm)",format:new mxRectangle(0,0,1100,1700)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)", format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"custom",title:mxResources.get("custom"),format:null}]}; (function(){mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph;if(null!=a.container&&!a.transparentBackground){if(a.pageVisible){var b=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var c=a.container.firstChild;null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.nextSibling;null!=c&&(this.backgroundPageShape=this.createBackgroundPageShape(b),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect= @@ -2034,33 +2034,33 @@ null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackground f="url("+this.gridImage+")";var e=c=0;null!=a.view.backgroundPageShape&&(e=this.getBackgroundPageBounds(),c=1+e.x,e=1+e.y);d=-Math.round(d-mxUtils.mod(this.translate.x*this.scale-c,d))+"px "+-Math.round(d-mxUtils.mod(this.translate.y*this.scale-e,d))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=d,a.view.backgroundPageShape.node.style.backgroundImage=f,a.view.backgroundPageShape.node.style.backgroundColor= b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=d,c.style.backgroundColor=b,c.style.backgroundImage=f)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],g=1;g<this.gridSteps;g++){var e=g*b;d.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+ c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+d.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,d){a.apply(this,arguments);if(null!=this.shiftPreview1){var c= -this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,g=this.view.translate,e=this.pageFormat,t=d*this.pageScale,h=this.view.getBackgroundPageBounds();b=h.width;c=h.height;var n= -new mxRectangle(d*g.x,d*g.y,e.width*t,e.height*t),l=(a=a&&Math.min(n.width,n.height)>this.minPageBreakDist)?Math.ceil(c/n.height)-1:0,w=a?Math.ceil(b/n.width)-1:0,r=h.x+b,q=h.y+c;null==this.horizontalPageBreaks&&0<l&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<w&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?l:w,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(h.x),Math.round(h.y+(b+1)*n.height)), -new mxPoint(Math.round(r),Math.round(h.y+(b+1)*n.height))]:[new mxPoint(Math.round(h.x+(b+1)*n.width),Math.round(h.y)),new mxPoint(Math.round(h.x+(b+1)*n.width),Math.round(q))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)}; +this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,g=this.view.translate,e=this.pageFormat,t=d*this.pageScale,l=this.view.getBackgroundPageBounds();b=l.width;c=l.height;var n= +new mxRectangle(d*g.x,d*g.y,e.width*t,e.height*t),k=(a=a&&Math.min(n.width,n.height)>this.minPageBreakDist)?Math.ceil(c/n.height)-1:0,w=a?Math.ceil(b/n.width)-1:0,r=l.x+b,q=l.y+c;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<w&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?k:w,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+(b+1)*n.height)), +new mxPoint(Math.round(r),Math.round(l.y+(b+1)*n.height))]:[new mxPoint(Math.round(l.x+(b+1)*n.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(b+1)*n.width),Math.round(q))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)}; var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){for(var f=0;f<b.length;f++)if(this.graph.getModel().isVertex(b[f])){var g=this.graph.getCellGeometry(b[f]);if(null!=g&&g.relative)return!1}return d.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()? !0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,g=this.graph.pageScale,e=d.width*g,d=d.height*g,g=Math.floor(Math.min(0,b)/e),t=Math.floor(Math.min(0, c)/d);return new mxRectangle(this.scale*(this.translate.x+g*e),this.scale*(this.translate.y+t*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/e)-g)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-t)*d)};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,d){b.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft= -a+"px",this.view.backgroundPageShape.node.style.marginTop=d+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,g,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=m.apply(this,arguments),g=b.getParent(d); +a+"px",this.view.backgroundPageShape.node.style.marginTop=d+"px")};var h=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,g,e){var f=h.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=m.apply(this,arguments),g=b.getParent(d); if(null==c||c!=d&&c!=g)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(g)&&b.isVertex(g)&&!this.graph.isContainer(g);)d=g,g=this.graph.getModel().getParent(d);return d};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=p.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),g=d.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&d.isVertex(g)){c=!0;break}g=d.getParent(g)}return c};mxGraphHandler.prototype.selectDelayed= function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var c=this.graph.view.getState(b);if(null==c||!a.isSource(c.control))for(var c=this.graph.getModel(),d=c.getParent(b);!this.graph.isCellSelected(d)&&c.isVertex(d);)b=d,d=c.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),c=b.getParent(a);b.isVertex(c)&&!this.graph.isContainer(c);)this.graph.isCellSelected(c)&& (a=c),c=b.getParent(c);return a}})();EditorUi=function(a,d,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=d||document.body;var b=this.editor.graph;b.lightbox=e;mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src); -this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,b.isEnabled=function(){return!1},b.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||b.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown= -k,this.toolbarContainer.onselectstart=k,this.toolbarContainer.onmousedown=k,this.diagramContainer.onselectstart=k,this.diagramContainer.onmousedown=k,this.sidebarContainer.onselectstart=k,this.sidebarContainer.onmousedown=k,this.formatContainer.onselectstart=k,this.formatContainer.onmousedown=k,this.footerContainer.onselectstart=k,this.footerContainer.onmousedown=k,null!=this.tabContainer&&(this.tabContainer.onselectstart=k));!this.editor.chromeless||this.editor.editable?(d=function(a){var c=mxEvent.getSource(a); -if("A"==c.nodeName)for(;null!=c;){if("geHint"==c.className)return!0;c=c.parentNode}return k(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",d):this.diagramContainer.oncontextmenu=d):b.panningHandler.usePopupTrigger=!1;b.init(this.diagramContainer);mxClient.IS_SVG&&null!=b.view.getDrawPane()&&(d=b.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons(); +this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,b.isEnabled=function(){return!1},b.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var h=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||b.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=h,this.menubarContainer.onmousedown= +h,this.toolbarContainer.onselectstart=h,this.toolbarContainer.onmousedown=h,this.diagramContainer.onselectstart=h,this.diagramContainer.onmousedown=h,this.sidebarContainer.onselectstart=h,this.sidebarContainer.onmousedown=h,this.formatContainer.onselectstart=h,this.formatContainer.onmousedown=h,this.footerContainer.onselectstart=h,this.footerContainer.onmousedown=h,null!=this.tabContainer&&(this.tabContainer.onselectstart=h));!this.editor.chromeless||this.editor.editable?(d=function(a){var c=mxEvent.getSource(a); +if("A"==c.nodeName)for(;null!=c;){if("geHint"==c.className)return!0;c=c.parentNode}return h(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",d):this.diagramContainer.oncontextmenu=d):b.panningHandler.usePopupTrigger=!1;b.init(this.diagramContainer);mxClient.IS_SVG&&null!=b.view.getDrawPane()&&(d=b.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons(); mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var c=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(a)-c.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-c.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var m=!1,p=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(a,c){return m||p.apply(this,arguments)};this.keydownHandler= mxUtils.bind(this,function(a){32==a.which?(m=!0,this.hoverIcons.reset(),b.container.style.cursor="move",b.isEditing()||mxEvent.getSource(a)!=b.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog()});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){b.container.style.cursor="";m=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var q=b.panningHandler.isForcePanningEvent;b.panningHandler.isForcePanningEvent= function(a){return q.apply(this,arguments)||m||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var v=b.cellEditor.isStopEditingEvent;b.cellEditor.isStopEditingEvent=function(a){return v.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxClient.IS_SF&&mxEvent.isShiftDown(a))}; -var c=!1,f=null,g=null,u=null,t=mxUtils.bind(this,function(){if(null!=this.toolbar&&c!=b.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,d=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),d.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==u)this.toolbar.createTextToolbar();else{for(var l=0;l<u.length;l++)this.toolbar.container.appendChild(u[l]);this.toolbar.fontMenu=f;this.toolbar.sizeMenu= -g}c=b.cellEditor.isContentEditing();f=a;g=e;u=d}}),h=this,n=b.cellEditor.startEditing;b.cellEditor.startEditing=function(){n.apply(this,arguments);t();if(b.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=b.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=h.toolbar)){var d=c.fontFamily;"'"==d.charAt(0)&&(d=d.substring(1));"'"==d.charAt(d.length-1)&&(d= -d.substring(0,d.length-1));h.toolbar.setFontName(d);h.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(b.cellEditor.textarea,"input",c);mxEvent.addListener(b.cellEditor.textarea,"touchend",c);mxEvent.addListener(b.cellEditor.textarea,"mouseup",c);mxEvent.addListener(b.cellEditor.textarea,"keyup",c);c()}};var l=b.cellEditor.stopEditing;b.cellEditor.stopEditing=function(a,c){l.apply(this,arguments);t()};b.container.setAttribute("tabindex","0");b.container.style.cursor="default"; +var c=!1,f=null,g=null,u=null,t=mxUtils.bind(this,function(){if(null!=this.toolbar&&c!=b.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,d=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),d.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==u)this.toolbar.createTextToolbar();else{for(var k=0;k<u.length;k++)this.toolbar.container.appendChild(u[k]);this.toolbar.fontMenu=f;this.toolbar.sizeMenu= +g}c=b.cellEditor.isContentEditing();f=a;g=e;u=d}}),l=this,n=b.cellEditor.startEditing;b.cellEditor.startEditing=function(){n.apply(this,arguments);t();if(b.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=b.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=l.toolbar)){var d=c.fontFamily;"'"==d.charAt(0)&&(d=d.substring(1));"'"==d.charAt(d.length-1)&&(d= +d.substring(0,d.length-1));l.toolbar.setFontName(d);l.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(b.cellEditor.textarea,"input",c);mxEvent.addListener(b.cellEditor.textarea,"touchend",c);mxEvent.addListener(b.cellEditor.textarea,"mouseup",c);mxEvent.addListener(b.cellEditor.textarea,"keyup",c);c()}};var k=b.cellEditor.stopEditing;b.cellEditor.stopEditing=function(a,c){k.apply(this,arguments);t()};b.container.setAttribute("tabindex","0");b.container.style.cursor="default"; if(window.self===window.top&&null!=b.container.parentNode)try{b.container.focus()}catch(x){}var w=b.fireMouseEvent;b.fireMouseEvent=function(a,c,b){a==mxEvent.MOUSE_DOWN&&this.container.focus();w.apply(this,arguments)};b.popupMenuHandler.autoExpand=!0;null!=this.menus&&(b.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,b){this.menus.createPopupMenu(a,c,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){b.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a); -this.getKeyHandler=function(){return keyHandler};var r="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),y="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=b.view.getState(a);if(null!=c){a=a.clone();a.style="";a=b.getCellStyle(a);var d=[],f=[],g;for(g in c.style)a[g]!=c.style[g]&&(d.push(c.style[g]),f.push(g));g=b.getModel().getStyle(c.cell);for(var e=null!=g?g.split(";"):[],l=0;l<e.length;l++){var u=e[l], -h=u.indexOf("=");0<=h&&(g=u.substring(0,h),u=u.substring(h+1),null!=a[g]&&"none"==u&&(d.push(u),f.push(g)))}b.getModel().isEdge(c.cell)?b.currentEdgeStyle={}:b.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",d,"cells",[c.cell]))}};this.clearDefaultStyle=function(){b.currentEdgeStyle=mxUtils.clone(b.defaultEdgeStyle);b.currentVertexStyle=mxUtils.clone(b.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var D= +this.getKeyHandler=function(){return keyHandler};var r="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),y="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=b.view.getState(a);if(null!=c){a=a.clone();a.style="";a=b.getCellStyle(a);var d=[],f=[],g;for(g in c.style)a[g]!=c.style[g]&&(d.push(c.style[g]),f.push(g));g=b.getModel().getStyle(c.cell);for(var e=null!=g?g.split(";"):[],k=0;k<e.length;k++){var u=e[k], +l=u.indexOf("=");0<=l&&(g=u.substring(0,l),u=u.substring(l+1),null!=a[g]&&"none"==u&&(d.push(u),f.push(g)))}b.getModel().isEdge(c.cell)?b.currentEdgeStyle={}:b.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",d,"cells",[c.cell]))}};this.clearDefaultStyle=function(){b.currentEdgeStyle=mxUtils.clone(b.defaultEdgeStyle);b.currentVertexStyle=mxUtils.clone(b.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var D= ["fontFamily","fontSize","fontColor"],z="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),G=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],D,["opacity"],["align"],["html"]];for(a=0;a<G.length;a++)for(d=0;d<G[a].length;d++)r.push(G[a][d]);for(a=0;a<y.length;a++)0>mxUtils.indexOf(r,y[a])&&r.push(y[a]);var E=function(a,c){var d=b.getModel(); -d.beginUpdate();try{if(c)for(var f=d.isEdge(u),g=f?b.currentEdgeStyle:b.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var l=g[f[e]];null!=l&&b.setCellStyles(f[e],l,a)}else for(l=0;l<a.length;l++){for(var u=a[l],h=d.getStyle(u),n=null!=h?h.split(";"):[],t=r.slice(),e=0;e<n.length;e++){var w=n[e],z=w.indexOf("=");if(0<=z){var k=w.substring(0,z),q=mxUtils.indexOf(t,k);0<=q&&t.splice(q,1);for(var D=0;D<G.length;D++){var x=G[D];if(0<=mxUtils.indexOf(x,k))for(var p=0;p< -x.length;p++){var m=mxUtils.indexOf(t,x[p]);0<=m&&t.splice(m,1)}}}}for(var g=(f=d.isEdge(u))?b.currentEdgeStyle:b.currentVertexStyle,v=d.getStyle(u),e=0;e<t.length;e++){var k=t[e],J=g[k];null==J||"shape"==k&&!f||f&&!(0>mxUtils.indexOf(y,k))||(v=mxUtils.setStyle(v,k,J))}d.setStyle(u,v)}}finally{d.endUpdate()}};b.addListener("cellsInserted",function(a,c){E(c.getProperty("cells"))});b.addListener("textInserted",function(a,c){E(c.getProperty("cells"),!0)});b.connectionHandler.addListener(mxEvent.CONNECT, -function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));E(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var d=c.getProperty("cells"),f=!1,g=!1;if(0<d.length)for(var e=0;e<d.length&&(f=b.getModel().isVertex(d[e])||f,!(g=b.getModel().isEdge(d[e])||g)||!f);e++);else g=f=!0;for(var d=c.getProperty("keys"),l=c.getProperty("values"),e=0;e<d.length;e++){var u=0<=mxUtils.indexOf(D,d[e]);if("strokeColor"!=d[e]||null!=l[e]&&"none"!= -l[e])if(0<=mxUtils.indexOf(y,d[e]))g||0<=mxUtils.indexOf(z,d[e])?null==l[e]?delete b.currentEdgeStyle[d[e]]:b.currentEdgeStyle[d[e]]=l[e]:f&&0<=mxUtils.indexOf(r,d[e])&&(null==l[e]?delete b.currentVertexStyle[d[e]]:b.currentVertexStyle[d[e]]=l[e]);else if(0<=mxUtils.indexOf(r,d[e])){if(f||u)null==l[e]?delete b.currentVertexStyle[d[e]]:b.currentVertexStyle[d[e]]=l[e];if(g||u||0<=mxUtils.indexOf(z,d[e]))null==l[e]?delete b.currentEdgeStyle[d[e]]:b.currentEdgeStyle[d[e]]=l[e]}}null!=this.toolbar&&(this.toolbar.setFontName(b.currentVertexStyle.fontFamily|| +d.beginUpdate();try{if(c)for(var f=d.isEdge(u),g=f?b.currentEdgeStyle:b.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var k=g[f[e]];null!=k&&b.setCellStyles(f[e],k,a)}else for(k=0;k<a.length;k++){for(var u=a[k],l=d.getStyle(u),n=null!=l?l.split(";"):[],t=r.slice(),e=0;e<n.length;e++){var w=n[e],z=w.indexOf("=");if(0<=z){var h=w.substring(0,z),q=mxUtils.indexOf(t,h);0<=q&&t.splice(q,1);for(var D=0;D<G.length;D++){var x=G[D];if(0<=mxUtils.indexOf(x,h))for(var p=0;p< +x.length;p++){var m=mxUtils.indexOf(t,x[p]);0<=m&&t.splice(m,1)}}}}for(var g=(f=d.isEdge(u))?b.currentEdgeStyle:b.currentVertexStyle,v=d.getStyle(u),e=0;e<t.length;e++){var h=t[e],J=g[h];null==J||"shape"==h&&!f||f&&!(0>mxUtils.indexOf(y,h))||(v=mxUtils.setStyle(v,h,J))}d.setStyle(u,v)}}finally{d.endUpdate()}};b.addListener("cellsInserted",function(a,c){E(c.getProperty("cells"))});b.addListener("textInserted",function(a,c){E(c.getProperty("cells"),!0)});b.connectionHandler.addListener(mxEvent.CONNECT, +function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));E(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var d=c.getProperty("cells"),f=!1,g=!1;if(0<d.length)for(var e=0;e<d.length&&(f=b.getModel().isVertex(d[e])||f,!(g=b.getModel().isEdge(d[e])||g)||!f);e++);else g=f=!0;for(var d=c.getProperty("keys"),k=c.getProperty("values"),e=0;e<d.length;e++){var u=0<=mxUtils.indexOf(D,d[e]);if("strokeColor"!=d[e]||null!=k[e]&&"none"!= +k[e])if(0<=mxUtils.indexOf(y,d[e]))g||0<=mxUtils.indexOf(z,d[e])?null==k[e]?delete b.currentEdgeStyle[d[e]]:b.currentEdgeStyle[d[e]]=k[e]:f&&0<=mxUtils.indexOf(r,d[e])&&(null==k[e]?delete b.currentVertexStyle[d[e]]:b.currentVertexStyle[d[e]]=k[e]);else if(0<=mxUtils.indexOf(r,d[e])){if(f||u)null==k[e]?delete b.currentVertexStyle[d[e]]:b.currentVertexStyle[d[e]]=k[e];if(g||u||0<=mxUtils.indexOf(z,d[e]))null==k[e]?delete b.currentEdgeStyle[d[e]]:b.currentEdgeStyle[d[e]]=k[e]}}null!=this.toolbar&&(this.toolbar.setFontName(b.currentVertexStyle.fontFamily|| Menus.prototype.defaultFont),this.toolbar.setFontSize(b.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==b.currentEdgeStyle.edgeStyle&&"1"==b.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==b.currentEdgeStyle.edgeStyle||"none"==b.currentEdgeStyle.edgeStyle||null==b.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"== b.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==b.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==b.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==b.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==b.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==b.currentEdgeStyle.shape? "geSprite geSprite-linkedge":"flexArrow"==b.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==b.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",b.currentEdgeStyle.shape,b.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(b.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className= @@ -2068,8 +2068,8 @@ this.getCssClassForMarker("end",b.currentEdgeStyle.shape,b.currentEdgeStyle[mxCo this.toolbar.setFontSize(c)}),b.getSelectionModel().addListener(mxEvent.CHANGE,a),b.getModel().addListener(mxEvent.CHANGE,a));b.addListener(mxEvent.CELLS_ADDED,function(a,c){var d=c.getProperty("cells"),f=c.getProperty("parent");b.getModel().isLayer(f)&&!b.isCellVisible(f)&&null!=d&&0<d.length&&b.getModel().setVisible(f,!0)});this.gestureHandler=mxUtils.bind(this,function(a){null!=this.currentMenu&&mxEvent.getSource(a)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document, this.gestureHandler);this.resizeHandler=mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window, "scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){b.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){b.view.validateBackground()}));b.addListener("gridSizeChanged",mxUtils.bind(this,function(){b.isGridEnabled()&&b.view.validateBackground()}));this.editor.resetGraph();this.init();this.open()}; -mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=34;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.editButtonLink=null;EditorUi.prototype.hsplitPosition=640>=screen.width?118:208;EditorUi.prototype.allowAnimation=!0; -EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4; +mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=34;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.hsplitPosition=640>=screen.width?118:208;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2; +EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1; EditorUi.prototype.init=function(){var a=this.editor.graph;mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(a){this.onKeyDown(a)}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(a){this.onKeyPress(a)}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})); var d=a.setDefaultParent,e=this;this.editor.graph.setDefaultParent=function(){d.apply(this,arguments);e.updateActionStates()};a.editLink=e.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()};EditorUi.prototype.onKeyDown=function(a){var d=this.editor.graph;9==a.which&&d.isEnabled()&&!mxEvent.isAltDown(a)&&(d.isEditing()?d.stopEditing(!1):d.selectCell(!mxEvent.isShiftDown(a)),mxEvent.consume(a))}; EditorUi.prototype.onKeyPress=function(a){var d=this.editor.graph;!this.isImmediateEditingEvent(a)||d.isEditing()||d.isSelectionEmpty()||0===a.which||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(d.escape(),d.startEditing(),mxClient.IS_FF&&(d=d.cellEditor,d.textarea.innerHTML=String.fromCharCode(a.which),a=document.createRange(),a.selectNodeContents(d.textarea),a.collapse(!1),d=window.getSelection(),d.removeAllRanges(),d.addRange(a)))}; @@ -2080,25 +2080,25 @@ a+"openthin":e==mxConstants.ARROW_BLOCK?"1"==b?"geSprite geSprite-"+a+"block":"g a+"ermany":"ERoneToMany"==e?"geSprite geSprite-"+a+"eronetomany":"ERzeroToOne"==e?"geSprite geSprite-"+a+"eroneopt":"ERzeroToMany"==e?"geSprite geSprite-"+a+"ermanyopt":"geSprite geSprite-noarrow"};EditorUi.prototype.createMenus=function(){return null}; EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,d=this.actions.get("paste"),e=this.actions.get("pasteHere");d.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));e.setEnabled(d.isEnabled())}; EditorUi.prototype.initClipboard=function(){var a=this,d=mxClipboard.cut;mxClipboard.cut=function(b){b.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);a.updatePasteActionStates()};var e=mxClipboard.copy;mxClipboard.copy=function(d){d.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):e.apply(this,arguments);a.updatePasteActionStates()};var b=mxClipboard.paste;mxClipboard.paste=function(d){var e=null;d.cellEditor.isContentEditing()?document.execCommand("paste", -!1,null):e=b.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(d,b){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20; +!1,null):e=b.apply(this,arguments);a.updatePasteActionStates();return e};var h=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){h.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(d,b){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20; EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),c=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*c.width),this.scale*(this.translate.y+a.y*c.height),this.scale*a.width*c.width, -this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,d){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var d=null,e=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(c,d,b,f){if(null!=a.container){b=null!=b?b:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),l=a.view.translate,u=a.view.scale,h=mxRectangle.fromRectangle(g); -h.x=h.x/u-l.x;h.y=h.y/u-l.y;h.width/=u;h.height/=u;var l=a.container.scrollTop,n=a.container.scrollLeft,r=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)r+=3;var t=a.container.offsetWidth-r,r=a.container.offsetHeight-r;c=c?Math.max(.3,Math.min(d||1,t/h.width)):u;d=(t-c*h.width)/2/c;var w=0==this.lightboxVerticalDivider?0:(r-c*h.height)/this.lightboxVerticalDivider/c;e&&(d=Math.max(d,0),w=Math.max(w,0));if(e||g.width<t||g.height<r)a.view.scaleAndTranslate(c, -Math.floor(d-h.x),Math.floor(w-h.y)),a.container.scrollTop=l*c/u,a.container.scrollLeft=n*c/u;else if(0!=b||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+b/u),Math.floor(g.y+f/u))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var b=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",b);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",b)});this.editor.addListener("resetGraphView", +this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,d){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var d=null,e=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(c,d,b,f){if(null!=a.container){b=null!=b?b:0;f=null!=f?f:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),k=a.view.translate,u=a.view.scale,l=mxRectangle.fromRectangle(g); +l.x=l.x/u-k.x;l.y=l.y/u-k.y;l.width/=u;l.height/=u;var k=a.container.scrollTop,n=a.container.scrollLeft,r=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)r+=3;var t=a.container.offsetWidth-r,r=a.container.offsetHeight-r;c=c?Math.max(.3,Math.min(d||1,t/l.width)):u;d=(t-c*l.width)/2/c;var w=0==this.lightboxVerticalDivider?0:(r-c*l.height)/this.lightboxVerticalDivider/c;e&&(d=Math.max(d,0),w=Math.max(w,0));if(e||g.width<t||g.height<r)a.view.scaleAndTranslate(c, +Math.floor(d-l.x),Math.floor(w-l.y)),a.container.scrollTop=k*c/u,a.container.scrollLeft=n*c/u;else if(0!=b||0!=f)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+b/u),Math.floor(g.y+f/u))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var b=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",b);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",b)});this.editor.addListener("resetGraphView", mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(c){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(c){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace= -"nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var k=mxUtils.bind(this,function(){var c=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]|| -0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",k);k();var m=0,k=mxUtils.bind(this,function(a,c,d){m++;var b=document.createElement("span");b.style.paddingLeft="8px";b.style.paddingRight="8px";b.style.cursor="pointer";mxEvent.addListener(b,"click",a);null!=d&&b.setAttribute("title",d);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);b.appendChild(a);this.chromelessToolbar.appendChild(b); -return b}),p=k(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.fontFamily="Helvetica,Arial";q.style.marginTop="8px";q.style.color="#ffffff";this.chromelessToolbar.appendChild(q);var v=k(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")), +"nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var h=mxUtils.bind(this,function(){var c=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]|| +0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",h);h();var m=0,h=mxUtils.bind(this,function(a,c,d){m++;var b=document.createElement("span");b.style.paddingLeft="8px";b.style.paddingRight="8px";b.style.cursor="pointer";mxEvent.addListener(b,"click",a);null!=d&&b.setAttribute("title",d);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);b.appendChild(a);this.chromelessToolbar.appendChild(b); +return b}),p=h(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),q=document.createElement("div");q.style.display="inline-block";q.style.verticalAlign="top";q.style.fontFamily="Helvetica,Arial";q.style.marginTop="8px";q.style.color="#ffffff";this.chromelessToolbar.appendChild(q);var v=h(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")), c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(q.innerHTML="",mxUtils.write(q,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});p.style.paddingLeft="0px";p.style.paddingRight="4px";v.style.paddingLeft="4px";v.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(v.style.display="",p.style.display="",q.style.display="inline-block"):(v.style.display="none",p.style.display= -"none",q.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);k(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");k(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");k(mxUtils.bind(this,function(c){a.isLightboxView()?(1==a.view.scale? +"none",q.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);h(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");h(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");h(mxUtils.bind(this,function(c){a.isLightboxView()?(1==a.view.scale? this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var g=null,u=null,t=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);g=null;u=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";u= -null}),600)}),a||200)}),h=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var n=k(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog, +null}),600)}),a||200)}),l=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var n=h(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog, "mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var d=n.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily="Helvetica,Arial";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.color="#ffffff"; -mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=d.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=d.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),l=a.getModel();l.addListener(mxEvent.CHANGE,function(){n.style.display=1<l.getChildCount(l.root)? -"":"none"})}this.addChromelessToolbarItems(k);null!=this.editor.editButtonLink&&k(mxUtils.bind(this,function(c){"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(c)}),Editor.editLargeImage,mxResources.get("edit"));!a.lightbox||"1"!=urlParams.close&&this.container==document.body||k(mxUtils.bind(this,function(a){"1"==urlParams.close?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage, -mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||h(30),t())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)}); -mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?t():h(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?t():h(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||h(30)}));var w=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,d){this.startX= -d.getGraphX();this.startY=d.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,d){mxEvent.isTouchEvent(d.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<w&&Math.abs(this.scrollTop-a.container.scrollTop)<w&&Math.abs(this.startX-d.getGraphX())<w&&Math.abs(this.startY-d.getGraphY())<w&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?t():h(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var r= +mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=d.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=d.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),k=a.getModel();k.addListener(mxEvent.CHANGE,function(){n.style.display=1<k.getChildCount(k.root)? +"":"none"})}this.addChromelessToolbarItems(h);null!=this.editor.editButtonLink&&h(mxUtils.bind(this,function(c){"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(c)}),Editor.editLargeImage,mxResources.get("edit"));!a.lightbox||"1"!=urlParams.close&&this.container==document.body||h(mxUtils.bind(this,function(a){"1"==urlParams.close?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage, +mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||l(30),t())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)}); +mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?t():l(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?t():l(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||l(30)}));var w=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,d){this.startX= +d.getGraphX();this.startY=d.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,d){mxEvent.isTouchEvent(d.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<w&&Math.abs(this.scrollTop-a.container.scrollTop)<w&&Math.abs(this.startX-d.getGraphX())<w&&Math.abs(this.startY-d.getGraphY())<w&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?t():l(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var r= a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}r.apply(this,arguments)};var y=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),d=this.getPagePadding(),b=this.getPageSize(),f=Math.ceil(2*d.x+c.width* b.width),g=Math.ceil(2*d.y+c.height*b.height),e=a.minimumGraphSize;if(null==e||e.width!=f||e.height!=g)a.minimumGraphSize=new mxRectangle(0,0,f,g);f=d.x-c.x*b.width;d=d.y-c.y*b.height;this.autoTranslate||this.view.translate.x==f&&this.view.translate.y==d?y.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0=c.y,c=a.view.translate.x,b=a.view.translate.y,a.view.setTranslate(f,d),a.container.scrollLeft+=Math.round((f-c)*a.view.scale),a.container.scrollTop+=Math.round((d-b)*a.view.scale), this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var D=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor= @@ -2120,28 +2120,28 @@ EditorUi.prototype.resetScrollbars=function(){var a=this.editor.graph;if(!this.e 1;d=a.getGraphBounds();0<d.width&&0<d.height&&(d.x>a.container.scrollLeft+.9*a.container.clientWidth&&(a.container.scrollLeft=Math.min(d.x+d.width-a.container.clientWidth,d.x-10)),d.y>a.container.scrollTop+.9*a.container.clientHeight&&(a.container.scrollTop=Math.min(d.y+d.height-a.container.clientHeight,d.y-10)))}else{var d=a.getGraphBounds(),e=Math.max(d.width,a.scrollTileSize.width*a.view.scale);a.container.scrollTop=Math.floor(Math.max(0,d.y-Math.max(20,(a.container.clientHeight-Math.max(d.height, a.scrollTileSize.height*a.view.scale))/4)));a.container.scrollLeft=Math.floor(Math.max(0,d.x-Math.max(0,(a.container.clientWidth-e)/2)))}else a.pageVisible?(d=a.view.getBackgroundPageBounds(),a.view.setTranslate(Math.floor(Math.max(0,(a.container.clientWidth-d.width)/2)-d.x),Math.floor(Math.max(0,(a.container.clientHeight-d.height)/2)-d.y))):(d=a.getGraphBounds(),a.view.setTranslate(Math.floor(Math.max(0,Math.max(0,(a.container.clientWidth-d.width)/2)-d.x)),Math.floor(Math.max(0,Math.max(20,(a.container.clientHeight- d.height)/4))-d.y)))}; -EditorUi.prototype.setPageVisible=function(a){var d=this.editor.graph,e=mxUtils.hasScrollbars(d.container),b=0,k=0;e&&(b=d.view.translate.x*d.view.scale-d.container.scrollLeft,k=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=a;d.pageBreaksVisible=a;d.preferPageSize=a;d.view.validateBackground();e&&(a=d.getSelectionCells(),d.clearSelection(),d.setSelectionCells(a));d.sizeDidChange();e&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-b,d.container.scrollTop=d.view.translate.y* -d.view.scale-k);this.fireEvent(new mxEventObject("pageViewChanged"))};function ChangePageSetup(a,d,e,b){this.ui=a;this.previousColor=this.color=d;this.previousImage=this.image=e;this.previousFormat=this.format=b;this.ignoreImage=this.ignoreColor=!1} +EditorUi.prototype.setPageVisible=function(a){var d=this.editor.graph,e=mxUtils.hasScrollbars(d.container),b=0,h=0;e&&(b=d.view.translate.x*d.view.scale-d.container.scrollLeft,h=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=a;d.pageBreaksVisible=a;d.preferPageSize=a;d.view.validateBackground();e&&(a=d.getSelectionCells(),d.clearSelection(),d.setSelectionCells(a));d.sizeDidChange();e&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-b,d.container.scrollTop=d.view.translate.y* +d.view.scale-h);this.fireEvent(new mxEventObject("pageViewChanged"))};function ChangePageSetup(a,d,e,b){this.ui=a;this.previousColor=this.color=d;this.previousImage=this.image=e;this.previousFormat=this.format=b;this.ignoreImage=this.ignoreColor=!1} ChangePageSetup.prototype.execute=function(){var a=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var d=a.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=d}this.ignoreImage||(this.image=this.previousImage,d=a.backgroundImage,this.ui.setBackgroundImage(this.previousImage),this.previousImage=d);null!=this.previousFormat&&(this.format=this.previousFormat,d=a.pageFormat,this.previousFormat.width!=d.width||this.previousFormat.height!=d.height)&&(this.ui.setPageFormat(this.previousFormat), this.previousFormat=d);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled)};(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.afterDecode=function(a,e,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);return b};mxCodecRegistry.register(a)})(); EditorUi.prototype.setBackgroundColor=function(a){this.editor.graph.background=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(a){this.editor.graph.foldingEnabled=a;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))}; EditorUi.prototype.setPageFormat=function(a){this.editor.graph.pageFormat=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(a){this.editor.graph.pageScale=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))}; EditorUi.prototype.setGridColor=function(a){this.editor.graph.view.gridColor=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))}; -EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),d=this.actions.get("redo"),e=this.editor.undoManager,b=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());d.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,b);e.addListener(mxEvent.UNDO,b);e.addListener(mxEvent.REDO,b);e.addListener(mxEvent.CLEAR,b);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);b()};var m=this.editor.graph.cellEditor.stopEditing; +EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),d=this.actions.get("redo"),e=this.editor.undoManager,b=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());d.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,b);e.addListener(mxEvent.UNDO,b);e.addListener(mxEvent.REDO,b);e.addListener(mxEvent.CLEAR,b);var h=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){h.apply(this,arguments);b()};var m=this.editor.graph.cellEditor.stopEditing; this.editor.graph.cellEditor.stopEditing=function(a,d){m.apply(this,arguments);b()};b()}; -EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,d=!a.isSelectionEmpty(),e=!1,b=!1,k=a.getSelectionCells();if(null!=k)for(var m=0;m<k.length;m++){var p=k[m];a.getModel().isEdge(p)&&(b=!0);a.getModel().isVertex(p)&&(e=!0);if(b&&e)break}k="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(m= -0;m<k.length;m++)this.actions.get(k[m]).setEnabled(d);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("copySize").setEnabled(1==a.getSelectionCount());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(b);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);b=e&&1== +EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,d=!a.isSelectionEmpty(),e=!1,b=!1,h=a.getSelectionCells();if(null!=h)for(var m=0;m<h.length;m++){var p=h[m];a.getModel().isEdge(p)&&(b=!0);a.getModel().isVertex(p)&&(e=!0);if(b&&e)break}h="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(m= +0;m<h.length;m++)this.actions.get(h[m]).setEnabled(d);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("copySize").setEnabled(1==a.getSelectionCount());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(b);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);b=e&&1== a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||b&&!a.isContainer(a.getSelectionCell()));this.actions.get("ungroup").setEnabled(1==a.getSelectionCount()&&(0<a.getModel().getChildCount(a.getSelectionCell())||b&&a.isContainer(a.getSelectionCell())));this.actions.get("removeFromGroup").setEnabled(b&&a.getModel().isVertex(a.getModel().getParent(a.getSelectionCell())));a.view.getState(a.getSelectionCell());this.menus.get("navigation").setEnabled(d||null!=a.view.currentRoot); this.actions.get("collapsible").setEnabled(e&&(a.isContainer(a.getSelectionCell())||0<a.model.getChildCount(a.getSelectionCell())));this.actions.get("home").setEnabled(null!=a.view.currentRoot);this.actions.get("exitGroup").setEnabled(null!=a.view.currentRoot);this.actions.get("enterGroup").setEnabled(1==a.getSelectionCount()&&a.isValidRoot(a.getSelectionCell()));d=1==a.getSelectionCount()&&a.isCellFoldable(a.getSelectionCell());this.actions.get("expand").setEnabled(d);this.actions.get("collapse").setEnabled(d); this.actions.get("editLink").setEnabled(1==a.getSelectionCount());this.actions.get("openLink").setEnabled(1==a.getSelectionCount()&&null!=a.getLinkForCell(a.getSelectionCell()));this.actions.get("guides").setEnabled(a.isEnabled());this.actions.get("grid").setEnabled(!this.editor.chromeless||this.editor.editable);d=a.isEnabled()&&!a.isCellLocked(a.getDefaultParent());this.menus.get("layout").setEnabled(d);this.menus.get("insert").setEnabled(d);this.menus.get("direction").setEnabled(d&&e);this.menus.get("align").setEnabled(d&& e&&1<a.getSelectionCount());this.menus.get("distribute").setEnabled(d&&e&&1<a.getSelectionCount());this.actions.get("selectVertices").setEnabled(d);this.actions.get("selectEdges").setEnabled(d);this.actions.get("selectAll").setEnabled(d);this.actions.get("selectNone").setEnabled(d);this.updatePasteActionStates()}; -EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var d=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,b=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,b=d?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var k=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&& -(k=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var m=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),p=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",p+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",p+=this.toolbarHeight);0<p&&!mxClient.IS_QUIRKS&&(p+=1);var q=0;if(null!=this.sidebarFooterContainer){var v= -this.footerHeight+k,q=Math.max(0,Math.min(b-p-v,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=q+"px";this.sidebarFooterContainer.style.bottom=v+"px"}v=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=p+"px";this.sidebarContainer.style.width=m+"px";this.formatContainer.style.top=p+"px";this.formatContainer.style.width=v+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left= -null!=this.hsplit.parentNode?m+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+k+"px";this.hsplit.style.left=m+"px";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);d?(this.menubarContainer.style.width=e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width, +EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var d=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,b=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,b=d?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var h=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&& +(h=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var m=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),p=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",p+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",p+=this.toolbarHeight);0<p&&!mxClient.IS_QUIRKS&&(p+=1);var q=0;if(null!=this.sidebarFooterContainer){var v= +this.footerHeight+h,q=Math.max(0,Math.min(b-p-v,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=q+"px";this.sidebarFooterContainer.style.bottom=v+"px"}v=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=p+"px";this.sidebarContainer.style.width=m+"px";this.formatContainer.style.top=p+"px";this.formatContainer.style.width=v+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left= +null!=this.hsplit.parentNode?m+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+h+"px";this.hsplit.style.left=m+"px";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);d?(this.menubarContainer.style.width=e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width, d=Math.max(0,b-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=d-q+"px",this.formatContainer.style.height=d+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-m-this.splitSize-v)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,q=Math.max(0,b-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&(this.tabContainer.style.width=this.diagramContainer.style.width,this.tabContainer.style.bottom= -this.footerHeight+k+"px",q-=this.tabContainer.clientHeight),this.diagramContainer.style.height=q+"px",this.hsplit.style.height=q+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=k+"px"),this.diagramContainer.style.right=v+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+k+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+q+k+"px",this.formatContainer.style.bottom= -this.footerHeight+k+"px",this.diagramContainer.style.bottom=this.footerHeight+k+e+"px");a&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null}; +this.footerHeight+h+"px",q-=this.tabContainer.clientHeight),this.diagramContainer.style.height=q+"px",this.hsplit.style.height=q+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=h+"px"),this.diagramContainer.style.right=v+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+h+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+q+h+"px",this.formatContainer.style.bottom= +this.footerHeight+h+"px",this.diagramContainer.style.bottom=this.footerHeight+h+e+"px");a&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null}; EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer");this.toolbarContainer=this.createDiv("geToolbarContainer");this.sidebarContainer=this.createDiv("geSidebarContainer");this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer");this.diagramContainer=this.createDiv("geDiagramContainer");this.footerContainer=this.createDiv("geFooterContainer");this.hsplit=this.createDiv("geHsplit");this.hsplit.setAttribute("title",mxResources.get("collapseExpand")); this.menubarContainer.style.top="0px";this.menubarContainer.style.left="0px";this.menubarContainer.style.right="0px";this.toolbarContainer.style.left="0px";this.toolbarContainer.style.right="0px";this.sidebarContainer.style.left="0px";this.formatContainer.style.right="0px";this.formatContainer.style.zIndex="1";this.diagramContainer.style.right=(null!=this.format?this.formatWidth:0)+"px";this.footerContainer.style.left="0px";this.footerContainer.style.right="0px";this.footerContainer.style.bottom= "0px";this.footerContainer.style.zIndex=mxPopupMenu.prototype.zIndex-2;this.hsplit.style.width=this.splitSize+"px";if(this.sidebarFooterContainer=this.createSidebarFooterContainer())this.sidebarFooterContainer.style.left="0px";this.editor.chromeless?this.diagramContainer.style.border="none":this.tabContainer=this.createTabContainer()};EditorUi.prototype.createSidebarFooterContainer=function(){return null}; @@ -2150,56 +2150,57 @@ this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContaine this.container.appendChild(this.sidebarFooterContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit, !0,0,mxUtils.bind(this,function(a){this.hsplitPosition=a;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";420>screen.width&&(a.style.maxWidth=Math.max(20,screen.width-320)+"px",a.style.overflow="hidden");return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a};EditorUi.prototype.createToolbar=function(a){return new Toolbar(this,a)}; EditorUi.prototype.createSidebar=function(a){return new Sidebar(this,a)};EditorUi.prototype.createFormat=function(a){return new Format(this,a)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(a){var d=document.createElement("div");d.className=a;return d}; -EditorUi.prototype.addSplitHandler=function(a,d,e,b){function k(a){if(null!=p){var g=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));b(Math.max(0,q+(d?g.x-p.x:p.y-g.y)-e));mxEvent.consume(a);q!=f()&&(v=!0,c=null)}}function m(a){k(a);p=q=null}var p=null,q=null,v=!0,c=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var f=mxUtils.bind(this,function(){var c=parseInt(d?a.style.left:a.style.bottom);d||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){p=new mxPoint(mxEvent.getClientX(a), -mxEvent.getClientY(a));q=f();v=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",function(a){if(!v){var d=null!=c?c-e:0;c=f();b(d);mxEvent.consume(a)}});mxEvent.addGestureListeners(document,null,k,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,m)})};EditorUi.prototype.showDialog=function(a,d,e,b,k,m,p){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,d,e,b,k,m,p);this.dialogs.push(this.dialog)}; +EditorUi.prototype.addSplitHandler=function(a,d,e,b){function h(a){if(null!=p){var g=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));b(Math.max(0,q+(d?g.x-p.x:p.y-g.y)-e));mxEvent.consume(a);q!=f()&&(v=!0,c=null)}}function m(a){h(a);p=q=null}var p=null,q=null,v=!0,c=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var f=mxUtils.bind(this,function(){var c=parseInt(d?a.style.left:a.style.bottom);d||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){p=new mxPoint(mxEvent.getClientX(a), +mxEvent.getClientY(a));q=f();v=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){if(!v&&this.hsplitClickEnabled){var d=null!=c?c-e:0;c=f();b(d);mxEvent.consume(a)}}));mxEvent.addGestureListeners(document,null,h,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,h,m)})}; +EditorUi.prototype.showDialog=function(a,d,e,b,h,m,p){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,d,e,b,h,m,p);this.dialogs.push(this.dialog)}; EditorUi.prototype.hideDialog=function(a){null!=this.dialogs&&0<this.dialogs.length&&(this.dialogs.pop().close(a),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&this.editor.graph.container.focus(),mxUtils.clearSelection(),this.editor.fireEvent(new mxEventObject("hideDialog")))}; -EditorUi.prototype.pickColor=function(a,d){var e=this.editor.graph,b=e.cellEditor.saveSelection(),k=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(b);d(a)},function(){e.cellEditor.restoreSelection(b)});this.showDialog(k.container,230,430,!0,!1);k.init()}; +EditorUi.prototype.pickColor=function(a,d){var e=this.editor.graph,b=e.cellEditor.saveSelection(),h=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(b);d(a)},function(){e.cellEditor.restoreSelection(b)});this.showDialog(h.container,230,430,!0,!1);h.init()}; EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})}; -EditorUi.prototype.extractGraphModelFromHtml=function(a){var d=null;try{var e=a.indexOf("<mxGraphModel ");if(0<=e){var b=a.lastIndexOf("</mxGraphModel>");b>e&&(d=a.substring(e,b+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(k){}return d}; +EditorUi.prototype.extractGraphModelFromHtml=function(a){var d=null;try{var e=a.indexOf("<mxGraphModel ");if(0<=e){var b=a.lastIndexOf("</mxGraphModel>");b>e&&(d=a.substring(e,b+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(h){}return d}; EditorUi.prototype.extractGraphModelFromEvent=function(a){var d=null,e=null;null!=a&&(a=null!=a.dataTransfer?a.dataTransfer:a.clipboardData,null!=a&&(10==document.documentMode||11==document.documentMode?e=a.getData("Text"):(e=0<=mxUtils.indexOf(a.types,"text/html")?a.getData("text/html"):null,mxUtils.indexOf(a.types,null==e||0==e.length)&&(e=a.getData("text/plain"))),null!=e&&(e=this.editor.graph.zapGremlins(mxUtils.trim(e)),a=this.extractGraphModelFromHtml(e),null!=a&&(e=a))));null!=e&&this.isCompatibleString(e)&& (d=e);return d};EditorUi.prototype.isCompatibleString=function(a){return!1};EditorUi.prototype.saveFile=function(a){a||null==this.editor.filename?(a=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(a){this.save(a)}),null,mxUtils.bind(this,function(a){if(null!=a&&0<a.length)return!0;mxUtils.confirm(mxResources.get("invalidName"));return!1})),this.showDialog(a.container,300,100,!0,!0),a.init()):this.save(this.editor.getOrCreateFilename())}; EditorUi.prototype.save=function(a){if(null!=a){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(a)&&!mxUtils.confirm(mxResources.get("replaceIt",[a])))return;localStorage.setItem(a,d);this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}else if(d.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(a)+"&xml="+encodeURIComponent(d))).simulate(document, "_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(d);return}this.editor.setModified(!1);this.editor.setFilename(a);this.updateDocumentTitle()}catch(e){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}}; -EditorUi.prototype.executeLayout=function(a,d,e){var b=this.editor.graph;if(b.isEnabled()){b.getModel().beginUpdate();try{a()}catch(k){throw k;}finally{this.allowAnimation&&d&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(b),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){b.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(b.getModel().endUpdate(),null!=e&&e())}}}; -EditorUi.prototype.showImageDialog=function(a,d,e,b){b=this.editor.graph.cellEditor;var k=b.saveSelection(),m=mxUtils.prompt(a,d);b.restoreSelection(k);if(null!=m&&0<m.length){var p=new Image;p.onload=function(){e(m,p.width,p.height)};p.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};p.src=m}else e(null)};EditorUi.prototype.showLinkDialog=function(a,d,e){a=new LinkDialog(this,a,d,e);this.showDialog(a.container,420,90,!0,!0);a.init()}; +EditorUi.prototype.executeLayout=function(a,d,e){var b=this.editor.graph;if(b.isEnabled()){b.getModel().beginUpdate();try{a()}catch(h){throw h;}finally{this.allowAnimation&&d&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(b),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){b.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(b.getModel().endUpdate(),null!=e&&e())}}}; +EditorUi.prototype.showImageDialog=function(a,d,e,b){b=this.editor.graph.cellEditor;var h=b.saveSelection(),m=mxUtils.prompt(a,d);b.restoreSelection(h);if(null!=m&&0<m.length){var p=new Image;p.onload=function(){e(m,p.width,p.height)};p.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};p.src=m}else e(null)};EditorUi.prototype.showLinkDialog=function(a,d,e){a=new LinkDialog(this,a,d,e);this.showDialog(a.container,420,90,!0,!0);a.init()}; EditorUi.prototype.showDataDialog=function(a){null!=a&&(a=new EditDataDialog(this,a),this.showDialog(a.container,340,340,!0,!1,null,!1),a.init())}; EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var d=mxUtils.prompt(mxResources.get("backgroundImage"),"");if(null!=d&&0<d.length){var e=new Image;e.onload=function(){a(new mxImage(d,e.width,e.height))};e.onerror=function(){a(null);mxUtils.alert(mxResources.get("fileNotFound"))};e.src=d}else a(null)}; EditorUi.prototype.setBackgroundImage=function(a){this.editor.graph.setBackgroundImage(a);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(a,d,e){mxUtils.confirm(a)?null!=d&&d():null!=e&&e()}; EditorUi.prototype.createOutline=function(a){var d=new mxOutline(this.editor.graph);d.border=20;mxEvent.addListener(window,"resize",function(){d.update()});this.addListener("pageFormatChanged",function(){d.update()});return d}; EditorUi.prototype.createKeyHandler=function(a){function d(a,c,d){p.push(function(){if(!b.isSelectionEmpty()&&b.isEnabled())if(c=null!=c?c:1,d){b.getModel().beginUpdate();try{for(var f=b.getSelectionCells(),g=0;g<f.length;g++)if(b.getModel().isVertex(f[g])&&b.isCellResizable(f[g])){var e=b.getCellGeometry(f[g]);null!=e&&(e=e.clone(),37==a?e.width=Math.max(0,e.width-c):38==a?e.height=Math.max(0,e.height-c):39==a?e.width+=c:40==a&&(e.height+=c),b.getModel().setGeometry(f[g],e))}}finally{b.getModel().endUpdate()}}else f= b.getSelectionCell(),g=b.model.getParent(f),e=null,1==b.getSelectionCount()&&b.model.isVertex(f)&&null!=b.layoutManager&&!b.isCellLocked(f)&&(e=b.layoutManager.getLayout(g)),null!=e&&e.constructor==mxStackLayout?(e=g.getIndex(f),37==a||38==a?b.model.add(g,f,Math.max(0,e-1)):39!=a&&40!=a||b.model.add(g,f,Math.min(b.model.getChildCount(g),e+1))):(g=f=0,37==a?f=-c:38==a?g=-c:39==a?f=c:40==a&&(g=c),b.moveCells(b.getMovableCells(b.getSelectionCells()),f,g))});null!=q&&window.clearTimeout(q);q=window.setTimeout(function(){if(0< -p.length){b.getModel().beginUpdate();try{for(var a=0;a<p.length;a++)p[a]();p=[]}finally{b.getModel().endUpdate()}b.scrollCellToVisible(b.getSelectionCell())}},200)}var e=this,b=this.editor.graph,k=new mxKeyHandler(b),m=k.isEventIgnored;k.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&& -!mxClient.IS_SF)&&m.apply(this,arguments)};k.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};k.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var p=[],q=null,v={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},c=k.getFunction,f={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"), +p.length){b.getModel().beginUpdate();try{for(var a=0;a<p.length;a++)p[a]();p=[]}finally{b.getModel().endUpdate()}b.scrollCellToVisible(b.getSelectionCell())}},200)}var e=this,b=this.editor.graph,h=new mxKeyHandler(b),m=h.isEventIgnored;h.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&& +!mxClient.IS_SF)&&m.apply(this,arguments)};h.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};h.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var p=[],q=null,v={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},c=h.getFunction,f={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"), 76:this.actions.get("editLink"),80:this.actions.get("connectionPoints"),84:this.actions.get("editTooltip"),86:this.actions.get("pasteSize"),88:this.actions.get("copySize")};mxKeyHandler.prototype.getFunction=function(a){if(b.isEnabled()){if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){var g=f[a.keyCode];if(null!=g)return g.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){b.selectParentCell()}:function(){b.selectChildCell()};if(null!=v[a.keyCode]&&!b.isSelectionEmpty())if(mxEvent.isShiftDown(a)&& mxEvent.isAltDown(a)){if(b.model.isVertex(b.getSelectionCell()))return function(){var c=b.connectVertex(b.getSelectionCell(),v[a.keyCode],b.defaultEdgeLength,a,!0);null!=c&&0<c.length&&(1==c.length&&b.model.isEdge(c[0])?b.setSelectionCell(b.model.getTerminal(c[0],!1)):b.setSelectionCell(c[c.length-1]),b.scrollCellToVisible(b.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(b.getSelectionCell())))}}else return this.isControlDown(a)?function(){d(a.keyCode,mxEvent.isShiftDown(a)? -b.gridSize:null,!0)}:function(){d(a.keyCode,mxEvent.isShiftDown(a)?b.gridSize:null)}}return c.apply(this,arguments)};k.bindAction=mxUtils.bind(this,function(a,c,d,b){var f=this.actions.get(d);null!=f&&(d=function(){f.isEnabled()&&f.funct()},c?b?k.bindControlShiftKey(a,d):k.bindControlKey(a,d):b?k.bindShiftKey(a,d):k.bindKey(a,d))});var g=k.escape;k.escape=function(a){g.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){b.exitGroup()});k.bindControlShiftKey(35,function(){b.enterGroup()}); -k.bindKey(36,function(){b.home()});k.bindKey(35,function(){b.refresh()});k.bindAction(107,!0,"zoomIn");k.bindAction(109,!0,"zoomOut");k.bindAction(80,!0,"print");k.bindAction(79,!0,"outline",!0);k.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)k.bindControlKey(36,function(){b.isEnabled()&&b.foldCells(!0)}),k.bindControlKey(35,function(){b.isEnabled()&&b.foldCells(!1)}),k.bindControlKey(13,function(){b.isEnabled()&&b.setSelectionCells(b.duplicateCells(b.getSelectionCells(), -!1))}),k.bindAction(8,!1,"delete"),k.bindAction(8,!0,"deleteAll"),k.bindAction(46,!1,"delete"),k.bindAction(46,!0,"deleteAll"),k.bindAction(72,!0,"resetView"),k.bindAction(72,!0,"fitWindow",!0),k.bindAction(74,!0,"fitPage"),k.bindAction(74,!0,"fitTwoPages",!0),k.bindAction(48,!0,"customZoom"),k.bindAction(82,!0,"turn"),k.bindAction(82,!0,"clearDefaultStyle",!0),k.bindAction(83,!0,"save"),k.bindAction(83,!0,"saveAs",!0),k.bindAction(65,!0,"selectAll"),k.bindAction(65,!0,"selectNone",!0),k.bindAction(73, -!0,"selectVertices",!0),k.bindAction(69,!0,"selectEdges",!0),k.bindAction(69,!0,"editStyle"),k.bindAction(66,!0,"bold"),k.bindAction(66,!0,"toBack",!0),k.bindAction(70,!0,"toFront",!0),k.bindAction(68,!0,"duplicate"),k.bindAction(68,!0,"setAsDefaultStyle",!0),k.bindAction(90,!0,"undo"),k.bindAction(89,!0,"autosize",!0),k.bindAction(88,!0,"cut"),k.bindAction(67,!0,"copy"),k.bindAction(86,!0,"paste"),k.bindAction(71,!0,"group"),k.bindAction(77,!0,"editData"),k.bindAction(71,!0,"grid",!0),k.bindAction(73, -!0,"italic"),k.bindAction(76,!0,"lockUnlock"),k.bindAction(76,!0,"layers",!0),k.bindAction(80,!0,"formatPanel",!0),k.bindAction(85,!0,"underline"),k.bindAction(85,!0,"ungroup",!0),k.bindAction(190,!0,"superscript"),k.bindAction(188,!0,"subscript"),k.bindKey(13,function(){b.isEnabled()&&b.startEditingAtCell()}),k.bindKey(113,function(){b.isEnabled()&&b.startEditingAtCell()});mxClient.IS_WIN?k.bindAction(89,!0,"redo"):k.bindAction(90,!0,"redo",!0);return k}; +b.gridSize:null,!0)}:function(){d(a.keyCode,mxEvent.isShiftDown(a)?b.gridSize:null)}}return c.apply(this,arguments)};h.bindAction=mxUtils.bind(this,function(a,c,d,b){var f=this.actions.get(d);null!=f&&(d=function(){f.isEnabled()&&f.funct()},c?b?h.bindControlShiftKey(a,d):h.bindControlKey(a,d):b?h.bindShiftKey(a,d):h.bindKey(a,d))});var g=h.escape;h.escape=function(a){g.apply(this,arguments)};h.enter=function(){};h.bindControlShiftKey(36,function(){b.exitGroup()});h.bindControlShiftKey(35,function(){b.enterGroup()}); +h.bindKey(36,function(){b.home()});h.bindKey(35,function(){b.refresh()});h.bindAction(107,!0,"zoomIn");h.bindAction(109,!0,"zoomOut");h.bindAction(80,!0,"print");h.bindAction(79,!0,"outline",!0);h.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)h.bindControlKey(36,function(){b.isEnabled()&&b.foldCells(!0)}),h.bindControlKey(35,function(){b.isEnabled()&&b.foldCells(!1)}),h.bindControlKey(13,function(){b.isEnabled()&&b.setSelectionCells(b.duplicateCells(b.getSelectionCells(), +!1))}),h.bindAction(8,!1,"delete"),h.bindAction(8,!0,"deleteAll"),h.bindAction(46,!1,"delete"),h.bindAction(46,!0,"deleteAll"),h.bindAction(72,!0,"resetView"),h.bindAction(72,!0,"fitWindow",!0),h.bindAction(74,!0,"fitPage"),h.bindAction(74,!0,"fitTwoPages",!0),h.bindAction(48,!0,"customZoom"),h.bindAction(82,!0,"turn"),h.bindAction(82,!0,"clearDefaultStyle",!0),h.bindAction(83,!0,"save"),h.bindAction(83,!0,"saveAs",!0),h.bindAction(65,!0,"selectAll"),h.bindAction(65,!0,"selectNone",!0),h.bindAction(73, +!0,"selectVertices",!0),h.bindAction(69,!0,"selectEdges",!0),h.bindAction(69,!0,"editStyle"),h.bindAction(66,!0,"bold"),h.bindAction(66,!0,"toBack",!0),h.bindAction(70,!0,"toFront",!0),h.bindAction(68,!0,"duplicate"),h.bindAction(68,!0,"setAsDefaultStyle",!0),h.bindAction(90,!0,"undo"),h.bindAction(89,!0,"autosize",!0),h.bindAction(88,!0,"cut"),h.bindAction(67,!0,"copy"),h.bindAction(86,!0,"paste"),h.bindAction(71,!0,"group"),h.bindAction(77,!0,"editData"),h.bindAction(71,!0,"grid",!0),h.bindAction(73, +!0,"italic"),h.bindAction(76,!0,"lockUnlock"),h.bindAction(76,!0,"layers",!0),h.bindAction(80,!0,"formatPanel",!0),h.bindAction(85,!0,"underline"),h.bindAction(85,!0,"ungroup",!0),h.bindAction(190,!0,"superscript"),h.bindAction(188,!0,"subscript"),h.bindKey(13,function(){b.isEnabled()&&b.startEditingAtCell()}),h.bindKey(113,function(){b.isEnabled()&&b.startEditingAtCell()});mxClient.IS_WIN?h.bindAction(89,!0,"redo"):h.bindAction(90,!0,"redo",!0);return h}; EditorUi.prototype.destroy=function(){null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&& (mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window, "scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(var a=0;a<this.destroyFunctions.length;a++)this.destroyFunctions[a]();this.destroyFunctions=null}for(var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog],a=0;a<d.length;a++)null!=d[a]&&null!=d[a].parentNode&&d[a].parentNode.removeChild(d[a])};"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0);mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1; (function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(d){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1; mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]"; -Graph=function(a,d,e,b,k){mxGraph.call(this,a,d,e,b);this.themes=k||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;d=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=a.indexOf("/",d+2),0<d&&(this.domainUrl=a.substring(0,d)),d=a.lastIndexOf("/"),0<d&&(this.domainPathUrl=a.substring(0,d+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a); +Graph=function(a,d,e,b,h){mxGraph.call(this,a,d,e,b);this.themes=h||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;d=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=a.indexOf("/",d+2),0<d&&(this.domainUrl=a.substring(0,d)),d=a.lastIndexOf("/"),0<d&&(this.domainPathUrl=a.substring(0,d+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a); return"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]};if(this.edgeMode){var m=null,p=null,q=null,v=null,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,d){if("mouseDown"==d.getProperty("eventName")&&this.isEnabled()){var b=d.getProperty("event");if(!mxEvent.isControlDown(b.getEvent())&&!mxEvent.isShiftDown(b.getEvent())){var f=b.getState();null!=f&&this.model.isEdge(f.cell)&&(m=new mxPoint(b.getGraphX(),b.getGraphY()),c=this.isCellSelected(f.cell),q=f,p=b,null!= f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,b.getGraphX(),b.getGraphY())?v=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(v=f.getHandleForEvent(b))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,d){var b=this.selectionCellsHandler.handlers.map,f;for(f in b)if(null!=b[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(d.getEvent())&& -!mxEvent.isShiftDown(d.getEvent())&&!mxEvent.isAltDown(d.getEvent()))if(f=this.tolerance,null!=m&&null!=q&&null!=p){if(b=q,Math.abs(m.x-d.getGraphX())>f||Math.abs(m.y-d.getGraphY())>f){this.isCellSelected(b.cell)||this.setSelectionCell(b.cell);var g=this.selectionCellsHandler.getHandler(b.cell);if(null!=g&&null!=g.bends&&0<g.bends.length){var e=g.getHandleForEvent(p),l=this.view.getEdgeStyle(b);f=l==mxEdgeStyle.EntityRelation;c||v!=mxEvent.LABEL_HANDLE||(e=v);if(f&&0!=e&&e!=g.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f|| -null==b.visibleSourceState&&null==b.visibleTargetState||(this.graphHandler.reset(),d.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=b.visibleSourceState||e==g.bends.length-1||null!=b.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=b.absolutePoints,null!=f&&(null==l&&null==e||l==mxEdgeStyle.OrthConnector)&&(e=v,null==e&&(e=new mxRectangle(m.x,m.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)? -e=g.bends.length-1:null!=l&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(b,m.x,m.y),e=null==l?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),g.start(d.getGraphX(),d.getGraphX(),e),v=m=p=q=null,c=!1,d.consume(),this.graphHandler.reset()}}}else if(b=d.getState(),null!=b&&this.model.isEdge(b.cell)){g=null;f=b.absolutePoints;if(null!=f)if(e=new mxRectangle(d.getGraphX(), -d.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,d.getGraphX(),d.getGraphY()))g="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))g="pointer";else if(null!=b.visibleSourceState||null!=b.visibleTargetState)l=this.view.getEdgeStyle(b),g="crosshair",l!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(b)&&(l=mxUtils.findNearestSegment(b,d.getGraphX(),d.getGraphY()), -l<f.length-1&&0<=l&&(g=0==Math.round(f[l].x-f[l+1].x)?"col-resize":"row-resize"));null!=g&&b.setCursor(g)}}),mouseUp:mxUtils.bind(this,function(a,c){v=m=p=q=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0); +!mxEvent.isShiftDown(d.getEvent())&&!mxEvent.isAltDown(d.getEvent()))if(f=this.tolerance,null!=m&&null!=q&&null!=p){if(b=q,Math.abs(m.x-d.getGraphX())>f||Math.abs(m.y-d.getGraphY())>f){this.isCellSelected(b.cell)||this.setSelectionCell(b.cell);var g=this.selectionCellsHandler.getHandler(b.cell);if(null!=g&&null!=g.bends&&0<g.bends.length){var e=g.getHandleForEvent(p),k=this.view.getEdgeStyle(b);f=k==mxEdgeStyle.EntityRelation;c||v!=mxEvent.LABEL_HANDLE||(e=v);if(f&&0!=e&&e!=g.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f|| +null==b.visibleSourceState&&null==b.visibleTargetState||(this.graphHandler.reset(),d.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=b.visibleSourceState||e==g.bends.length-1||null!=b.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=b.absolutePoints,null!=f&&(null==k&&null==e||k==mxEdgeStyle.OrthConnector)&&(e=v,null==e&&(e=new mxRectangle(m.x,m.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)? +e=g.bends.length-1:null!=k&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(b,m.x,m.y),e=null==k?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),g.start(d.getGraphX(),d.getGraphX(),e),v=m=p=q=null,c=!1,d.consume(),this.graphHandler.reset()}}}else if(b=d.getState(),null!=b&&this.model.isEdge(b.cell)){g=null;f=b.absolutePoints;if(null!=f)if(e=new mxRectangle(d.getGraphX(), +d.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,d.getGraphX(),d.getGraphY()))g="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))g="pointer";else if(null!=b.visibleSourceState||null!=b.visibleTargetState)k=this.view.getEdgeStyle(b),g="crosshair",k!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(b)&&(k=mxUtils.findNearestSegment(b,d.getGraphX(),d.getGraphY()), +k<f.length-1&&0<=k&&(g=0==Math.round(f[k].x-f[k+1].x)?"col-resize":"row-resize"));null!=g&&b.setCursor(g)}}),mouseUp:mxUtils.bind(this,function(a,c){v=m=p=q=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0); this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(a,c){return!1};this.alternateEdgeStyle="vertical";null==b&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates= -function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],d=this.graph.pageFormat,b=this.graph.pageScale,e=d.width*b,d=d.height*b,b=this.graph.view.translate,g=this.graph.view.scale,l=this.graph.getPageLayout(),h=0;h<l.width;h++)c.push(new mxRectangle(((l.x+h)*e+b.x)*g,(l.y*d+b.y)*g,e*g,d*g));for(h=0;h<l.height;h++)c.push(new mxRectangle((l.x*e+b.x)*g,((l.y+h)*d+b.y)*g,e*g,d*g));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor= +function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],d=this.graph.pageFormat,b=this.graph.pageScale,e=d.width*b,d=d.height*b,b=this.graph.view.translate,g=this.graph.view.scale,k=this.graph.getPageLayout(),l=0;l<k.width;l++)c.push(new mxRectangle(((k.x+l)*e+b.x)*g,(k.y*d+b.y)*g,e*g,d*g));for(l=0;l<k.height;l++)c.push(new mxRectangle((k.x*e+b.x)*g,((k.y+l)*d+b.y)*g,e*g,d*g));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor= function(a,c){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var c=mxGraphHandler.prototype.getCells.apply(this,arguments),d=[],b=0;b<c.length;b++){var f=this.graph.view.getState(c[b]),f=null!=f?f.style:this.graph.getCellStyle(c[b]); "1"==mxUtils.getValue(f,"part","0")?(f=this.graph.model.getParent(c[b]),this.graph.model.isVertex(f)&&0>mxUtils.indexOf(c,f)&&d.push(f)):d.push(c[b])}return d};this.connectionHandler.createTargetVertex=function(a,c){var d=this.graph.view.getState(c),d=null!=d?d.style:this.graph.getCellStyle(c);mxUtils.getValue(d,"part",!1)&&(d=this.graph.model.getParent(c),this.graph.model.isVertex(d)&&(c=d));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var g=new mxRubberband(this); -this.getRubberband=function(){return g};var u=(new Date).getTime(),t=0,h=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;h.apply(this,arguments);a!=this.currentState?(u=(new Date).getTime(),t=0):t=(new Date).getTime()-u};var n=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<t||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style, -"outlineConnect","1"))&&n.apply(this,arguments)};var l=this.isToggleEvent;this.isToggleEvent=function(a){return l.apply(this,arguments)||mxEvent.isShiftDown(a)};var w=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return w.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var r=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&& +this.getRubberband=function(){return g};var u=(new Date).getTime(),t=0,l=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;l.apply(this,arguments);a!=this.currentState?(u=(new Date).getTime(),t=0):t=(new Date).getTime()-u};var n=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<t||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style, +"outlineConnect","1"))&&n.apply(this,arguments)};var k=this.isToggleEvent;this.isToggleEvent=function(a){return k.apply(this,arguments)||mxEvent.isShiftDown(a)};var w=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return w.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var r=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&& (r=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=r)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var y=this.click;this.click=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);if(this.isEnabled()&&!c||a.isConsumed())return y.apply(this, arguments);c=c?a.sourceState.cell:a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&(this.isCustomLink(c)?this.customLinkClicked(c):this.openLink(c)))};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(c?a.sourceState.cell:a.getCell())};var D=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()||this.isCellLocked(a)){if(null!= -this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return D.apply(this,arguments)};this.selectRegion=function(a,c){var d=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(d,c);return d};this.getAllCells=function(a,c,d,b,f,g){g=null!=g?g:[];if(0<d||0<b){var e=this.getModel(),l=a+d,h=c+b;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var u=e.getChildCount(f),r=0;r<u;r++){var n=e.getChildAt(f,r),t=this.view.getState(n);if(null!= -t&&this.isCellVisible(n)&&"1"!=mxUtils.getValue(t.style,"locked","0")){var w=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0;0!=w&&(t=mxUtils.getBoundingBox(t,w));(e.isEdge(n)||e.isVertex(n))&&t.x>=a&&t.y+t.height<=h&&t.y>=c&&t.x+t.width<=l&&g.push(n);this.getAllCells(a,c,d,b,n,g)}}}return g};var z=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,d){return this.graph.isCellSelected(a)?!1:z.apply(this,arguments)};this.isCellLocked=function(a){for(a= +this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return D.apply(this,arguments)};this.selectRegion=function(a,c){var d=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(d,c);return d};this.getAllCells=function(a,c,d,b,f,g){g=null!=g?g:[];if(0<d||0<b){var e=this.getModel(),k=a+d,l=c+b;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var u=e.getChildCount(f),r=0;r<u;r++){var n=e.getChildAt(f,r),t=this.view.getState(n);if(null!= +t&&this.isCellVisible(n)&&"1"!=mxUtils.getValue(t.style,"locked","0")){var w=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0;0!=w&&(t=mxUtils.getBoundingBox(t,w));(e.isEdge(n)||e.isVertex(n))&&t.x>=a&&t.y+t.height<=l&&t.y>=c&&t.x+t.width<=k&&g.push(n);this.getAllCells(a,c,d,b,n,g)}}}return g};var z=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,d){return this.graph.isCellSelected(a)?!1:z.apply(this,arguments)};this.isCellLocked=function(a){for(a= this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var G=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var d=c.getProperty("event").getState();G=null==d||this.isSelectionEmpty()||this.isCellSelected(d.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var d= c.getProperty("event"),b=c.getProperty("cell");null==b?(d=mxUtils.convertPoint(this.container,mxEvent.getClientX(d),mxEvent.getClientY(d)),g.start(d.x,d.y)):null!=G?this.addSelectionCells(G):1<this.getSelectionCount()&&this.isCellSelected(b)&&this.removeSelectionCell(b);G=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE, mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var E=this.updateMouseEvent;this.updateMouseEvent=function(a){a=E.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state=null);return a}}}; @@ -2208,7 +2209,7 @@ Graph.createSvgImage=function(a,d,e){e=unescape(encodeURIComponent('<!DOCTYPE sv Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.defaultScrollbars=!mxClient.IS_IOS;Graph.prototype.defaultPageVisible=!0;Graph.prototype.lightbox=!1;Graph.prototype.defaultPageBackgroundColor="#ffffff";Graph.prototype.defaultPageBorderColor="#ffffff";Graph.prototype.defaultGraphBackground="#ffffff";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400); Graph.prototype.transparentBackground=!0;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}]+)%","g");Graph.prototype.absoluteUrlPattern=/^(?:[a-z]+:)?\/\//i;Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?decodeURIComponent(urlParams.base):(window!=window.top?document.referrer:document.location.toString()).split("#")[0]; Graph.prototype.editAfterInsert=!1; -Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var d=a.view.graph.tolerance,k=!0,m=null,p=mxUtils.bind(this,function(a){k=!0;m=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),q=mxUtils.bind(this,function(a){k=k&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<d&&Math.abs(m.y-mxEvent.getClientY(a))<d}),v=mxUtils.bind(this,function(c){if(k)for(var d=mxEvent.getSource(c);null!= +Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var d=a.view.graph.tolerance,h=!0,m=null,p=mxUtils.bind(this,function(a){h=!0;m=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),q=mxUtils.bind(this,function(a){h=h&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<d&&Math.abs(m.y-mxEvent.getClientY(a))<d}),v=mxUtils.bind(this,function(c){if(h)for(var d=mxEvent.getSource(c);null!= d&&d!=e.node;){if("a"==d.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,d,c);break}d=d.parentNode}});mxEvent.addGestureListeners(e.node,p,q,v);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};Graph.prototype.isLightboxView=function(){return this.lightbox}; Graph.prototype.labelLinkClicked=function(a,d,e){d=d.getAttribute("href");if(null!=d&&!this.isCustomLink(d)&&mxEvent.isLeftMouseButton(e)&&!mxEvent.isPopupTrigger(e)||mxEvent.isTouchEvent(e)){if(!this.isEnabled()||this.isCellLocked(a.cell))a=this.isBlankLink(d)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(d),a);mxEvent.consume(e)}}; Graph.prototype.openLink=function(a,d){var e=window;if("_self"==d&&window!=window.top)window.location.href=a;else if(a.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==a.charAt(this.baseUrl.length)&&"_top"==d&&window==window.top){var b=a.split("#")[1];window.location.hash=="#"+b&&(window.location.hash="");window.location.hash=b}else e=window.open(a,d);return e};Graph.prototype.getLinkTitle=function(a){return a.substring(a.lastIndexOf("/")+1)}; @@ -2218,41 +2219,41 @@ Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutMana "resizeLast","0"),d.spacing=a.stackSpacing||d.spacing,d.border=a.stackBorder||d.border,d.marginLeft=a.marginLeft||0,d.marginRight=a.marginRight||0,d.marginTop=a.marginTop||0,d.marginBottom=a.marginBottom||0,d.fill=!0,d):"treeLayout"==a.childLayout?(d=new mxCompactTreeLayout(this.graph),d.horizontal="1"==mxUtils.getValue(a,"horizontalTree","1"),d.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),d.groupPadding=mxUtils.getValue(a,"parentPadding",20),d.levelDistance=mxUtils.getValue(a,"treeLevelDistance", 30),d.maintainParentLocation=!0,d.edgeRouting=!1,d.resetEdges=!1,d):"flowLayout"==a.childLayout?(d=new mxHierarchicalLayout(this.graph,mxUtils.getValue(a,"flowOrientation",mxConstants.DIRECTION_EAST)),d.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),d.parentBorder=mxUtils.getValue(a,"parentPadding",20),d.maintainParentLocation=!0,d.intraCellSpacing=mxUtils.getValue(a,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),d.interRankCellSpacing=mxUtils.getValue(a,"interRankCellSpacing", mxHierarchicalLayout.prototype.interRankCellSpacing),d.interHierarchySpacing=mxUtils.getValue(a,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),d.parallelEdgeSpacing=mxUtils.getValue(a,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),d):null}};Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize}; -Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),d=this.getGraphBounds();if(0==d.width||0==d.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(d.x/this.view.scale-this.view.translate.x),b=Math.ceil(d.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),m=Math.floor(b/a.height);return new mxRectangle(k,m,Math.ceil((e+Math.floor(d.width/this.view.scale))/a.width)-k,Math.ceil((b+Math.floor(d.height/this.view.scale))/a.height)-m)}; +Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),d=this.getGraphBounds();if(0==d.width||0==d.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(d.x/this.view.scale-this.view.translate.x),b=Math.ceil(d.y/this.view.scale-this.view.translate.y),h=Math.floor(e/a.width),m=Math.floor(b/a.height);return new mxRectangle(h,m,Math.ceil((e+Math.floor(d.width/this.view.scale))/a.width)-h,Math.ceil((b+Math.floor(d.height/this.view.scale))/a.height)-m)}; Graph.prototype.sanitizeHtml=function(a,d){return html_sanitize(a,function(a){return null!=a&&"javascript:"!==a.toString().toLowerCase().substring(0,11)?a:null},function(a){return a})};Graph.prototype.updatePlaceholders=function(){var a=!1,d;for(d in this.model.cells){var e=this.model.cells[d];this.isReplacePlaceholders(e)&&(this.view.invalidate(e,!1,!1),a=!0)}a&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(a){return null!=a.value&&"object"==typeof a.value&&"1"==a.value.getAttribute("placeholders")}; Graph.prototype.isZoomWheelEvent=function(a){return mxEvent.isAltDown(a)||mxEvent.isControlDown(a)&&!mxClient.IS_MAC};Graph.prototype.isTransparentClickEvent=function(a){return mxEvent.isAltDown(a)};Graph.prototype.isIgnoreTerminalEvent=function(a){return mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)};Graph.prototype.isSplitTarget=function(a,d,e){return!this.model.isEdge(d[0])&&!mxEvent.isAltDown(e)&&!mxEvent.isShiftDown(e)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)}; Graph.prototype.getLabel=function(a){var d=mxGraph.prototype.getLabel.apply(this,arguments);null!=d&&this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder")&&(d=this.replacePlaceholders(a,d));return d};Graph.prototype.isLabelMovable=function(a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(d,"labelMovable","0")))}; Graph.prototype.setGridSize=function(a){this.gridSize=a;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.getGlobalVariable=function(a){var d=null;"date"==a?d=(new Date).toLocaleDateString():"time"==a?d=(new Date).toLocaleTimeString():"timestamp"==a?d=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),d=this.formatDate(new Date,a));return d}; Graph.prototype.formatDate=function(a,d,e){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy", -shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var b=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,p=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)|| -/\d/.test(a)||(d=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");d=String(b.masks[d]||d||b.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),e=!0);var q=e?"getUTC":"get",v=a[q+"Date"](),c=a[q+"Day"](),f=a[q+"Month"](),g=a[q+"FullYear"](),u=a[q+"Hours"](),t=a[q+"Minutes"](),h=a[q+"Seconds"](),q=a[q+"Milliseconds"](),n=e?0:a.getTimezoneOffset(),l={d:v,dd:p(v),ddd:b.i18n.dayNames[c],dddd:b.i18n.dayNames[c+7],m:f+1,mm:p(f+1),mmm:b.i18n.monthNames[f],mmmm:b.i18n.monthNames[f+ -12],yy:String(g).slice(2),yyyy:g,h:u%12||12,hh:p(u%12||12),H:u,HH:p(u),M:t,MM:p(t),s:h,ss:p(h),l:p(q,3),L:p(99<q?Math.round(q/10):q),t:12>u?"a":"p",tt:12>u?"am":"pm",T:12>u?"A":"P",TT:12>u?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0<n?"-":"+")+p(100*Math.floor(Math.abs(n)/60)+Math.abs(n)%60,4),S:["th","st","nd","rd"][3<v%10?0:(10!=v%100-v%10)*v%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in l?l[a]:a.slice(1, +shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var b=this.dateFormatCache,h=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,p=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)|| +/\d/.test(a)||(d=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");d=String(b.masks[d]||d||b.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),e=!0);var q=e?"getUTC":"get",v=a[q+"Date"](),c=a[q+"Day"](),f=a[q+"Month"](),g=a[q+"FullYear"](),u=a[q+"Hours"](),t=a[q+"Minutes"](),l=a[q+"Seconds"](),q=a[q+"Milliseconds"](),n=e?0:a.getTimezoneOffset(),k={d:v,dd:p(v),ddd:b.i18n.dayNames[c],dddd:b.i18n.dayNames[c+7],m:f+1,mm:p(f+1),mmm:b.i18n.monthNames[f],mmmm:b.i18n.monthNames[f+ +12],yy:String(g).slice(2),yyyy:g,h:u%12||12,hh:p(u%12||12),H:u,HH:p(u),M:t,MM:p(t),s:l,ss:p(l),l:p(q,3),L:p(99<q?Math.round(q/10):q),t:12>u?"a":"p",tt:12>u?"am":"pm",T:12>u?"A":"P",TT:12>u?"AM":"PM",Z:e?"UTC":(String(a).match(h)||[""]).pop().replace(m,""),o:(0<n?"-":"+")+p(100*Math.floor(Math.abs(n)/60)+Math.abs(n)%60,4),S:["th","st","nd","rd"][3<v%10?0:(10!=v%100-v%10)*v%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in k?k[a]:a.slice(1, a.length-1)})}; -Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var d=this.getModel(),e=d.getChildCount(d.root),b=0;b<e;b++)mxUtils.bind(this,function(b){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var k=document.createElement("input");k.style.display="inline-block";k.setAttribute("type","checkbox");d.isVisible(b)&&(k.setAttribute("checked","checked"), -k.defaultChecked=!0);e.appendChild(k);var q=this.convertValueToString(b)||mxResources.get("background")||"Background";e.setAttribute("title",q);mxUtils.write(e,q);a.appendChild(e);mxEvent.addListener(k,"click",function(){null!=k.getAttribute("checked")?k.removeAttribute("checked"):k.setAttribute("checked","checked");d.setVisible(b,k.checked)})})(d.getChildAt(d.root,b));return a}; -Graph.prototype.replacePlaceholders=function(a,d){var e=[];if(null!=d){for(var b=0;match=this.placeholderPattern.exec(d);){var k=match[0];if(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var m=null;if(match.index>b&&"%"==d.charAt(match.index-1))m=k.substring(1);else{var p=k.substring(1,k.length-1);if(0>p.indexOf("{"))for(var q=a;null==m&&null!=q;)null!=q.value&&"object"==typeof q.value&&(m=q.hasAttribute(p)?null!=q.getAttribute(p)?q.getAttribute(p):"":null),q=this.model.getParent(q);null==m&&(m=this.getGlobalVariable(p))}e.push(d.substring(b, -match.index)+(null!=m?m:k));b=match.index+k.length}}e.push(d.substring(b))}return e.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,d,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(d)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)}; -Graph.prototype.connectVertex=function(a,d,e,b,k,m){m=m?m:!1;var p=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);d==mxConstants.DIRECTION_NORTH?(p.x+=a.geometry.width/2,p.y-=e):d==mxConstants.DIRECTION_SOUTH?(p.x+=a.geometry.width/2,p.y+=a.geometry.height+e):(p.x=d==mxConstants.DIRECTION_WEST?p.x-e:p.x+(a.geometry.width+e),p.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a)); -var q=this.view.scale,v=this.view.translate,c=v.x*q,v=v.y*q;this.model.isVertex(e.cell)&&(c=e.x,v=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(p.x+=a.parent.geometry.x,p.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(b)&&!k?null:this.getCellAt(c+p.x*q,v+p.y*q);this.model.isAncestor(m,a)&&(m=null);for(e=m;null!=e;){if(this.isCellLocked(e)){m=null;break}e=this.model.getParent(e)}null!=m&&(e=this.view.getState(a),q=this.view.getState(m),null!=e&&null!=q&&mxUtils.intersects(e,q)&&(m= -null));if(k=!mxEvent.isShiftDown(b)||k)d==mxConstants.DIRECTION_NORTH?p.y-=a.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?p.y+=a.geometry.height/2:p.x=d==mxConstants.DIRECTION_WEST?p.x-a.geometry.width/2:p.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(e=this.getModel().getParent(m),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(m=e));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;e=[];this.model.beginUpdate();try{q=m;if(null==q&&k){for(var c=a,f=this.getCellGeometry(a);null!= -f&&f.relative;)c=this.getModel().getParent(c),f=this.getCellGeometry(c);var g=this.view.getState(c),u=null!=g?g.style:this.getCellStyle(c);if(mxUtils.getValue(u,"part",!1)){var t=this.model.getParent(c);this.model.isVertex(t)&&(c=t)}q=this.duplicateCells([c],!1)[0];f=this.getCellGeometry(q);null!=f&&(f.x=p.x-f.width/2,f.y=p.y-f.height/2)}f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(a)));var h=mxEvent.isControlDown(b)&&k||null==m&&null!=f&&f.constructor==mxStackLayout? -null:this.insertEdge(this.model.getParent(a),null,"",a,q,this.createCurrentEdgeStyle());if(null!=h&&this.connectionHandler.insertBeforeSource){var n=null;for(b=a;null!=b.parent&&null!=b.geometry&&b.geometry.relative&&b.parent!=h.parent;)b=this.model.getParent(b);null!=b&&null!=b.parent&&b.parent==h.parent&&(n=b.parent.getIndex(b),this.model.add(b.parent,h,n))}null==m&&null!=q&&null!=f&&null!=a.parent&&f.constructor==mxStackLayout&&d==mxConstants.DIRECTION_WEST&&(n=a.parent.getIndex(a),this.model.add(a.parent, -q,n));null!=h&&e.push(h);null==m&&null!=q&&e.push(q);null==q&&null!=h&&h.geometry.setTerminalPoint(p,!1);null!=h&&this.fireEvent(new mxEventObject("cellsInserted","cells",[h]))}finally{this.model.endUpdate()}return e}; +Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var d=this.getModel(),e=d.getChildCount(d.root),b=0;b<e;b++)mxUtils.bind(this,function(b){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var h=document.createElement("input");h.style.display="inline-block";h.setAttribute("type","checkbox");d.isVisible(b)&&(h.setAttribute("checked","checked"), +h.defaultChecked=!0);e.appendChild(h);var q=this.convertValueToString(b)||mxResources.get("background")||"Background";e.setAttribute("title",q);mxUtils.write(e,q);a.appendChild(e);mxEvent.addListener(h,"click",function(){null!=h.getAttribute("checked")?h.removeAttribute("checked"):h.setAttribute("checked","checked");d.setVisible(b,h.checked)})})(d.getChildAt(d.root,b));return a}; +Graph.prototype.replacePlaceholders=function(a,d){var e=[];if(null!=d){for(var b=0;match=this.placeholderPattern.exec(d);){var h=match[0];if(2<h.length&&"%label%"!=h&&"%tooltip%"!=h){var m=null;if(match.index>b&&"%"==d.charAt(match.index-1))m=h.substring(1);else{var p=h.substring(1,h.length-1);if(0>p.indexOf("{"))for(var q=a;null==m&&null!=q;)null!=q.value&&"object"==typeof q.value&&(m=q.hasAttribute(p)?null!=q.getAttribute(p)?q.getAttribute(p):"":null),q=this.model.getParent(q);null==m&&(m=this.getGlobalVariable(p))}e.push(d.substring(b, +match.index)+(null!=m?m:h));b=match.index+h.length}}e.push(d.substring(b))}return e.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,d,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(d)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)}; +Graph.prototype.connectVertex=function(a,d,e,b,h,m){m=m?m:!1;var p=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);d==mxConstants.DIRECTION_NORTH?(p.x+=a.geometry.width/2,p.y-=e):d==mxConstants.DIRECTION_SOUTH?(p.x+=a.geometry.width/2,p.y+=a.geometry.height+e):(p.x=d==mxConstants.DIRECTION_WEST?p.x-e:p.x+(a.geometry.width+e),p.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a)); +var q=this.view.scale,v=this.view.translate,c=v.x*q,v=v.y*q;this.model.isVertex(e.cell)&&(c=e.x,v=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(p.x+=a.parent.geometry.x,p.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(b)&&!h?null:this.getCellAt(c+p.x*q,v+p.y*q);this.model.isAncestor(m,a)&&(m=null);for(e=m;null!=e;){if(this.isCellLocked(e)){m=null;break}e=this.model.getParent(e)}null!=m&&(e=this.view.getState(a),q=this.view.getState(m),null!=e&&null!=q&&mxUtils.intersects(e,q)&&(m= +null));if(h=!mxEvent.isShiftDown(b)||h)d==mxConstants.DIRECTION_NORTH?p.y-=a.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?p.y+=a.geometry.height/2:p.x=d==mxConstants.DIRECTION_WEST?p.x-a.geometry.width/2:p.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(e=this.getModel().getParent(m),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(m=e));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;e=[];this.model.beginUpdate();try{q=m;if(null==q&&h){for(var c=a,f=this.getCellGeometry(a);null!= +f&&f.relative;)c=this.getModel().getParent(c),f=this.getCellGeometry(c);var g=this.view.getState(c),u=null!=g?g.style:this.getCellStyle(c);if(mxUtils.getValue(u,"part",!1)){var t=this.model.getParent(c);this.model.isVertex(t)&&(c=t)}q=this.duplicateCells([c],!1)[0];f=this.getCellGeometry(q);null!=f&&(f.x=p.x-f.width/2,f.y=p.y-f.height/2)}f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(a)));var l=mxEvent.isControlDown(b)&&h||null==m&&null!=f&&f.constructor==mxStackLayout? +null:this.insertEdge(this.model.getParent(a),null,"",a,q,this.createCurrentEdgeStyle());if(null!=l&&this.connectionHandler.insertBeforeSource){var n=null;for(b=a;null!=b.parent&&null!=b.geometry&&b.geometry.relative&&b.parent!=l.parent;)b=this.model.getParent(b);null!=b&&null!=b.parent&&b.parent==l.parent&&(n=b.parent.getIndex(b),this.model.add(b.parent,l,n))}null==m&&null!=q&&null!=f&&null!=a.parent&&f.constructor==mxStackLayout&&d==mxConstants.DIRECTION_WEST&&(n=a.parent.getIndex(a),this.model.add(a.parent, +q,n));null!=l&&e.push(l);null==m&&null!=q&&e.push(q);null==q&&null!=l&&l.geometry.setTerminalPoint(p,!1);null!=l&&this.fireEvent(new mxEventObject("cellsInserted","cells",[l]))}finally{this.model.endUpdate()}return e}; Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),d=[],e,b;for(b in this.model.cells)if(e=this.model.cells[b],this.model.isVertex(e)||this.model.isEdge(e))this.isHtmlLabel(e)?(a.innerHTML=this.getLabel(e),e=mxUtils.extractTextWithWhitespace([a])):e=this.getLabel(e),e=mxUtils.trim(e.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<e.length&&d.push(e);return d.join(" ")}; Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var d=a.getAttribute("placeholder"),e=a,b=null;null==b&&null!=e;)null!=e.value&&"object"==typeof e.value&&(b=e.hasAttribute(d)?null!=e.getAttribute(d)?e.getAttribute(d):"":null),e=this.model.getParent(e);return b||""}return a.value.getAttribute("label")}return mxGraph.prototype.convertValueToString.apply(this,arguments)}; Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),null!=a&&"javascript:"===a.toLowerCase().substring(0,11)&&(a=a.substring(11)),a):null}; Graph.prototype.getCellStyle=function(a){var d=mxGraph.prototype.getCellStyle.apply(this,arguments);if(null!=a&&null!=this.layoutManager){var e=this.model.getParent(a);this.model.isVertex(e)&&this.isCellCollapsed(a)&&(e=this.layoutManager.getLayout(e),null!=e&&e.constructor==mxStackLayout&&(d[mxConstants.STYLE_HORIZONTAL]=!e.horizontal))}return d}; Graph.prototype.updateAlternateBounds=function(a,d,e){if(null!=a&&null!=d&&null!=this.layoutManager&&null!=d.alternateBounds){var b=this.layoutManager.getLayout(this.model.getParent(a));null!=b&&b.constructor==mxStackLayout&&(b.horizontal?d.alternateBounds.height=0:d.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)}; -Graph.prototype.foldCells=function(a,d,e,b,k){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var m=0;m<e.length;m++){var p=this.view.getState(e[m]),q=this.getCellGeometry(e[m]);if(null!=p&&null!=q){var v=Math.round(q.width-p.width/this.view.scale),c=Math.round(q.height-p.height/this.view.scale);if(0!=c||0!=v){var f=this.model.getParent(e[m]),g=this.layoutManager.getLayout(f); -null==g?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(p,f,v,c):null!=k&&mxEvent.isAltDown(k)||g.constructor!=mxStackLayout||g.resizeLast||this.resizeParentStacks(f,g,v,c)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}}; -Graph.prototype.moveSiblings=function(a,d,e,b){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,d,!0,!0);for(d=0;d<k.length;d++)if(k[d]!=a.cell){var m=this.view.getState(k[d]),p=this.getCellGeometry(k[d]);null!=m&&null!=p&&(p=p.clone(),p.translate(Math.round(e*Math.max(0,Math.min(1,(m.x-a.x)/a.width))),Math.round(b*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(k[d],p))}}finally{this.model.endUpdate()}}; -Graph.prototype.resizeParentStacks=function(a,d,e,b){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var k=d.horizontal;null!=a&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==k&&!d.resizeLast;){var m=this.getCellGeometry(a),p=this.view.getState(a);null!=p&&null!=m&&(m=m.clone(),d.horizontal?m.width+=e+Math.min(0,p.width/this.view.scale-m.width):m.height+=b+Math.min(0,p.height/this.view.scale-m.height),this.model.setGeometry(a, +Graph.prototype.foldCells=function(a,d,e,b,h){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var m=0;m<e.length;m++){var p=this.view.getState(e[m]),q=this.getCellGeometry(e[m]);if(null!=p&&null!=q){var v=Math.round(q.width-p.width/this.view.scale),c=Math.round(q.height-p.height/this.view.scale);if(0!=c||0!=v){var f=this.model.getParent(e[m]),g=this.layoutManager.getLayout(f); +null==g?null!=h&&this.isMoveCellsEvent(h)&&this.moveSiblings(p,f,v,c):null!=h&&mxEvent.isAltDown(h)||g.constructor!=mxStackLayout||g.resizeLast||this.resizeParentStacks(f,g,v,c)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}}; +Graph.prototype.moveSiblings=function(a,d,e,b){this.model.beginUpdate();try{var h=this.getCellsBeyond(a.x,a.y,d,!0,!0);for(d=0;d<h.length;d++)if(h[d]!=a.cell){var m=this.view.getState(h[d]),p=this.getCellGeometry(h[d]);null!=m&&null!=p&&(p=p.clone(),p.translate(Math.round(e*Math.max(0,Math.min(1,(m.x-a.x)/a.width))),Math.round(b*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(h[d],p))}}finally{this.model.endUpdate()}}; +Graph.prototype.resizeParentStacks=function(a,d,e,b){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var h=d.horizontal;null!=a&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==h&&!d.resizeLast;){var m=this.getCellGeometry(a),p=this.view.getState(a);null!=p&&null!=m&&(m=m.clone(),d.horizontal?m.width+=e+Math.min(0,p.width/this.view.scale-m.width):m.height+=b+Math.min(0,p.height/this.view.scale-m.height),this.model.setGeometry(a, m));a=this.model.getParent(a);d=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=d.container:"1"==d.container};Graph.prototype.isCellConnectable=function(a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return null!=d.connectable?"0"!=d.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)}; Graph.prototype.selectAll=function(a){a=a||this.getDefaultParent();this.isCellLocked(a)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(a,d,e){e=e||this.getDefaultParent();this.isCellLocked(e)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,d,e){e=e||this.getDefaultParent();return this.isCellLocked(e)?null:mxGraph.prototype.getSwimlaneAt.apply(this,arguments)}; Graph.prototype.isCellFoldable=function(a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return this.foldingEnabled&&!this.isCellLocked(a)&&(this.isContainer(a)&&"0"!=d.collapsible||!this.isContainer(a)&&"1"==d.collapsible)};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()}; Graph.prototype.zoom=function(a,d){a=Math.max(.01,Math.min(this.view.scale*a,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)}; -Graph.prototype.getTooltipForCell=function(a){var d="";if(mxUtils.isNode(a.value)){var e=a.value.getAttribute("tooltip");if(null!=e)null!=e&&this.isReplacePlaceholders(a)&&(e=this.replacePlaceholders(a,e)),d=this.sanitizeHtml(e);else{e=["label","tooltip","placeholders","placeholder"];a=a.value.attributes;var b=[];this.isEnabled()&&e.push("link");for(var k=0;k<a.length;k++)0>mxUtils.indexOf(e,a[k].nodeName)&&0<a[k].nodeValue.length&&b.push({name:a[k].nodeName,value:a[k].nodeValue});b.sort(function(a, -d){return a.name<d.name?-1:a.name>d.name?1:0});for(k=0;k<b.length;k++)"link"==b[k].name&&this.isCustomLink(b[k].value)||(d+=("link"!=b[k].name?b[k].name+":":"")+mxUtils.htmlEntities(b[k].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1))}}return d};Graph.prototype.stringToBytes=function(a){for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=a.charCodeAt(e);return d};Graph.prototype.bytesToString=function(a){for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);return d.join("")}; +Graph.prototype.getTooltipForCell=function(a){var d="";if(mxUtils.isNode(a.value)){var e=a.value.getAttribute("tooltip");if(null!=e)null!=e&&this.isReplacePlaceholders(a)&&(e=this.replacePlaceholders(a,e)),d=this.sanitizeHtml(e);else{e=["label","tooltip","placeholders","placeholder"];a=a.value.attributes;var b=[];this.isEnabled()&&e.push("link");for(var h=0;h<a.length;h++)0>mxUtils.indexOf(e,a[h].nodeName)&&0<a[h].nodeValue.length&&b.push({name:a[h].nodeName,value:a[h].nodeValue});b.sort(function(a, +d){return a.name<d.name?-1:a.name>d.name?1:0});for(h=0;h<b.length;h++)"link"==b[h].name&&this.isCustomLink(b[h].value)||(d+=("link"!=b[h].name?b[h].name+":":"")+mxUtils.htmlEntities(b[h].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1))}}return d};Graph.prototype.stringToBytes=function(a){for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=a.charCodeAt(e);return d};Graph.prototype.bytesToString=function(a){for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);return d.join("")}; Graph.prototype.compress=function(a){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=this.bytesToString(pako.deflateRaw(encodeURIComponent(a)));return window.btoa?btoa(a):Base64.encode(a,!0)};Graph.prototype.decompress=function(a){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=window.atob?atob(a):Base64.decode(a,!0);return this.zapGremlins(decodeURIComponent(this.bytesToString(pako.inflateRaw(a))))}; Graph.prototype.zapGremlins=function(a){for(var d=[],e=0;e<a.length;e++){var b=a.charCodeAt(e);(32<=b||9==b||10==b||13==b)&&d.push(a.charAt(e))}return d.join("")};HoverIcons=function(a){this.graph=a;this.init()};HoverIcons.prototype.arrowSpacing=6;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;HoverIcons.prototype.cssCursor="copy"; HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.triangleUp=mxClient.IS_SVG?Graph.createSvgImage(26,14,'<path d="m 1 14 L 13 1 L 26 14 z" stroke="#fff" fill="#007dfc"/>'):new mxImage(IMAGE_PATH+"/triangle-up.png",26,14);HoverIcons.prototype.triangleRight=mxClient.IS_SVG?Graph.createSvgImage(14,26,'<path d="m 1 1 L 14 13 L 1 26 z" stroke="#fff" fill="#007dfc"/>'):new mxImage(IMAGE_PATH+"/triangle-right.png",14,26); @@ -2273,13 +2274,13 @@ this.activeArrow=e,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redire this.resetActiveArrow()}));return e};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};HoverIcons.prototype.getDirection=function(){var a=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?a=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?a=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(a=mxConstants.DIRECTION_WEST);return a}; HoverIcons.prototype.visitNodes=function(a){for(var d=0;d<this.elts.length;d++)null!=this.elts[d]&&a(this.elts[d])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(a){null!=a.parentNode&&a.parentNode.removeChild(a)})};HoverIcons.prototype.setDisplay=function(a){this.visitNodes(function(d){d.style.display=a})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState}; HoverIcons.prototype.drag=function(a,d,e){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,d,e),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,a=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=a&&a.setHandlesVisible(!1))};HoverIcons.prototype.getStateAt=function(a,d,e){return this.graph.view.getState(this.graph.getCellAt(d,e))}; -HoverIcons.prototype.click=function(a,d,e){var b=e.getEvent(),k=e.getGraphX(),m=e.getGraphY(),k=this.getStateAt(a,k,m);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(b)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,d,this.graph.defaultEdgeLength,b),this.graph.selectCellsForConnectVertex(a,b,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(b)?this.update(this.getState(this.graph.view.getState(a[1]))): -this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a)):(this.graph.setSelectionCell(k.cell),this.reset());e.consume()};HoverIcons.prototype.reset=function(a){null!=a&&!a||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null}; +HoverIcons.prototype.click=function(a,d,e){var b=e.getEvent(),h=e.getGraphX(),m=e.getGraphY(),h=this.getStateAt(a,h,m);null==h||!this.graph.model.isEdge(h.cell)||mxEvent.isControlDown(b)||h.getVisibleTerminalState(!0)!=a&&h.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,d,this.graph.defaultEdgeLength,b),this.graph.selectCellsForConnectVertex(a,b,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(b)?this.update(this.getState(this.graph.view.getState(a[1]))): +this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a)):(this.graph.setSelectionCell(h.cell),this.reset());e.consume()};HoverIcons.prototype.reset=function(a){null!=a&&!a||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null}; HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var a=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(a=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));a.grow(this.graph.tolerance);a.grow(this.arrowSpacing); var d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);null!=d&&(a.x-=d.horizontalOffset/2,a.y-=d.verticalOffset/2,a.width+=d.horizontalOffset,a.height+=d.verticalOffset,null!=d.rotationShape&&null!=d.rotationShape.node&&"hidden"!=d.rotationShape.node.style.visibility&&"none"!=d.rotationShape.node.style.display&&null!=d.rotationShape.boundingBox&&a.add(d.rotationShape.boundingBox));this.arrowUp.style.left=Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance)+ "px";this.arrowUp.style.top=Math.round(a.y-this.triangleUp.height-this.tolerance)+"px";mxUtils.setOpacity(this.arrowUp,this.inactiveOpacity);this.arrowRight.style.left=Math.round(a.x+a.width-this.tolerance)+"px";this.arrowRight.style.top=Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance)+"px";mxUtils.setOpacity(this.arrowRight,this.inactiveOpacity);this.arrowDown.style.left=this.arrowUp.style.left;this.arrowDown.style.top=Math.round(a.y+a.height-this.tolerance)+ "px";mxUtils.setOpacity(this.arrowDown,this.inactiveOpacity);this.arrowLeft.style.left=Math.round(a.x-this.triangleLeft.width-this.tolerance)+"px";this.arrowLeft.style.top=this.arrowRight.style.top;mxUtils.setOpacity(this.arrowLeft,this.inactiveOpacity);if(this.checkCollisions){var d=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()),e=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),b=this.graph.getCellAt(this.currentState.getCenterX(), -a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=d&&d==e&&e==b&&b==a&&(a=b=e=d=null);var k=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,d){var b=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==b||null==k||b.height<6*k.height&&b.width<6*k.width)?d.style.visibility="hidden":d.style.visibility="visible"}); +a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=d&&d==e&&e==b&&b==a&&(a=b=e=d=null);var h=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,d){var b=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==b||null==h||b.height<6*h.height&&b.width<6*h.width)?d.style.visibility="hidden":d.style.visibility="visible"}); m(d,this.arrowRight);m(e,this.arrowLeft);m(b,this.arrowUp);m(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title", mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}}; HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(d){null!=d.parentNode&&(d=new mxRectangle(d.offsetLeft,d.offsetTop,d.offsetWidth,d.offsetHeight),null==a?a=d:a.add(d))});return a}; @@ -2289,23 +2290,23 @@ this.setDisplay("");null!=this.currentState&&this.currentState!=a&&b<this.activa this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a}; (function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,c){var b=this.getState(a);null!=b&&this.graph.model.isEdge(b.cell)&&null!=b.style&&1!=b.style[mxConstants.STYLE_CURVED]&&!b.invalid&&this.updateLineJumps(b)&&this.graph.cellRenderer.redraw(b,!1,this.isRendering());b=d.apply(this,arguments);null!= b&&this.graph.model.isEdge(b.cell)&&1!=b.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(b);return b};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,c){return e.apply(this,arguments)||null!=a.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.routedPoints,a.routedPoints)};var b=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){b.apply(this,arguments);this.graph.model.isEdge(a.cell)&&1!=a.style[mxConstants.STYLE_CURVED]&& -this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var c=a.absolutePoints;if(Graph.lineJumpsEnabled){var d=null!=a.routedPoints,b=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var e=function(c,d,f){var e=new mxPoint(d,f);e.type=c;b.push(e);e=null!=a.routedPoints?a.routedPoints[b.length-1]:null;return null==e||e.type!=c||e.x!=d||e.y!=f},t=.5*this.scale,d=!1,b=[],h=0;h<c.length-1;h++){for(var n=c[h+1],l=c[h],w=[],r=c[h+2];h< -c.length-2&&mxUtils.ptSegDistSq(l.x,l.y,r.x,r.y,n.x,n.y)<1*this.scale*this.scale;)n=r,h++,r=c[h+2];for(var d=e(0,l.x,l.y)||d,k=0;k<this.validEdges.length;k++){var q=this.validEdges[k],z=q.absolutePoints;if(null!=z&&mxUtils.intersects(a,q)&&"1"!=q.style.noJump)for(q=0;q<z.length-1;q++){for(var p=z[q+1],m=z[q],r=z[q+2];q<z.length-2&&mxUtils.ptSegDistSq(m.x,m.y,r.x,r.y,p.x,p.y)<1*this.scale*this.scale;)p=r,q++,r=z[q+2];r=mxUtils.intersection(l.x,l.y,n.x,n.y,m.x,m.y,p.x,p.y);if(null!=r&&(Math.abs(r.x- -m.x)>t||Math.abs(r.y-m.y)>t)&&(Math.abs(r.x-p.x)>t||Math.abs(r.y-p.y)>t)){p=r.x-l.x;m=r.y-l.y;r={distSq:p*p+m*m,x:r.x,y:r.y};for(p=0;p<w.length;p++)if(w[p].distSq>r.distSq){w.splice(p,0,r);r=null;break}null==r||0!=w.length&&w[w.length-1].x===r.x&&w[w.length-1].y===r.y||w.push(r)}}}for(q=0;q<w.length;q++)d=e(1,w[q].x,w[q].y)||d}r=c[c.length-1];d=e(0,r.x,r.y)||d}a.routedPoints=b;return d}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,d){this.routedPoints= -null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),h,n=!0,l=null,w=null;h=[];var r=null;a.begin();for(var y=0;y<this.state.routedPoints.length;y++){var q= -this.state.routedPoints[y],z=new mxPoint(q.x/this.scale,q.y/this.scale);0==y?z=c[0]:y==this.state.routedPoints.length-1&&(z=c[c.length-1]);var p=!1;if(null!=l&&1==q.type){var m=this.state.routedPoints[y+1],q=m.x/this.scale-z.x,m=m.y/this.scale-z.y,q=q*q+m*m;null==r&&(r=new mxPoint(z.x-l.x,z.y-l.y),w=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/w,r.y=r.y*f/w);q>f*f&&0<w&&(q=l.x-z.x,m=l.y-z.y,q=q*q+m*m,q>f*f&&(p=new mxPoint(z.x-r.x,z.y-r.y),q=new mxPoint(z.x+r.x,z.y+r.y),h.push(p),this.addPoints(a,h,d,b,!1, -null,n),h=0>Math.round(r.x)||0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,n=!1,"sharp"==e?(a.lineTo(p.x-r.y*h,p.y+r.x*h),a.lineTo(q.x-r.y*h,q.y+r.x*h),a.lineTo(q.x,q.y)):"arc"==e?(h*=1.3,a.curveTo(p.x-r.y*h,p.y+r.x*h,q.x-r.y*h,q.y+r.x*h,q.x,q.y)):(a.moveTo(q.x,q.y),n=!0),h=[q],p=!0))}else r=null;p||(h.push(z),l=z)}this.addPoints(a,h,d,b,!1,null,n);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,c,d,b){if(null==c||null== -a||"1"!=c.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{c=this.getTerminalPort(a,c,b);var f=this.getNextPoint(a,d,b),e=this.graph.isOrthogonal(a),g=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),n=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=g)var l=Math.cos(-g),w=Math.sin(-g),f=mxUtils.getRotatedPoint(f,l,w,n);l=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);l+=parseFloat(a.style[b?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| -0);f=this.getPerimeterPoint(c,f,0==g&&e,l);0!=g&&(l=Math.cos(g),w=Math.sin(g),f=mxUtils.getRotatedPoint(f,l,w,n));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,c,d,b,f),b)}};mxGraphView.prototype.snapToAnchorPoint=function(a,c,d,b,e){if(null!=c&&null!=a){a=this.graph.getAllConnectionConstraints(c);b=d=null;if(null!=a)for(var f=0;f<a.length;f++){var g=this.graph.getConnectionPoint(c,a[f]);if(null!=g){var n=(g.x-e.x)*(g.x-e.x)+(g.y-e.y)*(g.y-e.y);if(null==b||n<b)d=g,b=n}}null!=d&&(e=d)}return e}; +this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var c=a.absolutePoints;if(Graph.lineJumpsEnabled){var d=null!=a.routedPoints,b=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var e=function(c,d,f){var e=new mxPoint(d,f);e.type=c;b.push(e);e=null!=a.routedPoints?a.routedPoints[b.length-1]:null;return null==e||e.type!=c||e.x!=d||e.y!=f},t=.5*this.scale,d=!1,b=[],l=0;l<c.length-1;l++){for(var n=c[l+1],k=c[l],w=[],r=c[l+2];l< +c.length-2&&mxUtils.ptSegDistSq(k.x,k.y,r.x,r.y,n.x,n.y)<1*this.scale*this.scale;)n=r,l++,r=c[l+2];for(var d=e(0,k.x,k.y)||d,h=0;h<this.validEdges.length;h++){var q=this.validEdges[h],z=q.absolutePoints;if(null!=z&&mxUtils.intersects(a,q)&&"1"!=q.style.noJump)for(q=0;q<z.length-1;q++){for(var p=z[q+1],m=z[q],r=z[q+2];q<z.length-2&&mxUtils.ptSegDistSq(m.x,m.y,r.x,r.y,p.x,p.y)<1*this.scale*this.scale;)p=r,q++,r=z[q+2];r=mxUtils.intersection(k.x,k.y,n.x,n.y,m.x,m.y,p.x,p.y);if(null!=r&&(Math.abs(r.x- +m.x)>t||Math.abs(r.y-m.y)>t)&&(Math.abs(r.x-p.x)>t||Math.abs(r.y-p.y)>t)){p=r.x-k.x;m=r.y-k.y;r={distSq:p*p+m*m,x:r.x,y:r.y};for(p=0;p<w.length;p++)if(w[p].distSq>r.distSq){w.splice(p,0,r);r=null;break}null==r||0!=w.length&&w[w.length-1].x===r.x&&w[w.length-1].y===r.y||w.push(r)}}}for(q=0;q<w.length;q++)d=e(1,w[q].x,w[q].y)||d}r=c[c.length-1];d=e(0,r.x,r.y)||d}a.routedPoints=b;return d}return!1};var h=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,d){this.routedPoints= +null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)h.apply(this,arguments);else{var b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,f=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),l,n=!0,k=null,w=null;l=[];var r=null;a.begin();for(var y=0;y<this.state.routedPoints.length;y++){var q= +this.state.routedPoints[y],z=new mxPoint(q.x/this.scale,q.y/this.scale);0==y?z=c[0]:y==this.state.routedPoints.length-1&&(z=c[c.length-1]);var p=!1;if(null!=k&&1==q.type){var m=this.state.routedPoints[y+1],q=m.x/this.scale-z.x,m=m.y/this.scale-z.y,q=q*q+m*m;null==r&&(r=new mxPoint(z.x-k.x,z.y-k.y),w=Math.sqrt(r.x*r.x+r.y*r.y),r.x=r.x*f/w,r.y=r.y*f/w);q>f*f&&0<w&&(q=k.x-z.x,m=k.y-z.y,q=q*q+m*m,q>f*f&&(p=new mxPoint(z.x-r.x,z.y-r.y),q=new mxPoint(z.x+r.x,z.y+r.y),l.push(p),this.addPoints(a,l,d,b,!1, +null,n),l=0>Math.round(r.x)||0==Math.round(r.x)&&0>=Math.round(r.y)?1:-1,n=!1,"sharp"==e?(a.lineTo(p.x-r.y*l,p.y+r.x*l),a.lineTo(q.x-r.y*l,q.y+r.x*l),a.lineTo(q.x,q.y)):"arc"==e?(l*=1.3,a.curveTo(p.x-r.y*l,p.y+r.x*l,q.x-r.y*l,q.y+r.x*l,q.x,q.y)):(a.moveTo(q.x,q.y),n=!0),l=[q],p=!0))}else r=null;p||(l.push(z),k=z)}this.addPoints(a,l,d,b,!1,null,n);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,c,d,b){if(null==c||null== +a||"1"!=c.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{c=this.getTerminalPort(a,c,b);var f=this.getNextPoint(a,d,b),e=this.graph.isOrthogonal(a),g=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),n=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=g)var k=Math.cos(-g),w=Math.sin(-g),f=mxUtils.getRotatedPoint(f,k,w,n);k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[b?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| +0);f=this.getPerimeterPoint(c,f,0==g&&e,k);0!=g&&(k=Math.cos(g),w=Math.sin(g),f=mxUtils.getRotatedPoint(f,k,w,n));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,c,d,b,f),b)}};mxGraphView.prototype.snapToAnchorPoint=function(a,c,d,b,e){if(null!=c&&null!=a){a=this.graph.getAllConnectionConstraints(c);b=d=null;if(null!=a)for(var f=0;f<a.length;f++){var g=this.graph.getConnectionPoint(c,a[f]);if(null!=g){var n=(g.x-e.x)*(g.x-e.x)+(g.y-e.y)*(g.y-e.y);if(null==b||n<b)d=g,b=n}}null!=d&&(e=d)}return e}; var p=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,c,d){var b=p.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=d.state&&(b=d.state.view.graph.replacePlaceholders(d.state.cell,b));return b};var q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var c=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=c&&"stencil("==c.substring(0,8))try{var d= c.substring(8,c.length-1),b=mxUtils.parseXml(a.view.graph.decompress(d));return new mxShape(new mxStencil(b.documentElement))}catch(u){null!=window.console&&console.log("Error in shape: "+u)}}return q.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[]; -mxStencilRegistry.getStencil=function(a){var d=mxStencilRegistry.stencils[a];if(null==d&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){d=mxStencilRegistry.libraries[e];if(null!=d){if(null==mxStencilRegistry.packages[e]){for(var b=0;b<d.length;b++){var k=d[b];if(".xml"==k.toLowerCase().substring(k.length-4,k.length))mxStencilRegistry.loadStencilSet(k,null);else if(".js"==k.toLowerCase().substring(k.length-3,k.length))try{if(mxStencilRegistry.allowEval){var m= -mxUtils.load(k);null!=m&&200<=m.getStatus()&&299>=m.getStatus()&&eval.call(window,m.getText())}}catch(p){null!=window.console&&console.log("error in getStencil:",k,p)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);d=mxStencilRegistry.stencils[a]}}return d}; +mxStencilRegistry.getStencil=function(a){var d=mxStencilRegistry.stencils[a];if(null==d&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){d=mxStencilRegistry.libraries[e];if(null!=d){if(null==mxStencilRegistry.packages[e]){for(var b=0;b<d.length;b++){var h=d[b];if(".xml"==h.toLowerCase().substring(h.length-4,h.length))mxStencilRegistry.loadStencilSet(h,null);else if(".js"==h.toLowerCase().substring(h.length-3,h.length))try{if(mxStencilRegistry.allowEval){var m= +mxUtils.load(h);null!=m&&200<=m.getStatus()&&299>=m.getStatus()&&eval.call(window,m.getText())}}catch(p){null!=window.console&&console.log("error in getStencil:",h,p)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);d=mxStencilRegistry.stencils[a]}}return d}; mxStencilRegistry.getBasenameForStencil=function(a){var d=null;if(null!=a&&(a=a.split("."),0<a.length&&"mxgraph"==a[0]))for(var d=a[1],e=2;e<a.length-1;e++)d+="/"+a[e];return d}; -mxStencilRegistry.loadStencilSet=function(a,d,e,b){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var m=!1;if(null==k)try{if(b){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(b){null!=b&&null!=b.documentElement&&(mxStencilRegistry.packages[a]=b,m=!0,mxStencilRegistry.parseStencilSet(b.documentElement,d,m))}));return}k=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=k;m=!0}catch(p){null!=window.console&&console.log("error in loadStencilSet:",a,p)}null!=k&&null!= -k.documentElement&&mxStencilRegistry.parseStencilSet(k.documentElement,d,m)}};mxStencilRegistry.loadStencil=function(a,d){if(null!=d)mxUtils.get(a,mxUtils.bind(this,function(a){d(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var d=0;d<a.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[d]).documentElement)}; -mxStencilRegistry.parseStencilSet=function(a,d,e){if("stencils"==a.nodeName)for(var b=a.firstChild;null!=b;)"shapes"==b.nodeName&&mxStencilRegistry.parseStencilSet(b,d,e),b=b.nextSibling;else{e=null!=e?e:!0;var b=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=b;){if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=b.getAttribute("name"),null!=a)){var k=k.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+m.toLowerCase(),new mxStencil(b));if(null!=d){var p=b.getAttribute("w"), -q=b.getAttribute("h"),p=null==p?80:parseInt(p,10),q=null==q?80:parseInt(q,10);d(k,m,a,p,q)}}b=b.nextSibling}}}; +mxStencilRegistry.loadStencilSet=function(a,d,e,b){var h=mxStencilRegistry.packages[a];if(null!=e&&e||null==h){var m=!1;if(null==h)try{if(b){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(b){null!=b&&null!=b.documentElement&&(mxStencilRegistry.packages[a]=b,m=!0,mxStencilRegistry.parseStencilSet(b.documentElement,d,m))}));return}h=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=h;m=!0}catch(p){null!=window.console&&console.log("error in loadStencilSet:",a,p)}null!=h&&null!= +h.documentElement&&mxStencilRegistry.parseStencilSet(h.documentElement,d,m)}};mxStencilRegistry.loadStencil=function(a,d){if(null!=d)mxUtils.get(a,mxUtils.bind(this,function(a){d(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var d=0;d<a.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[d]).documentElement)}; +mxStencilRegistry.parseStencilSet=function(a,d,e){if("stencils"==a.nodeName)for(var b=a.firstChild;null!=b;)"shapes"==b.nodeName&&mxStencilRegistry.parseStencilSet(b,d,e),b=b.nextSibling;else{e=null!=e?e:!0;var b=a.firstChild,h="";a=a.getAttribute("name");for(null!=a&&(h=a+".");null!=b;){if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=b.getAttribute("name"),null!=a)){var h=h.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(h+m.toLowerCase(),new mxStencil(b));if(null!=d){var p=b.getAttribute("w"), +q=b.getAttribute("h"),p=null==p?80:parseInt(p,10),q=null==q?80:parseInt(q,10);d(h,m,a,p,q)}}b=b.nextSibling}}}; "undefined"!=typeof mxVertexHandler&&function(){function a(){var a=document.createElement("div");a.className="geHint";a.style.whiteSpace="nowrap";a.style.position="absolute";return a}mxConstants.HANDLE_FILLCOLOR="#99ccff";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR= "#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_OPACITY=30;mxConstants.HIGHLIGHT_SIZE=8;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(a){return!mxEvent.isAltDown(a)};var d=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(a){return mxEvent.isControlDown(a)|| d.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxEllipse(null,this.highlightColor,this.highlightColor,0);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(a){a=this.graph.createCurrentEdgeStyle();a=this.graph.createEdge(null,null,null,null,null,a);a=new mxCellState(this.graph.view,a,this.graph.getCellStyle(a)); @@ -2313,16 +2314,16 @@ for(var c in this.graph.currentEdgeStyle)a.style[c]=this.graph.currentEdgeStyle[ a.getCell=mxUtils.bind(this,function(a){var d=c.apply(this,arguments);this.error=null;return d});return a};mxConnectionHandler.prototype.isCellEnabled=function(a){return!this.graph.isCellLocked(a)};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){var a="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";";null!=this.currentEdgeStyle.shape&& (a+="shape="+this.currentEdgeStyle.shape+";");null!=this.currentEdgeStyle.curved&&(a+="curved="+this.currentEdgeStyle.curved+";");null!=this.currentEdgeStyle.rounded&&(a+="rounded="+this.currentEdgeStyle.rounded+";");null!=this.currentEdgeStyle.comic&&(a+="comic="+this.currentEdgeStyle.comic+";");null!=this.currentEdgeStyle.jumpStyle&&(a+="jumpStyle="+this.currentEdgeStyle.jumpStyle+";");null!=this.currentEdgeStyle.jumpSize&&(a+="jumpSize="+this.currentEdgeStyle.jumpSize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&& null!=this.currentEdgeStyle.elbow&&(a+="elbow="+this.currentEdgeStyle.elbow+";");return a=null!=this.currentEdgeStyle.html?a+("html="+this.currentEdgeStyle.html+";"):a+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var a=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=a&&(new mxCodec(a.ownerDocument)).decode(a,this.getStylesheet())}; -Graph.prototype.importGraphModel=function(a,c,d,b){c=null!=c?c:0;d=null!=d?d:0;var f=[],e=new mxGraphModel;(new mxCodec(a.ownerDocument)).decode(a,e);a=e.getChildCount(e.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var g={},l=0;l<a;l++){var h=e.getChildAt(e.getRoot(),l);if(1!=a||this.isCellLocked(this.getDefaultParent()))h=this.importCells([h],0,0,this.model.getRoot(),null,g)[0],r=this.model.getChildren(h),this.moveCells(r,c,d),f=f.concat(r);else var r= -e.getChildren(h),f=f.concat(this.importCells(r,c,d,this.getDefaultParent(),null,g))}if(b){this.isGridEnabled()&&(c=this.snap(c),d=this.snap(d));var n=this.getBoundingBoxFromGeometry(f,!0);null!=n&&this.moveCells(f,c-n.x,d-n.y)}}finally{this.model.endUpdate()}return f};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var d=mxUtils.getValue(a.style,"points",null);if(null!=d){var b=[];try{for(var f=JSON.parse(d),d=0;d<f.length;d++){var e=f[d];b.push(new mxConnectionConstraint(new mxPoint(e[0], +Graph.prototype.importGraphModel=function(a,c,d,b){c=null!=c?c:0;d=null!=d?d:0;var f=[],e=new mxGraphModel;(new mxCodec(a.ownerDocument)).decode(a,e);a=e.getChildCount(e.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var g={},k=0;k<a;k++){var l=e.getChildAt(e.getRoot(),k);if(1!=a||this.isCellLocked(this.getDefaultParent()))l=this.importCells([l],0,0,this.model.getRoot(),null,g)[0],r=this.model.getChildren(l),this.moveCells(r,c,d),f=f.concat(r);else var r= +e.getChildren(l),f=f.concat(this.importCells(r,c,d,this.getDefaultParent(),null,g))}if(b){this.isGridEnabled()&&(c=this.snap(c),d=this.snap(d));var n=this.getBoundingBoxFromGeometry(f,!0);null!=n&&this.moveCells(f,c-n.x,d-n.y)}}finally{this.model.endUpdate()}return f};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var d=mxUtils.getValue(a.style,"points",null);if(null!=d){var b=[];try{for(var f=JSON.parse(d),d=0;d<f.length;d++){var e=f[d];b.push(new mxConnectionConstraint(new mxPoint(e[0], e[1]),2<e.length?"0"!=e[2]:!0))}}catch(O){}return b}if(null!=a.shape)if(null!=a.shape.stencil){if(null!=a.shape.stencil)return a.shape.stencil.constraints}else if(null!=a.shape.constraints)return a.shape.constraints}return null};Graph.prototype.flipEdge=function(a){if(null!=a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);null!=c&&(c=mxUtils.getValue(c,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL, this.setCellStyles(mxConstants.STYLE_ELBOW,c,[a]))}};Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),d=0,b=0;b<c;b++){var f=this.model.getChildAt(a,b);this.model.isVertex(f)&&(f=this.getCellGeometry(f),null==f||f.relative||d++)}return 0<d||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this, arguments)&&"0"!=mxUtils.getValue(c,"dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=this.layoutManager){var d=this.model.getParent(a);null!=d&&(d=this.layoutManager.getLayout(d),null!=d&&d.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell= -function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),d=[];c.beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(c.isEdge(f)){var e=c.getTerminal(f,!0),g=c.getTerminal(f,!1);c.setTerminal(f,g,!0);c.setTerminal(f,e,!1);var l=c.getGeometry(f);if(null!=l){l=l.clone();null!=l.points&&l.points.reverse(); -var h=l.getTerminalPoint(!0),r=l.getTerminalPoint(!1);l.setTerminalPoint(h,!1);l.setTerminalPoint(r,!0);c.setGeometry(f,l);var n=this.view.getState(f),u=this.view.getState(e),t=this.view.getState(g);if(null!=n){var w=null!=u?this.getConnectionConstraint(n,u,!0):null,Q=null!=t?this.getConnectionConstraint(n,t,!1):null;this.setConnectionConstraint(f,e,!0,Q);this.setConnectionConstraint(f,g,!1,w)}d.push(f)}}else if(c.isVertex(f)&&(l=this.getCellGeometry(f),null!=l)){l=l.clone();l.x+=l.width/2-l.height/ -2;l.y+=l.height/2-l.width/2;var q=l.width;l.width=l.height;l.height=q;c.setGeometry(f,l);var k=this.view.getState(f);if(null!=k){var y=k.style[mxConstants.STYLE_DIRECTION]||"east";"east"==y?y="south":"south"==y?y="west":"west"==y?y="north":"north"==y&&(y="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,y,[f])}d.push(f)}}}finally{c.endUpdate()}return d};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&& +function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),d=[];c.beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(c.isEdge(f)){var e=c.getTerminal(f,!0),g=c.getTerminal(f,!1);c.setTerminal(f,g,!0);c.setTerminal(f,e,!1);var k=c.getGeometry(f);if(null!=k){k=k.clone();null!=k.points&&k.points.reverse(); +var l=k.getTerminalPoint(!0),r=k.getTerminalPoint(!1);k.setTerminalPoint(l,!1);k.setTerminalPoint(r,!0);c.setGeometry(f,k);var n=this.view.getState(f),u=this.view.getState(e),t=this.view.getState(g);if(null!=n){var w=null!=u?this.getConnectionConstraint(n,u,!0):null,Q=null!=t?this.getConnectionConstraint(n,t,!1):null;this.setConnectionConstraint(f,e,!0,Q);this.setConnectionConstraint(f,g,!1,w)}d.push(f)}}else if(c.isVertex(f)&&(k=this.getCellGeometry(f),null!=k)){k=k.clone();k.x+=k.width/2-k.height/ +2;k.y+=k.height/2-k.width/2;var q=k.width;k.width=k.height;k.height=q;c.setGeometry(f,k);var h=this.view.getState(f);if(null!=h){var y=h.style[mxConstants.STYLE_DIRECTION]||"east";"east"==y?y="south":"south"==y?y="west":"west"==y?y="north":"north"==y&&(y="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,y,[f])}d.push(f)}}}finally{c.endUpdate()}return d};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&& null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);if(0<c.length)for(var d=0;d<c.length;d++)this.isReplacePlaceholders(c[d])&&this.view.invalidate(c[d],!1,!1)}};Graph.prototype.replaceElement=function(a,c){for(var d=a.ownerDocument.createElement(null!=c?c:"span"),b=Array.prototype.slice.call(a.attributes);attr=b.pop();)d.setAttribute(attr.nodeName,attr.nodeValue);d.innerHTML=a.innerHTML;a.parentNode.replaceChild(d,a)};Graph.prototype.updateLabelElements=function(a, -c,d){a=null!=a?a:this.getSelectionCells();for(var b=document.createElement("div"),f=0;f<a.length;f++)if(this.isHtmlLabel(a[f])){var e=this.convertValueToString(a[f]);if(null!=e&&0<e.length){b.innerHTML=e;for(var g=b.getElementsByTagName(null!=d?d:"*"),l=0;l<g.length;l++)c(g[l]);b.innerHTML!=e&&this.cellLabelChanged(a[f],b.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,c,d){c=this.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&& +c,d){a=null!=a?a:this.getSelectionCells();for(var b=document.createElement("div"),f=0;f<a.length;f++)if(this.isHtmlLabel(a[f])){var e=this.convertValueToString(a[f]);if(null!=e&&0<e.length){b.innerHTML=e;for(var g=b.getElementsByTagName(null!=d?d:"*"),k=0;k<g.length;k++)c(g[k]);b.innerHTML!=e&&this.cellLabelChanged(a[f],b.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,c,d){c=this.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&& null!=a.getAttribute("placeholder"))for(var b=a.getAttribute("placeholder"),f=a;null!=f;){if(f==this.model.getRoot()||null!=f.value&&"object"==typeof f.value&&f.hasAttribute(b)){this.setAttributeForCell(f,b,c);break}f=this.model.getParent(f)}var e=a.value.cloneNode(!0);e.setAttribute("label",c);c=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=new mxDictionary,d=0;d<a.length;d++)c.put(a[d],!0); for(var b=[],d=0;d<a.length;d++){var f=this.model.getParent(a[d]);null==f||c.get(f)||(c.put(f,!0),b.push(f))}for(d=0;d<b.length;d++)if(f=this.view.getState(b[d]),null!=f&&(this.model.isEdge(f.cell)||this.model.isVertex(f.cell))&&this.isCellDeletable(f.cell)){var e=mxUtils.getValue(f.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(f.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&g==mxConstants.NONE){e=!0;for(g=0;g<this.model.getChildCount(f.cell)&& e;g++)c.get(this.model.getChildAt(f.cell,g))||(e=!1);e&&a.push(f.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],d=0;d<a.length;d++)if(this.isCellDeletable(a[d])){var b=this.view.getState(a[d]);if(null!=b){var f=mxUtils.getValue(b.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),b=mxUtils.getValue(b.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);f==mxConstants.NONE&&b==mxConstants.NONE&&c.push(a[d])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this, @@ -2333,24 +2334,24 @@ if(null!=a&&!this.model.isVertex(c)){var b=this.model.isEdge(c)?this.view.getSta c=this.getGraphBounds(),d=this.getInsertPoint(),b=this.snap(Math.round(Math.max(d.x,c.x/a.scale-a.translate.x+(0==c.width?2*this.gridSize:0)))),a=this.snap(Math.round(Math.max(d.y,(c.y+c.height)/a.scale-a.translate.y+2*this.gridSize)));return new mxPoint(b,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,d){var b=new mxCell;b.value="Text";b.style="text;html=1;resizable=0;points=[];";b.geometry=new mxGeometry(0,0,0,0);b.vertex=!0;if(null!=d){b.style+= "align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";b.geometry.relative=!0;b.connectable=!1;var f=this.view.getRelativePoint(d,a,c);b.geometry.x=Math.round(1E4*f.x)/1E4;b.geometry.y=Math.round(f.y);b.geometry.offset=new mxPoint(0,0);var f=this.view.getPoint(d,b.geometry),e=this.view.scale;b.geometry.offset=new mxPoint(Math.round((a-f.x)/e),Math.round((c-f.y)/e))}else b.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",f=this.view.translate,b.geometry.width=40,b.geometry.height= 20,b.geometry.x=Math.round(a/this.view.scale)-f.x,b.geometry.y=Math.round(c/this.view.scale)-f.y;this.getModel().beginUpdate();try{this.addCells([b],null!=d?d.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[b])),this.autoSizeCell(b)}finally{this.getModel().endUpdate()}return b};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.addClickHandler= -function(a,c,d){var b=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var d=0;d<a.length;d++){var b=this.getAbsoluteUrl(a[d].getAttribute("href"));null!=b&&(a[d].setAttribute("href",b),null!=c&&mxEvent.addGestureListeners(a[d],null,null,c))}});this.model.addListener(mxEvent.CHANGE,b);b();var f=this.container.style.cursor,e=this.getTolerance(),g=this,l={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g, +function(a,c,d){var b=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var d=0;d<a.length;d++){var b=this.getAbsoluteUrl(a[d].getAttribute("href"));null!=b&&(a[d].setAttribute("href",b),null!=c&&mxEvent.addGestureListeners(a[d],null,null,c))}});this.model.addListener(mxEvent.CHANGE,b);b();var f=this.container.style.cursor,e=this.getTolerance(),g=this,k={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g, a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){var c=a.sourceState;if(null==c||null==g.getLinkForCell(c.cell))a=g.getCellAt(a.getGraphX(),a.getGraphY(),null,null,null,function(a,c,d){return null==g.getLinkForCell(a.cell)}),c=g.view.getState(a);c!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=c,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(a,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft= g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(c)},mouseMove:function(a,c){if(g.isMouseDown){if(null!=this.currentLink){var d=Math.abs(this.startX-c.getGraphX()),b=Math.abs(this.startY-c.getGraphY());(d>e||b>e)&&this.clear()}}else{for(d=c.getSource();null!=d&&"a"!=d.nodeName.toLowerCase();)d=d.parentNode;null!=d?this.clear():(null!=g.tooltipHandler&&null!=this.currentLink&& -null!=this.currentState&&g.tooltipHandler.reset(c,!0,this.currentState),(null==this.currentState||c.getState()!=this.currentState&&null!=c.sourceState||!g.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c))}},mouseUp:function(a,b){for(var f=b.getSource(),l=b.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==b.sourceState||!b.isSource(b.sourceState.control))&& -((mxEvent.isLeftMouseButton(l)||mxEvent.isMiddleMouseButton(l))&&!mxEvent.isPopupTrigger(l)||mxEvent.isTouchEvent(l))&&(null!=this.currentLink?(f=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==c||c(l,this.currentLink),mxEvent.isConsumed(l)||(l=mxEvent.isMiddleMouseButton(l)?"_blank":f?g.linkTarget:"_top",g.openLink(this.currentLink,l),b.consume())):null!=d&&!b.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)< +null!=this.currentState&&g.tooltipHandler.reset(c,!0,this.currentState),(null==this.currentState||c.getState()!=this.currentState&&null!=c.sourceState||!g.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c))}},mouseUp:function(a,b){for(var f=b.getSource(),k=b.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==b.sourceState||!b.isSource(b.sourceState.control))&& +((mxEvent.isLeftMouseButton(k)||mxEvent.isMiddleMouseButton(k))&&!mxEvent.isPopupTrigger(k)||mxEvent.isTouchEvent(k))&&(null!=this.currentLink?(f=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==c||c(k,this.currentLink),mxEvent.isConsumed(k)||(k=mxEvent.isMiddleMouseButton(k)?"_blank":f?g.linkTarget:"_top",g.openLink(this.currentLink,k),b.consume())):null!=d&&!b.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)< e&&Math.abs(this.startX-b.getGraphX())<e&&Math.abs(this.startY-b.getGraphY())<e&&d(b.getEvent()));this.clear()},activate:function(a){this.currentLink=g.getAbsoluteUrl(g.getLinkForCell(a.cell));null!=this.currentLink&&(g.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=g.container&&(g.container.style.cursor=f);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide();null!=g.tooltipHandler&&g.tooltipHandler.hide()}}; -g.click=function(a){};g.addMouseListener(l);mxEvent.addListener(document,"mouseleave",function(a){l.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var d=this.getModel(),b=this.gridSize,f=[];d.beginUpdate();try{for(var e=this.cloneCells(a,!1),g=0;g<a.length;g++){var l=d.getParent(a[g]),h=this.moveCells([e[g]],b,b,!1)[0];f.push(h);if(c)d.add(l,e[g]);else{var r=l.getIndex(a[g]);d.add(l,e[g],r+1)}}}finally{d.endUpdate()}return f}; +g.click=function(a){};g.addMouseListener(k);mxEvent.addListener(document,"mouseleave",function(a){k.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var d=this.getModel(),b=this.gridSize,f=[];d.beginUpdate();try{for(var e=this.cloneCells(a,!1),g=0;g<a.length;g++){var k=d.getParent(a[g]),l=this.moveCells([e[g]],b,b,!1)[0];f.push(l);if(c)d.add(k,e[g]);else{var r=k.getIndex(a[g]);d.add(k,e[g],r+1)}}}finally{d.endUpdate()}return f}; Graph.prototype.insertImage=function(a,c,d){if(null!=a){for(var b=this.cellEditor.textarea.getElementsByTagName("img"),f=[],e=0;e<b.length;e++)f.push(b[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==f.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=f[e-1]){a[e].setAttribute("width",c);a[e].setAttribute("height",d);break}}};Graph.prototype.insertLink=function(a){0==a.length?document.execCommand("unlink",!1):document.execCommand("createlink", !1,mxUtils.trim(a))};Graph.prototype.isCellResizable=function(a){var c=mxGraph.prototype.isCellResizable.apply(this,arguments),d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return c||"0"!=mxUtils.getValue(d,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==d[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,c){null==c&&(c=this.getSelectionCells());if(null!=c&&1<c.length){for(var d=[],b=null,f=null,e=0;e<c.length;e++)if(this.getModel().isVertex(c[e])){var g=this.view.getState(c[e]); -if(null!=g){var l=a?g.getCenterX():g.getCenterY(),b=null!=b?Math.max(b,l):l,f=null!=f?Math.min(f,l):l;d.push(g)}}if(2<d.length){d.sort(function(c,d){return a?c.x-d.x:c.y-d.y});g=this.view.translate;l=this.view.scale;f=f/l-(a?g.x:g.y);b=b/l-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var h=(b-f)/(d.length-1),b=f,e=1;e<d.length-1;e++){var r=this.view.getState(this.model.getParent(d[e].cell)),n=this.getCellGeometry(d[e].cell),b=b+h;null!=n&&null!=r&&(n=n.clone(),a?n.x=Math.round(b-n.width/2)-r.origin.x: +if(null!=g){var k=a?g.getCenterX():g.getCenterY(),b=null!=b?Math.max(b,k):k,f=null!=f?Math.min(f,k):k;d.push(g)}}if(2<d.length){d.sort(function(c,d){return a?c.x-d.x:c.y-d.y});g=this.view.translate;k=this.view.scale;f=f/k-(a?g.x:g.y);b=b/k-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var l=(b-f)/(d.length-1),b=f,e=1;e<d.length-1;e++){var r=this.view.getState(this.model.getParent(d[e].cell)),n=this.getCellGeometry(d[e].cell),b=b+l;null!=n&&null!=r&&(n=n.clone(),a?n.x=Math.round(b-n.width/2)-r.origin.x: n.y=Math.round(b-n.height/2)-r.origin.y,this.getModel().setGeometry(d[e].cell,n))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var c=this.cloneCells(a),d=new mxDictionary,b=0;b<a.length;b++)d.put(a[b],!0);for(b=0;b<c.length;b++){var f=this.view.getState(a[b]);if(null!=f){var e=this.getCellGeometry(c[b]);null==e||!e.relative||this.model.isEdge(a[b])|| -d.get(this.model.getParent(a[b]))||(e.relative=!1,e.x=f.x/f.view.scale-f.view.translate.x,e.y=f.y/f.view.scale-f.view.translate.y)}}d=new mxCodec;f=new mxGraphModel;e=f.getChildAt(f.getRoot(),0);for(b=0;b<a.length;b++)f.add(e,c[b]);return d.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,d,b,f,e,g,l){c=null!=c?c:1;d=null!=d?d:0; -f=null!=f?f:!0;e=null!=e?e:!0;g=null!=g?g:!0;b=e||b?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==b)throw Error(mxResources.get("drawingEmpty"));var h=this.view.scale,n=mxUtils.createXmlDocument(),r=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=r.style?r.style.backgroundColor=a:r.setAttribute("style","background-color:"+a));null==n.createElementNS?(r.setAttribute("xmlns",mxConstants.NS_SVG),r.setAttribute("xmlns:xlink", -mxConstants.NS_XLINK)):r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/h;r.setAttribute("width",Math.max(1,Math.ceil(b.width*a)+2*d)+"px");r.setAttribute("height",Math.max(1,Math.ceil(b.height*a)+2*d)+"px");r.setAttribute("version","1.1");var u=r;f&&(u=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),u.setAttribute("transform","translate(0.5,0.5)"),r.appendChild(u));n.appendChild(r);n=this.createSvgCanvas(u);n.foOffset= -f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((d/c-b.x)/h),Math.floor((d/c-b.y)/h));var t=document.createElement("textarea"),w=n.createAlternateContent;n.createAlternateContent=function(a,c,d,b,f,e,g,l,h,n,r,u,q){var k=this.state;if(null!=this.foAltText&&(0==b||0!=k.fontSize&&e.length<5*b/k.fontSize)){var y=this.createElement("text");y.setAttribute("x",Math.round(b/2));y.setAttribute("y",Math.round((f+k.fontSize)/2));y.setAttribute("fill",k.fontColor||"black");y.setAttribute("text-anchor", -"middle");y.setAttribute("font-size",Math.round(k.fontSize)+"px");y.setAttribute("font-family",k.fontFamily);(k.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold");(k.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");(k.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.setAttribute("text-decoration","underline");try{return t.innerHTML=e,y.textContent=t.value,y}catch(Ba){return w.apply(this, -arguments)}}else return w.apply(this,arguments)};d=this.backgroundImage;null!=d&&(f=h/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,d.width*f,d.height*f),mxUtils.intersects(b,f)&&n.image(c.x,c.y,d.width,d.height,d.src,!0));n.scale(a);n.textEnabled=g;l=null!=l?l:this.createSvgImageExport();var q=l.drawCellState;l.drawCellState=function(a,c){for(var d=a.view.graph,b=d.isCellSelected(a.cell),f=d.model.getParent(a.cell);!e&&!b&&null!=f;)b=d.isCellSelected(f),f=d.model.getParent(f);(e||b)&&q.apply(this, -arguments)};l.drawState(this.getView().getState(this.model.root),n);return r};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,d){for(;null!=a&&a.nodeName!=c;){if(a== +d.get(this.model.getParent(a[b]))||(e.relative=!1,e.x=f.x/f.view.scale-f.view.translate.x,e.y=f.y/f.view.scale-f.view.translate.y)}}d=new mxCodec;f=new mxGraphModel;e=f.getChildAt(f.getRoot(),0);for(b=0;b<a.length;b++)f.add(e,c[b]);return d.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,d,b,f,e,g,k){c=null!=c?c:1;d=null!=d?d:0; +f=null!=f?f:!0;e=null!=e?e:!0;g=null!=g?g:!0;b=e||b?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==b)throw Error(mxResources.get("drawingEmpty"));var l=this.view.scale,n=mxUtils.createXmlDocument(),r=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=r.style?r.style.backgroundColor=a:r.setAttribute("style","background-color:"+a));null==n.createElementNS?(r.setAttribute("xmlns",mxConstants.NS_SVG),r.setAttribute("xmlns:xlink", +mxConstants.NS_XLINK)):r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/l;r.setAttribute("width",Math.max(1,Math.ceil(b.width*a)+2*d)+"px");r.setAttribute("height",Math.max(1,Math.ceil(b.height*a)+2*d)+"px");r.setAttribute("version","1.1");var u=r;f&&(u=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),u.setAttribute("transform","translate(0.5,0.5)"),r.appendChild(u));n.appendChild(r);n=this.createSvgCanvas(u);n.foOffset= +f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((d/c-b.x)/l),Math.floor((d/c-b.y)/l));var t=document.createElement("textarea"),w=n.createAlternateContent;n.createAlternateContent=function(a,c,d,b,f,e,g,k,l,n,r,u,q){var h=this.state;if(null!=this.foAltText&&(0==b||0!=h.fontSize&&e.length<5*b/h.fontSize)){var y=this.createElement("text");y.setAttribute("x",Math.round(b/2));y.setAttribute("y",Math.round((f+h.fontSize)/2));y.setAttribute("fill",h.fontColor||"black");y.setAttribute("text-anchor", +"middle");y.setAttribute("font-size",Math.round(h.fontSize)+"px");y.setAttribute("font-family",h.fontFamily);(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold");(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");(h.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.setAttribute("text-decoration","underline");try{return t.innerHTML=e,y.textContent=t.value,y}catch(Ba){return w.apply(this, +arguments)}}else return w.apply(this,arguments)};d=this.backgroundImage;null!=d&&(f=l/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,d.width*f,d.height*f),mxUtils.intersects(b,f)&&n.image(c.x,c.y,d.width,d.height,d.src,!0));n.scale(a);n.textEnabled=g;k=null!=k?k:this.createSvgImageExport();var q=k.drawCellState;k.drawCellState=function(a,c){for(var d=a.view.graph,b=d.isCellSelected(a.cell),f=d.model.getParent(a.cell);!e&&!b&&null!=f;)b=d.isCellSelected(f),f=d.model.getParent(f);(e||b)&&q.apply(this, +arguments)};k.drawState(this.getView().getState(this.model.root),n);return r};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,d){for(;null!=a&&a.nodeName!=c;){if(a== d)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){var d=document.createRange();d.selectNode(a);c.removeAllRanges();c.addRange(d)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),d=c.createRange(),d.setEndPoint("StartToStart",a),d.select())};Graph.prototype.insertRow=function(a,c){for(var d=a.tBodies[0],b=0<d.rows.length?d.rows[0].cells.length:1,d=d.insertRow(c), f=0;f<b;f++)mxUtils.br(d.insertCell(-1));return d.cells[0]};Graph.prototype.deleteRow=function(a,c){a.tBodies[0].deleteRow(c)};Graph.prototype.insertColumn=function(a,c){var d=a.tHead;if(null!=d)for(var b=0;b<d.rows.length;b++){var f=document.createElement("th");d.rows[b].appendChild(f);mxUtils.br(f)}d=a.tBodies[0];for(b=0;b<d.rows.length;b++)f=d.rows[b].insertCell(c),mxUtils.br(f);return d.rows[0].cells[0<=c?c:d.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var d= a.tBodies[0].rows,b=0;b<d.length;b++)d[b].cells.length>c&&d[b].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){c=c.getRangeAt(0);c.deleteContents();var d=document.createElement("div");d.innerHTML=a;a=document.createDocumentFragment();for(var b;b=d.firstChild;)lastNode=a.appendChild(b);c.insertNode(a)}}else(c=document.selection)&&"Control"!=c.type&&c.createRange().pasteHTML(a)};Graph.prototype.createLinkForHint= @@ -2358,17 +2359,17 @@ function(a,c){c=null!=c?c:a;var d=document.createElement("a");d.setAttribute("hr c){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(c){c=a.apply(this,arguments);if(mxEvent.isTouchEvent(c.getEvent())&&null==c.getState()){var d=this.getCellAt(c.graphX,c.graphY);null!=d&&this.isSwimlane(d)&&this.hitsSwimlaneContent(d,c.graphX,c.graphY)||(c.state=this.view.getState(d),null!=c.state&&null!=c.state.shape&&(this.container.style.cursor=c.state.shape.node.style.cursor))}null==c.getState()&&this.isEnabled()&&(this.container.style.cursor="default"); return c};var c=!1,d=!1,b=!1,f=this.fireMouseEvent;this.fireMouseEvent=function(a,e,g){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),c=this.isCellSelected(e.getCell()),d=this.isSelectionEmpty(),b=this.popupMenuHandler.isMenuShowing());f.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,f){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==f.getState()||!f.isSource(f.getState().control))&&(this.popupMenuHandler.popupTrigger||!b&&!mxEvent.isMouseEvent(f.getEvent())&& (d&&null==f.getCell()&&this.isSelectionEmpty()||c&&this.isCellSelected(f.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount){for(var c=[],d=0,b=a.rangeCount;d<b;++d)c.push(a.getRangeAt(d));return c}}else if(document.selection&& -document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,d=a.length;c<d;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(F){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br", -"1"));k.apply(this,arguments)};var m=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?m.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var p=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){p.apply(this, +document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,d=a.length;c<d;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(F){}};var h=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br", +"1"));h.apply(this,arguments)};var m=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?m.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var p=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){p.apply(this, arguments);var d=this.graph.view.getState(a);this.textarea.className=null!=d&&1==d.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);var d=this.graph.getModel().getParent(a),b=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(d)&&null!=b&&b.relative||this.graph.getModel().isEdge(a)?mxClient.IS_QUIRKS?this.textarea.style.border="gray dotted 1px":this.textarea.style.outline=mxClient.IS_IE|| mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?"gray dotted 1px":"":mxClient.IS_QUIRKS&&(this.textarea.style.outline="none",this.textarea.style.border="")};var q=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(a){function c(a,d){d.originalNode=a;a=a.firstChild;for(var b=d.firstChild;null!=a&&null!=b;)c(a,b),a=a.nextSibling,b=b.nextSibling;return d}function d(a,c){if(null!=a)if(c.originalNode!=a)b(a);else for(a=a.firstChild,c=c.firstChild;null!=a;){var f= a.nextSibling;null==c?b(a):(d(a,c),c=c.nextSibling);a=f}}function b(a){for(var c=a.firstChild;null!=c;){var d=c.nextSibling;b(c);c=d}1==a.nodeType&&("BR"===a.nodeName||null!=a.firstChild)||3==a.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(a)).length?(3==a.nodeType&&mxUtils.setTextContent(a,mxUtils.getTextContent(a).replace(/\n|\r/g,"")),1==a.nodeType&&(a.removeAttribute("style"),a.removeAttribute("class"),a.removeAttribute("width"),a.removeAttribute("cellpadding"),a.removeAttribute("cellspacing"), a.removeAttribute("border"))):a.parentNode.removeChild(a)}q.apply(this,arguments);mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var b=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){d(this.textarea,b)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell),c=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br", -"1"),d=this.saveSelection();if(this.codeViewMode){l=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<l.length&&"\n"==l.charAt(l.length-1)&&(l=l.substring(0,l.length-1));l=this.graph.sanitizeHtml(c?l.replace(/\n/g,"<br/>"):l,!0);this.textarea.className="mxCellEditor geContentEditable";var b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style, +"1"),d=this.saveSelection();if(this.codeViewMode){k=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<k.length&&"\n"==k.charAt(k.length-1)&&(k=k.substring(0,k.length-1));k=this.graph.sanitizeHtml(c?k.replace(/\n/g,"<br/>"):k,!0);this.textarea.className="mxCellEditor geContentEditable";var b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style, mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,g=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,a=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT; -this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=e?"bold":"normal";this.textarea.style.fontStyle=g?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=l&&(this.textarea.innerHTML=l,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode= -!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var l=mxUtils.htmlEntities(this.textarea.innerHTML);mxClient.IS_QUIRKS||8==document.documentMode||(l=mxUtils.replaceTrailingNewlines(l,"<div><br></div>"));l=this.graph.sanitizeHtml(c?l.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):l,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var b=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT? -Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=l&&(this.textarea.innerHTML=l);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState); +this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=e?"bold":"normal";this.textarea.style.fontStyle=g?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=k&&(this.textarea.innerHTML=k,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode= +!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var k=mxUtils.htmlEntities(this.textarea.innerHTML);mxClient.IS_QUIRKS||8==document.documentMode||(k=mxUtils.replaceTrailingNewlines(k,"<div><br></div>"));k=this.graph.sanitizeHtml(c?k.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):k,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var b=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT? +Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=k&&(this.textarea.innerHTML=k);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState); this.switchSelectionState=d;this.resize()};var v=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,c){if(null!=this.textarea)if(a=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=a){var d=a.view.scale;this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*d;this.bounds.height=60*d;var b=null!=a.text?a.text.margin:null;null==b&&(b=mxUtils.getAlignmentAsPoint(mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=b.x*this.bounds.width;this.bounds.y+=b.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/d)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/d)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/d)+(this.textarea.offsetHeight- this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*d);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/d)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*d);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxClient.IS_VML?this.textarea.style.zoom=d:mxUtils.setPrefixedStyle(this.textarea.style, @@ -2394,13 +2395,13 @@ Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop);mxClient.IS_SVG||((n if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-24,mxConstraintHandler.prototype.getTolerance=function(a){return mxEvent.isMouseEvent(a.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return null== a.getState()&&!mxEvent.isMouseEvent(c)||mxEvent.isPopupTrigger(c)&&(null==a.getState()||mxEvent.isControlDown(c)||mxEvent.isShiftDown(c))};var t=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,c){t.apply(this,arguments);mxEvent.isTouchEvent(c.getEvent())&&this.graph.isCellSelected(c.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return mxEvent.isLeftMouseButton(c)&& (this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(c)&&!mxEvent.isShiftDown(c))||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,c){var d=null!=this.div&&"none"!=this.div.style.display,b=null,f=null,e=null,g=null;null!=this.first&& -null!=this.currentX&&null!=this.currentY&&(b=this.first.x,f=this.first.y,e=(this.currentX-b)/this.graph.view.scale,g=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(d){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,this.y,this.width,this.height),l= -this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(l)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(l=this.graph.getCellsBeyond(b,f,this.graph.getDefaultParent(),!0,!0),d=0;d<l.length;d++)if(this.graph.isCellMovable(l[d])){var h=this.graph.view.getState(l[d]),n=this.graph.getCellGeometry(l[d]);null!=h&&null!=n&&(n=n.clone(),n.translate(e,g),this.graph.model.setGeometry(l[d],n))}}finally{this.graph.model.endUpdate()}}else e=new mxRectangle(this.x,this.y, +null!=this.currentX&&null!=this.currentY&&(b=this.first.x,f=this.first.y,e=(this.currentX-b)/this.graph.view.scale,g=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(d){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,this.y,this.width,this.height),k= +this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(k)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(k=this.graph.getCellsBeyond(b,f,this.graph.getDefaultParent(),!0,!0),d=0;d<k.length;d++)if(this.graph.isCellMovable(k[d])){var l=this.graph.view.getState(k[d]),n=this.graph.getCellGeometry(k[d]);null!=l&&null!=n&&(n=n.clone(),n.translate(e,g),this.graph.model.setGeometry(k[d],n))}}finally{this.graph.model.endUpdate()}}else e=new mxRectangle(this.x,this.y, this.width,this.height),this.graph.selectRegion(e,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var d=mxUtils.getScrollOrigin(this.graph.container),b=mxUtils.getOffset(this.graph.container);d.x-=b.x;d.y-=b.y;var b=c.getX()+d.x,d=c.getY()+d.y,f=this.first.x-b,e=this.first.y-d,g=this.graph.tolerance;if(null!=this.div||Math.abs(f)>g||Math.abs(e)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(b,d), this.isSpaceEvent(c)?(b=this.x+this.width,d=this.y+this.height,f=this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(this.width=this.graph.snap(this.width/f)*f,this.height=this.graph.snap(this.height/f)*f,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=b-this.width),this.y<this.first.y&&(this.y=d-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left= this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height= -Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var h=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);h.apply(this, -arguments)};var n=(new Date).getTime(),l=0,w=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,d,b){w.apply(this,arguments);d!=this.currentTerminalState?(n=(new Date).getTime(),l=0):l=(new Date).getTime()-n;this.currentTerminalState=d};var r=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<l||(null==this.currentTerminalState|| +Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var l=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);l.apply(this, +arguments)};var n=(new Date).getTime(),k=0,w=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,d,b){w.apply(this,arguments);d!=this.currentTerminalState?(n=(new Date).getTime(),k=0):k=(new Date).getTime()-n;this.currentTerminalState=d};var r=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<k||(null==this.currentTerminalState|| "0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&r.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var d=null!=a&&0==a,b=this.state.getVisibleTerminalState(d),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,b,d):null,d=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(d), f):null)?this.fixedHandleImage:null!=f&&null!=b?this.terminalHandleImage:this.handleImage;if(null!=d)return d=new mxImageShape(new mxRectangle(0,0,d.width,d.height),d.src),d.preserveImageAspect=!1,d;d=mxConstants.HANDLE_SIZE;this.preferHtml&&--d;return new mxRectangleShape(new mxRectangle(0,0,d,d),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var y=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,c,d){this.handleImage=c==mxEvent.ROTATION_HANDLE? HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return y.apply(this,arguments)};var D=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),d=c.getParent(a[0]),b=this.graph.getCellGeometry(a[0]);if(c.isEdge(d)&&null!=b&&b.relative&&(c=this.graph.view.getState(a[0]),null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return D.apply(this, @@ -2421,17 +2422,17 @@ c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this. function(){I.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var R=mxEdgeHandler.prototype.redrawHandles; mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(R.apply(this),null!=this.state&&null!=this.linkHint)){var a=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(a=new mxRectangle(a.x,a.y,a.width,a.height),a.add(this.state.text.bounds));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(a.y+a.height+6+this.state.view.graph.tolerance)+"px"}};var Y=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset= function(){Y.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var aa=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){aa.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler), -this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function d(){mxActor.call(this)}function e(){mxCylinder.call(this)}function b(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function m(){mxActor.call(this)}function p(){mxCylinder.call(this)}function q(){mxActor.call(this)}function v(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function u(){mxActor.call(this)}function t(){mxActor.call(this)}function h(a,c){this.canvas= -a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,h.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,h.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,h.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,h.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo; -this.canvas.curveTo=mxUtils.bind(this,h.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,h.prototype.arcTo)}function n(){mxRectangleShape.call(this)}function l(){mxRectangleShape.call(this)}function w(){mxActor.call(this)}function r(){mxActor.call(this)}function y(){mxActor.call(this)}function D(){mxRectangleShape.call(this)}function z(){mxRectangleShape.call(this)}function G(){mxCylinder.call(this)}function E(){mxShape.call(this)}function x(){mxShape.call(this)} +this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function d(){mxActor.call(this)}function e(){mxCylinder.call(this)}function b(){mxCylinder.call(this)}function h(){mxCylinder.call(this)}function m(){mxActor.call(this)}function p(){mxCylinder.call(this)}function q(){mxActor.call(this)}function v(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function u(){mxActor.call(this)}function t(){mxActor.call(this)}function l(a,c){this.canvas= +a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo; +this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo)}function n(){mxRectangleShape.call(this)}function k(){mxRectangleShape.call(this)}function w(){mxActor.call(this)}function r(){mxActor.call(this)}function y(){mxActor.call(this)}function D(){mxRectangleShape.call(this)}function z(){mxRectangleShape.call(this)}function G(){mxCylinder.call(this)}function E(){mxShape.call(this)}function x(){mxShape.call(this)} function J(){mxEllipse.call(this)}function H(){mxShape.call(this)}function B(){mxShape.call(this)}function N(){mxRectangleShape.call(this)}function C(){mxShape.call(this)}function I(){mxShape.call(this)}function R(){mxShape.call(this)}function Y(){mxCylinder.call(this)}function aa(){mxDoubleEllipse.call(this)}function Q(){mxDoubleEllipse.call(this)}function S(){mxArrowConnector.call(this);this.spacing=0}function K(){mxArrowConnector.call(this);this.spacing=0}function F(){mxActor.call(this)}function V(){mxRectangleShape.call(this)} function L(){mxActor.call(this)}function O(){mxActor.call(this)}function X(){mxActor.call(this)}function A(){mxActor.call(this)}function W(){mxActor.call(this)}function P(){mxActor.call(this)}function da(){mxActor.call(this)}function T(){mxActor.call(this)}function Z(){mxActor.call(this)}function U(){mxActor.call(this)}function ma(){mxEllipse.call(this)}function na(){mxEllipse.call(this)}function ca(){mxEllipse.call(this)}function ia(){mxRhombus.call(this)}function qa(){mxEllipse.call(this)}function ea(){mxEllipse.call(this)} -function ra(){mxEllipse.call(this)}function fa(){mxEllipse.call(this)}function ja(){mxActor.call(this)}function ba(){mxActor.call(this)}function ka(){mxActor.call(this)}function ga(){mxConnector.call(this)}function Aa(a,c,d,b,f,e,g,l,h,n){g+=h;var pa=b.clone();b.x-=f*(2*g+h);b.y-=e*(2*g+h);f*=g+h;e*=g+h;return function(){a.ellipse(pa.x-f-g,pa.y-e-g,2*g,2*g);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b, +function ra(){mxEllipse.call(this)}function fa(){mxEllipse.call(this)}function ja(){mxActor.call(this)}function ba(){mxActor.call(this)}function ka(){mxActor.call(this)}function ga(){mxConnector.call(this)}function Aa(a,c,d,b,f,e,g,k,n,l){g+=n;var pa=b.clone();b.x-=f*(2*g+n);b.y-=e*(2*g+n);f*=g+n;e*=g+n;return function(){a.ellipse(pa.x-f-g,pa.y-e-g,2*g,2*g);l?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b, Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(c,f),a.lineTo(c,c),a.lineTo(0,0),a.moveTo(c,c),a.lineTo(b,c)):(a.moveTo(0,0),a.lineTo(b-c,0),a.lineTo(b,c),a.lineTo(b,f),a.lineTo(c,f),a.lineTo(0,f-c),a.lineTo(0,0),a.close());a.end()};a.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?(a=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(a,a,0,0)):null};mxCellRenderer.registerShape("cube", a);var xa=Math.tan(mxUtils.toRadians(30)),oa=(.5-xa)/2;mxUtils.extend(d,mxActor);d.prototype.size=20;d.prototype.redrawPath=function(a,c,d,b,f){c=Math.min(b,f/xa);a.translate((b-c)/2,(f-c)/2+c/4);a.moveTo(0,.25*c);a.lineTo(.5*c,c*oa);a.lineTo(c,.25*c);a.lineTo(.5*c,(.5-oa)*c);a.lineTo(0,.25*c);a.close();a.end()};mxCellRenderer.registerShape("isoRectangle",d);mxUtils.extend(e,mxCylinder);e.prototype.size=20;e.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.min(b,f/(.5+xa));e?(a.moveTo(0,.25*c),a.lineTo(.5* c,(.5-oa)*c),a.lineTo(c,.25*c),a.moveTo(.5*c,(.5-oa)*c),a.lineTo(.5*c,(1-oa)*c)):(a.translate((b-c)/2,(f-c)/2),a.moveTo(0,.25*c),a.lineTo(.5*c,c*oa),a.lineTo(c,.25*c),a.lineTo(c,.75*c),a.lineTo(.5*c,(1-oa)*c),a.lineTo(0,.75*c),a.close());a.end()};mxCellRenderer.registerShape("isoCube",e);mxUtils.extend(b,mxCylinder);b.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.min(f/2,Math.round(f/8)+this.strokewidth-1);if(e&&null!=this.fill||!e&&null==this.fill)a.moveTo(0,c),a.curveTo(0,2*c,b,2*c,b,c),e|| (a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,b,2*c,b,c),e||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,b,2*c,b,c),e||(a.stroke(),a.begin()),a.translate(0,-c);e||(a.moveTo(0,c),a.curveTo(0,-c/3,b,-c/3,b,c),a.lineTo(b,f-c),a.curveTo(b,f+c/3,0,f+c/3,0,f-c),a.close())};b.prototype.getLabelMargins=function(a){return new mxRectangle(0,2.5*Math.min(a.height/2,Math.round(a.height/8)+this.strokewidth-1)*this.scale,0,0)};mxCellRenderer.registerShape("datastore", -b);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(b-c,0),a.lineTo(b-c,c),a.lineTo(b,c)):(a.moveTo(0,0),a.lineTo(b-c,0),a.lineTo(b,c),a.lineTo(b,f),a.lineTo(0,f),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.registerShape("note",k);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,d,b,f){a.moveTo(0,0);a.quadTo(b/2,.5*f,b,0);a.quadTo(.5* +b);mxUtils.extend(h,mxCylinder);h.prototype.size=30;h.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));e?(a.moveTo(b-c,0),a.lineTo(b-c,c),a.lineTo(b,c)):(a.moveTo(0,0),a.lineTo(b-c,0),a.lineTo(b,c),a.lineTo(b,f),a.lineTo(0,f),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.registerShape("note",h);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,d,b,f){a.moveTo(0,0);a.quadTo(b/2,.5*f,b,0);a.quadTo(.5* b,f/2,b,f);a.quadTo(b/2,.5*f,0,f);a.quadTo(.5*b,f/2,0,0);a.end()};mxCellRenderer.registerShape("switch",m);mxUtils.extend(p,mxCylinder);p.prototype.tabWidth=60;p.prototype.tabHeight=20;p.prototype.tabPosition="right";p.prototype.redrawPath=function(a,c,d,b,f,e){c=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));d=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var g=mxUtils.getValue(this.style,"tabPosition",this.tabPosition); e?"left"==g?(a.moveTo(0,d),a.lineTo(c,d)):(a.moveTo(b-c,d),a.lineTo(b,d)):("left"==g?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,d),a.lineTo(b,d)):(a.moveTo(0,d),a.lineTo(b-c,d),a.lineTo(b-c,0),a.lineTo(b,0)),a.lineTo(b,f),a.lineTo(0,f),a.lineTo(0,d),a.close());a.end()};mxCellRenderer.registerShape("folder",p);mxUtils.extend(q,mxActor);q.prototype.size=30;q.prototype.redrawPath=function(a,c,d,b,f){c=Math.max(0,Math.min(b,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d=mxUtils.getValue(this.style, mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(b,0),new mxPoint(b,f),new mxPoint(0,f),new mxPoint(0,c)],this.isRounded,d,!0);a.end()};mxCellRenderer.registerShape("card",q);mxUtils.extend(v,mxActor);v.prototype.size=.4;v.prototype.redrawPath=function(a,c,d,b,f){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(b/4,1.4*c,b/2,c/2);a.quadTo(3*b/4,c*(1-1.4),b,c/2);a.lineTo(b,f-c/2);a.quadTo(3* @@ -2441,48 +2442,48 @@ a.end()};mxCellRenderer.registerShape("document",c);var Ba=mxCylinder.prototype. mxActor);f.prototype.size=.2;f.prototype.redrawPath=function(a,c,d,b,f){c=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(b,0),new mxPoint(b-c,f)],this.isRounded,d,!0);a.end()};mxCellRenderer.registerShape("parallelogram",f);mxUtils.extend(g,mxActor);g.prototype.size=.2;g.prototype.redrawPath=function(a,c,d,b,f){c=b* Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(c,0),new mxPoint(b-c,0),new mxPoint(b,f)],this.isRounded,d,!0)};mxCellRenderer.registerShape("trapezoid",g);mxUtils.extend(u,mxActor);u.prototype.size=.5;u.prototype.redrawPath=function(a,c,d,b,f){a.setFillColor(null);c=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size", this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(b,0),new mxPoint(c,0),new mxPoint(c,f/2),new mxPoint(0,f/2),new mxPoint(c,f/2),new mxPoint(c,f),new mxPoint(b,f)],this.isRounded,d,!1);a.end()};mxCellRenderer.registerShape("curlyBracket",u);mxUtils.extend(t,mxActor);t.prototype.redrawPath=function(a,c,d,b,f){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=b/5;a.rect(0,0,c,f);a.fillAndStroke();a.rect(2*c,0,c,f);a.fillAndStroke(); -a.rect(4*c,0,c,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",t);h.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;this.firstX=a;this.firstY=c};h.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};h.prototype.quadTo=function(a,c,d,b){this.originalQuadTo.apply(this.canvas, -arguments);this.lastX=d;this.lastY=b};h.prototype.curveTo=function(a,c,d,b,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};h.prototype.arcTo=function(a,c,d,b,f,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=g};h.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var d=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},b=Math.abs(a-this.lastX),f=Math.abs(c-this.lastY),e=Math.sqrt(b*b+f*f);if(2>e){this.originalLineTo.apply(this.canvas, -arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(e/10),l=this.defaultVariation;5>g&&(g=5,l/=3);for(var pa=d(a-this.lastX)*b/g,d=d(c-this.lastY)*f/g,b=b/e,f=f/e,e=0;e<g;e++){var h=(Math.random()-.5)*l;this.originalLineTo.call(this.canvas,pa*e+this.lastX-h*f,d*e+this.lastY-h*b)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};h.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo= -this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var Fa=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new h(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Fa.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(), +a.rect(4*c,0,c,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",t);l.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;this.firstX=a;this.firstY=c};l.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};l.prototype.quadTo=function(a,c,d,b){this.originalQuadTo.apply(this.canvas, +arguments);this.lastX=d;this.lastY=b};l.prototype.curveTo=function(a,c,d,b,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};l.prototype.arcTo=function(a,c,d,b,f,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=g};l.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var d=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},b=Math.abs(a-this.lastX),f=Math.abs(c-this.lastY),e=Math.sqrt(b*b+f*f);if(2>e){this.originalLineTo.apply(this.canvas, +arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(e/10),k=this.defaultVariation;5>g&&(g=5,k/=3);for(var pa=d(a-this.lastX)*b/g,d=d(c-this.lastY)*f/g,b=b/e,f=f/e,e=0;e<g;e++){var n=(Math.random()-.5)*k;this.originalLineTo.call(this.canvas,pa*e+this.lastX-n*f,d*e+this.lastY-n*b)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo= +this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var Fa=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new l(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Fa.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(), delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var Ga=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Ga.apply(this,arguments)};var Ha=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,c,d,b,f){if(null==a.handJiggle)Ha.apply(this,arguments);else{var e=!0;null!=this.style&&(e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS, "1"));if(e||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)e||null!=this.fill&&this.fill!=mxConstants.NONE||(a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?e=Math.min(b/2,Math.min(f/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.min(b* e,f*e)),a.moveTo(c+e,d),a.lineTo(c+b-e,d),a.quadTo(c+b,d,c+b,d+e),a.lineTo(c+b,d+f-e),a.quadTo(c+b,d+f,c+b-e,d+f),a.lineTo(c+e,d+f),a.quadTo(c,d+f,c,d+f-e),a.lineTo(c,d+e),a.quadTo(c,d,c+e,d)):(a.moveTo(c,d),a.lineTo(c+b,d),a.lineTo(c+b,d+f),a.lineTo(c,d+f),a.lineTo(c,d)),a.close(),a.end(),a.fillAndStroke()}};var Ia=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,c,d,b,f){null==a.handJiggle&&Ia.apply(this,arguments)};mxUtils.extend(n,mxRectangleShape); n.prototype.size=.1;n.prototype.isHtmlAllowed=function(){return!1};n.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var c=a.width,d=a.height;a=new mxRectangle(a.x,a.y,c,d);var b=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE, 100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,b=Math.max(b,Math.min(c*f,d*f));a.x+=Math.round(b);a.width-=Math.round(2*b)}return a};n.prototype.paintForeground=function(a,c,d,b,f){var e=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(b*g,f*g));e=Math.round(e);a.begin();a.moveTo(c+e,d);a.lineTo(c+e,d+f);a.moveTo(c+b- -e,d);a.lineTo(c+b-e,d+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",n);mxUtils.extend(l,mxRectangleShape);l.prototype.paintBackground=function(a,c,d,b,f){a.setFillColor(mxConstants.NONE);a.rect(c,d,b,f);a.fill()};l.prototype.paintForeground=function(a,c,d,b,f){};mxCellRenderer.registerShape("transparent",l);mxUtils.extend(w,mxHexagon);w.prototype.size=30;w.prototype.position=.5;w.prototype.position2=.5;w.prototype.base= +e,d);a.lineTo(c+b-e,d+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",n);mxUtils.extend(k,mxRectangleShape);k.prototype.paintBackground=function(a,c,d,b,f){a.setFillColor(mxConstants.NONE);a.rect(c,d,b,f);a.fill()};k.prototype.paintForeground=function(a,c,d,b,f){};mxCellRenderer.registerShape("transparent",k);mxUtils.extend(w,mxHexagon);w.prototype.size=30;w.prototype.position=.5;w.prototype.position2=.5;w.prototype.base= 20;w.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};w.prototype.redrawPath=function(a,c,d,b,f){c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var e=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),g=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style, -"position2",this.position2)))),l=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(a,[new mxPoint(0,0),new mxPoint(b,0),new mxPoint(b,f-d),new mxPoint(Math.min(b,e+l),f-d),new mxPoint(g,f),new mxPoint(Math.max(0,e),f-d),new mxPoint(0,f-d)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",w);mxUtils.extend(r,mxActor);r.prototype.size=.2;r.prototype.fixedSize=20;r.prototype.redrawPath=function(a,c,d,b,f){c="0"!=mxUtils.getValue(this.style, +"position2",this.position2)))),k=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(a,[new mxPoint(0,0),new mxPoint(b,0),new mxPoint(b,f-d),new mxPoint(Math.min(b,e+k),f-d),new mxPoint(g,f),new mxPoint(Math.max(0,e),f-d),new mxPoint(0,f-d)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",w);mxUtils.extend(r,mxActor);r.prototype.size=.2;r.prototype.fixedSize=20;r.prototype.redrawPath=function(a,c,d,b,f){c="0"!=mxUtils.getValue(this.style, "fixedSize","0")?Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(b-c,0),new mxPoint(b,f/2),new mxPoint(b-c,f),new mxPoint(0,f),new mxPoint(c,f/2)],this.isRounded,d,!0);a.end()};mxCellRenderer.registerShape("step",r);mxUtils.extend(y,mxHexagon);y.prototype.size= .25;y.prototype.redrawPath=function(a,c,d,b,f){c=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(b-c,0),new mxPoint(b,.5*f),new mxPoint(b-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],this.isRounded,d,!0)};mxCellRenderer.registerShape("hexagon",y);mxUtils.extend(D,mxRectangleShape);D.prototype.isHtmlAllowed=function(){return!1};D.prototype.paintForeground= function(a,c,d,b,f){var e=Math.min(b/5,f/5)+1;a.begin();a.moveTo(c+b/2,d+e);a.lineTo(c+b/2,d+f-e);a.moveTo(c+e,d+f/2);a.lineTo(c+b-e,d+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",D);var Ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+ c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,d,b,f){Ca.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var e=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;d+=e;b-=2*e;f-=2*e;0<b&&0<f&&(a.setShadow(!1),Ca.apply(this,[a,c,d,b,f]))}};mxUtils.extend(z,mxRectangleShape);z.prototype.isHtmlAllowed=function(){return!1};z.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2, this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};z.prototype.paintForeground=function(a,c,d,b,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;d+=e;b-=2*e;f-=2*e;0<b&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,g;do{g=mxCellRenderer.defaultShapes[this.style["symbol"+ -e]];if(null!=g){var l=this.style["symbol"+e+"Align"],pa=this.style["symbol"+e+"VerticalAlign"],h=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],r=this.style["symbol"+e+"Spacing"]||0,u=this.style["symbol"+e+"VSpacing"]||r,t=this.style["symbol"+e+"ArcSpacing"];null!=t&&(t*=this.getArcSize(b+this.strokewidth,f+this.strokewidth),r+=t,u+=t);var t=c,w=d,t=l==mxConstants.ALIGN_CENTER?t+(b-h)/2:l==mxConstants.ALIGN_RIGHT?t+(b-h-r):t+r,w=pa==mxConstants.ALIGN_MIDDLE?w+(f-n)/2:pa==mxConstants.ALIGN_BOTTOM? -w+(f-n-u):w+u;a.save();l=new g;l.style=this.style;g.prototype.paintVertexShape.call(l,a,t,w,h,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",z);mxUtils.extend(G,mxCylinder);G.prototype.redrawPath=function(a,c,d,b,f,e){e?(a.moveTo(0,0),a.lineTo(b/2,f/2),a.lineTo(b,0),a.end()):(a.moveTo(0,0),a.lineTo(b,0),a.lineTo(b,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",G);mxUtils.extend(E,mxShape); +e]];if(null!=g){var k=this.style["symbol"+e+"Align"],pa=this.style["symbol"+e+"VerticalAlign"],n=this.style["symbol"+e+"Width"],l=this.style["symbol"+e+"Height"],r=this.style["symbol"+e+"Spacing"]||0,u=this.style["symbol"+e+"VSpacing"]||r,t=this.style["symbol"+e+"ArcSpacing"];null!=t&&(t*=this.getArcSize(b+this.strokewidth,f+this.strokewidth),r+=t,u+=t);var t=c,w=d,t=k==mxConstants.ALIGN_CENTER?t+(b-n)/2:k==mxConstants.ALIGN_RIGHT?t+(b-n-r):t+r,w=pa==mxConstants.ALIGN_MIDDLE?w+(f-l)/2:pa==mxConstants.ALIGN_BOTTOM? +w+(f-l-u):w+u;a.save();k=new g;k.style=this.style;g.prototype.paintVertexShape.call(k,a,t,w,n,l);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",z);mxUtils.extend(G,mxCylinder);G.prototype.redrawPath=function(a,c,d,b,f,e){e?(a.moveTo(0,0),a.lineTo(b/2,f/2),a.lineTo(b,0),a.end()):(a.moveTo(0,0),a.lineTo(b,0),a.lineTo(b,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",G);mxUtils.extend(E,mxShape); E.prototype.paintBackground=function(a,c,d,b,f){a.translate(c,d);a.ellipse(b/4,0,b/2,f/4);a.fillAndStroke();a.begin();a.moveTo(b/2,f/4);a.lineTo(b/2,2*f/3);a.moveTo(b/2,f/3);a.lineTo(0,f/3);a.moveTo(b/2,f/3);a.lineTo(b,f/3);a.moveTo(b/2,2*f/3);a.lineTo(0,f);a.moveTo(b/2,2*f/3);a.lineTo(b,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlActor",E);mxUtils.extend(x,mxShape);x.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};x.prototype.paintBackground=function(a, c,d,b,f){a.translate(c,d);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(b/6,f/2);a.end();a.stroke();a.ellipse(b/6,0,5*b/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",x);mxUtils.extend(J,mxEllipse);J.prototype.paintVertexShape=function(a,c,d,b,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+b/8,d+f);a.lineTo(c+7*b/8,d+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",J);mxUtils.extend(H, mxShape);H.prototype.paintVertexShape=function(a,c,d,b,f){a.translate(c,d);a.begin();a.moveTo(b,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(b,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",H);mxUtils.extend(B,mxShape);B.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};B.prototype.paintBackground=function(a,c,d,b,f){a.translate(c,d);a.begin();a.moveTo(3*b/8,f/8*1.1);a.lineTo(5*b/8,0);a.end();a.stroke();a.ellipse(0,f/8,b,7*f/8);a.fillAndStroke()}; B.prototype.paintForeground=function(a,c,d,b,f){a.begin();a.moveTo(3*b/8,f/8*1.1);a.lineTo(5*b/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",B);mxUtils.extend(N,mxRectangleShape);N.prototype.size=40;N.prototype.isHtmlAllowed=function(){return!1};N.prototype.getLabelBounds=function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,c)};N.prototype.paintBackground=function(a,c,d,b, f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),g=mxUtils.getValue(this.style,"participant");null==g||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,d,b,e):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=N&&(g=new g,g.apply(this.state),a.save(),g.paintVertexShape(a,c,d,b,e),a.restore()));e<f&&(a.setDashed(!0),a.begin(),a.moveTo(c+b/2,d+e),a.lineTo(c+b/2,d+f),a.end(),a.stroke())};N.prototype.paintForeground=function(a, c,d,b,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,d,b,Math.min(f,e))};mxCellRenderer.registerShape("umlLifeline",N);mxUtils.extend(C,mxShape);C.prototype.width=60;C.prototype.height=30;C.prototype.corner=10;C.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style, -"height",this.height)*this.scale))};C.prototype.paintBackground=function(a,c,d,b,f){var e=this.corner,g=Math.min(b,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),l=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),h=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);h!=mxConstants.NONE&&(a.setFillColor(h),a.rect(c,d,b,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!= -mxConstants.NONE?(this.getGradientBounds(a,c,d,b,f),a.setGradient(this.fill,this.gradient,c,d,b,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,d);a.lineTo(c+g,d);a.lineTo(c+g,d+Math.max(0,l-1.5*e));a.lineTo(c+Math.max(0,g-e),d+l);a.lineTo(c,d+l);a.close();a.fillAndStroke();a.begin();a.moveTo(c+g,d);a.lineTo(c+b,d);a.lineTo(c+b,d+f);a.lineTo(c,d+f);a.lineTo(c,d+l);a.stroke()};mxCellRenderer.registerShape("umlFrame",C);mxPerimeter.LifelinePerimeter=function(a,c,d,b){b=N.prototype.size; +"height",this.height)*this.scale))};C.prototype.paintBackground=function(a,c,d,b,f){var e=this.corner,g=Math.min(b,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),k=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),n=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);n!=mxConstants.NONE&&(a.setFillColor(n),a.rect(c,d,b,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!= +mxConstants.NONE?(this.getGradientBounds(a,c,d,b,f),a.setGradient(this.fill,this.gradient,c,d,b,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,d);a.lineTo(c+g,d);a.lineTo(c+g,d+Math.max(0,k-1.5*e));a.lineTo(c+Math.max(0,g-e),d+k);a.lineTo(c,d+k);a.close();a.fillAndStroke();a.begin();a.moveTo(c+g,d);a.lineTo(c+b,d);a.lineTo(c+b,d+f);a.lineTo(c,d+f);a.lineTo(c,d+k);a.stroke()};mxCellRenderer.registerShape("umlFrame",C);mxPerimeter.LifelinePerimeter=function(a,c,d,b){b=N.prototype.size; null!=c&&(b=mxUtils.getValue(c.style,"size",b)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;d.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+b,d.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(a,c,d,b){b=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter); mxPerimeter.BackbonePerimeter=function(a,c,d,b){b=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;null!=c.style.backboneSize&&(b+=parseFloat(c.style.backboneSize)*c.view.scale/2-1);if("south"==c.style[mxConstants.STYLE_DIRECTION]||"north"==c.style[mxConstants.STYLE_DIRECTION])return d.x<a.getCenterX()&&(b=-1*(b+1)),new mxPoint(a.getCenterX()+b,Math.min(a.y+a.height,Math.max(a.y,d.y)));d.y<a.getCenterY()&&(b=-1*(b+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,d.x)), a.getCenterY()+b)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,c,d,b){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(c.style,"size",w.prototype.size))*c.view.scale))),c.style),c,d,b)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,c,d,b){var e=f.prototype.size; -null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,l=a.y,h=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(e=n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+h,l+e),new mxPoint(g+h,l+n),new mxPoint(g,l+n-e),new mxPoint(g,l)]):(e=h*Math.max(0,Math.min(1,e)),l=[new mxPoint(g+e,l),new mxPoint(g+h,l),new mxPoint(g+h-e,l+n),new mxPoint(g, -l+n),new mxPoint(g+e,l)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);b&&(d.x<g||d.x>g+h?a.y=d.y:a.x=d.x);return mxUtils.getPerimeterPoint(l,a,d)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,d,b){var f=g.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,l=a.y,h=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST; -c==mxConstants.DIRECTION_EAST?(f=h*Math.max(0,Math.min(1,f)),l=[new mxPoint(e+f,l),new mxPoint(e+h-f,l),new mxPoint(e+h,l+n),new mxPoint(e,l+n),new mxPoint(e+f,l)]):c==mxConstants.DIRECTION_WEST?(f=h*Math.max(0,Math.min(1,f)),l=[new mxPoint(e,l),new mxPoint(e+h,l),new mxPoint(e+h-f,l+n),new mxPoint(e+f,l+n),new mxPoint(e,l)]):c==mxConstants.DIRECTION_NORTH?(f=n*Math.max(0,Math.min(1,f)),l=[new mxPoint(e,l+f),new mxPoint(e+h,l),new mxPoint(e+h,l+n),new mxPoint(e,l+n-f),new mxPoint(e,l+f)]):(f=n*Math.max(0, -Math.min(1,f)),l=[new mxPoint(e,l),new mxPoint(e+h,l+f),new mxPoint(e+h,l+n-f),new mxPoint(e,l+n),new mxPoint(e,l)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);b&&(d.x<e||d.x>e+h?a.y=d.y:a.x=d.x);return mxUtils.getPerimeterPoint(l,a,d)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,d,b){var f="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=f?r.prototype.fixedSize:r.prototype.size;null!=c&&(e=mxUtils.getValue(c.style, -"size",e));var g=a.x,l=a.y,h=a.width,n=a.height,u=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(h,e)):h*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+h-f,l),new mxPoint(g+h,a),new mxPoint(g+h-f,l+n),new mxPoint(g,l+n),new mxPoint(g+f,a),new mxPoint(g,l)]):c==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(h,e)):h*Math.max(0, -Math.min(1,e)),l=[new mxPoint(g+f,l),new mxPoint(g+h,l),new mxPoint(g+h-f,a),new mxPoint(g+h,l+n),new mxPoint(g+f,l+n),new mxPoint(g,a),new mxPoint(g+f,l)]):c==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+f),new mxPoint(u,l),new mxPoint(g+h,l+f),new mxPoint(g+h,l+n),new mxPoint(u,l+n-f),new mxPoint(g,l+n),new mxPoint(g,l+f)]):(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(u,l+f),new mxPoint(g+ -h,l),new mxPoint(g+h,l+n-f),new mxPoint(u,l+n),new mxPoint(g,l+n-f),new mxPoint(g,l)]);u=new mxPoint(u,a);b&&(d.x<g||d.x>g+h?u.y=d.y:u.x=d.x);return mxUtils.getPerimeterPoint(l,u,d)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,d,b){var f=y.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,g=a.y,l=a.width,h=a.height,n=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION, -mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(f=h*Math.max(0,Math.min(1,f)),g=[new mxPoint(n,g),new mxPoint(e+l,g+f),new mxPoint(e+l,g+h-f),new mxPoint(n,g+h),new mxPoint(e,g+h-f),new mxPoint(e,g+f),new mxPoint(n,g)]):(f=l*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+f,g),new mxPoint(e+l-f,g),new mxPoint(e+l,a),new mxPoint(e+l-f,g+h),new mxPoint(e+f,g+h),new mxPoint(e,a),new mxPoint(e+f,g)]);n=new mxPoint(n,a);b&&(d.x<e||d.x>e+ -l?n.y=d.y:n.x=d.x);return mxUtils.getPerimeterPoint(g,n,d)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(I,mxShape);I.prototype.size=10;I.prototype.paintBackground=function(a,c,d,b,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,d);a.ellipse((b-e)/2,0,e,e);a.fillAndStroke();a.begin();a.moveTo(b/2,e);a.lineTo(b/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",I);mxUtils.extend(R,mxShape);R.prototype.size= +null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,k=a.y,n=a.width,l=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(e=l*Math.max(0,Math.min(1,e)),k=[new mxPoint(g,k),new mxPoint(g+n,k+e),new mxPoint(g+n,k+l),new mxPoint(g,k+l-e),new mxPoint(g,k)]):(e=n*Math.max(0,Math.min(1,e)),k=[new mxPoint(g+e,k),new mxPoint(g+n,k),new mxPoint(g+n-e,k+l),new mxPoint(g, +k+l),new mxPoint(g+e,k)]);l=a.getCenterX();a=a.getCenterY();a=new mxPoint(l,a);b&&(d.x<g||d.x>g+n?a.y=d.y:a.x=d.x);return mxUtils.getPerimeterPoint(k,a,d)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,d,b){var f=g.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,k=a.y,n=a.width,l=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST; +c==mxConstants.DIRECTION_EAST?(f=n*Math.max(0,Math.min(1,f)),k=[new mxPoint(e+f,k),new mxPoint(e+n-f,k),new mxPoint(e+n,k+l),new mxPoint(e,k+l),new mxPoint(e+f,k)]):c==mxConstants.DIRECTION_WEST?(f=n*Math.max(0,Math.min(1,f)),k=[new mxPoint(e,k),new mxPoint(e+n,k),new mxPoint(e+n-f,k+l),new mxPoint(e+f,k+l),new mxPoint(e,k)]):c==mxConstants.DIRECTION_NORTH?(f=l*Math.max(0,Math.min(1,f)),k=[new mxPoint(e,k+f),new mxPoint(e+n,k),new mxPoint(e+n,k+l),new mxPoint(e,k+l-f),new mxPoint(e,k+f)]):(f=l*Math.max(0, +Math.min(1,f)),k=[new mxPoint(e,k),new mxPoint(e+n,k+f),new mxPoint(e+n,k+l-f),new mxPoint(e,k+l),new mxPoint(e,k)]);l=a.getCenterX();a=a.getCenterY();a=new mxPoint(l,a);b&&(d.x<e||d.x>e+n?a.y=d.y:a.x=d.x);return mxUtils.getPerimeterPoint(k,a,d)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,d,b){var f="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=f?r.prototype.fixedSize:r.prototype.size;null!=c&&(e=mxUtils.getValue(c.style, +"size",e));var g=a.x,k=a.y,n=a.width,l=a.height,u=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),k=[new mxPoint(g,k),new mxPoint(g+n-f,k),new mxPoint(g+n,a),new mxPoint(g+n-f,k+l),new mxPoint(g,k+l),new mxPoint(g+f,a),new mxPoint(g,k)]):c==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(n,e)):n*Math.max(0, +Math.min(1,e)),k=[new mxPoint(g+f,k),new mxPoint(g+n,k),new mxPoint(g+n-f,a),new mxPoint(g+n,k+l),new mxPoint(g+f,k+l),new mxPoint(g,a),new mxPoint(g+f,k)]):c==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(l,e)):l*Math.max(0,Math.min(1,e)),k=[new mxPoint(g,k+f),new mxPoint(u,k),new mxPoint(g+n,k+f),new mxPoint(g+n,k+l),new mxPoint(u,k+l-f),new mxPoint(g,k+l),new mxPoint(g,k+f)]):(f=f?Math.max(0,Math.min(l,e)):l*Math.max(0,Math.min(1,e)),k=[new mxPoint(g,k),new mxPoint(u,k+f),new mxPoint(g+ +n,k),new mxPoint(g+n,k+l-f),new mxPoint(u,k+l),new mxPoint(g,k+l-f),new mxPoint(g,k)]);u=new mxPoint(u,a);b&&(d.x<g||d.x>g+n?u.y=d.y:u.x=d.x);return mxUtils.getPerimeterPoint(k,u,d)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,d,b){var f=y.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var e=a.x,g=a.y,k=a.width,n=a.height,l=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION, +mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(f=n*Math.max(0,Math.min(1,f)),g=[new mxPoint(l,g),new mxPoint(e+k,g+f),new mxPoint(e+k,g+n-f),new mxPoint(l,g+n),new mxPoint(e,g+n-f),new mxPoint(e,g+f),new mxPoint(l,g)]):(f=k*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+f,g),new mxPoint(e+k-f,g),new mxPoint(e+k,a),new mxPoint(e+k-f,g+n),new mxPoint(e+f,g+n),new mxPoint(e,a),new mxPoint(e+f,g)]);l=new mxPoint(l,a);b&&(d.x<e||d.x>e+ +k?l.y=d.y:l.x=d.x);return mxUtils.getPerimeterPoint(g,l,d)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(I,mxShape);I.prototype.size=10;I.prototype.paintBackground=function(a,c,d,b,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,d);a.ellipse((b-e)/2,0,e,e);a.fillAndStroke();a.begin();a.moveTo(b/2,e);a.lineTo(b/2,f);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",I);mxUtils.extend(R,mxShape);R.prototype.size= 10;R.prototype.inset=2;R.prototype.paintBackground=function(a,c,d,b,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size)),g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,d);a.begin();a.moveTo(b/2,e+g);a.lineTo(b/2,f);a.end();a.stroke();a.begin();a.moveTo((b-e)/2-g,e/2);a.quadTo((b-e)/2-g,e+g,b/2,e+g);a.quadTo((b+e)/2+g,e+g,(b+e)/2+g,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",R);mxUtils.extend(Y,mxCylinder);Y.prototype.jettyWidth= -32;Y.prototype.jettyHeight=12;Y.prototype.redrawPath=function(a,c,d,b,f,e){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));d=g/2;var g=d+g/2,l=.3*f-c/2,h=.7*f-c/2;e?(a.moveTo(d,l),a.lineTo(g,l),a.lineTo(g,l+c),a.lineTo(d,l+c),a.moveTo(d,h),a.lineTo(g,h),a.lineTo(g,h+c),a.lineTo(d,h+c)):(a.moveTo(d,0),a.lineTo(b,0),a.lineTo(b,f),a.lineTo(d,f),a.lineTo(d,h+c),a.lineTo(0,h+c),a.lineTo(0,h),a.lineTo(d, -h),a.lineTo(d,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(d,l),a.close());a.end()};mxCellRenderer.registerShape("component",Y);mxUtils.extend(aa,mxDoubleEllipse);aa.prototype.outerStroke=!0;aa.prototype.paintVertexShape=function(a,c,d,b,f){var e=Math.min(4,Math.min(b/5,f/5));0<b&&0<f&&(a.ellipse(c+e,d+e,b-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,d,b,f),a.stroke())};mxCellRenderer.registerShape("endState",aa);mxUtils.extend(Q,aa);Q.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState", +32;Y.prototype.jettyHeight=12;Y.prototype.redrawPath=function(a,c,d,b,f,e){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));d=g/2;var g=d+g/2,k=.3*f-c/2,n=.7*f-c/2;e?(a.moveTo(d,k),a.lineTo(g,k),a.lineTo(g,k+c),a.lineTo(d,k+c),a.moveTo(d,n),a.lineTo(g,n),a.lineTo(g,n+c),a.lineTo(d,n+c)):(a.moveTo(d,0),a.lineTo(b,0),a.lineTo(b,f),a.lineTo(d,f),a.lineTo(d,n+c),a.lineTo(0,n+c),a.lineTo(0,n),a.lineTo(d, +n),a.lineTo(d,k+c),a.lineTo(0,k+c),a.lineTo(0,k),a.lineTo(d,k),a.close());a.end()};mxCellRenderer.registerShape("component",Y);mxUtils.extend(aa,mxDoubleEllipse);aa.prototype.outerStroke=!0;aa.prototype.paintVertexShape=function(a,c,d,b,f){var e=Math.min(4,Math.min(b/5,f/5));0<b&&0<f&&(a.ellipse(c+e,d+e,b-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,d,b,f),a.stroke())};mxCellRenderer.registerShape("endState",aa);mxUtils.extend(Q,aa);Q.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState", Q);mxUtils.extend(S,mxArrowConnector);S.prototype.defaultWidth=4;S.prototype.isOpenEnded=function(){return!0};S.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};S.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",S);mxUtils.extend(K,mxArrowConnector);K.prototype.defaultWidth=10;K.prototype.defaultArrowWidth=20;K.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+ mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};K.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};K.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",K);mxUtils.extend(F,mxActor);F.prototype.size=30;F.prototype.redrawPath=function(a,c,d,b,f){c=Math.min(f,parseFloat(mxUtils.getValue(this.style, "size",this.size)));d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f),new mxPoint(0,c),new mxPoint(b,0),new mxPoint(b,f)],this.isRounded,d,!0);a.end()};mxCellRenderer.registerShape("manualInput",F);mxUtils.extend(V,mxRectangleShape);V.prototype.dx=20;V.prototype.dy=20;V.prototype.isHtmlAllowed=function(){return!1};V.prototype.paintForeground=function(a,c,d,b,f){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e= @@ -2505,32 +2506,32 @@ a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(c+b/2,d),a.l function(a,c,d,b,f){c=Math.min(f,b);var e=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(f-e)/2;d=c+e;var g=(b-e)/2,e=g+e;a.moveTo(0,c);a.lineTo(g,c);a.lineTo(g,0);a.lineTo(e,0);a.lineTo(e,c);a.lineTo(b,c);a.lineTo(b,d);a.lineTo(e,d);a.lineTo(e,f);a.lineTo(g,f);a.lineTo(g,d);a.lineTo(0,d);a.close();a.end()};mxCellRenderer.registerShape("cross",ba);mxUtils.extend(ka,mxActor);ka.prototype.size=.25;ka.prototype.redrawPath=function(a,c,d,b,f){c=Math.min(b,f/2); d=Math.min(b-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*b);a.moveTo(0,f/2);a.lineTo(d,0);a.lineTo(b-c,0);a.quadTo(b,0,b,f/2);a.quadTo(b,f,b-c,f);a.lineTo(d,f);a.close();a.end()};mxCellRenderer.registerShape("display",ka);mxUtils.extend(ga,mxConnector);ga.prototype.origPaintEdgeShape=ga.prototype.paintEdgeShape;ga.prototype.paintEdgeShape=function(a,c,d){for(var b=[],f=0;f<c.length;f++)b.push(mxUtils.clone(c[f]));var f=a.state.dashed,e=a.state.fixDash;ga.prototype.origPaintEdgeShape.apply(this, [a,b,d]);3<=a.state.strokeWidth&&(b=mxUtils.getValue(this.style,"fillColor",null),null!=b&&(a.setStrokeColor(b),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(f,e),ga.prototype.origPaintEdgeShape.apply(this,[a,c,d])))};mxCellRenderer.registerShape("filledEdge",ga);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),d=a.apply(this,arguments);"umlFrame"==c.style.shape&& -d.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return d}}();mxMarker.addMarker("dash",function(a,c,d,b,f,e,g,l,h,n){var r=f*(g+h+1),u=e*(g+h+1);return function(){a.begin();a.moveTo(b.x-r/2-u/2,b.y-u/2+r/2);a.lineTo(b.x+u/2-3*r/2,b.y-3*u/2-r/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,d,b,f,e,g,l,h,n){var r=f*(g+h+1),u=e*(g+h+1);return function(){a.begin();a.moveTo(b.x-r/2-u/2,b.y-u/2+r/2);a.lineTo(b.x+u/2-3*r/2,b.y-3*u/2-r/2);a.moveTo(b.x- -r/2+u/2,b.y-u/2-r/2);a.lineTo(b.x-u/2-3*r/2,b.y-3*u/2+r/2);a.stroke()}});mxMarker.addMarker("circle",Aa);mxMarker.addMarker("circlePlus",function(a,c,b,d,f,e,g,l,h,n){var r=d.clone(),u=Aa.apply(this,arguments),t=f*(g+2*h),w=e*(g+2*h);return function(){u.apply(this,arguments);a.begin();a.moveTo(r.x-f*h,r.y-e*h);a.lineTo(r.x-2*t+f*h,r.y-2*w+e*h);a.moveTo(r.x-t-w+e*h,r.y-w+t-f*h);a.lineTo(r.x+w-t-e*h,r.y-w-t+f*h);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,d,f,e,g,l,h,n){c=f*h*1.118;b=e* -h*1.118;f*=g+h;e*=g+h;var r=d.clone();r.x-=c;r.y-=b;d.x+=1*-f-c;d.y+=1*-e-b;return function(){a.begin();a.moveTo(r.x,r.y);l?a.lineTo(r.x-f-e/2,r.y-e+f/2):a.lineTo(r.x+e/2-f,r.y-e-f/2);a.lineTo(r.x-f,r.y-e);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,d,b,f,e,g,l,h,n,r){e*=l+n;g*=l+n;var u=f.clone();return function(){c.begin();c.moveTo(u.x,u.y);h?c.lineTo(u.x-e-g/a,u.y-g+e/a):c.lineTo(u.x+g/a-e,u.y-g-e/a);c.stroke()}}}(2));if("undefined"!== -typeof mxVertexHandler){var Da=function(a,c,d){return sa(a,["width"],c,function(c,b,f,e,g){g=a.shape.getEdgeWidth()*a.view.scale+d;return new mxPoint(e.x+b*c/4+f*g/2,e.y+f*c/4-b*g/2)},function(c,b,f,e,g,l){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));a.style.width=Math.round(2*c)/a.view.scale-d})},sa=function(a,c,d,b,f){return M(a,c,function(c){var f=a.absolutePoints,e=f.length-1;c=a.view.translate;var g=a.view.scale,l=d?f[0]:f[e],f=d?f[1]:f[e-1],e=f.x-l.x,h=f.y-l.y,n=Math.sqrt(e*e+h* -h),l=b.call(this,n,e/n,h/n,l,f);return new mxPoint(l.x/g-c.x,l.y/g-c.y)},function(c,b,e){var g=a.absolutePoints,l=g.length-1;c=a.view.translate;var h=a.view.scale,n=d?g[0]:g[l],g=d?g[1]:g[l-1],l=g.x-n.x,r=g.y-n.y,u=Math.sqrt(l*l+r*r);b.x=(b.x+c.x)*h;b.y=(b.y+c.y)*h;f.call(this,u,l/u,r/u,n,g,b,e)})},la=function(a){return function(c){return[M(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",A.prototype.arrowWidth))),d=Math.max(0,Math.min(a, +d.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return d}}();mxMarker.addMarker("dash",function(a,c,d,b,f,e,g,k,n,l){var r=f*(g+n+1),u=e*(g+n+1);return function(){a.begin();a.moveTo(b.x-r/2-u/2,b.y-u/2+r/2);a.lineTo(b.x+u/2-3*r/2,b.y-3*u/2-r/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,d,b,f,e,g,k,n,l){var r=f*(g+n+1),u=e*(g+n+1);return function(){a.begin();a.moveTo(b.x-r/2-u/2,b.y-u/2+r/2);a.lineTo(b.x+u/2-3*r/2,b.y-3*u/2-r/2);a.moveTo(b.x- +r/2+u/2,b.y-u/2-r/2);a.lineTo(b.x-u/2-3*r/2,b.y-3*u/2+r/2);a.stroke()}});mxMarker.addMarker("circle",Aa);mxMarker.addMarker("circlePlus",function(a,c,b,d,f,e,g,k,n,l){var r=d.clone(),u=Aa.apply(this,arguments),t=f*(g+2*n),w=e*(g+2*n);return function(){u.apply(this,arguments);a.begin();a.moveTo(r.x-f*n,r.y-e*n);a.lineTo(r.x-2*t+f*n,r.y-2*w+e*n);a.moveTo(r.x-t-w+e*n,r.y-w+t-f*n);a.lineTo(r.x+w-t-e*n,r.y-w-t+f*n);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,d,f,e,g,k,n,l){c=f*n*1.118;b=e* +n*1.118;f*=g+n;e*=g+n;var r=d.clone();r.x-=c;r.y-=b;d.x+=1*-f-c;d.y+=1*-e-b;return function(){a.begin();a.moveTo(r.x,r.y);k?a.lineTo(r.x-f-e/2,r.y-e+f/2):a.lineTo(r.x+e/2-f,r.y-e-f/2);a.lineTo(r.x-f,r.y-e);a.close();l?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,d,b,f,e,g,k,n,l,r){e*=k+l;g*=k+l;var u=f.clone();return function(){c.begin();c.moveTo(u.x,u.y);n?c.lineTo(u.x-e-g/a,u.y-g+e/a):c.lineTo(u.x+g/a-e,u.y-g-e/a);c.stroke()}}}(2));if("undefined"!== +typeof mxVertexHandler){var Da=function(a,c,d){return sa(a,["width"],c,function(c,b,f,e,g){g=a.shape.getEdgeWidth()*a.view.scale+d;return new mxPoint(e.x+b*c/4+f*g/2,e.y+f*c/4-b*g/2)},function(c,b,f,e,g,k){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));a.style.width=Math.round(2*c)/a.view.scale-d})},sa=function(a,c,d,b,f){return M(a,c,function(c){var f=a.absolutePoints,e=f.length-1;c=a.view.translate;var g=a.view.scale,k=d?f[0]:f[e],f=d?f[1]:f[e-1],e=f.x-k.x,n=f.y-k.y,l=Math.sqrt(e*e+n* +n),k=b.call(this,l,e/l,n/l,k,f);return new mxPoint(k.x/g-c.x,k.y/g-c.y)},function(c,b,e){var g=a.absolutePoints,k=g.length-1;c=a.view.translate;var n=a.view.scale,l=d?g[0]:g[k],g=d?g[1]:g[k-1],k=g.x-l.x,r=g.y-l.y,u=Math.sqrt(k*k+r*r);b.x=(b.x+c.x)*n;b.y=(b.y+c.y)*n;f.call(this,u,k/u,r/u,l,g,b,e)})},la=function(a){return function(c){return[M(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",A.prototype.arrowWidth))),d=Math.max(0,Math.min(a, mxUtils.getValue(this.state.style,"arrowSize",A.prototype.arrowSize)));return new mxPoint(c.x+(1-d)*c.width,c.y+(1-b)*c.height/2)},function(c,b){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(c.y+c.height/2-b.y)/c.height*2));this.state.style.arrowSize=Math.max(0,Math.min(a,(c.x+c.width-b.x)/c.width))})]}},ya=function(a,c,b){return function(d){var f=[M(d,["size"],function(b){var d=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style,"size",c)))))*a; return new mxPoint(b.x+d,b.y+d)},function(c,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(c.width,b.x-c.x),Math.min(c.height,b.y-c.y)))/a)})];b&&mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&f.push(ha(d));return f}},ua=function(a,c,b,d,f){b=null!=b?b:1;return function(e){var g=[M(e,["size"],function(c){var b=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,d=parseFloat(mxUtils.getValue(this.state.style,"size",b?f:a));return new mxPoint(c.x+Math.max(0, Math.min(c.width,d*(b?1:c.width))),c.getCenterY())},function(a,c,d){var g=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=g?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));g&&!mxEvent.isAltDown(d.getEvent())&&(a=e.view.graph.snap(a));this.state.style.size=a},null,d)];c&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&g.push(ha(e));return g}},Ea=function(a){return function(c){var b=[M(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style, "size",g.prototype.size))));return new mxPoint(c.x+b*c.width*.75,c.y+c.height/4)},function(c,b){this.state.style.size=Math.max(0,Math.min(a,(b.x-c.x)/(.75*c.width)))},null,!0)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ha(c));return b}},ta=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ha(a));return c}},ha=function(a,c){return M(a,[mxConstants.STYLE_ARCSIZE],function(b){var d=null!=c?c:b.height/8;if("1"==mxUtils.getValue(a.style, mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var f=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,f),b.y+d)}f=Math.max(0,parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(b.x+b.width-Math.min(Math.max(b.width/2,b.height/2),Math.min(b.width,b.height)*f),b.y+d)},function(c,b,d){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)? -this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},M=function(a,c,b,d,f,e){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};g.getPosition=b;g.setPosition=d;g.ignoreGrid=null!=f?f:!0;if(e){var l=g.positionChanged;g.positionChanged= -function(){l.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},za={link:function(a){return[Da(a,!0,10),Da(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(sa(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style, -mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,l,h){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(h.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= -a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(h.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(sa(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/ -5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,l,h){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(h.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= -a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(h.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(sa(a, -["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,l,h){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]= -Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(h.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(h.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(sa(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE], -!1,function(c,b,d,f,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,l,h){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/ -3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(h.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(h.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)- +this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},M=function(a,c,b,d,f,e){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};g.getPosition=b;g.setPosition=d;g.ignoreGrid=null!=f?f:!0;if(e){var k=g.positionChanged;g.positionChanged= +function(){k.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},za={link:function(a){return[Da(a,!0,10),Da(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(sa(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style, +mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,k,n){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,k.x,k.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(n.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= +a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(n.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(sa(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,d,f,e){c=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/ +5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,d,f,e,g,k,n){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,k.x,k.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(n.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= +a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(n.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(sa(a, +["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,d,f,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,k,n){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,k.x,k.y);a.style[mxConstants.STYLE_ENDSIZE]= +Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(n.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(n.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(sa(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE], +!1,function(c,b,d,f,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-d*c/2,f.y+d*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,d,f,e,g,k,n){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,k.x,k.y));d=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-d,k.x,k.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/ +3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(n.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(n.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)- parseFloat(a.style.startWidth))<c&&(a.style.endWidth=a.style.startWidth))})));return b},swimlane:function(a){var c=[M(a,[mxConstants.STYLE_STARTSIZE],function(c){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(c.getCenterX(),c.y+Math.max(0,Math.min(c.height,b))):new mxPoint(c.x+Math.max(0,Math.min(c.width,b)),c.getCenterY())},function(c,b){a.style[mxConstants.STYLE_STARTSIZE]= 1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(c.height,b.y-c.y))):Math.round(Math.max(0,Math.min(c.width,b.x-c.x)))})];if(mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED)){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));c.push(ha(a,b/2))}return c},label:ta(),ext:ta(),rectangle:ta(),triangle:ta(),rhombus:ta(),umlLifeline:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.height, parseFloat(mxUtils.getValue(this.state.style,"size",N.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))},!1)]},umlFrame:function(a){return[M(a,["width","height"],function(a){var c=Math.max(C.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,"width",C.prototype.width))),b=Math.max(1.5*C.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",C.prototype.height))); return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(C.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*C.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},process:function(a){var c=[M(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,"size",n.prototype.size))));return new mxPoint(a.x+a.width*c,a.y+a.height/4)},function(a,c){this.state.style.size=Math.max(0,Math.min(.5, (c.x-a.x)/a.width))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ha(a));return c},cross:function(a){return[M(a,["size"],function(a){var c=Math.min(a.width,a.height),c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",ba.prototype.size)))*c/2;return new mxPoint(a.getCenterX()-c,a.getCenterY()-c)},function(a,c){var b=Math.min(a.width,a.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,a.getCenterY()-c.y)/b*2,Math.max(0,a.getCenterX()-c.x)/b*2)))})]}, -note:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",k.prototype.size)))));return new mxPoint(a.x+a.width-c,a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-c.x),Math.min(a.height,c.y-a.y))))})]},manualInput:function(a){var c=[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",F.prototype.size))); +note:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",h.prototype.size)))));return new mxPoint(a.x+a.width-c,a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-c.x),Math.min(a.height,c.y-a.y))))})]},manualInput:function(a){var c=[M(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",F.prototype.size))); return new mxPoint(a.x+a.width/4,a.y+3*c/4)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,4*(c.y-a.y)/3)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ha(a));return c},dataStorage:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",P.prototype.size))));return new mxPoint(a.x+(1-c)*a.width,a.getCenterY())},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.x+a.width- c.x)/a.width))})]},callout:function(a){var c=[M(a,["size","position"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",w.prototype.size))),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",w.prototype.position)));mxUtils.getValue(this.state.style,"base",w.prototype.base);return new mxPoint(a.x+b*a.width,a.y+a.height-c)},function(a,c){mxUtils.getValue(this.state.style,"base",w.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(a.height, a.y+a.height-c.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(c.x-a.x)/a.width)))/100}),M(a,["position2"],function(a){var c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",w.prototype.position2)));return new mxPoint(a.x+c*a.width,a.y+a.height)},function(a,c){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(c.x-a.x)/a.width)))/100}),M(a,["base"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",w.prototype.size))), @@ -2543,12 +2544,12 @@ Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",p.proto Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",v.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c*a.height/2)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(c.y-a.y)/a.height*2))})]},offPageConnector:function(a){return[M(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",U.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-c)*a.height)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+ a.height-c.y)/a.height))})]},step:ua(r.prototype.size,!0,null,!0,r.prototype.fixedSize),hexagon:ua(y.prototype.size,!0,.5,!0),curlyBracket:ua(u.prototype.size,!1),display:ua(ka.prototype.size,!1),cube:ya(1,a.prototype.size,!1),card:ya(.5,q.prototype.size,!0),loopLimit:ya(.5,Z.prototype.size,!0),trapezoid:Ea(.5),parallelogram:Ea(1)};Graph.createHandle=M;Graph.handleFactory=za;mxVertexHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var a= this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_RECTANGLE);a=za[a];if(null!=a)return a(this.state)}return null};mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_CONNECTOR);a=za[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle= -function(){},Graph.handleFactory={};var va=new mxPoint(1,0),wa=new mxPoint(1,0),la=mxUtils.toRadians(-30),va=mxUtils.getRotatedPoint(va,Math.cos(la),Math.sin(la)),la=mxUtils.toRadians(-150),wa=mxUtils.getRotatedPoint(wa,Math.cos(la),Math.sin(la));mxEdgeStyle.IsometricConnector=function(a,c,b,d,f){var e=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,l=g[0],g=g[g.length-1];null!=d&&(d=e.transformControlPoint(a,d));null==l&&null!=c&&(l=new mxPoint(c.getCenterX(),c.getCenterY()));null== -g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var h=va.x,n=va.y,r=wa.x,u=wa.y,t="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=l){a=function(a,c,b){a-=w.x;var d=c-w.y;c=(u*a-r*d)/(h*u-n*r);a=(n*a-h*d)/(n*r-h*u);t?(b&&(w=new mxPoint(w.x+h*c,w.y+n*c),f.push(w)),w=new mxPoint(w.x+r*a,w.y+u*a)):(b&&(w=new mxPoint(w.x+r*a,w.y+u*a),f.push(w)),w=new mxPoint(w.x+h*c,w.y+n*c));f.push(w)};var w=l;null==d&&(d=new mxPoint(l.x+(g.x-l.x)/2,l.y+(g.y-l.y)/2));a(d.x,d.y, +function(){},Graph.handleFactory={};var va=new mxPoint(1,0),wa=new mxPoint(1,0),la=mxUtils.toRadians(-30),va=mxUtils.getRotatedPoint(va,Math.cos(la),Math.sin(la)),la=mxUtils.toRadians(-150),wa=mxUtils.getRotatedPoint(wa,Math.cos(la),Math.sin(la));mxEdgeStyle.IsometricConnector=function(a,c,b,d,f){var e=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,k=g[0],g=g[g.length-1];null!=d&&(d=e.transformControlPoint(a,d));null==k&&null!=c&&(k=new mxPoint(c.getCenterX(),c.getCenterY()));null== +g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var n=va.x,l=va.y,r=wa.x,u=wa.y,t="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=k){a=function(a,c,b){a-=w.x;var d=c-w.y;c=(u*a-r*d)/(n*u-l*r);a=(l*a-n*d)/(l*r-n*u);t?(b&&(w=new mxPoint(w.x+n*c,w.y+l*c),f.push(w)),w=new mxPoint(w.x+r*a,w.y+u*a)):(b&&(w=new mxPoint(w.x+r*a,w.y+u*a),f.push(w)),w=new mxPoint(w.x+n*c,w.y+l*c));f.push(w)};var w=k;null==d&&(d=new mxPoint(k.x+(g.x-k.x)/2,k.y+(g.y-k.y)/2));a(d.x,d.y, !0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Ja=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Ja.apply(this,arguments)};d.prototype.constraints=[];e.prototype.constraints=[];w.prototype.constraints=[];mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5, 0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)]; mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints= -mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;D.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.constraints=mxRectangleShape.prototype.constraints;q.prototype.constraints=mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;p.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;P.prototype.constraints= +mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;D.prototype.constraints=mxRectangleShape.prototype.constraints;h.prototype.constraints=mxRectangleShape.prototype.constraints;q.prototype.constraints=mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;p.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;P.prototype.constraints= mxRectangleShape.prototype.constraints;ma.prototype.constraints=mxEllipse.prototype.constraints;na.prototype.constraints=mxEllipse.prototype.constraints;ca.prototype.constraints=mxEllipse.prototype.constraints;fa.prototype.constraints=mxEllipse.prototype.constraints;F.prototype.constraints=mxRectangleShape.prototype.constraints;ja.prototype.constraints=mxRectangleShape.prototype.constraints;ka.prototype.constraints=mxRectangleShape.prototype.constraints;Z.prototype.constraints=mxRectangleShape.prototype.constraints; U.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1, .7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];E.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1, @@ -2566,12 +2567,12 @@ U.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.protot .5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];A.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];W.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ba.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1, .5),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];N.prototype.constraints=null;da.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];T.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175, .25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()} -Actions.prototype.init=function(){function a(a){b.escape();var d=b.getDeletableCells(b.getSelectionCells());if(null!=d&&0<d.length){var c=b.model.getParents(d);b.removeCells(d,a);if(null!=c){a=[];for(d=0;d<c.length;d++)b.model.contains(c[d])&&(b.model.isVertex(c[d])||b.model.isEdge(c[d]))&&a.push(c[d]);b.setSelectionCells(a)}}}var d=this.editorUi,e=d.editor,b=e.graph,k=function(){return Action.prototype.isEnabled.apply(this,arguments)&&b.isEnabled()};this.addAction("new...",function(){b.openLink(d.getUrl())}); +Actions.prototype.init=function(){function a(a){b.escape();var d=b.getDeletableCells(b.getSelectionCells());if(null!=d&&0<d.length){var c=b.model.getParents(d);b.removeCells(d,a);if(null!=c){a=[];for(d=0;d<c.length;d++)b.model.contains(c[d])&&(b.model.isVertex(c[d])||b.model.isEdge(c[d]))&&a.push(c[d]);b.setSelectionCells(a)}}}var d=this.editorUi,e=d.editor,b=e.graph,h=function(){return Action.prototype.isEnabled.apply(this,arguments)&&b.isEnabled()};this.addAction("new...",function(){b.openLink(d.getUrl())}); this.addAction("open...",function(){window.openNew=!0;window.openKey="open";d.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){d.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var c=mxUtils.parseXml(a);e.graph.setSelectionCells(e.graph.importGraphModel(c.documentElement))}catch(f){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+f.message)}}));d.showDialog((new OpenDialog(this)).container, -320,220,!0,!0,function(){window.openFile=null})}).isEnabled=k;this.addAction("save",function(){d.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=k;this.addAction("saveAs...",function(){d.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=k;this.addAction("export...",function(){d.showDialog((new ExportDialog(d)).container,300,230,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(d);d.showDialog(a.container,620,420,!0,!1);a.init()});this.addAction("pageSetup...", -function(){d.showDialog((new PageSetupDialog(d)).container,320,220,!0,!0)}).isEnabled=k;this.addAction("print...",function(){d.showDialog((new PrintDialog(d)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(b,null,10,10)});this.addAction("undo",function(){d.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){d.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut", +320,220,!0,!0,function(){window.openFile=null})}).isEnabled=h;this.addAction("save",function(){d.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=h;this.addAction("saveAs...",function(){d.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=h;this.addAction("export...",function(){d.showDialog((new ExportDialog(d)).container,300,230,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(d);d.showDialog(a.container,620,420,!0,!1);a.init()});this.addAction("pageSetup...", +function(){d.showDialog((new PageSetupDialog(d)).container,320,220,!0,!0)}).isEnabled=h;this.addAction("print...",function(){d.showDialog((new PrintDialog(d)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(b,null,10,10)});this.addAction("undo",function(){d.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){d.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut", function(){mxClipboard.cut(b)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){mxClipboard.copy(b)},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&mxClipboard.paste(b)},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(a){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){b.getModel().beginUpdate();try{var d=mxClipboard.paste(b);if(null!=d){a=!0;for(var c=0;c<d.length&& -a;c++)a=a&&b.model.isEdge(d[c]);var f=b.view.translate,e=b.view.scale,u=f.x,t=f.y,f=null;if(1==d.length&&a){var h=b.getCellGeometry(d[0]);null!=h&&(f=h.getTerminalPoint(!0))}f=null!=f?f:b.getBoundingBoxFromGeometry(d,a);if(null!=f){var n=Math.round(b.snap(b.popupMenuHandler.triggerX/e-u)),l=Math.round(b.snap(b.popupMenuHandler.triggerY/e-t));b.cellsMoved(d,n-f.x,l-f.y)}}}finally{b.getModel().endUpdate()}}});this.addAction("copySize",function(a){a=b.getSelectionCell();b.isEnabled()&&null!=a&&b.getModel().isVertex(a)&& +a;c++)a=a&&b.model.isEdge(d[c]);var f=b.view.translate,e=b.view.scale,u=f.x,t=f.y,f=null;if(1==d.length&&a){var l=b.getCellGeometry(d[0]);null!=l&&(f=l.getTerminalPoint(!0))}f=null!=f?f:b.getBoundingBoxFromGeometry(d,a);if(null!=f){var n=Math.round(b.snap(b.popupMenuHandler.triggerX/e-u)),k=Math.round(b.snap(b.popupMenuHandler.triggerY/e-t));b.cellsMoved(d,n-f.x,k-f.y)}}}finally{b.getModel().endUpdate()}}});this.addAction("copySize",function(a){a=b.getSelectionCell();b.isEnabled()&&null!=a&&b.getModel().isVertex(a)&& (a=b.getCellGeometry(a),null!=a&&(d.copiedSize=new mxRectangle(a.x,a.y,a.width,a.height)))},null,null,"Alt+Shit+X");this.addAction("pasteSize",function(a){if(b.isEnabled()&&!b.isSelectionEmpty()&&null!=d.copiedSize){b.getModel().beginUpdate();try{var e=b.getSelectionCells();for(a=0;a<e.length;a++)if(b.getModel().isVertex(e[a])){var c=b.getCellGeometry(e[a]);null!=c&&(c=c.clone(),c.width=d.copiedSize.width,c.height=d.copiedSize.height,b.getModel().setGeometry(e[a],c))}}finally{b.getModel().endUpdate()}}}, null,null,"Alt+Shit+V");this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");this.addAction("deleteAll",function(){a(!0)},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){b.setSelectionCells(b.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){b.turnShapes(b.getSelectionCells())},null,null,Editor.ctrlKey+"+R"));this.addAction("selectVertices", function(){b.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){b.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){b.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){b.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!b.isSelectionEmpty()){b.getModel().beginUpdate();try{var a=b.isCellMovable(b.getSelectionCell())?1:0;b.toggleCellStyles(mxConstants.STYLE_MOVABLE, @@ -2581,8 +2582,8 @@ null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){b.fo d.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=d.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var b=a.getSelectionCell(),c="";if(mxUtils.isNode(b.value)){var f=b.value.getAttribute("tooltip");null!=f&&(c=f)}c=new TextareaDialog(d,mxResources.get("editTooltip")+":",c,function(c){a.setTooltipForCell(b,c)});d.showDialog(c.container,320,200,!0,!0);c.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=b.getLinkForCell(b.getSelectionCell()); null!=a&&b.openLink(a)});this.addAction("editLink...",function(){var a=d.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var b=a.getSelectionCell(),c=a.getLinkForCell(b)||"";d.showLinkDialog(c,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(b,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.addAction("insertLink...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&d.showLinkDialog("",mxResources.get("insert"),function(a,d){a=mxUtils.trim(a);if(0<a.length){var c= null,f=b.getLinkTitle(a);null!=d&&0<d.length&&(c=d[0].iconUrl,f=d[0].name||d[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));var e=b.getFreeInsertPoint(),c=new mxCell(f,new mxGeometry(e.x,e.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:"spacing=10;"));c.vertex=!0;b.setLinkForCell(c,a);b.cellSizeUpdated(c,!0);b.getModel().beginUpdate();try{c=b.addCell(c), -b.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{b.getModel().endUpdate()}b.setSelectionCell(c);b.scrollCellToVisible(b.getSelectionCell())}})}).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=d.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var b=a.getSelectedElement(),c=a.getParentByName(b,"A",a.cellEditor.textarea),f="";if(null==c&&null!=b&&null!=b.getElementsByTagName)for(var e=b.getElementsByTagName("a"),u=0;u<e.length&&null==c;u++)e[u].textContent== -b.textContent&&(a.selectNode(e[u]),c=e[u]);null!=c&&"A"==c.nodeName&&(f=c.getAttribute("href")||"");var t=a.cellEditor.saveSelection();d.showLinkDialog(f,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(t);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=b.getSelectionCells();if(null!=a){b.getModel().beginUpdate();try{for(var d=0;d<a.length;d++){var c= +b.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{b.getModel().endUpdate()}b.setSelectionCell(c);b.scrollCellToVisible(b.getSelectionCell())}})}).isEnabled=h;this.addAction("link...",mxUtils.bind(this,function(){var a=d.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var b=a.getSelectedElement(),c=a.getParentByName(b,"A",a.cellEditor.textarea),f="";if(null==c&&null!=b&&null!=b.getElementsByTagName)for(var e=b.getElementsByTagName("a"),u=0;u<e.length&&null==c;u++)e[u].textContent== +b.textContent&&(a.selectNode(e[u]),c=e[u]);null!=c&&"A"==c.nodeName&&(f=c.getAttribute("href")||"");var t=a.cellEditor.saveSelection();d.showLinkDialog(f,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(t);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=h;this.addAction("autosize",function(){var a=b.getSelectionCells();if(null!=a){b.getModel().beginUpdate();try{for(var d=0;d<a.length;d++){var c= a[d];if(b.getModel().getChildCount(c))b.updateGroupBounds([c],20);else{var f=b.view.getState(c),e=b.getCellGeometry(c);b.getModel().isVertex(c)&&null!=f&&null!=f.text&&null!=e&&b.isWrapping(c)?(e=e.clone(),e.height=f.text.boundingBox.height/b.view.scale,b.getModel().setGeometry(c,e)):b.updateCellSize(c)}}}finally{b.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=b.getView().getState(b.getSelectionCell());if(null!=a){var e="1";b.stopEditing(); b.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,c=b.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var f=document.createElement("div");f.innerHTML=c;c=mxUtils.extractTextWithWhitespace(f.childNodes);b.cellLabelChanged(a.cell,c)}else c=mxUtils.htmlEntities(b.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>")),b.cellLabelChanged(a.cell,b.sanitizeHtml(c)); b.setCellStyles("html",e);d.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=b.getView().getState(b.getSelectionCell()),d="wrap";b.stopEditing();null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(d=null);b.setCellStyles(mxConstants.STYLE_WHITE_SPACE,d)});this.addAction("rotation",function(){var a="0",e=b.getView().getState(b.getSelectionCell()); @@ -2593,9 +2594,9 @@ a.y*b.view.scale-1,b.container.scrollLeft=Math.min(a.x*b.view.scale,(b.container b.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*b.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi, parseInt(100*b.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&d.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var m=null,m=this.addAction("grid",function(){b.setGridEnabled(!b.isGridEnabled());d.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");m.setToggleAction(!0);m.setSelectedCallback(function(){return b.isGridEnabled()});m.setEnabled(!1); m=this.addAction("guides",function(){b.graphHandler.guidesEnabled=!b.graphHandler.guidesEnabled;d.fireEvent(new mxEventObject("guidesEnabledChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.graphHandler.guidesEnabled});m.setEnabled(!1);m=this.addAction("tooltips",function(){b.tooltipHandler.setEnabled(!b.tooltipHandler.isEnabled())});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.tooltipHandler.isEnabled()});m=this.addAction("collapseExpand",function(){var a= -new ChangePageSetup(d);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!b.foldingEnabled;b.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.foldingEnabled});m.isEnabled=k;m=this.addAction("scrollbars",function(){d.setScrollbars(!d.hasScrollbars())});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){d.setPageVisible(!b.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return b.pageVisible}); +new ChangePageSetup(d);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!b.foldingEnabled;b.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.foldingEnabled});m.isEnabled=h;m=this.addAction("scrollbars",function(){d.setScrollbars(!d.hasScrollbars())});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){d.setPageVisible(!b.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return b.pageVisible}); m=this.addAction("connectionArrows",function(){b.connectionArrowsEnabled=!b.connectionArrowsEnabled;d.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");m.setToggleAction(!0);m.setSelectedCallback(function(){return b.connectionArrowsEnabled});m=this.addAction("connectionPoints",function(){b.setConnectable(!b.connectionHandler.isEnabled());d.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(function(){return b.connectionHandler.isEnabled()}); -m=this.addAction("copyConnect",function(){b.connectionHandler.setCreateTarget(!b.connectionHandler.isCreateTarget());d.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.connectionHandler.isCreateTarget()});m.isEnabled=k;m=this.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.editor.autosave});m.isEnabled=k;m.visible=!1;this.addAction("help",function(){var a= +m=this.addAction("copyConnect",function(){b.connectionHandler.setCreateTarget(!b.connectionHandler.isCreateTarget());d.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.connectionHandler.isCreateTarget()});m.isEnabled=h;m=this.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.editor.autosave});m.isEnabled=h;m.visible=!1;this.addAction("help",function(){var a= "";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);b.openLink(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(d.showDialog((new AboutDialog(d)).container,320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));m=mxUtils.bind(this,function(a,d,c,f){return this.addAction(a,function(){if(null!=c&&b.cellEditor.isContentEditing())c();else{b.stopEditing(!1);b.getModel().beginUpdate();try{b.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE, d),(d&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?b.updateLabelElements(b.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&b.replaceElement(a)}):(d&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?b.updateLabelElements(b.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&b.replaceElement(a)}):(d&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.updateLabelElements(b.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&& b.replaceElement(a)})}finally{b.getModel().endUpdate()}}},null,null,f)});m("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");m("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");m("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){d.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")}); @@ -2611,13 +2612,13 @@ mxUtils.bind(this,function(){var a=b.getSelectionCells();if(null!=a&&0<a.length) b.getCellGeometry(a);g=Math.round(b.snap(b.popupMenuHandler.triggerX/f-g));f=Math.round(b.snap(b.popupMenuHandler.triggerY/f-c));d.addPointAt(d.state,g,f)}}});this.addAction("removeWaypoint",function(){var a=d.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=b.getSelectionCells();if(null!=a){a=b.addAllEdges(a);b.getModel().beginUpdate();try{for(var d=0;d<a.length;d++){var c=a[d];if(b.getModel().isEdge(c)){var f= b.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,b.getModel().setGeometry(c,f))}}}finally{b.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this,function(){b.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){b.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...", function(){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=b.getView().getState(b.getSelectionCell()),c="";null!=e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=b.cellEditor.saveSelection();d.showImageDialog(a,c,function(a,c,d){if(b.cellEditor.isContentEditing())b.cellEditor.restoreSelection(f),b.insertImage(a,c,d);else{var e=b.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;b.getModel().beginUpdate(); -try{if(0==e.length){var l=b.getFreeInsertPoint(),g=e=[b.insertVertex(b.getDefaultParent(),null,"",l.x,l.y,c,d,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];b.fireEvent(new mxEventObject("cellsInserted","cells",g))}b.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var u=b.view.getState(e[0]),r=null!=u?u.style:b.getCellStyle(e[0]);"image"!=r[mxConstants.STYLE_SHAPE]&&"label"!=r[mxConstants.STYLE_SHAPE]?b.setCellStyles(mxConstants.STYLE_SHAPE,"image", -e):0==a.length&&b.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==b.getSelectionCount()&&null!=c&&null!=d){var t=e[0],k=b.getModel().getGeometry(t);null!=k&&(k=k.clone(),k.width=c,k.height=d,b.getModel().setGeometry(t,k))}}finally{b.getModel().endUpdate()}null!=g&&(b.setSelectionCells(g),b.scrollCellToVisible(g[0]))}}},b.cellEditor.isContentEditing(),!b.cellEditor.isContentEditing())}}).isEnabled=k;this.addAction("insertImage...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&& -(b.clearSelection(),d.actions.get("image").funct())}).isEnabled=k;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(d,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){d.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("layers"))): +try{if(0==e.length){var k=b.getFreeInsertPoint(),g=e=[b.insertVertex(b.getDefaultParent(),null,"",k.x,k.y,c,d,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];b.fireEvent(new mxEventObject("cellsInserted","cells",g))}b.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var u=b.view.getState(e[0]),r=null!=u?u.style:b.getCellStyle(e[0]);"image"!=r[mxConstants.STYLE_SHAPE]&&"label"!=r[mxConstants.STYLE_SHAPE]?b.setCellStyles(mxConstants.STYLE_SHAPE,"image", +e):0==a.length&&b.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==b.getSelectionCount()&&null!=c&&null!=d){var t=e[0],h=b.getModel().getGeometry(t);null!=h&&(h=h.clone(),h.width=c,h.height=d,b.getModel().setGeometry(t,h))}}finally{b.getModel().endUpdate()}null!=g&&(b.setSelectionCells(g),b.scrollCellToVisible(g[0]))}}},b.cellEditor.isContentEditing(),!b.cellEditor.isContentEditing())}}).isEnabled=h;this.addAction("insertImage...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&& +(b.clearSelection(),d.actions.get("image").funct())}).isEnabled=h;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(d,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){d.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("layers"))): this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));m=this.addAction("formatPanel",mxUtils.bind(this,function(){d.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return 0<d.formatWidth}));m=this.addAction("outline", mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(d,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){d.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null, -null,Editor.ctrlKey+"+Shift+O");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,d,e,b,k){var m;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),m=mxResources.get(a)+"..."):m=mxResources.get(a);return this.put(a,new Action(m,d,e,b,k))};Actions.prototype.put=function(a,d){return this.actions[a]=d};Actions.prototype.get=function(a){return this.actions[a]}; -function Action(a,d,e,b,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(d);this.enabled=null!=e?e:!0;this.iconCls=b;this.shortcut=k;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled}; +null,Editor.ctrlKey+"+Shift+O");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,d,e,b,h){var m;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),m=mxResources.get(a)+"..."):m=mxResources.get(a);return this.put(a,new Action(m,d,e,b,h))};Actions.prototype.put=function(a,d){return this.actions[a]=d};Actions.prototype.get=function(a){return this.actions[a]}; +function Action(a,d,e,b,h){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(d);this.enabled=null!=e?e:!0;this.iconCls=b;this.shortcut=h;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled}; Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(a,d){mxEventSource.call(this);this.ui=a;this.data=d||""};mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))}; DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.save=function(a,d,e,b){this.updateFileData();this.clearAutosave()};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};DrawioFile.prototype.saveAs=function(a,d,e){};DrawioFile.prototype.saveFile=function(a,d,e,b){};DrawioFile.prototype.getPublicUrl=function(a){a(null)}; DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,d,e){};DrawioFile.prototype.isMovable=function(){return!1}; @@ -2631,8 +2632,8 @@ DrawioFile.prototype.autosave=function(a,d,e,b){null==this.lastAutosave&&(this.l mxUtils.bind(this,function(a){null!=b&&b(a)}))}else null!=e&&e(null)}),a)};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 a=(new Date).getTime();return null==this.lastAutosaveRevision||a-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay}; DrawioFile.prototype.close=function(a){this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,d){if(null!=a&&null!=d){var e=a.lastIndexOf("."),b=0<e?a.substring(e):"",e=d.lastIndexOf(".");return b===(0<e?d.substring(e):"")}return a==d}; DrawioFile.prototype.destroy=function(){this.clearAutosave();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)};LocalFile=function(a,d,e,b){DrawioFile.call(this,a,d);this.title=e;this.mode=b?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,d,e){this.saveAs(this.title,d,e)};LocalFile.prototype.saveAs=function(a,d,e){this.saveFile(a,!1,d,e)}; -LocalFile.prototype.saveFile=function(a,d,e,b){this.title=a;this.updateFileData();d=this.getData();var k=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),m=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,k?"image/png":"text/xml",k);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+ -(k?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});k?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a)}),b,this.ui.getCurrentFile()!=this?this.getData():null):m(d)};LocalFile.prototype.rename=function(a,d,e){this.title=a;this.descriptorChanged();null!=d&&d()}; +LocalFile.prototype.saveFile=function(a,d,e,b){this.title=a;this.updateFileData();d=this.getData();var h=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),m=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,h?"image/png":"text/xml",h);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+ +(h?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});h?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a)}),b,this.ui.getCurrentFile()!=this?this.getData():null):m(d)};LocalFile.prototype.rename=function(a,d,e){this.title=a;this.descriptorChanged();null!=d&&d()}; LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.changeListener=mxUtils.bind(this,function(a,d){this.setModified(!0);this.addUnsavedStatus()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener)};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC": IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=": IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==": @@ -2656,7 +2657,7 @@ function(){b.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&null!= {jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],"HTML-CSS":{imageFont:null},TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}});MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};Editor.MathJaxRender=function(a){"undefined"!== typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var b=Editor.prototype.init;Editor.prototype.init=function(){b.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,c){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var d=document.getElementsByTagName("script");if(null!=d&&0<d.length){var f=document.createElement("script"); f.type="text/javascript";f.src=a;d[0].parentNode.appendChild(f)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;var c=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,function(a,b,d,f){void 0!== -b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.replace(/\\"/g,'"')):void 0!==f&&c.push(f);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var k=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){k.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var m=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){m.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&& +b?c.push(b.replace(/\\'/g,"'")):void 0!==d?c.push(d.replace(/\\"/g,'"')):void 0!==f&&c.push(f);return""});/,\s*$/.test(a)&&c.push("");return c};if(window.ColorDialog){var h=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){h.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var m=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){m.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&& (EditDataDialog.getDisplayIdForCell=function(a,c){var b=null;null!=a.editor.graph.getModel().getParent(c)?b=c.getId():null!=a.currentPage&&(b=a.currentPage.getId());return b});if(null!=window.StyleFormatPanel){var p=Format.prototype.init;Format.prototype.init=function(){p.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless? q.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile();return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var v=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=v.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,d=this.createOption(mxResources.get("shadow"), function(){return b.shadowVisible},function(a){var d=new ChangePageSetup(c);d.ignoreColor=!0;d.ignoreImage=!0;d.shadowVisible=a;b.model.execute(d)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});Editor.shadowOptionEnabled||(d.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(d,60));a.appendChild(d)}return a};var c=DiagramFormatPanel.prototype.addOptions; @@ -2670,18 +2671,18 @@ mxUtils.button("",function(c){d.getModel().beginUpdate();try{var b=d.getSelectio "#000000"),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,null));d.getModel().setStyle(b[c],f)}}finally{d.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";null!=a?(null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?c.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":c.style.backgroundImage="linear-gradient("+ a.fill+" 0px,"+a.gradient+" 100%)":c.style.backgroundColor=a.fill,c.style.border="1px solid "+a.stroke):(c.style.backgroundColor="#ffffff",c.style.border="1px solid #000000");f.appendChild(c)}f.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(f),c(a[b])}function b(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var d=this.editorUi.editor.graph,f=document.createElement("div");f.style.whiteSpace= "nowrap";f.style.paddingLeft="24px";f.style.paddingRight="20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(f);var e="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var g=document.createElement("div");g.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);"; -mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var l=document.createElement("div");l.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);"; -1<this.defaultColorSchemes.length&&(a.appendChild(g),a.appendChild(l));mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(g);b(l);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&& +mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var k=document.createElement("div");k.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);"; +1<this.defaultColorSchemes.length&&(a.appendChild(g),a.appendChild(k));mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(g);b(k);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&& (b=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var d=this.editorUi.editor.graph,f=d.view.getState(d.getSelectionCell());1==d.getSelectionCount()&&null!=f&&null!=f.shape&&null!=f.shape.stencil?(c=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this, function(a){this.editorUi.actions.get("editShape").funct()})),c.setAttribute("title",mxResources.get("editShape")),c.style.marginBottom="2px",null==b?c.style.width="202px":(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c)):c.image&&(c=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),c.setAttribute("title",mxResources.get("editImage")),c.style.marginBottom="2px",null==b?c.style.width="202px": (b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c));return a}}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.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize= "3";Graph.prototype.edgeMode="move"!=urlParams.edge;var u=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}u.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint; this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(this,arguments)};var d=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var c=this.graph.view.getState(a),c=null!=c?c.style:this.graph.getCellStyle(a);if("undefined"!=typeof mxRackContainer&&"rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,c){c.height=Math.max(c.height,20);if(1<c.height/20){var b=c.height%20;c.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a, c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.resizeParent=!1;return b}return d.apply(this,arguments)}};var t=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){t.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"==a.substring(0,17)&&(a=JSON.parse(a.substring(17)),null!=a.actions)){for(var c= -0;c<a.actions.length;c++)null!=a.actions[c].open&&(this.isCustomLink(a.actions[c].open)?this.customLinkClicked(a.actions[c].open):this.openLink(a.actions[c].open));this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)this.handleLinkAction(a.actions[c])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var c=[];null!=a.select&&this.isEnabled()&&(c=this.getCellsForAction(a.select),this.setSelectionCells(c));null!=a.scroll&&(c=this.getCellsForAction(a.scroll));null!= -a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.highlight&&(c=this.getCellsForAction(a.highlight),this.highlightCells(c,a.highlight.color,a.highlight.duration,a.highlight.opacity));0<c.length&&this.scrollCellToVisible(c[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))}; +0;c<a.actions.length;c++)null!=a.actions[c].open&&(this.isCustomLink(a.actions[c].open)?this.customLinkClicked(a.actions[c].open):this.openLink(a.actions[c].open));this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)this.handleLinkAction(a.actions[c])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var c=[];null!=a.select&&this.isEnabled()&&(c=this.getCellsForAction(a.select),this.setSelectionCells(c));null!=a.highlight&&(c=this.getCellsForAction(a.highlight), +this.highlightCells(c,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.scroll&&(c=this.getCellsForAction(a.scroll));0<c.length&&this.scrollCellToVisible(c[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))}; Graph.prototype.getCellsById=function(a){var c=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var d=this.getDefaultParent(),c=c.concat(this.model.filterDescendants(function(a){return a!=d},d));else{var f=this.model.getCell(a[b]);null!=f&&c.push(f)}return c};Graph.prototype.getCellsForTags=function(a,c,b){var d=[];if(null!=a){c=null!=c?c:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var f=0;f<c.length;f++)if(this.model.isVertex(c[f])||this.model.isEdge(c[f])){var e= -null!=c[f].value&&"object"==typeof c[f].value?mxUtils.trim(c[f].value.getAttribute(b)||""):"",g=!0;if(0<e.length)for(var e=e.toLowerCase().split(" "),l=0;l<a.length&&g;l++)var h=mxUtils.trim(a[l]).toLowerCase(),g=g&&(0==h.length||0<=mxUtils.indexOf(e,h));else g=0==a.length;g&&d.push(c[f])}}return d};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],!this.model.isVisible(a[c]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible= +null!=c[f].value&&"object"==typeof c[f].value?mxUtils.trim(c[f].value.getAttribute(b)||""):"",g=!0;if(0<e.length)for(var e=e.toLowerCase().split(" "),k=0;k<a.length&&g;k++)var n=mxUtils.trim(a[k]).toLowerCase(),g=g&&(0==n.length||0<=mxUtils.indexOf(e,n));else g=0==a.length;g&&d.push(c[f])}}return d};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],!this.model.isVisible(a[c]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible= function(a,c){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],c)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,c,b,d){for(var f=0;f<a.length;f++)this.highlightCell(a[f],c,b,d)};Graph.prototype.highlightCell=function(a,c,b,d){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var f=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),e=new mxCellHighlight(this,c,f,!1);null!= d&&(e.opacity=d);e.highlight(a);window.setTimeout(function(){null!=e.shape&&(mxUtils.setPrefixedStyle(e.shape.node.style,"transition","all 1200ms ease-in-out"),e.shape.node.style.opacity=0);window.setTimeout(function(){e.destroy()},1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;var d=a.ownerDocument,f=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"filter"):d.createElement("filter");f.setAttribute("id",this.shadowId);var e=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG, "feGaussianBlur"):d.createElement("feGaussianBlur");e.setAttribute("in","SourceAlpha");e.setAttribute("stdDeviation",this.svgShadowBlur);e.setAttribute("result","blur");f.appendChild(e);e=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"feOffset"):d.createElement("feOffset");e.setAttribute("in","blur");e.setAttribute("dx",this.svgShadowSize);e.setAttribute("dy",this.svgShadowSize);e.setAttribute("result","offsetBlur");f.appendChild(e);e=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG, @@ -2695,47 +2696,47 @@ c,b=0;do c=this.model.getChildAt(this.model.root,b);while(b++<a&&"1"==mxUtils.ge [SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl= [SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js", STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c= -null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var h=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,d,f,e,g,n,u,t){if(null!=b&&null==mxMarker.markers[b]){var l=this.getPackageForType(b);null!=l&&mxStencilRegistry.getStencil(l)}return h.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){w.value=Math.max(1,Math.min(h,Math.max(parseInt(w.value),parseInt(k.value))));k.value=Math.max(1,Math.min(h, -Math.min(parseInt(w.value),parseInt(k.value))))}function d(c){function b(c,b,f){var e=c.getGraphBounds(),g=0,h=0,l=da.get(),n=1/c.pageScale,u=v.checked;if(u)var n=parseInt(W.value),t=parseInt(P.value),n=Math.min(l.height*t/(e.height/c.view.scale),l.width*n/(e.width/c.view.scale));else n=parseInt(q.value)/(100*c.pageScale),isNaN(n)&&(d=1/c.pageScale,q.value="100 %");l=mxRectangle.fromRectangle(l);l.width=Math.ceil(l.width*d);l.height=Math.ceil(l.height*d);n*=d;!u&&c.pageVisible?(e=c.getPageLayout(), -g-=e.x*l.width,h-=e.y*l.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(c,n,l,0,g,h,u);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var r=b.writeHead;b.writeHead=function(c){r.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var k=b.renderPage;b.renderPage=function(a,c,b,d,f,e){var g=k.apply(this,arguments);this.graph.mathEnabled? -this.mathEnabled=!0:g.className="geDisableMathJax";return g}}b.open(null,null,f,!0)}else{l=c.background;if(null==l||""==l||l==mxConstants.NONE)l="#ffffff";b.backgroundColor=l;b.autoOrigin=u;b.appendGraph(c,n,g,h,f,!0)}return b}var d=parseInt(T.value)/100;isNaN(d)&&(d=1,T.value="100 %");var d=.75*d,e=k.value,g=w.value,h=!u.checked,n=null;h&&(h=e==l&&g==l);if(!h&&null!=a.pages&&a.pages.length){var t=0,h=a.pages.length-1;u.checked||(t=parseInt(e)-1,h=parseInt(g)-1);for(var r=t;r<=h;r++){var m=a.pages[r], +null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var l=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,d,f,e,g,n,u,t){if(null!=b&&null==mxMarker.markers[b]){var k=this.getPackageForType(b);null!=k&&mxStencilRegistry.getStencil(k)}return l.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){w.value=Math.max(1,Math.min(n,Math.max(parseInt(w.value),parseInt(h.value))));h.value=Math.max(1,Math.min(n, +Math.min(parseInt(w.value),parseInt(h.value))))}function d(c){function b(c,b,f){var e=c.getGraphBounds(),g=0,n=0,k=da.get(),l=1/c.pageScale,u=v.checked;if(u)var l=parseInt(W.value),t=parseInt(P.value),l=Math.min(k.height*t/(e.height/c.view.scale),k.width*l/(e.width/c.view.scale));else l=parseInt(q.value)/(100*c.pageScale),isNaN(l)&&(d=1/c.pageScale,q.value="100 %");k=mxRectangle.fromRectangle(k);k.width=Math.ceil(k.width*d);k.height=Math.ceil(k.height*d);l*=d;!u&&c.pageVisible?(e=c.getPageLayout(), +g-=e.x*k.width,n-=e.y*k.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(c,l,k,0,g,n,u);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var r=b.writeHead;b.writeHead=function(c){r.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var h=b.renderPage;b.renderPage=function(a,c,b,d,f,e){var g=h.apply(this,arguments);this.graph.mathEnabled? +this.mathEnabled=!0:g.className="geDisableMathJax";return g}}b.open(null,null,f,!0)}else{k=c.background;if(null==k||""==k||k==mxConstants.NONE)k="#ffffff";b.backgroundColor=k;b.autoOrigin=u;b.appendGraph(c,l,g,n,f,!0)}return b}var d=parseInt(T.value)/100;isNaN(d)&&(d=1,T.value="100 %");var d=.75*d,e=h.value,g=w.value,n=!u.checked,l=null;n&&(n=e==k&&g==k);if(!n&&null!=a.pages&&a.pages.length){var t=0,n=a.pages.length-1;u.checked||(t=parseInt(e)-1,n=parseInt(g)-1);for(var r=t;r<=n;r++){var m=a.pages[r], e=m==a.currentPage?f:null;if(null==e){var e=a.createTemporaryGraph(f.getStylesheet()),g=!0,t=!1,p=null,y=null;null==m.viewState&&null==m.mapping&&null==m.root&&a.updatePageRoot(m);null!=m.viewState?(g=m.viewState.pageVisible,t=m.viewState.mathEnabled,p=m.viewState.background,y=m.viewState.backgroundImage):null!=m.mapping&&null!=m.mapping.diagramMap&&(t="0"!=m.mapping.diagramMap.get("mathEnabled"),p=m.mapping.diagramMap.get("background"),y=m.mapping.diagramMap.get("backgroundImage"),y=null!=y&&0<y.length? -JSON.parse(y):null);e.background=p;e.backgroundImage=null!=y?new mxImage(y.src,y.width,y.height):null;e.pageVisible=g;e.mathEnabled=t;var B=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?r+1:B.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(m);e.model.setRoot(m.root)}n=b(e,n,r!=h);e!=f&&e.container.parentNode.removeChild(e.container)}}else n=b(f);n.mathEnabled&&(h=n.wnd.document,h.writeln('<script type="text/x-mathjax-config">'), -h.writeln("MathJax.Hub.Config({"),h.writeln('messageStyle: "none",'),h.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),h.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),h.writeln('"HTML-CSS": {'),h.writeln("imageFont: null"),h.writeln("},"),h.writeln("TeX: {"),h.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),h.writeln("},"),h.writeln("tex2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("},"), -h.writeln("asciimath2jax: {"),h.writeln('\tignoreClass: "geDisableMathJax"'),h.writeln("}"),h.writeln("});"),c&&(h.writeln("MathJax.Hub.Queue(function () {"),h.writeln("window.print();"),h.writeln("});")),h.writeln("\x3c/script>"),h.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>'));n.closeDocument();!n.mathEnabled&&c&&PrintDialog.printPreview(n)}var f=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");g.style.width="100%"; -g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var h=1,l=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");n.appendChild(u);g=document.createElement("span");mxUtils.write(g, -mxResources.get("printAllPages"));n.appendChild(g);mxUtils.br(n);var t=u.cloneNode(!0);u.setAttribute("checked","checked");t.setAttribute("value","range");n.appendChild(t);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");n.appendChild(g);var k=document.createElement("input");k.style.cssText="margin:0 8px 0 8px;";k.setAttribute("value","1");k.setAttribute("type","number");k.setAttribute("min","1");k.style.width="50px";n.appendChild(k);g=document.createElement("span"); -mxUtils.write(g,mxResources.get("to"));n.appendChild(g);var w=k.cloneNode(!0);n.appendChild(w);mxEvent.addListener(k,"focus",function(){t.checked=!0});mxEvent.addListener(w,"focus",function(){t.checked=!0});mxEvent.addListener(k,"change",b);mxEvent.addListener(w,"change",b);if(null!=a.pages&&(h=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){l=g+1;k.value=l;w.value=l;break}k.setAttribute("max",h);w.setAttribute("max",h);1<h&&e.appendChild(n);var m=document.createElement("div"); +JSON.parse(y):null);e.background=p;e.backgroundImage=null!=y?new mxImage(y.src,y.width,y.height):null;e.pageVisible=g;e.mathEnabled=t;var B=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?r+1:B.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(m);e.model.setRoot(m.root)}l=b(e,l,r!=n);e!=f&&e.container.parentNode.removeChild(e.container)}}else l=b(f);l.mathEnabled&&(n=l.wnd.document,n.writeln('<script type="text/x-mathjax-config">'), +n.writeln("MathJax.Hub.Config({"),n.writeln('messageStyle: "none",'),n.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),n.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),n.writeln('"HTML-CSS": {'),n.writeln("imageFont: null"),n.writeln("},"),n.writeln("TeX: {"),n.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),n.writeln("},"),n.writeln("tex2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("},"), +n.writeln("asciimath2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("}"),n.writeln("});"),c&&(n.writeln("MathJax.Hub.Queue(function () {"),n.writeln("window.print();"),n.writeln("});")),n.writeln("\x3c/script>"),n.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>'));l.closeDocument();!l.mathEnabled&&c&&PrintDialog.printPreview(l)}var f=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");g.style.width="100%"; +g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var n=1,k=1,l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");l.appendChild(u);g=document.createElement("span");mxUtils.write(g, +mxResources.get("printAllPages"));l.appendChild(g);mxUtils.br(l);var t=u.cloneNode(!0);u.setAttribute("checked","checked");t.setAttribute("value","range");l.appendChild(t);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");l.appendChild(g);var h=document.createElement("input");h.style.cssText="margin:0 8px 0 8px;";h.setAttribute("value","1");h.setAttribute("type","number");h.setAttribute("min","1");h.style.width="50px";l.appendChild(h);g=document.createElement("span"); +mxUtils.write(g,mxResources.get("to"));l.appendChild(g);var w=h.cloneNode(!0);l.appendChild(w);mxEvent.addListener(h,"focus",function(){t.checked=!0});mxEvent.addListener(w,"focus",function(){t.checked=!0});mxEvent.addListener(h,"change",b);mxEvent.addListener(w,"change",b);if(null!=a.pages&&(n=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){k=g+1;h.value=k;w.value=k;break}h.setAttribute("max",n);w.setAttribute("max",n);1<n&&e.appendChild(l);var m=document.createElement("div"); m.style.marginBottom="10px";var p=document.createElement("input");p.style.marginRight="8px";p.setAttribute("value","adjust");p.setAttribute("type","radio");p.setAttribute("name","printZoom");m.appendChild(p);g=document.createElement("span");mxUtils.write(g,mxResources.get("adjustTo"));m.appendChild(g);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","100 %");q.style.width="50px";m.appendChild(q);mxEvent.addListener(q,"focus",function(){p.checked=!0}); -e.appendChild(m);var n=n.cloneNode(!1),v=p.cloneNode(!0);v.setAttribute("value","fit");p.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(v);n.appendChild(g);m=document.createElement("table");m.style.display="inline-block";var Q=document.createElement("tbody"),S=document.createElement("tr"),K=S.cloneNode(!0),F=document.createElement("td"),V=F.cloneNode(!0),L=F.cloneNode(!0),O=F.cloneNode(!0), +e.appendChild(m);var l=l.cloneNode(!1),v=p.cloneNode(!0);v.setAttribute("value","fit");p.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(v);l.appendChild(g);m=document.createElement("table");m.style.display="inline-block";var Q=document.createElement("tbody"),S=document.createElement("tr"),K=S.cloneNode(!0),F=document.createElement("td"),V=F.cloneNode(!0),L=F.cloneNode(!0),O=F.cloneNode(!0), X=F.cloneNode(!0),A=F.cloneNode(!0);F.style.textAlign="right";O.style.textAlign="right";mxUtils.write(F,mxResources.get("fitTo"));var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","1");W.setAttribute("min","1");W.setAttribute("type","number");W.style.width="40px";V.appendChild(W);g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsAcross"));L.appendChild(g);mxUtils.write(O,mxResources.get("fitToBy"));var P=W.cloneNode(!0);X.appendChild(P); -mxEvent.addListener(W,"focus",function(){v.checked=!0});mxEvent.addListener(P,"focus",function(){v.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));A.appendChild(g);S.appendChild(F);S.appendChild(V);S.appendChild(L);K.appendChild(O);K.appendChild(X);K.appendChild(A);Q.appendChild(S);Q.appendChild(K);m.appendChild(Q);n.appendChild(m);e.appendChild(n);n=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom= -"12px";mxUtils.write(g,mxResources.get("paperSize"));n.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var da=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));n.appendChild(g);var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value","100 %");T.style.width="60px";n.appendChild(T); -e.appendChild(n);g=document.createElement("div");g.style.cssText="text-align:right;margin:62px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&g.appendChild(n);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",g.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog(); -d(!1)}),m.className="geBtn",g.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});m.className="geBtn gePrimaryBtn";g.appendChild(m);a.editor.cancelFirst||g.appendChild(n);e.appendChild(g);this.container=e};var n=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background= +mxEvent.addListener(W,"focus",function(){v.checked=!0});mxEvent.addListener(P,"focus",function(){v.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));A.appendChild(g);S.appendChild(F);S.appendChild(V);S.appendChild(L);K.appendChild(O);K.appendChild(X);K.appendChild(A);Q.appendChild(S);Q.appendChild(K);m.appendChild(Q);l.appendChild(m);e.appendChild(l);l=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom= +"12px";mxUtils.write(g,mxResources.get("paperSize"));l.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var da=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);l.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));l.appendChild(g);var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value","100 %");T.style.width="60px";l.appendChild(T); +e.appendChild(l);g=document.createElement("div");g.style.cssText="text-align:right;margin:62px 0 0 0;";l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst&&g.appendChild(l);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",g.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog(); +d(!1)}),m.className="geBtn",g.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});m.className="geBtn gePrimaryBtn";g.appendChild(m);a.editor.cancelFirst||g.appendChild(l);e.appendChild(g);this.container=e};var n=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background= this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(n.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!= this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})(); (function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};a.afterDecode=function(a,e,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="@DRAWIO-VERSION@";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";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.sidebarFooterHeight=36;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.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport= !1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(t){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport= -null!=a&&6<a.length}catch(h){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(t){}try{b=document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(t){}})(); +null!=a&&6<a.length}catch(l){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(t){}try{b=document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(t){}})(); EditorUi.prototype.openLink=function(a,b){return this.editor.graph.openLink(a,b)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh(); this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12, length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color="white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",g.style.paddingLeft="10px",g.style.paddingRight= "10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),g.innerHTML=e+"...",d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0, b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+ (a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(u){}return!1}; -var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var t=mxUtils.parseXml(c),h=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!= -h?mxUtils.getXml(h):""}catch(n){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate(); -try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,h,0==e?h:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"), -this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,e,t,h,n,l,k,r){b=null!= -b?b:this.editor.graph;t=null!=t?t:!1;k=null!=k?k:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var u=b.zapGremlins(mxUtils.getXml(a)),g=b.compress(u);if(b.decompress(g)!=u)return u;u=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(u,g);g=a.ownerDocument.createElement("mxfile");g.appendChild(u)}r?(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"), -g.removeAttribute("editor"),g.removeAttribute("type")):(g.setAttribute("userAgent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("editor","www.draw.io"),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!h&&!t&&(n||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(h||!t&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!= -App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,l,k,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var f=0;f<this.pages.length;f++){var e=this.pages[f].mapping; -this.currentPage!=this.pages[f]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[f].node,d),e.needsUpdate=!1);c.appendChild(this.pages[f].node)}}return c};EditorUi.prototype.getFileData=function(a,b,d,e,t,h,n,l,k){t=null!=t?t:!0;n=null!=n?n:this.getXmlFileData(t,null!=h?h:!1);k=null!=k?k:this.getCurrentFile();h=this.editor.graph; -if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=k&&/(\.svg)$/i.test(k.getTitle()))){h=this.createTemporaryGraph(h.getStylesheet());var c=h.getGlobalVariable,f=this.pages[0];h.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:c.apply(this,arguments)};document.body.appendChild(h.container);h.model.setRoot(f.root)}a=this.createFileData(n,h,k,window.location.href,a,b,d,e,t,l);h!=this.editor.graph&&h.container.parentNode.removeChild(h.container);return a}; -EditorUi.prototype.getHtml=function(a,b,d,e,t,h){h=null!=h?h:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=h?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),g=b.view.scale;h=Math.floor(c.x/g-b.view.translate.x);g=Math.floor(c.y/g-b.view.translate.y);c=b.background;null==t&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",h);a.setAttribute("y0",g)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom", +var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var t=mxUtils.parseXml(c),l=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!= +l?mxUtils.getXml(l):""}catch(n){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length))}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate(); +try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var l=this.updatePageRoot(new DiagramPage(d[e]));null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,l,0==e?l:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"), +this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,e,t,l,n,k,h,r){b=null!= +b?b:this.editor.graph;t=null!=t?t:!1;h=null!=h?h:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var u=b.zapGremlins(mxUtils.getXml(a)),g=b.compress(u);if(b.decompress(g)!=u)return u;u=a.ownerDocument.createElement("diagram");mxUtils.setTextContent(u,g);g=a.ownerDocument.createElement("mxfile");g.appendChild(u)}r?(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"), +g.removeAttribute("editor"),g.removeAttribute("type")):(g.setAttribute("userAgent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("editor","www.draw.io"),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!l&&!t&&(n||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(l||!t&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!= +App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,k,h,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage){var d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,d);c=this.fileNode.cloneNode(!1);if(b)c.appendChild(this.currentPage.node);else for(var f=0;f<this.pages.length;f++){var e=this.pages[f].mapping; +this.currentPage!=this.pages[f]&&null!=e&&e.needsUpdate&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(d),d=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(d))),mxUtils.setTextContent(this.pages[f].node,d),e.needsUpdate=!1);c.appendChild(this.pages[f].node)}}return c};EditorUi.prototype.getFileData=function(a,b,d,e,t,l,n,k,h){t=null!=t?t:!0;n=null!=n?n:this.getXmlFileData(t,null!=l?l:!1);h=null!=h?h:this.getCurrentFile();l=this.editor.graph; +if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=h&&/(\.svg)$/i.test(h.getTitle()))){l=this.createTemporaryGraph(l.getStylesheet());var c=l.getGlobalVariable,f=this.pages[0];l.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:c.apply(this,arguments)};document.body.appendChild(l.container);l.model.setRoot(f.root)}a=this.createFileData(n,l,h,window.location.href,a,b,d,e,t,k);l!=this.editor.graph&&l.container.parentNode.removeChild(l.container);return a}; +EditorUi.prototype.getHtml=function(a,b,d,e,t,l){l=null!=l?l:!0;var c=null,f="https://www.draw.io/js/embed-static.min.js";if(null!=b){var c=l?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),g=b.view.scale;l=Math.floor(c.x/g-b.view.translate.x);g=Math.floor(c.y/g-b.view.translate.y);c=b.background;null==t&&(b=this.getBasenames().join(";"),0<b.length&&(f="https://www.draw.io/embed.js?s="+b));a.setAttribute("x0",l);a.setAttribute("y0",g)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom", "1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=t&&(t=t.replace(/&/g,"&"));a=null!=a?this.editor.graph.zapGremlins(mxUtils.getXml(a)):"";e=this.editor.graph.compress(a);this.editor.graph.decompress(e)!=a&&(e=encodeURIComponent(a));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!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+"</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="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,e,t){null!=t&&(t=t.replace(/&/g,"&"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:this.editor.graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages, @@ -2743,48 +2744,48 @@ this.currentPage));return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compati mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==t?'<script type="text/javascript" src="https://www.draw.io/js/viewer.min.js">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;var c=null!=a&&0<a.length? mxUtils.parseXml(a).documentElement:null;a=null!=c?this.editor.extractGraphModel(c,!0):null;null!=a&&(c=a);if(null!=c&&"mxfile"==c.nodeName&&(a=c.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<a.length||1==a.length&&a[0].hasAttribute("name"))){this.fileNode=c;this.pages=[];for(c=0;c<a.length;c++){var b=new DiagramPage(a[c]);null==b.getName()&&b.setName(mxResources.get("pageWithNumber",[c+1]));this.pages.push(b)}this.currentPage=this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page|| 0))];c=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=c&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(c);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var c=this.getCurrentFile(),c=null!=c&&null!= -c.getTitle()?c.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(c)||/(\.html)$/i.test(c)||/(\.svg)$/i.test(c)||/(\.png)$/i.test(c))c=c.substring(0,c.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(c=c+"-"+this.currentPage.getName());return c};EditorUi.prototype.downloadFile=function(a,b,d,e,t,h,n){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!t), +c.getTitle()?c.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(c)||/(\.html)$/i.test(c)||/(\.svg)$/i.test(c)||/(\.png)$/i.test(c))c=c.substring(0,c.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(c=c+"-"+this.currentPage.getName());return c};EditorUi.prototype.downloadFile=function(a,b,d,e,t,l,n){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!t), f=c+"."+a;if("xml"==a){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,t));this.saveData(f,a,g,"text/xml")}else if("html"==a)g=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,g,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var d= -this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var f=this.createDownloadRequest(c,a,e,b,n);this.editor.graph.pageVisible=d;return f}catch(B){this.handleError(B)}}));else{var u=null,k=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(u)}))});if("svg"==a){var m=this.editor.graph.background;if(n||m== -mxConstants.NONE)m=null;var p=this.editor.graph.getSvg(m,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(p);this.convertImages(p,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();k('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else f=c+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();k(a)}),e)}}catch(E){this.handleError(E)}}; +this.editor.graph.pageVisible;null!=l&&(this.editor.graph.pageVisible=l);var f=this.createDownloadRequest(c,a,e,b,n);this.editor.graph.pageVisible=d;return f}catch(B){this.handleError(B)}}));else{var u=null,h=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(u)}))});if("svg"==a){var m=this.editor.graph.background;if(n||m== +mxConstants.NONE)m=null;var p=this.editor.graph.getSvg(m,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(p);this.convertImages(p,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();h('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else f=c+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();h(a)}),e)}}catch(E){this.handleError(E)}}; EditorUi.prototype.createDownloadRequest=function(a,b,d,e,t){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,"xmlpng"!=b);var f="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(var g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){f="&from="+g;break}g=this.editor.graph.background;"png"==b&&t&&(g=mxConstants.NONE); return new mxXmlRequest(EXPORT_URL,"format="+b+f+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,d){var c=window.location.hash,f=mxUtils.bind(this,function(d){var f=null!=a.data?a.data:"";null!=d&&0<d.length&&(0<f.length&&(f+="\n"),f+=d);d=new LocalFile(this,"csv"!=a.format&&0<f.length?f:this.emptyDiagramXml, -null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);d.getHash=function(){return c};this.fileLoaded(d);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?parseInt(a.interval):6E4,g=null,h=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())), -mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),n()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),n=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(h,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){n();h()}));n();h()}null!=b&&b()});if(null!=a.url){var e=a.url;/^https?:\/\//.test(e)&&!this.isCorsEnabledForUrl(e)&& +null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);d.getHash=function(){return c};this.fileLoaded(d);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?parseInt(a.interval):6E4,g=null,n=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())), +mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),l()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),l=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(n,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){l();n()}));l();n()}null!=b&&b()});if(null!=a.url){var e=a.url;/^https?:\/\//.test(e)&&!this.isCorsEnabledForUrl(e)&& (e=PROXY_URL+"?url="+encodeURIComponent(a.url));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else f(a.data)};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||d.warningImage,a.tooltip,a.align,a.valign,a.offset);c.addListener(mxEvent.CLICK,function(c,b){editorUi.alert(a.tooltip)});return c}var b=null;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var d= -this.editor.graph,e=d.getModel();e.beginUpdate();var h=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var n=e.getCell(a.getAttribute("id"));if(null!=n){try{var l=a.getAttribute("value");if(null!=l){var k=mxUtils.parseXml(l).documentElement;if(null!=k)if("1"==k.getAttribute("replace-value"))e.setValue(n,k);else for(var r=k.attributes,m=0;m<r.length;m++)d.setAttributeForCell(n,r[m].nodeName,0<r[m].nodeValue.length?r[m].nodeValue:null)}}catch(B){null!=window.console&&console.log("Error in value for "+ +this.editor.graph,e=d.getModel();e.beginUpdate();var l=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var n=e.getCell(a.getAttribute("id"));if(null!=n){try{var k=a.getAttribute("value");if(null!=k){var h=mxUtils.parseXml(k).documentElement;if(null!=h)if("1"==h.getAttribute("replace-value"))e.setValue(n,h);else for(var r=h.attributes,m=0;m<r.length;m++)d.setAttributeForCell(n,r[m].nodeName,0<r[m].nodeValue.length?r[m].nodeValue:null)}}catch(B){null!=window.console&&console.log("Error in value for "+ n.id+": "+B)}try{var p=a.getAttribute("style");null!=p&&d.model.setStyle(n,p)}catch(B){null!=window.console&&console.log("Error in style for "+n.id+": "+B)}try{var q=a.getAttribute("icon");if(null!=q){var v=0<q.length?JSON.parse(q):null;null!=v&&v.append||d.removeCellOverlays(n);null!=v&&d.addCellOverlay(n,c(v))}}catch(B){null!=window.console&&console.log("Error in icon for "+n.id+": "+B)}try{var E=a.getAttribute("geometry");if(null!=E){var E=JSON.parse(E),x=d.getCellGeometry(n);if(null!=x){x=x.clone(); for(key in E){var J=parseFloat(E[key]);"dx"==key?x.x+=J:"dy"==key?x.y+=J:"dw"==key?x.width+=J:"dh"==key?x.height+=J:x[key]=parseFloat(E[key])}d.model.setGeometry(n,x)}}}catch(B){null!=window.console&&console.log("Error in icon for "+n.id+": "+B)}}}else if("model"==a.nodeName){for(var H=a.firstChild;null!=H&&H.nodeType!=mxConstants.NODETYPE_ELEMENT;)H=H.nextSibling;null!=H&&(new mxCodec(a.firstChild)).decode(H,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(d.view.scale=parseFloat(a.getAttribute("scale"))), -a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(h=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=h&&this.chromelessResize&&this.chromelessResize(!0,h)}return b};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener), +a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(l=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=l&&this.chromelessResize&&this.chromelessResize(!0,l)}return b};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener), b.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=b&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename"))); this.updateUi();this.showSplash()});if(null!=a)try{this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+ "</span>"));!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();this.editor.fireEvent(new mxEventObject("fileLoaded"));c=!0;this.isOffline()||null==a.getMode()||this.logEvent({category:"File",action:"open",label:a.getMode()});if(this.mode==a.getMode()&&a.getMode()!= App.MODE_DEVICE&&null!=a.getMode())try{this.addRecent({id:a.getHash(),title:a.getTitle(),mode:a.getMode()})}catch(t){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(t){}}catch(t){null!=window.console&&console.log("error in fileLoaded:",a,t);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+ -(null!=t&&null!=t.message?":err:"+encodeURIComponent(t.message):"")+(null!=t&&null!=t.stack?"&stack="+encodeURIComponent(t.stack):"")}catch(h){}this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.descriptorChanged= -function(){};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,t,h,n){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad= +(null!=t&&null!=t.message?":err:"+encodeURIComponent(t.message):"")+(null!=t&&null!=t.stack?"&stack="+encodeURIComponent(t.stack):"")}catch(l){}this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.descriptorChanged= +function(){};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,t,l,n){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad= function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!= a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b= this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};}; EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){if(0==c.length&&a.isEditable())null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style, -"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f);else for(var d=0;d<c.length;d++){var e=c[d],g=e.data;if(null!=g){var g=this.convertDataUri(g),h="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(h+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(h+"image="+g,e.w,e.h,"",e.title||"",!1, +"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f);else for(var d=0;d<c.length;d++){var e=c[d],g=e.data;if(null!=g){var g=this.convertDataUri(g),n="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(n+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(n+"image="+g,e.w,e.h,"",e.title||"",!1, !1,!0))}else null!=e.xml&&(g=this.stringToCells(this.editor.graph.decompress(e.xml)),0<g.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(g,e.w,e.h,e.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+= -"aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var l=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var k= -l.parentNode.previousSibling;d=k.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&k.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var r=document.createElement("div");r.style.position="absolute";r.style.right="0px";r.style.top="0px";r.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(r.style.backgroundColor="inherit");k.style.position="relative";var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title", +"aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var h= +k.parentNode.previousSibling;d=h.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&h.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var r=document.createElement("div");r.style.position="absolute";r.style.right="0px";r.style.top="0px";r.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(r.style.backgroundColor="inherit");h.style.position="relative";var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title", mxResources.get("close"));m.setAttribute("valign","absmiddle");m.setAttribute("border","0");m.style.margin="0 3px";var p=null;if(".scratchpad"!=a.title||this.closableScratchpad)r.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=p?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var q= -this.editor.graph,v=null,E=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),l,b,a,a.getMode());mxEvent.consume(c)}),x=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v),v=m.cloneNode(!1),v.setAttribute("src",Editor.spinImage),v.setAttribute("title",mxResources.get("saving")),v.style.cursor="default",v.style.marginRight="2px",v.style.marginTop="-2px",r.insertBefore(v,r.firstChild),k.style.paddingRight=18*r.childNodes.length+ -"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=v&&null!=v.parentNode&&(v.parentNode.removeChild(v),k.style.paddingRight=18*r.childNodes.length+"px")})):null==p&&(p=m.cloneNode(!1),p.setAttribute("src",IMAGE_PATH+"/download.png"),p.setAttribute("title",mxResources.get("save")),r.insertBefore(p,r.firstChild),mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==p||a.isModified()|| -(k.style.paddingRight=18*r.childNodes.length+"px",p.parentNode.removeChild(p),p=null)});mxEvent.consume(c)})),k.style.paddingRight=18*r.childNodes.length+"px")}),J=mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var h=q.getCellGeometry(a[g]);null!=h&&h.translate(-c.x,-c.y)}l.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))), +this.editor.graph,v=null,E=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),x=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v),v=m.cloneNode(!1),v.setAttribute("src",Editor.spinImage),v.setAttribute("title",mxResources.get("saving")),v.style.cursor="default",v.style.marginRight="2px",v.style.marginTop="-2px",r.insertBefore(v,r.firstChild),h.style.paddingRight=18*r.childNodes.length+ +"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=v&&null!=v.parentNode&&(v.parentNode.removeChild(v),h.style.paddingRight=18*r.childNodes.length+"px")})):null==p&&(p=m.cloneNode(!1),p.setAttribute("src",IMAGE_PATH+"/download.png"),p.setAttribute("title",mxResources.get("save")),r.insertBefore(p,r.firstChild),mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==p||a.isModified()|| +(h.style.paddingRight=18*r.childNodes.length+"px",p.parentNode.removeChild(p),p=null)});mxEvent.consume(c)})),h.style.paddingRight=18*r.childNodes.length+"px")}),J=mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var n=q.getCellGeometry(a[g]);null!=n&&n.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))), w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);x(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=q.getSelectionCells(),b=q.view.getBounds(c),d=q.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=q.view.translate.x; -b.y-=q.view.translate.y;J(c,b)}mxEvent.consume(a)});l.style.border="3px solid transparent";mxEvent.addGestureListeners(l,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":l.style.border="3px dotted rgb(254, 137, 12)",l.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1), -null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(l.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),l.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(l,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&& -null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",l.style.border="3px solid transparent",l.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(l,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":l.style.border="3px dotted rgb(254, 137, 12)"; -a.dataTransfer.dropEffect="copy";l.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(l,"drop",mxUtils.bind(this,function(a){l.style.border="3px solid transparent";l.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,h,n,u,r,t,k){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+ -this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,n,u),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,n,u),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var m=!1,p=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,l);b=b.concat(h);x(a); -this.spinner.stop();m=!0}catch(T){}else if("mxfile"==g.documentElement.nodeName)try{for(var n=g.documentElement.getElementsByTagName("diagram"),g=0;g<n.length;g++){var h=mxUtils.getTextContent(n[g]),u=this.stringToCells(this.editor.graph.decompress(h)),r=this.editor.graph.getBoundingBoxFromGeometry(u);J(u,new mxRectangle(0,0,r.width,r.height),a)}m=!0}catch(T){null!=window.console&&console.log("error in drop handler:",T)}}m||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")})); -null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=k&&null!=r&&(/(\.vsdx?)($|\?)/i.test(r)||/(\.vssx)($|\?)/i.test(r))?this.importVisio(k,function(a){p(a,"text/xml")},null,r):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,r)&&null!=k?this.parseFile(k,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?p(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge": -"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):p(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(l,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(l.style.border="3px solid transparent",l.style.cursor="");a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));r.insertBefore(m,r.firstChild);mxEvent.addListener(m,"click",E);mxEvent.addListener(l, -"dblclick",function(a){mxEvent.getSource(a)==l&&E(a)});d=m.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));r.insertBefore(d,r.firstChild);mxEvent.addListener(d,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d, -mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(d,r.firstChild))}k.appendChild(r);k.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter"); +b.y-=q.view.translate.y;J(c,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1), +null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&& +null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)"; +a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,n,l,u,r,t,h){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+ +this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,l,u),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,l,u),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var m=!1,p=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(g.documentElement));e(n,k);b=b.concat(n);x(a); +this.spinner.stop();m=!0}catch(T){}else if("mxfile"==g.documentElement.nodeName)try{for(var l=g.documentElement.getElementsByTagName("diagram"),g=0;g<l.length;g++){var n=mxUtils.getTextContent(l[g]),u=this.stringToCells(this.editor.graph.decompress(n)),r=this.editor.graph.getBoundingBoxFromGeometry(u);J(u,new mxRectangle(0,0,r.width,r.height),a)}m=!0}catch(T){null!=window.console&&console.log("error in drop handler:",T)}}m||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")})); +null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=h&&null!=r&&(/(\.vsdx?)($|\?)/i.test(r)||/(\.vssx)($|\?)/i.test(r))?this.importVisio(h,function(a){p(a,"text/xml")},null,r):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,r)&&null!=h?this.parseFile(h,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?p(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge": +"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):p(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border="3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));r.insertBefore(m,r.firstChild);mxEvent.addListener(m,"click",E);mxEvent.addListener(k, +"dblclick",function(a){mxEvent.getSource(a)==k&&E(a)});d=m.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));r.insertBefore(d,r.firstChild);mxEvent.addListener(d,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d, +mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),r.insertBefore(d,r.firstChild))}h.appendChild(r);h.style.paddingRight=18*r.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter"); if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.initTheme=function(){"atlas"==uiTheme? (mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding= 5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4", @@ -2794,217 +2795,217 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM !0;this.editor.graph.model.execute(a)});var c=new BackgroundImageDialog(this,mxUtils.bind(this,function(c){a(c)}));this.showDialog(c.container,360,200,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(a,b,d,e,t){a=new LibraryDialog(this,a,b,d,e,t);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer"); a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d){var c=null!=this.spinner&&null!= this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),g=function(){c();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden")); -else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var l=window.location.hash;null!=l&&"#G"==l.substring(0,2)&&(l=l.substring(2),a+=' <a href="https://drive.google.com/open?id='+l+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a= -mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,d,g)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,t,h,n,l,k,r,m,p){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,t,h,n,p,l,k);this.showDialog(a.container,r||340,m||150,!0,!1);a.init()};EditorUi.prototype.alert= +else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2),a+=' <a href="https://drive.google.com/open?id='+k+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a= +mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,d,g)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,t,l,n,k,h,r,m,p){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,t,l,n,p,k,h);this.showDialog(a.container,r||340,m||150,!0,!1);a.init()};EditorUi.prototype.alert= function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,t){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,t)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile}; EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b)))); return c};EditorUi.prototype.saveCanvas=function(a,b,d){var c="jpeg"==d?"jpg":d,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!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&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS}; EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,t){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,d):new Blob([a],{type:d}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)d=window.open("about:blank","_blank"),null==d?mxUtils.popup(a,!0):(d.document.write(a),d.document.close(),d.document.execCommand("SaveAs",!0,b),d.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height= "380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof c.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),f=65==(g?parseInt(g[2],10):!1)?!1:f;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,d):new Blob([a],{type:d}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c); -try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(w){}}else this.createEchoRequest(a,b,d,e,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,t,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=t?"&format="+t:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b= -b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),n=0;n<f;++n){for(var l=1024*n,k=Math.min(l+1024,d),r=Array(k-l),m=0;l<k;++m,++l)r[m]=c[l].charCodeAt(0);e[n]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,t,h,n){h=null!=h?h:!1;n=null!=n?n:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);t=this.getServiceCount(h);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)|| +try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(w){}}else this.createEchoRequest(a,b,d,e,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,t,l){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=t?"&format="+t:"")+(null!=l?"&base64="+l:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b= +b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),n=0;n<f;++n){for(var k=1024*n,h=Math.min(k+1024,d),r=Array(h-k),m=0;k<h;++m,++k)r[m]=c[k].charCodeAt(0);e[n]=new Uint8Array(r)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,t,l,n){l=null!=l?l:!1;n=null!=n?n:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);t=this.getServiceCount(l);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)|| "image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE||"download"==b?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(D){this.handleError(D)}}))}catch(y){this.handleError(y)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"), -mxResources.get("download"),!1,h,n,null,1<t,4<t&&(!h||6>t)?3:4,a,d,e);this.showDialog(b.container,420,t==(mxClient.IS_IOS?0:1)?160:4<t?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+ +mxResources.get("download"),!1,l,n,null,1<t,4<t&&(!l||6>t)?3:4,a,d,e);this.showDialog(b.container,420,t==(mxClient.IS_IOS?0:1)?160:4<t?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+ '"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==c&&mxUtils.popup(a,!0)};var d=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog), this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";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,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog); this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this, function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}d.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,d,e,t){this.isLocalFileSave()?this.saveLocalFile(d, -a,e,t,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,t,b,c)}),d,t,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,t,h,n){n=null!=n?n:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||"download"==c||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"download"==c||"_blank"==c?f.simulate(document, -"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){h=null!=h?h:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,h,!0,c,d)}catch(z){this.handleError(z)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,h,!0,c,d)}catch(z){this.handleError(z)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop(); -this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,n,null,1<c,4<c?3:4,e,h,t);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,t,h){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,t,h,n,l,k){if(this.spinner.spin(document.body, -mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,n,l,null,d);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(a){this.spinner.stop();t&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,k));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS? +a,e,t,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,t,b,c)}),d,t,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,t,l,n){n=null!=n?n:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||"download"==c||null==c||"_blank"==c?"0":"1");null!=f&&(c==App.MODE_DEVICE||"download"==c||"_blank"==c?f.simulate(document, +"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){l=null!=l?l:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,l,!0,c,d)}catch(z){this.handleError(z)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,l,!0,c,d)}catch(z){this.handleError(z)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop(); +this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,n,null,1<c,4<c?3:4,e,l,t);this.showDialog(a.container,380,c==(mxClient.IS_IOS?0:1)?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,t,l){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,t,l,n,k,h){if(this.spinner.spin(document.body, +mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,n,k,null,d);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(a){this.spinner.stop();t&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,h));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS? c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(c)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"), -mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){h?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,u,this.thumbImageCache)):u(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,t,h){h=null!=h?h:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled", -"disabled");h&&(a.appendChild(c),d=document.createElement("span"),mxUtils.write(d,b),a.appendChild(d),t||mxUtils.br(a),mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){"disabled"!=c.getAttribute("disabled")&&(c.checked=!c.checked,mxEvent.consume(a))})));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&& +mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){l?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,u,this.thumbImageCache)):u(f)}))}};EditorUi.prototype.addCheckbox=function(a,b,d,e,t,l){l=null!=l?l:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type","checkbox");d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled", +"disabled");l&&(a.appendChild(c),d=document.createElement("span"),mxUtils.write(d,b),a.appendChild(d),t||mxUtils.br(a),mxEvent.addListener(d,"click",mxUtils.bind(this,function(a){"disabled"!=c.getAttribute("disabled")&&(c.checked=!c.checked,mxEvent.consume(a))})));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&& (f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"== e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return c}, getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){n.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft= "8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value", "frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",n=null,n=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();n.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";n.style.marginLeft="4px";n.style.height="22px";n.style.width="22px";n.style.position="relative";n.style.top=mxClient.IS_IE|| -mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";n.className="geColorBtn";a.appendChild(n);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,k,h,n,l){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=k&&0<k.length&&f.push("edit="+encodeURIComponent(k)),h&& -f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=n?d="#U"+encodeURIComponent(n):(c=this.getCurrentFile(),l||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1)); -a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,k,h,n,l,m,r,p){this.getBasenames();var c={};""!=k&&k!=mxConstants.NONE&&(c.highlight=k);"auto"!==e&&(c.target=e);m||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled; -d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];n&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);l&&d.push("layers");0<d.length&&(m&&d.push("lightbox"),c.toolbar=d.join(" "));null!=r&&0<r.length&&(c.edit=r);null!=a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!n);b='<div class="mxgraph" style="'+(h?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+ +mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";n.className="geColorBtn";a.appendChild(n);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,h,l,n,k){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=h&&0<h.length&&f.push("edit="+encodeURIComponent(h)),l&& +f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));if(d&&null!=this.pages&&null!=this.currentPage)for(a=0;a<this.pages.length;a++)if(this.pages[a]==this.currentPage){0<a&&f.push("page="+a);break}a=!0;null!=n?d="#U"+encodeURIComponent(n):(c=this.getCurrentFile(),k||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1)); +a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,h,l,n,k,m,r,p){this.getBasenames();var c={};""!=h&&h!=mxConstants.NONE&&(c.highlight=h);"auto"!==e&&(c.target=e);m||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled; +d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];n&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);k&&d.push("layers");0<d.length&&(m&&d.push("lightbox"),c.toolbar=d.join(" "));null!=r&&0<r.length&&(c.edit=r);null!=a?c.url=a:c.xml=this.getFileData(!0,null,null,null,null,!n);b='<div class="mxgraph" style="'+(l?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+ mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";p(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.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";c.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 k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(k);mxUtils.br(g);g.appendChild(l);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));g.appendChild(k);var r=this.getCurrentFile();null==d&&null!=r&&r.constructor==window.DriveFile&&(k=document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href","javascript:void(0);"),mxUtils.write(k,mxResources.get("share")), -g.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==d&&l.setAttribute("disabled","disabled");c.appendChild(g);var u=this.addLinkSection(c),m=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight= +mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value", +"copy");g.appendChild(f);var h=document.createElement("span");mxUtils.write(h,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(h);mxUtils.br(g);g.appendChild(k);h=document.createElement("span");mxUtils.write(h,mxResources.get("publicDiagramUrl"));g.appendChild(h);var r=this.getCurrentFile();null==d&&null!=r&&r.constructor==window.DriveFile&&(h=document.createElement("a"),h.style.paddingLeft="12px",h.style.color="gray",h.setAttribute("href","javascript:void(0);"),mxUtils.write(h,mxResources.get("share")), +g.appendChild(h),mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(r.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(g);var u=this.addLinkSection(c),m=this.addCheckbox(c,mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");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%";c.appendChild(p);var q=this.addCheckbox(c,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,E=E=this.addCheckbox(c,mxResources.get("allPages"),g,!g),x=this.addCheckbox(c,mxResources.get("layers"),!0),v=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,v),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(v,"change",function(){v.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&v.checked? -H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(l.checked?d:null,m.checked,p.value,u.getTarget(),u.getColor(),q.checked,E.checked,x.checked,v.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,k,h){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3"); +H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,m.checked,p.value,u.getTarget(),u.getColor(),q.checked,E.checked,x.checked,v.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,h,l){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3"); mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",r=document.createElement("div");r.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;"; var u=document.createElement("div");u.style.whiteSpace="normal";mxUtils.write(u,mxResources.get("linkAccountRequired"));r.appendChild(u);u=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));u.style.marginTop="12px";u.className="geBtn";r.appendChild(u);c.appendChild(r);u=document.createElement("a");u.style.paddingLeft="12px";u.style.color="gray";u.style.fontSize="11px";u.setAttribute("href","javascript:void(0);");mxUtils.write(u,mxResources.get("check")); r.appendChild(u);mxEvent.addListener(u,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var t=null,m=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),t=document.createElement("input"), -t.setAttribute("type","text"),t.style.marginRight="16px",t.style.width="50px",t.style.marginLeft="6px",t.style.marginRight="16px",t.style.marginBottom="10px",t.value="100%",c.appendChild(t),mxUtils.write(c,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=e+"px",c.appendChild(m),mxUtils.br(c);var p=this.addLinkSection(c,h);d=null!=this.pages&&1<this.pages.length;var q=null; +t.setAttribute("type","text"),t.style.marginRight="16px",t.style.width="50px",t.style.marginLeft="6px",t.style.marginRight="16px",t.style.marginBottom="10px",t.value="100%",c.appendChild(t),mxUtils.write(c,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=e+"px",c.appendChild(m),mxUtils.br(c);var p=this.addLinkSection(c,l);d=null!=this.pages&&1<this.pages.length;var q=null; if(null==g||g.constructor!=window.DriveFile||b)q=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var x=this.addCheckbox(c,mxResources.get("lightbox"),!0),v=this.addEditButton(c,x),H=v.getEditInput(),B=this.addCheckbox(c,mxResources.get("layers"),!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(x,"change",function(){x.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled", -"disabled"));H.checked&&x.checked?v.getEditSelect().removeAttribute("disabled"):v.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){k(p.getTarget(),p.getColor(),null==q?!0:q.checked,x.checked,v.getLink(),B.checked,null!=t?t.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=t?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select(): -document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var g=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),l=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"), -!0),f=this.editor.graph,k=e?null:this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=k&&(k.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!g.checked,null!=l?l.checked:!1,null!=k?k.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,k,h,n,l){n=null!=n?n:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f= -this.editor.graph,g="jpeg"==l?196:300,u=document.createElement("h3");mxUtils.write(u,a);u.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(u);mxUtils.write(c,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";c.appendChild(t);mxUtils.write(c,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";c.appendChild(m);mxUtils.br(c);var p=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=l),q=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),v=document.createElement("input");v.style.marginTop="16px";v.style.marginRight= -"8px";v.style.marginLeft="24px";v.setAttribute("disabled","disabled");v.setAttribute("type","checkbox");h&&(c.appendChild(v),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),g+=26,mxEvent.addListener(q,"change",function(){q.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(v.setAttribute("checked","checked"),v.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),B=document.createElement("input");B.style.marginTop= -"16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(c.appendChild(B),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=26);var N=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),n,null,null,"jpeg"!=l),C=null!=this.pages&&1<this.pages.length,I=this.addCheckbox(c,C?mxResources.get("allPages"):"",C,!C,null,"jpeg"!=l);I.style.marginLeft="24px";I.style.marginBottom="16px";C||(I.style.visibility= -"hidden");mxEvent.addListener(N,"change",function(){N.checked&&C?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")});n&&C||I.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=m.value;this.lastExportZoom=t.value;k(t.value,p.checked,!q.checked,H.checked,N.checked,B.checked,m.value,v.checked,!I.checked)}),null,d,e);this.showDialog(a.container,340,g,!0,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| -mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(g)}var u=this.addCheckbox(c,mxResources.get("fit"),!0),r=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e, +"disabled"));H.checked&&x.checked?v.getEditSelect().removeAttribute("disabled"):v.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){h(p.getTarget(),p.getColor(),null==q?!0:q.checked,x.checked,v.getLink(),B.checked,null!=t?t.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=t?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select(): +document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var g=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"), +!0),f=this.editor.graph,h=e?null:this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=h&&(h.style.marginBottom="16px");a=new CustomDialog(this,c,mxUtils.bind(this,function(){d(!g.checked,null!=k?k.checked:!1,null!=h?h.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,h,l,n,k){n=null!=n?n:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f= +this.editor.graph,g="jpeg"==k?196:300,u=document.createElement("h3");mxUtils.write(u,a);u.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(u);mxUtils.write(c,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";c.appendChild(t);mxUtils.write(c,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";c.appendChild(m);mxUtils.br(c);var p=this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background,null,null,"jpeg"!=k),q=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),v=document.createElement("input");v.style.marginTop="16px";v.style.marginRight= +"8px";v.style.marginLeft="24px";v.setAttribute("disabled","disabled");v.setAttribute("type","checkbox");l&&(c.appendChild(v),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),g+=26,mxEvent.addListener(q,"change",function(){q.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(v.setAttribute("checked","checked"),v.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),B=document.createElement("input");B.style.marginTop= +"16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(c.appendChild(B),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=26);var N=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),n,null,null,"jpeg"!=k),C=null!=this.pages&&1<this.pages.length,I=this.addCheckbox(c,C?mxResources.get("allPages"):"",C,!C,null,"jpeg"!=k);I.style.marginLeft="24px";I.style.marginBottom="16px";C||(I.style.visibility= +"hidden");mxEvent.addListener(N,"change",function(){N.checked&&C?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled")});n&&C||I.setAttribute("disabled","disabled");a=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=m.value;this.lastExportZoom=t.value;h(t.value,p.checked,!q.checked,H.checked,N.checked,B.checked,m.value,v.checked,!I.checked)}),null,d,e);this.showDialog(a.container,340,g,!0,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| +mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,h){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(g)}var u=this.addCheckbox(c,mxResources.get("fit"),!0),r=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e, !e),t=this.addCheckbox(c,d),m=this.addCheckbox(c,mxResources.get("lightbox"),!0),p=this.addEditButton(c,m),q=p.getEditInput(),v=1<f.model.getChildCount(f.model.getRoot()),x=this.addCheckbox(c,mxResources.get("layers"),v,!v);x.style.marginLeft=q.style.marginLeft;x.style.marginBottom="12px";x.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(v&&x.removeAttribute("disabled"),q.removeAttribute("disabled")):(x.setAttribute("disabled","disabled"),q.setAttribute("disabled","disabled")); -q.checked&&m.checked?p.getEditSelect().removeAttribute("disabled"):p.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(u.checked,r.checked,t.checked,m.checked,p.getLink(),x.checked)}),null,mxResources.get("embed"),k);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,k,h,n,l){function c(c){var b=" ",g="";e&&(b=" 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('https://www.draw.io/?client=1&lightbox=1"+ -(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var l="";d&&(l=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');n('<img src="'+c+'"'+l+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}), -null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";d&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var u=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));u.send(mxUtils.bind(this,function(){200<=u.getStatus()&&299>=u.getStatus()?c("data:image/png;base64,"+u.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})}; -EditorUi.prototype.createEmbedSvg=function(a,b,d,e,k,h,n){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var u=f[g].getAttribute("href");null!=u&&"#"==u.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var t=" ",m="";e&&(t="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ -(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");a&&(m+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){n('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=m?' style="'+m+'"':"")+t+"/>")}))}else m="",e&&(c.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('https://www.draw.io/?client=1&lightbox=1"+ -(k?"&edit=_blank":"")+(h?"&layers=1":"")+"');}}})(this);"),m+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),m+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=m&&c.setAttribute("style",m),n(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");c=Math.floor(a/2592E3);if(1<c)return c+ +q.checked&&m.checked?p.getEditSelect().removeAttribute("disabled"):p.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(u.checked,r.checked,t.checked,m.checked,p.getLink(),x.checked)}),null,mxResources.get("embed"),h);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,h,l,n,k){function c(c){var b=" ",g="";e&&(b=" 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('https://www.draw.io/?client=1&lightbox=1"+ +(h?"&edit=_blank":"")+(l?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var k="";d&&(k=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');n('<img src="'+c+'"'+k+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,mxUtils.bind(this,function(a){k({message:mxResources.get("unknownError")})}), +null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";d&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var u=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));u.send(mxUtils.bind(this,function(){200<=u.getStatus()&&299>=u.getStatus()?c("data:image/png;base64,"+u.getText()):k({message:mxResources.get("unknownError")})}))}else k({message:mxResources.get("drawingTooLarge")})}; +EditorUi.prototype.createEmbedSvg=function(a,b,d,e,h,l,n){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var u=f[g].getAttribute("href");null!=u&&"#"==u.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var t=" ",m="";e&&(t="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+ +(h?"&edit=_blank":"")+(l?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");a&&(m+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){n('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=m?' style="'+m+'"':"")+t+"/>")}))}else m="",e&&(c.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('https://www.draw.io/?client=1&lightbox=1"+ +(h?"&edit=_blank":"")+(l?"&layers=1":"")+"');}}})(this);"),m+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","0 0 "+a+" "+b),m+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=m&&c.setAttribute("style",m),n(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");c=Math.floor(a/2592E3);if(1<c)return c+ " "+mxResources.get("months");c=Math.floor(a/86400);if(1<c)return c+" "+mxResources.get("days");c=Math.floor(a/3600);if(1<c)return c+" "+mxResources.get("hours");c=Math.floor(a/60);return 1<c?c+" "+mxResources.get("minutes"):1==c?c+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,d,e){e()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0< -d.length){var c=d[0],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(h){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph, +d.length){var c=d[0],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=b.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(l){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){var c=this.editor.graph, f=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),f=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),e=c.getGlobalVariable,g=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(c.container); c.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==f&&(f=this.getFileData(!0));var e=d.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(r){null!=b&&b(r)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)};EditorUi.prototype.getEmbeddedSvg= -function(a,b,d,e,k,h,n){n=b.background;n==mxConstants.NONE&&(n=null);b=b.getSvg(n,null,null,null,null,h);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=k)this.convertImages(b,mxUtils.bind(this,function(a){k((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+ -mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,k,h,n,l,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,k?this.getFileData(!0,null,null,null,d,l):null,m)}catch(D){"Invalid image"==D.message?this.downloadFile(m):this.handleError(D)}}),null, -this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,h,n)}catch(y){this.spinner.stop(),this.handleError(y)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},h=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],g=1;g<b.length;g++){var h= -b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,h))]);f.push('"'+b[g].substring(h))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var n=1;n<b.length;n++){var l=b[n].indexOf(")"),k=null,r=b[n].indexOf("format(",l);0<r&&(k=c(b[n].substring(r+7,b[n].indexOf(")",r))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==k||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==k||"embedded-opentype"==k||/(\.otf)($|\?)/i.test(a))c= -"application/x-font-opentype";else if("woff"==k||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==k||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==k||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==k||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;h()}),mxUtils.bind(this, -function(a){d--;h()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[n].substring(0,l)),k)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,k,h,n,l,m,r,p,q,v,G){h=null!=h?h:!0;q=null!=q?q:this.editor.graph;v=null!=v?v:0;var c=m?null:q.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==m&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(q.getSvg(c,null,null,G,null,null!=n?n:!0),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this, -function(){try{var f=document.createElement("canvas"),g=parseInt(d.getAttribute("width")),n=parseInt(d.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=h?Math.min(1,Math.min(3*b/(4*n),b/g)):b/g);g=Math.ceil(l*g)+2*v;n=Math.ceil(l*n)+2*v;f.setAttribute("width",g);f.setAttribute("height",n);var r=f.getContext("2d");null!=c&&(r.beginPath(),r.rect(0,0,g,n),r.fillStyle=c,r.fill());r.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){r.drawImage(e,v/l,v/l);a(f)},0):(r.drawImage(e,v/l,v/l),a(f))}catch(R){null!= -k&&k(R)}});e.onerror=function(a){null!=k&&k(a)};try{r&&this.editor.graph.addSvgShadow(d);var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(q,d,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(B){null!=k&&k(B)}}),d,p)};EditorUi.prototype.createImageUrlConverter= +function(a,b,d,e,h,l,n){n=b.background;n==mxConstants.NONE&&(n=null);b=b.getSvg(n,null,null,null,null,l);null!=a&&b.setAttribute("content",a);null!=d&&b.setAttribute("resource",d);if(null!=h)this.convertImages(b,mxUtils.bind(this,function(a){h((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+ +mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,d,e,h,l,n,k,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,h?this.getFileData(!0,null,null,null,d,k):null,m)}catch(D){"Invalid image"==D.message?this.downloadFile(m):this.handleError(D)}}),null, +this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,l,n)}catch(y){this.spinner.stop(),this.handleError(y)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},l=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],g=1;g<b.length;g++){var n= +b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,n))]);f.push('"'+b[g].substring(n))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var n=1;n<b.length;n++){var k=b[n].indexOf(")"),h=null,r=b[n].indexOf("format(",k);0<r&&(h=c(b[n].substring(r+7,b[n].indexOf(")",r))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==h||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==h||"embedded-opentype"==h||/(\.otf)($|\?)/i.test(a))c= +"application/x-font-opentype";else if("woff"==h||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==h||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==h||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==h||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;l()}),mxUtils.bind(this, +function(a){d--;l()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[n].substring(0,k)),h)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,h,l,n,k,m,r,p,q,v,G){l=null!=l?l:!0;q=null!=q?q:this.editor.graph;v=null!=v?v:0;var c=m?null:q.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==c&&0==m&&(c=this.editor.graph.defaultPageBackgroundColor);this.convertImages(q.getSvg(c,null,null,G,null,null!=n?n:!0),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this, +function(){try{var f=document.createElement("canvas"),g=parseInt(d.getAttribute("width")),n=parseInt(d.getAttribute("height"));k=null!=k?k:1;null!=b&&(k=l?Math.min(1,Math.min(3*b/(4*n),b/g)):b/g);g=Math.ceil(k*g)+2*v;n=Math.ceil(k*n)+2*v;f.setAttribute("width",g);f.setAttribute("height",n);var r=f.getContext("2d");null!=c&&(r.beginPath(),r.rect(0,0,g,n),r.fillStyle=c,r.fill());r.scale(k,k);mxClient.IS_SF?window.setTimeout(function(){r.drawImage(e,v/k,v/k);a(f)},0):(r.drawImage(e,v/k,v/k),a(f))}catch(R){null!= +h&&h(R)}});e.onerror=function(a){null!=h&&h(a)};try{r&&this.editor.graph.addSvgShadow(d);var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(q,d,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(B){null!=h&&h(B)}}),d,p)};EditorUi.prototype.createImageUrlConverter= function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,d=this;a.convert=function(c){if(null!=c){var e="http://"==c.substring(0,7)||"https://"==c.substring(0,8);e&&!navigator.onLine?c=d.svgBrokenImage.src:!e||c.substring(0,a.baseUrl.length)==a.baseUrl||d.crossOriginImages&&d.isCorsEnabledForUrl(c)?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null== -e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var h=a.getElementsByTagName(d),l=0;l<h.length;l++)mxUtils.bind(this,function(d){var h=e.convert(d.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var l=f[h];null==l?(c++,this.convertImageToDataUri(h,function(e){null!=e&&(f[h]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,l)}else null!=h&&d.setAttribute(g,h)})(h[l])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl= -function(a,b,d,e,k,h){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);k=null!=k?k:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]= -String.fromCharCode(a[f]);e=e.join("")}h=null!=h?h:"data:image/png;base64,";e=h+this.base64Encode(e)}b(e)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){k&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(w){null!=d&&d(w)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)|| +e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var n=a.getElementsByTagName(d),k=0;k<n.length;k++)mxUtils.bind(this,function(d){var n=e.convert(d.getAttribute(g));if(null!=n&&"data:"!=n.substring(0,5)){var k=f[n];null==k?(c++,this.convertImageToDataUri(n,function(e){null!=e&&(f[n]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,k)}else null!=n&&d.setAttribute(g,n)})(n[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl= +function(a,b,d,e,h,l){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);h=null!=h?h:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]= +String.fromCharCode(a[f]);e=e.join("")}l=null!=l?l:"data:image/png;base64,";e=l+this.base64Encode(e)}b(e)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){h&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(w){null!=d&&d(w)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)|| "https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image, -d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d");a.height=c.height;a.width=c.width;e.drawImage(c,0,0);try{b(a.toDataURL())}catch(n){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,k){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),m=this.editor.extractGraphModel(g.documentElement, +d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d");a.height=c.height;a.width=c.width;e.drawImage(c,0,0);try{b(a.toDataURL())}catch(n){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,h){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),m=this.editor.extractGraphModel(g.documentElement, null!=this.pages);if(null!=m&&"mxfile"==m.nodeName&&null!=this.pages){var r=m.getElementsByTagName("diagram");if(1==r.length)m=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(r[0]))).documentElement;else if(1<r.length){f.model.beginUpdate();try{for(a=0;a<r.length;a++){var u=this.updatePageRoot(new DiagramPage(r[a])),t=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[t+1]));f.model.execute(new ChangePage(this,u,u,t))}}finally{f.model.endUpdate()}}}null!=m&&"mxGraphModel"=== -m.nodeName&&(c=f.importGraphModel(m,b,d,e))}}catch(z){throw k||this.handleError(z,mxResources.get("invalidOrMissingFile")),z;}return c};EditorUi.prototype.importVisio=function(a,b,d,e){e=null!=e?e:a.name;d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(e)&&null!=VSD_CONVERT_URL){var c=new FormData;c.append("file1",a,e);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);f.responseType= -"blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response,b,d)}catch(l){d(l)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d)}catch(l){d(l)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}}); -"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,d,e,k){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,k)}catch(n){this.handleError(n)}finally{null!=k&&k()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev? -mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,k){k=JSON.parse(a);a=[];if(null!=k.state){k=JSON.parse(k.state);for(var c in k.Pages)a.push(k.Pages[c]);a.sort(function(a,c){return a.Properties.Order<c.Properties.Order?-1:a.Properties.Order>c.Properties.Order?1:0})}else a.push(k);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage; -for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,d,e,k,h,n){h=null!=h?h:!0;n=null!=n?n:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText, -b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(k||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+ -1)),g=this.importXml(f,b,d,h,!0),0<g.length)return g}catch(y){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),n,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/ +m.nodeName&&(c=f.importGraphModel(m,b,d,e))}}catch(z){throw h||this.handleError(z,mxResources.get("invalidOrMissingFile")),z;}return c};EditorUi.prototype.importVisio=function(a,b,d,e){e=null!=e?e:a.name;d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(e)&&null!=VSD_CONVERT_URL){var c=new FormData;c.append("file1",a,e);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);f.responseType= +"blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response,b,d)}catch(k){d(k)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d)}catch(k){d(k)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}}); +"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,d,e,h){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,d,e,h)}catch(n){this.handleError(n)}finally{null!=h&&h()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev? +mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertLucidChart=function(a,b,d,e,h){h=JSON.parse(a);a=[];if(null!=h.state){h=JSON.parse(h.state);for(var c in h.Pages)a.push(h.Pages[c]);a.sort(function(a,c){return a.Properties.Order<c.Properties.Order?-1:a.Properties.Order>c.Properties.Order?1:0})}else a.push(h);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,d,e),null!=this.pages){var f=this.currentPage; +for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(f)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,d,e,h,l,n){l=null!=l?l:!0;n=null!=n?n:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText, +b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(h||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,l,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+ +1)),g=this.importXml(f,b,d,l,!0),0<g.length)return g}catch(y){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),n,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/ e.height)),g=Math.round(e.width*f);e=Math.round(e.height*f);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),g,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells", -[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,h);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,h);else{c=this.editor.graph;k=null;c.getModel().beginUpdate();try{k=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[k])),k.value= -a,c.updateCellSize(k),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(k.value)&&c.setLinkForCell(k,k.value),k.geometry.width+=c.gridSize,k.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[k]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1;do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+ -" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input"); -c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,c){if(null!=c&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(c)){var b=new Blob([a],{type:"application/octet-stream"}); -this.importVisio(b,mxUtils.bind(this,function(a){this.importXml(a)}),null,c)}else this.editor.graph.setSelectionCells(this.importXml(a))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,d,e,k,h,n,l,m,r, -p){r=null!=r?r:!0;var c=!1,f=null,g=mxUtils.bind(this,function(a){var c=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,n)):c=this.importXml(a,d,e,r);null!=l&&l(c)});"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=p?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,r),m=!0)),m||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),r&&f.isGridEnabled()&&(d=f.snap(d),e= -f.snap(e)),f=[f.insertVertex(null,null,"",d,e,k,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,r);null!=l&&l(a)})):null!=m&&null!=n&&(/(\.vsdx?)($|\?)/i.test(n)||/(\.vssx)($|\?)/i.test(n))?(c=!0,this.importVisio(m,g)):!this.isOffline()&&(new XMLHttpRequest).upload&& -this.isRemoteFileFormat(a,n)?(c=!0,this.parseFile(null!=m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=l&&l(null))}),n)):/(\.vsd)($|\?)/i.test(n)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,r));c||null==l||l(f);return f};EditorUi.prototype.base64Encode=function(a){for(var c="",b=0,d=a.length,e,h,n;b<d;){e=a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);c+="==";break}h=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);c+="=";break}n=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>> -2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(n&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n&63)}return c};EditorUi.prototype.importFiles=function(a,b,d,e,k,h,n,l,m,r,p,q){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&& -null!=a)for(var u=p||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>u){g=!0;break}var v=mxUtils.bind(this,function(){var g=this.editor.graph,m=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,d,e,f,g,h,l,n){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,d,e,f,g,h,l,n,c,q)});h=null!=h?h:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body, -mxResources.get("loading")))for(var u=a.length,t=u,v=[],y=mxUtils.bind(this,function(a,c){v[a]=c;if(0==--t){this.spinner.stop();if(null!=l)l(v);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<v.length;d++){var e=v[d]();null!=e&&(b=b.concat(e))}}finally{g.getModel().endUpdate()}}h(b)}}),x=0;x<u;x++)mxUtils.bind(this,function(c){var h=a[c],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==n||n(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var l= -a.target.result,u=l.indexOf(","),t=decodeURIComponent(escape(atob(l.substring(u+1)))),B=mxUtils.parseXml(t),t=B.getElementsByTagName("svg");if(0<t.length){var t=t[0],v=q?null:t.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?y(c,mxUtils.bind(this,function(){try{if(l.substring(0,u+1),null!=B){var a= -B.getElementsByTagName("svg");if(0<a.length){var n=a[0],r=parseFloat(n.getAttribute("width")),t=parseFloat(n.getAttribute("height")),p=n.getAttribute("viewBox");if(null==p||0==p.length)n.setAttribute("viewBox","0 0 "+r+" "+t);else if(isNaN(r)||isNaN(t)){var q=p.split(" ");3<q.length&&(r=parseFloat(q[2]),t=parseFloat(q[3]))}l=this.createSvgDataUri(mxUtils.getXml(n));var v=Math.min(1,Math.min(e/Math.max(1,r)),e/Math.max(1,t)),C=k(l,h.type,b+c*m,d+c*m,Math.max(1,Math.round(r*v)),Math.max(1,Math.round(t* -v)),h.name,f);if(isNaN(r)||isNaN(t)){var y=new Image;y.onload=mxUtils.bind(this,function(){r=Math.max(1,y.width);t=Math.max(1,y.height);C[0].geometry.width=r;C[0].geometry.height=t;n.setAttribute("viewBox","0 0 "+r+" "+t);l=this.createSvgDataUri(mxUtils.getXml(n));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));g.setCellStyles("image",l,[C[0]])});y.src=this.createSvgDataUri(mxUtils.getXml(n))}return C}}}catch(ea){}return null})):y(c,mxUtils.bind(this,function(){return k(v, -"text/xml",b+c*m,d+c*m,0,0,h.name)}))}}else{t=!1;if("image/png"==h.type){var C=q?null:this.extractGraphModelFromPng(a.target.result);if(null!=C&&0<C.length){var x=new Image;x.src=a.target.result;y(c,mxUtils.bind(this,function(){return k(C,"text/xml",b+c*m,d+c*m,x.width,x.height,h.name)}));t=!0}}t||(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(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,l,n){y(c,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var u=f&&this.isResampleImage(a.target.result,p)?Math.min(1,Math.min(e/l,e/n)):1;return k(g,h.type,b+c*m,d+c*m,Math.round(l*u),Math.round(n*u),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,p)}),mxUtils.bind(this, -function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,h.type,b+c*m,d+c*m,240,160,h.name,function(a){y(c,function(){return a})})});/(\.vsdx?)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name)?k(null,h.type,b+c*m,d+c*m,240,160,h.name,function(a){y(c,function(){return a})},h):"image"==h.type.substring(0,5)?l.readAsDataURL(h):l.readAsText(h)})(x)});g?this.confirmImageResize(function(a){f=a;v()},m):v()};EditorUi.prototype.confirmImageResize=function(a, -b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!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?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length> -b};EditorUi.prototype.resizeImage=function(a,b,d,e,k,h){k=null!=k?k:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,h))try{var g=Math.max(c/k,f/k);if(1<g){var r=Math.round(c/g),m=Math.round(f/g),u=document.createElement("canvas");u.width=r;u.height=m;u.getContext("2d").drawImage(a,0,0,r,m);var t=u.toDataURL();if(t.length<b.length){var p=document.createElement("canvas");p.width=r;p.height=m;var q=p.toDataURL();t!==q&&(b=t,c=r,f=m)}}}catch(x){}d(b,c,f)}; -EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var b=e,k=0;8>k;k++)b=1==(b&1)?3988292384^b>>>1:b>>>1,EditorUi.prototype.crcTable[e]=b;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c=c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a, -b,d,e,k){function c(a,c){var b=m;m+=c;return a.substring(b,m)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var m=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(c(a,4),"IHDR"!=c(a,4))null!=k&&k();else{c(a,17);k=a.substring(0,m);do{var r= -f(a);if("IDAT"==c(a,4)){k=a.substring(0,m-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);k+=g(d.length)+b+d+g(e^4294967295);k+=a.substring(m-8,a.length);break}k+=a.substring(m-8,m-4+r);c(a,r);c(a,4)}while(r);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var c=null;try{var b=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF? -atob(b):Base64.decode(b,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,b,e){a=d.substring(a+8,a+8+e);"zTXt"==b?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(c=a))):"tEXt"==b&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(c=a[1]));if(null!=c||"IDAT"==b)return!0}))}catch(t){}null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));null!=c&& -"%"==c.charAt(0)&&(c=decodeURIComponent(c));return c};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var m=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(c){return a.getLinkTitle(c)};b.customLinkClicked=function(c){try{a.handleCustomLink(c)}catch(H){a.handleError(H)}};this.isOffline()|| -"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(c){c=null!=c?c:"";if(null!=a.pages&&null!=a.currentPage)for(var b=0;b<a.pages.length;b++)if(a.pages[b]==a.currentPage){0<b&&(c+=(0<c.length?"&":"?")+"page="+b);break}"1"==urlParams.dev&&(c+=(0<c.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=b.addClickHandler;b.addClickHandler= -function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null==c||!b.isCustomLink(c)||!mxEvent.isTouchEvent(a)&&mxEvent.isPopupTrigger(a)||(b.customLinkClicked(c),mxEvent.consume(a));null!=f&&f(a,c)};e.call(this,a,c,d)};m.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!= -a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var k=b.getGlobalVariable;b.getGlobalVariable=function(c){return"page"==c&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==c?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:k.apply(this,arguments)};var h=b.createLinkForHint;b.createLinkForHint=function(a,c){null!=a&&b.isCustomLink(a)&&(c=b.getLinkTitle(a));var d=h.call(this,a,c);null!=a&&b.isCustomLink(a)&&mxEvent.addListener(d, -"click",function(c){b.customLinkClicked(a);mxEvent.consume(c)});return d};var n=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var e=c.getAttribute("href");if(null==e||!b.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))n.apply(this,arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(e),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var c=a.defaultFilename,b=a.getCurrentFile();null!=b&&(c=null!= -b.getTitle()?b.getTitle():c);return c};var l=this.actions.get("print");l.setEnabled(!mxClient.IS_IOS||!navigator.standalone);l.visible=l.isEnabled();if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){r.innerHTML=" ";r.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry", -!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var c=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var b=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<b.types.length;e++)if("text/"===b.types[e].substring(0,5)){d=!0;break}if(!d){var f=b.items;for(index in f){var g=f[index];if("file"===g.kind){if(c.isEditing())this.importFiles([g.getAsFile()], -0,0,this.maxImageSize,function(a,b,d,e,f,g){c.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(aa){}}),!1);var r=document.createElement("div");r.style.position="absolute";r.style.whiteSpace="nowrap";r.style.overflow="hidden";r.style.display="block";r.contentEditable=!0;mxUtils.setOpacity(r, -0);r.style.width="1px";r.style.height="1px";r.innerHTML=" ";var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)|| -q||(r.style.left=b.container.scrollLeft+10+"px",r.style.top=b.container.scrollTop+10+"px",b.container.appendChild(r),q=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){r.focus();document.execCommand("selectAll",!1,null)},0):(r.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=c&&17!=c&&91!=c||(q=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(), -r.parentNode.removeChild(r),mxUtils.clearSelection())}),0)}));mxEvent.addListener(r,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(r),p())}));mxEvent.addListener(r,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(this.copyCells(r,!0),p())}));mxEvent.addListener(r,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(r.innerHTML=" ",r.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,r);r.innerHTML= -" "}),0))}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==r?!0:v.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var c=this.editor.graph,b=c.cellEditor.text2,d=null;null!=b&&(mxEvent.addListener(b,"dragleave",function(a){null!= -d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(b));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,b,d,e,f,g){c.insertImage(a, -f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var b=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b)?this.loadImage(decodeURIComponent(b),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));c.insertImage(decodeURIComponent(b), -d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){l=document.createElement("div");l.style.position="absolute"; -l.style.top="95px";l.style.left="250px";l.style.width="2000px";l.style.height="30px";l.style.background="whiteSmoke";document.body.appendChild(l);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px";z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z);var G=document.createElement("div");G.style.position="absolute";G.style.top="95px";G.style.left="220px";G.style.width="30px";G.style.height="30px"; -G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,l,!1)}if("1"==urlParams.test){l=document.getElementById("geFooter");null!=l&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden", -this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),l.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,c){if(0<this.editor.graph.getSelectionCount()){var b=this.editor.graph.getSelectionCell(),b=this.editor.graph.getModel().getStyle(b);this.styleInput.value=b||"";this.styleInput.style.visibility= -"visible"}else this.styleInput.style.visibility="hidden"})));var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:E.apply(this,arguments)}}l=document.getElementById("geInfo");null!=l&&l.parentNode.removeChild(l);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var x=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=x&&(x.parentNode.removeChild(x),x=null),a.stopPropagation(),a.preventDefault())}); -mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==x&&(!mxClient.IS_IE||10<document.documentMode)&&(x=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=x&&(x.parentNode.removeChild(x),x=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale, -f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l= -a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var n=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(n=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var k=!0,r=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(l,f,g,!0,n,null,k))});n&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){k=a;r()},mxEvent.isControlDown(a)): -r()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(h, -f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var c=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");0<b&&(c=this.getPageById(a.substring(b+1)),c=null!=c? -c.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(c=mxResources.get("action"));return c};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");(a=this.getPageById(a.substring(c+1)))&&this.selectPage(a)}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors= -mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget()); -this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged", -mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(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.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d, -!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS|| -8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var n=e.lastIndexOf("%3E");0<=n&&n<e.length-3&&(e=e.substring(0,n+3))}catch(w){}try{var c=b.getElementsByTagName("span"),l=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(l)&&(f=!0,e=l)}catch(w){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e, -c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(w){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var c=null,b=0;b<a.length;b++)mxEvent.addListener(a[b],"dragleave", -function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[b],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==c&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(c=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[b],"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(this.editor.graph.isEnabled()|| -"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var b=this.extractGraphModelFromEvent(a);if(null==b){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?b=d.getData("Text"):(b=null,b=0<=mxUtils.indexOf(d.types, -"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=b&&0<b.length?(d=document.createElement("div"),d.innerHTML=b,d=d.getElementsByTagName("img"),0<d.length&&(b=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(b=d.getData("text/plain"))),null!=b&&("data:image/png;base64,"==b.substring(0,22)?(b=this.extractGraphModelFromPng(b),null!=b&&0<b.length&&this.openLocalFile(b,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(b)? -(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(b))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(b)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))))}else this.openLocalFile(b,null,!0)}a.stopPropagation();a.preventDefault()}))}; -EditorUi.prototype.highlightElement=function(a){var c=0,b=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else c=a.offsetTop,b=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=c+"px";h.style.left=b+"px";h.style.width= -Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var c=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=c){var b=new mxCodec(c.ownerDocument),d=new mxGraphModel;b.decode(c,d);c=d.getChildAt(d.getRoot(),0);for(b=0;b<d.getChildCount(c);b++)a.push(d.getChildAt(c,b))}return a};EditorUi.prototype.openFiles= -function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&& -"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx?)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this, -function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()})); -else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop(); -this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c=mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a, -b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"), -null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],d;for(d in a)b.push(d);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1, -a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=d.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(d.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility= -a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1), -null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&& -this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=d?d:!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(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var c=this.editor.graph;return{event:a,pageVisible:c.pageVisible,translate:c.view.translate,scale:c.view.scale,page:c.view.getBackgroundPageBounds(),bounds:c.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var c=null,b=!1,d=!1,e=null,h=mxUtils.bind(this,function(a, -c){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&& -(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(C){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&& -(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml); -this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog(); -k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(C){k.postMessage(JSON.stringify({event:"draft",error:C.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();var l=1==h.enableRecent,n=1==h.enableSearch,l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(c,b){c=c||this.emptyDiagramXml;null!=h.callback? -k.postMessage(JSON.stringify({event:"template",xml:c,blank:c==this.emptyDiagramXml,name:b}),"*"):(a(c,f,c!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,n?mxUtils.bind(this,function(a,c){this.searchReadyCallback=c;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,c,b){k.postMessage(JSON.stringify({event:"template", -docUrl:a,info:c,name:b}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list,h.errorMsg);else{if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message)); -null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var p=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph, -u=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var c=this.createLoadMessage("export");c.format=h.format;c.message=h;c.data=a;c.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(c),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);u(a)});if(this.isExportToCanvas()){if(null!= -this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),v=q.getGlobalVariable,B=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?B.getName():"pagenumber"==a?1:v.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+ -("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?u("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data= -this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)p=this.editor.getGraphXml(),m.data=this.getHtml(p,this.editor.graph),m.xml=mxUtils.getXml(p),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1), -"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0), -this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight= -"12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage", -data:JSON.stringify(h)}),"*");return}}}h=g(h);b=!0;try{a(h,f)}catch(C){this.handleError(C)}b=!1;null!=urlParams.modified&&this.editor.setStatus("");var N=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=N();d&&null==c&&(c=mxUtils.bind(this,function(a,c){var d=N();if(d!=e&&!b){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d, -"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,c),this.editor.graph.addListener("gridSizeChanged",c),this.editor.graph.addListener("shadowVisibleChanged",c),this.addListener("pageFormatChanged",c),this.addListener("pageScaleChanged",c),this.addListener("backgroundColorChanged",c),this.addListener("backgroundImageChanged",c),this.addListener("foldingEnabledChanged",c),this.addListener("mathEnabledChanged",c),this.addListener("gridEnabledChanged",c),this.addListener("guidesEnabledChanged", -c),this.addListener("pageViewChanged",c));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme? -"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"), -mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight= -"20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}), -null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,k=null,l="",m="auto",p="auto",q=null,v=null,z=40,G=40,E=0,x=this.editor.graph;x.getGraphBounds();for(var J=function(){null!=b?b(Z):(x.setSelectionCells(Z),x.scrollCellToVisible(x.getSelectionCell()))},H=x.getFreeInsertPoint(),B=H.x,N=H.y,H=N,C=null,I= -"auto",R=[],Y=null,aa=null,Q=0;Q<c.length&&"#"==c[Q].charAt(0);){a=c[Q];for(Q++;Q<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Q].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[Q].substring(1)),Q++;if("#"!=a.charAt(1)){var S=a.indexOf(":");if(0<S){var K=mxUtils.trim(a.substring(1,S)),F=mxUtils.trim(a.substring(S+1));"label"==K?C=x.sanitizeHtml(F):"style"==K?f=F:"identity"==K&&0<F.length&&"-"!=F?k=F:"namespace"==K&&0<F.length&&"-"!=F?l=F:"width"==K?m=F:"height"==K?p=F:"left"==K&&0<F.length? -q=F:"top"==K&&0<F.length?v=F:"ignore"==K?aa=F.split(","):"connect"==K?R.push(JSON.parse(F)):"link"==K?Y=F:"padding"==K?E=parseFloat(F):"edgespacing"==K?z=parseFloat(F):"nodespacing"==K?G=parseFloat(F):"layout"==K&&(I=F)}}}var V=this.editor.csvToArray(c[Q]),S=null;if(null!=k)for(var L=0;L<V.length;L++)if(k==V[L]){S=L;break}null==C&&(C="%"+V[0]+"%");if(null!=R)for(var O=0;O<R.length;O++)null==e[R[O].to]&&(e[R[O].to]={});x.model.beginUpdate();try{for(L=Q+1;L<c.length;L++){var X=this.editor.csvToArray(c[L]); -if(X.length==V.length){var A=null,W=null!=S?l+X[S]:null;null!=W&&(A=x.model.getCell(W));null==A&&(A=new mxCell(C,new mxGeometry(B,H,0,0),f||"whiteSpace=wrap;html=1;"),A.vertex=!0,A.id=W);for(var P=0;P<X.length;P++)x.setAttributeForCell(A,V[P],X[P]);x.setAttributeForCell(A,"placeholders","1");A.style=x.replacePlaceholders(A,A.style);for(O=0;O<R.length;O++)e[R[O].to][A.getAttribute(R[O].to)]=A;null!=Y&&"link"!=Y&&(x.setLinkForCell(A,A.getAttribute(Y)),x.setAttributeForCell(A,Y,null));x.fireEvent(new mxEventObject("cellsInserted", -"cells",[A]));var da=this.editor.graph.getPreferredSizeForCell(A);A.vertex&&(null!=q&&null!=A.getAttribute(q)&&(A.geometry.x=B+parseFloat(A.getAttribute(q))),null!=v&&null!=A.getAttribute(v)&&(A.geometry.y=N+parseFloat(A.getAttribute(v))),"@"==m.charAt(0)&&null!=A.getAttribute(m.substring(1))?A.geometry.width=parseFloat(A.getAttribute(m.substring(1))):A.geometry.width="auto"==m?da.width+E:parseFloat(m),"@"==p.charAt(0)&&null!=A.getAttribute(p.substring(1))?A.geometry.height=parseFloat(A.getAttribute(p.substring(1))): -A.geometry.height="auto"==p?da.height+E:parseFloat(p),H+=A.geometry.height+G);d.push(x.addCell(A))}}for(var T=d.slice(),Z=d.slice(),O=0;O<R.length;O++)for(var U=R[O],L=0;L<d.length;L++){var A=d[L],ma=A.getAttribute(U.from);if(null!=ma){x.setAttributeForCell(A,U.from,null);for(var na=ma.split(","),P=0;P<na.length;P++){var ca=e[U.to][na[P]];null!=ca&&(C=U.label,null!=U.fromlabel&&(C=(A.getAttribute(U.fromlabel)||"")+(C||"")),null!=U.tolabel&&(C=(C||"")+(ca.getAttribute(U.tolabel)||"")),Z.push(x.insertEdge(null, -null,C||"",U.invert?ca:A,U.invert?A:ca,U.style||x.createCurrentEdgeStyle())),mxUtils.remove(U.invert?A:ca,T))}}}if(null!=aa)for(L=0;L<d.length;L++)for(A=d[L],P=0;P<aa.length;P++)x.setAttributeForCell(A,mxUtils.trim(aa[P]),null);var ia=new mxParallelEdgeLayout(x);ia.spacing=z;var qa=function(){ia.execute(x.getDefaultParent());for(var a=0;a<d.length;a++){var b=x.getCellGeometry(d[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==m&&(b.width=Math.round(x.snap(b.width)));"auto"==p&& -(b.height=Math.round(x.snap(b.height)))}};if("circle"==I){var ea=new mxCircleLayout(x);ea.resetEdges=!1;var ra=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ea.execute(x.getDefaultParent());qa()},!0,J);J=null}else if("horizontaltree"==I||"verticaltree"==I||"auto"==I&&Z.length==2*d.length-1&&1==T.length){x.view.validate();var fa=new mxCompactTreeLayout(x,"horizontaltree"==I);fa.levelDistance=G;fa.edgeRouting= -!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(),0<T.length?T[0]:null)},!0,J);J=null}else if("horizontalflow"==I||"verticalflow"==I||"auto"==I&&1==T.length){x.view.validate();var ja=new mxHierarchicalLayout(x,"horizontalflow"==I?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=G;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(x.getDefaultParent(),Z);x.moveCells(Z,B,N)},!0,J);J=null}else if("organic"==I||"auto"==I&&Z.length> -d.length){x.view.validate();var ba=new mxFastOrganicLayout(x);ba.forceConstant=3*G;ba.resetEdges=!1;var ka=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return ka.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ia=new mxParallelEdgeLayout(x);ia.spacing=z;this.executeLayout(function(){ba.execute(x.getDefaultParent());qa()},!0,J);J=null}this.hideDialog()}finally{x.model.endUpdate()}null!=J&&J()}}catch(ga){this.handleError(ga)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&& -"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c, -d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var p=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=p.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a= -this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2* -a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a, -8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= +[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,l);if(0<a.length)if('{"state":"{\\"Properties\\":'==a.substring(0,26))this.importLucidChart(a,b,d,l);else{c=this.editor.graph;h=null;c.getModel().beginUpdate();try{h=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[h])),"<"==a.charAt(0)&& +a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),h.value=a,c.updateCellSize(h),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(h.value)&&c.setLinkForCell(h,h.value),h.geometry.width+=c.gridSize,h.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[h]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1; +do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11|| +0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a, +c){if(null!=c&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(c)){var b=new Blob([a],{type:"application/octet-stream"});this.importVisio(b,mxUtils.bind(this,function(a){this.importXml(a)}),null,c)}else this.editor.graph.setSelectionCells(this.importXml(a))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(e,arguments);a&&null==this.getCurrentFile()&& +"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,d,e,h,l,n,k,m,r,p){r=null!=r?r:!0;var c=!1,f=null,g=mxUtils.bind(this,function(a){var c=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,n)):c=this.importXml(a,d,e,r);null!=k&&k(c)});"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=p?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,r),m=!0)),m||(f=this.editor.graph,b=a.indexOf(";"), +0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),r&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,h,l,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,d,e,r);null!=k&&k(a)})):null!=m&&null!=n&&(/(\.vsdx?)($|\?)/i.test(n)||/(\.vssx)($|\?)/i.test(n))? +(c=!0,this.importVisio(m,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,n)?(c=!0,this.parseFile(null!=m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=k&&k(null))}),n)):/(\.vsd)($|\?)/i.test(n)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,r));c||null==k||k(f);return f};EditorUi.prototype.base64Encode=function(a){for(var c="",b=0,d=a.length,e,l,n;b<d;){e= +a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);c+="==";break}l=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(l&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l& +15)<<2);c+="=";break}n=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(l&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l&15)<<2|(n&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n&63)}return c};EditorUi.prototype.importFiles=function(a,b,d,e,h,l,n,k,m,r,p,q){b=null!=b?b:0;d=null!= +d?d:0;e=null!=e?e:this.maxImageSize;r=null!=r?r:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var u=p||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>u){g=!0;break}var v=mxUtils.bind(this,function(){var g=this.editor.graph,m=g.gridSize;h=null!=h?h:mxUtils.bind(this,function(a,b,d,e,f,g,n,k,l){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,n)),null): +this.importFile(a,b,d,e,f,g,n,k,l,c,q)});l=null!=l?l:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var u=a.length,t=u,v=[],y=mxUtils.bind(this,function(a,c){v[a]=c;if(0==--t){this.spinner.stop();if(null!=k)k(v);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<v.length;d++){var e=v[d]();null!=e&&(b=b.concat(e))}}finally{g.getModel().endUpdate()}}l(b)}}),x=0;x<u;x++)mxUtils.bind(this,function(c){var k=a[c],l=new FileReader; +l.onload=mxUtils.bind(this,function(a){if(null==n||n(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var l=a.target.result,u=l.indexOf(","),t=decodeURIComponent(escape(atob(l.substring(u+1)))),B=mxUtils.parseXml(t),t=B.getElementsByTagName("svg");if(0<t.length){var t=t[0],v=q?null:t.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&(v=decodeURIComponent(v));null==v||"<mxfile "!== +v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?y(c,mxUtils.bind(this,function(){try{if(l.substring(0,u+1),null!=B){var a=B.getElementsByTagName("svg");if(0<a.length){var n=a[0],r=parseFloat(n.getAttribute("width")),t=parseFloat(n.getAttribute("height")),p=n.getAttribute("viewBox");if(null==p||0==p.length)n.setAttribute("viewBox","0 0 "+r+" "+t);else if(isNaN(r)||isNaN(t)){var q=p.split(" ");3<q.length&&(r=parseFloat(q[2]),t=parseFloat(q[3]))}l=this.createSvgDataUri(mxUtils.getXml(n));var v= +Math.min(1,Math.min(e/Math.max(1,r)),e/Math.max(1,t)),C=h(l,k.type,b+c*m,d+c*m,Math.max(1,Math.round(r*v)),Math.max(1,Math.round(t*v)),k.name,f);if(isNaN(r)||isNaN(t)){var y=new Image;y.onload=mxUtils.bind(this,function(){r=Math.max(1,y.width);t=Math.max(1,y.height);C[0].geometry.width=r;C[0].geometry.height=t;n.setAttribute("viewBox","0 0 "+r+" "+t);l=this.createSvgDataUri(mxUtils.getXml(n));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));g.setCellStyles("image",l, +[C[0]])});y.src=this.createSvgDataUri(mxUtils.getXml(n))}return C}}}catch(ea){}return null})):y(c,mxUtils.bind(this,function(){return h(v,"text/xml",b+c*m,d+c*m,0,0,k.name)}))}}else{t=!1;if("image/png"==k.type){var C=q?null:this.extractGraphModelFromPng(a.target.result);if(null!=C&&0<C.length){var x=new Image;x.src=a.target.result;y(c,mxUtils.bind(this,function(){return h(C,"text/xml",b+c*m,d+c*m,x.width,x.height,k.name)}));t=!0}}t||(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(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,a.target.result,mxUtils.bind(this,function(g,n,l){y(c,mxUtils.bind(this,function(){if(null!=g&&g.length<r){var u=f&&this.isResampleImage(a.target.result,p)?Math.min(1,Math.min(e/n,e/l)):1;return h(g,k.type,b+c*m,d+c*m,Math.round(n* +u),Math.round(l*u),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,p)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else h(a.target.result,k.type,b+c*m,d+c*m,240,160,k.name,function(a){y(c,function(){return a})})});/(\.vsdx?)($|\?)/i.test(k.name)||/(\.vssx)($|\?)/i.test(k.name)?h(null,k.type,b+c*m,d+c*m,240,160,k.name,function(a){y(c,function(){return a})},k):"image"==k.type.substring(0,5)?l.readAsDataURL(k): +l.readAsText(k)})(x)});g?this.confirmImageResize(function(a){f=a;v()},m):v()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)}, +function(a){e(a,!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?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange= +function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,h,l){h=null!=h?h:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);if(e&&this.isResampleImage(b,l))try{var g=Math.max(c/h,f/h);if(1<g){var r=Math.round(c/g),m=Math.round(f/g),u=document.createElement("canvas");u.width=r;u.height=m;u.getContext("2d").drawImage(a,0,0,r,m);var t=u.toDataURL();if(t.length<b.length){var p= +document.createElement("canvas");p.width=r;p.height=m;var q=p.toDataURL();t!==q&&(b=t,c=r,f=m)}}}catch(x){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var b=e,h=0;8>h;h++)b=1==(b&1)?3988292384^b>>>1:b>>>1,EditorUi.prototype.crcTable[e]=b;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c= +c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,h){function c(a,c){var b=m;m+=c;return a.substring(b,m)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var m=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13, +10,26,10))null!=h&&h();else if(c(a,4),"IHDR"!=c(a,4))null!=h&&h();else{c(a,17);h=a.substring(0,m);do{var r=f(a);if("IDAT"==c(a,4)){h=a.substring(0,m-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);h+=g(d.length)+b+d+g(e^4294967295);h+=a.substring(m-8,a.length);break}h+=a.substring(m-8,m-4+r);c(a,r);c(a,4)}while(r);return"data:image/png;base64,"+(window.btoa?btoa(h):Base64.encode(h,!0))}};EditorUi.prototype.extractGraphModelFromPng= +function(a){var c=null;try{var b=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(b):Base64.decode(b,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,b,e){a=d.substring(a+8,a+8+e);"zTXt"==b?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(c=a))):"tEXt"==b&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(c=a[1]));if(null!=c|| +"IDAT"==b)return!0}))}catch(t){}null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));return c};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a};var m=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(c){return a.getLinkTitle(c)}; +b.customLinkClicked=function(c){try{a.handleCustomLink(c)}catch(H){a.handleError(H)}};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(c){c=null!=c?c:"";if(null!=a.pages&&null!=a.currentPage)for(var b=0;b<a.pages.length;b++)if(a.pages[b]==a.currentPage){0<b&&(c+=(0<c.length?"&":"?")+"page="+b);break}"1"==urlParams.dev&& +(c+=(0<c.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null==c||!b.isCustomLink(c)||!mxEvent.isTouchEvent(a)&&mxEvent.isPopupTrigger(a)||(b.customLinkClicked(c),mxEvent.consume(a));null!=f&&f(a,c)};e.call(this,a,c,d)};m.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement, +null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=b.getGlobalVariable;b.getGlobalVariable=function(c){return"page"==c&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==c?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:h.apply(this,arguments)};var l=b.createLinkForHint;b.createLinkForHint=function(a,c){null!= +a&&b.isCustomLink(a)&&(c=b.getLinkTitle(a));var d=l.call(this,a,c);null!=a&&b.isCustomLink(a)&&mxEvent.addListener(d,"click",function(c){b.customLinkClicked(a);mxEvent.consume(c)});return d};var n=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var e=c.getAttribute("href");if(null==e||!b.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))n.apply(this,arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(e),b.getRubberband().reset();mxEvent.consume(d)}}; +this.editor.getOrCreateFilename=function(){var c=a.defaultFilename,b=a.getCurrentFile();null!=b&&(c=null!=b.getTitle()?b.getTitle():c);return c};var k=this.actions.get("print");k.setEnabled(!mxClient.IS_IOS||!navigator.standalone);k.visible=k.isEnabled();if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){r.innerHTML=" ";r.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0, +"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var c=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var b=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<b.types.length;e++)if("text/"=== +b.types[e].substring(0,5)){d=!0;break}if(!d){var f=b.items;for(index in f){var g=f[index];if("file"===g.kind){if(c.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,b,d,e,f,g){c.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()});else{var n=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],n.x,n.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(aa){}}),!1);var r=document.createElement("div"); +r.style.position="absolute";r.style.whiteSpace="nowrap";r.style.overflow="hidden";r.style.display="block";r.contentEditable=!0;mxUtils.setOpacity(r,0);r.style.width="1px";r.style.height="1px";r.innerHTML=" ";var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()|| +null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||q||(r.style.left=b.container.scrollLeft+10+"px",r.style.top=b.container.scrollTop+10+"px",b.container.appendChild(r),q=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){r.focus();document.execCommand("selectAll",!1,null)},0):(r.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c= +a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=c&&17!=c&&91!=c||(q=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),r.parentNode.removeChild(r),mxUtils.clearSelection())}),0)}));mxEvent.addListener(r,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(r),p())}));mxEvent.addListener(r,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(this.copyCells(r,!0),p())}));mxEvent.addListener(r,"paste",mxUtils.bind(this,function(a){b.isEnabled()&& +!b.isCellLocked(b.getDefaultParent())&&(r.innerHTML=" ",r.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,r);r.innerHTML=" "}),0))}),!0);var v=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==r?!0:v.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED, +mxUtils.bind(this,function(a){var c=this.editor.graph,b=c.cellEditor.text2,d=null;null!=b&&(mxEvent.addListener(b,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(b));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d), +d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,b,d,e,f,g){c.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var c=0;c<a.length;c++)a[c]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var b=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b)?this.loadImage(decodeURIComponent(b),mxUtils.bind(this,function(a){var d= +Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));c.insertImage(decodeURIComponent(b),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain")); +a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){k=document.createElement("div");k.style.position="absolute";k.style.top="95px";k.style.left="250px";k.style.width="2000px";k.style.height="30px";k.style.background="whiteSmoke";document.body.appendChild(k);var z=document.createElement("div");z.style.position="absolute";z.style.top="125px";z.style.left="220px";z.style.width="30px";z.style.height="1000px";z.style.background="whiteSmoke";document.body.appendChild(z); +var G=document.createElement("div");G.style.position="absolute";G.style.top="95px";G.style.left="220px";G.style.width="30px";G.style.height="30px";G.style.background="whiteSmoke";document.body.appendChild(G);this.vRuler=new mxRuler(this.editor.graph,z,!0);this.hRuler=new mxRuler(this.editor.graph,k,!1)}if("1"==urlParams.test){k=document.getElementById("geFooter");null!=k&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute", +this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),k.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,c){if(0<this.editor.graph.getSelectionCount()){var b= +this.editor.graph.getSelectionCell(),b=this.editor.graph.getModel().getStyle(b);this.styleInput.value=b||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:E.apply(this,arguments)}}k=document.getElementById("geInfo");null!=k&&k.parentNode.removeChild(k);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var x=null;mxEvent.addListener(b.container, +"dragleave",function(a){b.isEnabled()&&(null!=x&&(x.parentNode.removeChild(x),x=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==x&&(!mxClient.IS_IE||10<document.documentMode)&&(x=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=x&&(x.parentNode.removeChild(x),x=null);if(b.isEnabled()){var c= +mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale,f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var n=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages); +if(null!=c)b.setSelectionCells(this.importXml(c,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=k;var l=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(l=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var h=!0,r=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k, +f,g,!0,l,null,h))});l&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){h=a;r()},mxEvent.isControlDown(a)):r()}else null!=n&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(n)?this.loadImage(decodeURIComponent(n),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ +n+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(n,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var c=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0, +13)){var b=a.indexOf(",");0<b&&(c=this.getPageById(a.substring(b+1)),c=null!=c?c.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(c=mxResources.get("action"));return c};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");(a=this.getPageById(a.substring(c+1)))&&this.selectPage(a)}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage|| +mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle); +mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this, +function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave= +mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(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.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML= +"";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d= +c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var n=e.lastIndexOf("%3E");0<=n&&n<e.length-3&&(e=e.substring(0,n+3))}catch(w){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(f=!0,e= +k)}catch(w){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell())); +try{mxEvent.consume(a)}catch(w){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var c=null,b=0;b<a.length;b++)mxEvent.addListener(a[b],"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[b],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==c&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(c=this.highlightElement()); +a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[b],"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var b=this.extractGraphModelFromEvent(a);if(null== +b){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?b=d.getData("Text"):(b=null,b=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=b&&0<b.length?(d=document.createElement("div"),d.innerHTML=b,d=d.getElementsByTagName("img"),0<d.length&&(b=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(b=d.getData("text/plain"))), +null!=b&&("data:image/png;base64,"==b.substring(0,22)?(b=this.extractGraphModelFromPng(b),null!=b&&0<b.length&&this.openLocalFile(b,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(b)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(b))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(b)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP? +"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))))}else this.openLocalFile(b,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var c=0,b=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else c=a.offsetTop,b=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex= +mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=c+"px";h.style.left=b+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var c=this.editor.extractGraphModel(a.documentElement);a= +[];if(null!=c){var b=new mxCodec(c.ownerDocument),d=new mxGraphModel;b.decode(c,d);c=d.getChildAt(d.getRoot(),0);for(b=0;b<d.getChildCount(c);b++)a.push(d.getChildAt(c,b))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&& +(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.vsdx?)($|\?)/i.test(e)||/(\.vssx)($|\?)/i.test(e))this.importVisio(a, +mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if('{"state":"{\\"Properties\\":'==d.substring(0,26))/(\.json)$/i.test(e)&& +(e=e.substring(0,e.length-5)+".xml"),this.openLocalFile(this.emptyDiagramXml,e,b),this.importLucidChart(d,0,0,null,mxUtils.bind(this,function(){this.editor.undoManager.clear();this.spinner.stop()}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}}else"image/png"== +a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,d){var c=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c= +mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,d))});null!=a&&0<a.length&&(null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile= +null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges"))}))))};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],d;for(d in a)b.push(d); +return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,e=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=d.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(d.model.getChildAt(a, +f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&& +this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0); +null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=d?d:!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(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var c=this.editor.graph;return{event:a,pageVisible:c.pageVisible,translate:c.view.translate,scale:c.view.scale,page:c.view.getBackgroundPageBounds(),bounds:c.getGraphBounds()}}; +EditorUi.prototype.installMessageHandler=function(a){var c=null,b=!1,d=!1,e=null,h=mxUtils.bind(this,function(a,c){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"== +a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(C){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey): +h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var k=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&n.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==h.action){k=null;k="data:image/png;base64,"== +h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();n.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();n.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey): +null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();n.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(C){n.postMessage(JSON.stringify({event:"draft",error:C.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();var k=1==h.enableRecent,l=1==h.enableSearch,k=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this, +function(c,b){c=c||this.emptyDiagramXml;null!=h.callback?n.postMessage(JSON.stringify({event:"template",xml:c,blank:c==this.emptyDiagramXml,name:b}),"*"):(a(c,f,c!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,k?mxUtils.bind(this,function(a){this.recentReadyCallback=a;n.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,l?mxUtils.bind(this,function(a,c){this.searchReadyCallback=c;n.postMessage(JSON.stringify({event:"searchDocs", +searchStr:a}),"*")}):null,function(a,c,b){n.postMessage(JSON.stringify({event:"template",docUrl:a,info:c,name:b}),"*")});this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();return}if("searchDocsList"==h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list,h.errorMsg);else{if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))): +null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var p=null!=h.xml? +h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,u=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var c=this.createLoadMessage("export");c.format=h.format;c.message=h;c.data=a;c.xml=encodeURIComponent(p);n.postMessage(JSON.stringify(c),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&& +q.container.parentNode.removeChild(q.container);u(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),v=q.getGlobalVariable,B=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?B.getName():"pagenumber"==a?1:v.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this, +function(){t(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?u("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!= +urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),m.xml=mxUtils.getXml(k),m.data=this.getFileData(null,null,!0,null,null,null,k),m.format=h.format;else if("html"==h.format)p=this.editor.getGraphXml(),m.data=this.getHtml(p,this.editor.graph),m.xml=mxUtils.getXml(p),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);m.xml=this.getFileData(!0);m.format="svg";if(h.embedImages||null==h.embedImages){if(null== +h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);n.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data= +this.createSvgDataUri(mxUtils.getXml(a));n.postMessage(JSON.stringify(m),"*")}));return}k="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));m.data=this.createSvgDataUri(k)}n.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit), +null!=h.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),h=null!=h.xmlpng? +this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{n.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}}h=g(h);b=!0;try{a(h,f)}catch(C){this.handleError(C)}b=!1;null!=urlParams.modified&&this.editor.setStatus("");var N=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}); +e=N();d&&null==c&&(c=mxUtils.bind(this,function(a,c){var d=N();if(d!=e&&!b){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,c),this.editor.graph.addListener("gridSizeChanged",c),this.editor.graph.addListener("shadowVisibleChanged",c),this.addListener("pageFormatChanged",c),this.addListener("pageScaleChanged",c),this.addListener("backgroundColorChanged",c),this.addListener("backgroundImageChanged", +c),this.addListener("foldingEnabledChanged",c),this.addListener("mathEnabledChanged",c),this.addListener("gridEnabledChanged",c),this.addListener("guidesEnabledChanged",c),this.addListener("pageViewChanged",c));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||n.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var n=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";n.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons= +function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b, +"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b, +mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&& +(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,h=null,k="",m="auto",p="auto",q=null,v=null,z=40,G=40,E=0,x=this.editor.graph;x.getGraphBounds();for(var J= +function(){null!=b?b(Z):(x.setSelectionCells(Z),x.scrollCellToVisible(x.getSelectionCell()))},H=x.getFreeInsertPoint(),B=H.x,N=H.y,H=N,C=null,I="auto",R=[],Y=null,aa=null,Q=0;Q<c.length&&"#"==c[Q].charAt(0);){a=c[Q];for(Q++;Q<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Q].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[Q].substring(1)),Q++;if("#"!=a.charAt(1)){var S=a.indexOf(":");if(0<S){var K=mxUtils.trim(a.substring(1,S)),F=mxUtils.trim(a.substring(S+1));"label"==K?C=x.sanitizeHtml(F):"style"== +K?f=F:"identity"==K&&0<F.length&&"-"!=F?h=F:"namespace"==K&&0<F.length&&"-"!=F?k=F:"width"==K?m=F:"height"==K?p=F:"left"==K&&0<F.length?q=F:"top"==K&&0<F.length?v=F:"ignore"==K?aa=F.split(","):"connect"==K?R.push(JSON.parse(F)):"link"==K?Y=F:"padding"==K?E=parseFloat(F):"edgespacing"==K?z=parseFloat(F):"nodespacing"==K?G=parseFloat(F):"layout"==K&&(I=F)}}}var V=this.editor.csvToArray(c[Q]),S=null;if(null!=h)for(var L=0;L<V.length;L++)if(h==V[L]){S=L;break}null==C&&(C="%"+V[0]+"%");if(null!=R)for(var O= +0;O<R.length;O++)null==e[R[O].to]&&(e[R[O].to]={});x.model.beginUpdate();try{for(L=Q+1;L<c.length;L++){var X=this.editor.csvToArray(c[L]);if(X.length==V.length){var A=null,W=null!=S?k+X[S]:null;null!=W&&(A=x.model.getCell(W));null==A&&(A=new mxCell(C,new mxGeometry(B,H,0,0),f||"whiteSpace=wrap;html=1;"),A.vertex=!0,A.id=W);for(var P=0;P<X.length;P++)x.setAttributeForCell(A,V[P],X[P]);x.setAttributeForCell(A,"placeholders","1");A.style=x.replacePlaceholders(A,A.style);for(O=0;O<R.length;O++)e[R[O].to][A.getAttribute(R[O].to)]= +A;null!=Y&&"link"!=Y&&(x.setLinkForCell(A,A.getAttribute(Y)),x.setAttributeForCell(A,Y,null));x.fireEvent(new mxEventObject("cellsInserted","cells",[A]));var da=this.editor.graph.getPreferredSizeForCell(A);A.vertex&&(null!=q&&null!=A.getAttribute(q)&&(A.geometry.x=B+parseFloat(A.getAttribute(q))),null!=v&&null!=A.getAttribute(v)&&(A.geometry.y=N+parseFloat(A.getAttribute(v))),"@"==m.charAt(0)&&null!=A.getAttribute(m.substring(1))?A.geometry.width=parseFloat(A.getAttribute(m.substring(1))):A.geometry.width= +"auto"==m?da.width+E:parseFloat(m),"@"==p.charAt(0)&&null!=A.getAttribute(p.substring(1))?A.geometry.height=parseFloat(A.getAttribute(p.substring(1))):A.geometry.height="auto"==p?da.height+E:parseFloat(p),H+=A.geometry.height+G);d.push(x.addCell(A))}}for(var T=d.slice(),Z=d.slice(),O=0;O<R.length;O++)for(var U=R[O],L=0;L<d.length;L++){var A=d[L],ma=A.getAttribute(U.from);if(null!=ma){x.setAttributeForCell(A,U.from,null);for(var na=ma.split(","),P=0;P<na.length;P++){var ca=e[U.to][na[P]];null!=ca&& +(C=U.label,null!=U.fromlabel&&(C=(A.getAttribute(U.fromlabel)||"")+(C||"")),null!=U.tolabel&&(C=(C||"")+(ca.getAttribute(U.tolabel)||"")),Z.push(x.insertEdge(null,null,C||"",U.invert?ca:A,U.invert?A:ca,U.style||x.createCurrentEdgeStyle())),mxUtils.remove(U.invert?A:ca,T))}}}if(null!=aa)for(L=0;L<d.length;L++)for(A=d[L],P=0;P<aa.length;P++)x.setAttributeForCell(A,mxUtils.trim(aa[P]),null);var ia=new mxParallelEdgeLayout(x);ia.spacing=z;var qa=function(){ia.execute(x.getDefaultParent());for(var a=0;a< +d.length;a++){var b=x.getCellGeometry(d[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==m&&(b.width=Math.round(x.snap(b.width)));"auto"==p&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==I){var ea=new mxCircleLayout(x);ea.resetEdges=!1;var ra=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ea.execute(x.getDefaultParent());qa()},!0,J);J=null}else if("horizontaltree"==I||"verticaltree"== +I||"auto"==I&&Z.length==2*d.length-1&&1==T.length){x.view.validate();var fa=new mxCompactTreeLayout(x,"horizontaltree"==I);fa.levelDistance=G;fa.edgeRouting=!1;fa.resetEdges=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(),0<T.length?T[0]:null)},!0,J);J=null}else if("horizontalflow"==I||"verticalflow"==I||"auto"==I&&1==T.length){x.view.validate();var ja=new mxHierarchicalLayout(x,"horizontalflow"==I?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=G;ja.disableEdgeStyle= +!1;this.executeLayout(function(){ja.execute(x.getDefaultParent(),Z);x.moveCells(Z,B,N)},!0,J);J=null}else if("organic"==I||"auto"==I&&Z.length>d.length){x.view.validate();var ba=new mxFastOrganicLayout(x);ba.forceConstant=3*G;ba.resetEdges=!1;var ka=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return ka.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ia=new mxParallelEdgeLayout(x);ia.spacing=z;this.executeLayout(function(){ba.execute(x.getDefaultParent());qa()},!0,J);J=null}this.hideDialog()}finally{x.model.endUpdate()}null!= +J&&J()}}catch(ga){this.handleError(ga)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "), +d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var p=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=p.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&& +null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width* +b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/ +a,8/a)};var h=b.init;b.init=function(){h.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat= e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient|| c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled(); this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d), this.menus.get("newLibrary").setEnabled(d));a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&& this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin= -"4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b= +"4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,h=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b= "";break;case e.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b= -'<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement= +'<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement= function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var q=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){q.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b); this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b); this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility); this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=d&&d.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var v=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&& -(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);v.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,k,h){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,k,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null, -null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*k/c.view.scale),p=Math.floor(g.height*k/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+p+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; +(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);v.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null, +null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),p=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+p+"&border="+l+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")}; DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,d,e){this.ui=a;this.page=d;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; function MovePage(a,d,e){this.ui=a;this.oldIndex=d;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; function SelectPage(a,d){this.ui=a;this.previousPage=this.page=d;this.neverShown=!0;null!=d&&(this.neverShown=null==d.viewState,this.ui.updatePageRoot(d))} @@ -3015,9 +3016,9 @@ EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var d=0;d<thi EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,d=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var b=this.tabContainer.style.height;this.tabContainer.style.height= null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":"30px";b!=this.tabContainer.style.height&&this.refresh(!1)}d.apply(a.view,arguments)});var e=null,b=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=e&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):(a.container.scrollLeft= a.view.translate.x*a.view.scale+b.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+b.viewState.scrollTop),e=b);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?1!=MathJax.Hub.queue.pending||null==this.editor||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){this.editor.graph.refresh()})):"undefined"===typeof Editor.MathJaxClear||null!=this.editor&&this.editor.graph.mathEnabled|| -Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,d){for(var e=d.getProperty("edit").changes,k=0;k<e.length;k++)if(e[k]instanceof SelectPage||e[k]instanceof RenamePage||e[k]instanceof MovePage||e[k]instanceof mxRootChange){b();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}; -Graph.prototype.createViewState=function(a){var d=a.getAttribute("page"),e=a.getAttribute("pageScale"),b=a.getAttribute("pageWidth"),k=a.getAttribute("pageHeight"),m=a.getAttribute("background"),p=a.getAttribute("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"== -a.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=m&&0<m.length?m:this.defaultGraphBackground,backgroundImage:null!=p?new mxImage(p.src,p.width,p.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=b&&null!=k?new mxRectangle(0,0,parseFloat(b),parseFloat(k)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"== +Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,d){for(var e=d.getProperty("edit").changes,h=0;h<e.length;h++)if(e[h]instanceof SelectPage||e[h]instanceof RenamePage||e[h]instanceof MovePage||e[h]instanceof mxRootChange){b();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}; +Graph.prototype.createViewState=function(a){var d=a.getAttribute("page"),e=a.getAttribute("pageScale"),b=a.getAttribute("pageWidth"),h=a.getAttribute("pageHeight"),m=a.getAttribute("background"),p=a.getAttribute("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),shadowVisible:"1"== +a.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=m&&0<m.length?m:this.defaultGraphBackground,backgroundImage:null!=p?new mxImage(p.src,p.width,p.height):null,pageScale:null!=e?e:mxGraph.prototype.pageScale,pageFormat:null!=b&&null!=h?new mxRectangle(0,0,parseFloat(b),parseFloat(h)):this.pageFormat,tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"== a.getAttribute("math"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1}}; 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}}; @@ -3033,8 +3034,8 @@ EditorUi.prototype.duplicatePage=function(a,d){var e=this.editor.graph,b=null;e. EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var d=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(d){null!=d&&0<d.length&&this.editor.graph.model.execute(new RenamePage(this,a,d))}),mxResources.get("rename"));this.showDialog(d.container,300,80,!0,!0);d.init()}return a};EditorUi.prototype.movePage=function(a,d){this.editor.graph.model.execute(new MovePage(this,a,d))}; EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#dcdcdc";a.style.position="absolute";a.style.whiteSpace="nowrap";a.style.overflow="hidden";a.style.height="0px";return a}; EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,d=document.createElement("div");d.style.position="relative";d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";d.style.verticalAlign="top";d.style.height=this.tabContainer.style.height;d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.fontSize="12px";d.style.marginLeft="30px";for(var e=this.editor.isChromelessView()?29:59,b=Math.min(140,Math.max(20,(this.tabContainer.clientWidth- -e)/this.pages.length)+1),k=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(b,e){this.pages[b]==this.currentPage?(e.className="geActivePage",e.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",e.style.fontWeight="bold",e.style.borderTopStyle="none"):e.className="geInactivePage";e.setAttribute("draggable","true");mxEvent.addListener(e,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),k=b):mxEvent.consume(c)}));mxEvent.addListener(e, -"dragend",mxUtils.bind(this,function(a){k=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){null!=k&&b!=k&&this.movePage(k,b);a.stopPropagation();a.preventDefault()}));d.appendChild(e)})(m,this.createTabForPage(this.pages[m],b,this.pages[m]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(d); +e)/this.pages.length)+1),h=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(b,e){this.pages[b]==this.currentPage?(e.className="geActivePage",e.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#eeeeee",e.style.fontWeight="bold",e.style.borderTopStyle="none"):e.className="geInactivePage";e.setAttribute("draggable","true");mxEvent.addListener(e,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),h=b):mxEvent.consume(c)}));mxEvent.addListener(e, +"dragend",mxUtils.bind(this,function(a){h=null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){null!=h&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){null!=h&&b!=h&&this.movePage(h,b);a.stopPropagation();a.preventDefault()}));d.appendChild(e)})(m,this.createTabForPage(this.pages[m],b,this.pages[m]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(d); b=this.createPageMenuTab();this.tabContainer.appendChild(b);b=null;this.isPageInsertTabVisible()&&(b=this.createPageInsertTab(),this.tabContainer.appendChild(b));if(d.clientWidth>this.tabContainer.clientWidth-e){null!=b&&(b.style.position="absolute",b.style.right="0px",d.style.marginRight="30px");var p=this.createControlTab(4," ❮ ");p.style.position="absolute";p.style.right=this.editor.chromeless?"29px":"55px";p.style.fontSize="13pt";this.tabContainer.appendChild(p);var q=this.createControlTab(4, " ❯");q.style.position="absolute";q.style.right=this.editor.chromeless?"0px":"29px";q.style.fontSize="13pt";this.tabContainer.appendChild(q);var v=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));d.style.width=v+"px";mxEvent.addListener(p,"click",mxUtils.bind(this,function(a){d.scrollLeft-=Math.max(20,v-20);mxUtils.setOpacity(p,0<d.scrollLeft?100:50);mxUtils.setOpacity(q,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(p, 0<d.scrollLeft?100:50);mxUtils.setOpacity(q,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.addListener(q,"click",mxUtils.bind(this,function(a){d.scrollLeft+=Math.max(20,v-20);mxUtils.setOpacity(p,0<d.scrollLeft?100:50);mxUtils.setOpacity(q,d.scrollLeft<d.scrollWidth-d.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()}; @@ -3043,49 +3044,49 @@ d.style.cursor="move";d.style.color="gray";a&&(mxEvent.addListener(d,"mouseenter EditorUi.prototype.createControlTab=function(a,d){var e=this.createTab(!0);e.style.paddingTop=a+"px";e.style.cursor="pointer";e.style.width="30px";e.style.lineHeight="30px";e.innerHTML=d;null!=e.firstChild&&null!=e.firstChild.style&&mxUtils.setOpacity(e.firstChild,40);return e}; EditorUi.prototype.createPageMenuTab=function(){var a=this.createControlTab(3,'<div class="geSprite geSprite-dots" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var d=0;d<this.pages.length;d++)mxUtils.bind(this, function(c){var d=a.addItem(this.pages[c].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[c])}),b);this.pages[c]==this.currentPage&&a.addCheckmark(d,Editor.checkmarkImage)})(d);if(this.editor.graph.isEnabled()){a.addSeparator(b);a.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),b);var e=this.currentPage;null!=e&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(e)}),b),a.addItem(mxResources.get("rename"), -null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxEvent.getClientX(a),k=mxEvent.getClientY(a);d.popup(b,k,null,a);this.setCurrentMenu(d); +null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxEvent.getClientX(a),h=mxEvent.getClientY(a);d.popup(b,h,null,a);this.setCurrentMenu(d); mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a}; EditorUi.prototype.createTabForPage=function(a,d,e){e=this.createTab(e);var b=a.getName();e.setAttribute("title",b);mxUtils.write(e,b);e.style.maxWidth=d+"px";e.style.width=d+"px";this.addTabListeners(a,e);42<d&&(e.style.textOverflow="ellipsis");return e}; -EditorUi.prototype.addTabListeners=function(a,d){mxEvent.disableContextMenu(d);var e=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var b=!1,k=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(d){b=null!=this.currentMenu;k=a==this.currentPage;e.isMouseDown||k||this.selectPage(a)}),null,mxUtils.bind(this,function(m){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(m)&&k||mxEvent.isPopupTrigger(m))){e.popupMenuHandler.hideMenu(); +EditorUi.prototype.addTabListeners=function(a,d){mxEvent.disableContextMenu(d);var e=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var b=!1,h=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(d){b=null!=this.currentMenu;h=a==this.currentPage;e.isMouseDown||h||this.selectPage(a)}),null,mxUtils.bind(this,function(m){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(m)&&h||mxEvent.isPopupTrigger(m))){e.popupMenuHandler.hideMenu(); this.hideCurrentMenu();if(!mxEvent.isTouchEvent(m)||!b){var p=new mxPopupMenu(this.createPageMenu(a));p.div.className+=" geMenubarMenu";p.smartSeparators=!0;p.showDisabled=!0;p.autoExpand=!0;p.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(p,arguments);this.resetCurrentMenu();p.destroy()});var q=mxEvent.getClientX(m),v=mxEvent.getClientY(m);p.popup(q,v,null,m);this.setCurrentMenu(p,d)}mxEvent.consume(m)}}))}; EditorUi.prototype.createPageMenu=function(a,d){return mxUtils.bind(this,function(e,b){e.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),b);e.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),b);e.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,d)}),b);e.addSeparator(b);e.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a, mxResources.get("copyOf",[a.getName()]))}),b)})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(d){a.apply(this,arguments);this.updateTabContainer()}})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};mxCodecRegistry.register(a)})(); (function(){var a=new mxObjectCodec(new RenamePage,["ui","page","previous"]);a.afterEncode=function(a,e,b){b.setAttribute("page",e.page.getId());return b};a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};a.afterDecode=function(a,e,b){b.page=a.ui.getPageById(e.getAttribute("page"));b.previous=b.name;return b};mxCodecRegistry.register(a)})(); (function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" "));a.afterEncode=function(a,e,b){b.setAttribute("relatedPage",e.relatedPage.getId());null==e.index&&(b.setAttribute("name",e.relatedPage.getName()),null!=e.relatedPage.root&&a.encodeCell(e.relatedPage.root,b));return b};a.beforeDecode=function(a,e,b){b.ui=a.ui;b.relatedPage=b.ui.getPageById(e.getAttribute("relatedPage"));if(null==b.relatedPage){var d=document.createElement("diagram");d.setAttribute("id", e.getAttribute("relatedPage"));d.setAttribute("name",e.getAttribute("name"));b.relatedPage=new DiagramPage(d);e=e.cloneNode(!0);d=e.firstChild;if(null!=d)for(b.relatedPage.root=a.decodeCell(d,!1),b=d.nextSibling,d.parentNode.removeChild(d),d=b;null!=d;){b=d.nextSibling;if(d.nodeType==mxConstants.NODETYPE_ELEMENT){var m=d.getAttribute("id");null==a.lookup(m)&&a.decodeCell(d)}d.parentNode.removeChild(d);d=b}}return e};a.afterDecode=function(a,e,b){b.index=b.previousIndex;return b};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",d=Graph.prototype.foldCells; -Graph.prototype.foldCells=function(a,b,e,q,v){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],g=0;g<e.length;g++){var k=this.view.getState(e[g]),m=null!=k?k.style:this.getCellStyle(e[g]);"1"==mxUtils.getValue(m,"treeFolding","0")&&(this.traverse(e[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[g]&&f.push(a);return a==e[g]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[g], -a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=c;e=d.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return n.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=n.getParent(a),b=h.view.getState(a),h.view.getState(a),b="tree"==(null!=b?b.style:h.getCellStyle(a)).containerType); -return b}function e(a){var b=!1;null!=a&&(a=n.getParent(a),b=h.view.getState(a),h.view.getState(a),b=null!=(null!=b?b.style:h.getCellStyle(a)).childLayout);return b}function q(a){a=h.view.getState(a);if(null!=a){var b=h.getIncomingEdges(a.cell);if(0<b.length&&(b=h.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())< -a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function v(a,b){b=null!=b?b:!0;h.model.beginUpdate();try{var c=h.model.getParent(a),d=h.getIncomingEdges(a),e=h.cloneCells([d[0],a]);h.model.setTerminal(e[0],h.model.getTerminal(d[0],!0),!0);var f=q(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+ -10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);h.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var l=h.view.getState(a),k=h.view.scale;if(null!=l){var n=mxRectangle.fromRectangle(l);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*k:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*k;var m=h.getOutgoingEdges(h.model.getTerminal(d[0], -!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,r=g=d=0;r<m.length;r++){var t=h.model.getTerminal(m[r],!1);if(f==q(t)){var u=h.view.getState(t);t!=a&&null!=u&&(p&&b!=u.getCenterX()<l.getCenterX()||!p&&b!=u.getCenterY()<l.getCenterY())&&mxUtils.intersects(n,u)&&(d=10+Math.max(d,(Math.min(n.x+n.width,u.x+u.width)-Math.max(n.x,u.x))/k),g=10+Math.max(g,(Math.min(n.y+n.height,u.y+u.height)-Math.max(n.y,u.y))/k))}}p?g=0:d=0;for(r=0;r<m.length;r++)if(t=h.model.getTerminal(m[r], -!1),f==q(t)&&(u=h.view.getState(t),t!=a&&null!=u&&(p&&b!=u.getCenterX()<l.getCenterX()||!p&&b!=u.getCenterY()<l.getCenterY()))){var v=[];h.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});h.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return h.addCells(e,c)}finally{h.model.endUpdate()}}function c(a){h.model.beginUpdate();try{var b=q(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(c[0],d[1],!1);h.model.setTerminal(d[0],d[1],!0);h.model.setTerminal(d[0],a,!1); -var e=h.model.getParent(a),f=e.geometry,g=[];h.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);h.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var l=a.geometry.width+40,k=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?l=0:b==mxConstants.DIRECTION_NORTH?(l=0,k=-40):b==mxConstants.DIRECTION_WEST?(l=-40,k=0):b==mxConstants.DIRECTION_EAST&&(k=0);h.moveCells(g,l,k);return h.addCells(d,e)}finally{h.model.endUpdate()}}function f(a){h.model.beginUpdate();try{var b= -h.model.getParent(a),c=h.getIncomingEdges(a),d=h.cloneCells([c[0],a]);h.model.setTerminal(d[0],a,!0);var c=h.getOutgoingEdges(a),e=b.geometry,f=[];h.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var l=h.model.getTerminal(c[g],!1);null!=l&&f.push(l)}var k=h.view.getBounds(f),n=q(a),m=h.view.translate,p=h.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-m.x-e.x+10,d[1].geometry.y+=a.geometry.height- -e.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-m.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=n==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==k?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-m.y+-e.y+10);return h.addCells(d,b)}finally{h.model.endUpdate()}}function g(a, -b,c){a=h.getOutgoingEdges(a);c=h.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=h.view.getState(h.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function u(a,b){var c=q(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST|| -c==mxConstants.DIRECTION_WEST)==d&&c!=b?t.actions.get("selectParent").funct():c==b?(d=h.getOutgoingEdges(a),null!=d&&0<d.length&&h.setSelectionCell(h.model.getTerminal(d[0],!1))):(c=h.getIncomingEdges(a),null!=c&&0<c.length&&(d=g(h.model.getTerminal(c[0],!0),d,a),c=h.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&h.setSelectionCell(d[c].cell)))))}var t=this,h=t.editor.graph,n=h.getModel();mxResources.parse("selectChildren=Select Children"); -mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var l=t.menus.createPopupMenu;t.menus.createPopupMenu=function(a,c,d){l.apply(this,arguments);if(1==h.getSelectionCount()){c=h.getSelectionCell();var e=h.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(h.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(h.getSelectionCell())&& -(a.addSeparator(),0<h.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};t.actions.addAction("selectChildren",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),a=h.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(h.model.getTerminal(a[c],!1));h.setSelectionCells(b)}}},null,null,"Alt+Shift+X");t.actions.addAction("selectSiblings",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(), -a=h.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=h.getOutgoingEdges(h.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(h.model.getTerminal(a[c],!1));h.setSelectionCells(b)}}},null,null,"Alt+Shift+S");t.actions.addAction("selectParent",function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),a=h.getIncomingEdges(a);null!=a&&0<a.length&&h.setSelectionCell(h.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");t.actions.addAction("selectDescendants", -function(){if(h.isEnabled()&&1==h.getSelectionCount()){var a=h.getSelectionCell(),b=[];h.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});h.setSelectionCells(b)}},null,null,"Alt+Shift+T");var w=h.removeCells;h.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];n.isEdge(g)&&d(g)&&(e.push(g),g=n.getTerminal(g,!1));b(g)?(h.traverse(g,!0, -function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=h.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return w.apply(this,arguments)};t.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var r=h.duplicateCells;h.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=h.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=h.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f], -a)}this.model.beginUpdate();try{var l=r.call(this,a,c);if(l.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=h.getIncomingEdges(l[e]),g=h.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var n=this.cloneCells([g[0]])[0];this.addEdge(n,h.getDefaultParent(),this.model.getTerminal(g[0],!0),l[e])}}}finally{this.model.endUpdate()}return l};var y=h.moveCells;h.moveCells=function(a,c,d,e,f,g,l){var k=null;this.model.beginUpdate();try{var n=f,m=this.view.getState(f),p=null!=m?m.style:this.getCellStyle(f); -if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var r=0;r<a.length;r++)if(b(a[r])||h.model.isEdge(a[r])&&null==h.model.getTerminal(a[r],!0)){f=h.model.getParent(a[r]);break}if(null!=n&&f!=n&&null!=this.view.getState(a[0])){var q=h.getIncomingEdges(a[0]);if(0<q.length){var t=h.view.getState(h.model.getTerminal(q[0],!0));if(null!=t){var u=h.view.getState(n);null!=u&&(c=(u.getCenterX()-t.getCenterX())/h.view.scale,d=(u.getCenterY()-t.getCenterY())/h.view.scale)}}}}k=y.apply(this,arguments); -if(null!=k&&null!=a&&k.length==a.length)for(r=0;r<k.length;r++)if(this.model.isEdge(k[r]))b(n)&&0>mxUtils.indexOf(k,this.model.getTerminal(k[r],!0))&&this.model.setTerminal(k[r],n,!0);else if(b(a[r])&&(q=h.getIncomingEdges(a[r]),0<q.length))if(!e)b(n)&&0>mxUtils.indexOf(a,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],n,!0);else if(0==h.getIncomingEdges(k[r]).length){m=n;if(null==m||m==h.model.getParent(a[r]))m=h.model.getTerminal(q[0],!0);e=this.cloneCells([q[0]])[0];this.addEdge(e, -h.getDefaultParent(),m,k[r])}}finally{this.model.endUpdate()}return k};if(null!=t.sidebar){var D=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(a,c,d,e){var f=h.model,g=null;f.beginUpdate();try{if(g=D.apply(this,arguments),b(a))for(var l=0;l<g.length;l++)if(f.isEdge(g[l])&&null==f.getTerminal(g[l],!0)){f.setTerminal(g[l],a,!0);var k=h.getCellGeometry(g[l]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var z={88:t.actions.get("selectChildren"), -84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},G=t.onKeyDown;t.onKeyDown=function(a){try{if(h.isEnabled()&&!h.isEditing()&&b(h.getSelectionCell())&&1==h.getSelectionCount()){var d=null;0<h.getIncomingEdges(h.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(h.getSelectionCell()):f(h.getSelectionCell()):13==a.which&&(d=v(h.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&h.model.isEdge(d[0])?h.setSelectionCell(h.model.getTerminal(d[0], -!1)):h.setSelectionCell(d[d.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(h.view.getState(h.getSelectionCell())),h.startEditingAtCell(h.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=z[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(u(h.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(u(h.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(u(h.getSelectionCell(), -mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(u(h.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(I){console.log("error",I)}mxEvent.isConsumed(a)||G.apply(this,arguments)};var E=h.connectVertex;h.connectVertex=function(a,d,e,g,l,k){var n=h.getIncomingEdges(a);return b(a)&&0<n.length?(e=q(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,l=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==l?c(a):v(a,d!=mxConstants.DIRECTION_NORTH&& -d!=mxConstants.DIRECTION_WEST)):E.call(this,a,d,e,g,l,k)};h.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&h.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var x=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){x.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"), +Graph.prototype.foldCells=function(a,b,e,q,v){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var c=e.slice(),f=[],g=0;g<e.length;g++){var h=this.view.getState(e[g]),m=null!=h?h.style:this.getCellStyle(e[g]);"1"==mxUtils.getValue(m,"treeFolding","0")&&(this.traverse(e[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=e[g]&&f.push(a);return a==e[g]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[g], +a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);e=c;e=d.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return n.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=n.getParent(a),b=l.view.getState(a),l.view.getState(a),b="tree"==(null!=b?b.style:l.getCellStyle(a)).containerType); +return b}function e(a){var b=!1;null!=a&&(a=n.getParent(a),b=l.view.getState(a),l.view.getState(a),b=null!=(null!=b?b.style:l.getCellStyle(a)).childLayout);return b}function q(a){a=l.view.getState(a);if(null!=a){var b=l.getIncomingEdges(a.cell);if(0<b.length&&(b=l.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())< +a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function v(a,b){b=null!=b?b:!0;l.model.beginUpdate();try{var c=l.model.getParent(a),d=l.getIncomingEdges(a),e=l.cloneCells([d[0],a]);l.model.setTerminal(e[0],l.model.getTerminal(d[0],!0),!0);var f=q(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+ +10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);l.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var h=l.view.getState(a),n=l.view.scale;if(null!=h){var k=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?k.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*n:k.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*n;var m=l.getOutgoingEdges(l.model.getTerminal(d[0], +!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,r=g=d=0;r<m.length;r++){var t=l.model.getTerminal(m[r],!1);if(f==q(t)){var u=l.view.getState(t);t!=a&&null!=u&&(p&&b!=u.getCenterX()<h.getCenterX()||!p&&b!=u.getCenterY()<h.getCenterY())&&mxUtils.intersects(k,u)&&(d=10+Math.max(d,(Math.min(k.x+k.width,u.x+u.width)-Math.max(k.x,u.x))/n),g=10+Math.max(g,(Math.min(k.y+k.height,u.y+u.height)-Math.max(k.y,u.y))/n))}}p?g=0:d=0;for(r=0;r<m.length;r++)if(t=l.model.getTerminal(m[r], +!1),f==q(t)&&(u=l.view.getState(t),t!=a&&null!=u&&(p&&b!=u.getCenterX()<h.getCenterX()||!p&&b!=u.getCenterY()<h.getCenterY()))){var v=[];l.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});l.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return l.addCells(e,c)}finally{l.model.endUpdate()}}function c(a){l.model.beginUpdate();try{var b=q(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],a]);l.model.setTerminal(c[0],d[1],!1);l.model.setTerminal(d[0],d[1],!0);l.model.setTerminal(d[0],a,!1); +var e=l.model.getParent(a),f=e.geometry,g=[];l.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);l.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var h=a.geometry.width+40,n=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?h=0:b==mxConstants.DIRECTION_NORTH?(h=0,n=-40):b==mxConstants.DIRECTION_WEST?(h=-40,n=0):b==mxConstants.DIRECTION_EAST&&(n=0);l.moveCells(g,h,n);return l.addCells(d,e)}finally{l.model.endUpdate()}}function f(a){l.model.beginUpdate();try{var b= +l.model.getParent(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],a]);l.model.setTerminal(d[0],a,!0);var c=l.getOutgoingEdges(a),e=b.geometry,f=[];l.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var h=l.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var n=l.view.getBounds(f),k=q(a),m=l.view.translate,p=l.view.scale;k==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==n?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(n.x+n.width)/p-m.x-e.x+10,d[1].geometry.y+=a.geometry.height- +e.y+40):k==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==n?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(n.x+n.width)/p-m.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=k==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==n?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(n.y+n.height)/p-m.y+-e.y+10);return l.addCells(d,b)}finally{l.model.endUpdate()}}function g(a, +b,c){a=l.getOutgoingEdges(a);c=l.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=l.view.getState(l.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function u(a,b){var c=q(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST|| +c==mxConstants.DIRECTION_WEST)==d&&c!=b?t.actions.get("selectParent").funct():c==b?(d=l.getOutgoingEdges(a),null!=d&&0<d.length&&l.setSelectionCell(l.model.getTerminal(d[0],!1))):(c=l.getIncomingEdges(a),null!=c&&0<c.length&&(d=g(l.model.getTerminal(c[0],!0),d,a),c=l.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&l.setSelectionCell(d[c].cell)))))}var t=this,l=t.editor.graph,n=l.getModel();mxResources.parse("selectChildren=Select Children"); +mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var k=t.menus.createPopupMenu;t.menus.createPopupMenu=function(a,c,d){k.apply(this,arguments);if(1==l.getSelectionCount()){c=l.getSelectionCell();var e=l.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(l.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(l.getSelectionCell())&& +(a.addSeparator(),0<l.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};t.actions.addAction("selectChildren",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),a=l.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(l.model.getTerminal(a[c],!1));l.setSelectionCells(b)}}},null,null,"Alt+Shift+X");t.actions.addAction("selectSiblings",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(), +a=l.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=l.getOutgoingEdges(l.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(l.model.getTerminal(a[c],!1));l.setSelectionCells(b)}}},null,null,"Alt+Shift+S");t.actions.addAction("selectParent",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),a=l.getIncomingEdges(a);null!=a&&0<a.length&&l.setSelectionCell(l.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");t.actions.addAction("selectDescendants", +function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),b=[];l.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});l.setSelectionCells(b)}},null,null,"Alt+Shift+T");var w=l.removeCells;l.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];n.isEdge(g)&&d(g)&&(e.push(g),g=n.getTerminal(g,!1));b(g)?(l.traverse(g,!0, +function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=l.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return w.apply(this,arguments)};t.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var r=l.duplicateCells;l.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=l.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=l.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f], +a)}this.model.beginUpdate();try{var h=r.call(this,a,c);if(h.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var n=l.getIncomingEdges(h[e]),g=l.getIncomingEdges(a[e]);if(0==n.length&&0<g.length){var k=this.cloneCells([g[0]])[0];this.addEdge(k,l.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var y=l.moveCells;l.moveCells=function(a,c,d,e,f,g,h){var n=null;this.model.beginUpdate();try{var k=f,m=this.view.getState(f),p=null!=m?m.style:this.getCellStyle(f); +if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var r=0;r<a.length;r++)if(b(a[r])||l.model.isEdge(a[r])&&null==l.model.getTerminal(a[r],!0)){f=l.model.getParent(a[r]);break}if(null!=k&&f!=k&&null!=this.view.getState(a[0])){var q=l.getIncomingEdges(a[0]);if(0<q.length){var t=l.view.getState(l.model.getTerminal(q[0],!0));if(null!=t){var u=l.view.getState(k);null!=u&&(c=(u.getCenterX()-t.getCenterX())/l.view.scale,d=(u.getCenterY()-t.getCenterY())/l.view.scale)}}}}n=y.apply(this,arguments); +if(null!=n&&null!=a&&n.length==a.length)for(r=0;r<n.length;r++)if(this.model.isEdge(n[r]))b(k)&&0>mxUtils.indexOf(n,this.model.getTerminal(n[r],!0))&&this.model.setTerminal(n[r],k,!0);else if(b(a[r])&&(q=l.getIncomingEdges(a[r]),0<q.length))if(!e)b(k)&&0>mxUtils.indexOf(a,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],k,!0);else if(0==l.getIncomingEdges(n[r]).length){m=k;if(null==m||m==l.model.getParent(a[r]))m=l.model.getTerminal(q[0],!0);e=this.cloneCells([q[0]])[0];this.addEdge(e, +l.getDefaultParent(),m,n[r])}}finally{this.model.endUpdate()}return n};if(null!=t.sidebar){var D=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(a,c,d,e){var f=l.model,g=null;f.beginUpdate();try{if(g=D.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var n=l.getCellGeometry(g[h]);n.points=null;null!=n.getTerminalPoint(!0)&&n.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var z={88:t.actions.get("selectChildren"), +84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},G=t.onKeyDown;t.onKeyDown=function(a){try{if(l.isEnabled()&&!l.isEditing()&&b(l.getSelectionCell())&&1==l.getSelectionCount()){var d=null;0<l.getIncomingEdges(l.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(l.getSelectionCell()):f(l.getSelectionCell()):13==a.which&&(d=v(l.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&l.model.isEdge(d[0])?l.setSelectionCell(l.model.getTerminal(d[0], +!1)):l.setSelectionCell(d[d.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(l.view.getState(l.getSelectionCell())),l.startEditingAtCell(l.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=z[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(u(l.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(u(l.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(u(l.getSelectionCell(), +mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(u(l.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(I){console.log("error",I)}mxEvent.isConsumed(a)||G.apply(this,arguments)};var E=l.connectVertex;l.connectVertex=function(a,d,e,g,h,n){var k=l.getIncomingEdges(a);return b(a)&&0<k.length?(e=q(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,h=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==h?c(a):v(a,d!=mxConstants.DIRECTION_NORTH&& +d!=mxConstants.DIRECTION_WEST)):E.call(this,a,d,e,g,h,n)};l.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&l.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var x=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){x.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"), this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells); this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var J=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){J.apply(this,arguments);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 H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var b=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=b.apply(this,arguments),d=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container", function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;"); b.vertex=!0;var d=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");c.geometry.relative=!0;c.edge=!0;b.insertEdge(c,!0);d.insertEdge(c,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;"); -e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var k=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");k.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); -m.geometry.relative=!0;m.edge=!0;b.insertEdge(m,!0);k.insertEdge(m,!1);var h=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");h.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); -n.geometry.relative=!0;n.edge=!0;b.insertEdge(n,!0);h.insertEdge(n,!1);a.insert(c);a.insert(g);a.insert(m);a.insert(n);a.insert(b);a.insert(d);a.insert(e);a.insert(k);a.insert(h);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a], +e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var h=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");h.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); +m.geometry.relative=!0;m.edge=!0;b.insertEdge(m,!0);h.insertEdge(m,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");l.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); +n.geometry.relative=!0;n.edge=!0;b.insertEdge(n,!0);l.insertEdge(n,!1);a.insert(c);a.insert(g);a.insert(m);a.insert(n);a.insert(b);a.insert(d);a.insert(e);a.insert(h);a.insert(l);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a], a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap branch",function(){var a=new mxCell("Branch",new mxGeometry(0,0,80,20),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;"); b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap sub topic",function(){var a=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0, 0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Organization", @@ -3094,14 +3095,14 @@ b.insertEdge(c,!0);e.insertEdge(c,!1);var f=new mxCell("Division",new mxGeometry a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree root",function(){var a=new mxCell("Organization",new mxGeometry(0,0,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");d.setAttributeForCell(a,"treeRoot","1");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree division",function(){var a=new mxCell("Division",new mxGeometry(20,40,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;"); a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");b.geometry.setTerminalPoint(new mxPoint(0,0),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree sub sections",function(){var a=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;"); a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");b.geometry.setTerminalPoint(new mxPoint(110,-40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);var d=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");d.vertex=!0;var c=new mxCell("",new mxGeometry(0, -0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");c.geometry.setTerminalPoint(new mxPoint(110,-40),!0);c.geometry.relative=!0;c.edge=!0;d.insertEdge(c,!1);return sb.createVertexTemplateFromCells([b,c,a,d],220,60,"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new k(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(546,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&& -a.formatWindow.window.fit()}function d(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,266);a.sidebarWindow=new k(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;"; +0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");c.geometry.setTerminalPoint(new mxPoint(110,-40),!0);c.geometry.relative=!0;c.edge=!0;d.insertEdge(c,!1);return sb.createVertexTemplateFromCells([b,c,a,d],220,60,"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new h(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(546,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&& +a.formatWindow.window.fit()}function d(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,266);a.sidebarWindow=new h(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;"; g.className="geTitle";b.appendChild(g);return g}var d=document.createElement("div");d.style.cssText="position:absolute;left:0;right:0;border-top:1px solid lightgray;height:24px;bottom:31px;text-align:center;cursor:pointer;padding:6px 0 0 0;";d.className="geTitle";mxUtils.write(d,mxResources.get("moreShapes"));b.appendChild(d);mxEvent.addListener(d,"click",function(){a.actions.get("shapes").funct()});var e=new Menubar(a,b);if(!Editor.enableCustomLibraries||"1"==urlParams.embed&&"1"!=urlParams.libraries)d.style.bottom= "0";else if(null!=a.actions.get("newLibrary")){d=document.createElement("div");d.style.cssText="position:absolute;left:0px;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;";d.className="geTitle";var f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("newLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("newLibrary").funct);d=document.createElement("div"); d.style.cssText="position:absolute;left:50%;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;border-left: 1px solid lightgray;";d.className="geTitle";f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("openLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("openLibrary").funct)}else d=c("newLibrary",mxResources.get("newLibrary")),d.style.left= "0",d=c("openLibraryFrom",mxResources.get("openLibraryFrom")),d.style.borderLeft="1px solid lightgray",d.style.left="50%";b.appendChild(a.sidebar.container);b.style.overflow="hidden";return b});a.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);a.sidebarWindow.window.setVisible(!0);a.getLocalData("sidebar",function(b){a.sidebar.showEntries(b,null,!0)});a.restoreLibraries()}else a.sidebarWindow.window.setVisible(!a.sidebarWindow.window.isVisible());a.sidebarWindow.window.isVisible()&&a.sidebarWindow.window.fit()} if("1"!=urlParams.lightbox&&"0"!=urlParams.chrome){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;try{var b=document.createElement("style");b.type="text/css";b.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0;}html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }.geDialog input, .geToolbarContainer input, .mxWindow input {padding:2px !important;display:inline-block !important; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }.mxWindow .geColorBtn, .geDialog .geColorBtn { background: none !important; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-color: rgb(216, 216, 216); }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.geBtn:hover, .mxWindow button.geBtn:hover, .geDialog button.geBtn:hover { box-shadow: none; border-color: rgb(216, 216, 216); }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:2px; padding: 0 2px 4px 2px; } .geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px 0 2px 0; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }a.geMenuItem:active { opacity: 0.4; }.geToolbarContainer { background:#fff !important; }div.mxWindow .geSidebarContainer .geTitle { background-color:#fdfdfd; }div.mxWindow .geSidebarContainer .geTitle:hover { background-color:#fafafa; }div.geSidebar { background-color: #fff !important;}div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:#fff !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow * { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: rgb(249, 249, 249) !important; color:lightgray !important; } html div.geActivePage { background: white !important;color: #353535 !important; } html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.5) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: #353535; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: #29b6f2; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: #fff !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }"; -document.getElementsByTagName("head")[0].appendChild(b)}catch(n){}var k=function(a,b,c,d,e,f,g){a=document.createElement("div");a.className="geSidebarContainer";a.style.position="absolute";a.style.width="100%";a.style.height="100%";a.style.border="1px solid whiteSmoke";a.style.overflowX="hidden";a.style.overflowY="auto";g(a);this.window=new mxWindow(b,a,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0); +document.getElementsByTagName("head")[0].appendChild(b)}catch(n){}var h=function(a,b,c,d,e,f,g){a=document.createElement("div");a.className="geSidebarContainer";a.style.position="absolute";a.style.width="100%";a.style.height="100%";a.style.border="1px solid whiteSmoke";a.style.overflowX="hidden";a.style.overflowY="auto";g(a);this.window=new mxWindow(b,a,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0); this.window.setLocation=function(a,b){var c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)}};Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src; mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#C0C0C0" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxVertexHandler.prototype.handleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/>'); mxEdgeHandler.prototype.handleImage=mxVertexHandler.prototype.handleImage;mxEdgeHandler.prototype.terminalHandleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/><circle cx="8" cy="8" r="3" stroke="#ffffff" fill="#29b6f2"/>');mxEdgeHandler.prototype.fixedHandleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/><path d="m 6 6 L 10 10 M 6 10 L 10 6" stroke="#ffffff"/>');mxConstraintHandler.prototype.pointImage= @@ -3125,20 +3126,20 @@ EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a mxResources.get("text");b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";b.actions.get("insertRectangle").label=mxResources.get("rectangle");b.actions.get("insertEllipse").label=mxResources.get("ellipse");b.actions.get("insertRhombus").label=mxResources.get("rhombus");b.actions.get("insertImage").label=mxResources.get("image")+"...";b.actions.get("insertLink").label=mxResources.get("link")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label= mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importFile",new Action("File...",function(){c.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",function(){null!=a.files&&b.importFiles(a.files,null,null,b.maxImageSize)});a.click()}));b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){c.popupMenuHandler.hideMenu();b.showImportCsvDialog()})); b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(b,"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){d(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+ -"...",function(){a(b)}));EditorUi.enablePlantUml&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,"new open - save saveAs -".split(" "),c):"1"==urlParams.embed? -(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile&&(b.menus.addMenuItems(a,["-","share"],c),null!=d.realtime&&b.menus.addMenuItems(a,["chatWindowTitle"],c),a.addSeparator(c));b.menus.addMenuItems(a,["-","outline", -"layers","-","find"],c);d=this.addMenuItem(a,"tags",c);b.isOffline()&&!mxClient.IS_CHROMEAPP||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,c){f.apply(this, -arguments);a.addSeparator(c);b.menus.addSubmenu("openRecent",a,c)}}this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],c):b.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||b.menus.addMenuItems(a,["-","revisionHistory"],c);b.menus.addMenuItems(a,["-","autosave"],c)})));var g= -this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){g.funct(a,c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=h&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","pageScale"], -c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);if(!b.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(c);var d=b.menus.addMenuItem(a,"plugins",c);b.isOffline()||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText createShape plantUml - importCsv formatSql editDiagram".split(" "), -c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.menus.addSubmenu("importFrom",a,c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",a,c);b.menus.addSubmenu("insertAdvanced",a,c)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "), -m=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):m(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "), -c)})))};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=f.menus.get(a),g=m.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height="30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));f.menus.menuCreated(e,g,"geMenuItem");null!=c? +"...",function(){a(b)}));EditorUi.enablePlantUml&&!b.isOffline()&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,"new open - save saveAs -".split(" "), +c):"1"==urlParams.embed?(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile&&(b.menus.addMenuItems(a,["-","share"],c),null!=d.realtime&&b.menus.addMenuItems(a,["chatWindowTitle"],c),a.addSeparator(c));b.menus.addMenuItems(a, +["-","outline","layers","-","find"],c);d=this.addMenuItem(a,"tags",c);b.isOffline()&&!mxClient.IS_CHROMEAPP||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a, +c){f.apply(this,arguments);a.addSeparator(c);b.menus.addSubmenu("openRecent",a,c)}}this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],c):b.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||b.menus.addMenuItems(a,["-","revisionHistory"],c);b.menus.addMenuItems(a,["-","autosave"], +c)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){g.funct(a,c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=h&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips", +"pageScale"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);if(!b.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(c);var d=b.menus.addMenuItem(a,"plugins",c);b.isOffline()||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "), +c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.menus.addSubmenu("importFrom",a,c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",a,c);b.menus.addSubmenu("insertAdvanced",a,c)})));var l="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "), +m=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<l.length;c++)"-"==l[c]?a.addSeparator(b):m(a,b,mxResources.get(l[c])+"...",l[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "), +c)})))};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=f.menus.get(a),g=m.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height="30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));f.menus.menuCreated(e,g,"geMenuItem");null!=c? (g.style.backgroundImage="url("+c+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px",g.innerHTML="",mxUtils.setOpacity(g,d||40)):b||(g.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",g.style.backgroundPosition="right 6px center",g.style.backgroundRepeat="no-repeat",g.style.paddingRight="22px");return g}function b(a,b,c,d,e,f){var g=document.createElement("a");g.setAttribute("href","javascript:void(0)"); -g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";k.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&& +g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";h.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&& b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);mxUtils.setOpacity(g,null!=f?40:100);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),mxUtils.setOpacity(g,null!=f?40:100),g.style.cursor=""):(g.setAttribute("disabled","disabled"),mxUtils.setOpacity(g,null!=f?10:20),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function c(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block"; -b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));k.appendChild(b);return b}h.apply(this,arguments);var d=document.createElement("div");d.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";d.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries? -"63px":"32px";this.sidebar=this.createSidebar(d);var f=this,g=f.editor.graph;f.toolbar=this.createToolbar(f.createDiv("geToolbar"));f.defaultLibraryName=mxResources.get("untitledLibrary");var k=document.createElement("div");k.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var m=new Menubar(f,k);(d=900>e)||a("diagram");c([d?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg", +b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));h.appendChild(b);return b}l.apply(this,arguments);var d=document.createElement("div");d.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";d.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries? +"63px":"32px";this.sidebar=this.createSidebar(d);var f=this,g=f.editor.graph;f.toolbar=this.createToolbar(f.createDiv("geToolbar"));f.defaultLibraryName=mxResources.get("untitledLibrary");var h=document.createElement("div");h.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var m=new Menubar(f,h);(d=900>e)||a("diagram");c([d?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg", 100):null,b(mxResources.get("shapes"),f.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),f.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),f.actions.get("toggleFormat").funct,null,mxResources.get("format")+ " ("+f.actions.get("formatPanel").shortcut+")",f.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==": null)]);var p=a("insert",!0,d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null,40);c([p,b(mxResources.get("delete"),f.actions.get("delete").funct,null,mxResources.get("delete"),f.actions.get("delete"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==": @@ -3148,69 +3149,69 @@ c([b("",function(){g.popupMenuHandler.hideMenu();var a=g.view.scale,b=g.view.tra 640<=e?b("",d.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",d,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="): null,640<=e?b("",q.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",q,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="): null])}}f.statusContainer=f.createStatusContainer();f.statusContainer.style.position="relative";f.statusContainer.style.maxWidth="";f.statusContainer.style.marginTop="7px";f.statusContainer.style.marginLeft="6px";f.statusContainer.style.color="gray";f.statusContainer.style.cursor="default";f.editor.addListener("statusChanged",mxUtils.bind(this,function(){f.setStatusText(f.editor.getStatus())}));var u=f.descriptorChanged;f.descriptorChanged=function(){u.apply(this,arguments);var a=f.getCurrentFile(); -if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);k.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else k.removeAttribute("title")};f.setStatusText(f.editor.getStatus());k.appendChild(f.statusContainer);f.buttonContainer=document.createElement("div");f.buttonContainer.style.cssText="position:absolute;right:40px;top:12px;white-space:nowrap;";k.appendChild(f.buttonContainer);f.menubarContainer= +if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);h.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else h.removeAttribute("title")};f.setStatusText(f.editor.getStatus());h.appendChild(f.statusContainer);f.buttonContainer=document.createElement("div");f.buttonContainer.style.cssText="position:absolute;right:40px;top:12px;white-space:nowrap;";h.appendChild(f.buttonContainer);f.menubarContainer= f.buttonContainer;d=this.menus.get("language");null!=d&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&480<=e&&(p=m.addMenu("",d.funct),p.setAttribute("title",mxResources.get("language")),p.style.backgroundImage="url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTEuOTkgMkM2LjQ3IDIgMiA2LjQ4IDIgMTJzNC40NyAxMCA5Ljk5IDEwQzE3LjUyIDIyIDIyIDE3LjUyIDIyIDEyUzE3LjUyIDIgMTEuOTkgMnptNi45MyA2aC0yLjk1Yy0uMzItMS4yNS0uNzgtMi40NS0xLjM4LTMuNTYgMS44NC42MyAzLjM3IDEuOTEgNC4zMyAzLjU2ek0xMiA0LjA0Yy44MyAxLjIgMS40OCAyLjUzIDEuOTEgMy45NmgtMy44MmMuNDMtMS40MyAxLjA4LTIuNzYgMS45MS0zLjk2ek00LjI2IDE0QzQuMSAxMy4zNiA0IDEyLjY5IDQgMTJzLjEtMS4zNi4yNi0yaDMuMzhjLS4wOC42Ni0uMTQgMS4zMi0uMTQgMiAwIC42OC4wNiAxLjM0LjE0IDJINC4yNnptLjgyIDJoMi45NWMuMzIgMS4yNS43OCAyLjQ1IDEuMzggMy41Ni0xLjg0LS42My0zLjM3LTEuOS00LjMzLTMuNTZ6bTIuOTUtOEg1LjA4Yy45Ni0xLjY2IDIuNDktMi45MyA0LjMzLTMuNTZDOC44MSA1LjU1IDguMzUgNi43NSA4LjAzIDh6TTEyIDE5Ljk2Yy0uODMtMS4yLTEuNDgtMi41My0xLjkxLTMuOTZoMy44MmMtLjQzIDEuNDMtMS4wOCAyLjc2LTEuOTEgMy45NnpNMTQuMzQgMTRIOS42NmMtLjA5LS42Ni0uMTYtMS4zMi0uMTYtMiAwLS42OC4wNy0xLjM1LjE2LTJoNC42OGMuMDkuNjUuMTYgMS4zMi4xNiAyIDAgLjY4LS4wNyAxLjM0LS4xNiAyem0uMjUgNS41NmMuNi0xLjExIDEuMDYtMi4zMSAxLjM4LTMuNTZoMi45NWMtLjk2IDEuNjUtMi40OSAyLjkzLTQuMzMgMy41NnpNMTYuMzYgMTRjLjA4LS42Ni4xNC0xLjMyLjE0LTIgMC0uNjgtLjA2LTEuMzQtLjE0LTJoMy4zOGMuMTYuNjQuMjYgMS4zMS4yNiAycy0uMSAxLjM2LS4yNiAyaC0zLjM4eiIvPjwvc3ZnPg==)", -p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="24px 24px",p.style.position="absolute",p.style.height="24px",p.style.width="24px",p.style.zIndex="1",p.style.top="11px",p.style.right="14px",mxUtils.setOpacity(p,30),k.appendChild(p));f.tabContainer=document.createElement("div");f.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;"; +p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="24px 24px",p.style.position="absolute",p.style.height="24px",p.style.width="24px",p.style.zIndex="1",p.style.top="11px",p.style.right="14px",mxUtils.setOpacity(p,30),h.appendChild(p));f.tabContainer=document.createElement("div");f.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;"; d=f.diagramContainer.parentNode;q=document.createElement("div");q.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";f.diagramContainer.style.top="47px";f.diagramContainer.style.bottom="30px";t=f.menus.get("viewZoom");if(null!=t){this.tabContainer.style.right="70px";p=m.addMenu("100%",t.funct);p.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");p.style.whiteSpace="nowrap";p.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";p.style.backgroundPosition= "right 6px center";p.style.backgroundRepeat="no-repeat";p.style.paddingRight="10px";p.style.display="block";p.style.position="absolute";p.style.textDecoration="none";p.style.textDecoration="none";p.style.right="0px";p.style.bottom="0px";p.style.overflow="hidden";p.style.textAlign="center";p.style.color="#000";p.style.fontSize="12px";p.style.color="#707070";p.style.width="59px";p.style.borderTop="1px solid lightgray";p.style.borderLeft="1px solid lightgray";p.style.height=parseInt(f.tabContainer.style.height)- 1+"px";p.style.lineHeight=parseInt(f.tabContainer.style.height)+1+"px";q.appendChild(p);t=mxUtils.bind(this,function(){p.innerHTML=Math.round(100*f.editor.graph.view.scale)+"%"});f.editor.graph.view.addListener(mxEvent.EVENT_SCALE,t);f.editor.addListener("resetGraphView",t);f.editor.addListener("pageSelected",t);var v=f.setGraphEnabled;f.setGraphEnabled=function(){v.apply(this,arguments);null!=this.tabContainer&&(p.style.visibility=this.tabContainer.style.visibility)}}q.appendChild(f.tabContainer); -q.appendChild(k);q.appendChild(f.diagramContainer);d.appendChild(q);f.updateTabContainer();mxEvent.addListener(window,"resize",function(){null!=f.sidebarWindow&&f.sidebarWindow.window.fit();null!=f.formatWindow&&f.formatWindow.window.fit();null!=f.actions.outlineWindow&&f.actions.outlineWindow.window.fit();null!=f.actions.layersWindow&&f.actions.layersWindow.window.fit();null!=f.menus.tagsWindow&&f.menus.tagsWindow.window.fit();null!=f.menus.findWindow&&f.menus.findWindow.window.fit()})}}}; +q.appendChild(h);q.appendChild(f.diagramContainer);d.appendChild(q);f.updateTabContainer();mxEvent.addListener(window,"resize",function(){null!=f.sidebarWindow&&f.sidebarWindow.window.fit();null!=f.formatWindow&&f.formatWindow.window.fit();null!=f.actions.outlineWindow&&f.actions.outlineWindow.window.fit();null!=f.actions.layersWindow&&f.actions.layersWindow.window.fit();null!=f.menus.tagsWindow&&f.menus.tagsWindow.window.fit();null!=f.menus.findWindow&&f.menus.findWindow.window.fit()})}}}; (function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();mxResources.parse("# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\naboutDrawio=About draw.io\naccessDenied=Access Denied\naction=Action\nactualSize=Actual Size\nadd=Add\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Borderwidth\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangesNotSaved=Changes have not been saved\nchatJoined={1} has joined\nchatLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncompressed=Compressed\ncommitMessage=Commit Message\ncsv=CSV\ndark=Dark\ndraftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * \" |\ncheck=Check\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nerror=Error\nerrorDeletingFile=Error Deleting File\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file.\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google's servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named '{1}'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target='_blank' href='{1}'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwrite=File was changed. Overwrite changes?\noverwrite=Overwrite\nfilename=Filename\nfileExists=File already exists\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have read access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngeneral=General\ngithub=GitHub\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngooglePlus=Google+\ngoogleSites=Google Sites\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn't be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = \"\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target=\"_blank\" href=\"https://support.draw.io/display/DFCS/Licensing+your+draw.io+plugin\">page</a>.\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after page refresh.\nlaneColor=Lanecolor\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for '{1}'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn't been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\npaste=Paste\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\nprint=Print\nprintAllPages=Print All Pages\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you've made a few changes while offline. We're sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendMessage=Send\nsendYourFeedbackToDrawIo=Send your feedback to draw.io\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save. \nsetAsDefaultStyle=Set as Default Style\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareLink=Link for shared editing\nsharp=Sharp\nshow=Show\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click to expand. Drag and drop shapes into the diagram. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsize=Size\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstandard=Standard\nstarting=Starting\nstraight=Straight\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page.\nturn=Rotate 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\n");Graph.prototype.defaultThemes[Graph.prototype.defaultThemeName]=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="#ffffff"/><add as="strokeColor" value="#000000"/><add as="fontColor" value="#000000"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#ffffff"/><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="#000000"/><add as="fontColor" value="#000000"/></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><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="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="#ffffff"/><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="#ffffff"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="white"/><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="#ffffff"/></add></mxStylesheet>').documentElement; Graph.prototype.defaultThemes.darkTheme=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="#2a2a2a"/><add as="strokeColor" value="#f0f0f0"/><add as="fontColor" value="#f0f0f0"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#2a2a2a"/><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="#f0f0f0"/><add as="fontColor" value="#f0f0f0"/></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="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="#2a2a2a"/><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="#2a2a2a"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="#2a2a2a"/><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="#2a2a2a"/></add></mxStylesheet>').documentElement;GraphViewer=function(a,d,e){this.init(a,d,e)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="https://www.draw.io/";GraphViewer.prototype.imageBaseUrl="https://www.draw.io/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?28:30;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;GraphViewer.prototype.autoFit=!0;GraphViewer.prototype.allowZoomIn=!1; GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0; GraphViewer.prototype.init=function(a,d,e){this.graphConfig=null!=e?e:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;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.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialWidth=null!=a?a.style.width:null;this.widthIsEmpty=null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.editor=null;if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d), null!=a)){var b=mxUtils.bind(this,function(){this.graph=new Graph(a);this.graph.transparentBackground=!1;this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(a){return!0});this.lightboxClickEnabled&&(a.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);var b=this;this.graph.getImageFromBundles=function(a){return b.getImageUrl(a)}; -mxClient.IS_SVG&&this.editor.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==d.nodeName){var e=d.getElementsByTagName("diagram");if(0<e.length){var k=this.graph.getGlobalVariable,b=this;this.graph.getGlobalVariable=function(a){var c=e[b.currentPage];return"page"==a?c.getAttribute("name")||"Page-"+(b.currentPage+1):"pagenumber"==a?b.currentPage+1:k.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(a){this.currentPage=mxUtils.mod(a,this.diagrams.length); +mxClient.IS_SVG&&this.editor.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==d.nodeName){var e=d.getElementsByTagName("diagram");if(0<e.length){var h=this.graph.getGlobalVariable,b=this;this.graph.getGlobalVariable=function(a){var c=e[b.currentPage];return"page"==a?c.getAttribute("name")||"Page-"+(b.currentPage+1):"pagenumber"==a?b.currentPage+1:h.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(a){this.currentPage=mxUtils.mod(a,this.diagrams.length); this.updateGraphXml(mxUtils.parseXml(this.graph.decompress(mxUtils.getTextContent(this.diagrams[this.currentPage]))).documentElement)};this.selectPageById=function(a){for(var b=0;b<this.diagrams.length;b++)if(this.diagrams[b].getAttribute("id")==a){this.selectPage(b);break}};var f=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)});this.addListener("xmlNodeChanged", f);f();urlParams.page=b.currentPage;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8,this.graph.view.scale=this.graphConfig.zoom||1}finally{this.graph.getModel().endUpdate()}this.graph.panningHandler.useLeftButtonForPanning=!0;this.graph.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())&&"auto"==this.graph.container.style.overflow}; this.graph.panningHandler.usePopupTrigger=!1;this.graph.panningHandler.pinchEnabled=!1;this.graph.panningHandler.ignoreCell=!0;this.graph.setPanning(!1);this.addSizeHandler();this.showLayers(this.graph);this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};b=this;this.graph.customLinkClicked=function(a){if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");b.selectPageById(a.substring(c+ -1))}else this.handleCustomLink(a)};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",this.graphConfig.title);this.fireEvent(new mxEventObject("render"))});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var k=this.getObservableParent(a),m=new e(mxUtils.bind(this,function(d){0<a.offsetWidth&&(m.disconnect(),b())}));m.observe(k, +1))}else this.handleCustomLink(a)};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",this.graphConfig.title);this.fireEvent(new mxEventObject("render"))});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var h=this.getObservableParent(a),m=new e(mxUtils.bind(this,function(d){0<a.offsetWidth&&(m.disconnect(),b())}));m.observe(h, {attributes:!0})}else b()}};GraphViewer.prototype.getObservableParent=function(a){for(a=a.parentNode;a!=document.body&&null!=a.parentNode&&"none"!==mxUtils.getCurrentStyle(a).display;)a=a.parentNode;return a};GraphViewer.prototype.getImageUrl=function(a){null!=a&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10)&&("/"==a.charAt(0)&&(a=a.substring(1,a.length)),a=this.imageBaseUrl+a);return a}; GraphViewer.prototype.setXmlNode=function(a){this.xmlDocument=a.ownerDocument;this.xml=mxUtils.getXml(a);this.xmlNode=a;this.updateGraphXml(a);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(a){null==this.xmlNode&&(this.xmlDocument=a.ownerDocument,this.xml=mxUtils.getXml(a),this.xmlNode=a);this.setGraphXml(a)};GraphViewer.prototype.updateGraphXml=function(a){this.setGraphXml(a);this.fireEvent(new mxEventObject("graphChanged"))}; GraphViewer.prototype.setGraphXml=function(a){null!=this.graph&&(this.graph.view.translate=new mxPoint,this.graph.view.scale=1,this.graph.getModel().clear(),this.editor.setGraphXml(a),this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph(),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale})}; GraphViewer.prototype.addSizeHandler=function(){var a=this.graph.container,d=this.graph.getGraphBounds(),e=!1;a.style.overflow="hidden";var b=mxUtils.bind(this,function(){if(!e){e=!0;var b=this.graph.getGraphBounds();a.style.overflow=a.offsetWidth<=b.width+2*this.graph.border*this.graph.view.scale?"auto":"hidden";if(null!=this.toolbar){var b=a.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x, -top:-c.y},b={left:b.left-c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),k=null,m=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==k||m||(m=!0,this.graph.maxFitScale= -null!=b?b:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,b.height+2*this.graph.border+1),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=c,window.setTimeout(function(){m=!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",b),this.graph.addListener("size", -b)):new ResizeSensor(this.graph.container,b));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,100,1),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,d.width+2*this.graph.border),this.updateContainerHeight(a,d.height+2*this.graph.border+1),!this.zoomEnabled&&this.autoFit){var p=k=null,b=mxUtils.bind(this,function(){window.clearTimeout(p);m||(p=window.setTimeout(mxUtils.bind(this, +top:-c.y},b={left:b.left-c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),h=null,m=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==h||m||(m=!0,this.graph.maxFitScale= +null!=b?b:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,b.height+2*this.graph.border+1),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},h=c,window.setTimeout(function(){m=!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",b),this.graph.addListener("size", +b)):new ResizeSensor(this.graph.container,b));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,100,1),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,d.width+2*this.graph.border),this.updateContainerHeight(a,d.height+2*this.graph.border+1),!this.zoomEnabled&&this.autoFit){var p=h=null,b=mxUtils.bind(this,function(){window.clearTimeout(p);m||(p=window.setTimeout(mxUtils.bind(this, this.fitGraph),100))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?mxEvent.addListener(window,"resize",b):new ResizeSensor(this.graph.container,b))}else mxClient.IS_QUIRKS||9>=document.documentMode||this.graph.addListener("size",b);var q=mxUtils.bind(this,function(){var b=a.style.minWidth;this.widthIsEmpty&&(a.style.minWidth="100%");if(0<a.offsetWidth&&(this.allowZoomIn||d.width+2*this.graph.border>a.offsetWidth||d.height+2*this.graph.border>this.graphConfig["max-height"])){var c= -null;null!=this.graphConfig["max-height"]&&(c=this.graphConfig["max-height"]/(d.height+2*this.graph.border));this.fitGraph(c)}else this.graph.view.setTranslate(Math.floor((this.graph.border-d.x)/this.graph.view.scale),Math.floor((this.graph.border-d.y)/this.graph.view.scale)),k=a.offsetWidth;a.style.minWidth=b});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(q,0):q();this.positionGraph=function(){d=this.graph.getGraphBounds();k=null;q()}}; +null;null!=this.graphConfig["max-height"]&&(c=this.graphConfig["max-height"]/(d.height+2*this.graph.border));this.fitGraph(c)}else this.graph.view.setTranslate(Math.floor((this.graph.border-d.x)/this.graph.view.scale),Math.floor((this.graph.border-d.y)/this.graph.view.scale)),h=a.offsetWidth;a.style.minWidth=b});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(q,0):q();this.positionGraph=function(){d=this.graph.getGraphBounds();h=null;q()}}; GraphViewer.prototype.updateContainerWidth=function(a,d){a.style.width=d+"px"};GraphViewer.prototype.updateContainerHeight=function(a,d){if(this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||mxClient.IS_QUIRKS||8==document.documentMode)a.style.height=d+"px"}; -GraphViewer.prototype.showLayers=function(a,d){var e=this.graphConfig.layers;if(null!=e||null!=d)if(e=null!=e?e.split(" "):null,null!=d||0<e.length){var b=null!=d?d.getModel():null,k=a.getModel();k.beginUpdate();try{for(var m=k.getChildCount(k.root),p=0;p<m;p++)k.setVisible(k.getChildAt(k.root,p),null!=d?b.isVisible(b.getChildAt(b.root,p)):!1);if(null==b)for(p=0;p<e.length;p++)k.setVisible(k.getChildAt(k.root,parseInt(e[p])),!0)}finally{k.endUpdate()}}}; +GraphViewer.prototype.showLayers=function(a,d){var e=this.graphConfig.layers;if(null!=e||null!=d)if(e=null!=e?e.split(" "):null,null!=d||0<e.length){var b=null!=d?d.getModel():null,h=a.getModel();h.beginUpdate();try{for(var m=h.getChildCount(h.root),p=0;p<m;p++)h.setVisible(h.getChildAt(h.root,p),null!=d?b.isVisible(b.getChildAt(b.root,p)):!1);if(null==b)for(p=0;p<e.length;p++)h.setVisible(h.getChildAt(h.root,parseInt(e[p])),!0)}finally{h.endUpdate()}}}; GraphViewer.prototype.addToolbar=function(){function a(a,b,c,d){var g=document.createElement("div");g.style.borderRight="1px solid #d0d0d0";g.style.padding="3px 6px 3px 6px";mxEvent.addListener(g,"click",a);null!=c&&g.setAttribute("title",c);g.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==d||d?(mxEvent.addListener(g,"mouseenter",function(){g.style.backgroundColor="#ddd"}),mxEvent.addListener(g,"mouseleave", function(){g.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),g.style.cursor="pointer"):mxUtils.setOpacity(g,30);g.appendChild(a);e.appendChild(g);f++;return g}var d=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?d.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(d.style.marginTop=this.toolbarHeight+"px");var e=d.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box"; -e.style.whiteSpace="nowrap";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var b=null,k=null,m=mxUtils.bind(this,function(a){null!=b&&(window.clearTimeout(b),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);b=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e, -0);b=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),p=mxUtils.bind(this,function(a){null!=b&&(window.clearTimeout(b),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(p(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove": +e.style.whiteSpace="nowrap";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var b=null,h=null,m=mxUtils.bind(this,function(a){null!=b&&(window.clearTimeout(b),fadeThead=null);null!=h&&(window.clearTimeout(h),fadeThead2=null);b=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e, +0);b=null;h=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";h=null}),100)}),a||200)}),p=mxUtils.bind(this,function(a){null!=b&&(window.clearTimeout(b),fadeThead=null);null!=h&&(window.clearTimeout(h),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(p(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove": "mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){p(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(a){p(100);mxEvent.consume(a)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||p(30)}));var q=this.graph,v=q.getTolerance();q.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft= -q.container.scrollLeft;this.scrollTop=q.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-q.container.scrollLeft)<v&&Math.abs(this.scrollTop-q.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.style.opacity||0)?m():p(30))}})}for(var c=this.toolbarItems,f=0,g=null,u=null,t=0;t<c.length;t++){var h=c[t];if("pages"==h){u=d.ownerDocument.createElement("div"); -u.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(u,70);var n=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");n.style.borderRightStyle="none";n.style.paddingLeft="0px";n.style.paddingRight="0px";e.appendChild(u);var l=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+ -1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");l.style.paddingLeft="0px";l.style.paddingRight="0px";h=mxUtils.bind(this,function(){u.innerHTML="";mxUtils.write(u,this.currentPage+1+" / "+this.diagrams.length);u.style.display=1<this.diagrams.length?"inline-block":"none";n.style.display=u.style.display;l.style.display=u.style.display});this.addListener("graphChanged",h);h()}else if("zoom"==h)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage, -mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==h){if(this.layersEnabled){var w=this.graph.getModel(),r=a(mxUtils.bind(this,function(a){if(null!=g)g.parentNode.removeChild(g), +q.container.scrollLeft;this.scrollTop=q.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-q.container.scrollLeft)<v&&Math.abs(this.scrollTop-q.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.style.opacity||0)?m():p(30))}})}for(var c=this.toolbarItems,f=0,g=null,u=null,t=0;t<c.length;t++){var l=c[t];if("pages"==l){u=d.ownerDocument.createElement("div"); +u.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(u,70);var n=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");n.style.borderRightStyle="none";n.style.paddingLeft="0px";n.style.paddingRight="0px";e.appendChild(u);var k=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+ +1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");k.style.paddingLeft="0px";k.style.paddingRight="0px";l=mxUtils.bind(this,function(){u.innerHTML="";mxUtils.write(u,this.currentPage+1+" / "+this.diagrams.length);u.style.display=1<this.diagrams.length?"inline-block":"none";n.style.display=u.style.display;k.style.display=u.style.display});this.addListener("graphChanged",l);l()}else if("zoom"==l)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage, +mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==l){if(this.layersEnabled){var w=this.graph.getModel(),r=a(mxUtils.bind(this,function(a){if(null!=g)g.parentNode.removeChild(g), g=null;else{g=this.graph.createLayersDialog();mxEvent.addListener(g,"mouseleave",function(){g.parentNode.removeChild(g);g=null});a=r.getBoundingClientRect();g.style.width="140px";g.style.padding="2px 0px 2px 0px";g.style.border="1px solid #d0d0d0";g.style.backgroundColor="#eee";g.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";g.style.fontSize="11px";g.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(g,80);var b=mxUtils.getDocumentScrollOrigin(document);g.style.left=b.x+a.left+ -"px";g.style.top=b.y+a.bottom+"px";document.body.appendChild(g)}}),Editor.layersImage,mxResources.get("layers")||"Layers");w.addListener(mxEvent.CHANGE,function(){r.style.display=1<w.getChildCount(w.root)?"inline-block":"none"});r.style.display=1<w.getChildCount(w.root)?"inline-block":"none"}}else"lightbox"==h?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(h=this.graphConfig["toolbar-buttons"][h], -null!=h&&a(null==h.enabled||h.enabled?h.handler:function(){},h.image,h.title,h.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*f);null!=this.graphConfig.title&&(c=d.ownerDocument.createElement("div"),c.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",c.setAttribute("title",this.graphConfig.title),mxUtils.write(c,this.graphConfig.title),mxUtils.setOpacity(c, +"px";g.style.top=b.y+a.bottom+"px";document.body.appendChild(g)}}),Editor.layersImage,mxResources.get("layers")||"Layers");w.addListener(mxEvent.CHANGE,function(){r.style.display=1<w.getChildCount(w.root)?"inline-block":"none"});r.style.display=1<w.getChildCount(w.root)?"inline-block":"none"}}else"lightbox"==l?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(l=this.graphConfig["toolbar-buttons"][l], +null!=l&&a(null==l.enabled||l.enabled?l.handler:function(){},l.image,l.title,l.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*f);null!=this.graphConfig.title&&(c=d.ownerDocument.createElement("div"),c.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",c.setAttribute("title",this.graphConfig.title),mxUtils.write(c,this.graphConfig.title),mxUtils.setOpacity(c, 70),e.appendChild(c));this.minToolbarWidth=34*f;var y=d.style.border,c=mxUtils.bind(this,function(){var a=d.getBoundingClientRect(),b=mxUtils.getScrollOrigin(document.body),b="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-b.x,top:-b.y},a={left:a.left-b.left,top:a.top-b.top,bottom:a.bottom-b.top,right:a.right-b.left};e.style.left=a.left+"px";e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,d.offsetWidth)+"px"; e.style.border="1px solid #d0d0d0";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=a.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=a.top+1+"px"):e.style.top=a.top+"px";"1px solid transparent"==y&&(d.style.border="1px solid #d0d0d0");document.body.appendChild(e);var c=mxUtils.bind(this,function(){1!=this.graphConfig["toolbar-nohide"]&&(null!=e.parentNode&&e.parentNode.removeChild(e),null!=g&&(g.parentNode.removeChild(g), g=null),d.style.border=y)});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==d||a==e||a==g)return;a=a.parentNode}c()});mxEvent.addListener(document,"mouseleave",function(a){c()})});mxEvent.addListener(d,"mouseenter",c)}; -GraphViewer.prototype.addClickHandler=function(a,d){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,b){if(null==b){var k=mxEvent.getSource(e);"a"==k.nodeName.toLowerCase()&&(b=k.getAttribute("href"))}null!=d?null==b||a.isExternalProtocol(b)||a.isBlankLink(b)||window.setTimeout(function(){d.destroy()},0):null==b||null!=d||!a.isCustomLink(b)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)||(a.customLinkClicked(b),mxEvent.consume(e))}), +GraphViewer.prototype.addClickHandler=function(a,d){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,b){if(null==b){var h=mxEvent.getSource(e);"a"==h.nodeName.toLowerCase()&&(b=h.getAttribute("href"))}null!=d?null==b||a.isExternalProtocol(b)||a.isBlankLink(b)||window.setTimeout(function(){d.destroy()},0):null==b||null!=d||!a.isCustomLink(b)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)||(a.customLinkClicked(b),mxEvent.consume(e))}), mxUtils.bind(this,function(a){null!=d||!this.lightboxClickEnabled||mxEvent.isTouchEvent(a)&&0!=this.toolbarItems.length||this.showLightbox()}))}; GraphViewer.prototype.showLightbox=function(a,d,e){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){a=null!=a?a:null!=this.graphConfig.editable?this.graphConfig.editable:!0;e={client:1,lightbox:1,target:null!=e?e:"blank"};a&&(e.edit=this.graphConfig.edit||"_blank");if(null!=d?d:1)e.close=1;this.layersEnabled&&(e.layers=1);null!=this.graphConfig&&0!=this.graphConfig.nav&&(e.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&& (e.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(e.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(a){"ready"==a.data&&a.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):e.data=encodeURIComponent(this.xml);a="www.draw.io";"1"==urlParams.dev&&(e.dev="1",e.drawdev= "1",a="test.draw.io");this.lightboxWindow=window.open("https://"+a+"/#P"+encodeURIComponent(JSON.stringify(e)))}else this.lightboxWindow.focus();else this.showLocalLightbox()}; GraphViewer.prototype.showLocalLightbox=function(){var a=mxUtils.getDocumentScrollOrigin(document),d=document.createElement("div");mxClient.IS_QUIRKS?(d.style.position="absolute",d.style.left=a.x+"px",d.style.top=a.y+"px",d.style.width=document.body.offsetWidth+"px",d.style.height=document.body.offsetHeight+"px"):d.style.cssText="position:fixed;top:0;left:0;bottom:0;right:0;";d.style.zIndex=this.lightboxZIndex;d.style.backgroundColor="#000000";mxUtils.setOpacity(d,70);document.body.appendChild(d); var e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("src",Editor.closeImage);mxClient.IS_QUIRKS?(e.style.position="absolute",e.style.right="32px",e.style.top=a.y+32+"px"):e.style.cssText="position:fixed;top:32px;right:32px;";e.style.cursor="pointer";mxEvent.addListener(e,"click",function(){b.destroy()});urlParams.pages="1";urlParams.page=this.currentPage;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";if(null==document.documentMode|| -10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var b=new EditorUi(new Editor(!0),document.createElement("div"),!0);b.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";b.refresh=function(){};var k=mxUtils.bind(this,function(a){27==a.keyCode&& -b.destroy()}),m=b.destroy;b.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(d);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var p=b.editor.graph,q=p.container;q.style.overflow="hidden";this.lightboxChrome?(q.style.border="1px solid #c0c0c0",q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",k)):(d.style.display="none",e.style.display="none"); +10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var b=new EditorUi(new Editor(!0),document.createElement("div"),!0);b.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";b.refresh=function(){};var h=mxUtils.bind(this,function(a){27==a.keyCode&& +b.destroy()}),m=b.destroy;b.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",h);document.body.removeChild(d);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var p=b.editor.graph,q=p.container;q.style.overflow="hidden";this.lightboxChrome?(q.style.border="1px solid #c0c0c0",q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",h)):(d.style.display="none",e.style.display="none"); var v=this;p.getImageFromBundles=function(a){return v.getImageUrl(a)};var c=b.createTemporaryGraph;b.createTemporaryGraph=function(){var a=c.apply(this,arguments);a.getImageFromBundles=function(a){return v.getImageUrl(a)};return a};this.graphConfig.move&&(p.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(q.style,"border-radius","4px"),q.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";mxClient.IS_SF||mxClient.IS_EDGE|| (mxUtils.setPrefixedStyle(q.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(q.style,"transition","all .25s ease-in-out"));this.addClickHandler(p,b);window.setTimeout(mxUtils.bind(this,function(){q.style.outline="none";q.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(q);document.body.appendChild(e);b.setFileData(this.xml);mxUtils.setPrefixedStyle(q.style,"transform","rotateY(0deg)");b.chromelessToolbar.style.bottom="60px";b.chromelessToolbar.style.zIndex= this.lightboxZIndex;document.body.appendChild(b.chromelessToolbar);b.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});mxClient.IS_QUIRKS&&(q.style.position="absolute",q.style.display="block",q.style.left=a.x+"px",q.style.top=a.y+"px",q.style.width=document.body.clientWidth-80+"px",q.style.height=document.body.clientHeight-80+"px",q.style.backgroundColor="white",b.chromelessToolbar.style.display="block",b.chromelessToolbar.style.position="absolute",b.chromelessToolbar.style.bottom="", b.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");b.lightboxFit();b.chromelessResize();this.showLayers(p,this.graph);mxEvent.addListener(d,"click",function(){b.destroy()})}),0);return b};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(e){throw a.innerHTML=e.message,e;}})}; -GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var d=document.getElementsByClassName(a);a=[];for(var e=0;e<d.length;e++)a.push(d[e]);return a}for(var b=document.getElementsByTagName("*"),d=[],e=0;e<b.length;e++){var k=b[e].className;null!=k&&0<k.length&&(k=k.split(" "),0<=mxUtils.indexOf(k,a)&&d.push(b[e]))}return d}; -GraphViewer.createViewerForElement=function(a,d){var e=a.getAttribute("data-mxgraph");if(null!=e){var b=JSON.parse(e),k=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,b);null!=d&&d(e)};null!=b.url?GraphViewer.getUrl(b.url,function(a){k(a)}):k(b.xml)}}; +GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var d=document.getElementsByClassName(a);a=[];for(var e=0;e<d.length;e++)a.push(d[e]);return a}for(var b=document.getElementsByTagName("*"),d=[],e=0;e<b.length;e++){var h=b[e].className;null!=h&&0<h.length&&(h=h.split(" "),0<=mxUtils.indexOf(h,a)&&d.push(b[e]))}return d}; +GraphViewer.createViewerForElement=function(a,d){var e=a.getAttribute("data-mxgraph");if(null!=e){var b=JSON.parse(e),h=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,b);null!=d&&d(e)};null!=b.url?GraphViewer.getUrl(b.url,function(a){h(a)}):h(b.xml)}}; GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type="text/css";a.innerHTML="div.mxTooltip {\n-webkit-box-shadow: 3px 3px 12px #C0C0C0;\n-moz-box-shadow: 3px 3px 12px #C0C0C0;\nbox-shadow: 3px 3px 12px #C0C0C0;\nbackground: #FFFFCC;\nborder-style: solid;\nborder-width: 1px;\nborder-color: black;\nfont-family: Arial;\nfont-size: 8pt;\nposition: absolute;\ncursor: default;\npadding: 4px;\ncolor: black;}\ntd.mxPopupMenuIcon div {\nwidth:16px;\nheight:16px;}\nhtml div.mxPopupMenu {\n-webkit-box-shadow:2px 2px 3px #d5d5d5;\n-moz-box-shadow:2px 2px 3px #d5d5d5;\nbox-shadow:2px 2px 3px #d5d5d5;\n_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d0d0d0',Positive='true');\nbackground:white;\nposition:absolute;\nborder:3px solid #e7e7e7;\npadding:3px;}\nhtml table.mxPopupMenu {\nborder-collapse:collapse;\nmargin:0px;}\nhtml td.mxPopupMenuItem {\npadding:7px 30px 7px 30px;\nfont-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;}\nhtml td.mxPopupMenuIcon {\nbackground-color:white;\npadding:0px;}\ntd.mxPopupMenuIcon .geIcon {\npadding:2px;\npadding-bottom:4px;\nmargin:2px;\nborder:1px solid transparent;\nopacity:0.5;\n_width:26px;\n_height:26px;}\ntd.mxPopupMenuIcon .geIcon:hover {\nborder:1px solid gray;\nborder-radius:2px;\nopacity:1;}\nhtml tr.mxPopupMenuItemHover {\nbackground-color: #eeeeee;\ncolor: black;}\ntable.mxPopupMenu hr {\ncolor:#cccccc;\nbackground-color:#cccccc;\nborder:none;\nheight:1px;}\ntable.mxPopupMenu tr {\tfont-size:4pt;}\n.geDialog { font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;\nborder:none;\nmargin:0px;}\n.geDialog {\tposition:absolute;\tbackground:white;\toverflow:hidden;\tpadding:30px;\tborder:1px solid #acacac;\t-webkit-box-shadow:0px 0px 2px 2px #d5d5d5;\t-moz-box-shadow:0px 0px 2px 2px #d5d5d5;\tbox-shadow:0px 0px 2px 2px #d5d5d5;\t_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d5d5d5', Positive='true');\tz-index: 2;}.geDialogClose {\tposition:absolute;\twidth:9px;\theight:9px;\topacity:0.5;\tcursor:pointer;\t_filter:alpha(opacity=50);}.geDialogClose:hover {\topacity:1;}.geDialogTitle {\tbox-sizing:border-box;\twhite-space:nowrap;\tbackground:rgb(229, 229, 229);\tborder-bottom:1px solid rgb(192, 192, 192);\tfont-size:15px;\tfont-weight:bold;\ttext-align:center;\tcolor:rgb(35, 86, 149);}.geDialogFooter {\tbackground:whiteSmoke;\twhite-space:nowrap;\ttext-align:right;\tbox-sizing:border-box;\tborder-top:1px solid #e5e5e5;\tcolor:darkGray;}\n.geBtn {\tbackground-color: #f5f5f5;\tborder-radius: 2px;\tborder: 1px solid #d8d8d8;\tcolor: #333;\tcursor: default;\tfont-size: 11px;\tfont-weight: bold;\theight: 29px;\tline-height: 27px;\tmargin: 0 0 0 8px;\tmin-width: 72px;\toutline: 0;\tpadding: 0 8px;\tcursor: pointer;}.geBtn:hover, .geBtn:focus {\t-webkit-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\t-moz-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tbox-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tborder: 1px solid #c6c6c6;\tbackground-color: #f8f8f8;\tbackground-image: linear-gradient(#f8f8f8 0px,#f1f1f1 100%);\tcolor: #111;}.geBtn:disabled {\topacity: .5;}.gePrimaryBtn {\tbackground-color: #4d90fe;\tbackground-image: linear-gradient(#4d90fe 0px,#4787ed 100%);\tborder: 1px solid #3079ed;\tcolor: #fff;}.gePrimaryBtn:hover, .gePrimaryBtn:focus {\tbackground-color: #357ae8;\tbackground-image: linear-gradient(#4d90fe 0px,#357ae8 100%);\tborder: 1px solid #2f5bb7;\tcolor: #fff;}.gePrimaryBtn:disabled {\topacity: .5;}";document.getElementsByTagName("head")[0].appendChild(a)}catch(d){}}; GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,d,e){if(null!=GraphViewer.cachedUrls[a])d(GraphViewer.cachedUrls[a]);else{var b=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;b.open("GET",a);b.onload=function(){d(null!=b.getText?b.getText():b.responseText)};b.onerror=e;b.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0; -(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},d=function(e,b){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function p(b,c){if(!b.resizedAttached)b.resizedAttached= -new k,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>'; +(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},d=function(e,b){function h(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function p(b,c){if(!b.resizedAttached)b.resizedAttached= +new h,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>'; b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var p=!1,r=function(){b.resizedAttached&&(p&&(b.resizedAttached.call(),p=!1),a(r))};a(r);var q,u,v,G,E=function(){if((v=b.offsetWidth)!=q||(G=b.offsetHeight)!=u)p=!0,q=v,u=G;g()},x=function(a,b,c){a.attachEvent? a.attachEvent("on"+b,c):a.addEventListener(b,c)};x(d,"scroll",E);x(f,"scroll",E)}var q=function(){GraphViewer.resizeSensorEnabled&&b()},v=Object.prototype.toString.call(e),c="[object Array]"===v||"[object NodeList]"===v||"[object HTMLCollection]"===v||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(c)for(var v=0,f=e.length;v<f;v++)p(e[v],q);else p(e,q);this.detach=function(){if(c)for(var a=0,b=e.length;a<b;a++)d.detach(e[a]);else d.detach(e)}}; d.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=d})(); diff --git a/src/main/webapp/plugins/text.js b/src/main/webapp/plugins/text.js index 0c87e26a1..4b5b959f2 100644 --- a/src/main/webapp/plugins/text.js +++ b/src/main/webapp/plugins/text.js @@ -9,7 +9,10 @@ Draw.loadPlugin(function(ui) // Adds action ui.actions.addAction('extractText', function() { - mxUtils.popup(ui.editor.graph.getIndexableText()); + var dlg = new EmbedDialog(ui, ui.editor.graph.getIndexableText(), + null, null, null, 'Extracted Text:'); + ui.showDialog(dlg.container, 440, 240, true, true); + dlg.init(); }); var menu = ui.menus.get('extras'); diff --git a/src/main/webapp/plugins/webcola/cola.min.js b/src/main/webapp/plugins/webcola/cola.min.js new file mode 100644 index 000000000..7c15ef303 --- /dev/null +++ b/src/main/webapp/plugins/webcola/cola.min.js @@ -0,0 +1,4 @@ +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.cola=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a){for(var b in a)c.hasOwnProperty(b)||(c[b]=a[b])}Object.defineProperty(c,"__esModule",{value:!0}),d(a("./src/adaptor")),d(a("./src/d3adaptor")),d(a("./src/descent")),d(a("./src/geom")),d(a("./src/gridrouter")),d(a("./src/handledisconnected")),d(a("./src/layout")),d(a("./src/layout3d")),d(a("./src/linklengths")),d(a("./src/powergraph")),d(a("./src/pqueue")),d(a("./src/rbtree")),d(a("./src/rectangle")),d(a("./src/shortestpaths")),d(a("./src/vpsc")),d(a("./src/batch"))},{"./src/adaptor":2,"./src/batch":3,"./src/d3adaptor":4,"./src/descent":7,"./src/geom":8,"./src/gridrouter":9,"./src/handledisconnected":10,"./src/layout":11,"./src/layout3d":12,"./src/linklengths":13,"./src/powergraph":14,"./src/pqueue":15,"./src/rbtree":16,"./src/rectangle":17,"./src/shortestpaths":18,"./src/vpsc":19}],2:[function(a,b,c){"use strict";function d(a){return new g(a)}var e=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(c,"__esModule",{value:!0});var f=a("./layout"),g=function(a){function b(b){var c=a.call(this)||this,d=b;return d.trigger&&(c.trigger=d.trigger),d.kick&&(c.kick=d.kick),d.drag&&(c.drag=d.drag),d.on&&(c.on=d.on),c.dragstart=c.dragStart=f.Layout.dragStart,c.dragend=c.dragEnd=f.Layout.dragEnd,c}return e(b,a),b.prototype.trigger=function(a){},b.prototype.kick=function(){},b.prototype.drag=function(){},b.prototype.on=function(a,b){return this},b}(f.Layout);c.LayoutAdaptor=g,c.adaptor=d},{"./layout":11}],3:[function(a,b,c){"use strict";function d(a,b,c,d){return a.cola.start(0,0,0,10,!1),e(a.cola.nodes(),a.cola.groups(),c,d).routeEdges(a.powerGraph.powerEdges,b,function(a){return a.source.routerNode.id},function(a){return a.target.routerNode.id})}function e(a,b,c,d){a.forEach(function(a){a.routerNode={name:a.name,bounds:a.bounds.inflate(-c)}}),b.forEach(function(b){b.routerNode={bounds:b.bounds.inflate(-d),children:(void 0!==b.groups?b.groups.map(function(b){return a.length+b.id}):[]).concat(void 0!==b.leaves?b.leaves.map(function(a){return a.index}):[])}});var e=a.concat(b).map(function(a,b){return a.routerNode.id=b,a.routerNode});return new h.GridRouter(e,{getChildren:function(a){return a.children},getBounds:function(a){return a.bounds}},c-d)}function f(a,b,c){var d;a.nodes.forEach(function(a,b){return a.index=b}),(new g.Layout).avoidOverlaps(!1).nodes(a.nodes).links(a.links).powerGraphGroups(function(a){d=a,d.groups.forEach(function(a){return a.padding=c})});var e=a.nodes.length,f=[],h=a.nodes.slice(0);return h.forEach(function(a,b){return a.index=b}),d.groups.forEach(function(a){var b=a.index=a.id+e;h.push(a),void 0!==a.leaves&&a.leaves.forEach(function(a){return f.push({source:b,target:a.index})}),void 0!==a.groups&&a.groups.forEach(function(a){return f.push({source:b,target:a.id+e})})}),d.powerEdges.forEach(function(a){f.push({source:a.source.index,target:a.target.index})}),(new g.Layout).size(b).nodes(h).links(f).avoidOverlaps(!1).linkDistance(30).symmetricDiffLinkLengths(5).convergenceThreshold(1e-4).start(100,0,0,0,!1),{cola:(new g.Layout).convergenceThreshold(.001).size(b).avoidOverlaps(!0).nodes(a.nodes).links(a.links).groupCompactness(1e-4).linkDistance(30).symmetricDiffLinkLengths(5).powerGraphGroups(function(a){d=a,d.groups.forEach(function(a){a.padding=c})}).start(50,0,100,0,!1),powerGraph:d}}Object.defineProperty(c,"__esModule",{value:!0});var g=a("./layout"),h=a("./gridrouter");c.gridify=d,c.powerGraphGridLayout=f},{"./gridrouter":9,"./layout":11}],4:[function(a,b,c){"use strict";function d(a){return!a||e(a)?new f.D3StyleLayoutAdaptor:new g.D3StyleLayoutAdaptor(a)}function e(a){var b=/^3\./;return a.version&&null!==a.version.match(b)}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./d3v3adaptor"),g=a("./d3v4adaptor");c.d3adaptor=d},{"./d3v3adaptor":5,"./d3v4adaptor":6}],5:[function(a,b,c){"use strict";function d(){return new g}var e=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(c,"__esModule",{value:!0});var f=a("./layout"),g=function(a){function b(){var b=a.call(this)||this;b.event=d3.dispatch(f.EventType[f.EventType.start],f.EventType[f.EventType.tick],f.EventType[f.EventType.end]);var c=b;return b.drag=function(){if(!a)var a=d3.behavior.drag().origin(f.Layout.dragOrigin).on("dragstart.d3adaptor",f.Layout.dragStart).on("drag.d3adaptor",function(a){f.Layout.drag(a,d3.event),c.resume()}).on("dragend.d3adaptor",f.Layout.dragEnd);if(!arguments.length)return a;this.call(a)},b}return e(b,a),b.prototype.trigger=function(a){var b={type:f.EventType[a.type],alpha:a.alpha,stress:a.stress};this.event[b.type](b)},b.prototype.kick=function(){var b=this;d3.timer(function(){return a.prototype.tick.call(b)})},b.prototype.on=function(a,b){return"string"==typeof a?this.event.on(a,b):this.event.on(f.EventType[a],b),this},b}(f.Layout);c.D3StyleLayoutAdaptor=g,c.d3adaptor=d},{"./layout":11}],6:[function(a,b,c){"use strict";var d=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(c,"__esModule",{value:!0});var e=a("./layout"),f=function(a){function b(b){var c=a.call(this)||this;c.d3Context=b,c.event=b.dispatch(e.EventType[e.EventType.start],e.EventType[e.EventType.tick],e.EventType[e.EventType.end]);var d=c;return c.drag=function(){if(!a)var a=b.drag().subject(e.Layout.dragOrigin).on("start.d3adaptor",e.Layout.dragStart).on("drag.d3adaptor",function(a){e.Layout.drag(a,b.event),d.resume()}).on("end.d3adaptor",e.Layout.dragEnd);if(!arguments.length)return a;arguments[0].call(a)},c}return d(b,a),b.prototype.trigger=function(a){var b={type:e.EventType[a.type],alpha:a.alpha,stress:a.stress};this.event.call(b.type,b)},b.prototype.kick=function(){var b=this,c=this.d3Context.timer(function(){return a.prototype.tick.call(b)&&c.stop()})},b.prototype.on=function(a,b){return"string"==typeof a?this.event.on(a,b):this.event.on(e.EventType[a],b),this},b}(e.Layout);c.D3StyleLayoutAdaptor=f},{"./layout":11}],7:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=function(){function a(){this.locks={}}return a.prototype.add=function(a,b){this.locks[a]=b},a.prototype.clear=function(){this.locks={}},a.prototype.isEmpty=function(){for(var a in this.locks)return!1;return!0},a.prototype.apply=function(a){for(var b in this.locks)a(Number(b),this.locks[b])},a}();c.Locks=d;var e=function(){function a(a,b,c){void 0===c&&(c=null),this.D=b,this.G=c,this.threshold=1e-4,this.numGridSnapNodes=0,this.snapGridSize=100,this.snapStrength=1e3,this.scaleSnapByMaxH=!1,this.random=new f,this.project=null,this.x=a,this.k=a.length;var e=this.n=a[0].length;this.H=new Array(this.k),this.g=new Array(this.k),this.Hd=new Array(this.k),this.a=new Array(this.k),this.b=new Array(this.k),this.c=new Array(this.k),this.d=new Array(this.k),this.e=new Array(this.k),this.ia=new Array(this.k),this.ib=new Array(this.k),this.xtmp=new Array(this.k),this.locks=new d,this.minD=Number.MAX_VALUE;for(var g,h=e;h--;)for(g=e;--g>h;){var i=b[h][g];i>0&&i<this.minD&&(this.minD=i)}for(this.minD===Number.MAX_VALUE&&(this.minD=1),h=this.k;h--;){for(this.g[h]=new Array(e),this.H[h]=new Array(e),g=e;g--;)this.H[h][g]=new Array(e);this.Hd[h]=new Array(e),this.a[h]=new Array(e),this.b[h]=new Array(e),this.c[h]=new Array(e),this.d[h]=new Array(e),this.e[h]=new Array(e),this.ia[h]=new Array(e),this.ib[h]=new Array(e),this.xtmp[h]=new Array(e)}}return a.createSquareMatrix=function(a,b){for(var c=new Array(a),d=0;d<a;++d){c[d]=new Array(a);for(var e=0;e<a;++e)c[d][e]=b(d,e)}return c},a.prototype.offsetDir=function(){for(var a=this,b=new Array(this.k),c=0,d=0;d<this.k;++d){var e=b[d]=this.random.getNextBetween(.01,1)-.5;c+=e*e}return c=Math.sqrt(c),b.map(function(b){return b*=a.minD/c})},a.prototype.computeDerivatives=function(a){var b=this,c=this.n;if(!(c<1)){for(var d,e=new Array(this.k),f=new Array(this.k),g=new Array(this.k),h=0,i=0;i<c;++i){for(d=0;d<this.k;++d)g[d]=this.g[d][i]=0;for(var j=0;j<c;++j)if(i!==j){for(var k=c;k--;){var l=0;for(d=0;d<this.k;++d){var m=e[d]=a[d][i]-a[d][j];l+=f[d]=m*m}if(l>1e-9)break;var n=this.offsetDir();for(d=0;d<this.k;++d)a[d][j]+=n[d]}var o=Math.sqrt(l),p=this.D[i][j],q=null!=this.G?this.G[i][j]:1;if(q>1&&o>p||!isFinite(p))for(d=0;d<this.k;++d)this.H[d][i][j]=0;else{q>1&&(q=1);var r=p*p,s=2*q*(o-p)/(r*o),t=o*o*o,u=2*-q/(r*t);for(isFinite(s)||console.log(s),d=0;d<this.k;++d)this.g[d][i]+=e[d]*s,g[d]-=this.H[d][i][j]=u*(t+p*(f[d]-l)+o*l)}}for(d=0;d<this.k;++d)h=Math.max(h,this.H[d][i][i]=g[d])}for(var v=this.snapGridSize/2,w=this.snapGridSize,x=this.snapStrength,y=x/(v*v),z=this.numGridSnapNodes,i=0;i<z;++i)for(d=0;d<this.k;++d){var A=this.x[d][i],B=A/w,C=B%1,D=B-C,E=Math.abs(C),m=E<=.5?A-D*w:A>0?A-(D+1)*w:A-(D-1)*w;-v<m&&m<=v&&(this.scaleSnapByMaxH?(this.g[d][i]+=h*y*m,this.H[d][i][i]+=h*y):(this.g[d][i]+=y*m,this.H[d][i][i]+=y))}this.locks.isEmpty()||this.locks.apply(function(c,e){for(d=0;d<b.k;++d)b.H[d][c][c]+=h,b.g[d][c]-=h*(e[d]-a[d][c])})}},a.dotProd=function(a,b){for(var c=0,d=a.length;d--;)c+=a[d]*b[d];return c},a.rightMultiply=function(b,c,d){for(var e=b.length;e--;)d[e]=a.dotProd(b[e],c)},a.prototype.computeStepSize=function(b){for(var c=0,d=0,e=0;e<this.k;++e)c+=a.dotProd(this.g[e],b[e]),a.rightMultiply(this.H[e],b[e],this.Hd[e]),d+=a.dotProd(b[e],this.Hd[e]);return 0!==d&&isFinite(d)?1*c/d:0},a.prototype.reduceStress=function(){this.computeDerivatives(this.x);for(var a=this.computeStepSize(this.g),b=0;b<this.k;++b)this.takeDescentStep(this.x[b],this.g[b],a);return this.computeStress()},a.copy=function(a,b){for(var c=a.length,d=b[0].length,e=0;e<c;++e)for(var f=0;f<d;++f)b[e][f]=a[e][f]},a.prototype.stepAndProject=function(b,c,d,e){a.copy(b,c),this.takeDescentStep(c[0],d[0],e),this.project&&this.project[0](b[0],b[1],c[0]),this.takeDescentStep(c[1],d[1],e),this.project&&this.project[1](c[0],b[1],c[1]);for(var f=2;f<this.k;f++)this.takeDescentStep(c[f],d[f],e)},a.mApply=function(a,b,c){for(var d=a;d-- >0;)for(var e=b;e-- >0;)c(d,e)},a.prototype.matrixApply=function(b){a.mApply(this.k,this.n,b)},a.prototype.computeNextPosition=function(a,b){var c=this;this.computeDerivatives(a);var d=this.computeStepSize(this.g);if(this.stepAndProject(a,b,this.g,d),this.project){this.matrixApply(function(d,e){return c.e[d][e]=a[d][e]-b[d][e]});var e=this.computeStepSize(this.e);e=Math.max(.2,Math.min(e,1)),this.stepAndProject(a,b,this.e,e)}},a.prototype.run=function(a){for(var b=Number.MAX_VALUE,c=!1;!c&&a-- >0;){var d=this.rungeKutta();c=Math.abs(b/d-1)<this.threshold,b=d}return b},a.prototype.rungeKutta=function(){var b=this;this.computeNextPosition(this.x,this.a),a.mid(this.x,this.a,this.ia),this.computeNextPosition(this.ia,this.b),a.mid(this.x,this.b,this.ib),this.computeNextPosition(this.ib,this.c),this.computeNextPosition(this.c,this.d);var c=0;return this.matrixApply(function(a,d){var e=(b.a[a][d]+2*b.b[a][d]+2*b.c[a][d]+b.d[a][d])/6,f=b.x[a][d]-e;c+=f*f,b.x[a][d]=e}),c},a.mid=function(b,c,d){a.mApply(b.length,b[0].length,function(a,e){return d[a][e]=b[a][e]+(c[a][e]-b[a][e])/2})},a.prototype.takeDescentStep=function(a,b,c){for(var d=0;d<this.n;++d)a[d]=a[d]-c*b[d]},a.prototype.computeStress=function(){for(var a=0,b=0,c=this.n-1;b<c;++b)for(var d=b+1,e=this.n;d<e;++d){for(var f=0,g=0;g<this.k;++g){var h=this.x[g][b]-this.x[g][d];f+=h*h}f=Math.sqrt(f);var i=this.D[b][d];if(isFinite(i)){var j=i-f,k=i*i;a+=j*j/k}}return a},a.zeroDistance=1e-10,a}();c.Descent=e;var f=function(){function a(a){void 0===a&&(a=1),this.seed=a,this.a=214013,this.c=2531011,this.m=2147483648,this.range=32767}return a.prototype.getNext=function(){return this.seed=(this.seed*this.a+this.c)%this.m,(this.seed>>16)/this.range},a.prototype.getNextBetween=function(a,b){return a+this.getNext()*(b-a)},a}();c.PseudoRandom=f},{}],8:[function(a,b,c){"use strict";function d(a,b,c){return(b.x-a.x)*(c.y-a.y)-(c.x-a.x)*(b.y-a.y)}function e(a,b,c){return d(a,b,c)>0}function f(a,b,c){return d(a,b,c)<0}function g(a){var b,c=a.slice(0).sort(function(a,b){return a.x!==b.x?b.x-a.x:b.y-a.y}),e=a.length,f=c[0].x;for(b=1;b<e&&c[b].x===f;++b);var g=b-1,h=[];if(h.push(c[0]),g===e-1)c[g].y!==c[0].y&&h.push(c[g]);else{var i,j=e-1,k=c[e-1].x;for(b=e-2;b>=0&&c[b].x===k;b--);for(i=b+1,b=g;++b<=i;)if(!(d(c[0],c[i],c[b])>=0&&b<i)){for(;h.length>1&&!(d(h[h.length-2],h[h.length-1],c[b])>0);)h.length-=1;0!=b&&h.push(c[b])}j!=i&&h.push(c[j]);var l=h.length;for(b=i;--b>=g;)if(!(d(c[j],c[g],c[b])>=0&&b>g)){for(;h.length>l&&!(d(h[h.length-2],h[h.length-1],c[b])>0);)h.length-=1;0!=b&&h.push(c[b])}}return h}function h(a,b,c){b.slice(0).sort(function(b,c){return Math.atan2(b.y-a.y,b.x-a.x)-Math.atan2(c.y-a.y,c.x-a.x)}).forEach(c)}function i(a,b){var c=b.slice(0);return c.push(b[0]),{rtan:j(a,c),ltan:k(a,c)}}function j(a,b){var c,d,g,h,i,j=b.length-1;if(f(a,b[1],b[0])&&!e(a,b[j-1],b[0]))return 0;for(c=0,d=j;;){if(d-c==1)return e(a,b[c],b[d])?c:d;if(g=Math.floor((c+d)/2),(i=f(a,b[g+1],b[g]))&&!e(a,b[g-1],b[g]))return g;h=e(a,b[c+1],b[c]),h?i?d=g:e(a,b[c],b[g])?d=g:c=g:i&&f(a,b[c],b[g])?d=g:c=g}}function k(a,b){var c,d,g,h,i,j=b.length-1;if(e(a,b[j-1],b[0])&&!f(a,b[1],b[0]))return 0;for(c=0,d=j;;){if(d-c==1)return f(a,b[c],b[d])?c:d;if(g=Math.floor((c+d)/2),i=f(a,b[g+1],b[g]),e(a,b[g-1],b[g])&&!i)return g;h=f(a,b[c+1],b[c]),h?i?f(a,b[c],b[g])?d=g:c=g:d=g:i?c=g:e(a,b[c],b[g])?d=g:c=g}}function l(a,b,c,d,e,f){var g,h;g=c(b[0],a),h=d(a[g],b);for(var i=!1;!i;){for(i=!0;;){if(g===a.length-1&&(g=0),e(b[h],a[g],a[g+1]))break;++g}for(;;){if(0===h&&(h=b.length-1),f(a[g],b[h],b[h-1]))break;--h,i=!1}}return{t1:g,t2:h}}function m(a,b){var c=n(b,a);return{t1:c.t2,t2:c.t1}}function n(a,b){return l(a,b,j,k,e,f)}function o(a,b){return l(a,b,k,k,f,f)}function p(a,b){return l(a,b,j,j,e,e)}function q(a,b){for(var c=[],d=1,e=b.length;d<e;++d){var f=w.Rectangle.lineIntersection(a.x1,a.y1,a.x2,a.y2,b[d-1].x,b[d-1].y,b[d].x,b[d].y);f&&c.push(f)}return c}function r(a,b){for(var c=a.length-1,e=b.length-1,f=new B,g=0;g<c;++g)for(var h=0;h<e;++h){var i=a[0==g?c-1:g-1],j=a[g],k=a[g+1],l=b[0==h?e-1:h-1],m=b[h],n=b[h+1],o=d(i,j,m),p=d(j,l,m),q=d(j,m,n),r=d(l,m,j),s=d(m,i,j),t=d(m,j,k);o>=0&&p>=0&&q<0&&r>=0&&s>=0&&t<0?f.ll=new A(g,h):o<=0&&p<=0&&q>0&&r<=0&&s<=0&&t>0?f.rr=new A(g,h):o<=0&&p>0&&q<=0&&r>=0&&s<0&&t>=0?f.rl=new A(g,h):o>=0&&p<0&&q>=0&&r<=0&&s>0&&t<=0&&(f.lr=new A(g,h))}return f}function s(a,b){for(var c=1,d=b.length;c<d;++c)if(f(b[c-1],b[c],a))return!1;return!0}function t(a,b){return!a.every(function(a){return!s(a,b)})}function u(a,b){if(t(a,b))return!0;if(t(b,a))return!0;for(var c=1,d=a.length;c<d;++c){var e=a[c],f=a[c-1];if(q(new y(f.x,f.y,e.x,e.y),b).length>0)return!0}return!1}var v=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(c,"__esModule",{value:!0});var w=a("./rectangle"),x=function(){function a(){}return a}();c.Point=x;var y=function(){function a(a,b,c,d){this.x1=a,this.y1=b,this.x2=c,this.y2=d}return a}();c.LineSegment=y;var z=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return v(b,a),b}(x);c.PolyPoint=z,c.isLeft=d,c.ConvexHull=g,c.clockwiseRadialSweep=h,c.tangent_PolyPolyC=l,c.LRtangent_PolyPolyC=m,c.RLtangent_PolyPolyC=n,c.LLtangent_PolyPolyC=o,c.RRtangent_PolyPolyC=p;var A=function(){function a(a,b){this.t1=a,this.t2=b}return a}();c.BiTangent=A;var B=function(){function a(){}return a}();c.BiTangents=B;var C=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return v(b,a),b}(x);c.TVGPoint=C;var D=function(){function a(a,b,c,d){this.id=a,this.polyid=b,this.polyvertid=c,this.p=d,d.vv=this}return a}();c.VisibilityVertex=D;var E=function(){function a(a,b){this.source=a,this.target=b}return a.prototype.length=function(){var a=this.source.p.x-this.target.p.x,b=this.source.p.y-this.target.p.y;return Math.sqrt(a*a+b*b)},a}();c.VisibilityEdge=E;var F=function(){function a(a,b){if(this.P=a,this.V=[],this.E=[],b)this.V=b.V.slice(0),this.E=b.E.slice(0);else{for(var c=a.length,d=0;d<c;d++){for(var e=a[d],f=0;f<e.length;++f){var g=e[f],h=new D(this.V.length,d,f,g);this.V.push(h),f>0&&this.E.push(new E(e[f-1].vv,h))}e.length>1&&this.E.push(new E(e[0].vv,e[e.length-1].vv))}for(var d=0;d<c-1;d++)for(var i=a[d],f=d+1;f<c;f++){var j=a[f],k=r(i,j);for(var l in k){var m=k[l],n=i[m.t1],o=j[m.t2];this.addEdgeIfVisible(n,o,d,f)}}}}return a.prototype.addEdgeIfVisible=function(a,b,c,d){this.intersectsPolys(new y(a.x,a.y,b.x,b.y),c,d)||this.E.push(new E(a.vv,b.vv))},a.prototype.addPoint=function(a,b){var c=this.P.length;this.V.push(new D(this.V.length,c,0,a));for(var d=0;d<c;++d)if(d!==b){var e=this.P[d],f=i(a,e);this.addEdgeIfVisible(a,e[f.ltan],b,d),this.addEdgeIfVisible(a,e[f.rtan],b,d)}return a.vv},a.prototype.intersectsPolys=function(a,b,c){for(var d=0,e=this.P.length;d<e;++d)if(d!=b&&d!=c&&q(a,this.P[d]).length>0)return!0;return!1},a}();c.TangentVisibilityGraph=F,c.tangents=r,c.polysOverlap=u},{"./rectangle":17}],9:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("./rectangle"),e=a("./vpsc"),f=a("./shortestpaths"),g=function(){function a(a,b,c){this.id=a,this.rect=b,this.children=c,this.leaf=void 0===c||0===c.length}return a}();c.NodeWrapper=g;var h=function(){function a(a,b,c,d,e){void 0===d&&(d=null),void 0===e&&(e=null),this.id=a,this.x=b,this.y=c,this.node=d,this.line=e}return a}();c.Vert=h;var i=function(){function a(b,c){this.s=b,this.t=c;var d=a.findMatch(b,c),e=c.slice(0).reverse(),f=a.findMatch(b,e);d.length>=f.length?(this.length=d.length,this.si=d.si,this.ti=d.ti,this.reversed=!1):(this.length=f.length,this.si=f.si,this.ti=c.length-f.ti-f.length,this.reversed=!0)}return a.findMatch=function(a,b){for(var c=a.length,d=b.length,e={length:0,si:-1,ti:-1},f=new Array(c),g=0;g<c;g++){f[g]=new Array(d);for(var h=0;h<d;h++)if(a[g]===b[h]){var i=f[g][h]=0===g||0===h?1:f[g-1][h-1]+1;i>e.length&&(e.length=i,e.si=g-i+1,e.ti=h-i+1)}else f[g][h]=0}return e},a.prototype.getSequence=function(){return this.length>=0?this.s.slice(this.si,this.si+this.length):[]},a}();c.LongestCommonSubsequence=i;var j=function(){function a(a,b,c){void 0===c&&(c=12);var e=this;this.originalnodes=a,this.groupPadding=c,this.leaves=null,this.nodes=a.map(function(a,c){return new g(c,b.getBounds(a),b.getChildren(a))}),this.leaves=this.nodes.filter(function(a){return a.leaf}),this.groups=this.nodes.filter(function(a){return!a.leaf}),this.cols=this.getGridLines("x"),this.rows=this.getGridLines("y"),this.groups.forEach(function(a){return a.children.forEach(function(b){return e.nodes[b].parent=a})}),this.root={children:[]},this.nodes.forEach(function(a){void 0===a.parent&&(a.parent=e.root,e.root.children.push(a.id)),a.ports=[]}),this.backToFront=this.nodes.slice(0),this.backToFront.sort(function(a,b){return e.getDepth(a)-e.getDepth(b)}),this.backToFront.slice(0).reverse().filter(function(a){return!a.leaf}).forEach(function(a){var b=d.Rectangle.empty();a.children.forEach(function(a){return b=b.union(e.nodes[a].rect)}),a.rect=b.inflate(e.groupPadding)});var f=this.midPoints(this.cols.map(function(a){return a.pos})),i=this.midPoints(this.rows.map(function(a){return a.pos})),j=f[0],k=f[f.length-1],l=i[0],m=i[i.length-1],n=this.rows.map(function(a){return{x1:j,x2:k,y1:a.pos,y2:a.pos}}).concat(i.map(function(a){return{x1:j,x2:k,y1:a,y2:a}})),o=this.cols.map(function(a){return{x1:a.pos,x2:a.pos,y1:l,y2:m}}).concat(f.map(function(a){return{x1:a,x2:a,y1:l,y2:m}})),p=n.concat(o);p.forEach(function(a){return a.verts=[]}),this.verts=[],this.edges=[],n.forEach(function(a){return o.forEach(function(b){var c=new h(e.verts.length,b.x1,a.y1);a.verts.push(c),b.verts.push(c),e.verts.push(c);for(var d=e.backToFront.length;d-- >0;){var f=e.backToFront[d],g=f.rect,i=Math.abs(c.x-g.cx()),j=Math.abs(c.y-g.cy());if(i<g.width()/2&&j<g.height()/2){c.node=f;break}}})}),p.forEach(function(a,b){e.nodes.forEach(function(b,c){b.rect.lineIntersections(a.x1,a.y1,a.x2,a.y2).forEach(function(c,d){var f=new h(e.verts.length,c.x,c.y,b,a);e.verts.push(f),a.verts.push(f),b.ports.push(f)})});var c=Math.abs(a.y1-a.y2)<.1,d=function(a,b){return c?b.x-a.x:b.y-a.y};a.verts.sort(d);for(var f=1;f<a.verts.length;f++){var g=a.verts[f-1],i=a.verts[f];g.node&&g.node===i.node&&g.node.leaf||e.edges.push({source:g.id,target:i.id,length:Math.abs(d(g,i))})}})}return a.prototype.avg=function(a){return a.reduce(function(a,b){return a+b})/a.length},a.prototype.getGridLines=function(a){for(var b=[],c=this.leaves.slice(0,this.leaves.length);c.length>0;){var d=c.filter(function(b){return b.rect["overlap"+a.toUpperCase()](c[0].rect)}),e={nodes:d,pos:this.avg(d.map(function(b){return b.rect["c"+a]()}))};b.push(e),e.nodes.forEach(function(a){return c.splice(c.indexOf(a),1)})}return b.sort(function(a,b){return a.pos-b.pos}),b},a.prototype.getDepth=function(a){for(var b=0;a.parent!==this.root;)b++,a=a.parent;return b},a.prototype.midPoints=function(a){for(var b=a[1]-a[0],c=[a[0]-b/2],d=1;d<a.length;d++)c.push((a[d]+a[d-1])/2);return c.push(a[a.length-1]+b/2),c},a.prototype.findLineage=function(a){var b=[a];do{a=a.parent,b.push(a)}while(a!==this.root);return b.reverse()},a.prototype.findAncestorPathBetween=function(a,b){for(var c=this.findLineage(a),d=this.findLineage(b),e=0;c[e]===d[e];)e++;return{commonAncestor:c[e-1],lineages:c.slice(e).concat(d.slice(e))}},a.prototype.siblingObstacles=function(a,b){var c=this,d=this.findAncestorPathBetween(a,b),e={};d.lineages.forEach(function(a){return e[a.id]={}});var f=d.commonAncestor.children.filter(function(a){return!(a in e)});return d.lineages.filter(function(a){return a.parent!==d.commonAncestor}).forEach(function(a){return f=f.concat(a.parent.children.filter(function(b){return b!==a.id}))}),f.map(function(a){return c.nodes[a]})},a.getSegmentSets=function(a,b,c){for(var d=[],e=0;e<a.length;e++)for(var f=a[e],g=0;g<f.length;g++){var h=f[g];h.edgeid=e,h.i=g;var i=h[1][b]-h[0][b];Math.abs(i)<.1&&d.push(h)}d.sort(function(a,c){return a[0][b]-c[0][b]});for(var j=[],k=null,l=0;l<d.length;l++){var h=d[l];(!k||Math.abs(h[0][b]-k.pos)>.1)&&(k={pos:h[0][b],segments:[]},j.push(k)),k.segments.push(h)}return j},a.nudgeSegs=function(a,b,c,d,f,g){var h=d.length;if(!(h<=1)){for(var i=d.map(function(b){return new e.Variable(b[0][a])}),j=[],k=0;k<h;k++)for(var l=0;l<h;l++)if(k!==l){var m=d[k],n=d[l],o=m.edgeid,p=n.edgeid,q=-1,r=-1;"x"==a?f(o,p)&&(m[0][b]<m[1][b]?(q=l,r=k):(q=k,r=l)):f(o,p)&&(m[0][b]<m[1][b]?(q=k,r=l):(q=l,r=k)),q>=0&&j.push(new e.Constraint(i[q],i[r],g))}new e.Solver(i,j).solve(),i.forEach(function(b,e){var f=d[e],g=b.position();f[0][a]=f[1][a]=g;var h=c[f.edgeid];f.i>0&&(h[f.i-1][1][a]=g),f.i<h.length-1&&(h[f.i+1][0][a]=g)})}},a.nudgeSegments=function(b,c,d,e,f){for(var g=a.getSegmentSets(b,c,d),h=0;h<g.length;h++){for(var i=g[h],j=[],k=0;k<i.segments.length;k++){var l=i.segments[k];j.push({type:0,s:l,pos:Math.min(l[0][d],l[1][d])}),j.push({type:1,s:l,pos:Math.max(l[0][d],l[1][d])})}j.sort(function(a,b){return a.pos-b.pos+a.type-b.type});var m=[],n=0;j.forEach(function(g){0===g.type?(m.push(g.s),n++):n--,0==n&&(a.nudgeSegs(c,d,b,m,e,f),m=[])})}},a.prototype.routeEdges=function(b,c,d,e){var f=this,g=b.map(function(a){return f.route(d(a),e(a))}),h=a.orderEdges(g),i=g.map(function(b){return a.makeSegments(b)});return a.nudgeSegments(i,"x","y",h,c),a.nudgeSegments(i,"y","x",h,c),a.unreverseEdges(i,g),i},a.unreverseEdges=function(a,b){a.forEach(function(a,c){b[c].reversed&&(a.reverse(),a.forEach(function(a){a.reverse()}))})},a.angleBetween2Lines=function(a,b){var c=Math.atan2(a[0].y-a[1].y,a[0].x-a[1].x),d=Math.atan2(b[0].y-b[1].y,b[0].x-b[1].x),e=c-d;return(e>Math.PI||e<-Math.PI)&&(e=d-c),e},a.isLeft=function(a,b,c){return(b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x)<=0},a.getOrder=function(a){for(var b={},c=0;c<a.length;c++){var d=a[c];void 0===b[d.l]&&(b[d.l]={}),b[d.l][d.r]=!0}return function(a,c){return void 0!==b[a]&&b[a][c]}},a.orderEdges=function(b){for(var c=[],d=0;d<b.length-1;d++)for(var e=d+1;e<b.length;e++){var f,g,h,j=b[d],k=b[e],l=new i(j,k);0!==l.length&&(l.reversed&&(k.reverse(),k.reversed=!0,l=new i(j,k)),(l.si<=0||l.ti<=0)&&(l.si+l.length>=j.length||l.ti+l.length>=k.length)?c.push({l:d,r:e}):(l.si+l.length>=j.length||l.ti+l.length>=k.length?(f=j[l.si+1],h=j[l.si-1],g=k[l.ti-1]):(f=j[l.si+l.length-2],g=j[l.si+l.length],h=k[l.ti+l.length]),a.isLeft(f,g,h)?c.push({l:e,r:d}):c.push({l:d,r:e})))}return a.getOrder(c)},a.makeSegments=function(a){function b(a){return{x:a.x,y:a.y}}for(var c=[],d=b(a[0]),e=1;e<a.length;e++){var f=b(a[e]),g=e<a.length-1?a[e+1]:null;g&&function(a,b,c){return Math.abs((b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x))<.001}(d,f,g)||(c.push([d,f]),d=f)}return c},a.prototype.route=function(a,b){var c=this,d=this.nodes[a],e=this.nodes[b];this.obstacles=this.siblingObstacles(d,e);var g={};this.obstacles.forEach(function(a){return g[a.id]=a}),this.passableEdges=this.edges.filter(function(a){var b=c.verts[a.source],d=c.verts[a.target];return!(b.node&&b.node.id in g||d.node&&d.node.id in g)});for(var h=1;h<d.ports.length;h++){var i=d.ports[0].id,j=d.ports[h].id;this.passableEdges.push({source:i,target:j,length:0})}for(var h=1;h<e.ports.length;h++){var i=e.ports[0].id,j=e.ports[h].id;this.passableEdges.push({source:i,target:j,length:0})}var k=function(a){return a.source},l=function(a){return a.target},m=function(a){return a.length},n=new f.Calculator(this.verts.length,this.passableEdges,k,l,m),o=function(a,b,f){var g=c.verts[a],h=c.verts[b],i=c.verts[f],j=Math.abs(i.x-g.x),k=Math.abs(i.y-g.y);return g.node===d&&g.node===h.node||h.node===e&&h.node===i.node?0:j>1&&k>1?1e3:0},p=n.PathFromNodeToNodeWithPrevCost(d.ports[0].id,e.ports[0].id,o),q=p.reverse().map(function(a){return c.verts[a]});return q.push(this.nodes[e.id].ports[0]),q.filter(function(a,b){return!(b<q.length-1&&q[b+1].node===d&&a.node===d||b>0&&a.node===e&&q[b-1].node===e)})},a.getRoutePath=function(b,c,d,e){var f={routepath:"M "+b[0][0].x+" "+b[0][0].y+" ",arrowpath:""};if(b.length>1)for(var g=0;g<b.length;g++){var h=b[g],i=h[1].x,j=h[1].y,k=i-h[0].x,l=j-h[0].y;if(g<b.length-1){Math.abs(k)>0?i-=k/Math.abs(k)*c:j-=l/Math.abs(l)*c,f.routepath+="L "+i+" "+j+" ";var m=b[g+1],n=m[0].x,o=m[0].y,p=m[1].x,q=m[1].y;k=p-n,l=q-o;var r,s,t=a.angleBetween2Lines(h,m)<0?1:0;Math.abs(k)>0?(r=n+k/Math.abs(k)*c,s=o):(r=n,s=o+l/Math.abs(l)*c);var u=Math.abs(r-i),v=Math.abs(s-j);f.routepath+="A "+u+" "+v+" 0 0 "+t+" "+r+" "+s+" "}else{var w,x,y=[i,j];Math.abs(k)>0?(i-=k/Math.abs(k)*e,w=[i,j+d],x=[i,j-d]):(j-=l/Math.abs(l)*e,w=[i+d,j],x=[i-d,j]),f.routepath+="L "+i+" "+j+" ",e>0&&(f.arrowpath="M "+y[0]+" "+y[1]+" L "+w[0]+" "+w[1]+" L "+x[0]+" "+x[1])}}else{var w,x,h=b[0],i=h[1].x,j=h[1].y,k=i-h[0].x,l=j-h[0].y,y=[i,j];Math.abs(k)>0?(i-=k/Math.abs(k)*e,w=[i,j+d],x=[i,j-d]):(j-=l/Math.abs(l)*e,w=[i+d,j],x=[i-d,j]),f.routepath+="L "+i+" "+j+" ",e>0&&(f.arrowpath="M "+y[0]+" "+y[1]+" L "+w[0]+" "+w[1]+" L "+x[0]+" "+x[1])}return f},a}();c.GridRouter=j},{"./rectangle":17,"./shortestpaths":18,"./vpsc":19}],10:[function(a,b,c){"use strict";function d(a,b,c,d,e){function g(a,b){s=[],o=0,p=0,r=l;for(var c=0;c<a.length;c++){h(a[c],b)}return Math.abs(j()-e)}function h(a,b){for(var c=void 0,d=0;d<s.length;d++)if(s[d].space_left>=a.height&&s[d].x+s[d].width+a.width+f.PADDING-b<=f.FLOAT_EPSILON){c=s[d];break}s.push(a),void 0!==c?(a.x=c.x+c.width+f.PADDING,a.y=c.bottom,a.space_left=a.height,a.bottom=a.y,c.space_left-=a.height+f.PADDING,c.bottom+=a.height+f.PADDING):(a.y=r,r+=a.height+f.PADDING,a.x=k,a.bottom=a.y,a.space_left=a.height),a.y+a.height-p>-f.FLOAT_EPSILON&&(p=a.y+a.height-l),a.x+a.width-o>-f.FLOAT_EPSILON&&(o=a.x+a.width-k)}function i(a){var b=0;return a.forEach(function(a){return b+=a.width+f.PADDING}),b}function j(){return o/p}void 0===e&&(e=1);var k=0,l=0,m=b,n=c,e=void 0!==e?e:1,d=void 0!==d?d:0,o=0,p=0,q=0,r=0,s=[];0!=a.length&&(function(a){function b(a){var b=Number.MAX_VALUE,c=Number.MAX_VALUE,e=0,f=0;a.array.forEach(function(a){var g=void 0!==a.width?a.width:d,h=void 0!==a.height?a.height:d;g/=2,h/=2,e=Math.max(a.x+g,e),b=Math.min(a.x-g,b),f=Math.max(a.y+h,f),c=Math.min(a.y-h,c)}),a.width=e-b,a.height=f-c}a.forEach(function(a){b(a)})}(a),function(a,b){var c=Number.POSITIVE_INFINITY,d=0;a.sort(function(a,b){return b.height-a.height}),q=a.reduce(function(a,b){return a.width<b.width?a.width:b.width});for(var e=p=q,h=r=i(a),j=0,k=Number.MAX_VALUE,l=Number.MAX_VALUE,m=-1,n=Number.MAX_VALUE,o=Number.MAX_VALUE;n>q||o>f.FLOAT_EPSILON;){if(1!=m)var p=h-(h-e)/f.GOLDEN_SECTION,k=g(a,p);if(0!=m)var r=e+(h-e)/f.GOLDEN_SECTION,l=g(a,r);if(n=Math.abs(p-r),o=Math.abs(k-l),k<c&&(c=k,d=p),l<c&&(c=l,d=r),k>l?(e=p,p=r,k=l,m=1):(h=r,r=p,l=k,m=0),j++>100)break}g(a,d)}(a),function(a){a.forEach(function(a){var b={x:0,y:0};a.array.forEach(function(a){b.x+=a.x,b.y+=a.y}),b.x/=a.array.length,b.y/=a.array.length;var c={x:b.x-a.width/2,y:b.y-a.height/2},d={x:a.x-c.x+m/2-o/2,y:a.y-c.y+n/2-p/2};a.array.forEach(function(a){a.x+=d.x,a.y+=d.y})})}(a))}function e(a,b){function c(a,b){if(void 0===d[a.index]){b&&(g++,f.push({array:[]})),d[a.index]=g,f[g-1].array.push(a);var h=e[a.index];if(h)for(var i=0;i<h.length;i++)c(h[i],!1)}}for(var d={},e={},f=[],g=0,h=0;h<b.length;h++){var i=b[h],j=i.source,k=i.target;e[j.index]?e[j.index].push(k):e[j.index]=[k],e[k.index]?e[k.index].push(j):e[k.index]=[j]}for(var h=0;h<a.length;h++){var l=a[h];d[l.index]||c(l,!0)}return f}Object.defineProperty(c,"__esModule",{value:!0});var f={PADDING:10,GOLDEN_SECTION:(1+Math.sqrt(5))/2,FLOAT_EPSILON:1e-4,MAX_INERATIONS:100};c.applyPacking=d,c.separateGraphs=e},{}],11:[function(a,b,c){"use strict";function d(a){return void 0!==a.leaves||void 0!==a.groups}Object.defineProperty(c,"__esModule",{value:!0});var e,f=a("./powergraph"),g=a("./linklengths"),h=a("./descent"),i=a("./rectangle"),j=a("./shortestpaths"),k=a("./geom"),l=a("./handledisconnected");!function(a){a[a.start=0]="start",a[a.tick=1]="tick",a[a.end=2]="end"}(e=c.EventType||(c.EventType={}));var m=function(){function a(){var b=this;this._canvasSize=[1,1],this._linkDistance=20,this._defaultNodeSize=10,this._linkLengthCalculator=null,this._linkType=null,this._avoidOverlaps=!1,this._handleDisconnected=!0,this._running=!1,this._nodes=[],this._groups=[],this._rootGroup=null,this._links=[],this._constraints=[],this._distanceMatrix=null,this._descent=null,this._directedLinkConstraints=null, +this._threshold=.01,this._visibilityGraph=null,this._groupCompactness=1e-6,this.event=null,this.linkAccessor={getSourceIndex:a.getSourceIndex,getTargetIndex:a.getTargetIndex,setLength:a.setLinkLength,getType:function(a){return"function"==typeof b._linkType?b._linkType(a):0}}}return a.prototype.on=function(a,b){return this.event||(this.event={}),"string"==typeof a?this.event[e[a]]=b:this.event[a]=b,this},a.prototype.trigger=function(a){this.event&&void 0!==this.event[a.type]&&this.event[a.type](a)},a.prototype.kick=function(){for(;!this.tick(););},a.prototype.tick=function(){if(this._alpha<this._threshold)return this._running=!1,this.trigger({type:e.end,alpha:this._alpha=0,stress:this._lastStress}),!0;var a,b,c=this._nodes.length;this._links.length;for(this._descent.locks.clear(),b=0;b<c;++b)if(a=this._nodes[b],a.fixed){void 0!==a.px&&void 0!==a.py||(a.px=a.x,a.py=a.y);var d=[a.px,a.py];this._descent.locks.add(b,d)}var f=this._descent.rungeKutta();return 0===f?this._alpha=0:void 0!==this._lastStress&&(this._alpha=f),this._lastStress=f,this.updateNodePositions(),this.trigger({type:e.tick,alpha:this._alpha,stress:this._lastStress}),!1},a.prototype.updateNodePositions=function(){for(var a,b=this._descent.x[0],c=this._descent.x[1],d=this._nodes.length;d--;)a=this._nodes[d],a.x=b[d],a.y=c[d]},a.prototype.nodes=function(a){if(!a){if(0===this._nodes.length&&this._links.length>0){var b=0;this._links.forEach(function(a){b=Math.max(b,a.source,a.target)}),this._nodes=new Array(++b);for(var c=0;c<b;++c)this._nodes[c]={}}return this._nodes}return this._nodes=a,this},a.prototype.groups=function(a){var b=this;return a?(this._groups=a,this._rootGroup={},this._groups.forEach(function(a){void 0===a.padding&&(a.padding=1),void 0!==a.leaves&&a.leaves.forEach(function(c,d){"number"==typeof c&&((a.leaves[d]=b._nodes[c]).parent=a)}),void 0!==a.groups&&a.groups.forEach(function(c,d){"number"==typeof c&&((a.groups[d]=b._groups[c]).parent=a)})}),this._rootGroup.leaves=this._nodes.filter(function(a){return void 0===a.parent}),this._rootGroup.groups=this._groups.filter(function(a){return void 0===a.parent}),this):this._groups},a.prototype.powerGraphGroups=function(a){var b=f.getGroups(this._nodes,this._links,this.linkAccessor,this._rootGroup);return this.groups(b.groups),a(b),this},a.prototype.avoidOverlaps=function(a){return arguments.length?(this._avoidOverlaps=a,this):this._avoidOverlaps},a.prototype.handleDisconnected=function(a){return arguments.length?(this._handleDisconnected=a,this):this._handleDisconnected},a.prototype.flowLayout=function(a,b){return arguments.length||(a="y"),this._directedLinkConstraints={axis:a,getMinSeparation:"number"==typeof b?function(){return b}:b},this},a.prototype.links=function(a){return arguments.length?(this._links=a,this):this._links},a.prototype.constraints=function(a){return arguments.length?(this._constraints=a,this):this._constraints},a.prototype.distanceMatrix=function(a){return arguments.length?(this._distanceMatrix=a,this):this._distanceMatrix},a.prototype.size=function(a){return a?(this._canvasSize=a,this):this._canvasSize},a.prototype.defaultNodeSize=function(a){return a?(this._defaultNodeSize=a,this):this._defaultNodeSize},a.prototype.groupCompactness=function(a){return a?(this._groupCompactness=a,this):this._groupCompactness},a.prototype.linkDistance=function(a){return a?(this._linkDistance="function"==typeof a?a:+a,this._linkLengthCalculator=null,this):this._linkDistance},a.prototype.linkType=function(a){return this._linkType=a,this},a.prototype.convergenceThreshold=function(a){return a?(this._threshold="function"==typeof a?a:+a,this):this._threshold},a.prototype.alpha=function(a){return arguments.length?(a=+a,this._alpha?this._alpha=a>0?a:0:a>0&&(this._running||(this._running=!0,this.trigger({type:e.start,alpha:this._alpha=a}),this.kick())),this):this._alpha},a.prototype.getLinkLength=function(a){return"function"==typeof this._linkDistance?+this._linkDistance(a):this._linkDistance},a.setLinkLength=function(a,b){a.length=b},a.prototype.getLinkType=function(a){return"function"==typeof this._linkType?this._linkType(a):0},a.prototype.symmetricDiffLinkLengths=function(a,b){var c=this;return void 0===b&&(b=1),this.linkDistance(function(b){return a*b.length}),this._linkLengthCalculator=function(){return g.symmetricDiffLinkLengths(c._links,c.linkAccessor,b)},this},a.prototype.jaccardLinkLengths=function(a,b){var c=this;return void 0===b&&(b=1),this.linkDistance(function(b){return a*b.length}),this._linkLengthCalculator=function(){return g.jaccardLinkLengths(c._links,c.linkAccessor,b)},this},a.prototype.start=function(b,c,d,e,f){var k=this;void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===e&&(e=0),void 0===f&&(f=!0);var l,m=this.nodes().length,n=m+2*this._groups.length,o=(this._links.length,this._canvasSize[0]),p=this._canvasSize[1],q=new Array(n),r=new Array(n),s=null,t=this._avoidOverlaps;this._nodes.forEach(function(a,b){a.index=b,void 0===a.x&&(a.x=o/2,a.y=p/2),q[b]=a.x,r[b]=a.y}),this._linkLengthCalculator&&this._linkLengthCalculator();var u;this._distanceMatrix?u=this._distanceMatrix:(u=new j.Calculator(n,this._links,a.getSourceIndex,a.getTargetIndex,function(a){return k.getLinkLength(a)}).DistanceMatrix(),s=h.Descent.createSquareMatrix(n,function(){return 2}),this._links.forEach(function(a){"number"==typeof a.source&&(a.source=k._nodes[a.source]),"number"==typeof a.target&&(a.target=k._nodes[a.target])}),this._links.forEach(function(b){var c=a.getSourceIndex(b),d=a.getTargetIndex(b);s[c][d]=s[d][c]=b.weight||1}));var v=h.Descent.createSquareMatrix(n,function(a,b){return u[a][b]});if(this._rootGroup&&void 0!==this._rootGroup.groups){var l=m,w=function(a,b,c,d){s[a][b]=s[b][a]=c,v[a][b]=v[b][a]=d};this._groups.forEach(function(a){w(l,l+1,k._groupCompactness,.1),q[l]=0,r[l++]=0,q[l]=0,r[l++]=0})}else this._rootGroup={leaves:this._nodes,groups:[]};var x=this._constraints||[];this._directedLinkConstraints&&(this.linkAccessor.getMinSeparation=this._directedLinkConstraints.getMinSeparation,x=x.concat(g.generateDirectedEdgeConstraints(m,this._links,this._directedLinkConstraints.axis,this.linkAccessor))),this.avoidOverlaps(!1),this._descent=new h.Descent([q,r],v),this._descent.locks.clear();for(var l=0;l<m;++l){var y=this._nodes[l];if(y.fixed){y.px=y.x,y.py=y.y;var z=[y.x,y.y];this._descent.locks.add(l,z)}}if(this._descent.threshold=this._threshold,this.initialLayout(b,q,r),x.length>0&&(this._descent.project=new i.Projection(this._nodes,this._groups,this._rootGroup,x).projectFunctions()),this._descent.run(c),this.separateOverlappingComponents(o,p),this.avoidOverlaps(t),t&&(this._nodes.forEach(function(a,b){a.x=q[b],a.y=r[b]}),this._descent.project=new i.Projection(this._nodes,this._groups,this._rootGroup,x,!0).projectFunctions(),this._nodes.forEach(function(a,b){q[b]=a.x,r[b]=a.y})),this._descent.G=s,this._descent.run(d),e){this._descent.snapStrength=1e3,this._descent.snapGridSize=this._nodes[0].width,this._descent.numGridSnapNodes=m,this._descent.scaleSnapByMaxH=m!=n;var A=h.Descent.createSquareMatrix(n,function(a,b){return a>=m||b>=m?s[a][b]:0});this._descent.G=A,this._descent.run(e)}return this.updateNodePositions(),this.separateOverlappingComponents(o,p),f?this.resume():this},a.prototype.initialLayout=function(b,c,d){if(this._groups.length>0&&b>0){var e=this._nodes.length,f=this._links.map(function(a){return{source:a.source.index,target:a.target.index}}),g=this._nodes.map(function(a){return{index:a.index}});this._groups.forEach(function(a,b){g.push({index:a.index=e+b})}),this._groups.forEach(function(a,b){void 0!==a.leaves&&a.leaves.forEach(function(b){return f.push({source:a.index,target:b.index})}),void 0!==a.groups&&a.groups.forEach(function(b){return f.push({source:a.index,target:b.index})})}),(new a).size(this.size()).nodes(g).links(f).avoidOverlaps(!1).linkDistance(this.linkDistance()).symmetricDiffLinkLengths(5).convergenceThreshold(1e-4).start(b,0,0,0,!1),this._nodes.forEach(function(a){c[a.index]=g[a.index].x,d[a.index]=g[a.index].y})}else this._descent.run(b)},a.prototype.separateOverlappingComponents=function(a,b){var c=this;if(!this._distanceMatrix&&this._handleDisconnected){var d=this._descent.x[0],e=this._descent.x[1];this._nodes.forEach(function(a,b){a.x=d[b],a.y=e[b]});var f=l.separateGraphs(this._nodes,this._links);l.applyPacking(f,a,b,this._defaultNodeSize),this._nodes.forEach(function(a,b){c._descent.x[0][b]=a.x,c._descent.x[1][b]=a.y,a.bounds&&(a.bounds.setXCentre(a.x),a.bounds.setYCentre(a.y))})}},a.prototype.resume=function(){return this.alpha(.1)},a.prototype.stop=function(){return this.alpha(0)},a.prototype.prepareEdgeRouting=function(a){void 0===a&&(a=0),this._visibilityGraph=new k.TangentVisibilityGraph(this._nodes.map(function(b){return b.bounds.inflate(-a).vertices()}))},a.prototype.routeEdge=function(a,b,c){void 0===b&&(b=5);var d=[],e=new k.TangentVisibilityGraph(this._visibilityGraph.P,{V:this._visibilityGraph.V,E:this._visibilityGraph.E}),f={x:a.source.x,y:a.source.y},g={x:a.target.x,y:a.target.y},h=e.addPoint(f,a.source.index),l=e.addPoint(g,a.target.index);e.addEdgeIfVisible(f,g,a.source.index,a.target.index),void 0!==c&&c(e);var m=function(a){return a.source.id},n=function(a){return a.target.id},o=function(a){return a.length()},p=new j.Calculator(e.V.length,e.E,m,n,o),q=p.PathFromNodeToNode(h.id,l.id);if(1===q.length||q.length===e.V.length){var r=i.makeEdgeBetween(a.source.innerBounds,a.target.innerBounds,b);d=[r.sourceIntersection,r.arrowStart]}else{for(var s=q.length-2,t=e.V[q[s]].p,u=e.V[q[0]].p,d=[a.source.innerBounds.rayIntersection(t.x,t.y)],v=s;v>=0;--v)d.push(e.V[q[v]].p);d.push(i.makeEdgeTo(u,a.target.innerBounds,b))}return d},a.getSourceIndex=function(a){return"number"==typeof a.source?a.source:a.source.index},a.getTargetIndex=function(a){return"number"==typeof a.target?a.target:a.target.index},a.linkId=function(b){return a.getSourceIndex(b)+"-"+a.getTargetIndex(b)},a.dragStart=function(b){d(b)?a.storeOffset(b,a.dragOrigin(b)):(a.stopNode(b),b.fixed|=2)},a.stopNode=function(a){a.px=a.x,a.py=a.y},a.storeOffset=function(b,c){void 0!==b.leaves&&b.leaves.forEach(function(b){b.fixed|=2,a.stopNode(b),b._dragGroupOffsetX=b.x-c.x,b._dragGroupOffsetY=b.y-c.y}),void 0!==b.groups&&b.groups.forEach(function(b){return a.storeOffset(b,c)})},a.dragOrigin=function(a){return d(a)?{x:a.bounds.cx(),y:a.bounds.cy()}:a},a.drag=function(b,c){d(b)?(void 0!==b.leaves&&b.leaves.forEach(function(a){b.bounds.setXCentre(c.x),b.bounds.setYCentre(c.y),a.px=a._dragGroupOffsetX+c.x,a.py=a._dragGroupOffsetY+c.y}),void 0!==b.groups&&b.groups.forEach(function(b){return a.drag(b,c)})):(b.px=c.x,b.py=c.y)},a.dragEnd=function(b){d(b)?(void 0!==b.leaves&&b.leaves.forEach(function(b){a.dragEnd(b),delete b._dragGroupOffsetX,delete b._dragGroupOffsetY}),void 0!==b.groups&&b.groups.forEach(a.dragEnd)):b.fixed&=-7},a.mouseOver=function(a){a.fixed|=4,a.px=a.x,a.py=a.y},a.mouseOut=function(a){a.fixed&=-5},a}();c.Layout=m},{"./descent":7,"./geom":8,"./handledisconnected":10,"./linklengths":13,"./powergraph":14,"./rectangle":17,"./shortestpaths":18}],12:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("./shortestpaths"),e=a("./descent"),f=a("./rectangle"),g=a("./linklengths"),h=function(){function a(a,b){this.source=a,this.target=b}return a.prototype.actualLength=function(a){var b=this;return Math.sqrt(a.reduce(function(a,c){var d=c[b.target]-c[b.source];return a+d*d},0))},a}();c.Link3D=h;var i=function(){function a(a,b,c){void 0===a&&(a=0),void 0===b&&(b=0),void 0===c&&(c=0),this.x=a,this.y=b,this.z=c}return a}();c.Node3D=i;var j=function(){function a(b,c,d){void 0===d&&(d=1);var e=this;this.nodes=b,this.links=c,this.idealLinkLength=d,this.constraints=null,this.useJaccardLinkLengths=!0,this.result=new Array(a.k);for(var f=0;f<a.k;++f)this.result[f]=new Array(b.length);b.forEach(function(b,c){for(var d=0,f=a.dims;d<f.length;d++){var g=f[d];void 0===b[g]&&(b[g]=Math.random())}e.result[0][c]=b.x,e.result[1][c]=b.y,e.result[2][c]=b.z})}return a.prototype.linkLength=function(a){return a.actualLength(this.result)},a.prototype.start=function(a){var b=this;void 0===a&&(a=100);var c=this.nodes.length,h=new k;this.useJaccardLinkLengths&&g.jaccardLinkLengths(this.links,h,1.5),this.links.forEach(function(a){return a.length*=b.idealLinkLength});var i=new d.Calculator(c,this.links,function(a){return a.source},function(a){return a.target},function(a){return a.length}).DistanceMatrix(),j=e.Descent.createSquareMatrix(c,function(a,b){return i[a][b]}),l=e.Descent.createSquareMatrix(c,function(){return 2});this.links.forEach(function(a){var b=a.source,c=a.target;return l[b][c]=l[c][b]=1}),this.descent=new e.Descent(this.result,j),this.descent.threshold=.001,this.descent.G=l,this.constraints&&(this.descent.project=new f.Projection(this.nodes,null,null,this.constraints).projectFunctions());for(var m=0;m<this.nodes.length;m++){var n=this.nodes[m];n.fixed&&this.descent.locks.add(m,[n.x,n.y,n.z])}return this.descent.run(a),this},a.prototype.tick=function(){this.descent.locks.clear();for(var a=0;a<this.nodes.length;a++){var b=this.nodes[a];b.fixed&&this.descent.locks.add(a,[b.x,b.y,b.z])}return this.descent.rungeKutta()},a.dims=["x","y","z"],a.k=a.dims.length,a}();c.Layout3D=j;var k=function(){function a(){}return a.prototype.getSourceIndex=function(a){return a.source},a.prototype.getTargetIndex=function(a){return a.target},a.prototype.getLength=function(a){return a.length},a.prototype.setLength=function(a,b){a.length=b},a}()},{"./descent":7,"./linklengths":13,"./rectangle":17,"./shortestpaths":18}],13:[function(a,b,c){"use strict";function d(a,b){var c={};for(var d in a)c[d]={};for(var d in b)c[d]={};return Object.keys(c).length}function e(a,b){var c=0;for(var d in a)void 0!==b[d]&&++c;return c}function f(a,b){var c={},d=function(a,b){void 0===c[a]&&(c[a]={}),c[a][b]={}};return a.forEach(function(a){var c=b.getSourceIndex(a),e=b.getTargetIndex(a);d(c,e),d(e,c)}),c}function g(a,b,c,d){var e=f(a,d);a.forEach(function(a){var f=e[d.getSourceIndex(a)],g=e[d.getTargetIndex(a)];d.setLength(a,1+b*c(f,g))})}function h(a,b,c){void 0===c&&(c=1),g(a,c,function(a,b){return Math.sqrt(d(a,b)-e(a,b))},b)}function i(a,b,c){void 0===c&&(c=1),g(a,c,function(a,b){return Math.min(Object.keys(a).length,Object.keys(b).length)<1.1?0:e(a,b)/d(a,b)},b)}function j(a,b,c,d){var e=k(a,b,d),f={};e.forEach(function(a,b){return a.forEach(function(a){return f[a]=b})});var g=[];return b.forEach(function(a){var b=d.getSourceIndex(a),e=d.getTargetIndex(a);f[b]!==f[e]&&g.push({axis:c,left:b,right:e,gap:d.getMinSeparation(a)})}),g}function k(a,b,c){function d(a){a.index=a.lowlink=f++,g.push(a),a.onStack=!0;for(var b=0,c=a.out;b<c.length;b++){var e=c[b];void 0===e.index?(d(e),a.lowlink=Math.min(a.lowlink,e.lowlink)):e.onStack&&(a.lowlink=Math.min(a.lowlink,e.index))}if(a.lowlink===a.index){for(var i=[];g.length&&(e=g.pop(),e.onStack=!1,i.push(e),e!==a););h.push(i.map(function(a){return a.id}))}}for(var e=[],f=0,g=[],h=[],i=0;i<a;i++)e.push({id:i,out:[]});for(var j=0,k=b;j<k.length;j++){var l=k[j],m=e[c.getSourceIndex(l)],n=e[c.getTargetIndex(l)];m.out.push(n)}for(var o=0,p=e;o<p.length;o++){var q=p[o];void 0===q.index&&d(q)}return h}Object.defineProperty(c,"__esModule",{value:!0}),c.symmetricDiffLinkLengths=h,c.jaccardLinkLengths=i,c.generateDirectedEdgeConstraints=j,c.stronglyConnectedComponents=k},{}],14:[function(a,b,c){"use strict";function d(a,b,c){a.forAll(function(a){if(a.isLeaf())b.leaves||(b.leaves=[]),b.leaves.push(a.id);else{var e=b;if(a.gid=c.length,!a.isIsland()||a.isPredefined()){if(e={id:a.gid},a.isPredefined())for(var f in a.definition)e[f]=a.definition[f];b.groups||(b.groups=[]),b.groups.push(a.gid),c.push(e)}d(a.children,e,c)}})}function e(a,b){var c={};for(var d in a)d in b&&(c[d]=a[d]);return c}function f(a,b,c,d){for(var e=a.length,f=new h(e,b,c,d);f.greedyMerge(););var g=[],i=f.getGroupHierarchy(g);return g.forEach(function(b){var c=function(c){var d=b[c];"number"==typeof d&&(b[c]=a[d])};c("source"),c("target")}),{groups:i,powerEdges:g}}Object.defineProperty(c,"__esModule",{value:!0});var g=function(){function a(a,b,c){this.source=a,this.target=b,this.type=c}return a}();c.PowerEdge=g;var h=function(){function a(a,b,c,d){var e=this;if(this.linkAccessor=c,this.modules=new Array(a),this.roots=[],d)this.initModulesFromGroup(d);else{this.roots.push(new j);for(var f=0;f<a;++f)this.roots[0].add(this.modules[f]=new i(f))}this.R=b.length,b.forEach(function(a){var b=e.modules[c.getSourceIndex(a)],d=e.modules[c.getTargetIndex(a)],f=c.getType(a);b.outgoing.add(f,d),d.incoming.add(f,b)})}return a.prototype.initModulesFromGroup=function(a){var b=new j;this.roots.push(b);for(var c=0;c<a.leaves.length;++c){var d=a.leaves[c],e=new i(d.id);this.modules[d.id]=e,b.add(e)}if(a.groups)for(var f=0;f<a.groups.length;++f){var g=a.groups[f],h={};for(var l in g)"leaves"!==l&&"groups"!==l&&g.hasOwnProperty(l)&&(h[l]=g[l]);b.add(new i(-1-f,new k,new k,this.initModulesFromGroup(g),h))}return b},a.prototype.merge=function(a,b,c){void 0===c&&(c=0);var d=a.incoming.intersection(b.incoming),e=a.outgoing.intersection(b.outgoing),f=new j;f.add(a),f.add(b);var g=new i(this.modules.length,e,d,f);this.modules.push(g);var h=function(c,d,e){c.forAll(function(c,f){c.forAll(function(c){var h=c[d];h.add(f,g),h.remove(f,a),h.remove(f,b),a[e].remove(f,c),b[e].remove(f,c)})})};return h(e,"incoming","outgoing"),h(d,"outgoing","incoming"),this.R-=d.count()+e.count(),this.roots[c].remove(a),this.roots[c].remove(b),this.roots[c].add(g),g},a.prototype.rootMerges=function(a){void 0===a&&(a=0);for(var b=this.roots[a].modules(),c=b.length,d=new Array(c*(c-1)),e=0,f=0,g=c-1;f<g;++f)for(var h=f+1;h<c;++h){var i=b[f],j=b[h];d[e]={id:e,nEdges:this.nEdges(i,j),a:i,b:j},e++}return d},a.prototype.greedyMerge=function(){for(var a=0;a<this.roots.length;++a)if(!(this.roots[a].modules().length<2)){var b=this.rootMerges(a).sort(function(a,b){return a.nEdges==b.nEdges?a.id-b.id:a.nEdges-b.nEdges}),c=b[0];if(!(c.nEdges>=this.R))return this.merge(c.a,c.b,a),!0}},a.prototype.nEdges=function(a,b){var c=a.incoming.intersection(b.incoming),d=a.outgoing.intersection(b.outgoing);return this.R-c.count()-d.count()},a.prototype.getGroupHierarchy=function(a){var b=this,c=[],e={};return d(this.roots[0],e,c),this.allEdges().forEach(function(d){var e=b.modules[d.source],f=b.modules[d.target];a.push(new g(void 0===e.gid?d.source:c[e.gid],void 0===f.gid?d.target:c[f.gid],d.type))}),c},a.prototype.allEdges=function(){var b=[];return a.getEdges(this.roots[0],b),b},a.getEdges=function(b,c){b.forAll(function(b){b.getEdges(c),a.getEdges(b.children,c)})},a}();c.Configuration=h;var i=function(){function a(a,b,c,d,e){void 0===b&&(b=new k),void 0===c&&(c=new k),void 0===d&&(d=new j),this.id=a,this.outgoing=b,this.incoming=c,this.children=d,this.definition=e}return a.prototype.getEdges=function(a){var b=this;this.outgoing.forAll(function(c,d){c.forAll(function(c){a.push(new g(b.id,c.id,d))})})},a.prototype.isLeaf=function(){return 0===this.children.count()},a.prototype.isIsland=function(){return 0===this.outgoing.count()&&0===this.incoming.count()},a.prototype.isPredefined=function(){return void 0!==this.definition},a}();c.Module=i;var j=function(){function a(){this.table={}}return a.prototype.count=function(){return Object.keys(this.table).length},a.prototype.intersection=function(b){var c=new a;return c.table=e(this.table,b.table),c},a.prototype.intersectionCount=function(a){return this.intersection(a).count()},a.prototype.contains=function(a){return a in this.table},a.prototype.add=function(a){this.table[a.id]=a},a.prototype.remove=function(a){delete this.table[a.id]},a.prototype.forAll=function(a){for(var b in this.table)a(this.table[b])},a.prototype.modules=function(){var a=[];return this.forAll(function(b){b.isPredefined()||a.push(b)}),a},a}();c.ModuleSet=j;var k=function(){function a(){this.sets={},this.n=0}return a.prototype.count=function(){return this.n},a.prototype.contains=function(a){var b=!1;return this.forAllModules(function(c){b||c.id!=a||(b=!0)}),b},a.prototype.add=function(a,b){(a in this.sets?this.sets[a]:this.sets[a]=new j).add(b),++this.n},a.prototype.remove=function(a,b){var c=this.sets[a];c.remove(b),0===c.count()&&delete this.sets[a],--this.n},a.prototype.forAll=function(a){for(var b in this.sets)a(this.sets[b],Number(b))},a.prototype.forAllModules=function(a){this.forAll(function(b,c){return b.forAll(a)})},a.prototype.intersection=function(b){var c=new a;return this.forAll(function(a,d){if(d in b.sets){var e=a.intersection(b.sets[d]),f=e.count();f>0&&(c.sets[d]=e,c.n+=f)}}),c},a}();c.LinkSets=k,c.getGroups=f},{}],15:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=function(){function a(a){this.elem=a,this.subheaps=[]}return a.prototype.toString=function(a){for(var b="",c=!1,d=0;d<this.subheaps.length;++d){var e=this.subheaps[d];e.elem?(c&&(b+=","),b+=e.toString(a),c=!0):c=!1}return""!==b&&(b="("+b+")"),(this.elem?a(this.elem):"")+b},a.prototype.forEach=function(a){this.empty()||(a(this.elem,this),this.subheaps.forEach(function(b){return b.forEach(a)}))},a.prototype.count=function(){return this.empty()?0:1+this.subheaps.reduce(function(a,b){return a+b.count()},0)},a.prototype.min=function(){return this.elem},a.prototype.empty=function(){return null==this.elem},a.prototype.contains=function(a){if(this===a)return!0;for(var b=0;b<this.subheaps.length;b++)if(this.subheaps[b].contains(a))return!0;return!1},a.prototype.isHeap=function(a){var b=this;return this.subheaps.every(function(c){return a(b.elem,c.elem)&&c.isHeap(a)})},a.prototype.insert=function(b,c){return this.merge(new a(b),c)},a.prototype.merge=function(a,b){return this.empty()?a:a.empty()?this:b(this.elem,a.elem)?(this.subheaps.push(a),this):(a.subheaps.push(this),a)},a.prototype.removeMin=function(a){return this.empty()?null:this.mergePairs(a)},a.prototype.mergePairs=function(b){if(0==this.subheaps.length)return new a(null);if(1==this.subheaps.length)return this.subheaps[0];var c=this.subheaps.pop().merge(this.subheaps.pop(),b),d=this.mergePairs(b);return c.merge(d,b)},a.prototype.decreaseKey=function(b,c,d,e){var f=b.removeMin(e);b.elem=f.elem,b.subheaps=f.subheaps,null!==d&&null!==f.elem&&d(b.elem,b);var g=new a(c);return null!==d&&d(c,g),this.merge(g,e)},a}();c.PairingHeap=d;var e=function(){function a(a){this.lessThan=a}return a.prototype.top=function(){return this.empty()?null:this.root.elem},a.prototype.push=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];for(var c,e,f=0;e=a[f];++f)c=new d(e),this.root=this.empty()?c:this.root.merge(c,this.lessThan);return c},a.prototype.empty=function(){return!this.root||!this.root.elem},a.prototype.isHeap=function(){return this.root.isHeap(this.lessThan)},a.prototype.forEach=function(a){this.root.forEach(a)},a.prototype.pop=function(){if(this.empty())return null;var a=this.root.min();return this.root=this.root.removeMin(this.lessThan),a},a.prototype.reduceKey=function(a,b,c){void 0===c&&(c=null),this.root=this.root.decreaseKey(a,b,c,this.lessThan)},a.prototype.toString=function(a){return this.root.toString(a)},a.prototype.count=function(){return this.root.count()},a}();c.PriorityQueue=e},{}],16:[function(a,b,c){"use strict";var d=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(){this.findIter=function(a){for(var b=this._root,c=this.iterator();null!==b;){var d=this._comparator(a,b.data);if(0===d)return c._cursor=b,c;c._ancestors.push(b),b=b.get_child(d>0)}return null}}return a.prototype.clear=function(){this._root=null,this.size=0},a.prototype.find=function(a){for(var b=this._root;null!==b;){var c=this._comparator(a,b.data);if(0===c)return b.data;b=b.get_child(c>0)}return null},a.prototype.lowerBound=function(a){return this._bound(a,this._comparator)},a.prototype.upperBound=function(a){function b(a,b){return c(b,a)}var c=this._comparator;return this._bound(a,b)},a.prototype.min=function(){var a=this._root;if(null===a)return null;for(;null!==a.left;)a=a.left;return a.data},a.prototype.max=function(){var a=this._root;if(null===a)return null;for(;null!==a.right;)a=a.right;return a.data},a.prototype.iterator=function(){return new f(this)},a.prototype.each=function(a){for(var b,c=this.iterator();null!==(b=c.next());)a(b)},a.prototype.reach=function(a){for(var b,c=this.iterator();null!==(b=c.prev());)a(b)},a.prototype._bound=function(a,b){for(var c=this._root,d=this.iterator();null!==c;){var e=this._comparator(a,c.data);if(0===e)return d._cursor=c,d;d._ancestors.push(c),c=c.get_child(e>0)}for(var f=d._ancestors.length-1;f>=0;--f)if(c=d._ancestors[f],b(a,c.data)>0)return d._cursor=c,d._ancestors.length=f,d;return d._ancestors.length=0,d},a}();c.TreeBase=e;var f=function(){function a(a){this._tree=a,this._ancestors=[],this._cursor=null}return a.prototype.data=function(){return null!==this._cursor?this._cursor.data:null},a.prototype.next=function(){if(null===this._cursor){var a=this._tree._root;null!==a&&this._minNode(a)}else if(null===this._cursor.right){var b;do{if(b=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.right===b)}else this._ancestors.push(this._cursor),this._minNode(this._cursor.right);return null!==this._cursor?this._cursor.data:null},a.prototype.prev=function(){if(null===this._cursor){var a=this._tree._root;null!==a&&this._maxNode(a)}else if(null===this._cursor.left){var b;do{if(b=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.left===b)}else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left);return null!==this._cursor?this._cursor.data:null},a.prototype._minNode=function(a){for(;null!==a.left;)this._ancestors.push(a),a=a.left;this._cursor=a},a.prototype._maxNode=function(a){for(;null!==a.right;)this._ancestors.push(a),a=a.right;this._cursor=a},a}();c.Iterator=f;var g=function(){function a(a){this.data=a,this.left=null,this.right=null,this.red=!0}return a.prototype.get_child=function(a){return a?this.right:this.left},a.prototype.set_child=function(a,b){a?this.right=b:this.left=b},a}(),h=function(a){function b(b){var c=a.call(this)||this;return c._root=null,c._comparator=b,c.size=0,c}return d(b,a),b.prototype.insert=function(a){var c=!1;if(null===this._root)this._root=new g(a),c=!0,this.size++;else{var d=new g(void 0),e=!1,f=!1,h=null,i=d,j=null,k=this._root;for(i.right=this._root;;){if(null===k?(k=new g(a),j.set_child(e,k),c=!0,this.size++):b.is_red(k.left)&&b.is_red(k.right)&&(k.red=!0,k.left.red=!1,k.right.red=!1),b.is_red(k)&&b.is_red(j)){var l=i.right===h;k===j.get_child(f)?i.set_child(l,b.single_rotate(h,!f)):i.set_child(l,b.double_rotate(h,!f))}var m=this._comparator(k.data,a);if(0===m)break;f=e,e=m<0,null!==h&&(i=h),h=j,j=k,k=k.get_child(e)}this._root=d.right}return this._root.red=!1,c},b.prototype.remove=function(a){if(null===this._root)return!1;var c=new g(void 0),d=c;d.right=this._root;for(var e=null,f=null,h=null,i=!0;null!==d.get_child(i);){var j=i;f=e,e=d,d=d.get_child(i);var k=this._comparator(a,d.data);if(i=k>0,0===k&&(h=d),!b.is_red(d)&&!b.is_red(d.get_child(i)))if(b.is_red(d.get_child(!i))){var l=b.single_rotate(d,i);e.set_child(j,l),e=l}else if(!b.is_red(d.get_child(!i))){var m=e.get_child(!j);if(null!==m)if(b.is_red(m.get_child(!j))||b.is_red(m.get_child(j))){var n=f.right===e;b.is_red(m.get_child(j))?f.set_child(n,b.double_rotate(e,j)):b.is_red(m.get_child(!j))&&f.set_child(n,b.single_rotate(e,j));var o=f.get_child(n);o.red=!0,d.red=!0,o.left.red=!1,o.right.red=!1}else e.red=!1,m.red=!0,d.red=!0}}return null!==h&&(h.data=d.data,e.set_child(e.right===d,d.get_child(null===d.left)),this.size--),this._root=c.right,null!==this._root&&(this._root.red=!1),null!==h},b.is_red=function(a){return null!==a&&a.red},b.single_rotate=function(a,b){var c=a.get_child(!b);return a.set_child(!b,c.get_child(b)),c.set_child(b,a),a.red=!0,c.red=!1,c},b.double_rotate=function(a,c){return a.set_child(!c,b.single_rotate(a.get_child(!c),!c)),b.single_rotate(a,c)},b}(e);c.RBTree=h},{}],17:[function(a,b,c){"use strict";function d(a){return a.bounds=void 0!==a.leaves?a.leaves.reduce(function(a,b){return b.bounds.union(a)},u.empty()):u.empty(),void 0!==a.groups&&(a.bounds=a.groups.reduce(function(a,b){return d(b).union(a)},a.bounds)),a.bounds=a.bounds.inflate(a.padding),a.bounds}function e(a,b,c){var d=a.rayIntersection(b.cx(),b.cy())||{x:a.cx(),y:a.cy()},e=b.rayIntersection(a.cx(),a.cy())||{x:b.cx(),y:b.cy()},f=e.x-d.x,g=e.y-d.y,h=Math.sqrt(f*f+g*g),i=h-c;return{sourceIntersection:d,targetIntersection:e,arrowStart:{x:d.x+i*f/h,y:d.y+i*g/h}}}function f(a,b,c){var d=b.rayIntersection(a.x,a.y);d||(d={x:b.cx(),y:b.cy()});var e=d.x-a.x,f=d.y-a.y,g=Math.sqrt(e*e+f*f);return{x:d.x-c*e/g,y:d.y-c*f/g}}function g(a,b){return a.pos>b.pos?1:a.pos<b.pos?-1:a.isOpen?-1:b.isOpen?1:0}function h(){return new t.RBTree(function(a,b){return a.pos-b.pos})}function i(a,b,c,d){void 0===d&&(d=!1);var e=a.padding,f=void 0!==a.groups?a.groups.length:0,g=void 0!==a.leaves?a.leaves.length:0,h=f?a.groups.reduce(function(a,d){return a.concat(i(d,b,c,!0))},[]):[],k=(d?2:0)+g+f,l=new Array(k),m=new Array(k),n=0,o=function(a,b){m[n]=a,l[n++]=b};if(d){var p=a.bounds,q=b.getCentre(p),r=b.getSize(p)/2,s=b.getOpen(p),t=b.getClose(p),u=q-r+e/2,v=q+r-e/2;a.minVar.desiredPosition=u,o(b.makeRect(s,t,u,e),a.minVar),a.maxVar.desiredPosition=v,o(b.makeRect(s,t,v,e),a.maxVar)}g&&a.leaves.forEach(function(a){return o(a.bounds,a.variable)}),f&&a.groups.forEach(function(a){var c=a.bounds;o(b.makeRect(b.getOpen(c),b.getClose(c),b.getCentre(c),b.getSize(c)),a.minVar)});var w=j(m,l,b,c);return f&&(l.forEach(function(a){a.cOut=[],a.cIn=[]}),w.forEach(function(a){a.left.cOut.push(a),a.right.cIn.push(a)}),a.groups.forEach(function(a){var c=(a.padding-b.getSize(a.bounds))/2;a.minVar.cIn.forEach(function(a){return a.gap+=c}),a.minVar.cOut.forEach(function(b){b.left=a.maxVar,b.gap+=c})})),h.concat(w)}function j(a,b,c,d){var e,f=a.length,i=2*f;console.assert(b.length>=f);var j=new Array(i);for(e=0;e<f;++e){var k=a[e],l=new v(b[e],k,c.getCentre(k));j[e]=new w(!0,l,c.getOpen(k)),j[e+f]=new w(!1,l,c.getClose(k))}j.sort(g);var m=new Array,n=h();for(e=0;e<i;++e){var o=j[e],l=o.v;if(o.isOpen)n.insert(l),c.findNeighbours(l,n);else{n.remove(l);var p=function(a,b){var e=(c.getSize(a.r)+c.getSize(b.r))/2+d;m.push(new s.Constraint(a.v,b.v,e))},q=function(a,b,c){for(var d,e=l[a].iterator();null!==(d=e[a]());)c(d,l),d[b].remove(l)};q("prev","next",function(a,b){return p(a,b)}),q("next","prev",function(a,b){return p(b,a)})}}return console.assert(0===n.size),m}function k(a,b){var c=function(c,d){for(var e,f=b.findIter(a);null!==(e=f[c]());){var g=e.r.overlapX(a.r);if((g<=0||g<=e.r.overlapY(a.r))&&(a[c].insert(e),e[d].insert(a)),g<=0)break}};c("next","prev"),c("prev","next")}function l(a,b){var c=function(c,d){var e=b.findIter(a)[c]();null!==e&&e.r.overlapX(a.r)>0&&(a[c].insert(e),e[d].insert(a))};c("next","prev"),c("prev","next")}function m(a,b){return j(a,b,x,1e-6)}function n(a,b){return j(a,b,y,1e-6)}function o(a){return i(a,x,1e-6)}function p(a){return i(a,y,1e-6)}function q(a){var b=a.map(function(a){return new s.Variable(a.cx())}),c=m(a,b),d=new s.Solver(b,c);d.solve(),b.forEach(function(b,c){return a[c].setXCentre(b.position())}),b=a.map(function(a){return new s.Variable(a.cy())}),c=n(a,b),d=new s.Solver(b,c),d.solve(),b.forEach(function(b,c){return a[c].setYCentre(b.position())})}var r=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){ +for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(c,"__esModule",{value:!0});var s=a("./vpsc"),t=a("./rbtree");c.computeGroupBounds=d;var u=function(){function a(a,b,c,d){this.x=a,this.X=b,this.y=c,this.Y=d}return a.empty=function(){return new a(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)},a.prototype.cx=function(){return(this.x+this.X)/2},a.prototype.cy=function(){return(this.y+this.Y)/2},a.prototype.overlapX=function(a){var b=this.cx(),c=a.cx();return b<=c&&a.x<this.X?this.X-a.x:c<=b&&this.x<a.X?a.X-this.x:0},a.prototype.overlapY=function(a){var b=this.cy(),c=a.cy();return b<=c&&a.y<this.Y?this.Y-a.y:c<=b&&this.y<a.Y?a.Y-this.y:0},a.prototype.setXCentre=function(a){var b=a-this.cx();this.x+=b,this.X+=b},a.prototype.setYCentre=function(a){var b=a-this.cy();this.y+=b,this.Y+=b},a.prototype.width=function(){return this.X-this.x},a.prototype.height=function(){return this.Y-this.y},a.prototype.union=function(b){return new a(Math.min(this.x,b.x),Math.max(this.X,b.X),Math.min(this.y,b.y),Math.max(this.Y,b.Y))},a.prototype.lineIntersections=function(b,c,d,e){for(var f=[[this.x,this.y,this.X,this.y],[this.X,this.y,this.X,this.Y],[this.X,this.Y,this.x,this.Y],[this.x,this.Y,this.x,this.y]],g=[],h=0;h<4;++h){var i=a.lineIntersection(b,c,d,e,f[h][0],f[h][1],f[h][2],f[h][3]);null!==i&&g.push({x:i.x,y:i.y})}return g},a.prototype.rayIntersection=function(a,b){var c=this.lineIntersections(this.cx(),this.cy(),a,b);return c.length>0?c[0]:null},a.prototype.vertices=function(){return[{x:this.x,y:this.y},{x:this.X,y:this.y},{x:this.X,y:this.Y},{x:this.x,y:this.Y}]},a.lineIntersection=function(a,b,c,d,e,f,g,h){var i=c-a,j=g-e,k=d-b,l=h-f,m=l*i-j*k;if(0==m)return null;var n=a-e,o=b-f,p=j*o-l*n,q=p/m,r=i*o-k*n,s=r/m;return q>=0&&q<=1&&s>=0&&s<=1?{x:a+q*i,y:b+q*k}:null},a.prototype.inflate=function(b){return new a(this.x-b,this.X+b,this.y-b,this.Y+b)},a}();c.Rectangle=u,c.makeEdgeBetween=e,c.makeEdgeTo=f;var v=function(){function a(a,b,c){this.v=a,this.r=b,this.pos=c,this.prev=h(),this.next=h()}return a}(),w=function(){function a(a,b,c){this.isOpen=a,this.v=b,this.pos=c}return a}(),x={getCentre:function(a){return a.cx()},getOpen:function(a){return a.y},getClose:function(a){return a.Y},getSize:function(a){return a.width()},makeRect:function(a,b,c,d){return new u(c-d/2,c+d/2,a,b)},findNeighbours:k},y={getCentre:function(a){return a.cy()},getOpen:function(a){return a.x},getClose:function(a){return a.X},getSize:function(a){return a.height()},makeRect:function(a,b,c,d){return new u(a,b,c-d/2,c+d/2)},findNeighbours:l};c.generateXConstraints=m,c.generateYConstraints=n,c.generateXGroupConstraints=o,c.generateYGroupConstraints=p,c.removeOverlaps=q;var z=function(a){function b(b,c){var d=a.call(this,0,c)||this;return d.index=b,d}return r(b,a),b}(s.Variable);c.IndexedVariable=z;var A=function(){function a(a,b,c,e,f){void 0===c&&(c=null),void 0===e&&(e=null),void 0===f&&(f=!1);var g=this;if(this.nodes=a,this.groups=b,this.rootGroup=c,this.avoidOverlaps=f,this.variables=a.map(function(a,b){return a.variable=new z(b,1)}),e&&this.createConstraints(e),f&&c&&void 0!==c.groups){a.forEach(function(a){if(!a.width||!a.height)return void(a.bounds=new u(a.x,a.x,a.y,a.y));var b=a.width/2,c=a.height/2;a.bounds=new u(a.x-b,a.x+b,a.y-c,a.y+c)}),d(c);var h=a.length;b.forEach(function(a){g.variables[h]=a.minVar=new z(h++,void 0!==a.stiffness?a.stiffness:.01),g.variables[h]=a.maxVar=new z(h++,void 0!==a.stiffness?a.stiffness:.01)})}}return a.prototype.createSeparation=function(a){return new s.Constraint(this.nodes[a.left].variable,this.nodes[a.right].variable,a.gap,void 0!==a.equality&&a.equality)},a.prototype.makeFeasible=function(a){var b=this;if(this.avoidOverlaps){var c="x",d="width";"x"===a.axis&&(c="y",d="height");var e=a.offsets.map(function(a){return b.nodes[a.node]}).sort(function(a,b){return a[c]-b[c]}),f=null;e.forEach(function(a){if(f){var b=f[c]+f[d];b>a[c]&&(a[c]=b)}f=a})}},a.prototype.createAlignment=function(a){var b=this,c=this.nodes[a.offsets[0].node].variable;this.makeFeasible(a);var d="x"===a.axis?this.xConstraints:this.yConstraints;a.offsets.slice(1).forEach(function(a){var e=b.nodes[a.node].variable;d.push(new s.Constraint(c,e,a.offset,!0))})},a.prototype.createConstraints=function(a){var b=this,c=function(a){return void 0===a.type||"separation"===a.type};this.xConstraints=a.filter(function(a){return"x"===a.axis&&c(a)}).map(function(a){return b.createSeparation(a)}),this.yConstraints=a.filter(function(a){return"y"===a.axis&&c(a)}).map(function(a){return b.createSeparation(a)}),a.filter(function(a){return"alignment"===a.type}).forEach(function(a){return b.createAlignment(a)})},a.prototype.setupVariablesAndBounds=function(a,b,c,d){this.nodes.forEach(function(e,f){e.fixed?(e.variable.weight=e.fixedWeight?e.fixedWeight:1e3,c[f]=d(e)):e.variable.weight=1;var g=(e.width||0)/2,h=(e.height||0)/2,i=a[f],j=b[f];e.bounds=new u(i-g,i+g,j-h,j+h)})},a.prototype.xProject=function(a,b,c){(this.rootGroup||this.avoidOverlaps||this.xConstraints)&&this.project(a,b,a,c,function(a){return a.px},this.xConstraints,o,function(a){return a.bounds.setXCentre(c[a.variable.index]=a.variable.position())},function(a){var b=c[a.minVar.index]=a.minVar.position(),d=c[a.maxVar.index]=a.maxVar.position(),e=a.padding/2;a.bounds.x=b-e,a.bounds.X=d+e})},a.prototype.yProject=function(a,b,c){(this.rootGroup||this.yConstraints)&&this.project(a,b,b,c,function(a){return a.py},this.yConstraints,p,function(a){return a.bounds.setYCentre(c[a.variable.index]=a.variable.position())},function(a){var b=c[a.minVar.index]=a.minVar.position(),d=c[a.maxVar.index]=a.maxVar.position(),e=a.padding/2;a.bounds.y=b-e,a.bounds.Y=d+e})},a.prototype.projectFunctions=function(){var a=this;return[function(b,c,d){return a.xProject(b,c,d)},function(b,c,d){return a.yProject(b,c,d)}]},a.prototype.project=function(a,b,c,e,f,g,h,i,j){this.setupVariablesAndBounds(a,b,e,f),this.rootGroup&&this.avoidOverlaps&&(d(this.rootGroup),g=g.concat(h(this.rootGroup))),this.solve(this.variables,g,c,e),this.nodes.forEach(i),this.rootGroup&&this.avoidOverlaps&&(this.groups.forEach(j),d(this.rootGroup))},a.prototype.solve=function(a,b,c,d){var e=new s.Solver(a,b);e.setStartingPositions(c),e.setDesiredPositions(d),e.solve()},a}();c.Projection=A},{"./rbtree":16,"./vpsc":19}],18:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=a("./pqueue"),e=function(){function a(a,b){this.id=a,this.distance=b}return a}(),f=function(){function a(a){this.id=a,this.neighbours=[]}return a}(),g=function(){function a(a,b,c){this.node=a,this.prev=b,this.d=c}return a}(),h=function(){function a(a,b,c,d,g){this.n=a,this.es=b,this.neighbours=new Array(this.n);for(var h=this.n;h--;)this.neighbours[h]=new f(h);for(h=this.es.length;h--;){var i=this.es[h],j=c(i),k=d(i),l=g(i);this.neighbours[j].neighbours.push(new e(k,l)),this.neighbours[k].neighbours.push(new e(j,l))}}return a.prototype.DistanceMatrix=function(){for(var a=new Array(this.n),b=0;b<this.n;++b)a[b]=this.dijkstraNeighbours(b);return a},a.prototype.DistancesFromNode=function(a){return this.dijkstraNeighbours(a)},a.prototype.PathFromNodeToNode=function(a,b){return this.dijkstraNeighbours(a,b)},a.prototype.PathFromNodeToNodeWithPrevCost=function(a,b,c){var e=new d.PriorityQueue(function(a,b){return a.d<=b.d}),f=this.neighbours[a],h=new g(f,null,0),i={};for(e.push(h);!e.empty()&&(h=e.pop(),f=h.node,f.id!==b);)for(var j=f.neighbours.length;j--;){var k=f.neighbours[j],l=this.neighbours[k.id];if(!h.prev||l.id!==h.prev.node.id){var m=l.id+","+f.id;if(!(m in i&&i[m]<=h.d)){var n=h.prev?c(h.prev.node.id,f.id,l.id):0,o=h.d+k.distance+n;i[m]=o,e.push(new g(l,h,o))}}}for(var p=[];h.prev;)h=h.prev,p.push(h.node.id);return p},a.prototype.dijkstraNeighbours=function(a,b){void 0===b&&(b=-1);for(var c=new d.PriorityQueue(function(a,b){return a.d<=b.d}),e=this.neighbours.length,f=new Array(e);e--;){var g=this.neighbours[e];g.d=e===a?0:Number.POSITIVE_INFINITY,g.q=c.push(g)}for(;!c.empty();){var h=c.pop();if(f[h.id]=h.d,h.id===b){for(var i=[],j=h;void 0!==j.prev;)i.push(j.prev.id),j=j.prev;return i}for(e=h.neighbours.length;e--;){var k=h.neighbours[e],j=this.neighbours[k.id],l=h.d+k.distance;h.d!==Number.MAX_VALUE&&j.d>l&&(j.d=l,j.prev=h,c.reduceKey(j.q,j,function(a,b){return a.q=b}))}}return f},a}();c.Calculator=h},{"./pqueue":15}],19:[function(a,b,c){"use strict";function d(a,b,c){for(var d=a.map(function(a){return new g(a.desiredCenter)}),e=[],h=a.length,i=0;i<h-1;i++){var k=a[i],l=a[i+1];e.push(new f(d[i],d[i+1],(k.size+l.size)/2))}var m=d[0],n=d[h-1],o=a[0].size/2,p=a[h-1].size/2,q=null,r=null;return b&&(q=new g(b,1e3*m.weight),d.push(q),e.push(new f(q,m,o))),c&&(r=new g(c,1e3*n.weight),d.push(r),e.push(new f(n,r,p))),new j(d,e).solve(),{newCenters:d.slice(0,a.length).map(function(a){return a.position()}),lowerBound:q?q.position():m.position()-o,upperBound:r?r.position():n.position()+p}}Object.defineProperty(c,"__esModule",{value:!0});var e=function(){function a(a){this.scale=a,this.AB=0,this.AD=0,this.A2=0}return a.prototype.addVariable=function(a){var b=this.scale/a.scale,c=a.offset/a.scale,d=a.weight;this.AB+=d*b*c,this.AD+=d*b*a.desiredPosition,this.A2+=d*b*b},a.prototype.getPosn=function(){return(this.AD-this.AB)/this.A2},a}();c.PositionStats=e;var f=function(){function a(a,b,c,d){void 0===d&&(d=!1),this.left=a,this.right=b,this.gap=c,this.equality=d,this.active=!1,this.unsatisfiable=!1,this.left=a,this.right=b,this.gap=c,this.equality=d}return a.prototype.slack=function(){return this.unsatisfiable?Number.MAX_VALUE:this.right.scale*this.right.position()-this.gap-this.left.scale*this.left.position()},a}();c.Constraint=f;var g=function(){function a(a,b,c){void 0===b&&(b=1),void 0===c&&(c=1),this.desiredPosition=a,this.weight=b,this.scale=c,this.offset=0}return a.prototype.dfdv=function(){return 2*this.weight*(this.position()-this.desiredPosition)},a.prototype.position=function(){return(this.block.ps.scale*this.block.posn+this.offset)/this.scale},a.prototype.visitNeighbours=function(a,b){var c=function(c,d){return c.active&&a!==d&&b(c,d)};this.cOut.forEach(function(a){return c(a,a.right)}),this.cIn.forEach(function(a){return c(a,a.left)})},a}();c.Variable=g;var h=function(){function a(a){this.vars=[],a.offset=0,this.ps=new e(a.scale),this.addVariable(a)}return a.prototype.addVariable=function(a){a.block=this,this.vars.push(a),this.ps.addVariable(a),this.posn=this.ps.getPosn()},a.prototype.updateWeightedPosition=function(){this.ps.AB=this.ps.AD=this.ps.A2=0;for(var a=0,b=this.vars.length;a<b;++a)this.ps.addVariable(this.vars[a]);this.posn=this.ps.getPosn()},a.prototype.compute_lm=function(a,b,c){var d=this,e=a.dfdv();return a.visitNeighbours(b,function(b,f){var g=d.compute_lm(f,a,c);f===b.right?(e+=g*b.left.scale,b.lm=g):(e+=g*b.right.scale,b.lm=-g),c(b)}),e/a.scale},a.prototype.populateSplitBlock=function(a,b){var c=this;a.visitNeighbours(b,function(b,d){d.offset=a.offset+(d===b.right?b.gap:-b.gap),c.addVariable(d),c.populateSplitBlock(d,a)})},a.prototype.traverse=function(a,b,c,d){var e=this;void 0===c&&(c=this.vars[0]),void 0===d&&(d=null),c.visitNeighbours(d,function(d,f){b.push(a(d)),e.traverse(a,b,f,c)})},a.prototype.findMinLM=function(){var a=null;return this.compute_lm(this.vars[0],null,function(b){!b.equality&&(null===a||b.lm<a.lm)&&(a=b)}),a},a.prototype.findMinLMBetween=function(a,b){this.compute_lm(a,null,function(){});var c=null;return this.findPath(a,null,b,function(a,b){!a.equality&&a.right===b&&(null===c||a.lm<c.lm)&&(c=a)}),c},a.prototype.findPath=function(a,b,c,d){var e=this,f=!1;return a.visitNeighbours(b,function(b,g){f||g!==c&&!e.findPath(g,a,c,d)||(f=!0,d(b,g))}),f},a.prototype.isActiveDirectedPathBetween=function(a,b){if(a===b)return!0;for(var c=a.cOut.length;c--;){var d=a.cOut[c];if(d.active&&this.isActiveDirectedPathBetween(d.right,b))return!0}return!1},a.split=function(b){return b.active=!1,[a.createSplitBlock(b.left),a.createSplitBlock(b.right)]},a.createSplitBlock=function(b){var c=new a(b);return c.populateSplitBlock(b,null),c},a.prototype.splitBetween=function(b,c){var d=this.findMinLMBetween(b,c);if(null!==d){var e=a.split(d);return{constraint:d,lb:e[0],rb:e[1]}}return null},a.prototype.mergeAcross=function(a,b,c){b.active=!0;for(var d=0,e=a.vars.length;d<e;++d){var f=a.vars[d];f.offset+=c,this.addVariable(f)}this.posn=this.ps.getPosn()},a.prototype.cost=function(){for(var a=0,b=this.vars.length;b--;){var c=this.vars[b],d=c.position()-c.desiredPosition;a+=d*d*c.weight}return a},a}();c.Block=h;var i=function(){function a(a){this.vs=a;var b=a.length;for(this.list=new Array(b);b--;){var c=new h(a[b]);this.list[b]=c,c.blockInd=b}}return a.prototype.cost=function(){for(var a=0,b=this.list.length;b--;)a+=this.list[b].cost();return a},a.prototype.insert=function(a){a.blockInd=this.list.length,this.list.push(a)},a.prototype.remove=function(a){var b=this.list.length-1,c=this.list[b];this.list.length=b,a!==c&&(this.list[a.blockInd]=c,c.blockInd=a.blockInd)},a.prototype.merge=function(a){var b=a.left.block,c=a.right.block,d=a.right.offset-a.left.offset-a.gap;b.vars.length<c.vars.length?(c.mergeAcross(b,a,d),this.remove(b)):(b.mergeAcross(c,a,-d),this.remove(c))},a.prototype.forEach=function(a){this.list.forEach(a)},a.prototype.updateBlockPositions=function(){this.list.forEach(function(a){return a.updateWeightedPosition()})},a.prototype.split=function(a){var b=this;this.updateBlockPositions(),this.list.forEach(function(c){var d=c.findMinLM();null!==d&&d.lm<j.LAGRANGIAN_TOLERANCE&&(c=d.left.block,h.split(d).forEach(function(a){return b.insert(a)}),b.remove(c),a.push(d))})},a}();c.Blocks=i;var j=function(){function a(a,b){this.vs=a,this.cs=b,this.vs=a,a.forEach(function(a){a.cIn=[],a.cOut=[]}),this.cs=b,b.forEach(function(a){a.left.cOut.push(a),a.right.cIn.push(a)}),this.inactive=b.map(function(a){return a.active=!1,a}),this.bs=null}return a.prototype.cost=function(){return this.bs.cost()},a.prototype.setStartingPositions=function(a){this.inactive=this.cs.map(function(a){return a.active=!1,a}),this.bs=new i(this.vs),this.bs.forEach(function(b,c){return b.posn=a[c]})},a.prototype.setDesiredPositions=function(a){this.vs.forEach(function(b,c){return b.desiredPosition=a[c]})},a.prototype.mostViolated=function(){for(var b=Number.MAX_VALUE,c=null,d=this.inactive,e=d.length,f=e,g=0;g<e;++g){var h=d[g];if(!h.unsatisfiable){var i=h.slack();if((h.equality||i<b)&&(b=i,c=h,f=g,h.equality))break}}return f!==e&&(b<a.ZERO_UPPERBOUND&&!c.active||c.equality)&&(d[f]=d[e-1],d.length=e-1),c},a.prototype.satisfy=function(){null==this.bs&&(this.bs=new i(this.vs)),this.bs.split(this.inactive);for(var b=null;(b=this.mostViolated())&&(b.equality||b.slack()<a.ZERO_UPPERBOUND&&!b.active);){var c=b.left.block;if(c!==b.right.block)this.bs.merge(b);else{if(c.isActiveDirectedPathBetween(b.right,b.left)){b.unsatisfiable=!0;continue}var d=c.splitBetween(b.left,b.right);if(null===d){b.unsatisfiable=!0;continue}this.bs.insert(d.lb),this.bs.insert(d.rb),this.bs.remove(c),this.inactive.push(d.constraint),b.slack()>=0?this.inactive.push(b):this.bs.merge(b)}}},a.prototype.solve=function(){this.satisfy();for(var a=Number.MAX_VALUE,b=this.bs.cost();Math.abs(a-b)>1e-4;)this.satisfy(),a=b,b=this.bs.cost();return b},a.LAGRANGIAN_TOLERANCE=-1e-4,a.ZERO_UPPERBOUND=-1e-10,a}();c.Solver=j,c.removeOverlapInOneDimension=d},{}]},{},[1])(1)}); +//# sourceMappingURL=cola.min.js.map \ No newline at end of file diff --git a/src/main/webapp/plugins/webcola/mxWebColaAdaptor.js b/src/main/webapp/plugins/webcola/mxWebColaAdaptor.js new file mode 100644 index 000000000..6cd200538 --- /dev/null +++ b/src/main/webapp/plugins/webcola/mxWebColaAdaptor.js @@ -0,0 +1,763 @@ +/** + * Copyright (c) 2006-2018, JGraph Ltd + * Copyright (c) 2006-2018, Gaudenz Alder + */ +/** + * Class: mxWebColaAdaptor + * + * Extends WebCola's cola object to act as both adaptor and layout in WebCola for mxGraph. + * + * Constructor: mxWebColaAdaptor + * + * Constructs a new WebCola-based adaptor for given mxGraph. + * + * Arguments: + * + * graph - <mxGraph> that contains the cells. + * dimension - <[]> array containing [width, height] of canvas in points + * movableVertices - <[]> IDs of vertices that are movable; if undefined all vertices are movable + * options - <{}> WebCola options for layout/adapter + * + **/ +var doNothing = function() + /** + * Empty method for default event handlers + */ +{ +} + +function mxWebColaAdaptor(graph, dimension, movableVertices, options) +/** + * Conatructs a WebCola adaptor for mxGraph + * @param graph mxGraph instance + * @param dimension array containing [width, height] of drawing canvas in points + * @param movableVertices set containing IDs of vertices that are movable; if undefined all vertices are movable + * @param options WebCola options for layout/adapter + * @constructor + */ +{ + this.graph = graph; + this.dimension = dimension; + if (typeof dimension === 'undefined') + { + this.dimension = [600, 600]; + } + var layoutResult = this.graphToLayout(graph, movableVertices); + this.nodes = layoutResult.nodes; + this.links = layoutResult.links; + this.groups = layoutResult.groups; + this.cellToNode = layoutResult.cellToNode; + this.isStopped = false; + this.options = {}; + // assign default values + for (var key in this.defaultValues) + { + this.options[key] = this.defaultValues[key]; + } + // if options were passed, override defaults for keys available in options + if (options != null) + { + for (var key in options) + { + this.options[key] = options[key]; + } + } +} + +// default layout options +mxWebColaAdaptor.prototype.defaultValues = { + doAnimations: true, // whether to show the layout as it's running + // doAnimations: false, // whether to show the layout as it's running + skipFrames: 1, // number of ticks per frame; higher is faster but more jerky + maxSimulationTime: 4000, // max length in ms to run the layout + ungrabifyWhileSimulating: false, // so you can't drag nodes during layout + fit: true, // on every layout reposition of nodes, fit the viewport + padding: 30, // padding around the simulation + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + nodeDimensionsIncludeLabels: false, // whether labels should be included in determining the space used by a node + + // layout event callbacks + ready: function ready() {}, // on layoutready + stop: function stop() {}, // on layoutstop + + // positioning options + randomize: false, // use random node positions at beginning of layout + avoidOverlap: true, // if true, prevents overlap of node bounding boxes + handleDisconnected: true, // if true, avoids disconnected components from overlapping + nodeSpacing: function nodeSpacing(node) { + return 10; + }, // extra spacing around nodes + flow: undefined, // use DAG/tree flow layout if specified, e.g. { axis: 'y', minSeparation: 30 } + alignment: undefined, // relative alignment constraints on nodes, e.g. function( node ){ return { x: 0, y: 1 } } + gapInequalities: undefined, // list of inequality constraints for the gap between the nodes, e.g. [{"axis":"y", "left":node1, "right":node2, "gap":25}] + + // different methods of specifying edge length + // each can be a constant numerical value or a function like `function( edge ){ return 2; }` + edgeLength: undefined, // sets edge length directly in simulation + edgeSymDiffLength: undefined, // symmetric diff edge length in simulation + edgeJaccardLength: undefined, // jaccard edge length in simulation + + // iterations of cola algorithm; uses default values on undefined + unconstrIter: undefined, // unconstrained initial layout iterations + userConstIter: undefined, // initial layout iterations with user-specified constraints + allConstIter: undefined, // initial layout iterations with all constraints including non-overlap + + // infinite layout options + keepRunning: false // overrides all other options for a forces-all-the-time mode +}; + +mxWebColaAdaptor.prototype.updatePositions = function() + /** + * Default method for updating positions + * Should be overridden by the caller/user of the adaptor + */ +{ + console.log("colaAdaptor: updatePositions"); + // TODO: do all the positions here +} + +mxWebColaAdaptor.prototype.kick = function (colaAdaptor) +/** + * Starts WebCola computation on the given adaptor + */ +{ + console.log("colaAdaptor: step"); + + if ('doAnimations' in this.options && this.options.doAnimations) + { + doRendering(this.callback); + } + else + { + // run until the end + while (!this.process(colaAdaptor)) + { + } + } +} + +mxWebColaAdaptor.prototype.step = function (colaAdaptor) +/** + * Notifies about a single layout computation step on WebCola adaptor + */ +{ + if ('doAnimations' in this.options && this.options.doAnimations) + { + this.updatePositions(); + } +} + +mxWebColaAdaptor.prototype.frameSteps = function(colaAdaptor) +/** + * Runs multiple ticks on WebCola adaptor until finished + */ +{ + var result = void 0; + + for (var i = 0; i < this.options.skipFrames && !result; i++) { + result = result || this.process(colaAdaptor); + } + return result; +} + +mxWebColaAdaptor.prototype.process = function(colaAdaptor) +/** + * Executes the whole layout computation on WebCola adaptor + */ +{ + if (this.isStopped) + { + this.finish(); + return true; + } + var result = colaAdaptor.tick(); + if (result && this.options.keepRunning) { + colaAdaptor.resume(); + } + return result; +} + +mxWebColaAdaptor.prototype.renderingChain = function(colaAdaptor) +/** + * This keeps rendering new simulation frames until end is reached + */ +{ + if (this.process(colaAdaptor)) + { + return; + } + doRendering(this.callback); +} + +mxWebColaAdaptor.prototype.finish = function() +{ + +} + +mxWebColaAdaptor.prototype.run = function() + /** + * Runs the layout computation on given nodes/links/groups + * @returns Nothing + */ +{ + var layout = this; + var options = this.options; + + var colaAdaptor = layout.adaptor = cola.adaptor + ({ + trigger: function (evt) + { + var START = cola.EventType ? cola.EventType.start : 'start'; + var TICK = cola.EventType ? cola.EventType.tick : 'tick'; + var END = cola.EventType ? cola.EventType.end : 'end'; + + switch (evt.type) + { + case START: + { + // colaAdaptor.start(); + } + break; + case TICK: + { + layout.step(); + } + break; + case END: + { + console.log("colaAdaptor: end"); + layout.updatePositions(); + if (!options.keepRunning) + { + layout.finish(); + } + } + break; + } + }, + + kick: function () + { + layout.kick(colaAdaptor); + }, + + finish: function() + { + layout.finish(); + }, + + on: doNothing, + + drag: doNothing + }); + + colaAdaptor.nodes(this.nodes) + .links(this.links) + .groups(this.groups) + .linkDistance(function (link) + { + return link.length; + }); + + layout.callback = function() + { + layout.renderingChain(colaAdaptor); + } + + colaAdaptor.avoidOverlaps(options.avoidOverlap) + .handleDisconnected(options.handleDisconnected) + // .constraints(constraints) + // .start(100, 100, 100); + .start(); + return this.adaptor; +} + +// module.exports = defaultValues; + +function getScreenConstraints(layout, width, height) +/** + * Returns a set of constraints covering limits of screen + * @param layout + * @param width + * @param height + * @returns {Array} + */ +{ + var gap = 20; + var size = layout._nodes.length; + var topLeft = {x: 0, y: 0, fixed: true, index: size}; + var bottomRight = {x: width, y: height, fixed: true, index: size + 1}; + layout._nodes.push(topLeft); + layout._nodes.push(bottomRight); + var constraints = []; + for (var i = 0; i < size; i++) { + var index = layout._nodes[i].index; + constraints.push({ axis: 'x', type: 'separation', left: topLeft.index, right: index, gap: gap }); + constraints.push({ axis: 'y', type: 'separation', left: topLeft.index, right: index, gap: gap }); + constraints.push({ axis: 'x', type: 'separation', left: index, right: bottomRight.index, gap: gap }); + constraints.push({ axis: 'y', type: 'separation', left: index, right: bottomRight.index, gap: gap }); + } + return constraints; +} + +mxWebColaAdaptor.prototype.graphToLayout = function(graph, movableVertices) +/** + * Returns a WebCola layout set up for the given Draw.io graph + * In WebCola's TypeScript source: vertex cell -> InputNode + * edge cell -> Link + * parent/child -> Group + * @param graph Draw.io graph object + * @param fixedVertices Vertices that shouldn't be moved (dictionary with {id: True} pairs, id is vertex id) + * optional, if undefined all vertices are considered movable + * @returns list of WebCola nodes, list of WebCola links, and a dictionary from Draw.io cell ID to WebCola node ID + * returned as a dictionary: {nodes: ..., links: ..., cellToNode: ...} + */ +{ + var activeMaps = this.findActiveVertices(graph); // list of all active vertices, i.e. with no collapsed parents + var activeVertices = activeMaps.activeVertices; // inactive vertex to its nearest active parent map + var inactiveToActiveMap = activeMaps.inactiveToActiveMap; + var cells = graph.getModel().cells; + var view = graph.getView(); + var nodeCells = {}; + var linkCells = {}; + var cellIds = {}; + var edgeIds = {}; + var colaId = 0; + var nodes = []; + var links = []; + // process nodes first + for (var id in cells) + { + var cell = cells[id]; + var state = view.getState(cell); + var bounds = view.getBoundingBox(state, true); + var isFirst = true; + // if (cell.isVertex() && this.isLeafOrCollapsed(cell)) { + // only active vertices should be considered (i.e. not hidden by a collapsed or layouted vertex) + // if (cell.isVertex() && activeVertices[cell.id]) + if (cell.isVertex() && this.isLeafOrCollapsed(cell) && activeVertices[cell.id]) + { + var node = {}; + // node.x = bounds.getCenterX(); + // node.y = bounds.getCenterY(); + node.width = bounds.width; + node.height = bounds.height; + node.index = colaId; + node.name = cell.value; + node.fixed = false; + if (typeof movableVertices !== 'undefined' && !(id in movableVertices)) + { + node.fixed = true; + } + nodes.push(node); + cellIds[id] = colaId; + nodeCells[colaId] = cell; + colaId++; + } + } + // now edges can be processed as well + for (var id in cells) + { + var cell = cells[id]; + var state = view.getState(cell); + if (cell.isEdge()) + { + // attach edges to lowest active vertex corresponding to each of their terminals + var terminal_id1 = inactiveToActiveMap[cell.source.id]; + var terminal_id2 = inactiveToActiveMap[cell.target.id]; + if (terminal_id1 == terminal_id2) + { + // both terminals are under the same active parent, no need to make an invisible edge + continue; + } + // if either of terminals are groups, we need to insert complete graph between nodes within these groups + var terminal1 = cells[terminal_id1]; + var terminal2 = cells[terminal_id2]; + var addedLinks = []; + if (this.isGroup(terminal1) || this.isGroup(terminal2)) + { + addedLinks = this.addGroupConstraintLinks(terminal1, terminal2, activeVertices, inactiveToActiveMap, cellIds); + } + else + { + // link = {} + // link.source = cellIds[cell.source.id]; + // link.target = cellIds[cell.target.id]; + var link = this.createLink(terminal_id1, terminal_id2, cellIds); + addedLinks.push(link); + } + for (var i = 0; i < addedLinks.length; i++) + { + var link = addedLinks[i]; + links.push(link); + edgeIds[cell] = id; + linkCells[link] = cell; + } + } + } + links = this.getUniqueLinks(links); + // finally, groups need to be extracted + // mxGraph.getCellsForGroup + // mxGraphModel.getChildCount + // mxGraph.getBoundsForGroup + // first, get all possible parents and their children + var groupParents = {}; + var directParentChildren = {}; + for (var id in cells) + { + var cell = cells[id]; + if (!cell.isVertex() || !this.isLeafOrCollapsed(cell)) + continue; + var parent = cell.getParent(); + if (parent.isVertex()) + { + groupParents[parent.id] = parent; + if (!(parent.id in directParentChildren)) + { + directParentChildren[parent.id] = {} + } + directParentChildren[parent.id][id] = cell; + } + } + // now go through all parents/children and build a group hierarchy for WebCola + var preliminaryGroups = []; + var groupId = 0; + var groupToParent = {} + for (var parentId in groupParents) + { + var parentChildren = directParentChildren[parentId]; + var groupNodes = [] + for (var childId in parentChildren) + { + if (activeVertices[childId]) + { + groupNodes.push(cellIds[childId]); + } + } + preliminaryGroups.push({id: groupId, parentId: parentId, nodes: parentChildren, leaves: groupNodes, groups: []}); + groupToParent[groupId] = parentId; + groupId++; + } + // here scan newly formed groups if their parent is a child of any of the nodes in any of the groups + for (var i = 0; i < preliminaryGroups.length; i++) + { + var parentGroup = preliminaryGroups[i]; + var parentId = parentGroup.parentId; + for (var j = 0; j < preliminaryGroups.length; j++) + { + if (i == j) + continue; + var groupParentId = cells[preliminaryGroups[j].parentId].getParent().id; + if (parentId == groupParentId) + parentGroup.groups.push(j); + } + } + // finalize groups + var groups = []; + for (var i = 0; i < preliminaryGroups.length; i++) + { + var group = preliminaryGroups[i]; + var graphGroup = {}; + if (group.leaves.length > 0) + { + graphGroup["leaves"] = group.leaves; + } + if (group.groups.length > 0) + { + graphGroup["groups"] = group.groups; + } + if (graphGroup.hasOwnProperty("leaves") || graphGroup.hasOwnProperty("groups")) + { + groups.push(graphGroup); + } + } + + return {nodes: nodes, links: links, groups: groups, cellToNode: cellIds}; +}; + +mxWebColaAdaptor.prototype.createLink = function(sourceId, targetId, cellIds) +{ + var link = {}; + link.source = cellIds[sourceId]; + link.target = cellIds[targetId]; + link.weight = 0.9; + link.length = 100; // TODO: replace with Graph.prototype.defaultEdgeLength; once integrated in draw.io + return link; +} + +mxWebColaAdaptor.prototype.isLeafOrCollapsed = function(cell) + /** + * Returns true if a cell is either a leaf or a collapsed group + * @param cell cell to investigate + * @returns true if a cell is either a leaf or a collapsed group, false otherwise + */ +{ + if (cell.isCollapsed() || + cell.children == null || cell.children.length == 0 || + typeof this.graph.getCellStyle(cell)['childLayout'] != 'undefined') + { + return true; + } + return false; +} + +mxWebColaAdaptor.prototype.findActiveVertices = function(graph) + /** + * Scans all groups and finds active vertices, as well as an inactive-vertex-to-active-parent map + * @param graph input graph + */ +{ + var inactiveToActiveMap = {}; + var activeVertices = {}; + var root = graph.getModel().root; + var cellsToExplore = [{vertex: root, isActive: true, activeParent: root}] + while (cellsToExplore.length > 0) + { + var currentCellInfo = cellsToExplore.shift(); + var cell = currentCellInfo.vertex; + if (cell.isEdge()) + { + // cut at edge group, those are ignored + continue; + } + var isActive = currentCellInfo.isActive; + var activeParent = currentCellInfo.activeParent; + if (cell.isVertex()) + { + if (isActive) + { + activeVertices[cell.id] = true; + } + else + { + activeVertices[cell.id] = false; + } + } + // prepare children + // child can be active only if any of its parents is not collapsed + var isActive = isActive && !this.isLeafOrCollapsed(cell); + var children = cell.children; + if (children != null && children.length > 0) + { + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + var childActiveParent = isActive? child: activeParent; + cellsToExplore.push({vertex: child, isActive: isActive, activeParent: childActiveParent}); + if (child.isVertex()) + { + inactiveToActiveMap[child.id] = childActiveParent.id; + } + } + } + } + return {activeVertices: activeVertices, inactiveToActiveMap: inactiveToActiveMap}; +} + +mxWebColaAdaptor.prototype.getActiveVerticesInGroup = function(groupCell, activeVertices, includeCollapsedGroups) + /** + * Scans all children in group and returns all active vertices inside group + * This method is for creating redundant edges between members of groups to simulate group edges in WebCola + * See https://github.com/tgdwyer/WebCola/issues/38 + * @param groupCell group cell + */ +{ + var activeChildren = []; + if (includeCollapsedGroups && this.isLeafOrCollapsed(groupCell)) + { + activeChildren.push(groupCell); + } + var cellsToExplore = [groupCell]; + while (cellsToExplore.length > 0) + { + var cell = cellsToExplore.shift(); + if (!cell.isVertex() || !activeVertices[cell]) + { + // cut at edge group, those are ignored + continue; + } + if (this.isLeafOrCollapsed(cell)) + { + activeChildren.push(cell); + } + else + { + var children = cell.children; + if (children == null || children.length == 0) + { + continue; + } + cellsToExplore = cellsToExplore.concat(children); + } + } + return activeChildren; +} + +mxWebColaAdaptor.prototype.getAllVerticesInGroup = function(groupCell, includeCollapsedGroups) + /** + * Scans all children in group and returns all active vertices inside group + * This method is for creating redundant edges between members of groups to simulate group edges in WebCola + * See https://github.com/tgdwyer/WebCola/issues/38 + * @param groupCell group cell + */ +{ + var result = []; + if (includeCollapsedGroups && this.isLeafOrCollapsed(groupCell)) + { + result.push(groupCell); + } + var cellsToExplore = [groupCell]; + while (cellsToExplore.length > 0) + { + var cell = cellsToExplore.shift(); + if (!cell.isVertex()) + { + // cut at edge group, those are ignored + continue; + } + if (this.isLeafOrCollapsed(cell)) + { + result.push(cell); + } + else + { + var children = cell.children; + if (children == null || children.length == 0) + { + continue; + } + cellsToExplore = cellsToExplore.concat(children); + } + } + return result; +} + +mxWebColaAdaptor.prototype.hasVertexChildren = function(cell) + /** + * Returns true if a (group) cell has vertex children in its subtree + * @param cell (group) cell + * @returns true if if a (group) cell has vertex children in its subtree, false otherwise + */ +{ + if (cell.children == null || cell.children.length == 0) + { + return false; + } + var toBeExamined = [] + toBeExamined = toBeExamined.concat(cell.children); + while (toBeExamined.length > 0) + { + var cell = toBeExamined.shift(); + if (cell.isVertex()) + return true; + if (cell.children != null && cell.children.length > 0) + { + toBeExamined = toBeExamined.concat(cell.children); + } + } + return false; +} + +mxWebColaAdaptor.prototype.isInCollapsedTree = function(cell) +{ + // scan the material path for collapsed group node + while (cell != null) + { + cell = cell.getParent(); + if (cell != null && cell.isCollapsed()) + { + return true; + } + } + return false; +} + +mxWebColaAdaptor.prototype.isGroup = function(cell) + /** + * Returns true if cell is a group (has children) + * @param cell cell + * @returns true if cell is a group (has children); false otherwise + */ +{ + return cell.children != null && cell.children.length > 0; +} + +mxWebColaAdaptor.prototype.addGroupConstraintLinks = function(groupA, groupB, activeVertices, inactiveToActiveMap, cellIds) + /** + * Adds edges between vertex and group or two groups. Each vertex child of a group must be connected to the vertex/ + * group, as this way WebCola simulates edges on the group level (as groups don't exist as vertices in WebCola) + * @param rootCell root cell + */ +{ + var result = [] + // var childrenA = this.getActiveVerticesInGroup(groupA, activeVertices, false); + // var childrenB = this.getActiveVerticesInGroup(groupB, activeVertices, false); + var childrenA = [groupA]; + var childrenB = [groupB]; + if (!groupA.isCollapsed()) + { + childrenA = this.getAllVerticesInGroup(groupA, activeVertices, false); + } + if (!groupB.isCollapsed()) + { + childrenB = this.getAllVerticesInGroup(groupB, activeVertices, false); + } + if (childrenA == null || childrenA.length == 0 || childrenB == null || childrenB.length == 0) + return result; + for (var i = 0; i < childrenA.length; i++) + { + var childA_Id = inactiveToActiveMap[childrenA[i].id]; + for (var j = 0; j < childrenB.length; j++) + { + var childB_Id = inactiveToActiveMap[childrenB[j].id]; + var link = this.createLink(childA_Id, childB_Id, cellIds); + result.push(link); + } + } + return result; +} + +mxWebColaAdaptor.prototype.getUniqueLinks = function(links) + /** + * Returns an array of unique links from an array of links + * @param links array of links containing duplicate links + * @returns array of unique links + */ +{ + var result = []; + // TODO: this part is inefficient - O(n^2); Theta(n) should be possible with hashmap + for (var i = 0; i < links.length; i++) + { + var link = links[i]; + var shouldBeAdded = true; + for (var j = 0; j < result.length; j++) + { + var existingLink = result[j]; + if (link.source == existingLink.source && link.target == existingLink.target) + { + shouldBeAdded = false; + break; + } + } + if (shouldBeAdded) + { + result.push(link); + } + } + return result; +} + +var doRendering = void 0; + +if ((typeof window === "undefined" ? "undefined" : typeof(window)) !== ( true ? "undefined" : typeof(undefined))) +{ + doRendering = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame; +} +else +{ + // if not available, all you get is immediate calls + function doRendering(callback) + { + callback(); + }; +} diff --git a/src/main/webapp/plugins/webcola/mxWebColaLayout.js b/src/main/webapp/plugins/webcola/mxWebColaLayout.js new file mode 100644 index 000000000..c3fb07112 --- /dev/null +++ b/src/main/webapp/plugins/webcola/mxWebColaLayout.js @@ -0,0 +1,303 @@ +/** + * Copyright (c) 2006-2018, JGraph Ltd + * Copyright (c) 2006-2018, Gaudenz Alder + */ +/** + * Class: mxWebColaLayout + * + * Extends <mxGraphLayout> to implement a WebCola-based layout. + * + * Example: + * + * (code) + * var layout = new mxWebColaLayout(graph); + * layout.execute(graph.getDefaultParent()); + * (end) + * + * Constructor: mxWebColaLayout + * + * Constructs a new WebCola-based layout for the graph. + * + * Arguments: + * + * graph - <mxGraph> that contains the cells. + * + **/ +function mxWebColaLayout(graph, layoutType) +/** + * Constructs a WebCola-based layout + * @param graph <mxGraph> that contains the cells. + * @param layoutType Type of WebCola layout + */ +{ + mxGraphLayout.call(this, graph); + this.layoutType = layoutType; +}; + +mxWebColaLayout.prototype = new mxGraphLayout(); +mxWebColaLayout.prototype.constructor = mxWebColaLayout; + +mxWebColaLayout.prototype.layoutType = null; + +mxWebColaLayout.prototype.execute = function(parent) + /** + * Runs re-layouting of the portion of a graph from a given starting cell + * @param parent starting cell + */ +{ + var movableVertices = this.getReachableVertices(parent); + this.layout = new mxWebColaAdaptor(this.graph, [600, 600], movableVertices); + var self = this; + var update = function () { + console.log("mxColaLayout: update"); + self.updateGraph(); + }; + this.layout.updatePositions = update; + this.resetGraph(this.graph); + var finalLayout = this.computePositions(this.layout); +}; + +mxWebColaLayout.prototype.getReachableVertices = function(parent) + /*** + * Finds all vertices reachable from a given parent + * @param parent starting cell of a search + * @returns dictionary of vertice IDs that are reachable in the form of {id: True} + * if undefined is returned, it means parent was not provided and it should be interpreted as all vertices + * are reachable + */ +{ + if (parent == undefined) + return undefined; + // first, get all incidental edges in a sub-tree (or a connected component if with loops) + var edges = this.graph.getEdges(parent, null, true, true, true, true); + // now all vertices that are reachable are subject to change; unreachable should be fixed + var reachableVertices = void(0); + if (edges.length != 0) + { + var reachableVertices = {}; + for (var i = 0; i < edges.length; i++) + { + var edge = edges[i]; + reachableVertices[edge.source.id] = true; + reachableVertices[edge.target.id] = true; + } + } + // vertices connected by returned edges must be allowed to move, rest must be fixed in place + return reachableVertices; +} + +mxWebColaLayout.prototype.computePositions = function() + /** + * Executes layout to compute positions + */ +{ + return this.layout.run(); +} + +mxWebColaLayout.prototype.resetGraph = function(graph) + /** + * Resets initial vertex positions + */ +{ + var model = graph.getModel(); + var cells = model.cells; + var view = graph.getView(); + for (var id in cells) + { + var cell = cells[id]; + var state = view.getState(cell); + var bounds = view.getBoundingBox(state, true); + var isFirst = true; + if (cell.isVertex()) { + var geometry = model.getGeometry(cell); + if (geometry != null && typeof geometry != "undefined") + { + geometry = geometry.clone(); + geometry.offset = null; + model.setGeometry(cell, geometry); + } + } + } +} + +mxWebColaLayout.prototype.getGroupBounds = function(model, groupCell) + /** + * Computes bounds of a group as boundary encompassing all children of a group + * @param model graph model + * @param groupCell starting group + * @returns boundaries of all children inside a group + */ +{ + var minX = 1000000; + var minY = 1000000; + var maxX = -1000000; + var maxY = -1000000; + if (groupCell.children == null || groupCell.children.length == 0) + return null; + var cellsToVisit = []; + cellsToVisit = cellsToVisit.concat(groupCell.children); + while (cellsToVisit.length > 0) + { + var child = cellsToVisit.shift(); + if (child.isVertex()) + { + if (this.layout.isLeafOrCollapsed(child)) + { + var geometry = model.getGeometry(child); + if (geometry != null && typeof geometry != "undefined") + { + if (geometry.x < minX) + { + minX = geometry.x; + } + if (geometry.y < minY) + { + minY = geometry.y; + } + if (geometry.x + geometry.width > maxX) + { + maxX = geometry.x + geometry.width; + } + if (geometry.y + geometry.height > maxY) + { + maxY = geometry.y + geometry.height; + } + } + } + else + { + cellsToVisit = cellsToVisit.concat(child.children); + } + } + } + var bounds = model.getGeometry(groupCell).clone(); + bounds.x = minX; + bounds.y = minY; + bounds.width = maxX - minX; + bounds.height = maxY - minY; + return bounds; +} + +mxWebColaLayout.prototype.adjustChildOffsets = function(model, groupCell) + /** + * Adjusts offset of child vertices to be relative to parent groups + * @param model graph model + * @param groupCell starting group cell + */ +{ + if (groupCell.children == null || groupCell.children.length == 0) + return; + var groupBounds = model.getGeometry(groupCell); + var offsetX = groupBounds.x; + var offsetY = groupBounds.y; + var cellsToVisit = []; + cellsToVisit = cellsToVisit.concat(groupCell.children); + while (cellsToVisit.length > 0) + { + var child = cellsToVisit.shift(); + if (child.isVertex()) + { + if (this.layout.isLeafOrCollapsed(child)) + { + var geometry = model.getGeometry(child); + if (geometry != null && typeof geometry != "undefined") + { + geometry = geometry.clone(); + geometry.x = geometry.x - offsetX; + geometry.y = geometry.y - offsetY; + model.setGeometry(child, geometry); + } + } + else + { + cellsToVisit = cellsToVisit.concat(child.children); + } + } + } +} + +mxWebColaLayout.prototype.updateGraph = function() + /** + * Updates graph based on layout's vertex/group positions + */ +{ + console.log("updating graph"); + // find X, Y ranges first + var minX = 1000000; + var maxX = -1000000; + var minY = 1000000; + var maxY = -1000000; + + for (var i = 0; i < this.layout.adaptor._nodes.length; i++) + { + var node = this.layout.adaptor._nodes[i]; + var x = node.x; + var y = node.y; + minX = Math.min(minX, x); + minY = Math.min(minY, y); + maxX = Math.max(maxX, x); + maxY = Math.max(maxY, y); + } + + var spanX = maxX - minX; + var spanY = maxY - minY; + + var model = this.graph.getModel(); + model.beginUpdate(); + try + { + var cells = model.cells; + var view = this.graph.getView(); + // scan leaves and edges + for (var id in cells) + { + var cell = cells[id]; + var state = view.getState(cell); + var bounds = view.getBoundingBox(state, true); + if (cell.isVertex() && this.layout.isLeafOrCollapsed(cell)) + { + var nodeId = this.layout.cellToNode[id]; + if (typeof nodeId == "undefined") + continue; + var node = this.layout.adaptor._nodes[nodeId]; + var geometry = model.getGeometry(cell); + if (geometry != null && typeof geometry != "undefined") + { + geometry = geometry.clone(); + geometry.x = node.x - minX; + geometry.y = node.y - minY; + model.setGeometry(cell, geometry); + } + else + { + alert("vertex cell id:" + id + " has no geometry!"); + } + } + else if (cell.isEdge()) + { + this.graph.resetEdge(cell); + } + } + // scan groups + for (var id in cells) + { + var cell = cells[id]; + var state = view.getState(cell); + var bounds = view.getBoundingBox(state, true); + if (cell.isVertex() && !this.layout.isLeafOrCollapsed(cell)) + { + var bounds = this.getGroupBounds(model, cell); + if (bounds != null && typeof bounds != "undefined") + { + model.setGeometry(cell, bounds); + this.adjustChildOffsets(model, cell); + } + } + } + } + finally + { + model.endUpdate(); + } + +} diff --git a/src/main/webapp/plugins/webcola/webcola.js b/src/main/webapp/plugins/webcola/webcola.js new file mode 100644 index 000000000..4d75d3fc3 --- /dev/null +++ b/src/main/webapp/plugins/webcola/webcola.js @@ -0,0 +1,31 @@ +/** + * WebCola layout plugin. + */ +Draw.loadPlugin(function(ui) +{ + mxscript("js/diagramly/plugins/webcola/cola.min.js"); + mxscript("js/diagramly/plugins/webcola/mxWebColaAdaptor.js"); + mxscript("js/diagramly/plugins/webcola/mxWebColaLayout.js"); + + // Adds resource for action + mxResources.parse('webColaLayout=WebCola Layout...'); + + // Adds action + ui.actions.addAction('Apply WebCola layout', function() + { + var graph = ui.editor.graph; + var layout = mxWebColaLayout(graph); + var parent = graph.getDefaultParent(); + layout.execute(parent); + }); + + var menu = ui.menus.get('extras'); + var oldFunct = menu.funct; + + menu.funct = function(menu, parent) + { + oldFunct.apply(this, arguments); + + ui.menus.addMenuItems(menu, ['-', 'webColaLayout'], parent); + }; +}); -- GitLab