Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jgraph/drawio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benson [draw.io] <david@jgraph.com>2019-10-23 16:35:35 +0300
committerDavid Benson [draw.io] <david@jgraph.com>2019-10-23 16:35:35 +0300
commitd42ae42d6cdd2a18a64245df439a3723b2b3f612 (patch)
tree8e4e4e68c9075d6e83de9c86a5af0bdca47d7e7c
parent79b858eb0b7534021e042b510ffa90c59b9a1537 (diff)
12.1.4 releasev12.1.4
-rw-r--r--ChangeLog8
-rw-r--r--VERSION2
-rw-r--r--etc/docker/README.md73
-rw-r--r--etc/mxgraph/mxClient.js16
-rw-r--r--src/main/java/com/mxgraph/io/gliffy/importer/GliffyDiagramConverter.java25
-rw-r--r--src/main/webapp/cache.manifest2
-rw-r--r--src/main/webapp/export3.html26
-rw-r--r--src/main/webapp/js/app.min.js2602
-rw-r--r--src/main/webapp/js/diagramly/Dialogs.js214
-rw-r--r--src/main/webapp/js/diagramly/DriveFile.js5
-rw-r--r--src/main/webapp/js/diagramly/EditorUi.js41
-rw-r--r--src/main/webapp/js/diagramly/GitHubClient.js112
-rw-r--r--src/main/webapp/js/diagramly/GitLabClient.js112
-rw-r--r--src/main/webapp/js/diagramly/GraphViewer.js65
-rw-r--r--src/main/webapp/js/viewer.min.js2430
-rw-r--r--src/main/webapp/plugins/cConf-1-4-8.js89
-rw-r--r--src/main/webapp/resources/dia_ro.txt14
-rw-r--r--src/main/webapp/styles/grapheditor.css44
18 files changed, 3212 insertions, 2668 deletions
diff --git a/ChangeLog b/ChangeLog
index fc1c04c6..2d1253e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+23-OCT-2019: 12.1.4
+
+- Fixes scrollbars in Confluence Diagram Viewer
+- Fixes embed dialog for Google Shared Drives
+- Fixes snap to grid while panning
+- Adds paging for GitLab picker
+- Uses mxGraph 4.0.6 beta 1
+
17-OCT-2019: 12.1.3
- Fixes Google Drive auth in Office plugin
diff --git a/VERSION b/VERSION
index 846602d8..d7df41de 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-12.1.3 \ No newline at end of file
+12.1.4 \ No newline at end of file
diff --git a/etc/docker/README.md b/etc/docker/README.md
index 8768ef18..5d0a2e50 100644
--- a/etc/docker/README.md
+++ b/etc/docker/README.md
@@ -1,58 +1,38 @@
-This guide is based on fjudith/draw.io docker image [docker-draw.io repository](https://github.com/jgraph/docker-draw.io)
+Our collection of docker images and docker-compose files are in [jgraph/docker-drawio repository](https://github.com/jgraph/docker-drawio)
-#HTTPS SSL Certificate via Let's Encrypt
+In that repository:
-###Prerequisites:
+* draw.io docker image that is always up-to-date with draw.io releases
+* draw.io export server image which allow exporting draw.io diagrams to pdf and images
+* docker-compose to run draw.io with the export server
+* docker-compose to run draw.io integrated within nextcloud
+* docker-compose to run draw.io with PlantUML support
+* docker-compose to run draw.io self-contained without any dependency on draw.io website (with the export server, plantUml, Google Drive support, OneDrive support, and EMF conversion support (for VSDX export)
-1. A Linux machine connected to the Internet with ports 443 and 80 open
-1. A domain/subdomain name pointing to this machine's IP address. (e.g., drawio.example.com)
-
-###Method:
-
-1. Using fjudith/draw.io docker image, run the following command
-`docker run -it -m1g -e LETS_ENCRYPT_ENABLED=true -e PUBLIC_DNS=drawio.example.com --rm --name="draw" -p 80:80 -p 443:8443 fjudith/draw.io`
-Notice that mapping port 80 to container's port 80 allows certbot to work in stand-alone mode. Mapping port 443 to container's port 8443 allows the container tomcat to serve https requests directly.
-
-#Updating draw.io in a running container
-
-##Method 1 (Using the host machine to build draw.io):
-
-###Prerequisites:
-1. Host machine must have wget, unzip and ant installed
-1. Assumptions: docker container is named 'draw' and $CATALINA_HOME in the container is '/usr/local/tomcat/'
+# HTTPS SSL Certificate via Let's Encrypt
-###Method:
+### Prerequisites:
-1. `wget https://github.com/jgraph/draw.io/archive/v{$version}.zip` For example, `wget https://github.com/jgraph/draw.io/archive/v11.2.9.zip`
-1. `unzip v11.2.9.zip`
-1. `cd drawio-11.2.9/etc/build/`
-1. `ant war`
-1. `cd ../../build/`
-1. `unzip draw.war -d draw`
-1. `docker cp draw draw:/usr/local/tomcat/webapps/`
-
-##Method 2 (build a new docker image with the new version)
+1. A Linux machine connected to the Internet with ports 443 and 80 open
+1. A domain/subdomain name pointing to this machine's IP address. (e.g., drawio.example.com)
-1. Download the VERSION file to get the latest draw.io version `wget https://raw.githubusercontent.com/jgraph/drawio/master/VERSION`
-1. Build the new docker image `docker build --build-arg VERSION=&#96;cat VERSION&#96; -t fjudith/draw.io .`
-1. Run the new image instead of the old one
+### Method:
-#Changing draw.io configuration
+1. Using jgraph/drawio docker image, run the following command
+`docker run -it -m1g -e LETS_ENCRYPT_ENABLED=true -e PUBLIC_DNS=drawio.example.com --rm --name="draw" -p 80:80 -p 443:8443 jgraph/drawio`
+Notice that mapping port 80 to container's port 80 allows certbot to work in stand-alone mode. Mapping port 443 to container's port 8443 allows the container tomcat to serve https requests directly.
-##Method 1 (Build you custom image with setting pre-loaded)
+# Changing draw.io configuration
-1. Create you PreConfig.js & PostConfig.js files using templates found in ⁨src⁩/⁨main⁩/⁨webapp⁩/⁨js⁩/PreConfig.js & PostConfig.js
-1. Add your configuration files (PreConfig.js & PostConfig.js) next to Dockerfile
-1. Add the following line after line 7 in Dockerfile
+## Method 1 (Build you custom image with setting pre-loaded)
-```
-COPY PreConfig.js PostConfig.js $CATALINA_HOME/webapps/draw/js/
-```
+1. Edit PreConfig.js & PostConfig.js files (next to Dockerfile in debian or alpine folders)
+1. Build the docker image
-##Method 2 (Using existing running docker container)
+## Method 2 (Using existing running docker container)
-1. Create you PreConfig.js & PostConfig.js files using templates found in ⁨src⁩/⁨main⁩/⁨webapp⁩/⁨js⁩/PreConfig.js & PostConfig.js
+1. Edit PreConfig.js & PostConfig.js files (next to Dockerfile in debian or alpine folders)
1. Copy these files to docker container
```
@@ -60,17 +40,14 @@ docker cp PreConfig.js draw:/usr/local/tomcat/webapps/draw/js/
docker cp PostConfig.js draw:/usr/local/tomcat/webapps/draw/js/
```
-##Method 3 (Bind configuration files into the container when started)
+## Method 3 (Bind configuration files into the container when started)
1. This method allows changing the configuration files directly on the host without invoking any other docker commands. It can be used for testing
-1. Create you PreConfig.js & PostConfig.js files using templates found in ⁨src⁩/⁨main⁩/⁨webapp⁩/⁨js⁩/PreConfig.js & PostConfig.js
+1. Edit PreConfig.js & PostConfig.js files (next to Dockerfile in debian or alpine folders)
1. From within the directory that contained the configuration files, run the following command to start docker container
+1. Note: self-contained docker-compose file already mount the configuration files into the container
```
docker run -it --rm --name="draw" --mount type=bind,source="$(pwd)"/PreConfig.js,target=/usr/local/tomcat/webapps/draw/js/PreConfig.js --mount type=bind,source="$(pwd)"/PostConfig.js,target=/usr/local/tomcat/webapps/draw/js/PostConfig.js -p 8080:8080 -p 8443:8443 fjudith/draw.io
```
-#draw.io with local export server
-
-Use the docker image from `drawio-export` folder. This image is much larger since it requires Node.js in addition to Puppeteer (which requires many dependencies similar to Chromium)
-
diff --git a/etc/mxgraph/mxClient.js b/etc/mxgraph/mxClient.js
index b0abe3ad..a6d6aa2b 100644
--- a/etc/mxgraph/mxClient.js
+++ b/etc/mxgraph/mxClient.js
@@ -1,4 +1,4 @@
-var mxClient={VERSION:"4.0.5",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")&&
+var mxClient={VERSION:"4.0.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")&&
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_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg",
@@ -1368,7 +1368,7 @@ mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=nul
function mxGraphHandler(a){this.graph=a;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,function(){this.updatePreview();this.updateHint()});this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,function(a,c){this.reset()});this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,function(a,c){if(null!=this.first)try{this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),
this.updatePreview(!0),window.setTimeout(mxUtils.bind(this,function(){this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.cells,!1),this.updatePreview())}),0)}catch(d){this.reset()}});this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50;mxGraphHandler.prototype.enabled=!0;mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;
mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;mxGraphHandler.prototype.removeEmptyParents=!1;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;mxGraphHandler.prototype.minimumSize=6;
-mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};
+mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};
mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};
mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a};mxGraphHandler.prototype.getInitialCellForEvent=function(a){return a.getCell()};mxGraphHandler.prototype.isDelayedSelection=function(a,b){return this.graph.isCellSelected(a)};mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()};
mxGraphHandler.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=b.getState()&&!mxEvent.isMultiTouchEvent(b.getEvent())){var c=this.getInitialCellForEvent(b);this.delayedSelection=this.isDelayedSelection(c,b);this.cell=null;this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(c,b.getEvent());if(this.isMoveEnabled()){var d=this.graph.model,e=d.getGeometry(c);this.graph.isCellMovable(c)&&(!d.isEdge(c)||1<this.graph.getSelectionCount()||
@@ -1380,14 +1380,14 @@ mxGraphHandler.prototype.createPreviewShape=function(a){a=new mxRectangleShape(a
mxGraphHandler.prototype.start=function(a,b,c){this.cell=a;this.first=mxUtils.convertPoint(this.graph.container,b,c);this.cells=this.getCells(this.cell);this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);this.allCells=new mxDictionary;this.cloning=!1;for(b=this.cellCount=0;b<this.cells.length;b++)this.cellCount+=this.addStates(this.cells[b],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var d=this.graph.model.getParent(a),
e=2>this.graph.model.getChildCount(d);this.guide.isStateIgnored=mxUtils.bind(this,function(a){var b=this.graph.model.getParent(a.cell);return!this.cloning&&this.isCellMoving(a.cell)||a.cell!=(this.target||d)&&!e&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&b!=(this.target||d)})}};
mxGraphHandler.prototype.addStates=function(a,b){var c=this.graph.view.getState(a),d=0;if(null!=c&&null==b.get(a)){b.put(a,c);d++;for(var c=this.graph.model.getChildCount(a),e=0;e<c;e++)d+=this.addStates(this.graph.model.getChildAt(a,e),b)}return d};mxGraphHandler.prototype.isCellMoving=function(a){return null!=this.allCells.get(a)};mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent()):!0};
-mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());var b=this.graph.view.scale;return new mxPoint(this.roundLength((a.x-this.first.x)/b)*b,this.roundLength((a.y-this.first.y)/b)*b)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){};
-mxGraphHandler.prototype.roundLength=function(a){return Math.round(2*a)/2};
+mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());var b=this.graph.view.scale;return new mxPoint(this.roundLength((a.x-this.first.x-this.graph.panDx)/b)*b,this.roundLength((a.y-this.first.y-this.graph.panDy)/b)*b)};mxGraphHandler.prototype.updateHint=function(a){};
+mxGraphHandler.prototype.removeHint=function(){};mxGraphHandler.prototype.roundLength=function(a){return Math.round(2*a)/2};
mxGraphHandler.prototype.mouseMove=function(a,b){var c=this.graph;if(!b.isConsumed()&&c.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds)if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{var d=this.getDelta(b),e=d.x,d=d.y,f=c.tolerance;if(null!=this.shape||this.livePreviewActive||Math.abs(e)>f||Math.abs(d)>f){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var g=c.isCloneEvent(b.getEvent())&&c.isCellsCloneable()&&this.isCloneEnabled(),
-k=c.isGridEnabledEvent(b.getEvent()),f=!0;this.cloning=g;var l=null,m=b.getCell();c.isDropEnabled()&&this.highlightEnabled&&(l=c.getDropTarget(this.cells,b.getEvent(),m,g));var n=c.getView().getState(l),p=!1;null==n||c.model.getParent(this.cell)==l&&!g?(this.target=null,this.connectOnDrop&&null!=m&&1==this.cells.length&&c.getModel().isVertex(m)&&c.isCellConnectable(m)&&(n=c.getView().getState(m),null!=n&&(l=null==c.getEdgeValidationError(null,this.cell,m)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,
-this.setHighlightColor(l),p=!0))):(this.target!=l&&(this.target=l,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0);null!=n&&p?this.highlight.highlight(n):this.highlight.hide();this.livePreviewActive&&g?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&mxClient.IS_SVG?(this.setHandlesVisibleForCells(this.cells,!1),this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds));
+k=c.isGridEnabledEvent(b.getEvent()),l=b.getCell(),f=!0,m=null;this.cloning=g;c.isDropEnabled()&&this.highlightEnabled&&(m=c.getDropTarget(this.cells,b.getEvent(),l,g));var n=c.getView().getState(m),p=!1;null==n||c.model.getParent(this.cell)==m&&!g?(this.target=null,this.connectOnDrop&&null!=l&&1==this.cells.length&&c.getModel().isVertex(l)&&c.isCellConnectable(l)&&(n=c.getView().getState(l),null!=n&&(l=null==c.getEdgeValidationError(null,this.cell,l)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,
+this.setHighlightColor(l),p=!0))):(this.target!=m&&(this.target=m,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0);null!=n&&p?this.highlight.highlight(n):this.highlight.hide();this.livePreviewActive&&g?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?(this.setHandlesVisibleForCells(this.cells,!1),this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds));
null!=this.guide&&this.useGuidesForEvent(b)?(d=this.guide.move(this.bounds,new mxPoint(e,d),k,g),f=!1,e=d.x,d=d.y):k&&(k=c.getView().translate,n=c.getView().scale,g=this.bounds.x-(c.snap(this.bounds.x/n-k.x)+k.x)*n,k=this.bounds.y-(c.snap(this.bounds.y/n-k.y)+k.y)*n,d=this.snap(new mxPoint(e,d)),e=d.x-g,d=d.y-k);null!=this.guide&&f&&this.guide.hide();c.isConstrainedEvent(b.getEvent())&&(Math.abs(e)>Math.abs(d)?d=0:e=0);this.currentDx=e;this.currentDy=d;this.updatePreview()}this.updateHint(b);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,
b);mxEvent.consume(b.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||b.isConsumed()||null==b.getState()&&null==b.sourceState||c.isMouseDown||(e=c.getCursorForMouseEvent(b),null==e&&c.isEnabled()&&c.isCellMovable(b.getCell())&&(e=c.getModel().isEdge(b.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=e&&null!=b.sourceState&&b.sourceState.setCursor(e))};
-mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&this.updateLivePreview(this.currentDx-this.graph.panDx,this.currentDy-this.graph.panDy):this.updatePreviewShape()};mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};
+mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&this.updateLivePreview(this.currentDx,this.currentDy):this.updatePreviewShape()};mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};
mxGraphHandler.prototype.updateLivePreview=function(a,b){var c=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,function(d,e){var f=e.clone();c.push([e,f]);null!=e.shape&&(null==e.shape.originalPointerEvents&&(e.shape.originalPointerEvents=e.shape.pointerEvents),e.shape.pointerEvents=!1,null!=e.text&&null!=e.text.node&&(f=e.text.node,null!=f.firstChild&&null!=f.firstChild.firstChild&&"foreignObject"==f.firstChild.firstChild.nodeName?f.firstChild.firstChild.setAttribute("pointer-events",
"none"):null!=f.ownerSVGElement?f.setAttribute("pointer-events","none"):f.style.pointerEvents="none"));this.graph.model.isVertex(e.cell)&&(e.x+=a,e.y+=b,this.cloning||(e.view.graph.cellRenderer.redraw(e,!0),e.view.invalidate(e.cell),e.invalid=!1),null!=e.control&&null!=e.control.node&&(e.control.node.style.visibility="hidden"))}));for(var d=this.graph.view.scale,e=0;e<c.length;e++){var f=c[e][0];if(this.graph.model.isEdge(f.cell)){var g=this.graph.getCellGeometry(f.cell),k=[];if(null!=g&&null!=g.points)for(var l=
0;l<g.points.length;l++)null!=g.points[l]&&k.push(new mxPoint(g.points[l].x+a/d,g.points[l].y+b/d));var g=f.visibleSourceState,l=f.visibleTargetState,m=c[e][1].absolutePoints;null!=g&&this.isCellMoving(g.cell)?f.view.updateFixedTerminalPoint(f,g,!0,this.graph.getConnectionConstraint(f,g,!0)):(g=m[0],f.setAbsoluteTerminalPoint(new mxPoint(g.x+a,g.y+b),!0),g=null);null!=l&&this.isCellMoving(l.cell)?f.view.updateFixedTerminalPoint(f,l,!1,this.graph.getConnectionConstraint(f,l,!1)):(l=m[m.length-1],f.setAbsoluteTerminalPoint(new mxPoint(l.x+
@@ -1400,7 +1400,7 @@ mxGraphHandler.prototype.selectDelayed=function(a){this.graph.isCellSelected(thi
mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.cells,!0));this.destroyShapes();this.removeHint();this.delayedSelection=!1;this.livePreviewUsed=this.livePreviewActive=null;this.cellWasClicked=!1;this.cellCount=this.currentDy=this.currentDx=null;this.cloning=!1;this.cell=this.cells=this.first=this.target=this.guides=this.allCells=null};
mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);var d=Math.sin(-d),e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return!mxUtils.contains(a,c.x,c.y)}return!1};
mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));var g=this.graph.getModel().getParent(this.cell);null==e&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(g,a,f)&&(e=this.graph.getDefaultParent());d=d&&!this.graph.isCellLocked(e||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{g=[];if(!d&&null!=e&&this.removeEmptyParents){for(var k=new mxDictionary,l=0;l<a.length;l++)k.put(a[l],!0);for(l=0;l<a.length;l++){var m=
-this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b-this.graph.panDx/this.graph.view.scale,c-this.graph.panDy/this.graph.view.scale,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])};
+this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b,c,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])};
mxGraphHandler.prototype.shouldRemoveParent=function(a){var b=this.graph.view.getState(a);return null!=b&&(this.graph.model.isEdge(b.cell)||this.graph.model.isVertex(b.cell))&&this.graph.isCellDeletable(b.cell)&&0==this.graph.model.getChildCount(b.cell)?(a=mxUtils.getValue(b.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),b=mxUtils.getValue(b.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE),a==mxConstants.NONE&&b==mxConstants.NONE):!1};
mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)};
mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.refreshHandler=null);this.destroyShapes();this.removeHint()};
diff --git a/src/main/java/com/mxgraph/io/gliffy/importer/GliffyDiagramConverter.java b/src/main/java/com/mxgraph/io/gliffy/importer/GliffyDiagramConverter.java
index 34f8e0c8..d1de5d57 100644
--- a/src/main/java/com/mxgraph/io/gliffy/importer/GliffyDiagramConverter.java
+++ b/src/main/java/com/mxgraph/io/gliffy/importer/GliffyDiagramConverter.java
@@ -17,6 +17,8 @@ import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -75,6 +77,10 @@ public class GliffyDiagramConverter
private Pattern rotationPattern = Pattern.compile("rotation=(\\-?\\w+)");
+ private static Pattern lightboxPageIdGliffyMigration = Pattern.compile("pageId=(.*?)(?=&)");
+
+ private static Pattern lightboxNameGliffyMigration = Pattern.compile("name=(.*?)(?=&)");
+
private StringBuilder report;
/**
@@ -1003,6 +1009,11 @@ public class GliffyDiagramConverter
{
Document doc = mxDomUtils.createDocument();
Element uo = doc.createElement("UserObject");
+
+ Pair<Long, String> lightBox = extractLightboxDataFromGliffyUrl(link);
+ if (lightBox != null) {
+ link = "/plugins/drawio/lightbox.action?ceoId=" + lightBox.getKey() + "&diagramName=" + lightBox.getValue() + ".drawio";
+ }
uo.setAttribute("link", link);
drawioDiagram.getModel().setValue(cell, uo);
@@ -1058,6 +1069,20 @@ public class GliffyDiagramConverter
style.replace(start, end, correctValue);
}
+ public Pair<Long, String> extractLightboxDataFromGliffyUrl(String link) {
+ Matcher pagem = lightboxPageIdGliffyMigration.matcher(link);
+ Matcher namem = lightboxNameGliffyMigration.matcher(link);
+ if (pagem.find())
+ {
+ Long oldPageId = Long.parseLong(pagem.group(1));
+ if (namem.find()) {
+ String oldDiagramName = namem.group(1);
+ return new ImmutablePair<Long, String>(oldPageId, oldDiagramName);
+ }
+ }
+ return null;
+ }
+
public StringBuilder getReport()
{
return report;
diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest
index b889bf31..ac5df488 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!
-# 10/17/2019 10:47 AM
+# 10/23/2019 01:46 PM
app.html
index.html?offline=1
diff --git a/src/main/webapp/export3.html b/src/main/webapp/export3.html
index a6534e8e..6fe3e891 100644
--- a/src/main/webapp/export3.html
+++ b/src/main/webapp/export3.html
@@ -79,7 +79,7 @@
// Parses XML
var doc = mxUtils.parseXml(data.xml);
var node = Editor.extractGraphModel(doc.documentElement, true);
-
+
if (node == null)
{
//Electron pdf export
@@ -331,7 +331,7 @@
}
//handle layers
- if (extras != null && extras.layers != null)
+ if (extras != null && (extras.layers != null || extras.layerIds != null))
{
var childCount = model.getChildCount(model.root);
@@ -340,14 +340,24 @@
{
model.setVisible(model.getChildAt(model.root, i), false);
}
-
- for (var i = 0; i < extras.layers.length; i++)
+
+ if (extras.layerIds != null)
{
- var layer = model.getChildAt(model.root, extras.layers[i]);
-
- if (layer != null)
+ for (var i = 0; i < extras.layerIds.length; i++)
{
- model.setVisible(layer, true);
+ model.setVisible(model.getCell(extras.layerIds[i]), true);
+ }
+ }
+ else
+ {
+ for (var i = 0; i < extras.layers.length; i++)
+ {
+ var layer = model.getChildAt(model.root, extras.layers[i]);
+
+ if (layer != null)
+ {
+ model.setVisible(layer, true);
+ }
}
}
}
diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js
index ccd4c49e..0a2be5c8 100644
--- a/src/main/webapp/js/app.min.js
+++ b/src/main/webapp/js/app.min.js
@@ -140,7 +140,7 @@ window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefi
(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&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];
null!=a&&(DRAWIO_GITLAB_ID=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.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0";
if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);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:"4.0.5",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:"4.0.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")&&
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_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg",
@@ -1510,7 +1510,7 @@ mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=nul
function mxGraphHandler(a){this.graph=a;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,function(){this.updatePreview();this.updateHint()});this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,function(a,c){this.reset()});this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,function(a,c){if(null!=this.first)try{this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),
this.updatePreview(!0),window.setTimeout(mxUtils.bind(this,function(){this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.cells,!1),this.updatePreview())}),0)}catch(d){this.reset()}});this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50;mxGraphHandler.prototype.enabled=!0;mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;
mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;mxGraphHandler.prototype.removeEmptyParents=!1;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;mxGraphHandler.prototype.minimumSize=6;
-mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};
+mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};
mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};
mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a};mxGraphHandler.prototype.getInitialCellForEvent=function(a){return a.getCell()};mxGraphHandler.prototype.isDelayedSelection=function(a,b){return this.graph.isCellSelected(a)};mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()};
mxGraphHandler.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=b.getState()&&!mxEvent.isMultiTouchEvent(b.getEvent())){var c=this.getInitialCellForEvent(b);this.delayedSelection=this.isDelayedSelection(c,b);this.cell=null;this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(c,b.getEvent());if(this.isMoveEnabled()){var d=this.graph.model,e=d.getGeometry(c);this.graph.isCellMovable(c)&&(!d.isEdge(c)||1<this.graph.getSelectionCount()||
@@ -1522,14 +1522,14 @@ mxGraphHandler.prototype.createPreviewShape=function(a){a=new mxRectangleShape(a
mxGraphHandler.prototype.start=function(a,b,c){this.cell=a;this.first=mxUtils.convertPoint(this.graph.container,b,c);this.cells=this.getCells(this.cell);this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);this.allCells=new mxDictionary;this.cloning=!1;for(b=this.cellCount=0;b<this.cells.length;b++)this.cellCount+=this.addStates(this.cells[b],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var d=this.graph.model.getParent(a),
e=2>this.graph.model.getChildCount(d);this.guide.isStateIgnored=mxUtils.bind(this,function(a){var b=this.graph.model.getParent(a.cell);return!this.cloning&&this.isCellMoving(a.cell)||a.cell!=(this.target||d)&&!e&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&b!=(this.target||d)})}};
mxGraphHandler.prototype.addStates=function(a,b){var c=this.graph.view.getState(a),d=0;if(null!=c&&null==b.get(a)){b.put(a,c);d++;for(var c=this.graph.model.getChildCount(a),e=0;e<c;e++)d+=this.addStates(this.graph.model.getChildAt(a,e),b)}return d};mxGraphHandler.prototype.isCellMoving=function(a){return null!=this.allCells.get(a)};mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent()):!0};
-mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());var b=this.graph.view.scale;return new mxPoint(this.roundLength((a.x-this.first.x)/b)*b,this.roundLength((a.y-this.first.y)/b)*b)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){};
-mxGraphHandler.prototype.roundLength=function(a){return Math.round(2*a)/2};
+mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());var b=this.graph.view.scale;return new mxPoint(this.roundLength((a.x-this.first.x-this.graph.panDx)/b)*b,this.roundLength((a.y-this.first.y-this.graph.panDy)/b)*b)};mxGraphHandler.prototype.updateHint=function(a){};
+mxGraphHandler.prototype.removeHint=function(){};mxGraphHandler.prototype.roundLength=function(a){return Math.round(2*a)/2};
mxGraphHandler.prototype.mouseMove=function(a,b){var c=this.graph;if(!b.isConsumed()&&c.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds)if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{var d=this.getDelta(b),e=d.x,d=d.y,f=c.tolerance;if(null!=this.shape||this.livePreviewActive||Math.abs(e)>f||Math.abs(d)>f){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var g=c.isCloneEvent(b.getEvent())&&c.isCellsCloneable()&&this.isCloneEnabled(),
-k=c.isGridEnabledEvent(b.getEvent()),f=!0;this.cloning=g;var l=null,m=b.getCell();c.isDropEnabled()&&this.highlightEnabled&&(l=c.getDropTarget(this.cells,b.getEvent(),m,g));var n=c.getView().getState(l),p=!1;null==n||c.model.getParent(this.cell)==l&&!g?(this.target=null,this.connectOnDrop&&null!=m&&1==this.cells.length&&c.getModel().isVertex(m)&&c.isCellConnectable(m)&&(n=c.getView().getState(m),null!=n&&(l=null==c.getEdgeValidationError(null,this.cell,m)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,
-this.setHighlightColor(l),p=!0))):(this.target!=l&&(this.target=l,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0);null!=n&&p?this.highlight.highlight(n):this.highlight.hide();this.livePreviewActive&&g?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&mxClient.IS_SVG?(this.setHandlesVisibleForCells(this.cells,!1),this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds));
+k=c.isGridEnabledEvent(b.getEvent()),l=b.getCell(),f=!0,m=null;this.cloning=g;c.isDropEnabled()&&this.highlightEnabled&&(m=c.getDropTarget(this.cells,b.getEvent(),l,g));var n=c.getView().getState(m),p=!1;null==n||c.model.getParent(this.cell)==m&&!g?(this.target=null,this.connectOnDrop&&null!=l&&1==this.cells.length&&c.getModel().isVertex(l)&&c.isCellConnectable(l)&&(n=c.getView().getState(l),null!=n&&(l=null==c.getEdgeValidationError(null,this.cell,l)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,
+this.setHighlightColor(l),p=!0))):(this.target!=m&&(this.target=m,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0);null!=n&&p?this.highlight.highlight(n):this.highlight.hide();this.livePreviewActive&&g?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?(this.setHandlesVisibleForCells(this.cells,!1),this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds));
null!=this.guide&&this.useGuidesForEvent(b)?(d=this.guide.move(this.bounds,new mxPoint(e,d),k,g),f=!1,e=d.x,d=d.y):k&&(k=c.getView().translate,n=c.getView().scale,g=this.bounds.x-(c.snap(this.bounds.x/n-k.x)+k.x)*n,k=this.bounds.y-(c.snap(this.bounds.y/n-k.y)+k.y)*n,d=this.snap(new mxPoint(e,d)),e=d.x-g,d=d.y-k);null!=this.guide&&f&&this.guide.hide();c.isConstrainedEvent(b.getEvent())&&(Math.abs(e)>Math.abs(d)?d=0:e=0);this.currentDx=e;this.currentDy=d;this.updatePreview()}this.updateHint(b);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,
b);mxEvent.consume(b.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||b.isConsumed()||null==b.getState()&&null==b.sourceState||c.isMouseDown||(e=c.getCursorForMouseEvent(b),null==e&&c.isEnabled()&&c.isCellMovable(b.getCell())&&(e=c.getModel().isEdge(b.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=e&&null!=b.sourceState&&b.sourceState.setCursor(e))};
-mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&this.updateLivePreview(this.currentDx-this.graph.panDx,this.currentDy-this.graph.panDy):this.updatePreviewShape()};mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};
+mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&this.updateLivePreview(this.currentDx,this.currentDy):this.updatePreviewShape()};mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};
mxGraphHandler.prototype.updateLivePreview=function(a,b){var c=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,function(d,e){var f=e.clone();c.push([e,f]);null!=e.shape&&(null==e.shape.originalPointerEvents&&(e.shape.originalPointerEvents=e.shape.pointerEvents),e.shape.pointerEvents=!1,null!=e.text&&null!=e.text.node&&(f=e.text.node,null!=f.firstChild&&null!=f.firstChild.firstChild&&"foreignObject"==f.firstChild.firstChild.nodeName?f.firstChild.firstChild.setAttribute("pointer-events",
"none"):null!=f.ownerSVGElement?f.setAttribute("pointer-events","none"):f.style.pointerEvents="none"));this.graph.model.isVertex(e.cell)&&(e.x+=a,e.y+=b,this.cloning||(e.view.graph.cellRenderer.redraw(e,!0),e.view.invalidate(e.cell),e.invalid=!1),null!=e.control&&null!=e.control.node&&(e.control.node.style.visibility="hidden"))}));for(var d=this.graph.view.scale,e=0;e<c.length;e++){var f=c[e][0];if(this.graph.model.isEdge(f.cell)){var g=this.graph.getCellGeometry(f.cell),k=[];if(null!=g&&null!=g.points)for(var l=
0;l<g.points.length;l++)null!=g.points[l]&&k.push(new mxPoint(g.points[l].x+a/d,g.points[l].y+b/d));var g=f.visibleSourceState,l=f.visibleTargetState,m=c[e][1].absolutePoints;null!=g&&this.isCellMoving(g.cell)?f.view.updateFixedTerminalPoint(f,g,!0,this.graph.getConnectionConstraint(f,g,!0)):(g=m[0],f.setAbsoluteTerminalPoint(new mxPoint(g.x+a,g.y+b),!0),g=null);null!=l&&this.isCellMoving(l.cell)?f.view.updateFixedTerminalPoint(f,l,!1,this.graph.getConnectionConstraint(f,l,!1)):(l=m[m.length-1],f.setAbsoluteTerminalPoint(new mxPoint(l.x+
@@ -1542,7 +1542,7 @@ mxGraphHandler.prototype.selectDelayed=function(a){this.graph.isCellSelected(thi
mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.cells,!0));this.destroyShapes();this.removeHint();this.delayedSelection=!1;this.livePreviewUsed=this.livePreviewActive=null;this.cellWasClicked=!1;this.cellCount=this.currentDy=this.currentDx=null;this.cloning=!1;this.cell=this.cells=this.first=this.target=this.guides=this.allCells=null};
mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);var d=Math.sin(-d),e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return!mxUtils.contains(a,c.x,c.y)}return!1};
mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));var g=this.graph.getModel().getParent(this.cell);null==e&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(g,a,f)&&(e=this.graph.getDefaultParent());d=d&&!this.graph.isCellLocked(e||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{g=[];if(!d&&null!=e&&this.removeEmptyParents){for(var k=new mxDictionary,l=0;l<a.length;l++)k.put(a[l],!0);for(l=0;l<a.length;l++){var m=
-this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b-this.graph.panDx/this.graph.view.scale,c-this.graph.panDy/this.graph.view.scale,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])};
+this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b,c,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])};
mxGraphHandler.prototype.shouldRemoveParent=function(a){var b=this.graph.view.getState(a);return null!=b&&(this.graph.model.isEdge(b.cell)||this.graph.model.isVertex(b.cell))&&this.graph.isCellDeletable(b.cell)&&0==this.graph.model.getChildCount(b.cell)?(a=mxUtils.getValue(b.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),b=mxUtils.getValue(b.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE),a==mxConstants.NONE&&b==mxConstants.NONE):!1};
mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)};
mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.refreshHandler=null);this.destroyShapes();this.removeHint()};
@@ -7767,26 +7767,26 @@ DrawioFile=function(a,c){mxEventSource.call(this);this.ui=a;this.shadowData=this
DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;
DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.errorReportsEnabled=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};
DrawioFile.prototype.synchronizeFile=function(a,c){this.savingFile?null!=c&&c({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,c):this.updateFile(a,c)};
-DrawioFile.prototype.updateFile=function(a,c,b,d){null!=b&&b()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():this.getLatestVersion(mxUtils.bind(this,function(m){try{null!=b&&b()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():null!=m?this.mergeFile(m,a,c,d):this.reloadFile(a,c))}catch(f){null!=c&&c(f)}}),c))};
-DrawioFile.prototype.mergeFile=function(a,c,b,d){var m=!0;try{this.stats.fileMerged++;var f=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),l=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=l&&0<l.length){this.shadowPages=l;this.backupPatch=this.isModified()?this.ui.diffPages(f,this.ui.pages):null;var n=[this.ui.diffPages(null!=d?d:f,this.shadowPages)];if(!this.ignorePatches(n)){var p=this.ui.patchPages(f,
-n[0]);d={};var u=this.ui.getHashValueForPages(p,d),f={},g=this.ui.getHashValueForPages(this.shadowPages,f);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",n,"checksum",g==u,u);if(null!=u&&u!=g){var k=this.compressReportData(this.getAnonymizedXmlForPages(l)),q=this.compressReportData(this.getAnonymizedXmlForPages(p)),v=this.ui.hashValue(a.getCurrentEtag()),y=this.ui.hashValue(this.getCurrentEtag());this.checksumError(b,n,"Shadow Details: "+JSON.stringify(d)+
-"\nChecksum: "+u+"\nCurrent: "+g+"\nCurrent Details: "+JSON.stringify(f)+"\nFrom: "+v+"\nTo: "+y+"\n\nFile Data:\n"+k+"\nPatched Shadow:\n"+q,null,"mergeFile");return}this.patch(n,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw m=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=c&&c()}catch(z){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
-null!=b&&b(z);try{if(m)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,z);else{var t=this.getCurrentUser(),A=null!=t?t.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),A,z)}}catch(D){}}};
-DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var c=new mxCodec(mxUtils.createXmlDocument()),b=c.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var m=c.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(m=this.ui.anonymizeNode(m,!0));m.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,m,!0);b.appendChild(m)}return mxUtils.getPrettyXml(b)};
+DrawioFile.prototype.updateFile=function(a,c,b,d){null!=b&&b()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():this.getLatestVersion(mxUtils.bind(this,function(g){try{null!=b&&b()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=c&&c():null!=g?this.mergeFile(g,a,c,d):this.reloadFile(a,c))}catch(e){null!=c&&c(e)}}),c))};
+DrawioFile.prototype.mergeFile=function(a,c,b,d){var g=!0;try{this.stats.fileMerged++;var e=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),k=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=k&&0<k.length){this.shadowPages=k;this.backupPatch=this.isModified()?this.ui.diffPages(e,this.ui.pages):null;var m=[this.ui.diffPages(null!=d?d:e,this.shadowPages)];if(!this.ignorePatches(m)){var n=this.ui.patchPages(e,
+m[0]);d={};var q=this.ui.getHashValueForPages(n,d),e={},f=this.ui.getHashValueForPages(this.shadowPages,e);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",m,"checksum",f==q,q);if(null!=q&&q!=f){var l=this.compressReportData(this.getAnonymizedXmlForPages(k)),p=this.compressReportData(this.getAnonymizedXmlForPages(n)),u=this.ui.hashValue(a.getCurrentEtag()),v=this.ui.hashValue(this.getCurrentEtag());this.checksumError(b,m,"Shadow Details: "+JSON.stringify(d)+
+"\nChecksum: "+q+"\nCurrent: "+f+"\nCurrent Details: "+JSON.stringify(e)+"\nFrom: "+u+"\nTo: "+v+"\n\nFile Data:\n"+l+"\nPatched Shadow:\n"+p,null,"mergeFile");return}this.patch(m,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw g=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=c&&c()}catch(y){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
+null!=b&&b(y);try{if(g)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,y);else{var t=this.getCurrentUser(),z=null!=t?t.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,y)}}catch(C){}}};
+DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var c=new mxCodec(mxUtils.createXmlDocument()),b=c.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var g=c.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(g=this.ui.anonymizeNode(g,!0));g.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,g,!0);b.appendChild(g)}return mxUtils.getPrettyXml(b)};
DrawioFile.prototype.compressReportData=function(a,c,b){c=null!=c?c:1E4;null!=b&&null!=a&&a.length>b?a=a.substring(0,b)+"[...]":null!=a&&a.length>c&&(a=Graph.compress(a)+"\n");return a};
-DrawioFile.prototype.checksumError=function(a,c,b,d,m){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var f=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(c,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
-25E3):"n/a";this.sendErrorReport("Checksum Error in "+m+" "+this.getHash(),(null!=b?b:"")+"\n\nPatches:\n"+d+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==d?f(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==d?f(a):f(null)}),function(){})}else{var l=this.getCurrentUser(),n=null!=l?l.id:"unknown";EditorUi.logError("Checksum Error in "+m+" "+this.getId(),null,this.getMode()+"."+this.getId(),"user_"+n+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync"));
-try{EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+this.getHash(),action:m,label:"user_"+n+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")})}catch(p){}}}catch(p){}};
-DrawioFile.prototype.sendErrorReport=function(a,c,b,d){try{var m=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),f=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),l=this.getCurrentUser(),n=null!=l?this.ui.hashValue(l.id):"unknown",p=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",u=this.getTitle(),g=u.lastIndexOf("."),l="xml";0<g&&(l=u.substring(g));var k=null!=b?b.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+
-":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+l+")\nUser="+n+p+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=c?"\n\n"+c:"")+
-(null!=b?"\n\nError: "+b.message:"")+"\n\nStack:\n"+k+"\n\nShadow:\n"+m+"\n\nData:\n"+f,d)}catch(q){}};
-DrawioFile.prototype.reloadFile=function(a,c){try{this.ui.spinner.stop();var b=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),c=this.ui.editor.graph.getSelectionCells(),f=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(f,b,c);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=
+DrawioFile.prototype.checksumError=function(a,c,b,d,g){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var e=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(c,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
+25E3):"n/a";this.sendErrorReport("Checksum Error in "+g+" "+this.getHash(),(null!=b?b:"")+"\n\nPatches:\n"+d+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==d?e(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==d?e(a):e(null)}),function(){})}else{var k=this.getCurrentUser(),m=null!=k?k.id:"unknown";EditorUi.logError("Checksum Error in "+g+" "+this.getId(),null,this.getMode()+"."+this.getId(),"user_"+m+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync"));
+try{EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+this.getHash(),action:g,label:"user_"+m+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")})}catch(n){}}}catch(n){}};
+DrawioFile.prototype.sendErrorReport=function(a,c,b,d){try{var g=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),e=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),k=this.getCurrentUser(),m=null!=k?this.ui.hashValue(k.id):"unknown",n=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",q=this.getTitle(),f=q.lastIndexOf("."),k="xml";0<f&&(k=q.substring(f));var l=null!=b?b.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+
+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+k+")\nUser="+m+n+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=c?"\n\n"+c:"")+
+(null!=b?"\n\nError: "+b.message:"")+"\n\nStack:\n"+l+"\n\nShadow:\n"+g+"\n\nData:\n"+e,d)}catch(p){}};
+DrawioFile.prototype.reloadFile=function(a,c){try{this.ui.spinner.stop();var b=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),c=this.ui.editor.graph.getSelectionCells(),e=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(e,b,c);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=
this.stats);null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}catch(d){null!=c&&c(d)}};DrawioFile.prototype.copyFile=function(a,c){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};
DrawioFile.prototype.ignorePatches=function(a){for(var c=!0,b=0;b<a.length&&c;b++)c=c&&0==Object.keys(a[b]).length;return c};
-DrawioFile.prototype.patch=function(a,c){var b=this.ui.editor.undoManager,d=b.history.slice(),m=b.indexOfNextAdd,f=this.ui.editor.graph;f.container.style.visibility="hidden";var l=this.changeListenerEnabled;this.changeListenerEnabled=!1;var n=f.foldingEnabled,p=f.mathEnabled,u=f.cellRenderer.redraw;f.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());u.apply(this,arguments)};f.model.beginUpdate();try{for(var g=
-0;g<a.length;g++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[g],!0,c,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{f.container.style.visibility="";f.model.endUpdate();f.cellRenderer.redraw=u;this.changeListenerEnabled=l;b.history=d;b.indexOfNextAdd=m;b.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)p!=
-f.mathEnabled?(this.ui.editor.updateGraphComponents(),f.refresh()):(n!=f.foldingEnabled?f.view.revalidate():f.view.validate(),f.sizeDidChange());this.ui.updateTabContainer()}};
-DrawioFile.prototype.save=function(a,c,b,d,m,f){try{if(this.isEditable())if(!m&&this.invalidChecksum)if(null!=b)b({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=c&&c();else if(null!=b)b({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(l){if(null!=b)b(l);else throw l;}};
+DrawioFile.prototype.patch=function(a,c){var b=this.ui.editor.undoManager,d=b.history.slice(),g=b.indexOfNextAdd,e=this.ui.editor.graph;e.container.style.visibility="hidden";var k=this.changeListenerEnabled;this.changeListenerEnabled=!1;var m=e.foldingEnabled,n=e.mathEnabled,q=e.cellRenderer.redraw;e.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());q.apply(this,arguments)};e.model.beginUpdate();try{for(var f=
+0;f<a.length;f++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[f],!0,c,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{e.container.style.visibility="";e.model.endUpdate();e.cellRenderer.redraw=q;this.changeListenerEnabled=k;b.history=d;b.indexOfNextAdd=g;b.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)n!=
+e.mathEnabled?(this.ui.editor.updateGraphComponents(),e.refresh()):(m!=e.foldingEnabled?e.view.revalidate():e.view.validate(),e.sizeDidChange());this.ui.updateTabContainer()}};
+DrawioFile.prototype.save=function(a,c,b,d,g,e){try{if(this.isEditable())if(!g&&this.invalidChecksum)if(null!=b)b({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=c&&c();else if(null!=b)b({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(k){if(null!=b)b(k);else throw k;}};
DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed()))};DrawioFile.prototype.isCompressedStorage=function(){return!0};DrawioFile.prototype.isCompressed=function(){var a=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=a?"false"!=a:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.saveAs=function(a,c,b){};DrawioFile.prototype.saveFile=function(a,c,b,d){};
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.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,c,b){};
DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,c,b){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
@@ -7813,323 +7813,332 @@ mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),b,mxResources.get("
b)}};DrawioFile.prototype.handleFileSuccess=function(a){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.isModified()?this.fileChanged():a?(this.addAllSavedStatus(),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.editor.setStatus(""))};
DrawioFile.prototype.handleFileError=function(a,c){this.ui.spinner.stop();if(this.ui.getCurrentFile()==this)if(this.inConflictState)this.handleConflictError(a,c);else if(this.isModified()&&this.addUnsavedStatus(a),c)this.ui.handleError(a,null!=a?mxResources.get("errorSavingFile"):null);else if(!this.isModified()){var b=null!=a?null!=a.error?a.error.message:a.message:null;null!=b&&60<b.length&&(b=b.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+
mxUtils.htmlEntities(mxResources.get("error"))+(null!=b?" ("+mxUtils.htmlEntities(b)+")":"")+"</div>")}};
-DrawioFile.prototype.handleConflictError=function(a,c){var b=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),m=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,b,d,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage))}),f=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&
-this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,b,d,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(b,d,m):this.invalidChecksum?this.showRefreshDialog(b,d,this.getErrorMessage(a)):c?this.showConflictDialog(m,f):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));
+DrawioFile.prototype.handleConflictError=function(a,c){var b=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),g=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,b,d,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage))}),e=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&
+this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,b,d,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(b,d,g):this.invalidChecksum?this.showRefreshDialog(b,d,this.getErrorMessage(a)):c?this.showConflictDialog(g,e):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));
this.synchronizeFile(b,d)}),this.getErrorMessage(a))};DrawioFile.prototype.getErrorMessage=function(a){return null!=a?null!=a.error?a.error.message:a.message:null};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};
DrawioFile.prototype.fileChanged=function(){this.lastChanged=new Date;this.setModified(!0);this.isAutosave()?(this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=
this.lastChanged)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus())};
-DrawioFile.prototype.fileSaved=function(a,c,b,d){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=b&&b()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),c,b,d,a)}catch(l){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(l);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,l);else{var m=
-this.getCurrentUser(),f=null!=m?m.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),f,l)}}catch(n){}}};
-DrawioFile.prototype.autosave=function(a,c,b,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());a=Date.now()-this.lastAutosave<c?a:0;this.clearAutosave();var m=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==m&&(this.autosaveThread=null);if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();null!=b&&b(a)}),mxUtils.bind(this,
-function(a){null!=d&&d(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=b&&b(null)}),a);this.autosaveThread=m};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.fileSaved=function(a,c,b,d){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=b&&b()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),c,b,d,a)}catch(k){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(k);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,k);else{var g=
+this.getCurrentUser(),e=null!=g?g.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),e,k)}}catch(m){}}};
+DrawioFile.prototype.autosave=function(a,c,b,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());a=Date.now()-this.lastAutosave<c?a:0;this.clearAutosave();var g=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==g&&(this.autosaveThread=null);if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();null!=b&&b(a)}),mxUtils.bind(this,
+function(a){null!=d&&d(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=b&&b(null)}),a);this.autosaveThread=g};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.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};
DrawioFile.prototype.close=function(a){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,c){if(null!=a&&null!=c){var b=a.lastIndexOf("."),d=0<b?a.substring(b):"",b=c.lastIndexOf(".");return d===(0<b?c.substring(b):"")}return a==c};
DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.stats.destroyed++;this.clearAutosave();this.removeListeners();null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};
DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(a,c){a([])};DrawioFile.prototype.addComment=function(a,c,b){c(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(a,c){return new DrawioComment(this,null,a,Date.now(),Date.now(),!1,c)};LocalFile=function(a,c,b,d){DrawioFile.call(this,a,c);this.title=b;this.mode=d?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,c,b){this.saveAs(this.title,c,b)};LocalFile.prototype.saveAs=function(a,c,b){this.saveFile(a,!1,c,b)};
-LocalFile.prototype.saveFile=function(a,c,b,d){this.title=a;this.updateFileData();c=this.getData();var m=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),f=mxUtils.bind(this,function(c){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,a,m?"image/png":"text/xml",m);else if(c.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(a)+
-(m?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));this.setModified(!1);this.contentChanged();null!=b&&b()});m?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){f(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):f(c)};LocalFile.prototype.rename=function(a,c,b){this.title=a;this.descriptorChanged();null!=c&&c()};
+LocalFile.prototype.saveFile=function(a,c,b,d){this.title=a;this.updateFileData();c=this.getData();var g=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),e=mxUtils.bind(this,function(c){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,a,g?"image/png":"text/xml",g);else if(c.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(a)+
+(g?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));this.setModified(!1);this.contentChanged();null!=b&&b()});g?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):e(c)};LocalFile.prototype.rename=function(a,c,b){this.title=a;this.descriptorChanged();null!=c&&c()};
LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};LocalLibrary=function(a,c,b){LocalFile.call(this,a,c,b)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(a,c,b){this.saveFile(a,!1,c,b)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(a,c,b){DrawioFile.call(this,a,c);this.title=b};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.autosaveDelay=2E3;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title};
StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.save=function(a,c,b){this.saveAs(this.getTitle(),c,b)};StorageFile.prototype.saveAs=function(a,c,b){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(a,!1,c,b)};
-StorageFile.prototype.saveFile=function(a,c,b,d){if(this.isEditable()){var m=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=b&&b()}))}catch(f){null!=d&&d(f)}});this.isRenamable()&&"."==a.charAt(0)&&null!=d?d({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(b){this.isRenamable()&&this.getTitle()!=a&&null!=b?this.ui.confirm(mxResources.get("replaceIt",
-[a]),m,d):m()}))}else null!=b&&b()};StorageFile.prototype.rename=function(a,c,b){var d=this.getTitle();d!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(m){var f=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(d,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(d,c)}),b)});null!=m?this.ui.confirm(mxResources.get("replaceIt",[a]),f,b):f()})):c()};
+StorageFile.prototype.saveFile=function(a,c,b,d){if(this.isEditable()){var g=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=b&&b()}))}catch(e){null!=d&&d(e)}});this.isRenamable()&&"."==a.charAt(0)&&null!=d?d({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(b){this.isRenamable()&&this.getTitle()!=a&&null!=b?this.ui.confirm(mxResources.get("replaceIt",
+[a]),g,d):g()}))}else null!=b&&b()};StorageFile.prototype.rename=function(a,c,b){var d=this.getTitle();d!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(g){var e=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(d,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(d,c)}),b)});null!=g?this.ui.confirm(mxResources.get("replaceIt",[a]),e,b):e()})):c()};
StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.getLatestVersion=function(a,c){this.ui.getLocalData(this.title,mxUtils.bind(this,function(b){a(new StorageFile(this.ui,b,this.title))}))};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,c,b){StorageFile.call(this,a,c,b)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,c,b){this.saveFile(a,!1,c,b)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
StorageLibrary.prototype.isRenamable=function(a,c,b){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(a,c,b){DrawioFile.call(this,a,c);this.title=b;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(a,c,b){RemoteFile.call(this,a,c,b.title);this.libObj=b};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(a,c,b){};
RemoteLibrary.prototype.saveAs=function(a,c,b){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(a,c,b){StorageFile.call(this,a,c,b);a=b;c=a.lastIndexOf("/");0<=c&&(a=a.substring(c+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,c,b){return!1};UrlLibrary.prototype.saveAs=function(a,c,b){};UrlLibrary.prototype.open=function(){};/*
mxClient.IS_IOS || */
-var StorageDialog=function(a,c,b){function d(q,d,t,f,B,l){function m(){mxEvent.addListener(x,"click",null!=l?l:function(){t!=App.MODE_GOOGLE||a.isDriveDomain()?t==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(t,p.checked);c()})):t==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(t,p.checked);
-c()})):(a.setMode(t,p.checked),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}++u>b&&(mxUtils.br(g),u=0);var x=document.createElement("a");x.style.overflow="hidden";x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.className="geBaseButton";x.style.boxSizing="border-box";x.style.fontSize="11px";x.style.position="relative";x.style.margin="4px";x.style.marginTop="2px";x.style.padding="8px 10px 12px 10px";x.style.width="88px";x.style.height=StorageDialog.extended?"50px":
-"100px";x.style.whiteSpace="nowrap";x.setAttribute("title",d);mxClient.IS_QUIRKS&&(x.style.cssFloat="left",x.style.zoom="1");var v=document.createElement("div");v.style.textOverflow="ellipsis";v.style.overflow="hidden";if(null!=q){var C=document.createElement("img");C.setAttribute("src",q);C.setAttribute("border","0");C.setAttribute("align","absmiddle");C.style.width=StorageDialog.extended?"24px":"60px";C.style.height=StorageDialog.extended?"24px":"60px";C.style.paddingBottom=StorageDialog.extended?
-"4px":"6px";x.appendChild(C)}else v.style.paddingTop="5px",v.style.whiteSpace="normal",mxClient.IS_IOS?(x.style.padding="0px 10px 20px 10px",x.style.top="6px"):mxClient.IS_FF&&(v.style.paddingTop="0px",v.style.marginTop="-2px");StorageDialog.extended&&(x.style.paddingTop="4px",x.style.marginBottom="0px",v.display="inline-block",2==b&&(C.style.width="38px",C.style.height="38px",x.style.width="80px",x.style.height="68px"));x.appendChild(v);mxUtils.write(v,d);if(null!=B)for(q=0;q<B.length;q++)mxUtils.br(v),
-mxUtils.write(v,B[q]);if(null!=f&&null==a[f]){C.style.visibility="hidden";mxUtils.setOpacity(v,10);var y=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});y.spin(x);var F=window.setTimeout(function(){null==a[f]&&(y.stop(),x.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,c){null!=a[f]&&c.getProperty("client")==a[f]&&(window.clearTimeout(F),mxUtils.setOpacity(v,
-100),C.style.visibility="",y.stop(),m(),"drive"==f&&null!=k.parentNode&&k.parentNode.removeChild(k))}))}else m();g.appendChild(x)}b=null!=b?b:2;var m=document.createElement("div");m.style.textAlign="center";m.style.whiteSpace="nowrap";m.style.paddingTop="0px";m.style.paddingBottom="20px";var f=a.addLanguageMenu(m,!0);null!=f&&(f.style.bottom=parseInt("28px")-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){f=document.createElement("a");f.setAttribute("href","https://about.draw.io/support/");f.setAttribute("title",
-mxResources.get("help"));f.setAttribute("target","_blank");f.style.position="absolute";f.style.userSelect="none";f.style.textDecoration="none";f.style.cursor="pointer";f.style.fontSize="12px";f.style.bottom="28px";f.style.left="26px";f.style.color="gray";var l=document.createElement("img");mxUtils.setOpacity(l,50);l.style.height="16px";l.style.width="16px";l.setAttribute("border","0");l.setAttribute("valign","bottom");l.setAttribute("src",Editor.helpImage);l.style.marginRight="2px";f.appendChild(l);
-mxUtils.write(f,mxResources.get("help"));m.appendChild(f)}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";n.style.userSelect="none";mxUtils.write(n,mxResources.get("decideLater"));mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,0)");n.style.left="50%";a.isOfflineApp()&&(n.style.bottom="28px");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)n.style.marginLeft=
--Math.round(n.clientWidth/2)+"px"};m.appendChild(n);mxEvent.addListener(n,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=b});f=document.createElement("div");mxClient.IS_QUIRKS&&(f.style.whiteSpace="nowrap",f.style.cssFloat="left");f.style.border="1px solid #d3d3d3";f.style.borderWidth="1px 0px 1px 0px";f.style.padding="12px 0px 12px 0px";var p=document.createElement("input");p.setAttribute("type",
-"checkbox");p.setAttribute("checked","checked");p.defaultChecked=!0;var u=0,g=document.createElement("div");g.style.paddingTop="2px";f.appendChild(g);var k=document.createElement("p"),l=document.createElement("p");l.style.fontSize="16pt";l.style.padding="0px";l.style.paddingTop="4px";l.style.paddingBottom="16px";l.style.margin="0px";l.style.color="gray";mxUtils.write(l,mxResources.get("saveDiagramsTo")+":");m.appendChild(l);var q=function(){u=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+
+var StorageDialog=function(a,c,b){function d(p,d,t,e,A,k){function g(){mxEvent.addListener(x,"click",null!=k?k:function(){t!=App.MODE_GOOGLE||a.isDriveDomain()?t==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(t,n.checked);c()})):t==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(t,n.checked);
+c()})):(a.setMode(t,n.checked),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}++q>b&&(mxUtils.br(f),q=0);var x=document.createElement("a");x.style.overflow="hidden";x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.className="geBaseButton";x.style.boxSizing="border-box";x.style.fontSize="11px";x.style.position="relative";x.style.margin="4px";x.style.marginTop="2px";x.style.padding="8px 10px 12px 10px";x.style.width="88px";x.style.height=StorageDialog.extended?"50px":
+"100px";x.style.whiteSpace="nowrap";x.setAttribute("title",d);mxClient.IS_QUIRKS&&(x.style.cssFloat="left",x.style.zoom="1");var u=document.createElement("div");u.style.textOverflow="ellipsis";u.style.overflow="hidden";if(null!=p){var B=document.createElement("img");B.setAttribute("src",p);B.setAttribute("border","0");B.setAttribute("align","absmiddle");B.style.width=StorageDialog.extended?"24px":"60px";B.style.height=StorageDialog.extended?"24px":"60px";B.style.paddingBottom=StorageDialog.extended?
+"4px":"6px";x.appendChild(B)}else u.style.paddingTop="5px",u.style.whiteSpace="normal",mxClient.IS_IOS?(x.style.padding="0px 10px 20px 10px",x.style.top="6px"):mxClient.IS_FF&&(u.style.paddingTop="0px",u.style.marginTop="-2px");StorageDialog.extended&&(x.style.paddingTop="4px",x.style.marginBottom="0px",u.display="inline-block",2==b&&(B.style.width="38px",B.style.height="38px",x.style.width="80px",x.style.height="68px"));x.appendChild(u);mxUtils.write(u,d);if(null!=A)for(p=0;p<A.length;p++)mxUtils.br(u),
+mxUtils.write(u,A[p]);if(null!=e&&null==a[e]){B.style.visibility="hidden";mxUtils.setOpacity(u,10);var v=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});v.spin(x);var F=window.setTimeout(function(){null==a[e]&&(v.stop(),x.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,c){null!=a[e]&&c.getProperty("client")==a[e]&&(window.clearTimeout(F),mxUtils.setOpacity(u,
+100),B.style.visibility="",v.stop(),g(),"drive"==e&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else g();f.appendChild(x)}b=null!=b?b:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace="nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var e=a.addLanguageMenu(g,!0);null!=e&&(e.style.bottom=parseInt("28px")-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){e=document.createElement("a");e.setAttribute("href","https://about.draw.io/support/");e.setAttribute("title",
+mxResources.get("help"));e.setAttribute("target","_blank");e.style.position="absolute";e.style.userSelect="none";e.style.textDecoration="none";e.style.cursor="pointer";e.style.fontSize="12px";e.style.bottom="28px";e.style.left="26px";e.style.color="gray";var k=document.createElement("img");mxUtils.setOpacity(k,50);k.style.height="16px";k.style.width="16px";k.setAttribute("border","0");k.setAttribute("valign","bottom");k.setAttribute("src",Editor.helpImage);k.style.marginRight="2px";e.appendChild(k);
+mxUtils.write(e,mxResources.get("help"));g.appendChild(e)}var m=document.createElement("div");m.style.position="absolute";m.style.cursor="pointer";m.style.fontSize="12px";m.style.bottom="28px";m.style.color="gray";m.style.userSelect="none";mxUtils.write(m,mxResources.get("decideLater"));mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,0)");m.style.left="50%";a.isOfflineApp()&&(m.style.bottom="28px");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)m.style.marginLeft=
+-Math.round(m.clientWidth/2)+"px"};g.appendChild(m);mxEvent.addListener(m,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=b});e=document.createElement("div");mxClient.IS_QUIRKS&&(e.style.whiteSpace="nowrap",e.style.cssFloat="left");e.style.border="1px solid #d3d3d3";e.style.borderWidth="1px 0px 1px 0px";e.style.padding="12px 0px 12px 0px";var n=document.createElement("input");n.setAttribute("type",
+"checkbox");n.setAttribute("checked","checked");n.defaultChecked=!0;var q=0,f=document.createElement("div");f.style.paddingTop="2px";e.appendChild(f);var l=document.createElement("p"),k=document.createElement("p");k.style.fontSize="16pt";k.style.padding="0px";k.style.paddingTop="4px";k.style.paddingBottom="16px";k.style.margin="0px";k.style.color="gray";mxUtils.write(k,mxResources.get("saveDiagramsTo")+":");g.appendChild(k);var p=function(){q=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+
"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");d(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||d(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);StorageDialog.extended&&("function"===typeof window.DropboxClient&&
-d(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox"),null!=a.gitHub&&d(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub"),null!=a.gitLab&&d(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab"))};m.appendChild(f);q();l=document.createElement("p");l.style.marginTop="8px";l.style.marginBottom="6px";var v=document.createElement("div");v.style.marginBottom="10px";if(!a.isOfflineApp()){var y=document.createElement("a");
-y.style.color="gray";y.style.fontSize="12px";y.style.cursor="pointer";y.style.userSelect="none";mxUtils.write(y,(StorageDialog.extended?mxResources.get("showLess"):mxResources.get("showMore"))+"...");v.appendChild(y);l.appendChild(v);mxEvent.addListener(y,"click",function(a){g.innerHTML="";y.innerHTML="";StorageDialog.extended=!StorageDialog.extended;q();mxUtils.write(y,(StorageDialog.extended?mxResources.get("showLess"):mxResources.get("showMore"))+"...");mxEvent.consume(a)})}l.appendChild(p);var t=
-document.createElement("span");t.style.color="gray";t.style.fontSize="12px";t.style.userSelect="none";mxUtils.write(t," "+mxResources.get("rememberThisSetting"));l.appendChild(t);mxUtils.br(l);v=a.getRecent();if(!a.isOfflineApp()&&null!=v&&0<v.length){var A=document.createElement("select");A.style.marginTop="8px";A.style.maxWidth="170px";var z=document.createElement("option");z.setAttribute("value","");z.setAttribute("selected","selected");z.style.textAlign="center";mxUtils.write(z,mxResources.get("openRecent")+
-"...");A.appendChild(z);for(z=0;z<v.length;z++)(function(a){var b=a.mode;b==App.MODE_GOOGLE?b="googleDrive":b==App.MODE_ONEDRIVE&&(b="oneDrive");var c=document.createElement("option");c.setAttribute("value",a.id);mxUtils.write(c,a.title+" ("+mxResources.get(b)+")");A.appendChild(c)})(v[z]);l.appendChild(A);mxEvent.addListener(A,"change",function(b){""!=A.value&&a.loadFile(A.value)})}else l.style.marginTop="20px",f.style.padding="30px 0px 26px 0px";Graph.fileSupport&&(v=document.createElement("div"),
-v.style.marginBottom="10px",v.style.padding="18px 0px 6px 0px",z=document.createElement("a"),z.style.cursor="pointer",z.style.fontSize="12px",z.style.color="gray",z.style.userSelect="none",mxUtils.write(z,mxResources.get("import")+": "+mxResources.get("gliffy")+", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(z,"click",function(){if(null==a.storageFileInputElt){var b=document.createElement("input");b.setAttribute("type",
-"file");mxEvent.addListener(b,"change",function(){null!=b.files&&(a.hideDialog(),a.openFiles(b.files,!0),b.type="",b.type="file",b.value="")});b.style.display="none";document.body.appendChild(b);a.storageFileInputElt=b}a.storageFileInputElt.click()}),v.appendChild(z),l.appendChild(v),f.style.paddingBottom="4px");f.appendChild(l);mxEvent.addListener(t,"click",function(a){p.checked=!p.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=
-document.documentMode)&&window.setTimeout(function(){null==a.drive&&(k.style.padding="8px",k.style.fontSize="9pt",k.style.marginTop="-14px",k.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://desk.draw.io/a/solutions/articles/16000074659" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",m.appendChild(k))},5E3);this.container=m};
+d(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox"),null!=a.gitHub&&d(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub"),null!=a.gitLab&&d(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab"))};g.appendChild(e);p();k=document.createElement("p");k.style.marginTop="8px";k.style.marginBottom="6px";var u=document.createElement("div");u.style.marginBottom="10px";if(!a.isOfflineApp()){var v=document.createElement("a");
+v.style.color="gray";v.style.fontSize="12px";v.style.cursor="pointer";v.style.userSelect="none";mxUtils.write(v,(StorageDialog.extended?mxResources.get("showLess"):mxResources.get("showMore"))+"...");u.appendChild(v);k.appendChild(u);mxEvent.addListener(v,"click",function(a){f.innerHTML="";v.innerHTML="";StorageDialog.extended=!StorageDialog.extended;p();mxUtils.write(v,(StorageDialog.extended?mxResources.get("showLess"):mxResources.get("showMore"))+"...");mxEvent.consume(a)})}k.appendChild(n);var t=
+document.createElement("span");t.style.color="gray";t.style.fontSize="12px";t.style.userSelect="none";mxUtils.write(t," "+mxResources.get("rememberThisSetting"));k.appendChild(t);mxUtils.br(k);u=a.getRecent();if(!a.isOfflineApp()&&null!=u&&0<u.length){var z=document.createElement("select");z.style.marginTop="8px";z.style.maxWidth="170px";var y=document.createElement("option");y.setAttribute("value","");y.setAttribute("selected","selected");y.style.textAlign="center";mxUtils.write(y,mxResources.get("openRecent")+
+"...");z.appendChild(y);for(y=0;y<u.length;y++)(function(a){var b=a.mode;b==App.MODE_GOOGLE?b="googleDrive":b==App.MODE_ONEDRIVE&&(b="oneDrive");var c=document.createElement("option");c.setAttribute("value",a.id);mxUtils.write(c,a.title+" ("+mxResources.get(b)+")");z.appendChild(c)})(u[y]);k.appendChild(z);mxEvent.addListener(z,"change",function(b){""!=z.value&&a.loadFile(z.value)})}else k.style.marginTop="20px",e.style.padding="30px 0px 26px 0px";Graph.fileSupport&&(u=document.createElement("div"),
+u.style.marginBottom="10px",u.style.padding="18px 0px 6px 0px",y=document.createElement("a"),y.style.cursor="pointer",y.style.fontSize="12px",y.style.color="gray",y.style.userSelect="none",mxUtils.write(y,mxResources.get("import")+": "+mxResources.get("gliffy")+", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(y,"click",function(){if(null==a.storageFileInputElt){var b=document.createElement("input");b.setAttribute("type",
+"file");mxEvent.addListener(b,"change",function(){null!=b.files&&(a.hideDialog(),a.openFiles(b.files,!0),b.type="",b.type="file",b.value="")});b.style.display="none";document.body.appendChild(b);a.storageFileInputElt=b}a.storageFileInputElt.click()}),u.appendChild(y),k.appendChild(u),e.style.paddingBottom="4px");e.appendChild(k);mxEvent.addListener(t,"click",function(a){n.checked=!n.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=
+document.documentMode)&&window.setTimeout(function(){null==a.drive&&(l.style.padding="8px",l.style.fontSize="9pt",l.style.marginTop="-14px",l.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://desk.draw.io/a/solutions/articles/16000074659" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",g.appendChild(l))},5E3);this.container=g};
StorageDialog.extended=!1;
var SplashDialog=function(a){var c=document.createElement("div");c.style.textAlign="center";var b=a.addLanguageMenu(c,!0);null!=b&&(b.style.bottom="19px");b=null;b=a.getServiceCount();if(!a.isOffline()&&1<b){b=document.createElement("a");b.setAttribute("href","https://about.draw.io/support/");b.setAttribute("title",mxResources.get("help"));b.setAttribute("target","_blank");b.style.position="absolute";b.style.fontSize="12px";b.style.textDecoration="none";b.style.cursor="pointer";b.style.bottom="22px";
b.style.left="26px";b.style.color="gray";var d=document.createElement("img");mxUtils.setOpacity(d,50);d.style.height="16px";d.style.width="16px";d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);d.style.marginRight="2px";b.appendChild(d);mxUtils.write(b,mxResources.get("help"));c.appendChild(b)}b=document.createElement("p");b.style.fontSize="16pt";b.style.padding="0px";b.style.paddingTop="2px";b.style.margin="0px";b.style.color="gray";d=document.createElement("img");
-d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="40px";d.style.height="40px";d.style.marginRight="12px";d.style.paddingBottom="4px";var m="";a.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",m=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",m=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",m=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+
-"/github-logo.svg",m=mxResources.get("github")):a.mode==App.MODE_GITLAB?(d.src=IMAGE_PATH+"/gitlab-logo.svg",m=mxResources.get("gitlab")):a.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",m=mxResources.get("browser")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",m=mxResources.get("device"));var f=document.createElement("div");f.style.margin="4px 0px 0px 0px";var l=document.createElement("button");l.className="geBigButton";l.style.fontSize="18px";l.style.padding="10px";l.style.width="340px";
-mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(f.style.padding="42px 0px 56px 0px",l.style.marginBottom="12px"):(b.appendChild(d),mxUtils.write(b,m),c.appendChild(b),f.style.border="1px solid #d3d3d3",f.style.borderWidth="1px 0px 1px 0px",f.style.padding="18px 0px 24px 0px",l.style.marginBottom="8px");mxClient.IS_QUIRKS&&(f.style.whiteSpace="nowrap",f.style.cssFloat="left");mxClient.IS_QUIRKS&&(l.style.width="340px");mxUtils.write(l,mxResources.get("createNewDiagram"));mxEvent.addListener(l,"click",
-function(){a.hideDialog();a.actions.get("new").funct()});f.appendChild(l);mxUtils.br(f);l=document.createElement("button");l.className="geBigButton";l.style.marginBottom="22px";l.style.fontSize="18px";l.style.padding="10px";l.style.width="340px";mxClient.IS_QUIRKS&&(l.style.width="340px");mxUtils.write(l,mxResources.get("openExistingDiagram"));mxEvent.addListener(l,"click",function(){a.actions.get("open").funct()});f.appendChild(l);a.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?
-mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?mxResources.get("github"):a.mode==App.MODE_GITLAB?mxResources.get("gitlab"):a.mode==App.MODE_TRELLO?mxResources.get("trello"):a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var b=function(b){l.style.marginBottom="24px";var c=document.createElement("a");c.setAttribute("href","javascript:void(0)");
-c.style.display="inline-block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));l.style.marginBottom="16px";f.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});f.appendChild(c)},n=null!=a.drive?a.drive.getUsersList():[];if(a.mode==App.MODE_GOOGLE&&0<n.length){b=document.createElement("span");b.style.marginTop="6px";mxUtils.write(b,mxResources.get("changeUser")+":");l.style.marginBottom="16px";f.style.paddingBottom=
-"18px";f.appendChild(b);var p=document.createElement("select");p.style.marginLeft="4px";p.style.width="200px";for(b=0;b<n.length;b++)d=document.createElement("option"),mxUtils.write(d,n[b].displayName),d.value=b,p.appendChild(d),d=document.createElement("option"),d.innerHTML="&nbsp;&nbsp;&nbsp;",mxUtils.write(d,"<"+n[b].email+">"),d.setAttribute("disabled","disabled"),p.appendChild(d);d=document.createElement("option");mxUtils.write(d,mxResources.get("addAccount"));d.value=n.length;p.appendChild(d);
-mxEvent.addListener(p,"change",function(){var b=p.value,c=n.length!=b;c&&a.drive.setUser(n[b]);a.drive.authorize(c,function(){a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash()},function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})},!0)});f.appendChild(p)}else a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?b(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?b(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_GITLAB&&
-null!=a.gitLab?b(function(){a.gitLab.logout();a.openLink(DRAWIO_GITLAB_URL+"/users/sign_out")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&b(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&b(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")});mxUtils.br(f);b=document.createElement("a");b.setAttribute("href","javascript:void(0)");b.style.display="inline-block";b.style.marginTop="8px";mxUtils.write(b,mxResources.get("changeStorage"));
-mxEvent.addListener(b,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)});f.appendChild(b)}c.appendChild(f);this.container=c},EmbedDialog=function(a,c,b,d,m,f){d=document.createElement("div");var l=/^https?:\/\//.test(c)||/^mailto:\/\//.test(c);null!=f?mxUtils.write(d,f):mxUtils.write(d,mxResources.get(5E5>c.length?l?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);f=document.createElement("div");f.style.position="absolute";f.style.top="30px";f.style.right="30px";
-f.style.color="gray";mxUtils.write(f,a.formatFileSize(c.length));d.appendChild(f);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");d.appendChild(n);mxUtils.br(d);this.init=function(){window.setTimeout(function(){5E5>
-c.length?(n.value=c,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=c.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};f=document.createElement("div");f.style.position="absolute";f.style.bottom="36px";f.style.right="32px";var p=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!l||navigator.standalone||!(l||mxClient.IS_SVG&&(null==document.documentMode||
-9<document.documentMode))||(p=mxUtils.button(mxResources.get(5E5>c.length?"preview":"openInNewWindow"),function(){var g=5E5>c.length?n.value:c;if(null!=m)m(g);else if(l)try{var q=a.openLink(g);null!=q&&(null==b||0<b)&&window.setTimeout(mxUtils.bind(this,function(){null!=q&&null!=q.location.href&&q.location.href.substring(0,8)!=g.substring(0,8)&&(q.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),b||500)}catch(y){a.handleError({message:y.message||mxResources.get("drawingTooLarge")})}else{var d=
-window.open(),d=null!=d?d.document:null;null!=d?(d.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+c+"</body></html>"),d.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),p.className="geBtn",f.appendChild(p));if(!l||7500<c.length){var u=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",c,"text/plain")});u.className="geBtn";f.appendChild(u)}if(l&&(!a.isOffline()||
-mxClient.IS_CHROMEAPP)){if(51200>c.length){var g=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")})}}),u=document.createElement("img");u.setAttribute("src",Editor.facebookImage);u.setAttribute("width","18");u.setAttribute("height","18");u.setAttribute("border","0");g.appendChild(u);g.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+
-" max)");g.style.verticalAlign="bottom";g.style.paddingTop="4px";g.style.minWidth="46px";g.className="geBtn";f.appendChild(g)}7168>c.length&&(g=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")})}}),u=document.createElement("img"),u.setAttribute("src",Editor.tweetImage),u.setAttribute("width",
-"18"),u.setAttribute("height","18"),u.setAttribute("border","0"),u.style.marginBottom="5px",g.appendChild(u),g.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),g.style.verticalAlign="bottom",g.style.paddingTop="4px",g.style.minWidth="46px",g.className="geBtn",f.appendChild(g))}u=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.appendChild(u);g=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>c.length?mxClient.IS_SF||null!=document.documentMode?u.className="geBtn gePrimaryBtn":(f.appendChild(g),g.className="geBtn gePrimaryBtn",u.className="geBtn"):(f.appendChild(p),u.className="geBtn",p.className="geBtn gePrimaryBtn");d.appendChild(f);this.container=d};EmbedDialog.showPreviewOption=!0;
-var GoogleSitesDialog=function(a,c){function b(){var a=null!=B&&null!=B.getTitle()?B.getTitle():this.defaultFilename;if(C.checked&&""!=q.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(q.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<G.length&&(b+="&s="+G);""!=v.value&&"0"!=v.value&&(b+="&border="+v.value);""!=k.value&&(b+="&height="+k.value);b+="&pan="+(y.checked?"1":"0");b+="&zoom="+(t.checked?"1":"0");b+="&fit="+(x.checked?"1":"0");
-b+="&resize="+(D.checked?"1":"0");b+="&x0="+Number(g.value);b+="&y0="+p;m.mathEnabled&&(b+="&math=1");z.checked?b+="&edit=_blank":A.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));u.value=b}else B.constructor==DriveFile||B.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=q.value?b+=encodeURIComponent(mxUtils.htmlEntities(q.value))+"&type=3":(b+=B.getHash().substring(1),b=B.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
-a&&(b+="&title="+encodeURIComponent(a)),""!=k.value&&(a=parseInt(k.value)+parseInt(g.value),b+="&height="+a),u.value=b):u.value=""}var d=document.createElement("div"),m=a.editor.graph,f=m.getGraphBounds(),l=m.view.scale,n=Math.floor(f.x/l-m.view.translate.x),p=Math.floor(f.y/l-m.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var u=document.createElement("input");u.setAttribute("type","text");u.style.marginBottom="8px";u.style.marginTop="2px";u.style.width="410px";
-d.appendChild(u);mxUtils.br(d);this.init=function(){u.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,mxResources.get("top")+":");var g=document.createElement("input");g.setAttribute("type","text");g.setAttribute("size","4");g.style.marginRight="16px";g.style.marginLeft="4px";g.value=n;d.appendChild(g);mxUtils.write(d,mxResources.get("height")+":");var k=document.createElement("input");k.setAttribute("type",
-"text");k.setAttribute("size","4");k.style.marginLeft="4px";k.value=Math.ceil(f.height/l);d.appendChild(k);mxUtils.br(d);f=document.createElement("hr");f.setAttribute("size","1");f.style.marginBottom="16px";f.style.marginTop="16px";d.appendChild(f);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);var q=document.createElement("input");q.setAttribute("type","text");q.setAttribute("size","28");q.style.marginBottom="8px";q.style.marginTop="2px";q.style.width="410px";q.value=c||"";
-d.appendChild(q);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var v=document.createElement("input");v.setAttribute("type","text");v.setAttribute("size","3");v.style.marginBottom="8px";v.style.marginLeft="4px";v.value="0";d.appendChild(v);mxUtils.br(d);var y=document.createElement("input");y.setAttribute("type","checkbox");y.setAttribute("checked","checked");y.defaultChecked=!0;y.style.marginLeft="16px";d.appendChild(y);mxUtils.write(d,mxResources.get("pan")+" ");var t=document.createElement("input");
-t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="8px";d.appendChild(t);mxUtils.write(d,mxResources.get("zoom")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";A.setAttribute("title",window.location.href);d.appendChild(A);mxUtils.write(d,mxResources.get("edit")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";d.appendChild(z);mxUtils.write(d,
-mxResources.get("asNew")+" ");mxUtils.br(d);var D=document.createElement("input");D.setAttribute("type","checkbox");D.setAttribute("checked","checked");D.defaultChecked=!0;D.style.marginLeft="16px";d.appendChild(D);mxUtils.write(d,mxResources.get("resize")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";d.appendChild(x);mxUtils.write(d,mxResources.get("fit")+" ");var C=document.createElement("input");C.setAttribute("type","checkbox");C.style.marginLeft=
-"8px";d.appendChild(C);mxUtils.write(d,mxResources.get("embed")+" ");var G=a.getBasenames().join(";"),B=a.getCurrentFile();mxEvent.addListener(y,"change",b);mxEvent.addListener(t,"change",b);mxEvent.addListener(D,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(A,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(k,"change",b);mxEvent.addListener(g,"change",b);mxEvent.addListener(v,"change",b);mxEvent.addListener(q,"change",b);b();
-mxEvent.addListener(u,"click",function(){u.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)});f=document.createElement("div");f.style.paddingTop="12px";f.style.textAlign="right";l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn gePrimaryBtn";f.appendChild(l);d.appendChild(f);this.container=d},CreateGraphDialog=function(a,c,b){var d=document.createElement("div");d.style.textAlign=
-"right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);d.appendChild(c);var f=new Graph(c);f.setCellsCloneable(!0);f.setPanning(!0);f.setAllowDanglingEdges(!1);f.connectionHandler.select=!1;f.view.setTranslate(20,20);f.border=20;f.panningHandler.useLeftButtonForPanning=!0;var l="curved=1;";f.cellRenderer.installCellOverlayListeners=
-function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(c.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchstart",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))})};f.getAllConnectionConstraints=function(){return null};f.connectionHandler.marker.highlight.keepOnTop=
-!1;f.connectionHandler.createEdgeState=function(a){a=f.createEdge(null,null,null,null,null,l);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var n=f.getDefaultParent(),p=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){f.connectionHandler.reset();f.clearSelection();var g=f.getCellGeometry(a),q;k(function(){q=f.insertVertex(n,null,"Entry",g.x,g.y,80,30,"rounded=1;");p(q);f.view.refresh(q);
-f.insertEdge(n,null,"",a,q,l)},function(){f.scrollCellToVisible(q)})});b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),g=b.getProperty("state");f.popupMenuHandler.hideMenu();f.stopEditing(!1);var k=mxUtils.convertPoint(f.container,mxEvent.getClientX(c),mxEvent.getClientY(c));f.connectionHandler.start(g,k.x,k.y);f.isMouseDown=!0;f.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});f.addCellOverlay(a,b)});f.getModel().beginUpdate();var u;try{u=f.insertVertex(n,null,"Start",
-0,0,80,30,"ellipse"),p(u)}finally{f.getModel().endUpdate()}var g;"horizontalTree"==b?(g=new mxCompactTreeLayout(f),g.edgeRouting=!1,g.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==b?(g=new mxCompactTreeLayout(f,!1),g.edgeRouting=!1,g.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==b?(g=new mxRadialTreeLayout(f,!1),g.edgeRouting=!1,g.levelDistance=80):"verticalFlow"==b?g=new mxHierarchicalLayout(f,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
-b?g=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):"organic"==b?(g=new mxFastOrganicLayout(f,!1),g.forceConstant=80):"circle"==b&&(g=new mxCircleLayout(f));if(null!=g){var k=function(a,b){f.getModel().beginUpdate();try{null!=a&&a(),g.execute(f.getDefaultParent(),u)}catch(D){throw D;}finally{var c=new mxMorphing(f);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},q=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
-function(a,b,c,g,d){q.apply(this,arguments);k()};f.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);k()};f.connectionHandler.addListener(mxEvent.CONNECT,function(){k()})}var v=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=c.parentNode&&(f.destroy(),c.parentNode.removeChild(c));a.hideDialog()})});v.className="geBtn";a.editor.cancelFirst&&d.appendChild(v);var y=mxUtils.button(mxResources.get("insert"),function(){f.clearCellOverlays();
-var b=a.editor.graph.getFreeInsertPoint(),b=a.editor.graph.importCells(f.getModel().getChildren(f.getDefaultParent()),b.x,b.y),g=a.editor.graph.view,k=g.getBounds(b);k.x-=g.translate.x;k.y-=g.translate.y;a.editor.graph.scrollRectToVisible(k);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(f.destroy(),c.parentNode.removeChild(c));a.hideDialog()});d.appendChild(y);y.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(v)};this.container=d};
+d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="40px";d.style.height="40px";d.style.marginRight="12px";d.style.paddingBottom="4px";var g="";a.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",g=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",g=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",g=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+
+"/github-logo.svg",g=mxResources.get("github")):a.mode==App.MODE_GITLAB?(d.src=IMAGE_PATH+"/gitlab-logo.svg",g=mxResources.get("gitlab")):a.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",g=mxResources.get("browser")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",g=mxResources.get("device"));var e=document.createElement("div");e.style.margin="4px 0px 0px 0px";var k=document.createElement("button");k.className="geBigButton";k.style.fontSize="18px";k.style.padding="10px";k.style.width="340px";
+mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(e.style.padding="42px 0px 56px 0px",k.style.marginBottom="12px"):(b.appendChild(d),mxUtils.write(b,g),c.appendChild(b),e.style.border="1px solid #d3d3d3",e.style.borderWidth="1px 0px 1px 0px",e.style.padding="18px 0px 24px 0px",k.style.marginBottom="8px");mxClient.IS_QUIRKS&&(e.style.whiteSpace="nowrap",e.style.cssFloat="left");mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("createNewDiagram"));mxEvent.addListener(k,"click",
+function(){a.hideDialog();a.actions.get("new").funct()});e.appendChild(k);mxUtils.br(e);k=document.createElement("button");k.className="geBigButton";k.style.marginBottom="22px";k.style.fontSize="18px";k.style.padding="10px";k.style.width="340px";mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("openExistingDiagram"));mxEvent.addListener(k,"click",function(){a.actions.get("open").funct()});e.appendChild(k);a.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?
+mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?mxResources.get("github"):a.mode==App.MODE_GITLAB?mxResources.get("gitlab"):a.mode==App.MODE_TRELLO?mxResources.get("trello"):a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var b=function(b){k.style.marginBottom="24px";var c=document.createElement("a");c.setAttribute("href","javascript:void(0)");
+c.style.display="inline-block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));k.style.marginBottom="16px";e.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});e.appendChild(c)},m=null!=a.drive?a.drive.getUsersList():[];if(a.mode==App.MODE_GOOGLE&&0<m.length){b=document.createElement("span");b.style.marginTop="6px";mxUtils.write(b,mxResources.get("changeUser")+":");k.style.marginBottom="16px";e.style.paddingBottom=
+"18px";e.appendChild(b);var n=document.createElement("select");n.style.marginLeft="4px";n.style.width="200px";for(b=0;b<m.length;b++)d=document.createElement("option"),mxUtils.write(d,m[b].displayName),d.value=b,n.appendChild(d),d=document.createElement("option"),d.innerHTML="&nbsp;&nbsp;&nbsp;",mxUtils.write(d,"<"+m[b].email+">"),d.setAttribute("disabled","disabled"),n.appendChild(d);d=document.createElement("option");mxUtils.write(d,mxResources.get("addAccount"));d.value=m.length;n.appendChild(d);
+mxEvent.addListener(n,"change",function(){var b=n.value,c=m.length!=b;c&&a.drive.setUser(m[b]);a.drive.authorize(c,function(){a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash()},function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})},!0)});e.appendChild(n)}else a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?b(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?b(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_GITLAB&&
+null!=a.gitLab?b(function(){a.gitLab.logout();a.openLink(DRAWIO_GITLAB_URL+"/users/sign_out")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&b(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&b(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")});mxUtils.br(e);b=document.createElement("a");b.setAttribute("href","javascript:void(0)");b.style.display="inline-block";b.style.marginTop="8px";mxUtils.write(b,mxResources.get("changeStorage"));
+mxEvent.addListener(b,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)});e.appendChild(b)}c.appendChild(e);this.container=c},EmbedDialog=function(a,c,b,d,g,e){d=document.createElement("div");var k=/^https?:\/\//.test(c)||/^mailto:\/\//.test(c);null!=e?mxUtils.write(d,e):mxUtils.write(d,mxResources.get(5E5>c.length?k?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(d);e=document.createElement("div");e.style.position="absolute";e.style.top="30px";e.style.right="30px";
+e.style.color="gray";mxUtils.write(e,a.formatFileSize(c.length));d.appendChild(e);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>
+c.length?(m.value=c,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=c.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};e=document.createElement("div");e.style.position="absolute";e.style.bottom="36px";e.style.right="32px";var n=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!k||navigator.standalone||!(k||mxClient.IS_SVG&&(null==document.documentMode||
+9<document.documentMode))||(n=mxUtils.button(mxResources.get(5E5>c.length?"preview":"openInNewWindow"),function(){var f=5E5>c.length?m.value:c;if(null!=g)g(f);else if(k)try{var p=a.openLink(f);null!=p&&(null==b||0<b)&&window.setTimeout(mxUtils.bind(this,function(){null!=p&&null!=p.location.href&&p.location.href.substring(0,8)!=f.substring(0,8)&&(p.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),b||500)}catch(v){a.handleError({message:v.message||mxResources.get("drawingTooLarge")})}else{var d=
+window.open(),d=null!=d?d.document:null;null!=d?(d.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+c+"</body></html>"),d.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),n.className="geBtn",e.appendChild(n));if(!k||7500<c.length){var q=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",c,"text/plain")});q.className="geBtn";e.appendChild(q)}if(k&&(!a.isOffline()||
+mxClient.IS_CHROMEAPP)){if(51200>c.length){var f=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(m.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),q=document.createElement("img");q.setAttribute("src",Editor.facebookImage);q.setAttribute("width","18");q.setAttribute("height","18");q.setAttribute("border","0");f.appendChild(q);f.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+
+" max)");f.style.verticalAlign="bottom";f.style.paddingTop="4px";f.style.minWidth="46px";f.className="geBtn";e.appendChild(f)}7168>c.length&&(f=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(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),q=document.createElement("img"),q.setAttribute("src",Editor.tweetImage),q.setAttribute("width",
+"18"),q.setAttribute("height","18"),q.setAttribute("border","0"),q.style.marginBottom="5px",f.appendChild(q),f.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),f.style.verticalAlign="bottom",f.style.paddingTop="4px",f.style.minWidth="46px",f.className="geBtn",e.appendChild(f))}q=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.appendChild(q);f=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>c.length?mxClient.IS_SF||null!=document.documentMode?q.className="geBtn gePrimaryBtn":(e.appendChild(f),f.className="geBtn gePrimaryBtn",q.className="geBtn"):(e.appendChild(n),q.className="geBtn",n.className="geBtn gePrimaryBtn");d.appendChild(e);this.container=d};EmbedDialog.showPreviewOption=!0;
+var GoogleSitesDialog=function(a,c){function b(){var a=null!=A&&null!=A.getTitle()?A.getTitle():this.defaultFilename;if(B.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<E.length&&(b+="&s="+E);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=l.value&&(b+="&height="+l.value);b+="&pan="+(v.checked?"1":"0");b+="&zoom="+(t.checked?"1":"0");b+="&fit="+(x.checked?"1":"0");
+b+="&resize="+(C.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+n;g.mathEnabled&&(b+="&math=1");y.checked?b+="&edit=_blank":z.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));q.value=b}else A.constructor==DriveFile||A.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=A.getHash().substring(1),b=A.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
+a&&(b+="&title="+encodeURIComponent(a)),""!=l.value&&(a=parseInt(l.value)+parseInt(f.value),b+="&height="+a),q.value=b):q.value=""}var d=document.createElement("div"),g=a.editor.graph,e=g.getGraphBounds(),k=g.view.scale,m=Math.floor(e.x/k-g.view.translate.x),n=Math.floor(e.y/k-g.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var q=document.createElement("input");q.setAttribute("type","text");q.style.marginBottom="8px";q.style.marginTop="2px";q.style.width="410px";
+d.appendChild(q);mxUtils.br(d);this.init=function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,mxResources.get("top")+":");var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","4");f.style.marginRight="16px";f.style.marginLeft="4px";f.value=m;d.appendChild(f);mxUtils.write(d,mxResources.get("height")+":");var l=document.createElement("input");l.setAttribute("type",
+"text");l.setAttribute("size","4");l.style.marginLeft="4px";l.value=Math.ceil(e.height/k);d.appendChild(l);mxUtils.br(d);e=document.createElement("hr");e.setAttribute("size","1");e.style.marginBottom="16px";e.style.marginTop="16px";d.appendChild(e);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);var p=document.createElement("input");p.setAttribute("type","text");p.setAttribute("size","28");p.style.marginBottom="8px";p.style.marginTop="2px";p.style.width="410px";p.value=c||"";
+d.appendChild(p);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.setAttribute("size","3");u.style.marginBottom="8px";u.style.marginLeft="4px";u.value="0";d.appendChild(u);mxUtils.br(d);var v=document.createElement("input");v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="16px";d.appendChild(v);mxUtils.write(d,mxResources.get("pan")+" ");var t=document.createElement("input");
+t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="8px";d.appendChild(t);mxUtils.write(d,mxResources.get("zoom")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";z.setAttribute("title",window.location.href);d.appendChild(z);mxUtils.write(d,mxResources.get("edit")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";d.appendChild(y);mxUtils.write(d,
+mxResources.get("asNew")+" ");mxUtils.br(d);var C=document.createElement("input");C.setAttribute("type","checkbox");C.setAttribute("checked","checked");C.defaultChecked=!0;C.style.marginLeft="16px";d.appendChild(C);mxUtils.write(d,mxResources.get("resize")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";d.appendChild(x);mxUtils.write(d,mxResources.get("fit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft=
+"8px";d.appendChild(B);mxUtils.write(d,mxResources.get("embed")+" ");var E=a.getBasenames().join(";"),A=a.getCurrentFile();mxEvent.addListener(v,"change",b);mxEvent.addListener(t,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(B,"change",b);mxEvent.addListener(l,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(p,"change",b);b();
+mxEvent.addListener(q,"click",function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)});e=document.createElement("div");e.style.paddingTop="12px";e.style.textAlign="right";k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn gePrimaryBtn";e.appendChild(k);d.appendChild(e);this.container=d},CreateGraphDialog=function(a,c,b){var d=document.createElement("div");d.style.textAlign=
+"right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);d.appendChild(c);var e=new Graph(c);e.setCellsCloneable(!0);e.setPanning(!0);e.setAllowDanglingEdges(!1);e.connectionHandler.select=!1;e.view.setTranslate(20,20);e.border=20;e.panningHandler.useLeftButtonForPanning=!0;var k="curved=1;";e.cellRenderer.installCellOverlayListeners=
+function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(c.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchstart",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))})};e.getAllConnectionConstraints=function(){return null};e.connectionHandler.marker.highlight.keepOnTop=
+!1;e.connectionHandler.createEdgeState=function(a){a=e.createEdge(null,null,null,null,null,k);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var m=e.getDefaultParent(),n=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){e.connectionHandler.reset();e.clearSelection();var f=e.getCellGeometry(a),p;l(function(){p=e.insertVertex(m,null,"Entry",f.x,f.y,80,30,"rounded=1;");n(p);e.view.refresh(p);
+e.insertEdge(m,null,"",a,p,k)},function(){e.scrollCellToVisible(p)})});b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),f=b.getProperty("state");e.popupMenuHandler.hideMenu();e.stopEditing(!1);var l=mxUtils.convertPoint(e.container,mxEvent.getClientX(c),mxEvent.getClientY(c));e.connectionHandler.start(f,l.x,l.y);e.isMouseDown=!0;e.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});e.addCellOverlay(a,b)});e.getModel().beginUpdate();var q;try{q=e.insertVertex(m,null,"Start",
+0,0,80,30,"ellipse"),n(q)}finally{e.getModel().endUpdate()}var f;"horizontalTree"==b?(f=new mxCompactTreeLayout(e),f.edgeRouting=!1,f.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==b?(f=new mxCompactTreeLayout(e,!1),f.edgeRouting=!1,f.levelDistance=30,k="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==b?(f=new mxRadialTreeLayout(e,!1),f.edgeRouting=!1,f.levelDistance=80):"verticalFlow"==b?f=new mxHierarchicalLayout(e,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
+b?f=new mxHierarchicalLayout(e,mxConstants.DIRECTION_WEST):"organic"==b?(f=new mxFastOrganicLayout(e,!1),f.forceConstant=80):"circle"==b&&(f=new mxCircleLayout(e));if(null!=f){var l=function(a,b){e.getModel().beginUpdate();try{null!=a&&a(),f.execute(e.getDefaultParent(),q)}catch(C){throw C;}finally{var c=new mxMorphing(e);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){e.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},p=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
+function(a,b,c,f,d){p.apply(this,arguments);l()};e.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);l()};e.connectionHandler.addListener(mxEvent.CONNECT,function(){l()})}var u=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=c.parentNode&&(e.destroy(),c.parentNode.removeChild(c));a.hideDialog()})});u.className="geBtn";a.editor.cancelFirst&&d.appendChild(u);var v=mxUtils.button(mxResources.get("insert"),function(){e.clearCellOverlays();
+var b=a.editor.graph.getFreeInsertPoint(),b=a.editor.graph.importCells(e.getModel().getChildren(e.getDefaultParent()),b.x,b.y),f=a.editor.graph.view,l=f.getBounds(b);l.x-=f.translate.x;l.y-=f.translate.y;a.editor.graph.scrollRectToVisible(l);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(e.destroy(),c.parentNode.removeChild(c));a.hideDialog()});d.appendChild(v);v.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(u)};this.container=d};
CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==":
IMAGE_PATH+"/handle-connect.png",26,26);
-var BackgroundImageDialog=function(a,c){var b=document.createElement("div");b.style.whiteSpace="nowrap";var d=document.createElement("h2");mxUtils.write(d,mxResources.get("backgroundImage"));d.style.marginTop="0px";b.appendChild(d);mxUtils.write(b,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(b);var d=a.editor.graph.backgroundImage,m=document.createElement("input");m.setAttribute("type","text");m.style.marginTop="4px";m.style.marginBottom="4px";m.style.width="350px";m.value=
-null!=d?d.src:"";var f=!1,l=function(){f||""==m.value||a.isOffline()?(n.value="",p.value=""):a.loadImage(mxUtils.trim(m.value),function(a){n.value=a.width;p.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));m.value="";n.value="";p.value=""})};this.init=function(){m.focus();if(Graph.fileSupport){m.setAttribute("placeholder",mxResources.get("dragImagesHere"));var c=b.parentNode,g=null;mxEvent.addListener(c,"dragleave",function(a){null!=
-g&&(g.parentNode.removeChild(g),g=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==g&&(!mxClient.IS_IE||10<document.documentMode)&&(g=a.highlightElement(c));b.stopPropagation();b.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=g&&(g.parentNode.removeChild(g),g=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,c,g,k,q){m.value=a;l()},function(){},
-function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes);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)&&(m.value=decodeURIComponent(c),l())}b.stopPropagation();b.preventDefault()}),!1)}};b.appendChild(m);mxUtils.br(b);mxUtils.br(b);mxUtils.write(b,mxResources.get("width")+":");var n=document.createElement("input");
-n.setAttribute("type","text");n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="16px";n.value=null!=d?d.width:"";b.appendChild(n);mxUtils.write(b,mxResources.get("height")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight="16px";p.value=null!=d?d.height:"";b.appendChild(p);d=mxUtils.button(mxResources.get("reset"),function(){m.value="";n.value="";p.value="";f=!1});mxEvent.addListener(d,"mousedown",
-function(){f=!0});mxEvent.addListener(d,"touchstart",function(){f=!0});d.className="geBtn";d.width="100";b.appendChild(d);mxUtils.br(b);mxEvent.addListener(m,"change",l);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(m.value=a.url,l()));m.focus()};d=document.createElement("div");d.style.marginTop="40px";d.style.textAlign="right";var u=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
-u.className="geBtn";a.editor.cancelFirst&&d.appendChild(u);if(!a.isOffline()&&"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top){var g=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)});
-g.className="geBtn";d.appendChild(g);null!=a.drive&&"1"==urlParams.photos&&(g=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).addView(google.picker.ViewId.PHOTO_UPLOAD);a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),
-g.className="geBtn",d.appendChild(g))}g=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c(""!=m.value?new mxImage(mxUtils.trim(m.value),n.value,p.value):null)});g.className="geBtn gePrimaryBtn";d.appendChild(g);a.editor.cancelFirst||d.appendChild(u);b.appendChild(d);this.container=b},ParseDialog=function(a,c,b){function d(b,c){var g=b.split("\n");if("plantUmlPng"==c||"plantUmlSvg"==c||"plantUmlTxt"==c){if(a.spinner.spin(document.body,mxResources.get("inserting"))){var k=a.editor.graph,
-q="plantUmlTxt"==c?"txt":"plantUmlPng"==c?"png":"svg";a.generatePlantUmlImage(b,q,function(c,g,d){a.spinner.stop();var t=null;k.getModel().beginUpdate();try{t="txt"==q?a.insertAsPreText(c,f.x,f.y):k.insertVertex(null,null,null,f.x,f.y,g,d,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(c)+";"),k.setAttributeForCell(t,"plantUmlData",JSON.stringify({data:b,format:q}))}finally{k.getModel().endUpdate()}null!=t&&(k.setSelectionCell(t),k.scrollCellToVisible(t))},
-function(b){a.handleError(b)})}}else if("table"==c){for(var d=null,l=[],x=0,m=0;m<g.length;m++){var v=mxUtils.trim(g[m]);if("create table"==v.substring(0,12).toLowerCase())v=mxUtils.trim(v.substring(12)),"("==v.charAt(v.length-1)&&(v=v.substring(0,v.lastIndexOf(" "))),d=new mxCell(v,new mxGeometry(x,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),
-d.vertex=!0,l.push(d),v=a.editor.graph.getPreferredSizeForCell(F),null!=v&&(d.geometry.width=v.width+10);else if(null!=d&&")"==v.charAt(0))x+=d.geometry.width+40,d=null;else if("("!=v&&null!=d&&(v=v.substring(0,","==v.charAt(v.length-1)?v.length-1:v.length),"primary key"!=v.substring(0,11).toLowerCase())){var B=v.toLowerCase().indexOf("primary key"),v=v.replace(/primary key/i,""),F=new mxCell(v,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
-F.vertex=!0;v=sb.cloneCell(F,0<B?"PK":"");v.connectable=!1;v.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";v.geometry.width=30;v.geometry.height=26;F.insert(v);v=a.editor.graph.getPreferredSizeForCell(F);null!=v&&d.geometry.width<v.width+10&&(d.geometry.width=Math.min(220,v.width+10));d.insert(F);d.geometry.height+=26}}0<l.length&&(k=a.editor.graph,
-m=k.view,g=k.getGraphBounds(),k.setSelectionCells(k.importCells(l,Math.ceil(Math.max(0,g.x/m.scale-m.translate.x)+4*k.gridSize),Math.ceil(Math.max(0,(g.y+g.height)/m.scale-m.translate.y)+4*k.gridSize))),k.scrollCellToVisible(k.getSelectionCell()))}else if("list"==c){if(0<g.length){k=a.editor.graph;F=null;l=[];for(m=d=0;m<g.length;m++)";"!=g[m].charAt(0)&&(0==g[m].length?F=null:null==F?(F=new mxCell(g[m],new mxGeometry(d,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;"),
-F.vertex=!0,l.push(F),v=k.getPreferredSizeForCell(F),null!=v&&F.geometry.width<v.width+10&&(F.geometry.width=v.width+10),d+=F.geometry.width+40):"--"==g[m]?(v=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),v.vertex=!0,F.geometry.height+=v.geometry.height,F.insert(v)):0<g[m].length&&(x=new mxCell(g[m],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),
-x.vertex=!0,v=k.getPreferredSizeForCell(x),null!=v&&x.geometry.width<v.width&&(x.geometry.width=v.width),F.geometry.width=Math.max(F.geometry.width,x.geometry.width),F.geometry.height+=x.geometry.height,F.insert(x)));if(0<l.length){k.getModel().beginUpdate();try{l=k.importCells(l,f.x,f.y);v=[];for(m=0;m<l.length;m++)v.push(l[m]),v=v.concat(l[m].children);k.fireEvent(new mxEventObject("cellsInserted","cells",v))}finally{k.getModel().endUpdate()}k.setSelectionCells(l);k.scrollCellToVisible(k.getSelectionCell())}}}else{for(var F=
-function(a){var b=p[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,p[a]=b,l.push(b));return b},p={},l=[],m=0;m<g.length;m++)if(";"!=g[m].charAt(0)){var n=g[m].split("->");if(2<=n.length){var B=F(n[0]),u=F(n[n.length-1]),n=new mxCell(2<n.length?n[1]:"",new mxGeometry);n.edge=!0;B.insertEdge(n,!0);u.insertEdge(n,!1);l.push(n)}}if(0<l.length){g=document.createElement("div");g.style.visibility="hidden";document.body.appendChild(g);k=new Graph(g);k.getModel().beginUpdate();
-try{l=k.importCells(l);for(m=0;m<l.length;m++)k.getModel().isVertex(l[m])&&(v=k.getPreferredSizeForCell(l[m]),l[m].geometry.width=Math.max(l[m].geometry.width,v.width),l[m].geometry.height=Math.max(l[m].geometry.height,v.height));d=new mxFastOrganicLayout(k);d.disableEdgeStyle=!1;d.forceConstant=120;d.execute(k.getDefaultParent());x=new mxParallelEdgeLayout(k);x.spacing=20;x.execute(k.getDefaultParent())}finally{k.getModel().endUpdate()}k.clearCellOverlays();v=[];a.editor.graph.getModel().beginUpdate();
-try{v=a.editor.graph.importCells(k.getModel().getChildren(k.getDefaultParent()),f.x,f.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",v))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(v);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());k.destroy();g.parentNode.removeChild(g)}}}function m(){return"list"==n.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":
-"table"==n.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==n.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":
-"plantUmlSvg"==n.value||"plantUmlTxt"==n.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var f=a.editor.graph.getFreeInsertPoint();c=document.createElement("div");c.style.textAlign="right";var l=document.createElement("textarea");l.style.resize="none";l.style.width="100%";l.style.height=
-"354px";l.style.marginBottom="16px";var n=document.createElement("select");"formatSql"==b&&(n.style.display="none");var p=document.createElement("option");p.setAttribute("value","list");mxUtils.write(p,mxResources.get("list"));"plantUml"!=b&&n.appendChild(p);null!=b&&"fromText"!=b||p.setAttribute("selected","selected");p=document.createElement("option");p.setAttribute("value","table");mxUtils.write(p,mxResources.get("formatSql"));"formatSql"==b&&(n.appendChild(p),p.setAttribute("selected","selected"));
-p=document.createElement("option");p.setAttribute("value","diagram");mxUtils.write(p,mxResources.get("diagram"));"plantUml"!=b&&n.appendChild(p);p=document.createElement("option");p.setAttribute("value","plantUmlSvg");mxUtils.write(p,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==b&&p.setAttribute("selected","selected");var u=document.createElement("option");u.setAttribute("value","plantUmlPng");mxUtils.write(u,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+
-")");var g=document.createElement("option");g.setAttribute("value","plantUmlTxt");mxUtils.write(g,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==b&&(n.appendChild(p),n.appendChild(u),n.appendChild(g));var k=m();l.value=k;c.appendChild(l);this.init=function(){l.focus()};Graph.fileSupport&&(l.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),l.addEventListener("drop",function(a){a.stopPropagation();
-a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){l.value=a.target.result};b.readAsText(a)}},!1));c.appendChild(n);mxEvent.addListener(n,"change",function(){var a=m();if(0==l.value.length||l.value==k)k=a,l.value=k});b=mxUtils.button(mxResources.get("close"),function(){l.value==k?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);p=mxUtils.button(mxResources.get("insert"),
-function(){a.hideDialog();d(l.value,n.value)});c.appendChild(p);p.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(b);this.container=c},NewDialog=function(a,c,b,d,m,f,l,n,p,u,g,k,q,v,y,t,A){function z(){var a=!0;if(null!=V)for(;K<V.length&&(a||0!=mxUtils.mod(K,30));)a=V[K++],C(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick,a.preview,a.noImg,a.clibs),a=!1}function D(){if(W)b||a.hideDialog(),v(W,ca,I.value);else if(d)b||a.hideDialog(),d(ha,I.value);
-else{var c=I.value;null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,ha,null!=ba&&0<ba.length?ba:null,null,function(){a.hideDialog()},null,b,null,null!=ia&&0<ia.length?ia:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function x(a,b,c,g,k,d){null!=da&&(da.style.backgroundColor="transparent",da.style.border="1px solid transparent");H.removeAttribute("disabled");ha=b;ba=c;ia=d;da=a;W=g;ca=k;da.style.backgroundColor=n;da.style.border=p}function C(b,c,
-g,k,d,q,f,t,l,B,m){var v=document.createElement("div");v.className="geTemplate";v.style.height=Y+"px";v.style.width=fa+"px";null!=k&&0<k.length&&v.setAttribute("title",k);if(null!=q)v.style.backgroundImage="url("+q+")",v.style.backgroundSize="contain",v.style.backgroundPosition="center center",v.style.backgroundRepeat="no-repeat",mxEvent.addListener(v,"click",function(a){x(v,null,null,b,f,m)}),mxEvent.addListener(v,"dblclick",function(a){D()});else if(!B&&null!=b&&0<b.length){g=l||TEMPLATE_PATH+"/"+
-b.substring(0,b.length-4)+".png";v.style.backgroundImage="url("+g+")";v.style.backgroundPosition="center center";v.style.backgroundRepeat="no-repeat";var C=!1;mxEvent.addListener(v,"click",function(g){H.setAttribute("disabled","disabled");v.style.backgroundColor="transparent";v.style.border="1px solid transparent";g=b;g=/^https?:\/\//.test(g)&&!a.editor.isCorsEnabledForUrl(g)?PROXY_URL+"?url="+encodeURIComponent(g):TEMPLATE_PATH+"/"+g;J.spin(R);mxUtils.get(g,mxUtils.bind(this,function(a){J.stop();
-200<=a.getStatus()&&299>=a.getStatus()&&(x(v,a.getText(),c,null,null,m),C&&D())}))});mxEvent.addListener(v,"dblclick",function(a){C=!0})}else v.innerHTML='<table width="100%" height="100%" style="line-height:1em;word-break: break-all;"><tr><td align="center" valign="middle">'+mxResources.get(g,null,g)+"</td></tr></table>",d&&x(v),null!=t?mxEvent.addListener(v,"click",t):(mxEvent.addListener(v,"click",function(a){x(v,null,null,b,f)}),mxEvent.addListener(v,"dblclick",function(a){D()}));R.appendChild(v)}
-function G(){T&&(T=!1,mxEvent.addListener(R,"scroll",function(a){R.scrollTop+R.clientHeight>=R.scrollHeight&&(z(),mxEvent.consume(a))}));var a=null;if(0<ea){var b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,mxResources.get("custom"));Z.appendChild(b);for(var c in O){var g=document.createElement("div"),b=c,k=O[c];18<b.length&&(b=b.substring(0,18)+"&hellip;");g.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";
-g.setAttribute("title",b+" ("+k.length+")");mxUtils.write(g,g.getAttribute("title"));null!=u&&(g.style.padding=u);Z.appendChild(g);(function(b,c){mxEvent.addListener(g,"click",function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=l,R.scrollTop=0,R.innerHTML="",K=0,V=O[b],N=null,z())})})(c,g)}b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,"draw.io");Z.appendChild(b)}for(c in Q)g=document.createElement("div"),
-b=mxResources.get(c),k=Q[c],null==b&&(b=c.substring(0,1).toUpperCase()+c.substring(1)),18<b.length&&(b=b.substring(0,18)+"&hellip;"),g.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;",g.setAttribute("title",b+" ("+k.length+")"),mxUtils.write(g,g.getAttribute("title")),null!=u&&(g.style.padding=u),Z.appendChild(g),null==a&&0<k.length&&(a=g,a.style.backgroundColor=l,V=k),function(b,c){mxEvent.addListener(g,"click",
-function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=l,R.scrollTop=0,R.innerHTML="",K=0,V=Q[b],N=null,z())})}(c,g);z()}b=null!=b?b:!0;m=null!=m?m:!1;l=null!=l?l:"#ebf2f9";n=null!=n?n:"#e6eff8";p=null!=p?p:"1px solid #ccd9ea";g=null!=g?g:EditorUi.templateFile;var B=document.createElement("div");B.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.height="46px";b&&B.appendChild(F);var E=document.createElement("img");E.setAttribute("border",
-"0");E.setAttribute("align","absmiddle");E.style.width="40px";E.style.height="40px";E.style.marginRight="10px";E.style.paddingBottom="4px";E.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?
-IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&b&&F.appendChild(E);b&&mxUtils.write(F,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");E=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?E=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?E=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?E=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?E=a.gitHub.extension:
-a.mode==App.MODE_GITLAB&&null!=a.gitLab?E=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(E=a.trello.extension);var I=document.createElement("input");I.setAttribute("value",a.defaultFilename+E);I.style.marginLeft="10px";I.style.width=c?"220px":"430px";this.init=function(){b&&(I.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?I.select():document.execCommand("selectAll",!1,null))};b&&(F.appendChild(I),null!=a.editor.fileExtensions&&(E=FilenameDialog.createTypeHint(a,
-I,a.editor.fileExtensions),E.style.marginTop="12px",F.appendChild(E)));var F=!1,K=0,J=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),H=mxUtils.button(t||mxResources.get("create"),function(){H.setAttribute("disabled","disabled");D();H.removeAttribute("disabled")});H.className="geBtn gePrimaryBtn";if(k||q){var L=[],N=null,S=null,aa=null,U=function(a){H.setAttribute("disabled","disabled");for(var b=0;b<L.length;b++)L[b].className=
-b==a?"geBtn gePrimaryBtn":"geBtn"},F=!0;t=document.createElement("div");t.style.whiteSpace="nowrap";t.style.height="30px";B.appendChild(t);E=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Z.style.display="";R.style.left="160px";U(0);R.scrollTop=0;R.innerHTML="";K=0;N!=V&&(V=N,Q=S,ea=aa,Z.innerHTML="",G(),N=null)});L.push(E);t.appendChild(E);var M=function(a){Z.style.display="none";R.style.left="30px";U(a?-1:1);null==N&&(N=V);R.scrollTop=0;R.innerHTML="";J.spin(R);var b=function(a,
-b,c){K=0;J.stop();V=a;c=c||{};var g=0,k;for(k in c)g+=c[k].length;if(b)R.innerHTML=b;else if(0==a.length&&0==g)R.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(R.innerHTML="",0<g){Z.style.display="";R.style.left="160px";Z.innerHTML="";ea=0;Q={"draw.io":a};for(k in c)Q[k]=c[k];G()}else z()};a?q(X.value,b):k(b)};k&&(E=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){M()}),t.appendChild(E),L.push(E));if(q){E=document.createElement("span");
-E.style.marginLeft="10px";E.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");t.appendChild(E);var X=document.createElement("input");X.style.marginRight="10px";X.style.marginLeft="10px";X.style.width="220px";mxEvent.addListener(X,"keypress",function(a){13==a.keyCode&&M(!0)});t.appendChild(X);E=mxUtils.button(mxResources.get("search"),function(){M(!0)});E.className="geBtn";t.appendChild(E)}U(0)}var ba=null,ia=null,ha=null,da=null,W=null,ca=null,R=document.createElement("div");R.style.border=
-"1px solid #d3d3d3";R.style.position="absolute";R.style.left="160px";R.style.right="34px";F=(b?72:40)+(F?30:0);R.style.top=F+"px";R.style.bottom="68px";R.style.margin="6px 0 0 -1px";R.style.padding="6px";R.style.overflow="auto";var Z=document.createElement("div");Z.style.cssText="position:absolute;left:30px;width:128px;top:"+F+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var Y=140,fa=140,Q={},O={},ea=0,T=!0;Q.basic=[{title:"blankDiagram",select:!0}];var V=Q.basic;if(!c){var ka=
-function(){mxUtils.get(P,function(a){if(!la){la=!0;a=a.getXml().documentElement.firstChild;for(var b={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"==a.nodeName){for(var c=a.getAttribute("name"),g=a.getElementsByTagName("add"),k=[],d=0;d<g.length;d++)k.push(encodeURIComponent(mxUtils.getTextContent(g[d])));null!=c&&0<k.length&&(b[c]=k.join(";"))}else c=a.getAttribute("url"),null!=c&&(g=a.getAttribute("section"),null==g&&(g=c.indexOf("/"),g=c.substring(0,g)),c=Q[g],null==c&&(c=[],Q[g]=
-c),g=a.getAttribute("clibs"),null!=b[g]&&(g=b[g]),c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:g}));a=a.nextSibling}J.stop();G()}})};B.appendChild(Z);B.appendChild(R);var la=!1,P=g;/^https?:\/\//.test(P)&&!a.editor.isCorsEnabledForUrl(P)&&(P=PROXY_URL+"?url="+encodeURIComponent(P));J.spin(R);null!=A?A(function(a,b){O=a;aa=ea=b;ka()},ka):ka();S=Q}mxEvent.addListener(I,"keypress",function(b){a.dialog.container.firstChild==
-B&&13==b.keyCode&&D()});g=document.createElement("div");g.style.marginTop=c?"4px":"16px";g.style.textAlign="right";g.style.position="absolute";g.style.left="40px";g.style.bottom="24px";g.style.right="40px";c||a.isOffline()||!b||null!=d||m||(A=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),A.className="geBtn",g.appendChild(A));A=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});A.className=
-"geBtn";!a.editor.cancelFirst||m&&null==f||g.appendChild(A);c||"1"==urlParams.embed||m||(c=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(I.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),
-c.className="geBtn",g.appendChild(c));Graph.fileSupport&&y&&(y=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var b=document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(c){a.openFiles(b.files,!0);b.value=""});b.style.display="none";document.body.appendChild(b);a.newDlgFileInputElt=b}a.newDlgFileInputElt.click()}),y.className="geBtn",g.appendChild(y));g.appendChild(H);a.editor.cancelFirst||
-null!=d||m&&null==f||g.appendChild(A);B.appendChild(g);this.container=B},CreateDialog=function(a,c,b,d,m,f,l,n,p,u,g,k,q,v,y,t){function A(b,g,d,q){function f(){mxEvent.addListener(t,"click",function(){var b=d;if(l){var g=x.value,k=g.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var b=null!=b?b:B.value,q="";b==App.MODE_GOOGLE?q=a.drive.extension:b==App.MODE_GITHUB?q=a.gitHub.extension:b==App.MODE_GITLAB?q=a.gitLab.extension:b==App.MODE_TRELLO?q=a.trello.extension:b==App.MODE_DROPBOX?q=a.dropbox.extension:
-b==App.MODE_ONEDRIVE?q=a.oneDrive.extension:b==App.MODE_DEVICE&&(q=".drawio");0<=k&&(g=g.substring(0,k));x.value=g+q}}z(d)})}var t=document.createElement("a");t.style.overflow="hidden";var m=document.createElement("img");m.src=b;m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.width="60px";m.style.height="60px";m.style.paddingBottom="6px";t.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";t.className="geBaseButton";t.style.position="relative";t.style.margin="4px";t.style.padding=
-"8px 8px 10px 8px";t.style.whiteSpace="nowrap";t.appendChild(m);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");t.style.color="gray";t.style.fontSize="11px";var v=document.createElement("div");t.appendChild(v);mxUtils.write(v,g);if(null!=q&&null==a[q]){m.style.visibility="hidden";mxUtils.setOpacity(v,10);var F=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});F.spin(t);var y=window.setTimeout(function(){null==
-a[q]&&(F.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[q]&&(window.clearTimeout(y),mxUtils.setOpacity(v,100),m.style.visibility="",F.stop(),f())}))}else f();C.appendChild(t);++G==k&&(mxUtils.br(C),G=0)}function z(c){var g=x.value;if(null==c||null!=g&&0<g.length)a.hideDialog(),b(g,c)}l=null!=l?l:!0;n=null!=n?n:!0;k=null!=k?k:4;f=document.createElement("div");f.style.whiteSpace="nowrap";null==d&&a.addLanguageMenu(f);var D=document.createElement("h2");
-mxUtils.write(D,m||mxResources.get("create"));D.style.marginTop="0px";D.style.marginBottom="24px";f.appendChild(D);mxUtils.write(f,mxResources.get("filename")+":");var x=document.createElement("input");x.setAttribute("value",c);x.style.width="280px";x.style.marginLeft="10px";x.style.marginBottom="20px";x.style.maxWidth="70%";this.init=function(){x.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?x.select():document.execCommand("selectAll",!1,null)};f.appendChild(x);
-null!=t&&f.appendChild(FilenameDialog.createTypeHint(a,x,t));null!=q&&null!=v&&"image/"==v.substring(0,6)&&(x.style.width="160px",m=null,"image/svg+xml"==v&&mxClient.IS_SVG?(m=document.createElement("div"),m.innerHTML=mxUtils.trim(q),q=m.getElementsByTagName("svg")[0],v=parseInt(q.getAttribute("width")),y=parseInt(q.getAttribute("height")),q.setAttribute("viewBox","0 0 "+v+" "+y),q.setAttribute("width","120px"),q.setAttribute("height","80px")):(m=document.createElement("img"),m.setAttribute("src",
-"data:"+v+(y?";base64,":";utf8,")+q)),m.style.position="absolute",m.style.top="70px",m.style.right="100px",m.style.maxWidth="120px",m.style.maxHeight="80px",mxUtils.setPrefixedStyle(m.style,"transform","translate(50%,-50%)"),f.appendChild(m),p&&Editor.popupsAllowed&&(m.style.cursor="pointer",mxEvent.addListener(m,"click",function(){z("_blank")})));mxUtils.br(f);var C=document.createElement("div");C.style.textAlign="center";var G=0;C.style.marginTop="6px";f.appendChild(C);var B=document.createElement("select");
-B.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(q,mxResources.get("googleDrive")),B.appendChild(q),A(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(q,mxResources.get("oneDrive")),
-B.appendChild(q),a.mode==App.MODE_ONEDRIVE&&q.setAttribute("selected","selected"),A(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(q,mxResources.get("dropbox")),B.appendChild(q),a.mode==App.MODE_DROPBOX&&q.setAttribute("selected","selected"),A(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),
-null!=a.gitHub&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_GITHUB),mxUtils.write(q,mxResources.get("github")),B.appendChild(q),A(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.gitLab&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_GITLAB),mxUtils.write(q,mxResources.get("gitlab")),B.appendChild(q),A(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&
-(q=document.createElement("option"),q.setAttribute("value",App.MODE_TRELLO),mxUtils.write(q,mxResources.get("trello")),B.appendChild(q),A(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(q=document.createElement("option"),q.setAttribute("value",App.MODE_DEVICE),mxUtils.write(q,mxResources.get("device")),B.appendChild(q),a.mode!=App.MODE_DEVICE&&n||q.setAttribute("selected","selected"),
-g&&A(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE));n&&isLocalStorage&&"0"!=urlParams.browser&&(n=document.createElement("option"),n.setAttribute("value",App.MODE_BROWSER),mxUtils.write(n,mxResources.get("browser")),B.appendChild(n),a.mode==App.MODE_BROWSER&&n.setAttribute("selected","selected"),A(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="center";null!=u&&
-(g=mxUtils.button(mxResources.get("help"),function(){a.openLink(u)}),g.className="geBtn",n.appendChild(g));g=mxUtils.button(mxResources.get("cancel"),function(){null!=d?d():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});g.className="geBtn";a.editor.cancelFirst&&n.appendChild(g);null==d&&(q=mxUtils.button(mxResources.get("decideLater"),function(){z(null)}),q.className="geBtn",n.appendChild(q));p&&Editor.popupsAllowed&&(p=mxUtils.button(mxResources.get("openInNewWindow"),
-function(){z("_blank")}),p.className="geBtn",n.appendChild(p));CreateDialog.showDownloadButton&&(p=mxUtils.button(mxResources.get("download"),function(){z("download")}),p.className="geBtn",n.appendChild(p));a.editor.cancelFirst||n.appendChild(g);mxEvent.addListener(x,"keypress",function(b){13==b.keyCode?z(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});f.appendChild(n);this.container=f};CreateDialog.showDownloadButton=!0;
-var PopupDialog=function(a,c,b,d,m){m=null!=m?m:!0;var f=document.createElement("div");f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var l=mxUtils.button(mxResources.get("openInThisWindow"),function(){m&&a.hideDialog();null!=d&&d()});l.className="geBtn";l.style.marginBottom="8px";l.style.width="280px";f.appendChild(l);mxUtils.br(f);var n=mxUtils.button(mxResources.get("openInNewWindow"),function(){m&&a.hideDialog();null!=b&&b();a.openLink(c,
-null,!0)});n.className="geBtn gePrimaryBtn";n.style.width=l.style.width;f.appendChild(n);mxUtils.br(f);mxUtils.br(f);mxUtils.write(f,mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,c,b,d,m,f){f=null!=f?f:!0;var l=a.editor.graph,n=document.createElement("div");mxUtils.write(n,c);c=document.createElement("div");c.className="geTitle";c.style.backgroundColor="transparent";c.style.borderColor="transparent";c.style.whiteSpace="nowrap";c.style.textOverflow="clip";c.style.cursor=
-"default";mxClient.IS_VML||(c.style.paddingRight="20px");var p=document.createElement("input");p.setAttribute("value",b);p.setAttribute("type","text");p.setAttribute("spellcheck","false");p.setAttribute("autocorrect","off");p.setAttribute("autocomplete","off");p.setAttribute("autocapitalize","off");p.style.marginTop="6px";p.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";p.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";p.style.backgroundRepeat="no-repeat";
-p.style.backgroundPosition="100% 50%";p.style.paddingRight="14px";b=document.createElement("div");b.setAttribute("title",mxResources.get("reset"));b.style.position="relative";b.style.left="-16px";b.style.width="12px";b.style.height="14px";b.style.cursor="pointer";b.style.display=mxClient.IS_VML?"inline":"inline-block";b.style.top=(mxClient.IS_VML?0:3)+"px";b.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(b,"click",function(){p.value="";p.focus()});c.appendChild(p);c.appendChild(b);
-n.appendChild(c);var u=function(b,c,g,k){var q="data:"==b.substring(0,5);!a.isOffline()||q&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(q){a.spinner.stop();a.hideDialog();var t=!1===k?1:null!=c&&null!=g?Math.max(c/q.width,g/q.height):Math.min(1,Math.min(520/q.width,520/q.height));f&&(b=a.convertDataUri(b));d(b,Math.round(Number(q.width)*t),Math.round(Number(q.height)*t))},function(){a.spinner.stop();d(null);a.showError(mxResources.get("error"),
-mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),d(b)):(b=a.convertDataUri(b),c=null==c?120:c,g=null==g?100:g,a.hideDialog(),d(b,c,g))},g=function(b,c){if(null!=b){var g=m?null:l.getModel().getGeometry(l.getSelectionCell());null!=g?u(b,g.width,g.height,c):u(b,null,null,c)}else a.hideDialog(),d(null)};this.init=function(){p.focus();if(Graph.fileSupport){p.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=n.parentNode,c=null;mxEvent.addListener(b,"dragleave",
-function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(g){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));g.stopPropagation();g.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(a,b,c,k,q,d,f,t){g(a,
-t)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var k=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(k)&&g(decodeURIComponent(k))}b.stopPropagation();b.preventDefault()}),!1)}};b=document.createElement("div");b.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";b.style.textAlign="center";c=mxUtils.button(mxResources.get("cancel"),
-function(){a.spinner.stop();a.hideDialog()});c.className="geBtn";a.editor.cancelFirst&&b.appendChild(c);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(p.value=a.url));p.focus()};if(Graph.fileSupport){if(null==a.imgDlgFileInputElt){var k=document.createElement("input");k.setAttribute("multiple","multiple");k.setAttribute("type","file");mxEvent.addListener(k,"change",function(b){null!=
-k.files&&(a.importFiles(k.files,0,0,a.maxImageSize,function(a,b,c,k,q,d){g(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0),k.type="",k.type="file",k.value="")});k.style.display="none";document.body.appendChild(k);a.imgDlgFileInputElt=k}var q=mxUtils.button(mxResources.get("open"),function(){a.imgDlgFileInputElt.click()});q.className="geBtn";b.appendChild(q)}document.createElement("canvas").getContext&&"data:image/"==p.value.substring(0,
-11)&&"data:image/svg"!=p.value.substring(0,14)&&(q=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,p.value,function(a){p.value=a});a.showDialog(b.container,200,200,!0,!0);b.init()}),q.className="geBtn",b.appendChild(q));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(q=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);
-a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),q.className="geBtn",b.appendChild(q),null!=a.drive&&"1"==urlParams.photos&&(q=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).addView(google.picker.ViewId.PHOTO_UPLOAD);
-a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),q.className="geBtn",b.appendChild(q)));mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&g(p.value)});q=mxUtils.button(mxResources.get("apply"),function(){g(p.value)});q.className="geBtn gePrimaryBtn";b.appendChild(q);a.editor.cancelFirst||b.appendChild(c);Graph.fileSupport&&(b.style.marginTop="120px",n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",n.style.backgroundPosition=
-"center 65%",n.style.backgroundRepeat="no-repeat",c=document.createElement("div"),c.style.position="absolute",c.style.width="420px",c.style.top="58%",c.style.textAlign="center",c.style.fontSize="18px",c.style.color="#a0c3ff",mxUtils.write(c,mxResources.get("dragImagesHere")),n.appendChild(c));n.appendChild(b);this.container=n},LinkDialog=function(a,c,b,d,m){function f(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");b.style.height="26px";
-b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);A.appendChild(c)}var l=document.createElement("div");mxUtils.write(l,mxResources.get("editLink")+":");var n=document.createElement("div");n.className="geTitle";n.style.backgroundColor="transparent";n.style.borderColor="transparent";n.style.whiteSpace="nowrap";n.style.textOverflow="clip";n.style.cursor="default";mxClient.IS_VML||(n.style.paddingRight="20px");var p=document.createElement("input");
-p.setAttribute("placeholder",mxResources.get("dragUrlsHere"));p.setAttribute("type","text");p.style.marginTop="6px";p.style.width="100%";p.style.boxSizing="border-box";p.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";p.style.backgroundRepeat="no-repeat";p.style.backgroundPosition="100% 50%";p.style.paddingRight="14px";var u=document.createElement("div");u.setAttribute("title",mxResources.get("reset"));u.style.position="relative";u.style.left="-16px";u.style.width="12px";u.style.height=
-"14px";u.style.cursor="pointer";u.style.display=mxClient.IS_VML?"inline":"inline-block";u.style.top=(mxClient.IS_VML?0:3)+"px";u.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(u,"click",function(){p.value="";p.focus()});var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","current-linkdialog");var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";
-k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","current-linkdialog");var q=document.createElement("select");q.style.width="100%";if(m&&null!=a.pages){null!=c&&"data:page/id,"==c.substring(0,13)?(k.setAttribute("checked","checked"),k.defaultChecked=!0):(p.setAttribute("value",c),g.setAttribute("checked","checked"),g.defaultChecked=!0);n.appendChild(g);n.appendChild(p);n.appendChild(u);mxUtils.br(n);n.appendChild(k);m=!1;for(u=0;u<a.pages.length;u++){var v=document.createElement("option");
-mxUtils.write(v,a.pages[u].getName()||mxResources.get("pageWithNumber",[u+1]));v.setAttribute("value","data:page/id,"+a.pages[u].getId());c==v.getAttribute("value")&&(v.setAttribute("selected","selected"),m=!0);q.appendChild(v)}if(!m&&k.checked){var y=document.createElement("option");mxUtils.write(y,mxResources.get("pageNotFound"));y.setAttribute("disabled","disabled");y.setAttribute("selected","selected");y.setAttribute("value","pageNotFound");q.appendChild(y);mxEvent.addListener(q,"change",function(){null==
-y.parentNode||y.selected||y.parentNode.removeChild(y)})}n.appendChild(q)}else p.setAttribute("value",c),n.appendChild(p),n.appendChild(u);l.appendChild(n);var t=mxUtils.button(b,function(){a.hideDialog();d(k.checked?"pageNotFound"!==q.value?q.value:c:p.value,LinkDialog.selectedDocs)});t.style.verticalAlign="middle";t.className="geBtn gePrimaryBtn";this.init=function(){k.checked?q.focus():(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",
-!1,null));mxEvent.addListener(q,"focus",function(){g.removeAttribute("checked");k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(p,"focus",function(){k.removeAttribute("checked");g.setAttribute("checked","checked");g.checked=!0});if(Graph.fileSupport){var b=l.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(g){null==
-c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));g.stopPropagation();g.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(p.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),g.setAttribute("checked","checked"),g.checked=!0,t.click());a.stopPropagation();a.preventDefault()}),!1)}};var A=document.createElement("div");A.style.marginTop=
-"20px";A.style.textAlign="center";b=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});b.style.verticalAlign="middle";b.className="geBtn";A.appendChild(b);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(b.style.display="none");b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.style.verticalAlign="middle";b.className="geBtn";a.editor.cancelFirst&&A.appendChild(b);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==
-google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||null!=a.docs[0].mimeType&&"application/vnd.jgraph."==a.docs[0].mimeType.substring(0,23)?b="https://www.draw.io/#G"+a.docs[0].id:"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);p.value=b;p.focus()}else LinkDialog.selectedDocs=null;p.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&
-f(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),g=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),
-b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(c).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTO_UPLOAD);a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});
-"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&f(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){p.value=a[0].link;p.focus()}})});null!=a.oneDrive&&f(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){p.value=b.value[0].webUrl;p.focus()})});null!=a.gitHub&&f(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=
-a){a=a.split("/");var b=a[0],c=a[1],g=a[2];a=a.slice(3,a.length).join("/");p.value="https://github.com/"+b+"/"+c+"/blob/"+g+"/"+a;p.focus()}})});null!=a.gitLab&&f(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),function(){a.gitLab.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],g=a[2];a=a.slice(3,a.length).join("/");p.value=DRAWIO_GITLAB_URL+"/"+b+"/"+c+"/blob/"+g+"/"+a;p.focus()}})});mxEvent.addListener(p,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),d(k.checked?
-q.value:p.value,LinkDialog.selectedDocs))});A.appendChild(t);a.editor.cancelFirst||A.appendChild(b);l.appendChild(A);this.container=l},AboutDialog=function(a){var c=document.createElement("div");c.style.marginTop="6px";c.setAttribute("align","center");var b=document.createElement("img");b.style.border="0px";mxClient.IS_SVG?(b.setAttribute("width","164"),b.setAttribute("height","221"),b.style.width="164px",b.style.height="221px",b.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):(b.setAttribute("width",
+var BackgroundImageDialog=function(a,c){var b=document.createElement("div");b.style.whiteSpace="nowrap";var d=document.createElement("h2");mxUtils.write(d,mxResources.get("backgroundImage"));d.style.marginTop="0px";b.appendChild(d);mxUtils.write(b,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(b);var d=a.editor.graph.backgroundImage,g=document.createElement("input");g.setAttribute("type","text");g.style.marginTop="4px";g.style.marginBottom="4px";g.style.width="350px";g.value=
+null!=d?d.src:"";var e=!1,k=function(){e||""==g.value||a.isOffline()?(m.value="",n.value=""):a.loadImage(mxUtils.trim(g.value),function(a){m.value=a.width;n.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));g.value="";m.value="";n.value=""})};this.init=function(){g.focus();if(Graph.fileSupport){g.setAttribute("placeholder",mxResources.get("dragImagesHere"));var c=b.parentNode,f=null;mxEvent.addListener(c,"dragleave",function(a){null!=
+f&&(f.parentNode.removeChild(f),f=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==f&&(!mxClient.IS_IE||10<document.documentMode)&&(f=a.highlightElement(c));b.stopPropagation();b.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,c,f,l,p){g.value=a;k()},function(){},
+function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes);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)&&(g.value=decodeURIComponent(c),k())}b.stopPropagation();b.preventDefault()}),!1)}};b.appendChild(g);mxUtils.br(b);mxUtils.br(b);mxUtils.write(b,mxResources.get("width")+":");var m=document.createElement("input");
+m.setAttribute("type","text");m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="16px";m.value=null!=d?d.width:"";b.appendChild(m);mxUtils.write(b,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="16px";n.value=null!=d?d.height:"";b.appendChild(n);d=mxUtils.button(mxResources.get("reset"),function(){g.value="";m.value="";n.value="";e=!1});mxEvent.addListener(d,"mousedown",
+function(){e=!0});mxEvent.addListener(d,"touchstart",function(){e=!0});d.className="geBtn";d.width="100";b.appendChild(d);mxUtils.br(b);mxEvent.addListener(g,"change",k);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(g.value=a.url,k()));g.focus()};d=document.createElement("div");d.style.marginTop="40px";d.style.textAlign="right";var q=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
+q.className="geBtn";a.editor.cancelFirst&&d.appendChild(q);if(!a.isOffline()&&"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top){var f=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)});
+f.className="geBtn";d.appendChild(f);null!=a.drive&&"1"==urlParams.photos&&(f=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).addView(google.picker.ViewId.PHOTO_UPLOAD);a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),
+f.className="geBtn",d.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c(""!=g.value?new mxImage(mxUtils.trim(g.value),m.value,n.value):null)});f.className="geBtn gePrimaryBtn";d.appendChild(f);a.editor.cancelFirst||d.appendChild(q);b.appendChild(d);this.container=b},ParseDialog=function(a,c,b){function d(b,c){var f=b.split("\n");if("plantUmlPng"==c||"plantUmlSvg"==c||"plantUmlTxt"==c){if(a.spinner.spin(document.body,mxResources.get("inserting"))){var l=a.editor.graph,
+p="plantUmlTxt"==c?"txt":"plantUmlPng"==c?"png":"svg";a.generatePlantUmlImage(b,p,function(c,f,d){a.spinner.stop();var k=null;l.getModel().beginUpdate();try{k="txt"==p?a.insertAsPreText(c,e.x,e.y):l.insertVertex(null,null,null,e.x,e.y,f,d,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(c)+";"),l.setAttributeForCell(k,"plantUmlData",JSON.stringify({data:b,format:p}))}finally{l.getModel().endUpdate()}null!=k&&(l.setSelectionCell(k),l.scrollCellToVisible(k))},
+function(b){a.handleError(b)})}}else if("table"==c){for(var d=null,k=[],x=0,g=0;g<f.length;g++){var u=mxUtils.trim(f[g]);if("create table"==u.substring(0,12).toLowerCase())u=mxUtils.trim(u.substring(12)),"("==u.charAt(u.length-1)&&(u=u.substring(0,u.lastIndexOf(" "))),d=new mxCell(u,new mxGeometry(x,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),
+d.vertex=!0,k.push(d),u=a.editor.graph.getPreferredSizeForCell(F),null!=u&&(d.geometry.width=u.width+10);else if(null!=d&&")"==u.charAt(0))x+=d.geometry.width+40,d=null;else if("("!=u&&null!=d&&(u=u.substring(0,","==u.charAt(u.length-1)?u.length-1:u.length),"primary key"!=u.substring(0,11).toLowerCase())){var A=u.toLowerCase().indexOf("primary key"),u=u.replace(/primary key/i,""),F=new mxCell(u,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
+F.vertex=!0;u=sb.cloneCell(F,0<A?"PK":"");u.connectable=!1;u.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";u.geometry.width=30;u.geometry.height=26;F.insert(u);u=a.editor.graph.getPreferredSizeForCell(F);null!=u&&d.geometry.width<u.width+10&&(d.geometry.width=Math.min(220,u.width+10));d.insert(F);d.geometry.height+=26}}0<k.length&&(l=a.editor.graph,
+g=l.view,f=l.getGraphBounds(),l.setSelectionCells(l.importCells(k,Math.ceil(Math.max(0,f.x/g.scale-g.translate.x)+4*l.gridSize),Math.ceil(Math.max(0,(f.y+f.height)/g.scale-g.translate.y)+4*l.gridSize))),l.scrollCellToVisible(l.getSelectionCell()))}else if("list"==c){if(0<f.length){l=a.editor.graph;F=null;k=[];for(g=d=0;g<f.length;g++)";"!=f[g].charAt(0)&&(0==f[g].length?F=null:null==F?(F=new mxCell(f[g],new mxGeometry(d,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;"),
+F.vertex=!0,k.push(F),u=l.getPreferredSizeForCell(F),null!=u&&F.geometry.width<u.width+10&&(F.geometry.width=u.width+10),d+=F.geometry.width+40):"--"==f[g]?(u=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),u.vertex=!0,F.geometry.height+=u.geometry.height,F.insert(u)):0<f[g].length&&(x=new mxCell(f[g],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),
+x.vertex=!0,u=l.getPreferredSizeForCell(x),null!=u&&x.geometry.width<u.width&&(x.geometry.width=u.width),F.geometry.width=Math.max(F.geometry.width,x.geometry.width),F.geometry.height+=x.geometry.height,F.insert(x)));if(0<k.length){l.getModel().beginUpdate();try{k=l.importCells(k,e.x,e.y);u=[];for(g=0;g<k.length;g++)u.push(k[g]),u=u.concat(k[g].children);l.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{l.getModel().endUpdate()}l.setSelectionCells(k);l.scrollCellToVisible(l.getSelectionCell())}}}else{for(var F=
+function(a){var b=n[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,n[a]=b,k.push(b));return b},n={},k=[],g=0;g<f.length;g++)if(";"!=f[g].charAt(0)){var m=f[g].split("->");if(2<=m.length){var A=F(m[0]),q=F(m[m.length-1]),m=new mxCell(2<m.length?m[1]:"",new mxGeometry);m.edge=!0;A.insertEdge(m,!0);q.insertEdge(m,!1);k.push(m)}}if(0<k.length){f=document.createElement("div");f.style.visibility="hidden";document.body.appendChild(f);l=new Graph(f);l.getModel().beginUpdate();
+try{k=l.importCells(k);for(g=0;g<k.length;g++)l.getModel().isVertex(k[g])&&(u=l.getPreferredSizeForCell(k[g]),k[g].geometry.width=Math.max(k[g].geometry.width,u.width),k[g].geometry.height=Math.max(k[g].geometry.height,u.height));d=new mxFastOrganicLayout(l);d.disableEdgeStyle=!1;d.forceConstant=120;d.execute(l.getDefaultParent());x=new mxParallelEdgeLayout(l);x.spacing=20;x.execute(l.getDefaultParent())}finally{l.getModel().endUpdate()}l.clearCellOverlays();u=[];a.editor.graph.getModel().beginUpdate();
+try{u=a.editor.graph.importCells(l.getModel().getChildren(l.getDefaultParent()),e.x,e.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(u);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());l.destroy();f.parentNode.removeChild(f)}}}function g(){return"list"==m.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":
+"table"==m.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==m.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":
+"plantUmlSvg"==m.value||"plantUmlTxt"==m.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var e=a.editor.graph.getFreeInsertPoint();c=document.createElement("div");c.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height=
+"354px";k.style.marginBottom="16px";var m=document.createElement("select");"formatSql"==b&&(m.style.display="none");var n=document.createElement("option");n.setAttribute("value","list");mxUtils.write(n,mxResources.get("list"));"plantUml"!=b&&m.appendChild(n);null!=b&&"fromText"!=b||n.setAttribute("selected","selected");n=document.createElement("option");n.setAttribute("value","table");mxUtils.write(n,mxResources.get("formatSql"));"formatSql"==b&&(m.appendChild(n),n.setAttribute("selected","selected"));
+n=document.createElement("option");n.setAttribute("value","diagram");mxUtils.write(n,mxResources.get("diagram"));"plantUml"!=b&&m.appendChild(n);n=document.createElement("option");n.setAttribute("value","plantUmlSvg");mxUtils.write(n,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==b&&n.setAttribute("selected","selected");var q=document.createElement("option");q.setAttribute("value","plantUmlPng");mxUtils.write(q,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+
+")");var f=document.createElement("option");f.setAttribute("value","plantUmlTxt");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==b&&(m.appendChild(n),m.appendChild(q),m.appendChild(f));var l=g();k.value=l;c.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation();
+a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){k.value=a.target.result};b.readAsText(a)}},!1));c.appendChild(m);mxEvent.addListener(m,"change",function(){var a=g();if(0==k.value.length||k.value==l)l=a,k.value=l});b=mxUtils.button(mxResources.get("close"),function(){k.value==l?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("insert"),
+function(){a.hideDialog();d(k.value,m.value)});c.appendChild(n);n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(b);this.container=c},NewDialog=function(a,c,b,d,g,e,k,m,n,q,f,l,p,u,v,t,z){function y(){var a=!0;if(null!=U)for(;J<U.length&&(a||0!=mxUtils.mod(J,30));)a=U[J++],B(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick,a.preview,a.noImg,a.clibs),a=!1}function C(){if(V)b||a.hideDialog(),u(V,ba,H.value);else if(d)b||a.hideDialog(),d(ga,H.value);
+else{var c=H.value;null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,ga,null!=aa&&0<aa.length?aa:null,null,function(){a.hideDialog()},null,b,null,null!=ha&&0<ha.length?ha:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function x(a,b,c,f,l,d){null!=ca&&(ca.style.backgroundColor="transparent",ca.style.border="1px solid transparent");G.removeAttribute("disabled");ga=b;aa=c;ha=d;ca=a;V=f;ba=l;ca.style.backgroundColor=m;ca.style.border=n}function B(b,c,
+f,l,d,p,e,k,t,A,g){var u=document.createElement("div");u.className="geTemplate";u.style.height=X+"px";u.style.width=ea+"px";null!=l&&0<l.length&&u.setAttribute("title",l);if(null!=p)u.style.backgroundImage="url("+p+")",u.style.backgroundSize="contain",u.style.backgroundPosition="center center",u.style.backgroundRepeat="no-repeat",mxEvent.addListener(u,"click",function(a){x(u,null,null,b,e,g)}),mxEvent.addListener(u,"dblclick",function(a){C()});else if(!A&&null!=b&&0<b.length){f=t||TEMPLATE_PATH+"/"+
+b.substring(0,b.length-4)+".png";u.style.backgroundImage="url("+f+")";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";var B=!1;mxEvent.addListener(u,"click",function(f){G.setAttribute("disabled","disabled");u.style.backgroundColor="transparent";u.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;I.spin(R);mxUtils.get(f,mxUtils.bind(this,function(a){I.stop();
+200<=a.getStatus()&&299>=a.getStatus()&&(x(u,a.getText(),c,null,null,g),B&&C())}))});mxEvent.addListener(u,"dblclick",function(a){B=!0})}else u.innerHTML='<table width="100%" height="100%" style="line-height:1em;word-break: break-all;"><tr><td align="center" valign="middle">'+mxResources.get(f,null,f)+"</td></tr></table>",d&&x(u),null!=k?mxEvent.addListener(u,"click",k):(mxEvent.addListener(u,"click",function(a){x(u,null,null,b,e)}),mxEvent.addListener(u,"dblclick",function(a){C()}));R.appendChild(u)}
+function E(){S&&(S=!1,mxEvent.addListener(R,"scroll",function(a){R.scrollTop+R.clientHeight>=R.scrollHeight&&(y(),mxEvent.consume(a))}));var a=null;if(0<da){var b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,mxResources.get("custom"));Z.appendChild(b);for(var c in M){var f=document.createElement("div"),b=c,l=M[c];18<b.length&&(b=b.substring(0,18)+"&hellip;");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";
+f.setAttribute("title",b+" ("+l.length+")");mxUtils.write(f,f.getAttribute("title"));null!=q&&(f.style.padding=q);Z.appendChild(f);(function(b,c){mxEvent.addListener(f,"click",function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=k,R.scrollTop=0,R.innerHTML="",J=0,U=M[b],Q=null,y())})})(c,f)}b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,"draw.io");Z.appendChild(b)}for(c in P)f=document.createElement("div"),
+b=mxResources.get(c),l=P[c],null==b&&(b=c.substring(0,1).toUpperCase()+c.substring(1)),18<b.length&&(b=b.substring(0,18)+"&hellip;"),f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;",f.setAttribute("title",b+" ("+l.length+")"),mxUtils.write(f,f.getAttribute("title")),null!=q&&(f.style.padding=q),Z.appendChild(f),null==a&&0<l.length&&(a=f,a.style.backgroundColor=k,U=l),function(b,c){mxEvent.addListener(f,"click",
+function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=k,R.scrollTop=0,R.innerHTML="",J=0,U=P[b],Q=null,y())})}(c,f);y()}b=null!=b?b:!0;g=null!=g?g:!1;k=null!=k?k:"#ebf2f9";m=null!=m?m:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var A=document.createElement("div");A.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.height="46px";b&&A.appendChild(F);var D=document.createElement("img");D.setAttribute("border",
+"0");D.setAttribute("align","absmiddle");D.style.width="40px";D.style.height="40px";D.style.marginRight="10px";D.style.paddingBottom="4px";D.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?
+IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&b&&F.appendChild(D);b&&mxUtils.write(F,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");D=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?D=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?D=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?D=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?D=a.gitHub.extension:
+a.mode==App.MODE_GITLAB&&null!=a.gitLab?D=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(D=a.trello.extension);var H=document.createElement("input");H.setAttribute("value",a.defaultFilename+D);H.style.marginLeft="10px";H.style.width=c?"220px":"430px";this.init=function(){b&&(H.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?H.select():document.execCommand("selectAll",!1,null))};b&&(F.appendChild(H),null!=a.editor.fileExtensions&&(D=FilenameDialog.createTypeHint(a,
+H,a.editor.fileExtensions),D.style.marginTop="12px",F.appendChild(D)));var F=!1,J=0,I=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),G=mxUtils.button(t||mxResources.get("create"),function(){G.setAttribute("disabled","disabled");C();G.removeAttribute("disabled")});G.className="geBtn gePrimaryBtn";if(l||p){var K=[],Q=null,N=null,Y=null,T=function(a){G.setAttribute("disabled","disabled");for(var b=0;b<K.length;b++)K[b].className=
+b==a?"geBtn gePrimaryBtn":"geBtn"},F=!0;t=document.createElement("div");t.style.whiteSpace="nowrap";t.style.height="30px";A.appendChild(t);D=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Z.style.display="";R.style.left="160px";T(0);R.scrollTop=0;R.innerHTML="";J=0;Q!=U&&(U=Q,P=N,da=Y,Z.innerHTML="",E(),Q=null)});K.push(D);t.appendChild(D);var L=function(a){Z.style.display="none";R.style.left="30px";T(a?-1:1);null==Q&&(Q=U);R.scrollTop=0;R.innerHTML="";I.spin(R);var b=function(a,
+b,c){J=0;I.stop();U=a;c=c||{};var f=0,l;for(l in c)f+=c[l].length;if(b)R.innerHTML=b;else if(0==a.length&&0==f)R.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(R.innerHTML="",0<f){Z.style.display="";R.style.left="160px";Z.innerHTML="";da=0;P={"draw.io":a};for(l in c)P[l]=c[l];E()}else y()};a?p(W.value,b):l(b)};l&&(D=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){L()}),t.appendChild(D),K.push(D));if(p){D=document.createElement("span");
+D.style.marginLeft="10px";D.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");t.appendChild(D);var W=document.createElement("input");W.style.marginRight="10px";W.style.marginLeft="10px";W.style.width="220px";mxEvent.addListener(W,"keypress",function(a){13==a.keyCode&&L(!0)});t.appendChild(W);D=mxUtils.button(mxResources.get("search"),function(){L(!0)});D.className="geBtn";t.appendChild(D)}T(0)}var aa=null,ha=null,ga=null,ca=null,V=null,ba=null,R=document.createElement("div");R.style.border=
+"1px solid #d3d3d3";R.style.position="absolute";R.style.left="160px";R.style.right="34px";F=(b?72:40)+(F?30:0);R.style.top=F+"px";R.style.bottom="68px";R.style.margin="6px 0 0 -1px";R.style.padding="6px";R.style.overflow="auto";var Z=document.createElement("div");Z.style.cssText="position:absolute;left:30px;width:128px;top:"+F+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var X=140,ea=140,P={},M={},da=0,S=!0;P.basic=[{title:"blankDiagram",select:!0}];var U=P.basic;if(!c){var ja=
+function(){mxUtils.get(O,function(a){if(!ka){ka=!0;a=a.getXml().documentElement.firstChild;for(var b={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"==a.nodeName){for(var c=a.getAttribute("name"),f=a.getElementsByTagName("add"),l=[],d=0;d<f.length;d++)l.push(encodeURIComponent(mxUtils.getTextContent(f[d])));null!=c&&0<l.length&&(b[c]=l.join(";"))}else c=a.getAttribute("url"),null!=c&&(f=a.getAttribute("section"),null==f&&(f=c.indexOf("/"),f=c.substring(0,f)),c=P[f],null==c&&(c=[],P[f]=
+c),f=a.getAttribute("clibs"),null!=b[f]&&(f=b[f]),c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:f}));a=a.nextSibling}I.stop();E()}})};A.appendChild(Z);A.appendChild(R);var ka=!1,O=f;/^https?:\/\//.test(O)&&!a.editor.isCorsEnabledForUrl(O)&&(O=PROXY_URL+"?url="+encodeURIComponent(O));I.spin(R);null!=z?z(function(a,b){M=a;Y=da=b;ja()},ja):ja();N=P}mxEvent.addListener(H,"keypress",function(b){a.dialog.container.firstChild==
+A&&13==b.keyCode&&C()});f=document.createElement("div");f.style.marginTop=c?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";c||a.isOffline()||!b||null!=d||g||(z=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",f.appendChild(z));z=mxUtils.button(mxResources.get("cancel"),function(){null!=e&&e();a.hideDialog(!0)});z.className=
+"geBtn";!a.editor.cancelFirst||g&&null==e||f.appendChild(z);c||"1"==urlParams.embed||g||(c=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(H.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),
+c.className="geBtn",f.appendChild(c));Graph.fileSupport&&v&&(v=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var b=document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(c){a.openFiles(b.files,!0);b.value=""});b.style.display="none";document.body.appendChild(b);a.newDlgFileInputElt=b}a.newDlgFileInputElt.click()}),v.className="geBtn",f.appendChild(v));f.appendChild(G);a.editor.cancelFirst||
+null!=d||g&&null==e||f.appendChild(z);A.appendChild(f);this.container=A},CreateDialog=function(a,c,b,d,g,e,k,m,n,q,f,l,p,u,v,t){function z(b,f,d,p){function e(){mxEvent.addListener(t,"click",function(){var b=d;if(k){var f=x.value,l=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>l){var b=null!=b?b:A.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?p=a.gitHub.extension:b==App.MODE_GITLAB?p=a.gitLab.extension:b==App.MODE_TRELLO?p=a.trello.extension:b==App.MODE_DROPBOX?p=a.dropbox.extension:
+b==App.MODE_ONEDRIVE?p=a.oneDrive.extension:b==App.MODE_DEVICE&&(p=".drawio");0<=l&&(f=f.substring(0,l));x.value=f+p}}y(d)})}var t=document.createElement("a");t.style.overflow="hidden";var g=document.createElement("img");g.src=b;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";t.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";t.className="geBaseButton";t.style.position="relative";t.style.margin="4px";t.style.padding=
+"8px 8px 10px 8px";t.style.whiteSpace="nowrap";t.appendChild(g);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");t.style.color="gray";t.style.fontSize="11px";var u=document.createElement("div");t.appendChild(u);mxUtils.write(u,f);if(null!=p&&null==a[p]){g.style.visibility="hidden";mxUtils.setOpacity(u,10);var v=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});v.spin(t);var F=window.setTimeout(function(){null==
+a[p]&&(v.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(F),mxUtils.setOpacity(u,100),g.style.visibility="",v.stop(),e())}))}else e();B.appendChild(t);++E==l&&(mxUtils.br(B),E=0)}function y(c){var f=x.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}k=null!=k?k:!0;m=null!=m?m:!0;l=null!=l?l:4;e=document.createElement("div");e.style.whiteSpace="nowrap";null==d&&a.addLanguageMenu(e);var C=document.createElement("h2");
+mxUtils.write(C,g||mxResources.get("create"));C.style.marginTop="0px";C.style.marginBottom="24px";e.appendChild(C);mxUtils.write(e,mxResources.get("filename")+":");var x=document.createElement("input");x.setAttribute("value",c);x.style.width="280px";x.style.marginLeft="10px";x.style.marginBottom="20px";x.style.maxWidth="70%";this.init=function(){x.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?x.select():document.execCommand("selectAll",!1,null)};e.appendChild(x);
+null!=t&&e.appendChild(FilenameDialog.createTypeHint(a,x,t));null!=p&&null!=u&&"image/"==u.substring(0,6)&&(x.style.width="160px",g=null,"image/svg+xml"==u&&mxClient.IS_SVG?(g=document.createElement("div"),g.innerHTML=mxUtils.trim(p),p=g.getElementsByTagName("svg")[0],u=parseInt(p.getAttribute("width")),v=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+u+" "+v),p.setAttribute("width","120px"),p.setAttribute("height","80px")):(g=document.createElement("img"),g.setAttribute("src",
+"data:"+u+(v?";base64,":";utf8,")+p)),g.style.position="absolute",g.style.top="70px",g.style.right="100px",g.style.maxWidth="120px",g.style.maxHeight="80px",mxUtils.setPrefixedStyle(g.style,"transform","translate(50%,-50%)"),e.appendChild(g),n&&Editor.popupsAllowed&&(g.style.cursor="pointer",mxEvent.addListener(g,"click",function(){y("_blank")})));mxUtils.br(e);var B=document.createElement("div");B.style.textAlign="center";var E=0;B.style.marginTop="6px";e.appendChild(B);var A=document.createElement("select");
+A.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(p,mxResources.get("googleDrive")),A.appendChild(p),z(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(p,mxResources.get("oneDrive")),
+A.appendChild(p),a.mode==App.MODE_ONEDRIVE&&p.setAttribute("selected","selected"),z(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(p,mxResources.get("dropbox")),A.appendChild(p),a.mode==App.MODE_DROPBOX&&p.setAttribute("selected","selected"),z(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),
+null!=a.gitHub&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GITHUB),mxUtils.write(p,mxResources.get("github")),A.appendChild(p),z(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.gitLab&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GITLAB),mxUtils.write(p,mxResources.get("gitlab")),A.appendChild(p),z(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&
+(p=document.createElement("option"),p.setAttribute("value",App.MODE_TRELLO),mxUtils.write(p,mxResources.get("trello")),A.appendChild(p),z(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(p=document.createElement("option"),p.setAttribute("value",App.MODE_DEVICE),mxUtils.write(p,mxResources.get("device")),A.appendChild(p),a.mode!=App.MODE_DEVICE&&m||p.setAttribute("selected","selected"),
+f&&z(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE));m&&isLocalStorage&&"0"!=urlParams.browser&&(m=document.createElement("option"),m.setAttribute("value",App.MODE_BROWSER),mxUtils.write(m,mxResources.get("browser")),A.appendChild(m),a.mode==App.MODE_BROWSER&&m.setAttribute("selected","selected"),z(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));m=document.createElement("div");m.style.marginTop="26px";m.style.textAlign="center";null!=q&&
+(f=mxUtils.button(mxResources.get("help"),function(){a.openLink(q)}),f.className="geBtn",m.appendChild(f));f=mxUtils.button(mxResources.get("cancel"),function(){null!=d?d():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});f.className="geBtn";a.editor.cancelFirst&&m.appendChild(f);null==d&&(p=mxUtils.button(mxResources.get("decideLater"),function(){y(null)}),p.className="geBtn",m.appendChild(p));n&&Editor.popupsAllowed&&(n=mxUtils.button(mxResources.get("openInNewWindow"),
+function(){y("_blank")}),n.className="geBtn",m.appendChild(n));CreateDialog.showDownloadButton&&(n=mxUtils.button(mxResources.get("download"),function(){y("download")}),n.className="geBtn",m.appendChild(n));a.editor.cancelFirst||m.appendChild(f);mxEvent.addListener(x,"keypress",function(b){13==b.keyCode?y(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});e.appendChild(m);this.container=e};CreateDialog.showDownloadButton=!0;
+var PopupDialog=function(a,c,b,d,g){g=null!=g?g:!0;var e=document.createElement("div");e.style.textAlign="left";mxUtils.write(e,mxResources.get("fileOpenLocation"));mxUtils.br(e);mxUtils.br(e);var k=mxUtils.button(mxResources.get("openInThisWindow"),function(){g&&a.hideDialog();null!=d&&d()});k.className="geBtn";k.style.marginBottom="8px";k.style.width="280px";e.appendChild(k);mxUtils.br(e);var m=mxUtils.button(mxResources.get("openInNewWindow"),function(){g&&a.hideDialog();null!=b&&b();a.openLink(c,
+null,!0)});m.className="geBtn gePrimaryBtn";m.style.width=k.style.width;e.appendChild(m);mxUtils.br(e);mxUtils.br(e);mxUtils.write(e,mxResources.get("allowPopups"));this.container=e},ImageDialog=function(a,c,b,d,g,e){e=null!=e?e:!0;var k=a.editor.graph,m=document.createElement("div");mxUtils.write(m,c);c=document.createElement("div");c.className="geTitle";c.style.backgroundColor="transparent";c.style.borderColor="transparent";c.style.whiteSpace="nowrap";c.style.textOverflow="clip";c.style.cursor=
+"default";mxClient.IS_VML||(c.style.paddingRight="20px");var n=document.createElement("input");n.setAttribute("value",b);n.setAttribute("type","text");n.setAttribute("spellcheck","false");n.setAttribute("autocorrect","off");n.setAttribute("autocomplete","off");n.setAttribute("autocapitalize","off");n.style.marginTop="6px";n.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";n.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";n.style.backgroundRepeat="no-repeat";
+n.style.backgroundPosition="100% 50%";n.style.paddingRight="14px";b=document.createElement("div");b.setAttribute("title",mxResources.get("reset"));b.style.position="relative";b.style.left="-16px";b.style.width="12px";b.style.height="14px";b.style.cursor="pointer";b.style.display=mxClient.IS_VML?"inline":"inline-block";b.style.top=(mxClient.IS_VML?0:3)+"px";b.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(b,"click",function(){n.value="";n.focus()});c.appendChild(n);c.appendChild(b);
+m.appendChild(c);var q=function(b,c,f,l){var p="data:"==b.substring(0,5);!a.isOffline()||p&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(p){a.spinner.stop();a.hideDialog();var k=!1===l?1:null!=c&&null!=f?Math.max(c/p.width,f/p.height):Math.min(1,Math.min(520/p.width,520/p.height));e&&(b=a.convertDataUri(b));d(b,Math.round(Number(p.width)*k),Math.round(Number(p.height)*k))},function(){a.spinner.stop();d(null);a.showError(mxResources.get("error"),
+mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),d(b)):(b=a.convertDataUri(b),c=null==c?120:c,f=null==f?100:f,a.hideDialog(),d(b,c,f))},f=function(b,c){if(null!=b){var f=g?null:k.getModel().getGeometry(k.getSelectionCell());null!=f?q(b,f.width,f.height,c):q(b,null,null,c)}else a.hideDialog(),d(null)};this.init=function(){n.focus();if(Graph.fileSupport){n.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=m.parentNode,c=null;mxEvent.addListener(b,"dragleave",
+function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(f){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(a,b,c,l,d,p,e,k){f(a,
+k)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var l=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(l)&&f(decodeURIComponent(l))}b.stopPropagation();b.preventDefault()}),!1)}};b=document.createElement("div");b.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";b.style.textAlign="center";c=mxUtils.button(mxResources.get("cancel"),
+function(){a.spinner.stop();a.hideDialog()});c.className="geBtn";a.editor.cancelFirst&&b.appendChild(c);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(n.value=a.url));n.focus()};if(Graph.fileSupport){if(null==a.imgDlgFileInputElt){var l=document.createElement("input");l.setAttribute("multiple","multiple");l.setAttribute("type","file");mxEvent.addListener(l,"change",function(b){null!=
+l.files&&(a.importFiles(l.files,0,0,a.maxImageSize,function(a,b,c,l,d,p){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0),l.type="",l.type="file",l.value="")});l.style.display="none";document.body.appendChild(l);a.imgDlgFileInputElt=l}var p=mxUtils.button(mxResources.get("open"),function(){a.imgDlgFileInputElt.click()});p.className="geBtn";b.appendChild(p)}document.createElement("canvas").getContext&&"data:image/"==n.value.substring(0,
+11)&&"data:image/svg"!=n.value.substring(0,14)&&(p=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,n.value,function(a){n.value=a});a.showDialog(b.container,200,200,!0,!0);b.init()}),p.className="geBtn",b.appendChild(p));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(p=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);
+a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),p.className="geBtn",b.appendChild(p),null!=a.drive&&"1"==urlParams.photos&&(p=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).addView(google.picker.ViewId.PHOTO_UPLOAD);
+a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),p.className="geBtn",b.appendChild(p)));mxEvent.addListener(n,"keypress",function(a){13==a.keyCode&&f(n.value)});p=mxUtils.button(mxResources.get("apply"),function(){f(n.value)});p.className="geBtn gePrimaryBtn";b.appendChild(p);a.editor.cancelFirst||b.appendChild(c);Graph.fileSupport&&(b.style.marginTop="120px",m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",m.style.backgroundPosition=
+"center 65%",m.style.backgroundRepeat="no-repeat",c=document.createElement("div"),c.style.position="absolute",c.style.width="420px",c.style.top="58%",c.style.textAlign="center",c.style.fontSize="18px",c.style.color="#a0c3ff",mxUtils.write(c,mxResources.get("dragImagesHere")),m.appendChild(c));m.appendChild(b);this.container=m},LinkDialog=function(a,c,b,d,g){function e(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");b.style.height="26px";
+b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);z.appendChild(c)}var k=document.createElement("div");mxUtils.write(k,mxResources.get("editLink")+":");var m=document.createElement("div");m.className="geTitle";m.style.backgroundColor="transparent";m.style.borderColor="transparent";m.style.whiteSpace="nowrap";m.style.textOverflow="clip";m.style.cursor="default";mxClient.IS_VML||(m.style.paddingRight="20px");var n=document.createElement("input");
+n.setAttribute("placeholder",mxResources.get("dragUrlsHere"));n.setAttribute("type","text");n.style.marginTop="6px";n.style.width="100%";n.style.boxSizing="border-box";n.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";n.style.backgroundRepeat="no-repeat";n.style.backgroundPosition="100% 50%";n.style.paddingRight="14px";var q=document.createElement("div");q.setAttribute("title",mxResources.get("reset"));q.style.position="relative";q.style.left="-16px";q.style.width="12px";q.style.height=
+"14px";q.style.cursor="pointer";q.style.display=mxClient.IS_VML?"inline":"inline-block";q.style.top=(mxClient.IS_VML?0:3)+"px";q.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(q,"click",function(){n.value="";n.focus()});var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-bottom:8px;";f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","current-linkdialog");var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-bottom:8px;";
+l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","current-linkdialog");var p=document.createElement("select");p.style.width="100%";if(g&&null!=a.pages){null!=c&&"data:page/id,"==c.substring(0,13)?(l.setAttribute("checked","checked"),l.defaultChecked=!0):(n.setAttribute("value",c),f.setAttribute("checked","checked"),f.defaultChecked=!0);m.appendChild(f);m.appendChild(n);m.appendChild(q);mxUtils.br(m);m.appendChild(l);g=!1;for(q=0;q<a.pages.length;q++){var u=document.createElement("option");
+mxUtils.write(u,a.pages[q].getName()||mxResources.get("pageWithNumber",[q+1]));u.setAttribute("value","data:page/id,"+a.pages[q].getId());c==u.getAttribute("value")&&(u.setAttribute("selected","selected"),g=!0);p.appendChild(u)}if(!g&&l.checked){var v=document.createElement("option");mxUtils.write(v,mxResources.get("pageNotFound"));v.setAttribute("disabled","disabled");v.setAttribute("selected","selected");v.setAttribute("value","pageNotFound");p.appendChild(v);mxEvent.addListener(p,"change",function(){null==
+v.parentNode||v.selected||v.parentNode.removeChild(v)})}m.appendChild(p)}else n.setAttribute("value",c),m.appendChild(n),m.appendChild(q);k.appendChild(m);var t=mxUtils.button(b,function(){a.hideDialog();d(l.checked?"pageNotFound"!==p.value?p.value:c:n.value,LinkDialog.selectedDocs)});t.style.verticalAlign="middle";t.className="geBtn gePrimaryBtn";this.init=function(){l.checked?p.focus():(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",
+!1,null));mxEvent.addListener(p,"focus",function(){f.removeAttribute("checked");l.setAttribute("checked","checked");l.checked=!0});mxEvent.addListener(n,"focus",function(){l.removeAttribute("checked");f.setAttribute("checked","checked");f.checked=!0});if(Graph.fileSupport){var b=k.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(f){null==
+c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(n.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),f.setAttribute("checked","checked"),f.checked=!0,t.click());a.stopPropagation();a.preventDefault()}),!1)}};var z=document.createElement("div");z.style.marginTop=
+"20px";z.style.textAlign="center";b=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});b.style.verticalAlign="middle";b.className="geBtn";z.appendChild(b);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(b.style.display="none");b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.style.verticalAlign="middle";b.className="geBtn";a.editor.cancelFirst&&z.appendChild(b);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==
+google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||null!=a.docs[0].mimeType&&"application/vnd.jgraph."==a.docs[0].mimeType.substring(0,23)?b="https://www.draw.io/#G"+a.docs[0].id:"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);n.value=b;n.focus()}else LinkDialog.selectedDocs=null;n.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&
+e(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),f=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),
+b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(a.drive.token).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(c).addView(f).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTO_UPLOAD);a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});
+"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&e(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){n.value=a[0].link;n.focus()}})});null!=a.oneDrive&&e(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){n.value=b.value[0].webUrl;n.focus()})});null!=a.gitHub&&e(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=
+a){a=a.split("/");var b=a[0],c=a[1],f=a[2];a=a.slice(3,a.length).join("/");n.value="https://github.com/"+b+"/"+c+"/blob/"+f+"/"+a;n.focus()}})});null!=a.gitLab&&e(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),function(){a.gitLab.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],f=a[2];a=a.slice(3,a.length).join("/");n.value=DRAWIO_GITLAB_URL+"/"+b+"/"+c+"/blob/"+f+"/"+a;n.focus()}})});mxEvent.addListener(n,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),d(l.checked?
+p.value:n.value,LinkDialog.selectedDocs))});z.appendChild(t);a.editor.cancelFirst||z.appendChild(b);k.appendChild(z);this.container=k},AboutDialog=function(a){var c=document.createElement("div");c.style.marginTop="6px";c.setAttribute("align","center");var b=document.createElement("img");b.style.border="0px";mxClient.IS_SVG?(b.setAttribute("width","164"),b.setAttribute("height","221"),b.style.width="164px",b.style.height="221px",b.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):(b.setAttribute("width",
"176"),b.setAttribute("height","219"),b.style.width="170px",b.style.height="219px",b.setAttribute("src",IMAGE_PATH+"/logo-flat.png"));"dark"==uiTheme&&(b.style.filter="grayscale(100%) invert(100%)");c.appendChild(b);mxUtils.br(c);var b="dark"==uiTheme?"#cccccc":"#505050",d=document.createElement("small");d.innerHTML="v "+EditorUi.VERSION;d.style.color=b;c.appendChild(d);mxUtils.br(c);mxUtils.br(c);d=document.createElement("small");d.style.color=b;d.innerHTML='&copy; 2005-2019 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';
c.appendChild(d);mxEvent.addListener(c,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=c},FeedbackDialog=function(a){var c=document.createElement("div"),b=document.createElement("div");mxUtils.write(b,mxResources.get("sendYourFeedbackToDrawIo"));b.style.fontSize="18px";b.style.marginBottom="18px";c.appendChild(b);b=document.createElement("div");mxUtils.write(b,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");c.appendChild(b);var d=document.createElement("input");
-d.setAttribute("type","text");d.style.marginTop="6px";d.style.width="600px";var m=mxUtils.button(mxResources.get("sendMessage"),function(){var b=p.value+(l.checked?"\nDiagram:\n"+mxUtils.getXml(a.getXmlFileData()):"")+"\nBrowser:\n"+navigator.userAgent;b.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(d.value)+
-"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+b),function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()?a.alert(mxResources.get("feedbackSent")):a.alert(mxResources.get("errorSendingFeedback"))},function(){a.spinner.stop();a.alert(mxResources.get("errorSendingFeedback"))}))});m.className="geBtn gePrimaryBtn";m.setAttribute("disabled","disabled");var f=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
-mxEvent.addListener(d,"change",function(){0<d.value.length&&0<f.test(d.value)?m.removeAttribute("disabled"):m.setAttribute("disabled","disabled")});mxEvent.addListener(d,"keyup",function(){0<d.value.length&&f.test(d.value)?m.removeAttribute("disabled"):m.setAttribute("disabled","disabled")});c.appendChild(d);this.init=function(){d.focus()};var l=document.createElement("input");l.setAttribute("type","checkbox");l.setAttribute("checked","checked");l.defaultChecked=!0;b=document.createElement("p");b.style.marginTop=
-"14px";b.appendChild(l);var n=document.createElement("span");mxUtils.write(n," "+mxResources.get("includeCopyOfMyDiagram"));b.appendChild(n);mxEvent.addListener(n,"click",function(a){l.checked=!l.checked;mxEvent.consume(a)});c.appendChild(b);b=document.createElement("div");mxUtils.write(b,mxResources.get("feedback"));c.appendChild(b);var p=document.createElement("textarea");p.style.resize="none";p.style.width="600px";p.style.height="140px";p.style.marginTop="6px";p.setAttribute("placeholder",mxResources.get("comments"));
-c.appendChild(p);b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="right";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst?(b.appendChild(n),b.appendChild(m)):(b.appendChild(m),b.appendChild(n));c.appendChild(b);this.container=c};FeedbackDialog.maxAttachmentSize=1E6;
-var RevisionDialog=function(a,c,b){var d=document.createElement("div"),m=document.createElement("h3");m.style.marginTop="0px";mxUtils.write(m,mxResources.get("revisionHistory"));d.appendChild(m);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";d.appendChild(f);var l=document.createElement("div");l.style.position="absolute";l.style.border="1px solid lightGray";l.style.left="199px";l.style.width="470px";l.style.height=
-"376px";l.style.overflow="hidden";mxEvent.disableContextMenu(l);d.appendChild(l);var n=new Graph(l);n.setTooltips(!1);n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;var p=0,u=null,g=0,k=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=u&&null!=u[g]?u[g].getAttribute("name"):"pagenumber"==a?g+1:"pagecount"==a?null!=u?u.length:1:k.apply(this,arguments)};n.getLinkForCell=
-function(){return null};Editor.MathJaxRender&&n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var q=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),v=a.getCurrentFile(),y=null,t=null,A=null,z=null,D=mxUtils.button("",function(){null!=A&&n.zoomIn()});D.className="geSprite geSprite-zoomin";
-D.setAttribute("title",mxResources.get("zoomIn"));D.style.outline="none";D.style.border="none";D.style.margin="2px";D.setAttribute("disabled","disabled");mxUtils.setOpacity(D,20);var x=mxUtils.button("",function(){null!=A&&n.zoomOut()});x.className="geSprite geSprite-zoomout";x.setAttribute("title",mxResources.get("zoomOut"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var C=mxUtils.button("",function(){null!=A&&
-(n.maxFitScale=8,n.fit(8),n.center())});C.className="geSprite geSprite-fit";C.setAttribute("title",mxResources.get("fit"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var G=mxUtils.button("",function(){null!=A&&(n.zoomActual(),n.center())});G.className="geSprite geSprite-actualsize";G.setAttribute("title",mxResources.get("actualSize"));G.style.outline="none";G.style.border="none";G.style.margin="2px";G.setAttribute("disabled",
-"disabled");mxUtils.setOpacity(G,20);var B=document.createElement("div");B.style.position="absolute";B.style.textAlign="right";B.style.color="gray";B.style.marginTop="10px";B.style.backgroundColor="transparent";B.style.top="440px";B.style.right="32px";B.style.maxWidth="380px";B.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=A){var b=mxUtils.getXml(A.documentElement),c=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b=
-"undefined"===typeof pako?"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});F.className="geBtn";F.setAttribute("disabled","disabled");var E=mxUtils.button(mxResources.get("restore"),function(){null!=A&&null!=z&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(z):a.spinner.spin(document.body,mxResources.get("restoring"))&&v.save(!0,function(b){a.spinner.stop();
-a.replaceFileData(z);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});E.className="geBtn";E.setAttribute("disabled","disabled");var I=document.createElement("select");I.setAttribute("disabled","disabled");I.style.maxWidth="80px";I.style.position="relative";I.style.top="-2px";I.style.verticalAlign="bottom";I.style.marginRight="6px";I.style.display="none";var K=null;mxEvent.addListener(I,"change",function(a){null!=
-K&&(K(a),mxEvent.consume(a))});var J=mxUtils.button(mxResources.get("edit"),function(){null!=A&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(A.documentElement)),a.openLink(a.getUrl(),null,!0))});J.className="geBtn";J.setAttribute("disabled","disabled");null!=b&&(J.style.display="none");var H=mxUtils.button(mxResources.get("show"),function(){null!=t&&a.openLink(t.getUrl(I.selectedIndex))});H.className="geBtn gePrimaryBtn";H.setAttribute("disabled",
-"disabled");null!=b&&(H.style.display="none",E.className="geBtn gePrimaryBtn");m=document.createElement("div");m.style.position="absolute";m.style.top="482px";m.style.width="640px";m.style.textAlign="right";var L=document.createElement("div");L.className="geToolbarContainer";L.style.backgroundColor="transparent";L.style.padding="2px";L.style.border="none";L.style.left="199px";L.style.top="442px";var N=null;if(null!=c&&0<c.length){l.style.cursor="move";var S=document.createElement("table");S.style.border=
-"1px solid lightGray";S.style.borderCollapse="collapse";S.style.borderSpacing="0px";S.style.width="100%";var aa=document.createElement("tbody"),U=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(p=mxUtils.indexOf(a.pages,a.currentPage));for(var M=c.length-1;0<=M;M--){var X=function(b){var k=new Date(b.modifiedDate),d=null;if(0<=k.getTime()){var f=function(c){q.stop();var f=mxUtils.parseXml(c),t=a.editor.extractGraphModel(f.documentElement,!0);if(null!=t){var m=function(a){null!=a&&(a=
-y(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));return a},y=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";l.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center();return a};I.style.display="none";I.innerHTML="";A=f;z=c;u=parseSelectFunction=null;g=0;if("mxfile"==t.nodeName){f=t.getElementsByTagName("diagram");u=[];for(c=0;c<f.length;c++)u.push(f[c]);g=Math.min(p,
-u.length-1);0<u.length&&m(u[g]);if(1<u.length)for(I.removeAttribute("disabled"),I.style.display="",c=0;c<u.length;c++)f=document.createElement("option"),mxUtils.write(f,u[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),f.setAttribute("value",c),c==g&&f.setAttribute("selected","selected"),I.appendChild(f);K=function(){try{var b=parseInt(I.value);g=p=b;m(u[b])}catch(O){I.value=p,a.handleError(O)}}}else y(t);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");
-B.innerHTML="";mxUtils.write(B,(null!=c?c+" ":"")+k.toLocaleDateString()+" "+k.toLocaleTimeString());B.setAttribute("title",d.getAttribute("title"));D.removeAttribute("disabled");x.removeAttribute("disabled");C.removeAttribute("disabled");G.removeAttribute("disabled");null!=v&&v.isRestricted()||(a.editor.graph.isEnabled()&&E.removeAttribute("disabled"),F.removeAttribute("disabled"),H.removeAttribute("disabled"),J.removeAttribute("disabled"));mxUtils.setOpacity(D,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(C,
-60);mxUtils.setOpacity(G,60)}else I.style.display="none",I.innerHTML="",B.innerHTML="",mxUtils.write(B,mxResources.get("errorLoadingFile"))},d=document.createElement("tr");d.style.borderBottom="1px solid lightGray";d.style.fontSize="12px";d.style.cursor="pointer";var m=document.createElement("td");m.style.padding="6px";m.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(m,mxResources.get("current")):k.toDateString()===U?mxUtils.write(m,k.toLocaleTimeString()):mxUtils.write(m,k.toLocaleDateString()+
-" "+k.toLocaleTimeString());d.appendChild(m);d.setAttribute("title",k.toLocaleDateString()+" "+k.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(a){t!=b&&(q.stop(),null!=y&&(y.style.backgroundColor=""),t=b,y=d,y.style.backgroundColor="#ebf2f9",z=A=null,B.removeAttribute("title"),B.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),l.style.backgroundColor=
-"#ffffff",n.getModel().clear(),E.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),mxUtils.setOpacity(D,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(C,20),mxUtils.setOpacity(G,20),q.spin(l),b.getXml(function(a){if(t==
-b)try{f(a)}catch(Z){B.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+Z.message)}},function(a){q.stop();I.style.display="none";I.innerHTML="";B.innerHTML="";mxUtils.write(B,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(d,"dblclick",function(a){H.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);aa.appendChild(d)}return d}(c[M]);null!=X&&M==c.length-1&&(N=X)}S.appendChild(aa);
-f.appendChild(S)}else null==v||null==a.drive&&v.constructor==window.DriveFile||null==a.dropbox&&v.constructor==window.DropboxFile?(l.style.display="none",L.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(l.style.display="none",L.style.display="none",mxUtils.write(f,mxResources.get("noRevisions")));this.init=function(){null!=N&&N.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";L.appendChild(I);L.appendChild(D);L.appendChild(x);
-L.appendChild(G);L.appendChild(C);a.editor.cancelFirst?(m.appendChild(f),m.appendChild(F),m.appendChild(J),m.appendChild(E),m.appendChild(H)):(m.appendChild(F),m.appendChild(J),m.appendChild(E),m.appendChild(H),m.appendChild(f));d.appendChild(m);d.appendChild(L);d.appendChild(B);this.container=d},DraftDialog=function(a,c,b,d,m,f,l,n){var p=document.createElement("div"),u=document.createElement("div");u.style.marginTop="0px";u.style.whiteSpace="nowrap";u.style.overflow="auto";mxUtils.write(u,c);p.appendChild(u);
-var g=document.createElement("div");g.style.position="absolute";g.style.border="1px solid lightGray";g.style.marginTop="10px";g.style.width="640px";g.style.top="46px";g.style.bottom="74px";g.style.overflow="hidden";mxEvent.disableContextMenu(g);p.appendChild(g);var k=new Graph(g);k.setEnabled(!1);k.setPanning(!0);k.panningHandler.ignoreCell=!0;k.panningHandler.useLeftButtonForPanning=!0;k.minFitScale=null;k.maxFitScale=null;k.centerZoom=!0;c=mxUtils.parseXml(b);var q=a.editor.extractGraphModel(c.documentElement,
-!0),v=0,y=null,t=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a&&null!=y&&null!=y[v]?y[v].getAttribute("name"):"pagenumber"==a?v+1:"pagecount"==a?null!=y?y.length:1:t.apply(this,arguments)};k.getLinkForCell=function(){return null};c=mxUtils.button("",function(){k.zoomIn()});c.className="geSprite geSprite-zoomin";c.setAttribute("title",mxResources.get("zoomIn"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);b=mxUtils.button("",function(){k.zoomOut()});
-b.className="geSprite geSprite-zoomout";b.setAttribute("title",mxResources.get("zoomOut"));b.style.outline="none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);u=mxUtils.button("",function(){k.maxFitScale=8;k.fit(8);k.center()});u.className="geSprite geSprite-fit";u.setAttribute("title",mxResources.get("fit"));u.style.outline="none";u.style.border="none";u.style.margin="2px";mxUtils.setOpacity(u,60);var A=mxUtils.button("",function(){k.zoomActual();k.center()});A.className="geSprite geSprite-actualsize";
-A.setAttribute("title",mxResources.get("actualSize"));A.style.outline="none";A.style.border="none";A.style.margin="2px";mxUtils.setOpacity(A,60);m=mxUtils.button(l||mxResources.get("discard"),m);m.className="geBtn";var z=document.createElement("select");z.style.maxWidth="80px";z.style.position="relative";z.style.top="-2px";z.style.verticalAlign="bottom";z.style.marginRight="6px";z.style.display="none";d=mxUtils.button(f||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";f=document.createElement("div");
-f.style.position="absolute";f.style.bottom="30px";f.style.width="640px";f.style.textAlign="right";l=document.createElement("div");l.className="geToolbarContainer";l.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function a(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";g.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,k.getModel());
-k.maxFitScale=1;k.fit(8);k.center()}}function b(b){null!=b&&(b=a(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(b))).documentElement));return b}mxEvent.addListener(z,"change",function(a){v=parseInt(z.value);b(y[v]);mxEvent.consume(a)});if("mxfile"==q.nodeName){var c=q.getElementsByTagName("diagram");y=[];for(var d=0;d<c.length;d++)y.push(c[d]);0<y.length&&b(y[v]);if(1<y.length)for(z.style.display="",d=0;d<y.length;d++)c=document.createElement("option"),mxUtils.write(c,y[d].getAttribute("name")||
-mxResources.get("pageWithNumber",[d+1])),c.setAttribute("value",d),d==v&&c.setAttribute("selected","selected"),z.appendChild(c)}else a(q)};l.appendChild(z);l.appendChild(c);l.appendChild(b);l.appendChild(A);l.appendChild(u);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.className="geBtn";n=null!=n?mxUtils.button(mxResources.get("ignore"),n):null;null!=n&&(n.className="geBtn");a.editor.cancelFirst?(f.appendChild(c),null!=n&&f.appendChild(n),f.appendChild(m),f.appendChild(d)):
-(f.appendChild(d),f.appendChild(m),null!=n&&f.appendChild(n),f.appendChild(c));p.appendChild(f);p.appendChild(l);this.container=p},FindWindow=function(a,c,b,d,m){function f(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var g=0;g<b.length;g++)if("label"!=b[g].nodeName){var k=mxUtils.trim(b[g].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&k.substring(0,c.length)===c||null!=a&&a.test(k))return!0}}return!1}function l(){var a=p.model.getDescendants(p.model.getRoot()),
-b=q.value.toLowerCase(),c=v.checked?new RegExp(b):null,k=null;u!=b&&(u=b,g=null);var d=null==g;if(0<b.length)for(var l=0;l<a.length;l++){var m=p.view.getState(a[l]);if(null!=m&&null!=m.cell.value&&(d||null==k)&&(p.model.isVertex(m.cell)||p.model.isEdge(m.cell))&&(p.isHtmlLabel(m.cell)?(t.innerHTML=p.getLabel(m.cell),label=mxUtils.extractTextWithWhitespace([t])):label=p.getLabel(m.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===
-b||f(c,m.cell,b))||null!=c&&(c.test(label)||f(c,m.cell,b))))if(d){k=m;break}else null==k&&(k=m);d=d||m==g}null!=k?(g=k,p.scrollCellToVisible(g.cell),p.isEnabled()?p.setSelectionCell(g.cell):p.highlightCell(g.cell)):p.isEnabled()&&p.clearSelection();return 0==b.length||null!=k}var n=a.actions.get("find"),p=a.editor.graph,u=null,g=null,k=document.createElement("div");k.style.userSelect="none";k.style.overflow="hidden";k.style.padding="10px";k.style.height="100%";var q=document.createElement("input");
-q.setAttribute("placeholder",mxResources.get("find"));q.setAttribute("type","text");q.style.marginTop="4px";q.style.marginBottom="6px";q.style.width="200px";q.style.fontSize="12px";q.style.borderRadius="4px";q.style.padding="6px";k.appendChild(q);mxUtils.br(k);var v=document.createElement("input");v.setAttribute("type","checkbox");v.style.marginRight="4px";k.appendChild(v);mxUtils.write(k,mxResources.get("regularExpression"));var y=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000088250");
-y.style.position="relative";y.style.marginLeft="6px";y.style.top="-1px";k.appendChild(y);var t=document.createElement("div");mxUtils.br(k);y=mxUtils.button(mxResources.get("reset"),function(){q.value="";q.style.backgroundColor="";u=g=null;q.focus()});y.setAttribute("title",mxResources.get("reset"));y.style.marginTop="6px";y.style.marginRight="4px";y.className="geBtn";k.appendChild(y);y=mxUtils.button(mxResources.get("find"),function(){try{q.style.backgroundColor=l()?"":"#ffcfcf"}catch(z){a.handleError(z)}});
-y.setAttribute("title",mxResources.get("find")+" (Enter)");y.style.marginTop="6px";y.className="geBtn gePrimaryBtn";k.appendChild(y);mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(u!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=l()?"":"#ffcfcf"}catch(D){q.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(k,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&
-(n.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),k,c,b,d,m,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)):p.container.focus()}));this.window.setLocation=
-function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var A=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,
-"resize",A);this.destroy=function(){mxEvent.removeListener(window,"resize",A);this.window.destroy()}},FreehandWindow=function(a,c,b,d,m){var f=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var l=mxUtils.button(mxResources.get("startDrawing"),function(){f.freehand.isDrawing()&&f.freehand.stopDrawing();f.freehand.startDrawing()});l.setAttribute("title",mxResources.get("startDrawing"));l.style.marginTop="8px";l.style.marginRight=
-"4px";l.style.width="160px";l.style.overflow="hidden";l.style.textOverflow="ellipsis";l.style.textAlign="center";l.className="geBtn gePrimaryBtn";a.appendChild(l);var n=l.cloneNode(!1);mxUtils.write(n,mxResources.get("stopDrawing"));n.setAttribute("title",mxResources.get("stopDrawing"));n.style.marginTop="4px";mxEvent.addListener(n,"click",function(){f.freehand.stopDrawing()});a.appendChild(n);this.window=new mxWindow(mxResources.get("freehand"),a,c,b,d,m,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
-this.window.setResizable(!1);this.window.setClosable(!0);f.addListener("freehandStateChanged",mxUtils.bind(this,function(){n.className="geBtn"+(f.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){f.freehand.isDrawing()&&f.freehand.stopDrawing()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;
-a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var p=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",p);this.destroy=function(){mxEvent.removeListener(window,"resize",p);this.window.destroy()}},
-TagsWindow=function(a,c,b,d,m){var f=a.editor.graph,l="tags",n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var p=document.createElement("input");p.setAttribute("placeholder",mxResources.get("allTags"));p.setAttribute("type","text");p.style.marginTop="4px";p.style.width="260px";p.style.fontSize="12px";p.style.borderRadius="4px";p.style.padding="6px";n.appendChild(p);if(!a.isOffline()||mxClient.IS_CHROMEAPP){p.style.width=
-"240px";var u=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000046966");u.firstChild.style.marginBottom="6px";u.style.marginLeft="6px";n.appendChild(u)}mxEvent.addListener(p,"dblclick",function(){var b=new FilenameDialog(a,l,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(l=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});p.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(n);
-u=mxUtils.button(mxResources.get("hide"),function(){var a=f.getCellsForTags(p.value.split(" "),void 0,l,!0);f.setCellsVisible(a,!1)});u.setAttribute("title",mxResources.get("hide"));u.style.marginTop="8px";u.style.marginRight="4px";u.className="geBtn";n.appendChild(u);u=mxUtils.button(mxResources.get("show"),function(){var a=f.getCellsForTags(p.value.split(" "),void 0,l,!0);f.setCellsVisible(a,!0);if(f.isEnabled()){for(var b=[],c=0;c<a.length;c++)(f.model.isVertex(a[c])||f.model.isEdge(a[c]))&&b.push(a[c]);
-f.setSelectionCells(b)}else for(c=0;c<a.length;c++)f.highlightCell(a[c])});u.setAttribute("title",mxResources.get("show"));u.style.marginTop="8px";u.style.marginRight="4px";u.className="geBtn";n.appendChild(u);var g=a.actions.get("tags"),u=mxUtils.button(mxResources.get("close"),function(){g.funct()});u.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");u.style.marginTop="8px";u.className="geBtn gePrimaryBtn";n.appendChild(u);mxEvent.addListener(p,"keyup",function(a){13!=a.keyCode&&27!=
-a.keyCode||g.funct()});this.window=new mxWindow(mxResources.get("tags"),n,c,b,d,m,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)):f.container.focus()}));this.window.setLocation=function(a,
-b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var k=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,
-"resize",k);this.destroy=function(){mxEvent.removeListener(window,"resize",k);this.window.destroy()}},AuthDialog=function(a,c,b,d){var m=document.createElement("div");m.style.textAlign="center";var f=document.createElement("p");f.style.fontSize="16pt";f.style.padding="0px";f.style.margin="0px";f.style.color="gray";mxUtils.write(f,mxResources.get("authorizationRequired"));var l="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight=
-"10px";c==a.drive?(l=mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?(l=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(l=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(l=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(l=mxResources.get("gitlab"),n.src=IMAGE_PATH+"/gitlab-logo.svg",n.style.width="32px"):c==a.trello&&(l=mxResources.get("trello"),
-n.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[l]));var p=document.createElement("input");p.setAttribute("type","checkbox");l=mxUtils.button(mxResources.get("authorize"),function(){d(p.checked)});l.insertBefore(n,l.firstChild);l.style.marginTop="6px";l.className="geBigButton";l.style.fontSize="18px";l.style.padding="14px";m.appendChild(f);m.appendChild(a);m.appendChild(l);b&&(b=document.createElement("p"),b.style.marginTop=
-"20px",b.appendChild(p),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberMe")),b.appendChild(f),m.appendChild(b),p.checked=!0,p.defaultChecked=!0,mxEvent.addListener(f,"click",function(a){p.checked=!p.checked;mxEvent.consume(a)}));this.container=m},MoreShapesDialog=function(a,c,b){b=null!=b?b:a.sidebar.entries;var d=document.createElement("div"),m=[];if(null!=a.sidebar.customEntries)for(var f=0;f<a.sidebar.customEntries.length;f++){for(var l=a.sidebar.customEntries[f],
-n={title:a.getResource(l.title),entries:[]},p=0;p<l.entries.length;p++){var u=l.entries[p];n.entries.push({id:u.id,title:a.getResource(u.title),desc:a.getResource(u.desc),image:u.preview})}m.push(n)}for(f=0;f<b.length;f++)if(null==a.sidebar.enabledLibraries)m.push(b[f]);else{n={title:b[f].title,entries:[]};for(p=0;p<b[f].entries.length;p++)0<=mxUtils.indexOf(a.sidebar.enabledLibraries,b[f].entries[p].id)&&n.entries.push(b[f].entries[p]);0<n.entries.length&&m.push(n)}b=m;if(c){p=mxUtils.bind(this,
-function(b){for(var c=0;c<b.length;c++)(function(b){var d=y.cloneNode(!1);d.style.fontWeight="bold";d.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";d.style.padding="6px 0px 6px 20px";mxUtils.write(d,b.title);g.appendChild(d);for(var f=0;f<b.entries.length;f++)(function(b){var d=y.cloneNode(!1);d.style.cursor="pointer";d.style.padding="4px 0px 4px 20px";d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.textOverflow="ellipsis";d.setAttribute("title",b.title+" ("+b.id+")");var t=
-document.createElement("input");t.setAttribute("type","checkbox");t.checked=a.sidebar.isEntryVisible(b.id);t.defaultChecked=t.checked;d.appendChild(t);mxUtils.write(d," "+b.title);g.appendChild(d);var l=function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName){k.style.textAlign="center";k.style.padding="0px";k.style.color="";k.innerHTML="";if(null!=b.desc){var c=document.createElement("pre");c.style.boxSizing="border-box";c.style.fontFamily="inherit";c.style.margin="20px";c.style.right="0px";
-c.style.textAlign="left";mxUtils.write(c,b.desc);k.appendChild(c)}null!=b.imageCallback?b.imageCallback(k):null!=b.image?k.innerHTML+='<img border="0" src="'+b.image+'"/>':null==b.desc&&(k.style.padding="20px",k.style.color="rgb(179, 179, 179)",mxUtils.write(k,mxResources.get("noPreview")));null!=q&&(q.style.backgroundColor="");q=d;q.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(d,"click",l);mxEvent.addListener(d,"dblclick",function(a){t.checked=
-!t.checked;mxEvent.consume(a)});v.push(function(){return t.checked?b.id:null});0==c&&0==f&&l()})(b.entries[f])})(b[c])});f=document.createElement("div");f.className="geDialogTitle";mxUtils.write(f,mxResources.get("shapes"));f.style.position="absolute";f.style.top="0px";f.style.left="0px";f.style.lineHeight="40px";f.style.height="40px";f.style.right="0px";mxClient.IS_QUIRKS&&(f.style.width="718px");var g=document.createElement("div"),k=document.createElement("div");g.style.position="absolute";g.style.top=
-"40px";g.style.left="0px";g.style.width="202px";g.style.bottom="60px";g.style.overflow="auto";mxClient.IS_QUIRKS&&(g.style.height="437px",g.style.marginTop="1px");k.style.position="absolute";k.style.left="202px";k.style.right="0px";k.style.top="40px";k.style.bottom="60px";k.style.overflow="auto";k.style.borderLeft="1px solid rgb(211, 211, 211)";k.style.textAlign="center";mxClient.IS_QUIRKS&&(k.style.width=parseInt(f.style.width)-202+"px",k.style.height=g.style.height,k.style.marginTop=g.style.marginTop);
-var q=null,v=[],y=document.createElement("div");y.style.position="relative";y.style.left="0px";y.style.right="0px";p(b);d.style.padding="30px";d.appendChild(f);d.appendChild(g);d.appendChild(k);b=document.createElement("div");b.className="geDialogFooter";b.style.position="absolute";b.style.paddingRight="16px";b.style.color="gray";b.style.left="0px";b.style.right="0px";b.style.bottom="0px";b.style.height="60px";b.style.lineHeight="52px";mxClient.IS_QUIRKS&&(b.style.width=f.style.width,b.style.paddingTop=
-"12px");var t=document.createElement("input");t.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)f=document.createElement("span"),f.style.paddingRight="20px",f.appendChild(t),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),t.checked=!0,t.defaultChecked=!0,mxEvent.addListener(f,"click",function(a){mxEvent.getSource(a)!=t&&(t.checked=!t.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(f.style.position="relative",f.style.top="-6px"),b.appendChild(f);f=mxUtils.button(mxResources.get("cancel"),
-function(){a.hideDialog()});f.className="geBtn";p=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=[],c=0;c<v.length;c++){var g=v[c].apply(this,arguments);null!=g&&b.push(g)}a.sidebar.showEntries(b.join(";"),t.checked,!0)});p.className="geBtn gePrimaryBtn"}else{var A=document.createElement("table"),f=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";p=document.createElement("tr");A.style.width="100%";c=document.createElement("td");var m=document.createElement("td"),
-l=document.createElement("td"),z=mxUtils.bind(this,function(b,c,g){var k=document.createElement("input");k.type="checkbox";A.appendChild(k);k.checked=a.sidebar.isEntryVisible(g);var d=document.createElement("span");mxUtils.write(d,c);c=document.createElement("div");c.style.display="block";c.appendChild(k);c.appendChild(d);mxEvent.addListener(d,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return k.checked?g:null}});p.appendChild(c);p.appendChild(m);
-p.appendChild(l);f.appendChild(p);A.appendChild(f);for(var v=[],D=0,f=0;f<b.length;f++)for(p=0;p<b[f].entries.length;p++)D++;for(var x=[c,m,l],C=0,f=0;f<b.length;f++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];v.push(z(x[Math.floor(C/(D/3))],c.title,c.id));C++}})(b[f]);d.appendChild(A);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";t=document.createElement("input");isLocalStorage&&(t.setAttribute("type","checkbox"),t.checked=!0,t.defaultChecked=
-!0,b.appendChild(t),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),b.appendChild(f),mxEvent.addListener(f,"click",function(a){t.checked=!t.checked;mxEvent.consume(a)}));d.appendChild(b);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";p=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<v.length;c++){var g=v[c].apply(this,arguments);null!=g&&b.push(g)}a.sidebar.showEntries(0<b.length?
-b.join(";"):"",t.checked);a.hideDialog()});p.className="geBtn gePrimaryBtn";b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="right"}a.editor.cancelFirst?(b.appendChild(f),b.appendChild(p)):(b.appendChild(p),b.appendChild(f));d.appendChild(b);this.container=d},PluginsDialog=function(a){function c(){if(0==m.length)d.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{d.innerHTML="";for(var b=0;b<m.length;b++){var k=document.createElement("span");k.style.whiteSpace=
-"nowrap";var q=document.createElement("span");q.className="geSprite geSprite-delete";q.style.position="relative";q.style.cursor="pointer";q.style.top="5px";q.style.marginRight="4px";q.style.display="inline-block";k.appendChild(q);mxUtils.write(k,m[b]);d.appendChild(k);mxUtils.br(d);mxEvent.addListener(q,"click",function(b){return function(){a.confirm(mxResources.get("delete")+' "'+m[b]+'"?',function(){m.splice(b,1);c()})}}(b))}}}var b=document.createElement("div"),d=document.createElement("div");
-d.style.height="120px";d.style.overflow="auto";var m=mxSettings.getPlugins().slice();b.appendChild(d);c();var f=mxUtils.button(mxResources.get("add"),function(){var b="",k=urlParams.p;if(null!=k&&0<k.length){for(var d=k.split(";"),k=0;k<d.length;k++){var f=App.pluginRegistry[d[k]];null!=f&&(b+=f+";")}";"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1))}b=new FilenameDialog(a,b,mxResources.get("add"),function(a){if(null!=a&&0<a.length){d=a.split(";");for(a=0;a<d.length;a++){var b=d[a],g=App.pluginRegistry[b];
-null!=g&&(b=g);0<b.length&&0>mxUtils.indexOf(m,b)&&m.push(b)}c()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");a.showDialog(b.container,300,80,!0,!0);b.init()});f.className="geBtn";var l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";var n=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(m);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});n.className="geBtn gePrimaryBtn";var p=
-document.createElement("div");p.style.marginTop="14px";p.style.textAlign="right";var u=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000056430")});u.className="geBtn";a.isOffline()&&!mxClient.IS_CHROMEAPP&&(u.style.display="none");p.appendChild(u);a.editor.cancelFirst?(p.appendChild(l),p.appendChild(f),p.appendChild(n)):(p.appendChild(f),p.appendChild(n),p.appendChild(l));b.appendChild(p);this.container=b},CropImageDialog=function(a,
-c,b){var d=document.createElement("div"),m=document.createElement("table"),f=document.createElement("tbody"),l=document.createElement("tr"),n=document.createElement("td");n.style.whiteSpace="nowrap";n.setAttribute("colspan","2");mxUtils.write(n,mxResources.get("loading")+"...");l.appendChild(n);f.appendChild(l);var l=document.createElement("tr"),p=document.createElement("td"),u=document.createElement("td");m.style.paddingLeft="6px";mxUtils.write(p,mxResources.get("left")+":");var g=document.createElement("input");
-g.setAttribute("type","text");g.style.width="100px";g.value="0";this.init=function(){g.focus();g.select()};u.appendChild(g);l.appendChild(p);l.appendChild(u);f.appendChild(l);l=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("top")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value="0";u.appendChild(k);l.appendChild(p);l.appendChild(u);f.appendChild(l);l=document.createElement("tr");
-p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("right")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value="0";u.appendChild(q);l.appendChild(p);l.appendChild(u);f.appendChild(l);l=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("bottom")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";
-v.value="0";u.appendChild(v);l.appendChild(p);l.appendChild(u);f.appendChild(l);l=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("circle")+":");l.appendChild(p);var y=document.createElement("input");y.setAttribute("type","checkbox");u.appendChild(y);l.appendChild(u);f.appendChild(l);m.appendChild(f);d.appendChild(m);m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";var t=new Image,
-A=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var c=document.createElement("canvas"),d=c.getContext("2d"),f=t.width,l=t.height,m=parseInt(g.value),B=parseInt(k.value),f=Math.max(1,f-m-parseInt(q.value)),l=Math.max(1,l-B-parseInt(v.value));c.width=f;c.height=l;y.checked&&(d.fillStyle="#000000",d.arc(f/2,l/2,Math.min(f/2,l/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(t,m,B,f,l,0,0,f,l);b(c.toDataURL())});A.className="geBtn gePrimaryBtn";A.setAttribute("disabled",
-"disabled");t.onload=function(){A.removeAttribute("disabled");n.innerHTML="";mxUtils.write(n,mxResources.get("width")+": "+t.width+" "+mxResources.get("height")+": "+t.height)};t.src=c;mxEvent.addListener(d,"keypress",function(a){13==a.keyCode&&A.click()});c=document.createElement("div");c.style.marginTop="20px";c.style.textAlign="right";a.editor.cancelFirst?(c.appendChild(m),c.appendChild(A)):(c.appendChild(A),c.appendChild(m));d.appendChild(c);this.container=d},EditGeometryDialog=function(a,c){var b=
-a.editor.graph,d=1==c.length?b.getCellGeometry(c[0]):null,m=document.createElement("div"),f=document.createElement("table"),l=document.createElement("tbody"),n=document.createElement("tr"),p=document.createElement("td"),u=document.createElement("td");f.style.paddingLeft="6px";mxUtils.write(p,mxResources.get("relative")+":");var g=document.createElement("input");g.setAttribute("type","checkbox");null!=d&&d.relative&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);this.init=function(){g.focus()};
-u.appendChild(g);n.appendChild(p);n.appendChild(u);l.appendChild(n);n=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value=null!=d?d.x:"";u.appendChild(k);n.appendChild(p);n.appendChild(u);l.appendChild(n);n=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("top")+
-":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=d?d.y:"";u.appendChild(q);n.appendChild(p);n.appendChild(u);l.appendChild(n);n=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("dx")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=d&&null!=d.offset?d.offset.x:"";u.appendChild(v);n.appendChild(p);n.appendChild(u);
-l.appendChild(n);n=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("dy")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=null!=d&&null!=d.offset?d.offset.y:"";u.appendChild(y);n.appendChild(p);n.appendChild(u);l.appendChild(n);n=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("width")+":");var t=
-document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=d?d.width:"";u.appendChild(t);n.appendChild(p);n.appendChild(u);l.appendChild(n);n=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("height")+":");var A=document.createElement("input");A.setAttribute("type","text");A.style.width="100px";A.value=null!=d?d.height:"";u.appendChild(A);n.appendChild(p);n.appendChild(u);l.appendChild(n);
-n=document.createElement("tr");p=document.createElement("td");u=document.createElement("td");mxUtils.write(p,mxResources.get("rotation")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.width="100px";z.value=1==c.length?mxUtils.getValue(b.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";u.appendChild(z);n.appendChild(p);n.appendChild(u);l.appendChild(n);f.appendChild(l);m.appendChild(f);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className=
-"geBtn";var D=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.getModel().beginUpdate();try{for(var d=0;d<c.length;d++){var f=b.getCellGeometry(c[d]);null!=f&&(f=f.clone(),b.isCellMovable(c[d])&&(f.relative=g.checked,0<mxUtils.trim(k.value).length&&(f.x=Number(k.value)),0<mxUtils.trim(q.value).length&&(f.y=Number(q.value)),0<mxUtils.trim(v.value).length&&(null==f.offset&&(f.offset=new mxPoint),f.offset.x=Number(v.value)),0<mxUtils.trim(y.value).length&&(null==f.offset&&(f.offset=
-new mxPoint),f.offset.y=Number(y.value))),b.isCellResizable(c[d])&&(0<mxUtils.trim(t.value).length&&(f.width=Number(t.value)),0<mxUtils.trim(A.value).length&&(f.height=Number(A.value))),b.getModel().setGeometry(c[d],f));0<mxUtils.trim(z.value).length&&b.setCellStyles(mxConstants.STYLE_ROTATION,Number(z.value),[c[d]])}}finally{b.getModel().endUpdate()}});D.className="geBtn gePrimaryBtn";mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&D.click()});f=document.createElement("div");f.style.marginTop=
-"20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(d),f.appendChild(D)):(f.appendChild(D),f.appendChild(d));m.appendChild(f);this.container=m},LibraryDialog=function(a,c,b,d,m,f){function l(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=v;)a=a.parentNode;var b=null;if(null!=a)for(var c=v.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function n(b,c,k,d,q,f,m,B,p){try{if(a.spinner.stop(),null==c||"image/"==c.substring(0,6))if(null==b&&null!=
-m||null==t[b]){var F=function(){J.innerHTML="";J.style.cursor="pointer";J.style.whiteSpace="nowrap";J.style.textOverflow="ellipsis";mxUtils.write(J,null!=L.title&&0<L.title.length?L.title:mxResources.get("untitled"));J.style.color=null==L.title||0==L.title.length?"#d0d0d0":""};v.style.backgroundImage="";y.style.display="none";var z=q,u=f;if(q>a.maxImageSize||f>a.maxImageSize){var G=Math.min(1,Math.min(a.maxImageSize/Math.max(1,q)),a.maxImageSize/Math.max(1,f));q*=G;f*=G}z>u?(u=Math.round(100*u/z),
-z=100):(z=Math.round(100*z/u),u=100);var E=document.createElement("div");E.setAttribute("draggable","true");E.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";E.style.position="relative";E.style.cursor="move";mxUtils.setPrefixedStyle(E.style,"transition","transform .1s ease-in-out");if(null!=b){var H=document.createElement("img");H.setAttribute("src",x.convert(b));H.style.width=z+"px";H.style.height=u+"px";H.style.margin="10px";H.style.paddingBottom=Math.floor((100-u)/2)+"px";H.style.paddingLeft=
-Math.floor((100-z)/2)+"px";E.appendChild(H)}else if(null!=m){var K=a.stringToCells(Graph.decompress(m.xml));0<K.length&&(a.sidebar.createThumb(K,100,100,E,null,!0,!1),E.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",E.firstChild.style.cursor="")}var I=document.createElement("img");I.setAttribute("src",Editor.closeImage);I.setAttribute("border","0");I.setAttribute("title",mxResources.get("delete"));I.setAttribute("align","top");I.style.paddingTop="4px";I.style.position="absolute";
-I.style.marginLeft="-12px";I.style.zIndex="1";I.style.cursor="pointer";mxEvent.addListener(I,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,c){mxEvent.addListener(I,"click",function(k){t[b]=null;for(var d=0;d<g.length;d++)if(null!=g[d].data&&g[d].data==b||null!=g[d].xml&&null!=c&&g[d].xml==c.xml){g.splice(d,1);break}E.parentNode.removeChild(a);0==g.length&&(v.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",y.style.display="");mxEvent.consume(k)});mxEvent.addListener(I,"dblclick",
-function(a){mxEvent.consume(a)})})(E,b,m);E.appendChild(I);E.style.marginBottom="30px";var J=document.createElement("div");J.style.position="absolute";J.style.boxSizing="border-box";J.style.bottom="-18px";J.style.left="10px";J.style.right="10px";J.style.backgroundColor="#ffffff";J.style.overflow="hidden";J.style.textAlign="center";var L=null;null!=b?(L={data:b,w:q,h:f,title:p},null!=B&&(L.aspect=B),t[b]=H,g.push(L)):null!=m&&(m.aspect="fixed",g.push(m),L=m);mxEvent.addListener(J,"keydown",function(a){13==
-a.keyCode&&null!=D&&(D(),D=null,mxEvent.consume(a))});F();E.appendChild(J);mxEvent.addListener(J,"mousedown",function(a){"true"!=J.getAttribute("contentEditable")&&mxEvent.consume(a)});K=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,L.title||"",mxResources.get("ok"),function(a){null!=a&&(L.title=a,F())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=
-J.getAttribute("contentEditable")){null!=D&&(D(),D=null);if(null==L.title||0==L.title.length)J.innerHTML="";J.style.textOverflow="";J.style.whiteSpace="";J.style.cursor="text";J.style.color="";J.setAttribute("contentEditable","true");J.focus();document.execCommand("selectAll",!1,null);D=function(){J.removeAttribute("contentEditable");J.style.cursor="pointer";L.title=J.innerHTML;F()};mxEvent.consume(b)}};mxEvent.addListener(J,"click",K);mxEvent.addListener(E,"dblclick",K);v.appendChild(E);mxEvent.addListener(E,
-"dragstart",function(a){null==b&&null!=m&&(I.style.visibility="hidden",J.style.visibility="hidden");mxClient.IS_FF&&null!=m.xml&&a.dataTransfer.setData("Text",m.xml);A=l(a);mxClient.IS_GC&&(E.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(E.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(E,30);I.style.visibility="";J.style.visibility=""},0)});mxEvent.addListener(E,"dragend",function(a){"hidden"==I.style.visibility&&(I.style.visibility="",J.style.visibility="");A=
-null;mxUtils.setOpacity(E,100);mxUtils.setPrefixedStyle(E.style,"transform",null)})}else C||(C=!0,a.handleError({message:mxResources.get("fileExists")}));else{q=!1;try{if(z=mxUtils.parseXml(b),"mxlibrary"==z.documentElement.nodeName){u=JSON.parse(mxUtils.getTextContent(z.documentElement));if(null!=u&&0<u.length)for(var N=0;N<u.length;N++)null!=u[N].xml?n(null,null,0,0,0,0,u[N]):n(u[N].data,null,0,0,u[N].w,u[N].h,null,"fixed",u[N].title);q=!0}else if("mxfile"==z.documentElement.nodeName){for(var S=
-z.documentElement.getElementsByTagName("diagram"),N=0;N<S.length;N++){var u=mxUtils.getTextContent(S[N]),K=a.stringToCells(Graph.decompress(u)),Y=a.editor.graph.getBoundingBoxFromGeometry(K);n(null,null,0,0,0,0,{xml:u,w:Y.width,h:Y.height})}q=!0}}catch(fa){}q||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(fa){}return null}function p(a){a.dataTransfer.dropEffect=null!=A?"move":"copy";a.stopPropagation();a.preventDefault()}function u(b){b.stopPropagation();b.preventDefault();
-C=!1;z=l(b);if(null!=A)null!=z&&z<v.children.length?(g.splice(z>A?z-1:z,0,g.splice(A,1)[0]),v.insertBefore(v.children[A],v.children[z])):(g.push(g.splice(A,1)[0]),v.appendChild(v.children[A]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,G(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||
-/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){n(c,null,0,0,a.width,a.height);v.scrollTop=v.scrollHeight})}b.stopPropagation();b.preventDefault()}var g=[];b=document.createElement("div");b.style.height="100%";var k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.height="40px";b.appendChild(k);mxUtils.write(k,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var q=document.createElement("input");q.setAttribute("value",c);q.style.marginRight="20px";q.style.marginLeft=
-"10px";q.style.width="500px";null==m||m.isRenamable()||q.setAttribute("disabled","true");this.init=function(){if(null==m||m.isRenamable())q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};k.appendChild(q);var v=document.createElement("div");v.style.borderWidth="1px 0px 1px 0px";v.style.borderColor="#d3d3d3";v.style.borderStyle="solid";v.style.marginTop="6px";v.style.overflow="auto";v.style.height="340px";v.style.backgroundPosition=
-"center center";v.style.backgroundRepeat="no-repeat";0==g.length&&Graph.fileSupport&&(v.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var y=document.createElement("div");y.style.position="absolute";y.style.width="640px";y.style.top="260px";y.style.textAlign="center";y.style.fontSize="22px";y.style.color="#a0c3ff";mxUtils.write(y,mxResources.get("dragImagesHere"));b.appendChild(y);var t={},A=null,z=null,D=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&
-null!=D&&(D(),D=null,mxEvent.consume(a))};mxEvent.addListener(v,"mousedown",c);mxEvent.addListener(v,"pointerdown",c);mxEvent.addListener(v,"touchstart",c);var x=new mxUrlConverter,C=!1;if(null!=d)for(c=0;c<d.length;c++)k=d[c],n(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(v,"dragleave",function(a){y.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==v||b==y){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var G=function(b){return function(c,g,k,d,q,f,
-t,l,m){null!=m&&(/(\.vsdx)($|\?)/i.test(m.name)||/(\.vssx)($|\?)/i.test(m.name))?a.importVisio(m,mxUtils.bind(this,function(a){n(a,g,k,d,q,f,t,"fixed",mxEvent.isAltDown(b)?null:t.substring(0,t.lastIndexOf(".")).replace(/_/g," "))})):null!=m&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,m.name)?a.parseFile(m,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(n(c.responseText,g,k,d,q,f,t,"fixed",mxEvent.isAltDown(b)?null:t.substring(0,
-t.lastIndexOf(".")).replace(/_/g," ")),v.scrollTop=v.scrollHeight))})):(n(c,g,k,d,q,f,t,"fixed",mxEvent.isAltDown(b)?null:t.substring(0,t.lastIndexOf(".")).replace(/_/g," ")),v.scrollTop=v.scrollHeight)}};mxEvent.addListener(v,"dragover",p);mxEvent.addListener(v,"drop",u);mxEvent.addListener(y,"dragover",p);mxEvent.addListener(y,"drop",u);b.appendChild(v);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});
-c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&d.appendChild(c);k=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(g),c=q.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});k.setAttribute("id","btnDownload");k.className="geBtn";d.appendChild(k);if(Graph.fileSupport){if(null==
-a.libDlgFileInputElt){var B=document.createElement("input");B.setAttribute("multiple","multiple");B.setAttribute("type","file");mxEvent.addListener(B,"change",function(b){C=!1;a.importFiles(B.files,0,0,a.maxImageSize,function(a,c,g,k,d,q,f,t,l){null!=B.files&&(G(b)(a,c,g,k,d,q,f,t,l),B.type="",B.type="file",B.value="")});v.scrollTop=v.scrollHeight});B.style.display="none";document.body.appendChild(B);a.libDlgFileInputElt=B}k=mxUtils.button(mxResources.get("import"),function(){null!=D&&(D(),D=null);
-a.libDlgFileInputElt.click()});k.setAttribute("id","btnAddImage");k.className="geBtn";d.appendChild(k)}k=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=D&&(D(),D=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){C=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var g=a.indexOf(",");0<g&&(a=a.substring(0,g)+";base64,"+a.substring(g+1))}n(a,null,0,0,b,c);v.scrollTop=v.scrollHeight}})});k.setAttribute("id","btnAddImageUrl");k.className="geBtn";d.appendChild(k);
-this.saveBtnClickHandler=function(b,c,g,k){a.saveLibrary(b,c,g,k)};k=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=D&&(D(),D=null);this.saveBtnClickHandler(q.value,g,m,f)}));k.setAttribute("id","btnSave");k.className="geBtn gePrimaryBtn";d.appendChild(k);a.editor.cancelFirst||d.appendChild(c);b.appendChild(d);this.container=b},EditShapeDialog=function(a,c,b,d,m){d=null!=d?d:300;m=null!=m?m:120;var f,l,n=document.createElement("table"),p=document.createElement("tbody");
-n.style.cellPadding="4px";f=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";mxUtils.write(l,b);f.appendChild(l);p.appendChild(f);f=document.createElement("tr");l=document.createElement("td");var u=document.createElement("textarea");u.style.outline="none";u.style.resize="none";u.style.width=d-200+"px";u.style.height=m+"px";this.textarea=u;this.init=function(){u.focus();u.scrollTop=0};l.appendChild(u);f.appendChild(l);l=document.createElement("td");
-b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.top="6px";b.style.width="200px";b.style.height=m+4+"px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);l.appendChild(b);var g=new Graph(b);g.setEnabled(!1);var k=a.editor.graph.cloneCell(c);g.addCells([k]);b=g.view.getState(k);var q="";null!=b.shape&&null!=b.shape.stencil&&(q=mxUtils.getPrettyXml(b.shape.stencil.desc));mxUtils.write(u,q||"");b=g.getGraphBounds();
-m=Math.min(160/b.width,(m-40)/b.height);g.view.scaleAndTranslate(m,20/m-b.x,20/m-b.y);f.appendChild(l);p.appendChild(f);f=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),m.className="geBtn",l.appendChild(m));m=mxUtils.button(mxResources.get("cancel"),
-function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst&&l.appendChild(m);var v=function(b,c,g){var k=u.value,d=mxUtils.parseXml(k),k=mxUtils.getPrettyXml(d.documentElement),d=d.documentElement.getElementsByTagName("parsererror");if(null!=d&&0<d.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(g&&a.hideDialog(),d=!b.model.contains(c),!g||d||k!=q){k=Graph.compress(k);b.getModel().beginUpdate();try{if(d){var f=a.editor.graph.getFreeInsertPoint();
-c.geometry.x=f.x;c.geometry.y=f.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+k+")",[c])}catch(C){throw C;}finally{b.getModel().endUpdate()}d&&(b.setSelectionCell(c),b.scrollCellToVisible(c))}};b=mxUtils.button(mxResources.get("preview"),function(){v(g,k,!1)});b.className="geBtn";l.appendChild(b);b=mxUtils.button(mxResources.get("apply"),function(){v(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";l.appendChild(b);a.editor.cancelFirst||l.appendChild(m);f.appendChild(l);
-p.appendChild(f);n.appendChild(p);this.container=n},CustomDialog=function(a,c,b,d,m,f,l,n){var p=document.createElement("div");p.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=l&&c.appendChild(l);a.isOffline()||null==f||(l=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)}),l.className="geBtn",c.appendChild(l));l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d()});l.className="geBtn";n&&(l.style.display=
-"none");a.editor.cancelFirst&&c.appendChild(l);m=mxUtils.button(m||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b()});c.appendChild(m);m.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(l);p.appendChild(c);this.cancelBtn=l;this.okButton=m;this.container=p},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",
+d.setAttribute("type","text");d.style.marginTop="6px";d.style.width="600px";var g=mxUtils.button(mxResources.get("sendMessage"),function(){var b=n.value+(k.checked?"\nDiagram:\n"+mxUtils.getXml(a.getXmlFileData()):"")+"\nBrowser:\n"+navigator.userAgent;b.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(d.value)+
+"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+b),function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()?a.alert(mxResources.get("feedbackSent")):a.alert(mxResources.get("errorSendingFeedback"))},function(){a.spinner.stop();a.alert(mxResources.get("errorSendingFeedback"))}))});g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");var e=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
+mxEvent.addListener(d,"change",function(){0<d.value.length&&0<e.test(d.value)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")});mxEvent.addListener(d,"keyup",function(){0<d.value.length&&e.test(d.value)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")});c.appendChild(d);this.init=function(){d.focus()};var k=document.createElement("input");k.setAttribute("type","checkbox");k.setAttribute("checked","checked");k.defaultChecked=!0;b=document.createElement("p");b.style.marginTop=
+"14px";b.appendChild(k);var m=document.createElement("span");mxUtils.write(m," "+mxResources.get("includeCopyOfMyDiagram"));b.appendChild(m);mxEvent.addListener(m,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)});c.appendChild(b);b=document.createElement("div");mxUtils.write(b,mxResources.get("feedback"));c.appendChild(b);var n=document.createElement("textarea");n.style.resize="none";n.style.width="600px";n.style.height="140px";n.style.marginTop="6px";n.setAttribute("placeholder",mxResources.get("comments"));
+c.appendChild(n);b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="right";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst?(b.appendChild(m),b.appendChild(g)):(b.appendChild(g),b.appendChild(m));c.appendChild(b);this.container=c};FeedbackDialog.maxAttachmentSize=1E6;
+var RevisionDialog=function(a,c,b){var d=document.createElement("div"),g=document.createElement("h3");g.style.marginTop="0px";mxUtils.write(g,mxResources.get("revisionHistory"));d.appendChild(g);var e=document.createElement("div");e.style.position="absolute";e.style.overflow="auto";e.style.width="170px";e.style.height="378px";d.appendChild(e);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.left="199px";k.style.width="470px";k.style.height=
+"376px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);d.appendChild(k);var m=new Graph(k);m.setTooltips(!1);m.setEnabled(!1);m.setPanning(!0);m.panningHandler.ignoreCell=!0;m.panningHandler.useLeftButtonForPanning=!0;m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;var n=0,q=null,f=0,l=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=q&&null!=q[f]?q[f].getAttribute("name"):"pagenumber"==a?f+1:"pagecount"==a?null!=q?q.length:1:l.apply(this,arguments)};m.getLinkForCell=
+function(){return null};Editor.MathJaxRender&&m.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(m.container)}));var p=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),v=null,t=null,z=null,y=null,C=mxUtils.button("",function(){null!=z&&m.zoomIn()});C.className="geSprite geSprite-zoomin";
+C.setAttribute("title",mxResources.get("zoomIn"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var x=mxUtils.button("",function(){null!=z&&m.zoomOut()});x.className="geSprite geSprite-zoomout";x.setAttribute("title",mxResources.get("zoomOut"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var B=mxUtils.button("",function(){null!=z&&
+(m.maxFitScale=8,m.fit(8),m.center())});B.className="geSprite geSprite-fit";B.setAttribute("title",mxResources.get("fit"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var E=mxUtils.button("",function(){null!=z&&(m.zoomActual(),m.center())});E.className="geSprite geSprite-actualsize";E.setAttribute("title",mxResources.get("actualSize"));E.style.outline="none";E.style.border="none";E.style.margin="2px";E.setAttribute("disabled",
+"disabled");mxUtils.setOpacity(E,20);var A=document.createElement("div");A.style.position="absolute";A.style.textAlign="right";A.style.color="gray";A.style.marginTop="10px";A.style.backgroundColor="transparent";A.style.top="440px";A.style.right="32px";A.style.maxWidth="380px";A.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var b=mxUtils.getXml(z.documentElement),c=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b=
+"undefined"===typeof pako?"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});F.className="geBtn";F.setAttribute("disabled","disabled");var D=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(y):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop();
+a.replaceFileData(y);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});D.className="geBtn";D.setAttribute("disabled","disabled");var H=document.createElement("select");H.setAttribute("disabled","disabled");H.style.maxWidth="80px";H.style.position="relative";H.style.top="-2px";H.style.verticalAlign="bottom";H.style.marginRight="6px";H.style.display="none";var J=null;mxEvent.addListener(H,"change",function(a){null!=
+J&&(J(a),mxEvent.consume(a))});var I=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});I.className="geBtn";I.setAttribute("disabled","disabled");null!=b&&(I.style.display="none");var G=mxUtils.button(mxResources.get("show"),function(){null!=t&&a.openLink(t.getUrl(H.selectedIndex))});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled",
+"disabled");null!=b&&(G.style.display="none",D.className="geBtn gePrimaryBtn");g=document.createElement("div");g.style.position="absolute";g.style.top="482px";g.style.width="640px";g.style.textAlign="right";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.padding="2px";K.style.border="none";K.style.left="199px";K.style.top="442px";var Q=null;if(null!=c&&0<c.length){k.style.cursor="move";var N=document.createElement("table");N.style.border=
+"1px solid lightGray";N.style.borderCollapse="collapse";N.style.borderSpacing="0px";N.style.width="100%";var Y=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var L=c.length-1;0<=L;L--){var W=function(b){var l=new Date(b.modifiedDate),d=null;if(0<=l.getTime()){var e=function(c){p.stop();var e=mxUtils.parseXml(c),g=a.editor.extractGraphModel(e.documentElement,!0);if(null!=g){var t=function(a){null!=a&&(a=
+v(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));return a},v=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};H.style.display="none";H.innerHTML="";z=e;y=c;q=parseSelectFunction=null;f=0;if("mxfile"==g.nodeName){e=g.getElementsByTagName("diagram");q=[];for(c=0;c<e.length;c++)q.push(e[c]);f=Math.min(n,
+q.length-1);0<q.length&&t(q[f]);if(1<q.length)for(H.removeAttribute("disabled"),H.style.display="",c=0;c<q.length;c++)e=document.createElement("option"),mxUtils.write(e,q[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),H.appendChild(e);J=function(){try{var b=parseInt(H.value);f=n=b;t(q[b])}catch(M){H.value=n,a.handleError(M)}}}else v(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");
+A.innerHTML="";mxUtils.write(A,(null!=c?c+" ":"")+l.toLocaleDateString()+" "+l.toLocaleTimeString());A.setAttribute("title",d.getAttribute("title"));C.removeAttribute("disabled");x.removeAttribute("disabled");B.removeAttribute("disabled");E.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&D.removeAttribute("disabled"),F.removeAttribute("disabled"),G.removeAttribute("disabled"),I.removeAttribute("disabled"));mxUtils.setOpacity(C,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(B,
+60);mxUtils.setOpacity(E,60)}else H.style.display="none",H.innerHTML="",A.innerHTML="",mxUtils.write(A,mxResources.get("errorLoadingFile"))},d=document.createElement("tr");d.style.borderBottom="1px solid lightGray";d.style.fontSize="12px";d.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):l.toDateString()===T?mxUtils.write(g,l.toLocaleTimeString()):mxUtils.write(g,l.toLocaleDateString()+
+" "+l.toLocaleTimeString());d.appendChild(g);d.setAttribute("title",l.toLocaleDateString()+" "+l.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(a){t!=b&&(p.stop(),null!=v&&(v.style.backgroundColor=""),t=b,v=d,v.style.backgroundColor="#ebf2f9",y=z=null,A.removeAttribute("title"),A.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),k.style.backgroundColor=
+"#ffffff",m.getModel().clear(),D.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),mxUtils.setOpacity(C,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(B,20),mxUtils.setOpacity(E,20),p.spin(k),b.getXml(function(a){if(t==
+b)try{e(a)}catch(Z){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+Z.message)}},function(a){p.stop();H.style.display="none";H.innerHTML="";A.innerHTML="";mxUtils.write(A,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(d,"dblclick",function(a){G.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);Y.appendChild(d)}return d}(c[L]);null!=W&&L==c.length-1&&(Q=W)}N.appendChild(Y);
+e.appendChild(N)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(k.style.display="none",K.style.display="none",mxUtils.write(e,mxResources.get("notAvailable"))):(k.style.display="none",K.style.display="none",mxUtils.write(e,mxResources.get("noRevisions")));this.init=function(){null!=Q&&Q.click()};e=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.className="geBtn";K.appendChild(H);K.appendChild(C);K.appendChild(x);
+K.appendChild(E);K.appendChild(B);a.editor.cancelFirst?(g.appendChild(e),g.appendChild(F),g.appendChild(I),g.appendChild(D),g.appendChild(G)):(g.appendChild(F),g.appendChild(I),g.appendChild(D),g.appendChild(G),g.appendChild(e));d.appendChild(g);d.appendChild(K);d.appendChild(A);this.container=d},DraftDialog=function(a,c,b,d,g,e,k,m){var n=document.createElement("div"),q=document.createElement("div");q.style.marginTop="0px";q.style.whiteSpace="nowrap";q.style.overflow="auto";mxUtils.write(q,c);n.appendChild(q);
+var f=document.createElement("div");f.style.position="absolute";f.style.border="1px solid lightGray";f.style.marginTop="10px";f.style.width="640px";f.style.top="46px";f.style.bottom="74px";f.style.overflow="hidden";mxEvent.disableContextMenu(f);n.appendChild(f);var l=new Graph(f);l.setEnabled(!1);l.setPanning(!0);l.panningHandler.ignoreCell=!0;l.panningHandler.useLeftButtonForPanning=!0;l.minFitScale=null;l.maxFitScale=null;l.centerZoom=!0;c=mxUtils.parseXml(b);var p=a.editor.extractGraphModel(c.documentElement,
+!0),u=0,v=null,t=l.getGlobalVariable;l.getGlobalVariable=function(a){return"page"==a&&null!=v&&null!=v[u]?v[u].getAttribute("name"):"pagenumber"==a?u+1:"pagecount"==a?null!=v?v.length:1:t.apply(this,arguments)};l.getLinkForCell=function(){return null};c=mxUtils.button("",function(){l.zoomIn()});c.className="geSprite geSprite-zoomin";c.setAttribute("title",mxResources.get("zoomIn"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);b=mxUtils.button("",function(){l.zoomOut()});
+b.className="geSprite geSprite-zoomout";b.setAttribute("title",mxResources.get("zoomOut"));b.style.outline="none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);q=mxUtils.button("",function(){l.maxFitScale=8;l.fit(8);l.center()});q.className="geSprite geSprite-fit";q.setAttribute("title",mxResources.get("fit"));q.style.outline="none";q.style.border="none";q.style.margin="2px";mxUtils.setOpacity(q,60);var z=mxUtils.button("",function(){l.zoomActual();l.center()});z.className="geSprite geSprite-actualsize";
+z.setAttribute("title",mxResources.get("actualSize"));z.style.outline="none";z.style.border="none";z.style.margin="2px";mxUtils.setOpacity(z,60);g=mxUtils.button(k||mxResources.get("discard"),g);g.className="geBtn";var y=document.createElement("select");y.style.maxWidth="80px";y.style.position="relative";y.style.top="-2px";y.style.verticalAlign="bottom";y.style.marginRight="6px";y.style.display="none";d=mxUtils.button(e||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";e=document.createElement("div");
+e.style.position="absolute";e.style.bottom="30px";e.style.width="640px";e.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function a(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";f.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());
+l.maxFitScale=1;l.fit(8);l.center()}}function b(b){null!=b&&(b=a(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(b))).documentElement));return b}mxEvent.addListener(y,"change",function(a){u=parseInt(y.value);b(v[u]);mxEvent.consume(a)});if("mxfile"==p.nodeName){var c=p.getElementsByTagName("diagram");v=[];for(var d=0;d<c.length;d++)v.push(c[d]);0<v.length&&b(v[u]);if(1<v.length)for(y.style.display="",d=0;d<v.length;d++)c=document.createElement("option"),mxUtils.write(c,v[d].getAttribute("name")||
+mxResources.get("pageWithNumber",[d+1])),c.setAttribute("value",d),d==u&&c.setAttribute("selected","selected"),y.appendChild(c)}else a(p)};k.appendChild(y);k.appendChild(c);k.appendChild(b);k.appendChild(z);k.appendChild(q);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.className="geBtn";m=null!=m?mxUtils.button(mxResources.get("ignore"),m):null;null!=m&&(m.className="geBtn");a.editor.cancelFirst?(e.appendChild(c),null!=m&&e.appendChild(m),e.appendChild(g),e.appendChild(d)):
+(e.appendChild(d),e.appendChild(g),null!=m&&e.appendChild(m),e.appendChild(c));n.appendChild(e);n.appendChild(k);this.container=n},FindWindow=function(a,c,b,d,g){function e(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var f=0;f<b.length;f++)if("label"!=b[f].nodeName){var l=mxUtils.trim(b[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&l.substring(0,c.length)===c||null!=a&&a.test(l))return!0}}return!1}function k(){var a=n.model.getDescendants(n.model.getRoot()),
+b=p.value.toLowerCase(),c=u.checked?new RegExp(b):null,l=null;q!=b&&(q=b,f=null);var d=null==f;if(0<b.length)for(var k=0;k<a.length;k++){var g=n.view.getState(a[k]);if(null!=g&&null!=g.cell.value&&(d||null==l)&&(n.model.isVertex(g.cell)||n.model.isEdge(g.cell))&&(n.isHtmlLabel(g.cell)?(t.innerHTML=n.getLabel(g.cell),label=mxUtils.extractTextWithWhitespace([t])):label=n.getLabel(g.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===
+b||e(c,g.cell,b))||null!=c&&(c.test(label)||e(c,g.cell,b))))if(d){l=g;break}else null==l&&(l=g);d=d||g==f}null!=l?(f=l,n.scrollCellToVisible(f.cell),n.isEnabled()?n.setSelectionCell(f.cell):n.highlightCell(f.cell)):n.isEnabled()&&n.clearSelection();return 0==b.length||null!=l}var m=a.actions.get("find"),n=a.editor.graph,q=null,f=null,l=document.createElement("div");l.style.userSelect="none";l.style.overflow="hidden";l.style.padding="10px";l.style.height="100%";var p=document.createElement("input");
+p.setAttribute("placeholder",mxResources.get("find"));p.setAttribute("type","text");p.style.marginTop="4px";p.style.marginBottom="6px";p.style.width="200px";p.style.fontSize="12px";p.style.borderRadius="4px";p.style.padding="6px";l.appendChild(p);mxUtils.br(l);var u=document.createElement("input");u.setAttribute("type","checkbox");u.style.marginRight="4px";l.appendChild(u);mxUtils.write(l,mxResources.get("regularExpression"));var v=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000088250");
+v.style.position="relative";v.style.marginLeft="6px";v.style.top="-1px";l.appendChild(v);var t=document.createElement("div");mxUtils.br(l);v=mxUtils.button(mxResources.get("reset"),function(){p.value="";p.style.backgroundColor="";q=f=null;p.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.className="geBtn";l.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{p.style.backgroundColor=k()?"":"#ffcfcf"}catch(y){a.handleError(y)}});
+v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";l.appendChild(v);mxEvent.addListener(p,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)m.funct();else if(q!=p.value.toLowerCase()||13==a.keyCode)try{p.style.backgroundColor=k()?"":"#ffcfcf"}catch(C){p.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(l,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&
+(m.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),l,c,b,d,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)):n.container.focus()}));this.window.setLocation=
+function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var z=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,
+"resize",z);this.destroy=function(){mxEvent.removeListener(window,"resize",z);this.window.destroy()}},FreehandWindow=function(a,c,b,d,g){var e=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var k=mxUtils.button(mxResources.get("startDrawing"),function(){e.freehand.isDrawing()&&e.freehand.stopDrawing();e.freehand.startDrawing()});k.setAttribute("title",mxResources.get("startDrawing"));k.style.marginTop="8px";k.style.marginRight=
+"4px";k.style.width="160px";k.style.overflow="hidden";k.style.textOverflow="ellipsis";k.style.textAlign="center";k.className="geBtn gePrimaryBtn";a.appendChild(k);var m=k.cloneNode(!1);mxUtils.write(m,mxResources.get("stopDrawing"));m.setAttribute("title",mxResources.get("stopDrawing"));m.style.marginTop="4px";mxEvent.addListener(m,"click",function(){e.freehand.stopDrawing()});a.appendChild(m);this.window=new mxWindow(mxResources.get("freehand"),a,c,b,d,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
+this.window.setResizable(!1);this.window.setClosable(!0);e.addListener("freehandStateChanged",mxUtils.bind(this,function(){m.className="geBtn"+(e.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){e.freehand.isDrawing()&&e.freehand.stopDrawing()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;
+a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var n=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",n);this.destroy=function(){mxEvent.removeListener(window,"resize",n);this.window.destroy()}},
+TagsWindow=function(a,c,b,d,g){var e=a.editor.graph,k="tags",m=document.createElement("div");m.style.userSelect="none";m.style.overflow="hidden";m.style.padding="10px";m.style.height="100%";var n=document.createElement("input");n.setAttribute("placeholder",mxResources.get("allTags"));n.setAttribute("type","text");n.style.marginTop="4px";n.style.width="260px";n.style.fontSize="12px";n.style.borderRadius="4px";n.style.padding="6px";m.appendChild(n);if(!a.isOffline()||mxClient.IS_CHROMEAPP){n.style.width=
+"240px";var q=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000046966");q.firstChild.style.marginBottom="6px";q.style.marginLeft="6px";m.appendChild(q)}mxEvent.addListener(n,"dblclick",function(){var b=new FilenameDialog(a,k,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(k=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});n.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(m);
+q=mxUtils.button(mxResources.get("hide"),function(){var a=e.getCellsForTags(n.value.split(" "),void 0,k,!0);e.setCellsVisible(a,!1)});q.setAttribute("title",mxResources.get("hide"));q.style.marginTop="8px";q.style.marginRight="4px";q.className="geBtn";m.appendChild(q);q=mxUtils.button(mxResources.get("show"),function(){var a=e.getCellsForTags(n.value.split(" "),void 0,k,!0);e.setCellsVisible(a,!0);if(e.isEnabled()){for(var b=[],c=0;c<a.length;c++)(e.model.isVertex(a[c])||e.model.isEdge(a[c]))&&b.push(a[c]);
+e.setSelectionCells(b)}else for(c=0;c<a.length;c++)e.highlightCell(a[c])});q.setAttribute("title",mxResources.get("show"));q.style.marginTop="8px";q.style.marginRight="4px";q.className="geBtn";m.appendChild(q);var f=a.actions.get("tags"),q=mxUtils.button(mxResources.get("close"),function(){f.funct()});q.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");q.style.marginTop="8px";q.className="geBtn gePrimaryBtn";m.appendChild(q);mxEvent.addListener(n,"keyup",function(a){13!=a.keyCode&&27!=
+a.keyCode||f.funct()});this.window=new mxWindow(mxResources.get("tags"),m,c,b,d,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):e.container.focus()}));this.window.setLocation=function(a,
+b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var l=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,
+"resize",l);this.destroy=function(){mxEvent.removeListener(window,"resize",l);this.window.destroy()}},AuthDialog=function(a,c,b,d){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("authorizationRequired"));var k="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight=
+"10px";c==a.drive?(k=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?(k=mxResources.get("dropbox"),m.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(k=mxResources.get("oneDrive"),m.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(k=mxResources.get("github"),m.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(k=mxResources.get("gitlab"),m.src=IMAGE_PATH+"/gitlab-logo.svg",m.style.width="32px"):c==a.trello&&(k=mxResources.get("trello"),
+m.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[k]));var n=document.createElement("input");n.setAttribute("type","checkbox");k=mxUtils.button(mxResources.get("authorize"),function(){d(n.checked)});k.insertBefore(m,k.firstChild);k.style.marginTop="6px";k.className="geBigButton";k.style.fontSize="18px";k.style.padding="14px";g.appendChild(e);g.appendChild(a);g.appendChild(k);b&&(b=document.createElement("p"),b.style.marginTop=
+"20px",b.appendChild(n),e=document.createElement("span"),mxUtils.write(e," "+mxResources.get("rememberMe")),b.appendChild(e),g.appendChild(b),n.checked=!0,n.defaultChecked=!0,mxEvent.addListener(e,"click",function(a){n.checked=!n.checked;mxEvent.consume(a)}));this.container=g},MoreShapesDialog=function(a,c,b){b=null!=b?b:a.sidebar.entries;var d=document.createElement("div"),g=[];if(null!=a.sidebar.customEntries)for(var e=0;e<a.sidebar.customEntries.length;e++){for(var k=a.sidebar.customEntries[e],
+m={title:a.getResource(k.title),entries:[]},n=0;n<k.entries.length;n++){var q=k.entries[n];m.entries.push({id:q.id,title:a.getResource(q.title),desc:a.getResource(q.desc),image:q.preview})}g.push(m)}for(e=0;e<b.length;e++)if(null==a.sidebar.enabledLibraries)g.push(b[e]);else{m={title:b[e].title,entries:[]};for(n=0;n<b[e].entries.length;n++)0<=mxUtils.indexOf(a.sidebar.enabledLibraries,b[e].entries[n].id)&&m.entries.push(b[e].entries[n]);0<m.entries.length&&g.push(m)}b=g;if(c){n=mxUtils.bind(this,
+function(b){for(var c=0;c<b.length;c++)(function(b){var d=v.cloneNode(!1);d.style.fontWeight="bold";d.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";d.style.padding="6px 0px 6px 20px";mxUtils.write(d,b.title);f.appendChild(d);for(var e=0;e<b.entries.length;e++)(function(b){var d=v.cloneNode(!1);d.style.cursor="pointer";d.style.padding="4px 0px 4px 20px";d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.textOverflow="ellipsis";d.setAttribute("title",b.title+" ("+b.id+")");var k=
+document.createElement("input");k.setAttribute("type","checkbox");k.checked=a.sidebar.isEntryVisible(b.id);k.defaultChecked=k.checked;d.appendChild(k);mxUtils.write(d," "+b.title);f.appendChild(d);var g=function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName){l.style.textAlign="center";l.style.padding="0px";l.style.color="";l.innerHTML="";if(null!=b.desc){var c=document.createElement("pre");c.style.boxSizing="border-box";c.style.fontFamily="inherit";c.style.margin="20px";c.style.right="0px";
+c.style.textAlign="left";mxUtils.write(c,b.desc);l.appendChild(c)}null!=b.imageCallback?b.imageCallback(l):null!=b.image?l.innerHTML+='<img border="0" src="'+b.image+'"/>':null==b.desc&&(l.style.padding="20px",l.style.color="rgb(179, 179, 179)",mxUtils.write(l,mxResources.get("noPreview")));null!=p&&(p.style.backgroundColor="");p=d;p.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(d,"click",g);mxEvent.addListener(d,"dblclick",function(a){k.checked=
+!k.checked;mxEvent.consume(a)});u.push(function(){return k.checked?b.id:null});0==c&&0==e&&g()})(b.entries[e])})(b[c])});e=document.createElement("div");e.className="geDialogTitle";mxUtils.write(e,mxResources.get("shapes"));e.style.position="absolute";e.style.top="0px";e.style.left="0px";e.style.lineHeight="40px";e.style.height="40px";e.style.right="0px";mxClient.IS_QUIRKS&&(e.style.width="718px");var f=document.createElement("div"),l=document.createElement("div");f.style.position="absolute";f.style.top=
+"40px";f.style.left="0px";f.style.width="202px";f.style.bottom="60px";f.style.overflow="auto";mxClient.IS_QUIRKS&&(f.style.height="437px",f.style.marginTop="1px");l.style.position="absolute";l.style.left="202px";l.style.right="0px";l.style.top="40px";l.style.bottom="60px";l.style.overflow="auto";l.style.borderLeft="1px solid rgb(211, 211, 211)";l.style.textAlign="center";mxClient.IS_QUIRKS&&(l.style.width=parseInt(e.style.width)-202+"px",l.style.height=f.style.height,l.style.marginTop=f.style.marginTop);
+var p=null,u=[],v=document.createElement("div");v.style.position="relative";v.style.left="0px";v.style.right="0px";n(b);d.style.padding="30px";d.appendChild(e);d.appendChild(f);d.appendChild(l);b=document.createElement("div");b.className="geDialogFooter";b.style.position="absolute";b.style.paddingRight="16px";b.style.color="gray";b.style.left="0px";b.style.right="0px";b.style.bottom="0px";b.style.height="60px";b.style.lineHeight="52px";mxClient.IS_QUIRKS&&(b.style.width=e.style.width,b.style.paddingTop=
+"12px");var t=document.createElement("input");t.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)e=document.createElement("span"),e.style.paddingRight="20px",e.appendChild(t),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),t.checked=!0,t.defaultChecked=!0,mxEvent.addListener(e,"click",function(a){mxEvent.getSource(a)!=t&&(t.checked=!t.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(e.style.position="relative",e.style.top="-6px"),b.appendChild(e);e=mxUtils.button(mxResources.get("cancel"),
+function(){a.hideDialog()});e.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=[],c=0;c<u.length;c++){var f=u[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(b.join(";"),t.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table"),e=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";n=document.createElement("tr");z.style.width="100%";c=document.createElement("td");var g=document.createElement("td"),
+k=document.createElement("td"),y=mxUtils.bind(this,function(b,c,f){var l=document.createElement("input");l.type="checkbox";z.appendChild(l);l.checked=a.sidebar.isEntryVisible(f);var d=document.createElement("span");mxUtils.write(d,c);c=document.createElement("div");c.style.display="block";c.appendChild(l);c.appendChild(d);mxEvent.addListener(d,"click",function(a){l.checked=!l.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return l.checked?f:null}});n.appendChild(c);n.appendChild(g);
+n.appendChild(k);e.appendChild(n);z.appendChild(e);for(var u=[],C=0,e=0;e<b.length;e++)for(n=0;n<b[e].entries.length;n++)C++;for(var x=[c,g,k],B=0,e=0;e<b.length;e++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];u.push(y(x[Math.floor(B/(C/3))],c.title,c.id));B++}})(b[e]);d.appendChild(z);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";t=document.createElement("input");isLocalStorage&&(t.setAttribute("type","checkbox"),t.checked=!0,t.defaultChecked=
+!0,b.appendChild(t),e=document.createElement("span"),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),b.appendChild(e),mxEvent.addListener(e,"click",function(a){t.checked=!t.checked;mxEvent.consume(a)}));d.appendChild(b);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<u.length;c++){var f=u[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(0<b.length?
+b.join(";"):"",t.checked);a.hideDialog()});n.className="geBtn gePrimaryBtn";b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="right"}a.editor.cancelFirst?(b.appendChild(e),b.appendChild(n)):(b.appendChild(n),b.appendChild(e));d.appendChild(b);this.container=d},PluginsDialog=function(a){function c(){if(0==g.length)d.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{d.innerHTML="";for(var b=0;b<g.length;b++){var l=document.createElement("span");l.style.whiteSpace=
+"nowrap";var p=document.createElement("span");p.className="geSprite geSprite-delete";p.style.position="relative";p.style.cursor="pointer";p.style.top="5px";p.style.marginRight="4px";p.style.display="inline-block";l.appendChild(p);mxUtils.write(l,g[b]);d.appendChild(l);mxUtils.br(d);mxEvent.addListener(p,"click",function(b){return function(){a.confirm(mxResources.get("delete")+' "'+g[b]+'"?',function(){g.splice(b,1);c()})}}(b))}}}var b=document.createElement("div"),d=document.createElement("div");
+d.style.height="120px";d.style.overflow="auto";var g=mxSettings.getPlugins().slice();b.appendChild(d);c();var e=mxUtils.button(mxResources.get("add"),function(){var b="",l=urlParams.p;if(null!=l&&0<l.length){for(var d=l.split(";"),l=0;l<d.length;l++){var e=App.pluginRegistry[d[l]];null!=e&&(b+=e+";")}";"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1))}b=new FilenameDialog(a,b,mxResources.get("add"),function(a){if(null!=a&&0<a.length){d=a.split(";");for(a=0;a<d.length;a++){var b=d[a],f=App.pluginRegistry[b];
+null!=f&&(b=f);0<b.length&&0>mxUtils.indexOf(g,b)&&g.push(b)}c()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");a.showDialog(b.container,300,80,!0,!0);b.init()});e.className="geBtn";var k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";var m=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(g);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});m.className="geBtn gePrimaryBtn";var n=
+document.createElement("div");n.style.marginTop="14px";n.style.textAlign="right";var q=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000056430")});q.className="geBtn";a.isOffline()&&!mxClient.IS_CHROMEAPP&&(q.style.display="none");n.appendChild(q);a.editor.cancelFirst?(n.appendChild(k),n.appendChild(e),n.appendChild(m)):(n.appendChild(e),n.appendChild(m),n.appendChild(k));b.appendChild(n);this.container=b},CropImageDialog=function(a,
+c,b){var d=document.createElement("div"),g=document.createElement("table"),e=document.createElement("tbody"),k=document.createElement("tr"),m=document.createElement("td");m.style.whiteSpace="nowrap";m.setAttribute("colspan","2");mxUtils.write(m,mxResources.get("loading")+"...");k.appendChild(m);e.appendChild(k);var k=document.createElement("tr"),n=document.createElement("td"),q=document.createElement("td");g.style.paddingLeft="6px";mxUtils.write(n,mxResources.get("left")+":");var f=document.createElement("input");
+f.setAttribute("type","text");f.style.width="100px";f.value="0";this.init=function(){f.focus();f.select()};q.appendChild(f);k.appendChild(n);k.appendChild(q);e.appendChild(k);k=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("top")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.width="100px";l.value="0";q.appendChild(l);k.appendChild(n);k.appendChild(q);e.appendChild(k);k=document.createElement("tr");
+n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("right")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value="0";q.appendChild(p);k.appendChild(n);k.appendChild(q);e.appendChild(k);k=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("bottom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";
+u.value="0";q.appendChild(u);k.appendChild(n);k.appendChild(q);e.appendChild(k);k=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("circle")+":");k.appendChild(n);var v=document.createElement("input");v.setAttribute("type","checkbox");q.appendChild(v);k.appendChild(q);e.appendChild(k);g.appendChild(e);d.appendChild(g);g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";var t=new Image,
+z=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var c=document.createElement("canvas"),d=c.getContext("2d"),e=t.width,k=t.height,g=parseInt(f.value),A=parseInt(l.value),e=Math.max(1,e-g-parseInt(p.value)),k=Math.max(1,k-A-parseInt(u.value));c.width=e;c.height=k;v.checked&&(d.fillStyle="#000000",d.arc(e/2,k/2,Math.min(e/2,k/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(t,g,A,e,k,0,0,e,k);b(c.toDataURL())});z.className="geBtn gePrimaryBtn";z.setAttribute("disabled",
+"disabled");t.onload=function(){z.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+": "+t.width+" "+mxResources.get("height")+": "+t.height)};t.src=c;mxEvent.addListener(d,"keypress",function(a){13==a.keyCode&&z.click()});c=document.createElement("div");c.style.marginTop="20px";c.style.textAlign="right";a.editor.cancelFirst?(c.appendChild(g),c.appendChild(z)):(c.appendChild(z),c.appendChild(g));d.appendChild(c);this.container=d},EditGeometryDialog=function(a,c){var b=
+a.editor.graph,d=1==c.length?b.getCellGeometry(c[0]):null,g=document.createElement("div"),e=document.createElement("table"),k=document.createElement("tbody"),m=document.createElement("tr"),n=document.createElement("td"),q=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(n,mxResources.get("relative")+":");var f=document.createElement("input");f.setAttribute("type","checkbox");null!=d&&d.relative&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);this.init=function(){f.focus()};
+q.appendChild(f);m.appendChild(n);m.appendChild(q);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("left")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.width="100px";l.value=null!=d?d.x:"";q.appendChild(l);m.appendChild(n);m.appendChild(q);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("top")+
+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=d?d.y:"";q.appendChild(p);m.appendChild(n);m.appendChild(q);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("dx")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=d&&null!=d.offset?d.offset.x:"";q.appendChild(u);m.appendChild(n);m.appendChild(q);
+k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("dy")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=d&&null!=d.offset?d.offset.y:"";q.appendChild(v);m.appendChild(n);m.appendChild(q);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("width")+":");var t=
+document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=d?d.width:"";q.appendChild(t);m.appendChild(n);m.appendChild(q);k.appendChild(m);m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("height")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.width="100px";z.value=null!=d?d.height:"";q.appendChild(z);m.appendChild(n);m.appendChild(q);k.appendChild(m);
+m=document.createElement("tr");n=document.createElement("td");q=document.createElement("td");mxUtils.write(n,mxResources.get("rotation")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=1==c.length?mxUtils.getValue(b.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";q.appendChild(y);m.appendChild(n);m.appendChild(q);k.appendChild(m);e.appendChild(k);g.appendChild(e);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className=
+"geBtn";var C=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.getModel().beginUpdate();try{for(var d=0;d<c.length;d++){var e=b.getCellGeometry(c[d]);null!=e&&(e=e.clone(),b.isCellMovable(c[d])&&(e.relative=f.checked,0<mxUtils.trim(l.value).length&&(e.x=Number(l.value)),0<mxUtils.trim(p.value).length&&(e.y=Number(p.value)),0<mxUtils.trim(u.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.x=Number(u.value)),0<mxUtils.trim(v.value).length&&(null==e.offset&&(e.offset=
+new mxPoint),e.offset.y=Number(v.value))),b.isCellResizable(c[d])&&(0<mxUtils.trim(t.value).length&&(e.width=Number(t.value)),0<mxUtils.trim(z.value).length&&(e.height=Number(z.value))),b.getModel().setGeometry(c[d],e));0<mxUtils.trim(y.value).length&&b.setCellStyles(mxConstants.STYLE_ROTATION,Number(y.value),[c[d]])}}finally{b.getModel().endUpdate()}});C.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&C.click()});e=document.createElement("div");e.style.marginTop=
+"20px";e.style.textAlign="right";a.editor.cancelFirst?(e.appendChild(d),e.appendChild(C)):(e.appendChild(C),e.appendChild(d));g.appendChild(e);this.container=g},LibraryDialog=function(a,c,b,d,g,e){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=u;)a=a.parentNode;var b=null;if(null!=a)for(var c=u.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function m(b,c,l,d,p,e,g,A,n){try{if(a.spinner.stop(),null==c||"image/"==c.substring(0,6))if(null==b&&null!=
+g||null==t[b]){var F=function(){I.innerHTML="";I.style.cursor="pointer";I.style.whiteSpace="nowrap";I.style.textOverflow="ellipsis";mxUtils.write(I,null!=N.title&&0<N.title.length?N.title:mxResources.get("untitled"));I.style.color=null==N.title||0==N.title.length?"#d0d0d0":""};u.style.backgroundImage="";v.style.display="none";var y=p,q=e;if(p>a.maxImageSize||e>a.maxImageSize){var E=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=E;e*=E}y>q?(q=Math.round(100*q/y),
+y=100):(y=Math.round(100*y/q),q=100);var D=document.createElement("div");D.setAttribute("draggable","true");D.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";D.style.position="relative";D.style.cursor="move";mxUtils.setPrefixedStyle(D.style,"transition","transform .1s ease-in-out");if(null!=b){var G=document.createElement("img");G.setAttribute("src",x.convert(b));G.style.width=y+"px";G.style.height=q+"px";G.style.margin="10px";G.style.paddingBottom=Math.floor((100-q)/2)+"px";G.style.paddingLeft=
+Math.floor((100-y)/2)+"px";D.appendChild(G)}else if(null!=g){var J=a.stringToCells(Graph.decompress(g.xml));0<J.length&&(a.sidebar.createThumb(J,100,100,D,null,!0,!1),D.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",D.firstChild.style.cursor="")}var H=document.createElement("img");H.setAttribute("src",Editor.closeImage);H.setAttribute("border","0");H.setAttribute("title",mxResources.get("delete"));H.setAttribute("align","top");H.style.paddingTop="4px";H.style.position="absolute";
+H.style.marginLeft="-12px";H.style.zIndex="1";H.style.cursor="pointer";mxEvent.addListener(H,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,c){mxEvent.addListener(H,"click",function(l){t[b]=null;for(var d=0;d<f.length;d++)if(null!=f[d].data&&f[d].data==b||null!=f[d].xml&&null!=c&&f[d].xml==c.xml){f.splice(d,1);break}D.parentNode.removeChild(a);0==f.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(l)});mxEvent.addListener(H,"dblclick",
+function(a){mxEvent.consume(a)})})(D,b,g);D.appendChild(H);D.style.marginBottom="30px";var I=document.createElement("div");I.style.position="absolute";I.style.boxSizing="border-box";I.style.bottom="-18px";I.style.left="10px";I.style.right="10px";I.style.backgroundColor="#ffffff";I.style.overflow="hidden";I.style.textAlign="center";var N=null;null!=b?(N={data:b,w:p,h:e,title:n},null!=A&&(N.aspect=A),t[b]=G,f.push(N)):null!=g&&(g.aspect="fixed",f.push(g),N=g);mxEvent.addListener(I,"keydown",function(a){13==
+a.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(a))});F();D.appendChild(I);mxEvent.addListener(I,"mousedown",function(a){"true"!=I.getAttribute("contentEditable")&&mxEvent.consume(a)});J=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,N.title||"",mxResources.get("ok"),function(a){null!=a&&(N.title=a,F())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=
+I.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==N.title||0==N.title.length)I.innerHTML="";I.style.textOverflow="";I.style.whiteSpace="";I.style.cursor="text";I.style.color="";I.setAttribute("contentEditable","true");I.focus();document.execCommand("selectAll",!1,null);C=function(){I.removeAttribute("contentEditable");I.style.cursor="pointer";N.title=I.innerHTML;F()};mxEvent.consume(b)}};mxEvent.addListener(I,"click",J);mxEvent.addListener(D,"dblclick",J);u.appendChild(D);mxEvent.addListener(D,
+"dragstart",function(a){null==b&&null!=g&&(H.style.visibility="hidden",I.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",g.xml);z=k(a);mxClient.IS_GC&&(D.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(D.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(D,30);H.style.visibility="";I.style.visibility=""},0)});mxEvent.addListener(D,"dragend",function(a){"hidden"==H.style.visibility&&(H.style.visibility="",I.style.visibility="");z=
+null;mxUtils.setOpacity(D,100);mxUtils.setPrefixedStyle(D.style,"transform",null)})}else B||(B=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=!1;try{if(y=mxUtils.parseXml(b),"mxlibrary"==y.documentElement.nodeName){q=JSON.parse(mxUtils.getTextContent(y.documentElement));if(null!=q&&0<q.length)for(var K=0;K<q.length;K++)null!=q[K].xml?m(null,null,0,0,0,0,q[K]):m(q[K].data,null,0,0,q[K].w,q[K].h,null,"fixed",q[K].title);p=!0}else if("mxfile"==y.documentElement.nodeName){for(var Q=
+y.documentElement.getElementsByTagName("diagram"),K=0;K<Q.length;K++){var q=mxUtils.getTextContent(Q[K]),J=a.stringToCells(Graph.decompress(q)),X=a.editor.graph.getBoundingBoxFromGeometry(J);m(null,null,0,0,0,0,{xml:q,w:X.width,h:X.height})}p=!0}}catch(ea){}p||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ea){}return null}function n(a){a.dataTransfer.dropEffect=null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function q(b){b.stopPropagation();b.preventDefault();
+B=!1;y=k(b);if(null!=z)null!=y&&y<u.children.length?(f.splice(y>z?y-1:y,0,f.splice(z,1)[0]),u.insertBefore(u.children[z],u.children[y])):(f.push(f.splice(z,1)[0]),u.appendChild(u.children[z]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,E(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||
+/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){m(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}b.stopPropagation();b.preventDefault()}var f=[];b=document.createElement("div");b.style.height="100%";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.height="40px";b.appendChild(l);mxUtils.write(l,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var p=document.createElement("input");p.setAttribute("value",c);p.style.marginRight="20px";p.style.marginLeft=
+"10px";p.style.width="500px";null==g||g.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==g||g.isRenamable())p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};l.appendChild(p);var u=document.createElement("div");u.style.borderWidth="1px 0px 1px 0px";u.style.borderColor="#d3d3d3";u.style.borderStyle="solid";u.style.marginTop="6px";u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition=
+"center center";u.style.backgroundRepeat="no-repeat";0==f.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var v=document.createElement("div");v.style.position="absolute";v.style.width="640px";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));b.appendChild(v);var t={},z=null,y=null,C=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&
+null!=C&&(C(),C=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",c);mxEvent.addListener(u,"pointerdown",c);mxEvent.addListener(u,"touchstart",c);var x=new mxUrlConverter,B=!1;if(null!=d)for(c=0;c<d.length;c++)l=d[c],m(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(u,"dragleave",function(a){v.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==v){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var E=function(b){return function(c,f,l,d,p,e,
+k,g,t){null!=t&&(/(\.vsdx)($|\?)/i.test(t.name)||/(\.vssx)($|\?)/i.test(t.name))?a.importVisio(t,mxUtils.bind(this,function(a){m(a,f,l,d,p,e,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," "))})):null!=t&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,t.name)?a.parseFile(t,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(m(c.responseText,f,l,d,p,e,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,
+k.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(m(c,f,l,d,p,e,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",n);mxEvent.addListener(u,"drop",q);mxEvent.addListener(v,"dragover",n);mxEvent.addListener(v,"drop",q);b.appendChild(u);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});
+c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&d.appendChild(c);l=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(f),c=p.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});l.setAttribute("id","btnDownload");l.className="geBtn";d.appendChild(l);if(Graph.fileSupport){if(null==
+a.libDlgFileInputElt){var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");mxEvent.addListener(A,"change",function(b){B=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,l,d,p,e,k,g){null!=A.files&&(E(b)(a,c,f,l,d,p,e,k,g),A.type="",A.type="file",A.value="")});u.scrollTop=u.scrollHeight});A.style.display="none";document.body.appendChild(A);a.libDlgFileInputElt=A}l=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);
+a.libDlgFileInputElt.click()});l.setAttribute("id","btnAddImage");l.className="geBtn";d.appendChild(l)}l=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=C&&(C(),C=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){B=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}m(a,null,0,0,b,c);u.scrollTop=u.scrollHeight}})});l.setAttribute("id","btnAddImageUrl");l.className="geBtn";d.appendChild(l);
+this.saveBtnClickHandler=function(b,c,f,l){a.saveLibrary(b,c,f,l)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(p.value,f,g,e)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";d.appendChild(l);a.editor.cancelFirst||d.appendChild(c);b.appendChild(d);this.container=b},EditShapeDialog=function(a,c,b,d,g){d=null!=d?d:300;g=null!=g?g:120;var e,k,m=document.createElement("table"),n=document.createElement("tbody");
+m.style.cellPadding="4px";e=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";mxUtils.write(k,b);e.appendChild(k);n.appendChild(e);e=document.createElement("tr");k=document.createElement("td");var q=document.createElement("textarea");q.style.outline="none";q.style.resize="none";q.style.width=d-200+"px";q.style.height=g+"px";this.textarea=q;this.init=function(){q.focus();q.scrollTop=0};k.appendChild(q);e.appendChild(k);k=document.createElement("td");
+b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.top="6px";b.style.width="200px";b.style.height=g+4+"px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);k.appendChild(b);var f=new Graph(b);f.setEnabled(!1);var l=a.editor.graph.cloneCell(c);f.addCells([l]);b=f.view.getState(l);var p="";null!=b.shape&&null!=b.shape.stencil&&(p=mxUtils.getPrettyXml(b.shape.stencil.desc));mxUtils.write(q,p||"");b=f.getGraphBounds();
+g=Math.min(160/b.width,(g-40)/b.height);f.view.scaleAndTranslate(g,20/g-b.x,20/g-b.y);e.appendChild(k);n.appendChild(e);e=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.paddingTop="2px";k.style.whiteSpace="nowrap";k.setAttribute("align","right");a.isOffline()||(g=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),g.className="geBtn",k.appendChild(g));g=mxUtils.button(mxResources.get("cancel"),
+function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&k.appendChild(g);var u=function(b,c,f){var l=q.value,d=mxUtils.parseXml(l),l=mxUtils.getPrettyXml(d.documentElement),d=d.documentElement.getElementsByTagName("parsererror");if(null!=d&&0<d.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(f&&a.hideDialog(),d=!b.model.contains(c),!f||d||l!=p){l=Graph.compress(l);b.getModel().beginUpdate();try{if(d){var e=a.editor.graph.getFreeInsertPoint();
+c.geometry.x=e.x;c.geometry.y=e.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+l+")",[c])}catch(B){throw B;}finally{b.getModel().endUpdate()}d&&(b.setSelectionCell(c),b.scrollCellToVisible(c))}};b=mxUtils.button(mxResources.get("preview"),function(){u(f,l,!1)});b.className="geBtn";k.appendChild(b);b=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";k.appendChild(b);a.editor.cancelFirst||k.appendChild(g);e.appendChild(k);
+n.appendChild(e);m.appendChild(n);this.container=m},CustomDialog=function(a,c,b,d,g,e,k,m){var n=document.createElement("div");n.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=k&&c.appendChild(k);a.isOffline()||null==e||(k=mxUtils.button(mxResources.get("help"),function(){a.openLink(e)}),k.className="geBtn",c.appendChild(k));k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d()});k.className="geBtn";m&&(k.style.display=
+"none");a.editor.cancelFirst&&c.appendChild(k);g=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b()});c.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(k);n.appendChild(c);this.cancelBtn=k;this.okButton=g;this.container=n},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",
null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+
mxResources.get("showAll",null,"+ Show all")+'</div></div></div><div class="geTempDlgDiagramsList"><div class="geTempDlgDiagramsListHeader"><div class="geTempDlgDiagramsListTitle"></div><div class="geTempDlgDiagramsListBtns"><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge" data-id="myDiagramsBtn"><img src="/images/my-diagrams.svg" class="geTempDlgMyDiagramsBtnImg"> <span>'+mxResources.get("myDiagrams",null,"My diagrams")+'</span></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge geTempDlgRadioBtnActive" data-id="allDiagramsBtn"><img src="/images/all-diagrams-sel.svg" class="geTempDlgAllDiagramsBtnImg"> <span>'+
mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">&#x1F6C8; '+
mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",c=document.createElement("div");c.innerHTML=a;c.className="geTemplateDlg";
-var a=window.innerWidth,b=window.innerHeight,d=987,m=712;.9*a<d&&(d=Math.max(.9*a,600),c.style.width=d+"px");.9*b<m&&(m=Math.max(.9*b,300),c.style.height=m+"px");this.width=d;this.height=m;this.container=c};
-TemplatesDialog.prototype.init=function(a,c,b,d,m,f,l,n,p,u){function g(){null!=E&&(E.style.fontWeight="normal",E.style.textDecoration="none",E=null)}function k(a,b,c,g,k,d,q){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";G.querySelector(".geTempDlgRadioBtn[data-id="+g+"]").className="geTempDlgRadioBtn "+(q?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");G.querySelector("."+b).src="/images/"+c+"-sel.svg";G.querySelector("."+k).src="/images/"+
-d+".svg";return!0}function q(a){function b(a){ba.removeChild(g);G.removeChild(c);ba.scrollTop=d}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";G.appendChild(c);var g=document.createElement("div");g.className="geTempDlgDiagramPreviewBox";var k=document.createElement("img");k.src=a;g.appendChild(k);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
-a.setAttribute("title",mxResources.get("close"));g.appendChild(a);var d=ba.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);ba.appendChild(g);ba.scrollTop=0;g.style.lineHeight=g.clientHeight+"px"}function v(a,b,c){if(null!=I){for(var g=I.className.split(" "),k=0;k<g.length;k++)if(-1<g[k].indexOf("Active")){g.splice(k,1);break}I.className=g.join(" ")}null!=a?(I=a,I.className+=" "+b,K=c,W.className="geTempDlgCreateBtn"):(K=I=null,W.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
-function y(b){if(null!=K){var g=K;K=null;W.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";g.isExternal?(1==b?u(g.url,g,"nameInput.value"):p(g.url,g,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+g.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function t(a){a=a?"":"none";for(var b=G.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display=
-a}function A(a,b,c){function g(){W.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));t(!b)}U.innerHTML="";v();N=a;var k=null;if(c){k=document.createElement("table");k.className="geTempDlgDiagramsListGrid";var d=document.createElement("tr"),f=document.createElement("th");f.style.width="50%";f.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));d.appendChild(f);f=document.createElement("th");f.style.width="25%";f.innerHTML=
-mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));d.appendChild(f);f=document.createElement("th");f.style.width="25%";f.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));d.appendChild(f);k.appendChild(d);U.appendChild(k)}for(d=0;d<a.length;d++){a[d].isExternal=!b;var l=a[d].url,f=mxUtils.htmlEntities(a[d].title),m=a[d].tooltip||a[d].title,B=a[d].imgUrl,x=mxUtils.htmlEntities(a[d].changedBy||""),C=mxUtils.htmlEntities(a[d].lastModifiedOn||
-"");B||(B=TEMPLATE_PATH+"/"+l.substring(0,l.length-4)+".png");l=c?50:15;null!=f&&f.length>l&&(f=f.substring(0,l)+"&hellip;");if(c){var p=document.createElement("tr"),B=document.createElement("td"),n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramListPreviewBtn";n.setAttribute("title",mxResources.get("preview"));B.appendChild(n);m=document.createElement("span");m.className="geTempDlgDiagramTitle";m.innerHTML=f;B.appendChild(m);p.appendChild(B);B=document.createElement("td");
-B.innerHTML=x;p.appendChild(B);B=document.createElement("td");B.innerHTML=C;p.appendChild(B);k.appendChild(p);null==I&&(g(),v(p,"geTempDlgDiagramsListGridActive",a[d]));(function(a,b){mxEvent.addListener(p,"click",function(){I!=b&&(g(),v(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(p,"dblclick",y);mxEvent.addListener(n,"click",function(){q(a)})})(a[d],p)}else{var F=document.createElement("div");F.className="geTempDlgDiagramTile";F.setAttribute("title",m);null==I&&(g(),v(F,"geTempDlgDiagramTileActive",
-a[d]));x=document.createElement("div");x.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var A=document.createElement("img");A.style.display="none";(function(a,b){A.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};A.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(A,x);A.src=B;x.appendChild(A);F.appendChild(x);x=document.createElement("div");x.className="geTempDlgDiagramTileLbl";x.innerHTML=null!=f?f:"";F.appendChild(x);
-n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramPreviewBtn";n.setAttribute("title",mxResources.get("preview"));F.appendChild(n);(function(a,b){mxEvent.addListener(F,"click",function(){I!=b&&(g(),v(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(F,"dblclick",y);mxEvent.addListener(n,"click",function(){q(a)})})(a[d],F);U.appendChild(F)}}}function z(a,b){da.innerHTML="";v();for(var c=!b&&5<a.length?5:a.length,g=0;g<c;g++){var k=a[g];k.isCategory=
-!0;var d=document.createElement("div"),q=mxResources.get(k.title);null==q&&(q=k.title.substring(0,1).toUpperCase()+k.title.substring(1));d.className="geTempDlgNewDiagramCatItem";d.setAttribute("title",q);q=mxUtils.htmlEntities(q);15<q.length&&(q=q.substring(0,15)+"&hellip;");null==I&&(W.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),t(),v(d,"geTempDlgNewDiagramCatItemActive",k));var f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemImg";var l=document.createElement("img");
-l.src=NEW_DIAGRAM_CATS_PATH+"/"+k.img;f.appendChild(l);d.appendChild(f);f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemLbl";f.innerHTML=q;d.appendChild(f);da.appendChild(d);(function(a,b){mxEvent.addListener(d,"click",function(){I!=b&&(W.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),t(),v(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(d,"dblclick",y)})(k,d)}aa.style.display=5>a.length?"none":""}function D(a){var b=G.querySelector(".geTemplatesList"),
-c;for(c in a){var g=document.createElement("div"),k=mxResources.get(c),d=a[c];null==k&&(k=c.substring(0,1).toUpperCase()+c.substring(1));g.className="geTemplateCatLink";g.setAttribute("title",k+" ("+d.length+")");k=mxUtils.htmlEntities(k);15<k.length&&(k=k.substring(0,15)+"&hellip;");g.innerHTML=k+" ("+d.length+")";b.appendChild(g);(function(b,c,k){mxEvent.addListener(g,"click",function(){E!=k&&(null!=E?(E.style.fontWeight="normal",E.style.textDecoration="none"):(ha.style.display="none",ia.style.minHeight=
-"100%"),E=k,E.style.fontWeight="bold",E.style.textDecoration="underline",ba.scrollTop=0,B&&(F=!0),M.innerHTML=c,X.style.display="none",A(a[b],!0))})})(c,k,g)}}function x(a){l&&(ba.scrollTop=0,U.innerHTML="",ca.spin(U),F=!1,B=!0,M.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),S=null,l(O,a?null:f))}function C(a){g();ba.scrollTop=0;U.innerHTML="";ca.spin(U);F=!1;B=!0;ea=null;M.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+
-' "'+mxUtils.htmlEntities(a)+'"';n(a,O,H?null:f);S=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";m=null!=m?m:NEW_DIAGRAM_CATS_PATH+"/index.xml";var G=this.container,B=!1,F=!1,E=null,I=null,K=null,J=!1,H=!0,L=!1,N=[],S,aa=G.querySelector(".geTempDlgShowAllBtn"),U=G.querySelector(".geTempDlgDiagramsTiles"),M=G.querySelector(".geTempDlgDiagramsListTitle"),X=G.querySelector(".geTempDlgDiagramsListBtns"),ba=G.querySelector(".geTempDlgContent"),ia=G.querySelector(".geTempDlgDiagramsList"),ha=G.querySelector(".geTempDlgNewDiagramCat"),
-da=G.querySelector(".geTempDlgNewDiagramCatList"),W=G.querySelector(".geTempDlgCreateBtn"),ca=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(G.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){g();ha.style.display="";ia.style.minHeight="calc(100% - 280px)";x(H)});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){k(this,"geTempDlgAllDiagramsBtnImg",
-"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(H=!0,null==S?x(H):C(S))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){k(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(H=!1,null==S?x(H):C(S))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){k(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
-"tiles",!1)&&(L=!0,A(N,!1,L))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){k(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(L=!1,A(N,!1,L))});mxEvent.addListener(aa,"click",function(){J?(ha.style.height="280px",da.style.height="190px",aa.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),z(fa)):(ha.style.height="440px",da.style.height="355px",aa.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
-null,"- Show less")),z(fa,!0));J=!J});var R=!1,Z=!1,Y={},fa=[],Q=1;mxUtils.get(d,function(a){if(!R){R=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=Y[b];null==c&&(Q++,c=[],Y[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=
-a.nextSibling}D(Y)}});mxUtils.get(m,function(a){if(!Z){Z=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&fa.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;z(fa)}});var O=function(a,b){X.style.display="";ca.stop();B=!1;F?F=!1:b?U.innerHTML=b:0==a.length?U.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
-A(a,!1,L)};x(H);var ea=null;n&&mxEvent.addListener(G.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var b=this;null!=ea&&clearTimeout(ea);13==a.keyCode?C(b.value):ea=setTimeout(function(){C(b.value)},500)});mxEvent.addListener(W,"click",y);mxEvent.addListener(G.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){y(!0)});mxEvent.addListener(G.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})};
-var BtnDialog=function(a,c,b,d){var m=document.createElement("div");m.style.textAlign="center";var f=document.createElement("p");f.style.fontSize="16pt";f.style.padding="0px";f.style.margin="0px";f.style.color="gray";mxUtils.write(f,mxResources.get("done"));var l="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight="10px";c==a.drive?(l=mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?
-(l=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(l=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(l=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(l=mxResources.get("gitlab"),n.src=IMAGE_PATH+"/gitlab-logo.svg"):c==a.trello&&(l=mxResources.get("trello"),n.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[l],"You are now authorized in {1}"));
-b=mxUtils.button(b,d);b.insertBefore(n,b.firstChild);b.style.marginTop="6px";b.className="geBigButton";b.style.fontSize="18px";b.style.padding="14px";m.appendChild(f);m.appendChild(a);m.appendChild(b);this.container=m};(function(){Editor.prototype.appName="draw.io";Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];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":
+var a=window.innerWidth,b=window.innerHeight,d=987,g=712;.9*a<d&&(d=Math.max(.9*a,600),c.style.width=d+"px");.9*b<g&&(g=Math.max(.9*b,300),c.style.height=g+"px");this.width=d;this.height=g;this.container=c};
+TemplatesDialog.prototype.init=function(a,c,b,d,g,e,k,m,n,q){function f(){null!=D&&(D.style.fontWeight="normal",D.style.textDecoration="none",D=null)}function l(a,b,c,f,l,d,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";E.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");E.querySelector("."+b).src="/images/"+c+"-sel.svg";E.querySelector("."+l).src="/images/"+
+d+".svg";return!0}function p(a){function b(a){aa.removeChild(f);E.removeChild(c);aa.scrollTop=d}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";E.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var l=document.createElement("img");l.src=a;f.appendChild(l);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
+a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var d=aa.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);aa.appendChild(f);aa.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function u(a,b,c){if(null!=H){for(var f=H.className.split(" "),l=0;l<f.length;l++)if(-1<f[l].indexOf("Active")){f.splice(l,1);break}H.className=f.join(" ")}null!=a?(H=a,H.className+=" "+b,J=c,V.className="geTempDlgCreateBtn"):(J=H=null,V.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
+function v(b){if(null!=J){var f=J;J=null;V.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";f.isExternal?(1==b?q(f.url,f,"nameInput.value"):n(f.url,f,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+f.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function t(a){a=a?"":"none";for(var b=E.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display=
+a}function z(a,b,c){function f(){V.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));t(!b)}T.innerHTML="";u();Q=a;var l=null;if(c){l=document.createElement("table");l.className="geTempDlgDiagramsListGrid";var d=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));d.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=
+mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));d.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));d.appendChild(e);l.appendChild(d);T.appendChild(l)}for(d=0;d<a.length;d++){a[d].isExternal=!b;var k=a[d].url,e=mxUtils.htmlEntities(a[d].title),g=a[d].tooltip||a[d].title,A=a[d].imgUrl,x=mxUtils.htmlEntities(a[d].changedBy||""),B=mxUtils.htmlEntities(a[d].lastModifiedOn||
+"");A||(A=TEMPLATE_PATH+"/"+k.substring(0,k.length-4)+".png");k=c?50:15;null!=e&&e.length>k&&(e=e.substring(0,k)+"&hellip;");if(c){var n=document.createElement("tr"),A=document.createElement("td"),m=document.createElement("img");m.src="/images/icon-search.svg";m.className="geTempDlgDiagramListPreviewBtn";m.setAttribute("title",mxResources.get("preview"));A.appendChild(m);g=document.createElement("span");g.className="geTempDlgDiagramTitle";g.innerHTML=e;A.appendChild(g);n.appendChild(A);A=document.createElement("td");
+A.innerHTML=x;n.appendChild(A);A=document.createElement("td");A.innerHTML=B;n.appendChild(A);l.appendChild(n);null==H&&(f(),u(n,"geTempDlgDiagramsListGridActive",a[d]));(function(a,b){mxEvent.addListener(n,"click",function(){H!=b&&(f(),u(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(n,"dblclick",v);mxEvent.addListener(m,"click",function(){p(a)})})(a[d],n)}else{var F=document.createElement("div");F.className="geTempDlgDiagramTile";F.setAttribute("title",g);null==H&&(f(),u(F,"geTempDlgDiagramTileActive",
+a[d]));x=document.createElement("div");x.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var z=document.createElement("img");z.style.display="none";(function(a,b){z.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};z.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(z,x);z.src=A;x.appendChild(z);F.appendChild(x);x=document.createElement("div");x.className="geTempDlgDiagramTileLbl";x.innerHTML=null!=e?e:"";F.appendChild(x);
+m=document.createElement("img");m.src="/images/icon-search.svg";m.className="geTempDlgDiagramPreviewBtn";m.setAttribute("title",mxResources.get("preview"));F.appendChild(m);(function(a,b){mxEvent.addListener(F,"click",function(){H!=b&&(f(),u(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(F,"dblclick",v);mxEvent.addListener(m,"click",function(){p(a)})})(a[d],F);T.appendChild(F)}}}function y(a,b){ca.innerHTML="";u();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var l=a[f];l.isCategory=
+!0;var d=document.createElement("div"),p=mxResources.get(l.title);null==p&&(p=l.title.substring(0,1).toUpperCase()+l.title.substring(1));d.className="geTempDlgNewDiagramCatItem";d.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"&hellip;");null==H&&(V.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),t(),u(d,"geTempDlgNewDiagramCatItemActive",l));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var k=document.createElement("img");
+k.src=NEW_DIAGRAM_CATS_PATH+"/"+l.img;e.appendChild(k);d.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;d.appendChild(e);ca.appendChild(d);(function(a,b){mxEvent.addListener(d,"click",function(){H!=b&&(V.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),t(),u(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(d,"dblclick",v)})(l,d)}Y.style.display=5>a.length?"none":""}function C(a){var b=E.querySelector(".geTemplatesList"),
+c;for(c in a){var f=document.createElement("div"),l=mxResources.get(c),d=a[c];null==l&&(l=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";f.setAttribute("title",l+" ("+d.length+")");l=mxUtils.htmlEntities(l);15<l.length&&(l=l.substring(0,15)+"&hellip;");f.innerHTML=l+" ("+d.length+")";b.appendChild(f);(function(b,c,l){mxEvent.addListener(f,"click",function(){D!=l&&(null!=D?(D.style.fontWeight="normal",D.style.textDecoration="none"):(ga.style.display="none",ha.style.minHeight=
+"100%"),D=l,D.style.fontWeight="bold",D.style.textDecoration="underline",aa.scrollTop=0,A&&(F=!0),L.innerHTML=c,W.style.display="none",z(a[b],!0))})})(c,l,f)}}function x(a){k&&(aa.scrollTop=0,T.innerHTML="",ba.spin(T),F=!1,A=!0,L.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),N=null,k(M,a?null:e))}function B(a){f();aa.scrollTop=0;T.innerHTML="";ba.spin(T);F=!1;A=!0;da=null;L.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+
+' "'+mxUtils.htmlEntities(a)+'"';m(a,M,G?null:e);N=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";g=null!=g?g:NEW_DIAGRAM_CATS_PATH+"/index.xml";var E=this.container,A=!1,F=!1,D=null,H=null,J=null,I=!1,G=!0,K=!1,Q=[],N,Y=E.querySelector(".geTempDlgShowAllBtn"),T=E.querySelector(".geTempDlgDiagramsTiles"),L=E.querySelector(".geTempDlgDiagramsListTitle"),W=E.querySelector(".geTempDlgDiagramsListBtns"),aa=E.querySelector(".geTempDlgContent"),ha=E.querySelector(".geTempDlgDiagramsList"),ga=E.querySelector(".geTempDlgNewDiagramCat"),
+ca=E.querySelector(".geTempDlgNewDiagramCatList"),V=E.querySelector(".geTempDlgCreateBtn"),ba=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(E.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){f();ga.style.display="";ha.style.minHeight="calc(100% - 280px)";x(G)});mxEvent.addListener(E.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){l(this,"geTempDlgAllDiagramsBtnImg",
+"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(G=!0,null==N?x(G):B(N))});mxEvent.addListener(E.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){l(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(G=!1,null==N?x(G):B(N))});mxEvent.addListener(E.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){l(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
+"tiles",!1)&&(K=!0,z(Q,!1,K))});mxEvent.addListener(E.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){l(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,z(Q,!1,K))});mxEvent.addListener(Y,"click",function(){I?(ga.style.height="280px",ca.style.height="190px",Y.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),y(ea)):(ga.style.height="440px",ca.style.height="355px",Y.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
+null,"- Show less")),y(ea,!0));I=!I});var R=!1,Z=!1,X={},ea=[],P=1;mxUtils.get(d,function(a){if(!R){R=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=X[b];null==c&&(P++,c=[],X[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=
+a.nextSibling}C(X)}});mxUtils.get(g,function(a){if(!Z){Z=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ea.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;y(ea)}});var M=function(a,b){W.style.display="";ba.stop();A=!1;F?F=!1:b?T.innerHTML=b:0==a.length?T.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
+z(a,!1,K)};x(G);var da=null;m&&mxEvent.addListener(E.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var b=this;null!=da&&clearTimeout(da);13==a.keyCode?B(b.value):da=setTimeout(function(){B(b.value)},500)});mxEvent.addListener(V,"click",v);mxEvent.addListener(E.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){v(!0)});mxEvent.addListener(E.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})};
+var BtnDialog=function(a,c,b,d){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("done"));var k="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight="10px";c==a.drive?(k=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?
+(k=mxResources.get("dropbox"),m.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(k=mxResources.get("oneDrive"),m.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(k=mxResources.get("github"),m.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(k=mxResources.get("gitlab"),m.src=IMAGE_PATH+"/gitlab-logo.svg"):c==a.trello&&(k=mxResources.get("trello"),m.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[k],"You are now authorized in {1}"));
+b=mxUtils.button(b,d);b.insertBefore(m,b.firstChild);b.style.marginTop="6px";b.className="geBigButton";b.style.fontSize="18px";b.style.padding="14px";g.appendChild(e);g.appendChild(a);g.appendChild(b);this.container=g};
+function AspectDialog(a,c,b,d,g){this.aspect={pageId:c||a.pages[0].getId(),layerIds:b||[]};c=document.createElement("div");var e=document.createElement("h5");e.style.margin="0 0 10px";mxUtils.write(e,mxResources.get("pages"));c.appendChild(e);b=document.createElement("div");b.className="geAspectDlgList";c.appendChild(b);e=document.createElement("h5");e.style.margin="0 0 10px";mxUtils.write(e,mxResources.get("layers"));c.appendChild(e);e=document.createElement("div");e.className="geAspectDlgList";
+c.appendChild(e);this.pagesContainer=b;this.layersContainer=e;this.ui=a;b=document.createElement("div");b.style.marginTop="16px";b.style.textAlign="center";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=g&&g()});e.className="geBtn";a.editor.cancelFirst&&b.appendChild(e);var k=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){a.hideDialog();d({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));b.appendChild(k);k.className="geBtn gePrimaryBtn";
+a.editor.cancelFirst||b.appendChild(e);k.setAttribute("disabled","disabled");this.okBtn=k;c.appendChild(b);this.container=c}AspectDialog.prototype.init=function(){for(var a=0;a<this.ui.pages.length;a++){var c=this.ui.updatePageRoot(this.ui.pages[a]);this.createPageItem(c.getId(),c.getName(),c.node,c.root)}};
+AspectDialog.prototype.createViewer=function(a,c,b){mxEvent.disableContextMenu(a);a.style.userSelect="none";var d=new Graph(a);d.setTooltips(!1);d.setEnabled(!1);d.setPanning(!1);d.minFitScale=null;d.maxFitScale=null;d.centerZoom=!0;c=c.firstElementChild;if(null!=c){var g=c.getAttribute("background");if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";a.style.backgroundColor=g;g=new mxCodec(c.ownerDocument);a=d.getModel();g.decode(c,a);c=a.getChildCount(a.root);for(var g=null==b,e=0;e<c;e++){var k=
+a.getChildAt(a.root,e);a.setVisible(k,g||b==k.id)}d.maxFitScale=1;d.fit(0);d.center()}return d};
+AspectDialog.prototype.createPageItem=function(a,c,b,d){var g=document.createElement("div");g.className="geAspectDlgListItem";g.setAttribute("data-page-id",a);g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+c+"</div>";this.pagesContainer.appendChild(g);var e=this.createViewer(g.childNodes[0],b);c=mxUtils.bind(this,function(){null!=this.selectedItem&&(this.selectedItem.className="geAspectDlgListItem");this.selectedItem=g;this.selectedPage=a;
+g.className+=" geAspectDlgListItemSelected";this.layersContainer.innerHTML="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");for(var c=e.model,c=c.getChildCells(c.getRoot()),d=0;d<c.length;d++)this.createLayerItem(c[d],a,e,b)});mxEvent.addListener(g,"click",c);this.aspect.pageId==a&&c()};
+AspectDialog.prototype.createLayerItem=function(a,c,b,d){c=b.convertValueToString(a)||mxResources.get("background")||"Background";var g=document.createElement("div");g.setAttribute("data-layer-id",a.id);g.className="geAspectDlgListItem";g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+c+"</div>";this.layersContainer.appendChild(g);this.createViewer(g.childNodes[0],d,a.id);d=mxUtils.bind(this,function(){0<=g.className.indexOf("geAspectDlgListItemSelected")?
+(g.className="geAspectDlgListItem",delete this.selectedLayers[a.id],0==Object.keys(this.selectedLayers).length&&this.okBtn.setAttribute("disabled","disabled")):(g.className+=" geAspectDlgListItemSelected",this.selectedLayers[a.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(g,"click",d);-1!=this.aspect.layerIds.indexOf(a.id)&&d()};(function(){Editor.prototype.appName="draw.io";Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];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==":
IMAGE_PATH+"/spin.gif";Editor.globeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTEuOTkgMkM2LjQ3IDIgMiA2LjQ4IDIgMTJzNC40NyAxMCA5Ljk5IDEwQzE3LjUyIDIyIDIyIDE3LjUyIDIyIDEyUzE3LjUyIDIgMTEuOTkgMnptNi45MyA2aC0yLjk1Yy0uMzItMS4yNS0uNzgtMi40NS0xLjM4LTMuNTYgMS44NC42MyAzLjM3IDEuOTEgNC4zMyAzLjU2ek0xMiA0LjA0Yy44MyAxLjIgMS40OCAyLjUzIDEuOTEgMy45NmgtMy44MmMuNDMtMS40MyAxLjA4LTIuNzYgMS45MS0zLjk2ek00LjI2IDE0QzQuMSAxMy4zNiA0IDEyLjY5IDQgMTJzLjEtMS4zNi4yNi0yaDMuMzhjLS4wOC42Ni0uMTQgMS4zMi0uMTQgMiAwIC42OC4wNiAxLjM0LjE0IDJINC4yNnptLjgyIDJoMi45NWMuMzIgMS4yNS43OCAyLjQ1IDEuMzggMy41Ni0xLjg0LS42My0zLjM3LTEuOS00LjMzLTMuNTZ6bTIuOTUtOEg1LjA4Yy45Ni0xLjY2IDIuNDktMi45MyA0LjMzLTMuNTZDOC44MSA1LjU1IDguMzUgNi43NSA4LjAzIDh6TTEyIDE5Ljk2Yy0uODMtMS4yLTEuNDgtMi41My0xLjkxLTMuOTZoMy44MmMtLjQzIDEuNDMtMS4wOCAyLjc2LTEuOTEgMy45NnpNMTQuMzQgMTRIOS42NmMtLjA5LS42Ni0uMTYtMS4zMi0uMTYtMiAwLS42OC4wNy0xLjM1LjE2LTJoNC42OGMuMDkuNjUuMTYgMS4zMi4xNiAyIDAgLjY4LS4wNyAxLjM0LS4xNiAyem0uMjUgNS41NmMuNi0xLjExIDEuMDYtMi4zMSAxLjM4LTMuNTZoMi45NWMtLjk2IDEuNjUtMi40OSAyLjkzLTQuMzMgMy41NnpNMTYuMzYgMTRjLjA4LS42Ni4xNC0xLjMyLjE0LTIgMC0uNjgtLjA2LTEuMzQtLjE0LTJoMy4zOGMuMTYuNjQuMjYgMS4zMS4yNiAycy0uMSAxLjM2LS4yNiAyaC0zLjM4eiIvPjwvc3ZnPg==";
@@ -8152,51 +8161,51 @@ defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},{val:"rectangle
dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter",dispName:"Step"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1.5,isVisible:function(a){return"1"==mxUtils.getValue(a.style,"comic","0")}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"collapsible",dispName:"Collapsible",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",defVal:!1},{name:"recursiveResize",
dispName:"Resize Children",type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",
dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",type:"bool",defVal:!1}];Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## The label is concatenated in the form fromlabel + label + tolabel if all are defined.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle or a JSON string as used in Layout, Apply.\n## Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nEvan Miller,CFO,emi,Office 1,,me@example.com,#dae8fc,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nRon Donovan,System Admin,rdo,Office 3,Evan Miller,me@example.com,#d5e8d4,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nTessa Valet,HR Director,tva,Office 4,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\n';
-Editor.fastCompress=function(a){return null==a||0==a.length||"undefined"===typeof pako?a:pako.deflateRaw(a,{to:"string"})};Editor.fastDecompress=function(a){return null==a||0==a.length||"undefined"===typeof pako?a:pako.inflateRaw(a,{to:"string"})};Editor.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==typeof pako){var c=a.ownerDocument.getElementsByTagName("div"),g=[];if(null!=c&&0<c.length)for(var k=0;k<c.length;k++)if("mxgraph"==c[k].getAttribute("class")){g.push(c[k]);break}0<g.length&&
-(c=g[0].getAttribute("data-mxgraph"),null!=c?(g=JSON.parse(c),null!=g&&null!=g.xml&&(g=mxUtils.parseXml(g.xml),a=g.documentElement)):(g=g[0].getElementsByTagName("div"),0<g.length&&(c=mxUtils.getTextContent(g[0]),c=Graph.decompress(c),0<c.length&&(g=mxUtils.parseXml(c),a=g.documentElement))))}if(null!=a&&"svg"==a.nodeName)if(c=a.getAttribute("content"),null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),
-null!=c&&0<c.length)a=mxUtils.parseXml(c).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||b||(g=null,"diagram"==a.nodeName?g=a:"mxfile"==a.nodeName&&(c=a.getElementsByTagName("diagram"),0<c.length&&(g=c[Math.max(0,Math.min(c.length-1,urlParams.page||0))])),null!=g&&(a=Editor.parseDiagramNode(g)));null==a||"mxGraphModel"==a.nodeName||b&&"mxfile"==a.nodeName||(a=null);return a};Editor.parseDiagramNode=function(a){var b=mxUtils.trim(mxUtils.getTextContent(a)),c=null;0<
+Editor.fastCompress=function(a){return null==a||0==a.length||"undefined"===typeof pako?a:pako.deflateRaw(a,{to:"string"})};Editor.fastDecompress=function(a){return null==a||0==a.length||"undefined"===typeof pako?a:pako.inflateRaw(a,{to:"string"})};Editor.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==typeof pako){var c=a.ownerDocument.getElementsByTagName("div"),f=[];if(null!=c&&0<c.length)for(var l=0;l<c.length;l++)if("mxgraph"==c[l].getAttribute("class")){f.push(c[l]);break}0<f.length&&
+(c=f[0].getAttribute("data-mxgraph"),null!=c?(f=JSON.parse(c),null!=f&&null!=f.xml&&(f=mxUtils.parseXml(f.xml),a=f.documentElement)):(f=f[0].getElementsByTagName("div"),0<f.length&&(c=mxUtils.getTextContent(f[0]),c=Graph.decompress(c),0<c.length&&(f=mxUtils.parseXml(c),a=f.documentElement))))}if(null!=a&&"svg"==a.nodeName)if(c=a.getAttribute("content"),null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),
+null!=c&&0<c.length)a=mxUtils.parseXml(c).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||b||(f=null,"diagram"==a.nodeName?f=a:"mxfile"==a.nodeName&&(c=a.getElementsByTagName("diagram"),0<c.length&&(f=c[Math.max(0,Math.min(c.length-1,urlParams.page||0))])),null!=f&&(a=Editor.parseDiagramNode(f)));null==a||"mxGraphModel"==a.nodeName||b&&"mxfile"==a.nodeName||(a=null);return a};Editor.parseDiagramNode=function(a){var b=mxUtils.trim(mxUtils.getTextContent(a)),c=null;0<
b.length?(a=Graph.decompress(b),null!=a&&0<a.length&&(c=mxUtils.parseXml(a).documentElement)):(a=mxUtils.getChildNodes(a),0<a.length&&(c=mxUtils.createXmlDocument(),c.appendChild(c.importNode(a[0],!0)),c=c.documentElement));return c};Editor.getDiagramNodeXml=function(a){var b=mxUtils.getTextContent(a),c=null;0<b.length?c=Graph.decompress(b):null!=a.firstChild&&(c=mxUtils.getXml(a.firstChild));return c};Editor.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),
-g=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(g,mxUtils.bind(this,function(a,c,k){a=g.substring(a+8,a+8+k);"zTXt"==c?(k=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,k)&&(a=pako.inflateRaw(a.substring(k+2),{to:"string"}).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&("mxGraphModel"==a[0]||"mxfile"==a[0])&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(K){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));
-null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};Editor.extractParserError=function(a,b){var c=null,g=null!=a?a.getElementsByTagName("parsererror"):null;null!=g&&0<g.length&&(c=b||mxResources.get("invalidChars"),g=g[0].getElementsByTagName("div"),0<g.length&&(c=mxUtils.getTextContent(g[0])));return c};Editor.configure=function(a,b){if(null!=a){Editor.config=a;Editor.configVersion=a.version;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=
+f=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(f,mxUtils.bind(this,function(a,c,l){a=f.substring(a+8,a+8+l);"zTXt"==c?(l=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,l)&&(a=pako.inflateRaw(a.substring(l+2),{to:"string"}).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&("mxGraphModel"==a[0]||"mxfile"==a[0])&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(J){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));
+null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};Editor.extractParserError=function(a,b){var c=null,f=null!=a?a.getElementsByTagName("parsererror"):null;null!=f&&0<f.length&&(c=b||mxResources.get("invalidChars"),f=f[0].getElementsByTagName("div"),0<f.length&&(c=mxUtils.getTextContent(f[0])));return c};Editor.configure=function(a,b){if(null!=a){Editor.config=a;Editor.configVersion=a.version;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=
a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes;Graph.prototype.defaultEdgeLength=a.defaultEdgeLength||Graph.prototype.defaultEdgeLength;DrawioFile.prototype.autosaveDelay=a.autosaveDelay||DrawioFile.prototype.autosaveDelay;null!=a.templateFile&&(EditorUi.templateFile=a.templateFile);null!=a.globalVars&&
(Editor.globalVars=a.globalVars);null!=a.compressXml&&(Editor.compressXml=a.compressXml);a.customFonts&&(Menus.prototype.defaultFonts=a.customFonts.concat(Menus.prototype.defaultFonts));a.customPresetColors&&(ColorDialog.prototype.presetColors=a.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=a.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=a.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=a.css){var c=document.createElement("style");
-c.setAttribute("type","text/css");c.appendChild(document.createTextNode(a.css));var g=document.getElementsByTagName("script")[0];g.parentNode.insertBefore(c,g)}null!=a.libraries&&(Sidebar.prototype.customEntries=a.libraries);null!=a.enabledLibraries&&(Sidebar.prototype.enabledLibraries=a.enabledLibraries);null!=a.defaultLibraries&&(Sidebar.prototype.defaultEntries=a.defaultLibraries);null!=a.defaultCustomLibraries&&(Editor.defaultCustomLibraries=a.defaultCustomLibraries);null!=a.enableCustomLibraries&&
+c.setAttribute("type","text/css");c.appendChild(document.createTextNode(a.css));var f=document.getElementsByTagName("script")[0];f.parentNode.insertBefore(c,f)}null!=a.libraries&&(Sidebar.prototype.customEntries=a.libraries);null!=a.enabledLibraries&&(Sidebar.prototype.enabledLibraries=a.enabledLibraries);null!=a.defaultLibraries&&(Sidebar.prototype.defaultEntries=a.defaultLibraries);null!=a.defaultCustomLibraries&&(Editor.defaultCustomLibraries=a.defaultCustomLibraries);null!=a.enableCustomLibraries&&
(Editor.enableCustomLibraries=a.enableCustomLibraries);null!=a.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=a.defaultVertexStyle);null!=a.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=a.defaultEdgeStyle);a.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=a.emptyDiagramXml);a.thumbWidth&&(Sidebar.prototype.thumbWidth=a.thumbWidth);a.thumbHeight&&(Sidebar.prototype.thumbHeight=a.thumbHeight);a.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=a.emptyLibraryXml);a.sidebarWidth&&
-(EditorUi.prototype.hsplitPosition=a.sidebarWidth);a.fontCss&&(c=document.createElement("style"),c.setAttribute("type","text/css"),c.appendChild(document.createTextNode(a.fontCss)),g=document.getElementsByTagName("script")[0],g.parentNode.insertBefore(c,g),Editor.prototype.fontCss=a.fontCss);if(null!=a.plugins&&!b)for(App.initPluginCallback(),c=0;c<a.plugins.length;c++)mxscript(a.plugins[c])}};Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=
+(EditorUi.prototype.hsplitPosition=a.sidebarWidth);a.fontCss&&(c=document.createElement("style"),c.setAttribute("type","text/css"),c.appendChild(document.createTextNode(a.fontCss)),f=document.getElementsByTagName("script")[0],f.parentNode.insertBefore(c,f),Editor.prototype.fontCss=a.fontCss);if(null!=a.plugins&&!b)for(App.initPluginCallback(),c=0;c<a.plugins.length;c++)mxscript(a.plugins[c])}};Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=
20;Editor.guid=function(a){a=null!=a?a:Editor.GUID_LENGTH;for(var b=[],c=0;c<a;c++)b.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return b.join("")};Editor.prototype.timeout=25E3;Editor.prototype.useForeignObjectForMath=!1;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(b){b=null!=b&&"mxlibrary"!=b.nodeName?this.extractGraphModel(b):null;
-if(null!=b){var c=b.getElementsByTagName("parsererror");if(null!=c&&0<c.length){var c=c[0],g=c.getElementsByTagName("div");null!=g&&0<g.length&&(c=g[0]);throw{message:mxUtils.getTextContent(c)};}if("mxGraphModel"==b.nodeName){c=b.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=c&&""!=c)c!=this.graph.currentStyle&&(g=null!=this.graph.themes?this.graph.themes[c]:mxUtils.load(STYLE_PATH+"/"+c+".xml").getDocumentElement(),null!=g&&(k=new mxCodec(g.ownerDocument),k.decode(g,this.graph.getStylesheet())));
-else if(g=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),null!=g){var k=new mxCodec(g.ownerDocument);k.decode(g,this.graph.getStylesheet())}this.graph.currentStyle=c;this.graph.mathEnabled="1"==urlParams.math||"1"==b.getAttribute("math");c=b.getAttribute("backgroundImage");null!=c?(c=JSON.parse(c),this.graph.setBackgroundImage(new mxImage(c.src,c.width,c.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled&&
+if(null!=b){var c=b.getElementsByTagName("parsererror");if(null!=c&&0<c.length){var c=c[0],f=c.getElementsByTagName("div");null!=f&&0<f.length&&(c=f[0]);throw{message:mxUtils.getTextContent(c)};}if("mxGraphModel"==b.nodeName){c=b.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=c&&""!=c)c!=this.graph.currentStyle&&(f=null!=this.graph.themes?this.graph.themes[c]:mxUtils.load(STYLE_PATH+"/"+c+".xml").getDocumentElement(),null!=f&&(l=new mxCodec(f.ownerDocument),l.decode(f,this.graph.getStylesheet())));
+else if(f=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),null!=f){var l=new mxCodec(f.ownerDocument);l.decode(f,this.graph.getStylesheet())}this.graph.currentStyle=c;this.graph.mathEnabled="1"==urlParams.math||"1"==b.getAttribute("math");c=b.getAttribute("backgroundImage");null!=c?(c=JSON.parse(c),this.graph.setBackgroundImage(new mxImage(c.src,c.width,c.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled&&
!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==b.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var c=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var b=c.apply(this,
arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&b.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&b.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));b.setAttribute("math",this.graph.mathEnabled?"1":"0");b.setAttribute("shadow",this.graph.shadowVisible?"1":"0");return b};Editor.prototype.isDataSvg=function(a){try{var b=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=b&&(null!=b&&"<"!=
-b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(I){}return!1};Editor.prototype.extractGraphModel=function(a,b){return Editor.extractGraphModel.apply(this,arguments)};var b=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=
+b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(H){}return!1};Editor.prototype.extractGraphModel=function(a,b){return Editor.extractGraphModel.apply(this,arguments)};var b=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=
null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();b.apply(this,arguments)};var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){d.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?
!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(a,b){a=null!=a?a:DRAW_MATH_URL+"/MathJax.js?config=TeX-MML-AM_HTMLorMML";Editor.mathJaxQueue=[];Editor.doMathJaxRender=function(a){window.setTimeout(function(){"hidden"!=a.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])},0)};window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",
AuthorInit:function(){MathJax.Hub.Config(b||{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 c=Editor.prototype.init;Editor.prototype.init=function(){c.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,b){null!=this.graph.container&&this.graph.mathEnabled&&!this.graph.blockMathRender&&Editor.MathJaxRender(this.graph.container)}))};var g=document.getElementsByTagName("script");
-if(null!=g&&0<g.length){var k=document.createElement("script");k.type="text/javascript";k.src=a;g[0].parentNode.appendChild(k)}};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 b=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,
-function(a,c,g,k){void 0!==c?b.push(c.replace(/\\'/g,"'")):void 0!==g?b.push(g.replace(/\\"/g,'"')):void 0!==k&&b.push(k);return""});/,\s*$/.test(a)&&b.push("");return b};Editor.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?:\/\/[^\/]*\.blob.core.windows.net\//.test(a)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(g){if(null!=g){var k="http://"==g.substring(0,7)||"https://"==g.substring(0,8);k&&!navigator.onLine?g=EditorUi.prototype.svgBrokenImage.src:!k||g.substring(0,
-a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&c.isCorsEnabledForUrl(g)?"chrome-extension://"==g.substring(0,19)||mxClient.IS_CHROMEAPP||(g=b.apply(this,arguments)):g=PROXY_URL+"?url="+encodeURIComponent(g)}return g};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.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(EditorUi.prototype.svgBrokenImage.src)});else{var c=new Image;EditorUi.prototype.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),g=a.getContext("2d");a.height=c.height;a.width=c.width;g.drawImage(c,0,0);try{b(a.toDataURL())}catch(J){b(EditorUi.prototype.svgBrokenImage.src)}};c.onerror=function(){b(EditorUi.prototype.svgBrokenImage.src)};c.src=a}};Editor.prototype.convertImages=function(a,b,c,g){null==g&&(g=this.createImageUrlConverter());
-var k=0,d=c||{};c=mxUtils.bind(this,function(c,q){for(var f=a.getElementsByTagName(c),l=0;l<f.length;l++)mxUtils.bind(this,function(c){var f=g.convert(c.getAttribute(q));if(null!=f&&"data:"!=f.substring(0,5)){var l=d[f];null==l?(k++,this.convertImageToDataUri(f,function(g){null!=g&&(d[f]=g,c.setAttribute(q,g));k--;0==k&&b(a)})):c.setAttribute(q,l)}else null!=f&&c.setAttribute(q,f)})(f[l])});c("image","xlink:href");c("img","src");0==k&&b(a)};Editor.prototype.base64Encode=function(a){for(var b="",c=
-0,g=a.length,k,d,q;c<g;){k=a.charCodeAt(c++)&255;if(c==g){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&3)<<4);b+="==";break}d=a.charCodeAt(c++);if(c==g){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&3)<<4|(d&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&
-15)<<2);b+="=";break}q=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&3)<<4|(d&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&15)<<2|(q&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(q&63)}return b};Editor.prototype.loadUrl=function(a,b,c,g,k,d){try{var q=g||/(\.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 g=a.getText();if(q){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var g=Array(a.length),k=0;k<a.length;k++)g[k]=String.fromCharCode(a[k]);g=g.join("")}d=null!=d?d:"data:image/png;base64,";g=d+this.base64Encode(g)}b(g)}}else null!=
-c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},q,this.timeout,function(){k&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(N){null!=c&&c(N)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.fontCss.split("url("),g=0,k={},d=mxUtils.bind(this,function(){if(0==g){for(var d=[c[0]],q=1;q<c.length;q++){var f=
-c[q].indexOf(")");d.push('url("');d.push(k[b(c[q].substring(0,f))]);d.push('"'+c[q].substring(f))}this.resolvedFontCss=d.join("");a()}});if(0<c.length)for(var q=1;q<c.length;q++){var f=c[q].indexOf(")"),l=null,t=c[q].indexOf("format(",f);0<t&&(l=b(c[q].substring(t+7,c[q].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==k[a]){k[a]=a;g++;var b="application/x-font-ttf";if("svg"==l||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==l||"embedded-opentype"==l||/(\.otf)($|\?)/i.test(a))b=
-"application/x-font-opentype";else if("woff"==l||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==l||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==l||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==l||/(\.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){k[a]=b;g--;d()}),mxUtils.bind(this,
-function(a){g--;d()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[q].substring(0,f)),l)}}else a()};Editor.prototype.convertMath=function(a,b,c,g){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){g()}))}),0)):g()};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=
-function(a,b,c,g,k,d,q,f,l,t,m,v,x,C){d=null!=d?d:!0;v=null!=v?v:this.graph;x=null!=x?x:0;var B=l?null:v.background;B==mxConstants.NONE&&(B=null);null==B&&(B=g);null==B&&0==l&&(B=this.graph.defaultPageBackgroundColor);this.convertImages(v.getSvg(B,null,null,C,null,null!=q?q:!0,null,null,null,t),mxUtils.bind(this,function(c){var g=new Image;g.onload=mxUtils.bind(this,function(){try{var q=document.createElement("canvas"),l=parseInt(c.getAttribute("width")),t=parseInt(c.getAttribute("height"));f=null!=
-f?f:1;null!=b&&(f=d?Math.min(1,Math.min(3*b/(4*t),b/l)):b/l);l=Math.ceil(f*l)+2*x;t=Math.ceil(f*t)+2*x;q.setAttribute("width",l);q.setAttribute("height",t);var m=q.getContext("2d");null!=B&&(m.beginPath(),m.rect(0,0,l,t),m.fillStyle=B,m.fill());m.scale(f,f);mxClient.IS_SF?window.setTimeout(function(){m.drawImage(g,x/f,x/f);a(q)},0):(m.drawImage(g,x/f,x/f),a(q))}catch(Y){null!=k&&k(Y)}});g.onerror=function(a){null!=k&&k(a)};try{t&&this.graph.addSvgShadow(c);var q=mxUtils.bind(this,function(){if(null!=
-this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(v,c,!0,mxUtils.bind(this,function(){g.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(q)}catch(W){null!=k&&k(W)}}),c,m)};Editor.prototype.writeGraphModelToPng=function(a,b,c,g,k){function d(a,b){var c=l;l+=b;return a.substring(c,l)}function q(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
-8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function f(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 l=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(d(a,4),"IHDR"!=d(a,4))null!=k&&k();else{d(a,17);k=a.substring(0,l);do{var t=q(a);if("IDAT"==d(a,4)){k=a.substring(0,l-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+g;g=4294967295;
-g=EditorUi.prototype.updateCRC(g,b,0,4);g=EditorUi.prototype.updateCRC(g,c,0,c.length);k+=f(c.length)+b+c+f(g^4294967295);k+=a.substring(l-8,a.length);break}k+=a.substring(l-8,l-4+t);d(a,t);d(a,4)}while(t);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";var m=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,b){m.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
-mxSettings.save()};var f=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){f.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(a,b){var c=null;null!=a.editor.graph.getModel().getParent(b)?c=b.getId():null!=a.currentPage&&(c=a.currentPage.getId());return c});if(null!=window.StyleFormatPanel){var l=Format.prototype.init;Format.prototype.init=function(){l.apply(this,arguments);
-this.editorUi.editor.addListener("fileLoaded",this.update)};var n=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?n.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 p=DiagramFormatPanel.prototype.addView;
-DiagramFormatPanel.prototype.addView=function(a){a=p.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var b=this.editorUi,c=b.editor.graph,g=this.createOption(mxResources.get("shadow"),function(){return c.shadowVisible},function(a){var g=new ChangePageSetup(b);g.ignoreColor=!0;g.ignoreImage=!0;g.shadowVisible=a;c.model.execute(g)},{install:function(a){this.listener=function(){a(c.shadowVisible)};b.addListener("shadowVisibleChanged",this.listener)},
-destroy:function(){b.removeListener(this.listener)}});Editor.shadowOptionEnabled||(g.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(g,60));a.appendChild(g)}return a};var u=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(a){a=u.apply(this,arguments);var b=this.editorUi,c=b.editor.graph;if(c.isEnabled()){var g=b.getCurrentFile();if(null!=g&&g.isAutosaveOptional()){var k=this.createOption(mxResources.get("autosave"),function(){return b.editor.autosave},
-function(a){b.editor.setAutosave(a);b.editor.autosave&&g.isModified()&&g.fileChanged()},{install:function(a){this.listener=function(){a(b.editor.autosave)};b.editor.addListener("autosaveChanged",this.listener)},destroy:function(){b.editor.removeListener(this.listener)}});a.appendChild(k)}}if(this.isMathOptionVisible()&&c.isEnabled()&&"undefined"!==typeof MathJax){k=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return c.mathEnabled},function(a){b.actions.get("mathematicalTypesetting").funct()},
-{install:function(a){this.listener=function(){a(c.mathEnabled)};b.addListener("mathEnabledChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}});k.style.paddingTop="5px";a.appendChild(k);var d=b.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");d.style.position="relative";d.style.marginLeft="6px";d.style.top="2px";k.appendChild(d)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",
+Editor.MathJaxRender=function(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var c=Editor.prototype.init;Editor.prototype.init=function(){c.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,b){null!=this.graph.container&&this.graph.mathEnabled&&!this.graph.blockMathRender&&Editor.MathJaxRender(this.graph.container)}))};var f=document.getElementsByTagName("script");
+if(null!=f&&0<f.length){var l=document.createElement("script");l.type="text/javascript";l.src=a;f[0].parentNode.appendChild(l)}};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 b=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,
+function(a,c,f,l){void 0!==c?b.push(c.replace(/\\'/g,"'")):void 0!==f?b.push(f.replace(/\\"/g,'"')):void 0!==l&&b.push(l);return""});/,\s*$/.test(a)&&b.push("");return b};Editor.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?:\/\/[^\/]*\.blob.core.windows.net\//.test(a)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(f){if(null!=f){var l="http://"==f.substring(0,7)||"https://"==f.substring(0,8);l&&!navigator.onLine?f=EditorUi.prototype.svgBrokenImage.src:!l||f.substring(0,
+a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&c.isCorsEnabledForUrl(f)?"chrome-extension://"==f.substring(0,19)||mxClient.IS_CHROMEAPP||(f=b.apply(this,arguments)):f=PROXY_URL+"?url="+encodeURIComponent(f)}return f};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.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(EditorUi.prototype.svgBrokenImage.src)});else{var c=new Image;EditorUi.prototype.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,0,0);try{b(a.toDataURL())}catch(I){b(EditorUi.prototype.svgBrokenImage.src)}};c.onerror=function(){b(EditorUi.prototype.svgBrokenImage.src)};c.src=a}};Editor.prototype.convertImages=function(a,b,c,f){null==f&&(f=this.createImageUrlConverter());
+var l=0,d=c||{};c=mxUtils.bind(this,function(c,p){for(var e=a.getElementsByTagName(c),k=0;k<e.length;k++)mxUtils.bind(this,function(c){var e=f.convert(c.getAttribute(p));if(null!=e&&"data:"!=e.substring(0,5)){var k=d[e];null==k?(l++,this.convertImageToDataUri(e,function(f){null!=f&&(d[e]=f,c.setAttribute(p,f));l--;0==l&&b(a)})):c.setAttribute(p,k)}else null!=e&&c.setAttribute(p,e)})(e[k])});c("image","xlink:href");c("img","src");0==l&&b(a)};Editor.prototype.base64Encode=function(a){for(var b="",c=
+0,f=a.length,l,d,p;c<f;){l=a.charCodeAt(c++)&255;if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l&3)<<4);b+="==";break}d=a.charCodeAt(c++);if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l&3)<<4|(d&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&
+15)<<2);b+="=";break}p=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l&3)<<4|(d&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&15)<<2|(p&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(p&63)}return b};Editor.prototype.loadUrl=function(a,b,c,f,l,d){try{var p=f||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||
+/(\.gif)($|\?)/i.test(a);l=null!=l?l:!0;var e=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var f=a.getText();if(p){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),l=0;l<a.length;l++)f[l]=String.fromCharCode(a[l]);f=f.join("")}d=null!=d?d:"data:image/png;base64,";f=d+this.base64Encode(f)}b(f)}}else null!=
+c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},p,this.timeout,function(){l&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:e})})});e()}catch(Q){null!=c&&c(Q)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.fontCss.split("url("),f=0,l={},d=mxUtils.bind(this,function(){if(0==f){for(var d=[c[0]],p=1;p<c.length;p++){var e=
+c[p].indexOf(")");d.push('url("');d.push(l[b(c[p].substring(0,e))]);d.push('"'+c[p].substring(e))}this.resolvedFontCss=d.join("");a()}});if(0<c.length)for(var p=1;p<c.length;p++){var e=c[p].indexOf(")"),k=null,g=c[p].indexOf("format(",e);0<g&&(k=b(c[p].substring(g+7,c[p].indexOf(")",g))));mxUtils.bind(this,function(a){if(null==l[a]){l[a]=a;f++;var b="application/x-font-ttf";if("svg"==k||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==k||"embedded-opentype"==k||/(\.otf)($|\?)/i.test(a))b=
+"application/x-font-opentype";else if("woff"==k||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==k||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==k||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==k||/(\.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){l[a]=b;f--;d()}),mxUtils.bind(this,
+function(a){f--;d()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[p].substring(0,e)),k)}}else a()};Editor.prototype.convertMath=function(a,b,c,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){f()}))}),0)):f()};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=
+function(a,b,c,f,l,d,p,e,k,g,t,x,u,B){d=null!=d?d:!0;x=null!=x?x:this.graph;u=null!=u?u:0;var A=k?null:x.background;A==mxConstants.NONE&&(A=null);null==A&&(A=f);null==A&&0==k&&(A=this.graph.defaultPageBackgroundColor);this.convertImages(x.getSvg(A,null,null,B,null,null!=p?p:!0,null,null,null,g),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var p=document.createElement("canvas"),k=parseInt(c.getAttribute("width")),g=parseInt(c.getAttribute("height"));e=null!=
+e?e:1;null!=b&&(e=d?Math.min(1,Math.min(3*b/(4*g),b/k)):b/k);k=Math.ceil(e*k)+2*u;g=Math.ceil(e*g)+2*u;p.setAttribute("width",k);p.setAttribute("height",g);var t=p.getContext("2d");null!=A&&(t.beginPath(),t.rect(0,0,k,g),t.fillStyle=A,t.fill());t.scale(e,e);mxClient.IS_SF?window.setTimeout(function(){t.drawImage(f,u/e,u/e);a(p)},0):(t.drawImage(f,u/e,u/e),a(p))}catch(X){null!=l&&l(X)}});f.onerror=function(a){null!=l&&l(a)};try{g&&this.graph.addSvgShadow(c);var p=mxUtils.bind(this,function(){if(null!=
+this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(x,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(p)}catch(V){null!=l&&l(V)}}),c,t)};Editor.prototype.writeGraphModelToPng=function(a,b,c,f,l){function d(a,b){var c=k;k+=b;return a.substring(c,k)}function p(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
+8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function e(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 k=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=l&&l();else if(d(a,4),"IHDR"!=d(a,4))null!=l&&l();else{d(a,17);l=a.substring(0,k);do{var g=p(a);if("IDAT"==d(a,4)){l=a.substring(0,k-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+f;f=4294967295;
+f=EditorUi.prototype.updateCRC(f,b,0,4);f=EditorUi.prototype.updateCRC(f,c,0,c.length);l+=e(c.length)+b+c+e(f^4294967295);l+=a.substring(k-8,a.length);break}l+=a.substring(k-8,k-4+g);d(a,g);d(a,4)}while(g);return"data:image/png;base64,"+(window.btoa?btoa(l):Base64.encode(l,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";var g=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,b){g.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
+mxSettings.save()};var e=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){e.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(a,b){var c=null;null!=a.editor.graph.getModel().getParent(b)?c=b.getId():null!=a.currentPage&&(c=a.currentPage.getId());return c});if(null!=window.StyleFormatPanel){var k=Format.prototype.init;Format.prototype.init=function(){k.apply(this,arguments);
+this.editorUi.editor.addListener("fileLoaded",this.update)};var m=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?m.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 n=DiagramFormatPanel.prototype.addView;
+DiagramFormatPanel.prototype.addView=function(a){a=n.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var b=this.editorUi,c=b.editor.graph,f=this.createOption(mxResources.get("shadow"),function(){return c.shadowVisible},function(a){var f=new ChangePageSetup(b);f.ignoreColor=!0;f.ignoreImage=!0;f.shadowVisible=a;c.model.execute(f)},{install:function(a){this.listener=function(){a(c.shadowVisible)};b.addListener("shadowVisibleChanged",this.listener)},
+destroy:function(){b.removeListener(this.listener)}});Editor.shadowOptionEnabled||(f.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(f,60));a.appendChild(f)}return a};var q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(a){a=q.apply(this,arguments);var b=this.editorUi,c=b.editor.graph;if(c.isEnabled()){var f=b.getCurrentFile();if(null!=f&&f.isAutosaveOptional()){var l=this.createOption(mxResources.get("autosave"),function(){return b.editor.autosave},
+function(a){b.editor.setAutosave(a);b.editor.autosave&&f.isModified()&&f.fileChanged()},{install:function(a){this.listener=function(){a(b.editor.autosave)};b.editor.addListener("autosaveChanged",this.listener)},destroy:function(){b.editor.removeListener(this.listener)}});a.appendChild(l)}}if(this.isMathOptionVisible()&&c.isEnabled()&&"undefined"!==typeof MathJax){l=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return c.mathEnabled},function(a){b.actions.get("mathematicalTypesetting").funct()},
+{install:function(a){this.listener=function(){a(c.mathEnabled)};b.addListener("mathEnabledChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}});l.style.paddingTop="5px";a.appendChild(l);var d=b.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");d.style.position="relative";d.style.marginLeft="6px";d.style.top="2px";l.appendChild(d)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",
type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,
defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",
dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",
@@ -8217,59 +8226,59 @@ type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,de
{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#aa00ff",stroke:"#7700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#ffffff"},{fill:"#f0a30a",stroke:"#BD7000",font:"#ffffff"},{fill:"#e3c800",
stroke:"#B09500",font:"#ffffff"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},
{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",
-stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,b,c){if(null!=b){var g=function(a){if(null!=a)if(c)for(var g=0;g<a.length;g++)b[a[g].name]=a[g];else for(var k in b){for(var d=!1,g=0;g<a.length;g++)if(a[g].name==k&&a[g].type==b[k].type){d=!0;break}d||delete b[k]}},k=this.editorUi.editor.graph.view.getState(a);null!=k&&
-null!=k.shape&&(k.shape.commonCustomPropAdded||(k.shape.commonCustomPropAdded=!0,k.shape.customProperties=k.shape.customProperties||[],k.cell.vertex?Array.prototype.push.apply(k.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(k.shape.customProperties,Editor.commonEdgeProperties)),g(k.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{g(JSON.parse(a))}catch(J){}}};var g=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
-this.format.createSelectionState();"image"==a.style.shape||a.containsLabel||this.container.appendChild(this.addStyles(this.createPanel()));g.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},c=a.vertices,k=a.edges,d=0;d<c.length;d++)this.findCommonProperties(c[d],b,0==d);for(d=0;d<k.length;d++)this.findCommonProperties(k[d],b,0==c.length&&0==d);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),
-b,a))}};var k=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var b=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));b.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";b.style.marginRight="2px";a.appendChild(b);b=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,
-function(a){this.editorUi.actions.get("pasteStyle").funct()}));b.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";a.appendChild(b);mxUtils.br(a);return k.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,b,c){function g(a,b,c,g){v.getModel().beginUpdate();try{var k=[],d=[];if(null!=c.index){for(var q=[],f=c.parentRow.nextSibling;f&&
-f.getAttribute("data-pName")==a;)q.push(f.getAttribute("data-pValue")),f=f.nextSibling;c.index<q.length?null!=g?q.splice(g,1):q[c.index]=b:q.push(b);null!=c.size&&q.length>c.size&&(q=q.slice(0,c.size));b=q.join(",");null!=c.countProperty&&(v.setCellStyles(c.countProperty,q.length,v.getSelectionCells()),k.push(c.countProperty),d.push(q.length))}v.setCellStyles(a,b,v.getSelectionCells());k.push(a);d.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var l=c.dependentPropsDefVal[a],
-t=c.dependentPropsVals[a];if(t.length>b)t=t.slice(0,b);else for(var x=t.length;x<b;x++)t.push(l);t=t.join(",");v.setCellStyles(c.dependentProps[a],t,v.getSelectionCells());k.push(c.dependentProps[a]);d.push(t)}if("function"==typeof c.onChange)c.onChange(v,b);m.editorUi.fireEvent(new mxEventObject("styleChanged","keys",k,"values",d,"cells",v.getSelectionCells()))}finally{v.getModel().endUpdate()}}function k(b,c,g){var k=mxUtils.getOffset(a,!0),d=mxUtils.getOffset(b,!0);c.style.position="absolute";
-c.style.left=d.x-k.x+"px";c.style.top=d.y-k.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(g?4:0)+"px";c.style.zIndex=5}function d(a,b,c){var k=document.createElement("div");k.style.width="32px";k.style.height="4px";k.style.margin="2px";k.style.border="1px solid black";k.style.background=b&&"none"!=b?b:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(m,function(d){this.editorUi.pickColor(b,function(b){k.style.background="none"==b?"url('"+Dialog.prototype.noColorImage+
-"')":b;g(a,b,c)});mxEvent.consume(d)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(k);return btn}function q(a,b,c,k,d,q,f){null!=b&&(b=b.split(","),x.push({name:a,values:b,type:c,defVal:k,countProperty:d,parentRow:q,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(m,function(b){for(var l=q,m=0;null!=l.nextSibling;)if(l.nextSibling.getAttribute("data-pName")==a)l=l.nextSibling,m++;else break;var v={type:c,parentRow:q,index:m,isDeletable:!0,
-defVal:k,countProperty:d},m=t(a,"",v,0==m%2,f);g(a,k,v);l.parentNode.insertBefore(m,l.nextSibling);mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,b,c,g,k,d,q){if(0<k){var f=Array(k);b=null!=b?b.split(","):[];for(var l=0;l<k;l++)f[l]=null!=b[l]?b[l]:null!=g?g:"";x.push({name:a,values:f,type:c,defVal:g,parentRow:d,flipBkg:q,size:k})}return document.createElement("div")}function l(a,b,c){var k=document.createElement("input");k.type=
-"checkbox";k.checked="1"==b;mxEvent.addListener(k,"change",function(){g(a,k.checked?"1":"0",c)});return k}function t(b,c,t,v,x){var p=t.dispName,C=t.type,B=document.createElement("tr");B.className="gePropRow"+(x?"Dark":"")+(v?"Alt":"")+" gePropNonHeaderRow";B.setAttribute("data-pName",b);B.setAttribute("data-pValue",c);v=!1;null!=t.index&&(B.setAttribute("data-index",t.index),p=(null!=p?p:"")+"["+t.index+"]",v=!0);var n=document.createElement("td");n.className="gePropRowCell";n.innerHTML=mxUtils.htmlEntities(mxResources.get(p,
-null,p));v&&(n.style.textAlign="right");B.appendChild(n);n=document.createElement("td");n.className="gePropRowCell";if("color"==C)n.appendChild(d(b,c,t));else if("bool"==C||"boolean"==C)n.appendChild(l(b,c,t));else if("enum"==C){var y=t.enumList;for(x=0;x<y.length;x++)if(p=y[x],p.val==c){n.innerHTML=mxUtils.htmlEntities(mxResources.get(p.dispName,null,p.dispName));break}mxEvent.addListener(n,"click",mxUtils.bind(m,function(){var d=document.createElement("select");k(n,d);for(var q=0;q<y.length;q++){var f=
-y[q],l=document.createElement("option");l.value=mxUtils.htmlEntities(f.val);l.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));d.appendChild(l)}d.value=c;a.appendChild(d);mxEvent.addListener(d,"change",function(){var a=mxUtils.htmlEntities(d.value);g(b,a,t)});d.focus();mxEvent.addListener(d,"blur",function(){a.removeChild(d)})}))}else"dynamicArr"==C?n.appendChild(q(b,c,t.subType,t.subDefVal,t.countProperty,B,x)):"staticArr"==C?n.appendChild(f(b,c,t.subType,t.subDefVal,t.size,
-B,x)):(n.innerHTML=c,mxEvent.addListener(n,"click",mxUtils.bind(m,function(){function d(){var a=q.value,a=0==a.length&&"string"!=C?0:a;t.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",C="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=t.min&&a<t.min?a=t.min:null!=t.max&&a>t.max&&(a=t.max);a=mxUtils.htmlEntities(("int"==C?parseInt(a):a)+"");g(b,a,t)}var q=document.createElement("input");k(n,q,!0);q.value=c;q.className="gePropEditor";"int"!=C&&"float"!=C||t.allowAuto||(q.type="number",q.step=
-"int"==C?"1":"any",null!=t.min&&(q.min=parseFloat(t.min)),null!=t.max&&(q.max=parseFloat(t.max)));a.appendChild(q);mxEvent.addListener(q,"keypress",function(a){13==a.keyCode&&d()});q.focus();mxEvent.addListener(q,"blur",function(){d()})})));t.isDeletable&&(x=mxUtils.button("-",mxUtils.bind(m,function(a){g(b,"",t,t.index);mxEvent.consume(a)})),x.style.height="16px",x.style.width="25px",x.style["float"]="right",x.className="geColorBtn",n.appendChild(x));B.appendChild(n);return B}var m=this,v=this.editorUi.editor.graph,
-x=[];a.style.position="relative";a.style.padding="0";var C=document.createElement("table");C.style.whiteSpace="nowrap";C.style.width="100%";var p=document.createElement("tr");p.className="gePropHeader";var B=document.createElement("th");B.className="gePropHeaderCell";var n=document.createElement("img");n.src=Sidebar.prototype.expandedImage;B.appendChild(n);mxUtils.write(B,mxResources.get("property"));p.style.cursor="pointer";var y=function(){var b=C.querySelectorAll(".gePropNonHeaderRow"),c;if(m.editorUi.propertiesCollapsed){n.src=
-Sidebar.prototype.collapsedImage;c="none";for(var g=a.childNodes.length-1;0<=g;g--)try{var k=a.childNodes[g],d=k.nodeName.toUpperCase();"INPUT"!=d&&"SELECT"!=d||a.removeChild(k)}catch(P){}}else n.src=Sidebar.prototype.expandedImage,c="";for(g=0;g<b.length;g++)b[g].style.display=c};mxEvent.addListener(p,"click",function(){m.editorUi.propertiesCollapsed=!m.editorUi.propertiesCollapsed;y()});p.appendChild(B);B=document.createElement("th");B.className="gePropHeaderCell";B.innerHTML=mxResources.get("value");
-p.appendChild(B);C.appendChild(p);var A=!1,z=!1,u;for(u in b)if(p=b[u],"function"!=typeof p.isVisible||p.isVisible(c)){var D=null!=c.style[u]?mxUtils.htmlEntities(c.style[u]+""):p.defVal;if("separator"==p.type)z=!z;else{if("staticArr"==p.type)p.size=parseInt(c.style[p.sizeProperty]||b[p.sizeProperty].defVal)||0;else if(null!=p.dependentProps){for(var G=p.dependentProps,F=[],E=[],B=0;B<G.length;B++){var O=c.style[G[B]];E.push(b[G[B]].subDefVal);F.push(null!=O?O.split(","):[])}p.dependentPropsDefVal=
-E;p.dependentPropsVals=F}C.appendChild(t(u,D,p,A,z));A=!A}}for(B=0;B<x.length;B++)for(p=x[B],b=p.parentRow,c=0;c<p.values.length;c++)u=t(p.name,p.values[c],{type:p.type,parentRow:p.parentRow,isDeletable:p.isDeletable,index:c,defVal:p.defVal,countProperty:p.countProperty,size:p.size},0==c%2,p.flipBkg),b.parentNode.insertBefore(u,b.nextSibling),b=u;a.appendChild(C);y();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){g.getModel().beginUpdate();
-try{var c=g.getSelectionCells();for(b=0;b<c.length;b++){for(var k=g.getModel().getStyle(c[b]),q=0;q<d.length;q++)k=mxUtils.removeStylename(k,d[q]);var f=g.getModel().isVertex(c[b])?g.defaultVertexStyle:g.defaultEdgeStyle;null!=a?(k=mxUtils.setStyle(k,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(f,mxConstants.STYLE_GRADIENTCOLOR,null)),k=""==a.fill?mxUtils.setStyle(k,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(k,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(f,mxConstants.STYLE_FILLCOLOR,
-null)),k=""==a.stroke?mxUtils.setStyle(k,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(k,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(f,mxConstants.STYLE_STROKECOLOR,null)),g.getModel().isVertex(c[b])&&(k=mxUtils.setStyle(k,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(f,mxConstants.STYLE_FONTCOLOR,null)))):(k=mxUtils.setStyle(k,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(f,mxConstants.STYLE_FILLCOLOR,"#ffffff")),k=mxUtils.setStyle(k,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(f,
-mxConstants.STYLE_STROKECOLOR,"#000000")),k=mxUtils.setStyle(k,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(f,mxConstants.STYLE_GRADIENTCOLOR,null)),g.getModel().isVertex(c[b])&&(k=mxUtils.setStyle(k,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(f,mxConstants.STYLE_FONTCOLOR,null))));g.getModel().setStyle(c[b],k)}}finally{g.getModel().endUpdate()}});b.className="geStyleButton";b.style.width="36px";b.style.height="30px";b.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&
-(mxClient.IS_QUIRKS||10>document.documentMode)?b.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":b.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":a.fill==mxConstants.NONE?b.style.background="url('"+Dialog.prototype.noColorImage+"')":b.style.backgroundColor=""==a.fill?mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"):a.fill||mxUtils.getValue(g.defaultVertexStyle,
-mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"),b.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"):"1px solid "+(a.stroke||mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"));else{var c=mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),q=mxUtils.getValue(g.defaultVertexStyle,
-mxConstants.STYLE_STROKECOLOR,"#000000");b.style.backgroundColor=c;b.style.border="1px solid "+q}k.appendChild(b)}k.innerHTML="";for(var c=0;c<a.length;c++)0<c&&0==mxUtils.mod(c,4)&&mxUtils.br(k),b(a[c])}function c(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var g=this.editorUi.editor.graph,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.paddingLeft="24px";k.style.paddingRight="20px";
-a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(k);var d="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 q=document.createElement("div");q.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(q,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);b(this.defaultColorSchemes[this.editorUi.currentScheme])}));var f=document.createElement("div");f.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(q),a.appendChild(f));mxEvent.addListener(f,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);b(this.defaultColorSchemes[this.editorUi.currentScheme])}));c(q);c(f);b(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var b=this.format.getSelectionState(),c=null;1==this.editorUi.editor.graph.getSelectionCount()&&
-(c=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),c.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),c.style.width="202px",c.style.marginBottom="2px",a.appendChild(c));var g=this.editorUi.editor.graph,k=g.view.getState(g.getSelectionCell());1==g.getSelectionCount()&&null!=k&&null!=k.shape&&null!=k.shape.stencil?(b=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
+stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,b,c){if(null!=b){var f=function(a){if(null!=a)if(c)for(var f=0;f<a.length;f++)b[a[f].name]=a[f];else for(var l in b){for(var d=!1,f=0;f<a.length;f++)if(a[f].name==l&&a[f].type==b[l].type){d=!0;break}d||delete b[l]}},l=this.editorUi.editor.graph.view.getState(a);null!=l&&
+null!=l.shape&&(l.shape.commonCustomPropAdded||(l.shape.commonCustomPropAdded=!0,l.shape.customProperties=l.shape.customProperties||[],l.cell.vertex?Array.prototype.push.apply(l.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(l.shape.customProperties,Editor.commonEdgeProperties)),f(l.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(I){}}};var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
+this.format.createSelectionState();"image"==a.style.shape||a.containsLabel||this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},c=a.vertices,l=a.edges,d=0;d<c.length;d++)this.findCommonProperties(c[d],b,0==d);for(d=0;d<l.length;d++)this.findCommonProperties(l[d],b,0==c.length&&0==d);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),
+b,a))}};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var b=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));b.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";b.style.marginRight="2px";a.appendChild(b);b=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,
+function(a){this.editorUi.actions.get("pasteStyle").funct()}));b.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";a.appendChild(b);mxUtils.br(a);return l.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,b,c){function f(a,b,c,f){x.getModel().beginUpdate();try{var l=[],d=[];if(null!=c.index){for(var p=[],e=c.parentRow.nextSibling;e&&
+e.getAttribute("data-pName")==a;)p.push(e.getAttribute("data-pValue")),e=e.nextSibling;c.index<p.length?null!=f?p.splice(f,1):p[c.index]=b:p.push(b);null!=c.size&&p.length>c.size&&(p=p.slice(0,c.size));b=p.join(",");null!=c.countProperty&&(x.setCellStyles(c.countProperty,p.length,x.getSelectionCells()),l.push(c.countProperty),d.push(p.length))}x.setCellStyles(a,b,x.getSelectionCells());l.push(a);d.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var k=c.dependentPropsDefVal[a],
+g=c.dependentPropsVals[a];if(g.length>b)g=g.slice(0,b);else for(var u=g.length;u<b;u++)g.push(k);g=g.join(",");x.setCellStyles(c.dependentProps[a],g,x.getSelectionCells());l.push(c.dependentProps[a]);d.push(g)}if("function"==typeof c.onChange)c.onChange(x,b);t.editorUi.fireEvent(new mxEventObject("styleChanged","keys",l,"values",d,"cells",x.getSelectionCells()))}finally{x.getModel().endUpdate()}}function l(b,c,f){var l=mxUtils.getOffset(a,!0),d=mxUtils.getOffset(b,!0);c.style.position="absolute";
+c.style.left=d.x-l.x+"px";c.style.top=d.y-l.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(f?4:0)+"px";c.style.zIndex=5}function d(a,b,c){var l=document.createElement("div");l.style.width="32px";l.style.height="4px";l.style.margin="2px";l.style.border="1px solid black";l.style.background=b&&"none"!=b?b:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(t,function(d){this.editorUi.pickColor(b,function(b){l.style.background="none"==b?"url('"+Dialog.prototype.noColorImage+
+"')":b;f(a,b,c)});mxEvent.consume(d)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(l);return btn}function p(a,b,c,l,d,p,e){null!=b&&(b=b.split(","),u.push({name:a,values:b,type:c,defVal:l,countProperty:d,parentRow:p,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(t,function(b){for(var k=p,t=0;null!=k.nextSibling;)if(k.nextSibling.getAttribute("data-pName")==a)k=k.nextSibling,t++;else break;var x={type:c,parentRow:p,index:t,isDeletable:!0,
+defVal:l,countProperty:d},t=g(a,"",x,0==t%2,e);f(a,l,x);k.parentNode.insertBefore(t,k.nextSibling);mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function e(a,b,c,f,l,d,p){if(0<l){var e=Array(l);b=null!=b?b.split(","):[];for(var k=0;k<l;k++)e[k]=null!=b[k]?b[k]:null!=f?f:"";u.push({name:a,values:e,type:c,defVal:f,parentRow:d,flipBkg:p,size:l})}return document.createElement("div")}function k(a,b,c){var l=document.createElement("input");l.type=
+"checkbox";l.checked="1"==b;mxEvent.addListener(l,"change",function(){f(a,l.checked?"1":"0",c)});return l}function g(b,c,g,x,u){var n=g.dispName,B=g.type,v=document.createElement("tr");v.className="gePropRow"+(u?"Dark":"")+(x?"Alt":"")+" gePropNonHeaderRow";v.setAttribute("data-pName",b);v.setAttribute("data-pValue",c);x=!1;null!=g.index&&(v.setAttribute("data-index",g.index),n=(null!=n?n:"")+"["+g.index+"]",x=!0);var A=document.createElement("td");A.className="gePropRowCell";A.innerHTML=mxUtils.htmlEntities(mxResources.get(n,
+null,n));x&&(A.style.textAlign="right");v.appendChild(A);A=document.createElement("td");A.className="gePropRowCell";if("color"==B)A.appendChild(d(b,c,g));else if("bool"==B||"boolean"==B)A.appendChild(k(b,c,g));else if("enum"==B){var m=g.enumList;for(u=0;u<m.length;u++)if(n=m[u],n.val==c){A.innerHTML=mxUtils.htmlEntities(mxResources.get(n.dispName,null,n.dispName));break}mxEvent.addListener(A,"click",mxUtils.bind(t,function(){var d=document.createElement("select");l(A,d);for(var p=0;p<m.length;p++){var e=
+m[p],k=document.createElement("option");k.value=mxUtils.htmlEntities(e.val);k.innerHTML=mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));d.appendChild(k)}d.value=c;a.appendChild(d);mxEvent.addListener(d,"change",function(){var a=mxUtils.htmlEntities(d.value);f(b,a,g)});d.focus();mxEvent.addListener(d,"blur",function(){a.removeChild(d)})}))}else"dynamicArr"==B?A.appendChild(p(b,c,g.subType,g.subDefVal,g.countProperty,v,u)):"staticArr"==B?A.appendChild(e(b,c,g.subType,g.subDefVal,g.size,
+v,u)):(A.innerHTML=c,mxEvent.addListener(A,"click",mxUtils.bind(t,function(){function d(){var a=p.value,a=0==a.length&&"string"!=B?0:a;g.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",B="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=g.min&&a<g.min?a=g.min:null!=g.max&&a>g.max&&(a=g.max);a=mxUtils.htmlEntities(("int"==B?parseInt(a):a)+"");f(b,a,g)}var p=document.createElement("input");l(A,p,!0);p.value=c;p.className="gePropEditor";"int"!=B&&"float"!=B||g.allowAuto||(p.type="number",p.step=
+"int"==B?"1":"any",null!=g.min&&(p.min=parseFloat(g.min)),null!=g.max&&(p.max=parseFloat(g.max)));a.appendChild(p);mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&d()});p.focus();mxEvent.addListener(p,"blur",function(){d()})})));g.isDeletable&&(u=mxUtils.button("-",mxUtils.bind(t,function(a){f(b,"",g,g.index);mxEvent.consume(a)})),u.style.height="16px",u.style.width="25px",u.style["float"]="right",u.className="geColorBtn",A.appendChild(u));v.appendChild(A);return v}var t=this,x=this.editorUi.editor.graph,
+u=[];a.style.position="relative";a.style.padding="0";var B=document.createElement("table");B.style.whiteSpace="nowrap";B.style.width="100%";var n=document.createElement("tr");n.className="gePropHeader";var v=document.createElement("th");v.className="gePropHeaderCell";var A=document.createElement("img");A.src=Sidebar.prototype.expandedImage;v.appendChild(A);mxUtils.write(v,mxResources.get("property"));n.style.cursor="pointer";var m=function(){var b=B.querySelectorAll(".gePropNonHeaderRow"),c;if(t.editorUi.propertiesCollapsed){A.src=
+Sidebar.prototype.collapsedImage;c="none";for(var f=a.childNodes.length-1;0<=f;f--)try{var l=a.childNodes[f],d=l.nodeName.toUpperCase();"INPUT"!=d&&"SELECT"!=d||a.removeChild(l)}catch(O){}}else A.src=Sidebar.prototype.expandedImage,c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(n,"click",function(){t.editorUi.propertiesCollapsed=!t.editorUi.propertiesCollapsed;m()});n.appendChild(v);v=document.createElement("th");v.className="gePropHeaderCell";v.innerHTML=mxResources.get("value");
+n.appendChild(v);B.appendChild(n);var z=!1,y=!1,q;for(q in b)if(n=b[q],"function"!=typeof n.isVisible||n.isVisible(c)){var C=null!=c.style[q]?mxUtils.htmlEntities(c.style[q]+""):n.defVal;if("separator"==n.type)y=!y;else{if("staticArr"==n.type)n.size=parseInt(c.style[n.sizeProperty]||b[n.sizeProperty].defVal)||0;else if(null!=n.dependentProps){for(var E=n.dependentProps,F=[],D=[],v=0;v<E.length;v++){var M=c.style[E[v]];D.push(b[E[v]].subDefVal);F.push(null!=M?M.split(","):[])}n.dependentPropsDefVal=
+D;n.dependentPropsVals=F}B.appendChild(g(q,C,n,z,y));z=!z}}for(v=0;v<u.length;v++)for(n=u[v],b=n.parentRow,c=0;c<n.values.length;c++)q=g(n.name,n.values[c],{type:n.type,parentRow:n.parentRow,isDeletable:n.isDeletable,index:c,defVal:n.defVal,countProperty:n.countProperty,size:n.size},0==c%2,n.flipBkg),b.parentNode.insertBefore(q,b.nextSibling),b=q;a.appendChild(B);m();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();
+try{var c=f.getSelectionCells();for(b=0;b<c.length;b++){for(var l=f.getModel().getStyle(c[b]),p=0;p<d.length;p++)l=mxUtils.removeStylename(l,d[p]);var e=f.getModel().isVertex(c[b])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(l=mxUtils.setStyle(l,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),l=""==a.fill?mxUtils.setStyle(l,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(l,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,
+null)),l=""==a.stroke?mxUtils.setStyle(l,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(l,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(c[b])&&(l=mxUtils.setStyle(l,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null)))):(l=mxUtils.setStyle(l,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,"#ffffff")),l=mxUtils.setStyle(l,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(e,
+mxConstants.STYLE_STROKECOLOR,"#000000")),l=mxUtils.setStyle(l,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(c[b])&&(l=mxUtils.setStyle(l,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null))));f.getModel().setStyle(c[b],l)}}finally{f.getModel().endUpdate()}});b.className="geStyleButton";b.style.width="36px";b.style.height="30px";b.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&
+(mxClient.IS_QUIRKS||10>document.documentMode)?b.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":b.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":a.fill==mxConstants.NONE?b.style.background="url('"+Dialog.prototype.noColorImage+"')":b.style.backgroundColor=""==a.fill?mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"):a.fill||mxUtils.getValue(f.defaultVertexStyle,
+mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"),b.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"):"1px solid "+(a.stroke||mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"));else{var c=mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),p=mxUtils.getValue(f.defaultVertexStyle,
+mxConstants.STYLE_STROKECOLOR,"#000000");b.style.backgroundColor=c;b.style.border="1px solid "+p}l.appendChild(b)}l.innerHTML="";for(var c=0;c<a.length;c++)0<c&&0==mxUtils.mod(c,4)&&mxUtils.br(l),b(a[c])}function c(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var f=this.editorUi.editor.graph,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.paddingLeft="24px";l.style.paddingRight="20px";
+a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(l);var d="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 p=document.createElement("div");p.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(p,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);b(this.defaultColorSchemes[this.editorUi.currentScheme])}));var e=document.createElement("div");e.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(p),a.appendChild(e));mxEvent.addListener(e,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);b(this.defaultColorSchemes[this.editorUi.currentScheme])}));c(p);c(e);b(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var b=this.format.getSelectionState(),c=null;1==this.editorUi.editor.graph.getSelectionCount()&&
+(c=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),c.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),c.style.width="202px",c.style.marginBottom="2px",a.appendChild(c));var f=this.editorUi.editor.graph,l=f.view.getState(f.getSelectionCell());1==f.getSelectionCount()&&null!=l&&null!=l.shape&&null!=l.shape.stencil?(b=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
function(a){this.editorUi.actions.get("editShape").funct()})),b.setAttribute("title",mxResources.get("editShape")),b.style.marginBottom="2px",null==c?b.style.width="202px":(c.style.width="100px",b.style.width="100px",b.style.marginLeft="2px"),a.appendChild(b)):b.image&&(b=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),b.setAttribute("title",mxResources.get("editImage")),b.style.marginBottom="2px",null==c?b.style.width="202px":
(c.style.width="100px",b.style.width="100px",b.style.marginLeft="2px"),a.appendChild(b));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 q=Graph.prototype.init;Graph.prototype.init=function(){function a(a){b=a;try{if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)b=document.createEventObject(a),b.type=a.type,b.canBubble=a.canBubble,b.cancelable=a.cancelable,b.view=a.view,b.detail=a.detail,b.screenX=a.screenX,b.screenY=a.screenY,b.clientX=a.clientX,b.clientY=a.clientY,b.ctrlKey=a.ctrlKey,b.altKey=a.altKey,b.shiftKey=a.shiftKey,b.metaKey=a.metaKey,b.button=
-a.button,b.relatedTarget=a.relatedTarget}catch(J){}}q.apply(this,arguments);window.mxFreehand&&(this.freehand=new mxFreehand(this));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 g=this.layoutManager.getLayout;
+"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var p=Graph.prototype.init;Graph.prototype.init=function(){function a(a){b=a;try{if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)b=document.createEventObject(a),b.type=a.type,b.canBubble=a.canBubble,b.cancelable=a.cancelable,b.view=a.view,b.detail=a.detail,b.screenX=a.screenX,b.screenY=a.screenY,b.clientX=a.clientX,b.clientY=a.clientY,b.ctrlKey=a.ctrlKey,b.altKey=a.altKey,b.shiftKey=a.shiftKey,b.metaKey=a.metaKey,b.button=
+a.button,b.relatedTarget=a.relatedTarget}catch(I){}}p.apply(this,arguments);window.mxFreehand&&(this.freehand=new mxFreehand(this));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 f=this.layoutManager.getLayout;
this.layoutManager.getLayout=function(a){var b=this.graph.getCellStyle(a);if(null!=b){if("rack"==b.childLayout){var c=new mxStackLayout(this.graph,!1);c.gridSize=null!=b.rackUnitSize?parseFloat(b.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;c.fill=!0;c.marginLeft=b.marginLeft||0;c.marginRight=b.marginRight||0;c.marginTop=b.marginTop||0;c.marginBottom=b.marginBottom||0;c.allowGaps=b.allowGaps||0;c.resizeParent=!1;return c}if("undefined"!==typeof mxTableLayout&&"tableLayout"==
b.childLayout)return c=new mxTableLayout(this.graph),c.rows=b.tableRows||2,c.columns=b.tableColumns||2,c.colPercentages=b.colPercentages,c.rowPercentages=b.rowPercentages,c.equalColumns="1"==mxUtils.getValue(b,"equalColumns",c.colPercentages?"0":"1"),c.equalRows="1"==mxUtils.getValue(b,"equalRows",c.rowPercentages?"0":"1"),c.resizeParent="1"==mxUtils.getValue(b,"resizeParent","1"),c.border=b.tableBorder||c.border,c.marginLeft=b.marginLeft||0,c.marginRight=b.marginRight||0,c.marginTop=b.marginTop||
-0,c.marginBottom=b.marginBottom||0,c.autoAddCol="1"==mxUtils.getValue(b,"autoAddCol","0"),c.autoAddRow="1"==mxUtils.getValue(b,"autoAddRow",c.autoAddCol?"0":"1"),c.colWidths=b.colWidths||"100",c.rowHeights=b.rowHeights||"50",c}return g.apply(this,arguments)};this.updateGlobalUrlVariables()};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));
-if(null!=a)for(var b in a)this.globalVars[b]=a[b]}catch(E){null!=window.console&&console.log("Error in vars URL parameter: "+E)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var v=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var b=v.apply(this,arguments);null==b&&null!=this.globalVars&&(b=this.globalVars[a]);return b};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=
-this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var y=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;null!=this.themes&&"darkTheme"==this.defaultThemeName&&(a=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var b=y.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return b};var t=Graph.prototype.isCssTransformsSupported;
-Graph.prototype.isCssTransformsSupported=function(){return t.apply(this,arguments)&&!mxClient.IS_SF};var A=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){A.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||
+0,c.marginBottom=b.marginBottom||0,c.autoAddCol="1"==mxUtils.getValue(b,"autoAddCol","0"),c.autoAddRow="1"==mxUtils.getValue(b,"autoAddRow",c.autoAddCol?"0":"1"),c.colWidths=b.colWidths||"100",c.rowHeights=b.rowHeights||"50",c}return f.apply(this,arguments)};this.updateGlobalUrlVariables()};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));
+if(null!=a)for(var b in a)this.globalVars[b]=a[b]}catch(D){null!=window.console&&console.log("Error in vars URL parameter: "+D)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var u=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var b=u.apply(this,arguments);null==b&&null!=this.globalVars&&(b=this.globalVars[a]);return b};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=
+this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var v=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;null!=this.themes&&"darkTheme"==this.defaultThemeName&&(a=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var b=v.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return b};var t=Graph.prototype.isCssTransformsSupported;
+Graph.prototype.isCssTransformsSupported=function(){return t.apply(this,arguments)&&!mxClient.IS_SF};var z=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){z.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||
this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",a.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,a.ownerSVGElement))}};
-var z=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){z.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++){var c=a.actions[b];if(null!=c.open)if(this.isCustomLink(c.open)){if(!this.customLinkClicked(c.open))return}else this.openLink(c.open)}this.model.beginUpdate();try{for(b=0;b<a.actions.length;b++)c=
-a.actions[b],null!=c.toggle&&this.toggleCells(this.getCellsForAction(c.toggle,!0)),null!=c.show&&this.setCellsVisible(this.getCellsForAction(c.show,!0),!0),null!=c.hide&&this.setCellsVisible(this.getCellsForAction(c.hide,!0),!1)}finally{this.model.endUpdate()}for(b=0;b<a.actions.length;b++){var c=a.actions[b],g=[];null!=c.select&&this.isEnabled()&&(g=this.getCellsForAction(c.select),this.setSelectionCells(g));null!=c.highlight&&(g=this.getCellsForAction(c.highlight),this.highlightCells(g,c.highlight.color,
-c.highlight.duration,c.highlight.opacity));null!=c.scroll&&(g=this.getCellsForAction(c.scroll));0<g.length&&this.scrollCellToVisible(g[0])}}};Graph.prototype.updateCustomLinksForCell=function(a,b){var c=this.getLinkForCell(b);null!=c&&"data:action/json,"==c.substring(0,17)&&this.setLinkForCell(b,this.updateCustomLink(a,c));if(this.isHtmlLabel(b)){var g=document.createElement("div");g.innerHTML=this.getLabel(b);for(var k=g.getElementsByTagName("a"),d=!1,q=0;q<k.length;q++)c=k[q].getAttribute("href"),
-null!=c&&"data:action/json,"==c.substring(0,17)&&(k[q].setAttribute("href",this.updateCustomLink(a,c)),d=!0);d&&this.labelChanged(b,g.innerHTML)}};Graph.prototype.updateCustomLink=function(a,b){if("data:action/json,"==b.substring(0,17))try{var c=JSON.parse(b.substring(17));null!=c.actions&&(this.updateCustomLinkActions(a,c.actions),b="data:action/json,"+JSON.stringify(c))}catch(I){}return b};Graph.prototype.updateCustomLinkActions=function(a,b){for(var c=0;c<b.length;c++){var g=b[c];this.updateCustomLinkAction(a,
-g.toggle);this.updateCustomLinkAction(a,g.show);this.updateCustomLinkAction(a,g.hide);this.updateCustomLinkAction(a,g.select);this.updateCustomLinkAction(a,g.highlight);this.updateCustomLinkAction(a,g.scroll)}};Graph.prototype.updateCustomLinkAction=function(a,b){if(null!=b&&null!=b.cells){for(var c=[],g=0;g<b.cells.length;g++)if("*"==b.cells[g])c.push(b.cells[g]);else{var k=a[b.cells[g]];null!=k?""!=k&&c.push(k):c.push(b.cells[g])}b.cells=c}};Graph.prototype.getCellsForAction=function(a,b){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags,
-null,null,b))};Graph.prototype.getCellsById=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++)if("*"==a[c])var g=this.getDefaultParent(),b=b.concat(this.model.filterDescendants(function(a){return a!=g},g));else{var k=this.model.getCell(a[c]);null!=k&&b.push(k)}return b};Graph.prototype.getCellsForTags=function(a,b,c,g){var k=[];if(null!=a){b=null!=b?b:this.model.getDescendants(this.model.getRoot());c=null!=c?c:"tags";for(var d=0,q={},f=0;f<a.length;f++)0<a[f].length&&(q[a[f].toLowerCase()]=
-!0,d++);for(f=0;f<b.length;f++)if(g&&this.model.getParent(b[f])==this.model.root||this.model.isVertex(b[f])||this.model.isEdge(b[f])){var l=null!=b[f].value&&"object"==typeof b[f].value?mxUtils.trim(b[f].value.getAttribute(c)||""):"",t=!1;if(0<l.length){if(l=l.toLowerCase().split(" "),l.length>=a.length){for(var m=t=0;m<l.length&&t<d;m++)null!=q[l[m]]&&t++;t=t==d}}else t=0==a.length;t&&k.push(b[f])}}return k};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,g){for(var k=0;k<a.length;k++)this.highlightCell(a[k],b,c,g)};Graph.prototype.highlightCell=function(a,b,c,g){b=null!=b?b:mxConstants.DEFAULT_VALID_COLOR;c=null!=c?c:1E3;a=this.view.getState(a);if(null!=a){var k=Math.max(5,mxUtils.getValue(a.style,
-mxConstants.STYLE_STROKEWIDTH,1)+4),d=new mxCellHighlight(this,b,k,!1);null!=g&&(d.opacity=g);d.highlight(a);window.setTimeout(function(){null!=d.shape&&(mxUtils.setPrefixedStyle(d.shape.node.style,"transition","all 1200ms ease-in-out"),d.shape.node.style.opacity=0);window.setTimeout(function(){d.destroy()},1200)},c)}};Graph.prototype.addSvgShadow=function(a,b,c){c=null!=c?c:!1;var g=a.ownerDocument,k=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"filter"):g.createElement("filter");
-k.setAttribute("id",this.shadowId);var d=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):g.createElement("feGaussianBlur");d.setAttribute("in","SourceAlpha");d.setAttribute("stdDeviation",this.svgShadowBlur);d.setAttribute("result","blur");k.appendChild(d);d=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feOffset"):g.createElement("feOffset");d.setAttribute("in","blur");d.setAttribute("dx",this.svgShadowSize);d.setAttribute("dy",this.svgShadowSize);d.setAttribute("result",
-"offsetBlur");k.appendChild(d);d=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feFlood"):g.createElement("feFlood");d.setAttribute("flood-color",this.svgShadowColor);d.setAttribute("flood-opacity",this.svgShadowOpacity);d.setAttribute("result","offsetColor");k.appendChild(d);d=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feComposite"):g.createElement("feComposite");d.setAttribute("in","offsetColor");d.setAttribute("in2","offsetBlur");d.setAttribute("operator","in");
-d.setAttribute("result","offsetBlur");k.appendChild(d);d=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feBlend"):g.createElement("feBlend");d.setAttribute("in","SourceGraphic");d.setAttribute("in2","offsetBlur");k.appendChild(d);d=a.getElementsByTagName("defs");0==d.length?(g=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"defs"):g.createElement("defs"),null!=a.firstChild?a.insertBefore(g,a.firstChild):a.appendChild(g)):g=d[0];g.appendChild(k);c||(b=null!=b?b:a.getElementsByTagName("g")[0],
-null!=b&&(b.setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6),b=a.getAttribute("viewBox"),null!=b&&0<b.length&&(b=b.split(" "),3<b.length&&(w=parseFloat(b[2])+6,h=parseFloat(b[3])+6,a.setAttribute("viewBox",b[0]+" "+b[1]+" "+w+" "+h))))));return k};Graph.prototype.setShadowVisible=function(a,b){mxClient.IS_SVG&&(b=null!=b?b:!0,(this.shadowVisible=
+var y=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){y.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++){var c=a.actions[b];if(null!=c.open)if(this.isCustomLink(c.open)){if(!this.customLinkClicked(c.open))return}else this.openLink(c.open)}this.model.beginUpdate();try{for(b=0;b<a.actions.length;b++)c=
+a.actions[b],null!=c.toggle&&this.toggleCells(this.getCellsForAction(c.toggle,!0)),null!=c.show&&this.setCellsVisible(this.getCellsForAction(c.show,!0),!0),null!=c.hide&&this.setCellsVisible(this.getCellsForAction(c.hide,!0),!1)}finally{this.model.endUpdate()}for(b=0;b<a.actions.length;b++){var c=a.actions[b],f=[];null!=c.select&&this.isEnabled()&&(f=this.getCellsForAction(c.select),this.setSelectionCells(f));null!=c.highlight&&(f=this.getCellsForAction(c.highlight),this.highlightCells(f,c.highlight.color,
+c.highlight.duration,c.highlight.opacity));null!=c.scroll&&(f=this.getCellsForAction(c.scroll));0<f.length&&this.scrollCellToVisible(f[0])}}};Graph.prototype.updateCustomLinksForCell=function(a,b){var c=this.getLinkForCell(b);null!=c&&"data:action/json,"==c.substring(0,17)&&this.setLinkForCell(b,this.updateCustomLink(a,c));if(this.isHtmlLabel(b)){var f=document.createElement("div");f.innerHTML=this.getLabel(b);for(var l=f.getElementsByTagName("a"),d=!1,p=0;p<l.length;p++)c=l[p].getAttribute("href"),
+null!=c&&"data:action/json,"==c.substring(0,17)&&(l[p].setAttribute("href",this.updateCustomLink(a,c)),d=!0);d&&this.labelChanged(b,f.innerHTML)}};Graph.prototype.updateCustomLink=function(a,b){if("data:action/json,"==b.substring(0,17))try{var c=JSON.parse(b.substring(17));null!=c.actions&&(this.updateCustomLinkActions(a,c.actions),b="data:action/json,"+JSON.stringify(c))}catch(H){}return b};Graph.prototype.updateCustomLinkActions=function(a,b){for(var c=0;c<b.length;c++){var f=b[c];this.updateCustomLinkAction(a,
+f.toggle);this.updateCustomLinkAction(a,f.show);this.updateCustomLinkAction(a,f.hide);this.updateCustomLinkAction(a,f.select);this.updateCustomLinkAction(a,f.highlight);this.updateCustomLinkAction(a,f.scroll)}};Graph.prototype.updateCustomLinkAction=function(a,b){if(null!=b&&null!=b.cells){for(var c=[],f=0;f<b.cells.length;f++)if("*"==b.cells[f])c.push(b.cells[f]);else{var l=a[b.cells[f]];null!=l?""!=l&&c.push(l):c.push(b.cells[f])}b.cells=c}};Graph.prototype.getCellsForAction=function(a,b){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags,
+null,null,b))};Graph.prototype.getCellsById=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++)if("*"==a[c])var f=this.getDefaultParent(),b=b.concat(this.model.filterDescendants(function(a){return a!=f},f));else{var l=this.model.getCell(a[c]);null!=l&&b.push(l)}return b};Graph.prototype.getCellsForTags=function(a,b,c,f){var l=[];if(null!=a){b=null!=b?b:this.model.getDescendants(this.model.getRoot());c=null!=c?c:"tags";for(var d=0,p={},e=0;e<a.length;e++)0<a[e].length&&(p[a[e].toLowerCase()]=
+!0,d++);for(e=0;e<b.length;e++)if(f&&this.model.getParent(b[e])==this.model.root||this.model.isVertex(b[e])||this.model.isEdge(b[e])){var k=null!=b[e].value&&"object"==typeof b[e].value?mxUtils.trim(b[e].value.getAttribute(c)||""):"",g=!1;if(0<k.length){if(k=k.toLowerCase().split(" "),k.length>=a.length){for(var t=g=0;t<k.length&&g<d;t++)null!=p[k[t]]&&g++;g=g==d}}else g=0==a.length;g&&l.push(b[e])}}return l};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,f){for(var l=0;l<a.length;l++)this.highlightCell(a[l],b,c,f)};Graph.prototype.highlightCell=function(a,b,c,f){b=null!=b?b:mxConstants.DEFAULT_VALID_COLOR;c=null!=c?c:1E3;a=this.view.getState(a);if(null!=a){var l=Math.max(5,mxUtils.getValue(a.style,
+mxConstants.STYLE_STROKEWIDTH,1)+4),d=new mxCellHighlight(this,b,l,!1);null!=f&&(d.opacity=f);d.highlight(a);window.setTimeout(function(){null!=d.shape&&(mxUtils.setPrefixedStyle(d.shape.node.style,"transition","all 1200ms ease-in-out"),d.shape.node.style.opacity=0);window.setTimeout(function(){d.destroy()},1200)},c)}};Graph.prototype.addSvgShadow=function(a,b,c){c=null!=c?c:!1;var f=a.ownerDocument,l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");
+l.setAttribute("id",this.shadowId);var d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");d.setAttribute("in","SourceAlpha");d.setAttribute("stdDeviation",this.svgShadowBlur);d.setAttribute("result","blur");l.appendChild(d);d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");d.setAttribute("in","blur");d.setAttribute("dx",this.svgShadowSize);d.setAttribute("dy",this.svgShadowSize);d.setAttribute("result",
+"offsetBlur");l.appendChild(d);d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");d.setAttribute("flood-color",this.svgShadowColor);d.setAttribute("flood-opacity",this.svgShadowOpacity);d.setAttribute("result","offsetColor");l.appendChild(d);d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):f.createElement("feComposite");d.setAttribute("in","offsetColor");d.setAttribute("in2","offsetBlur");d.setAttribute("operator","in");
+d.setAttribute("result","offsetBlur");l.appendChild(d);d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");d.setAttribute("in","SourceGraphic");d.setAttribute("in2","offsetBlur");l.appendChild(d);d=a.getElementsByTagName("defs");0==d.length?(f=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"defs"):f.createElement("defs"),null!=a.firstChild?a.insertBefore(f,a.firstChild):a.appendChild(f)):f=d[0];f.appendChild(l);c||(b=null!=b?b:a.getElementsByTagName("g")[0],
+null!=b&&(b.setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6),b=a.getAttribute("viewBox"),null!=b&&0<b.length&&(b=b.split(" "),3<b.length&&(w=parseFloat(b[2])+6,h=parseFloat(b[3])+6,a.setAttribute("viewBox",b[0]+" "+b[1]+" "+w+" "+h))))));return l};Graph.prototype.setShadowVisible=function(a,b){mxClient.IS_SVG&&(b=null!=b?b:!0,(this.shadowVisible=
a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),b&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var a=this.model.getChildCount(this.model.root),b,c=0;do b=this.model.getChildAt(this.model.root,c);while(c++<a&&"1"==mxUtils.getValue(this.getCellStyle(b),"locked","0"));null!=b&&this.setDefaultParent(b)}};mxStencilRegistry.libraries.mockup=
[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",STENCIL_PATH+"/bpmn.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+
"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+
@@ -8279,429 +8288,430 @@ a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this
[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.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.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.aws4=
[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.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 b=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?b="mxgraph.er":"sysML"==a.substring(0,5)&&(b="mxgraph.sysml"));return b};var D=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,g,k,d,q,f,t,l){if(null!=c&&null==mxMarker.markers[c]){var m=this.getPackageForType(c);null!=m&&mxStencilRegistry.getStencil(m)}return D.apply(this,arguments)};PrintDialog.prototype.create=
-function(a,b){function c(){p.value=Math.max(1,Math.min(f,Math.max(parseInt(p.value),parseInt(x.value))));x.value=Math.max(1,Math.min(f,Math.min(parseInt(p.value),parseInt(x.value))))}function g(b){function c(b,c,d){var q=b.getGraphBounds(),f=0,l=0,t=ka.get(),m=1/b.pageScale,v=A.checked;if(v)var m=parseInt(T.value),x=parseInt(V.value),m=Math.min(t.height*x/(q.height/b.view.scale),t.width*m/(q.width/b.view.scale));else m=parseInt(y.value)/(100*b.pageScale),isNaN(m)&&(g=1/b.pageScale,y.value="100 %");
-t=mxRectangle.fromRectangle(t);t.width=Math.ceil(t.width*g);t.height=Math.ceil(t.height*g);m*=g;!v&&b.pageVisible?(q=b.getPageLayout(),f-=q.x*t.width,l-=q.y*t.height):v=!0;if(null==c){c=PrintDialog.createPrintPreview(b,m,t,0,f,l,v);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var C=c.writeHead;c.writeHead=function(b){C.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==
-typeof MathJax){var p=c.renderPage;c.renderPage=function(a,b,c,g,k,d){var q=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var f=p.apply(this,arguments);mxClient.NO_FO=q;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:f.className="geDisableMathJax";return f}}b=null;null!=k.themes&&"darkTheme"==k.defaultThemeName&&(b=k.stylesheet,k.stylesheet=k.getDefaultStylesheet(),k.refresh());c.open(null,null,d,!0);null!=b&&(k.stylesheet=
-b,k.refresh())}else{t=b.background;if(null==t||""==t||t==mxConstants.NONE)t="#ffffff";c.backgroundColor=t;c.autoOrigin=v;c.appendGraph(b,m,f,l,d,!0)}return c}var g=parseInt(la.value)/100;isNaN(g)&&(g=1,la.value="100 %");var g=.75*g,d=x.value,q=p.value,f=!m.checked,l=null;f&&(f=d==t&&q==t);if(!f&&null!=a.pages&&a.pages.length){var v=0,f=a.pages.length-1;m.checked||(v=parseInt(d)-1,f=parseInt(q)-1);for(var C=v;C<=f;C++){var n=a.pages[C],d=n==a.currentPage?k:null;if(null==d){var d=a.createTemporaryGraph(k.getStylesheet()),
-q=!0,v=!1,z=null,B=null;null==n.viewState&&null==n.root&&a.updatePageRoot(n);null!=n.viewState&&(q=n.viewState.pageVisible,v=n.viewState.mathEnabled,z=n.viewState.background,B=n.viewState.backgroundImage);d.background=z;d.backgroundImage=null!=B?new mxImage(B.src,B.width,B.height):null;d.pageVisible=q;d.mathEnabled=v;var u=d.getGlobalVariable;d.getGlobalVariable=function(b){return"page"==b?n.getName():"pagenumber"==b?C+1:"pagecount"==b?null!=a.pages?a.pages.length:1:u.apply(this,arguments)};document.body.appendChild(d.container);
-a.updatePageRoot(n);d.model.setRoot(n.root)}l=c(d,l,C!=f);d!=k&&d.container.parentNode.removeChild(d.container)}}else l=c(k);null==l?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(l.mathEnabled&&(f=l.wnd.document,f.writeln('<script type="text/x-mathjax-config">'),f.writeln("MathJax.Hub.Config({"),f.writeln("showMathMenu: false,"),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("});"),b&&(f.writeln("MathJax.Hub.Queue(function () {"),f.writeln("window.print();"),f.writeln("});")),f.writeln("\x3c/script>"),
-f.writeln('<script type="text/javascript" src="'+DRAW_MATH_URL+'/MathJax.js">\x3c/script>')),l.closeDocument(),!l.mathEnabled&&b&&PrintDialog.printPreview(l))}var k=a.editor.graph,d=document.createElement("div"),q=document.createElement("h3");q.style.width="100%";q.style.textAlign="center";q.style.marginTop="0px";mxUtils.write(q,b||mxResources.get("print"));d.appendChild(q);var f=1,t=1,l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";
-var m=document.createElement("input");m.style.cssText="margin-right:8px;margin-bottom:8px;";m.setAttribute("value","all");m.setAttribute("type","radio");m.setAttribute("name","pages-printdialog");l.appendChild(m);q=document.createElement("span");mxUtils.write(q,mxResources.get("printAllPages"));l.appendChild(q);mxUtils.br(l);var v=m.cloneNode(!0);m.setAttribute("checked","checked");v.setAttribute("value","range");l.appendChild(v);q=document.createElement("span");mxUtils.write(q,mxResources.get("pages")+
-":");l.appendChild(q);var x=document.createElement("input");x.style.cssText="margin:0 8px 0 8px;";x.setAttribute("value","1");x.setAttribute("type","number");x.setAttribute("min","1");x.style.width="50px";l.appendChild(x);q=document.createElement("span");mxUtils.write(q,mxResources.get("to"));l.appendChild(q);var p=x.cloneNode(!0);l.appendChild(p);mxEvent.addListener(x,"focus",function(){v.checked=!0});mxEvent.addListener(p,"focus",function(){v.checked=!0});mxEvent.addListener(x,"change",c);mxEvent.addListener(p,
-"change",c);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(q=0;q<a.pages.length;q++)if(a.currentPage==a.pages[q]){t=q+1;x.value=t;p.value=t;break}x.setAttribute("max",f);p.setAttribute("max",f);1<f&&d.appendChild(l);var C=document.createElement("div");C.style.marginBottom="10px";var n=document.createElement("input");n.style.marginRight="8px";n.setAttribute("value","adjust");n.setAttribute("type","radio");n.setAttribute("name","printZoom");C.appendChild(n);q=document.createElement("span");
-mxUtils.write(q,mxResources.get("adjustTo"));C.appendChild(q);var y=document.createElement("input");y.style.cssText="margin:0 8px 0 8px;";y.setAttribute("value","100 %");y.style.width="50px";C.appendChild(y);mxEvent.addListener(y,"focus",function(){n.checked=!0});d.appendChild(C);var l=l.cloneNode(!1),A=n.cloneNode(!0);A.setAttribute("value","fit");n.setAttribute("checked","checked");q=document.createElement("div");q.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";
-q.appendChild(A);l.appendChild(q);C=document.createElement("table");C.style.display="inline-block";var B=document.createElement("tbody"),z=document.createElement("tr"),u=z.cloneNode(!0),D=document.createElement("td"),G=D.cloneNode(!0),F=D.cloneNode(!0),Q=D.cloneNode(!0),O=D.cloneNode(!0),ea=D.cloneNode(!0);D.style.textAlign="right";Q.style.textAlign="right";mxUtils.write(D,mxResources.get("fitTo"));var T=document.createElement("input");T.style.cssText="margin:0 8px 0 8px;";T.setAttribute("value",
-"1");T.setAttribute("min","1");T.setAttribute("type","number");T.style.width="40px";G.appendChild(T);q=document.createElement("span");mxUtils.write(q,mxResources.get("fitToSheetsAcross"));F.appendChild(q);mxUtils.write(Q,mxResources.get("fitToBy"));var V=T.cloneNode(!0);O.appendChild(V);mxEvent.addListener(T,"focus",function(){A.checked=!0});mxEvent.addListener(V,"focus",function(){A.checked=!0});q=document.createElement("span");mxUtils.write(q,mxResources.get("fitToSheetsDown"));ea.appendChild(q);
-z.appendChild(D);z.appendChild(G);z.appendChild(F);u.appendChild(Q);u.appendChild(O);u.appendChild(ea);B.appendChild(z);B.appendChild(u);C.appendChild(B);l.appendChild(C);d.appendChild(l);l=document.createElement("div");q=document.createElement("div");q.style.fontWeight="bold";q.style.marginBottom="12px";mxUtils.write(q,mxResources.get("paperSize"));l.appendChild(q);q=document.createElement("div");q.style.marginBottom="12px";var ka=PageSetupDialog.addPageFormatPanel(q,"printdialog",a.editor.graph.pageFormat||
-mxConstants.PAGE_FORMAT_A4_PORTRAIT);l.appendChild(q);q=document.createElement("span");mxUtils.write(q,mxResources.get("pageScale"));l.appendChild(q);var la=document.createElement("input");la.style.cssText="margin:0 8px 0 8px;";la.setAttribute("value","100 %");la.style.width="60px";l.appendChild(la);d.appendChild(l);q=document.createElement("div");q.style.cssText="text-align:right;margin:48px 0 0 0;";l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst&&
-q.appendChild(l);a.isOffline()||(C=mxUtils.button(mxResources.get("help"),function(){k.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),C.className="geBtn",q.appendChild(C));PrintDialog.previewEnabled&&(C=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();g(!1)}),C.className="geBtn",q.appendChild(C));C=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();g(!0)});C.className="geBtn gePrimaryBtn";q.appendChild(C);
-a.editor.cancelFirst||q.appendChild(l);d.appendChild(q);this.container=d};var x=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)):(x.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))};Editor.prototype.useCanvasForExport=!1;try{var C=
-document.createElement("canvas"),G=new Image;G.onload=function(){try{C.getContext("2d").drawImage(G,0,0);var a=C.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(F){}};G.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(B){}})();
-(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,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="12.1.3";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";
-EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";Editor.cacheTimeout=1E4;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.logError=function(a,b,c,d,f){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,
-c,d,f);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var g=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",k=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";f=null!=f?f:Error(a);(new Image).src=k+"/log?severity="+g+"&v="+encodeURIComponent(EditorUi.VERSION)+
-"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=d?":colno:"+encodeURIComponent(d):"")+(null!=f&&null!=f.stack?"&stack="+encodeURIComponent(f.stack):"")}}catch(z){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=
-a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(q){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(q){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var a=
-[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);console.log.apply(console,a)}}catch(q){}};EditorUi.parsePng=function(a,b,c){function g(a,b){var c=d;d+=b;return a.substring(c,d)}function k(a){a=g(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var d=0;if(g(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(g(a,4),"IHDR"!=g(a,4))null!=c&&c();else{g(a,17);do{c=k(a);var q=g(a,4);if(null!=b&&
-b(d-8,q,c))break;value=g(a,c);g(a,4);if("IEND"==q)break}while(c)}};EditorUi.removeChildNodes=function(a){for(;null!=a.firstChild;)a.removeChild(a.firstChild)};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.sidebarFooterHeight=38;EditorUi.prototype.defaultCustomShapeStyle=
+mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var b=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?b="mxgraph.er":"sysML"==a.substring(0,5)&&(b="mxgraph.sysml"));return b};var C=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,f,l,d,p,e,k,g){if(null!=c&&null==mxMarker.markers[c]){var t=this.getPackageForType(c);null!=t&&mxStencilRegistry.getStencil(t)}return C.apply(this,arguments)};PrintDialog.prototype.create=
+function(a,b){function c(){n.value=Math.max(1,Math.min(e,Math.max(parseInt(n.value),parseInt(u.value))));u.value=Math.max(1,Math.min(e,Math.min(parseInt(n.value),parseInt(u.value))))}function f(b){function c(b,c,d){var p=b.getGraphBounds(),e=0,g=0,k=ja.get(),t=1/b.pageScale,u=z.checked;if(u)var t=parseInt(S.value),x=parseInt(U.value),t=Math.min(k.height*x/(p.height/b.view.scale),k.width*t/(p.width/b.view.scale));else t=parseInt(m.value)/(100*b.pageScale),isNaN(t)&&(f=1/b.pageScale,m.value="100 %");
+k=mxRectangle.fromRectangle(k);k.width=Math.ceil(k.width*f);k.height=Math.ceil(k.height*f);t*=f;!u&&b.pageVisible?(p=b.getPageLayout(),e-=p.x*k.width,g-=p.y*k.height):u=!0;if(null==c){c=PrintDialog.createPrintPreview(b,t,k,0,e,g,u);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var B=c.writeHead;c.writeHead=function(b){B.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==
+typeof MathJax){var n=c.renderPage;c.renderPage=function(a,b,c,f,l,d){var p=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=n.apply(this,arguments);mxClient.NO_FO=p;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:e.className="geDisableMathJax";return e}}b=null;null!=l.themes&&"darkTheme"==l.defaultThemeName&&(b=l.stylesheet,l.stylesheet=l.getDefaultStylesheet(),l.refresh());c.open(null,null,d,!0);null!=b&&(l.stylesheet=
+b,l.refresh())}else{k=b.background;if(null==k||""==k||k==mxConstants.NONE)k="#ffffff";c.backgroundColor=k;c.autoOrigin=u;c.appendGraph(b,t,e,g,d,!0)}return c}var f=parseInt(ka.value)/100;isNaN(f)&&(f=1,ka.value="100 %");var f=.75*f,d=u.value,p=n.value,e=!t.checked,g=null;e&&(e=d==k&&p==k);if(!e&&null!=a.pages&&a.pages.length){var x=0,e=a.pages.length-1;t.checked||(x=parseInt(d)-1,e=parseInt(p)-1);for(var B=x;B<=e;B++){var v=a.pages[B],d=v==a.currentPage?l:null;if(null==d){var d=a.createTemporaryGraph(l.getStylesheet()),
+p=!0,x=!1,A=null,y=null;null==v.viewState&&null==v.root&&a.updatePageRoot(v);null!=v.viewState&&(p=v.viewState.pageVisible,x=v.viewState.mathEnabled,A=v.viewState.background,y=v.viewState.backgroundImage);d.background=A;d.backgroundImage=null!=y?new mxImage(y.src,y.width,y.height):null;d.pageVisible=p;d.mathEnabled=x;var q=d.getGlobalVariable;d.getGlobalVariable=function(b){return"page"==b?v.getName():"pagenumber"==b?B+1:"pagecount"==b?null!=a.pages?a.pages.length:1:q.apply(this,arguments)};document.body.appendChild(d.container);
+a.updatePageRoot(v);d.model.setRoot(v.root)}g=c(d,g,B!=e);d!=l&&d.container.parentNode.removeChild(d.container)}}else g=c(l);null==g?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(g.mathEnabled&&(e=g.wnd.document,e.writeln('<script type="text/x-mathjax-config">'),e.writeln("MathJax.Hub.Config({"),e.writeln("showMathMenu: false,"),e.writeln('messageStyle: "none",'),e.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),e.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
+e.writeln('"HTML-CSS": {'),e.writeln("imageFont: null"),e.writeln("},"),e.writeln("TeX: {"),e.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),e.writeln("},"),e.writeln("tex2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("},"),e.writeln("asciimath2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("}"),e.writeln("});"),b&&(e.writeln("MathJax.Hub.Queue(function () {"),e.writeln("window.print();"),e.writeln("});")),e.writeln("\x3c/script>"),
+e.writeln('<script type="text/javascript" src="'+DRAW_MATH_URL+'/MathJax.js">\x3c/script>')),g.closeDocument(),!g.mathEnabled&&b&&PrintDialog.printPreview(g))}var l=a.editor.graph,d=document.createElement("div"),p=document.createElement("h3");p.style.width="100%";p.style.textAlign="center";p.style.marginTop="0px";mxUtils.write(p,b||mxResources.get("print"));d.appendChild(p);var e=1,k=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);p=document.createElement("span");mxUtils.write(p,mxResources.get("printAllPages"));g.appendChild(p);mxUtils.br(g);var x=t.cloneNode(!0);t.setAttribute("checked","checked");x.setAttribute("value","range");g.appendChild(x);p=document.createElement("span");mxUtils.write(p,mxResources.get("pages")+
+":");g.appendChild(p);var u=document.createElement("input");u.style.cssText="margin:0 8px 0 8px;";u.setAttribute("value","1");u.setAttribute("type","number");u.setAttribute("min","1");u.style.width="50px";g.appendChild(u);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));g.appendChild(p);var n=u.cloneNode(!0);g.appendChild(n);mxEvent.addListener(u,"focus",function(){x.checked=!0});mxEvent.addListener(n,"focus",function(){x.checked=!0});mxEvent.addListener(u,"change",c);mxEvent.addListener(n,
+"change",c);if(null!=a.pages&&(e=a.pages.length,null!=a.currentPage))for(p=0;p<a.pages.length;p++)if(a.currentPage==a.pages[p]){k=p+1;u.value=k;n.value=k;break}u.setAttribute("max",e);n.setAttribute("max",e);1<e&&d.appendChild(g);var B=document.createElement("div");B.style.marginBottom="10px";var v=document.createElement("input");v.style.marginRight="8px";v.setAttribute("value","adjust");v.setAttribute("type","radio");v.setAttribute("name","printZoom");B.appendChild(v);p=document.createElement("span");
+mxUtils.write(p,mxResources.get("adjustTo"));B.appendChild(p);var m=document.createElement("input");m.style.cssText="margin:0 8px 0 8px;";m.setAttribute("value","100 %");m.style.width="50px";B.appendChild(m);mxEvent.addListener(m,"focus",function(){v.checked=!0});d.appendChild(B);var g=g.cloneNode(!1),z=v.cloneNode(!0);z.setAttribute("value","fit");v.setAttribute("checked","checked");p=document.createElement("div");p.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";
+p.appendChild(z);g.appendChild(p);B=document.createElement("table");B.style.display="inline-block";var y=document.createElement("tbody"),A=document.createElement("tr"),q=A.cloneNode(!0),C=document.createElement("td"),E=C.cloneNode(!0),F=C.cloneNode(!0),P=C.cloneNode(!0),M=C.cloneNode(!0),da=C.cloneNode(!0);C.style.textAlign="right";P.style.textAlign="right";mxUtils.write(C,mxResources.get("fitTo"));var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value",
+"1");S.setAttribute("min","1");S.setAttribute("type","number");S.style.width="40px";E.appendChild(S);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));F.appendChild(p);mxUtils.write(P,mxResources.get("fitToBy"));var U=S.cloneNode(!0);M.appendChild(U);mxEvent.addListener(S,"focus",function(){z.checked=!0});mxEvent.addListener(U,"focus",function(){z.checked=!0});p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));da.appendChild(p);
+A.appendChild(C);A.appendChild(E);A.appendChild(F);q.appendChild(P);q.appendChild(M);q.appendChild(da);y.appendChild(A);y.appendChild(q);B.appendChild(y);g.appendChild(B);d.appendChild(g);g=document.createElement("div");p=document.createElement("div");p.style.fontWeight="bold";p.style.marginBottom="12px";mxUtils.write(p,mxResources.get("paperSize"));g.appendChild(p);p=document.createElement("div");p.style.marginBottom="12px";var ja=PageSetupDialog.addPageFormatPanel(p,"printdialog",a.editor.graph.pageFormat||
+mxConstants.PAGE_FORMAT_A4_PORTRAIT);g.appendChild(p);p=document.createElement("span");mxUtils.write(p,mxResources.get("pageScale"));g.appendChild(p);var ka=document.createElement("input");ka.style.cssText="margin:0 8px 0 8px;";ka.setAttribute("value","100 %");ka.style.width="60px";g.appendChild(ka);d.appendChild(g);p=document.createElement("div");p.style.cssText="text-align:right;margin:48px 0 0 0;";g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&
+p.appendChild(g);a.isOffline()||(B=mxUtils.button(mxResources.get("help"),function(){l.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),B.className="geBtn",p.appendChild(B));PrintDialog.previewEnabled&&(B=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),B.className="geBtn",p.appendChild(B));B=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});B.className="geBtn gePrimaryBtn";p.appendChild(B);
+a.editor.cancelFirst||p.appendChild(g);d.appendChild(p);this.container=d};var x=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)):(x.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))};Editor.prototype.useCanvasForExport=!1;try{var B=
+document.createElement("canvas"),E=new Image;E.onload=function(){try{B.getContext("2d").drawImage(E,0,0);var a=B.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(F){}};E.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(A){}})();
+(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,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="12.1.4";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";
+EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";Editor.cacheTimeout=1E4;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.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,
+c,d,e);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",l=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e=null!=e?e:Error(a);(new Image).src=l+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+
+"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=d?":colno:"+encodeURIComponent(d):"")+(null!=e&&null!=e.stack?"&stack="+encodeURIComponent(e.stack):"")}}catch(y){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=
+a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(p){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(p){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var a=
+[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);console.log.apply(console,a)}}catch(p){}};EditorUi.parsePng=function(a,b,c){function f(a,b){var c=d;d+=b;return a.substring(c,d)}function l(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var d=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(a,4),"IHDR"!=f(a,4))null!=c&&c();else{f(a,17);do{c=l(a);var p=f(a,4);if(null!=b&&
+b(d-8,p,c))break;value=f(a,c);f(a,4);if("IEND"==p)break}while(c)}};EditorUi.removeChildNodes=function(a){for(;null!=a.firstChild;)a.removeChild(a.firstChild)};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.sidebarFooterHeight=38;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.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=
-!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(y){}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=null!=a&&6<a.length}catch(t){}};c.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(y){}try{b=
-document.createElement("canvas");b.width=b.height=1;var d=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==d.match("image/jpeg")}catch(y){}})();EditorUi.prototype.openLink=function(a,b,c){return this.editor.graph.openLink(a,b,c)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);null!=c&&c()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);
+!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(v){}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=null!=a&&6<a.length}catch(t){}};c.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(v){}try{b=
+document.createElement("canvas");b.width=b.height=1;var d=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==d.match("image/jpeg")}catch(v){}})();EditorUi.prototype.openLink=function(a,b,c){return this.editor.graph.openLink(a,b,c)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);null!=c&&c()};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(a){return this.isOfflineApp()||
-!navigator.onLine||!a&&"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=c?c:24;var g=new Spinner({lines:12,length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),k=g.spin;g.spin=function(c,d){var q=!1;this.active||(k.call(this,c),this.active=!0,null!=d&&(q=document.createElement("div"),q.style.position="absolute",q.style.whiteSpace="nowrap",q.style.background="#4B4243",
-q.style.color="white",q.style.fontFamily="Helvetica, Arial",q.style.fontSize="9pt",q.style.padding="6px",q.style.paddingLeft="10px",q.style.paddingRight="10px",q.style.zIndex=2E9,q.style.left=Math.max(0,a)+"px",q.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(q.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(q.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(q.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=d.substring(d.length-3,d.length)&&"!"!=
-d.charAt(d.length-1)&&(d+="..."),q.innerHTML=d,c.appendChild(q),g.status=q,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(q.style.left=Math.round(Math.max(0,a-q.offsetWidth/2))+"px",q.style.top=Math.round(Math.max(0,b+70-q.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,d)}));this.stop();return a}),q=!0);return q};var d=g.stop;g.stop=function(){d.call(this);this.active=!1;null!=
-g.status&&(g.status.parentNode.removeChild(g.status),g.status=null)};g.pause=function(){return function(){}};return g};EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(v){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&&
+!navigator.onLine||!a&&"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=c?c:24;var f=new Spinner({lines:12,length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),l=f.spin;f.spin=function(c,d){var p=!1;this.active||(l.call(this,c),this.active=!0,null!=d&&(p=document.createElement("div"),p.style.position="absolute",p.style.whiteSpace="nowrap",p.style.background="#4B4243",
+p.style.color="white",p.style.fontFamily="Helvetica, Arial",p.style.fontSize="9pt",p.style.padding="6px",p.style.paddingLeft="10px",p.style.paddingRight="10px",p.style.zIndex=2E9,p.style.left=Math.max(0,a)+"px",p.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(p.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(p.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=d.substring(d.length-3,d.length)&&"!"!=
+d.charAt(d.length-1)&&(d+="..."),p.innerHTML=d,c.appendChild(p),f.status=p,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(p.style.left=Math.round(Math.max(0,a-p.offsetWidth/2))+"px",p.style.top=Math.round(Math.max(0,b+70-p.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,d)}));this.stop();return a}),p=!0);return p};var d=f.stop;f.stop=function(){d.call(this);this.active=!1;null!=
+f.status&&(f.status.parentNode.removeChild(f.status),f.status=null)};f.pause=function(){return function(){}};return f};EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(u){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&&
177==a.charCodeAt(5)&&26==a.charCodeAt(6)&&225==a.charCodeAt(7)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&4==a.charCodeAt(3)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&6==a.charCodeAt(3)};EditorUi.prototype.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};var a=EditorUi.prototype.extractGraphModelFromHtml;
-EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var g=b.indexOf("&lt;mxfile ");if(0<=g){var d=b.lastIndexOf("&lt;/mxfile&gt;");d>g&&(c=b.substring(g,d+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(b),l=this.editor.extractGraphModel(f.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=l?mxUtils.getXml(l):""}catch(A){}return c};EditorUi.prototype.validateFileData=
-function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,g=a.getElementsByTagName("diagram");
-if("0"!=urlParams.pages||1<g.length||1==g.length&&g[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var d=g.length-1;0<=d;d--){var f=this.updatePageRoot(new DiagramPage(g[d]));null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[d+1]));b.model.execute(new ChangePage(this,f,0==d?f: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])),b.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!=c)for(d=0;d<c.length;d++)b.model.execute(new ChangePage(this,c[d],null))}finally{b.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,d,f,l,m,p,n,x,C){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;n=null!=n?n:!0;var g,k=null;null==
-c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?g="_blank":k=g=d;if(null==a)return"";var q=a;if("mxfile"!=q.nodeName.toLowerCase()){if(C){var t=a.ownerDocument.createElement("diagram");t.setAttribute("id",Editor.guid());t.appendChild(a)}else{t=Graph.zapGremlins(mxUtils.getXml(a));q=Graph.compress(t);if(Graph.decompress(q)!=t)return t;t=a.ownerDocument.createElement("diagram");t.setAttribute("id",Editor.guid());mxUtils.setTextContent(t,q)}q=a.ownerDocument.createElement("mxfile");q.appendChild(t)}x?
-(q=q.cloneNode(!0),q.removeAttribute("modified"),q.removeAttribute("host"),q.removeAttribute("agent"),q.removeAttribute("etag"),q.removeAttribute("userAgent"),q.removeAttribute("version"),q.removeAttribute("editor"),q.removeAttribute("type")):(q.removeAttribute("userAgent"),q.removeAttribute("version"),q.removeAttribute("editor"),q.removeAttribute("pages"),q.removeAttribute("type"),mxClient.IS_CHROMEAPP?q.setAttribute("host","Chrome"):EditorUi.isElectronApp?q.setAttribute("host","Electron"):q.setAttribute("host",
-window.location.hostname),q.setAttribute("modified",(new Date).toISOString()),q.setAttribute("agent",navigator.userAgent),q.setAttribute("version",EditorUi.VERSION),q.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&q.setAttribute("type",a),null!=this.pages&&q.setAttribute("pages",this.pages.length));C=C?mxUtils.getPrettyXml(q):mxUtils.getXml(q);if(!l&&!f&&(m||null!=c&&/(\.html)$/i.test(c.getTitle())))C=this.getHtml2(mxUtils.getXml(q),b,null!=c?c.getTitle():null,g,k);else if(l||
-!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),C=this.getEmbeddedSvg(C,b,d,null,p,n,k);return C};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var g=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(c?(EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(g)):(g=Graph.compressNode(g),mxUtils.setTextContent(this.currentPage.node,
-g)),g=this.fileNode.cloneNode(!1),b)g.appendChild(this.currentPage.node);else for(b=0;b<this.pages.length;b++)this.currentPage!=this.pages[b]&&(this.pages[b].needsUpdate?(a=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[b].root)),this.editor.graph.saveViewState(this.pages[b].viewState,a),c?(EditorUi.removeChildNodes(this.pages[b].node),this.pages[b].node.appendChild(a)):mxUtils.setTextContent(this.pages[b].node,Graph.compressNode(a)),delete this.pages[b].needsUpdate):
-c&&(a=Editor.parseDiagramNode(this.pages[b].node),EditorUi.removeChildNodes(this.pages[b].node),this.pages[b].node.appendChild(a))),g.appendChild(this.pages[b].node);return g};EditorUi.prototype.anonymizeString=function(a,b){for(var c=[],g=0;g<a.length;g++){var k=a.charAt(g);0<=EditorUi.ignoredAnonymizedChars.indexOf(k)?c.push(k):isNaN(parseInt(k))?k.toLowerCase()!=k?c.push(String.fromCharCode(65+Math.round(25*Math.random()))):k.toUpperCase()!=k?c.push(String.fromCharCode(97+Math.round(25*Math.random()))):
-/\s/.test(k)?c.push(" "):c.push("?"):c.push(b?"0":Math.round(9*Math.random()))}return c.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var b=0;b<a[EditorUi.DIFF_INSERT].length;b++)try{var c=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][b].data).documentElement.cloneNode(!1);null!=c.getAttribute("name")&&c.setAttribute("name",this.anonymizeString(c.getAttribute("name")));a[EditorUi.DIFF_INSERT][b].data=mxUtils.getXml(c)}catch(t){a[EditorUi.DIFF_INSERT][b].data=
-t.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var g in a[EditorUi.DIFF_UPDATE]){var d=a[EditorUi.DIFF_UPDATE][g];null!=d.name&&(d.name=this.anonymizeString(d.name));null!=d.cells&&(b=mxUtils.bind(this,function(a){var b=d.cells[a];if(null!=b){for(var c in b)null!=b[c].value&&(b[c].value="["+b[c].value.length+"]"),null!=b[c].xmlValue&&(b[c].xmlValue="["+b[c].xmlValue.length+"]"),null!=b[c].style&&(b[c].style="["+b[c].style.length+"]"),0==Object.keys(b[c]).length&&delete b[c];0==Object.keys(b).length&&
-delete d.cells[a]}}),b(EditorUi.DIFF_INSERT),b(EditorUi.DIFF_UPDATE),0==Object.keys(d.cells).length&&delete d.cells);0==Object.keys(d).length&&delete a[EditorUi.DIFF_UPDATE][g]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var c=0;c<a.attributes.length;c++)"as"!=a.attributes[c].name&&a.setAttribute(a.attributes[c].name,this.anonymizeString(a.attributes[c].value,b));if(null!=a.childNodes)for(c=
-0;c<a.childNodes.length;c++)this.anonymizeAttributes(a.childNodes[c],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var c=a.getElementsByTagName("mxCell"),g=0;g<c.length;g++)null!=c[g].getAttribute("value")&&c[g].setAttribute("value","["+c[g].getAttribute("value").length+"]"),null!=c[g].getAttribute("xmlValue")&&c[g].setAttribute("xmlValue","["+c[g].getAttribute("xmlValue").length+"]"),null!=c[g].getAttribute("style")&&c[g].setAttribute("style","["+c[g].getAttribute("style").length+"]"),null!=
-c[g].parentNode&&"root"!=c[g].parentNode.nodeName&&null!=c[g].parentNode.parentNode&&(c[g].setAttribute("id",c[g].parentNode.getAttribute("id")),c[g].parentNode.parentNode.replaceChild(c[g],c[g].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var b=this.getCurrentFile();null!=b&&(b.savingFile?this.handleError({message:mxResources.get("busy")}):!a&&b.invalidChecksum?b.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(b.clearAutosave(),
-this.editor.setStatus(""),a?b.reloadFile(mxUtils.bind(this,function(){b.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){b.handleFileError(a,!0)})):b.synchronizeFile(mxUtils.bind(this,function(){b.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){b.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=function(a,b,c,d,f,l,m,p,n,x){f=null!=f?f:!0;l=null!=l?l:!1;var g=this.editor.graph;if(b||!a&&null!=n&&/(\.svg)$/i.test(n.getTitle()))if(x=
-!1,null!=this.pages&&this.currentPage!=this.pages[0]){var k=g.getGlobalVariable,g=this.createTemporaryGraph(g.getStylesheet()),q=this.pages[0];g.getGlobalVariable=function(a){return"page"==a?q.getName():"pagenumber"==a?1:k.apply(this,arguments)};document.body.appendChild(g.container);g.model.setRoot(q.root)}m=null!=m?m:this.getXmlFileData(f,l,x);n=null!=n?n:this.getCurrentFile();a=this.createFileData(m,g,n,window.location.href,a,b,c,d,f,p,x);g!=this.editor.graph&&g.container.parentNode.removeChild(g.container);
-return a};EditorUi.prototype.getHtml=function(a,b,c,d,f,l){l=null!=l?l:!0;var g=null,k=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var g=l?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),q=b.view.scale;l=Math.floor(g.x/q-b.view.translate.x);q=Math.floor(g.y/q-b.view.translate.y);g=b.background;null==f&&(b=this.getBasenames().join(";"),0<b.length&&(k=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",l);a.setAttribute("y0",q)}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!=d&&a.setAttribute("edit",d));null!=f&&(f=f.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";d=Graph.compress(a);Graph.decompress(d)!=a&&(d=encodeURIComponent(a));return(null==f?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=f?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+
-(null==f?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=f?'<meta http-equiv="refresh" content="0;URL=\''+f+"'\"/>\n":"")+"</head>\n<body"+(null==f&&null!=g&&g!=mxConstants.NONE?' style="background-color:'+g+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+"</div>\n</div>\n"+(null==f?'<script type="text/javascript" src="'+k+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+
-f+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,c,d,f){b=EditorUi.drawHost+"/js/viewer.min.js";null!=f&&(f=f.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==f?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
-"")+"<!DOCTYPE html>\n<html"+(null!=f?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==f?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=f?'<meta http-equiv="refresh" content="0;URL=\''+f+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==f?'<script type="text/javascript" src="'+
-b+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+f+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/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;a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=Editor.extractParserError(a,mxResources.get("invalidOrMissingFile"));if(b)throw Error(b);
-b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a&&"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<b.length||1==b.length&&b[0].hasAttribute("name"))){var c=null;this.fileNode=a;this.pages=[];for(a=0;a<b.length;a++){null==b[a].getAttribute("id")&&b[a].setAttribute("id",a);var g=new DiagramPage(b[a]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[a+1]));this.pages.push(g);null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]&&
-(c=g)}this.currentPage=null!=c?c:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};
+EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var f=b.indexOf("&lt;mxfile ");if(0<=f){var d=b.lastIndexOf("&lt;/mxfile&gt;");d>f&&(c=b.substring(f,d+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var e=mxUtils.parseXml(b),k=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=k?mxUtils.getXml(k):""}catch(z){}return c};EditorUi.prototype.validateFileData=
+function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,f=a.getElementsByTagName("diagram");
+if("0"!=urlParams.pages||1<f.length||1==f.length&&f[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var d=f.length-1;0<=d;d--){var e=this.updatePageRoot(new DiagramPage(f[d]));null==e.getName()&&e.setName(mxResources.get("pageWithNumber",[d+1]));b.model.execute(new ChangePage(this,e,0==d?e: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])),b.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!=c)for(d=0;d<c.length;d++)b.model.execute(new ChangePage(this,c[d],null))}finally{b.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,d,e,k,g,n,m,x,B){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;m=null!=m?m:!0;var f,l=null;null==
+c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?f="_blank":l=f=d;if(null==a)return"";var p=a;if("mxfile"!=p.nodeName.toLowerCase()){if(B){var t=a.ownerDocument.createElement("diagram");t.setAttribute("id",Editor.guid());t.appendChild(a)}else{t=Graph.zapGremlins(mxUtils.getXml(a));p=Graph.compress(t);if(Graph.decompress(p)!=t)return t;t=a.ownerDocument.createElement("diagram");t.setAttribute("id",Editor.guid());mxUtils.setTextContent(t,p)}p=a.ownerDocument.createElement("mxfile");p.appendChild(t)}x?
+(p=p.cloneNode(!0),p.removeAttribute("modified"),p.removeAttribute("host"),p.removeAttribute("agent"),p.removeAttribute("etag"),p.removeAttribute("userAgent"),p.removeAttribute("version"),p.removeAttribute("editor"),p.removeAttribute("type")):(p.removeAttribute("userAgent"),p.removeAttribute("version"),p.removeAttribute("editor"),p.removeAttribute("pages"),p.removeAttribute("type"),mxClient.IS_CHROMEAPP?p.setAttribute("host","Chrome"):EditorUi.isElectronApp?p.setAttribute("host","Electron"):p.setAttribute("host",
+window.location.hostname),p.setAttribute("modified",(new Date).toISOString()),p.setAttribute("agent",navigator.userAgent),p.setAttribute("version",EditorUi.VERSION),p.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&p.setAttribute("type",a),null!=this.pages&&p.setAttribute("pages",this.pages.length));B=B?mxUtils.getPrettyXml(p):mxUtils.getXml(p);if(!k&&!e&&(g||null!=c&&/(\.html)$/i.test(c.getTitle())))B=this.getHtml2(mxUtils.getXml(p),b,null!=c?c.getTitle():null,f,l);else if(k||
+!e&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),B=this.getEmbeddedSvg(B,b,d,null,n,m,l);return B};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var f=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(c?(EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(f)):(f=Graph.compressNode(f),mxUtils.setTextContent(this.currentPage.node,
+f)),f=this.fileNode.cloneNode(!1),b)f.appendChild(this.currentPage.node);else for(b=0;b<this.pages.length;b++)this.currentPage!=this.pages[b]&&(this.pages[b].needsUpdate?(a=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[b].root)),this.editor.graph.saveViewState(this.pages[b].viewState,a),c?(EditorUi.removeChildNodes(this.pages[b].node),this.pages[b].node.appendChild(a)):mxUtils.setTextContent(this.pages[b].node,Graph.compressNode(a)),delete this.pages[b].needsUpdate):
+c&&(a=Editor.parseDiagramNode(this.pages[b].node),EditorUi.removeChildNodes(this.pages[b].node),this.pages[b].node.appendChild(a))),f.appendChild(this.pages[b].node);return f};EditorUi.prototype.anonymizeString=function(a,b){for(var c=[],f=0;f<a.length;f++){var d=a.charAt(f);0<=EditorUi.ignoredAnonymizedChars.indexOf(d)?c.push(d):isNaN(parseInt(d))?d.toLowerCase()!=d?c.push(String.fromCharCode(65+Math.round(25*Math.random()))):d.toUpperCase()!=d?c.push(String.fromCharCode(97+Math.round(25*Math.random()))):
+/\s/.test(d)?c.push(" "):c.push("?"):c.push(b?"0":Math.round(9*Math.random()))}return c.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var b=0;b<a[EditorUi.DIFF_INSERT].length;b++)try{var c=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][b].data).documentElement.cloneNode(!1);null!=c.getAttribute("name")&&c.setAttribute("name",this.anonymizeString(c.getAttribute("name")));a[EditorUi.DIFF_INSERT][b].data=mxUtils.getXml(c)}catch(t){a[EditorUi.DIFF_INSERT][b].data=
+t.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var f in a[EditorUi.DIFF_UPDATE]){var d=a[EditorUi.DIFF_UPDATE][f];null!=d.name&&(d.name=this.anonymizeString(d.name));null!=d.cells&&(b=mxUtils.bind(this,function(a){var b=d.cells[a];if(null!=b){for(var c in b)null!=b[c].value&&(b[c].value="["+b[c].value.length+"]"),null!=b[c].xmlValue&&(b[c].xmlValue="["+b[c].xmlValue.length+"]"),null!=b[c].style&&(b[c].style="["+b[c].style.length+"]"),0==Object.keys(b[c]).length&&delete b[c];0==Object.keys(b).length&&
+delete d.cells[a]}}),b(EditorUi.DIFF_INSERT),b(EditorUi.DIFF_UPDATE),0==Object.keys(d.cells).length&&delete d.cells);0==Object.keys(d).length&&delete a[EditorUi.DIFF_UPDATE][f]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var c=0;c<a.attributes.length;c++)"as"!=a.attributes[c].name&&a.setAttribute(a.attributes[c].name,this.anonymizeString(a.attributes[c].value,b));if(null!=a.childNodes)for(c=
+0;c<a.childNodes.length;c++)this.anonymizeAttributes(a.childNodes[c],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var c=a.getElementsByTagName("mxCell"),f=0;f<c.length;f++)null!=c[f].getAttribute("value")&&c[f].setAttribute("value","["+c[f].getAttribute("value").length+"]"),null!=c[f].getAttribute("xmlValue")&&c[f].setAttribute("xmlValue","["+c[f].getAttribute("xmlValue").length+"]"),null!=c[f].getAttribute("style")&&c[f].setAttribute("style","["+c[f].getAttribute("style").length+"]"),null!=
+c[f].parentNode&&"root"!=c[f].parentNode.nodeName&&null!=c[f].parentNode.parentNode&&(c[f].setAttribute("id",c[f].parentNode.getAttribute("id")),c[f].parentNode.parentNode.replaceChild(c[f],c[f].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var b=this.getCurrentFile();null!=b&&(b.savingFile?this.handleError({message:mxResources.get("busy")}):!a&&b.invalidChecksum?b.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(b.clearAutosave(),
+this.editor.setStatus(""),a?b.reloadFile(mxUtils.bind(this,function(){b.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){b.handleFileError(a,!0)})):b.synchronizeFile(mxUtils.bind(this,function(){b.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){b.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=function(a,b,c,d,e,k,g,n,m,x){e=null!=e?e:!0;k=null!=k?k:!1;var f=this.editor.graph;if(b||!a&&null!=m&&/(\.svg)$/i.test(m.getTitle()))if(x=
+!1,null!=this.pages&&this.currentPage!=this.pages[0]){var l=f.getGlobalVariable,f=this.createTemporaryGraph(f.getStylesheet()),p=this.pages[0];f.getGlobalVariable=function(a){return"page"==a?p.getName():"pagenumber"==a?1:l.apply(this,arguments)};document.body.appendChild(f.container);f.model.setRoot(p.root)}g=null!=g?g:this.getXmlFileData(e,k,x);m=null!=m?m:this.getCurrentFile();a=this.createFileData(g,f,m,window.location.href,a,b,c,d,e,n,x);f!=this.editor.graph&&f.container.parentNode.removeChild(f.container);
+return a};EditorUi.prototype.getHtml=function(a,b,c,d,e,k){k=null!=k?k:!0;var f=null,l=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var f=k?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),p=b.view.scale;k=Math.floor(f.x/p-b.view.translate.x);p=Math.floor(f.y/p-b.view.translate.y);f=b.background;null==e&&(b=this.getBasenames().join(";"),0<b.length&&(l=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",k);a.setAttribute("y0",p)}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!=d&&a.setAttribute("edit",d));null!=e&&(e=e.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";d=Graph.compress(a);Graph.decompress(d)!=a&&(d=encodeURIComponent(a));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+
+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+"</head>\n<body"+(null==e&&null!=f&&f!=mxConstants.NONE?' style="background-color:'+f+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+"</div>\n</div>\n"+(null==e?'<script type="text/javascript" src="'+l+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+
+e+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,c,d,e){b=EditorUi.drawHost+"/js/viewer.min.js";null!=e&&(e=e.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
+"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==e?'<script type="text/javascript" src="'+
+b+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/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;a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=Editor.extractParserError(a,mxResources.get("invalidOrMissingFile"));if(b)throw Error(b);
+b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a&&"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<b.length||1==b.length&&b[0].hasAttribute("name"))){var c=null;this.fileNode=a;this.pages=[];for(a=0;a<b.length;a++){null==b[a].getAttribute("id")&&b[a].setAttribute("id",a);var f=new DiagramPage(b[a]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[a+1]));this.pages.push(f);null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]&&
+(c=f)}this.currentPage=null!=c?c:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};
EditorUi.prototype.getBaseFilename=function(a){var b=this.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(b)||/(\.html)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.png)$/i.test(b)||/(\.drawio)$/i.test(b))b=b.substring(0,b.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(b=b+"-"+this.currentPage.getName());return b};EditorUi.prototype.downloadFile=
-function(a,b,c,d,f,l,m,p,n,x){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var g=this.getBaseFilename(!f),k=g+"."+a;if("xml"==a){var q='<?xml version="1.0" encoding="UTF-8"?>\n'+this.getFileData(!0,null,null,null,d,f,null,null,null,b);this.saveData(k,a,q,"text/xml")}else if("html"==a)q=this.getHtml2(this.getFileData(!0),this.editor.graph,g),this.saveData(k,a,q,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=g+".png":"jpeg"==
-a&&(k=g+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(b,c){try{var g=this.editor.graph.pageVisible;null!=l&&(this.editor.graph.pageVisible=l);var k=this.createDownloadRequest(b,a,d,c,m,f,p,n,x);this.editor.graph.pageVisible=g;return k}catch(S){this.handleError(S)}}));else{var t=null,v=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(t)}))});
-if("svg"==a){var y=this.editor.graph.background;if(m||y==mxConstants.NONE)y=null;var A=this.editor.graph.getSvg(y,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(A);this.convertImages(A,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();v('<?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 k=g+".svg",t=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();
-v(a)}),d)}}catch(J){this.handleError(J)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d,f,l,m,p,n){var g=this.editor.graph,k=g.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==l?!1:"xmlpng"!=b);var q="",t="";if(k.width*k.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};k="0";"pdf"==b&&0==l&&(t="&allPages=1");if("xmlpng"==b&&(k="1",b="png",null!=this.pages&&null!=this.currentPage))for(l=0;l<this.pages.length;l++)if(this.pages[l]==this.currentPage){q=
-"&from="+l;break}l=g.background;"png"==b&&f?l=mxConstants.NONE:f||null!=l&&l!=mxConstants.NONE||(l="#ffffff");f={globalVars:g.getExportVariables()};n&&(f.grid={size:g.gridSize,steps:g.view.gridSteps,color:g.view.gridColor});return new mxXmlRequest(EXPORT_URL,"format="+b+q+t+"&bg="+(null!=l?l:mxConstants.NONE)+"&base64="+d+"&embedXml="+k+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(f))+(null!=m?"&scale="+m:"")+(null!=p?"&border="+
-p:""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var g=window.location.hash,d=mxUtils.bind(this,function(c){var d=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<d.length&&(d+="\n"),d+=c);c=new LocalFile(this,"csv"!=a.format&&0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return g};this.fileLoaded(c);"csv"==a.format&&this.importCsv(d,mxUtils.bind(this,
-function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?parseInt(a.interval):6E4,q=null,f=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){b===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(q);q=window.setTimeout(f,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){l();f()}));l();f()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var k=a.url;/^https?:\/\//.test(k)&&!this.editor.isCorsEnabledForUrl(k)&&(k=PROXY_URL+"?url="+encodeURIComponent(k));this.loadUrl(k,mxUtils.bind(this,function(a){d(a)}),mxUtils.bind(this,function(a){null!=c&&
-c(a)}))}else d("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||d.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,c){g.alert(a.tooltip)});return b}var c=null,g=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=a&&"updates"==a.nodeName)){var d=this.editor.graph,f=d.getModel();f.beginUpdate();var l=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var m=f.getCell(a.getAttribute("id"));
-if(null!=m){try{var p=a.getAttribute("value");if(null!=p){var x=mxUtils.parseXml(p).documentElement;if(null!=x)if("1"==x.getAttribute("replace-value"))f.setValue(m,x);else for(var C=x.attributes,n=0;n<C.length;n++)d.setAttributeForCell(m,C[n].nodeName,0<C[n].nodeValue.length?C[n].nodeValue:null)}}catch(L){null!=window.console&&console.log("Error in value for "+m.id+": "+L)}try{var B=a.getAttribute("style");null!=B&&d.model.setStyle(m,B)}catch(L){null!=window.console&&console.log("Error in style for "+
-m.id+": "+L)}try{var u=a.getAttribute("icon");if(null!=u){var E=0<u.length?JSON.parse(u):null;null!=E&&E.append||d.removeCellOverlays(m);null!=E&&d.addCellOverlay(m,b(E))}}catch(L){null!=window.console&&console.log("Error in icon for "+m.id+": "+L)}try{var I=a.getAttribute("geometry");if(null!=I){var I=JSON.parse(I),K=d.getCellGeometry(m);if(null!=K){K=K.clone();for(key in I){var J=parseFloat(I[key]);"dx"==key?K.x+=J:"dy"==key?K.y+=J:"dw"==key?K.width+=J:"dh"==key?K.height+=J:K[key]=parseFloat(I[key])}d.model.setGeometry(m,
-K)}}}catch(L){null!=window.console&&console.log("Error in icon for "+m.id+": "+L)}}}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,f)}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&&(l=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{f.endUpdate()}null!=l&&this.chromelessResize&&this.chromelessResize(!0,l)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,g="",d=c.lastIndexOf(".");0<=d&&(g=c.substring(d),c=c.substring(0,d));if(b)var k=new Date,d=k.getFullYear(),f=k.getMonth()+1,l=k.getDate(),m=k.getHours(),x=k.getMinutes(),k=k.getSeconds(),c=
-c+(" "+(d+"-"+f+"-"+l+"-"+m+"-"+x+"-"+k));return c=mxResources.get("copyOf",[c])+g};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var g=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();
+function(a,b,c,d,e,k,g,n,m,x){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var f=this.getBaseFilename(!e),l=f+"."+a;if("xml"==a){var p='<?xml version="1.0" encoding="UTF-8"?>\n'+this.getFileData(!0,null,null,null,d,e,null,null,null,b);this.saveData(l,a,p,"text/xml")}else if("html"==a)p=this.getHtml2(this.getFileData(!0),this.editor.graph,f),this.saveData(l,a,p,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?l=f+".png":"jpeg"==
+a&&(l=f+".jpg"),this.saveRequest(l,a,mxUtils.bind(this,function(b,c){try{var f=this.editor.graph.pageVisible;null!=k&&(this.editor.graph.pageVisible=k);var l=this.createDownloadRequest(b,a,d,c,g,e,n,m,x);this.editor.graph.pageVisible=f;return l}catch(N){this.handleError(N)}}));else{var t=null,u=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(t)}))});
+if("svg"==a){var v=this.editor.graph.background;if(g||v==mxConstants.NONE)v=null;var z=this.editor.graph.getSvg(v,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(z);this.convertImages(z,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();u('<?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 l=f+".svg",t=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();
+u(a)}),d)}}catch(I){this.handleError(I)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d,e,k,g,n,m){var f=this.editor.graph,l=f.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==k?!1:"xmlpng"!=b);var p="",t="";if(l.width*l.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};l="0";"pdf"==b&&0==k&&(t="&allPages=1");if("xmlpng"==b&&(l="1",b="png",null!=this.pages&&null!=this.currentPage))for(k=0;k<this.pages.length;k++)if(this.pages[k]==this.currentPage){p=
+"&from="+k;break}k=f.background;"png"==b&&e?k=mxConstants.NONE:e||null!=k&&k!=mxConstants.NONE||(k="#ffffff");e={globalVars:f.getExportVariables()};m&&(e.grid={size:f.gridSize,steps:f.view.gridSteps,color:f.view.gridColor});return new mxXmlRequest(EXPORT_URL,"format="+b+p+t+"&bg="+(null!=k?k:mxConstants.NONE)+"&base64="+d+"&embedXml="+l+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(e))+(null!=g?"&scale="+g:"")+(null!=n?"&border="+
+n:""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var f=window.location.hash,d=mxUtils.bind(this,function(c){var d=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<d.length&&(d+="\n"),d+=c);c=new LocalFile(this,"csv"!=a.format&&0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return f};this.fileLoaded(c);"csv"==a.format&&this.importCsv(d,mxUtils.bind(this,
+function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var l=null!=a.interval?parseInt(a.interval):6E4,p=null,e=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){b===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),k()):this.handleError({message:mxResources.get("error")+
+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),k=mxUtils.bind(this,function(){window.clearTimeout(p);p=window.setTimeout(e,l)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){k();e()}));k();e()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var l=a.url;/^https?:\/\//.test(l)&&!this.editor.isCorsEnabledForUrl(l)&&(l=PROXY_URL+"?url="+encodeURIComponent(l));this.loadUrl(l,mxUtils.bind(this,function(a){d(a)}),mxUtils.bind(this,function(a){null!=c&&
+c(a)}))}else d("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||d.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,c){f.alert(a.tooltip)});return b}var c=null,f=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=a&&"updates"==a.nodeName)){var d=this.editor.graph,e=d.getModel();e.beginUpdate();var k=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var g=e.getCell(a.getAttribute("id"));
+if(null!=g){try{var n=a.getAttribute("value");if(null!=n){var x=mxUtils.parseXml(n).documentElement;if(null!=x)if("1"==x.getAttribute("replace-value"))e.setValue(g,x);else for(var B=x.attributes,m=0;m<B.length;m++)d.setAttributeForCell(g,B[m].nodeName,0<B[m].nodeValue.length?B[m].nodeValue:null)}}catch(K){null!=window.console&&console.log("Error in value for "+g.id+": "+K)}try{var A=a.getAttribute("style");null!=A&&d.model.setStyle(g,A)}catch(K){null!=window.console&&console.log("Error in style for "+
+g.id+": "+K)}try{var q=a.getAttribute("icon");if(null!=q){var D=0<q.length?JSON.parse(q):null;null!=D&&D.append||d.removeCellOverlays(g);null!=D&&d.addCellOverlay(g,b(D))}}catch(K){null!=window.console&&console.log("Error in icon for "+g.id+": "+K)}try{var H=a.getAttribute("geometry");if(null!=H){var H=JSON.parse(H),J=d.getCellGeometry(g);if(null!=J){J=J.clone();for(key in H){var I=parseFloat(H[key]);"dx"==key?J.x+=I:"dy"==key?J.y+=I:"dw"==key?J.width+=I:"dh"==key?J.height+=I:J[key]=parseFloat(H[key])}d.model.setGeometry(g,
+J)}}}catch(K){null!=window.console&&console.log("Error in icon for "+g.id+": "+K)}}}else if("model"==a.nodeName){for(var G=a.firstChild;null!=G&&G.nodeType!=mxConstants.NODETYPE_ELEMENT;)G=G.nextSibling;null!=G&&(new mxCodec(a.firstChild)).decode(G,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&&(k=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=k&&this.chromelessResize&&this.chromelessResize(!0,k)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,f="",d=c.lastIndexOf(".");0<=d&&(f=c.substring(d),c=c.substring(0,d));if(b)var l=new Date,d=l.getFullYear(),e=l.getMonth()+1,k=l.getDate(),g=l.getHours(),x=l.getMinutes(),l=l.getSeconds(),c=
+c+(" "+(d+"-"+e+"-"+k+"-"+g+"-"+x+"-"+l));return c=mxResources.get("copyOf",[c])+f};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var f=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();
this.editor.undoManager.clear();this.setBackgroundImage(null);!b&&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.editor.setStatus("");this.updateUi();b||this.showSplash()});if(null!=a)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(a);a.addListener("descriptorChanged",
this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();a.isEditable()?a.isModified()?(a.addUnsavedStatus(),null!=a.backupPatch&&a.patch([a.backupPatch])):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"));g=!0;this.isOffline()||null==a.getMode()||EditorUi.logEvent({category:a.getMode().toUpperCase()+"-OPEN-FILE-"+
-a.getHash(),action:"size_"+a.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")});if(this.editor.editable&&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(A){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(A){}}catch(A){this.fileLoadedError=A;null!=window.console&&(console.error(A),console.log("error in fileLoaded:",a,A));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!=A&&null!=A.message?":err:"+encodeURIComponent(A.message):"")+(null!=A&&null!=A.stack?"&stack="+encodeURIComponent(A.stack):"")}catch(z){}var k=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):
-null!=c?this.fileLoaded(c):d()});b?k():this.handleError(A,mxResources.get("errorLoadingFile"),k,!0)}else d();return g};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,g=new mxGraphModel,d=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var k=0;k<a.length;k++){this.updatePageRoot(a[k]);var f=a[k].node.cloneNode(!1);f.removeAttribute("name");g.root=a[k].root;var l=d.encode(g);this.editor.graph.saveViewState(a[k].viewState,l,!0);l.removeAttribute("pageWidth");
-l.removeAttribute("pageHeight");f.appendChild(l);null!=b&&(b.eltCount+=f.getElementsByTagName("*").length,b.nodeCount+=f.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(f,function(a,b,c,g){return!g||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=b&&"height"!=b?g&&"mxCell"==a.nodeName&&"previous"==b?null:c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var g=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===
-typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(g^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var d=0;d<a.attributes.length;d++){var k=a.attributes[d].name,q=null!=b?b(a,k,a.attributes[d].value,!0):a.attributes[d].value;null!=q&&(g^=this.hashValue(k,b,c)+this.hashValue(q,b,c))}}if(null!=a.childNodes)for(d=0;d<a.childNodes.length;d++)g=(g<<5)-g+this.hashValue(a.childNodes[d],b,c)<<0}else if(null!=a&&"function"!==
-typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(d=0;d<a.length;d++)b=(b<<5)-b+a.charCodeAt(d)<<0;g^=b}return g};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,f,l,m){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",
+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"));f=!0;this.isOffline()||null==a.getMode()||EditorUi.logEvent({category:a.getMode().toUpperCase()+"-OPEN-FILE-"+
+a.getHash(),action:"size_"+a.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")});if(this.editor.editable&&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(z){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(z){}}catch(z){this.fileLoadedError=z;null!=window.console&&(console.error(z),console.log("error in fileLoaded:",a,z));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!=z&&null!=z.message?":err:"+encodeURIComponent(z.message):"")+(null!=z&&null!=z.stack?"&stack="+encodeURIComponent(z.stack):"")}catch(y){}var l=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):
+null!=c?this.fileLoaded(c):d()});b?l():this.handleError(z,mxResources.get("errorLoadingFile"),l,!0)}else d();return f};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,f=new mxGraphModel,d=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var l=0;l<a.length;l++){this.updatePageRoot(a[l]);var e=a[l].node.cloneNode(!1);e.removeAttribute("name");f.root=a[l].root;var k=d.encode(f);this.editor.graph.saveViewState(a[l].viewState,k,!0);k.removeAttribute("pageWidth");
+k.removeAttribute("pageHeight");e.appendChild(k);null!=b&&(b.eltCount+=e.getElementsByTagName("*").length,b.nodeCount+=e.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(e,function(a,b,c,f){return!f||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=b&&"height"!=b?f&&"mxCell"==a.nodeName&&"previous"==b?null:c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var f=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===
+typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(f^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var d=0;d<a.attributes.length;d++){var l=a.attributes[d].name,p=null!=b?b(a,l,a.attributes[d].value,!0):a.attributes[d].value;null!=p&&(f^=this.hashValue(l,b,c)+this.hashValue(p,b,c))}}if(null!=a.childNodes)for(d=0;d<a.childNodes.length;d++)f=(f<<5)-f+this.hashValue(a.childNodes[d],b,c)<<0}else if(null!=a&&"function"!==
+typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(d=0;d<a.length;d++)b=(b<<5)-b+a.charCodeAt(d)<<0;f^=b}return f};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,e,k,g){};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 b=mxUtils.createXmlDocument(),c=b.createElement("mxlibrary");mxUtils.setTextContent(c,JSON.stringify(a));b.appendChild(c);return mxUtils.getXml(b)};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 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,g=c.previousSibling;b.insertBefore(c,a);b.insertBefore(g,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 g=this.sidebar.palettes[a.getHash()],g=null!=g?g[g.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var d=null,k=mxUtils.bind(this,function(b,c){0==b.length&&a.isEditable()?(null==d&&(d=document.createElement("div"),d.className="geDropTarget",mxUtils.write(d,mxResources.get("dragElementsHere"))),c.appendChild(d)):this.addLibraryEntries(b,c)});null!=this.sidebar&&
-null!=b&&this.sidebar.addEntries(b);c=null!=c&&0<c.length?c:a.getTitle();var q=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){k(b,a)}));this.repositionLibrary(g);var f=q.parentNode.previousSibling;c=f.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&f.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var l=document.createElement("div");l.style.position="absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||
-(l.style.backgroundColor="inherit");f.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)l.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});
-null!=p?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var n=this.editor.graph,B=null,u=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),q,b,a,a.getMode());mxEvent.consume(c)}),E=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=B&&null!=B.parentNode&&B.parentNode.removeChild(B),B=m.cloneNode(!1),B.setAttribute("src",Editor.spinImage),B.setAttribute("title",
-mxResources.get("saving")),B.style.cursor="default",B.style.marginRight="2px",B.style.marginTop="-2px",l.insertBefore(B,l.firstChild),f.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=B&&null!=B.parentNode&&(B.parentNode.removeChild(B),f.style.paddingRight=18*l.childNodes.length+"px")})):null==p&&(p=m.cloneNode(!1),p.setAttribute("src",IMAGE_PATH+"/download.png"),p.setAttribute("title",mxResources.get("save")),l.insertBefore(p,l.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()||(f.style.paddingRight=18*l.childNodes.length+"px",p.parentNode.removeChild(p),p=null)});mxEvent.consume(c)})),f.style.paddingRight=18*l.childNodes.length+"px")}),I=mxUtils.bind(this,function(a,c,g,k){a=n.cloneCells(mxUtils.sortCells(n.model.getTopmostCells(a)));for(var f=0;f<a.length;f++){var l=n.getCellGeometry(a[f]);null!=l&&
-l.translate(-c.x,-c.y)}q.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,k||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=k&&(a.title=k);b.push(a);E(g);null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null)}),K=mxUtils.bind(this,function(a){if(n.isSelectionEmpty())n.getRubberband().isActive()?(n.getRubberband().execute(a),n.getRubberband().reset()):this.showError(mxResources.get("error"),
-mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=n.getSelectionCells(),c=n.view.getBounds(b),g=n.view.scale;c.x/=g;c.y/=g;c.width/=g;c.height/=g;c.x-=n.view.translate.x;c.y-=n.view.translate.y;I(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(q,function(){},mxUtils.bind(this,function(a){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="hidden",q.style.backgroundColor="#f1f3f4",q.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(a))}),mxUtils.bind(this,function(a){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler&&(q.style.backgroundColor="",q.style.cursor="default",this.sidebar.showTooltips=!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,K(a),mxEvent.consume(a))}));mxEvent.addListener(q,"mouseleave",mxUtils.bind(this,
-function(a){n.isMouseDown&&null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="visible",q.style.backgroundColor="",q.style.cursor="",n.autoScroll=!0,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!0),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(q,"dragover",mxUtils.bind(this,function(a){q.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";q.style.cursor="copy";this.sidebar.hideTooltip();
-a.stopPropagation();a.preventDefault()})),mxEvent.addListener(q,"drop",mxUtils.bind(this,function(a){q.style.cursor="";q.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,g,f,l,m,t,x,p,n){if(null!=c&&"image/"==g.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,m,t),c)],c[0].vertex=!0,I(c,new mxRectangle(0,
-0,m,t),a,mxEvent.isAltDown(a)?null:x.substring(0,x.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null);else{var v=!1,C=mxUtils.bind(this,function(c,g){if(null!=c&&"text/xml"==g){var f=mxUtils.parseXml(c);if("mxlibrary"==f.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(f.documentElement));k(l,q);b=b.concat(l);E(a);this.spinner.stop();v=!0}catch(Q){}else if("mxfile"==f.documentElement.nodeName)try{for(var m=f.documentElement.getElementsByTagName("diagram"),
-f=0;f<m.length;f++){var t=this.stringToCells(Editor.getDiagramNodeXml(m[f])),x=this.editor.graph.getBoundingBoxFromGeometry(t);I(t,new mxRectangle(0,0,x.width,x.height),a)}v=!0}catch(Q){null!=window.console&&console.log("error in drop handler:",Q)}}v||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null)});null!=n&&null!=x&&(/(\.v(dx|sdx?))($|\?)/i.test(x)||/(\.vs(x|sx?))($|\?)/i.test(x))?
-this.importVisio(n,function(a){C(a,"text/xml")},null,x):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,x)&&null!=n?this.parseFile(n,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?C(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):C(c,g)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(q,"dragleave",
-function(a){q.style.cursor="";q.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));l.insertBefore(m,l.firstChild);mxEvent.addListener(m,"click",u);mxEvent.addListener(q,"dblclick",function(a){mxEvent.getSource(a)==q&&u(a)});c=m.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));l.insertBefore(c,l.firstChild);mxEvent.addListener(c,
-"click",K);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)})),l.insertBefore(c,l.firstChild))}f.appendChild(l);f.style.paddingRight=18*l.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=
-function(a,b){for(var c=0;c<a.length;c++){var g=a[c],d=g.data;if(null!=d){var d=this.convertDataUri(d),k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==g.aspect&&(k+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(k+"image="+d,g.w,g.h,"",g.title||"",!1,!1,!0))}else null!=g.xml&&(d=this.stringToCells(Graph.decompress(g.xml)),0<d.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(d,g.w,g.h,g.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=
+var c=b.lastChild,f=c.previousSibling;b.insertBefore(c,a);b.insertBefore(f,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 f=this.sidebar.palettes[a.getHash()],f=null!=f?f[f.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var d=null,l=mxUtils.bind(this,function(b,c){0==b.length&&a.isEditable()?(null==d&&(d=document.createElement("div"),d.className="geDropTarget",mxUtils.write(d,mxResources.get("dragElementsHere"))),c.appendChild(d)):this.addLibraryEntries(b,c)});null!=this.sidebar&&
+null!=b&&this.sidebar.addEntries(b);c=null!=c&&0<c.length?c:a.getTitle();var e=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){l(b,a)}));this.repositionLibrary(f);var p=e.parentNode.previousSibling;c=p.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&p.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var k=document.createElement("div");k.style.position="absolute";k.style.right="0px";k.style.top="0px";k.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||
+(k.style.backgroundColor="inherit");p.style.position="relative";var g=document.createElement("img");g.setAttribute("src",Dialog.prototype.closeImage);g.setAttribute("title",mxResources.get("close"));g.setAttribute("valign","absmiddle");g.setAttribute("border","0");g.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)k.appendChild(g),mxEvent.addListener(g,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});
+null!=n?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var m=this.editor.graph,A=null,q=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),e,b,a,a.getMode());mxEvent.consume(c)}),D=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=A&&null!=A.parentNode&&A.parentNode.removeChild(A),A=g.cloneNode(!1),A.setAttribute("src",Editor.spinImage),A.setAttribute("title",
+mxResources.get("saving")),A.style.cursor="default",A.style.marginRight="2px",A.style.marginTop="-2px",k.insertBefore(A,k.firstChild),p.style.paddingRight=18*k.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=A&&null!=A.parentNode&&(A.parentNode.removeChild(A),p.style.paddingRight=18*k.childNodes.length+"px")})):null==n&&(n=g.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),k.insertBefore(n,k.firstChild),
+mxEvent.addListener(n,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==n||a.isModified()||(p.style.paddingRight=18*k.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),p.style.paddingRight=18*k.childNodes.length+"px")}),H=mxUtils.bind(this,function(a,c,f,l){a=m.cloneCells(mxUtils.sortCells(m.model.getTopmostCells(a)));for(var p=0;p<a.length;p++){var k=m.getCellGeometry(a[p]);null!=k&&
+k.translate(-c.x,-c.y)}e.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,l||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=l&&(a.title=l);b.push(a);D(f);null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null)}),J=mxUtils.bind(this,function(a){if(m.isSelectionEmpty())m.getRubberband().isActive()?(m.getRubberband().execute(a),m.getRubberband().reset()):this.showError(mxResources.get("error"),
+mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=m.getSelectionCells(),c=m.view.getBounds(b),f=m.view.scale;c.x/=f;c.y/=f;c.width/=f;c.height/=f;c.x-=m.view.translate.x;c.y-=m.view.translate.y;H(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(e,function(){},mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="hidden",e.style.backgroundColor="#f1f3f4",e.style.cursor="copy",m.panningManager.stop(),
+m.autoScroll=!1,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!1),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler&&(e.style.backgroundColor="",e.style.cursor="default",this.sidebar.showTooltips=!0,m.panningManager.stop(),m.graphHandler.reset(),m.isMouseDown=!1,m.autoScroll=!0,J(a),mxEvent.consume(a))}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,
+function(a){m.isMouseDown&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="visible",e.style.backgroundColor="",e.style.cursor="",m.autoScroll=!0,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!0),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){e.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";e.style.cursor="copy";this.sidebar.hideTooltip();
+a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){e.style.cursor="";e.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,f,p,k,g,t,x,n,u){if(null!=c&&"image/"==f.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,g,t),c)],c[0].vertex=!0,H(c,new mxRectangle(0,
+0,g,t),a,mxEvent.isAltDown(a)?null:x.substring(0,x.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null);else{var m=!1,B=mxUtils.bind(this,function(c,f){if(null!=c&&"text/xml"==f){var p=mxUtils.parseXml(c);if("mxlibrary"==p.documentElement.nodeName)try{var k=JSON.parse(mxUtils.getTextContent(p.documentElement));l(k,e);b=b.concat(k);D(a);this.spinner.stop();m=!0}catch(P){}else if("mxfile"==p.documentElement.nodeName)try{for(var g=p.documentElement.getElementsByTagName("diagram"),
+p=0;p<g.length;p++){var t=this.stringToCells(Editor.getDiagramNodeXml(g[p])),x=this.editor.graph.getBoundingBoxFromGeometry(t);H(t,new mxRectangle(0,0,x.width,x.height),a)}m=!0}catch(P){null!=window.console&&console.log("error in drop handler:",P)}}m||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null)});null!=u&&null!=x&&(/(\.v(dx|sdx?))($|\?)/i.test(x)||/(\.vs(x|sx?))($|\?)/i.test(x))?
+this.importVisio(u,function(a){B(a,"text/xml")},null,x):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,x)&&null!=u?this.parseFile(u,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?B(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):B(c,f)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"dragleave",
+function(a){e.style.cursor="";e.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));g=g.cloneNode(!1);g.setAttribute("src",Editor.editImage);g.setAttribute("title",mxResources.get("edit"));k.insertBefore(g,k.firstChild);mxEvent.addListener(g,"click",q);mxEvent.addListener(e,"dblclick",function(a){mxEvent.getSource(a)==e&&q(a)});c=g.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));k.insertBefore(c,k.firstChild);mxEvent.addListener(c,
+"click",J);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)})),k.insertBefore(c,k.firstChild))}p.appendChild(k);p.style.paddingRight=18*k.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=
+function(a,b){for(var c=0;c<a.length;c++){var f=a[c],d=f.data;if(null!=d){var d=this.convertDataUri(d),l="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==f.aspect&&(l+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(l+"image="+d,f.w,f.h,"",f.title||"",!1,!1,!0))}else null!=f.xml&&(d=this.stringToCells(Graph.decompress(f.xml)),0<d.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(d,f.w,f.h,f.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=
function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.offline||EditorUi.isElectronApp||("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.createFooter=function(){return document.getElementById("geFooter")});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):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultPageBorderColor="#505759",Format.prototype.inactiveTabBackgroundColor=
"black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",
Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display=
-"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,f){a=new ImageDialog(this,a,b,c,d,f);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);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 b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,f){a=new LibraryDialog(this,a,b,c,d,f);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var c=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var b=
+"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);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 b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var c=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var b=
c.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&b.refresh()}));return b};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position="absolute";a.style.overflow="hidden";var b=document.createElement("a");b.className="geTitle";b.style.color="#DF6C0C";b.style.fontWeight="bold";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML=
-'<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));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,c,d,f){var g=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},
-k=null!=a&&null!=a.error?a.error:a;if(null!=k||null!=b){var q=mxUtils.htmlEntities(mxResources.get("unknownError")),l=mxResources.get("ok"),m=null;b=null!=b?b:mxResources.get("error");if(null!=k)if(null!=k.retry&&(l=mxResources.get("cancel"),m=function(){g();k.retry()}),404==k.code||404==k.status||403==k.code){var q=403==k.code?null!=k.message?mxUtils.htmlEntities(k.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=f?f:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+
-(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":"")),p=window.location.hash;if(null!=p&&("#G"==p.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==p.substring(0,45))&&(null!=a&&null!=a.error&&(null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason||null!=a.error.data&&0<a.error.data.length&&"fileAccess"==a.error.data[0].reason)||404==k.code||404==k.status)){p="#U"==p.substring(0,2)?p.substring(45,
-p.lastIndexOf("%26ex")):p.substring(2);this.showError(b,q,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+p);this.handleError(a,b,c,d,f)}),m,mxResources.get("changeUser"),mxUtils.bind(this,function(){function a(){d.innerHTML="";for(var a=0;a<b.length;a++){var c=document.createElement("option");mxUtils.write(c,b[a].displayName);c.value=a;d.appendChild(c);c=document.createElement("option");c.innerHTML="&nbsp;&nbsp;&nbsp;";
-mxUtils.write(c,"<"+b[a].email+">");c.setAttribute("disabled","disabled");d.appendChild(c)}c=document.createElement("option");mxUtils.write(c,mxResources.get("addAccount"));c.value=b.length;d.appendChild(c)}var b=this.drive.getUsersList(),c=document.createElement("div"),g=document.createElement("span");g.style.marginTop="6px";mxUtils.write(g,mxResources.get("changeUser")+": ");c.appendChild(g);var d=document.createElement("select");d.style.width="200px";a();mxEvent.addListener(d,"change",mxUtils.bind(this,
-function(){var c=d.value,g=b.length!=c;g&&this.drive.setUser(b[c]);this.drive.authorize(g,mxUtils.bind(this,function(){g||(b=this.drive.getUsersList(),a())}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}));c.appendChild(d);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(c.container,300,75,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){window.location.hash=""}),480,150);return}}else null!=k.message?
-q=mxUtils.htmlEntities(k.message):null!=k.response&&null!=k.response.error?q=mxUtils.htmlEntities(k.response.error):"undefined"!==typeof window.App&&(k.code==App.ERROR_TIMEOUT?q=mxUtils.htmlEntities(mxResources.get("timeout")):k.code==App.ERROR_BUSY&&(q=mxUtils.htmlEntities(mxResources.get("busy"))));var n=null,v=null;null!=k&&null!=k.helpLink&&(n=mxResources.get("help"),v=mxUtils.bind(this,function(){return this.editor.graph.openLink(k.helpLink)}));this.showError(b,q,l,c,m,null,null,n,v,null,null,
-null,d?c:null)}else null!=c&&c()};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,c,d,f,l){var g=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){g();null!=b&&b()},function(){g();null!=c&&c()},d,f);this.showDialog(a.container,340,90,!0,l);a.init()};EditorUi.prototype.setCurrentFile=function(a){null!=
-a&&(a.opened=new Date);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,c,d){var g=a.toDataURL("image/"+c);if(6>=g.length||g==a.cloneNode(!1).toDataURL("image/"+
-c))throw{message:"Invalid image"};null!=b&&(g=this.writeGraphModelToPng(g,"tEXt","mxfile",encodeURIComponent(b)));0<d&&(g=this.writeGraphModelToPng(g,"pHYs","dpi",d));return g};EditorUi.prototype.saveCanvas=function(a,b,c,d,f){var g="jpeg"==c?"jpg":c;d=this.getBaseFilename(d)+"."+g;a=this.createImageDataUri(a,b,c,f);this.saveData(d,g,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&
+'<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));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,c,d,e){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},
+l=null!=a&&null!=a.error?a.error:a;if(null!=l||null!=b){var p=mxUtils.htmlEntities(mxResources.get("unknownError")),k=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=l)if(null!=l.retry&&(k=mxResources.get("cancel"),g=function(){f();l.retry()}),404==l.code||404==l.status||403==l.code){var p=403==l.code?null!=l.message?mxUtils.htmlEntities(l.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=e?e:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+
+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":"")),n=window.location.hash;if(null!=n&&("#G"==n.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==n.substring(0,45))&&(null!=a&&null!=a.error&&(null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason||null!=a.error.data&&0<a.error.data.length&&"fileAccess"==a.error.data[0].reason)||404==l.code||404==l.status)){n="#U"==n.substring(0,2)?n.substring(45,
+n.lastIndexOf("%26ex")):n.substring(2);this.showError(b,p,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+n);this.handleError(a,b,c,d,e)}),g,mxResources.get("changeUser"),mxUtils.bind(this,function(){function a(){f.innerHTML="";for(var a=0;a<b.length;a++){var c=document.createElement("option");mxUtils.write(c,b[a].displayName);c.value=a;f.appendChild(c);c=document.createElement("option");c.innerHTML="&nbsp;&nbsp;&nbsp;";
+mxUtils.write(c,"<"+b[a].email+">");c.setAttribute("disabled","disabled");f.appendChild(c)}c=document.createElement("option");mxUtils.write(c,mxResources.get("addAccount"));c.value=b.length;f.appendChild(c)}var b=this.drive.getUsersList(),c=document.createElement("div"),d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+": ");c.appendChild(d);var f=document.createElement("select");f.style.width="200px";a();mxEvent.addListener(f,"change",mxUtils.bind(this,
+function(){var c=f.value,d=b.length!=c;d&&this.drive.setUser(b[c]);this.drive.authorize(d,mxUtils.bind(this,function(){d||(b=this.drive.getUsersList(),a())}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}));c.appendChild(f);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(c.container,300,75,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){window.location.hash=""}),480,150);return}}else null!=l.message?
+p=mxUtils.htmlEntities(l.message):null!=l.response&&null!=l.response.error?p=mxUtils.htmlEntities(l.response.error):"undefined"!==typeof window.App&&(l.code==App.ERROR_TIMEOUT?p=mxUtils.htmlEntities(mxResources.get("timeout")):l.code==App.ERROR_BUSY&&(p=mxUtils.htmlEntities(mxResources.get("busy"))));var m=null,u=null;null!=l&&null!=l.helpLink&&(m=mxResources.get("help"),u=mxUtils.bind(this,function(){return this.editor.graph.openLink(l.helpLink)}));this.showError(b,p,k,c,g,null,null,m,u,null,null,
+null,d?c:null)}else null!=c&&c()};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,c,d,e,k){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){f();null!=b&&b()},function(){f();null!=c&&c()},d,e);this.showDialog(a.container,340,90,!0,k);a.init()};EditorUi.prototype.setCurrentFile=function(a){null!=
+a&&(a.opened=new Date);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,c,d){var f=a.toDataURL("image/"+c);if(6>=f.length||f==a.cloneNode(!1).toDataURL("image/"+
+c))throw{message:"Invalid image"};null!=b&&(f=this.writeGraphModelToPng(f,"tEXt","mxfile",encodeURIComponent(b)));0<d&&(f=this.writeGraphModelToPng(f,"pHYs","dpi",d));return f};EditorUi.prototype.saveCanvas=function(a,b,c,d,e){var f="jpeg"==c?"jpg":c;d=this.getBaseFilename(d)+"."+f;a=this.createImageDataUri(a,b,c,e);this.saveData(d,f,a.substring(a.lastIndexOf(",")+1),"image/"+c,!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.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=
-function(a,b,c,d,f){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else{var g=document.createElement("a"),k=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof g.download;if(mxClient.IS_GC)var q=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),
-k=65==(q?parseInt(q[2],10):!1)?!1:k;if(k||this.isOffline()){g.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?g.download=b:g.setAttribute("target","_blank");document.body.appendChild(g);try{window.setTimeout(function(){URL.revokeObjectURL(g.href)},0),g.click(),g.parentNode.removeChild(g)}catch(D){}}else this.createEchoRequest(a,b,c,d,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,f,l){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,
-a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=l?"&base64="+l:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,g=Math.ceil(d/1024),k=Array(g),f=0;f<g;++f){for(var l=1024*f,m=Math.min(l+1024,d),x=Array(m-l),p=0;l<m;++p,++l)x[p]=c[l].charCodeAt(0);k[f]=new Uint8Array(x)}return new Blob(k,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,f,l,m){l=null!=l?l:!1;m=null!=m?m:
-"vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);f=this.getServiceCount(l);isLocalStorage&&f++;var g=4>=f?2:6<f?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,g){try{if("_blank"==g)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var k=window.open("about:blank");null==k?mxUtils.popup(a,!0):(k.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"<pre>"),k.document.close())}else this.openInNewWindow(a,c,d);else g==App.MODE_DEVICE||"download"==g?
-this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(g,mxUtils.bind(this,function(k){try{this.exportFile(a,b,c,d,g,k)}catch(B){this.handleError(B)}}))}catch(G){this.handleError(G)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,l,m,null,1<f,g,a,c,d);l=this.isServices(f)?f>g?390:270:160;this.showDialog(b.container,400,l,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||
+function(a,b,c,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else{var f=document.createElement("a"),l=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var p=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),
+l=65==(p?parseInt(p[2],10):!1)?!1:l;if(l||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));l?f.download=b:f.setAttribute("target","_blank");document.body.appendChild(f);try{window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.click(),f.parentNode.removeChild(f)}catch(C){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,k){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,
+a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=k?"&base64="+k:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),l=Array(f),e=0;e<f;++e){for(var k=1024*e,g=Math.min(k+1024,d),x=Array(g-k),n=0;k<g;++n,++k)x[n]=c[k].charCodeAt(0);l[e]=new Uint8Array(x)}return new Blob(l,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,k,g){k=null!=k?k:!1;g=null!=g?g:
+"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(k);isLocalStorage&&e++;var f=4>=e?2:6<e?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var l=window.open("about:blank");null==l?mxUtils.popup(a,!0):(l.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"<pre>"),l.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?
+this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(l){try{this.exportFile(a,b,c,d,f,l)}catch(A){this.handleError(A)}}))}catch(E){this.handleError(E)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,k,g,null,1<e,f,a,c,d);k=this.isServices(e)?e>f?390:270:160;this.showDialog(b.container,400,k,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||
11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=d&&null!=d.document||mxUtils.popup(a,!0)};var b=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 g=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});g.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){g.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,
+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.style.backgroundColor="white";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"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c,a,d,f,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,g){return this.createEchoRequest(c,a,d,f,b,g)}),c,f,d)};EditorUi.prototype.saveRequest=function(a,
-b,c,d,f,l,m){m=null!=m?m:!mxClient.IS_IOS||!navigator.standalone;var g=this.getServiceCount(!1);isLocalStorage&&g++;var k=4>=g?2:6<g?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,g){if("_blank"==g||null!=a&&0<a.length){var k=c("_blank"==g?null:a,g==App.MODE_DEVICE||"download"==g||null==g||"_blank"==g?"0":"1");null!=k&&(g==App.MODE_DEVICE||"download"==g||"_blank"==g?k.simulate(document,"_blank"):this.pickFolder(g,mxUtils.bind(this,function(c){l=null!=l?l:"pdf"==b?"application/pdf":"image/"+
-b;if(null!=d)try{this.exportFile(d,a,l,!0,g,c)}catch(F){this.handleError(F)}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(),a,l,!0,g,c)}catch(F){this.handleError(F)}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,m,null,1<g,k,d,l,f);g=this.isServices(g)?4<g?390:270:160;this.showDialog(a.container,380,g,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,f,l){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,f,l,m,p,n,x){if(this.spinner.spin(document.body,mxResources.get("export"))){var g=
-this.editor.graph.isSelectionEmpty();c=null!=c?c:g;g=b?null:this.editor.graph.background;g==mxConstants.NONE&&(g=null);null==g&&0==b&&(g="#ffffff");var k=this.editor.graph.getSvg(g,a,m,p,null,c,null,null,"blank"==x?"_blank":"self"==x?"_top":null);d&&this.editor.graph.addSvgShadow(k);var q=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,n,null,null,null,!1));if(null!=this.editor.fontCss){var b=a.ownerDocument,
-b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var 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);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(q,"svg",d,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},
-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor.graph,k,!1,mxUtils.bind(this,function(){l?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(k,t,this.thumbImageCache)):t(k)}))}};EditorUi.prototype.addRadiobox=function(a,b,c,d,f,l,m){return this.addCheckbox(a,c,d,f,l,m,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,d,f,l,m,p){l=null!=l?l:!0;var g=document.createElement("input");g.style.marginRight="8px";g.style.marginTop=
-"16px";g.setAttribute("type",m?"radio":"checkbox");m="geCheckbox-"+Editor.guid();g.id=m;null!=p&&g.setAttribute("name",p);c&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);d&&g.setAttribute("disabled","disabled");l&&(a.appendChild(g),c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",m),a.appendChild(c),f||mxUtils.br(a));return g};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(),g="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(g=window.location.href);var k=document.createElement("select");k.style.width="120px";k.style.marginLeft="8px";k.style.marginRight="10px";k.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));k.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");
-k.appendChild(d);a.appendChild(k);mxEvent.addListener(k,"change",mxUtils.bind(this,function(){if("custom"==k.value){var a=new FilenameDialog(this,g,mxResources.get("ok"),function(a){null!=a?g=a:k.value="blank"},mxResources.get("url"),null,null,null,null,function(){k.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)?k.removeAttribute("disabled"):k.setAttribute("disabled","disabled")}));
-mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===k.value?"_blank":g:null},getEditInput:function(){return c},getEditSelect:function(){return k}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){f.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=k&&k!=mxConstants.NONE?"border:1px solid black;background-color:"+k:"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 g=document.createElement("option");g.setAttribute("value","auto");mxUtils.write(g,mxResources.get("automatic"));d.appendChild(g);g=document.createElement("option");g.setAttribute("value","blank");mxUtils.write(g,mxResources.get("openInNewWindow"));d.appendChild(g);g=document.createElement("option");g.setAttribute("value",
-"self");mxUtils.write(g,mxResources.get("openInThisWindow"));d.appendChild(g);b&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(g));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var k="#0000ff",f=null,f=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(k||"none",function(a){k=a;c()});mxEvent.consume(a)}));c();f.style.padding=mxClient.IS_FF?
-"4px 2px 4px 2px":"4px";f.style.marginLeft="4px";f.style.height="22px";f.style.width="22px";f.style.position="relative";f.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";f.className="geColorBtn";a.appendChild(f);mxUtils.br(a);return{getColor:function(){return k},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,f,l,m,p){var g=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!=f&&0<f.length&&k.push("edit="+encodeURIComponent(f)),l&&k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&k.push("page-id="+this.currentPage.getId());a=!0;null!=m?c="#U"+encodeURIComponent(m):(g=this.getCurrentFile(),p||null==g||g.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,
-null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+g.getHash(),a=!1));a&&null!=g&&null!=g.getTitle()&&g.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(g.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,f,l,m,p,n,x,C){this.getBasenames();
-var g={};""!=f&&f!=mxConstants.NONE&&(g.highlight=f);"auto"!==d&&(g.target=d);n||(g.lightbox=!1);g.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(g.zoom=c/100);c=[];m&&(c.push("pages"),g.resize=!0,null!=this.pages&&null!=this.currentPage&&(g.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),g.resize=!0);p&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),g.toolbar=c.join(" "));null!=x&&0<x.length&&(g.edit=x);null!=a?g.url=a:g.xml=this.getFileData(!0,
-null,null,null,null,!m);b='<div class="mxgraph" style="'+(l?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(g))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";C(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+
-"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,mxResources.get("html"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";g.appendChild(k);var f=document.createElement("div");f.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");k=l.cloneNode(!0);k.setAttribute("value","copy");f.appendChild(k);var q=document.createElement("span");mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram"));f.appendChild(q);mxUtils.br(f);f.appendChild(l);q=document.createElement("span");mxUtils.write(q,mxResources.get("publicDiagramUrl"));f.appendChild(q);var m=this.getCurrentFile();
-null==c&&null!=m&&m.constructor==window.DriveFile&&(q=document.createElement("a"),q.style.paddingLeft="12px",q.style.color="gray",q.setAttribute("href","javascript:void(0);"),mxUtils.write(q,mxResources.get("share")),f.appendChild(q),mxEvent.addListener(q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));k.setAttribute("checked","checked");null==c&&l.setAttribute("disabled","disabled");g.appendChild(f);var p=this.addLinkSection(g),n=this.addCheckbox(g,
-mxResources.get("zoom"),!0,null,!0);mxUtils.write(g,":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.style.marginRight="12px";v.value="100%";g.appendChild(v);var u=this.addCheckbox(g,mxResources.get("fit"),!0),f=null!=this.pages&&1<this.pages.length,E=E=this.addCheckbox(g,mxResources.get("allPages"),f,!f),I=this.addCheckbox(g,mxResources.get("layers"),!0),K=this.addCheckbox(g,mxResources.get("lightbox"),
-!0),J=this.addEditButton(g,K),H=J.getEditInput();H.style.marginBottom="16px";mxEvent.addListener(K,"change",function(){K.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled");H.checked&&K.checked?J.getEditSelect().removeAttribute("disabled"):J.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,g,mxUtils.bind(this,function(){d(l.checked?c:null,n.checked,v.value,p.getTarget(),p.getColor(),u.checked,E.checked,I.checked,K.checked,J.getLink())}),null,a,
-b);this.showDialog(a.container,340,384,!0,!0);k.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,f,l){var g=document.createElement("div");g.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";g.appendChild(k);var q=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=q&&q.constructor==window.DriveFile&&
-!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",m=document.createElement("div");m.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var t=document.createElement("div");t.style.whiteSpace="normal";mxUtils.write(t,mxResources.get("linkAccountRequired"));m.appendChild(t);t=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(q.getId())}));t.style.marginTop=
-"12px";t.className="geBtn";m.appendChild(t);g.appendChild(m);t=document.createElement("a");t.style.paddingLeft="12px";t.style.color="gray";t.style.fontSize="11px";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("check"));m.appendChild(t);mxEvent.addListener(t,"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 p=null,n=null;if(null!=c||null!=d)a+=30,mxUtils.write(g,mxResources.get("width")+":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.marginRight="16px",p.style.width="50px",p.style.marginLeft="6px",p.style.marginRight="16px",p.style.marginBottom="10px",p.value="100%",g.appendChild(p),mxUtils.write(g,mxResources.get("height")+":"),
-n=document.createElement("input"),n.setAttribute("type","text"),n.style.width="50px",n.style.marginLeft="6px",n.style.marginBottom="10px",n.value=d+"px",g.appendChild(n),mxUtils.br(g);var v=this.addLinkSection(g,l);c=null!=this.pages&&1<this.pages.length;var u=null;if(null==q||q.constructor!=window.DriveFile||b)u=this.addCheckbox(g,mxResources.get("allPages"),c,!c);var y=this.addCheckbox(g,mxResources.get("lightbox"),!0),K=this.addEditButton(g,y),J=K.getEditInput(),H=this.addCheckbox(g,mxResources.get("layers"),
-!0);H.style.marginLeft=J.style.marginLeft;H.style.marginBottom="16px";H.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(H.removeAttribute("disabled"),J.removeAttribute("disabled")):(H.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"));J.checked&&y.checked?K.getEditSelect().removeAttribute("disabled"):K.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){f(v.getTarget(),v.getColor(),null==u?
-!0:u.checked,y.checked,K.getLink(),H.checked,null!=p?p.value:null,null!=n?n.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=p?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)):v.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d,f){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,
-mxResources.get("image"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(f?"10":"4")+"px";g.appendChild(k);if(f){mxUtils.write(g,mxResources.get("zoom")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.style.marginRight="12px";l.value=this.lastExportZoom||"100%";g.appendChild(l);mxUtils.write(g,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";g.appendChild(q);mxUtils.br(g)}var m=this.addCheckbox(g,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),p=d?null:this.addCheckbox(g,mxResources.get("includeCopyOfMyDiagram"),!0),k=this.editor.graph,n=d?null:this.addCheckbox(g,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background);null!=n&&(n.style.marginBottom="16px");a=
-new CustomDialog(this,g,mxUtils.bind(this,function(){var a=parseInt(l.value)/100||1,b=parseInt(q.value)||0;c(!m.checked,null!=p?p.checked:!1,null!=n?n.checked:!1,a,b)}),null,a,b);this.showDialog(a.container,300,(f?25:0)+(d?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,f,l,m,p){m=null!=m?m:!0;var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=this.editor.graph,q="jpeg"==p?196:300,t=document.createElement("h3");mxUtils.write(t,a);t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";
-g.appendChild(t);mxUtils.write(g,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";g.appendChild(n);mxUtils.write(g,mxResources.get("borderWidth")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.value=this.lastExportBorder||
-"0";g.appendChild(v);mxUtils.br(g);var u=this.addCheckbox(g,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=p),z=this.addCheckbox(g,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),y=document.createElement("input");y.style.marginTop="16px";y.style.marginRight="8px";y.style.marginLeft="24px";y.setAttribute("disabled","disabled");y.setAttribute("type","checkbox");l&&(g.appendChild(y),mxUtils.write(g,mxResources.get("crop")),mxUtils.br(g),q+=26,mxEvent.addListener(z,"change",function(){z.checked?
-y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(y.setAttribute("checked","checked"),y.defaultChecked=!0);var A=this.addCheckbox(g,mxResources.get("shadow"),k.shadowVisible),H=document.createElement("input");H.style.marginTop="16px";H.style.marginRight="8px";H.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||H.setAttribute("disabled","disabled");b&&(g.appendChild(H),mxUtils.write(g,mxResources.get("embedImages")),mxUtils.br(g),q+=
-26);var L=null;if("png"==p||"jpeg"==p)L=this.addCheckbox(g,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),q+=26;var N=this.addCheckbox(g,mxResources.get("includeCopyOfMyDiagram"),m,null,null,"jpeg"!=p),S=null!=this.pages&&1<this.pages.length,aa=this.addCheckbox(g,S?mxResources.get("allPages"):"",S,!S,null,"jpeg"!=p);aa.style.marginLeft="24px";aa.style.marginBottom="16px";S||(aa.style.display="none");mxEvent.addListener(N,"change",function(){N.checked&&S?aa.removeAttribute("disabled"):
-aa.setAttribute("disabled","disabled")});m&&S||aa.setAttribute("disabled","disabled");var U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginRight="10px";U.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));U.appendChild(a);a=document.createElement("option");
-a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));U.appendChild(a);"svg"==p&&(mxUtils.write(g,mxResources.get("links")+":"),g.appendChild(U),mxUtils.br(g),mxUtils.br(g),q+=26);c=new CustomDialog(this,g,mxUtils.bind(this,function(){this.lastExportBorder=v.value;this.lastExportZoom=n.value;f(n.value,u.checked,!z.checked,A.checked,N.checked,H.checked,v.value,y.checked,!aa.checked,U.value,null!=L?L.checked:null)}),null,c,d);this.showDialog(c.container,340,q,!0,!0,null,
-null,null,null,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,f){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=this.editor.graph;if(null!=b){var l=document.createElement("h3");mxUtils.write(l,b);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";g.appendChild(l)}var q=this.addCheckbox(g,mxResources.get("fit"),
-!0),m=this.addCheckbox(g,mxResources.get("shadow"),k.shadowVisible&&d,!d),p=this.addCheckbox(g,c),n=this.addCheckbox(g,mxResources.get("lightbox"),!0),v=this.addEditButton(g,n),u=v.getEditInput(),y=1<k.model.getChildCount(k.model.getRoot()),I=this.addCheckbox(g,mxResources.get("layers"),y,!y);I.style.marginLeft=u.style.marginLeft;I.style.marginBottom="12px";I.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(y&&I.removeAttribute("disabled"),u.removeAttribute("disabled")):
-(I.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"));u.checked&&n.checked?v.getEditSelect().removeAttribute("disabled"):v.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){a(q.checked,m.checked,p.checked,n.checked,v.getLink(),I.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,f,l,m,p){function g(b){var g=" ",q="";d&&(g=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(f?"&edit=_blank":"")+(l?"&layers=1":"")+"');}})(this);\"",q+="cursor:pointer;");a&&(q+="max-width:100%;");var t="";c&&(t=' width="'+Math.round(k.width)+'" height="'+Math.round(k.height)+'"');m('<img src="'+b+'"'+t+(""!=q?' style="'+q+'"':"")+g+"/>")}var k=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");g(a)}),null,null,null,
-mxUtils.bind(this,function(a){p({message:mxResources.get("unknownError")})}),null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),k.width*k.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var q="";c&&(q="&w="+Math.round(2*k.width)+"&h="+Math.round(2*k.height));var t=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+q+"&xml="+encodeURIComponent(b));t.send(mxUtils.bind(this,function(){200<=t.getStatus()&&299>=t.getStatus()?g("data:image/png;base64,"+t.getText()):p({message:mxResources.get("unknownError")})}))}else p({message:mxResources.get("drawingTooLarge")})};
-EditorUi.prototype.createEmbedSvg=function(a,b,c,d,f,l,m){var g=this.editor.graph.getSvg(),k=g.getElementsByTagName("a");if(null!=k)for(var q=0;q<k.length;q++){var t=k[q].getAttribute("href");null!=t&&"#"==t.charAt(0)&&"_blank"==k[q].getAttribute("target")&&k[q].removeAttribute("target")}d&&g.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(g);if(c){var p=" ",n="";d&&(p="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(f?"&edit=_blank":"")+(l?"&layers=1":"")+"');}})(this);\"",n+="cursor:pointer;");a&&(n+="max-width:100%;");this.convertImages(g,mxUtils.bind(this,function(a){m('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=n?' style="'+n+'"':"")+p+"/>")}))}else n="",d&&(g.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(f?"&edit=_blank":"")+(l?"&layers=1":"")+"');}}})(this);"),n+="cursor:pointer;"),a&&(a=parseInt(g.getAttribute("width")),b=parseInt(g.getAttribute("height")),g.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),n+="max-width:100%;max-height:"+b+"px;",g.removeAttribute("height")),""!=n&&g.setAttribute("style",n),m(mxUtils.getXml(g))};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");
+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"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,f){return this.createEchoRequest(c,a,d,e,b,f)}),c,e,d)};EditorUi.prototype.saveRequest=function(a,
+b,c,d,e,k,g){g=null!=g?g:!mxClient.IS_IOS||!navigator.standalone;var f=this.getServiceCount(!1);isLocalStorage&&f++;var l=4>=f?2:6<f?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,f){if("_blank"==f||null!=a&&0<a.length){var l=c("_blank"==f?null:a,f==App.MODE_DEVICE||"download"==f||null==f||"_blank"==f?"0":"1");null!=l&&(f==App.MODE_DEVICE||"download"==f||"_blank"==f?l.simulate(document,"_blank"):this.pickFolder(f,mxUtils.bind(this,function(c){k=null!=k?k:"pdf"==b?"application/pdf":"image/"+
+b;if(null!=d)try{this.exportFile(d,a,k,!0,f,c)}catch(F){this.handleError(F)}else this.spinner.spin(document.body,mxResources.get("saving"))&&l.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=l.getStatus()&&299>=l.getStatus())try{this.exportFile(l.getText(),a,k,!0,f,c)}catch(F){this.handleError(F)}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,g,null,1<f,l,d,k,e);f=this.isServices(f)?4<f?390:270:160;this.showDialog(a.container,380,f,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,k){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,k,g,n,m,x){if(this.spinner.spin(document.body,mxResources.get("export"))){var f=
+this.editor.graph.isSelectionEmpty();c=null!=c?c:f;f=b?null:this.editor.graph.background;f==mxConstants.NONE&&(f=null);null==f&&0==b&&(f="#ffffff");var l=this.editor.graph.getSvg(f,a,g,n,null,c,null,null,"blank"==x?"_blank":"self"==x?"_top":null);d&&this.editor.graph.addSvgShadow(l);var p=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,m,null,null,null,!1));if(null!=this.editor.fontCss){var b=a.ownerDocument,
+b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var 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);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(p,"svg",d,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},
+mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor.graph,l,!1,mxUtils.bind(this,function(){k?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(l,t,this.thumbImageCache)):t(l)}))}};EditorUi.prototype.addRadiobox=function(a,b,c,d,e,k,g){return this.addCheckbox(a,c,d,e,k,g,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,k,g,n){k=null!=k?k:!0;var f=document.createElement("input");f.style.marginRight="8px";f.style.marginTop=
+"16px";f.setAttribute("type",g?"radio":"checkbox");g="geCheckbox-"+Editor.guid();f.id=g;null!=n&&f.setAttribute("name",n);c&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);d&&f.setAttribute("disabled","disabled");k&&(a.appendChild(f),c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",g),a.appendChild(c),e||mxUtils.br(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 l=document.createElement("select");l.style.width="120px";l.style.marginLeft="8px";l.style.marginRight="10px";l.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));l.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");
+l.appendChild(d);a.appendChild(l);mxEvent.addListener(l,"change",mxUtils.bind(this,function(){if("custom"==l.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:l.value="blank"},mxResources.get("url"),null,null,null,null,function(){l.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)?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled")}));
+mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===l.value?"_blank":f:null},getEditInput:function(){return c},getEditSelect:function(){return l}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){e.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=l&&l!=mxConstants.NONE?"border:1px solid black;background-color:"+l:"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 l="#0000ff",e=null,e=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(l||"none",function(a){l=a;c()});mxEvent.consume(a)}));c();e.style.padding=mxClient.IS_FF?
+"4px 2px 4px 2px":"4px";e.style.marginLeft="4px";e.style.height="22px";e.style.width="22px";e.style.position="relative";e.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";e.className="geColorBtn";a.appendChild(e);mxUtils.br(a);return{getColor:function(){return l},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,k,g,n){var f=this.getCurrentFile(),l=[];d&&(l.push("lightbox=1"),"auto"!=a&&l.push("target="+a),null!=
+b&&b!=mxConstants.NONE&&l.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&l.push("edit="+encodeURIComponent(e)),k&&l.push("layers=1"),this.editor.graph.foldingEnabled&&l.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&l.push("page-id="+this.currentPage.getId());a=!0;null!=g?c="#U"+encodeURIComponent(g):(f=this.getCurrentFile(),n||null==f||f.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,
+null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+f.getHash(),a=!1));a&&null!=f&&null!=f.getTitle()&&f.getTitle()!=this.defaultFilename&&l.push("title="+encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host+"/")+(0<l.length?"?"+l.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,e,k,g,n,m,x,B){this.getBasenames();
+var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);m||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(f.zoom=c/100);c=[];g&&(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);n&&c.push("layers");0<c.length&&(m&&c.push("lightbox"),f.toolbar=c.join(" "));null!=x&&0<x.length&&(f.edit=x);null!=a?f.url=a:f.xml=this.getFileData(!0,
+null,null,null,null,!g);b='<div class="mxgraph" style="'+(k?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";B(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+
+"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var l=document.createElement("h3");mxUtils.write(l,mxResources.get("html"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(l);var e=document.createElement("div");e.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");l=k.cloneNode(!0);l.setAttribute("value","copy");e.appendChild(l);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));e.appendChild(p);mxUtils.br(e);e.appendChild(k);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));e.appendChild(p);var g=this.getCurrentFile();
+null==c&&null!=g&&g.constructor==window.DriveFile&&(p=document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href","javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),e.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(g.getId())})));l.setAttribute("checked","checked");null==c&&k.setAttribute("disabled","disabled");f.appendChild(e);var n=this.addLinkSection(f),m=this.addCheckbox(f,
+mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.style.marginRight="12px";u.value="100%";f.appendChild(u);var q=this.addCheckbox(f,mxResources.get("fit"),!0),e=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(f,mxResources.get("allPages"),e,!e),H=this.addCheckbox(f,mxResources.get("layers"),!0),J=this.addCheckbox(f,mxResources.get("lightbox"),
+!0),I=this.addEditButton(f,J),G=I.getEditInput();G.style.marginBottom="16px";mxEvent.addListener(J,"change",function(){J.checked?G.removeAttribute("disabled"):G.setAttribute("disabled","disabled");G.checked&&J.checked?I.getEditSelect().removeAttribute("disabled"):I.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(k.checked?c:null,m.checked,u.value,n.getTarget(),n.getColor(),q.checked,D.checked,H.checked,J.checked,I.getLink())}),null,a,
+b);this.showDialog(a.container,340,384,!0,!0);l.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,k){var f=document.createElement("div");f.style.whiteSpace="nowrap";var l=document.createElement("h3");mxUtils.write(l,a||mxResources.get("link"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(l);var p=this.getCurrentFile(),l="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=p&&p.constructor==window.DriveFile&&
+!b){a=80;var l="https://desk.draw.io/support/solutions/articles/16000039384",g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var t=document.createElement("div");t.style.whiteSpace="normal";mxUtils.write(t,mxResources.get("linkAccountRequired"));g.appendChild(t);t=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(p.getId())}));t.style.marginTop=
+"12px";t.className="geBtn";g.appendChild(t);f.appendChild(g);t=document.createElement("a");t.style.paddingLeft="12px";t.style.color="gray";t.style.fontSize="11px";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("check"));g.appendChild(t);mxEvent.addListener(t,"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 n=null,m=null;if(null!=c||null!=d)a+=30,mxUtils.write(f,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",f.appendChild(n),mxUtils.write(f,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",f.appendChild(m),mxUtils.br(f);var u=this.addLinkSection(f,k);c=null!=this.pages&&1<this.pages.length;var q=null;if(null==p||p.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var v=this.addCheckbox(f,mxResources.get("lightbox"),!0),J=this.addEditButton(f,v),I=J.getEditInput(),G=this.addCheckbox(f,mxResources.get("layers"),
+!0);G.style.marginLeft=I.style.marginLeft;G.style.marginBottom="16px";G.style.marginTop="8px";mxEvent.addListener(v,"change",function(){v.checked?(G.removeAttribute("disabled"),I.removeAttribute("disabled")):(G.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"));I.checked&&v.checked?J.getEditSelect().removeAttribute("disabled"):J.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(u.getTarget(),u.getColor(),null==q?
+!0:q.checked,v.checked,J.getLink(),G.checked,null!=n?n.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),l);this.showDialog(b.container,340,254+a,!0,!0);null!=n?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d,e){var f=document.createElement("div");f.style.whiteSpace="nowrap";var l=document.createElement("h3");mxUtils.write(l,
+mxResources.get("image"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(e?"10":"4")+"px";f.appendChild(l);if(e){mxUtils.write(f,mxResources.get("zoom")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.marginRight="16px";k.style.width="60px";k.style.marginLeft="4px";k.style.marginRight="12px";k.value=this.lastExportZoom||"100%";f.appendChild(k);mxUtils.write(f,mxResources.get("borderWidth")+":");var p=document.createElement("input");p.setAttribute("type",
+"text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";f.appendChild(p);mxUtils.br(f)}var g=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),n=d?null:this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),!0),l=this.editor.graph,m=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),l.background==mxConstants.NONE||null==l.background);null!=m&&(m.style.marginBottom="16px");a=
+new CustomDialog(this,f,mxUtils.bind(this,function(){var a=parseInt(k.value)/100||1,b=parseInt(p.value)||0;c(!g.checked,null!=n?n.checked:!1,null!=m?m.checked:!1,a,b)}),null,a,b);this.showDialog(a.container,300,(e?25:0)+(d?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,k,g,n){g=null!=g?g:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var l=this.editor.graph,p="jpeg"==n?196:300,t=document.createElement("h3");mxUtils.write(t,a);t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";
+f.appendChild(t);mxUtils.write(f,mxResources.get("zoom")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="12px";m.value=this.lastExportZoom||"100%";f.appendChild(m);mxUtils.write(f,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||
+"0";f.appendChild(u);mxUtils.br(f);var q=this.addCheckbox(f,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=n),v=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,l.isSelectionEmpty()),y=document.createElement("input");y.style.marginTop="16px";y.style.marginRight="8px";y.style.marginLeft="24px";y.setAttribute("disabled","disabled");y.setAttribute("type","checkbox");k&&(f.appendChild(y),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),p+=26,mxEvent.addListener(v,"change",function(){v.checked?
+y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));l.isSelectionEmpty()||(y.setAttribute("checked","checked"),y.defaultChecked=!0);var z=this.addCheckbox(f,mxResources.get("shadow"),l.shadowVisible),G=document.createElement("input");G.style.marginTop="16px";G.style.marginRight="8px";G.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||G.setAttribute("disabled","disabled");b&&(f.appendChild(G),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),p+=
+26);var K=null;if("png"==n||"jpeg"==n)K=this.addCheckbox(f,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),p+=26;var Q=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),g,null,null,"jpeg"!=n),N=null!=this.pages&&1<this.pages.length,Y=this.addCheckbox(f,N?mxResources.get("allPages"):"",N,!N,null,"jpeg"!=n);Y.style.marginLeft="24px";Y.style.marginBottom="16px";N||(Y.style.display="none");mxEvent.addListener(Q,"change",function(){Q.checked&&N?Y.removeAttribute("disabled"):
+Y.setAttribute("disabled","disabled")});g&&N||Y.setAttribute("disabled","disabled");var T=document.createElement("select");T.style.maxWidth="260px";T.style.marginLeft="8px";T.style.marginRight="10px";T.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));T.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));T.appendChild(a);a=document.createElement("option");
+a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));T.appendChild(a);"svg"==n&&(mxUtils.write(f,mxResources.get("links")+":"),f.appendChild(T),mxUtils.br(f),mxUtils.br(f),p+=26);c=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=m.value;e(m.value,q.checked,!v.checked,z.checked,Q.checked,G.checked,u.value,y.checked,!Y.checked,T.value,null!=K?K.checked:null)}),null,c,d);this.showDialog(c.container,340,p,!0,!0,null,
+null,null,null,!0);m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var f=document.createElement("div");f.style.whiteSpace="nowrap";var l=this.editor.graph;if(null!=b){var k=document.createElement("h3");mxUtils.write(k,b);k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(k)}var p=this.addCheckbox(f,mxResources.get("fit"),
+!0),g=this.addCheckbox(f,mxResources.get("shadow"),l.shadowVisible&&d,!d),n=this.addCheckbox(f,c),m=this.addCheckbox(f,mxResources.get("lightbox"),!0),u=this.addEditButton(f,m),q=u.getEditInput(),v=1<l.model.getChildCount(l.model.getRoot()),H=this.addCheckbox(f,mxResources.get("layers"),v,!v);H.style.marginLeft=q.style.marginLeft;H.style.marginBottom="12px";H.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(v&&H.removeAttribute("disabled"),q.removeAttribute("disabled")):
+(H.setAttribute("disabled","disabled"),q.setAttribute("disabled","disabled"));q.checked&&m.checked?u.getEditSelect().removeAttribute("disabled"):u.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){a(p.checked,g.checked,n.checked,m.checked,u.getLink(),H.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,k,g,n){function f(b){var f=" ",p="";d&&(f=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(e?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",p+="cursor:pointer;");a&&(p+="max-width:100%;");var n="";c&&(n=' width="'+Math.round(l.width)+'" height="'+Math.round(l.height)+'"');g('<img src="'+b+'"'+n+(""!=p?' style="'+p+'"':"")+f+"/>")}var l=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");f(a)}),null,null,null,
+mxUtils.bind(this,function(a){n({message:mxResources.get("unknownError")})}),null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),l.width*l.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var p="";c&&(p="&w="+Math.round(2*l.width)+"&h="+Math.round(2*l.height));var t=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+p+"&xml="+encodeURIComponent(b));t.send(mxUtils.bind(this,function(){200<=t.getStatus()&&299>=t.getStatus()?f("data:image/png;base64,"+t.getText()):n({message:mxResources.get("unknownError")})}))}else n({message:mxResources.get("drawingTooLarge")})};
+EditorUi.prototype.createEmbedSvg=function(a,b,c,d,e,k,g){var f=this.editor.graph.getSvg(),l=f.getElementsByTagName("a");if(null!=l)for(var p=0;p<l.length;p++){var n=l[p].getAttribute("href");null!=n&&"#"==n.charAt(0)&&"_blank"==l[p].getAttribute("target")&&l[p].removeAttribute("target")}d&&f.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(f);if(c){var t=" ",m="";d&&(t="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(e?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");a&&(m+="max-width:100%;");this.convertImages(f,mxUtils.bind(this,function(a){g('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=m?' style="'+m+'"':"")+t+"/>")}))}else m="",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('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(e?"&edit=_blank":"")+(k?"&layers=1":"")+"');}}})(this);"),m+="cursor:pointer;"),a&&(a=parseInt(f.getAttribute("width")),b=parseInt(f.getAttribute("height")),f.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),m+="max-width:100%;max-height:"+b+"px;",f.removeAttribute("height")),""!=m&&f.setAttribute("style",m),g(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){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,
-function(){d()}))}),0)):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],g=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:g.apply(this,arguments)}}}null!=c&&(a=Editor.parseDiagramNode(c))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(t){}finally{this.editor.graph=
-d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){try{var d=this.editor.graph,g=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),g=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),k=d.getGlobalVariable,f=this.pages[0];d.getGlobalVariable=function(a){return"page"==
-a?f.getName():"pagenumber"==a?1:k.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(f.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==g&&(g=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var k=c.toDataURL("image/png"),k=this.writeGraphModelToPng(k,"tEXt","mxfile",encodeURIComponent(g));a(k.substring(k.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(x){null!=b&&b(x)}}),null,null,null,mxUtils.bind(this,
-function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)}catch(z){null!=b&&b(z)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,f,l,m){m=b.background;m==mxConstants.NONE&&(m=null);l=b.getSvg(m,null,null,null,null,l);b.shadowVisible&&b.addSvgShadow(l);null!=a&&l.setAttribute("content",a);null!=c&&l.setAttribute("resource",c);if(null!=f)this.convertImages(l,mxUtils.bind(this,function(a){f((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(l)};EditorUi.prototype.exportImage=function(a,b,c,d,f,l,m,p,n,x,C){n=null!=n?n:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,
-function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,p):null,n,!p,C)}catch(F){"Invalid image"==F.message?this.downloadFile(n):this.handleError(F)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,l,m,x)}catch(B){this.spinner.stop(),this.handleError(B)}}};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,g={},f=mxUtils.bind(this,function(){if(0==d){for(var k=[c[0]],f=1;f<c.length;f++){var l=c[f].indexOf(")");k.push('url("');k.push(g[b(c[f].substring(0,l))]);k.push('"'+c[f].substring(l))}this.editor.resolvedFontCss=k.join("");a()}});if(0<c.length)for(var l=1;l<c.length;l++){var m=c[l].indexOf(")"),p=null,n=c[l].indexOf("format(",m);0<n&&(p=b(c[l].substring(n+7,c[l].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==
-g[a]){g[a]=a;d++;var b="application/x-font-ttf";if("svg"==p||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==p||"embedded-opentype"==p||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==p||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==p||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==p||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==p||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=
-a;/^https?:\/\//.test(c)&&!this.editor.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){g[a]=b;d--;f()}),mxUtils.bind(this,function(a){d--;f()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[l].substring(0,m)),p)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,f,l,m,p,n,x,C,u,B,F,E){try{l=null!=l?l:!0;m=null!=m?m:!0;u=null!=u?u:this.editor.graph;B=null!=B?B:0;var g=n?null:u.background;g==mxConstants.NONE&&(g=null);
-null==g&&(g=d);null==g&&0==n&&(g="#ffffff");this.convertImages(u.getSvg(null,null,null,F,null,m,null,null,null,x),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var k=function(){mxClient.IS_SF?window.setTimeout(function(){n.drawImage(d,B/p,B/p);a(q)},0):(n.drawImage(d,B/p,B/p),a(q))},q=document.createElement("canvas"),m=parseInt(c.getAttribute("width")),t=parseInt(c.getAttribute("height"));p=null!=p?p:1;null!=b&&(p=l?Math.min(1,Math.min(3*b/(4*t),b/m)):b/m);
-m=Math.ceil(p*m)+2*B;t=Math.ceil(p*t)+2*B;q.setAttribute("width",m);q.setAttribute("height",t);var n=q.getContext("2d");null!=g&&(n.beginPath(),n.rect(0,0,m,t),n.fillStyle=g,n.fill());n.scale(p,p);if(E){var x=u.view,C=btoa(unescape(encodeURIComponent(x.createSvgGrid(x.gridColor)))),C="data:image/svg+xml;base64,"+C,v=u.gridSize*x.gridSteps*p,y=u.getGraphBounds(),z=y.x*p,A=y.y*p,G=new Image;G.src=C;G.onload=function(){for(var a=-Math.round(v-mxUtils.mod(x.translate.x*p-z,v)),b=-Math.round(v-mxUtils.mod(x.translate.y*
-p-A,v));a<m;a+=v)for(var c=b;c<t;c+=v)n.drawImage(G,a/p,c/p);k()}}else k()}catch(ca){null!=f&&f(ca)}});d.onerror=function(a){null!=f&&f(a)};try{x&&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(u,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});
-this.loadFonts(k)}catch(L){null!=f&&f(L)}}),c,C)}catch(K){null!=f&&f(K)}};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var g="http://"==d.substring(0,7)||"https://"==d.substring(0,8);g&&!navigator.onLine?d=c.svgBrokenImage.src:!g||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.editor.isCorsEnabledForUrl(d)?"chrome-extension://"==d.substring(0,19)||mxClient.IS_CHROMEAPP||
-(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var g=0,k=c||{};c=mxUtils.bind(this,function(c,f){for(var l=a.getElementsByTagName(c),q=0;q<l.length;q++)mxUtils.bind(this,function(c){try{if(null!=c){var l=d.convert(c.getAttribute(f));if(null!=l&&"data:"!=l.substring(0,5)){var q=k[l];null==q?(g++,this.convertImageToDataUri(l,function(d){null!=d&&(k[l]=d,c.setAttribute(f,
-d));g--;0==g&&b(a)})):c.setAttribute(f,q)}else null!=l&&c.setAttribute(f,l)}}catch(F){}})(l[q])});c("image","xlink:href");c("img","src");0==g&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,f,l,m){try{var g=!m&&(d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));f=null!=f?f:!0;var k=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText();if(g){if((9==document.documentMode||
-10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),k=0;k<a.length;k++)d[k]=String.fromCharCode(a[k]);d=d.join("")}l=null!=l?l:"data:image/png;base64,";d=l+this.base64Encode(d)}b(d)}}else null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()})},g,this.timeout,function(){f&&null!=c&&c({code:App.ERROR_TIMEOUT,
-retry:k})})});k()}catch(x){null!=c&&c(x)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){try{var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b(this.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(d);c&&b(this.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(d);c&&b(this.svgBrokenImage.src)});
-else{var g=new Image,k=this;this.crossOriginImages&&(g.crossOrigin="anonymous");g.onload=function(){window.clearTimeout(d);if(c)try{var a=document.createElement("canvas"),f=a.getContext("2d");a.height=g.height;a.width=g.width;f.drawImage(g,0,0);b(a.toDataURL())}catch(D){b(k.svgBrokenImage.src)}};g.onerror=function(){window.clearTimeout(d);c&&b(k.svgBrokenImage.src)};g.src=a}}catch(A){b(this.svgBrokenImage.src)}};EditorUi.prototype.importXml=function(a,b,c,d,f){b=null!=b?b:0;c=null!=c?c:0;var g=[];
-try{var k=this.editor.graph;if(null!=a&&0<a.length){k.model.beginUpdate();try{var l=mxUtils.parseXml(a),q=this.editor.extractGraphModel(l.documentElement,null!=this.pages);if(null!=q&&"mxfile"==q.nodeName&&null!=this.pages){var m=q.getElementsByTagName("diagram");if(1==m.length)q=Editor.parseDiagramNode(m[0]);else if(1<m.length){a={};var l=[],p=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(q=Editor.parseDiagramNode(m[0]),d=!1,p=1);for(;p<m.length;p++){var n=m[p].getAttribute("id");
-m[p].removeAttribute("id");var v=this.updatePageRoot(new DiagramPage(m[p]));a[n]=m[p].getAttribute("id");var u=this.pages.length;null==v.getName()&&v.setName(mxResources.get("pageWithNumber",[u+1]));k.model.execute(new ChangePage(this,v,v,u,!0));l.push(v)}this.updatePageLinks(a,l)}}null!=q&&"mxGraphModel"===q.nodeName&&(g=k.importGraphModel(q,b,c,d))}finally{k.model.endUpdate()}}}catch(E){if(f)throw E;this.handleError(E)}return g};EditorUi.prototype.updatePageLinks=function(a,b){for(var c=0;c<b.length;c++)this.updatePageLinksForCell(a,
-b[c].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var c=document.createElement("div"),d=this.editor.graph,g=d.getLinkForCell(b);null!=g&&d.setLinkForCell(b,this.updatePageLink(a,g));if(d.isHtmlLabel(b)){c.innerHTML=d.getLabel(b);for(var k=c.getElementsByTagName("a"),f=!1,l=0;l<k.length;l++)g=k[l].getAttribute("href"),null!=g&&(k[l].setAttribute("href",this.updatePageLink(a,g)),f=!0);f&&d.labelChanged(b,c.innerHTML)}for(l=0;l<d.model.getChildCount(b);l++)this.updatePageLinksForCell(a,
-d.model.getChildAt(b,l))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var c=a[b.substring(b.indexOf(",")+1)];b=null!=c?"data:page/id,"+c:null}else if("data:action/json,"==b.substring(0,17))try{var d=JSON.parse(b.substring(17));if(null!=d.actions){for(var g=0;g<d.actions.length;g++){var k=d.actions[g];null!=k.open&&"data:page/id,"==k.open.substring(0,13)&&(c=a[k.open.substring(k.open.indexOf(",")+1)],null!=c?k.open="data:page/id,"+c:delete k.open)}b="data:action/json,"+
-JSON.stringify(d)}}catch(A){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};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 g=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var g=this.isRemoteVisioFormat(d);try{var k="UNKNOWN-VISIO",f=d.lastIndexOf(".");0<=f&&f<d.length&&(k=d.substring(f+1).toUpperCase());
-EditorUi.logEvent({category:k+"-MS-IMPORT-FILE",action:"filename_"+d,label:g?"remote":"local"})}catch(x){}if(g)if(null!=VSD_CONVERT_URL){g=new FormData;g.append("file1",a,d);var l=new XMLHttpRequest;l.open("POST",VSD_CONVERT_URL);l.responseType="blob";this.addRemoteServiceSecurityCheck(l);l.onreadystatechange=mxUtils.bind(this,function(){if(4==l.readyState)if(200<=l.status&&299>=l.status)try{var a=l.response;if("text/xml"==a.type){var g=new FileReader;g.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(B){c({message:mxResources.get("errorLoadingFile")})}});
-g.readAsText(a)}else this.doImportVisio(a,b,c,d)}catch(G){c(G)}else c({})});l.send(g)}else c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else try{this.doImportVisio(a,b,c,d)}catch(x){c(x)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?g():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",g))};EditorUi.prototype.importGraphML=
-function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,c)}catch(y){c(y)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,
-function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(k){this.handleError(k)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,
-b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length})}catch(y){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(y){c(y)}}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",
-d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.generatePlantUmlImage=function(a,b,c,d){function g(a,b,c){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|c>>6;c4=c&63;r="";r+=k(c1&63);r+=k(c2&63);r+=k(c3&63);return r+=k(c4&63)}function k(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"}var f=new XMLHttpRequest;f.open("GET",("txt"==b?PLANT_URL+"/txt/":"png"==b?PLANT_URL+"/png/":
-PLANT_URL+"/svg/")+function(a){r="";for(i=0;i<a.length;i+=3)r=i+2==a.length?r+g(a.charCodeAt(i),a.charCodeAt(i+1),0):i+1==a.length?r+g(a.charCodeAt(i),0,0):r+g(a.charCodeAt(i),a.charCodeAt(i+1),a.charCodeAt(i+2));return r}(pako.deflateRaw(a,{to:"string"})),!0);"txt"!=b&&(f.responseType="blob");f.onload=function(a){if(200<=this.status&&300>this.status)if("txt"==b)c(this.response);else{var g=new FileReader;g.readAsDataURL(this.response);g.onloadend=function(a){var b=new Image;b.onload=function(){var a=
-b.width,d=b.height;if(0==a&&0==d){var k=g.result,f=k.indexOf(","),k=decodeURIComponent(escape(atob(k.substring(f+1)))),k=mxUtils.parseXml(k).getElementsByTagName("svg");0<k.length&&(a=parseFloat(k[0].getAttribute("width")),d=parseFloat(k[0].getAttribute("height")))}c(g.result,a,d)};b.src=g.result};g.onerror=function(a){d(a)}}else d(a)};f.onerror=function(a){d(a)};f.send()};EditorUi.prototype.insertAsPreText=function(a,b,c){var d=this.editor.graph,g=null;d.getModel().beginUpdate();try{g=d.insertVertex(null,
-null,"<pre>"+a+"</pre>",b,c,1,1,"text;html=1;align=left;verticalAlign=top;"),d.updateCellSize(g,!0)}finally{d.getModel().endUpdate()}return g};EditorUi.prototype.insertTextAt=function(a,b,c,d,f,l,m){l=null!=l?l:!0;m=null!=m?m:!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()&&(f||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var g=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var k=this.extractGraphModelFromPng(a),q=this.importXml(k,b,c,l,!0);if(0<q.length)return q}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)),q=this.importXml(k,b,c,l,!0),0<q.length)return q}catch(C){}this.loadImage(a,mxUtils.bind(this,function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,f){g.setSelectionCell(g.insertVertex(null,null,"",g.snap(b),g.snap(c),d,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),m,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);g.setSelectionCell(g.insertVertex(null,null,"",g.snap(b),g.snap(c),k,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var f=null;g.getModel().beginUpdate();try{f=g.insertVertex(g.getDefaultParent(),null,a,g.snap(b),g.snap(c),1,1,"text;"+(d?"html=1;":"")),g.updateCellSize(f),g.fireEvent(new mxEventObject("textInserted","cells",
-[f]))}finally{g.getModel().endUpdate()}g.setSelectionCell(f)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,l);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,c,l))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{g=this.editor.graph;f=null;g.getModel().beginUpdate();try{f=g.insertVertex(g.getDefaultParent(),null,"",g.snap(b),g.snap(c),
-1,1,"text;"+(d?"html=1;":"")),g.fireEvent(new mxEventObject("textInserted","cells",[f])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),a.length>this.maxTextBytes&&(a=a.substring(0,this.maxTextBytes)+"..."),f.value=a,g.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)&&g.setLinkForCell(f,
-f.value),f.geometry.width+=g.gridSize,f.geometry.height+=g.gridSize}finally{g.getModel().endUpdate()}return[f]}}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)};
+function(){d()}))}),0)):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],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&&(a=Editor.parseDiagramNode(c))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(t){}finally{this.editor.graph=
+d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){try{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()),l=d.getGlobalVariable,e=this.pages[0];d.getGlobalVariable=function(a){return"page"==
+a?e.getName():"pagenumber"==a?1:l.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(e.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var l=c.toDataURL("image/png"),l=this.writeGraphModelToPng(l,"tEXt","mxfile",encodeURIComponent(f));a(l.substring(l.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(x){null!=b&&b(x)}}),null,null,null,mxUtils.bind(this,
+function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)}catch(y){null!=b&&b(y)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,e,k,g){g=b.background;g==mxConstants.NONE&&(g=null);k=b.getSvg(g,null,null,null,null,k);b.shadowVisible&&b.addSvgShadow(k);null!=a&&k.setAttribute("content",a);null!=c&&k.setAttribute("resource",c);if(null!=e)this.convertImages(k,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(k)};EditorUi.prototype.exportImage=function(a,b,c,d,e,k,g,n,m,x,B){m=null!=m?m:"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,n):null,m,!n,B)}catch(F){"Invalid image"==F.message?this.downloadFile(m):this.handleError(F)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,k,g,x)}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 l=[c[0]],e=1;e<c.length;e++){var k=c[e].indexOf(")");l.push('url("');l.push(f[b(c[e].substring(0,k))]);l.push('"'+c[e].substring(k))}this.editor.resolvedFontCss=l.join("");a()}});if(0<c.length)for(var k=1;k<c.length;k++){var g=c[k].indexOf(")"),n=null,m=c[k].indexOf("format(",g);0<m&&(n=b(c[k].substring(m+7,c[k].indexOf(")",m))));mxUtils.bind(this,function(a){if(null==
+f[a]){f[a]=a;d++;var b="application/x-font-ttf";if("svg"==n||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=
+a;/^https?:\/\//.test(c)&&!this.editor.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[k].substring(0,g)),n)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,k,g,n,m,x,B,q,A,F,D){try{k=null!=k?k:!0;g=null!=g?g:!0;q=null!=q?q:this.editor.graph;A=null!=A?A:0;var f=m?null:q.background;f==mxConstants.NONE&&(f=null);
+null==f&&(f=d);null==f&&0==m&&(f="#ffffff");this.convertImages(q.getSvg(null,null,null,F,null,g,null,null,null,x),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var l=function(){mxClient.IS_SF?window.setTimeout(function(){t.drawImage(d,A/n,A/n);a(g)},0):(t.drawImage(d,A/n,A/n),a(g))},g=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),m=parseInt(c.getAttribute("height"));n=null!=n?n:1;null!=b&&(n=k?Math.min(1,Math.min(3*b/(4*m),b/p)):b/p);
+p=Math.ceil(n*p)+2*A;m=Math.ceil(n*m)+2*A;g.setAttribute("width",p);g.setAttribute("height",m);var t=g.getContext("2d");null!=f&&(t.beginPath(),t.rect(0,0,p,m),t.fillStyle=f,t.fill());t.scale(n,n);if(D){var x=q.view,u=btoa(unescape(encodeURIComponent(x.createSvgGrid(x.gridColor)))),u="data:image/svg+xml;base64,"+u,B=q.gridSize*x.gridSteps*n,v=q.getGraphBounds(),y=v.x*n,z=v.y*n,E=new Image;E.src=u;E.onload=function(){for(var a=-Math.round(B-mxUtils.mod(x.translate.x*n-y,B)),b=-Math.round(B-mxUtils.mod(x.translate.y*
+n-z,B));a<p;a+=B)for(var c=b;c<m;c+=B)t.drawImage(E,a/n,c/n);l()}}else l()}catch(ba){null!=e&&e(ba)}});d.onerror=function(a){null!=e&&e(a)};try{x&&this.editor.graph.addSvgShadow(c);var l=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(q,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});
+this.loadFonts(l)}catch(K){null!=e&&e(K)}}),c,B)}catch(J){null!=e&&e(J)}};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.editor.isCorsEnabledForUrl(d)?"chrome-extension://"==d.substring(0,19)||mxClient.IS_CHROMEAPP||
+(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var f=0,l=c||{};c=mxUtils.bind(this,function(c,e){for(var k=a.getElementsByTagName(c),g=0;g<k.length;g++)mxUtils.bind(this,function(c){try{if(null!=c){var k=d.convert(c.getAttribute(e));if(null!=k&&"data:"!=k.substring(0,5)){var g=l[k];null==g?(f++,this.convertImageToDataUri(k,function(d){null!=d&&(l[k]=d,c.setAttribute(e,
+d));f--;0==f&&b(a)})):c.setAttribute(e,g)}else null!=k&&c.setAttribute(e,k)}}catch(F){}})(k[g])});c("image","xlink:href");c("img","src");0==f&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,k,g){try{var f=!g&&(d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));e=null!=e?e:!0;var l=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText();if(f){if((9==document.documentMode||
+10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),l=0;l<a.length;l++)d[l]=String.fromCharCode(a[l]);d=d.join("")}k=null!=k?k:"data:image/png;base64,";d=k+this.base64Encode(d)}b(d)}}else null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()})},f,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,
+retry:l})})});l()}catch(x){null!=c&&c(x)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){try{var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b(this.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(d);c&&b(this.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(d);c&&b(this.svgBrokenImage.src)});
+else{var f=new Image,l=this;this.crossOriginImages&&(f.crossOrigin="anonymous");f.onload=function(){window.clearTimeout(d);if(c)try{var a=document.createElement("canvas"),e=a.getContext("2d");a.height=f.height;a.width=f.width;e.drawImage(f,0,0);b(a.toDataURL())}catch(C){b(l.svgBrokenImage.src)}};f.onerror=function(){window.clearTimeout(d);c&&b(l.svgBrokenImage.src)};f.src=a}}catch(z){b(this.svgBrokenImage.src)}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var f=[];
+try{var l=this.editor.graph;if(null!=a&&0<a.length){l.model.beginUpdate();try{var k=mxUtils.parseXml(a),g=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=g&&"mxfile"==g.nodeName&&null!=this.pages){var p=g.getElementsByTagName("diagram");if(1==p.length)g=Editor.parseDiagramNode(p[0]);else if(1<p.length){a={};var k=[],n=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(g=Editor.parseDiagramNode(p[0]),d=!1,n=1);for(;n<p.length;n++){var m=p[n].getAttribute("id");
+p[n].removeAttribute("id");var u=this.updatePageRoot(new DiagramPage(p[n]));a[m]=p[n].getAttribute("id");var q=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[q+1]));l.model.execute(new ChangePage(this,u,u,q,!0));k.push(u)}this.updatePageLinks(a,k)}}null!=g&&"mxGraphModel"===g.nodeName&&(f=l.importGraphModel(g,b,c,d))}finally{l.model.endUpdate()}}}catch(D){if(e)throw D;this.handleError(D)}return f};EditorUi.prototype.updatePageLinks=function(a,b){for(var c=0;c<b.length;c++)this.updatePageLinksForCell(a,
+b[c].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var c=document.createElement("div"),d=this.editor.graph,f=d.getLinkForCell(b);null!=f&&d.setLinkForCell(b,this.updatePageLink(a,f));if(d.isHtmlLabel(b)){c.innerHTML=d.getLabel(b);for(var e=c.getElementsByTagName("a"),l=!1,k=0;k<e.length;k++)f=e[k].getAttribute("href"),null!=f&&(e[k].setAttribute("href",this.updatePageLink(a,f)),l=!0);l&&d.labelChanged(b,c.innerHTML)}for(k=0;k<d.model.getChildCount(b);k++)this.updatePageLinksForCell(a,
+d.model.getChildAt(b,k))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var c=a[b.substring(b.indexOf(",")+1)];b=null!=c?"data:page/id,"+c:null}else if("data:action/json,"==b.substring(0,17))try{var d=JSON.parse(b.substring(17));if(null!=d.actions){for(var f=0;f<d.actions.length;f++){var e=d.actions[f];null!=e.open&&"data:page/id,"==e.open.substring(0,13)&&(c=a[e.open.substring(e.open.indexOf(",")+1)],null!=c?e.open="data:page/id,"+c:delete e.open)}b="data:action/json,"+
+JSON.stringify(d)}}catch(z){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};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 f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var f=this.isRemoteVisioFormat(d);try{var e="UNKNOWN-VISIO",l=d.lastIndexOf(".");0<=l&&l<d.length&&(e=d.substring(l+1).toUpperCase());
+EditorUi.logEvent({category:e+"-MS-IMPORT-FILE",action:"filename_"+d,label:f?"remote":"local"})}catch(x){}if(f)if(null!=VSD_CONVERT_URL){f=new FormData;f.append("file1",a,d);var k=new XMLHttpRequest;k.open("POST",VSD_CONVERT_URL);k.responseType="blob";this.addRemoteServiceSecurityCheck(k);k.onreadystatechange=mxUtils.bind(this,function(){if(4==k.readyState)if(200<=k.status&&299>=k.status)try{var a=k.response;if("text/xml"==a.type){var f=new FileReader;f.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(A){c({message:mxResources.get("errorLoadingFile")})}});
+f.readAsText(a)}else this.doImportVisio(a,b,c,d)}catch(E){c(E)}else c({})});k.send(f)}else c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else try{this.doImportVisio(a,b,c,d)}catch(x){c(x)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.importGraphML=
+function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,c)}catch(v){c(v)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,
+function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(l){this.handleError(l)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,
+b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length})}catch(v){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(v){c(v)}}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",
+d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.generatePlantUmlImage=function(a,b,c,d){function f(a,b,c){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|c>>6;c4=c&63;r="";r+=e(c1&63);r+=e(c2&63);r+=e(c3&63);return r+=e(c4&63)}function e(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"}var l=new XMLHttpRequest;l.open("GET",("txt"==b?PLANT_URL+"/txt/":"png"==b?PLANT_URL+"/png/":
+PLANT_URL+"/svg/")+function(a){r="";for(i=0;i<a.length;i+=3)r=i+2==a.length?r+f(a.charCodeAt(i),a.charCodeAt(i+1),0):i+1==a.length?r+f(a.charCodeAt(i),0,0):r+f(a.charCodeAt(i),a.charCodeAt(i+1),a.charCodeAt(i+2));return r}(pako.deflateRaw(a,{to:"string"})),!0);"txt"!=b&&(l.responseType="blob");l.onload=function(a){if(200<=this.status&&300>this.status)if("txt"==b)c(this.response);else{var f=new FileReader;f.readAsDataURL(this.response);f.onloadend=function(a){var b=new Image;b.onload=function(){var a=
+b.width,d=b.height;if(0==a&&0==d){var e=f.result,l=e.indexOf(","),e=decodeURIComponent(escape(atob(e.substring(l+1)))),e=mxUtils.parseXml(e).getElementsByTagName("svg");0<e.length&&(a=parseFloat(e[0].getAttribute("width")),d=parseFloat(e[0].getAttribute("height")))}c(f.result,a,d)};b.src=f.result};f.onerror=function(a){d(a)}}else d(a)};l.onerror=function(a){d(a)};l.send()};EditorUi.prototype.insertAsPreText=function(a,b,c){var d=this.editor.graph,f=null;d.getModel().beginUpdate();try{f=d.insertVertex(null,
+null,"<pre>"+a+"</pre>",b,c,1,1,"text;html=1;align=left;verticalAlign=top;"),d.updateCellSize(f,!0)}finally{d.getModel().endUpdate()}return f};EditorUi.prototype.insertTextAt=function(a,b,c,d,e,k,g){k=null!=k?k:!0;g=null!=g?g:!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 l=this.extractGraphModelFromPng(a),p=this.importXml(l,b,c,k,!0);if(0<p.length)return p}if("data:image/svg+xml;"==a.substring(0,19))try{if(l=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(l=a.substring(a.indexOf(",")+1),l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0)):l=decodeURIComponent(a.substring(a.indexOf(",")+
+1)),p=this.importXml(l,b,c,k,!0),0<p.length)return p}catch(B){}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)+";"))}),g,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/
+d.height)),l=Math.round(d.width*e);d=Math.round(d.height*e);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),l,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=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,k);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,c,k))}),mxUtils.bind(this,function(a){this.handleError(a)}));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)),a.length>this.maxTextBytes&&(a=a.substring(0,this.maxTextBytes)+"..."),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.isLucidChartData=function(a){return null!=a&&('{"state":"{\\"Properties\\":'==a.substring(0,26)||'{"Properties":'==a.substring(0,14))};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport){if(null==this.importFileInputElt){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.type="",c.type="file",c.value="")}));c.style.display=
"none";document.body.appendChild(c);this.importFileInputElt=c}this.importFileInputElt.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&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var c=new Blob([a],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(a){this.importXml(a,
-0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var g=this.dialog,f=g.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(g,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(a,b,c){var d=this,g=mxUtils.bind(this,function(){this.loadingExtensions=
-!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(g){if(0==Object.keys(g.files).length)c();else{var f=0,k,l=!1;g.forEach(function(a,d){var g=d.name.toLowerCase();"diagram/diagram.xml"==g?(l=!0,d.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):c()})):0==g.indexOf("versions/")&&(g=parseInt(g.substr(9)),g>f&&(f=g,k=d))});0<f?k.async("string").then(function(g){!d.isOffline()&&(new XMLHttpRequest).upload&&d.isRemoteFileFormat(g,a.name)?d.parseFile(new Blob([g],{type:"application/octet-stream"}),
-mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):l||c()}},function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?g():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",g))};EditorUi.prototype.importFile=function(a,b,c,d,f,l,m,p,n,x,C){x=null!=x?x:!0;var g=!1,k=null,q=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,
-a,m)):b=this.importXml(a,c,d,x);null!=p&&p(b)});"image"==b.substring(0,5)?(n=!1,"image/png"==b.substring(0,9)&&(b=C?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,d,x),n=!0)),n||(b=this.editor.graph,C=a.indexOf(";"),0<C&&(a=a.substring(0,C)+a.substring(a.indexOf(",",C+1))),x&&b.isGridEnabled()&&(c=b.snap(c),d=b.snap(d)),k=[b.insertVertex(null,null,"",c,d,f,l,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
-a+";")])):/(\.*<graphml )/.test(a)?(g=!0,this.importGraphML(a,q)):null!=n&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(g=!0,this.importVisio(n,q)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(g=!0,this.parseFile(null!=n?n:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?q(a.responseText):null!=p&&p(null))}),m)):0==a.indexOf("PK")&&null!=n?(g=!0,this.importZipFile(n,
-q,mxUtils.bind(this,function(){k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,x);p(k)}))):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,x));g||null==p||p(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,g,f,l;c<d;){g=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&
-3)<<4);b+="==";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2);b+="=";break}l=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&
-3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(l&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,f,l,m,p,n,x,C,u){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;x=null!=x?x:this.maxImageBytes;var g=null!=b&&null!=c,k=!0,q=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var t=C||this.resampleThreshold,v=0;v<a.length;v++)if("image/"==a[v].type.substring(0,
-6)&&a[v].size>t){q=!0;break}var y=mxUtils.bind(this,function(){var q=this.editor.graph,n=q.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,d,f,k,l,m,q){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,l)),null):this.importFile(a,b,c,d,f,k,l,m,q,g,u)});l=null!=l?l:mxUtils.bind(this,function(a){q.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var t=a.length,v=t,B=[],y=mxUtils.bind(this,function(a,
-b){B[a]=b;if(0==--v){this.spinner.stop();if(null!=p)p(B);else{var c=[];q.getModel().beginUpdate();try{for(var d=0;d<B.length;d++){var g=B[d]();null!=g&&(c=c.concat(g))}}finally{q.getModel().endUpdate()}}l(c)}}),G=0;G<t;G++)mxUtils.bind(this,function(g){var l=a[g];if(null!=l){var p=new FileReader;p.onload=mxUtils.bind(this,function(a){if(null==m||m(l))if("image/"==l.type.substring(0,6))if("image/svg"==l.type.substring(0,9)){var p=a.target.result,t=p.indexOf(","),v=decodeURIComponent(escape(atob(p.substring(t+
-1)))),B=mxUtils.parseXml(v),v=B.getElementsByTagName("svg");if(0<v.length){var v=v[0],G=u?null:v.getAttribute("content");null!=G&&"<"!=G.charAt(0)&&"%"!=G.charAt(0)&&(G=unescape(window.atob?atob(G):Base64.decode(G,!0)));null!=G&&"%"==G.charAt(0)&&(G=decodeURIComponent(G));null==G||"<mxfile "!==G.substring(0,8)&&"<mxGraphModel "!==G.substring(0,14)?y(g,mxUtils.bind(this,function(){try{if(p.substring(0,t+1),null!=B){var a=B.getElementsByTagName("svg");if(0<a.length){var k=a[0],m=parseFloat(k.getAttribute("width")),
-x=parseFloat(k.getAttribute("height")),C=k.getAttribute("viewBox");if(null==C||0==C.length)k.setAttribute("viewBox","0 0 "+m+" "+x);else if(isNaN(m)||isNaN(x)){var u=C.split(" ");3<u.length&&(m=parseFloat(u[2]),x=parseFloat(u[3]))}p=this.createSvgDataUri(mxUtils.getXml(k));var v=Math.min(1,Math.min(d/Math.max(1,m)),d/Math.max(1,x)),y=f(p,l.type,b+g*n,c+g*n,Math.max(1,Math.round(m*v)),Math.max(1,Math.round(x*v)),l.name);if(isNaN(m)||isNaN(x)){var G=new Image;G.onload=mxUtils.bind(this,function(){m=
-Math.max(1,G.width);x=Math.max(1,G.height);y[0].geometry.width=m;y[0].geometry.height=x;k.setAttribute("viewBox","0 0 "+m+" "+x);p=this.createSvgDataUri(mxUtils.getXml(k));var a=p.indexOf(";");0<a&&(p=p.substring(0,a)+p.substring(p.indexOf(",",a+1)));q.setCellStyles("image",p,[y[0]])});G.src=this.createSvgDataUri(mxUtils.getXml(k))}return y}}}catch(ga){}return null})):y(g,mxUtils.bind(this,function(){return f(G,"text/xml",b+g*n,c+g*n,0,0,l.name)}))}else y(g,mxUtils.bind(this,function(){return null}))}else{v=
-!1;if("image/png"==l.type){var A=u?null:this.extractGraphModelFromPng(a.target.result);if(null!=A&&0<A.length){var z=new Image;z.src=a.target.result;y(g,mxUtils.bind(this,function(){return f(A,"text/xml",b+g*n,c+g*n,z.width,z.height,l.name)}));v=!0}}v||(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(m){this.resizeImage(m,a.target.result,mxUtils.bind(this,function(m,q,p){y(g,mxUtils.bind(this,function(){if(null!=m&&m.length<x){var t=k&&this.isResampleImage(a.target.result,C)?Math.min(1,Math.min(d/q,d/p)):1;return f(m,l.type,b+g*n,c+g*n,Math.round(q*t),Math.round(p*t),l.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,C)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else f(a.target.result,
-l.type,b+g*n,c+g*n,240,160,l.name,function(a){y(g,function(){return a})},l)});/(\.v(dx|sdx?))($|\?)/i.test(l.name)||/(\.vs(x|sx?))($|\?)/i.test(l.name)?f(null,l.type,b+g*n,c+g*n,240,160,l.name,function(a){y(g,function(){return a})},l):"image"==l.type.substring(0,5)?p.readAsDataURL(l):p.readAsText(l)}})(G)});if(q){q=[];for(v=0;v<a.length;v++)q.push(a[v]);a=q;this.confirmImageResize(function(a){k=a;y()},n)}else y()};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,g=function(d,g){if(d||b)mxSettings.setResizeImages(d?g:null),mxSettings.save();c();a(g)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){g(a,!0)},function(a){g(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):g(!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 g=new XMLHttpRequest;g.open("POST",OPEN_URL);g.onreadystatechange=function(){b(g)};g.send(d);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(t){}};EditorUi.prototype.isResampleImage=function(a,
-b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,f,l){f=null!=f?f:this.maxImageSize;var g=Math.max(1,a.width),k=Math.max(1,a.height);if(d&&this.isResampleImage(b,l))try{var m=Math.max(g/f,k/f);if(1<m){var q=Math.round(g/m),p=Math.round(k/m),n=document.createElement("canvas");n.width=q;n.height=p;n.getContext("2d").drawImage(a,0,0,q,p);var t=n.toDataURL();if(t.length<b.length){var u=document.createElement("canvas");u.width=q;u.height=p;var v=
-u.toDataURL();t!==v&&(b=t,g=q,k=p)}}}catch(I){}c(b,g,k)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var m=d,f=0;8>f;f++)m=1==(m&1)?3988292384^m>>>1:m>>>1,EditorUi.prototype.crcTable[d]=m;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var g=0;g<d;g++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+g))&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,f){function g(a,b){var c=m;m+=b;return a.substring(c,m)}function k(a){a=g(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function l(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(g(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=f&&f();else if(g(a,
-4),"IHDR"!=g(a,4))null!=f&&f();else{g(a,17);f=a.substring(0,m);do{var q=k(a);if("IDAT"==g(a,4)){f=a.substring(0,m-8);"pHYs"==b&&"dpi"==c?(c=Math.round(d/.0254),c=l(c)+l(c)+String.fromCharCode(1)):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);f+=l(c.length)+b+c+l(d^4294967295);f+=a.substring(m-8,a.length);break}f+=a.substring(m-8,m-4+q);g(a,q);g(a,4)}while(q);return"data:image/png;base64,"+(window.btoa?btoa(f):
-Base64.encode(f,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){return Editor.extractGraphModelFromPng(a)};EditorUi.prototype.loadImage=function(a,b,c){try{var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a}catch(y){if(null!=c)c(y);else throw y;}};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());
-var a=this,b=this.editor.graph,c=b.cellEditor.startEditing;b.cellEditor.startEditing=function(d,g){var f=this.graph.getAttributeForCell(d,"plantUmlData");if(null!=f){var k=JSON.parse(f),f=new TextareaDialog(a,mxResources.get("plantUml")+":",k.data,function(c){null!=c&&a.spinner.spin(document.body,mxResources.get("inserting"))&&a.generatePlantUmlImage(c,k.format,function(g,f,l){a.spinner.stop();b.getModel().beginUpdate();try{if("txt"==k.format)b.labelChanged(d,"<pre>"+g+"</pre>"),b.updateCellSize(d,
-!0);else{b.setCellStyles("image",a.convertDataUri(g),[d]);var m=b.model.getGeometry(d);null!=m&&(m=m.clone(),m.width=f,m.height=l,b.cellsResized([d],[m],!1))}b.setAttributeForCell(d,"plantUmlData",JSON.stringify({data:c,format:k.format}))}finally{b.getModel().endUpdate()}},function(b){a.handleError(e)})},null,null,400,220);a.showDialog(f.container,420,300,!0,!0);f.init()}else c.apply(this,arguments)};b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),
-c=!0}catch(E){a.handleError(E)}return c};var d=this.clearDefaultStyle;this.clearDefaultStyle=function(){d.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var f=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var c=0;c<a.pages.length;c++)if(a.pages[c]==a.currentPage){0<c&&(b+=(0<b.length?"&":
-"?")+"page="+c);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return f.apply(this,arguments)};var m=b.addClickHandler;b.addClickHandler=function(a,c,d){var g=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!=g&&g(a,c)};m.call(this,a,c,d)};l.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 p=b.getExportVariables;b.getExportVariables=function(){var b=p.apply(this,arguments);b.pagecount=null!=a.pages?a.pages.length:1;b.page=null!=a.currentPage?a.currentPage.getName():"";b.pagenumber=null!=a.pages&&null!=a.currentPage?mxUtils.indexOf(a.pages,
-a.currentPage)+1:1;return b};var n=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:"pagecount"==b?null!=a.pages?a.pages.length:1:n.apply(this,arguments)};var u=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var g=c.getAttribute("href");if(null==g||!b.isCustomLink(g)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))u.apply(this,arguments);
-else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(g),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 x=this.actions.get("print");x.setEnabled(!mxClient.IS_IOS||!navigator.standalone);x.visible=x.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"find"),this.keyHandler.bindAction(67,
+0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var f=this.dialog,e=f.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(f,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(a,b,c){var d=this,f=mxUtils.bind(this,function(){this.loadingExtensions=
+!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(f){if(0==Object.keys(f.files).length)c();else{var e=0,l,k=!1;f.forEach(function(a,d){var f=d.name.toLowerCase();"diagram/diagram.xml"==f?(k=!0,d.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):c()})):0==f.indexOf("versions/")&&(f=parseInt(f.substr(9)),f>e&&(e=f,l=d))});0<e?l.async("string").then(function(f){!d.isOffline()&&(new XMLHttpRequest).upload&&d.isRemoteFileFormat(f,a.name)?d.parseFile(new Blob([f],{type:"application/octet-stream"}),
+mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):k||c()}},function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.importFile=function(a,b,c,d,e,k,g,n,m,x,B){x=null!=x?x:!0;var f=!1,l=null,p=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,
+a,g)):b=this.importXml(a,c,d,x);null!=n&&n(b)});"image"==b.substring(0,5)?(m=!1,"image/png"==b.substring(0,9)&&(b=B?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(l=this.importXml(b,c,d,x),m=!0)),m||(b=this.editor.graph,B=a.indexOf(";"),0<B&&(a=a.substring(0,B)+a.substring(a.indexOf(",",B+1))),x&&b.isGridEnabled()&&(c=b.snap(c),d=b.snap(d)),l=[b.insertVertex(null,null,"",c,d,e,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+a+";")])):/(\.*<graphml )/.test(a)?(f=!0,this.importGraphML(a,p)):null!=m&&null!=g&&(/(\.v(dx|sdx?))($|\?)/i.test(g)||/(\.vs(x|sx?))($|\?)/i.test(g))?(f=!0,this.importVisio(m,p)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,g)?(f=!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?p(a.responseText):null!=n&&n(null))}),g)):0==a.indexOf("PK")&&null!=m?(f=!0,this.importZipFile(m,
+p,mxUtils.bind(this,function(){l=this.insertTextAt(this.validateFileData(a),c,d,!0,null,x);n(l)}))):/(\.v(sd|dx))($|\?)/i.test(g)||/(\.vs(s|x))($|\?)/i.test(g)||(l=this.insertTextAt(this.validateFileData(a),c,d,!0,null,x));f||null==n||n(l);return l};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,f,e,k;c<d;){f=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&
+3)<<4);b+="==";break}e=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);b+="=";break}k=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&
+3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(k&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,k,g,n,m,x,B,q){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;x=null!=x?x:this.maxImageBytes;var f=null!=b&&null!=c,l=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var t=B||this.resampleThreshold,u=0;u<a.length;u++)if("image/"==a[u].type.substring(0,
+6)&&a[u].size>t){p=!0;break}var v=mxUtils.bind(this,function(){var p=this.editor.graph,m=p.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,l,k,g,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,l,k,g,p,f,q)});k=null!=k?k:mxUtils.bind(this,function(a){p.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var t=a.length,u=t,A=[],v=mxUtils.bind(this,function(a,
+b){A[a]=b;if(0==--u){this.spinner.stop();if(null!=n)n(A);else{var c=[];p.getModel().beginUpdate();try{for(var d=0;d<A.length;d++){var f=A[d]();null!=f&&(c=c.concat(f))}}finally{p.getModel().endUpdate()}}k(c)}}),E=0;E<t;E++)mxUtils.bind(this,function(f){var k=a[f];if(null!=k){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==g||g(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var n=a.target.result,t=n.indexOf(","),u=decodeURIComponent(escape(atob(n.substring(t+
+1)))),A=mxUtils.parseXml(u),u=A.getElementsByTagName("svg");if(0<u.length){var u=u[0],E=q?null:u.getAttribute("content");null!=E&&"<"!=E.charAt(0)&&"%"!=E.charAt(0)&&(E=unescape(window.atob?atob(E):Base64.decode(E,!0)));null!=E&&"%"==E.charAt(0)&&(E=decodeURIComponent(E));null==E||"<mxfile "!==E.substring(0,8)&&"<mxGraphModel "!==E.substring(0,14)?v(f,mxUtils.bind(this,function(){try{if(n.substring(0,t+1),null!=A){var a=A.getElementsByTagName("svg");if(0<a.length){var l=a[0],g=parseFloat(l.getAttribute("width")),
+x=parseFloat(l.getAttribute("height")),B=l.getAttribute("viewBox");if(null==B||0==B.length)l.setAttribute("viewBox","0 0 "+g+" "+x);else if(isNaN(g)||isNaN(x)){var u=B.split(" ");3<u.length&&(g=parseFloat(u[2]),x=parseFloat(u[3]))}n=this.createSvgDataUri(mxUtils.getXml(l));var q=Math.min(1,Math.min(d/Math.max(1,g)),d/Math.max(1,x)),v=e(n,k.type,b+f*m,c+f*m,Math.max(1,Math.round(g*q)),Math.max(1,Math.round(x*q)),k.name);if(isNaN(g)||isNaN(x)){var E=new Image;E.onload=mxUtils.bind(this,function(){g=
+Math.max(1,E.width);x=Math.max(1,E.height);v[0].geometry.width=g;v[0].geometry.height=x;l.setAttribute("viewBox","0 0 "+g+" "+x);n=this.createSvgDataUri(mxUtils.getXml(l));var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));p.setCellStyles("image",n,[v[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(l))}return v}}}catch(fa){}return null})):v(f,mxUtils.bind(this,function(){return e(E,"text/xml",b+f*m,c+f*m,0,0,k.name)}))}else v(f,mxUtils.bind(this,function(){return null}))}else{u=
+!1;if("image/png"==k.type){var z=q?null:this.extractGraphModelFromPng(a.target.result);if(null!=z&&0<z.length){var y=new Image;y.src=a.target.result;v(f,mxUtils.bind(this,function(){return e(z,"text/xml",b+f*m,c+f*m,y.width,y.height,k.name)}));u=!0}}u||(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,p,n){v(f,mxUtils.bind(this,function(){if(null!=g&&g.length<x){var t=l&&this.isResampleImage(a.target.result,B)?Math.min(1,Math.min(d/p,d/n)):1;return e(g,k.type,b+f*m,c+f*m,Math.round(p*t),Math.round(n*t),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),l,d,B)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,
+k.type,b+f*m,c+f*m,240,160,k.name,function(a){v(f,function(){return a})},k)});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?e(null,k.type,b+f*m,c+f*m,240,160,k.name,function(a){v(f,function(){return a})},k):"image"==k.type.substring(0,5)?n.readAsDataURL(k):n.readAsText(k)}})(E)});if(p){p=[];for(u=0;u<a.length;u++)p.push(a[u]);a=p;this.confirmImageResize(function(a){l=a;v()},m)}else 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,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(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):f(!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 f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.send(d);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(t){}};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,k){e=null!=e?e:this.maxImageSize;var f=Math.max(1,a.width),l=Math.max(1,a.height);if(d&&this.isResampleImage(b,k))try{var g=Math.max(f/e,l/e);if(1<g){var p=Math.round(f/g),n=Math.round(l/g),m=document.createElement("canvas");m.width=p;m.height=n;m.getContext("2d").drawImage(a,0,0,p,n);var t=m.toDataURL();if(t.length<b.length){var q=document.createElement("canvas");q.width=p;q.height=n;var u=
+q.toDataURL();t!==u&&(b=t,f=p,l=n)}}}catch(H){}c(b,f,l)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var g=d,e=0;8>e;e++)g=1==(g&1)?3988292384^g>>>1:g>>>1,EditorUi.prototype.crcTable[d]=g;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var f=0;f<d;f++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+f))&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=g;g+=b;return a.substring(c,g)}function l(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 g=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,g);do{var p=l(a);if("IDAT"==f(a,4)){e=a.substring(0,g-8);"pHYs"==b&&"dpi"==c?(c=Math.round(d/.0254),c=k(c)+k(c)+String.fromCharCode(1)):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(g-8,a.length);break}e+=a.substring(g-8,g-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){return Editor.extractGraphModelFromPng(a)};EditorUi.prototype.loadImage=function(a,b,c){try{var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a}catch(v){if(null!=c)c(v);else throw v;}};var k=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());
+var a=this,b=this.editor.graph,c=b.cellEditor.startEditing;b.cellEditor.startEditing=function(d,f){var e=this.graph.getAttributeForCell(d,"plantUmlData");if(null!=e){var k=JSON.parse(e),e=new TextareaDialog(a,mxResources.get("plantUml")+":",k.data,function(c){null!=c&&a.spinner.spin(document.body,mxResources.get("inserting"))&&a.generatePlantUmlImage(c,k.format,function(f,e,l){a.spinner.stop();b.getModel().beginUpdate();try{if("txt"==k.format)b.labelChanged(d,"<pre>"+f+"</pre>"),b.updateCellSize(d,
+!0);else{b.setCellStyles("image",a.convertDataUri(f),[d]);var g=b.model.getGeometry(d);null!=g&&(g=g.clone(),g.width=e,g.height=l,b.cellsResized([d],[g],!1))}b.setAttributeForCell(d,"plantUmlData",JSON.stringify({data:c,format:k.format}))}finally{b.getModel().endUpdate()}},function(b){a.handleError(b)})},null,null,400,220);a.showDialog(e.container,420,300,!0,!0);e.init()}else c.apply(this,arguments)};b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),
+c=!0}catch(D){a.handleError(D)}return c};var d=this.clearDefaultStyle;this.clearDefaultStyle=function(){d.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var c=0;c<a.pages.length;c++)if(a.pages[c]==a.currentPage){0<c&&(b+=(0<b.length?"&":
+"?")+"page="+c);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var g=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)};g.call(this,a,c,d)};k.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 n=b.getExportVariables;b.getExportVariables=function(){var b=n.apply(this,arguments);b.pagecount=null!=a.pages?a.pages.length:1;b.page=null!=a.currentPage?a.currentPage.getName():"";b.pagenumber=null!=a.pages&&null!=a.currentPage?mxUtils.indexOf(a.pages,
+a.currentPage)+1:1;return b};var m=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:"pagecount"==b?null!=a.pages?a.pages.length:1:m.apply(this,arguments)};var q=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var f=c.getAttribute("href");if(null==f||!b.isCustomLink(f)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))q.apply(this,arguments);
+else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(f),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 x=this.actions.get("print");x.setEnabled(!mxClient.IS_IOS||!navigator.standalone);x.visible=x.isEnabled();if(!this.editor.chromeless||this.editor.editable)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_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize"),this.installImagePasteHandler(),this.installNativeClipboardHandler();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,g,f,k){b.insertImage(a,f,k)},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 g=this.maxImageSize,g=Math.min(1,Math.min(g/Math.max(1,d)),g/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*g,a*g)})):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,
+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,f,e,k){b.insertImage(a,e,k)},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 f=this.maxImageSize,f=Math.min(1,Math.min(f/Math.max(1,d)),f/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*f,a*f)})):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()})))}));"undefined"!==typeof window.mxSettings&&(x=this.editor.graph.view,x.setUnit(mxSettings.getUnit()),x.addListener("unitChanged",function(a,b){mxSettings.setUnit(b.getProperty("unit"));mxSettings.save()}),this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:
new mxDualRuler(this,x.unit),this.refresh());if("1"==urlParams.styledev){x=document.getElementById("geFooter");null!=x&&(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)})),x.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 C=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==
-this.styleInput?!0:C.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var G=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=G&&(G.parentNode.removeChild(G),G=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==G&&(!mxClient.IS_IE||10<document.documentMode)&&(G=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!=G&&(G.parentNode.removeChild(G),G=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,g=b.view.scale,f=c.x/g-d.x,k=c.y/g-d.y;mxEvent.isAltDown(a)&&(k=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,k,this.maxImageSize,null,null,null,
-null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var l=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,k,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var m=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=m;var q=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?
-(m=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(m)||(q=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(m=c[0].getAttribute("href")));var p=!0,n=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(m,f,k,!0,q,null,p))});q&&m.length>this.resampleThreshold?this.confirmImageResize(function(a){p=a;n()},mxEvent.isControlDown(a)):n()}else null!=l&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)?this.loadImage(decodeURIComponent(l),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,k,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+l+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(l,f,k,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
-f,k,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var c=b.getProperty("edit");null!=c&&this.updateEditReferences(c)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var a=
-this.editor.graph;a.container.addEventListener("paste",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,d=!1,g=0;g<c.types.length;g++)if("text/"===c.types[g].substring(0,5)){d=!0;break}if(!d){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,d,g,f,k){a.insertImage(b,f,k)},function(){},function(a){return"image/"==a.type.substring(0,
-6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var l=this.editor.graph.getInsertPoint();this.importFiles([k.getAsFile()],l.x,l.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(D){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function a(){window.setTimeout(function(){c.innerHTML="&nbsp;";c.focus();document.execCommand("selectAll",!1,null)},0)}var b=this.editor.graph,c=document.createElement("div");c.setAttribute("autocomplete","off");c.setAttribute("autocorrect",
-"off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");c.style.position="absolute";c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.display="block";c.contentEditable=!0;mxUtils.setOpacity(c,0);c.style.width="1px";c.style.height="1px";c.innerHTML="&nbsp;";var d=!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 g=mxEvent.getSource(a);
-null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==g.nodeName||"TEXTAREA"==g.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||d||(c.style.left=b.container.scrollLeft+10+"px",c.style.top=b.container.scrollTop+10+"px",b.container.appendChild(c),d=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){c.focus();document.execCommand("selectAll",!1,null)},0):(c.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,
-"keyup",mxUtils.bind(this,function(a){var g=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!d||224!=g&&17!=g&&91!=g||(d=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),c.parentNode.removeChild(c),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(c,"copy",mxUtils.bind(this,function(d){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(c),a()}catch(A){this.handleError(A)}}));mxEvent.addListener(c,"cut",mxUtils.bind(this,function(d){if(b.isEnabled())try{mxClipboard.copy(b),
-this.copyCells(c,!0),a()}catch(A){this.handleError(A)}}));mxEvent.addListener(c,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(c.innerHTML="&nbsp;",c.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,c);c.innerHTML="&nbsp;"}),0))}),!0);var f=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==c?!0:f.apply(this,arguments)}};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,
+this.styleInput.value)})),x.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 B=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==
+this.styleInput?!0:B.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E),E=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=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!=E&&(E.parentNode.removeChild(E),E=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,k=c.y/f-d.y;mxEvent.isAltDown(a)&&(k=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,e,k,this.maxImageSize,null,null,null,
+null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var l=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,e,k,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var g=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=g;var p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?
+(g=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(g=c[0].getAttribute("href")));var n=!0,m=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(g,e,k,!0,p,null,n))});p&&g.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;m()},mxEvent.isControlDown(a)):m()}else null!=l&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)?this.loadImage(decodeURIComponent(l),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,"",e,k,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+l+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(l,e,k,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
+e,k,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var c=b.getProperty("edit");null!=c&&this.updateEditReferences(c)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var a=
+this.editor.graph;a.container.addEventListener("paste",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,d=!1,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){d=!0;break}if(!d){var e=c.items;for(index in e){var k=e[index];if("file"===k.kind){if(a.isEditing())this.importFiles([k.getAsFile()],0,0,this.maxImageSize,function(b,c,d,f,e,k){a.insertImage(b,e,k)},function(){},function(a){return"image/"==a.type.substring(0,
+6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var l=this.editor.graph.getInsertPoint();this.importFiles([k.getAsFile()],l.x,l.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(C){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function a(){window.setTimeout(function(){c.innerHTML="&nbsp;";c.focus();document.execCommand("selectAll",!1,null)},0)}var b=this.editor.graph,c=document.createElement("div");c.setAttribute("autocomplete","off");c.setAttribute("autocorrect",
+"off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");c.style.position="absolute";c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.display="block";c.contentEditable=!0;mxUtils.setOpacity(c,0);c.style.width="1px";c.style.height="1px";c.innerHTML="&nbsp;";var d=!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 f=mxEvent.getSource(a);
+null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==f.nodeName||"TEXTAREA"==f.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||d||(c.style.left=b.container.scrollLeft+10+"px",c.style.top=b.container.scrollTop+10+"px",b.container.appendChild(c),d=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){c.focus();document.execCommand("selectAll",!1,null)},0):(c.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,
+"keyup",mxUtils.bind(this,function(a){var f=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!d||224!=f&&17!=f&&91!=f||(d=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),c.parentNode.removeChild(c),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(c,"copy",mxUtils.bind(this,function(d){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(c),a()}catch(z){this.handleError(z)}}));mxEvent.addListener(c,"cut",mxUtils.bind(this,function(d){if(b.isEnabled())try{mxClipboard.copy(b),
+this.copyCells(c,!0),a()}catch(z){this.handleError(z)}}));mxEvent.addListener(c,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(c.innerHTML="&nbsp;",c.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,c);c.innerHTML="&nbsp;"}),0))}),!0);var e=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==c?!0:e.apply(this,arguments)}};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(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}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();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(a){a.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged",
+EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(a){a.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(f){}this.fireEvent(new mxEventObject("styleChanged",
"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(a,b){mxSettings.setCustomFonts(this.menus.customFonts);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("dark"==uiTheme);this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){console.log("gridColorChanged",this.editor.graph.view.gridColor);mxSettings.setGridColor(this.editor.graph.view.gridColor,"dark"==uiTheme);
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())),g=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(g));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=g,c.pasteCounter=0);a.focus();
+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())),f=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(f));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=f,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.convertLucidChart(d,mxUtils.bind(this,function(a){var b=this.editor.graph;b.setSelectionCells(this.importXml(a,0,0));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,
-function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,g=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var l=g.lastIndexOf("%3E");0<=l&&l<g.length-3&&(g=g.substring(0,l+3))}catch(D){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(g);this.isCompatibleString(k)&&(f=!0,g=k)}catch(D){}d.lastPasteXml==g?d.pasteCounter++:(d.lastPasteXml=
-g,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=g&&0<g.length&&(f||this.isCompatibleString(g)?d.setSelectionCells(this.importXml(g,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==g&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(g,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(D){}}}}};
+function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),e=!1;try{var k=f.lastIndexOf("%3E");0<=k&&k<f.length-3&&(f=f.substring(0,k+3))}catch(C){}try{var c=b.getElementsByTagName("span"),g=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(f);this.isCompatibleString(g)&&(e=!0,f=g)}catch(C){}d.lastPasteXml==f?d.pasteCounter++:(d.lastPasteXml=
+f,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=f&&0<f.length&&(e||this.isCompatibleString(f)?d.setSelectionCells(this.importXml(f,c,c)):(e=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==f&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(f,e.x+c,e.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?EditorUi.drawHost+"/":
-"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,g;if(null==a){g=document.body;var f=document.documentElement;d=(g.clientWidth||f.clientWidth)-3;g=Math.max(g.clientHeight||0,f.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,g=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,g-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){try{var d=c.target.result,g=a.name;if(null!=g&&0<g.length){!this.useCanvasForExport&&/(\.png)$/i.test(g)&&(g=g.substring(0,g.length-4)+".drawio");
-var f=mxUtils.bind(this,function(a){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";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,g))}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,g,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(g)||/(\.vs(x|sx?))($|\?)/i.test(g))this.importVisio(a,
-mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,g))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(this.isLucidChartData(d))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,g,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));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(x){this.handleError(x,mxResources.get("errorLoadingFile"))}}else 0==d.indexOf("PK")?this.importZipFile(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(d,g,b)})):("image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,g,b))}}catch(x){this.handleError(x)}});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(),g=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))});if(null!=a&&0<a.length)null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?g():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,g,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(){null!=d&&d.isModified()?
-this.confirm(mxResources.get("allChangesLost"),null,g,mxResources.get("cancel"),mxResources.get("discardChanges")):g()})));else throw Error(mxResources.get("notADiagramFile"));};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,g=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(g[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(g[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(g[mxConstants.STYLE_ENDARROW])));for(var g=d.model.getChildCount(a),f=0;f<g;f++)this.addBasenamesForCell(d.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=
+"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,f;if(null==a){f=document.body;var e=document.documentElement;d=(f.clientWidth||e.clientWidth)-3;f=Math.max(f.clientHeight||0,e.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,f=a.clientHeight;e=document.createElement("div");e.style.zIndex=mxPopupMenu.prototype.zIndex+
+2;e.style.border="3px dotted rgb(254, 137, 12)";e.style.pointerEvents="none";e.style.position="absolute";e.style.top=b+"px";e.style.left=c+"px";e.style.width=Math.max(0,d-3)+"px";e.style.height=Math.max(0,f-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(e):document.body.appendChild(e);return e};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){try{var d=c.target.result,f=a.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".drawio");
+var e=mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";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,f))}catch(B){this.handleError(B,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,
+mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?e(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},
+mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,f,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));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(x){this.handleError(x,mxResources.get("errorLoadingFile"))}}else 0==d.indexOf("PK")?this.importZipFile(a,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(d,f,b)})):("image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b))}}catch(x){this.handleError(x)}});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(),f=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))});if(null!=a&&0<a.length)null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?f():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=d&&d.isModified()?
+this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var 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,f=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(f[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(f[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(f[mxConstants.STYLE_ENDARROW])));for(var f=d.model.getChildCount(a),e=0;e<f;e++)this.addBasenamesForCell(d.model.getChildAt(a,e),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.ruler&&(this.ruler.hRuler.container.style.visibility=a?"":"hidden",this.ruler.vRuler.container.style.visibility=a?"":"hidden");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,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,g=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){if(f.source==(window.opener||window.parent)){var k=f.data,m=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"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=Graph.decompress(a)))}catch(S){}return a});if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(N){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();m=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):
-null,function(a){null!=a&&l.postMessage(JSON.stringify({event:"prompt",value:a,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(m.container,300,80,!0,!1);m.init();return}if("draft"==k.action){var q=m(k.xml);this.spinner.stop();m=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),q,mxUtils.bind(this,function(){this.hideDialog();l.postMessage(JSON.stringify({event:"draft",result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();
-l.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();l.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{m.init()}catch(N){l.postMessage(JSON.stringify({event:"draft",error:N.toString(),
-message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var m=1==k.enableRecent,q=1==k.enableSearch,p=1==k.enableCustomTemp,m=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?l.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,m?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",
-null,null,a,function(){a(null,"Network Error!")})}):null,q?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,mxUtils.bind(this,function(a,b,c){l.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")}),null,null,p?mxUtils.bind(this,function(a){this.remoteInvoke("getCustomTemplates",null,null,a,function(){a({},0)})}):null);this.showDialog(m.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
-m.init();return}if("textContent"==k.action){m=this.getDiagramTextContent();l.postMessage(JSON.stringify({event:"textContent",data:m,message:k}),"*");return}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 t=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var u=this.editor.graph,v=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.message=
-k;b.data=a;b.xml=encodeURIComponent(t);l.postMessage(JSON.stringify(b),"*")}),y=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(t)));u!=this.editor.graph&&u.container.parentNode.removeChild(u.container);v(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var z=u.getGlobalVariable,u=this.createTemporaryGraph(u.getStylesheet()),H=this.pages[0];u.getGlobalVariable=function(a){return"page"==
-a?H.getName():"pagenumber"==a?1:z.apply(this,arguments)};document.body.appendChild(u.container);u.model.setRoot(H.root)}this.exportToCanvas(mxUtils.bind(this,function(a){y(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){y(null)}),null,null,k.scale,null,null,null,u)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+(null!=k.scale?"&scale="+k.scale:"")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(t)))).send(mxUtils.bind(this,function(a){200<=
-a.getStatus()&&299>=a.getStatus()?v("data:image/png;base64,"+a.getText()):y(null)}),mxUtils.bind(this,function(){y(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))m=this.getXmlFileData(),n.xml=mxUtils.getXml(m),n.data=this.getFileData(null,null,!0,null,null,null,m),n.format=k.format;else if("html"==k.format)t=this.editor.getGraphXml(),n.data=
-this.getHtml(t,this.editor.graph),n.xml=mxUtils.getXml(t),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;m=this.editor.graph.background;m==mxConstants.NONE&&(m=null);n.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);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(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(a);l.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(m),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(a));l.postMessage(JSON.stringify(n),"*")}));return}m="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(m));
-n.data=this.createSvgDataUri(m)}l.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&&(q=document.createElement("span"),mxUtils.write(q,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",
-this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(q),this.embedFilenameSpan=q),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):k.xml;else{"remoteInvokeReady"==k.action?this.handleRemoteInvokeReady(l):"remoteInvoke"==k.action?this.handleRemoteInvoke(k):"remoteInvokeResponse"==
-k.action?this.handleRemoteInvokeResponse(k):l.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}var A=mxUtils.bind(this,function(f,k){c=!0;try{a(f,k)}catch(U){this.handleError(U)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var m=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});g=m();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=m();
-if(d!=g&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}g=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||l.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=k&&"function"===typeof k.substring&&"data:application/vnd.visio;base64,"==k.substring(0,34)?(m="0M8R4KGxGuE"==k.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(k.substring(k.indexOf(",")+
-1)),function(a){A(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),m)):null!=k&&"function"===typeof k.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,"")?this.parseFile(new Blob([k],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&A(a.responseText,f)}),""):null!=k&&"function"===typeof k.substring&&this.isLucidChartData(k)?this.convertLucidChart(k,
-mxUtils.bind(this,function(a){A(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(k=m(k),A(k,f))}}));var l=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";l.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":"0px";a.style.paddingLeft="8px";a.style.paddingBottom=
-"2px";var b=document.createElement("button");b.className="geBigButton";"1"==urlParams.noSaveBtn?(mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)):(mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),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.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",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.className=
-"geBigButton geBigStandardButton";b.style.marginLeft="6px";b.style.marginRight="20px";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.isOffline()?null:"https://about.draw.io/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),g=0;g<a.length;g++){var f=new window[a[g].layout](c);if(null!=a[g].config)for(var l in a[g].config)f[l]=a[g].config[l];this.executeLayout(function(){f.execute(c.getDefaultParent(),
-0==d.length?null:d)},g==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],g=[],f={};if(0<c.length){var l={},k=null,m=null,p=null,n=null,u=null,B=null,F=null,E=null,I="",K="auto",J="auto",H=null,L=null,N=40,S=40,aa=100,U=0,M=this.editor.graph;M.getGraphBounds();for(var X=function(){null!=b?b(ma):(M.setSelectionCells(ma),M.scrollCellToVisible(M.getSelectionCell()))},ba=M.getFreeInsertPoint(),ia=ba.x,ha=ba.y,ba=ha,da=null,W="auto",E=null,ca=[],R=null,Z=null,Y=0;Y<
-c.length&&"#"==c[Y].charAt(0);){a=c[Y];for(Y++;Y<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Y].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[Y].substring(1)),Y++;if("#"!=a.charAt(1)){var fa=a.indexOf(":");if(0<fa){var Q=mxUtils.trim(a.substring(1,fa)),O=mxUtils.trim(a.substring(fa+1));"label"==Q?da=M.sanitizeHtml(O):"labelname"==Q&&0<O.length&&"-"!=O?n=O:"labels"==Q&&0<O.length&&"-"!=O?u=JSON.parse(O):"style"==Q?k=O:"parentstyle"==Q?B=O:"stylename"==Q&&0<O.length&&"-"!=O?p=O:"styles"==Q&&
-0<O.length&&"-"!=O?m=JSON.parse(O):"identity"==Q&&0<O.length&&"-"!=O?F=O:"parent"==Q&&0<O.length&&"-"!=O?E=O:"namespace"==Q&&0<O.length&&"-"!=O?I=O:"width"==Q?K=O:"height"==Q?J=O:"left"==Q&&0<O.length?H=O:"top"==Q&&0<O.length?L=O:"ignore"==Q?Z=O.split(","):"connect"==Q?ca.push(JSON.parse(O)):"link"==Q?R=O:"padding"==Q?U=parseFloat(O):"edgespacing"==Q?N=parseFloat(O):"nodespacing"==Q?S=parseFloat(O):"levelspacing"==Q?aa=parseFloat(O):"layout"==Q&&(W=O)}}}if(null==c[Y])throw Error(mxResources.get("invalidOrMissingFile"));
-var ea=this.editor.csvToArray(c[Y]),Q=fa=null;if(null!=F||null!=E)for(var T=0;T<ea.length;T++)F==ea[T]&&(fa=T),E==ea[T]&&(Q=T);null==da&&(da="%"+ea[0]+"%");if(null!=ca)for(var V=0;V<ca.length;V++)null==l[ca[V].to]&&(l[ca[V].to]={});M.model.beginUpdate();try{for(T=Y+1;T<c.length;T++){var ka=this.editor.csvToArray(c[T]);if(null==ka){var la=40<c[T].length?c[T].substring(0,40)+"...":c[T];throw Error(T+" ("+la+") "+mxResources.get("containsValidationErrors"));}if(ka.length==ea.length){var P=null,na=null!=
-fa?I+ka[fa]:null;null!=na&&(P=M.model.getCell(na));var F=null!=P,ga=new mxCell(da,new mxGeometry(ia,ba,0,0),k||"whiteSpace=wrap;html=1;");ga.vertex=!0;ga.id=na;for(var ja=0;ja<ka.length;ja++)M.setAttributeForCell(ga,ea[ja],ka[ja]);if(null!=n&&null!=u){var va=u[ga.getAttribute(n)];null!=va&&M.labelChanged(ga,va)}if(null!=p&&null!=m){var wa=m[ga.getAttribute(p)];null!=wa&&(ga.style=wa)}M.setAttributeForCell(ga,"placeholders","1");ga.style=M.replacePlaceholders(ga,ga.style);F&&(M.model.setGeometry(P,
-ga.geometry),M.model.setStyle(P,ga.style),0>mxUtils.indexOf(g,P)&&g.push(P));P=ga;if(!F)for(V=0;V<ca.length;V++)l[ca[V].to][P.getAttribute(ca[V].to)]=P;null!=R&&"link"!=R&&(M.setLinkForCell(P,P.getAttribute(R)),M.setAttributeForCell(P,R,null));M.fireEvent(new mxEventObject("cellsInserted","cells",[P]));var xa=this.editor.graph.getPreferredSizeForCell(P);P.vertex&&(null!=H&&null!=P.getAttribute(H)&&(P.geometry.x=ia+parseFloat(P.getAttribute(H))),null!=L&&null!=P.getAttribute(L)&&(P.geometry.y=ha+parseFloat(P.getAttribute(L))),
-"@"==K.charAt(0)&&null!=P.getAttribute(K.substring(1))?P.geometry.width=parseFloat(P.getAttribute(K.substring(1))):P.geometry.width="auto"==K?xa.width+U:parseFloat(K),"@"==J.charAt(0)&&null!=P.getAttribute(J.substring(1))?P.geometry.height=parseFloat(P.getAttribute(J.substring(1))):P.geometry.height="auto"==J?xa.height+U:parseFloat(J),ba+=P.geometry.height+S);F?(null==f[na]&&(f[na]=[]),f[na].push(P)):(E=null!=Q?M.model.getCell(I+ka[Q]):null,d.push(P),null!=E?(E.style=M.replacePlaceholders(E,B),M.addCell(P,
-E)):g.push(M.addCell(P)))}}for(var oa=g.slice(),ma=g.slice(),V=0;V<ca.length;V++)for(var ya=ca[V],T=0;T<g.length;T++){var P=g[T],za=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){M.setAttributeForCell(b,c.from,null);for(var d=d.split(","),g=0;g<d.length;g++){var f=l[c.to][d[g]];if(null!=f){var k=c.label;null!=c.fromlabel&&(k=(b.getAttribute(c.fromlabel)||"")+(k||""));null!=c.tolabel&&(k=(k||"")+(f.getAttribute(c.tolabel)||""));ma.push(M.insertEdge(null,null,k||"",c.invert?
-f:a,c.invert?a:f,c.style||M.createCurrentEdgeStyle()));mxUtils.remove(c.invert?a:f,oa)}}}});za(P,P,ya);if(null!=f[P.id])for(ja=0;ja<f[P.id].length;ja++)za(P,f[P.id][ja],ya)}if(null!=Z)for(T=0;T<d.length;T++)for(P=d[T],ja=0;ja<Z.length;ja++)M.setAttributeForCell(P,mxUtils.trim(Z[ja]),null);if(0<g.length){var pa=new mxParallelEdgeLayout(M);pa.spacing=N;var ua=function(){0<pa.spacing&&pa.execute(M.getDefaultParent());for(var a=0;a<g.length;a++){var b=M.getCellGeometry(g[a]);b.x=Math.round(M.snap(b.x));
-b.y=Math.round(M.snap(b.y));"auto"==K&&(b.width=Math.round(M.snap(b.width)));"auto"==J&&(b.height=Math.round(M.snap(b.height)))}};if("["==W.charAt(0)){var Aa=X;M.view.validate();this.executeLayoutList(JSON.parse(W),function(){ua();Aa()});X=null}else if("circle"==W){var sa=new mxCircleLayout(M);sa.resetEdges=!1;var Ba=sa.isVertexIgnored;sa.isVertexIgnored=function(a){return Ba.apply(this,arguments)||0>mxUtils.indexOf(g,a)};this.executeLayout(function(){sa.execute(M.getDefaultParent());ua()},!0,X);
-X=null}else if("horizontaltree"==W||"verticaltree"==W||"auto"==W&&ma.length==2*g.length-1&&1==oa.length){M.view.validate();var ta=new mxCompactTreeLayout(M,"horizontaltree"==W);ta.levelDistance=S;ta.edgeRouting=!1;ta.resetEdges=!1;this.executeLayout(function(){ta.execute(M.getDefaultParent(),0<oa.length?oa[0]:null)},!0,X);X=null}else if("horizontalflow"==W||"verticalflow"==W||"auto"==W&&1==oa.length){M.view.validate();var qa=new mxHierarchicalLayout(M,"horizontalflow"==W?mxConstants.DIRECTION_WEST:
-mxConstants.DIRECTION_NORTH);qa.intraCellSpacing=S;qa.parallelEdgeSpacing=N;qa.interRankCellSpacing=aa;qa.disableEdgeStyle=!1;this.executeLayout(function(){qa.execute(M.getDefaultParent(),ma);M.moveCells(ma,ia,ha)},!0,X);X=null}else if("organic"==W||"auto"==W&&ma.length>g.length){M.view.validate();var ra=new mxFastOrganicLayout(M);ra.forceConstant=3*S;ra.resetEdges=!1;var Ca=ra.isVertexIgnored;ra.isVertexIgnored=function(a){return Ca.apply(this,arguments)||0>mxUtils.indexOf(g,a)};pa=new mxParallelEdgeLayout(M);
-pa.spacing=N;this.executeLayout(function(){ra.execute(M.getDefaultParent());ua()},!0,X);X=null}}this.hideDialog()}finally{M.model.endUpdate()}null!=X&&X()}}catch(Da){this.handleError(Da)}};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,560,130,!0,!0);a.init()};var n=
-EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=n.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 g=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 g.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"),g=b.source,f=b.outline;f.pageScale=g.pageScale;f.pageFormat=g.pageFormat;f.background=g.background;f.pageVisible=g.pageVisible;f.background=g.background;var l=mxUtils.getCurrentStyle(g.container);f.container.style.backgroundColor=l.backgroundColor;null!=g.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&
-(f.view.backgroundPageShape.fill=g.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=1;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.gitLab||c++;b&&a&&isLocalStorage&&"1"==urlParams.browser&&
-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),this.menus.get("newLibrary").setEnabled(c));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.actions.get("undo").setEnabled(this.canUndo()&&
-a);this.actions.get("redo").setEnabled(this.canRedo()&&a);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 d=applicationCache;if(null!=d&&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 d=window.applicationCache,f=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';
-break;case d.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.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!=f&&(this.offlineStatus.innerHTML=b,f=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",b);mxEvent.addListener(d,
-"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||
-"1"==urlParams.embed&&this.editor.graph.isEnabled()};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.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!=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("hidden"!=this.diagramContainer.style.visibility);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 u=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.editUpdateListener&&(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener=
-null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);u.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,f,l,m){var g=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(g.getSvg(d,f,l)),"image/svg+xml");else{var k=
-a.getFileData(!0,null,null,null,null,!0),p=g.getGraphBounds(),q=Math.floor(p.width*f/g.view.scale),n=Math.floor(p.height*f/g.view.scale);if(k.length<=MAX_REQUEST_SIZE&&q*n<MAX_AREA)if(a.hideDialog(),"png"!=c&&"jpg"!=c&&"jpeg"!=c||!a.isExportToCanvas()){var t={globalVars:g.getExportVariables()};a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(t))+(0<m?"&dpi="+
-m:"")+"&bg="+(null!=d?d:"none")+"&w="+q+"&h="+n+"&border="+l+"&xml="+encodeURIComponent(k))})}else"png"==c?a.exportImage(f,null==d||"none"==d,!0,!1,!1,l,!0,!1,null,null,m):a.exportImage(f,!1,!0,!1,!1,l,!0,!1,"jpeg");else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var g=this.getFutureCellForEdit(c.model,
-a,d.source.id);g!=d.source&&(d.source=g)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,c){var d=a.getCell(c);if(null==d)for(var g=b.changes.length-1;0<=g;g--){var f=b.changes[g];if(f.constructor==mxChildChange&&null!=f.child&&f.child.id==c){a.contains(f.previous)&&(d=f.child);break}}return d};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);
-var a=this.editor.graph,b="";if(null!=this.pages)for(var c=0;c<this.pages.length;c++){var d=a;this.currentPage!=this.pages[c]&&(d=this.createTemporaryGraph(a.getStylesheet()),d.model.setRoot(this.pages[c].root));b+=this.pages[c].getName()+" "+d.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b={},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,
-mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var g=document.createElement("div");g.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";g.innerHTML='<div style="text-align:center;padding:8px;"><img src="/images/spin.gif"></div>';var f={};try{var l=mxSettings.getCustomLibraries();for(a=0;a<l.length;a++){var m=l[a];if("R"==m.substring(0,1)){var p=JSON.parse(decodeURIComponent(m.substring(1)));f[p[0]]={id:p[0],
-title:p[1],downloadUrl:p[2]}}}}catch(x){}this.remoteInvoke("getCustomLibraries",null,null,function(a){g.innerHTML="";if(0==a.length)g.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&(b[d.id]=d);var l=this.addCheckbox(g,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,l)}},mxUtils.bind(this,function(a){g.innerHTML=
-"";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));g.appendChild(b)}));c.appendChild(g);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,
-function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(F){this.handleError(F,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in f)b[c]||this.closeLibrary(new RemoteLibrary(this,null,f[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763");this.showDialog(c.container,340,375,!0,!0,
-null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error?
-c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,d,f){var g=!0,l=window.setTimeout(mxUtils.bind(this,function(){g=!1;f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),k=mxUtils.bind(this,function(){window.clearTimeout(l);g&&d.apply(this,arguments)});c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:k,error:f});
-a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,msgMarkers:c});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var g=
-a.functionArgs;Array.isArray(g)||(g=[]);if(d.isAsync)g.push(function(){b(Array.prototype.slice.apply(arguments))}),g.push(function(a){b(null,a||"Unkown Error")}),this[c].apply(this,g);else{var f=this[c].apply(this,g);b([f])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(A){b(null,"Invalid Call: An error occured, "+A.message)}};EditorUi.prototype.commentsSupported=function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var a=
-this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(a,b){var c=this.getCurrentFile();null!=c?c.getComments(a,b):a([])};EditorUi.prototype.addComment=function(a,b,c){var d=this.getCurrentFile();null!=d?d.addComment(a,b,c):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile();return null!=a?
-a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!=
-c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language","da, mi, en, de-DE")}})();
-var CommentsWindow=function(a,c,b,d,m,f){function l(){for(var a=D.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==D&&b++;x.style.display=0==b?"block":"none"}function n(a,b,c,d){function g(){b.removeChild(m);b.removeChild(p);k.style.display="block";f.style.display="block"}t={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),k=b.querySelector(".geCommentActionsList"),m=document.createElement("textarea");m.className=
-"geCommentEditTxtArea";m.style.minHeight=f.offsetHeight+"px";m.value=a.content;b.insertBefore(m,f);var p=document.createElement("div");p.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),l()):g();t=null});n.className="geCommentEditBtn";p.appendChild(n);var q=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=m.value;mxUtils.write(f,a.content);g();c(a);t=null});mxEvent.addListener(m,"keydown",mxUtils.bind(this,
-function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(q.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));q.focus();q.className="geCommentEditBtn gePrimaryBtn";p.appendChild(q);b.insertBefore(p,f);k.style.display="none";f.style.display="none";m.focus()}function p(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),f=a.timeSince(d);null==f&&(f=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
-[f],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function u(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function g(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function k(a){a.style.border="";a.removeChild(a.busyImg)}function q(b,c,d,f,m){function C(a,c,d){var f=document.createElement("li");f.className="geCommentAction";var g=document.createElement("a");g.className=
-"geCommentActionLnk";mxUtils.write(g,a);f.appendChild(g);mxEvent.addListener(g,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});I.appendChild(f);d&&(f.style.display="none")}function G(){function a(b){c.push(d);if(null!=b.replies)for(var f=0;f<b.replies.length;f++)d=d.nextSibling,a(b.replies[f])}var c=[],d=z;a(b);return{pdiv:d,replies:c}}function H(c,d,l,m,p){function t(){u(B);b.addReply(v,function(a){v.id=a;b.replies.push(v);k(B);l&&l()},function(b){x();g(B);a.handleError(b,null,
-null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},m,p)}function x(){n(v,B,function(a){t()},!0)}var C=G().pdiv,v=a.newComment(c,a.getCurrentUser());v.pCommentId=b.id;null==b.replies&&(b.replies=[]);var B=q(v,b.replies,C,f+1);d?x():t()}if(m||!b.isResolved){x.style.display="none";var z=document.createElement("div");z.className="geCommentContainer";z.setAttribute("data-commentId",b.id);z.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(z.style.backgroundColor="ghostWhite");
-var A=document.createElement("div");A.className="geCommentHeader";var F=document.createElement("img");F.className="geCommentUserImg";F.src=b.user.pictureUrl||Editor.userImage;A.appendChild(F);F=document.createElement("div");F.className="geCommentHeaderTxt";A.appendChild(F);var E=document.createElement("div");E.className="geCommentUsername";mxUtils.write(E,b.user.displayName||"");F.appendChild(E);E=document.createElement("div");E.className="geCommentDate";E.setAttribute("data-commentId",b.id);p(b,
-E);F.appendChild(E);z.appendChild(A);A=document.createElement("div");A.className="geCommentTxt";mxUtils.write(A,b.content||"");z.appendChild(A);A=document.createElement("div");A.className="geCommentActions";var I=document.createElement("ul");I.className="geCommentActionsList";A.appendChild(I);v||0!=f&&!y||C(mxResources.get("reply"),function(){H("",!0)},b.isResolved);F=a.getCurrentUser();null==F||F.id!=b.user.id||v||(C(mxResources.get("edit"),function(){function c(){n(b,z,function(){u(z);b.editComment(b.content,
-function(){k(z)},function(b){g(z);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),C(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){u(z);b.deleteComment(function(){for(var a=G(b).replies,d=0;d<a.length;d++)D.removeChild(a[d]);for(d=0;d<c.length;d++)if(c[d]==b){c.splice(d,1);break}x.style.display=0==D.getElementsByTagName("div").length?"block":"none"},function(b){g(z);a.handleError(b,null,null,
-null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));v||0!=f||C(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",f=G(b).replies,g="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",k=0;k<f.length;k++){f[k].style.backgroundColor=g;for(var m=f[k].querySelectorAll(".geCommentAction"),
-p=0;p<m.length;p++)m[p]!=c.parentNode&&(m[p].style.display=d);B||(f[k].style.display="none")}l()}b.isResolved?H(mxResources.get("reOpened")+": ",!0,c,!1,!0):H(mxResources.get("markedAsResolved"),!1,c,!0)});z.appendChild(A);null!=d?D.insertBefore(z,d.nextSibling):D.appendChild(z);for(d=0;null!=b.replies&&d<b.replies.length;d++)A=b.replies[d],A.isResolved=b.isResolved,q(A,b.replies,null,f+1,m);null!=t&&(t.comment.id==b.id?(m=b.content,b.content=t.comment.content,n(b,z,t.saveCallback,t.deleteOnCancel),
-b.content=m):null==t.comment.id&&t.comment.pCommentId==b.id&&(D.appendChild(t.div),n(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return z}}var v=!a.canComment(),y=a.canReplyToReplies(),t=null,A=document.createElement("div");A.className="geCommentsWin";A.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var z=EditorUi.compactUi?"26px":"30px",D=document.createElement("div");D.className="geCommentsList";D.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":
-Dialog.backdropColor;D.style.bottom=parseInt(z)+7+"px";A.appendChild(D);var x=document.createElement("span");x.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(x,mxResources.get("noCommentsFound"));var C=document.createElement("div");C.className="geToolbarContainer geCommentsToolbar";C.style.height=z;C.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";C.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(C.style.filter=
-"none");z=document.createElement("a");z.className="geButton";mxClient.IS_QUIRKS&&(z.style.filter="none");if(!v){var G=z.cloneNode();G.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';G.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(G,"click",function(b){function c(){n(d,f,function(b){u(f);a.addComment(b,function(a){b.id=a;F.push(b);k(f)},function(b){g(f);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},
-!0)}var d=a.newComment("",a.getCurrentUser()),f=q(d,F,null,0);c();b.preventDefault();mxEvent.consume(b)});C.appendChild(G)}G=z.cloneNode();G.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';G.setAttribute("title",mxResources.get("showResolved"));var B=!1;"dark"==uiTheme&&(G.style.filter="invert(100%)");mxEvent.addListener(G,"click",function(a){this.className=(B=!B)?"geButton geCheckedBtn":"geButton";E();a.preventDefault();mxEvent.consume(a)});C.appendChild(G);a.commentsRefreshNeeded()&&
-(G=z.cloneNode(),G.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',G.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(G.style.filter="invert(100%)"),mxEvent.addListener(G,"click",function(a){E();a.preventDefault();mxEvent.consume(a)}),C.appendChild(G));a.commentsSaveNeeded()&&(z=z.cloneNode(),z.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',z.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&
-(z.style.filter="invert(100%)"),mxEvent.addListener(z,"click",function(a){f();a.preventDefault();mxEvent.consume(a)}),C.appendChild(z));A.appendChild(C);var F=[],E=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t){t.div=t.div.cloneNode(!0);var b=t.div.querySelector(".geCommentEditTxtArea"),c=t.div.querySelector(".geCommentEditBtns");t.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}D.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+
-'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";y=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});D.innerHTML="";D.appendChild(x);x.style.display="block";F=a;for(a=0;a<F.length;a++)b(F[a].replies),q(F[a],F,
-null,0,B);null!=t&&null==t.comment.id&&null==t.comment.pCommentId&&(D.appendChild(t.div),n(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(a){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):D.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});E();this.refreshComments=E;C=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(p(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])}
-if(this.window.isVisible()){for(var b=D.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var f=b[d];c[f.getAttribute("data-commentId")]=f}for(d=0;d<F.length;d++)a(F[d])}});setInterval(C,6E4);this.refreshCommentsTime=C;this.window=new mxWindow(mxResources.get("comments"),A,c,b,d,m,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,
-mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var I=mxUtils.bind(this,function(){var a=this.window.getX(),
-b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",I);this.destroy=function(){mxEvent.removeListener(window,"resize",I);this.window.destroy()}},ConfirmDialog=function(a,c,b,d,m,f,l,n,p,u){var g=document.createElement("div");g.style.textAlign="center";var k=document.createElement("div");k.style.padding="6px";k.style.overflow="auto";k.style.maxHeight="44px";k.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(k.style.height="60px");mxUtils.write(k,c);g.appendChild(k);
-null!=u&&(k=document.createElement("div"),k.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",u),k.appendChild(c),g.appendChild(k));u=document.createElement("div");u.style.textAlign="center";u.style.whiteSpace="nowrap";var q=document.createElement("input");q.setAttribute("type","checkbox");f=mxUtils.button(f||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(q.checked)});f.className="geBtn";null!=n&&(f.innerHTML=n+"<br>"+f.innerHTML,f.style.paddingBottom=
-"8px",f.style.paddingTop="8px",f.style.height="auto",f.style.width="40%");a.editor.cancelFirst&&u.appendChild(f);var v=mxUtils.button(m||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b(q.checked)});u.appendChild(v);null!=l?(v.innerHTML=l+"<br>"+v.innerHTML+"<br>",v.style.paddingBottom="8px",v.style.paddingTop="8px",v.style.height="auto",v.className="geBtn",v.style.width="40%"):v.className="geBtn gePrimaryBtn";a.editor.cancelFirst||u.appendChild(f);g.appendChild(u);p?(u.style.marginTop=
-"10px",k=document.createElement("p"),k.style.marginTop="20px",k.appendChild(q),m=document.createElement("span"),mxUtils.write(m," "+mxResources.get("rememberThisSetting")),k.appendChild(m),g.appendChild(k),mxEvent.addListener(m,"click",function(a){q.checked=!q.checked;mxEvent.consume(a)})):u.style.marginTop="12px";this.init=function(){v.focus()};this.container=g};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectId:!0,mxTransient:!0};
-EditorUi.prototype.patchPages=function(a,c,b,d,m){var f={},l=[],n={},p={},u={},g={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var k in d[EditorUi.DIFF_UPDATE])f[k]=d[EditorUi.DIFF_UPDATE][k];if(null!=c[EditorUi.DIFF_REMOVE])for(d=0;d<c[EditorUi.DIFF_REMOVE].length;d++)p[c[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=c[EditorUi.DIFF_INSERT])for(d=0;d<c[EditorUi.DIFF_INSERT].length;d++)n[c[EditorUi.DIFF_INSERT][d].previous]=c[EditorUi.DIFF_INSERT][d];if(null!=c[EditorUi.DIFF_UPDATE])for(k in c[EditorUi.DIFF_UPDATE])d=
-c[EditorUi.DIFF_UPDATE][k],null!=d.previous&&(g[d.previous]=k);if(null!=a){var q="";for(d=0;d<a.length;d++){var v=a[d].getId();u[v]=a[d];null!=g[q]||p[v]||null!=c[EditorUi.DIFF_UPDATE]&&null!=c[EditorUi.DIFF_UPDATE][v]&&null!=c[EditorUi.DIFF_UPDATE][v].previous||(g[q]=v);q=v}}var y={},t=mxUtils.bind(this,function(a){var d=null!=a?a.getId():"";if(null!=a&&!y[d]){y[d]=!0;l.push(a);var k=null!=c[EditorUi.DIFF_UPDATE]?c[EditorUi.DIFF_UPDATE][d]:null;null!=k&&(this.updatePageRoot(a),null!=k.name&&a.setName(k.name),
-null!=k.view&&this.patchViewState(a,k.view),null!=k.cells&&this.patchPage(a,k.cells,f[a.getId()],m),!b||null==k.cells&&null==k.view||(a.needsUpdate=!0))}a=g[d];null!=a&&(delete g[d],t(u[a]));a=n[d];null!=a&&(delete n[d],A(a))}),A=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var c=u[a.getId()];null==c?t(a):(c.root=a.root,this.currentPage==c?this.editor.graph.model.setRoot(c.root):b&&(c.needsUpdate=!0))});t();for(k in g)t(u[g[k]]),
-delete g[k];for(k in n)A(n[k]),delete n[k];return l};EditorUi.prototype.patchViewState=function(a,c){if(null!=a.viewState&&null!=c){a==this.currentPage&&(a.viewState=this.editor.graph.getViewState());for(var b in c)a.viewState[b]=JSON.parse(c[b]);a==this.currentPage&&this.editor.graph.setViewState(a.viewState)}};
-EditorUi.prototype.createParentLookup=function(a,c){function b(a){var b=d[a];null==b&&(b={inserted:[],moved:{}},d[a]=b);return b}var d={};if(null!=c[EditorUi.DIFF_INSERT])for(var m=0;m<c[EditorUi.DIFF_INSERT].length;m++){var f=c[EditorUi.DIFF_INSERT][m],l=null!=f.parent?f.parent:"",n=null!=f.previous?f.previous:"";b(l).inserted[n]=f}if(null!=c[EditorUi.DIFF_UPDATE])for(var p in c[EditorUi.DIFF_UPDATE])f=c[EditorUi.DIFF_UPDATE][p],null!=f.previous&&(l=f.parent,null==l&&(m=a.getCell(p),null!=m&&(m=
-a.getParent(m),null!=m&&(l=m.getId()))),null!=l&&(b(l).moved[f.previous]=p));return d};
-EditorUi.prototype.patchPage=function(a,c,b,d){var m=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),f=this.createParentLookup(m,c);m.beginUpdate();try{var l=m.updateEdgeParent,n=new mxDictionary,p=[];m.updateEdgeParent=function(a,b){!n.get(a)&&d&&(n.put(a,!0),p.push(a))};var u=f[""],g=null!=u&&null!=u.inserted?u.inserted[""]:null,k=null;null!=g&&(k=this.getCellForJson(g));if(null==k){var q=null!=u&&null!=u.moved?u.moved[""]:null;null!=q&&(k=m.getCell(q))}null!=k&&(m.setRoot(k),
-a.root=k);this.patchCellRecursive(a,m,m.root,f,c);if(null!=c[EditorUi.DIFF_REMOVE])for(var v=0;v<c[EditorUi.DIFF_REMOVE].length;v++){var y=m.getCell(c[EditorUi.DIFF_REMOVE][v]);null!=y&&m.remove(y)}if(null!=c[EditorUi.DIFF_UPDATE]){var t=null!=b&&null!=b.cells?b.cells[EditorUi.DIFF_UPDATE]:null;for(q in c[EditorUi.DIFF_UPDATE])this.patchCell(m,m.getCell(q),c[EditorUi.DIFF_UPDATE][q],null!=t?t[q]:null)}if(null!=c[EditorUi.DIFF_INSERT])for(v=0;v<c[EditorUi.DIFF_INSERT].length;v++)g=c[EditorUi.DIFF_INSERT][v],
-y=m.getCell(g.id),null!=y&&(m.setTerminal(y,m.getCell(g.source),!0),m.setTerminal(y,m.getCell(g.target),!1));m.updateEdgeParent=l;if(d&&0<p.length)for(v=0;v<p.length;v++)m.contains(p[v])&&m.updateEdgeParent(p[v])}finally{m.endUpdate()}};
-EditorUi.prototype.patchCellRecursive=function(a,c,b,d,m){if(null!=b){for(var f=d[b.getId()],l=null!=f&&null!=f.inserted?f.inserted:{},f=null!=f&&null!=f.moved?f.moved:{},n=0,p=c.getChildCount(b),u="",g=0;g<p;g++){var k=c.getChildAt(b,g).getId();null==f[u]&&(null==m[EditorUi.DIFF_UPDATE]||null==m[EditorUi.DIFF_UPDATE][k]||null==m[EditorUi.DIFF_UPDATE][k].previous&&null==m[EditorUi.DIFF_UPDATE][k].parent)&&(f[u]=k);u=k}p=mxUtils.bind(this,function(f,g){var l=null!=f?f.getId():"";if(null!=f&&g){var k=
-c.getCell(l);null!=k&&k!=f&&(f=null)}null!=f&&(c.getChildAt(b,n)!=f&&c.add(b,f,n),this.patchCellRecursive(a,c,f,d,m),n++);return l});for(u=[null];0<u.length;)if(g=u.shift(),g=p(null!=g?g.child:null,null!=g?g.insert:!1),k=f[g],null!=k&&(delete f[g],u.push({child:c.getCell(k)})),k=l[g],null!=k&&(delete l[g],u.push({child:this.getCellForJson(k),insert:!0})),0==u.length){for(g in f)u.push({child:c.getCell(f[g])}),delete f[g];for(g in l)u.push({child:this.getCellForJson(l[g]),insert:!0}),delete l[g]}}};
+pageVisible:b.pageVisible,translate:b.view.translate,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,f=null,e=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,
+e);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){if(e.source==(window.opener||window.parent)){var g=e.data,l=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"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=Graph.decompress(a)))}catch(Y){}return a});if("json"==urlParams.proto){try{g=JSON.parse(g)}catch(N){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();l=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):
+null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:g}),"*")},null!=g.titleKey?mxResources.get(g.titleKey):g.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==g.action){var p=l(g.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[g.name||this.defaultFilename]),p,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:g}),"*")}),mxUtils.bind(this,function(){this.hideDialog();
+k.postMessage(JSON.stringify({event:"draft",result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(N){k.postMessage(JSON.stringify({event:"draft",error:N.toString(),
+message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var l=1==g.enableRecent,p=1==g.enableSearch,n=1==g.enableCustomTemp,l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=g.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,e,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",
+null,null,a,function(){a(null,"Network Error!")})}):null,p?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,mxUtils.bind(this,function(a,b,c){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")}),null,null,n?mxUtils.bind(this,function(a){this.remoteInvoke("getCustomTemplates",null,null,a,function(){a({},0)})}):null);this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
+l.init();return}if("textContent"==g.action){l=this.getDiagramTextContent();k.postMessage(JSON.stringify({event:"textContent",data:l,message:g}),"*");return}if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var m=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||
+g.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var t=null!=g.xml?g.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 b=this.createLoadMessage("export");b.format=g.format;b.message=
+g;b.data=a;b.xml=encodeURIComponent(t);k.postMessage(JSON.stringify(b),"*")}),v=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(t)));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);u(a)}),p=g.pageId||(null!=this.pages?this.pages[0].getId():null);if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage.getId()!=p){for(var y=q.getGlobalVariable,q=this.createTemporaryGraph(q.getStylesheet()),
+G,l=0;l<this.pages.length;l++)if(this.pages[l].getId()==p){G=this.updatePageRoot(this.pages[l]);break}q.getGlobalVariable=function(a){return"page"==a?G.getName():"pagenumber"==a?1:y.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(G.root)}if(null!=g.layerIds){for(var p=q.model,n=p.getChildCells(p.getRoot()),z={},l=0;l<g.layerIds.length;l++)z[g.layerIds[l]]=!0;for(l=0;l<n.length;l++)p.setVisible(n[l],z[n[l].id]||!1)}this.exportToCanvas(mxUtils.bind(this,function(a){v(a.toDataURL("image/png"))}),
+null,null,null,mxUtils.bind(this,function(){v(null)}),null,null,g.scale,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+(null!=p?"&pageId="+p:"")+(null!=g.layerIds?"&extras="+encodeURIComponent(JSON.stringify({layerIds:g.layerIds})):"")+(null!=g.scale?"&scale="+g.scale:"")+"&base64=1&xml="+encodeURIComponent(t))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?u("data:image/png;base64,"+a.getText()):v(null)}),mxUtils.bind(this,
+function(){v(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);m=this.createLoadMessage("export");if("html2"==g.format||"html"==g.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=g.format;else if("html"==g.format)t=this.editor.getGraphXml(),m.data=this.getHtml(t,this.editor.graph),m.xml=mxUtils.getXml(t),m.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=
+null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);m.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.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"==g.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"==
+g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(p=document.createElement("span"),mxUtils.write(p,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight=
+"38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(p),this.embedFilenameSpan=p),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):g.xml;else{"remoteInvokeReady"==g.action?this.handleRemoteInvokeReady(k):"remoteInvoke"==g.action?this.handleRemoteInvoke(g):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):k.postMessage(JSON.stringify({error:"unknownMessage",
+data:JSON.stringify(g)}),"*");return}}var Q=mxUtils.bind(this,function(e,g){c=!0;try{a(e,g)}catch(L){this.handleError(L)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var l=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();if(d!=f&&!c){var e=this.createLoadMessage("autosave");e.xml=d;d=JSON.stringify(e);(window.opener||
+window.parent).postMessage(d,"*")}f=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||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=g&&"function"===typeof g.substring&&"data:application/vnd.visio;base64,"==g.substring(0,34)?(l="0M8R4KGxGuE"==g.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){Q(a,e)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=g&&"function"===typeof g.substring&&
+!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,"")?this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&Q(a.responseText,e)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){Q(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(g=l(g),Q(g,e))}}));var k=
+window.opener||window.parent,e="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(e,"*")};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":"0px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";"1"==urlParams.noSaveBtn?(mxUtils.write(b,
+mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)):(mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),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.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",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.className="geBigButton geBigStandardButton";b.style.marginLeft="6px";b.style.marginRight="20px";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.isOffline()?
+null:"https://about.draw.io/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),f=0;f<a.length;f++){var e=new window[a[f].layout](c);if(null!=a[f].config)for(var g in a[f].config)e[g]=a[f].config[g];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=
+function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var g={},k=null,l=null,n=null,m=null,q=null,A=null,F=null,D=null,H="",J="auto",I="auto",G=null,K=null,Q=40,N=40,Y=100,T=0,L=this.editor.graph;L.getGraphBounds();for(var W=function(){null!=b?b(la):(L.setSelectionCells(la),L.scrollCellToVisible(L.getSelectionCell()))},aa=L.getFreeInsertPoint(),ha=aa.x,ga=aa.y,aa=ga,ca=null,V="auto",D=null,ba=[],R=null,Z=null,X=0;X<c.length&&"#"==c[X].charAt(0);){a=c[X];for(X++;X<c.length&&"\\"==a.charAt(a.length-
+1)&&"#"==c[X].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[X].substring(1)),X++;if("#"!=a.charAt(1)){var ea=a.indexOf(":");if(0<ea){var P=mxUtils.trim(a.substring(1,ea)),M=mxUtils.trim(a.substring(ea+1));"label"==P?ca=L.sanitizeHtml(M):"labelname"==P&&0<M.length&&"-"!=M?m=M:"labels"==P&&0<M.length&&"-"!=M?q=JSON.parse(M):"style"==P?k=M:"parentstyle"==P?A=M:"stylename"==P&&0<M.length&&"-"!=M?n=M:"styles"==P&&0<M.length&&"-"!=M?l=JSON.parse(M):"identity"==P&&0<M.length&&"-"!=M?F=M:"parent"==
+P&&0<M.length&&"-"!=M?D=M:"namespace"==P&&0<M.length&&"-"!=M?H=M:"width"==P?J=M:"height"==P?I=M:"left"==P&&0<M.length?G=M:"top"==P&&0<M.length?K=M:"ignore"==P?Z=M.split(","):"connect"==P?ba.push(JSON.parse(M)):"link"==P?R=M:"padding"==P?T=parseFloat(M):"edgespacing"==P?Q=parseFloat(M):"nodespacing"==P?N=parseFloat(M):"levelspacing"==P?Y=parseFloat(M):"layout"==P&&(V=M)}}}if(null==c[X])throw Error(mxResources.get("invalidOrMissingFile"));var da=this.editor.csvToArray(c[X]),P=ea=null;if(null!=F||null!=
+D)for(var S=0;S<da.length;S++)F==da[S]&&(ea=S),D==da[S]&&(P=S);null==ca&&(ca="%"+da[0]+"%");if(null!=ba)for(var U=0;U<ba.length;U++)null==g[ba[U].to]&&(g[ba[U].to]={});L.model.beginUpdate();try{for(S=X+1;S<c.length;S++){var ja=this.editor.csvToArray(c[S]);if(null==ja){var ka=40<c[S].length?c[S].substring(0,40)+"...":c[S];throw Error(S+" ("+ka+") "+mxResources.get("containsValidationErrors"));}if(ja.length==da.length){var O=null,ma=null!=ea?H+ja[ea]:null;null!=ma&&(O=L.model.getCell(ma));var F=null!=
+O,fa=new mxCell(ca,new mxGeometry(ha,aa,0,0),k||"whiteSpace=wrap;html=1;");fa.vertex=!0;fa.id=ma;for(var ia=0;ia<ja.length;ia++)L.setAttributeForCell(fa,da[ia],ja[ia]);if(null!=m&&null!=q){var ua=q[fa.getAttribute(m)];null!=ua&&L.labelChanged(fa,ua)}if(null!=n&&null!=l){var va=l[fa.getAttribute(n)];null!=va&&(fa.style=va)}L.setAttributeForCell(fa,"placeholders","1");fa.style=L.replacePlaceholders(fa,fa.style);F&&(L.model.setGeometry(O,fa.geometry),L.model.setStyle(O,fa.style),0>mxUtils.indexOf(f,
+O)&&f.push(O));O=fa;if(!F)for(U=0;U<ba.length;U++)g[ba[U].to][O.getAttribute(ba[U].to)]=O;null!=R&&"link"!=R&&(L.setLinkForCell(O,O.getAttribute(R)),L.setAttributeForCell(O,R,null));L.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var wa=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=G&&null!=O.getAttribute(G)&&(O.geometry.x=ha+parseFloat(O.getAttribute(G))),null!=K&&null!=O.getAttribute(K)&&(O.geometry.y=ga+parseFloat(O.getAttribute(K))),"@"==J.charAt(0)&&null!=O.getAttribute(J.substring(1))?
+O.geometry.width=parseFloat(O.getAttribute(J.substring(1))):O.geometry.width="auto"==J?wa.width+T:parseFloat(J),"@"==I.charAt(0)&&null!=O.getAttribute(I.substring(1))?O.geometry.height=parseFloat(O.getAttribute(I.substring(1))):O.geometry.height="auto"==I?wa.height+T:parseFloat(I),aa+=O.geometry.height+N);F?(null==e[ma]&&(e[ma]=[]),e[ma].push(O)):(D=null!=P?L.model.getCell(H+ja[P]):null,d.push(O),null!=D?(D.style=L.replacePlaceholders(D,A),L.addCell(O,D)):f.push(L.addCell(O)))}}for(var na=f.slice(),
+la=f.slice(),U=0;U<ba.length;U++)for(var xa=ba[U],S=0;S<f.length;S++){var O=f[S],ya=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){L.setAttributeForCell(b,c.from,null);for(var d=d.split(","),f=0;f<d.length;f++){var e=g[c.to][d[f]];if(null!=e){var k=c.label;null!=c.fromlabel&&(k=(b.getAttribute(c.fromlabel)||"")+(k||""));null!=c.tolabel&&(k=(k||"")+(e.getAttribute(c.tolabel)||""));la.push(L.insertEdge(null,null,k||"",c.invert?e:a,c.invert?a:e,c.style||L.createCurrentEdgeStyle()));
+mxUtils.remove(c.invert?a:e,na)}}}});ya(O,O,xa);if(null!=e[O.id])for(ia=0;ia<e[O.id].length;ia++)ya(O,e[O.id][ia],xa)}if(null!=Z)for(S=0;S<d.length;S++)for(O=d[S],ia=0;ia<Z.length;ia++)L.setAttributeForCell(O,mxUtils.trim(Z[ia]),null);if(0<f.length){var oa=new mxParallelEdgeLayout(L);oa.spacing=Q;var ta=function(){0<oa.spacing&&oa.execute(L.getDefaultParent());for(var a=0;a<f.length;a++){var b=L.getCellGeometry(f[a]);b.x=Math.round(L.snap(b.x));b.y=Math.round(L.snap(b.y));"auto"==J&&(b.width=Math.round(L.snap(b.width)));
+"auto"==I&&(b.height=Math.round(L.snap(b.height)))}};if("["==V.charAt(0)){var za=W;L.view.validate();this.executeLayoutList(JSON.parse(V),function(){ta();za()});W=null}else if("circle"==V){var ra=new mxCircleLayout(L);ra.resetEdges=!1;var Aa=ra.isVertexIgnored;ra.isVertexIgnored=function(a){return Aa.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){ra.execute(L.getDefaultParent());ta()},!0,W);W=null}else if("horizontaltree"==V||"verticaltree"==V||"auto"==V&&la.length==
+2*f.length-1&&1==na.length){L.view.validate();var sa=new mxCompactTreeLayout(L,"horizontaltree"==V);sa.levelDistance=N;sa.edgeRouting=!1;sa.resetEdges=!1;this.executeLayout(function(){sa.execute(L.getDefaultParent(),0<na.length?na[0]:null)},!0,W);W=null}else if("horizontalflow"==V||"verticalflow"==V||"auto"==V&&1==na.length){L.view.validate();var pa=new mxHierarchicalLayout(L,"horizontalflow"==V?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);pa.intraCellSpacing=N;pa.parallelEdgeSpacing=Q;
+pa.interRankCellSpacing=Y;pa.disableEdgeStyle=!1;this.executeLayout(function(){pa.execute(L.getDefaultParent(),la);L.moveCells(la,ha,ga)},!0,W);W=null}else if("organic"==V||"auto"==V&&la.length>f.length){L.view.validate();var qa=new mxFastOrganicLayout(L);qa.forceConstant=3*N;qa.resetEdges=!1;var Ba=qa.isVertexIgnored;qa.isVertexIgnored=function(a){return Ba.apply(this,arguments)||0>mxUtils.indexOf(f,a)};oa=new mxParallelEdgeLayout(L);oa.spacing=Q;this.executeLayout(function(){qa.execute(L.getDefaultParent());
+ta()},!0,W);W=null}}this.hideDialog()}finally{L.model.endUpdate()}null!=W&&W()}}catch(Ca){this.handleError(Ca)}};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,560,130,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=
+m.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 f=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 f.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 e=b.init;b.init=function(){e.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"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var g=mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=g.backgroundColor;null!=f.view.backgroundPageShape&&null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.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=1;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.gitLab||c++;b&&a&&isLocalStorage&&"1"==urlParams.browser&&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),this.menus.get("newLibrary").setEnabled(c));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.actions.get("undo").setEnabled(this.canUndo()&&a);this.actions.get("redo").setEnabled(this.canRedo()&&a);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 d=applicationCache;if(null!=d&&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 d=window.applicationCache,e=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+
+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.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!=e&&(this.offlineStatus.innerHTML=b,e=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,
+"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=
+function(){n.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.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!=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("hidden"!=this.diagramContainer.style.visibility);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 q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.editUpdateListener&&(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener=null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);q.apply(this,
+arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,g,k){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 l=a.getFileData(!0,null,null,null,null,!0),n=f.getGraphBounds(),p=Math.floor(n.width*e/f.view.scale),m=Math.floor(n.height*e/f.view.scale);
+if(l.length<=MAX_REQUEST_SIZE&&p*m<MAX_AREA)if(a.hideDialog(),"png"!=c&&"jpg"!=c&&"jpeg"!=c||!a.isExportToCanvas()){var t={globalVars:f.getExportVariables()};a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(t))+(0<k?"&dpi="+k:"")+"&bg="+(null!=d?d:"none")+"&w="+p+"&h="+m+"&border="+g+"&xml="+encodeURIComponent(l))})}else"png"==c?a.exportImage(e,null==d||"none"==
+d,!0,!1,!1,g,!0,!1,null,null,k):a.exportImage(e,!1,!0,!1,!1,g,!0,!1,"jpeg");else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var f=this.getFutureCellForEdit(c.model,a,d.source.id);f!=d.source&&(d.source=f)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,
+a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,c){var d=a.getCell(c);if(null==d)for(var f=b.changes.length-1;0<=f;f--){var e=b.changes[f];if(e.constructor==mxChildChange&&null!=e.child&&e.child.id==c){a.contains(e.previous)&&(d=e.child);break}}return d};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var a=this.editor.graph,b="";if(null!=this.pages)for(var c=0;c<this.pages.length;c++){var d=a;this.currentPage!=
+this.pages[c]&&(d=this.createTemporaryGraph(a.getStylesheet()),d.model.setRoot(this.pages[c].root));b+=this.pages[c].getName()+" "+d.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b={},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";
+c.appendChild(d);var f=document.createElement("div");f.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";f.innerHTML='<div style="text-align:center;padding:8px;"><img src="/images/spin.gif"></div>';var e={};try{var g=mxSettings.getCustomLibraries();for(a=0;a<g.length;a++){var k=g[a];if("R"==k.substring(0,1)){var n=JSON.parse(decodeURIComponent(k.substring(1)));e[n[0]]={id:n[0],title:n[1],downloadUrl:n[2]}}}}catch(x){}this.remoteInvoke("getCustomLibraries",null,null,function(a){f.innerHTML=
+"";if(0==a.length)f.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];e[d.id]&&(b[d.id]=d);var g=this.addCheckbox(f,d.title,e[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},mxUtils.bind(this,function(a){f.innerHTML="";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,
+mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));f.appendChild(b)}));c.appendChild(f);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==e[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(F){this.handleError(F,
+mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in e)b[c]||this.closeLibrary(new RemoteLibrary(this,null,e[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763");this.showDialog(c.container,340,375,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=
+[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=
+function(a,b,c,d,e){var f=!0,g=window.setTimeout(mxUtils.bind(this,function(){f=!1;e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),k=mxUtils.bind(this,function(){window.clearTimeout(g);f&&d.apply(this,arguments)});c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:k,error:e});a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,msgMarkers:c});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};
+EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var e=a.functionArgs;Array.isArray(e)||(e=[]);if(d.isAsync)e.push(function(){b(Array.prototype.slice.apply(arguments))}),e.push(function(a){b(null,a||"Unkown Error")}),
+this[c].apply(this,e);else{var f=this[c].apply(this,e);b([f])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(z){b(null,"Invalid Call: An error occured, "+z.message)}};EditorUi.prototype.commentsSupported=function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var a=this.getCurrentFile();return null!=
+a?a.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(a,b){var c=this.getCurrentFile();null!=c?c.getComments(a,b):a([])};EditorUi.prototype.addComment=function(a,b,c){var d=this.getCurrentFile();null!=d?d.addComment(a,b,c):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile();return null!=a?a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=
+function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!=c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();
+return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language","da, mi, en, de-DE")}})();
+var CommentsWindow=function(a,c,b,d,g,e){function k(){for(var a=C.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==C&&b++;x.style.display=0==b?"block":"none"}function m(a,b,c,d){function e(){b.removeChild(l);b.removeChild(n);g.style.display="block";f.style.display="block"}t={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),l=document.createElement("textarea");l.className=
+"geCommentEditTxtArea";l.style.minHeight=f.offsetHeight+"px";l.value=a.content;b.insertBefore(l,f);var n=document.createElement("div");n.className="geCommentEditBtns";var m=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),k()):e();t=null});m.className="geCommentEditBtn";n.appendChild(m);var p=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=l.value;mxUtils.write(f,a.content);e();c(a);t=null});mxEvent.addListener(l,"keydown",mxUtils.bind(this,
+function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(p.click(),mxEvent.consume(a)):27==a.keyCode&&(m.click(),mxEvent.consume(a)))}));p.focus();p.className="geCommentEditBtn gePrimaryBtn";n.appendChild(p);b.insertBefore(n,f);g.style.display="none";f.style.display="none";l.focus()}function n(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
+[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function q(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function f(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function l(a){a.style.border="";a.removeChild(a.busyImg)}function p(b,c,d,e,g){function B(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
+"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});J.appendChild(e);d&&(e.style.display="none")}function E(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=y;a(b);return{pdiv:d,replies:c}}function G(c,d,g,k,n){function x(){q(A);b.addReply(u,function(a){u.id=a;b.replies.push(u);l(A);g&&g()},function(b){t();f(A);a.handleError(b,null,
+null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},k,n)}function t(){m(u,A,function(a){x()},!0)}var B=E().pdiv,u=a.newComment(c,a.getCurrentUser());u.pCommentId=b.id;null==b.replies&&(b.replies=[]);var A=p(u,b.replies,B,e+1);d?t():x()}if(g||!b.isResolved){x.style.display="none";var y=document.createElement("div");y.className="geCommentContainer";y.setAttribute("data-commentId",b.id);y.style.marginLeft=20*e+5+"px";b.isResolved&&"dark"!=uiTheme&&(y.style.backgroundColor="ghostWhite");
+var z=document.createElement("div");z.className="geCommentHeader";var F=document.createElement("img");F.className="geCommentUserImg";F.src=b.user.pictureUrl||Editor.userImage;z.appendChild(F);F=document.createElement("div");F.className="geCommentHeaderTxt";z.appendChild(F);var D=document.createElement("div");D.className="geCommentUsername";mxUtils.write(D,b.user.displayName||"");F.appendChild(D);D=document.createElement("div");D.className="geCommentDate";D.setAttribute("data-commentId",b.id);n(b,
+D);F.appendChild(D);y.appendChild(z);z=document.createElement("div");z.className="geCommentTxt";mxUtils.write(z,b.content||"");y.appendChild(z);z=document.createElement("div");z.className="geCommentActions";var J=document.createElement("ul");J.className="geCommentActionsList";z.appendChild(J);u||0!=e&&!v||B(mxResources.get("reply"),function(){G("",!0)},b.isResolved);F=a.getCurrentUser();null==F||F.id!=b.user.id||u||(B(mxResources.get("edit"),function(){function c(){m(b,y,function(){q(y);b.editComment(b.content,
+function(){l(y)},function(b){f(y);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),B(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){q(y);b.deleteComment(function(){for(var a=E(b).replies,d=0;d<a.length;d++)C.removeChild(a[d]);for(d=0;d<c.length;d++)if(c[d]==b){c.splice(d,1);break}x.style.display=0==C.getElementsByTagName("div").length?"block":"none"},function(b){f(y);a.handleError(b,null,null,
+null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));u||0!=e||B(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=E(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var l=e[g].querySelectorAll(".geCommentAction"),
+n=0;n<l.length;n++)l[n]!=c.parentNode&&(l[n].style.display=d);A||(e[g].style.display="none")}k()}b.isResolved?G(mxResources.get("reOpened")+": ",!0,c,!1,!0):G(mxResources.get("markedAsResolved"),!1,c,!0)});y.appendChild(z);null!=d?C.insertBefore(y,d.nextSibling):C.appendChild(y);for(d=0;null!=b.replies&&d<b.replies.length;d++)z=b.replies[d],z.isResolved=b.isResolved,p(z,b.replies,null,e+1,g);null!=t&&(t.comment.id==b.id?(g=b.content,b.content=t.comment.content,m(b,y,t.saveCallback,t.deleteOnCancel),
+b.content=g):null==t.comment.id&&t.comment.pCommentId==b.id&&(C.appendChild(t.div),m(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return y}}var u=!a.canComment(),v=a.canReplyToReplies(),t=null,z=document.createElement("div");z.className="geCommentsWin";z.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var y=EditorUi.compactUi?"26px":"30px",C=document.createElement("div");C.className="geCommentsList";C.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":
+Dialog.backdropColor;C.style.bottom=parseInt(y)+7+"px";z.appendChild(C);var x=document.createElement("span");x.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(x,mxResources.get("noCommentsFound"));var B=document.createElement("div");B.className="geToolbarContainer geCommentsToolbar";B.style.height=y;B.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";B.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(B.style.filter=
+"none");y=document.createElement("a");y.className="geButton";mxClient.IS_QUIRKS&&(y.style.filter="none");if(!u){var E=y.cloneNode();E.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';E.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(E,"click",function(b){function c(){m(d,e,function(b){q(e);a.addComment(b,function(a){b.id=a;F.push(b);l(e)},function(b){f(e);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},
+!0)}var d=a.newComment("",a.getCurrentUser()),e=p(d,F,null,0);c();b.preventDefault();mxEvent.consume(b)});B.appendChild(E)}E=y.cloneNode();E.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';E.setAttribute("title",mxResources.get("showResolved"));var A=!1;"dark"==uiTheme&&(E.style.filter="invert(100%)");mxEvent.addListener(E,"click",function(a){this.className=(A=!A)?"geButton geCheckedBtn":"geButton";D();a.preventDefault();mxEvent.consume(a)});B.appendChild(E);a.commentsRefreshNeeded()&&
+(E=y.cloneNode(),E.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',E.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(E.style.filter="invert(100%)"),mxEvent.addListener(E,"click",function(a){D();a.preventDefault();mxEvent.consume(a)}),B.appendChild(E));a.commentsSaveNeeded()&&(y=y.cloneNode(),y.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',y.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&
+(y.style.filter="invert(100%)"),mxEvent.addListener(y,"click",function(a){e();a.preventDefault();mxEvent.consume(a)}),B.appendChild(y));z.appendChild(B);var F=[],D=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t){t.div=t.div.cloneNode(!0);var b=t.div.querySelector(".geCommentEditTxtArea"),c=t.div.querySelector(".geCommentEditBtns");t.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+
+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";v=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});C.innerHTML="";C.appendChild(x);x.style.display="block";F=a;for(a=0;a<F.length;a++)b(F[a].replies),p(F[a],F,
+null,0,A);null!=t&&null==t.comment.id&&null==t.comment.pCommentId&&(C.appendChild(t.div),m(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(a){C.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});D();this.refreshComments=D;B=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(n(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])}
+if(this.window.isVisible()){for(var b=C.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<F.length;d++)a(F[d])}});setInterval(B,6E4);this.refreshCommentsTime=B;this.window=new mxWindow(mxResources.get("comments"),z,c,b,d,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,
+mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var H=mxUtils.bind(this,function(){var a=this.window.getX(),
+b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",H);this.destroy=function(){mxEvent.removeListener(window,"resize",H);this.window.destroy()}},ConfirmDialog=function(a,c,b,d,g,e,k,m,n,q){var f=document.createElement("div");f.style.textAlign="center";var l=document.createElement("div");l.style.padding="6px";l.style.overflow="auto";l.style.maxHeight="44px";l.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(l.style.height="60px");mxUtils.write(l,c);f.appendChild(l);
+null!=q&&(l=document.createElement("div"),l.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",q),l.appendChild(c),f.appendChild(l));q=document.createElement("div");q.style.textAlign="center";q.style.whiteSpace="nowrap";var p=document.createElement("input");p.setAttribute("type","checkbox");e=mxUtils.button(e||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(p.checked)});e.className="geBtn";null!=m&&(e.innerHTML=m+"<br>"+e.innerHTML,e.style.paddingBottom=
+"8px",e.style.paddingTop="8px",e.style.height="auto",e.style.width="40%");a.editor.cancelFirst&&q.appendChild(e);var u=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b(p.checked)});q.appendChild(u);null!=k?(u.innerHTML=k+"<br>"+u.innerHTML+"<br>",u.style.paddingBottom="8px",u.style.paddingTop="8px",u.style.height="auto",u.className="geBtn",u.style.width="40%"):u.className="geBtn gePrimaryBtn";a.editor.cancelFirst||q.appendChild(e);f.appendChild(q);n?(q.style.marginTop=
+"10px",l=document.createElement("p"),l.style.marginTop="20px",l.appendChild(p),g=document.createElement("span"),mxUtils.write(g," "+mxResources.get("rememberThisSetting")),l.appendChild(g),f.appendChild(l),mxEvent.addListener(g,"click",function(a){p.checked=!p.checked;mxEvent.consume(a)})):q.style.marginTop="12px";this.init=function(){u.focus()};this.container=f};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectId:!0,mxTransient:!0};
+EditorUi.prototype.patchPages=function(a,c,b,d,g){var e={},k=[],m={},n={},q={},f={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var l in d[EditorUi.DIFF_UPDATE])e[l]=d[EditorUi.DIFF_UPDATE][l];if(null!=c[EditorUi.DIFF_REMOVE])for(d=0;d<c[EditorUi.DIFF_REMOVE].length;d++)n[c[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=c[EditorUi.DIFF_INSERT])for(d=0;d<c[EditorUi.DIFF_INSERT].length;d++)m[c[EditorUi.DIFF_INSERT][d].previous]=c[EditorUi.DIFF_INSERT][d];if(null!=c[EditorUi.DIFF_UPDATE])for(l in c[EditorUi.DIFF_UPDATE])d=
+c[EditorUi.DIFF_UPDATE][l],null!=d.previous&&(f[d.previous]=l);if(null!=a){var p="";for(d=0;d<a.length;d++){var u=a[d].getId();q[u]=a[d];null!=f[p]||n[u]||null!=c[EditorUi.DIFF_UPDATE]&&null!=c[EditorUi.DIFF_UPDATE][u]&&null!=c[EditorUi.DIFF_UPDATE][u].previous||(f[p]=u);p=u}}var v={},t=mxUtils.bind(this,function(a){var d=null!=a?a.getId():"";if(null!=a&&!v[d]){v[d]=!0;k.push(a);var l=null!=c[EditorUi.DIFF_UPDATE]?c[EditorUi.DIFF_UPDATE][d]:null;null!=l&&(this.updatePageRoot(a),null!=l.name&&a.setName(l.name),
+null!=l.view&&this.patchViewState(a,l.view),null!=l.cells&&this.patchPage(a,l.cells,e[a.getId()],g),!b||null==l.cells&&null==l.view||(a.needsUpdate=!0))}a=f[d];null!=a&&(delete f[d],t(q[a]));a=m[d];null!=a&&(delete m[d],z(a))}),z=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var c=q[a.getId()];null==c?t(a):(c.root=a.root,this.currentPage==c?this.editor.graph.model.setRoot(c.root):b&&(c.needsUpdate=!0))});t();for(l in f)t(q[f[l]]),
+delete f[l];for(l in m)z(m[l]),delete m[l];return k};EditorUi.prototype.patchViewState=function(a,c){if(null!=a.viewState&&null!=c){a==this.currentPage&&(a.viewState=this.editor.graph.getViewState());for(var b in c)a.viewState[b]=JSON.parse(c[b]);a==this.currentPage&&this.editor.graph.setViewState(a.viewState)}};
+EditorUi.prototype.createParentLookup=function(a,c){function b(a){var b=d[a];null==b&&(b={inserted:[],moved:{}},d[a]=b);return b}var d={};if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++){var e=c[EditorUi.DIFF_INSERT][g],k=null!=e.parent?e.parent:"",m=null!=e.previous?e.previous:"";b(k).inserted[m]=e}if(null!=c[EditorUi.DIFF_UPDATE])for(var n in c[EditorUi.DIFF_UPDATE])e=c[EditorUi.DIFF_UPDATE][n],null!=e.previous&&(k=e.parent,null==k&&(g=a.getCell(n),null!=g&&(g=
+a.getParent(g),null!=g&&(k=g.getId()))),null!=k&&(b(k).moved[e.previous]=n));return d};
+EditorUi.prototype.patchPage=function(a,c,b,d){var g=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),e=this.createParentLookup(g,c);g.beginUpdate();try{var k=g.updateEdgeParent,m=new mxDictionary,n=[];g.updateEdgeParent=function(a,b){!m.get(a)&&d&&(m.put(a,!0),n.push(a))};var q=e[""],f=null!=q&&null!=q.inserted?q.inserted[""]:null,l=null;null!=f&&(l=this.getCellForJson(f));if(null==l){var p=null!=q&&null!=q.moved?q.moved[""]:null;null!=p&&(l=g.getCell(p))}null!=l&&(g.setRoot(l),
+a.root=l);this.patchCellRecursive(a,g,g.root,e,c);if(null!=c[EditorUi.DIFF_REMOVE])for(var u=0;u<c[EditorUi.DIFF_REMOVE].length;u++){var v=g.getCell(c[EditorUi.DIFF_REMOVE][u]);null!=v&&g.remove(v)}if(null!=c[EditorUi.DIFF_UPDATE]){var t=null!=b&&null!=b.cells?b.cells[EditorUi.DIFF_UPDATE]:null;for(p in c[EditorUi.DIFF_UPDATE])this.patchCell(g,g.getCell(p),c[EditorUi.DIFF_UPDATE][p],null!=t?t[p]:null)}if(null!=c[EditorUi.DIFF_INSERT])for(u=0;u<c[EditorUi.DIFF_INSERT].length;u++)f=c[EditorUi.DIFF_INSERT][u],
+v=g.getCell(f.id),null!=v&&(g.setTerminal(v,g.getCell(f.source),!0),g.setTerminal(v,g.getCell(f.target),!1));g.updateEdgeParent=k;if(d&&0<n.length)for(u=0;u<n.length;u++)g.contains(n[u])&&g.updateEdgeParent(n[u])}finally{g.endUpdate()}};
+EditorUi.prototype.patchCellRecursive=function(a,c,b,d,g){if(null!=b){for(var e=d[b.getId()],k=null!=e&&null!=e.inserted?e.inserted:{},e=null!=e&&null!=e.moved?e.moved:{},m=0,n=c.getChildCount(b),q="",f=0;f<n;f++){var l=c.getChildAt(b,f).getId();null==e[q]&&(null==g[EditorUi.DIFF_UPDATE]||null==g[EditorUi.DIFF_UPDATE][l]||null==g[EditorUi.DIFF_UPDATE][l].previous&&null==g[EditorUi.DIFF_UPDATE][l].parent)&&(e[q]=l);q=l}n=mxUtils.bind(this,function(e,f){var k=null!=e?e.getId():"";if(null!=e&&f){var l=
+c.getCell(k);null!=l&&l!=e&&(e=null)}null!=e&&(c.getChildAt(b,m)!=e&&c.add(b,e,m),this.patchCellRecursive(a,c,e,d,g),m++);return k});for(q=[null];0<q.length;)if(f=q.shift(),f=n(null!=f?f.child:null,null!=f?f.insert:!1),l=e[f],null!=l&&(delete e[f],q.push({child:c.getCell(l)})),l=k[f],null!=l&&(delete k[f],q.push({child:this.getCellForJson(l),insert:!0})),0==q.length){for(f in e)q.push({child:c.getCell(e[f])}),delete e[f];for(f in k)q.push({child:this.getCellForJson(k[f]),insert:!0}),delete k[f]}}};
EditorUi.prototype.patchCell=function(a,c,b,d){if(null!=c&&null!=b){if(null==d||null==d.xmlValue&&(null==d.value||""==d.value))"value"in b?a.setValue(c,b.value):null!=b.xmlValue&&a.setValue(c,mxUtils.parseXml(b.xmlValue).documentElement);null!=d&&null!=d.style||null==b.style||a.setStyle(c,b.style);null!=b.visible&&a.setVisible(c,1==b.visible);null!=b.collapsed&&a.setCollapsed(c,1==b.collapsed);null!=b.vertex&&(c.vertex=1==b.vertex);null!=b.edge&&(c.edge=1==b.edge);null!=b.connectable&&(c.connectable=
-1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var m in b)this.cellProperties[m]||(c[m]=b[m])}};
-EditorUi.prototype.getPagesForNode=function(a,c){var b=this.editor.extractGraphModel(a,!0);null!=b&&(a=b);var b=a.getElementsByTagName(c||"diagram"),d=[];if(0<b.length)for(var m=0;m<b.length;m++){var f=new DiagramPage(b[m]);this.updatePageRoot(f);d.push(f)}else"mxGraphModel"==a.nodeName&&(f=new DiagramPage(a.ownerDocument.createElement("diagram")),f.setName(mxResources.get("pageWithNumber",[1])),mxUtils.setTextContent(f.node,Graph.compressNode(a)),d.push(f));return d};
-EditorUi.prototype.diffPages=function(a,c){for(var b=[],d=[],m={},f={},l={},n=null,p=0;p<c.length;p++)f[c[p].getId()]={page:c[p],prev:n},n=c[p];n=null;for(p=0;p<a.length;p++){var u=a[p].getId(),g=f[u];if(null==g)d.push(u);else{var k=this.diffPage(a[p],g.page),q={};0<Object.keys(k).length&&(q.cells=k);k=this.diffViewState(a[p],g.page);0<Object.keys(k).length&&(q.view=k);if((null!=g.prev?null==n:null!=n)||null!=n&&null!=g.prev&&n.getId()!=g.prev.getId())q.previous=null!=g.prev?g.prev.getId():"";null!=
-g.page.getName()&&a[p].getName()!=g.page.getName()&&(q.name=g.page.getName());0<Object.keys(q).length&&(l[u]=q)}delete f[a[p].getId()];n=a[p]}for(u in f)g=f[u],b.push({data:mxUtils.getXml(g.page.node),previous:null!=g.prev?g.prev.getId():""});0<Object.keys(l).length&&(m[EditorUi.DIFF_UPDATE]=l);0<d.length&&(m[EditorUi.DIFF_REMOVE]=d);0<b.length&&(m[EditorUi.DIFF_INSERT]=b);return m};
-EditorUi.prototype.createCellLookup=function(a,c,b){b=null!=b?b:{};b[a.getId()]={cell:a,prev:c};var d=a.getChildCount();c=null;for(var m=0;m<d;m++){var f=a.getChildAt(m);this.createCellLookup(f,c,b);c=f}return b};
-EditorUi.prototype.diffCellRecursive=function(a,c,b,d,m){d=null!=d?d:{};var f=b[a.getId()];delete b[a.getId()];if(null==f)m.push(a.getId());else{var l=this.diffCell(a,f.cell);if(null!=l.parent||(null!=f.prev?null==c:null!=c)||null!=c&&null!=f.prev&&c.getId()!=f.prev.getId())l.previous=null!=f.prev?f.prev.getId():"";0<Object.keys(l).length&&(d[a.getId()]=l)}f=a.getChildCount();c=null;for(l=0;l<f;l++){var n=a.getChildAt(l);this.diffCellRecursive(n,c,b,d,m);c=n}return d};
-EditorUi.prototype.diffPage=function(a,c){var b=[],d=[],m={};this.updatePageRoot(a);this.updatePageRoot(c);var f=this.createCellLookup(c.root),l=this.diffCellRecursive(a.root,null,f,l,d),n;for(n in f){var p=f[n];b.push(this.getJsonForCell(p.cell,p.prev))}0<Object.keys(l).length&&(m[EditorUi.DIFF_UPDATE]=l);0<d.length&&(m[EditorUi.DIFF_REMOVE]=d);0<b.length&&(m[EditorUi.DIFF_INSERT]=b);return m};
-EditorUi.prototype.diffViewState=function(a,c){var b=a.viewState,d=c.viewState,m={};c==this.currentPage&&(d=this.editor.graph.getViewState());if(null!=b&&null!=d)for(var f in this.viewStateProperties){var l=JSON.stringify(b[f]),n=JSON.stringify(d[f]);l!=n&&(m[f]=n)}return m};
+1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var g in b)this.cellProperties[g]||(c[g]=b[g])}};
+EditorUi.prototype.getPagesForNode=function(a,c){var b=this.editor.extractGraphModel(a,!0);null!=b&&(a=b);var b=a.getElementsByTagName(c||"diagram"),d=[];if(0<b.length)for(var g=0;g<b.length;g++){var e=new DiagramPage(b[g]);this.updatePageRoot(e);d.push(e)}else"mxGraphModel"==a.nodeName&&(e=new DiagramPage(a.ownerDocument.createElement("diagram")),e.setName(mxResources.get("pageWithNumber",[1])),mxUtils.setTextContent(e.node,Graph.compressNode(a)),d.push(e));return d};
+EditorUi.prototype.diffPages=function(a,c){for(var b=[],d=[],g={},e={},k={},m=null,n=0;n<c.length;n++)e[c[n].getId()]={page:c[n],prev:m},m=c[n];m=null;for(n=0;n<a.length;n++){var q=a[n].getId(),f=e[q];if(null==f)d.push(q);else{var l=this.diffPage(a[n],f.page),p={};0<Object.keys(l).length&&(p.cells=l);l=this.diffViewState(a[n],f.page);0<Object.keys(l).length&&(p.view=l);if((null!=f.prev?null==m:null!=m)||null!=m&&null!=f.prev&&m.getId()!=f.prev.getId())p.previous=null!=f.prev?f.prev.getId():"";null!=
+f.page.getName()&&a[n].getName()!=f.page.getName()&&(p.name=f.page.getName());0<Object.keys(p).length&&(k[q]=p)}delete e[a[n].getId()];m=a[n]}for(q in e)f=e[q],b.push({data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});0<Object.keys(k).length&&(g[EditorUi.DIFF_UPDATE]=k);0<d.length&&(g[EditorUi.DIFF_REMOVE]=d);0<b.length&&(g[EditorUi.DIFF_INSERT]=b);return g};
+EditorUi.prototype.createCellLookup=function(a,c,b){b=null!=b?b:{};b[a.getId()]={cell:a,prev:c};var d=a.getChildCount();c=null;for(var g=0;g<d;g++){var e=a.getChildAt(g);this.createCellLookup(e,c,b);c=e}return b};
+EditorUi.prototype.diffCellRecursive=function(a,c,b,d,g){d=null!=d?d:{};var e=b[a.getId()];delete b[a.getId()];if(null==e)g.push(a.getId());else{var k=this.diffCell(a,e.cell);if(null!=k.parent||(null!=e.prev?null==c:null!=c)||null!=c&&null!=e.prev&&c.getId()!=e.prev.getId())k.previous=null!=e.prev?e.prev.getId():"";0<Object.keys(k).length&&(d[a.getId()]=k)}e=a.getChildCount();c=null;for(k=0;k<e;k++){var m=a.getChildAt(k);this.diffCellRecursive(m,c,b,d,g);c=m}return d};
+EditorUi.prototype.diffPage=function(a,c){var b=[],d=[],g={};this.updatePageRoot(a);this.updatePageRoot(c);var e=this.createCellLookup(c.root),k=this.diffCellRecursive(a.root,null,e,k,d),m;for(m in e){var n=e[m];b.push(this.getJsonForCell(n.cell,n.prev))}0<Object.keys(k).length&&(g[EditorUi.DIFF_UPDATE]=k);0<d.length&&(g[EditorUi.DIFF_REMOVE]=d);0<b.length&&(g[EditorUi.DIFF_INSERT]=b);return g};
+EditorUi.prototype.diffViewState=function(a,c){var b=a.viewState,d=c.viewState,g={};c==this.currentPage&&(d=this.editor.graph.getViewState());if(null!=b&&null!=d)for(var e in this.viewStateProperties){var k=JSON.stringify(b[e]),m=JSON.stringify(d[e]);k!=m&&(g[e]=m)}return g};
EditorUi.prototype.getCellForJson=function(a){var c=null!=a.geometry?this.codec.decode(mxUtils.parseXml(a.geometry).documentElement):null,b=a.value;null!=a.xmlValue&&(b=mxUtils.parseXml(a.xmlValue).documentElement);c=new mxCell(b,c,a.style);c.connectable=0!=a.connectable;c.collapsed=1==a.collapsed;c.visible=0!=a.visible;c.vertex=1==a.vertex;c.edge=1==a.edge;c.id=a.id;for(var d in a)this.cellProperties[d]||(c[d]=a[d]);return c};
EditorUi.prototype.getJsonForCell=function(a,c){var b={id:a.getId()};a.vertex&&(b.vertex=1);a.edge&&(b.edge=1);a.connectable||(b.connectable=0);null!=a.parent&&(b.parent=a.parent.getId());null!=c&&(b.previous=c.getId());null!=a.source&&(b.source=a.source.getId());null!=a.target&&(b.target=a.target.getId());null!=a.style&&(b.style=a.style);null!=a.geometry&&(b.geometry=mxUtils.getXml(this.codec.encode(a.geometry)));a.collapsed&&(b.collapsed=1);a.visible||(b.visible=0);null!=a.value&&("object"===typeof a.value&&
"number"===typeof a.value.nodeType&&"string"===typeof a.value.nodeName&&"function"===typeof a.value.getAttribute?b.xmlValue=mxUtils.getXml(a.value):b.value=a.value);for(var d in a)this.cellProperties[d]||"function"===typeof a[d]||(b[d]=a[d]);return b};
EditorUi.prototype.diffCell=function(a,c){function b(a){return null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute}var d={};a.vertex!=c.vertex&&(d.vertex=c.vertex?1:0);a.edge!=c.edge&&(d.edge=c.edge?1:0);a.connectable!=c.connectable&&(d.connectable=c.connectable?1:0);if((null!=a.parent?null==c.parent:null!=c.parent)||null!=a.parent&&null!=c.parent&&a.parent.getId()!=c.parent.getId())d.parent=null!=c.parent?c.parent.getId():"";
if((null!=a.source?null==c.source:null!=c.source)||null!=a.source&&null!=c.source&&a.source.getId()!=c.source.getId())d.source=null!=c.source?c.source.getId():"";if((null!=a.target?null==c.target:null!=c.target)||null!=a.target&&null!=c.target&&a.target.getId()!=c.target.getId())d.target=null!=c.target?c.target.getId():"";b(a.value)&&b(c.value)?a.value.isEqualNode(c.value)||(d.xmlValue=mxUtils.getXml(c.value)):a.value!=c.value&&(b(c.value)?d.xmlValue=mxUtils.getXml(c.value):d.value=null!=c.value?
-c.value:null);a.style!=c.style&&(d.style=c.style);a.visible!=c.visible&&(d.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(d.collapsed=c.collapsed?1:0);if(!this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)){var m=this.codec.encode(c.geometry);null!=m&&(d.geometry=mxUtils.getXml(m))}for(var f in a)this.cellProperties[f]||"function"===typeof a[f]||"function"===typeof c[f]||a[f]==c[f]||(d[f]=void 0===c[f]?null:c[f]);for(f in c)f in a||this.cellProperties[f]||"function"===typeof a[f]||"function"===
-typeof c[f]||a[f]==c[f]||(d[f]=void 0===c[f]?null:c[f]);return d};EditorUi.prototype.isObjectEqual=function(a,c,b){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var d=function(a,c){return null==b||b[a]!=c?!0===c?1:c:void 0};return JSON.stringify(a,d)==JSON.stringify(c,d)};var mxSettings={currentVersion:18,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(a){return a?mxSettings.settings.darkGridColor:
+c.value:null);a.style!=c.style&&(d.style=c.style);a.visible!=c.visible&&(d.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(d.collapsed=c.collapsed?1:0);if(!this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)){var g=this.codec.encode(c.geometry);null!=g&&(d.geometry=mxUtils.getXml(g))}for(var e in a)this.cellProperties[e]||"function"===typeof a[e]||"function"===typeof c[e]||a[e]==c[e]||(d[e]=void 0===c[e]?null:c[e]);for(e in c)e in a||this.cellProperties[e]||"function"===typeof a[e]||"function"===
+typeof c[e]||a[e]==c[e]||(d[e]=void 0===c[e]?null:c[e]);return d};EditorUi.prototype.isObjectEqual=function(a,c,b){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var d=function(a,c){return null==b||b[a]!=c?!0===c?1:c:void 0};return JSON.stringify(a,d)==JSON.stringify(c,d)};var mxSettings={currentVersion:18,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(a){return a?mxSettings.settings.darkGridColor:
mxSettings.settings.gridColor},setGridColor:function(a,c){c?mxSettings.settings.darkGridColor=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},setCustomFonts:function(a){mxSettings.settings.customFonts=a},getCustomFonts:function(a){return mxSettings.settings.customFonts},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=
@@ -8735,64 +8745,64 @@ DrawioFileSync.prototype.fileChangedNotify=function(){if(this.isValidState())if(
DrawioFileSync.prototype.fileChanged=function(a,c,b){var d=window.setTimeout(mxUtils.bind(this,function(){null!=b&&b()||(this.isValidState()?this.file.loadPatchDescriptor(mxUtils.bind(this,function(d){null!=b&&b()||(this.isValidState()?this.catchup(d,a,c,b):null!=c&&c())}),c):null!=c&&c())}),0);return this.notifyThread=d};
DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(a){null!=a?(this.file.setDescriptorRevisionId(a,this.file.getCurrentRevisionId()),this.updateDescriptor(a),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(a){this.file.inConflictState=!0;this.file.handleFileError(a)}))};
DrawioFileSync.prototype.updateDescriptor=function(a){this.file.setDescriptor(a);this.file.descriptorChanged();this.start()};
-DrawioFileSync.prototype.catchup=function(a,c,b,d){if(null!=a&&(null==d||!d())){var m=this.file.getDescriptorRevisionId(a),f=this.file.getCurrentRevisionId();if(f==m)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=c&&c();else if(this.isValidState()){var l=this.file.getDescriptorSecret(a),n=0,p=!1,u=mxUtils.bind(this,function(){if(null==d||!d())if(f!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var g=!0,k=window.setTimeout(mxUtils.bind(this,function(){g=!1;
-this.reload(c,b,d)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(m)+(null!=l?"&secret="+encodeURIComponent(l):""),mxUtils.bind(this,function(l){this.file.stats.bytesReceived+=l.getText().length;window.clearTimeout(k);if(g&&(null==d||!d()))if(f!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var m=null,q=[];if(200<=l.getStatus()&&299>=l.getStatus()&&0<l.getText().length)try{var t=
-JSON.parse(l.getText());if(null!=t&&0<t.length)for(var A=0;A<t.length;A++){var z=this.stringToObject(t[A]);if(z.v>DrawioFileSync.PROTOCOL){p=!0;q=[];break}else if(z.v===DrawioFileSync.PROTOCOL&&null!=z.d)m=z.d.checksum,q.push(z.d.patch);else{p=!0;q=[];break}}}catch(D){q=[],null!=window.console&&"1"==urlParams.test&&console.log(D)}try{0<q.length?(this.file.stats.cacheHits++,this.merge(q,m,a,c,b,d)):n<=this.maxCacheReadyRetries&&!p&&401!=l.getStatus()?(n++,this.file.stats.cacheMiss++,window.setTimeout(u,
-(n+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,b,d))}catch(D){null!=b&&b(D)}}else null!=b&&b()}))}else null!=b&&b()});window.setTimeout(u,this.cacheReadyDelay)}else null!=b&&b()}};DrawioFileSync.prototype.reload=function(a,c,b,d){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),b,d)};
-DrawioFileSync.prototype.merge=function(a,c,b,d,m,f){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var l=this.file.ignorePatches(a),n=this.file.getDescriptorRevisionId(b);if(!l){for(f=0;f<a.length;f++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
-a[f]);var p=null!=c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",n,"etag",this.file.getDescriptorEtag(b),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==p,c);if(null!=c&&c!=p){var u=this.ui.hashValue(this.file.getCurrentRevisionId()),g=this.ui.hashValue(n);this.file.checksumError(m,a,"From: "+u+"\nTo: "+g+"\nChecksum: "+c+"\nCurrent: "+p,n,"merge");
-return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),b);this.file.backupPatch=null;null!=d&&d()}catch(v){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=m&&m(v);try{if(this.file.errorReportsEnabled)u=this.ui.hashValue(this.file.getCurrentRevisionId()),g=this.ui.hashValue(n),this.file.sendErrorReport("Error in merge",
-"From: "+u+"\nTo: "+g+"\nChecksum: "+c+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,null,2)),v);else{var k=this.file.getCurrentUser(),q=null!=k?k.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),q,v)}}catch(y){}}};
+DrawioFileSync.prototype.catchup=function(a,c,b,d){if(null!=a&&(null==d||!d())){var g=this.file.getDescriptorRevisionId(a),e=this.file.getCurrentRevisionId();if(e==g)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=c&&c();else if(this.isValidState()){var k=this.file.getDescriptorSecret(a),m=0,n=!1,q=mxUtils.bind(this,function(){if(null==d||!d())if(e!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var f=!0,l=window.setTimeout(mxUtils.bind(this,function(){f=!1;
+this.reload(c,b,d)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(e)+"&to="+encodeURIComponent(g)+(null!=k?"&secret="+encodeURIComponent(k):""),mxUtils.bind(this,function(g){this.file.stats.bytesReceived+=g.getText().length;window.clearTimeout(l);if(f&&(null==d||!d()))if(e!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var k=null,p=[];if(200<=g.getStatus()&&299>=g.getStatus()&&0<g.getText().length)try{var t=
+JSON.parse(g.getText());if(null!=t&&0<t.length)for(var z=0;z<t.length;z++){var y=this.stringToObject(t[z]);if(y.v>DrawioFileSync.PROTOCOL){n=!0;p=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)k=y.d.checksum,p.push(y.d.patch);else{n=!0;p=[];break}}}catch(C){p=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<p.length?(this.file.stats.cacheHits++,this.merge(p,k,a,c,b,d)):m<=this.maxCacheReadyRetries&&!n&&401!=g.getStatus()?(m++,this.file.stats.cacheMiss++,window.setTimeout(q,
+(m+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,b,d))}catch(C){null!=b&&b(C)}}else null!=b&&b()}))}else null!=b&&b()});window.setTimeout(q,this.cacheReadyDelay)}else null!=b&&b()}};DrawioFileSync.prototype.reload=function(a,c,b,d){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),b,d)};
+DrawioFileSync.prototype.merge=function(a,c,b,d,g,e){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var k=this.file.ignorePatches(a),m=this.file.getDescriptorRevisionId(b);if(!k){for(e=0;e<a.length;e++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
+a[e]);var n=null!=c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",m,"etag",this.file.getDescriptorEtag(b),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==n,c);if(null!=c&&c!=n){var q=this.ui.hashValue(this.file.getCurrentRevisionId()),f=this.ui.hashValue(m);this.file.checksumError(g,a,"From: "+q+"\nTo: "+f+"\nChecksum: "+c+"\nCurrent: "+n,m,"merge");
+return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),b);this.file.backupPatch=null;null!=d&&d()}catch(u){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=g&&g(u);try{if(this.file.errorReportsEnabled)q=this.ui.hashValue(this.file.getCurrentRevisionId()),f=this.ui.hashValue(m),this.file.sendErrorReport("Error in merge",
+"From: "+q+"\nTo: "+f+"\nChecksum: "+c+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,null,2)),u);else{var l=this.file.getCurrentUser(),p=null!=l?l.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),p,u)}}catch(v){}}};
DrawioFileSync.prototype.descriptorChanged=function(a){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var c=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),b=this.file.getCurrentRevisionId(),d=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(a)+"&to="+encodeURIComponent(b)+"&msg="+encodeURIComponent(c)+"&data="+encodeURIComponent(d));this.file.stats.bytesSent+=d.length;this.file.stats.msgSent++}this.updateStatus()};
DrawioFileSync.prototype.objectToString=function(a){a=Graph.compress(JSON.stringify(a));null!=this.key&&"undefined"!==typeof CryptoJS&&(a=CryptoJS.AES.encrypt(a,this.key).toString());return a};DrawioFileSync.prototype.stringToObject=function(a){null!=this.key&&"undefined"!==typeof CryptoJS&&(a=CryptoJS.AES.decrypt(a,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(a))};
-DrawioFileSync.prototype.fileSaved=function(a,c,b,d){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline()&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var m=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);d=this.ui.getHashValueForPages(a);m=this.ui.diffPages(m,a);c=this.file.getDescriptorRevisionId(c);
-var f=this.file.getCurrentRevisionId(),l=this.objectToString(this.createMessage({patch:m,checksum:d})),n=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),p=this.file.getDescriptorSecret(this.file.getDescriptor());this.file.stats.bytesSent+=l.length;this.file.stats.msgSent++;mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(c)+"&to="+encodeURIComponent(f)+"&msg="+encodeURIComponent(n)+(null!=p?"&secret="+encodeURIComponent(p):"")+(l.length<this.maxCacheEntrySize?
-"&data="+encodeURIComponent(l):""),mxUtils.bind(this,function(a){}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",c,"to",f,"etag",this.file.getCurrentEtag(),l.length,"bytes","diff",m,"checksum",d)}this.file.shadowPages=a;null!=b&&b()};DrawioFileSync.prototype.getIdParameters=function(){var a="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(a+="&sid="+this.pusher.connection.socket_id);return a};
+DrawioFileSync.prototype.fileSaved=function(a,c,b,d){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline()&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var g=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);d=this.ui.getHashValueForPages(a);g=this.ui.diffPages(g,a);c=this.file.getDescriptorRevisionId(c);
+var e=this.file.getCurrentRevisionId(),k=this.objectToString(this.createMessage({patch:g,checksum:d})),m=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),n=this.file.getDescriptorSecret(this.file.getDescriptor());this.file.stats.bytesSent+=k.length;this.file.stats.msgSent++;mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(c)+"&to="+encodeURIComponent(e)+"&msg="+encodeURIComponent(m)+(null!=n?"&secret="+encodeURIComponent(n):"")+(k.length<this.maxCacheEntrySize?
+"&data="+encodeURIComponent(k):""),mxUtils.bind(this,function(a){}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",c,"to",e,"etag",this.file.getCurrentEtag(),k.length,"bytes","diff",g,"checksum",d)}this.file.shadowPages=a;null!=b&&b()};DrawioFileSync.prototype.getIdParameters=function(){var a="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(a+="&sid="+this.pusher.connection.socket_id);return a};
DrawioFileSync.prototype.createMessage=function(a){return{v:DrawioFileSync.PROTOCOL,d:a,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(a,c,b){this.catchupRetryCount++;this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=a?this.catchup(a,c,b):this.fileChanged(c,b)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=b&&b({message:mxResources.get("timeout")}))};
DrawioFileSync.prototype.stop=function(){null!=this.pusher&&(EditorUi.debug("Sync.stop",[this]),null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null);this.updateOnlineState();this.updateStatus()};
DrawioFileSync.prototype.destroy=function(){if(null!=this.channelId){var a=this.file.getCurrentUser(),c={a:"leave"};null!=a&&(c.name=a.displayName,c.uid=a.id);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(this.objectToString(this.createMessage(c))));this.file.stats.msgSent++}this.stop();null!=this.updateStatusThread&&(window.clearInterval(this.updateStatusThread),this.updateStatusThread=null);null!=this.onlineListener&&(mxEvent.removeListener(window,"online",this.onlineListener),
this.onlineListener=null);null!=this.visibleListener&&(mxEvent.removeListener(document,"visibilitychange",this.visibleListener),this.visibleListener=null);null!=this.activityListener&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.activityListener),mxEvent.removeListener(document,"keypress",this.activityListener),mxEvent.removeListener(window,"focus",this.activityListener),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.removeListener(document,"touchstart",this.activityListener),
mxEvent.removeListener(document,"touchmove",this.activityListener)),this.activityListener=null);null!=this.collaboratorsElement&&(this.collaboratorsElement.parentNode.removeChild(this.collaboratorsElement),this.collaboratorsElement=null)};Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="#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;function mxAsyncCanvas(a){mxAbstractCanvas2D.call(this);this.htmlCanvas=a;a.images=a.images||[];a.subCanvas=a.subCanvas||[]}mxUtils.extend(mxAsyncCanvas,mxAbstractCanvas2D);mxAsyncCanvas.prototype.htmlCanvas=null;mxAsyncCanvas.prototype.canvasIndex=0;mxAsyncCanvas.prototype.waitCounter=0;mxAsyncCanvas.prototype.onComplete=null;mxAsyncCanvas.prototype.incWaitCounter=function(){this.waitCounter++};
-mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxAsyncCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};mxAsyncCanvas.prototype.rotate=function(a,c,b,d,m){};
+mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxAsyncCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};mxAsyncCanvas.prototype.rotate=function(a,c,b,d,g){};
mxAsyncCanvas.prototype.setAlpha=function(a){this.state.alpha=a};mxAsyncCanvas.prototype.setFontColor=function(a){this.state.fontColor=a};mxAsyncCanvas.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAsyncCanvas.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxAsyncCanvas.prototype.setFontSize=function(a){this.state.fontSize=a};
-mxAsyncCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAsyncCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxAsyncCanvas.prototype.rect=function(a,c,b,d){};mxAsyncCanvas.prototype.roundrect=function(a,c,b,d,m,f){};mxAsyncCanvas.prototype.ellipse=function(a,c,b,d){};mxAsyncCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a};
-mxAsyncCanvas.prototype.image=function(a,c,b,d,m,f,l,n){m=this.rewriteImageSource(m);a=this.htmlCanvas.images[m];null==a&&(a=new Image,a.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),a.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[m]=a,a.src=m)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};
-mxAsyncCanvas.prototype.text=function(a,c,b,d,m,f,l,n,p,u,g,k){if(null!=m&&0!=m.length&&(a=this.state.scale,"html"==p&&"function"===typeof html2canvas)){this.incWaitCounter();var q=this.canvasIndex++;html2canvas(m,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[q]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;
-mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,d,m){return b+b+d+d+m+m});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++};
+mxAsyncCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAsyncCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxAsyncCanvas.prototype.rect=function(a,c,b,d){};mxAsyncCanvas.prototype.roundrect=function(a,c,b,d,g,e){};mxAsyncCanvas.prototype.ellipse=function(a,c,b,d){};mxAsyncCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a};
+mxAsyncCanvas.prototype.image=function(a,c,b,d,g,e,k,m){g=this.rewriteImageSource(g);a=this.htmlCanvas.images[g];null==a&&(a=new Image,a.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),a.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[g]=a,a.src=g)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};
+mxAsyncCanvas.prototype.text=function(a,c,b,d,g,e,k,m,n,q,f,l){if(null!=g&&0!=g.length&&(a=this.state.scale,"html"==n&&"function"===typeof html2canvas)){this.incWaitCounter();var p=this.canvasIndex++;html2canvas(g,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[p]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;
+mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,d,g){return b+b+d+d+g+g});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++};
mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};
mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a;this.ctx.scale(a,a)};mxJsCanvas.prototype.translate=function(a,c){this.state.dx+=a;this.state.dy+=c;this.ctx.translate(a,c)};
-mxJsCanvas.prototype.rotate=function(a,c,b,d,m){d-=this.state.dx;m-=this.state.dy;this.ctx.translate(d,m);(c||b)&&this.ctx.scale(c?-1:1,b?-1:1);this.ctx.rotate(a*this.M_RAD_PER_DEG);this.ctx.translate(-d,-m)};mxJsCanvas.prototype.setAlpha=function(a){this.state.alpha=a;this.ctx.globalAlpha=a};mxJsCanvas.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null;this.ctx.fillStyle=a};
-mxJsCanvas.prototype.setGradient=function(a,c,b,d,m,f,l,n,p){b=this.ctx.createLinearGradient(0,d,0,d+f);d=this.state;d.fillColor=a;d.fillAlpha=null!=n?n:1;d.gradientColor=c;d.gradientAlpha=null!=p?p:1;d.gradientDirection=l;a=this.hexToRgb(a);c=this.hexToRgb(c);null!=a&&b.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+d.fillAlpha+")");null!=c&&b.addColorStop(1,"rgba("+c.r+","+c.g+","+c.b+","+d.gradientAlpha+")");this.ctx.fillStyle=b};
+mxJsCanvas.prototype.rotate=function(a,c,b,d,g){d-=this.state.dx;g-=this.state.dy;this.ctx.translate(d,g);(c||b)&&this.ctx.scale(c?-1:1,b?-1:1);this.ctx.rotate(a*this.M_RAD_PER_DEG);this.ctx.translate(-d,-g)};mxJsCanvas.prototype.setAlpha=function(a){this.state.alpha=a;this.ctx.globalAlpha=a};mxJsCanvas.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null;this.ctx.fillStyle=a};
+mxJsCanvas.prototype.setGradient=function(a,c,b,d,g,e,k,m,n){b=this.ctx.createLinearGradient(0,d,0,d+e);d=this.state;d.fillColor=a;d.fillAlpha=null!=m?m:1;d.gradientColor=c;d.gradientAlpha=null!=n?n:1;d.gradientDirection=k;a=this.hexToRgb(a);c=this.hexToRgb(c);null!=a&&b.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+d.fillAlpha+")");null!=c&&b.addColorStop(1,"rgba("+c.r+","+c.g+","+c.b+","+d.gradientAlpha+")");this.ctx.fillStyle=b};
mxJsCanvas.prototype.setStrokeColor=function(a){null!=a&&(a==mxConstants.NONE?(this.state.strokeColor=null,this.ctx.strokeStyle="rgba(0, 0, 0, 0)"):(this.ctx.strokeStyle=a,this.state.strokeColor=a))};mxJsCanvas.prototype.setStrokeWidth=function(a){this.ctx.lineWidth=a};mxJsCanvas.prototype.setDashed=function(a){if(this.state.dashed=a){a=this.state.dashPattern.split(" ");for(var c=0;c<a.length;c++)a[c]=parseInt(a[c],10);this.setLineDash(a)}else this.setLineDash([0])};
mxJsCanvas.prototype.setLineDash=function(a){try{"function"===typeof this.ctx.setLineDash&&this.ctx.setLineDash(a)}catch(c){}};mxJsCanvas.prototype.setDashPattern=function(a){this.state.dashPattern=a;if(this.state.dashed){a=a.split(" ");for(var c=0;c<a.length;c++)a[c]=parseInt(a[c],10);this.ctx.setLineDash(a)}};mxJsCanvas.prototype.setLineCap=function(a){this.ctx.lineCap=a};mxJsCanvas.prototype.setLineJoin=function(a){this.ctx.lineJoin=a};
mxJsCanvas.prototype.setMiterLimit=function(a){this.ctx.lineJoin=a};mxJsCanvas.prototype.setFontColor=function(a){this.ctx.fillStyle=a};mxJsCanvas.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxJsCanvas.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxJsCanvas.prototype.setFontSize=function(a){this.state.fontSize=a};
mxJsCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxJsCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxJsCanvas.prototype.setShadow=function(a){(this.state.shadow=a)?(this.setShadowOffset(this.state.shadowDx,this.state.shadowDy),this.setShadowAlpha(this.state.shadowAlpha)):(this.ctx.shadowColor="transparent",this.ctx.shadowBlur=0,this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0)};
mxJsCanvas.prototype.setShadowColor=function(a){if(null==a||a==mxConstants.NONE)a=null,this.ctx.shadowColor="transparent";this.state.shadowColor=a;if(this.state.shadow&&null!=a){var c=null!=this.state.shadowAlpha?this.state.shadowAlpha:1;a=this.hexToRgb(a);this.ctx.shadowColor="rgba("+a.r+","+a.g+","+a.b+","+c+")"}};mxJsCanvas.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a;this.setShadowColor(this.state.shadowColor)};
mxJsCanvas.prototype.setShadowOffset=function(a,c){this.state.shadowDx=a;this.state.shadowDy=c;this.state.shadow&&(this.ctx.shadowOffsetX=a,this.ctx.shadowOffsetY=c)};mxJsCanvas.prototype.moveTo=function(a,c){this.ctx.moveTo(a,c);this.lastMoveX=a;this.lastMoveY=c};mxJsCanvas.prototype.lineTo=function(a,c){this.ctx.lineTo(a,c);this.lastMoveX=a;this.lastMoveY=c};mxJsCanvas.prototype.quadTo=function(a,c,b,d){this.ctx.quadraticCurveTo(a,c,b,d);this.lastMoveX=b;this.lastMoveY=d};
-mxJsCanvas.prototype.arcTo=function(a,c,b,d,m,f,l){a=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,a,c,b,d,m,f,l);if(null!=a)for(c=0;c<a.length;c+=6)this.curveTo(a[c],a[c+1],a[c+2],a[c+3],a[c+4],a[c+5])};mxJsCanvas.prototype.curveTo=function(a,c,b,d,m,f){this.ctx.bezierCurveTo(a,c,b,d,m,f);this.lastMoveX=m;this.lastMoveY=f};mxJsCanvas.prototype.rect=function(a,c,b,d){this.begin();this.moveTo(a,c);this.lineTo(a+b,c);this.lineTo(a+b,c+d);this.lineTo(a,c+d);this.close()};
-mxJsCanvas.prototype.roundrect=function(a,c,b,d,m,f){this.begin();this.moveTo(a+m,c);this.lineTo(a+b-m,c);this.quadTo(a+b,c,a+b,c+f);this.lineTo(a+b,c+d-f);this.quadTo(a+b,c+d,a+b-m,c+d);this.lineTo(a+m,c+d);this.quadTo(a,c+d,a,c+d-f);this.lineTo(a,c+f);this.quadTo(a,c,a+m,c)};mxJsCanvas.prototype.ellipse=function(a,c,b,d){this.ctx.save();this.ctx.translate(a+b/2,c+d/2);this.ctx.scale(b/2,d/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()};
+mxJsCanvas.prototype.arcTo=function(a,c,b,d,g,e,k){a=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,a,c,b,d,g,e,k);if(null!=a)for(c=0;c<a.length;c+=6)this.curveTo(a[c],a[c+1],a[c+2],a[c+3],a[c+4],a[c+5])};mxJsCanvas.prototype.curveTo=function(a,c,b,d,g,e){this.ctx.bezierCurveTo(a,c,b,d,g,e);this.lastMoveX=g;this.lastMoveY=e};mxJsCanvas.prototype.rect=function(a,c,b,d){this.begin();this.moveTo(a,c);this.lineTo(a+b,c);this.lineTo(a+b,c+d);this.lineTo(a,c+d);this.close()};
+mxJsCanvas.prototype.roundrect=function(a,c,b,d,g,e){this.begin();this.moveTo(a+g,c);this.lineTo(a+b-g,c);this.quadTo(a+b,c,a+b,c+e);this.lineTo(a+b,c+d-e);this.quadTo(a+b,c+d,a+b-g,c+d);this.lineTo(a+g,c+d);this.quadTo(a,c+d,a,c+d-e);this.lineTo(a,c+e);this.quadTo(a,c,a+g,c)};mxJsCanvas.prototype.ellipse=function(a,c,b,d){this.ctx.save();this.ctx.translate(a+b/2,c+d/2);this.ctx.scale(b/2,d/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()};
mxJsCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url="+encodeURIComponent(a);return a};
-mxJsCanvas.prototype.image=function(a,c,b,d,m,f,l,n){m=this.rewriteImageSource(m);m=this.images[m];if(null!=m&&0<m.height&&0<m.width){var p=this.ctx;p.save();if(f){f=m.width;var u=m.height,g=Math.min(b/f,d/u);a+=(b-f*g)/2;c+=(d-u*g)/2;b=f*g;d=u*g}l&&(p.translate(2*a+b,0),p.scale(-1,1));n&&(p.translate(0,2*c+d),p.scale(1,-1));p.drawImage(m,a,c,b,d);p.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};
+mxJsCanvas.prototype.image=function(a,c,b,d,g,e,k,m){g=this.rewriteImageSource(g);g=this.images[g];if(null!=g&&0<g.height&&0<g.width){var n=this.ctx;n.save();if(e){e=g.width;var q=g.height,f=Math.min(b/e,d/q);a+=(b-e*f)/2;c+=(d-q*f)/2;b=e*f;d=q*f}k&&(n.translate(2*a+b,0),n.scale(-1,1));m&&(n.translate(0,2*c+d),n.scale(1,-1));n.drawImage(g,a,c,b,d);n.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};
mxJsCanvas.prototype.fill=function(){this.ctx.fill()};mxJsCanvas.prototype.stroke=function(){this.ctx.stroke()};mxJsCanvas.prototype.fillAndStroke=function(){if(this.state.shadow){this.ctx.stroke();this.ctx.fill();var a=this.ctx.shadowColor,c=this.ctx.shadowOffsetX,b=this.ctx.shadowOffsetY;this.ctx.shadowColor="transparent";this.ctx.shadowOffsetX=0;this.ctx.shadowOffsetY=0;this.ctx.stroke();this.ctx.shadowColor=a;this.ctx.shadowOffsetX=c;this.ctx.shadowOffsetY=b}else this.ctx.fill(),this.ctx.stroke()};
-mxJsCanvas.prototype.text=function(a,c,b,d,m,f,l,n,p,u,g,k){if(null!=m&&0!=m.length){b=this.state.scale;0!=k&&(this.ctx.translate(Math.round(a),Math.round(c)),this.ctx.rotate(k*Math.PI/180),this.ctx.translate(Math.round(-a),Math.round(-c)));if("html"==p){m=this.subCanvas[this.canvasIndex++];p=m.height;k=m.width;switch(l){case mxConstants.ALIGN_MIDDLE:c-=p/2/b;break;case mxConstants.ALIGN_BOTTOM:c-=p/b}switch(f){case mxConstants.ALIGN_CENTER:a-=k/2/b;break;case mxConstants.ALIGN_RIGHT:a-=k/b}this.ctx.save();
-if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(a)-.5,Math.round(c)-.5,Math.round(m.width/b),Math.round(m.height/b))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(a)-.5,Math.round(c)-.5,Math.round(m.width/b),Math.round(m.height/b)));this.ctx.scale(1/b,1/b);this.ctx.drawImage(m,
-Math.round(a*b),Math.round(c*b))}else{this.ctx.save();this.updateFont();k=document.createElement("div");k.innerHTML=m;k.style.position="absolute";k.style.top="-9999px";k.style.left="-9999px";k.style.fontFamily=this.state.fontFamily;k.style.fontWeight="bold";k.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(k);p=[k.offsetWidth,k.offsetHeight];document.body.removeChild(k);m=m.split("\n");k=p[1];this.ctx.textBaseline="top";p=c;switch(l){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=
-"middle";c-=(m.length-1)*k/2;p=c-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",c-=k*(m.length-1),p=c-this.state.fontSize}l=[];k=[];for(b=0;b<m.length;b++)k[b]=a,l[b]=this.ctx.measureText(m[b]).width,null!=f&&f!=mxConstants.ALIGN_LEFT&&(k[b]-=l[b],f==mxConstants.ALIGN_CENTER&&(k[b]+=l[b]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){a=k[0];f=l[0];for(b=1;b<m.length;b++)a=Math.min(a,k[b]),f=Math.max(f,l[b]);this.ctx.save();
-a=Math.round(a)-.5;p=Math.round(p)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(a,p,f,this.state.fontSize*mxConstants.LINE_HEIGHT*m.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(a,p,f,this.state.fontSize*mxConstants.LINE_HEIGHT*m.length));this.ctx.restore()}for(b=0;b<m.length;b++)this.ctx.fillText(m[b],k[b],c),c+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};
+mxJsCanvas.prototype.text=function(a,c,b,d,g,e,k,m,n,q,f,l){if(null!=g&&0!=g.length){b=this.state.scale;0!=l&&(this.ctx.translate(Math.round(a),Math.round(c)),this.ctx.rotate(l*Math.PI/180),this.ctx.translate(Math.round(-a),Math.round(-c)));if("html"==n){g=this.subCanvas[this.canvasIndex++];n=g.height;l=g.width;switch(k){case mxConstants.ALIGN_MIDDLE:c-=n/2/b;break;case mxConstants.ALIGN_BOTTOM:c-=n/b}switch(e){case mxConstants.ALIGN_CENTER:a-=l/2/b;break;case mxConstants.ALIGN_RIGHT:a-=l/b}this.ctx.save();
+if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(a)-.5,Math.round(c)-.5,Math.round(g.width/b),Math.round(g.height/b))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(a)-.5,Math.round(c)-.5,Math.round(g.width/b),Math.round(g.height/b)));this.ctx.scale(1/b,1/b);this.ctx.drawImage(g,
+Math.round(a*b),Math.round(c*b))}else{this.ctx.save();this.updateFont();l=document.createElement("div");l.innerHTML=g;l.style.position="absolute";l.style.top="-9999px";l.style.left="-9999px";l.style.fontFamily=this.state.fontFamily;l.style.fontWeight="bold";l.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(l);n=[l.offsetWidth,l.offsetHeight];document.body.removeChild(l);g=g.split("\n");l=n[1];this.ctx.textBaseline="top";n=c;switch(k){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=
+"middle";c-=(g.length-1)*l/2;n=c-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",c-=l*(g.length-1),n=c-this.state.fontSize}k=[];l=[];for(b=0;b<g.length;b++)l[b]=a,k[b]=this.ctx.measureText(g[b]).width,null!=e&&e!=mxConstants.ALIGN_LEFT&&(l[b]-=k[b],e==mxConstants.ALIGN_CENTER&&(l[b]+=k[b]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){a=l[0];e=k[0];for(b=1;b<g.length;b++)a=Math.min(a,l[b]),e=Math.max(e,k[b]);this.ctx.save();
+a=Math.round(a)-.5;n=Math.round(n)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(a,n,e,this.state.fontSize*mxConstants.LINE_HEIGHT*g.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(a,n,e,this.state.fontSize*mxConstants.LINE_HEIGHT*g.length));this.ctx.restore()}for(b=0;b<g.length;b++)this.ctx.fillText(g[b],l[b],c),c+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};
mxJsCanvas.prototype.getCanvas=function(){return canvas};mxJsCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};DrawioClient=function(a,c){mxEventSource.call(this);this.ui=a;this.cookieName=c;this.token=this.getPersistentToken()};mxUtils.extend(DrawioClient,mxEventSource);DrawioClient.prototype.token=null;DrawioClient.prototype.user=null;DrawioClient.prototype.setUser=function(a){this.user=a;this.fireEvent(new mxEventObject("userChanged"))};DrawioClient.prototype.getUser=function(){return this.user};
DrawioClient.prototype.clearPersistentToken=function(){if(isLocalStorage)localStorage.removeItem("."+this.cookieName),sessionStorage.removeItem("."+this.cookieName);else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie=this.cookieName+"=; expires="+a.toUTCString()}};
DrawioClient.prototype.getPersistentToken=function(a){var c=null;isLocalStorage&&(c=localStorage.getItem("."+this.cookieName),null==c&&a&&(c=sessionStorage.getItem("."+this.cookieName)));if(null==c&&"undefined"!=typeof Storage){var b=document.cookie;a=this.cookieName+"=";var d=b.indexOf(a);0<=d&&(d+=a.length,c=b.indexOf(";",d),0>c?c=b.length:postCookie=b.substring(c),c=b.substring(d,c),c=0<c.length?c:null,null!=c&&isLocalStorage&&(b=new Date,b.setYear(b.getFullYear()-1),document.cookie=a+"; expires="+
-b.toUTCString(),localStorage.setItem("."+this.cookieName,c)))}return c};DrawioClient.prototype.setPersistentToken=function(a,c){if(null!=a)if(isLocalStorage)c?sessionStorage.setItem("."+this.cookieName,a):localStorage.setItem("."+this.cookieName,a);else{if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()+10);b=this.cookieName+"="+a+"; path=/"+(c?"":"; expires="+b.toUTCString());"https"==document.location.protocol.toLowerCase()&&(b+=";secure");document.cookie=b}}else this.clearPersistentToken()};DrawioUser=function(a,c,b,d,m){this.id=a;this.email=c;this.displayName=b;this.pictureUrl=d;this.locale=m};DriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.desc=b};mxUtils.extend(DriveFile,DrawioFile);DriveFile.prototype.autosaveDelay=2500;DriveFile.prototype.saveDelay=0;DriveFile.prototype.allChangesSavedKey="allChangesSavedInDrive";DriveFile.prototype.getSize=function(){return this.desc.fileSize};DriveFile.prototype.isRestricted=function(){return null!=this.desc.userPermission&&null!=this.desc.labels&&"reader"==this.desc.userPermission.role&&this.desc.labels.restricted};
+b.toUTCString(),localStorage.setItem("."+this.cookieName,c)))}return c};DrawioClient.prototype.setPersistentToken=function(a,c){if(null!=a)if(isLocalStorage)c?sessionStorage.setItem("."+this.cookieName,a):localStorage.setItem("."+this.cookieName,a);else{if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()+10);b=this.cookieName+"="+a+"; path=/"+(c?"":"; expires="+b.toUTCString());"https"==document.location.protocol.toLowerCase()&&(b+=";secure");document.cookie=b}}else this.clearPersistentToken()};DrawioUser=function(a,c,b,d,g){this.id=a;this.email=c;this.displayName=b;this.pictureUrl=d;this.locale=g};DriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.desc=b};mxUtils.extend(DriveFile,DrawioFile);DriveFile.prototype.autosaveDelay=2500;DriveFile.prototype.saveDelay=0;DriveFile.prototype.allChangesSavedKey="allChangesSavedInDrive";DriveFile.prototype.getSize=function(){return this.desc.fileSize};DriveFile.prototype.isRestricted=function(){return null!=this.desc.userPermission&&null!=this.desc.labels&&"reader"==this.desc.userPermission.role&&this.desc.labels.restricted};
DriveFile.prototype.isConflict=function(a){return null!=a&&null!=a.error&&412==a.error.code};DriveFile.prototype.getCurrentUser=function(){return null!=this.ui.drive?this.ui.drive.user:null};DriveFile.prototype.getMode=function(){return App.MODE_GOOGLE};
-DriveFile.prototype.getPublicUrl=function(a){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions"},mxUtils.bind(this,function(c){if(null!=c&&null!=c.items)for(var b=0;b<c.items.length;b++)if("anyoneWithLink"===c.items[b].id||"anyone"===c.items[b].id){a(this.desc.webContentLink);return}a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};
-DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.save=function(a,c,b,d,m){DrawioFile.prototype.save.apply(this,[a,mxUtils.bind(this,function(){this.saveFile(null,a,c,b,d,m)}),b,d,m])};
-DriveFile.prototype.saveFile=function(a,c,b,d,m,f){try{if(!this.isEditable())null!=b&&b();else if(!this.savingFile){var l=mxUtils.bind(this,function(a,f){var p=null,g=null;try{p=this.isModified;g=this.isModified();this.setModified(!1);this.savingFileTime=new Date;this.savingFile=!0;this.isModified=function(){return!0};var k=this.desc;this.ui.drive.saveFile(this,f,mxUtils.bind(this,function(a,f){try{this.savingFile=!1,this.isModified=p,0!=a?(c&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=
-Math.min(8E3,Math.max(this.saveDelay+500,DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(f,k,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b(a)}),d)):(this.setModified(g||this.isModified()),null!=d&&d(a))}catch(y){if(this.setModified(g||this.isModified()),null!=d)d(y);else throw y;}}),mxUtils.bind(this,function(b,c){try{this.savingFile=!1,this.isModified=p,this.setModified(g||this.isModified()),this.isConflict(b)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=
-!0,this.savingFileTime=new Date,this.sync.fileConflict(c,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();l(a,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(b)}catch(y){if(this.setModified(g||this.isModified()),null!=d)d(y);else throw y;}}),m,m,a)}catch(q){if(this.savingFile=!1,null!=p&&(this.isModified=p),null!=g&&this.setModified(g||this.isModified()),null!=d)d(q);else throw q;
-}});l(f,c)}}catch(n){if(null!=d)d(n);else throw n;}};DriveFile.prototype.copyFile=function(a,c){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,c)}catch(b){c(b)}}),c,!0)};
+DriveFile.prototype.getPublicUrl=function(a){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsTeamDrives=true"},mxUtils.bind(this,function(c){if(null!=c&&null!=c.items)for(var b=0;b<c.items.length;b++)if("anyoneWithLink"===c.items[b].id||"anyone"===c.items[b].id){a(this.desc.webContentLink);return}a(null)}),mxUtils.bind(this,function(){a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};
+DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.save=function(a,c,b,d,g){DrawioFile.prototype.save.apply(this,[a,mxUtils.bind(this,function(){this.saveFile(null,a,c,b,d,g)}),b,d,g])};
+DriveFile.prototype.saveFile=function(a,c,b,d,g,e){try{if(!this.isEditable())null!=b&&b();else if(!this.savingFile){var k=mxUtils.bind(this,function(a,e){var n=null,f=null;try{n=this.isModified;f=this.isModified();this.setModified(!1);this.savingFileTime=new Date;this.savingFile=!0;this.isModified=function(){return!0};var l=this.desc;this.ui.drive.saveFile(this,e,mxUtils.bind(this,function(a,e){try{this.savingFile=!1,this.isModified=n,0!=a?(c&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=
+Math.min(8E3,Math.max(this.saveDelay+500,DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(e,l,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b(a)}),d)):(this.setModified(f||this.isModified()),null!=d&&d(a))}catch(v){if(this.setModified(f||this.isModified()),null!=d)d(v);else throw v;}}),mxUtils.bind(this,function(b,c){try{this.savingFile=!1,this.isModified=n,this.setModified(f||this.isModified()),this.isConflict(b)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=
+!0,this.savingFileTime=new Date,this.sync.fileConflict(c,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();k(a,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(b)}catch(v){if(this.setModified(f||this.isModified()),null!=d)d(v);else throw v;}}),g,g,a)}catch(p){if(this.savingFile=!1,null!=n&&(this.isModified=n),null!=f&&this.setModified(f||this.isModified()),null!=d)d(p);else throw p;
+}});k(e,c)}}catch(m){if(null!=d)d(m);else throw m;}};DriveFile.prototype.copyFile=function(a,c){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,c)}catch(b){c(b)}}),c,!0)};
DriveFile.prototype.makeCopy=function(a,c,b){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(this.ui.getCopyFilename(this,b),mxUtils.bind(this,function(b){this.desc=b;this.ui.spinner.stop();this.setModified(!1);this.backupPatch=null;this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();a()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=c&&c()}))};DriveFile.prototype.saveAs=function(a,c,b){this.ui.drive.copyFile(this.getId(),a,c,b)};
-DriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(m){this.hasSameExtension(a,this.getTitle())?(this.desc=m,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(m)):(this.desc=m,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
+DriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.desc=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(g)):(this.desc=g,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
DriveFile.prototype.move=function(a,c,b){this.ui.drive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.desc=a;this.descriptorChanged();null!=c&&c(a)}),b)};DriveFile.prototype.getTitle=function(){return this.desc.title};DriveFile.prototype.getHash=function(){return"G"+this.getId()};DriveFile.prototype.getId=function(){return this.desc.id};DriveFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&this.desc.editable};
DriveFile.prototype.isSyncSupported=function(){return!0};DriveFile.prototype.isRevisionHistorySupported=function(){return!0};
DriveFile.prototype.getRevisions=function(a,c){this.ui.drive.executeRequest({url:"/files/"+this.getId()+"/revisions"},mxUtils.bind(this,function(b){for(var c=0;c<b.items.length;c++)mxUtils.bind(this,function(a){a.title=a.originalFilename;a.getXml=mxUtils.bind(this,function(b,c){this.ui.drive.getXmlFile(a,mxUtils.bind(this,function(a){b(a.getData())}),c)});a.getUrl=mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+a.id+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=
@@ -8800,8 +8810,8 @@ b?"&page="+b:""))+window.location.hash})})(b.items[c]);a(b.items)}),c)};DriveFil
DriveFile.prototype.getDescriptor=function(){return this.desc};DriveFile.prototype.setDescriptor=function(a){this.desc=a};DriveFile.prototype.getDescriptorSecret=function(a){return this.ui.drive.getCustomProperty(a,"secret")};DriveFile.prototype.setDescriptorRevisionId=function(a,c){a.headRevisionId=c};DriveFile.prototype.getDescriptorRevisionId=function(a){return a.headRevisionId};DriveFile.prototype.getDescriptorEtag=function(a){return a.etag};
DriveFile.prototype.setDescriptorEtag=function(a,c){a.etag=c};DriveFile.prototype.loadPatchDescriptor=function(a,c){this.ui.drive.executeRequest({url:"/files/"+this.getId()+"?supportsTeamDrives=true&fields="+this.ui.drive.catchupFields},mxUtils.bind(this,function(b){a(b)}),c)};DriveFile.prototype.patchDescriptor=function(a,c){DrawioFile.prototype.patchDescriptor.apply(this,arguments);a.headRevisionId=c.headRevisionId;a.modifiedDate=c.modifiedDate};
DriveFile.prototype.loadDescriptor=function(a,c){this.ui.drive.loadDescriptor(this.getId(),a,c)};DriveFile.prototype.commentsSupported=function(){return!0};
-DriveFile.prototype.getComments=function(a,c){function b(a,c,l){if(c.deleted)return null;l=new DriveComment(a,c.commentId||c.replyId,c.content,c.modifiedDate,c.createdDate,"resolved"==c.status,c.author.isAuthenticatedUser?d:new DrawioUser(c.author.permissionId,c.author.emailAddress,c.author.displayName,c.author.picture.url),l);for(var f=0;null!=c.replies&&f<c.replies.length;f++)l.addReplyDirect(b(a,c.replies[f],c.commentId));return l}var d=this.ui.getCurrentUser();this.ui.drive.executeRequest({url:"/files/"+
-this.getId()+"/comments"},mxUtils.bind(this,function(c){for(var d=[],l=0;l<c.items.length;l++){var m=b(this,c.items[l]);null!=m&&d.push(m)}a(d)}),c)};DriveFile.prototype.addComment=function(a,c,b){a={content:a.content};this.ui.drive.executeRequest({url:"/files/"+this.getId()+"/comments",method:"POST",params:a},mxUtils.bind(this,function(a){c(a.commentId)}),b)};DriveFile.prototype.canReplyToReplies=function(){return!1};DriveFile.prototype.canComment=function(){return this.desc.canComment};
+DriveFile.prototype.getComments=function(a,c){function b(a,c,k){if(c.deleted)return null;k=new DriveComment(a,c.commentId||c.replyId,c.content,c.modifiedDate,c.createdDate,"resolved"==c.status,c.author.isAuthenticatedUser?d:new DrawioUser(c.author.permissionId,c.author.emailAddress,c.author.displayName,c.author.picture.url),k);for(var e=0;null!=c.replies&&e<c.replies.length;e++)k.addReplyDirect(b(a,c.replies[e],c.commentId));return k}var d=this.ui.getCurrentUser();this.ui.drive.executeRequest({url:"/files/"+
+this.getId()+"/comments"},mxUtils.bind(this,function(c){for(var d=[],g=0;g<c.items.length;g++){var m=b(this,c.items[g]);null!=m&&d.push(m)}a(d)}),c)};DriveFile.prototype.addComment=function(a,c,b){a={content:a.content};this.ui.drive.executeRequest({url:"/files/"+this.getId()+"/comments",method:"POST",params:a},mxUtils.bind(this,function(a){c(a.commentId)}),b)};DriveFile.prototype.canReplyToReplies=function(){return!1};DriveFile.prototype.canComment=function(){return this.desc.canComment};
DriveFile.prototype.newComment=function(a,c){return new DriveComment(this,null,a,Date.now(),Date.now(),!1,c)};DriveLibrary=function(a,c,b){DriveFile.call(this,a,c,b)};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,c,b){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=c&&c(a)}),b)};DriveLibrary.prototype.open=function(){};DriveClient=function(a){mxEventSource.call(this);DrawioClient.call(this,a,"gDriveAuthInfo");this.ui=a;this.xmlMimeType="application/vnd.jgraph.mxfile";this.mimeType="application/vnd.jgraph.mxfile.realtime";this.ui.editor.chromeless&&!this.ui.editor.editable&&"1"!=urlParams.rt?(this.cookieName="gDriveViewerAuthInfo",this.token=this.getPersistentToken(),this.appId=window.DRAWIO_GOOGLE_VIEWER_APP_ID||"850530949725",this.clientId=window.DRAWIO_GOOGLE_VIEWER_CLIENT_ID||"850530949725.apps.googleusercontent.com",
this.scopes=["https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/userinfo.profile"],this.appIndex=0):(this.appId=window.DRAWIO_GOOGLE_APP_ID||"671128082532",this.clientId=window.DRAWIO_GOOGLE_CLIENT_ID||"671128082532-jhphbq6d0e1gnsus9mn7vf8a6fjn10mp.apps.googleusercontent.com",this.appIndex=1);this.mimeTypes=this.xmlMimeType+"application/mxe,application/mxr,application/vnd.jgraph.mxfile.realtime,application/vnd.jgraph.mxfile.rtlegacy";"1"==urlParams.photos&&this.scopes.push("https://www.googleapis.com/auth/photos.upload");
a=JSON.parse(this.token);if(null!=a&&null!=a.current){a=a.current;this.userId=a.userId;this.token=a.access_token;var c=(a.expires-Date.now())/1E3;a.expires_in=600>c?1:c;this.resetTokenRefresh(a);this.authCalled=!1}};mxUtils.extend(DriveClient,mxEventSource);mxUtils.extend(DriveClient,DrawioClient);DriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/google";DriveClient.prototype.GDriveBaseUrl="https://www.googleapis.com/drive/v2";
@@ -8813,135 +8823,135 @@ DriveClient.prototype.setUser=function(a){this.user=a;null==this.user?(this.user
DriveClient.prototype.getUsersList=function(){var a=[],c=JSON.parse(this.getPersistentToken(!0)),b=null;if(null!=c){null!=c.current&&(b=c.current.userId,a.push(c[b].user),a[0].isCurrent=!0);for(var d in c)"current"!=d&&d!=b&&a.push(c[d].user)}return a};DriveClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};
DriveClient.prototype.execute=function(a){var c=mxUtils.bind(this,function(b){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,c){this.authorize(!1,mxUtils.bind(this,function(){null!=c&&c();a()}),mxUtils.bind(this,function(a){var b=mxResources.get("cannotLogin");null!=a&&null!=a.error&&403==a.error.code&&null!=a.error.data&&0<a.error.data.length&&"domainPolicy"==a.error.data[0].reason&&(b=a.error.message);this.logout();this.ui.showError(mxResources.get("error"),b,mxResources.get("help"),
mxUtils.bind(this,function(){this.ui.openLink("https://desk.draw.io/support/solutions/articles/16000074659")}),null,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,c)};
-DriveClient.prototype.executeRequest=function(a,c,b){try{var d=!0,m=null,f=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var l=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=a;null!=m&&window.clearTimeout(m);m=window.setTimeout(mxUtils.bind(this,function(){d=!1;null!=b&&b({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:l})}),this.ui.timeout);var n=null,p=!1;"string"===typeof a.params?n=a.params:null!=a.params&&(n=JSON.stringify(a.params),
-p=!0);var u=a.fullUrl||this.GDriveBaseUrl+a.url;p&&(u+=(0<u.indexOf("?")?"&":"?")+"alt=json");var g=new mxXmlRequest(u,n,a.method||"GET");g.setRequestHeaders=mxUtils.bind(this,function(b,c){if(null!=a.headers)for(var d in a.headers)b.setRequestHeader(d,a.headers[d]);else null!=a.contentType?b.setRequestHeader("Content-Type",a.contentType):p&&b.setRequestHeader("Content-Type","application/json");b.setRequestHeader("Authorization","Bearer "+this.token)});g.send(mxUtils.bind(this,function(g){try{if(window.clearTimeout(m),
-d){var k;try{k=JSON.parse(g.getText())}catch(t){k=null}if(200<=g.getStatus()&&299>=g.getStatus())null!=c&&c(k);else{var p=null!=k&&null!=k.error?null!=k.error.data?k.error.data:k.error.errors:null,n=null!=p&&0<p.length?p[0].reason:null;null==b||null==k||null==k.error||-1!=k.error.code&&(403!=k.error.code||"domainPolicy"!=n&&"The requested mime type change is forbidden."!=k.error.message)?null!=k&&null!=k.error&&(401==k.error.code||403==k.error.code&&"rateLimitExceeded"!=n)?403==k.error.code&&this.retryAuth||
-401==k.error.code&&this.retryAuth&&"authError"==n?(null!=b&&b(k),this.retryAuth=!1):(this.retryAuth=!0,this.execute(l)):null!=k&&null!=k.error&&412!=k.error.code&&404!=k.error.code&&400!=k.error.code&&this.currentRequest==a&&f<this.maxRetries?(f++,this.requestThread=window.setTimeout(l,Math.round(Math.pow(2,f)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=b&&b(k):b(k)}}}catch(t){if(null!=b)b(t);else throw t;}}))}catch(k){if(null!=b)b(k);else throw k;}});null!=this.token&&this.authCalled?l():this.execute(l)}catch(n){if(null!=
-b)b(n);else throw n;}};DriveClient.prototype.createAuthWin=function(a){return window.open(a?a:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};
-DriveClient.prototype.authorize=function(a,c,b,d,m){var f=mxUtils.bind(this,function(a,d,f){this.token=a.access_token;a.expires=Date.now()+1E3*parseInt(a.expires_in);a.remember=d;this.resetTokenRefresh(a);this.authCalled=!0;if(f||null==this.user){var g=JSON.stringify(a);this.updateUser(mxUtils.bind(this,function(){var a=JSON.parse(g);this.setPersistentToken(a,!d);null!=c&&c()}),b)}else null!=c&&(this.setPersistentToken(a,!d),c())});try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=
-this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));var l=JSON.parse(this.getPersistentToken(!0));null!=l&&(null==this.userId?null!=l.current?(this.userId=l.current.userId,l=l[this.userId]):l=null:l=l[this.userId]);if(!a||null!=l&&null!=l.refresh_token)if(a)(new mxXmlRequest(this.redirectUri+"?state=appIndex%3D"+this.appIndex+"&refresh_token="+l.refresh_token,null,"GET")).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?(a=JSON.parse(a.getText()),
-a.refresh_token=l.refresh_token,f(a,!0)):(this.logout(),null!=b&&b(a))}),b);else{var n="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(d?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state=appIndex%3D"+this.appIndex;null==m?m=this.createAuthWin(n):m.location=n;null!=m&&(window.onGoogleDriveCallback=mxUtils.bind(this,
-function(a,c){window.onGoogleDriveCallback=null;try{null==a?null!=b&&b({message:mxResources.get("accessDenied")}):f(a,d,!0)}catch(g){null!=b&&b(g)}finally{null!=c&&c.close()}}),m.focus())}else null!=b&&b()}catch(p){if(null!=b)b(p);else throw p;}};
+DriveClient.prototype.executeRequest=function(a,c,b){try{var d=!0,g=null,e=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var k=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=a;null!=g&&window.clearTimeout(g);g=window.setTimeout(mxUtils.bind(this,function(){d=!1;null!=b&&b({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:k})}),this.ui.timeout);var m=null,n=!1;"string"===typeof a.params?m=a.params:null!=a.params&&(m=JSON.stringify(a.params),
+n=!0);var q=a.fullUrl||this.GDriveBaseUrl+a.url;n&&(q+=(0<q.indexOf("?")?"&":"?")+"alt=json");var f=new mxXmlRequest(q,m,a.method||"GET");f.setRequestHeaders=mxUtils.bind(this,function(b,c){if(null!=a.headers)for(var d in a.headers)b.setRequestHeader(d,a.headers[d]);else null!=a.contentType?b.setRequestHeader("Content-Type",a.contentType):n&&b.setRequestHeader("Content-Type","application/json");b.setRequestHeader("Authorization","Bearer "+this.token)});f.send(mxUtils.bind(this,function(f){try{if(window.clearTimeout(g),
+d){var l;try{l=JSON.parse(f.getText())}catch(t){l=null}if(200<=f.getStatus()&&299>=f.getStatus())null!=c&&c(l);else{var n=null!=l&&null!=l.error?null!=l.error.data?l.error.data:l.error.errors:null,m=null!=n&&0<n.length?n[0].reason:null;null==b||null==l||null==l.error||-1!=l.error.code&&(403!=l.error.code||"domainPolicy"!=m&&"The requested mime type change is forbidden."!=l.error.message)?null!=l&&null!=l.error&&(401==l.error.code||403==l.error.code&&"rateLimitExceeded"!=m)?403==l.error.code&&this.retryAuth||
+401==l.error.code&&this.retryAuth&&"authError"==m?(null!=b&&b(l),this.retryAuth=!1):(this.retryAuth=!0,this.execute(k)):null!=l&&null!=l.error&&412!=l.error.code&&404!=l.error.code&&400!=l.error.code&&this.currentRequest==a&&e<this.maxRetries?(e++,this.requestThread=window.setTimeout(k,Math.round(Math.pow(2,e)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=b&&b(l):b(l)}}}catch(t){if(null!=b)b(t);else throw t;}}))}catch(l){if(null!=b)b(l);else throw l;}});null!=this.token&&this.authCalled?k():this.execute(k)}catch(m){if(null!=
+b)b(m);else throw m;}};DriveClient.prototype.createAuthWin=function(a){return window.open(a?a:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};
+DriveClient.prototype.authorize=function(a,c,b,d,g){var e=mxUtils.bind(this,function(a,d,e){this.token=a.access_token;a.expires=Date.now()+1E3*parseInt(a.expires_in);a.remember=d;this.resetTokenRefresh(a);this.authCalled=!0;if(e||null==this.user){var f=JSON.stringify(a);this.updateUser(mxUtils.bind(this,function(){var a=JSON.parse(f);this.setPersistentToken(a,!d);null!=c&&c()}),b)}else null!=c&&(this.setPersistentToken(a,!d),c())});try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=
+this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));var k=JSON.parse(this.getPersistentToken(!0));null!=k&&(null==this.userId?null!=k.current?(this.userId=k.current.userId,k=k[this.userId]):k=null:k=k[this.userId]);if(!a||null!=k&&null!=k.refresh_token)if(a)(new mxXmlRequest(this.redirectUri+"?state=appIndex%3D"+this.appIndex+"&refresh_token="+k.refresh_token,null,"GET")).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?(a=JSON.parse(a.getText()),
+a.refresh_token=k.refresh_token,e(a,!0)):(this.logout(),null!=b&&b(a))}),b);else{var m="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(d?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state=appIndex%3D"+this.appIndex;null==g?g=this.createAuthWin(m):g.location=m;null!=g&&(window.onGoogleDriveCallback=mxUtils.bind(this,
+function(a,c){window.onGoogleDriveCallback=null;try{null==a?null!=b&&b({message:mxResources.get("accessDenied")}):e(a,d,!0)}catch(f){null!=b&&b(f)}finally{null!=c&&c.close()}}),g.focus())}else null!=b&&b()}catch(n){if(null!=b)b(n);else throw n;}};
DriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=a&&null==a.error&&0<a.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(a.expires_in),this.lastTokenRefresh=(new Date).getTime(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*a.expires_in))};
DriveClient.prototype.checkToken=function(a){var c=0<this.lastTokenRefresh;(new Date).getTime()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){a();c&&this.fireEvent(new mxEventObject("disconnected"))})):a()};
-DriveClient.prototype.updateUser=function(a,c){try{this.ui.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token="+this.token,mxUtils.bind(this,function(b){var d=JSON.parse(b);this.executeRequest({url:"/about"},mxUtils.bind(this,function(b){var c=mxResources.get("notAvailable"),l=c,m=null;null!=b&&null!=b.user&&(c=b.user.emailAddress,l=b.user.displayName,m=null!=b.user.picture?b.user.picture.url:null);this.setUser(new DrawioUser(d.id,c,l,m,d.locale));this.userId=d.id;null!=
+DriveClient.prototype.updateUser=function(a,c){try{this.ui.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token="+this.token,mxUtils.bind(this,function(b){var d=JSON.parse(b);this.executeRequest({url:"/about"},mxUtils.bind(this,function(b){var c=mxResources.get("notAvailable"),g=c,m=null;null!=b&&null!=b.user&&(c=b.user.emailAddress,g=b.user.displayName,m=null!=b.user.picture?b.user.picture.url:null);this.setUser(new DrawioUser(d.id,c,g,m,d.locale));this.userId=d.id;null!=
a&&a()}),c)}),c)}catch(b){if(null!=c)c(b);else throw b;}};DriveClient.prototype.copyFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest({url:"/files/"+a+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsTeamDrives=true",method:"POST",params:{title:c,properties:[{key:"channel",value:Editor.guid()}]}},b,d)};DriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{title:c}),b,d)};
DriveClient.prototype.moveFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{parents:[{kind:"drive#fileLink",id:c}]}),b,d)};DriveClient.prototype.createDriveRequest=function(a,c){return{url:"/files/"+a+"?uploadType=multipart&supportsTeamDrives=true",method:"PUT",contentType:"application/json; charset=UTF-8",params:c}};DriveClient.prototype.getLibrary=function(a,c,b){return this.getFile(a,c,b,!0,!0)};
-DriveClient.prototype.loadDescriptor=function(a,c,b,d){this.executeRequest({url:"/files/"+a+"?supportsTeamDrives=true&fields="+(null!=d?d:this.allFields)},c,b)};DriveClient.prototype.getCustomProperty=function(a,c){var b=a.properties,d=null;if(null!=b)for(var m=0;m<b.length;m++)if(b[m].key==c){d=b[m].value;break}return d};
-DriveClient.prototype.getFile=function(a,c,b,d,m){d=null!=d?d:!1;m=null!=m?m:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+a+"/revisions/"+urlParams.rev+"?supportsTeamDrives=true"},mxUtils.bind(this,function(d){d.title=d.originalFilename;d.headRevisionId=d.id;d.id=a;this.getXmlFile(d,c,b)}),b):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var f=/\.png$/i.test(a.title);/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&
-f?this.ui.convertFile(a.downloadUrl+"&access_token="+this.token,a.title,a.mimeType,this.extension,c,b):d||m||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,b,!0,m):this.getXmlFile(a,c,b)}else b({message:mxResources.get("loggedOut")})}catch(n){if(null!=b)b(n);else throw n;}}),b)};DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)};
-DriveClient.prototype.getXmlFile=function(a,c,b,d,m){try{var f=a.downloadUrl+"&access_token="+this.token;this.ui.loadUrl(f,mxUtils.bind(this,function(d){try{if(null==d)b({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||m)a.mimeType!=this.libraryMimeType||m?c(new DriveLibrary(this.ui,d,a)):b({message:mxResources.get("notADiagramFile")});else{var l=!1;if(/\.png$/i.test(a.title)){var p=d.lastIndexOf(",");if(0<p){var u=this.ui.extractGraphModelFromPng(d.substring(p+
-1));if(null!=u&&0<u.length)d=u;else try{var u=d.substring(p+1),g=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(u):atob(u),k=this.ui.editor.extractGraphModel(mxUtils.parseXml(g).documentElement,!0);null==k||0<k.getElementsByTagName("parsererror").length?l=!0:d=g}catch(q){l=!0}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(g=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(d,
-f)?this.ui.parseFile(new Blob([d],{type:"application/octet-stream"}),mxUtils.bind(this,function(d){try{4==d.readyState&&(200<=d.status&&299>=d.status?c(new LocalFile(this.ui,d.responseText,a.title+this.extension,!0)):null!=b&&b({message:mxResources.get("errorLoadingFile")}))}catch(v){if(null!=b)b(v);else throw v;}}),a.title):c(l?new LocalFile(this.ui,d,a.title,!0):new DriveFile(this.ui,d,a))}}catch(q){if(null!=b)b(q);else throw q;}}),b,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=
-a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))}catch(l){if(null!=b)b(l);else throw l;}};
-DriveClient.prototype.saveFile=function(a,c,b,d,m,f,l,n){try{a.saveLevel=1;var p=mxUtils.bind(this,function(b){a.saveLevel=null;if(null!=d)d(b);else throw b;try{if(!a.isConflict(b)){var c="error_"+(a.getErrorMessage(b)||"unknown");null!=b&&null!=b.error&&null!=b.error.code&&(c+="-code_"+b.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+
-(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),action:c,label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}}catch(x){}}),u=mxUtils.bind(this,function(b){p(b);try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+
-"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(D){}});if(a.isEditable()&&null!=a.desc){var g=(new Date).getTime(),k=a.desc.etag,q=a.desc.modifiedDate,v=a.desc.headRevisionId,y=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());m=null!=m?m:"1"==urlParams.ignoremime;f=null!=f?f:!1;var t=mxUtils.bind(this,function(d,m,t){try{a.saveLevel=3;var x=null,G=!1,B={mimeType:a.desc.mimeType,title:a.getTitle()};
-this.isGoogleRealtimeMimeType(a.desc.mimeType)?(B.mimeType=this.xmlMimeType,x=a.desc,G=c=!0):"application/octet-stream"==B.mimeType&&(B.mimeType=this.xmlMimeType);a.constructor==DriveFile&&(null==n&&(n=[]),null==a.getChannelId()&&n.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&n.push({key:"key",value:Editor.guid(32)}),n.push({key:"secret",value:Editor.guid(32)}));t||(null!=d||f||(d=this.placeholderThumbnail,m=this.placeholderMimeType),null!=d&&null!=m&&(B.thumbnail={image:d,
-mimeType:m}));var A=a.getData(),z=mxUtils.bind(this,function(d){try{a.saveDelay=(new Date).getTime()-g;var f=(new Date(d.modifiedDate)).getTime()-(new Date(q)).getTime();if(0>=f||k==d.etag||c&&v==d.headRevisionId){var l=[];0>=f&&l.push("invalid modified time");k==d.etag&&l.push("stale etag");c&&v==d.headRevisionId&&l.push("stale revision");var m=l.join(", ");p({message:mxResources.get("errorSavingFile")+": "+m},d);try{EditorUi.sendReport("Critical: Error saving to Google Drive "+(new Date).toISOString()+
-":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+" "+a.desc.mimeType+"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nErrors="+m+"\nOld="+v+" "+q+" etag-hash="+this.ui.hashValue(k)+"\nNew="+d.headRevisionId+" "+d.modifiedDate+" etag-hash="+this.ui.hashValue(d.etag)),EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+v+"."+q+"-"+this.ui.hashValue(k)+"-to-"+d.headRevisionId+"."+d.modifiedDate+"-"+this.ui.hashValue(d.etag)+
-(0<m.length?"-errors-"+m:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(N){}}else{a.saveLevel=null;b(d,A);if(null!=x){this.executeRequest({url:"/files/"+x.id+"/revisions/"+x.headRevisionId+"?supportsTeamDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+x.id+"/revisions/"+x.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+"-CONVERT-FILE-"+
-a.getHash(),action:"from_"+x.id+"."+x.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(N){}}try{EditorUi.logEvent({category:"SUCCESS-SAVE-FILE-"+a.getHash()+"-rev0_"+v+"-mod0_"+q,action:"rev-"+d.headRevisionId+"-mod_"+d.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+
-(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}catch(N){}}}catch(N){u(N)}}),D=mxUtils.bind(this,function(b,g){a.saveLevel=4;try{null!=n&&(B.properties=n);var f=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),k=0,m=mxUtils.bind(this,function(d){a.saveLevel=5;try{var l=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=
-this.mimeType&&a.desc.mimeType!=this.libraryMimeType,m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),4*this.ui.timeout);this.executeRequest(this.createUploadRequest(a.getId(),B,b,c||d||l,g,d?null:f,G),mxUtils.bind(this,function(a){window.clearTimeout(n);m&&z(a)}),mxUtils.bind(this,function(b){window.clearTimeout(n);if(m){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsTeamDrives=true&fields="+
-this.catchupFields},mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!=c&&c.etag==f)if(k<this.maxRetries)k++,window.setTimeout(q,2*k*this.coolOff*(1+.1*(Math.random()-.5)));else{q(!0);try{EditorUi.logError("Warning: Stale Etag Overwrite "+a.getHash(),null,a.desc.id+"."+a.desc.headRevisionId,(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(da){}}else"1"==urlParams.test&&c.headRevisionId==v&&EditorUi.debug("DriveClient: Remote Etag Changed",
-"local",f,"remote",c.etag,"rev",a.desc.headRevisionId,"response",[c],"file",[a]),p(b,c)}catch(da){u(da)}}),mxUtils.bind(this,function(){p(b)})):p(b)}catch(ha){u(ha)}}}))}catch(ia){u(ia)}}),q=mxUtils.bind(this,function(b){b?m(b):this.executeRequest({url:"/files/"+a.getId()+"?supportsTeamDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(c){try{null!=c&&c.headRevisionId==v?("1"==urlParams.test&&f!=c.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",f,"to",c.etag,"rev",
-a.desc.headRevisionId,"response",[c],"file",[a]),f=c.etag,m(b)):p({error:{code:412}},c)}catch(X){u(X)}}),mxUtils.bind(this,function(a){p(a)}))});if(y&&null==d){a.saveLevel=8;var t=new Image;t.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/t.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(t.height*a);b.getContext("2d").drawImage(t,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");
-B.thumbnail={image:c,mimeType:"image/png"};q(!1)}catch(ba){q(!1)}});t.src="data:image/png;base64,"+b}else q(!1)}catch(U){u(U)}});y?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){D(a,!0)}),p,this.ui.getCurrentFile()!=a?A:null):D(A,!1)}catch(K){u(K)}}),A=mxUtils.bind(this,function(){try{if(a.saveLevel=2,f||y||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=a.desc.mimeType&&"application/vnd.jgraph.mxfile"!=a.desc.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,
-mxUtils.bind(this,function(b){try{var c=a.thumbTime=null;try{null!=b&&(c=b.toDataURL("image/png")),null!=c&&(c=c.length>this.maxThumbnailSize?null:c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(x){c=null}t(c,"image/png")}catch(x){u(x)}})))a.thumbTime=null,t(null,null,a.constructor!=DriveLibrary)}catch(z){u(z)}});m||!c?A():this.verifyMimeType(a.getId(),A,!0)}else this.ui.editor.graph.reset(),p({message:mxResources.get("readOnly")})}catch(z){u(z)}};
-DriveClient.prototype.verifyMimeType=function(a,c,b,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var m=(new Date).getTime();if(b||m-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=m,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest({url:"/files/"+a+"?supportsTeamDrives=true&fields=mimeType"},mxUtils.bind(this,function(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!=c&&c()})))};
+DriveClient.prototype.loadDescriptor=function(a,c,b,d){this.executeRequest({url:"/files/"+a+"?supportsTeamDrives=true&fields="+(null!=d?d:this.allFields)},c,b)};DriveClient.prototype.getCustomProperty=function(a,c){var b=a.properties,d=null;if(null!=b)for(var g=0;g<b.length;g++)if(b[g].key==c){d=b[g].value;break}return d};
+DriveClient.prototype.getFile=function(a,c,b,d,g){d=null!=d?d:!1;g=null!=g?g:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+a+"/revisions/"+urlParams.rev+"?supportsTeamDrives=true"},mxUtils.bind(this,function(d){d.title=d.originalFilename;d.headRevisionId=d.id;d.id=a;this.getXmlFile(d,c,b)}),b):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var e=/\.png$/i.test(a.title);/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&
+e?this.ui.convertFile(a.downloadUrl+"&access_token="+this.token,a.title,a.mimeType,this.extension,c,b):d||g||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,b,!0,g):this.getXmlFile(a,c,b)}else b({message:mxResources.get("loggedOut")})}catch(m){if(null!=b)b(m);else throw m;}}),b)};DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)};
+DriveClient.prototype.getXmlFile=function(a,c,b,d,g){try{var e=a.downloadUrl+"&access_token="+this.token;this.ui.loadUrl(e,mxUtils.bind(this,function(d){try{if(null==d)b({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||g)a.mimeType!=this.libraryMimeType||g?c(new DriveLibrary(this.ui,d,a)):b({message:mxResources.get("notADiagramFile")});else{var k=!1;if(/\.png$/i.test(a.title)){var n=d.lastIndexOf(",");if(0<n){var q=this.ui.extractGraphModelFromPng(d.substring(n+
+1));if(null!=q&&0<q.length)d=q;else try{var q=d.substring(n+1),f=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(q):atob(q),l=this.ui.editor.extractGraphModel(mxUtils.parseXml(f).documentElement,!0);null==l||0<l.getElementsByTagName("parsererror").length?k=!0:d=f}catch(p){k=!0}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(f=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(d,
+e)?this.ui.parseFile(new Blob([d],{type:"application/octet-stream"}),mxUtils.bind(this,function(d){try{4==d.readyState&&(200<=d.status&&299>=d.status?c(new LocalFile(this.ui,d.responseText,a.title+this.extension,!0)):null!=b&&b({message:mxResources.get("errorLoadingFile")}))}catch(u){if(null!=b)b(u);else throw u;}}),a.title):c(k?new LocalFile(this.ui,d,a.title,!0):new DriveFile(this.ui,d,a))}}catch(p){if(null!=b)b(p);else throw p;}}),b,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=
+a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))}catch(k){if(null!=b)b(k);else throw k;}};
+DriveClient.prototype.saveFile=function(a,c,b,d,g,e,k,m){try{a.saveLevel=1;var n=mxUtils.bind(this,function(b){a.saveLevel=null;if(null!=d)d(b);else throw b;try{if(!a.isConflict(b)){var c="error_"+(a.getErrorMessage(b)||"unknown");null!=b&&null!=b.error&&null!=b.error.code&&(c+="-code_"+b.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+
+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),action:c,label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}}catch(x){}}),q=mxUtils.bind(this,function(b){n(b);try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+
+"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(C){}});if(a.isEditable()&&null!=a.desc){var f=(new Date).getTime(),l=a.desc.etag,p=a.desc.modifiedDate,u=a.desc.headRevisionId,v=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());g=null!=g?g:"1"==urlParams.ignoremime;e=null!=e?e:!1;var t=mxUtils.bind(this,function(d,g,x){try{a.saveLevel=3;var t=null,E=!1,A={mimeType:a.desc.mimeType,title:a.getTitle()};
+this.isGoogleRealtimeMimeType(a.desc.mimeType)?(A.mimeType=this.xmlMimeType,t=a.desc,E=c=!0):"application/octet-stream"==A.mimeType&&(A.mimeType=this.xmlMimeType);a.constructor==DriveFile&&(null==m&&(m=[]),null==a.getChannelId()&&m.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&m.push({key:"key",value:Editor.guid(32)}),m.push({key:"secret",value:Editor.guid(32)}));x||(null!=d||e||(d=this.placeholderThumbnail,g=this.placeholderMimeType),null!=d&&null!=g&&(A.thumbnail={image:d,
+mimeType:g}));var z=a.getData(),y=mxUtils.bind(this,function(d){try{a.saveDelay=(new Date).getTime()-f;var e=(new Date(d.modifiedDate)).getTime()-(new Date(p)).getTime();if(0>=e||l==d.etag||c&&u==d.headRevisionId){var g=[];0>=e&&g.push("invalid modified time");l==d.etag&&g.push("stale etag");c&&u==d.headRevisionId&&g.push("stale revision");var k=g.join(", ");n({message:mxResources.get("errorSavingFile")+": "+k},d);try{EditorUi.sendReport("Critical: Error saving to Google Drive "+(new Date).toISOString()+
+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+" "+a.desc.mimeType+"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nErrors="+k+"\nOld="+u+" "+p+" etag-hash="+this.ui.hashValue(l)+"\nNew="+d.headRevisionId+" "+d.modifiedDate+" etag-hash="+this.ui.hashValue(d.etag)),EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+u+"."+p+"-"+this.ui.hashValue(l)+"-to-"+d.headRevisionId+"."+d.modifiedDate+"-"+this.ui.hashValue(d.etag)+
+(0<k.length?"-errors-"+k:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(Q){}}else{a.saveLevel=null;b(d,z);if(null!=t){this.executeRequest({url:"/files/"+t.id+"/revisions/"+t.headRevisionId+"?supportsTeamDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+t.id+"/revisions/"+t.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+"-CONVERT-FILE-"+
+a.getHash(),action:"from_"+t.id+"."+t.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(Q){}}try{EditorUi.logEvent({category:"SUCCESS-SAVE-FILE-"+a.getHash()+"-rev0_"+u+"-mod0_"+p,action:"rev-"+d.headRevisionId+"-mod_"+d.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+
+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}catch(Q){}}}catch(Q){q(Q)}}),C=mxUtils.bind(this,function(b,e){a.saveLevel=4;try{null!=m&&(A.properties=m);var f=k||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),g=0,l=mxUtils.bind(this,function(d){a.saveLevel=5;try{var k=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=
+this.mimeType&&a.desc.mimeType!=this.libraryMimeType,l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;n({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),4*this.ui.timeout);this.executeRequest(this.createUploadRequest(a.getId(),A,b,c||d||k,e,d?null:f,E),mxUtils.bind(this,function(a){window.clearTimeout(m);l&&y(a)}),mxUtils.bind(this,function(b){window.clearTimeout(m);if(l){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsTeamDrives=true&fields="+
+this.catchupFields},mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!=c&&c.etag==f)if(g<this.maxRetries)g++,window.setTimeout(p,2*g*this.coolOff*(1+.1*(Math.random()-.5)));else{p(!0);try{EditorUi.logError("Warning: Stale Etag Overwrite "+a.getHash(),null,a.desc.id+"."+a.desc.headRevisionId,(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(ca){}}else"1"==urlParams.test&&c.headRevisionId==u&&EditorUi.debug("DriveClient: Remote Etag Changed",
+"local",f,"remote",c.etag,"rev",a.desc.headRevisionId,"response",[c],"file",[a]),n(b,c)}catch(ca){q(ca)}}),mxUtils.bind(this,function(){n(b)})):n(b)}catch(ga){q(ga)}}}))}catch(ha){q(ha)}}),p=mxUtils.bind(this,function(b){b?l(b):this.executeRequest({url:"/files/"+a.getId()+"?supportsTeamDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(c){try{null!=c&&c.headRevisionId==u?("1"==urlParams.test&&f!=c.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",f,"to",c.etag,"rev",
+a.desc.headRevisionId,"response",[c],"file",[a]),f=c.etag,l(b)):n({error:{code:412}},c)}catch(W){q(W)}}),mxUtils.bind(this,function(a){n(a)}))});if(v&&null==d){a.saveLevel=8;var x=new Image;x.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/x.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(x.height*a);b.getContext("2d").drawImage(x,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");
+A.thumbnail={image:c,mimeType:"image/png"};p(!1)}catch(aa){p(!1)}});x.src="data:image/png;base64,"+b}else p(!1)}catch(T){q(T)}});v?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){C(a,!0)}),n,this.ui.getCurrentFile()!=a?z:null):C(z,!1)}catch(J){q(J)}}),z=mxUtils.bind(this,function(){try{if(a.saveLevel=2,e||v||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=a.desc.mimeType&&"application/vnd.jgraph.mxfile"!=a.desc.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,
+mxUtils.bind(this,function(b){try{var c=a.thumbTime=null;try{null!=b&&(c=b.toDataURL("image/png")),null!=c&&(c=c.length>this.maxThumbnailSize?null:c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(x){c=null}t(c,"image/png")}catch(x){q(x)}})))a.thumbTime=null,t(null,null,a.constructor!=DriveLibrary)}catch(y){q(y)}});g||!c?z():this.verifyMimeType(a.getId(),z,!0)}else this.ui.editor.graph.reset(),n({message:mxResources.get("readOnly")})}catch(y){q(y)}};
+DriveClient.prototype.verifyMimeType=function(a,c,b,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var g=(new Date).getTime();if(b||g-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=g,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest({url:"/files/"+a+"?supportsTeamDrives=true&fields=mimeType"},mxUtils.bind(this,function(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!=c&&c()})))};
DriveClient.prototype.redirectToNewApp=function(a,c){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var b=window.location.protocol+"//"+this.newAppHostname+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#G"+c,d=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==b?window.location.reload():window.location.href=b});null!=a?this.ui.confirm(mxResources.get("redirectToNewApp"),d,mxUtils.bind(this,function(){this.redirectDialogShowing=
-!1;null!=a&&a()})):this.ui.alert(mxResources.get("redirectToNewApp"),d)}};DriveClient.prototype.insertFile=function(a,c,b,d,m,f,l){f=null!=f?f:this.xmlMimeType;a={mimeType:f,title:a};null!=b&&(a.parents=[{kind:"drive#fileLink",id:b}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,l),mxUtils.bind(this,function(a){f==this.libraryMimeType?d(new DriveLibrary(this.ui,c,a)):0==a?null!=m&&m({message:mxResources.get("errorSavingFile")}):d(new DriveFile(this.ui,c,a))}),m)};
-DriveClient.prototype.createUploadRequest=function(a,c,b,d,m,f,l){m=null!=m?m:!1;var n={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=f&&(n["If-Match"]=f);a={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=a?"/"+a:"")+"?uploadType=multipart&supportsTeamDrives=true&fields="+this.allFields,method:null!=a?"PUT":"POST",headers:n,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+
-(null!=b?m?b:Base64.encode(b):"")+"\r\n---------314159265358979323846--"};d||(a.url+="&newRevision=false");l&&(a.url+="&pinned=true");return a};
+!1;null!=a&&a()})):this.ui.alert(mxResources.get("redirectToNewApp"),d)}};DriveClient.prototype.insertFile=function(a,c,b,d,g,e,k){e=null!=e?e:this.xmlMimeType;a={mimeType:e,title:a};null!=b&&(a.parents=[{kind:"drive#fileLink",id:b}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,k),mxUtils.bind(this,function(a){e==this.libraryMimeType?d(new DriveLibrary(this.ui,c,a)):0==a?null!=g&&g({message:mxResources.get("errorSavingFile")}):d(new DriveFile(this.ui,c,a))}),g)};
+DriveClient.prototype.createUploadRequest=function(a,c,b,d,g,e,k){g=null!=g?g:!1;var m={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=e&&(m["If-Match"]=e);a={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=a?"/"+a:"")+"?uploadType=multipart&supportsTeamDrives=true&fields="+this.allFields,method:null!=a?"PUT":"POST",headers:m,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+
+(null!=b?g?b:Base64.encode(b):"")+"\r\n---------314159265358979323846--"};d||(a.url+="&newRevision=false");k&&(a.url+="&pinned=true");return a};
DriveClient.prototype.pickFile=function(a,c){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=c?"genericPicker":"filePicker",d=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==
-mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",d),this[a].setVisible(!1))});if(null==this[a]||this[a+"Token"]!=this.token){this[a+"Token"]=this.token;var m=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),f=(new google.picker.DocsView).setIncludeFolders(!0),l=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0),n=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(m.setMimeTypes("*/*"),f.setMimeTypes("*/*"),
-l.setMimeTypes("*/*")):(m.setMimeTypes(this.mimeTypes),f.setMimeTypes(this.mimeTypes),l.setMimeTypes(this.mimeTypes));this[a]=(new google.picker.PickerBuilder).setOAuthToken(this[a+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(m).addView(f).addView(l).addView(google.picker.ViewId.RECENTLY_PICKED).addView(n).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||
-mxEvent.removeListener(document,"click",d);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",d);this[a].setVisible(!0)}catch(p){this.ui.spinner.stop(),this.ui.handleError(p)}}))};
+mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",d),this[a].setVisible(!1))});if(null==this[a]||this[a+"Token"]!=this.token){this[a+"Token"]=this.token;var g=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),e=(new google.picker.DocsView).setIncludeFolders(!0),k=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0),m=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(g.setMimeTypes("*/*"),e.setMimeTypes("*/*"),
+k.setMimeTypes("*/*")):(g.setMimeTypes(this.mimeTypes),e.setMimeTypes(this.mimeTypes),k.setMimeTypes(this.mimeTypes));this[a]=(new google.picker.PickerBuilder).setOAuthToken(this[a+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(g).addView(e).addView(k).addView(google.picker.ViewId.RECENTLY_PICKED).addView(m).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||
+mxEvent.removeListener(document,"click",d);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",d);this[a].setVisible(!0)}catch(n){this.ui.spinner.stop(),this.ui.handleError(n)}}))};
DriveClient.prototype.pickFolder=function(a,c){this.folderPickerCallback=a;var b=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||this.folderPickerToken!=this.token){this.folderPickerToken=
-this.token;var b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),l=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");this.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(c).addView(l).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder")).setCallback(mxUtils.bind(this,
-function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);this.folderPickerCallback(b)})).build()}mxEvent.addListener(document,"click",a);this.folderPicker.setVisible(!0)}catch(n){this.ui.spinner.stop(),this.ui.handleError(n)}}))}catch(d){this.ui.handleError(d)}});c?b():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",
+this.token;var b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),k=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");this.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(c).addView(k).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder")).setCallback(mxUtils.bind(this,
+function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);this.folderPickerCallback(b)})).build()}mxEvent.addListener(document,"click",a);this.folderPicker.setVisible(!0)}catch(m){this.ui.spinner.stop(),this.ui.handleError(m)}}))}catch(d){this.ui.handleError(d)}});c?b():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",
id:"root"}]})}),mxUtils.bind(this,function(){b()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)};
DriveClient.prototype.pickLibrary=function(a){this.filePickerCallback=a;this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED?this.filePickerCallback(a.docs[0].id):a.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==
mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))});if(null==this.libraryPicker||this.libraryPickerToken!=this.token){this.libraryPickerToken=this.token;var b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),d=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),
-m=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),f=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(d).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).addView(f).setCallback(mxUtils.bind(this,
-function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document,"click",a);this.libraryPicker.setVisible(!0)}catch(l){this.ui.spinner.stop(),this.ui.handleError(l)}}))};
+g=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),e=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(d).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(e).setCallback(mxUtils.bind(this,
+function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document,"click",a);this.libraryPicker.setVisible(!0)}catch(k){this.ui.spinner.stop(),this.ui.handleError(k)}}))};
DriveClient.prototype.showPermissions=function(a){var c=mxUtils.bind(this,function(){var b=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){this.ui.editor.graph.openLink("https://drive.google.com/open?id="+a)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(b.container,360,190,!0,!0);b.init()});this.sharingFailed?c():this.checkToken(mxUtils.bind(this,function(){try{var b=new gapi.drive.share.ShareClient(this.appId);
-b.setOAuthToken(this.token);b.setItemIds([a]);b.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(a){for(var b=!1,d=0;d<a.length;d++)for(var l=0;l<a[d].addedNodes.length;l++){var n=a[d].addedNodes[l];"BUTTON"==n.nodeName&&"ok"==n.getAttribute("name")&&null!=n.parentNode&&null!=n.parentNode.parentNode&&"dialog"==n.parentNode.parentNode.getAttribute("role")?
-(this.sharingFailed=!0,n.click(),c(),b=!0):"DIV"==n.nodeName&&"shr-q-shr-r-shr-xb"==n.className&&(b=!0)}b&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(d){this.ui.handleError(d)}}))};
+b.setOAuthToken(this.token);b.setItemIds([a]);b.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(a){for(var b=!1,d=0;d<a.length;d++)for(var k=0;k<a[d].addedNodes.length;k++){var m=a[d].addedNodes[k];"BUTTON"==m.nodeName&&"ok"==m.getAttribute("name")&&null!=m.parentNode&&null!=m.parentNode.parentNode&&"dialog"==m.parentNode.parentNode.getAttribute("role")?
+(this.sharingFailed=!0,m.click(),c(),b=!0):"DIV"==m.nodeName&&"shr-q-shr-r-shr-xb"==m.className&&(b=!0)}b&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(d){this.ui.handleError(d)}}))};
DriveClient.prototype.clearPersistentToken=function(){var a=JSON.parse(this.getPersistentToken(!0))||{};delete a.current;delete a[this.userId];for(var c in a){a.current={userId:c,expires:0};break}DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(a))};
DriveClient.prototype.setPersistentToken=function(a,c){var b=JSON.parse(this.getPersistentToken(!0))||{};a.userId=this.userId;b.current=a;b[this.userId]={refresh_token:a.refresh_token,user:this.user};DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(b),c)};DropboxFile=function(a,c,b){DrawioFile.call(this,a,c);this.stat=b};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};
DropboxFile.prototype.isRenamable=function(){return!0};DropboxFile.prototype.getSize=function(){return this.stat.size};DropboxFile.prototype.isRevisionHistorySupported=function(){return!0};
-DropboxFile.prototype.getRevisions=function(a,c){var b=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});b.then(mxUtils.bind(this,function(b){try{for(var d=[],f=b.entries.length-1;0<=f;f--)mxUtils.bind(this,function(a){d.push({modifiedDate:a.client_modified,fileSize:a.size,getXml:mxUtils.bind(this,function(b,c){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:a.rev},b,c)}),getUrl:mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+
-a.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=b?"&page="+b:""))+window.location.hash})})})(b.entries[f]);a(d)}catch(l){c(l)}}));b["catch"](function(a){c(a)})};DropboxFile.prototype.getLatestVersion=function(a,c){this.ui.dropbox.getFile(this.getId(),a,c)};DropboxFile.prototype.updateDescriptor=function(a){this.stat=a.stat};DropboxFile.prototype.save=function(a,c,b,d,m){this.doSave(this.getTitle(),a,c,b,d,m)};DropboxFile.prototype.saveAs=function(a,c,b){this.doSave(a,!1,c,b)};
-DropboxFile.prototype.doSave=function(a,c,b,d,m,f){var l=this.stat.name;this.stat.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.stat.name=l;this.saveFile(a,c,b,d,m,f)}),d,m,f])};
-DropboxFile.prototype.saveFile=function(a,c,b,d){this.isEditable()?this.savingFile?null!=d&&d({code:App.ERROR_BUSY}):(c=mxUtils.bind(this,function(c){if(c){var f=null,l=null;try{f=this.isModified;l=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var m=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return l}});m();var p=mxUtils.bind(this,function(c){var g=this.stat.path_display.lastIndexOf("/"),g=1<g?this.stat.path_display.substring(1,g+1):null;this.ui.dropbox.saveFile(a,
-c,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=f;this.stat=a;this.contentChanged();null!=b&&b()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=f;this.setModified(l||this.isModified());if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){m();b()}}d(a)}}),g)});this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){p(this.ui.base64ToBlob(a,"image/png"))}),d,this.ui.getCurrentFile()!=
-this?this.getData():null):p(this.getData())}catch(u){if(this.savingFile=!1,null!=f&&(this.isModified=f),null!=l&&this.setModified(l||this.isModified()),null!=d)d(u);else throw u;}}else null!=d&&d()}),this.getTitle()==a?c(!0):this.ui.dropbox.checkExists(a,c)):null!=b&&b()};
+DropboxFile.prototype.getRevisions=function(a,c){var b=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});b.then(mxUtils.bind(this,function(b){try{for(var d=[],e=b.entries.length-1;0<=e;e--)mxUtils.bind(this,function(a){d.push({modifiedDate:a.client_modified,fileSize:a.size,getXml:mxUtils.bind(this,function(b,c){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:a.rev},b,c)}),getUrl:mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+
+a.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=b?"&page="+b:""))+window.location.hash})})})(b.entries[e]);a(d)}catch(k){c(k)}}));b["catch"](function(a){c(a)})};DropboxFile.prototype.getLatestVersion=function(a,c){this.ui.dropbox.getFile(this.getId(),a,c)};DropboxFile.prototype.updateDescriptor=function(a){this.stat=a.stat};DropboxFile.prototype.save=function(a,c,b,d,g){this.doSave(this.getTitle(),a,c,b,d,g)};DropboxFile.prototype.saveAs=function(a,c,b){this.doSave(a,!1,c,b)};
+DropboxFile.prototype.doSave=function(a,c,b,d,g,e){var k=this.stat.name;this.stat.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.stat.name=k;this.saveFile(a,c,b,d,g,e)}),d,g,e])};
+DropboxFile.prototype.saveFile=function(a,c,b,d){this.isEditable()?this.savingFile?null!=d&&d({code:App.ERROR_BUSY}):(c=mxUtils.bind(this,function(c){if(c){var e=null,g=null;try{e=this.isModified;g=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var m=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return g}});m();var n=mxUtils.bind(this,function(c){var f=this.stat.path_display.lastIndexOf("/"),f=1<f?this.stat.path_display.substring(1,f+1):null;this.ui.dropbox.saveFile(a,
+c,mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.stat=a;this.contentChanged();null!=b&&b()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(g||this.isModified());if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){m();b()}}d(a)}}),f)});this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){n(this.ui.base64ToBlob(a,"image/png"))}),d,this.ui.getCurrentFile()!=
+this?this.getData():null):n(this.getData())}catch(q){if(this.savingFile=!1,null!=e&&(this.isModified=e),null!=g&&this.setModified(g||this.isModified()),null!=d)d(q);else throw q;}}else null!=d&&d()}),this.getTitle()==a?c(!0):this.ui.dropbox.checkExists(a,c)):null!=b&&b()};
DropboxFile.prototype.rename=function(a,c,b){this.ui.dropbox.renameFile(this,a,mxUtils.bind(this,function(d){this.hasSameExtension(a,this.getTitle())?(this.stat=d,this.descriptorChanged(),null!=c&&c()):(this.stat=d,this.descriptorChanged(),this.save(!0,c,b))}),b)};DropboxLibrary=function(a,c,b){DropboxFile.call(this,a,c,b)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!0};DropboxLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};DropboxLibrary.prototype.open=function(){};DropboxClient=function(a){DrawioClient.call(this,a,"dbauth");this.client=new Dropbox({clientId:App.DROPBOX_APPKEY});this.client.setAccessToken(this.token)};mxUtils.extend(DropboxClient,DrawioClient);DropboxClient.prototype.appPath="/drawio/";DropboxClient.prototype.extension=".drawio";DropboxClient.prototype.writingFile=!1;DropboxClient.prototype.maxRetries=4;
DropboxClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null;this.client.authTokenRevoke().then(mxUtils.bind(this,function(){this.client.setAccessToken(null)}))};
-DropboxClient.prototype.updateUser=function(a,c,b){var d=!0,m=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),f=this.client.usersGetCurrentAccount();f.then(mxUtils.bind(this,function(b){window.clearTimeout(m);d&&(this.setUser(new DrawioUser(b.account_id,b.email,b.name.display_name)),a())}));f["catch"](mxUtils.bind(this,function(f){window.clearTimeout(m);d&&(null==f||401!==f.status||b?c({message:mxResources.get("accessDenied")}):(this.setUser(null),
+DropboxClient.prototype.updateUser=function(a,c,b){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),e=this.client.usersGetCurrentAccount();e.then(mxUtils.bind(this,function(b){window.clearTimeout(g);d&&(this.setUser(new DrawioUser(b.account_id,b.email,b.name.display_name)),a())}));e["catch"](mxUtils.bind(this,function(e){window.clearTimeout(g);d&&(null==e||401!==e.status||b?c({message:mxResources.get("accessDenied")}):(this.setUser(null),
this.client.setAccessToken(null),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)))}))};
-DropboxClient.prototype.authenticate=function(a,c){if(null==window.onDropboxCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(m,f){null!=window.open(this.client.getAuthenticationUrl("https://"+window.location.host+"/dropbox.html"),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(l,n){if(d){window.onDropboxCallback=null;d=!1;try{null==l?c({message:mxResources.get("accessDenied"),retry:b}):(null!=f&&f(),this.client.setAccessToken(l),
-this.setUser(null),m&&this.setPersistentToken(l),a())}catch(p){c(p)}finally{null!=n&&n.close()}}else null!=n&&n.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onDropboxCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};
-DropboxClient.prototype.executePromise=function(a,c,b){var d=mxUtils.bind(this,function(f){var l=!0,n=window.setTimeout(mxUtils.bind(this,function(){l=!1;b({code:App.ERROR_TIMEOUT,retry:m})}),this.ui.timeout);a.then(mxUtils.bind(this,function(a){window.clearTimeout(n);l&&null!=c&&c(a)}));a["catch"](mxUtils.bind(this,function(a){window.clearTimeout(n);l&&(null==a||500!=a.status&&400!=a.status&&401!=a.status?b({message:mxResources.get("error")+" "+a.status}):(this.setUser(null),this.client.setAccessToken(null),
-f?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){m(!0)},b)})}):this.authenticate(function(){d(!0)},b)))}))}),m=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){m(!0)},b,a):d(a)});null===this.client.getAccessToken()?this.authenticate(function(){m(!0)},b):m(!1)};DropboxClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!0)};
-DropboxClient.prototype.getFile=function(a,c,b,d){d=null!=d?d:!1;var m=/\.png$/i.test(a);if(/^https:\/\//i.test(a)||/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&m){var f=mxUtils.bind(this,function(){var d=a.split("/");this.ui.convertFile(a,0<d.length?d[d.length-1]:a,null,this.extension,c,b)});null!=this.token?f():this.authenticate(f,b)}else f={path:"/"+a},null!=urlParams.rev&&(f.rev=urlParams.rev),this.readFile(f,mxUtils.bind(this,function(b,f){var l=m?b.lastIndexOf(","):
--1,n=null;0<l&&(l=this.ui.extractGraphModelFromPng(b.substring(l+1)),null!=l&&0<l.length?b=l:n=new LocalFile(this,b,a,!0));c(null!=n?n:d?new DropboxLibrary(this.ui,b,f):new DropboxFile(this.ui,b,f))}),b,m)};
-DropboxClient.prototype.readFile=function(a,c,b,d){var m=mxUtils.bind(this,function(l){var n=!0,p=window.setTimeout(mxUtils.bind(this,function(){n=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),u=this.client.filesGetMetadata({path:"/"+a.path.substring(1),include_deleted:!1});u.then(mxUtils.bind(this,function(a){}));u["catch"](function(a){window.clearTimeout(p);n&&null!=a&&409==a.status&&(n=!1,b({message:mxResources.get("fileNotFound")}))});u=this.client.filesDownload(a);u.then(mxUtils.bind(this,
-function(a){window.clearTimeout(p);if(n){n=!1;try{var g=new FileReader;g.onload=mxUtils.bind(this,function(b){c(g.result,a)});d?g.readAsDataURL(a.fileBlob):g.readAsText(a.fileBlob)}catch(q){b(q)}}}));u["catch"](mxUtils.bind(this,function(a){window.clearTimeout(p);n&&(n=!1,null==a||500!=a.status&&400!=a.status&&401!=a.status?b({message:mxResources.get("error")+" "+a.status}):(this.client.setAccessToken(null),this.setUser(null),l?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){f(!0)},
-b)})}):this.authenticate(function(){m(!0)},b)))}))}),f=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){f(!0)},b,a):m(a)});null===this.client.getAccessToken()?this.authenticate(function(){f(!0)},b):f(!1)};
+DropboxClient.prototype.authenticate=function(a,c){if(null==window.onDropboxCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){null!=window.open(this.client.getAuthenticationUrl("https://"+window.location.host+"/dropbox.html"),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(k,m){if(d){window.onDropboxCallback=null;d=!1;try{null==k?c({message:mxResources.get("accessDenied"),retry:b}):(null!=e&&e(),this.client.setAccessToken(k),
+this.setUser(null),g&&this.setPersistentToken(k),a())}catch(n){c(n)}finally{null!=m&&m.close()}}else null!=m&&m.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onDropboxCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};
+DropboxClient.prototype.executePromise=function(a,c,b){var d=mxUtils.bind(this,function(e){var k=!0,m=window.setTimeout(mxUtils.bind(this,function(){k=!1;b({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout);a.then(mxUtils.bind(this,function(a){window.clearTimeout(m);k&&null!=c&&c(a)}));a["catch"](mxUtils.bind(this,function(a){window.clearTimeout(m);k&&(null==a||500!=a.status&&400!=a.status&&401!=a.status?b({message:mxResources.get("error")+" "+a.status}):(this.setUser(null),this.client.setAccessToken(null),
+e?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){g(!0)},b)})}):this.authenticate(function(){d(!0)},b)))}))}),g=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){g(!0)},b,a):d(a)});null===this.client.getAccessToken()?this.authenticate(function(){g(!0)},b):g(!1)};DropboxClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!0)};
+DropboxClient.prototype.getFile=function(a,c,b,d){d=null!=d?d:!1;var g=/\.png$/i.test(a);if(/^https:\/\//i.test(a)||/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&g){var e=mxUtils.bind(this,function(){var d=a.split("/");this.ui.convertFile(a,0<d.length?d[d.length-1]:a,null,this.extension,c,b)});null!=this.token?e():this.authenticate(e,b)}else e={path:"/"+a},null!=urlParams.rev&&(e.rev=urlParams.rev),this.readFile(e,mxUtils.bind(this,function(b,e){var k=g?b.lastIndexOf(","):
+-1,m=null;0<k&&(k=this.ui.extractGraphModelFromPng(b.substring(k+1)),null!=k&&0<k.length?b=k:m=new LocalFile(this,b,a,!0));c(null!=m?m:d?new DropboxLibrary(this.ui,b,e):new DropboxFile(this.ui,b,e))}),b,g)};
+DropboxClient.prototype.readFile=function(a,c,b,d){var g=mxUtils.bind(this,function(k){var m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),q=this.client.filesGetMetadata({path:"/"+a.path.substring(1),include_deleted:!1});q.then(mxUtils.bind(this,function(a){}));q["catch"](function(a){window.clearTimeout(n);m&&null!=a&&409==a.status&&(m=!1,b({message:mxResources.get("fileNotFound")}))});q=this.client.filesDownload(a);q.then(mxUtils.bind(this,
+function(a){window.clearTimeout(n);if(m){m=!1;try{var e=new FileReader;e.onload=mxUtils.bind(this,function(b){c(e.result,a)});d?e.readAsDataURL(a.fileBlob):e.readAsText(a.fileBlob)}catch(p){b(p)}}}));q["catch"](mxUtils.bind(this,function(a){window.clearTimeout(n);m&&(m=!1,null==a||500!=a.status&&400!=a.status&&401!=a.status?b({message:mxResources.get("error")+" "+a.status}):(this.client.setAccessToken(null),this.setUser(null),k?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},
+b)})}):this.authenticate(function(){g(!0)},b)))}))}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},b,a):g(a)});null===this.client.getAccessToken()?this.authenticate(function(){e(!0)},b):e(!1)};
DropboxClient.prototype.checkExists=function(a,c,b){var d=this.client.filesGetMetadata({path:"/"+a.toLowerCase(),include_deleted:!1});this.executePromise(d,mxUtils.bind(this,function(d){b?c(!1,!0,d):this.ui.confirm(mxResources.get("replaceIt",[a]),function(){c(!0,!0,d)},function(){c(!1,!0,d)})}),function(a){c(!0,!1)})};
-DropboxClient.prototype.renameFile=function(a,c,b,d){if(/[\\\/:\?\*"\|]/.test(c))d({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=a&&null!=c){var m=a.stat.path_display.substring(1),f=m.lastIndexOf("/");0<f&&(c=m.substring(0,f+1)+c)}null!=a&&null!=c&&a.stat.path_lower.substring(1)!==c.toLowerCase()?this.checkExists(c,mxUtils.bind(this,function(f,m,p){f?(f=mxUtils.bind(this,function(f){f=this.client.filesMove({from_path:a.stat.path_display,to_path:"/"+c,autorename:!1});this.executePromise(f,
-b,d)}),m&&p.path_lower.substring(1)!==c.toLowerCase()?(m=this.client.filesDelete({path:"/"+c.toLowerCase()}),this.executePromise(m,f,d)):f()):d()})):d({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(a,c,b,d){this.insertFile(a,c,b,d,!0)};
-DropboxClient.prototype.insertFile=function(a,c,b,d,m){m=null!=m?m:!1;this.checkExists(a,mxUtils.bind(this,function(f){f?this.saveFile(a,c,mxUtils.bind(this,function(a){m?b(new DropboxLibrary(this.ui,c,a)):b(new DropboxFile(this.ui,c,a))}),d):d()}))};
-DropboxClient.prototype.saveFile=function(a,c,b,d,m){/[\\\/:\?\*"\|]/.test(a)?d({message:mxResources.get("dropboxCharsNotAllowed")}):15E7<=c.length?d({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 150 MB)"}):(a=this.client.filesUpload({path:"/"+(null!=m?m:"")+a,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([c],{type:"text/plain"})}),this.executePromise(a,b,d))};
-DropboxClient.prototype.pickLibrary=function(a){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(c){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var b=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),d=c[0].link.indexOf(this.appPath);if(0<d){var m=decodeURIComponent(c[0].link.substring(d+this.appPath.length-1));this.readFile({path:m},mxUtils.bind(this,function(d,l){if(null!=l&&l.id==c[0].id)try{this.ui.spinner.stop(),
-a(m.substring(1),new DropboxLibrary(this.ui,d,l))}catch(n){this.ui.handleError(n)}else this.createLibrary(c[0],a,b)}),b)}else this.createLibrary(c[0],a,b)}})})};
-DropboxClient.prototype.createLibrary=function(a,c,b){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){this.ui.loadUrl(a.link,mxUtils.bind(this,function(d){this.insertFile(a.name,d,mxUtils.bind(this,function(a){try{this.ui.spinner.stop(),c(a.getHash().substring(1),a)}catch(f){b(f)}}),b,!0)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};
-DropboxClient.prototype.pickFile=function(a,c){null!=Dropbox.choose?(a=null!=a?a:mxUtils.bind(this,function(a,c){this.ui.loadFile(null!=a?"D"+encodeURIComponent(a):c.getHash(),null,c)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(b){if(this.ui.spinner.spin(document.body,mxResources.get("loading")))if(c)this.ui.spinner.stop(),a(b[0].link);else{var d=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),m=mxUtils.bind(this,
-function(b,c){this.ui.spinner.stop();a(b,c)}),f=/\.png$/i.test(b[0].name);if(/\.vsdx$/i.test(b[0].name)||/\.gliffy$/i.test(b[0].name)||!this.ui.useCanvasForExport&&f)m(b[0].link);else{var l=b[0].link.indexOf(this.appPath);if(0<l){var n=decodeURIComponent(b[0].link.substring(l+this.appPath.length-1));this.readFile({path:n},mxUtils.bind(this,function(c,l){if(null!=l&&l.id==b[0].id){var g=f?c.lastIndexOf(","):-1;this.ui.spinner.stop();var k=null;0<g&&(g=this.ui.extractGraphModelFromPng(c.substring(g+
-1)),null!=g&&0<g.length?c=g:k=new LocalFile(this,c,n,!0));a(n.substring(1),null!=k?k:new DropboxFile(this.ui,c,l))}else this.createFile(b[0],m,d)}),d,f)}else this.createFile(b[0],m,d)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};
-DropboxClient.prototype.createFile=function(a,c,b){var d=/(\.png)$/i.test(a.name);this.ui.loadUrl(a.link,mxUtils.bind(this,function(m){null!=m&&0<m.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){var f=d?m.lastIndexOf(","):-1;0<f&&(f=this.ui.extractGraphModelFromPng(m.substring(f+1)),null!=f&&0<f.length&&(m=f));this.insertFile(a.name,m,mxUtils.bind(this,function(b){c(a.name,b)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):
+DropboxClient.prototype.renameFile=function(a,c,b,d){if(/[\\\/:\?\*"\|]/.test(c))d({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=a&&null!=c){var g=a.stat.path_display.substring(1),e=g.lastIndexOf("/");0<e&&(c=g.substring(0,e+1)+c)}null!=a&&null!=c&&a.stat.path_lower.substring(1)!==c.toLowerCase()?this.checkExists(c,mxUtils.bind(this,function(e,g,n){e?(e=mxUtils.bind(this,function(e){e=this.client.filesMove({from_path:a.stat.path_display,to_path:"/"+c,autorename:!1});this.executePromise(e,
+b,d)}),g&&n.path_lower.substring(1)!==c.toLowerCase()?(g=this.client.filesDelete({path:"/"+c.toLowerCase()}),this.executePromise(g,e,d)):e()):d()})):d({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(a,c,b,d){this.insertFile(a,c,b,d,!0)};
+DropboxClient.prototype.insertFile=function(a,c,b,d,g){g=null!=g?g:!1;this.checkExists(a,mxUtils.bind(this,function(e){e?this.saveFile(a,c,mxUtils.bind(this,function(a){g?b(new DropboxLibrary(this.ui,c,a)):b(new DropboxFile(this.ui,c,a))}),d):d()}))};
+DropboxClient.prototype.saveFile=function(a,c,b,d,g){/[\\\/:\?\*"\|]/.test(a)?d({message:mxResources.get("dropboxCharsNotAllowed")}):15E7<=c.length?d({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 150 MB)"}):(a=this.client.filesUpload({path:"/"+(null!=g?g:"")+a,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([c],{type:"text/plain"})}),this.executePromise(a,b,d))};
+DropboxClient.prototype.pickLibrary=function(a){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(c){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var b=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),d=c[0].link.indexOf(this.appPath);if(0<d){var g=decodeURIComponent(c[0].link.substring(d+this.appPath.length-1));this.readFile({path:g},mxUtils.bind(this,function(d,k){if(null!=k&&k.id==c[0].id)try{this.ui.spinner.stop(),
+a(g.substring(1),new DropboxLibrary(this.ui,d,k))}catch(m){this.ui.handleError(m)}else this.createLibrary(c[0],a,b)}),b)}else this.createLibrary(c[0],a,b)}})})};
+DropboxClient.prototype.createLibrary=function(a,c,b){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){this.ui.loadUrl(a.link,mxUtils.bind(this,function(d){this.insertFile(a.name,d,mxUtils.bind(this,function(a){try{this.ui.spinner.stop(),c(a.getHash().substring(1),a)}catch(e){b(e)}}),b,!0)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};
+DropboxClient.prototype.pickFile=function(a,c){null!=Dropbox.choose?(a=null!=a?a:mxUtils.bind(this,function(a,c){this.ui.loadFile(null!=a?"D"+encodeURIComponent(a):c.getHash(),null,c)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(b){if(this.ui.spinner.spin(document.body,mxResources.get("loading")))if(c)this.ui.spinner.stop(),a(b[0].link);else{var d=mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError(a)}),g=mxUtils.bind(this,
+function(b,c){this.ui.spinner.stop();a(b,c)}),e=/\.png$/i.test(b[0].name);if(/\.vsdx$/i.test(b[0].name)||/\.gliffy$/i.test(b[0].name)||!this.ui.useCanvasForExport&&e)g(b[0].link);else{var k=b[0].link.indexOf(this.appPath);if(0<k){var m=decodeURIComponent(b[0].link.substring(k+this.appPath.length-1));this.readFile({path:m},mxUtils.bind(this,function(c,k){if(null!=k&&k.id==b[0].id){var f=e?c.lastIndexOf(","):-1;this.ui.spinner.stop();var l=null;0<f&&(f=this.ui.extractGraphModelFromPng(c.substring(f+
+1)),null!=f&&0<f.length?c=f:l=new LocalFile(this,c,m,!0));a(m.substring(1),null!=l?l:new DropboxFile(this.ui,c,k))}else this.createFile(b[0],g,d)}),d,e)}else this.createFile(b[0],g,d)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};
+DropboxClient.prototype.createFile=function(a,c,b){var d=/(\.png)$/i.test(a.name);this.ui.loadUrl(a.link,mxUtils.bind(this,function(g){null!=g&&0<g.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){var e=d?g.lastIndexOf(","):-1;0<e&&(e=this.ui.extractGraphModelFromPng(g.substring(e+1)),null!=e&&0<e.length&&(g=e));this.insertFile(a.name,g,mxUtils.bind(this,function(b){c(a.name,b)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):
(this.ui.spinner.stop(),b({message:mxResources.get("errorLoadingFile")}))}),b,d)};OneDriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.meta=b};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.getId=function(){return this.getIdOf(this.meta)};OneDriveFile.prototype.getParentId=function(){return this.getIdOf(this.meta,!0)};OneDriveFile.prototype.getIdOf=function(a,c){return(null!=a.parentReference&&null!=a.parentReference.driveId?a.parentReference.driveId+"/":"")+(null!=c?a.parentReference.id:a.id)};
OneDriveFile.prototype.getChannelId=function(){return"W-"+DrawioFile.prototype.getChannelId.apply(this,arguments)};OneDriveFile.prototype.getHash=function(){return"W"+encodeURIComponent(this.getId())};OneDriveFile.prototype.getMode=function(){return App.MODE_ONEDRIVE};OneDriveFile.prototype.isAutosaveOptional=function(){return!0};OneDriveFile.prototype.getTitle=function(){return this.meta.name};OneDriveFile.prototype.isRenamable=function(){return!0};OneDriveFile.prototype.isSyncSupported=function(){return!0};
OneDriveFile.prototype.getSize=function(){return this.meta.size};OneDriveFile.prototype.isConflict=function(a){return null!=a&&(412==a.getStatus()||409==a.getStatus())};OneDriveFile.prototype.getCurrentUser=function(){return null!=this.ui.oneDrive?this.ui.oneDrive.user:null};
OneDriveFile.prototype.loadDescriptor=function(a,c){this.ui.oneDrive.executeRequest(this.ui.oneDrive.getItemURL(this.getId()),mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):null!=c&&c()}),c)};OneDriveFile.prototype.getLatestVersion=function(a,c){this.ui.oneDrive.getFile(this.getId(),a,c)};OneDriveFile.prototype.getDescriptor=function(){return this.meta};OneDriveFile.prototype.setDescriptor=function(a){this.meta=a};
OneDriveFile.prototype.getDescriptorSecret=function(a){return null!=a.file&&null!=a.file.hashes&&null!=a.file.hashes.quickXorHash?a.file.hashes.quickXorHash:null};OneDriveFile.prototype.getDescriptorEtag=function(a){return a.eTag};OneDriveFile.prototype.setDescriptorEtag=function(a,c){a.eTag=c};
OneDriveFile.prototype.loadPatchDescriptor=function(a,c){var b=this.ui.oneDrive.getItemURL(this.getId());this.ui.oneDrive.executeRequest(b+"?select=etag,file",mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):c(this.ui.oneDrive.parseRequestText(b))}),c)};
-OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(a,c,b,d,m){this.doSave(this.getTitle(),a,c,b,d,m)};OneDriveFile.prototype.saveAs=function(a,c,b){this.doSave(a,!1,c,b)};
-OneDriveFile.prototype.doSave=function(a,c,b,d,m,f){var l=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=l;this.saveFile(a,c,b,d,m,f)}),d,m,f])};
-OneDriveFile.prototype.saveFile=function(a,c,b,d,m,f){if(!this.isEditable())null!=b&&b();else if(!this.savingFile)if(this.getTitle()==a){var l=mxUtils.bind(this,function(){var a=null,c=null;try{a=this.isModified;c=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var m=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return c}}),g=f||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),k=this.meta;
-m();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(c,f){this.isModified=a;this.savingFile=!1;this.meta=c;this.fileSaved(f,k,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b()}),d)}),mxUtils.bind(this,function(b,f){this.savingFile=!1;this.isModified=a;this.setModified(c||this.isModified());if(this.isConflict(f))this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.savingFileTime=new Date,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,
-function(){this.updateFileData();l()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d();else if(null!=d){if(null!=b&&null!=b.retry){var g=b.retry;b.retry=function(){m();g()}}d(b)}}),g)}catch(q){if(this.savingFile=!1,null!=a&&(this.isModified=a),null!=c&&this.setModified(c||this.isModified()),null!=d)d(q);else throw q;}});l()}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.oneDrive.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=
-!1;null!=b&&b();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))};OneDriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.oneDrive.renameFile(this,a,mxUtils.bind(this,function(m){this.hasSameExtension(a,this.getTitle())?(this.meta=m,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(m)):(this.meta=m,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
+OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(a,c,b,d,g){this.doSave(this.getTitle(),a,c,b,d,g)};OneDriveFile.prototype.saveAs=function(a,c,b){this.doSave(a,!1,c,b)};
+OneDriveFile.prototype.doSave=function(a,c,b,d,g,e){var k=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=k;this.saveFile(a,c,b,d,g,e)}),d,g,e])};
+OneDriveFile.prototype.saveFile=function(a,c,b,d,g,e){if(!this.isEditable())null!=b&&b();else if(!this.savingFile)if(this.getTitle()==a){var k=mxUtils.bind(this,function(){var a=null,c=null;try{a=this.isModified;c=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var g=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return c}}),f=e||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),l=this.meta;
+g();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(c,e){this.isModified=a;this.savingFile=!1;this.meta=c;this.fileSaved(e,l,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b()}),d)}),mxUtils.bind(this,function(b,e){this.savingFile=!1;this.isModified=a;this.setModified(c||this.isModified());if(this.isConflict(e))this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.savingFileTime=new Date,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,
+function(){this.updateFileData();k()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d();else if(null!=d){if(null!=b&&null!=b.retry){var f=b.retry;b.retry=function(){g();f()}}d(b)}}),f)}catch(p){if(this.savingFile=!1,null!=a&&(this.isModified=a),null!=c&&this.setModified(c||this.isModified()),null!=d)d(p);else throw p;}});k()}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.oneDrive.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=
+!1;null!=b&&b();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))};OneDriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.oneDrive.renameFile(this,a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.meta=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(g)):(this.meta=g,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
OneDriveFile.prototype.move=function(a,c,b){this.ui.oneDrive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.meta=a;this.descriptorChanged();null!=c&&c(a)}),b)};OneDriveLibrary=function(a,c,b){OneDriveFile.call(this,a,c,b)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(a,c,b){this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(a){this.desc=a;null!=c&&c(a)}),b)};OneDriveLibrary.prototype.open=function(){};OneDriveClient=function(a){DrawioClient.call(this,a,"oneDriveAuthInfo");a=JSON.parse(this.token);null!=a&&(this.token=a.access_token,this.endpointHint=a.endpointHint,this.tokenExpiresOn=a.expiresOn,a=(this.tokenExpiresOn-Date.now())/1E3,this.resetTokenRefresh(600>a?1:a))};mxUtils.extend(OneDriveClient,DrawioClient);OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"2e598409-107f-4b59-89ca-d7723c8e00a4":"45c10911-200f-4e27-a666-9e9fca147395");
OneDriveClient.prototype.scopes="user.read files.readwrite.all offline_access";OneDriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/microsoft";OneDriveClient.prototype.pickerRedirectUri=window.location.protocol+"//"+window.location.host+"/onedrive3.html";OneDriveClient.prototype.defEndpointHint="api.onedrive.com";OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint;OneDriveClient.prototype.extension=".drawio";
OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];OneDriveClient.prototype.isValidFilename=function(a){if(null==a||""===a)return!1;for(var c=0;c<this.invalidFilenameRegExs.length;c++)if(this.invalidFilenameRegExs[c].test(a))return!1;return!0};
OneDriveClient.prototype.get=function(a,c,b){a=new mxXmlRequest(a,null,"GET");a.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Authorization","Bearer "+this.token)});a.send(c,b);return a};
-OneDriveClient.prototype.updateUser=function(a,c,b){var d=!0,m=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,function(f){window.clearTimeout(m);d&&(200>f.getStatus()||300<=f.getStatus()?b?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):(f=JSON.parse(f.getText()),this.setUser(new DrawioUser(f.id,null,f.displayName)),
+OneDriveClient.prototype.updateUser=function(a,c,b){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,function(e){window.clearTimeout(g);d&&(200>e.getStatus()||300<=e.getStatus()?b?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):(e=JSON.parse(e.getText()),this.setUser(new DrawioUser(e.id,null,e.displayName)),
a()))}),c)};OneDriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<a&&(this.tokenRefreshInterval=1E3*a,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0)}),900*a))};
-OneDriveClient.prototype.authenticate=function(a,c,b){if(null==window.onOneDriveCallback){var d=mxUtils.bind(this,function(){var m=!0,f=JSON.parse(this.getPersistentToken(!0));null!=f?(new mxXmlRequest(this.redirectUri+"?refresh_token="+f.refresh_token,null,"GET")).send(mxUtils.bind(this,function(f){200<=f.getStatus()&&299>=f.getStatus()?(f=JSON.parse(f.getText()),this.token=f.access_token,f.access_token=f.access_token,f.refresh_token=f.refresh_token,f.expiresOn=Date.now()+1E3*f.expires_in,this.tokenExpiresOn=
-f.expiresOn,this.setPersistentToken(JSON.stringify(f),!f.remember),this.resetTokenRefresh(f.expires_in),a()):(this.clearPersistentToken(),this.setUser(null),this.token=null,401!=f.getStatus()||b?c({message:mxResources.get("accessDenied"),retry:d}):d())}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,f){var l="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes),
-l=window.open(l,"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=l&&(window.onOneDriveCallback=mxUtils.bind(this,function(l,g){if(m){window.onOneDriveCallback=null;m=!1;try{null==l?c({message:mxResources.get("accessDenied"),retry:d}):(null!=f&&f(),this.setUser(null),this.token=l.access_token,l.expiresOn=Date.now()+1E3*
-l.expires_in,this.tokenExpiresOn=l.expiresOn,l.remember=b,this.setPersistentToken(JSON.stringify(l),!b),this.resetTokenRefresh(l.expires_in),this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){a()}),c))}catch(k){c(k)}finally{null!=g&&g.close()}}else null!=g&&g.close()}),l.focus())}),mxUtils.bind(this,function(){m&&(window.onOneDriveCallback=null,m=!1,c({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else c({code:App.ERROR_BUSY})};
-OneDriveClient.prototype.getAccountTypeAndEndpoint=function(a,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(b){try{if(200<=b.getStatus()&&299>=b.getStatus()){var d=JSON.parse(b.getText());0<d.webUrl.indexOf(".sharepoint.com")?this.endpointHint=d.webUrl:this.endpointHint=this.defEndpointHint;var m=JSON.parse(this.getPersistentToken(!0));null!=m&&(m.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(m),!m.remember));a();return}}catch(f){}c({message:mxResources.get("unknownError")+
+OneDriveClient.prototype.authenticate=function(a,c,b){if(null==window.onOneDriveCallback){var d=mxUtils.bind(this,function(){var g=!0,e=JSON.parse(this.getPersistentToken(!0));null!=e?(new mxXmlRequest(this.redirectUri+"?refresh_token="+e.refresh_token,null,"GET")).send(mxUtils.bind(this,function(e){200<=e.getStatus()&&299>=e.getStatus()?(e=JSON.parse(e.getText()),this.token=e.access_token,e.access_token=e.access_token,e.refresh_token=e.refresh_token,e.expiresOn=Date.now()+1E3*e.expires_in,this.tokenExpiresOn=
+e.expiresOn,this.setPersistentToken(JSON.stringify(e),!e.remember),this.resetTokenRefresh(e.expires_in),a()):(this.clearPersistentToken(),this.setUser(null),this.token=null,401!=e.getStatus()||b?c({message:mxResources.get("accessDenied"),retry:d}):d())}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,e){var k="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes),
+k=window.open(k,"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=k&&(window.onOneDriveCallback=mxUtils.bind(this,function(k,f){if(g){window.onOneDriveCallback=null;g=!1;try{null==k?c({message:mxResources.get("accessDenied"),retry:d}):(null!=e&&e(),this.setUser(null),this.token=k.access_token,k.expiresOn=Date.now()+1E3*
+k.expires_in,this.tokenExpiresOn=k.expiresOn,k.remember=b,this.setPersistentToken(JSON.stringify(k),!b),this.resetTokenRefresh(k.expires_in),this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){a()}),c))}catch(l){c(l)}finally{null!=f&&f.close()}}else null!=f&&f.close()}),k.focus())}),mxUtils.bind(this,function(){g&&(window.onOneDriveCallback=null,g=!1,c({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else c({code:App.ERROR_BUSY})};
+OneDriveClient.prototype.getAccountTypeAndEndpoint=function(a,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(b){try{if(200<=b.getStatus()&&299>=b.getStatus()){var d=JSON.parse(b.getText());0<d.webUrl.indexOf(".sharepoint.com")?this.endpointHint=d.webUrl:this.endpointHint=this.defEndpointHint;var g=JSON.parse(this.getPersistentToken(!0));null!=g&&(g.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(g),!g.remember));a();return}}catch(e){}c({message:mxResources.get("unknownError")+
" (Code: "+b.getStatus()+")"})}),c)};
-OneDriveClient.prototype.executeRequest=function(a,c,b){var d=mxUtils.bind(this,function(m){var f=!0,l=window.setTimeout(mxUtils.bind(this,function(){f=!1;b({code:App.ERROR_TIMEOUT,retry:d})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(l);f&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(a)):m||401!==a.getStatus()&&400!==a.getStatus()?b(this.parseRequestText(a)):this.authenticate(function(){d(!0)},
-b,m))}),b)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){d(!0)},b):d(!1)};OneDriveClient.prototype.checkToken=function(a){null==this.token||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(a,this.emptyFn):a()};OneDriveClient.prototype.getItemRef=function(a){var c=a.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:a}};
+OneDriveClient.prototype.executeRequest=function(a,c,b){var d=mxUtils.bind(this,function(g){var e=!0,k=window.setTimeout(mxUtils.bind(this,function(){e=!1;b({code:App.ERROR_TIMEOUT,retry:d})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(k);e&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(a)):g||401!==a.getStatus()&&400!==a.getStatus()?b(this.parseRequestText(a)):this.authenticate(function(){d(!0)},
+b,g))}),b)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){d(!0)},b):d(!1)};OneDriveClient.prototype.checkToken=function(a){null==this.token||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(a,this.emptyFn):a()};OneDriveClient.prototype.getItemRef=function(a){var c=a.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:a}};
OneDriveClient.prototype.getItemURL=function(a,c){var b=a.split("/");return 1<b.length?(c?"":this.baseUrl)+"/drives/"+b[0]+"/items/"+b[1]:(c?"":this.baseUrl)+"/me/drive/items/"+a};OneDriveClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!1,!0)};
-OneDriveClient.prototype.getFile=function(a,c,b,d,m){m=null!=m?m:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var d=JSON.parse(a.getText()),f=/\.png$/i.test(d.name);if(/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&f)this.ui.convertFile(d["@microsoft.graph.downloadUrl"],d.name,null!=d.file?d.file.mimeType:null,this.extension,c,b);else{var p=!0,u=window.setTimeout(mxUtils.bind(this,function(){p=
-!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.loadUrl(d["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){try{if(window.clearTimeout(u),p){var g=f?a.lastIndexOf(","):-1,l=null;if(0<g){var n=this.ui.extractGraphModelFromPng(a.substring(g+1));null!=n&&0<n.length?a=n:l=new LocalFile(this.ui,a,d.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var y=a.substring(22);a=window.atob&&!mxClient.IS_SF?atob(y):Base64.decode(y)}Graph.fileSupport&&(new XMLHttpRequest).upload&&
-this.ui.isRemoteFileFormat(a,d["@microsoft.graph.downloadUrl"])?this.ui.parseFile(new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){try{4==a.readyState&&(200<=a.status&&299>=a.status?c(new LocalFile(this.ui,a.responseText,d.name+this.extension,!0)):null!=b&&b({message:mxResources.get("errorLoadingFile")}))}catch(A){if(null!=b)b(A);else throw A;}}),d.name):null!=l?c(l):m?c(new OneDriveLibrary(this.ui,a,d)):c(new OneDriveFile(this.ui,a,d))}}catch(t){if(null!=b)b(t);else throw t;
-}}),mxUtils.bind(this,function(a){window.clearTimeout(u);p&&b(this.parseRequestText(a))}),f||null!=d.file&&null!=d.file.mimeType&&"image/"==d.file.mimeType.substring(0,6))}}else b(this.parseRequestText(a))}),b)};
-OneDriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&(this.isValidFilename(c)?this.checkExists(a.getParentId(),c,!1,mxUtils.bind(this,function(m){m?this.writeFile(this.getItemURL(a.getId()),JSON.stringify({name:c}),"PATCH","application/json",b,d):d()})):d({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};
-OneDriveClient.prototype.moveFile=function(a,c,b,d){c=this.getItemRef(c);var m=this.getItemRef(a);c.driveId!=m.driveId?d({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(a),JSON.stringify({parentReference:c}),"PATCH","application/json",b,d)};OneDriveClient.prototype.insertLibrary=function(a,c,b,d,m){this.insertFile(a,c,b,d,!0,m)};
-OneDriveClient.prototype.insertFile=function(a,c,b,d,m,f){this.isValidFilename(a)?(m=null!=m?m:!1,this.checkExists(f,a,!0,mxUtils.bind(this,function(l){l?(l="/me/drive/root",null!=f&&(l=this.getItemURL(f,!0)),l=this.baseUrl+l+"/children/"+encodeURIComponent(a)+"/content",this.writeFile(l,c,"PUT",null,mxUtils.bind(this,function(a){m?b(new OneDriveLibrary(this.ui,c,a)):b(new OneDriveFile(this.ui,c,a))}),d)):d()}))):d({message:this.invalidFilenameRegExs[0].test(a)?mxResources.get("oneDriveCharsNotAllowed"):
+OneDriveClient.prototype.getFile=function(a,c,b,d,g){g=null!=g?g:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var d=JSON.parse(a.getText()),e=/\.png$/i.test(d.name);if(/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&e)this.ui.convertFile(d["@microsoft.graph.downloadUrl"],d.name,null!=d.file?d.file.mimeType:null,this.extension,c,b);else{var n=!0,q=window.setTimeout(mxUtils.bind(this,function(){n=
+!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.loadUrl(d["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){try{if(window.clearTimeout(q),n){var f=e?a.lastIndexOf(","):-1,k=null;if(0<f){var m=this.ui.extractGraphModelFromPng(a.substring(f+1));null!=m&&0<m.length?a=m:k=new LocalFile(this.ui,a,d.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var v=a.substring(22);a=window.atob&&!mxClient.IS_SF?atob(v):Base64.decode(v)}Graph.fileSupport&&(new XMLHttpRequest).upload&&
+this.ui.isRemoteFileFormat(a,d["@microsoft.graph.downloadUrl"])?this.ui.parseFile(new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){try{4==a.readyState&&(200<=a.status&&299>=a.status?c(new LocalFile(this.ui,a.responseText,d.name+this.extension,!0)):null!=b&&b({message:mxResources.get("errorLoadingFile")}))}catch(z){if(null!=b)b(z);else throw z;}}),d.name):null!=k?c(k):g?c(new OneDriveLibrary(this.ui,a,d)):c(new OneDriveFile(this.ui,a,d))}}catch(t){if(null!=b)b(t);else throw t;
+}}),mxUtils.bind(this,function(a){window.clearTimeout(q);n&&b(this.parseRequestText(a))}),e||null!=d.file&&null!=d.file.mimeType&&"image/"==d.file.mimeType.substring(0,6))}}else b(this.parseRequestText(a))}),b)};
+OneDriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&(this.isValidFilename(c)?this.checkExists(a.getParentId(),c,!1,mxUtils.bind(this,function(g){g?this.writeFile(this.getItemURL(a.getId()),JSON.stringify({name:c}),"PATCH","application/json",b,d):d()})):d({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};
+OneDriveClient.prototype.moveFile=function(a,c,b,d){c=this.getItemRef(c);var g=this.getItemRef(a);c.driveId!=g.driveId?d({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(a),JSON.stringify({parentReference:c}),"PATCH","application/json",b,d)};OneDriveClient.prototype.insertLibrary=function(a,c,b,d,g){this.insertFile(a,c,b,d,!0,g)};
+OneDriveClient.prototype.insertFile=function(a,c,b,d,g,e){this.isValidFilename(a)?(g=null!=g?g:!1,this.checkExists(e,a,!0,mxUtils.bind(this,function(k){k?(k="/me/drive/root",null!=e&&(k=this.getItemURL(e,!0)),k=this.baseUrl+k+"/children/"+encodeURIComponent(a)+"/content",this.writeFile(k,c,"PUT",null,mxUtils.bind(this,function(a){g?b(new OneDriveLibrary(this.ui,c,a)):b(new OneDriveFile(this.ui,c,a))}),d)):d()}))):d({message:this.invalidFilenameRegExs[0].test(a)?mxResources.get("oneDriveCharsNotAllowed"):
mxResources.get("oneDriveInvalidDeviceName")})};
-OneDriveClient.prototype.checkExists=function(a,c,b,d){var m="/me/drive/root";null!=a&&(m=this.getItemURL(a,!0));this.executeRequest(this.baseUrl+m+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(a){404==a.getStatus()?d(!0):b?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){d(!0)},function(){d(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)}))}),function(a){d(!1)},
-!0)};OneDriveClient.prototype.saveFile=function(a,c,b,d){try{var m=a.getData(),f=mxUtils.bind(this,function(f){var l=this.getItemURL(a.getId());this.writeFile(l+"/content/",f,"PUT",null,mxUtils.bind(this,function(a){c(a,m)}),b,d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){f(this.ui.base64ToBlob(a,"image/png"))}),b,this.ui.getCurrentFile()!=a?m:null):f(m)}catch(l){b(l)}};
-OneDriveClient.prototype.writeFile=function(a,c,b,d,m,f,l){try{if(null!=a&&null!=c){var n=mxUtils.bind(this,function(p){try{var u=!0,g=window.setTimeout(mxUtils.bind(this,function(){u=!1;f({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout),k=new mxXmlRequest(a,c,b);k.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Content-Type",d||" ");a.setRequestHeader("Authorization","Bearer "+this.token);null!=l&&a.setRequestHeader("If-Match",l)});k.send(mxUtils.bind(this,function(a){window.clearTimeout(g);
-u&&(200<=a.getStatus()&&299>=a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),m(JSON.parse(a.getText()))):p||401!==a.getStatus()?f(this.parseRequestText(a),a):this.authenticate(function(){n(!0)},f,p))}),mxUtils.bind(this,function(a){window.clearTimeout(g);u&&f(this.parseRequestText(a))}))}catch(q){f(q)}});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){n(!0)},f):n(!1)}else f({message:mxResources.get("unknownError")})}catch(p){f(p)}};
+OneDriveClient.prototype.checkExists=function(a,c,b,d){var g="/me/drive/root";null!=a&&(g=this.getItemURL(a,!0));this.executeRequest(this.baseUrl+g+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(a){404==a.getStatus()?d(!0):b?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){d(!0)},function(){d(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)}))}),function(a){d(!1)},
+!0)};OneDriveClient.prototype.saveFile=function(a,c,b,d){try{var g=a.getData(),e=mxUtils.bind(this,function(e){var k=this.getItemURL(a.getId());this.writeFile(k+"/content/",e,"PUT",null,mxUtils.bind(this,function(a){c(a,g)}),b,d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(this.ui.base64ToBlob(a,"image/png"))}),b,this.ui.getCurrentFile()!=a?g:null):e(g)}catch(k){b(k)}};
+OneDriveClient.prototype.writeFile=function(a,c,b,d,g,e,k){try{if(null!=a&&null!=c){var m=mxUtils.bind(this,function(n){try{var q=!0,f=window.setTimeout(mxUtils.bind(this,function(){q=!1;e({code:App.ERROR_TIMEOUT,retry:m})}),this.ui.timeout),l=new mxXmlRequest(a,c,b);l.setRequestHeaders=mxUtils.bind(this,function(a,b){a.setRequestHeader("Content-Type",d||" ");a.setRequestHeader("Authorization","Bearer "+this.token);null!=k&&a.setRequestHeader("If-Match",k)});l.send(mxUtils.bind(this,function(a){window.clearTimeout(f);
+q&&(200<=a.getStatus()&&299>=a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),g(JSON.parse(a.getText()))):n||401!==a.getStatus()?e(this.parseRequestText(a),a):this.authenticate(function(){m(!0)},e,n))}),mxUtils.bind(this,function(a){window.clearTimeout(f);q&&e(this.parseRequestText(a))}))}catch(p){e(p)}});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){m(!0)},e):m(!1)}else e({message:mxResources.get("unknownError")})}catch(n){e(n)}};
OneDriveClient.prototype.parseRequestText=function(a){var c={message:mxResources.get("unknownError")};try{c=JSON.parse(a.getText())}catch(b){}return c};OneDriveClient.prototype.pickLibrary=function(a){this.pickFile(function(c){a(c)})};
OneDriveClient.prototype.pickFolder=function(a,c){var b=mxUtils.bind(this,function(b){var c=mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(b){a(b);mxClient.IS_IE11&&(this.token=b.accessToken)}),cancel:mxUtils.bind(this,function(){}),
error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})});b?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){a({value:[{id:"root",name:"root",parentReference:{driveId:"me"}}]})}),c,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){b(!1)}),this.emptyFn):b(c)};
@@ -8950,106 +8960,108 @@ OneDriveClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,func
300,140,!0,!0)}),this.emptyFn):c()};OneDriveClient.prototype.logout=function(){if(isLocalStorage){var a=localStorage.getItem("odpickerv7cache");null!=a&&'{"odsdkLoginHint":{'==a.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}this.clearPersistentToken();this.setUser(null);this.token=null};GitHubFile=function(a,c,b){DrawioFile.call(this,a,c);this.meta=b;this.peer=this.ui.gitHub};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.getId=function(){return encodeURIComponent(this.meta.org)+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitHubFile.prototype.getHash=function(){return encodeURIComponent("H"+this.getId())};
GitHubFile.prototype.getPublicUrl=function(a){null!=this.meta.download_url?mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(c){a(200<=c.getStatus()&&299>=c.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){a(null)})):a(null)};GitHubFile.prototype.isConflict=function(a){return null!=a&&409==a.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name};
GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(a,c){this.peer.getFile(this.getId(),a,c)};GitHubFile.prototype.isCompressedStorage=function(){return!1};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(a){this.meta=a};GitHubFile.prototype.getDescriptorEtag=function(a){return a.sha};GitHubFile.prototype.setDescriptorEtag=function(a,c){a.sha=c};
-GitHubFile.prototype.save=function(a,c,b,d,m,f){this.doSave(this.getTitle(),c,b,d,m,f)};GitHubFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};GitHubFile.prototype.doSave=function(a,c,b,d,m,f){var l=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=l;this.saveFile(a,!1,c,b,d,m,f)}),b,d,m])};
-GitHubFile.prototype.saveFile=function(a,c,b,d,m,f,l){if(this.isEditable())if(this.savingFile)null!=d&&d({code:App.ERROR_BUSY});else{var n=mxUtils.bind(this,function(c){if(this.getTitle()==a){var l=null,g=null;try{l=this.isModified;g=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return g}}),m=this.getCurrentEtag(),p=this.data;k();this.peer.saveFile(this,mxUtils.bind(this,function(a){this.savingFile=
-!1;this.isModified=l;this.setDescriptorEtag(this.meta,a);this.fileSaved(p,m,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b()}),d)}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=l;this.setModified(g||this.isModified());if(this.isConflict(a))this.inConflictState=!0,null!=d&&d({commitMessage:c});else if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){k();b()}}d(a)}}),f,c)}catch(y){if(this.savingFile=!1,null!=l&&(this.isModified=l),null!=g&&this.setModified(g||
-this.isModified()),null!=d)d(y);else throw y;}}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(f){this.peer.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=b&&b();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,f,c)}))});null!=l?n(l):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(a){n(a)}),
+GitHubFile.prototype.save=function(a,c,b,d,g,e){this.doSave(this.getTitle(),c,b,d,g,e)};GitHubFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};GitHubFile.prototype.doSave=function(a,c,b,d,g,e){var k=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=k;this.saveFile(a,!1,c,b,d,g,e)}),b,d,g])};
+GitHubFile.prototype.saveFile=function(a,c,b,d,g,e,k){if(this.isEditable())if(this.savingFile)null!=d&&d({code:App.ERROR_BUSY});else{var m=mxUtils.bind(this,function(c){if(this.getTitle()==a){var g=null,f=null;try{g=this.isModified;f=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}}),n=this.getCurrentEtag(),m=this.data;k();this.peer.saveFile(this,mxUtils.bind(this,function(a){this.savingFile=
+!1;this.isModified=g;this.setDescriptorEtag(this.meta,a);this.fileSaved(m,n,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b()}),d)}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=g;this.setModified(f||this.isModified());if(this.isConflict(a))this.inConflictState=!0,null!=d&&d({commitMessage:c});else if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){k();b()}}d(a)}}),e,c)}catch(v){if(this.savingFile=!1,null!=g&&(this.isModified=g),null!=f&&this.setModified(f||
+this.isModified()),null!=d)d(v);else throw v;}}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(e){this.peer.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=b&&b();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,e,c)}))});null!=k?m(k):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(a){m(a)}),
d)}else null!=b&&b()};GitHubLibrary=function(a,c,b){GitHubFile.call(this,a,c,b)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};GitHubLibrary.prototype.open=function(){};GitHubClient=function(a,c){DrawioClient.call(this,a,c||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"23bc97120b9035515661":"89c9e4624ca416554489";GitHubClient.prototype.scope="repo";GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl="https://api.github.com";GitHubClient.prototype.maxFileSize=1E6;
-GitHubClient.prototype.updateUser=function(a,c,b){var d=!0,m=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(this.baseUrl+"/user?access_token="+this.token,mxUtils.bind(this,function(f){window.clearTimeout(m);d&&(401===f.getStatus()?b?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):200>f.getStatus()||300<=f.getStatus()?
-c({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(f.getText()))),a()))}))};GitHubClient.prototype.createUser=function(a){return new DrawioUser(a.id,a.email,a.name)};
-GitHubClient.prototype.authenticate=function(a,c){if(null==window.onGitHubCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(m,f){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(l,n){if(d)if(window.onGitHubCallback=null,d=!1,null==l)c({message:mxResources.get("accessDenied"),retry:b});else{var p=mxUtils.bind(this,function(){var b=
-!0,d=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT,retry:p})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+l,mxUtils.bind(this,function(g){window.clearTimeout(d);if(b)try{if(200>g.getStatus()||300<=g.getStatus())c({message:mxResources.get("cannotLogin")});else{null!=f&&f();var l=g.getText();this.token=l.substring(l.indexOf("=")+1,l.indexOf("&"));this.setUser(null);m&&this.setPersistentToken(this.token);a()}}catch(v){c(v)}finally{null!=n&&
-n.close()}}))});p()}else null!=n&&n.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onGitHubCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(a,c){try{var b=JSON.parse(a.getText());null!=b&&null!=b.message&&(c=b.message)}catch(d){}return c};
-GitHubClient.prototype.executeRequest=function(a,c,b,d){var m=mxUtils.bind(this,function(l){var n=!0,p=window.setTimeout(mxUtils.bind(this,function(){n=!1;b({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),u=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+u)};a.send(mxUtils.bind(this,function(){window.clearTimeout(p);if(n)if(200<=a.getStatus()&&299>=a.getStatus()||d&&404==a.getStatus())c(a);else if(401===a.getStatus())l?b({code:a.getStatus(),message:mxResources.get("accessDenied"),
-retry:mxUtils.bind(this,function(){this.authenticate(function(){f(!0)},b)})}):this.authenticate(function(){m(!0)},b);else if(403===a.getStatus()){var g=!1;try{var k=JSON.parse(a.getText());null!=k&&null!=k.errors&&0<k.errors.length&&(g="too_large"==k.errors[0].code)}catch(q){}b({message:mxResources.get(g?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?b({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("fileNotFound"))}):409===a.getStatus()?b({code:a.getStatus(),status:409}):
-b({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),b)}),f=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){f(!0)},b,a):m(a)});null==this.token?this.authenticate(function(){f(!0)},b):f(!1)};GitHubClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!0)};
-GitHubClient.prototype.getSha=function(a,c,b,d,m,f){var l="&t="+(new Date).getTime();a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+c+"/contents/"+b+"?ref="+d+l,null,"HEAD");this.executeRequest(a,mxUtils.bind(this,function(a){try{m(a.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(p){f(p)}}),f)};
-GitHubClient.prototype.getFile=function(a,c,b,d,m){d=null!=d?d:!1;var f=a.split("/"),l=f[0],n=f[1],p=f[2];a=f.slice(3,f.length).join("/");f=/\.png$/i.test(a);!m&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&f)?null!=this.token?(m=this.baseUrl+"/repos/"+l+"/"+n+"/contents/"+a+"?ref="+p+"&token="+this.token,f=a.split("/"),this.ui.convertFile(m,0<f.length?f[f.length-1]:a,null,this.extension,c,b)):b({message:mxResources.get("accessDenied")}):(m="&t="+(new Date).getTime(),
-a=new mxXmlRequest(this.baseUrl+"/repos/"+l+"/"+n+"/contents/"+a+"?ref="+p+m,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{c(this.createGitHubFile(l,n,p,JSON.parse(a.getText()),d))}catch(g){b(g)}}),b))};
-GitHubClient.prototype.createGitHubFile=function(a,c,b,d,m){a={org:a,repo:c,ref:b,name:d.name,path:d.path,sha:d.sha,html_url:d.html_url,download_url:d.download_url};c=d.content;"base64"===d.encoding&&(/\.jpe?g$/i.test(d.name)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(d.name)?c="data:image/gif;base64,"+c:/\.png$/i.test(d.name)?(d=this.ui.extractGraphModelFromPng(c),c=null!=d&&0<d.length?d:"data:image/png;base64,"+c):c=Base64.decode(c));return m?new GitHubLibrary(this.ui,c,a):new GitHubFile(this.ui,
-c,a)};GitHubClient.prototype.insertLibrary=function(a,c,b,d,m){this.insertFile(a,c,b,d,!0,m,!1)};
-GitHubClient.prototype.insertFile=function(a,c,b,d,m,f,l){m=null!=m?m:!1;f=f.split("/");var n=f[0],p=f[1],u=f[2],g=f.slice(3,f.length).join("/");0<g.length&&(g+="/");g+=a;this.checkExists(n+"/"+p+"/"+u+"/"+g,!0,mxUtils.bind(this,function(f,q){f?m?(l||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(n,p,u,g,a,c,q,mxUtils.bind(this,function(a){try{var c=JSON.parse(a.getText());b(this.createGitHubFile(n,p,u,c.content,m))}catch(A){d(A)}}),d)}),d)):b(new GitHubFile(this.ui,
-c,{org:n,repo:p,ref:u,name:a,path:g,sha:q,isNew:!0})):d()}))};GitHubClient.prototype.showCommitDialog=function(a,c,b,d){var m=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(c?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){m();b(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){d()}),null,280);this.ui.showDialog(a.container,400,80,!0,!1);a.init()};
-GitHubClient.prototype.writeFile=function(a,c,b,d,m,f,l,n,p){f.length>=this.maxFileSize?p({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(f.length)+" / 1 MB)"}):(b={path:d,branch:decodeURIComponent(b),message:m,content:f},null!=l&&(b.sha=l),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+c+"/contents/"+d,JSON.stringify(b),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){n(a)}),mxUtils.bind(this,function(a){404==a.code&&(a.helpLink="https://github.com/settings/connections/applications/"+
-this.clientId,a.code=null);p(a)})))};
-GitHubClient.prototype.checkExists=function(a,c,b){var d=a.split("/"),m=d[0],f=d[1],l=d[2];a=d.slice(3,d.length).join("/");this.getSha(m,f,a,l,mxUtils.bind(this,function(d){if(c){var f=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){f();b(!0,d)},function(){f();b(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){b(!1)})}),mxUtils.bind(this,function(a){b(!0)}),null,!0)};
-GitHubClient.prototype.saveFile=function(a,c,b,d,m){var f=a.meta.org,l=a.meta.repo,n=a.meta.ref,p=a.meta.path,u=mxUtils.bind(this,function(d,g){this.writeFile(f,l,n,p,m,g,d,mxUtils.bind(this,function(b){delete a.meta.isNew;c(JSON.parse(b.getText()).content.sha)}),mxUtils.bind(this,function(a){b(a)}))}),g=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(p)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){u(a.meta.sha,b)}),b,this.ui.getCurrentFile()!=a?a.getData():null):
-u(a.meta.sha,Base64.encode(a.getData()))});d?this.getSha(f,l,p,n,mxUtils.bind(this,function(b){a.meta.sha=b;g()}),b):g()};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)};
-GitHubClient.prototype.showGitHubDialog=function(a,c){var b=null,d=null,m=null,f=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(n);var p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.border="1px solid lightgray";p.style.boxSizing=
-"border-box";p.style.padding="4px";p.style.overflow="auto";p.style.lineHeight="1.2em";p.style.height="274px";l.appendChild(p);var u=document.createElement("div");u.style.textOverflow="ellipsis";u.style.boxSizing="border-box";u.style.overflow="hidden";u.style.padding="4px";u.style.width="100%";var g=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){c(b+"/"+d+"/"+encodeURIComponent(m)+"/"+f)}));this.ui.showDialog(g.container,420,360,!0,!0);a&&g.okButton.parentNode.removeChild(g.okButton);var k=
-mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=u.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),q=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(k(b+"/"+d,mxUtils.bind(this,function(){f=null;D()})));a||(mxUtils.write(c," / "),c.appendChild(k(decodeURIComponent(m),mxUtils.bind(this,
-function(){f=null;z()}))));if(null!=f&&0<f.length){var g=f.split("/");for(a=0;a<g.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(k(g[a],mxUtils.bind(this,function(){f=g.slice(0,a+1).join("/");y()})))})(a)}p.appendChild(c)}),v=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=m=d=b=null,D()):this.ui.hideDialog()}))}),y=mxUtils.bind(this,function(){var l=new mxXmlRequest(this.baseUrl+"/repos/"+b+"/"+d+"/contents/"+
-f+"?ref="+encodeURIComponent(m),null,"GET");g.okButton.removeAttribute("disabled");p.innerHTML="";this.ui.spinner.spin(p,mxResources.get("loading"));this.executeRequest(l,mxUtils.bind(this,function(g){q();this.ui.spinner.stop();var l=JSON.parse(g.getText());p.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,D();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px"));if(null==l||0==l.length)mxUtils.write(p,mxResources.get("noFiles"));else{var n=!0;g=mxUtils.bind(this,
-function(g){for(var q=0;q<l.length;q++)mxUtils.bind(this,function(l,q){if(g==("dir"==l.type)){var t=u.cloneNode();t.style.backgroundColor=n?"#eeeeee":"";n=!n;var x=document.createElement("img");x.src=IMAGE_PATH+"/"+("dir"==l.type?"folder.png":"file.png");x.setAttribute("align","absmiddle");x.style.marginRight="4px";x.style.marginTop="-4px";x.width=20;t.appendChild(x);t.appendChild(k(l.name+("dir"==l.type?"/":""),mxUtils.bind(this,function(){"dir"==l.type?(f=l.path,y()):a&&"file"==l.type&&(this.ui.hideDialog(),
-c(b+"/"+d+"/"+encodeURIComponent(m)+"/"+l.path))})));p.appendChild(t)}})(l[q],q)});g(!0);a&&g(!1)}}),v,!0)}),t=null,A=null,z=mxUtils.bind(this,function(a){null==a&&(p.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/repos/"+b+"/"+d+"/branches?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(p,mxResources.get("loading"));null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href",
-"javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(p,"scroll",A);z(a+1)});mxEvent.addListener(t,"click",l);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(q(!0),p.appendChild(k("../ [Up]",mxUtils.bind(this,function(){f=null;D()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(p,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,
-b){var c=u.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(k(a.name,mxUtils.bind(this,function(){m=a.name;f="";y()})));p.appendChild(c)})(b[c],c);100==b.length&&(p.appendChild(t),A=function(){p.scrollTop>=p.scrollHeight-p.offsetHeight&&l()},mxEvent.addListener(p,"scroll",A))}}),v)}),D=mxUtils.bind(this,function(a){null==a&&(p.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(p,
-mxResources.get("loading"));null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(p,"scroll",A);D(a+1)});mxEvent.addListener(t,"click",l);this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();c=JSON.parse(c.getText());if(null==c||0==c.length)mxUtils.write(p,mxResources.get("noFiles"));
-else{1==a&&(p.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){if(null!=a){var c=a.split("/");if(1<c.length){a=c[0];var g=c[1];3>c.length?(b=a,d=g,f=m=null,z()):this.ui.spinner.spin(p,mxResources.get("loading"))&&(c=encodeURIComponent(c.slice(2,c.length).join("/")),this.getFile(a+"/"+g+"/"+c,mxUtils.bind(this,function(a){this.ui.spinner.stop();b=a.meta.org;d=a.meta.repo;
-m=decodeURIComponent(a.meta.ref);f="";y()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(p),mxUtils.br(p));for(var g=0;g<c.length;g++)mxUtils.bind(this,function(a,c){var g=u.cloneNode();g.style.backgroundColor=0==c%2?"#eeeeee":"";g.appendChild(k(a.full_name,
-mxUtils.bind(this,function(){b=a.owner.login;d=a.name;m=a.default_branch;f="";y()})));p.appendChild(g)})(c[g],g)}100==c.length&&(p.appendChild(t),A=function(){p.scrollTop>=p.scrollHeight-p.offsetHeight&&l()},mxEvent.addListener(p,"scroll",A))}),v)});D()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,c,b){DrawioFile.call(this,a,c);this.meta=b;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
+GitHubClient.prototype.updateUser=function(a,c,b){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(this.baseUrl+"/user?access_token="+this.token,mxUtils.bind(this,function(e){window.clearTimeout(g);d&&(401===e.getStatus()?b?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,c,!0)}),c)):200>e.getStatus()||300<=e.getStatus()?
+c({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(e.getText()))),a()))}))};GitHubClient.prototype.createUser=function(a){return new DrawioUser(a.id,a.email,a.name)};
+GitHubClient.prototype.authenticate=function(a,c){if(null==window.onGitHubCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(k,m){if(d)if(window.onGitHubCallback=null,d=!1,null==k)c({message:mxResources.get("accessDenied"),retry:b});else{var n=mxUtils.bind(this,function(){var b=
+!0,d=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(f){window.clearTimeout(d);if(b)try{if(200>f.getStatus()||300<=f.getStatus())c({message:mxResources.get("cannotLogin")});else{null!=e&&e();var k=f.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);g&&this.setPersistentToken(this.token);a()}}catch(u){c(u)}finally{null!=m&&
+m.close()}}))});n()}else null!=m&&m.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onGitHubCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(a,c){try{var b=JSON.parse(a.getText());null!=b&&null!=b.message&&(c=b.message)}catch(d){}return c};
+GitHubClient.prototype.executeRequest=function(a,c,b,d){var g=mxUtils.bind(this,function(k){var m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),q=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+q)};a.send(mxUtils.bind(this,function(){window.clearTimeout(n);if(m)if(200<=a.getStatus()&&299>=a.getStatus()||d&&404==a.getStatus())c(a);else if(401===a.getStatus())k?b({code:a.getStatus(),message:mxResources.get("accessDenied"),
+retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},b)})}):this.authenticate(function(){g(!0)},b);else if(403===a.getStatus()){var f=!1;try{var l=JSON.parse(a.getText());null!=l&&null!=l.errors&&0<l.errors.length&&(f="too_large"==l.errors[0].code)}catch(p){}b({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?b({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("fileNotFound"))}):409===a.getStatus()?b({code:a.getStatus(),status:409}):
+b({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),b)}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},b,a):g(a)});null==this.token?this.authenticate(function(){e(!0)},b):e(!1)};GitHubClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!0)};
+GitHubClient.prototype.getSha=function(a,c,b,d,g,e){var k="&t="+(new Date).getTime();a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+c+"/contents/"+b+"?ref="+d+k,null,"HEAD");this.executeRequest(a,mxUtils.bind(this,function(a){try{g(a.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(n){e(n)}}),e)};
+GitHubClient.prototype.getFile=function(a,c,b,d,g){d=null!=d?d:!1;var e=a.split("/"),k=e[0],m=e[1],n=e[2];a=e.slice(3,e.length).join("/");e=/\.png$/i.test(a);!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&e)?null!=this.token?(g=this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+a+"?ref="+n+"&token="+this.token,e=a.split("/"),this.ui.convertFile(g,0<e.length?e[e.length-1]:a,null,this.extension,c,b)):b({message:mxResources.get("accessDenied")}):(g="&t="+(new Date).getTime(),
+a=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+a+"?ref="+n+g,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{c(this.createGitHubFile(k,m,n,JSON.parse(a.getText()),d))}catch(f){b(f)}}),b))};
+GitHubClient.prototype.createGitHubFile=function(a,c,b,d,g){a={org:a,repo:c,ref:b,name:d.name,path:d.path,sha:d.sha,html_url:d.html_url,download_url:d.download_url};c=d.content;"base64"===d.encoding&&(/\.jpe?g$/i.test(d.name)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(d.name)?c="data:image/gif;base64,"+c:/\.png$/i.test(d.name)?(d=this.ui.extractGraphModelFromPng(c),c=null!=d&&0<d.length?d:"data:image/png;base64,"+c):c=Base64.decode(c));return g?new GitHubLibrary(this.ui,c,a):new GitHubFile(this.ui,
+c,a)};GitHubClient.prototype.insertLibrary=function(a,c,b,d,g){this.insertFile(a,c,b,d,!0,g,!1)};
+GitHubClient.prototype.insertFile=function(a,c,b,d,g,e,k){g=null!=g?g:!1;e=e.split("/");var m=e[0],n=e[1],q=e[2],f=e.slice(3,e.length).join("/");0<f.length&&(f+="/");f+=a;this.checkExists(m+"/"+n+"/"+q+"/"+f,!0,mxUtils.bind(this,function(e,p){e?g?(k||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(m,n,q,f,a,c,p,mxUtils.bind(this,function(a){try{var c=JSON.parse(a.getText());b(this.createGitHubFile(m,n,q,c.content,g))}catch(z){d(z)}}),d)}),d)):b(new GitHubFile(this.ui,
+c,{org:m,repo:n,ref:q,name:a,path:f,sha:p,isNew:!0})):d()}))};GitHubClient.prototype.showCommitDialog=function(a,c,b,d){var g=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(c?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){g();b(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){d()}),null,280);this.ui.showDialog(a.container,400,80,!0,!1);a.init()};
+GitHubClient.prototype.writeFile=function(a,c,b,d,g,e,k,m,n){e.length>=this.maxFileSize?n({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 1 MB)"}):(b={path:d,branch:decodeURIComponent(b),message:g,content:e},null!=k&&(b.sha=k),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+c+"/contents/"+d,JSON.stringify(b),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){m(a)}),mxUtils.bind(this,function(a){404==a.code&&(a.helpLink="https://github.com/settings/connections/applications/"+
+this.clientId,a.code=null);n(a)})))};
+GitHubClient.prototype.checkExists=function(a,c,b){var d=a.split("/"),g=d[0],e=d[1],k=d[2];a=d.slice(3,d.length).join("/");this.getSha(g,e,a,k,mxUtils.bind(this,function(d){if(c){var e=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){e();b(!0,d)},function(){e();b(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){b(!1)})}),mxUtils.bind(this,function(a){b(!0)}),null,!0)};
+GitHubClient.prototype.saveFile=function(a,c,b,d,g){var e=a.meta.org,k=a.meta.repo,m=a.meta.ref,n=a.meta.path,q=mxUtils.bind(this,function(d,f){this.writeFile(e,k,m,n,g,f,d,mxUtils.bind(this,function(b){delete a.meta.isNew;c(JSON.parse(b.getText()).content.sha)}),mxUtils.bind(this,function(a){b(a)}))}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(n)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){q(a.meta.sha,b)}),b,this.ui.getCurrentFile()!=a?a.getData():null):
+q(a.meta.sha,Base64.encode(a.getData()))});d?this.getSha(e,k,n,m,mxUtils.bind(this,function(b){a.meta.sha=b;f()}),b):f()};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)};
+GitHubClient.prototype.showGitHubDialog=function(a,c){var b=null,d=null,g=null,e=null,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.height="304px";var m=document.createElement("h3");mxUtils.write(m,mxResources.get(a?"selectFile":"selectFolder"));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(m);var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.border="1px solid lightgray";n.style.boxSizing=
+"border-box";n.style.padding="4px";n.style.overflow="auto";n.style.lineHeight="1.2em";n.style.height="274px";k.appendChild(n);var q=document.createElement("div");q.style.textOverflow="ellipsis";q.style.boxSizing="border-box";q.style.overflow="hidden";q.style.padding="4px";q.style.width="100%";var f=new CustomDialog(this.ui,k,mxUtils.bind(this,function(){c(b+"/"+d+"/"+encodeURIComponent(g)+"/"+e)}));this.ui.showDialog(f.container,420,360,!0,!0);a&&f.okButton.parentNode.removeChild(f.okButton);var l=
+mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=q.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),p=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(l(b+"/"+d,mxUtils.bind(this,function(){e=null;C()})));a||(mxUtils.write(c," / "),c.appendChild(l(decodeURIComponent(g),mxUtils.bind(this,
+function(){e=null;y()}))));if(null!=e&&0<e.length){var f=e.split("/");for(a=0;a<f.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(l(f[a],mxUtils.bind(this,function(){e=f.slice(0,a+1).join("/");z()})))})(a)}n.appendChild(c)}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(e=g=d=b=null,C()):this.ui.hideDialog()}))}),v=null,t=null,z=mxUtils.bind(this,function(k){null==k&&(n.innerHTML="",k=1);var m=new mxXmlRequest(this.baseUrl+
+"/repos/"+b+"/"+d+"/contents/"+e+"?ref="+encodeURIComponent(g)+"&per_page=100&page="+k,null,"GET");this.ui.spinner.spin(n,mxResources.get("loading"));f.okButton.removeAttribute("disabled");null!=t&&(mxEvent.removeListener(n,"scroll",t),t=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var x=mxUtils.bind(this,function(){z(k+1)});mxEvent.addListener(v,
+"click",x);this.executeRequest(m,mxUtils.bind(this,function(f){this.ui.spinner.stop();1==k&&(p(),n.appendChild(l("../ [Up]",mxUtils.bind(this,function(){if(""==e)e=null,C();else{var a=e.split("/");e=a.slice(0,a.length-1).join("/");z()}}),"4px")));var m=JSON.parse(f.getText());if(null==m||0==m.length)mxUtils.write(n,mxResources.get("noFiles"));else{var x=!0,t=0;f=mxUtils.bind(this,function(f){for(var k=0;k<m.length;k++)mxUtils.bind(this,function(k,m){if(f==("dir"==k.type)){var p=q.cloneNode();p.style.backgroundColor=
+x?"#eeeeee":"";x=!x;var B=document.createElement("img");B.src=IMAGE_PATH+"/"+("dir"==k.type?"folder.png":"file.png");B.setAttribute("align","absmiddle");B.style.marginRight="4px";B.style.marginTop="-4px";B.width=20;p.appendChild(B);p.appendChild(l(k.name+("dir"==k.type?"/":""),mxUtils.bind(this,function(){"dir"==k.type?(e=k.path,z()):a&&"file"==k.type&&(this.ui.hideDialog(),c(b+"/"+d+"/"+encodeURIComponent(g)+"/"+k.path))})));n.appendChild(p);t++}})(m[k],k)});f(!0);a&&f(!1)}}),u,!0)}),y=mxUtils.bind(this,
+function(a){null==a&&(n.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/repos/"+b+"/"+d+"/branches?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));null!=t&&(mxEvent.removeListener(n,"scroll",t),t=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k=
+mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(p(!0),n.appendChild(l("../ [Up]",mxUtils.bind(this,function(){e=null;C()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(n,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=q.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(l(a.name,mxUtils.bind(this,function(){g=
+a.name;e="";z()})));n.appendChild(c)})(b[c],c);100==b.length&&(n.appendChild(v),t=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&k()},mxEvent.addListener(n,"scroll",t))}}),u)}),C=mxUtils.bind(this,function(a){null==a&&(n.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));null!=t&&mxEvent.removeListener(n,"scroll",t);null!=v&&null!=v.parentNode&&
+v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){C(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();c=JSON.parse(c.getText());if(null==c||0==c.length)mxUtils.write(n,mxResources.get("noFiles"));else{1==a&&(n.appendChild(l(mxResources.get("enterValue")+"...",mxUtils.bind(this,
+function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){if(null!=a){var c=a.split("/");if(1<c.length){a=c[0];var f=c[1];3>c.length?(b=a,d=f,e=g=null,y()):this.ui.spinner.spin(n,mxResources.get("loading"))&&(c=encodeURIComponent(c.slice(2,c.length).join("/")),this.getFile(a+"/"+f+"/"+c,mxUtils.bind(this,function(a){this.ui.spinner.stop();b=a.meta.org;d=a.meta.repo;g=decodeURIComponent(a.meta.ref);e="";z()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();
+this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(n),mxUtils.br(n));for(var f=0;f<c.length;f++)mxUtils.bind(this,function(a,c){var f=q.cloneNode();f.style.backgroundColor=0==c%2?"#eeeeee":"";f.appendChild(l(a.full_name,mxUtils.bind(this,function(){b=a.owner.login;d=a.name;g=a.default_branch;
+e="";z()})));n.appendChild(f)})(c[f],f)}100==c.length&&(n.appendChild(v),t=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&k()},mxEvent.addListener(n,"scroll",t))}),u)});C()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,c,b){DrawioFile.call(this,a,c);this.meta=b;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
TrelloFile.prototype.save=function(a,c,b){this.doSave(this.getTitle(),c,b)};TrelloFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};TrelloFile.prototype.doSave=function(a,c,b){var d=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=d;this.saveFile(a,!1,c,b)};
-TrelloFile.prototype.saveFile=function(a,c,b,d){if(this.isEditable())if(this.savingFile)null!=d&&(this.saveNeededCounter++,d({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.savingFileTime=new Date,this.getTitle()==a){var m=this.isModified,f=this.isModified(),l=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});l();this.ui.trello.saveFile(this,mxUtils.bind(this,function(f){this.savingFile=!1;this.isModified=m;this.meta=f;this.contentChanged();null!=b&&
-b();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,c,b,d))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=m;this.setModified(f||this.isModified());if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){l();b()}}d(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(f){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(f){this.savingFile=!1;null!=b&&b();this.ui.fileLoaded(f);0<this.saveNeededCounter&&
-(this.saveNeededCounter--,this.saveFile(a,c,b,d))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,f)}));else null!=b&&b()};TrelloLibrary=function(a,c,b){TrelloFile.call(this,a,c,b)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(a){DrawioClient.call(this,a,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e73615c79cf7e381aef91c85936e9553";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";
-TrelloClient.prototype.authenticate=function(a,c,b){b&&this.logout();b=mxUtils.bind(this,function(b,m){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:b?"never":"1hour",success:function(){null!=m&&m();a()},error:function(){null!=m&&m();null!=c&&c(mxResources.get("loggedOut"))}})});this.isAuthorized()?b(!0):this.ui.showAuthDialog(this,!0,b)};TrelloClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!1,!0)};
-TrelloClient.prototype.getFile=function(a,c,b,d,m){m=null!=m?m:!1;var f=mxUtils.bind(this,function(){var d=a.split(this.SEPARATOR),n=!0,p=window.setTimeout(mxUtils.bind(this,function(){n=!1;b({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout);Trello.cards.get(d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(d){window.clearTimeout(p);if(n){var g=/\.png$/i.test(d.name);/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&g?this.ui.convertFile(PROXY_URL+"?url="+
-encodeURIComponent(d.url),d.name,d.mimeType,this.extension,c,b):(n=!0,p=window.setTimeout(mxUtils.bind(this,function(){n=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(d.url),mxUtils.bind(this,function(b){window.clearTimeout(p);if(n){d.compoundId=a;var f=g?b.lastIndexOf(","):-1;0<f&&(f=this.ui.extractGraphModelFromPng(b.substring(f+1)),null!=f&&0<f.length&&(b=f));m?c(new TrelloLibrary(this.ui,b,d)):c(new TrelloFile(this.ui,b,d))}}),mxUtils.bind(this,
-function(a,c){window.clearTimeout(p);n&&(401==c.status?this.authenticate(f,b,!0):b())}),g||null!=d.mimeType&&"image/"==d.mimeType.substring(0,6)))}}),mxUtils.bind(this,function(a){window.clearTimeout(p);n&&(null!=a&&401==a.status?this.authenticate(f,b,!0):b())}))});this.authenticate(f,b)};TrelloClient.prototype.insertLibrary=function(a,c,b,d,m){this.insertFile(a,c,b,d,!0,m)};
-TrelloClient.prototype.insertFile=function(a,c,b,d,m,f){m=null!=m?m:!1;var l=mxUtils.bind(this,function(){var l=mxUtils.bind(this,function(l){this.writeFile(a,l,f,mxUtils.bind(this,function(a){m?b(new TrelloLibrary(this.ui,c,a)):b(new TrelloFile(this.ui,c,a))}),d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){l(this.ui.base64ToBlob(a,"image/png"))}),d,c):l(c)});this.authenticate(l,d)};
-TrelloClient.prototype.saveFile=function(a,c,b){var d=a.meta.compoundId.split(this.SEPARATOR),m=mxUtils.bind(this,function(l){this.writeFile(a.meta.name,l,d[0],function(a){Trello.del("cards/"+d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(){c(a)}),mxUtils.bind(this,function(a){null!=a&&401==a.status?this.authenticate(f,b,!0):b()}))},b)}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(this.ui.base64ToBlob(a,
-"image/png"))}),b,this.ui.getCurrentFile()!=a?a.getData():null):m(a.getData())});this.authenticate(f,b)};
-TrelloClient.prototype.writeFile=function(a,c,b,d,m){if(null!=a&&null!=c)if(c.length>=this.maxFileSize)m({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 10 MB)"});else{var f=mxUtils.bind(this,function(){var l=!0,n=window.setTimeout(mxUtils.bind(this,function(){l=!1;m({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),p=new FormData;p.append("key",Trello.key());p.append("token",Trello.token());p.append("file","string"===typeof c?new Blob([c]):c,a);p.append("name",
-a);var u=new XMLHttpRequest;u.responseType="json";u.onreadystatechange=mxUtils.bind(this,function(){if(4===u.readyState&&(window.clearTimeout(n),l))if(200==u.status){var a=u.response;a.compoundId=b+this.SEPARATOR+a.id;d(a)}else 401==u.status?this.authenticate(f,m,!0):m()});u.open("POST",this.baseUrl+"cards/"+b+"/attachments");u.send(p)});this.authenticate(f,m)}else m({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};
+TrelloFile.prototype.saveFile=function(a,c,b,d){if(this.isEditable())if(this.savingFile)null!=d&&(this.saveNeededCounter++,d({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.savingFileTime=new Date,this.getTitle()==a){var g=this.isModified,e=this.isModified(),k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return e}});k();this.ui.trello.saveFile(this,mxUtils.bind(this,function(e){this.savingFile=!1;this.isModified=g;this.meta=e;this.contentChanged();null!=b&&
+b();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,c,b,d))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=g;this.setModified(e||this.isModified());if(null!=d){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){k();b()}}d(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(e){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(e){this.savingFile=!1;null!=b&&b();this.ui.fileLoaded(e);0<this.saveNeededCounter&&
+(this.saveNeededCounter--,this.saveFile(a,c,b,d))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,e)}));else null!=b&&b()};TrelloLibrary=function(a,c,b){TrelloFile.call(this,a,c,b)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(a){DrawioClient.call(this,a,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e73615c79cf7e381aef91c85936e9553";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";
+TrelloClient.prototype.authenticate=function(a,c,b){b&&this.logout();b=mxUtils.bind(this,function(b,g){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:b?"never":"1hour",success:function(){null!=g&&g();a()},error:function(){null!=g&&g();null!=c&&c(mxResources.get("loggedOut"))}})});this.isAuthorized()?b(!0):this.ui.showAuthDialog(this,!0,b)};TrelloClient.prototype.getLibrary=function(a,c,b){this.getFile(a,c,b,!1,!0)};
+TrelloClient.prototype.getFile=function(a,c,b,d,g){g=null!=g?g:!1;var e=mxUtils.bind(this,function(){var d=a.split(this.SEPARATOR),m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout);Trello.cards.get(d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(d){window.clearTimeout(n);if(m){var f=/\.png$/i.test(d.name);/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&f?this.ui.convertFile(PROXY_URL+"?url="+
+encodeURIComponent(d.url),d.name,d.mimeType,this.extension,c,b):(m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(d.url),mxUtils.bind(this,function(b){window.clearTimeout(n);if(m){d.compoundId=a;var e=f?b.lastIndexOf(","):-1;0<e&&(e=this.ui.extractGraphModelFromPng(b.substring(e+1)),null!=e&&0<e.length&&(b=e));g?c(new TrelloLibrary(this.ui,b,d)):c(new TrelloFile(this.ui,b,d))}}),mxUtils.bind(this,
+function(a,c){window.clearTimeout(n);m&&(401==c.status?this.authenticate(e,b,!0):b())}),f||null!=d.mimeType&&"image/"==d.mimeType.substring(0,6)))}}),mxUtils.bind(this,function(a){window.clearTimeout(n);m&&(null!=a&&401==a.status?this.authenticate(e,b,!0):b())}))});this.authenticate(e,b)};TrelloClient.prototype.insertLibrary=function(a,c,b,d,g){this.insertFile(a,c,b,d,!0,g)};
+TrelloClient.prototype.insertFile=function(a,c,b,d,g,e){g=null!=g?g:!1;var k=mxUtils.bind(this,function(){var k=mxUtils.bind(this,function(k){this.writeFile(a,k,e,mxUtils.bind(this,function(a){g?b(new TrelloLibrary(this.ui,c,a)):b(new TrelloFile(this.ui,c,a))}),d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){k(this.ui.base64ToBlob(a,"image/png"))}),d,c):k(c)});this.authenticate(k,d)};
+TrelloClient.prototype.saveFile=function(a,c,b){var d=a.meta.compoundId.split(this.SEPARATOR),g=mxUtils.bind(this,function(g){this.writeFile(a.meta.name,g,d[0],function(a){Trello.del("cards/"+d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(){c(a)}),mxUtils.bind(this,function(a){null!=a&&401==a.status?this.authenticate(e,b,!0):b()}))},b)}),e=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){g(this.ui.base64ToBlob(a,
+"image/png"))}),b,this.ui.getCurrentFile()!=a?a.getData():null):g(a.getData())});this.authenticate(e,b)};
+TrelloClient.prototype.writeFile=function(a,c,b,d,g){if(null!=a&&null!=c)if(c.length>=this.maxFileSize)g({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(c.length)+" / 10 MB)"});else{var e=mxUtils.bind(this,function(){var k=!0,m=window.setTimeout(mxUtils.bind(this,function(){k=!1;g({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),n=new FormData;n.append("key",Trello.key());n.append("token",Trello.token());n.append("file","string"===typeof c?new Blob([c]):c,a);n.append("name",
+a);var q=new XMLHttpRequest;q.responseType="json";q.onreadystatechange=mxUtils.bind(this,function(){if(4===q.readyState&&(window.clearTimeout(m),k))if(200==q.status){var a=q.response;a.compoundId=b+this.SEPARATOR+a.id;d(a)}else 401==q.status?this.authenticate(e,g,!0):g()});q.open("POST",this.baseUrl+"cards/"+b+"/attachments");q.send(n)});this.authenticate(e,g)}else g({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};
TrelloClient.prototype.pickFolder=function(a){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}))};TrelloClient.prototype.pickFile=function(a,c){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("T"+encodeURIComponent(a))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a,mxResources.get("ok"))}))};
-TrelloClient.prototype.showTrelloDialog=function(a,c){var b=null,d="@me",m=0,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.height="224px";var l=document.createElement("h3");mxUtils.write(l,a?mxResources.get("selectFile"):mxResources.get("selectCard"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(l);var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.overflow="auto";n.style.height=
-"194px";f.appendChild(n);f=new CustomDialog(this.ui,f);this.ui.showDialog(f.container,340,270,!0,!0);f.okButton.parentNode.removeChild(f.okButton);var p=mxUtils.bind(this,function(a,b,c){m++;var d=document.createElement("div");d.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;background:"+(0==m%2?"#eee":"#fff");var f=document.createElement("a");f.setAttribute("href","javascript:void(0);");if(null!=c){var g=document.createElement("img");g.src=c.url;g.width=c.width;g.height=
-c.height;g.style="border: 1px solid black;margin:5px;vertical-align:middle";f.appendChild(g)}mxUtils.write(f,a);mxEvent.addListener(f,"click",b);d.appendChild(f);return d}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),g=mxUtils.bind(this,function(){m=0;n.innerHTML="";this.ui.spinner.spin(n,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(b+"/attachments",{fields:"id,name,previews"},
-mxUtils.bind(this,function(a){this.ui.spinner.stop();n.appendChild(p("../ [Up]",mxUtils.bind(this,function(){v()})));mxUtils.br(n);null==a||0==a.length?mxUtils.write(n,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){n.appendChild(p(a.name,mxUtils.bind(this,function(){this.ui.hideDialog();c(b+this.SEPARATOR+a.id)}),null!=a.previews?a.previews[0]:null))})(a[d])})()}),mxUtils.bind(this,function(b){401==b.status?this.authenticate(a,u,!0):
-null!=u&&u(b)}))});a()}),k=null,q=null,v=mxUtils.bind(this,function(f){null==f&&(m=0,n.innerHTML="",f=1);this.ui.spinner.spin(n,mxResources.get("loading"));null!=k&&null!=k.parentNode&&k.parentNode.removeChild(k);k=document.createElement("a");k.style.display="block";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(n,"scroll",q);v(f+1)});mxEvent.addListener(k,"click",l);var A=mxUtils.bind(this,function(){Trello.get("search",
-{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:f-1},mxUtils.bind(this,function(m){this.ui.spinner.stop();m=null!=m?m.cards:null;if(null==m||0==m.length)mxUtils.write(n,mxResources.get("noFiles"));else{1==f&&(n.appendChild(p(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(d=a,v())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");
-this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(n));for(var t=0;t<m.length;t++)mxUtils.bind(this,function(d){n.appendChild(p(d.name,mxUtils.bind(this,function(){a?(b=d.id,g()):(this.ui.hideDialog(),c(d.id))})))})(m[t]);100==m.length&&(n.appendChild(k),q=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&l()},mxEvent.addListener(n,"scroll",q))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(A,u,!0):null!=u&&u({message:a.responseText})}))});A()});v()};
+TrelloClient.prototype.showTrelloDialog=function(a,c){var b=null,d="@me",g=0,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.overflow="hidden";e.style.height="224px";var k=document.createElement("h3");mxUtils.write(k,a?mxResources.get("selectFile"):mxResources.get("selectCard"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(k);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.overflow="auto";m.style.height=
+"194px";e.appendChild(m);e=new CustomDialog(this.ui,e);this.ui.showDialog(e.container,340,270,!0,!0);e.okButton.parentNode.removeChild(e.okButton);var n=mxUtils.bind(this,function(a,b,c){g++;var d=document.createElement("div");d.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;background:"+(0==g%2?"#eee":"#fff");var e=document.createElement("a");e.setAttribute("href","javascript:void(0);");if(null!=c){var f=document.createElement("img");f.src=c.url;f.width=c.width;f.height=
+c.height;f.style="border: 1px solid black;margin:5px;vertical-align:middle";e.appendChild(f)}mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d.appendChild(e);return d}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),f=mxUtils.bind(this,function(){g=0;m.innerHTML="";this.ui.spinner.spin(m,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(b+"/attachments",{fields:"id,name,previews"},
+mxUtils.bind(this,function(a){this.ui.spinner.stop();m.appendChild(n("../ [Up]",mxUtils.bind(this,function(){u()})));mxUtils.br(m);null==a||0==a.length?mxUtils.write(m,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){m.appendChild(n(a.name,mxUtils.bind(this,function(){this.ui.hideDialog();c(b+this.SEPARATOR+a.id)}),null!=a.previews?a.previews[0]:null))})(a[d])})()}),mxUtils.bind(this,function(b){401==b.status?this.authenticate(a,q,!0):
+null!=q&&q(b)}))});a()}),l=null,p=null,u=mxUtils.bind(this,function(e){null==e&&(g=0,m.innerHTML="",e=1);this.ui.spinner.spin(m,mxResources.get("loading"));null!=l&&null!=l.parentNode&&l.parentNode.removeChild(l);l=document.createElement("a");l.style.display="block";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(m,"scroll",p);u(e+1)});mxEvent.addListener(l,"click",k);var v=mxUtils.bind(this,function(){Trello.get("search",
+{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:e-1},mxUtils.bind(this,function(g){this.ui.spinner.stop();g=null!=g?g.cards:null;if(null==g||0==g.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==e&&(m.appendChild(n(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(d=a,u())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");
+this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m));for(var t=0;t<g.length;t++)mxUtils.bind(this,function(d){m.appendChild(n(d.name,mxUtils.bind(this,function(){a?(b=d.id,f()):(this.ui.hideDialog(),c(d.id))})))})(g[t]);100==g.length&&(m.appendChild(l),p=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&k()},mxEvent.addListener(m,"scroll",p))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(v,q,!0):null!=q&&q({message:a.responseText})}))});v()});u()};
TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};GitLabFile=function(a,c,b){GitHubFile.call(this,a,c,b);this.peer=this.ui.gitLab};mxUtils.extend(GitLabFile,GitHubFile);GitLabFile.prototype.getId=function(){return this.meta.org+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitLabFile.prototype.getHash=function(){return encodeURIComponent("A"+this.getId())};GitLabFile.prototype.isConflict=function(a){return null!=a&&400==a.status};
GitLabFile.prototype.getMode=function(){return App.MODE_GITLAB};GitLabFile.prototype.getDescriptorEtag=function(a){return a.last_commit_id};GitLabFile.prototype.setDescriptorEtag=function(a,c){a.last_commit_id=c};GitLabLibrary=function(a,c,b){GitLabFile.call(this,a,c,b)};mxUtils.extend(GitLabLibrary,GitLabFile);GitLabLibrary.prototype.doSave=function(a,c,b){this.saveFile(a,!1,c,b)};GitLabLibrary.prototype.open=function(){};GitLabClient=function(a){GitHubClient.call(this,a,"gitlabauth")};mxUtils.extend(GitLabClient,GitHubClient);GitLabClient.prototype.clientId=DRAWIO_GITLAB_ID;GitLabClient.prototype.scope="api%20read_repository%20write_repository";GitLabClient.prototype.baseUrl=DRAWIO_GITLAB_URL+"/api/v4";
-GitLabClient.prototype.authenticate=function(a,c){if(null==window.onGitLabCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(m,f){var l=encodeURIComponent(window.location.origin+"/gitlab.html");null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope+"&redirect_uri="+l+"&response_type=token&state=123","gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,function(l,p){d?(window.onGitLabCallback=
-null,d=!1,null==l?c({message:mxResources.get("accessDenied"),retry:b}):(null!=f&&f(),this.token=l,this.setUser(null),m&&this.setPersistentToken(this.token),a())):null!=p&&p.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onGitLabCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};
-GitLabClient.prototype.executeRequest=function(a,c,b,d){var m=mxUtils.bind(this,function(l){var n=!0,p=window.setTimeout(mxUtils.bind(this,function(){n=!1;b({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),u=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","Bearer "+u);a.setRequestHeader("PRIVATE_TOKEN",u);a.setRequestHeader("Content-Type","application/json")};a.send(mxUtils.bind(this,function(){window.clearTimeout(p);if(n)if(200<=a.getStatus()&&
-299>=a.getStatus()||d&&404==a.getStatus())c(a);else if(401===a.getStatus())l?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){f(!0)},b)})}):this.authenticate(function(){m(!0)},b);else if(403===a.getStatus()){var g=!1;try{var k=JSON.parse(a.getText());null!=k&&null!=k.errors&&0<k.errors.length&&(g="too_large"==k.errors[0].code)}catch(q){}b({message:mxResources.get(g?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?b({message:this.getErrorMessage(a,
-mxResources.get("fileNotFound"))}):400===a.getStatus()?b({status:400}):b({status:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),b)}),f=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){f(!0)},b,a):m(a)});null==this.token?this.authenticate(function(){f(!0)},b):f(!1)};
-GitLabClient.prototype.getRefIndex=function(a,c,b,d,m){if(null!=m)b(a,m);else{var f=a.length-2,l=mxUtils.bind(this,function(){if(2>f)d({message:mxResources.get("fileNotFound")});else{var m=Math.max(f-1,0),p=a.slice(0,m).join("/"),m=a[m],u=a[f],g=a.slice(f+1,a.length).join("/"),p=this.baseUrl+"/projects/"+encodeURIComponent(p+"/"+m)+"/repository/"+(c?"tree?path="+g+"&ref="+u:"files/"+encodeURIComponent(g)+"?ref="+u),k=new mxXmlRequest(p,null,"HEAD");this.executeRequest(k,mxUtils.bind(this,function(){200==
-k.getStatus()?b(a,f):d({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==k.getStatus()?(f--,l()):d({message:mxResources.get("fileNotFound")})}))}});l()}};
-GitLabClient.prototype.getFile=function(a,c,b,d,m,f){d=null!=d?d:!1;this.getRefIndex(a.split("/"),!1,mxUtils.bind(this,function(f,n){var l=Math.max(n-1,0),u=f.slice(0,l).join("/"),g=f[l],k=f[n];a=f.slice(n+1,f.length).join("/");l=/\.png$/i.test(a);if(!m&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&l))null!=this.token?(l=this.baseUrl+"/projects/"+encodeURIComponent(u+"/"+g)+"/repository/files/"+encodeURIComponent(k),f=a.split("/"),this.ui.convertFile(l,0<f.length?
-f[f.length-1]:a,null,this.extension,c,b)):b({message:mxResources.get("accessDenied")});else{var q="&t="+(new Date).getTime(),l=this.baseUrl+"/projects/"+encodeURIComponent(u+"/"+g)+"/repository/files/"+encodeURIComponent(a)+"?ref="+k,l=new mxXmlRequest(l+q,null,"GET");this.executeRequest(l,mxUtils.bind(this,function(a){try{c(this.createGitLabFile(u,g,k,JSON.parse(a.getText()),d,n))}catch(y){b(y)}}),b)}}),b,f)};
-GitLabClient.prototype.createGitLabFile=function(a,c,b,d,m,f){var l=DRAWIO_GITLAB_URL+"/",n=d.file_name;a={org:a,repo:c,ref:b,name:n,path:d.file_path,html_url:l+a+"/"+c+"/blob/"+b+"/"+d.file_path,download_url:l+a+"/"+c+"/raw/"+b+"/"+d.file_path+"?inline=false",last_commit_id:d.last_commit_id,refPos:f};c=d.content;"base64"===d.encoding&&(/\.jpe?g$/i.test(n)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(n)?c="data:image/gif;base64,"+c:/\.png$/i.test(n)?(d=this.ui.extractGraphModelFromPng(c),c=null!=
-d&&0<d.length?d:"data:image/png;base64,"+c):c=Base64.decode(c));return m?new GitLabLibrary(this.ui,c,a):new GitLabFile(this.ui,c,a)};
-GitLabClient.prototype.insertFile=function(a,c,b,d,m,f,l){m=null!=m?m:!1;this.getRefIndex(f.split("/"),!0,mxUtils.bind(this,function(f,p){var n=Math.max(p-1,0),g=f.slice(0,n).join("/"),k=f[n],q=f[p];path=f.slice(p+1,f.length).join("/");0<path.length&&(path+="/");path+=a;this.checkExists(g+"/"+k+"/"+q+"/"+path,!0,mxUtils.bind(this,function(f,n){if(f)if(m)l||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(g,k,q,path,a,c,n,mxUtils.bind(this,function(a){try{var c=
-JSON.parse(a.getText());b(this.createGitLabFile(g,k,q,c.content,m,p))}catch(x){d(x)}}),d)}),d);else{var t=DRAWIO_GITLAB_URL+"/";b(new GitLabFile(this.ui,c,{org:g,repo:k,ref:q,name:a,path:path,html_url:t+g+"/"+k+"/blob/"+q+"/"+path,download_url:t+g+"/"+k+"/raw/"+q+"/"+path+"?inline=false",refPos:p,last_commit_id:n,isNew:!0}))}else d()}))}),d)};
-GitLabClient.prototype.checkExists=function(a,c,b){this.getFile(a,mxUtils.bind(this,function(d){if(c){var m=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){m();b(!0,d.getCurrentEtag())},function(){m();b(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){b(!1)})}),mxUtils.bind(this,function(a){b(!0)}),null,!0)};
-GitLabClient.prototype.writeFile=function(a,c,b,d,m,f,l,n,p){if(f.length>=this.maxFileSize)p({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(f.length)+" / 1 MB)"});else{var u="POST";b={path:encodeURIComponent(d),branch:decodeURIComponent(b),commit_message:m,content:f,encoding:"base64"};null!=l&&(b.last_commit_id=l,u="PUT");a=this.baseUrl+"/projects/"+encodeURIComponent(a+"/"+c)+"/repository/files/"+encodeURIComponent(d);u=new mxXmlRequest(a,JSON.stringify(b),u);this.executeRequest(u,
-mxUtils.bind(this,function(a){n(a)}),p)}};
-GitLabClient.prototype.saveFile=function(a,c,b,d,m){var f=a.meta.org,l=a.meta.repo,n=a.meta.ref,p=a.meta.path,u=mxUtils.bind(this,function(d,g){this.writeFile(f,l,n,p,m,g,d,mxUtils.bind(this,function(d){delete a.meta.isNew;this.getFile(f+"/"+l+"/"+n+"/"+p,mxUtils.bind(this,function(b){b.getData()==a.getData()?c(b.getCurrentEtag()):c({content:a.getCurrentEtag()})}),b,null,null,a.meta.refPos)}),b)}),g=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(p)?this.ui.getEmbeddedPng(mxUtils.bind(this,
-function(b){u(a.meta.last_commit_id,b)}),b,this.ui.getCurrentFile()!=a?a.getData():null):u(a.meta.last_commit_id,Base64.encode(a.getData()))});d?this.getFile(f+"/"+l+"/"+n+"/"+p,mxUtils.bind(this,function(b){a.meta.last_commit_id=b.meta.last_commit_id;g()}),b):g()};GitLabClient.prototype.pickFolder=function(a){this.showGitLabDialog(!1,a)};GitLabClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("A"+encodeURIComponent(a))});this.showGitLabDialog(!0,a)};
-GitLabClient.prototype.showGitLabDialog=function(a,c){var b=null,d=null,m=null,f=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(n);var p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.border="1px solid lightgray";p.style.boxSizing=
-"border-box";p.style.padding="4px";p.style.overflow="auto";p.style.lineHeight="1.2em";p.style.height="274px";l.appendChild(p);var u=document.createElement("div");u.style.textOverflow="ellipsis";u.style.boxSizing="border-box";u.style.overflow="hidden";u.style.padding="4px";u.style.width="100%";var g=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){c(b+"/"+d+"/"+encodeURIComponent(m)+"/"+f)}));this.ui.showDialog(g.container,420,360,!0,!0);a&&g.okButton.parentNode.removeChild(g.okButton);var k=
-mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=u.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),q=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(k(b+"/"+d,mxUtils.bind(this,function(){f=null;D()})));a||(mxUtils.write(c," / "),c.appendChild(k(decodeURIComponent(m),mxUtils.bind(this,
-function(){f=null;z()}))));if(null!=f&&0<f.length){var g=f.split("/");for(a=0;a<g.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(k(g[a],mxUtils.bind(this,function(){f=g.slice(0,a+1).join("/");y()})))})(a)}p.appendChild(c)}),v=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=m=d=b=null,D()):this.ui.hideDialog()}))}),y=mxUtils.bind(this,function(){var l=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(b+
-"/"+d)+"/repository/tree?path="+f+"&ref="+m,null,"GET");g.okButton.removeAttribute("disabled");p.innerHTML="";this.ui.spinner.spin(p,mxResources.get("loading"));this.executeRequest(l,mxUtils.bind(this,function(g){q(!m);this.ui.spinner.stop();var l=JSON.parse(g.getText());p.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,D();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px"));if(null==l||0==l.length)mxUtils.write(p,mxResources.get("noFiles"));else{var n=!0;
-g=mxUtils.bind(this,function(g){for(var q=0;q<l.length;q++)mxUtils.bind(this,function(l){if(g==("tree"==l.type)){var q=u.cloneNode();q.style.backgroundColor=n?"#eeeeee":"";n=!n;var t=document.createElement("img");t.src=IMAGE_PATH+"/"+("tree"==l.type?"folder.png":"file.png");t.setAttribute("align","absmiddle");t.style.marginRight="4px";t.style.marginTop="-4px";t.width=20;q.appendChild(t);q.appendChild(k(l.name+("tree"==l.type?"/":""),mxUtils.bind(this,function(){"tree"==l.type?(f=l.path,y()):a&&"blob"==
-l.type&&(this.ui.hideDialog(),c(b+"/"+d+"/"+m+"/"+l.path))})));p.appendChild(q)}})(l[q])});g(!0);a&&g(!1)}}),v,!0)}),t=null,A=null,z=mxUtils.bind(this,function(a){null==a&&(p.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(b+"/"+d)+"/repository/branches?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(p,mxResources.get("loading"));null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");
-t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(p,"scroll",A);z(a+1)});mxEvent.addListener(t,"click",l);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(q(!0),p.appendChild(k("../ [Up]",mxUtils.bind(this,function(){f=null;D()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(p,mxResources.get("noFiles"));else{for(var c=
-0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=u.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(k(a.name,mxUtils.bind(this,function(){m=encodeURIComponent(a.name);f="";y()})));p.appendChild(c)})(b[c],c);100==b.length&&(p.appendChild(t),A=function(){p.scrollTop>=p.scrollHeight-p.offsetHeight&&l()},mxEvent.addListener(p,"scroll",A))}}),v)});g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(p,mxResources.get("loading"));var D=mxUtils.bind(this,function(a){this.ui.spinner.stop();
-null==a&&(p.innerHTML="",a=1);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var c=mxUtils.bind(this,function(){mxEvent.removeListener(p,"scroll",A);D(a+1)});mxEvent.addListener(t,"click",c);var g=mxUtils.bind(this,function(a){this.ui.spinner.spin(p,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");
-this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),v)}),l=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(p,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();b(a,JSON.parse(c.getText()))}),v)});g(mxUtils.bind(this,function(g){var n=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+
-a,null,"GET");this.ui.spinner.spin(p,mxResources.get("loading"));this.executeRequest(n,mxUtils.bind(this,function(n){this.ui.spinner.stop();n=JSON.parse(n.getText());if(null!=n&&0!=n.length||null!=g&&0!=g.length){1==a&&(p.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(b=a[0],d=a[1],m="master",f=null,2<a.length&&(f=encodeURIComponent(a.slice(2,
-a.length).join("/"))),y()):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(p),mxUtils.br(p));for(var q=!0,x=0;x<n.length;x++)mxUtils.bind(this,function(a,c){var g=u.cloneNode();g.style.backgroundColor=q?"#eeeeee":"";q=!q;g.appendChild(k(a.name_with_namespace,mxUtils.bind(this,function(){b=a.owner.username;d=a.path;m=a.default_branch||"master";f="";y()})));p.appendChild(g)})(n[x],
-x);for(x=0;x<g.length;x++)l(g[x],mxUtils.bind(this,function(a,c){for(var g=0;g<c.length;g++){var l=u.cloneNode();l.style.backgroundColor=q?"#eeeeee":"";q=!q;mxUtils.bind(this,function(c){l.appendChild(k(c.name_with_namespace,mxUtils.bind(this,function(){b=a.full_path;d=c.path;m=c.default_branch||"master";f="";y()})));p.appendChild(l)})(c[g])}}))}else mxUtils.write(p,mxResources.get("noFiles"));100==n.length&&(p.appendChild(t),A=function(){p.scrollTop>=p.scrollHeight-p.offsetHeight&&c()},mxEvent.addListener(p,
-"scroll",A))}),v)}))});this.token?this.user?D():this.updateUser(function(){D()},v,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){D()},v,!0)}),v)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,c,b,d,m,f,l){this.file=a;this.id=c;this.content=b;this.modifiedDate=d;this.createdDate=m;this.isResolved=f;this.user=l;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,c,b,d,m){c()};DrawioComment.prototype.editComment=function(a,c,b){c()};DrawioComment.prototype.deleteComment=function(a,c){a()};DriveComment=function(a,c,b,d,m,f,l,n){DrawioComment.call(this,a,c,b,d,m,f,l);this.pCommentId=n};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,c,b,d,m){a={content:a.content};d?a.verb="resolve":m&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){c(a.replyId)}),b)};
+GitLabClient.prototype.authenticate=function(a,c){if(null==window.onGitLabCallback){var b=mxUtils.bind(this,function(){var d=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(g,e){var k=encodeURIComponent(window.location.origin+"/gitlab.html");null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope+"&redirect_uri="+k+"&response_type=token&state=123","gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,function(k,n){d?(window.onGitLabCallback=
+null,d=!1,null==k?c({message:mxResources.get("accessDenied"),retry:b}):(null!=e&&e(),this.token=k,this.setUser(null),g&&this.setPersistentToken(this.token),a())):null!=n&&n.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:b})}),mxUtils.bind(this,function(){d&&(window.onGitLabCallback=null,d=!1,c({message:mxResources.get("accessDenied"),retry:b}))}))});b()}else c({code:App.ERROR_BUSY})};
+GitLabClient.prototype.executeRequest=function(a,c,b,d){var g=mxUtils.bind(this,function(k){var m=!0,n=window.setTimeout(mxUtils.bind(this,function(){m=!1;b({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),q=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","Bearer "+q);a.setRequestHeader("PRIVATE_TOKEN",q);a.setRequestHeader("Content-Type","application/json")};a.send(mxUtils.bind(this,function(){window.clearTimeout(n);if(m)if(200<=a.getStatus()&&
+299>=a.getStatus()||d&&404==a.getStatus())c(a);else if(401===a.getStatus())k?b({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){e(!0)},b)})}):this.authenticate(function(){g(!0)},b);else if(403===a.getStatus()){var f=!1;try{var l=JSON.parse(a.getText());null!=l&&null!=l.errors&&0<l.errors.length&&(f="too_large"==l.errors[0].code)}catch(p){}b({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?b({message:this.getErrorMessage(a,
+mxResources.get("fileNotFound"))}):400===a.getStatus()?b({status:400}):b({status:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),b)}),e=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){e(!0)},b,a):g(a)});null==this.token?this.authenticate(function(){e(!0)},b):e(!1)};
+GitLabClient.prototype.getRefIndex=function(a,c,b,d,g){if(null!=g)b(a,g);else{var e=a.length-2,k=mxUtils.bind(this,function(){if(2>e)d({message:mxResources.get("fileNotFound")});else{var g=Math.max(e-1,0),n=a.slice(0,g).join("/"),g=a[g],q=a[e],f=a.slice(e+1,a.length).join("/"),n=this.baseUrl+"/projects/"+encodeURIComponent(n+"/"+g)+"/repository/"+(c?"tree?path="+f+"&ref="+q:"files/"+encodeURIComponent(f)+"?ref="+q),l=new mxXmlRequest(n,null,"HEAD");this.executeRequest(l,mxUtils.bind(this,function(){200==
+l.getStatus()?b(a,e):d({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==l.getStatus()?(e--,k()):d({message:mxResources.get("fileNotFound")})}))}});k()}};
+GitLabClient.prototype.getFile=function(a,c,b,d,g,e){d=null!=d?d:!1;this.getRefIndex(a.split("/"),!1,mxUtils.bind(this,function(e,m){var k=Math.max(m-1,0),q=e.slice(0,k).join("/"),f=e[k],l=e[m];a=e.slice(m+1,e.length).join("/");k=/\.png$/i.test(a);if(!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||!this.ui.useCanvasForExport&&k))null!=this.token?(k=this.baseUrl+"/projects/"+encodeURIComponent(q+"/"+f)+"/repository/files/"+encodeURIComponent(l),e=a.split("/"),this.ui.convertFile(k,0<e.length?
+e[e.length-1]:a,null,this.extension,c,b)):b({message:mxResources.get("accessDenied")});else{var p="&t="+(new Date).getTime(),k=this.baseUrl+"/projects/"+encodeURIComponent(q+"/"+f)+"/repository/files/"+encodeURIComponent(a)+"?ref="+l,k=new mxXmlRequest(k+p,null,"GET");this.executeRequest(k,mxUtils.bind(this,function(a){try{c(this.createGitLabFile(q,f,l,JSON.parse(a.getText()),d,m))}catch(v){b(v)}}),b)}}),b,e)};
+GitLabClient.prototype.createGitLabFile=function(a,c,b,d,g,e){var k=DRAWIO_GITLAB_URL+"/",m=d.file_name;a={org:a,repo:c,ref:b,name:m,path:d.file_path,html_url:k+a+"/"+c+"/blob/"+b+"/"+d.file_path,download_url:k+a+"/"+c+"/raw/"+b+"/"+d.file_path+"?inline=false",last_commit_id:d.last_commit_id,refPos:e};c=d.content;"base64"===d.encoding&&(/\.jpe?g$/i.test(m)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(m)?c="data:image/gif;base64,"+c:/\.png$/i.test(m)?(d=this.ui.extractGraphModelFromPng(c),c=null!=
+d&&0<d.length?d:"data:image/png;base64,"+c):c=Base64.decode(c));return g?new GitLabLibrary(this.ui,c,a):new GitLabFile(this.ui,c,a)};
+GitLabClient.prototype.insertFile=function(a,c,b,d,g,e,k){g=null!=g?g:!1;this.getRefIndex(e.split("/"),!0,mxUtils.bind(this,function(e,n){var m=Math.max(n-1,0),f=e.slice(0,m).join("/"),l=e[m],p=e[n];path=e.slice(n+1,e.length).join("/");0<path.length&&(path+="/");path+=a;this.checkExists(f+"/"+l+"/"+p+"/"+path,!0,mxUtils.bind(this,function(e,m){if(e)if(g)k||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(f,l,p,path,a,c,m,mxUtils.bind(this,function(a){try{var c=
+JSON.parse(a.getText());b(this.createGitLabFile(f,l,p,c.content,g,n))}catch(x){d(x)}}),d)}),d);else{var t=DRAWIO_GITLAB_URL+"/";b(new GitLabFile(this.ui,c,{org:f,repo:l,ref:p,name:a,path:path,html_url:t+f+"/"+l+"/blob/"+p+"/"+path,download_url:t+f+"/"+l+"/raw/"+p+"/"+path+"?inline=false",refPos:n,last_commit_id:m,isNew:!0}))}else d()}))}),d)};
+GitLabClient.prototype.checkExists=function(a,c,b){this.getFile(a,mxUtils.bind(this,function(d){if(c){var g=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){g();b(!0,d.getCurrentEtag())},function(){g();b(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){b(!1)})}),mxUtils.bind(this,function(a){b(!0)}),null,!0)};
+GitLabClient.prototype.writeFile=function(a,c,b,d,g,e,k,m,n){if(e.length>=this.maxFileSize)n({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 1 MB)"});else{var q="POST";b={path:encodeURIComponent(d),branch:decodeURIComponent(b),commit_message:g,content:e,encoding:"base64"};null!=k&&(b.last_commit_id=k,q="PUT");a=this.baseUrl+"/projects/"+encodeURIComponent(a+"/"+c)+"/repository/files/"+encodeURIComponent(d);q=new mxXmlRequest(a,JSON.stringify(b),q);this.executeRequest(q,
+mxUtils.bind(this,function(a){m(a)}),n)}};
+GitLabClient.prototype.saveFile=function(a,c,b,d,g){var e=a.meta.org,k=a.meta.repo,m=a.meta.ref,n=a.meta.path,q=mxUtils.bind(this,function(d,f){this.writeFile(e,k,m,n,g,f,d,mxUtils.bind(this,function(d){delete a.meta.isNew;this.getFile(e+"/"+k+"/"+m+"/"+n,mxUtils.bind(this,function(b){b.getData()==a.getData()?c(b.getCurrentEtag()):c({content:a.getCurrentEtag()})}),b,null,null,a.meta.refPos)}),b)}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(n)?this.ui.getEmbeddedPng(mxUtils.bind(this,
+function(b){q(a.meta.last_commit_id,b)}),b,this.ui.getCurrentFile()!=a?a.getData():null):q(a.meta.last_commit_id,Base64.encode(a.getData()))});d?this.getFile(e+"/"+k+"/"+m+"/"+n,mxUtils.bind(this,function(b){a.meta.last_commit_id=b.meta.last_commit_id;f()}),b):f()};GitLabClient.prototype.pickFolder=function(a){this.showGitLabDialog(!1,a)};GitLabClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("A"+encodeURIComponent(a))});this.showGitLabDialog(!0,a)};
+GitLabClient.prototype.showGitLabDialog=function(a,c){var b=null,d=null,g=null,e=null,k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.height="304px";var m=document.createElement("h3");mxUtils.write(m,mxResources.get(a?"selectFile":"selectFolder"));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(m);var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.border="1px solid lightgray";n.style.boxSizing=
+"border-box";n.style.padding="4px";n.style.overflow="auto";n.style.lineHeight="1.2em";n.style.height="274px";k.appendChild(n);var q=document.createElement("div");q.style.textOverflow="ellipsis";q.style.boxSizing="border-box";q.style.overflow="hidden";q.style.padding="4px";q.style.width="100%";var f=new CustomDialog(this.ui,k,mxUtils.bind(this,function(){c(b+"/"+d+"/"+encodeURIComponent(g)+"/"+e)}));this.ui.showDialog(f.container,420,360,!0,!0);a&&f.okButton.parentNode.removeChild(f.okButton);var l=
+mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=q.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),p=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(l(b+"/"+d,mxUtils.bind(this,function(){e=null;C()})));a||(mxUtils.write(c," / "),c.appendChild(l(decodeURIComponent(g),mxUtils.bind(this,
+function(){e=null;y()}))));if(null!=e&&0<e.length){var f=e.split("/");for(a=0;a<f.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(l(f[a],mxUtils.bind(this,function(){e=f.slice(0,a+1).join("/");z()})))})(a)}n.appendChild(c)}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(e=g=d=b=null,C()):this.ui.hideDialog()}))}),v=null,t=null,z=mxUtils.bind(this,function(k){null==k&&(n.innerHTML="",k=1);var m=new mxXmlRequest(this.baseUrl+
+"/projects/"+encodeURIComponent(b+"/"+d)+"/repository/tree?path="+e+"&ref="+g+"&per_page=100&page="+k,null,"GET");this.ui.spinner.spin(n,mxResources.get("loading"));f.okButton.removeAttribute("disabled");null!=t&&(mxEvent.removeListener(n,"scroll",t),t=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var x=mxUtils.bind(this,function(){z(k+
+1)});mxEvent.addListener(v,"click",x);this.executeRequest(m,mxUtils.bind(this,function(f){this.ui.spinner.stop();1==k&&(p(!g),n.appendChild(l("../ [Up]",mxUtils.bind(this,function(){if(""==e)e=null,C();else{var a=e.split("/");e=a.slice(0,a.length-1).join("/");z()}}),"4px")));var m=JSON.parse(f.getText());if(null==m||0==m.length)mxUtils.write(n,mxResources.get("noFiles"));else{var B=!0,u=0;f=mxUtils.bind(this,function(f){for(var k=0;k<m.length;k++)mxUtils.bind(this,function(k){if(f==("tree"==k.type)){var m=
+q.cloneNode();m.style.backgroundColor=B?"#eeeeee":"";B=!B;var p=document.createElement("img");p.src=IMAGE_PATH+"/"+("tree"==k.type?"folder.png":"file.png");p.setAttribute("align","absmiddle");p.style.marginRight="4px";p.style.marginTop="-4px";p.width=20;m.appendChild(p);m.appendChild(l(k.name+("tree"==k.type?"/":""),mxUtils.bind(this,function(){"tree"==k.type?(e=k.path,z()):a&&"blob"==k.type&&(this.ui.hideDialog(),c(b+"/"+d+"/"+g+"/"+k.path))})));n.appendChild(m);u++}})(m[k])});f(!0);a&&f(!1);100==
+u&&(n.appendChild(v),t=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&x()},mxEvent.addListener(n,"scroll",t))}}),u,!0)}),y=mxUtils.bind(this,function(a){null==a&&(n.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(b+"/"+d)+"/repository/branches?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));null!=t&&(mxEvent.removeListener(n,"scroll",t),t=null);null!=v&&null!=v.parentNode&&
+v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(v,"click",k);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(p(!0),n.appendChild(l("../ [Up]",mxUtils.bind(this,function(){e=null;C()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(n,mxResources.get("noFiles"));
+else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=q.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(l(a.name,mxUtils.bind(this,function(){g=encodeURIComponent(a.name);e="";z()})));n.appendChild(c)})(b[c],c);100==b.length&&(n.appendChild(v),t=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&k()},mxEvent.addListener(n,"scroll",t))}}),u)});f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));var C=mxUtils.bind(this,
+function(a){this.ui.spinner.stop();null==a&&(n.innerHTML="",a=1);null!=t&&(mxEvent.removeListener(n,"scroll",t),t=null);null!=v&&null!=v.parentNode&&v.parentNode.removeChild(v);v=document.createElement("a");v.style.display="block";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("more")+"...");var c=mxUtils.bind(this,function(){C(a+1)});mxEvent.addListener(v,"click",c);var f=mxUtils.bind(this,function(a){this.ui.spinner.spin(n,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+
+"/groups?per_page=100",null,"GET");this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),u)}),k=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(n,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();b(a,JSON.parse(c.getText()))}),u)});f(mxUtils.bind(this,function(f){var m=new mxXmlRequest(this.baseUrl+"/users/"+
+this.user.id+"/projects?per_page=100&page="+a,null,"GET");this.ui.spinner.spin(n,mxResources.get("loading"));this.executeRequest(m,mxUtils.bind(this,function(m){this.ui.spinner.stop();m=JSON.parse(m.getText());if(null!=m&&0!=m.length||null!=f&&0!=f.length){1==a&&(n.appendChild(l(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(b=a[0],d=a[1],g="master",
+e=null,2<a.length&&(e=encodeURIComponent(a.slice(2,a.length).join("/"))),z()):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(n),mxUtils.br(n));for(var p=!0,x=0;x<m.length;x++)mxUtils.bind(this,function(a,c){var f=q.cloneNode();f.style.backgroundColor=p?"#eeeeee":"";p=!p;f.appendChild(l(a.name_with_namespace,mxUtils.bind(this,function(){b=a.owner.username;d=
+a.path;g=a.default_branch||"master";e="";z()})));n.appendChild(f)})(m[x],x);for(x=0;x<f.length;x++)k(f[x],mxUtils.bind(this,function(a,c){for(var f=0;f<c.length;f++){var k=q.cloneNode();k.style.backgroundColor=p?"#eeeeee":"";p=!p;mxUtils.bind(this,function(c){k.appendChild(l(c.name_with_namespace,mxUtils.bind(this,function(){b=a.full_path;d=c.path;g=c.default_branch||"master";e="";z()})));n.appendChild(k)})(c[f])}}))}else mxUtils.write(n,mxResources.get("noFiles"));100==m.length&&(n.appendChild(v),
+t=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&c()},mxEvent.addListener(n,"scroll",t))}),u)}))});this.token?this.user?C():this.updateUser(function(){C()},u,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){C()},u,!0)}),u)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,c,b,d,g,e,k){this.file=a;this.id=c;this.content=b;this.modifiedDate=d;this.createdDate=g;this.isResolved=e;this.user=k;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,c,b,d,g){c()};DrawioComment.prototype.editComment=function(a,c,b){c()};DrawioComment.prototype.deleteComment=function(a,c){a()};DriveComment=function(a,c,b,d,g,e,k,m){DrawioComment.call(this,a,c,b,d,g,e,k);this.pCommentId=m};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,c,b,d,g){a={content:a.content};d?a.verb="resolve":g&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){c(a.replyId)}),b)};
DriveComment.prototype.editComment=function(a,c,b){this.content=a;a={content:a};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:a,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:a,method:"PATCH"},c,b)};
DriveComment.prototype.deleteComment=function(a,c){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},a,c)};App=function(a,c,b){EditorUi.call(this,a,c,null!=b?b:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()){var b={category:"DISCARD-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!=
a.ageStart?Math.round((Date.now()-a.ageStart.getTime())/1E3):"x")+(this.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+"-open_"+(null!=a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.lastSaved?Math.round((Date.now()-a.lastSaved.getTime())/1E3):"x")+"-change_"+(null!=a.lastChanged?Math.round((Date.now()-a.lastChanged.getTime())/1E3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1E3),label:null!=a.sync?"client_"+a.sync.clientId:"nosync"};
a.constructor==DriveFile&&null!=a.desc&&null!=this.drive&&(b.label+=(null!=this.drive.user?"-user_"+this.drive.user.id:"-nouser")+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType);EditorUi.logEvent(b)}}));this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+a.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?
"on":"off")})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
-(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,b,c){var d=null;try{d=window.open(a)}catch(n){}null==d||void 0===d?this.showDialog((new PopupDialog(this,a,b,c)).container,320,140,!0,!0):null!=b&&b()});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]);if(null!=
+(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,b,c){var d=null;try{d=window.open(a)}catch(m){}null==d||void 0===d?this.showDialog((new PopupDialog(this,a,b,c)).container,320,140,!0,!0):null!=b&&b()});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]);if(null!=
App.DrawPlugins){for(a=0;a<App.DrawPlugins.length;a++)try{App.DrawPlugins[a](this)}catch(d){null!=window.console&&console.log("Plugin Error:",d,App.DrawPlugins[a])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(a){try{a(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=0,this.initializeEmbedMode())}),5E3)}this.load()};
App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_GITHUB="github";App.MODE_GITLAB="gitlab";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL="js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";
App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":"js/onedrive/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";App.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";App.PUSHER_URL="https://js.pusher.com/4.3/pusher.min.js";App.GOOGLE_APIS="drive-share";App.startTime=new Date;
@@ -9064,14 +9076,14 @@ App.main=function(a,c){function b(d){mxUtils.getAll("1"!=urlParams.dev?[d]:[d,ST
null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode))mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&
"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null);"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.tr||
"1"==urlParams.embed&&"1"==urlParams.tr)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!=a&&a(b);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))},function(a){a=document.getElementById("geStatus");
-null!=a&&(a.innerHTML="Error loading page. <a>Please try refreshing.</a>",a.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";b(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})}function d(){mxResources.loadDefaultBundle=!1;b(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}window.onerror=function(a,b,c,d,f){EditorUi.logError(a,b,c,d,f)};if("1"==urlParams.embed||
-"1"==urlParams.lightbox){var m=document.getElementById("geInfo");null!=m&&m.parentNode.removeChild(m)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.offline||"1"==urlParams.appcache)mxscript("js/shapes.min.js"),mxscript("js/stencils.min.js"),mxscript("js/extensions.min.js"),m=document.createElement("iframe"),m.setAttribute("width","0"),m.setAttribute("height",
-"0"),m.setAttribute("src","offline.html"),document.body.appendChild(m);"ArrayBuffer"in window&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"auto"==DrawioFile.SYNC&&"1"!=urlParams.embed&&"1"!=urlParams.local&&"1"!=urlParams.stealth&&"1"!=urlParams.offline&&mxscript(App.PUSHER_URL);if("0"!=urlParams.plugins&&"1"!=urlParams.offline){m=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var f=JSON.parse(localStorage.getItem(mxSettings.key));
-null!=f&&(m=f.plugins)}catch(k){}f=urlParams.p;App.initPluginCallback();null!=f&&App.loadPlugins(f.split(";"));if(null!=m&&0<m.length&&"0"!=urlParams.plugins){for(var f=window.location.protocol+"//"+window.location.host,l=!0,n=0;n<m.length&&l;n++)"/"!=m[n].charAt(0)&&m[n].substring(0,f.length)!=f&&(l=!1);if(l||mxUtils.confirm(mxResources.replacePlaceholders("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",
-[m.join("\n")]).replace(/\\n/g,"\n")))for(n=0;n<m.length;n++)try{null==App.pluginsLoaded[m[n]]&&(App.pluginsLoaded[m[n]]=!0,App.embedModePluginsCount++,"/"==m[n].charAt(0)&&(m[n]=PLUGINS_BASE_PATH+m[n]),mxscript(m[n]))}catch(k){}}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",
-null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var p=parseInt(mxSettings.settings.autosaveDelay);!isNaN(p)&&0<p?(DrawioFile.prototype.autosaveDelay=p,null!=window.console&&console.log("Setting autosaveDelay to "+DrawioFile.prototype.autosaveDelay)):null!=window.console&&console.log("Invalid value for autosaveDelay")}null!=mxSettings.settings.defaultEdgeLength&&
-(p=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(p)&&0<p?(Graph.prototype.defaultEdgeLength=p,null!=window.console&&console.log("Setting defaultEdgeLength to "+Graph.prototype.defaultEdgeLength)):null!=window.console&&console.log("Invalid value for defaultEdgeLength"))}}catch(k){null!=window.console&&console.error(k)}if(null!=window.DRAWIO_CONFIG)try{Editor.configure(window.DRAWIO_CONFIG,!0)}catch(k){null!=window.console&&console.log("Error in global configuration: "+k,window.DRAWIO_CONFIG)}if("1"==
-urlParams.configure){var u=window.opener||window.parent,g=function(a){if(a.source==u)try{var b=JSON.parse(a.data);null!=b&&"configure"==b.action&&(mxEvent.removeListener(window,"message",g),Editor.configure(b.config,!0),mxSettings.load(),d())}catch(v){null!=window.console&&console.log("Error in configuration: "+v)}};mxEvent.addListener(window,"message",g);u.postMessage(JSON.stringify({event:"configure"}),"*")}else d()};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=64";
+null!=a&&(a.innerHTML="Error loading page. <a>Please try refreshing.</a>",a.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";b(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})}function d(){mxResources.loadDefaultBundle=!1;b(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}window.onerror=function(a,b,c,d,e){EditorUi.logError(a,b,c,d,e)};if("1"==urlParams.embed||
+"1"==urlParams.lightbox){var g=document.getElementById("geInfo");null!=g&&g.parentNode.removeChild(g)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.offline||"1"==urlParams.appcache)mxscript("js/shapes.min.js"),mxscript("js/stencils.min.js"),mxscript("js/extensions.min.js"),g=document.createElement("iframe"),g.setAttribute("width","0"),g.setAttribute("height",
+"0"),g.setAttribute("src","offline.html"),document.body.appendChild(g);"ArrayBuffer"in window&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"auto"==DrawioFile.SYNC&&"1"!=urlParams.embed&&"1"!=urlParams.local&&"1"!=urlParams.stealth&&"1"!=urlParams.offline&&mxscript(App.PUSHER_URL);if("0"!=urlParams.plugins&&"1"!=urlParams.offline){g=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var e=JSON.parse(localStorage.getItem(mxSettings.key));
+null!=e&&(g=e.plugins)}catch(l){}e=urlParams.p;App.initPluginCallback();null!=e&&App.loadPlugins(e.split(";"));if(null!=g&&0<g.length&&"0"!=urlParams.plugins){for(var e=window.location.protocol+"//"+window.location.host,k=!0,m=0;m<g.length&&k;m++)"/"!=g[m].charAt(0)&&g[m].substring(0,e.length)!=e&&(k=!1);if(k||mxUtils.confirm(mxResources.replacePlaceholders("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",
+[g.join("\n")]).replace(/\\n/g,"\n")))for(m=0;m<g.length;m++)try{null==App.pluginsLoaded[g[m]]&&(App.pluginsLoaded[g[m]]=!0,App.embedModePluginsCount++,"/"==g[m].charAt(0)&&(g[m]=PLUGINS_BASE_PATH+g[m]),mxscript(g[m]))}catch(l){}}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",
+null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var n=parseInt(mxSettings.settings.autosaveDelay);!isNaN(n)&&0<n?(DrawioFile.prototype.autosaveDelay=n,null!=window.console&&console.log("Setting autosaveDelay to "+DrawioFile.prototype.autosaveDelay)):null!=window.console&&console.log("Invalid value for autosaveDelay")}null!=mxSettings.settings.defaultEdgeLength&&
+(n=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(n)&&0<n?(Graph.prototype.defaultEdgeLength=n,null!=window.console&&console.log("Setting defaultEdgeLength to "+Graph.prototype.defaultEdgeLength)):null!=window.console&&console.log("Invalid value for defaultEdgeLength"))}}catch(l){null!=window.console&&console.error(l)}if(null!=window.DRAWIO_CONFIG)try{Editor.configure(window.DRAWIO_CONFIG,!0)}catch(l){null!=window.console&&console.log("Error in global configuration: "+l,window.DRAWIO_CONFIG)}if("1"==
+urlParams.configure){var q=window.opener||window.parent,f=function(a){if(a.source==q)try{var b=JSON.parse(a.data);null!=b&&"configure"==b.action&&(mxEvent.removeListener(window,"message",f),Editor.configure(b.config,!0),mxSettings.load(),d())}catch(u){null!=window.console&&console.log("Error in configuration: "+u)}};mxEvent.addListener(window,"message",f);q.postMessage(JSON.stringify({event:"configure"}),"*")}else d()};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=64";
App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";
App.prototype.chevronUpImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUY1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NjA1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1RDUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1RTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pg+qUokAAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAAL0lEQVR42mJgRgMMRAswMKAKMDDARBjg8lARBoR6KImkH0wTbygT6YaS4DmAAAMAYPkClOEDDD0AAAAASUVORK5CYII=":
IMAGE_PATH+"/chevron-up.png";
@@ -9081,19 +9093,19 @@ App.prototype.formatShowImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgo
"/format-show.png";
App.prototype.formatHideImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODdCREY5REI1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODdCREY5REM1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4N0JERjlEOTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4N0JERjlEQTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqjT9SMAAAAGUExURQAAAP///6XZn90AAAACdFJOU/8A5bcwSgAAAB9JREFUeNpiYEQDDEQJMMABTAAmNdAC6A4j0XMAAQYAcbwA1Xvj1CgAAAAASUVORK5CYII=":IMAGE_PATH+
"/format-hide.png";App.prototype.fullscreenImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABpJREFUCNdjgAAbGxAy4AEh5gNwBBGByoIBAIueBd12TUjqAAAAAElFTkSuQmCC":IMAGE_PATH+"/fullscreen.png";App.prototype.warnInterval=3E5;"1"!=urlParams.embed?App.prototype.menubarHeight=64:App.prototype.footerHeight=0;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(a){App.DrawPlugins.push(a)})};
-App.pluginsLoaded={};App.embedModePluginsCount=0;App.loadPlugins=function(a,c){for(var b=0;b<a.length;b++)if(null!=a[b]&&0<a[b].length)try{var d=App.pluginRegistry[a[b]];null!=d?null==App.pluginsLoaded[d]&&(App.pluginsLoaded[d]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?c?mxinclude(d):mxscript(d):c?mxinclude(d):mxscript(drawDevUrl+d)):null!=window.console&&console.log("Unknown plugin:",a[b])}catch(m){null!=window.console&&console.log("Error loading plugin:",a[b],m)}};
+App.pluginsLoaded={};App.embedModePluginsCount=0;App.loadPlugins=function(a,c){for(var b=0;b<a.length;b++)if(null!=a[b]&&0<a[b].length)try{var d=App.pluginRegistry[a[b]];null!=d?null==App.pluginsLoaded[d]&&(App.pluginsLoaded[d]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?c?mxinclude(d):mxscript(d):c?mxinclude(d):mxscript(drawDevUrl+d)):null!=window.console&&console.log("Unknown plugin:",a[b])}catch(g){null!=window.console&&console.log("Error loading plugin:",a[b],g)}};
App.prototype.initializeEmbedMode=function(){"1"!=urlParams.embed||0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments))};App.prototype.initializeViewerMode=function(){var a=window.opener||window.parent;null!=a&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){a.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")}))};
App.prototype.init=function(){EditorUi.prototype.init.apply(this,arguments);this.defaultLibraryName=mxResources.get("untitledLibrary");this.descriptorChangedListener=mxUtils.bind(this,this.descriptorChanged);this.gitHub=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gh||"1"==urlParams.embed&&"1"!=urlParams.gh?null:new GitHubClient(this);null!=this.gitHub&&this.gitHub.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()}));
-this.gitLab=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this);null!=this.gitLab&&this.gitLab.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()}));var a=mxUtils.bind(this,function(a,b,c,d,f,k){var g=document.createElement("div");g.style.cssText="position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;white-space:nowrap;left:50%;bottom:2px;";
-g.className=c;c="geStatusAlert"==c?'<img src="'+mxClient.imageBasePath+'/warning.gif" border="0" style="margin-top:-4px;margin-right:8px;margin-left:8px;" valign="middle"/>':"";mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,110%)");mxUtils.setPrefixedStyle(g.style,"transition","all 1s ease");g.style.whiteSpace="nowrap";g.innerHTML='<a href="'+(null!=b?b:"javascript:void(0)")+'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">'+c+
-a+c+"</a>"+(null!=f?'<a href="'+f+'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;margin-right:8px;">Help</a>':"");a=document.createElement("img");a.setAttribute("src",Dialog.prototype.closeImage);a.setAttribute("title",mxResources.get("close"));a.style.position="absolute";a.style.cursor="pointer";a.style.right="10px";a.style.top="12px";g.appendChild(a);d&&mxEvent.addListener(a,"click",d);null!=k&&(g.style.paddingRight="40px",mxEvent.addListener(g,
-"click",k));return g});if("1"!=urlParams.embed||"1"==urlParams.od){var c=mxUtils.bind(this,function(){"undefined"!==typeof OneDrive?(this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=c)});c()}if("1"!=urlParams.embed||"1"==urlParams.tr){var b=
+this.gitLab=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this);null!=this.gitLab&&this.gitLab.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()}));var a=mxUtils.bind(this,function(a,b,c,d,e,g){var f=document.createElement("div");f.style.cssText="position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;white-space:nowrap;left:50%;bottom:2px;";
+f.className=c;c="geStatusAlert"==c?'<img src="'+mxClient.imageBasePath+'/warning.gif" border="0" style="margin-top:-4px;margin-right:8px;margin-left:8px;" valign="middle"/>':"";mxUtils.setPrefixedStyle(f.style,"transform","translate(-50%,110%)");mxUtils.setPrefixedStyle(f.style,"transition","all 1s ease");f.style.whiteSpace="nowrap";f.innerHTML='<a href="'+(null!=b?b:"javascript:void(0)")+'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">'+c+
+a+c+"</a>"+(null!=e?'<a href="'+e+'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;margin-right:8px;">Help</a>':"");a=document.createElement("img");a.setAttribute("src",Dialog.prototype.closeImage);a.setAttribute("title",mxResources.get("close"));a.style.position="absolute";a.style.cursor="pointer";a.style.right="10px";a.style.top="12px";f.appendChild(a);d&&mxEvent.addListener(a,"click",d);null!=g&&(f.style.paddingRight="40px",mxEvent.addListener(f,
+"click",g));return f});if("1"!=urlParams.embed||"1"==urlParams.od){var c=mxUtils.bind(this,function(){"undefined"!==typeof OneDrive?(this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=c)});c()}if("1"!=urlParams.embed||"1"==urlParams.tr){var b=
mxUtils.bind(this,function(){"undefined"!==typeof window.Trello?(this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))):null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=b)});b()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var d=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var a=mxUtils.bind(this,
function(){this.drive=new DriveClient(this);this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries();this.checkLicense()}));this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,a),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=d)});d()}if("1"!=urlParams.embed||
-"1"==urlParams.db){var m=mxUtils.bind(this,function(){"function"===typeof Dropbox&&"undefined"!==typeof Dropbox.choose?(window.DrawDropboxClientCallback=null,this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))):null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=m)});m()}if("1"!=urlParams.embed){if(this.bg=
+"1"==urlParams.db){var g=mxUtils.bind(this,function(){"function"===typeof Dropbox&&"undefined"!==typeof Dropbox.choose?(window.DrawDropboxClientCallback=null,this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))):null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=g)});g()}if("1"!=urlParams.embed){if(this.bg=
this.createBackground(),document.body.appendChild(this.bg),this.diagramContainer.style.visibility="hidden",this.formatContainer.style.visibility="hidden",this.hsplit.style.display="none",this.sidebarContainer.style.display="none",this.sidebarFooterContainer.style.display="none","1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,!(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"1"==urlParams.embed||"auto"!=DrawioFile.SYNC||"1"==urlParams.local||"1"==urlParams.stealth||"1"==urlParams.offline||
-this.editor.chromeless&&!this.editor.editable)){var f=window.setTimeout(mxUtils.bind(this,function(){DrawioFile.SYNC="manual";var a=this.getCurrentFile();null!=a&&null!=a.sync&&(a.sync.destroy(),a.sync=null,a=mxUtils.htmlEntities(mxResources.get("timeout")),this.editor.setStatus('<div title="'+a+'" class="geStatusAlert" style="overflow:hidden;">'+a+"</div>"));EditorUi.logEvent({category:"TIMEOUT-CACHE-CHECK",action:"timeout",label:408})}),Editor.cacheTimeout);(new Date).getTime();mxUtils.get(EditorUi.cacheUrl+
-"?alive",mxUtils.bind(this,function(a){window.clearTimeout(f)}));this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){if(this.getCurrentFile().mode!=App.MODE_DEVICE||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeDesktopFooter||this.editor.chromeless&&!this.editor.editable||this.footerShowing||null!=urlParams.open)isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeRateFooter||this.editor.chromeless&&!this.editor.editable||this.footerShowing||
+this.editor.chromeless&&!this.editor.editable)){var e=window.setTimeout(mxUtils.bind(this,function(){DrawioFile.SYNC="manual";var a=this.getCurrentFile();null!=a&&null!=a.sync&&(a.sync.destroy(),a.sync=null,a=mxUtils.htmlEntities(mxResources.get("timeout")),this.editor.setStatus('<div title="'+a+'" class="geStatusAlert" style="overflow:hidden;">'+a+"</div>"));EditorUi.logEvent({category:"TIMEOUT-CACHE-CHECK",action:"timeout",label:408})}),Editor.cacheTimeout);(new Date).getTime();mxUtils.get(EditorUi.cacheUrl+
+"?alive",mxUtils.bind(this,function(a){window.clearTimeout(e)}));this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){if(this.getCurrentFile().mode!=App.MODE_DEVICE||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeDesktopFooter||this.editor.chromeless&&!this.editor.editable||this.footerShowing||null!=urlParams.open)isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeRateFooter||this.editor.chromeless&&!this.editor.editable||this.footerShowing||
null!=urlParams.open||(b=a('<a style="cursor:default;" title="Please Rate Us"><b>Please Rate Us:</b></a><img border="0" align="absmiddle" title="1 star" style="margin-top:-6px;cursor:pointer;margin-left:8px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg=="><img border="0" align="absmiddle" title="2 stars" style="margin-top:-6px;margin-left:3px;cursor:pointer;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg=="><img border="0" align="absmiddle" title="3 stars" style="margin-top:-6px;margin-left:3px;cursor:pointer;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg=="><img border="0" align="absmiddle" title="4 stars" style="margin-top:-6px;margin-left:3px;cursor:pointer;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==" onclick="javascript:window.open(\'https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence?hosting=cloud&tab=reviews\');">',
null,"geStatusMessage",null,null,mxUtils.bind(this,function(){b.parentNode.removeChild(b);this.hideFooter();isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeRateFooter=Date.now(),mxSettings.save())})),document.body.appendChild(b),this.footerShowing=!0,window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,0%)")}),1500));else{var b=a(mxResources.get("downloadDesktop")+"...","https://get.draw.io/","geStatusMessage",mxUtils.bind(this,
function(){b.parentNode.removeChild(b);this.hideFooter();isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeDesktopFooter=Date.now(),mxSettings.save())}));document.body.appendChild(b);this.footerShowing=!0;window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,0%)")}),1500);window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,110%)");this.footerShowing=!1}),15E3)}}))}}else null!=
@@ -9106,39 +9118,39 @@ a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.
a.isEditable()?"save":"saveAs").funct()}),null,null,360,120,null,mxUtils.bind(this,function(){this.scheduleSanityCheck()}))}};App.prototype.isDriveDomain=function(){return"0"!=urlParams.drive&&("test.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"jgraph.github.io"==window.location.hostname)};
App.prototype.getPusher=function(){null==this.pusher&&"function"===typeof window.Pusher&&(this.pusher=new Pusher(App.PUSHER_KEY,{cluster:App.PUSHER_CLUSTER,encrypted:!0}));return this.pusher};
App.prototype.checkLicense=function(){var a=this.drive.getUser(),c=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=c){var b=c.lastIndexOf("@"),d=c;0<=b&&(d=c.substring(b+1),c=this.crc32(c.substring(0,b))+"@"+d);mxUtils.post("/license","domain="+encodeURIComponent(d)+"&email="+encodeURIComponent(c)+"&lc="+encodeURIComponent(a.locale)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(a){try{if(200<=a.getStatus()&&299>=a.getStatus()){var b=
-a.getText();if(0<b.length){var c=JSON.parse(b);null!=c&&this.handleLicense(c,d)}}}catch(n){}}))}};App.prototype.handleLicense=function(a,c){null!=a&&null!=a.plugins&&App.loadPlugins(a.plugins.split(";"),!0)};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?a.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())};
+a.getText();if(0<b.length){var c=JSON.parse(b);null!=c&&this.handleLicense(c,d)}}}catch(m){}}))}};App.prototype.handleLicense=function(a,c){null!=a&&null!=a.plugins&&App.loadPlugins(a.plugins.split(";"),!0)};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?a.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())};
App.prototype.updateDraft=function(){isLocalStorage&&null!=localStorage&&localStorage.setItem(".draft",JSON.stringify({modified:(new Date).getTime(),data:this.getFileData()}))};App.prototype.getDraft=function(){return null};App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var c=this.getRecent();if(null==c)c=[];else for(var b=0;b<c.length;b++)c[b].id==a.id&&c.splice(b,1);null!=c&&(c.unshift(a),c=c.slice(0,10),localStorage.setItem(".recent",JSON.stringify(c)))}};
App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var a=localStorage.getItem(".recent");if(null!=a)return JSON.parse(a)}catch(c){}return null}};App.prototype.resetRecent=function(a){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(c){}};App.prototype.removeDraft=function(){if(isLocalStorage&&null!=localStorage&&"0"==urlParams.splash)try{localStorage.removeItem(".draft")}catch(a){}};
App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");var a=this.getCurrentFile();if(null!=a)if(a.constructor!=LocalFile||""!=a.getHash()||a.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()){if(a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")};
App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var a=this.editor.appName,c=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=c&&(a=(null!=c.getTitle()?c.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],c,b=0;256>b;b++){c=b;for(var d=0;8>d;d++)c=c&1?3988292384^c>>>1:c>>>1;a[b]=c}return a};
-App.prototype.getThumbnail=function(a,c){var b=!1;try{var d=!0,m=window.setTimeout(mxUtils.bind(this,function(){d=!1;c(null)}),this.timeout),f=mxUtils.bind(this,function(a){window.clearTimeout(m);d&&c(a)});null==this.thumbImageCache&&(this.thumbImageCache={});var l=this.editor.graph,n=null!=l.themes&&"darkTheme"==l.defaultThemeName;if(null!=this.pages&&(this.currentPage!=this.pages[0]||n)){var p=l.getGlobalVariable,l=this.createTemporaryGraph(n?l.getDefaultStylesheet():l.getStylesheet()),u=this.pages[0];
-n&&(l.defaultThemeName="default");l.getGlobalVariable=function(a){return"page"==a?u.getName():"pagenumber"==a?1:p.apply(this,arguments)};l.getGlobalVariable=p;document.body.appendChild(l.container);l.model.setRoot(u.root)}if(mxClient.IS_CHROMEAPP||!l.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,function(a){try{l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}catch(G){a=null}f(a)}),a,this.thumbImageCache,"#ffffff",function(){f()},
-null,null,null,null,null,null,l),b=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var g=document.createElement("canvas"),k=l.getGraphBounds(),q=a/k.width,q=Math.min(1,Math.min(3*a/(4*k.height),q)),v=Math.floor(k.x),y=Math.floor(k.y);g.setAttribute("width",Math.ceil(q*(k.width+4)));g.setAttribute("height",Math.ceil(q*(k.height+4)));var t=g.getContext("2d");t.scale(q,q);t.translate(-v,-y);var A=l.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";t.save();t.fillStyle=A;t.fillRect(v,
-y,Math.ceil(k.width+4),Math.ceil(k.height+4));t.restore();var z=new mxJsCanvas(g),D=new mxAsyncCanvas(this.thumbImageCache);z.images=this.thumbImageCache.images;var x=new mxImageExport;x.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};x.drawText=function(a,b){};x.drawState(l.getView().getState(l.model.root),D);D.finish(mxUtils.bind(this,function(){try{x.drawState(l.getView().getState(l.model.root),
-z),l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}catch(C){g=null}f(g)}));b=!0}}catch(C){b=!1,null!=l&&l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}return b};
+App.prototype.getThumbnail=function(a,c){var b=!1;try{var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c(null)}),this.timeout),e=mxUtils.bind(this,function(a){window.clearTimeout(g);d&&c(a)});null==this.thumbImageCache&&(this.thumbImageCache={});var k=this.editor.graph,m=null!=k.themes&&"darkTheme"==k.defaultThemeName;if(null!=this.pages&&(this.currentPage!=this.pages[0]||m)){var n=k.getGlobalVariable,k=this.createTemporaryGraph(m?k.getDefaultStylesheet():k.getStylesheet()),q=this.pages[0];
+m&&(k.defaultThemeName="default");k.getGlobalVariable=function(a){return"page"==a?q.getName():"pagenumber"==a?1:n.apply(this,arguments)};k.getGlobalVariable=n;document.body.appendChild(k.container);k.model.setRoot(q.root)}if(mxClient.IS_CHROMEAPP||!k.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,function(a){try{k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}catch(E){a=null}e(a)}),a,this.thumbImageCache,"#ffffff",function(){e()},
+null,null,null,null,null,null,k),b=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var f=document.createElement("canvas"),l=k.getGraphBounds(),p=a/l.width,p=Math.min(1,Math.min(3*a/(4*l.height),p)),u=Math.floor(l.x),v=Math.floor(l.y);f.setAttribute("width",Math.ceil(p*(l.width+4)));f.setAttribute("height",Math.ceil(p*(l.height+4)));var t=f.getContext("2d");t.scale(p,p);t.translate(-u,-v);var z=k.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";t.save();t.fillStyle=z;t.fillRect(u,
+v,Math.ceil(l.width+4),Math.ceil(l.height+4));t.restore();var y=new mxJsCanvas(f),C=new mxAsyncCanvas(this.thumbImageCache);y.images=this.thumbImageCache.images;var x=new mxImageExport;x.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};x.drawText=function(a,b){};x.drawState(k.getView().getState(k.model.root),C);C.finish(mxUtils.bind(this,function(){try{x.drawState(k.getView().getState(k.model.root),
+y),k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}catch(B){f=null}e(f)}));b=!0}}catch(B){b=!1,null!=k&&k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}return b};
App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a};
(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(c,b){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var d=this.getCurrentFile();c=null!=d?d.getMode():c;c==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):c==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),
-this.appIcon.style.cursor="pointer"):c==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=c==App.MODE_DEVICE?"pointer":"default")}if(b)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var m=new Date;m.setYear(m.getFullYear()+1);document.cookie="MODE="+c+"; expires="+m.toUTCString()}}catch(f){}}})();
+this.appIcon.style.cursor="pointer"):c==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=c==App.MODE_DEVICE?"pointer":"default")}if(b)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var g=new Date;g.setYear(g.getFullYear()+1);document.cookie="MODE="+c+"; expires="+g.toUTCString()}}catch(e){}}})();
App.prototype.appIconClicked=function(a){if(mxEvent.isAltDown(a))this.showSplash(!0);else{var c=this.getCurrentFile(),b=null!=c?c.getMode():null;b==App.MODE_GOOGLE?null!=c&&null!=c.desc&&null!=c.desc.parents&&0<c.desc.parents.length&&!mxEvent.isShiftDown(a)?this.openLink("https://drive.google.com/drive/folders/"+c.desc.parents[0].id):null!=c&&null!=c.getId()?this.openLink("https://drive.google.com/open?id="+c.getId()):this.openLink("https://drive.google.com/?authuser=0"):b==App.MODE_DROPBOX?this.openLink("https://www.dropbox.com/"):
b==App.MODE_ONEDRIVE?this.openLink("https://onedrive.live.com/"):b==App.MODE_TRELLO?this.openLink("https://trello.com/"):b==App.MODE_GITHUB?null!=c&&c.constructor==GitHubFile?this.openLink(c.meta.html_url):this.openLink("https://github.com/"):b==App.MODE_GITLAB?null!=c&&c.constructor==GitLabFile?this.openLink(c.meta.html_url):this.openLink(DRAWIO_GITLAB_URL):b==App.MODE_DEVICE&&this.openLink("https://get.draw.io/")}mxEvent.consume(a)};
App.prototype.clearMode=function(){if(isLocalStorage)localStorage.removeItem(".mode");else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie="MODE=; expires="+a.toUTCString()}};App.prototype.getDiagramId=function(){var a=window.location.hash;null!=a&&0<a.length&&(a=a.substring(1));if(null!=a&&1<a.length&&"T"==a.charAt(0)){var c=a.indexOf("#");0<c&&(a=a.substring(0,c))}return a};
-App.prototype.open=function(){try{if(null!=window.opener){var a=urlParams.create;null!=a&&(a=decodeURIComponent(a));if(null!=a&&0<a.length&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)){var c=mxUtils.parseXml(window.opener[a]);this.editor.setGraphXml(c.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,c,m){this.spinner.stop();null==c&&(c=urlParams.title,m=!0,c=null!=c?decodeURIComponent(c):this.defaultFilename);0<(this.useCanvasForExport?
--1:".png"==c.substring(c.length-4))&&(c=c.substring(0,c.length-4)+".drawio");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,c):new LocalFile(this,a,c,m))}))}}catch(b){}};App.prototype.loadGapi=function(a){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,a)};
+App.prototype.open=function(){try{if(null!=window.opener){var a=urlParams.create;null!=a&&(a=decodeURIComponent(a));if(null!=a&&0<a.length&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)){var c=mxUtils.parseXml(window.opener[a]);this.editor.setGraphXml(c.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,c,g){this.spinner.stop();null==c&&(c=urlParams.title,g=!0,c=null!=c?decodeURIComponent(c):this.defaultFilename);0<(this.useCanvasForExport?
+-1:".png"==c.substring(c.length-4))&&(c=c.substring(0,c.length-4)+".drawio");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,c):new LocalFile(this,a,c,g))}))}}catch(b){}};App.prototype.loadGapi=function(a){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,a)};
App.prototype.load=function(){if("1"!=urlParams.embed){if(this.spinner.spin(document.body,mxResources.get("starting"))){try{this.stateArg=null!=urlParams.state&&null!=this.drive?JSON.parse(decodeURIComponent(urlParams.state)):null}catch(a){}this.editor.graph.setEnabled(null!=this.getCurrentFile());null!=window.location.hash&&0!=window.location.hash.length||null==this.drive||null==this.stateArg||null==this.stateArg.userId||this.drive.setUserId(this.stateArg.userId);null!=urlParams.fileId?(window.location.hash=
"G"+urlParams.fileId,window.location.search=this.getSearch(["fileId"])):null==this.drive?(this.mode==App.MODE_GOOGLE&&(this.mode=null),this.start()):this.loadGapi(mxUtils.bind(this,function(){this.start()}))}}else this.restoreLibraries(),"1"==urlParams.gapi&&this.loadGapi(function(){})};
App.prototype.showRefreshDialog=function(a,c){if(!this.showingRefreshDialog&&(this.showingRefreshDialog=!0,this.showError(a||mxResources.get("externalChanges"),c||mxResources.get("redirectToNewApp"),mxResources.get("refresh"),mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.setModified(!1);this.spinner.spin(document.body,mxResources.get("connecting"));this.editor.graph.setEnabled(!1);window.location.reload()}),null,null,null,null,null,340,180),null!=this.dialog&&null!=this.dialog.container)){var b=
this.createRealtimeNotice();b.style.left="0";b.style.right="0";b.style.borderRadius="0";b.style.borderLeftStyle="none";b.style.borderRightStyle="none";b.style.marginBottom="26px";b.style.padding="8px 0 8px 0";this.dialog.container.appendChild(b)}};
App.prototype.showAlert=function(a){if(null!=a&&0<a.length){var c=document.createElement("div");c.className="geAlert";c.style.zIndex=2E9;c.style.left="50%";c.style.top="-100%";mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(c.style,"transition","all 1s ease");c.innerHTML=a;a=document.createElement("a");a.className="geAlertLink";a.style.textAlign="right";a.style.marginTop="20px";a.style.display="block";a.setAttribute("title",mxResources.get("close"));a.innerHTML=
mxResources.get("close");c.appendChild(a);mxEvent.addListener(a,"click",function(a){null!=c.parentNode&&(c.parentNode.removeChild(c),mxEvent.consume(a))});document.body.appendChild(c);window.setTimeout(function(){c.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(c.style,"transition","all 2s ease");c.style.opacity="0";window.setTimeout(function(){null!=c.parentNode&&c.parentNode.removeChild(c)},2E3)},15E3)}};
-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{this.hideDialog();var b=this.getDiagramId(),c=this.getCurrentFile();null!=c&&c.getHash()==b||this.loadFile(b,!0)}catch(n){null!=document.body&&this.handleError(n,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=
+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{this.hideDialog();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(u){}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(),p=null!=d?d.data:this.getFileData(),
-c=Editor.useLocalStorage;this.createFile(this.defaultFilename,p,null,null,null,null,null,!0);Editor.useLocalStorage=c;null!=d&&(c=this.getCurrentFile(),null!=c&&c.addUnsavedStatus())}}}),c=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=c&&0<c.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var b=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=
+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(q){}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(),n=null!=d?d.data:this.getFileData(),
+c=Editor.useLocalStorage;this.createFile(this.defaultFilename,n,null,null,null,null,null,!0);Editor.useLocalStorage=c;null!=d&&(c=this.getCurrentFile(),null!=c&&c.addUnsavedStatus())}}}),c=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=c&&0<c.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var b=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);isLocalStorage&&a++;var c=4>=a?2:6<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,!0,null,!0);Editor.useLocalStorage=c}else this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,this.getFileData(!0),null,b,null,!0,c)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,c,null,null,null,this.editor.fileExtensions);this.showDialog(b.container,400,a>c?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),c=decodeURIComponent(c);if("http://"!=c.substring(0,
-7)&&"https://"!=c.substring(0,8))try{null!=window.opener&&null!=window.opener[c]?d(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),b)}))}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(m){this.handleError(m)}};
+7)&&"https://"!=c.substring(0,8))try{null!=window.opener&&null!=window.opener[c]?d(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(g){this.handleError(g,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),b)}))}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 c=this.getServiceCount(!0,!0),b=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:2>c?230: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(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&b();else{a=4==c?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();b()}),a);this.showDialog(d.container,3>a?240:300,4<=c?440:this.isOfflineApp()?300:320,!0,!1);d.init()}};
App.prototype.addLanguageMenu=function(a,c){var b=null;if((!this.isOfflineApp()||mxClient.IS_CHROMEAPP)&&null!=this.menus.get("language")){b=document.createElement("div");b.setAttribute("title",mxResources.get("language"));b.className="geIcon geSprite geSprite-globe";b.style.position="absolute";b.style.cursor="pointer";b.style.bottom="20px";b.style.right="20px";if(c){b.style.direction="rtl";b.style.textAlign="right";b.style.right="24px";var d=document.createElement("span");d.style.display="inline-block";
@@ -9146,68 +9158,68 @@ d.style.fontSize="12px";d.style.margin="5px 24px 0 0";d.style.color="gray";d.sty
c.destroy()});var d=mxUtils.getOffset(b);c.popup(d.x,d.y+b.offsetHeight,null,a);this.setCurrentMenu(c)}));a.appendChild(b)}return b};
App.prototype.pickFile=function(a){try{if(a=null!=a?a:this.mode,a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var c=this.getPeerForMode(a);if(null!=c)c.pickFile();else if(a==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",mxUtils.bind(this,function(){null!=b.files&&
(this.openFiles(b.files),b.type="",b.type="file",b.value="")}));b.style.display="none";document.body.appendChild(b);this.openFileInputElt=b}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";var d=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,function(b,c){this.useCanvasForExport||".png"!=c.substring(c.length-
-4)||(c=c.substring(0,c.length-4)+".drawio");this.fileLoaded(a==App.MODE_BROWSER?new StorageFile(this,b,c):new LocalFile(this,b,c))}));var m=this.dialog,f=m.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(m,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(l){this.handleError(l)}};
-App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_GITLAB||a==App.MODE_TRELLO){var c=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=c&&c.pickLibrary(mxUtils.bind(this,function(a,b){if(null!=b)try{this.loadLibrary(b)}catch(l){this.handleError(l,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body,
-mxResources.get("loading"))&&c.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",mxUtils.bind(this,function(){if(null!=
-b.files){for(var a=0;a<b.files.length;a++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}});b.readAsText(a)})(b.files[a]);b.type="";b.type="file";b.value=""}}));b.style.display="none";document.body.appendChild(b);this.libFileInputElt=b}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";var d=Editor.useLocalStorage;
-Editor.useLocalStorage=a==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,c){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,b,c):new LocalLibrary(this,b,c))}catch(l){this.handleError(l,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=
+4)||(c=c.substring(0,c.length-4)+".drawio");this.fileLoaded(a==App.MODE_BROWSER?new StorageFile(this,b,c):new LocalFile(this,b,c))}));var g=this.dialog,e=g.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(g,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(k){this.handleError(k)}};
+App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_GITLAB||a==App.MODE_TRELLO){var c=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=c&&c.pickLibrary(mxUtils.bind(this,function(a,b){if(null!=b)try{this.loadLibrary(b)}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body,
+mxResources.get("loading"))&&c.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",mxUtils.bind(this,function(){if(null!=
+b.files){for(var a=0;a<b.files.length;a++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}});b.readAsText(a)})(b.files[a]);b.type="";b.type="file";b.value=""}}));b.style.display="none";document.body.appendChild(b);this.libFileInputElt=b}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";var d=Editor.useLocalStorage;
+Editor.useLocalStorage=a==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,c){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,b,c):new LocalLibrary(this,b,c))}catch(k){this.handleError(k,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=
d;window.openFile=null})}};
-App.prototype.saveLibrary=function(a,c,b,d,m,f,l){try{d=null!=d?d:this.mode;m=null!=m?m:!1;f=null!=f?f:!1;var n=this.createLibraryDataFromImages(c),p=mxUtils.bind(this,function(a){this.spinner.stop();null!=l&&l();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==b&&d==App.MODE_DEVICE&&(b=new LocalLibrary(this,n,a));if(null==b)this.pickFolder(d,mxUtils.bind(this,function(b){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
-n,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),p,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),p,b):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(a,n,mxUtils.bind(this,
-function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),p,b):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),p,b):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);
-this.libraryLoaded(a,c)}),p,b):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,n,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),p,b):d==App.MODE_BROWSER?(b=mxUtils.bind(this,function(){var b=new StorageLibrary(this,n,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,c)}),p)}),null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",
-[a]),b)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(m||this.spinner.spin(document.body,mxResources.get("saving"))){b.setData(n);var u=mxUtils.bind(this,function(){b.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);f||this.libraryLoaded(b,c);null!=l&&l()}),p)});if(a!=b.getTitle()){var g=b.getHash();b.rename(a,mxUtils.bind(this,function(a){b.constructor!=LocalLibrary&&g!=b.getHash()&&(mxSettings.removeCustomLibrary(g),mxSettings.addCustomLibrary(b.getHash()));
-this.removeLibrarySidebar(g);u()}),p)}else u()}}catch(k){this.handleError(k)}};
-App.prototype.saveFile=function(a,c){var b=this.getCurrentFile();if(null!=b){var d=mxUtils.bind(this,function(){this.removeDraft();this.getCurrentFile()==b||b.isModified()||(b.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=c&&c()});if(a||null==b.getTitle()||null==this.mode){var m=null!=b.getTitle()?b.getTitle():this.defaultFilename,f=!mxClient.IS_IOS||!navigator.standalone,l=this.mode,n=this.getServiceCount(!0);
-isLocalStorage&&n++;var p=4>=n?2:6<n?4:3,m=new CreateDialog(this,m,mxUtils.bind(this,function(a,b){null!=a&&0<a.length&&(null==l&&b==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,d)):"download"==b?(new LocalFile(this,null,a)).save():"_blank"==b?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0)):l!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,
-this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf(".")||/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)})):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,f,null,!0,p,null,null,null,this.editor.fileExtensions);this.showDialog(m.container,400,n>p?390:270,!0,!0);m.init()}else this.save(b.getTitle(),d)}};
-App.prototype.loadTemplate=function(a,c,b,d){var m=!1,f=a;this.editor.isCorsEnabledForUrl(f)||(f="t="+(new Date).getTime(),f=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+f,m=!0);var l=null!=d?d:a;this.loadUrl(f,mxUtils.bind(this,function(d){try{var f=m?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(d):atob(d):d;if(/(\.v(dx|sdx?))($|\?)/i.test(l)||this.isVisioData(f))this.importVisio(this.base64ToBlob(d.substring(d.indexOf(",")+1)),function(a){c(a)},b,l);else if(!this.isOffline()&&
-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(f,l))this.parseFile(new Blob([f],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&c(a.responseText)}),a);else if(this.isLucidChartData(f))this.convertLucidChart(f,mxUtils.bind(this,function(a){c(a)}),mxUtils.bind(this,function(a){b(a)}));else{if(/(\.png)($|\?)/i.test(l)||this.isPngData(f))f=this.extractGraphModelFromPng(d);c(f)}}catch(u){b(u)}}),
-b,/(\.png)($|\?)/i.test(l)||/(\.v(dx|sdx?))($|\?)/i.test(l),null,null,m)};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_GITLAB?this.gitLab:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
-App.prototype.createFile=function(a,c,b,d,m,f,l,n,p){d=n?null:null!=d?d:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){c=null!=c?c:this.emptyDiagramXml;var u=mxUtils.bind(this,function(){this.spinner.stop()}),g=mxUtils.bind(this,function(a){u();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});try{if(d==App.MODE_GOOGLE&&null!=this.drive)null==l&&null!=this.stateArg&&null!=this.stateArg.folderId&&(l=this.stateArg.folderId),
-this.drive.insertFile(a,c,l,mxUtils.bind(this,function(a){u();this.fileCreated(a,b,f,m,p)}),g);else if(d==App.MODE_GITHUB&&null!=this.gitHub)this.gitHub.insertFile(a,c,mxUtils.bind(this,function(a){u();this.fileCreated(a,b,f,m,p)}),g,!1,l);else if(d==App.MODE_GITLAB&&null!=this.gitLab)this.gitLab.insertFile(a,c,mxUtils.bind(this,function(a){u();this.fileCreated(a,b,f,m,p)}),g,!1,l);else if(d==App.MODE_TRELLO&&null!=this.trello)this.trello.insertFile(a,c,mxUtils.bind(this,function(a){u();this.fileCreated(a,
-b,f,m,p)}),g,!1,l);else if(d==App.MODE_DROPBOX&&null!=this.dropbox)this.dropbox.insertFile(a,c,mxUtils.bind(this,function(a){u();this.fileCreated(a,b,f,m,p)}),g);else if(d==App.MODE_ONEDRIVE&&null!=this.oneDrive)this.oneDrive.insertFile(a,c,mxUtils.bind(this,function(a){u();this.fileCreated(a,b,f,m,p)}),g,!1,l);else if(d==App.MODE_BROWSER){u();var k=mxUtils.bind(this,function(){var d=new StorageFile(this,c,a);d.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(d,b,f,m,p)}),g)});null==localStorage.getItem(a)?
-k():this.confirm(mxResources.get("replaceIt",[a]),k,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}else u(),this.fileCreated(new LocalFile(this,c,a,null==d),b,f,m,p)}catch(q){u(),this.handleError(q)}}};
-App.prototype.fileCreated=function(a,c,b,d,m){var f=window.location.pathname;null!=c&&0<c.length&&(f+="?libs="+c);null!=m&&0<m.length&&(f+="?clibs="+m);f=this.getUrl(f);a.getMode()!=App.MODE_DEVICE&&(f+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var l=a.getData(),l=0<l.length?this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,!0):null,n=window.location.protocol+"//"+window.location.hostname+f,p=l,u=null;null!=l&&/\.svg$/i.test(a.getTitle())&&
-(u=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(u.container),p=this.decodeNodeIntoGraph(p,u));a.setData(this.createFileData(l,u,a,n));null!=u&&u.container.parentNode.removeChild(u.container);var g=mxUtils.bind(this,function(){this.spinner.stop()}),k=mxUtils.bind(this,function(){g();var l=this.getCurrentFile();null==b&&null!=l&&(b=!l.isModified()&&null==l.getMode());var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);b&&a.addAllSavedStatus();
-null!=c&&this.sidebar.showEntries(c);if(null!=m){for(var d=[],f=m.split(";"),g=0;g<f.length;g++)d.push(decodeURIComponent(f[g]));this.loadLibraries(d)}}),p=mxUtils.bind(this,function(){b||null==l||!l.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=d&&d();null==b||b?p():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),
-null==a.getMode())),null!=d&&d(),window.openWindow(f,null,p))});a.constructor==LocalFile?k():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){k()}),mxUtils.bind(this,function(a){g();this.handleError(a)}))}};
-App.prototype.loadFile=function(a,c,b,d,m){this.hideDialog();var f=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var f=localStorage.getItem(a);if(null!=f)this.fileLoaded(new StorageFile(this,f,a)),null!=d&&d();else throw{message:mxResources.get("fileNotFound")};}catch(q){this.handleError(q,
+App.prototype.saveLibrary=function(a,c,b,d,g,e,k){try{d=null!=d?d:this.mode;g=null!=g?g:!1;e=null!=e?e:!1;var m=this.createLibraryDataFromImages(c),n=mxUtils.bind(this,function(a){this.spinner.stop();null!=k&&k();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==b&&d==App.MODE_DEVICE&&(b=new LocalLibrary(this,m,a));if(null==b)this.pickFolder(d,mxUtils.bind(this,function(b){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
+m,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(a,m,mxUtils.bind(this,
+function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);
+this.libraryLoaded(a,c)}),n,b):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_BROWSER?(b=mxUtils.bind(this,function(){var b=new StorageLibrary(this,m,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,c)}),n)}),null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",
+[a]),b)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(g||this.spinner.spin(document.body,mxResources.get("saving"))){b.setData(m);var q=mxUtils.bind(this,function(){b.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);e||this.libraryLoaded(b,c);null!=k&&k()}),n)});if(a!=b.getTitle()){var f=b.getHash();b.rename(a,mxUtils.bind(this,function(a){b.constructor!=LocalLibrary&&f!=b.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(b.getHash()));
+this.removeLibrarySidebar(f);q()}),n)}else q()}}catch(l){this.handleError(l)}};
+App.prototype.saveFile=function(a,c){var b=this.getCurrentFile();if(null!=b){var d=mxUtils.bind(this,function(){this.removeDraft();this.getCurrentFile()==b||b.isModified()||(b.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=c&&c()});if(a||null==b.getTitle()||null==this.mode){var g=null!=b.getTitle()?b.getTitle():this.defaultFilename,e=!mxClient.IS_IOS||!navigator.standalone,k=this.mode,m=this.getServiceCount(!0);
+isLocalStorage&&m++;var n=4>=m?2:6<m?4:3,g=new CreateDialog(this,g,mxUtils.bind(this,function(a,b){null!=a&&0<a.length&&(null==k&&b==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,d)):"download"==b?(new LocalFile(this,null,a)).save():"_blank"==b?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0)):k!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,
+this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf(".")||/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)})):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,e,null,!0,n,null,null,null,this.editor.fileExtensions);this.showDialog(g.container,400,m>n?390:270,!0,!0);g.init()}else this.save(b.getTitle(),d)}};
+App.prototype.loadTemplate=function(a,c,b,d){var g=!1,e=a;this.editor.isCorsEnabledForUrl(e)||(e="t="+(new Date).getTime(),e=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+e,g=!0);var k=null!=d?d:a;this.loadUrl(e,mxUtils.bind(this,function(d){try{var e=g?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(d):atob(d):d;if(/(\.v(dx|sdx?))($|\?)/i.test(k)||this.isVisioData(e))this.importVisio(this.base64ToBlob(d.substring(d.indexOf(",")+1)),function(a){c(a)},b,k);else if(!this.isOffline()&&
+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(e,k))this.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&c(a.responseText)}),a);else if(this.isLucidChartData(e))this.convertLucidChart(e,mxUtils.bind(this,function(a){c(a)}),mxUtils.bind(this,function(a){b(a)}));else{if(/(\.png)($|\?)/i.test(k)||this.isPngData(e))e=this.extractGraphModelFromPng(d);c(e)}}catch(q){b(q)}}),
+b,/(\.png)($|\?)/i.test(k)||/(\.v(dx|sdx?))($|\?)/i.test(k),null,null,g)};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_GITLAB?this.gitLab:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
+App.prototype.createFile=function(a,c,b,d,g,e,k,m,n){d=m?null:null!=d?d:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){c=null!=c?c:this.emptyDiagramXml;var q=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(a){q();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});try{if(d==App.MODE_GOOGLE&&null!=this.drive)null==k&&null!=this.stateArg&&null!=this.stateArg.folderId&&(k=this.stateArg.folderId),
+this.drive.insertFile(a,c,k,mxUtils.bind(this,function(a){q();this.fileCreated(a,b,e,g,n)}),f);else if(d==App.MODE_GITHUB&&null!=this.gitHub)this.gitHub.insertFile(a,c,mxUtils.bind(this,function(a){q();this.fileCreated(a,b,e,g,n)}),f,!1,k);else if(d==App.MODE_GITLAB&&null!=this.gitLab)this.gitLab.insertFile(a,c,mxUtils.bind(this,function(a){q();this.fileCreated(a,b,e,g,n)}),f,!1,k);else if(d==App.MODE_TRELLO&&null!=this.trello)this.trello.insertFile(a,c,mxUtils.bind(this,function(a){q();this.fileCreated(a,
+b,e,g,n)}),f,!1,k);else if(d==App.MODE_DROPBOX&&null!=this.dropbox)this.dropbox.insertFile(a,c,mxUtils.bind(this,function(a){q();this.fileCreated(a,b,e,g,n)}),f);else if(d==App.MODE_ONEDRIVE&&null!=this.oneDrive)this.oneDrive.insertFile(a,c,mxUtils.bind(this,function(a){q();this.fileCreated(a,b,e,g,n)}),f,!1,k);else if(d==App.MODE_BROWSER){q();var l=mxUtils.bind(this,function(){var d=new StorageFile(this,c,a);d.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(d,b,e,g,n)}),f)});null==localStorage.getItem(a)?
+l():this.confirm(mxResources.get("replaceIt",[a]),l,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}else q(),this.fileCreated(new LocalFile(this,c,a,null==d),b,e,g,n)}catch(p){q(),this.handleError(p)}}};
+App.prototype.fileCreated=function(a,c,b,d,g){var e=window.location.pathname;null!=c&&0<c.length&&(e+="?libs="+c);null!=g&&0<g.length&&(e+="?clibs="+g);e=this.getUrl(e);a.getMode()!=App.MODE_DEVICE&&(e+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var k=a.getData(),k=0<k.length?this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0):null,m=window.location.protocol+"//"+window.location.hostname+e,n=k,q=null;null!=k&&/\.svg$/i.test(a.getTitle())&&
+(q=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(q.container),n=this.decodeNodeIntoGraph(n,q));a.setData(this.createFileData(k,q,a,m));null!=q&&q.container.parentNode.removeChild(q.container);var f=mxUtils.bind(this,function(){this.spinner.stop()}),l=mxUtils.bind(this,function(){f();var k=this.getCurrentFile();null==b&&null!=k&&(b=!k.isModified()&&null==k.getMode());var l=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);b&&a.addAllSavedStatus();
+null!=c&&this.sidebar.showEntries(c);if(null!=g){for(var d=[],e=g.split(";"),f=0;f<e.length;f++)d.push(decodeURIComponent(e[f]));this.loadLibraries(d)}}),n=mxUtils.bind(this,function(){b||null==k||!k.isModified()?l():this.confirm(mxResources.get("allChangesLost"),null,l,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=d&&d();null==b||b?n():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),
+null==a.getMode())),null!=d&&d(),window.openWindow(e,null,n))});a.constructor==LocalFile?l():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){l()}),mxUtils.bind(this,function(a){f();this.handleError(a)}))}};
+App.prototype.loadFile=function(a,c,b,d,g){this.hideDialog();var e=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var e=localStorage.getItem(a);if(null!=e)this.fileLoaded(new StorageFile(this,e,a)),null!=d&&d();else throw{message:mxResources.get("fileNotFound")};}catch(p){this.handleError(p,
mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=b)this.spinner.stop(),this.fileLoaded(b),null!=d&&d();else if("S"==a.charAt(0)){this.spinner.stop();try{this.loadDescriptor(JSON.parse(Graph.decompress(a.substring(1))),
-d,mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}}else if("R"==a.charAt(0))this.spinner.stop(),f=decodeURIComponent(a.substring(1)),"<"!=f.charAt(0)&&(f=Graph.decompress(f)),f=new LocalFile(this,f,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),f.getHash=function(){return a},this.fileLoaded(f),null!=d&&d();else if("U"==a.charAt(0)){var l=decodeURIComponent(a.substring(1)),
-g=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=l.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var a=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var a=l.substring(31,l.lastIndexOf("&ex"));this.loadFile("G"+a,c,null,mxUtils.bind(this,function(){var b=this.getCurrentFile();null!=b&&this.editor.chromeless&&!this.editor.editable&&(b.getHash=function(){return"G"+a},window.location.hash="#"+b.getHash());
-null!=d&&d()}));return!0}return!1});!a()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",a);return!0});this.loadTemplate(l,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0<b.length){var c=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var d=l,f=l.lastIndexOf("."),k=d.lastIndexOf("/");f>k&&0<k&&(d=d.substring(k+1,f),f=l.substring(f),this.useCanvasForExport||".png"!=f||(f=".drawio"),".svg"===f||".xml"===f||".html"===
-f||".png"===f||".drawio"===f)&&(c=d+f)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b,!0)||g()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else g()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){g()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},
-mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else if(f=null,"G"==a.charAt(0)?f=this.drive:"D"==a.charAt(0)?f=this.dropbox:"W"==a.charAt(0)?f=this.oneDrive:"H"==a.charAt(0)?f=this.gitHub:"A"==a.charAt(0)?f=this.gitLab:"T"==a.charAt(0)&&(f=this.trello),null==f)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();
-window.location.hash=null!=a?a.getHash():""}));else{var k=a.charAt(0);a=decodeURIComponent(a.substring(1));f.getFile(a,mxUtils.bind(this,function(b){this.spinner.stop();this.fileLoaded(b);var c=this.getCurrentFile();null==c?(window.location.hash="",this.showSplash()):this.editor.chromeless&&!this.editor.editable?(c.getHash=function(){return k+a},window.location.hash="#"+c.getHash()):b==c&&null==b.getMode()&&(b=mxResources.get("copyCreated"),this.editor.setStatus('<div title="'+b+'" class="geStatusAlert" style="overflow:hidden;">'+
-b+"</div>"));null!=d&&d()}),mxUtils.bind(this,function(b){null!=window.console&&null!=b&&console.log("error in loadFile:",a,b);this.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null,mxUtils.bind(this,function(){var a=this.getCurrentFile();null==a?(window.location.hash="",this.showSplash()):window.location.hash="#"+a.getHash()}))}))}}),l=this.getCurrentFile(),n=mxUtils.bind(this,function(){m||null==l||!l.isModified()?f():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,
-function(){null!=l&&(window.location.hash=l.getHash())}),f,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==a||0==a.length?n():null!=l&&l.isModified()&&!c?window.openWindow(this.getUrl()+"#"+a,null,n):n()};
+d,mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}catch(p){this.handleError(p,mxResources.get("errorLoadingFile"))}}else if("R"==a.charAt(0))this.spinner.stop(),e=decodeURIComponent(a.substring(1)),"<"!=e.charAt(0)&&(e=Graph.decompress(e)),e=new LocalFile(this,e,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0),e.getHash=function(){return a},this.fileLoaded(e),null!=d&&d();else if("U"==a.charAt(0)){var g=decodeURIComponent(a.substring(1)),
+f=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=g.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var a=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var a=g.substring(31,g.lastIndexOf("&ex"));this.loadFile("G"+a,c,null,mxUtils.bind(this,function(){var b=this.getCurrentFile();null!=b&&this.editor.chromeless&&!this.editor.editable&&(b.getHash=function(){return"G"+a},window.location.hash="#"+b.getHash());
+null!=d&&d()}));return!0}return!1});!a()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",a);return!0});this.loadTemplate(g,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0<b.length){var c=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var d=g,e=g.lastIndexOf("."),k=d.lastIndexOf("/");e>k&&0<k&&(d=d.substring(k+1,e),e=g.substring(e),this.useCanvasForExport||".png"!=e||(e=".drawio"),".svg"===e||".xml"===e||".html"===
+e||".png"===e||".drawio"===e)&&(c=d+e)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b,!0)||f()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else f()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){f()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},
+mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else if(e=null,"G"==a.charAt(0)?e=this.drive:"D"==a.charAt(0)?e=this.dropbox:"W"==a.charAt(0)?e=this.oneDrive:"H"==a.charAt(0)?e=this.gitHub:"A"==a.charAt(0)?e=this.gitLab:"T"==a.charAt(0)&&(e=this.trello),null==e)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();
+window.location.hash=null!=a?a.getHash():""}));else{var k=a.charAt(0);a=decodeURIComponent(a.substring(1));e.getFile(a,mxUtils.bind(this,function(b){this.spinner.stop();this.fileLoaded(b);var c=this.getCurrentFile();null==c?(window.location.hash="",this.showSplash()):this.editor.chromeless&&!this.editor.editable?(c.getHash=function(){return k+a},window.location.hash="#"+c.getHash()):b==c&&null==b.getMode()&&(b=mxResources.get("copyCreated"),this.editor.setStatus('<div title="'+b+'" class="geStatusAlert" style="overflow:hidden;">'+
+b+"</div>"));null!=d&&d()}),mxUtils.bind(this,function(b){null!=window.console&&null!=b&&console.log("error in loadFile:",a,b);this.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null,mxUtils.bind(this,function(){var a=this.getCurrentFile();null==a?(window.location.hash="",this.showSplash()):window.location.hash="#"+a.getHash()}))}))}}),k=this.getCurrentFile(),m=mxUtils.bind(this,function(){g||null==k||!k.isModified()?e():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,
+function(){null!=k&&(window.location.hash=k.getHash())}),e,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==a||0==a.length?m():null!=k&&k.isModified()&&!c?window.openWindow(this.getUrl()+"#"+a,null,m):m()};
App.prototype.getLibraryStorageHint=function(a){var c=a.getTitle();a.constructor!=LocalLibrary&&(c+="\n"+a.getHash());a.constructor==DriveLibrary?c+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?c+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?c+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?c+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?c+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?c+=" ("+
mxResources.get("browser")+")":a.constructor==LocalLibrary&&(c+=" ("+mxResources.get("device")+")");return c};App.prototype.restoreLibraries=function(){this.loadLibraries(mxSettings.getCustomLibraries(),mxUtils.bind(this,function(){this.loadLibraries((urlParams.clibs||"").split(";"))}))};
-App.prototype.loadLibraries=function(a,c){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var b=mxUtils.bind(this,function(a,b){b||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),d=0,m=[],f=mxUtils.bind(this,function(){if(0==d){if(null!=a)for(var b=a.length-1;0<=b;b--)null!=m[b]&&this.loadLibrary(m[b]);null!=c&&c()}});if(null!=a)for(var l=0;l<a.length;l++){var n=encodeURIComponent(decodeURIComponent(a[l]));mxUtils.bind(this,function(a,c){if(null!=
-a&&0<a.length&&null==this.pendingLibraries[a]&&null==this.sidebar.palettes[a]){d++;var g=mxUtils.bind(this,function(b){delete this.pendingLibraries[a];m[c]=b;d--;f()}),l=mxUtils.bind(this,function(c){b(a,c);d--;f()});this.pendingLibraries[a]=!0;var n=a.substring(0,1);if("L"==n)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var b=decodeURIComponent(a.substring(1));this.getLocalData(b,mxUtils.bind(this,function(a){".scratchpad"==b&&null==a&&(a=this.emptyLibraryXml);
-null!=a?g(new StorageLibrary(this,a,b)):l()}))}catch(z){l()}}),0);else if("U"==n){var p=decodeURIComponent(a.substring(1));if(!this.isOffline()){n=p;this.editor.isCorsEnabledForUrl(n)||(n="t="+(new Date).getTime(),n=PROXY_URL+"?url="+encodeURIComponent(p)+"&"+n);try{mxUtils.get(n,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{g(new UrlLibrary(this,a.getText(),p))}catch(z){l()}else l()}),function(){l()})}catch(A){l()}}}else if("R"==n){if(n=decodeURIComponent(a.substring(1)),
-!this.isOffline())try{var n=JSON.parse(n),u={id:n[0],title:n[1],downloadUrl:n[2]};this.remoteInvoke("getFileContent",[u.downloadUrl],null,mxUtils.bind(this,function(a){try{g(new RemoteLibrary(this,a,u))}catch(z){l()}}),function(){l()})}catch(A){l()}}else if("S"==n&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(a.substring(1)),function(a){g(a)},l)}catch(A){l()}else{var t=null;"G"==n?null!=this.drive&&null!=this.drive.user&&(t=this.drive):"H"==n?null!=this.gitHub&&null!=this.gitHub.getUser()&&
-(t=this.gitHub):"T"==n?null!=this.trello&&this.trello.isAuthorized()&&(t=this.trello):"D"==n?null!=this.dropbox&&null!=this.dropbox.getUser()&&(t=this.dropbox):"W"==n&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(t=this.oneDrive);null!=t?t.getLibrary(decodeURIComponent(a.substring(1)),mxUtils.bind(this,function(a){try{g(a)}catch(z){l()}}),function(a){l()}):l(!0)}}})(n,l)}f()}};
+App.prototype.loadLibraries=function(a,c){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var b=mxUtils.bind(this,function(a,b){b||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),d=0,g=[],e=mxUtils.bind(this,function(){if(0==d){if(null!=a)for(var b=a.length-1;0<=b;b--)null!=g[b]&&this.loadLibrary(g[b]);null!=c&&c()}});if(null!=a)for(var k=0;k<a.length;k++){var m=encodeURIComponent(decodeURIComponent(a[k]));mxUtils.bind(this,function(a,c){if(null!=
+a&&0<a.length&&null==this.pendingLibraries[a]&&null==this.sidebar.palettes[a]){d++;var f=mxUtils.bind(this,function(b){delete this.pendingLibraries[a];g[c]=b;d--;e()}),k=mxUtils.bind(this,function(c){b(a,c);d--;e()});this.pendingLibraries[a]=!0;var n=a.substring(0,1);if("L"==n)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var b=decodeURIComponent(a.substring(1));this.getLocalData(b,mxUtils.bind(this,function(a){".scratchpad"==b&&null==a&&(a=this.emptyLibraryXml);
+null!=a?f(new StorageLibrary(this,a,b)):k()}))}catch(y){k()}}),0);else if("U"==n){var m=decodeURIComponent(a.substring(1));if(!this.isOffline()){n=m;this.editor.isCorsEnabledForUrl(n)||(n="t="+(new Date).getTime(),n=PROXY_URL+"?url="+encodeURIComponent(m)+"&"+n);try{mxUtils.get(n,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{f(new UrlLibrary(this,a.getText(),m))}catch(y){k()}else k()}),function(){k()})}catch(z){k()}}}else if("R"==n){if(n=decodeURIComponent(a.substring(1)),
+!this.isOffline())try{var n=JSON.parse(n),q={id:n[0],title:n[1],downloadUrl:n[2]};this.remoteInvoke("getFileContent",[q.downloadUrl],null,mxUtils.bind(this,function(a){try{f(new RemoteLibrary(this,a,q))}catch(y){k()}}),function(){k()})}catch(z){k()}}else if("S"==n&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(a.substring(1)),function(a){f(a)},k)}catch(z){k()}else{var t=null;"G"==n?null!=this.drive&&null!=this.drive.user&&(t=this.drive):"H"==n?null!=this.gitHub&&null!=this.gitHub.getUser()&&
+(t=this.gitHub):"T"==n?null!=this.trello&&this.trello.isAuthorized()&&(t=this.trello):"D"==n?null!=this.dropbox&&null!=this.dropbox.getUser()&&(t=this.dropbox):"W"==n&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(t=this.oneDrive);null!=t?t.getLibrary(decodeURIComponent(a.substring(1)),mxUtils.bind(this,function(a){try{f(a)}catch(y){k()}}),function(a){k()}):k(!0)}}})(m,k)}e()}};
App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer){var a=this.getCurrentFile();this.commentsSupported()?null==this.commentButton&&(this.commentButton=document.createElement("a"),this.commentButton.setAttribute("title",mxResources.get("comments")),this.commentButton.className="geToolbarButton",this.commentButton.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;float:left;cursor:pointer;width:24px;height:24px;background-size:24px 24px;background-position:center center;background-repeat:no-repeat;background-image:url("+
Editor.commentImage+");","atlas"==uiTheme?(this.commentButton.style.marginRight="10px",this.commentButton.style.marginTop="-3px"):this.commentButton.style.marginTop="min"==uiTheme?"1px":"-5px",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),this.buttonContainer.appendChild(this.commentButton),"dark"==uiTheme||"atlas"==uiTheme)&&(this.commentButton.style.filter="invert(100%)"):null!=this.commentButton&&(this.commentButton.parentNode.removeChild(this.commentButton),
this.commentButton=null);null!=a&&a.constructor==DriveFile?null==this.shareButton&&(this.shareButton=document.createElement("div"),this.shareButton.className="geBtn gePrimaryBtn",this.shareButton.style.display="inline-block",this.shareButton.style.backgroundColor="#F2931E",this.shareButton.style.borderColor="#F08705",this.shareButton.style.backgroundImage="none",this.shareButton.style.padding="2px 10px 0 10px",this.shareButton.style.marginTop="-10px",this.shareButton.style.height="28px",this.shareButton.style.lineHeight=
"28px",this.shareButton.style.minWidth="0px",this.shareButton.style.cssFloat="right",this.shareButton.setAttribute("title",mxResources.get("share")),a=document.createElement("img"),a.setAttribute("src",this.shareImage),a.setAttribute("align","absmiddle"),a.style.marginRight="4px",a.style.marginTop="-3px",this.shareButton.appendChild(a),"dark"!=uiTheme&&"atlas"!=uiTheme&&(this.shareButton.style.color="black",a.style.filter="invert(100%)"),mxUtils.write(this.shareButton,mxResources.get("share")),mxEvent.addListener(this.shareButton,
"click",mxUtils.bind(this,function(){this.actions.get("share").funct()})),this.buttonContainer.appendChild(this.shareButton)):null!=this.shareButton&&(this.shareButton.parentNode.removeChild(this.shareButton),this.shareButton=null)}};
-App.prototype.save=function(a,c){var b=this.getCurrentFile(),d=mxResources.get("saving");if(null!=b&&this.spinner.spin(document.body,d)){this.editor.setStatus("");this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.bind(this,function(){b.handleFileSuccess(!0);null!=c&&c()}),m=mxUtils.bind(this,function(a){b.handleFileError(a,!0)});try{a==b.getTitle()?b.save(!0,d,m):b.saveAs(a,d,m)}catch(f){b.handleFileError(f,!0)}}};
-App.prototype.pickFolder=function(a,c,b,d,m){b=null!=b?b:!0;var f=this.spinner.pause();b&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){f();if(a.action==google.picker.Action.PICKED){var b=null;null!=a.docs&&0<a.docs.length&&"folder"==a.docs[0].type&&(b=a.docs[0].id);c(b)}}),m):b&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){f();null!=a&&null!=a.value&&0<a.value.length&&(a=OneDriveFile.prototype.getIdOf(a.value[0]),
-c(a))}),d):b&&a==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(a){f();c(a)})):b&&a==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(a){f();c(a)})):b&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){f();c(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)};
-App.prototype.exportFile=function(a,c,b,d,m,f){m==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)})):m==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(c,a,f,mxUtils.bind(this,function(a){this.spinner.stop()}),
-mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),b,d):m==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,f):m==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(c,a,mxUtils.bind(this,
-function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!0,f,d):m==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,f):m==App.MODE_BROWSER&&(b=mxUtils.bind(this,function(){localStorage.setItem(c,a)}),null==localStorage.getItem(c)?
+App.prototype.save=function(a,c){var b=this.getCurrentFile(),d=mxResources.get("saving");if(null!=b&&this.spinner.spin(document.body,d)){this.editor.setStatus("");this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.bind(this,function(){b.handleFileSuccess(!0);null!=c&&c()}),g=mxUtils.bind(this,function(a){b.handleFileError(a,!0)});try{a==b.getTitle()?b.save(!0,d,g):b.saveAs(a,d,g)}catch(e){b.handleFileError(e,!0)}}};
+App.prototype.pickFolder=function(a,c,b,d,g){b=null!=b?b:!0;var e=this.spinner.pause();b&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){e();if(a.action==google.picker.Action.PICKED){var b=null;null!=a.docs&&0<a.docs.length&&"folder"==a.docs[0].type&&(b=a.docs[0].id);c(b)}}),g):b&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){e();null!=a&&null!=a.value&&0<a.value.length&&(a=OneDriveFile.prototype.getIdOf(a.value[0]),
+c(a))}),d):b&&a==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(a){e();c(a)})):b&&a==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(a){e();c(a)})):b&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){e();c(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)};
+App.prototype.exportFile=function(a,c,b,d,g,e){g==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)})):g==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(c,a,e,mxUtils.bind(this,function(a){this.spinner.stop()}),
+mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),b,d):g==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,e):g==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(c,a,mxUtils.bind(this,
+function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!0,e,d):g==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(c,d?this.base64ToBlob(a,b):a,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),!1,e):g==App.MODE_BROWSER&&(b=mxUtils.bind(this,function(){localStorage.setItem(c,a)}),null==localStorage.getItem(c)?
b():this.confirm(mxResources.get("replaceIt",[c]),b))};
App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var c=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,c);this.fname.setAttribute("title",c+" - "+mxResources.get("rename"))}var c=this.editor.graph,b=a.isEditable()&&!a.invalidChecksum;c.isEnabled()&&!b&&c.reset();c.setEnabled(b);null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length?
window.location.hash=a:0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null!=this.format&&this.editor.graph.isSelectionEmpty()&&this.format.refresh()};
-App.prototype.showAuthDialog=function(a,c,b,d){var m=this.spinner.pause();this.showDialog((new AuthDialog(this,a,c,mxUtils.bind(this,function(a){try{null!=b&&b(a,mxUtils.bind(this,function(){this.hideDialog();m()}))}catch(l){this.editor.setStatus(mxUtils.htmlEntities(l.message))}}))).container,300,c?180:140,!0,!0,mxUtils.bind(this,function(a){null!=d&&d();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
-App.prototype.convertFile=function(a,c,b,d,m,f){var l=c;/\.svg$/i.test(l)||(l=l.substring(0,c.lastIndexOf("."))+d);var n=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(n=!0);if(/\.v(dx|sdx?)$/i.test(c)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var p=new XMLHttpRequest;p.open("GET",a,!0);n||(p.responseType="blob");p.onload=mxUtils.bind(this,function(){if(200<=p.status&&299>=p.status){var a=null;n?(a=
-JSON.parse(p.responseText),a=this.base64ToBlob(a.content,"application/octet-stream")):a=new Blob([p.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){m(new LocalFile(this,a,l,!0))}),f,c)}else null!=f&&f({message:mxResources.get("errorLoadingFile")})});p.onerror=f;p.send()}else{var u=mxUtils.bind(this,function(b){try{/\.png$/i.test(c)?(temp=this.extractGraphModelFromPng(b),null!=temp?m(new LocalFile(this,temp,l,!0)):m(new LocalFile(this,b,c,!0))):Graph.fileSupport&&
-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?m(new LocalFile(this,a.responseText,l,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}),c):m(new LocalFile(this,b,l,!0))}catch(k){null!=f&&f(k)}});b=/\.png$/i.test(c)||/\.jpe?g$/i.test(c)||null!=b&&"image/"==b.substring(0,6);n?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&
-299>=a.getStatus()){if(null!=m){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(c)?"data:image/png;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));u(b)}}else null!=f&&f({code:App.ERROR_UNKNOWN})}),function(){null!=f&&f({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=f&&f({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,u,f,b)}};
+App.prototype.showAuthDialog=function(a,c,b,d){var g=this.spinner.pause();this.showDialog((new AuthDialog(this,a,c,mxUtils.bind(this,function(a){try{null!=b&&b(a,mxUtils.bind(this,function(){this.hideDialog();g()}))}catch(k){this.editor.setStatus(mxUtils.htmlEntities(k.message))}}))).container,300,c?180:140,!0,!0,mxUtils.bind(this,function(a){null!=d&&d();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
+App.prototype.convertFile=function(a,c,b,d,g,e){var k=c;/\.svg$/i.test(k)||(k=k.substring(0,c.lastIndexOf("."))+d);var m=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(m=!0);if(/\.v(dx|sdx?)$/i.test(c)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var n=new XMLHttpRequest;n.open("GET",a,!0);m||(n.responseType="blob");n.onload=mxUtils.bind(this,function(){if(200<=n.status&&299>=n.status){var a=null;m?(a=
+JSON.parse(n.responseText),a=this.base64ToBlob(a.content,"application/octet-stream")):a=new Blob([n.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){g(new LocalFile(this,a,k,!0))}),e,c)}else null!=e&&e({message:mxResources.get("errorLoadingFile")})});n.onerror=e;n.send()}else{var q=mxUtils.bind(this,function(b){try{/\.png$/i.test(c)?(temp=this.extractGraphModelFromPng(b),null!=temp?g(new LocalFile(this,temp,k,!0)):g(new LocalFile(this,b,c,!0))):Graph.fileSupport&&
+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(new LocalFile(this,a.responseText,k,!0)):null!=e&&e({message:mxResources.get("errorLoadingFile")}))}),c):g(new LocalFile(this,b,k,!0))}catch(l){null!=e&&e(l)}});b=/\.png$/i.test(c)||/\.jpe?g$/i.test(c)||null!=b&&"image/"==b.substring(0,6);m?mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&
+299>=a.getStatus()){if(null!=g){a=JSON.parse(a.getText());var b=a.content;"base64"===a.encoding&&(b=/\.png$/i.test(c)?"data:image/png;base64,"+b:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(b):atob(b));q(b)}}else null!=e&&e({code:App.ERROR_UNKNOWN})}),function(){null!=e&&e({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=e&&e({code:App.ERROR_TIMEOUT,retry:fn})}):this.loadUrl(a,q,e,b)}};
App.prototype.updateHeader=function(){if(null!=this.menubar){this.appIcon=document.createElement("a");this.appIcon.style.display="block";this.appIcon.style.position="absolute";this.appIcon.style.width="28px";this.appIcon.style.height=this.menubarHeight-28+"px";this.appIcon.style.margin="14px 0px 8px 20px";this.appIcon.style.opacity="0.75";this.appIcon.style.borderRadius="3px";"dark"!=uiTheme&&(this.appIcon.style.backgroundColor="#f08705");mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,
"click",mxUtils.bind(this,function(a){this.appIconClicked(a)}));var a=mxClient.IS_SVG?"dark"==uiTheme?"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjgiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTAwOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGc+PHBhdGgKICAgICAgICAgZD0iTTUyLjc3Myw3Ny4wODRjMCwxLjk1NC0xLjU5OSwzLjU1My0zLjU1MywzLjU1M0gzNi45OTljLTEuOTU0LDAtMy41NTMtMS41OTktMy41NTMtMy41NTN2LTkuMzc5ICAgIGMwLTEuOTU0LDEuNTk5LTMuNTUzLDMuNTUzLTMuNTUzaDEyLjIyMmMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjc3LjA4NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnCiAgICAgICBpZD0iZzM0MTkiPjxwYXRoCiAgICAgICAgIGQ9Ik02Ny43NjIsNDguMDc0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINTEuOTg4Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M0g2NC4yMWMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjQ4LjA3NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnPjxwYXRoCiAgICAgICAgIGQ9Ik04Mi43NTIsNzcuMDg0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINjYuOTc3Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M2gxMi4yMjJjMS45NTQsMCwzLjU1MywxLjU5OSwzLjU1MywzLjU1M1Y3Ny4wODR6IgogICAgICAgICBmaWxsPSIjRkZGRkZGIiAvPjwvZz48L2c+PC9zdmc+)":
"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJFYmVuZV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMjI1IDIyNSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjI1IDIyNTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MXtmaWxsOiNERjZDMEM7fQoJLnN0MntmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPgo8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMjI1LDIxNS40YzAsNS4zLTQuMyw5LjYtOS41LDkuNmwwLDBINzcuMWwtNDQuOC00NS41TDYwLjIsMTM0bDgyLjctMTAyLjdsODIuMSw4NC41VjIxNS40eiIvPgo8cGF0aCBjbGFzcz0ic3QyIiBkPSJNMTg0LjYsMTI1LjhoLTIzLjdsLTI1LTQyLjdjNS43LTEuMiw5LjgtNi4yLDkuNy0xMlYzOWMwLTYuOC01LjQtMTIuMy0xMi4yLTEyLjNoLTAuMUg5MS42CgljLTYuOCwwLTEyLjMsNS40LTEyLjMsMTIuMlYzOXYzMi4xYzAsNS44LDQsMTAuOCw5LjcsMTJsLTI1LDQyLjdINDAuNGMtNi44LDAtMTIuMyw1LjQtMTIuMywxMi4ydjAuMXYzMi4xCgljMCw2LjgsNS40LDEyLjMsMTIuMiwxMi4zaDAuMWg0MS43YzYuOCwwLDEyLjMtNS40LDEyLjMtMTIuMnYtMC4xdi0zMi4xYzAtNi44LTUuNC0xMi4zLTEyLjItMTIuM2gtMC4xaC00bDI0LjgtNDIuNGgxOS4zCglsMjQuOSw0Mi40SDE0M2MtNi44LDAtMTIuMyw1LjQtMTIuMywxMi4ydjAuMXYzMi4xYzAsNi44LDUuNCwxMi4zLDEyLjIsMTIuM2gwLjFoNDEuN2M2LjgsMCwxMi4zLTUuNCwxMi4zLTEyLjJ2LTAuMXYtMzIuMQoJYzAtNi44LTUuNC0xMi4zLTEyLjItMTIuM0MxODQuNywxMjUuOCwxODQuNywxMjUuOCwxODQuNiwxMjUuOHoiLz4KPC9zdmc+Cg==)":
@@ -9231,126 +9243,126 @@ App.prototype.toggleCompactMode=function(a){a||"none"!=this.appIcon.style.displa
App.prototype.updateUserElement=function(){if(null!=this.drive&&null!=this.drive.getUser()||null!=this.oneDrive&&null!=this.oneDrive.getUser()||null!=this.dropbox&&null!=this.dropbox.getUser()||null!=this.gitHub&&null!=this.gitHub.getUser()||null!=this.gitLab&&null!=this.gitLab.getUser()||null!=this.trello&&this.trello.isAuthorized()){null==this.userElement&&(this.userElement=document.createElement("a"),this.userElement.className="geItem",this.userElement.style.position="absolute",this.userElement.style.fontSize=
"8pt",this.userElement.style.top="atlas"==uiTheme?"8px":"2px",this.userElement.style.right="30px",this.userElement.style.margin="4px",this.userElement.style.padding="2px",this.userElement.style.paddingRight="16px",this.userElement.style.verticalAlign="middle",this.userElement.style.backgroundImage="url("+IMAGE_PATH+"/expanded.gif)",this.userElement.style.backgroundPosition="100% 60%",this.userElement.style.backgroundRepeat="no-repeat",this.menubarContainer.appendChild(this.userElement),mxEvent.addListener(this.userElement,
mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()})),mxEvent.addListener(this.userElement,"click",mxUtils.bind(this,function(a){if(null==this.userPanel){var b=document.createElement("div");b.className="geDialog";b.style.position="absolute";b.style.top=this.userElement.clientTop+this.userElement.clientHeight+6+"px";b.style.right="36px";b.style.padding="0px";b.style.cursor="default";this.userPanel=b}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);
-else{var c=!1;this.userPanel.innerHTML="";b=document.createElement("img");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("close"));b.className="geDialogClose";b.style.top="8px";b.style.right="8px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)}));this.userPanel.appendChild(b);if(null!=this.drive&&(b=this.drive.getUsersList(),0<b.length)){var m=mxUtils.bind(this,
-function(a,b){var c=this.getCurrentFile();null!=c&&c.constructor==DriveFile?(this.spinner.spin(document.body,b),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,function(){this.spinner.stop();a()}),2E3)):a()}),f=mxUtils.bind(this,function(a){var b=document.createElement("tr");b.style.cssText=a.isCurrent?"":"background-color: whitesmoke; cursor: pointer";b.setAttribute("title","User ID: "+a.id);b.innerHTML='<td valign="middle" style="height: 59px;width: 66px;'+(a.isCurrent?"":"border-top: 1px solid rgb(224, 224, 224);")+
+else{var c=!1;this.userPanel.innerHTML="";b=document.createElement("img");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("close"));b.className="geDialogClose";b.style.top="8px";b.style.right="8px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)}));this.userPanel.appendChild(b);if(null!=this.drive&&(b=this.drive.getUsersList(),0<b.length)){var g=mxUtils.bind(this,
+function(a,b){var c=this.getCurrentFile();null!=c&&c.constructor==DriveFile?(this.spinner.spin(document.body,b),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,function(){this.spinner.stop();a()}),2E3)):a()}),e=mxUtils.bind(this,function(a){var b=document.createElement("tr");b.style.cssText=a.isCurrent?"":"background-color: whitesmoke; cursor: pointer";b.setAttribute("title","User ID: "+a.id);b.innerHTML='<td valign="middle" style="height: 59px;width: 66px;'+(a.isCurrent?"":"border-top: 1px solid rgb(224, 224, 224);")+
'"><img width="50" height="50" style="margin: 4px 8px 0 8px;border-radius:50%;" src="'+(null!=a.pictureUrl?a.pictureUrl:this.defaultUserPicture)+'"/></td><td valign="middle" style="white-space:nowrap;'+(null!=a.pictureUrl?"padding-top:4px;":"")+(a.isCurrent?"":"border-top: 1px solid rgb(224, 224, 224);")+'">'+mxUtils.htmlEntities(a.displayName)+'<br><small style="color:gray;">'+mxUtils.htmlEntities(a.email)+'</small><div style="margin-top:4px;"><i>'+mxResources.get("googleDrive")+"</i></div>";a.isCurrent||
-mxEvent.addListener(b,"click",mxUtils.bind(this,function(b){m(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(a);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}),mxResources.get("closingFile")+"...");mxEvent.consume(b)}));return b}),c=!0,l=document.createElement("table");l.style.cssText="font-size:10pt;padding: 20px 0 0 0;min-width: 300px;border-spacing: 0;";
-for(var n=0;n<b.length;n++)l.appendChild(f(b[n]));this.userPanel.appendChild(l);b=document.createElement("div");b.style.textAlign="left";b.style.padding="8px";b.style.whiteSpace="nowrap";b.style.borderTop="1px solid rgb(224, 224, 224)";f=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){m(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),
-mxResources.get("signOut"))}))}));f.className="geBtn";f.style["float"]="right";b.appendChild(f);f=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var a=this.drive.createAuthWin();a.blur();window.focus();m(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(a){this.handleError(a)}),!0,a)}),mxResources.get("closingFile")+"...")}));
-f.className="geBtn";f.style.margin="0px";b.appendChild(f);this.userPanel.appendChild(b)}b=mxUtils.bind(this,function(a,b,d,f){if(null!=a){c&&this.userPanel.appendChild(document.createElement("hr"));c=!0;var g=document.createElement("table");g.style.cssText="font-size:10pt;padding:"+(c?"10":"20")+"px 20px 10px 10px;";g.innerHTML+='<tr><td valign="top">'+(null!=b?'<img style="margin-right:6px;" src="'+b+'" width="40" height="40"/></td>':"")+'<td valign="middle" style="white-space:nowrap;">'+mxUtils.htmlEntities(a.displayName)+
-(null!=a.email?'<br><small style="color:gray;">'+mxUtils.htmlEntities(a.email)+"</small>":"")+(null!=f?'<div style="margin-top:4px;"><i>'+mxUtils.htmlEntities(f)+"</i></div>":"")+"</td></tr>";this.userPanel.appendChild(g);a=document.createElement("div");a.style.textAlign="center";a.style.paddingBottom="12px";a.style.whiteSpace="nowrap";null!=d&&(d=mxUtils.button(mxResources.get("signOut"),d),d.className="geBtn",a.appendChild(d));this.userPanel.appendChild(a)}});null!=this.dropbox&&b(this.dropbox.getUser(),
+mxEvent.addListener(b,"click",mxUtils.bind(this,function(b){g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(a);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}),mxResources.get("closingFile")+"...");mxEvent.consume(b)}));return b}),c=!0,k=document.createElement("table");k.style.cssText="font-size:10pt;padding: 20px 0 0 0;min-width: 300px;border-spacing: 0;";
+for(var m=0;m<b.length;m++)k.appendChild(e(b[m]));this.userPanel.appendChild(k);b=document.createElement("div");b.style.textAlign="left";b.style.padding="8px";b.style.whiteSpace="nowrap";b.style.borderTop="1px solid rgb(224, 224, 224)";e=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),
+mxResources.get("signOut"))}))}));e.className="geBtn";e.style["float"]="right";b.appendChild(e);e=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var a=this.drive.createAuthWin();a.blur();window.focus();g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(a){this.handleError(a)}),!0,a)}),mxResources.get("closingFile")+"...")}));
+e.className="geBtn";e.style.margin="0px";b.appendChild(e);this.userPanel.appendChild(b)}b=mxUtils.bind(this,function(a,b,d,e){if(null!=a){c&&this.userPanel.appendChild(document.createElement("hr"));c=!0;var f=document.createElement("table");f.style.cssText="font-size:10pt;padding:"+(c?"10":"20")+"px 20px 10px 10px;";f.innerHTML+='<tr><td valign="top">'+(null!=b?'<img style="margin-right:6px;" src="'+b+'" width="40" height="40"/></td>':"")+'<td valign="middle" style="white-space:nowrap;">'+mxUtils.htmlEntities(a.displayName)+
+(null!=a.email?'<br><small style="color:gray;">'+mxUtils.htmlEntities(a.email)+"</small>":"")+(null!=e?'<div style="margin-top:4px;"><i>'+mxUtils.htmlEntities(e)+"</i></div>":"")+"</td></tr>";this.userPanel.appendChild(f);a=document.createElement("div");a.style.textAlign="center";a.style.paddingBottom="12px";a.style.whiteSpace="nowrap";null!=d&&(d=mxUtils.button(mxResources.get("signOut"),d),d.className="geBtn",a.appendChild(d));this.userPanel.appendChild(a)}});null!=this.dropbox&&b(this.dropbox.getUser(),
IMAGE_PATH+"/dropbox-logo.svg",mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.constructor==DropboxFile){var b=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});a.isModified()?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}else this.dropbox.logout()}),mxResources.get("dropbox"));null!=this.oneDrive&&b(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",mxUtils.bind(this,function(){var a=
this.getCurrentFile();if(null!=a&&a.constructor==OneDriveFile){var b=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});a.isModified()?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}else this.oneDrive.logout()}),mxResources.get("oneDrive"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.constructor==GitHubFile){var b=
mxUtils.bind(this,function(){this.gitHub.logout();window.location.hash=""});a.isModified()?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}else this.gitHub.logout()}),mxResources.get("github"));null!=this.gitLab&&b(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.constructor==GitLabFile){var b=mxUtils.bind(this,function(){this.gitLab.logout();window.location.hash=
""});a.isModified()?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}else this.gitLab.logout()}),mxResources.get("gitlab"));null!=this.trello&&b(this.trello.getUser(),IMAGE_PATH+"/trello-logo.svg",mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.constructor==TrelloFile){var b=mxUtils.bind(this,function(){this.trello.logout();window.location.hash=""});a.isModified()?this.confirm(mxResources.get("allChangesLost"),
-null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}else this.trello.logout()}),mxResources.get("trello"));c||(b=document.createElement("div"),b.style.textAlign="center",b.style.padding="20px 20px 10px 10px",b.innerHTML=mxResources.get("notConnected"),this.userPanel.appendChild(b));b=document.createElement("div");b.style.textAlign="center";b.style.padding="12px";b.style.background="whiteSmoke";b.style.borderTop="1px solid #e0e0e0";b.style.whiteSpace="nowrap";f=mxUtils.button(mxResources.get("close"),
-mxUtils.bind(this,function(){mxEvent.isConsumed(a)||null==this.userPanel||null==this.userPanel.parentNode||this.userPanel.parentNode.removeChild(this.userPanel)}));f.className="geBtn";b.appendChild(f);this.userPanel.appendChild(b);document.body.appendChild(this.userPanel)}mxEvent.consume(a)})),mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(a){mxEvent.isConsumed(a)||null==this.userPanel||null==this.userPanel.parentNode||this.userPanel.parentNode.removeChild(this.userPanel)})));
+null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}else this.trello.logout()}),mxResources.get("trello"));c||(b=document.createElement("div"),b.style.textAlign="center",b.style.padding="20px 20px 10px 10px",b.innerHTML=mxResources.get("notConnected"),this.userPanel.appendChild(b));b=document.createElement("div");b.style.textAlign="center";b.style.padding="12px";b.style.background="whiteSmoke";b.style.borderTop="1px solid #e0e0e0";b.style.whiteSpace="nowrap";e=mxUtils.button(mxResources.get("close"),
+mxUtils.bind(this,function(){mxEvent.isConsumed(a)||null==this.userPanel||null==this.userPanel.parentNode||this.userPanel.parentNode.removeChild(this.userPanel)}));e.className="geBtn";b.appendChild(e);this.userPanel.appendChild(b);document.body.appendChild(this.userPanel)}mxEvent.consume(a)})),mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(a){mxEvent.isConsumed(a)||null==this.userPanel||null==this.userPanel.parentNode||this.userPanel.parentNode.removeChild(this.userPanel)})));
var a=null;null!=this.drive&&null!=this.drive.getUser()?a=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?a=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?a=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()?a=this.gitHub.getUser():null!=this.gitLab&&null!=this.gitLab.getUser()&&(a=this.gitLab.getUser());null!=a?(this.userElement.innerHTML="",560<screen.width&&(mxUtils.write(this.userElement,a.displayName),this.userElement.style.display=
"block")):this.userElement.style.display="none"}else null!=this.userElement&&(this.userElement.parentNode.removeChild(this.userElement),this.userElement=null)};
App.prototype.getCurrentUser=function(){var a=null;null!=this.drive&&null!=this.drive.getUser()?a=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?a=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?a=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(a=this.gitHub.getUser());return a};var editorResetGraph=Editor.prototype.resetGraph;
Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);this.graph.pageFormat=mxSettings.getPageFormat()};(function(){var a=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){a.apply(this,arguments);this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-10+"px"};Menus.prototype.createHelpLink=function(a){var b=document.createElement("span");b.setAttribute("title",mxResources.get("help"));b.style.cssText="color:blue;text-decoration:underline;margin-left:8px;cursor:help;";
var c=document.createElement("img");mxUtils.setOpacity(c,50);c.style.height="16px";c.style.width="16px";c.setAttribute("border","0");c.setAttribute("valign","bottom");c.setAttribute("src",Editor.helpImage);b.appendChild(c);mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){null!=this.editorUi.menubar&&this.editorUi.menubar.hideMenu();this.editorUi.openLink(a);mxEvent.consume(b)}));return b};Menus.prototype.addLinkToItem=function(a,c){null!=a&&a.firstChild.nextSibling.appendChild(this.createHelpLink(c))};
-var c=Menus.prototype.init;Menus.prototype.init=function(){c.apply(this,arguments);var a=this.editorUi,d=a.editor.graph,m=mxUtils.bind(d,d.isEnabled),f=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),l=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode),n=("www.draw.io"==
-window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode),p=("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode);mxClient.IS_SVG||a.isOffline()||
-((new Image).src=IMAGE_PATH+"/help.png");a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,f,g,l,k,m,n,p){b=
-parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,f,g,l,k,!m,n,p)}),!0,null,"svg")}));a.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){var b=new NewDialog(a,null,!1,function(b){a.hideDialog();if(null!=b){var c=a.editor.graph.getFreeInsertPoint();d.setSelectionCells(a.importXml(b,Math.max(c.x,20),Math.max(c.y,20),!0));d.scrollCellToVisible(d.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));a.showDialog(b.container,
-620,440,!0,!0)})).isEnabled=m;var u=a.actions.addAction("points",function(){a.editor.graph.view.setUnit(mxConstants.POINTS)});u.setToggleAction(!0);u.setSelectedCallback(function(){return a.editor.graph.view.unit==mxConstants.POINTS});u=a.actions.addAction("inches",function(){a.editor.graph.view.setUnit(mxConstants.INCHES)});u.setToggleAction(!0);u.setSelectedCallback(function(){return a.editor.graph.view.unit==mxConstants.INCHES});u=a.actions.addAction("millimeters",function(){a.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});
-u.setToggleAction(!0);u.setSelectedCallback(function(){return a.editor.graph.view.unit==mxConstants.MILLIMETERS});this.put("units",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["points","millimeters"],b)})));u=a.actions.addAction("ruler",function(){mxSettings.setRulerOn(!mxSettings.isRulerOn());mxSettings.save();null!=a.ruler?(a.ruler.destroy(),a.ruler=null):a.ruler=new mxDualRuler(a,a.editor.graph.view.unit);a.refresh()});u.setEnabled(a.canvasSupported&&9!=document.documentMode);
-u.setToggleAction(!0);u.setSelectedCallback(function(){return null!=a.ruler});window.mxFreehand&&(a.actions.put("insertFreehand",new Action(mxResources.get("freehand")+"...",function(b){d.isEnabled()&&(null==this.freehandWindow&&(this.freehandWindow=new FreehandWindow(a,document.body.offsetWidth-420,102,176,104)),d.freehand.isDrawing()?d.freehand.stopDrawing():d.freehand.startDrawing(),this.freehandWindow.window.setVisible(d.freehand.isDrawing()))})).isEnabled=function(){return m()&&mxClient.IS_SVG});
-a.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatXml"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(f);var g=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),l=a.addCheckbox(b,mxResources.get("compressed"),!0),k=a.addCheckbox(b,
-mxResources.get("allPages"),!c,c);k.style.marginBottom="16px";mxEvent.addListener(g,"change",function(){g.checked?k.setAttribute("disabled","disabled"):k.removeAttribute("disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("xml",!l.checked,null,!g.checked,c||!k.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,180,!0,!0)}));a.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){a.showPublishLinkDialog(mxResources.get("url"),!0,
-null,null,function(b,c,d,f,g,l){b=new EmbedDialog(a,a.createLink(b,c,d,f,g,l,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,f,g,l,k,m,n,p){a.createHtml(b,c,d,f,g,l,k,m,n,p,mxUtils.bind(this,function(b,c){var d=
-a.getBaseFilename(k),f='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+b+"\n"+c+"\n</body>\n</html>";a.saveData(d+".html","html",f,"text/html")}))})})}));a.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if("undefined"!==typeof mxIsElectron5&&mxIsElectron5||!a.isOffline()&&!a.printPdfExport){var b=null==a.pages||
-1>=a.pages.length,c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatPdf"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var f=function(){l!=this&&this.checked?m.removeAttribute("disabled"):(m.setAttribute("disabled","disabled"),m.checked=!1)},g=172;if(a.pdfPageExport&&!b){var l=a.addRadiobox(c,"pages",mxResources.get("allPages"),!0),g=a.addRadiobox(c,"pages",mxResources.get("currentPage"),
-!1),k=a.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),m=a.addCheckbox(c,mxResources.get("crop"),!1,!0),n=a.addCheckbox(c,mxResources.get("grid"),!1,!1);mxEvent.addListener(l,"change",f);mxEvent.addListener(g,"change",f);mxEvent.addListener(k,"change",f);g=240}else k=a.addCheckbox(c,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),m=a.addCheckbox(c,mxResources.get("crop"),!d.pageVisible||!a.pdfPageExport,!a.pdfPageExport),n=a.addCheckbox(c,mxResources.get("grid"),
-!1,!1),a.pdfPageExport||mxEvent.addListener(k,"change",f);c=new CustomDialog(a,c,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!k.checked,b?!0:!l.checked,!m.checked,null,null,null,n.checked)}),null,mxResources.get("export"));a.showDialog(c.container,300,g,!0,!0)}else a.showDialog((new PrintDialog(a,mxResources.get("formatPdf"))).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){function b(){a.fileLoaded(null)}
+var c=Menus.prototype.init;Menus.prototype.init=function(){c.apply(this,arguments);var a=this.editorUi,d=a.editor.graph,g=mxUtils.bind(d,d.isEnabled),e=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),k=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode),m=("www.draw.io"==
+window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode),n=("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode);mxClient.IS_SVG||a.isOffline()||
+((new Image).src=IMAGE_PATH+"/help.png");a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,k,l,m,n){b=
+parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,k,!l,m,n)}),!0,null,"svg")}));a.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){var b=new NewDialog(a,null,!1,function(b){a.hideDialog();if(null!=b){var c=a.editor.graph.getFreeInsertPoint();d.setSelectionCells(a.importXml(b,Math.max(c.x,20),Math.max(c.y,20),!0));d.scrollCellToVisible(d.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));a.showDialog(b.container,
+620,440,!0,!0)})).isEnabled=g;var q=a.actions.addAction("points",function(){a.editor.graph.view.setUnit(mxConstants.POINTS)});q.setToggleAction(!0);q.setSelectedCallback(function(){return a.editor.graph.view.unit==mxConstants.POINTS});q=a.actions.addAction("inches",function(){a.editor.graph.view.setUnit(mxConstants.INCHES)});q.setToggleAction(!0);q.setSelectedCallback(function(){return a.editor.graph.view.unit==mxConstants.INCHES});q=a.actions.addAction("millimeters",function(){a.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});
+q.setToggleAction(!0);q.setSelectedCallback(function(){return a.editor.graph.view.unit==mxConstants.MILLIMETERS});this.put("units",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["points","millimeters"],b)})));q=a.actions.addAction("ruler",function(){mxSettings.setRulerOn(!mxSettings.isRulerOn());mxSettings.save();null!=a.ruler?(a.ruler.destroy(),a.ruler=null):a.ruler=new mxDualRuler(a,a.editor.graph.view.unit);a.refresh()});q.setEnabled(a.canvasSupported&&9!=document.documentMode);
+q.setToggleAction(!0);q.setSelectedCallback(function(){return null!=a.ruler});window.mxFreehand&&(a.actions.put("insertFreehand",new Action(mxResources.get("freehand")+"...",function(b){d.isEnabled()&&(null==this.freehandWindow&&(this.freehandWindow=new FreehandWindow(a,document.body.offsetWidth-420,102,176,104)),d.freehand.isDrawing()?d.freehand.stopDrawing():d.freehand.startDrawing(),this.freehandWindow.window.setVisible(d.freehand.isDrawing()))})).isEnabled=function(){return g()&&mxClient.IS_SVG});
+a.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatXml"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(e);var f=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),g=a.addCheckbox(b,mxResources.get("compressed"),!0),k=a.addCheckbox(b,
+mxResources.get("allPages"),!c,c);k.style.marginBottom="16px";mxEvent.addListener(f,"change",function(){f.checked?k.setAttribute("disabled","disabled"):k.removeAttribute("disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("xml",!g.checked,null,!f.checked,c||!k.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,180,!0,!0)}));a.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){a.showPublishLinkDialog(mxResources.get("url"),!0,
+null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,f,g,k,l,m,n){a.createHtml(b,c,d,e,f,g,k,l,m,n,mxUtils.bind(this,function(b,c){var d=
+a.getBaseFilename(k),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+b+"\n"+c+"\n</body>\n</html>";a.saveData(d+".html","html",e,"text/html")}))})})}));a.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if("undefined"!==typeof mxIsElectron5&&mxIsElectron5||!a.isOffline()&&!a.printPdfExport){var b=null==a.pages||
+1>=a.pages.length,c=document.createElement("div");c.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatPdf"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(e);var e=function(){g!=this&&this.checked?l.removeAttribute("disabled"):(l.setAttribute("disabled","disabled"),l.checked=!1)},f=172;if(a.pdfPageExport&&!b){var g=a.addRadiobox(c,"pages",mxResources.get("allPages"),!0),f=a.addRadiobox(c,"pages",mxResources.get("currentPage"),
+!1),k=a.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),l=a.addCheckbox(c,mxResources.get("crop"),!1,!0),m=a.addCheckbox(c,mxResources.get("grid"),!1,!1);mxEvent.addListener(g,"change",e);mxEvent.addListener(f,"change",e);mxEvent.addListener(k,"change",e);f=240}else k=a.addCheckbox(c,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),l=a.addCheckbox(c,mxResources.get("crop"),!d.pageVisible||!a.pdfPageExport,!a.pdfPageExport),m=a.addCheckbox(c,mxResources.get("grid"),
+!1,!1),a.pdfPageExport||mxEvent.addListener(k,"change",e);c=new CustomDialog(a,c,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!k.checked,b?!0:!g.checked,!l.checked,null,null,null,m.checked)}),null,mxResources.get("export"));a.showDialog(c.container,300,f,!0,!0)}else a.showDialog((new PrintDialog(a,mxResources.get("formatPdf"))).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){function b(){a.fileLoaded(null)}
var c=a.getCurrentFile();null!=c&&c.isModified()?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});a.actions.addAction("editShape...",mxUtils.bind(this,function(){d.getSelectionCells();if(1==d.getSelectionCount()){var b=d.getSelectionCell(),c=d.view.getState(b);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400),a.showDialog(b.container,640,480,!0,!1),b.init())}}));a.actions.addAction("revisionHistory...",
function(){a.isRevisionHistorySupported()?a.spinner.spin(document.body,mxResources.get("loading"))&&a.getRevisions(mxUtils.bind(this,function(b,c){a.spinner.stop();var d=new RevisionDialog(a,b,c);a.showDialog(d.container,640,480,!0,!0);d.init()}),mxUtils.bind(this,function(b){a.handleError(b)})):a.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");
-u=a.actions.addAction("synchronize",function(){a.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&(u.label=mxResources.get("refresh"));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),
-null,!0))});"undefined"!==typeof MathJax&&(u=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();d.model.execute(b)}),u.setToggleAction(!0),u.setSelectedCallback(function(){return a.isMathEnabled()}),u.isEnabled=m);if(isLocalStorage||mxClient.IS_CHROMEAPP)u=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),u.setToggleAction(!0),
-u.setSelectedCallback(function(){return mxSettings.getShowStartScreen()});var g=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});g.setToggleAction(!0);g.setSelectedCallback(function(){return g.isEnabled()&&a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=d.getSelectionCells(),c=[],f=0;f<b.length;f++)d.getModel().isVertex(b[f])&&c.push(b[f]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,200,250,!0,!0),b.init())},
-null,null,Editor.ctrlKey+"+Shift+M");var k="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 targetPerimeterSpacing startFill startArrow startSize sourcePerimeterSpacing arcSize".split(" ");a.actions.addAction("copyStyle",function(){var b=
-d.view.getState(d.getSelectionCell());if(d.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=d.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],c=0;c<b.length;c++){var f=b[c],g=f.indexOf("=");if(0<=g){var l=f.substring(0,g),f=f.substring(g+1);null==a.copiedStyle[l]&&"none"==f&&(a.copiedStyle[l]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=a.copiedStyle){d.getModel().beginUpdate();
-try{for(var b=d.getSelectionCells(),c=0;c<b.length;c++)for(var f=d.view.getState(b[c]),g=0;g<k.length;g++){var l=k[g],m=a.copiedStyle[l];f.style[l]!=m&&d.setCellStyles(l,m,[b[c]])}}finally{d.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,f,g,l,k,m,n,p,t){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,f,g,k,!m,n,null,t)}),!0,!0,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(b,c,d,f,g){a.downloadFile(c?
-"xmlpng":"png",null,null,b,null,null,d,f,g)}),!1,!0)}));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,f,g,l,k,m,n,p,t){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,f,!1,k,!m,!1,"jpeg",t)}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),
-null,mxUtils.bind(this,function(b,c,d,f,g){a.downloadFile("jpeg",null,null,b,null,null,null,f,g)}),!0,!0)}));u=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){d.setShadowVisible(!d.shadowVisible)}));u.setToggleAction(!0);u.setSelectedCallback(function(){return d.shadowVisible});var q=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){q||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){q=!1}),q=!0)},null,null,"F1"));
+q=a.actions.addAction("synchronize",function(){a.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&(q.label=mxResources.get("refresh"));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),
+null,!0))});"undefined"!==typeof MathJax&&(q=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();d.model.execute(b)}),q.setToggleAction(!0),q.setSelectedCallback(function(){return a.isMathEnabled()}),q.isEnabled=g);if(isLocalStorage||mxClient.IS_CHROMEAPP)q=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),q.setToggleAction(!0),
+q.setSelectedCallback(function(){return mxSettings.getShowStartScreen()});var f=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});f.setToggleAction(!0);f.setSelectedCallback(function(){return f.isEnabled()&&a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=d.getSelectionCells(),c=[],e=0;e<b.length;e++)d.getModel().isVertex(b[e])&&c.push(b[e]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,200,250,!0,!0),b.init())},
+null,null,Editor.ctrlKey+"+Shift+M");var l="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 targetPerimeterSpacing startFill startArrow startSize sourcePerimeterSpacing arcSize".split(" ");a.actions.addAction("copyStyle",function(){var b=
+d.view.getState(d.getSelectionCell());if(d.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=d.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],c=0;c<b.length;c++){var e=b[c],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(d.isEnabled()&&!d.isSelectionEmpty()&&null!=a.copiedStyle){d.getModel().beginUpdate();
+try{for(var b=d.getSelectionCells(),c=0;c<b.length;c++)for(var e=d.view.getState(b[c]),f=0;f<l.length;f++){var g=l[f],k=a.copiedStyle[g];e.style[g]!=k&&d.setCellStyles(g,k,[b[c]])}}finally{d.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,k,l,m,n,p){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,k,!l,m,null,p)}),!0,!0,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(b,c,d,e,f){a.downloadFile(c?
+"xmlpng":"png",null,null,b,null,null,d,e,f)}),!1,!0)}));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,k,l,m,n,p){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,!1,d,e,!1,k,!l,!1,"jpeg",p)}),!0,!1,"jpeg"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),
+null,mxUtils.bind(this,function(b,c,d,e,f){a.downloadFile("jpeg",null,null,b,null,null,null,e,f)}),!0,!0)}));q=a.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){d.setShadowVisible(!d.shadowVisible)}));q.setToggleAction(!0);q.setSelectedCallback(function(){return d.shadowVisible});var p=!1;a.actions.put("about",new Action(mxResources.get("aboutDrawio")+"...",function(){p||(a.showDialog((new AboutDialog(a)).container,220,300,!0,!0,function(){p=!1}),p=!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,!1);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});u=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())}));u.setToggleAction(!0);u.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));u=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())}));u.setToggleAction(!0);u.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){this.put("language",new Menu(mxUtils.bind(this,function(b,c){var d=mxUtils.bind(this,function(d){var f=""==d?mxResources.get("automatic"):mxLanguageMap[d],g=null;""!=f&&(g=b.addItem(f,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(g,Editor.checkmarkImage));return g});d("");b.addSeparator(c);for(var f in mxLanguageMap)d(f)})));var v=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=v.apply(this,arguments);if(null!=b){var c=this.get("language");if(null!=c){c=b.addMenu("",c.funct);c.setAttribute("title",
+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,!1);b.init()});a.actions.addAction("quickStart...",function(){a.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});q=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())}));q.setToggleAction(!0);q.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));q=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())}));q.setToggleAction(!0);q.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){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)})));var u=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=u.apply(this,arguments);if(null!=b){var c=this.get("language");if(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.style.zIndex="1";c.style.position="absolute";c.style.display="block";c.style.cursor="pointer";c.style.right="17px";"atlas"==uiTheme?(c.style.top="6px",c.style.right="15px"):c.style.top="min"==uiTheme?"2px":"0px";if(mxClient.IS_VML)c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>';else{var d=document.createElement("div");d.style.backgroundImage="url("+Editor.globeImage+")";d.style.backgroundPosition=
"center center";d.style.backgroundRepeat="no-repeat";d.style.backgroundSize="19px 19px";d.style.position="absolute";d.style.height="19px";d.style.width="19px";d.style.marginTop="2px";d.style.zIndex="1";c.appendChild(d);mxUtils.setOpacity(c,40);if("atlas"==uiTheme||"dark"==uiTheme)c.style.opacity="0.85",c.style.filter="invert(100%)"}document.body.appendChild(c)}}return b}}a.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,
-parallelEdgeSpacing:10}}];a.actions.addAction("runLayout",function(){var b=new TextareaDialog(a,"Run Layouts:",JSON.stringify(a.customLayoutConfig,null,2),function(b){if(0<b.length)try{var c=JSON.parse(b);a.executeLayoutList(c);a.customLayoutConfig=c}catch(B){a.handleError(B),console.error(B)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()});var u=this.get("layout"),y=u.funct;u.funct=function(b,c){y.apply(this,arguments);b.addSeparator(c);
-a.menus.addMenuItem(b,"runLayout",c,null,null,mxResources.get("apply")+"...")};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 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="",EditorUi.logEvent({category:"SEARCH-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="")}));d.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","-"],c);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],c);this.addMenuItems(b,["support","-"],c);EditorUi.isElectronApp||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["downloadDesktop"],c);navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["useOffline"],
+parallelEdgeSpacing:10}}];a.actions.addAction("runLayout",function(){var b=new TextareaDialog(a,"Run Layouts:",JSON.stringify(a.customLayoutConfig,null,2),function(b){if(0<b.length)try{var c=JSON.parse(b);a.executeLayoutList(c);a.customLayoutConfig=c}catch(A){a.handleError(A),console.error(A)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()});var q=this.get("layout"),v=q.funct;q.funct=function(b,c){v.apply(this,arguments);b.addSeparator(c);
+a.menus.addMenuItem(b,"runLayout",c,null,null,mxResources.get("apply")+"...")};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="",EditorUi.logEvent({category:"SEARCH-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);EditorUi.isElectronApp||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["downloadDesktop"],c);navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["useOffline"],
c);this.addMenuItems(b,["-","about"],c)}"1"==urlParams.test&&(b.addSeparator(c),this.addSubmenu("testDevelop",b,c))})));"1"==urlParams.test&&(mxResources.parse("testDevelop=Develop"),mxResources.parse("showBoundingBox=Show bounding box"),mxResources.parse("createSidebarEntry=Create Sidebar Entry"),mxResources.parse("testCheckFile=Check File"),mxResources.parse("testDiff=Diff"),mxResources.parse("testInspect=Inspect"),mxResources.parse("testShowConsole=Show Console"),mxResources.parse("testXmlImageExport=XML Image Export"),
mxResources.parse("testDownloadRtModel=Export RT model"),mxResources.parse("testImportRtModel=Import RT model"),a.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){d.isSelectionEmpty()||a.showTextDialog("Create Sidebar Entry","sb.createVertexTemplateFromData('"+Graph.compress(mxUtils.getXml(d.encodeCells(d.getSelectionCells())))+"', width, height, 'Title');")})),a.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=d.getGraphBounds(),b=d.view.translate,c=d.view.scale;
-d.insertVertex(d.getDefaultParent(),null,"",a.x/c-b.x,a.y/c-b.y,a.width/c,a.height/c,"fillColor=none;strokeColor=red;")})),a.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var b=null!=a.pages&&null!=a.getCurrentFile()?a.getCurrentFile().getAnonymizedXmlForPages(a.pages):"",b=new TextareaDialog(a,"Paste Data:",b,function(b){if(0<b.length)try{var c=function(a){function b(a){if(null==p[a]){if(p[a]=!0,null!=f[a]){for(;0<f[a].length;){var d=f[a].pop();b(d)}delete f[a]}}else mxLog.debug(c+
-": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var f={},g=null,l={},k=0;k<d.length;k++){var m=d[k];if(null!=m.id&&0<m.id.length)if(null==a[m.id]){a[m.id]=m.id;var n=m.getAttribute("parent");null==n?null!=g?mxLog.debug(c+": Multiple roots: "+m.id):g=m.id:(null==f[n]&&(f[n]=[]),f[n].push(m.id))}else l[m.id]=m.id}0<Object.keys(l).length?(d=c+": "+Object.keys(l).length+" Duplicates: "+Object.keys(l).join(", "),mxLog.debug(d+" (see console)")):mxLog.debug(c+": Checked");var p={};null==
-g?mxLog.debug(c+": No root"):(b(g),Object.keys(p).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"),console.log(c+": Invalid tree",f)))};"<"!=b.charAt(0)&&(b=Graph.decompress(b),mxLog.debug("See console for uncompressed XML"),console.log("xml",b));var d=mxUtils.parseXml(b),f=a.getPagesForNode(d.documentElement,"mxGraphModel");if(null!=f&&0<f.length)try{var g=a.getHashValueForPages(f);mxLog.debug("Checksum: ",g)}catch(K){mxLog.debug("Error: ",K.message)}else mxLog.debug("No pages found for checksum");
-var l=d.getElementsByTagName("root");for(b=0;b<l.length;b++)c(l[b]);mxLog.show()}catch(K){a.handleError(K),console.error(K)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()})),a.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=a.pages){var b=new TextareaDialog(a,"Paste Data:","",function(b){if(0<b.length)try{console.log(JSON.stringify(a.diffPages(a.pages,a.getPagesForNode(mxUtils.parseXml(b).documentElement)),null,
-2))}catch(G){a.handleError(G),console.error(G)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()}else a.alert("No pages")})),a.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(a,d.getModel())})),a.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,f=mxUtils.createXmlDocument(),g=f.createElement("output");f.appendChild(g);f=new mxXmlCanvas2D(g);
-f.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));f.scale(1/c);var l=0,k=f.save;f.save=function(){l++;k.apply(this,arguments)};var m=f.restore;f.restore=function(){l--;m.apply(this,arguments)};var n=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,l);n.apply(this,arguments);mxLog.debug("leaving shape",a,l)};a.drawState(d.getView().getState(d.model.root),f);mxLog.show();mxLog.debug(mxUtils.getXml(g));mxLog.debug("stateCounter",l)})),a.actions.addAction("testDownloadRtModel...",
+d.insertVertex(d.getDefaultParent(),null,"",a.x/c-b.x,a.y/c-b.y,a.width/c,a.height/c,"fillColor=none;strokeColor=red;")})),a.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var b=null!=a.pages&&null!=a.getCurrentFile()?a.getCurrentFile().getAnonymizedXmlForPages(a.pages):"",b=new TextareaDialog(a,"Paste Data:",b,function(b){if(0<b.length)try{var c=function(a){function b(a){if(null==n[a]){if(n[a]=!0,null!=e[a]){for(;0<e[a].length;){var d=e[a].pop();b(d)}delete e[a]}}else mxLog.debug(c+
+": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var e={},f=null,g={},k=0;k<d.length;k++){var l=d[k];if(null!=l.id&&0<l.id.length)if(null==a[l.id]){a[l.id]=l.id;var m=l.getAttribute("parent");null==m?null!=f?mxLog.debug(c+": Multiple roots: "+l.id):f=l.id:(null==e[m]&&(e[m]=[]),e[m].push(l.id))}else g[l.id]=l.id}0<Object.keys(g).length?(d=c+": "+Object.keys(g).length+" Duplicates: "+Object.keys(g).join(", "),mxLog.debug(d+" (see console)")):mxLog.debug(c+": Checked");var n={};null==
+f?mxLog.debug(c+": No root"):(b(f),Object.keys(n).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"),console.log(c+": Invalid tree",e)))};"<"!=b.charAt(0)&&(b=Graph.decompress(b),mxLog.debug("See console for uncompressed XML"),console.log("xml",b));var d=mxUtils.parseXml(b),e=a.getPagesForNode(d.documentElement,"mxGraphModel");if(null!=e&&0<e.length)try{var f=a.getHashValueForPages(e);mxLog.debug("Checksum: ",f)}catch(J){mxLog.debug("Error: ",J.message)}else mxLog.debug("No pages found for checksum");
+var g=d.getElementsByTagName("root");for(b=0;b<g.length;b++)c(g[b]);mxLog.show()}catch(J){a.handleError(J),console.error(J)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()})),a.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=a.pages){var b=new TextareaDialog(a,"Paste Data:","",function(b){if(0<b.length)try{console.log(JSON.stringify(a.diffPages(a.pages,a.getPagesForNode(mxUtils.parseXml(b).documentElement)),null,
+2))}catch(E){a.handleError(E),console.error(E)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()}else a.alert("No pages")})),a.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(a,d.getModel())})),a.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);
+e.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));e.scale(1/c);var g=0,k=e.save;e.save=function(){g++;k.apply(this,arguments)};var l=e.restore;e.restore=function(){g--;l.apply(this,arguments)};var m=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);m.apply(this,arguments);mxLog.debug("leaving shape",a,g)};a.drawState(d.getView().getState(d.model.root),e);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),a.actions.addAction("testDownloadRtModel...",
mxUtils.bind(this,function(){null==a.drive?a.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}):a.drive.execute(mxUtils.bind(this,function(){var b=prompt("File ID","");if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("export"))){var c=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b+"/realtime?supportsTeamDrives=true",null,"GET");c.setRequestHeaders=function(b){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);b.setRequestHeader("authorization",
"Bearer "+a.drive.token)};c.send(function(c){a.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?a.saveLocalFile(c.getText(),"json-"+b+".txt","text/plain"):a.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})}}))})),a.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.put("testDevelop",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,
"createSidebarEntry showBoundingBox - testCheckFile testDiff - testInspect - testXmlImageExport - testDownloadRtModel".split(" "),c);b.addItem(mxResources.get("testImportRtModel")+"...",null,function(){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",mxUtils.bind(this,function(){if(null!=b.files){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{a.openLocalFile(mxUtils.getXml(a.drive.convertJsonToXml(JSON.parse(c.target.result).data)),
-b.files[0].name,!0)}catch(E){a.handleError(E,mxResources.get("errorLoadingFile"))}});c.readAsText(b.files[0])}}));b.click()},c);this.addMenuItems(b,["-","testShowConsole"],c)}))));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.put("createShape",
-new Action(mxResources.get("shape")+"...",function(b){d.isEnabled()&&(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())})).isEnabled=m;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,f,g,l,k,m,n,p){a.createHtml(b,c,d,f,g,l,k,m,n,p,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var d=window.open(),f=d.document;if(null!=f){"CSS1Compat"===document.compatMode&&f.writeln("<!DOCTYPE html>");f.writeln("<html>");f.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');f.writeln("<body>");f.writeln(b);var g=mxClient.IS_IE||
-mxClient.IS_EDGE||null!=document.documentMode;g&&f.writeln(c);f.writeln("</body>");f.writeln("</html>");f.close();if(!g){var l=d.document.createElement("div");l.marginLeft="26px";l.marginTop="26px";mxUtils.write(l,mxResources.get("updatingDocument"));g=d.document.createElement("img");g.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");g.style.marginLeft="6px";l.appendChild(g);d.document.body.insertBefore(l,d.document.body.firstChild);window.setTimeout(function(){var a=
-document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];f.body.appendChild(a);l.parentNode.removeChild(l)},20)}}else a.handleError({message:mxResources.get("errorUpdatingPreview")})});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){var b=a.getCurrentFile();null!=b&&a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(c){a.spinner.stop();
-null!=c?(c=new EmbedDialog(a,'<img src="'+(b.constructor!=DriveFile?c:"https://drive.google.com/uc?id="+b.getId())+'"/>'),a.showDialog(c.container,440,240,!0,!0),c.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){a.showEmbedImageDialog(function(b,c,d,f,g,l){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,f,g,l,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,f,g,l){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,f,g,l,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=d.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-d.view.translate.y)/d.view.scale)+2,function(b,c,d,f,g,l,k,m){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(n){a.spinner.stop();
-n=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+k+";height:"+m+';" src="'+a.createLink(b,c,d,f,g,l,n)+'"></iframe>');a.showDialog(n.container,440,240,!0,!0);n.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,null,null,null,function(b,c,d,f,g,l){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,f,g,l,k));
+b.files[0].name,!0)}catch(D){a.handleError(D,mxResources.get("errorLoadingFile"))}});c.readAsText(b.files[0])}}));b.click()},c);this.addMenuItems(b,["-","testShowConsole"],c)}))));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.put("createShape",
+new Action(mxResources.get("shape")+"...",function(b){d.isEnabled()&&(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())})).isEnabled=g;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,k,l,m,n){a.createHtml(b,c,d,e,f,g,k,l,m,n,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var d=window.open(),e=d.document;if(null!=e){"CSS1Compat"===document.compatMode&&e.writeln("<!DOCTYPE html>");e.writeln("<html>");e.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');e.writeln("<body>");e.writeln(b);var f=mxClient.IS_IE||
+mxClient.IS_EDGE||null!=document.documentMode;f&&e.writeln(c);e.writeln("</body>");e.writeln("</html>");e.close();if(!f){var g=d.document.createElement("div");g.marginLeft="26px";g.marginTop="26px";mxUtils.write(g,mxResources.get("updatingDocument"));f=d.document.createElement("img");f.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");f.style.marginLeft="6px";g.appendChild(f);d.document.body.insertBefore(g,d.document.body.firstChild);window.setTimeout(function(){var a=
+document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];e.body.appendChild(a);g.parentNode.removeChild(g)},20)}}else a.handleError({message:mxResources.get("errorUpdatingPreview")})});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){var b=a.getCurrentFile();null!=b&&a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(c){a.spinner.stop();
+null!=c?(c=new EmbedDialog(a,'<img src="'+(b.constructor!=DriveFile?c:"https://drive.google.com/uc?id="+b.getId())+'"/>'),a.showDialog(c.container,440,240,!0,!0),c.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=d.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-d.view.translate.y)/d.view.scale)+2,function(b,c,d,e,f,g,k,l){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(m){a.spinner.stop();
+m=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+k+";height:"+l+';" src="'+a.createLink(b,c,d,e,f,g,m)+'"></iframe>');a.showDialog(m.container,440,240,!0,!0);m.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("microsoftOffice...",function(){a.openLink("https://office.draw.io")});a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSlides...",function(){a.openLink("https://slidesaddon.draw.io")});a.actions.addAction("googleSheets...",function(){a.openLink("https://sheetsaddon.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)u=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),u.setToggleAction(!0),u.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,170,!0,!1)});u=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");
-a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});u.setToggleAction(!0);u.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){d.isEditing()&&d.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 f=a.createLoadMessage("save");f.xml=c;b&&(f.exit=!0);c=JSON.stringify(f)}(window.opener||
+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)q=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),q.setToggleAction(!0),q.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,170,!0,!1)});q=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");
+a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});q.setToggleAction(!0);q.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){d.isEditing()&&d.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 e=a.createLoadMessage("save");e.xml=c;b&&(e.exit=!0);c=JSON.stringify(e)}(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_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.put("importFrom",new Menu(mxUtils.bind(this,function(b,c){function g(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,
-function(b){var c="data:image/"==b.getData().substring(0,11)?m(b.getTitle()):"text/xml";/\.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,f){var g=d.view,l=d.getGraphBounds(),k=d.snap(Math.ceil(Math.max(0,l.x/g.scale-g.translate.x)+4*d.gridSize)),m=d.snap(Math.ceil(Math.max(0,
-(l.y+l.height)/g.scale-g.translate.y)+4*d.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(g){var l=!0,n=mxUtils.bind(this,function(){a.resizeImage(g,b,mxUtils.bind(this,function(g,n,p){g=l?Math.min(1,Math.min(a.maxImageSize/n,a.maxImageSize/p)):1;a.importFile(b,c,k,m,Math.round(n*g),Math.round(p*g),f,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),l)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){l=
-a;n()}):n()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,k,m,0,0,f,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),m=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(){g(a.drive)},c):f&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){g(a.oneDrive)},c):n&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,
-function(){g(a.dropbox)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){g(a.gitHub)},c);null!=a.gitLab&&b.addItem(mxResources.get("gitlab")+"...",null,function(){g(a.gitLab)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){g(a.trello)},c):p&&"function"===typeof window.TrelloClient&&
+this.addMenuItems(b,["exportPdf"],c);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.put("importFrom",new Menu(mxUtils.bind(this,function(b,c){function f(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,
+function(b){var c="data:image/"==b.getData().substring(0,11)?l(b.getTitle()):"text/xml";/\.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,c,e){var f=d.view,g=d.getGraphBounds(),k=d.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*d.gridSize)),l=d.snap(Math.ceil(Math.max(0,
+(g.y+g.height)/f.scale-f.translate.y)+4*d.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,n){f=g?Math.min(1,Math.min(a.maxImageSize/m,a.maxImageSize/n)):1;a.importFile(b,c,k,l,Math.round(m*f),Math.round(n*f),e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.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,c,k,l,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),l=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(){f(a.drive)},c):e&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){f(a.oneDrive)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,
+function(){f(a.dropbox)},c):k&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){f(a.gitHub)},c);null!=a.gitLab&&b.addItem(mxResources.get("gitlab")+"...",null,function(){f(a.gitLab)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){f(a.trello)},c):n&&"function"===typeof window.TrelloClient&&
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.importLocalFile(!1)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},c);a.isOffline()||(b.addSeparator(c),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){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()},c))}))).isEnabled=m;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),f=b.addItem(mxResources.get("automatic"),
-null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(f,Editor.checkmarkImage);b.addSeparator(c);f=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"==d&&b.addCheckmark(f,Editor.checkmarkImage);f=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");
-mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&b.addCheckmark(f,Editor.checkmarkImage);f=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&b.addCheckmark(f,Editor.checkmarkImage);f=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&b.addCheckmark(f,
-Editor.checkmarkImage)})));u=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&&a!=b.getTitle()&&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},null,null,null,null,a.editor.fileExtensions);this.editorUi.showDialog(c.container,340,90,!0,!0);c.init()}}));u.isEnabled=function(){return this.enabled&&
-m.apply(this,arguments)};u.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=a.getCopyFilename(b);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.saveAs(c,mxUtils.bind(this,function(c){b.desc=c;b.save(!1,mxUtils.bind(this,function(){a.spinner.stop();
+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()},c))}))).isEnabled=g;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),
+null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");
+mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&b.addCheckmark(e,
+Editor.checkmarkImage)})));q=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&&a!=b.getTitle()&&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},null,null,null,null,a.editor.fileExtensions);this.editorUi.showDialog(c.container,340,90,!0,!0);c.init()}}));q.isEnabled=function(){return this.enabled&&
+g.apply(this,arguments)};q.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=a.getCopyFilename(b);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.saveAs(c,mxUtils.bind(this,function(c){b.desc=c;b.save(!1,mxUtils.bind(this,function(){a.spinner.stop();
b.setModified(!1);b.addAllSavedStatus()}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):a.createFile(c,a.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0,null,null,null,null,a.editor.fileExtensions),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();if(b.getMode()==App.MODE_GOOGLE||b.getMode()==App.MODE_ONEDRIVE){var c=!1;if(b.getMode()==App.MODE_GOOGLE&&null!=b.desc.parents)for(var d=0;d<b.desc.parents.length;d++)if(b.desc.parents[d].isRoot){c=!0;break}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)}))}),null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,
-function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var b=a.getCurrentFile();null!=b&&a.drive.showPermissions(b.getId())}catch(C){a.handleError(C)}}));this.put("embed",
+function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var b=a.getCurrentFile();null!=b&&a.drive.showPermissions(b.getId())}catch(B){a.handleError(B)}}));this.put("embed",
new Menu(mxUtils.bind(this,function(b,c){var d=a.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);"1"==urlParams.embed||a.isOffline()||this.addMenuItems(b,"- googleDocs googleSlides googleSheets - microsoftOffice".split(" "),c)})));var t=function(b,
-c,d,f){("plantUml"!=f||EditorUi.enablePlantUml&&!a.isOffline())&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==f||"formatSql"==f||"plantUml"==f){var b=new ParseDialog(a,d,f);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,f),a.showDialog(b.container,620,420,!0,!1);b.init()}),c,null,m())},A=function(a,b,c,f){var g=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(g.x,g.y,b,
-c),f);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,
-function(b,c,d,f,g,l,k,m,n,p){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,f,g,l,k,!m,n,p)}),!0,null,"svg")}));a.actions.put("insertText",new Action(mxResources.get("text"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(A("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=m;a.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),
-function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&A("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=m;a.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&A("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=m;a.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&
-A("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=m;var z=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):t(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);a.insertTemplateEnabled&&!a.isOffline()&&this.addMenuItems(b,["insertTemplate","-"],c);this.addMenuItems(b,["createShape","insertFreehand",
-"-"],c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));this.addSubmenu("insertAdvanced",b,c,mxResources.get("advanced"))})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){z(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(b,c){z(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},
-c,null,m())})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var f=0;f<d.length;f++)(function(d){var f=d.mode;f==App.MODE_GOOGLE?f="googleDrive":f==App.MODE_ONEDRIVE&&(f="oneDrive");b.addItem(d.title+" ("+mxResources.get(f)+")",null,function(){a.loadFile(d.id)},c)})(d[f]);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):f&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):n&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+
-"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.gitLab&&b.addItem(mxResources.get("gitlab")+"...",null,function(){a.pickFile(App.MODE_GITLAB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},
-c):p&&"function"===typeof window.TrelloClient&&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);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,
+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,null,g())},z=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,
+c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,
+function(b,c,d,e,f,g,k,l,m,n){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,k,!l,m,n)}),!0,null,"svg")}));a.actions.put("insertText",new Action(mxResources.get("text"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(z("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.put("insertRectangle",new Action(mxResources.get("rectangle"),
+function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&z("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=g;a.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&z("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=g;a.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&
+z("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=g;var y=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):t(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);a.insertTemplateEnabled&&!a.isOffline()&&this.addMenuItems(b,["insertTemplate","-"],c);this.addMenuItems(b,["createShape","insertFreehand",
+"-"],c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));this.addSubmenu("insertAdvanced",b,c,mxResources.get("advanced"))})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){y(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(b,c){y(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},
+c,null,g())})));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):e&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+
+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):k&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.gitLab&&b.addItem(mxResources.get("gitlab")+"...",null,function(){a.pickFile(App.MODE_GITLAB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},
+c):n&&"function"===typeof window.TrelloClient&&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);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):f&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+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):n&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+
-" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},
-c);null!=a.gitLab&&b.addItem(mxResources.get("gitlab")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITLAB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):p&&"function"===typeof window.TrelloClient&&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);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):f&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+
-" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):n&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+
-" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.gitLab&&b.addItem(mxResources.get("gitlab")+"...",null,function(){a.pickLibrary(App.MODE_GITLAB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},c):p&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+
+a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):e&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+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):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+
+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):k&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},
+c);null!=a.gitLab&&b.addItem(mxResources.get("gitlab")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITLAB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):n&&"function"===typeof window.TrelloClient&&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);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):e&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+
+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):k&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+
+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.gitLab&&b.addItem(mxResources.get("gitlab")+"...",null,function(){a.pickLibrary(App.MODE_GITLAB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},c):n&&"function"===typeof window.TrelloClient&&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);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.editor.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(I){a.handleError(I,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));"1"==urlParams.confLib&&(b.addSeparator(c),b.addItem(mxResources.get("confluenceCloud")+"...",null,function(){a.showRemotelyStoredLibrary(mxResources.get("libraries"))},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 editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));u=a.actions.addAction("comments",
+b;a.editor.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(H){a.handleError(H,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));"1"==urlParams.confLib&&(b.addSeparator(c),b.addItem(mxResources.get("confluenceCloud")+"...",null,function(){a.showRemotelyStoredLibrary(mxResources.get("libraries"))},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 editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));q=a.actions.addAction("comments",
mxUtils.bind(this,function(){if(null==this.commentsWindow)this.commentsWindow=new CommentsWindow(a,document.body.offsetWidth-380,120,300,350),this.commentsWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("comments"));else{var b=!this.commentsWindow.window.isVisible();this.commentsWindow.window.setVisible(b);
-this.commentsWindow.refreshCommentsTime();b&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));u.setToggleAction(!0);u.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));a.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));var u=this.get("viewPanels"),D=u.funct;u.funct=function(b,c){D.apply(this,arguments);
+this.commentsWindow.refreshCommentsTime();b&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));q.setToggleAction(!0);q.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));a.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));var q=this.get("viewPanels"),C=q.funct;q.funct=function(b,c){C.apply(this,arguments);
a.commentsSupported()&&a.menus.addMenuItems(b,["comments"],c)};this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers"]).concat(a.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,
["shapes","-","pageView","pageScale"]);this.addSubmenu("units",b,c);this.addMenuItems(b,"- scrollbars tooltips ruler - 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);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);
@@ -9358,25 +9370,25 @@ a.commentsSupported()&&a.menus.addMenuItems(b,["comments"],c)};this.put("view",n
{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"},{url:"123",title:"Test 4"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"}]):a([{url:"123",title:"Test 4",imgUrl:"https://images.pexels.com/photos/459225/pexels-photo-459225.jpeg"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"},{url:"123",title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},
{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"}]);console.log(b)},1E3)},function(a,b,c){setTimeout(function(){b(c?[{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"},{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"}]:[{url:"123",title:a+"Test 5"},
{url:"123",title:a+"Test 6"},{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"}])},2E3)},null)}),this.addMenuItem(b,"templates",c))})));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)),a.isRevisionHistorySupported()&&this.addMenuItems(b,["-","revisionHistory"],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();if(null!=d&&d.constructor==DriveFile){d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c);this.addMenuItems(b,["save","-","share"],c);var f=this.addMenuItem(b,
-"synchronize",c);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(f,"https://desk.draw.io/support/solutions/articles/16000087947");b.addSeparator(c)}else 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):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||(b.addSeparator(c),
-f=this.addMenuItem(b,"synchronize",c),(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(f,"https://desk.draw.io/support/solutions/articles/16000087947")),this.addMenuItems(b,["-","save","saveAs"],c),this.addMenuItems(b,["-","rename"],c),a.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&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",
+this.addSubmenu("openLibraryFrom",b,c)),a.isRevisionHistorySupported()&&this.addMenuItems(b,["-","revisionHistory"],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();if(null!=d&&d.constructor==DriveFile){d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c);this.addMenuItems(b,["save","-","share"],c);var e=this.addMenuItem(b,
+"synchronize",c);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947");b.addSeparator(c)}else 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):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||(b.addSeparator(c),
+e=this.addMenuItem(b,"synchronize",c),(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947")),this.addMenuItems(b,["-","save","saveAs"],c),this.addMenuItems(b,["-","rename"],c),a.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&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);a.isRevisionHistorySupported()&&this.addMenuItems(b,["-","revisionHistory"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))}})();function DiagramPage(a,c){this.node=a;null!=c?this.node.setAttribute("id",c):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}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,c,b){this.ui=a;this.page=c;this.previous=this.name=b}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
function MovePage(a,c,b){this.ui=a;this.oldIndex=c;this.newIndex=b}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,c,b){this.ui=a;this.previousPage=this.page=c;this.neverShown=!0;null!=c&&(this.neverShown=null==c.viewState,this.ui.updatePageRoot(c),null!=b&&(c.viewState=b,this.neverShown=!1))}
SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,c=this.ui.editor,b=c.graph,d=Graph.compressNode(c.getGraphXml(!0));mxUtils.setTextContent(a.node,d);a.viewState=b.getViewState();a.root=b.model.root;null!=a.model&&a.model.rootChanged(a.root);b.view.clear(a.root,!0);b.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;b.model.prefix=Editor.guid()+"-";b.model.rootChanged(a.root);
b.setViewState(a.viewState);b.gridEnabled=b.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);c.updateGraphComponents();b.view.validate();b.blockMathRender=!0;b.sizeDidChange();b.blockMathRender=!1;this.neverShown&&(this.neverShown=!1,b.selectUnlockedLayer());c.graph.fireEvent(new mxEventObject(mxEvent.ROOT));c.fireEvent(new mxEventObject("pageSelected","change",this))}};
-function ChangePage(a,c,b,d,m){SelectPage.call(this,a,b);this.relatedPage=c;this.index=d;this.previousIndex=null;this.noSelect=m}mxUtils.extend(ChangePage,SelectPage);
+function ChangePage(a,c,b,d,g){SelectPage.call(this,a,b);this.relatedPage=c;this.index=d;this.previousIndex=null;this.noSelect=g}mxUtils.extend(ChangePage,SelectPage);
ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var a=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(a,1);this.index=a}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};EditorUi.prototype.tabContainerHeight=38;
EditorUi.prototype.getSelectedPageIndex=function(){var a=null;if(null!=this.pages&&null!=this.currentPage)for(var c=0;c<this.pages.length;c++)if(this.pages[c]==this.currentPage){a=c;break}return a};EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var c=0;c<this.pages.length;c++)if(this.pages[c].getId()==a)return this.pages[c];return null};
EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,c=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":this.tabContainerHeight+"px";b!=this.tabContainer.style.height&&this.refresh(!1)}c.apply(a.view,arguments)});var b=null,d=mxUtils.bind(this,function(){this.updateTabContainer();var c=this.currentPage;null!=c&&c!=b&&(null==c.viewState||null==c.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+c.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+c.viewState.scrollTop),b=c);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(){null!=this.editor&&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,b){for(var c=b.getProperty("edit").changes,f=0;f<c.length;f++)if(c[f]instanceof SelectPage||c[f]instanceof RenamePage||c[f]instanceof MovePage||c[f]instanceof mxRootChange){d();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}};
+"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,b){for(var c=b.getProperty("edit").changes,e=0;e<c.length;e++)if(c[e]instanceof SelectPage||c[e]instanceof RenamePage||c[e]instanceof MovePage||c[e]instanceof mxRootChange){d();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}};
EditorUi.prototype.restoreViewState=function(a,c,b){a=null!=a?this.getPageById(a.getId()):null;var d=this.editor.graph;null!=a&&null!=this.currentPage&&null!=this.pages&&(a!=this.currentPage?this.selectPage(a,!0,c):(d.setViewState(c),this.editor.updateGraphComponents(),d.view.revalidate(),d.sizeDidChange()),d.container.scrollLeft=d.view.translate.x*d.view.scale+c.scrollLeft,d.container.scrollTop=d.view.translate.y*d.view.scale+c.scrollTop,d.restoreSelection(b))};
-Graph.prototype.createViewState=function(a){var c=a.getAttribute("page"),b=parseFloat(a.getAttribute("pageScale")),d=parseFloat(a.getAttribute("pageWidth")),m=parseFloat(a.getAttribute("pageHeight")),f=a.getAttribute("background"),l=a.getAttribute("backgroundImage"),l=null!=l&&0<l.length?JSON.parse(l):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!=c?"0"!=c:this.defaultPageVisible,background:null!=f&&0<f.length?f:null,backgroundImage:null!=l?new mxImage(l.src,l.width,l.height):null,pageScale:isNaN(b)?mxGraph.prototype.pageScale:b,pageFormat:isNaN(d)||isNaN(m)?mxSettings.getPageFormat():new mxRectangle(0,0,d,m),tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"==a.getAttribute("math"),
+Graph.prototype.createViewState=function(a){var c=a.getAttribute("page"),b=parseFloat(a.getAttribute("pageScale")),d=parseFloat(a.getAttribute("pageWidth")),g=parseFloat(a.getAttribute("pageHeight")),e=a.getAttribute("background"),k=a.getAttribute("backgroundImage"),k=null!=k&&0<k.length?JSON.parse(k):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!=c?"0"!=c:this.defaultPageVisible,background:null!=e&&0<e.length?e:null,backgroundImage:null!=k?new mxImage(k.src,k.width,k.height):null,pageScale:isNaN(b)?mxGraph.prototype.pageScale:b,pageFormat:isNaN(d)||isNaN(g)?mxSettings.getPageFormat():new mxRectangle(0,0,d,g),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.saveViewState=function(a,c,b){b||(c.setAttribute("grid",null==a||a.gridEnabled?"1":"0"),c.setAttribute("gridSize",null!=a?a.gridSize:mxGraph.prototype.gridSize),c.setAttribute("guides",null==a||a.guidesEnabled?"1":"0"),c.setAttribute("tooltips",null==a||a.tooltips?"1":"0"),c.setAttribute("connect",null==a||a.connect?"1":"0"),c.setAttribute("arrows",null==a||a.arrows?"1":"0"),c.setAttribute("page",null==a&&this.defaultPageVisible||null!=a&&a.pageVisible?"1":"0"),c.setAttribute("fold",
null==a||a.foldingEnabled?"1":"0"));c.setAttribute("pageScale",null!=a&&null!=a.pageScale?a.pageScale:mxGraph.prototype.pageScale);b=null!=a?a.pageFormat:mxSettings.getPageFormat();null!=b&&(c.setAttribute("pageWidth",b.width),c.setAttribute("pageHeight",b.height));null!=a&&null!=a.background&&c.setAttribute("background",a.background);null!=a&&null!=a.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(a.backgroundImage));c.setAttribute("math",null!=a&&a.mathEnabled?"1":"0");c.setAttribute("shadow",
@@ -9389,167 +9401,167 @@ a.translate)):(this.view.currentRoot=null,this.view.scale=1,this.gridEnabled=!0,
this.pasteCounter=0,this.mathEnabled=!1,this.connectionArrowsEnabled=!0);this.preferPageSize=this.pageBreaksVisible=this.pageVisible;this.fireEvent(new mxEventObject("viewStateChanged","state",a))};
EditorUi.prototype.updatePageRoot=function(a){if(null==a.root){var c=this.editor.extractGraphModel(a.node),b=Editor.extractParserError(c);if(b)throw Error(b);null!=c?(a.graphModelNode=c,a.viewState=this.editor.graph.createViewState(c),b=new mxCodec(c.ownerDocument),a.root=b.decode(c).root):a.root=this.editor.graph.model.createRoot()}else if(null==a.viewState){if(null==a.graphModelNode){c=this.editor.extractGraphModel(a.node);if(b=Editor.extractParserError(c))throw Error(b);null!=c&&(a.graphModelNode=
c)}null!=a.graphModelNode&&(a.viewState=this.editor.graph.createViewState(a.graphModelNode))}return a};
-EditorUi.prototype.selectPage=function(a,c,b){try{if(a!=this.currentPage){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c=null!=c?c:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var d=this.editor.graph.model.createUndoableEdit();d.ignoreEdit=!0;var m=new SelectPage(this,a,b);m.execute();d.add(m);d.notify();this.editor.graph.tooltipHandler.hide();c||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))}}catch(f){this.handleError(f)}};
+EditorUi.prototype.selectPage=function(a,c,b){try{if(a!=this.currentPage){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c=null!=c?c:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var d=this.editor.graph.model.createUndoableEdit();d.ignoreEdit=!0;var g=new SelectPage(this,a,b);g.execute();d.add(g);d.notify();this.editor.graph.tooltipHandler.hide();c||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))}}catch(e){this.handleError(e)}};
EditorUi.prototype.selectNextPage=function(a){var c=this.currentPage;null!=c&&null!=this.pages&&(c=mxUtils.indexOf(this.pages,c),a?this.selectPage(this.pages[mxUtils.mod(c+1,this.pages.length)]):a||this.selectPage(this.pages[mxUtils.mod(c-1,this.pages.length)]))};
EditorUi.prototype.insertPage=function(a,c){if(this.editor.graph.isEnabled()){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);a=null!=a?a:this.createPage(null,this.createPageId());c=null!=c?c:this.pages.length;var b=new ChangePage(this,a,a,c);this.editor.graph.model.execute(b)}return a};EditorUi.prototype.createPageId=function(){var a;do a=Editor.guid();while(null!=this.getPageById(a));return a};
EditorUi.prototype.createPage=function(a,c){var b=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"),c);b.setName(null!=a?a:this.createPageName());return b};EditorUi.prototype.createPageName=function(){for(var a={},c=0;c<this.pages.length;c++){var b=this.pages[c].getName();null!=b&&0<b.length&&(a[b]=b)}c=this.pages.length;do b=mxResources.get("pageWithNumber",[++c]);while(null!=a[b]);return b};
-EditorUi.prototype.removePage=function(a){try{var c=this.editor.graph,b=mxUtils.indexOf(this.pages,a);if(c.isEnabled()&&0<=b){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c.model.beginUpdate();try{var d=this.currentPage;d==a&&1<this.pages.length?(b==this.pages.length-1?b--:b++,d=this.pages[b]):1>=this.pages.length&&(d=this.insertPage(),c.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));c.model.execute(new ChangePage(this,a,d))}finally{c.model.endUpdate()}}}catch(m){this.handleError(m)}return a};
-EditorUi.prototype.duplicatePage=function(a,c){var b=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var m=a.node.cloneNode(!1);m.removeAttribute("id");b=new DiagramPage(m);b.root=d.cloneCell(d.model.root);b.viewState=d.getViewState();b.viewState.scale=1;b.viewState.scrollLeft=null;b.viewState.scrollTop=null;b.viewState.currentRoot=null;b.viewState.defaultParent=null;b.setName(c);b=this.insertPage(b,mxUtils.indexOf(this.pages,a)+1)}}catch(f){this.handleError(f)}return b};
+EditorUi.prototype.removePage=function(a){try{var c=this.editor.graph,b=mxUtils.indexOf(this.pages,a);if(c.isEnabled()&&0<=b){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);c.model.beginUpdate();try{var d=this.currentPage;d==a&&1<this.pages.length?(b==this.pages.length-1?b--:b++,d=this.pages[b]):1>=this.pages.length&&(d=this.insertPage(),c.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));c.model.execute(new ChangePage(this,a,d))}finally{c.model.endUpdate()}}}catch(g){this.handleError(g)}return a};
+EditorUi.prototype.duplicatePage=function(a,c){var b=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var g=a.node.cloneNode(!1);g.removeAttribute("id");b=new DiagramPage(g);b.root=d.cloneCell(d.model.root);b.viewState=d.getViewState();b.viewState.scale=1;b.viewState.scrollLeft=null;b.viewState.scrollTop=null;b.viewState.currentRoot=null;b.viewState.defaultParent=null;b.setName(c);b=this.insertPage(b,mxUtils.indexOf(this.pages,a)+1)}}catch(e){this.handleError(e)}return b};
EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var c=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(b){null!=b&&0<b.length&&this.editor.graph.model.execute(new RenamePage(this,a,b))}),mxResources.get("rename"));this.showDialog(c.container,300,80,!0,!0);c.init()}return a};EditorUi.prototype.movePage=function(a,c){this.editor.graph.model.execute(new MovePage(this,a,c))};
EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.className="geTabContainer";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,c=document.createElement("div");c.style.position="relative";c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";c.style.verticalAlign="top";c.style.height=this.tabContainer.style.height;c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.fontSize="13px";c.style.marginLeft="30px";for(var b=this.editor.isChromelessView()?29:59,d=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
-b)/this.pages.length)+1),m=null,f=0;f<this.pages.length;f++)mxUtils.bind(this,function(b,d){this.pages[b]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),m=b):mxEvent.consume(c)}));mxEvent.addListener(d,"dragend",mxUtils.bind(this,function(a){a.stopPropagation();
-a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=m&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=m&&b!=m&&this.movePage(m,b);m=null;a.stopPropagation();a.preventDefault()}));c.appendChild(d)})(f,this.createTabForPage(this.pages[f],d,this.pages[f]!=this.currentPage,f+1));this.tabContainer.innerHTML="";this.tabContainer.appendChild(c);d=this.createPageMenuTab();
-this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(c.clientWidth>this.tabContainer.clientWidth-b){null!=d&&(d.style.position="absolute",d.style.right="0px",c.style.marginRight="30px");var l=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");l.style.position="absolute";l.style.right=this.editor.chromeless?"29px":"55px";l.style.fontSize="13pt";this.tabContainer.appendChild(l);var n=this.createControlTab(4,"&nbsp;&#10095;");
-n.style.position="absolute";n.style.right=this.editor.chromeless?"0px":"29px";n.style.fontSize="13pt";this.tabContainer.appendChild(n);var p=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));c.style.width=p+"px";mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){c.scrollLeft-=Math.max(20,p-20);mxUtils.setOpacity(l,0<c.scrollLeft?100:50);mxUtils.setOpacity(n,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(l,0<c.scrollLeft?100:
-50);mxUtils.setOpacity(n,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.addListener(n,"click",mxUtils.bind(this,function(a){c.scrollLeft+=Math.max(20,p-20);mxUtils.setOpacity(l,0<c.scrollLeft?100:50);mxUtils.setOpacity(n,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
+b)/this.pages.length)+1),g=null,e=0;e<this.pages.length;e++)mxUtils.bind(this,function(b,d){this.pages[b]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(c){a.isEnabled()?(mxClient.IS_FF&&c.dataTransfer.setData("Text","<diagram/>"),g=b):mxEvent.consume(c)}));mxEvent.addListener(d,"dragend",mxUtils.bind(this,function(a){a.stopPropagation();
+a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=g&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=g&&b!=g&&this.movePage(g,b);g=null;a.stopPropagation();a.preventDefault()}));c.appendChild(d)})(e,this.createTabForPage(this.pages[e],d,this.pages[e]!=this.currentPage,e+1));this.tabContainer.innerHTML="";this.tabContainer.appendChild(c);d=this.createPageMenuTab();
+this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(c.clientWidth>this.tabContainer.clientWidth-b){null!=d&&(d.style.position="absolute",d.style.right="0px",c.style.marginRight="30px");var k=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");k.style.position="absolute";k.style.right=this.editor.chromeless?"29px":"55px";k.style.fontSize="13pt";this.tabContainer.appendChild(k);var m=this.createControlTab(4,"&nbsp;&#10095;");
+m.style.position="absolute";m.style.right=this.editor.chromeless?"0px":"29px";m.style.fontSize="13pt";this.tabContainer.appendChild(m);var n=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));c.style.width=n+"px";mxEvent.addListener(k,"click",mxUtils.bind(this,function(a){c.scrollLeft-=Math.max(20,n-20);mxUtils.setOpacity(k,0<c.scrollLeft?100:50);mxUtils.setOpacity(m,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(k,0<c.scrollLeft?100:
+50);mxUtils.setOpacity(m,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.addListener(m,"click",mxUtils.bind(this,function(a){c.scrollLeft+=Math.max(20,n-20);mxUtils.setOpacity(k,0<c.scrollLeft?100:50);mxUtils.setOpacity(m,c.scrollLeft<c.scrollWidth-c.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
EditorUi.prototype.createTab=function(a){var c=document.createElement("div");c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";c.style.whiteSpace="nowrap";c.style.boxSizing="border-box";c.style.position="relative";c.style.overflow="hidden";c.style.textAlign="center";c.style.marginLeft="-1px";c.style.height=this.tabContainer.clientHeight+"px";c.style.padding="12px 4px 8px 4px";c.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #e8eaed";c.style.borderTopStyle="none";c.style.borderBottomStyle=
"none";c.style.backgroundColor=this.tabContainer.style.backgroundColor;c.style.cursor="move";c.style.color="gray";a&&(mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(c.style.backgroundColor="dark"==uiTheme?"black":"#e8eaed",mxEvent.consume(a))})),mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(a){c.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return c};
EditorUi.prototype.createControlTab=function(a,c){var b=this.createTab(!0);b.style.lineHeight=this.tabContainerHeight+"px";b.style.paddingTop=a+"px";b.style.cursor="pointer";b.style.width="30px";b.innerHTML=c;null!=b.firstChild&&null!=b.firstChild.style&&mxUtils.setOpacity(b.firstChild,40);return b};
EditorUi.prototype.createPageMenuTab=function(){var a=this.createControlTab(3,'<div class="geSprite geSprite-dots" style="display:inline-block;margin-top:5px;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.marginLeft="0px";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var c=
0;c<this.pages.length;c++)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)})(c);if(this.editor.graph.isEnabled()){a.addSeparator(b);a.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),b);var d=this.currentPage;null!=d&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this,
function(){this.removePage(d)}),b),a.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(d,d.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(d,mxResources.get("copyOf",[d.getName()]))}),b))}}));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 c=
-mxEvent.getClientX(a),m=mxEvent.getClientY(a);b.popup(c,m,null,a);this.setCurrentMenu(b);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,c,b,d){b=this.createTab(b);var m=a.getName()||mxResources.get("untitled"),f=a.getId();b.setAttribute("title",m+(null!=f?" ("+f+")":"")+" ["+d+"]");mxUtils.write(b,m);b.style.maxWidth=c+"px";b.style.width=c+"px";this.addTabListeners(a,b);42<c&&(b.style.textOverflow="ellipsis");return b};
-EditorUi.prototype.addTabListeners=function(a,c){mxEvent.disableContextMenu(c);var b=this.editor.graph;mxEvent.addListener(c,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,m=!1;mxEvent.addGestureListeners(c,mxUtils.bind(this,function(c){d=null!=this.currentMenu;m=a==this.currentPage;b.isMouseDown||m||this.selectPage(a)}),null,mxUtils.bind(this,function(f){if(b.isEnabled()&&!b.isMouseDown&&(mxEvent.isTouchEvent(f)&&m||mxEvent.isPopupTrigger(f))){b.popupMenuHandler.hideMenu();
-this.hideCurrentMenu();if(!mxEvent.isTouchEvent(f)||!d){var l=new mxPopupMenu(this.createPageMenu(a));l.div.className+=" geMenubarMenu";l.smartSeparators=!0;l.showDisabled=!0;l.autoExpand=!0;l.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(l,arguments);this.resetCurrentMenu();l.destroy()});var n=mxEvent.getClientX(f),p=mxEvent.getClientY(f);l.popup(n,p,null,f);this.setCurrentMenu(l,c)}mxEvent.consume(f)}}))};
+mxEvent.getClientX(a),g=mxEvent.getClientY(a);b.popup(c,g,null,a);this.setCurrentMenu(b);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,c,b,d){b=this.createTab(b);var g=a.getName()||mxResources.get("untitled"),e=a.getId();b.setAttribute("title",g+(null!=e?" ("+e+")":"")+" ["+d+"]");mxUtils.write(b,g);b.style.maxWidth=c+"px";b.style.width=c+"px";this.addTabListeners(a,b);42<c&&(b.style.textOverflow="ellipsis");return b};
+EditorUi.prototype.addTabListeners=function(a,c){mxEvent.disableContextMenu(c);var b=this.editor.graph;mxEvent.addListener(c,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,g=!1;mxEvent.addGestureListeners(c,mxUtils.bind(this,function(c){d=null!=this.currentMenu;g=a==this.currentPage;b.isMouseDown||g||this.selectPage(a)}),null,mxUtils.bind(this,function(e){if(b.isEnabled()&&!b.isMouseDown&&(mxEvent.isTouchEvent(e)&&g||mxEvent.isPopupTrigger(e))){b.popupMenuHandler.hideMenu();
+this.hideCurrentMenu();if(!mxEvent.isTouchEvent(e)||!d){var k=new mxPopupMenu(this.createPageMenu(a));k.div.className+=" geMenubarMenu";k.smartSeparators=!0;k.showDisabled=!0;k.autoExpand=!0;k.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(k,arguments);this.resetCurrentMenu();k.destroy()});var m=mxEvent.getClientX(e),n=mxEvent.getClientY(e);k.popup(m,n,null,e);this.setCurrentMenu(k,c)}mxEvent.consume(e)}}))};
EditorUi.prototype.createPageMenu=function(a,c){return mxUtils.bind(this,function(b,d){b.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),d);b.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),d);b.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,c)}),d);b.addSeparator(d);b.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
mxResources.get("copyOf",[a.getName()]))}),d)})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(c){a.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){a=d.oldIndex;d.oldIndex=d.newIndex;d.newIndex=a;return d};mxCodecRegistry.register(a)})();
(function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){a=d.previous;d.previous=d.name;d.name=a;return d};mxCodecRegistry.register(a)})();
-(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),c="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,d,m){m.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(m.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.viewState&&m.setAttribute("viewState",JSON.stringify(d.relatedPage.viewState,function(a,b){return 0>mxUtils.indexOf(c,
-a)?b:void 0})),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,m));return m};a.beforeDecode=function(a,c,m){m.ui=a.ui;m.relatedPage=m.ui.getPageById(c.getAttribute("relatedPage"));if(null==m.relatedPage){var b=c.ownerDocument.createElement("diagram");b.setAttribute("id",c.getAttribute("relatedPage"));b.setAttribute("name",c.getAttribute("name"));m.relatedPage=new DiagramPage(b);b=c.getAttribute("viewState");null!=b&&(m.relatedPage.viewState=JSON.parse(b),c.removeAttribute("viewState"));
-c=c.cloneNode(!0);b=c.firstChild;if(null!=b)for(m.relatedPage.root=a.decodeCell(b,!1),m=b.nextSibling,b.parentNode.removeChild(b),b=m;null!=b;){m=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var d=b.getAttribute("id");null==a.lookup(d)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=m}}return c};a.afterDecode=function(a,c,m){m.index=m.previousIndex;return m};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";EditorUi.prototype.altShiftActions[68]=
-"selectDescendants";var c=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,b,d,n,p){b=null!=b?b:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var f=d.slice(),g=[],l=0;l<d.length;l++){var m=this.view.getState(d[l]),v=null!=m?m.style:this.getCellStyle(d[l]);"1"==mxUtils.getValue(v,"treeFolding","0")&&(this.traverse(d[l],!0,mxUtils.bind(this,function(a,b){null!=b&&g.push(b);a!=d[l]&&g.push(a);return a==d[l]||!this.model.isCollapsed(a)})),
-this.model.setCollapsed(d[l],a))}for(l=0;l<g.length;l++)this.model.setVisible(g[l],!a);d=f;d=c.apply(this,arguments)}finally{this.model.endUpdate()}return d};var b=EditorUi.prototype.init;EditorUi.prototype.init=function(){b.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return A.isVertex(a)&&d(a)}function c(a){var b=!1;null!=a&&(b=t.view.getState(a),b="1"==(null!=b?b.style:t.getCellStyle(a)).treeMoving);
-return b}function d(a){var b=!1;null!=a&&(a=A.getParent(a),b=t.view.getState(a),b="tree"==(null!=b?b.style:t.getCellStyle(a)).containerType);return b}function n(a){var b=!1;null!=a&&(a=A.getParent(a),b=t.view.getState(a),t.view.getState(a),b=null!=(null!=b?b.style:t.getCellStyle(a)).childLayout);return b}function p(a){a=t.view.getState(a);if(null!=a){var b=t.getIncomingEdges(a.cell);if(0<b.length&&(b=t.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 u(a,b){b=null!=b?b:!0;t.model.beginUpdate();try{var c=t.model.getParent(a),d=t.getIncomingEdges(a),f=t.cloneCells([d[0],a]);t.model.setTerminal(f[0],t.model.getTerminal(d[0],!0),!0);var g=p(a),l=c.geometry;g==mxConstants.DIRECTION_SOUTH||
-g==mxConstants.DIRECTION_NORTH?f[1].geometry.x+=b?a.geometry.width+10:-f[1].geometry.width-10:f[1].geometry.y+=b?a.geometry.height+10:-f[1].geometry.height-10;t.view.currentRoot!=c&&(f[1].geometry.x-=l.x,f[1].geometry.y-=l.y);var k=t.view.getState(a),m=t.view.scale;if(null!=k){var n=mxRectangle.fromRectangle(k);g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-f[1].geometry.width-10)*m:n.y+=(b?a.geometry.height+10:-f[1].geometry.height-10)*m;var q=t.getOutgoingEdges(t.model.getTerminal(d[0],
-!0));if(null!=q){for(var u=g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH,v=l=d=0;v<q.length;v++){var x=t.model.getTerminal(q[v],!1);if(g==p(x)){var B=t.view.getState(x);x!=a&&null!=B&&(u&&b!=B.getCenterX()<k.getCenterX()||!u&&b!=B.getCenterY()<k.getCenterY())&&mxUtils.intersects(n,B)&&(d=10+Math.max(d,(Math.min(n.x+n.width,B.x+B.width)-Math.max(n.x,B.x))/m),l=10+Math.max(l,(Math.min(n.y+n.height,B.y+B.height)-Math.max(n.y,B.y))/m))}}u?l=0:d=0;for(v=0;v<q.length;v++)if(x=t.model.getTerminal(q[v],
-!1),g==p(x)&&(B=t.view.getState(x),x!=a&&null!=B&&(u&&b!=B.getCenterX()<k.getCenterX()||!u&&b!=B.getCenterY()<k.getCenterY()))){var A=[];t.traverse(B.cell,!0,function(a,b){null!=b&&A.push(b);A.push(a);return!0});t.moveCells(A,(b?1:-1)*d,(b?1:-1)*l)}}}return t.addCells(f,c)}finally{t.model.endUpdate()}}function g(a){t.model.beginUpdate();try{var b=p(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1);
-var f=t.model.getParent(a),g=f.geometry,l=[];t.view.currentRoot!=f&&(d[1].geometry.x-=g.x,d[1].geometry.y-=g.y);t.traverse(a,!0,function(a,b){null!=b&&l.push(b);l.push(a);return!0});var k=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,m=-m):b==mxConstants.DIRECTION_WEST?(k=-k,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);t.moveCells(l,k,m);return t.addCells(d,f)}finally{t.model.endUpdate()}}function k(a){t.model.beginUpdate();try{var b=
-t.model.getParent(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(d[0],a,!0);var c=t.getOutgoingEdges(a),f=b.geometry,g=[];t.view.currentRoot==b&&(f=new mxRectangle);for(var l=0;l<c.length;l++){var k=t.model.getTerminal(c[l],!1);null!=k&&g.push(k)}var m=t.view.getBounds(g),n=p(a),q=t.view.translate,u=t.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/u-q.x-f.x+10,d[1].geometry.y+=d[1].geometry.height-
-f.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/u-q.x+-f.x+10,d[1].geometry.y-=d[1].geometry.height+f.y+40):(d[1].geometry.x=n==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width+f.x+40):d[1].geometry.x+(d[1].geometry.width-f.x+40),d[1].geometry.y=null==m?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(m.y+m.height)/u-q.y+-f.y+10);return t.addCells(d,b)}finally{t.model.endUpdate()}}function q(a,
-b,c){a=t.getOutgoingEdges(a);c=t.view.getState(c);var d=[];if(null!=c&&null!=a){for(var f=0;f<a.length;f++){var g=t.view.getState(t.model.getTerminal(a[f],!1));null!=g&&(!b&&Math.min(g.x+g.width,c.x+c.width)>=Math.max(g.x,c.x)||b&&Math.min(g.y+g.height,c.y+c.height)>=Math.max(g.y,c.y))&&d.push(g)}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 v(a,b){var c=p(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
-c==mxConstants.DIRECTION_WEST)==d&&c!=b?y.actions.get("selectParent").funct():c==b?(d=t.getOutgoingEdges(a),null!=d&&0<d.length&&t.setSelectionCell(t.model.getTerminal(d[0],!1))):(c=t.getIncomingEdges(a),null!=c&&0<c.length&&(d=q(t.model.getTerminal(c[0],!0),d,a),c=t.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&&t.setSelectionCell(d[c].cell)))))}var y=this,t=y.editor.graph,A=t.getModel(),z=y.menus.createPopupMenu;
-y.menus.createPopupMenu=function(a,c,d){z.apply(this,arguments);if(1==t.getSelectionCount()){c=t.getSelectionCell();var f=t.getOutgoingEdges(c);a.addSeparator();null!=f&&0<f.length&&(b(t.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(t.getSelectionCell())&&(a.addSeparator(),0<t.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};y.actions.addAction("selectChildren",function(){if(t.isEnabled()&&
-1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+X");y.actions.addAction("selectSiblings",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=t.getOutgoingEdges(t.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],
-!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+S");y.actions.addAction("selectParent",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);null!=a&&0<a.length&&t.setSelectionCell(t.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");y.actions.addAction("selectDescendants",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),b=[];t.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});t.setSelectionCells(b)}},
-null,null,"Alt+Shift+D");var D=t.removeCells;t.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 f=[],g=0;g<a.length;g++){var l=a[g];A.isEdge(l)&&d(l)&&(f.push(l),l=A.getTerminal(l,!1));b(l)?(t.traverse(l,!0,function(a,b){null!=b&&f.push(b);f.push(a);return!0}),l=t.getIncomingEdges(a[g]),a=a.concat(l)):f.push(a[g])}a=f;return D.apply(this,arguments)};y.hoverIcons.getStateAt=function(a,c,
-d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var x=t.duplicateCells;t.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),f=0;f<d.length;f++){var g=t.view.getState(d[f]);if(null!=g&&b(g.cell))for(var l=t.getIncomingEdges(g.cell),g=0;g<l.length;g++)mxUtils.remove(l[g],a)}this.model.beginUpdate();try{var k=x.call(this,a,c);if(k.length==a.length)for(f=0;f<a.length;f++)if(b(a[f])){var m=t.getIncomingEdges(k[f]),l=t.getIncomingEdges(a[f]);
-if(0==m.length&&0<l.length){var n=this.cloneCell(l[0]);this.addEdge(n,t.getDefaultParent(),this.model.getTerminal(l[0],!0),k[f])}}}finally{this.model.endUpdate()}return k};var C=t.moveCells;t.moveCells=function(a,c,d,f,g,l,k){var m=null;this.model.beginUpdate();try{var n=g,p=this.view.getState(g),q=null!=p?p.style:this.getCellStyle(g);if(null!=a&&b(g)&&"1"==mxUtils.getValue(q,"treeFolding","0")){for(var u=0;u<a.length;u++)if(b(a[u])||t.model.isEdge(a[u])&&null==t.model.getTerminal(a[u],!0)){g=t.model.getParent(a[u]);
-break}if(null!=n&&g!=n&&null!=this.view.getState(a[0])){var v=t.getIncomingEdges(a[0]);if(0<v.length){var x=t.view.getState(t.model.getTerminal(v[0],!0));if(null!=x){var B=t.view.getState(n);null!=B&&(c=(B.getCenterX()-x.getCenterX())/t.view.scale,d=(B.getCenterY()-x.getCenterY())/t.view.scale)}}}}m=C.apply(this,arguments);if(null!=m&&null!=a&&m.length==a.length)for(u=0;u<m.length;u++)if(this.model.isEdge(m[u]))b(n)&&0>mxUtils.indexOf(m,this.model.getTerminal(m[u],!0))&&this.model.setTerminal(m[u],
-n,!0);else if(b(a[u])&&(v=t.getIncomingEdges(a[u]),0<v.length))if(!f)b(n)&&0>mxUtils.indexOf(a,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],n,!0);else if(0==t.getIncomingEdges(m[u]).length){p=n;if(null==p||p==t.model.getParent(a[u]))p=t.model.getTerminal(v[0],!0);f=this.cloneCell(v[0]);this.addEdge(f,t.getDefaultParent(),p,m[u])}}finally{this.model.endUpdate()}return m};if(null!=y.sidebar){var G=y.sidebar.dropAndConnect;y.sidebar.dropAndConnect=function(a,c,d,f){var g=t.model,l=null;
-g.beginUpdate();try{if(l=G.apply(this,arguments),b(a))for(var k=0;k<l.length;k++)if(g.isEdge(l[k])&&null==g.getTerminal(l[k],!0)){g.setTerminal(l[k],a,!0);var m=t.getCellGeometry(l[k]);m.points=null;null!=m.getTerminalPoint(!0)&&m.setTerminalPoint(null,!0)}}finally{g.endUpdate()}return l}}var B={88:y.actions.get("selectChildren"),84:y.actions.get("selectSubtree"),80:y.actions.get("selectParent"),83:y.actions.get("selectSiblings")},F=y.onKeyDown;y.onKeyDown=function(a){try{if(t.isEnabled()&&!t.isEditing()&&
-b(t.getSelectionCell())&&1==t.getSelectionCount()){var c=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?g(t.getSelectionCell()):k(t.getSelectionCell()):13==a.which&&(c=u(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&t.model.isEdge(c[0])?t.setSelectionCell(t.model.getTerminal(c[0],!1)):t.setSelectionCell(c[c.length-1]),null!=y.hoverIcons&&y.hoverIcons.update(t.view.getState(t.getSelectionCell())),t.startEditingAtCell(t.getSelectionCell()),
-mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=B[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(v(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(v(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(v(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(v(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(S){console.log("error",
-S)}mxEvent.isConsumed(a)||F.apply(this,arguments)};var E=t.connectVertex;t.connectVertex=function(a,c,d,f,l,m){var n=t.getIncomingEdges(a);return b(a)&&0<n.length?(d=p(a),f=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,l=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?k(a):f==l?g(a):u(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):E.call(this,a,c,d,f,l,m)};t.getSubtree=function(a){var d=[a];!c(a)&&!b(a)||n(a)||t.traverse(a,!0,function(a,b){null!=
-b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);return!0});return d};var I=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){I.apply(this,arguments);(c(this.state.cell)||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",
+(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),c="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,d,g){g.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(g.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.viewState&&g.setAttribute("viewState",JSON.stringify(d.relatedPage.viewState,function(a,b){return 0>mxUtils.indexOf(c,
+a)?b:void 0})),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,g));return g};a.beforeDecode=function(a,c,g){g.ui=a.ui;g.relatedPage=g.ui.getPageById(c.getAttribute("relatedPage"));if(null==g.relatedPage){var b=c.ownerDocument.createElement("diagram");b.setAttribute("id",c.getAttribute("relatedPage"));b.setAttribute("name",c.getAttribute("name"));g.relatedPage=new DiagramPage(b);b=c.getAttribute("viewState");null!=b&&(g.relatedPage.viewState=JSON.parse(b),c.removeAttribute("viewState"));
+c=c.cloneNode(!0);b=c.firstChild;if(null!=b)for(g.relatedPage.root=a.decodeCell(b,!1),g=b.nextSibling,b.parentNode.removeChild(b),b=g;null!=b;){g=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){var d=b.getAttribute("id");null==a.lookup(d)&&a.decodeCell(b)}b.parentNode.removeChild(b);b=g}}return c};a.afterDecode=function(a,c,g){g.index=g.previousIndex;return g};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";EditorUi.prototype.altShiftActions[68]=
+"selectDescendants";var c=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,b,d,m,n){b=null!=b?b:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var e=d.slice(),f=[],g=0;g<d.length;g++){var k=this.view.getState(d[g]),u=null!=k?k.style:this.getCellStyle(d[g]);"1"==mxUtils.getValue(u,"treeFolding","0")&&(this.traverse(d[g],!0,mxUtils.bind(this,function(a,b){null!=b&&f.push(b);a!=d[g]&&f.push(a);return a==d[g]||!this.model.isCollapsed(a)})),
+this.model.setCollapsed(d[g],a))}for(g=0;g<f.length;g++)this.model.setVisible(f[g],!a);d=e;d=c.apply(this,arguments)}finally{this.model.endUpdate()}return d};var b=EditorUi.prototype.init;EditorUi.prototype.init=function(){b.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return z.isVertex(a)&&d(a)}function c(a){var b=!1;null!=a&&(b=t.view.getState(a),b="1"==(null!=b?b.style:t.getCellStyle(a)).treeMoving);
+return b}function d(a){var b=!1;null!=a&&(a=z.getParent(a),b=t.view.getState(a),b="tree"==(null!=b?b.style:t.getCellStyle(a)).containerType);return b}function m(a){var b=!1;null!=a&&(a=z.getParent(a),b=t.view.getState(a),t.view.getState(a),b=null!=(null!=b?b.style:t.getCellStyle(a)).childLayout);return b}function n(a){a=t.view.getState(a);if(null!=a){var b=t.getIncomingEdges(a.cell);if(0<b.length&&(b=t.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 q(a,b){b=null!=b?b:!0;t.model.beginUpdate();try{var c=t.model.getParent(a),d=t.getIncomingEdges(a),e=t.cloneCells([d[0],a]);t.model.setTerminal(e[0],t.model.getTerminal(d[0],!0),!0);var f=n(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;t.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=t.view.getState(a),l=t.view.scale;if(null!=k){var m=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=t.getOutgoingEdges(t.model.getTerminal(d[0],
+!0));if(null!=p){for(var q=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,u=g=d=0;u<p.length;u++){var x=t.model.getTerminal(p[u],!1);if(f==n(x)){var v=t.view.getState(x);x!=a&&null!=v&&(q&&b!=v.getCenterX()<k.getCenterX()||!q&&b!=v.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,v)&&(d=10+Math.max(d,(Math.min(m.x+m.width,v.x+v.width)-Math.max(m.x,v.x))/l),g=10+Math.max(g,(Math.min(m.y+m.height,v.y+v.height)-Math.max(m.y,v.y))/l))}}q?g=0:d=0;for(u=0;u<p.length;u++)if(x=t.model.getTerminal(p[u],
+!1),f==n(x)&&(v=t.view.getState(x),x!=a&&null!=v&&(q&&b!=v.getCenterX()<k.getCenterX()||!q&&b!=v.getCenterY()<k.getCenterY()))){var B=[];t.traverse(v.cell,!0,function(a,b){null!=b&&B.push(b);B.push(a);return!0});t.moveCells(B,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=n(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1);
+var e=t.model.getParent(a),f=e.geometry,g=[];t.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);t.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-l):b==mxConstants.DIRECTION_WEST?(k=-k,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);t.moveCells(g,k,l);return t.addCells(d,e)}finally{t.model.endUpdate()}}function l(a){t.model.beginUpdate();try{var b=
+t.model.getParent(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(d[0],a,!0);var c=t.getOutgoingEdges(a),e=b.geometry,f=[];t.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=t.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var l=t.view.getBounds(f),m=n(a),p=t.view.translate,q=t.view.scale;m==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/q-p.x-e.x+10,d[1].geometry.y+=d[1].geometry.height-
+e.y+40):m==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/q-p.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height+e.y+40):(d[1].geometry.x=m==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width+e.x+40):d[1].geometry.x+(d[1].geometry.width-e.x+40),d[1].geometry.y=null==l?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(l.y+l.height)/q-p.y+-e.y+10);return t.addCells(d,b)}finally{t.model.endUpdate()}}function p(a,
+b,c){a=t.getOutgoingEdges(a);c=t.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=t.view.getState(t.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=n(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
+c==mxConstants.DIRECTION_WEST)==d&&c!=b?v.actions.get("selectParent").funct():c==b?(d=t.getOutgoingEdges(a),null!=d&&0<d.length&&t.setSelectionCell(t.model.getTerminal(d[0],!1))):(c=t.getIncomingEdges(a),null!=c&&0<c.length&&(d=p(t.model.getTerminal(c[0],!0),d,a),c=t.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&&t.setSelectionCell(d[c].cell)))))}var v=this,t=v.editor.graph,z=t.getModel(),y=v.menus.createPopupMenu;
+v.menus.createPopupMenu=function(a,c,d){y.apply(this,arguments);if(1==t.getSelectionCount()){c=t.getSelectionCell();var e=t.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(t.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(t.getSelectionCell())&&(a.addSeparator(),0<t.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};v.actions.addAction("selectChildren",function(){if(t.isEnabled()&&
+1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+X");v.actions.addAction("selectSiblings",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=t.getOutgoingEdges(t.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],
+!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+S");v.actions.addAction("selectParent",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);null!=a&&0<a.length&&t.setSelectionCell(t.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");v.actions.addAction("selectDescendants",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),b=[];t.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});t.setSelectionCells(b)}},
+null,null,"Alt+Shift+D");var C=t.removeCells;t.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];z.isEdge(g)&&d(g)&&(e.push(g),g=z.getTerminal(g,!1));b(g)?(t.traverse(g,!0,function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=t.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return C.apply(this,arguments)};v.hoverIcons.getStateAt=function(a,c,
+d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var x=t.duplicateCells;t.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=t.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],a)}this.model.beginUpdate();try{var k=x.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=t.getIncomingEdges(k[e]),g=t.getIncomingEdges(a[e]);
+if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,t.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var B=t.moveCells;t.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.view.getState(f),p=null!=n?n.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||t.model.isEdge(a[q])&&null==t.model.getTerminal(a[q],!0)){f=t.model.getParent(a[q]);
+break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var u=t.getIncomingEdges(a[0]);if(0<u.length){var v=t.view.getState(t.model.getTerminal(u[0],!0));if(null!=v){var x=t.view.getState(m);null!=x&&(c=(x.getCenterX()-v.getCenterX())/t.view.scale,d=(x.getCenterY()-v.getCenterY())/t.view.scale)}}}}l=B.apply(this,arguments);if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],
+m,!0);else if(b(a[q])&&(u=t.getIncomingEdges(a[q]),0<u.length))if(!e)b(m)&&0>mxUtils.indexOf(a,this.model.getTerminal(u[0],!0))&&this.model.setTerminal(u[0],m,!0);else if(0==t.getIncomingEdges(l[q]).length){n=m;if(null==n||n==t.model.getParent(a[q]))n=t.model.getTerminal(u[0],!0);e=this.cloneCell(u[0]);this.addEdge(e,t.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=v.sidebar){var E=v.sidebar.dropAndConnect;v.sidebar.dropAndConnect=function(a,c,d,e){var f=t.model,g=null;
+f.beginUpdate();try{if(g=E.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=t.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var A={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},F=v.onKeyDown;v.onKeyDown=function(a){try{if(t.isEnabled()&&!t.isEditing()&&
+b(t.getSelectionCell())&&1==t.getSelectionCount()){var c=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?f(t.getSelectionCell()):l(t.getSelectionCell()):13==a.which&&(c=q(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&t.model.isEdge(c[0])?t.setSelectionCell(t.model.getTerminal(c[0],!1)):t.setSelectionCell(c[c.length-1]),null!=v.hoverIcons&&v.hoverIcons.update(t.view.getState(t.getSelectionCell())),t.startEditingAtCell(t.getSelectionCell()),
+mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=A[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(u(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(N){console.log("error",
+N)}mxEvent.isConsumed(a)||F.apply(this,arguments)};var D=t.connectVertex;t.connectVertex=function(a,c,d,e,g,k){var m=t.getIncomingEdges(a);return b(a)&&0<m.length?(d=n(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?l(a):e==g?f(a):q(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):D.call(this,a,c,d,e,g,k)};t.getSubtree=function(a){var d=[a];!c(a)&&!b(a)||m(a)||t.traverse(a,!0,function(a,b){null!=
+b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);return!0});return d};var H=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){H.apply(this,arguments);(c(this.state.cell)||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 K=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){K.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 J=mxVertexHandler.prototype.destroy;
-mxVertexHandler.prototype.destroy=function(a,b){J.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.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;");
+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 I=mxVertexHandler.prototype.destroy;
+mxVertexHandler.prototype.destroy=function(a,b){I.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.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 mindmaps 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;treeMoving=1;");b.vertex=!0;var c=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;treeMoving=1;");c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");d.geometry.relative=!0;d.edge=!0;b.insertEdge(d,!0);c.insertEdge(d,!1);var f=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;");
-f.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");k.geometry.relative=!0;k.edge=!0;b.insertEdge(k,!0);f.insertEdge(k,!1);var m=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;treeMoving=1;");m.vertex=!0;var v=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-v.geometry.relative=!0;v.edge=!0;b.insertEdge(v,!0);m.insertEdge(v,!1);var y=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;treeMoving=1;");y.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-t.geometry.relative=!0;t.edge=!0;b.insertEdge(t,!0);y.insertEdge(t,!1);a.insert(d);a.insert(k);a.insert(v);a.insert(t);a.insert(b);a.insert(c);a.insert(f);a.insert(m);a.insert(y);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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;treeMoving=1;");a.vertex=
+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;treeMoving=1;");c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");d.geometry.relative=!0;d.edge=!0;b.insertEdge(d,!0);c.insertEdge(d,!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;treeMoving=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 p=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;treeMoving=1;");p.vertex=!0;var u=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+u.geometry.relative=!0;u.edge=!0;b.insertEdge(u,!0);p.insertEdge(u,!1);var v=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;treeMoving=1;");v.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+t.geometry.relative=!0;t.edge=!0;b.insertEdge(t,!0);v.insertEdge(t,!1);a.insert(d);a.insert(g);a.insert(u);a.insert(t);a.insert(b);a.insert(c);a.insert(e);a.insert(p);a.insert(v);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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;treeMoving=1;");a.vertex=
!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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;treeMoving=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 mindmaps 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;treeMoving=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 c=new mxCell("Organization",new mxGeometry(80,40,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;container=1;recursiveResize=0;");b.setAttributeForCell(c,"treeRoot","1");c.vertex=!0;var d=new mxCell("Division",new mxGeometry(20,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");d.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");
-f.geometry.relative=!0;f.edge=!0;c.insertEdge(f,!0);d.insertEdge(f,!1);var g=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");g.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");k.geometry.relative=!0;k.edge=!0;c.insertEdge(k,!0);g.insertEdge(k,!1);a.insert(f);a.insert(k);a.insert(c);a.insert(d);
-a.insert(g);return sb.createVertexTemplateFromCells([a],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;treeMoving=1;container=1;recursiveResize=0;");b.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",
+a.vertex=!0;var c=new mxCell("Organization",new mxGeometry(80,40,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;container=1;recursiveResize=0;");b.setAttributeForCell(c,"treeRoot","1");c.vertex=!0;var d=new mxCell("Division",new mxGeometry(20,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");d.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");
+e.geometry.relative=!0;e.edge=!0;c.insertEdge(e,!0);d.insertEdge(e,!1);var f=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");f.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");g.geometry.relative=!0;g.edge=!0;c.insertEdge(g,!0);f.insertEdge(g,!1);a.insert(e);a.insert(g);a.insert(c);a.insert(d);
+a.insert(f);return sb.createVertexTemplateFromCells([a],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;treeMoving=1;container=1;recursiveResize=0;");b.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;treeMoving=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;treeMoving=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 c=new mxCell("Sub Section",
new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");d.geometry.setTerminalPoint(new mxPoint(110,-40),!0);d.geometry.relative=!0;d.edge=!0;c.insertEdge(d,!1);return sb.createVertexTemplateFromCells([b,d,a,c],220,60,
-"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new m(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(566,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 c(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,218);a.sidebarWindow=new m(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var g=a.menus.get(c),l=f.addMenu(d,mxUtils.bind(this,function(){g.funct.apply(this,arguments)}));l.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;cusor:pointer;";
-l.className="geTitle";b.appendChild(l);return l}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";d.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(d,mxResources.get("moreShapes"));b.appendChild(d);mxEvent.addListener(d,"click",function(){a.actions.get("shapes").funct()});var f=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 g=document.createElement("span");g.style.cssText="position:relative;top:6px;";mxUtils.write(g,mxResources.get("newLibrary"));d.appendChild(g);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";g=document.createElement("span");g.style.cssText="position:relative;top:6px;";mxUtils.write(g,mxResources.get("openLibrary"));d.appendChild(g);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("openLibrary").funct)}else d=
+"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new g(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(566,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 c(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,218);a.sidebarWindow=new g(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;cusor:pointer;";
+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";d.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';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.boxSizing="border-box",d.style.paddingRight="6px",d.style.paddingLeft="6px",d.style.height="32px",d.style.left="0",d=c("openLibraryFrom",mxResources.get("openLibraryFrom")),d.style.borderLeft="1px solid lightgray",d.style.boxSizing="border-box",d.style.paddingRight="6px",d.style.paddingLeft="6px",d.style.height="32px",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||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var b=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
try{var d=document.createElement("style");d.type="text/css";d.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }html body table.mxWindow td.mxWindowPane div.mxWindowPane *:not(svg *) { font-size:9pt; }table.mxWindow * { font-size:13px; }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; }html body a.geMenuItem { opacity: 0.75; cursor: pointer; user-select:none; }html body a.geMenuItem[disabled] { opacity: 0.2; }html body a.geMenuItem[disabled]:active { opacity: 0.2; }html body div.geActivePage { opacity: 0.7; }html body a.geMenuItem:active { opacity: 0.2; }html body .geToolbarButton { opacity: 0.3; }html body .geToolbarButton:active { opacity: 0.15; }html body .geStatus:active { opacity: 0.5; }html table.mxPopupMenu tr.mxPopupMenuItemHover:active { opacity:0.7; }html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding:2px;display:inline-block; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; border: none !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }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:0px; 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; 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); }.geToolbarContainer { background:#fff !important; }div.geSidebarContainer { background-color: #ffffff; }div.geSidebarContainer .geTitle { background-color:#fdfdfd; }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; }"+
-(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(d)}catch(t){}var m=function(a,b,c,d,f,g,l){var k=document.createElement("div");k.className="geSidebarContainer";k.style.position="absolute";k.style.width="100%";k.style.height="100%";k.style.border="1px solid whiteSmoke";k.style.overflowX="hidden";k.style.overflowY="auto";l(k);this.window=new mxWindow(b,k,c,d,f,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
+(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(d)}catch(t){}var g=function(a,b,c,d,e,f,g){var k=document.createElement("div");k.className="geSidebarContainer";k.style.position="absolute";k.style.width="100%";k.style.height="100%";k.style.border="1px solid whiteSmoke";k.style.overflowX="hidden";k.style.overflowY="auto";g(k);this.window=new mxWindow(b,k,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)};mxClient.IS_SF&&
(this.window.div.onselectstart=mxUtils.bind(this,function(b){null==b&&(b=window.event);return null!=b&&a.isSelectionAllowed(b)}))};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;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR=
"#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=35;mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";Format.prototype.inactiveTabBackgroundColor=
-"#f0f0f0";mxGraphHandler.prototype.previewColor="#C0C0C0";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=!0;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var f=EditorUi.prototype.updateTabContainer;EditorUi.prototype.updateTabContainer=
-function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px");f.apply(this,arguments)};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var n=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(a,c){null!=c.shortcut&&900>b&&!mxClient.IS_IOS?a.firstChild.nextSibling.setAttribute("title",
-c.shortcut):n.apply(this,arguments)};var p=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){p.apply(this,arguments);if(null!=this.userElement){var a=this.userElement;a.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+a.style.display;a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.userImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height=
-"24px";a.style.width="24px";a.style.cssFloat="right";a.setAttribute("title",mxResources.get("changeUser"));"none"!=a.style.display&&(a.style.display="inline-block")}};var u=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){u.apply(this,arguments);if(null!=this.shareButton){var a=this.shareButton;a.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage=
+"#f0f0f0";mxGraphHandler.prototype.previewColor="#C0C0C0";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=!0;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var e=EditorUi.prototype.updateTabContainer;EditorUi.prototype.updateTabContainer=
+function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px");e.apply(this,arguments)};var k=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){k.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var m=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(a,c){null!=c.shortcut&&900>b&&!mxClient.IS_IOS?a.firstChild.nextSibling.setAttribute("title",
+c.shortcut):m.apply(this,arguments)};var n=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){n.apply(this,arguments);if(null!=this.userElement){var a=this.userElement;a.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+a.style.display;a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.userImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height=
+"24px";a.style.width="24px";a.style.cssFloat="right";a.setAttribute("title",mxResources.get("changeUser"));"none"!=a.style.display&&(a.style.display="inline-block")}};var q=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){q.apply(this,arguments);if(null!=this.shareButton){var a=this.shareButton;a.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage=
"url("+Editor.shareImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height="24px";a.style.width="24px"}};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.buttonContainer){var a=document.createElement("div");a.style.display="inline-block";a.style.position="relative";a.style.marginTop="8px";a.style.marginRight="4px";var b=document.createElement("a");b.className="geMenuItem gePrimaryBtn";b.style.marginLeft=
"8px";b.style.padding="6px";"1"==urlParams.noSaveBtn?(mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)):(mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),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.className="geMenuItem",b.style.marginLeft="6px",b.style.padding="6px",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.className="geMenuItem";b.style.marginLeft=
-"6px";b.style.padding="6px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);a.y+=40;return a};var g=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,c){var d=this.editorUi.editor.graph;a.smartSeparators=!0;g.apply(this,arguments);
+"6px";b.style.padding="6px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);a.y+=40;return a};var f=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,c){var d=this.editorUi.editor.graph;a.smartSeparators=!0;f.apply(this,arguments);
mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResources.get("apply"),function(a){b(parseFloat(a))},mxResources.get("spacing"));this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()});1==d.getSelectionCount()?(this.addMenuItems(a,["editTooltip","-","editStyle","editGeometry","-"],null,c),d.isCellFoldable(d.getSelectionCell())&&this.addMenuItems(a,d.isCellCollapsed(b)?["expand"]:["collapse"],null,c),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],
null,c),a.addSeparator(),this.addSubmenu("layout",a)):d.isSelectionEmpty()&&d.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,c),a.addSeparator(),this.addSubmenu("layout",a),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-","exitGroup"],null,c)):d.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):
-a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var k=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),
-this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);k.apply(this,arguments)};var q=
-EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){q.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var v=Menus.prototype.init;Menus.prototype.init=function(){v.apply(this,arguments);var b=this.editorUi,d=b.editor.graph;b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";b.actions.get("createShape").label=
+a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var l=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),
+this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);l.apply(this,arguments)};var p=
+EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){p.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var u=Menus.prototype.init;Menus.prototype.init=function(){u.apply(this,arguments);var b=this.editorUi,d=b.editor.graph;b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";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("importCsv",new Action(mxResources.get("csv")+"...",function(){d.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(){c(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",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){var d=b.getCurrentFile();b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(b.menus.addMenuItems(a,["new","open","-"],c),EditorUi.isElectronApp&&b.menus.addMenuItems(a,["synchronize","-"],c),b.menus.addMenuItems(a,["save","saveAs","-"],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),isLocalStorage&&this.addSubmenu("openRecent",a,c),a.addSeparator(c),null!=d&&d.constructor==DriveFile&&b.menus.addMenuItems(a,["share"],c),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||b.menus.addMenuItems(a,["synchronize"],c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);b.menus.addMenuItems(a,["-","outline","layers"],
c);b.commentsSupported()&&b.menus.addMenuItems(a,["comments"],c);b.menus.addMenuItems(a,["-","find","tags"],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"])})));this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["save","makeCopy","-","rename","moveToFolder"],
-c):(b.menus.addMenuItems(a,["save","saveAs","-","rename"],c),b.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],c):b.menus.addMenuItems(a,["makeCopy"],c));b.menus.addMenuItems(a,["-","autosave"],c);null!=d&&d.isRevisionHistorySupported()&&b.menus.addMenuItems(a,["-","revisionHistory"],c)})));var f=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){f.funct(a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,
-["publishLink"],c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c)})));var g=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=g&&b.menus.addSubmenu("language",a,c);b.menus.addSubmenu("units",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","ruler"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],
+c):(b.menus.addMenuItems(a,["save","saveAs","-","rename"],c),b.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],c):b.menus.addMenuItems(a,["makeCopy"],c));b.menus.addMenuItems(a,["-","autosave"],c);null!=d&&d.isRevisionHistorySupported()&&b.menus.addMenuItems(a,["-","revisionHistory"],c)})));var e=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){e.funct(a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,
+["publishLink"],c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c)})));var f=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=f&&b.menus.addSubmenu("language",a,c);b.menus.addSubmenu("units",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","ruler"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],
c);!b.isOfflineApp()&&isLocalStorage&&(a.addSeparator(c),b.menus.addMenuItem(a,"plugins",c));a.addSeparator(c)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),c)})));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.insertTemplateEnabled&&!b.isOffline()&&
-b.menus.addMenuItems(a,["insertTemplate"],c);a.addSeparator(c);this.addMenuItems(a,["createShape","insertFreehand","-"],c);this.addSubmenu("insertLayout",a,c,mxResources.get("layout"));this.addSubmenu("insertAdvanced",a,c,mxResources.get("advanced"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,["import"],c):b.menus.addSubmenu("importFrom",a,c)})));var l="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),k=function(a,
-c,d,f){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,f);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):k(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 -".split(" "),c);if("undefined"!==typeof MathJax){var d=b.menus.addMenuItem(a,
-"mathematicalTypesetting",c);b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}b.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],c)})))};var y=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=k.menus.get(a),f=q.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),p);f.className="geMenuItem";f.style.display="inline-block";f.style.boxSizing="border-box";f.style.top="6px";f.style.marginRight=
-"6px";f.style.height="30px";f.style.paddingTop="6px";f.style.paddingBottom="6px";f.style.cursor="pointer";f.setAttribute("title",mxResources.get(a));k.menus.menuCreated(d,f,"geMenuItem");null!=c?(f.style.backgroundImage="url("+c+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.width="34px",f.innerHTML=""):b||(f.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",f.style.backgroundPosition="right 6px center",
-f.style.backgroundRepeat="no-repeat",f.style.paddingRight="22px");return f}function d(a,b,c,d,f,g){var l=document.createElement("a");l.className="geMenuItem";l.style.display="inline-block";l.style.boxSizing="border-box";l.style.height="30px";l.style.padding="6px";l.style.position="relative";l.style.verticalAlign="top";l.style.top="0px";null!=k.statusContainer?n.insertBefore(l,k.statusContainer):n.appendChild(l);null!=g?(l.style.backgroundImage="url("+g+")",l.style.backgroundPosition="center center",
-l.style.backgroundRepeat="no-repeat",l.style.backgroundSize="24px 24px",l.style.width="34px"):mxUtils.write(l,a);mxEvent.addListener(l,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(l,"click",function(a){"disabled"!=l.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(l.style.marginRight="4px");null!=d&&l.setAttribute("title",d);null!=f&&(a=function(){f.isEnabled()?(l.removeAttribute("disabled"),l.style.cursor="pointer"):
-(l.setAttribute("disabled","disabled"),l.style.cursor="default")},f.addListener("stateChanged",a),a());return l}function f(a,b){var c=document.createElement("div");c.className="geMenuItem";c.style.display="inline-block";c.style.verticalAlign="top";c.style.marginRight="6px";c.style.padding="0 4px 0 4px";c.style.height="30px";c.style.position="relative";c.style.top="0px";for(var d=0;d<a.length;d++)null!=a[d]&&(a[d].style.margin="0px",a[d].style.boxShadow="none",c.appendChild(a[d]));null!=b&&mxUtils.setOpacity(c,
-b);null!=k.statusContainer?n.insertBefore(c,k.statusContainer):n.appendChild(c);return c}function g(){for(var c=n.firstChild;null!=c;){var g=c.nextSibling;"geMenuItem"!=c.className&&"geItem"!=c.className||c.parentNode.removeChild(c);c=g}p=n.firstChild;b=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(c=1E3>b)||a("diagram");f([c?a("diagram",null,IMAGE_PATH+"/drawlogo.svg"):null,d(mxResources.get("shapes"),k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),
+b.menus.addMenuItems(a,["insertTemplate"],c);a.addSeparator(c);this.addMenuItems(a,["createShape","insertFreehand","-"],c);this.addSubmenu("insertLayout",a,c,mxResources.get("layout"));this.addSubmenu("insertAdvanced",a,c,mxResources.get("advanced"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,["import"],c):b.menus.addSubmenu("importFrom",a,c)})));var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),k=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<g.length;c++)"-"==g[c]?a.addSeparator(b):k(a,b,mxResources.get(g[c])+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),c);if("undefined"!==typeof MathJax){var d=b.menus.addMenuItem(a,
+"mathematicalTypesetting",c);b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}b.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],c)})))};var v=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=k.menus.get(a),e=p.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),n);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight=
+"6px";e.style.height="30px";e.style.paddingTop="6px";e.style.paddingBottom="6px";e.style.cursor="pointer";e.setAttribute("title",mxResources.get(a));k.menus.menuCreated(d,e,"geMenuItem");null!=c?(e.style.backgroundImage="url("+c+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.width="34px",e.innerHTML=""):b||(e.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",e.style.backgroundPosition="right 6px center",
+e.style.backgroundRepeat="no-repeat",e.style.paddingRight="22px");return e}function d(a,b,c,d,e,f){var g=document.createElement("a");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";null!=k.statusContainer?m.insertBefore(g,k.statusContainer):m.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,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));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);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),g.style.cursor="pointer"):
+(g.setAttribute("disabled","disabled"),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function e(a,b){var c=document.createElement("div");c.className="geMenuItem";c.style.display="inline-block";c.style.verticalAlign="top";c.style.marginRight="6px";c.style.padding="0 4px 0 4px";c.style.height="30px";c.style.position="relative";c.style.top="0px";for(var d=0;d<a.length;d++)null!=a[d]&&(a[d].style.margin="0px",a[d].style.boxShadow="none",c.appendChild(a[d]));null!=b&&mxUtils.setOpacity(c,
+b);null!=k.statusContainer?m.insertBefore(c,k.statusContainer):m.appendChild(c);return c}function f(){for(var c=m.firstChild;null!=c;){var f=c.nextSibling;"geMenuItem"!=c.className&&"geItem"!=c.className||c.parentNode.removeChild(c);c=f}n=m.firstChild;b=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(c=1E3>b)||a("diagram");e([c?a("diagram",null,IMAGE_PATH+"/drawlogo.svg"):null,d(mxResources.get("shapes"),k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),
k.actions.get("image"),c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),d(mxResources.get("format"),k.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+k.actions.get("formatPanel").shortcut+")",k.actions.get("image"),c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
-null)],c?60:null);g=a("insert",!0,c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null);f([g,d(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==":
-null)],c?60:null);if(411<=b&&(g=k.actions.get("undo"),c=k.actions.get("redo"),g=d("",g.funct,null,mxResources.get("undo")+" ("+g.shortcut+")",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),c=d("",
-c.funct,null,mxResources.get("redo")+" ("+c.shortcut+")",c,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg=="),f([g,c],60),480<=b)){var c=k.actions.get("zoomIn"),g=k.actions.get("zoomOut"),l=k.actions.get("resetView");
-f([d("",function(){m.popupMenuHandler.hideMenu();var a=m.view.scale,b=m.view.translate.x,c=m.view.translate.y;k.actions.get("resetView").funct();1E-5>Math.abs(a-m.view.scale)&&b==m.view.translate.x&&c==m.view.translate.y&&k.actions.get(m.pageVisible?"fitPage":"fitWindow").funct()},!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",l,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg=="),
+null)],c?60:null);f=a("insert",!0,c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null);e([f,d(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),c?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==":
+null)],c?60:null);if(411<=b&&(f=k.actions.get("undo"),c=k.actions.get("redo"),f=d("",f.funct,null,mxResources.get("undo")+" ("+f.shortcut+")",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),c=d("",
+c.funct,null,mxResources.get("redo")+" ("+c.shortcut+")",c,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg=="),e([f,c],60),480<=b)){var c=k.actions.get("zoomIn"),f=k.actions.get("zoomOut"),g=k.actions.get("resetView");
+e([d("",function(){l.popupMenuHandler.hideMenu();var a=l.view.scale,b=l.view.translate.x,c=l.view.translate.y;k.actions.get("resetView").funct();1E-5>Math.abs(a-l.view.scale)&&b==l.view.translate.x&&c==l.view.translate.y&&k.actions.get(l.pageVisible?"fitPage":"fitWindow").funct()},!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg=="),
640<=b?d("",c.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",c,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="):
-null,640<=b?d("",g.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="):
-null],60)}c=k.menus.get("language");null!=c&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=b?(null==N&&(g=q.addMenu("",c.funct),g.setAttribute("title",mxResources.get("language")),g.className="geToolbarButton",g.style.backgroundImage="url("+Editor.globeImage+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.position="absolute",g.style.height="24px",g.style.width="24px",g.style.zIndex="1",g.style.right="8px",g.style.cursor=
-"pointer",g.style.top="1"==urlParams.embed?"12px":"11px",n.appendChild(g),N=g),k.buttonContainer.style.paddingRight="34px"):(k.buttonContainer.style.paddingRight="4px",null!=N&&(N.parentNode.removeChild(N),N=null))}y.apply(this,arguments);var l=document.createElement("div");l.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";l.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(l);null==urlParams.clibs&&
-null==urlParams.libs||c(this);var k=this,m=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));k.defaultLibraryName=mxResources.get("untitledLibrary");var n=document.createElement("div");n.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 p=null,q=new Menubar(k,n);k.statusContainer=k.createStatusContainer();k.statusContainer.style.position="relative";
-k.statusContainer.style.maxWidth="";k.statusContainer.style.marginTop="7px";k.statusContainer.style.marginLeft="6px";k.statusContainer.style.color="gray";k.statusContainer.style.cursor="default";k.editor.addListener("statusChanged",mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));var u=k.descriptorChanged;k.descriptorChanged=function(){u.apply(this,arguments);var a=k.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":
-"gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);n.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else n.removeAttribute("title")};k.setStatusText(k.editor.getStatus());n.appendChild(k.statusContainer);k.buttonContainer=document.createElement("div");k.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";n.appendChild(k.buttonContainer);k.menubarContainer=k.buttonContainer;
-k.tabContainer=document.createElement("div");k.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;visibility:hidden;";var l=k.diagramContainer.parentNode,v=document.createElement("div");v.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";k.diagramContainer.style.top="47px";var J=k.menus.get("viewZoom");
-if(null!=J){this.tabContainer.style.right="70px";var H=q.addMenu("100%",J.funct);H.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");H.style.whiteSpace="nowrap";H.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";H.style.backgroundPosition="right 6px center";H.style.backgroundRepeat="no-repeat";H.style.backgroundColor="#ffffff";H.style.paddingRight="10px";H.style.display="block";H.style.position="absolute";H.style.textDecoration="none";H.style.textDecoration="none";
-H.style.right="0px";H.style.bottom="0px";H.style.overflow="hidden";H.style.visibility="hidden";H.style.textAlign="center";H.style.color="#000";H.style.fontSize="12px";H.style.color="#707070";H.style.width="59px";H.style.cursor="pointer";H.style.borderTop="1px solid lightgray";H.style.borderLeft="1px solid lightgray";H.style.height=parseInt(k.tabContainerHeight)-1+"px";H.style.lineHeight=parseInt(k.tabContainerHeight)+1+"px";v.appendChild(H);J=mxUtils.bind(this,function(){H.innerHTML=Math.round(100*
-k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,J);k.editor.addListener("resetGraphView",J);k.editor.addListener("pageSelected",J);var L=k.setGraphEnabled;k.setGraphEnabled=function(){L.apply(this,arguments);null!=this.tabContainer&&(H.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}v.appendChild(k.tabContainer);v.appendChild(n);v.appendChild(k.diagramContainer);
-l.appendChild(v);k.updateTabContainer();var N=null;g();mxEvent.addListener(window,"resize",function(){g();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit()})}}};
-(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,f,l){var d=c.y,m=c.x,u=!1,g=!1;if(null!=this.states&&null!=b&&null!=c){var k=this,q=new mxCellState,v=this.graph.getView().scale,y=Math.max(2,this.getGuideTolerance()/2);q.x=b.x+m;q.y=b.y+d;q.width=b.width;q.height=b.height;for(var t=[],A=[],z=0;z<this.states.length;z++){var D=this.states[z];D instanceof mxCellState&&(l||!this.graph.isCellSelected(D.cell))&&((q.x>=D.x&&q.x<=D.x+D.width||D.x>=q.x&&D.x<=q.x+q.width)&&(q.y>
-D.y+D.height+4||q.y+q.height+4<D.y)?t.push(D):(q.y>=D.y&&q.y<=D.y+D.height||D.y>=q.y&&D.y<=q.y+q.height)&&(q.x>D.x+D.width+4||q.x+q.width+4<D.x)&&A.push(D))}var x=0,C=0,G=D=0,B=0,F=0,E=0,I=0,K=5*v;if(1<t.length){t.push(q);t.sort(function(a,b){return a.y-b.y});var J=!1,z=q==t[0],v=q==t[t.length-1];if(!z&&!v)for(z=1;z<t.length-1;z++)if(q==t[z]){v=t[z-1];z=t[z+1];D=C=G=(z.y-v.y-v.height-q.height)/2;break}for(z=0;z<t.length-1;z++){var v=t[z],H=t[z+1],L=q==v||q==H,H=H.y-v.y-v.height,J=J|q==v;if(0==C&&
-0==x)C=H,x=1;else if(Math.abs(C-H)<=(L||1==z&&J?y:0))x+=1;else if(1<x&&J){t=t.slice(0,z+1);break}else if(3<=t.length-z&&!J)x=0,D=C=0!=G?G:0,t.splice(0,0==z?1:z),z=-1;else break;0!=D||L||(C=D=H)}3==t.length&&t[1]==q&&(D=0)}if(1<A.length){A.push(q);A.sort(function(a,b){return a.x-b.x});J=!1;z=q==A[0];v=q==A[A.length-1];if(!z&&!v)for(z=1;z<A.length-1;z++)if(q==A[z]){v=A[z-1];z=A[z+1];E=F=I=(z.x-v.x-v.width-q.width)/2;break}for(z=0;z<A.length-1;z++){v=A[z];H=A[z+1];L=q==v||q==H;H=H.x-v.x-v.width;J|=q==
-v;if(0==F&&0==B)F=H,B=1;else if(Math.abs(F-H)<=(L||1==z&&J?y:0))B+=1;else if(1<B&&J){A=A.slice(0,z+1);break}else if(3<=A.length-z&&!J)B=0,E=F=0!=I?I:0,A.splice(0,0==z?1:z),z=-1;else break;0!=E||L||(F=E=H)}3==A.length&&A[1]==q&&(E=0)}y=function(a,b,c,d){var f=[],g;d?(d=K,g=0):(d=0,g=K);f.push(new mxPoint(a.x-d,a.y-g));f.push(new mxPoint(a.x+d,a.y+g));f.push(a);f.push(b);f.push(new mxPoint(b.x-d,b.y-g));f.push(new mxPoint(b.x+d,b.y+g));if(null!=c)return c.points=f,c;a=new mxPolyline(f,mxConstants.GUIDE_COLOR,
-mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(k.graph.getView().getOverlayPane());return a};F=function(a,b){if(a&&null!=k.guidesArrHor)for(var c=0;c<k.guidesArrHor.length;c++)k.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=k.guidesArrVer)for(c=0;c<k.guidesArrVer.length;c++)k.guidesArrVer[c].node.style.visibility="hidden"};if(1<B&&B==A.length-1){B=[];I=k.guidesArrHor;u=[];m=0;z=A[0]==q?1:0;J=A[z].y+A[z].height;if(0<E)for(z=0;z<A.length-1;z++)v=
-A[z],H=A[z+1],q==v?(m=H.x-v.width-E,u.push(new mxPoint(m+v.width+K,J)),u.push(new mxPoint(H.x-K,J))):q==H?(u.push(new mxPoint(v.x+v.width+K,J)),m=v.x+v.width+E,u.push(new mxPoint(m-K,J))):(u.push(new mxPoint(v.x+v.width+K,J)),u.push(new mxPoint(H.x-K,J)));else v=A[0],z=A[2],m=v.x+v.width+(z.x-v.x-v.width-q.width)/2,u.push(new mxPoint(v.x+v.width+K,J)),u.push(new mxPoint(m-K,J)),u.push(new mxPoint(m+q.width+K,J)),u.push(new mxPoint(z.x-K,J));for(z=0;z<u.length;z+=2)A=u[z],E=u[z+1],A=y(A,E,null!=I?
-I[z/2]:null),A.node.style.visibility="visible",A.redraw(),B.push(A);for(z=u.length/2;null!=I&&z<I.length;z++)I[z].destroy();k.guidesArrHor=B;m-=b.x;u=!0}else F(!0);if(1<x&&x==t.length-1){B=[];I=k.guidesArrVer;g=[];d=0;z=t[0]==q?1:0;x=t[z].x+t[z].width;if(0<D)for(z=0;z<t.length-1;z++)v=t[z],H=t[z+1],q==v?(d=H.y-v.height-D,g.push(new mxPoint(x,d+v.height+K)),g.push(new mxPoint(x,H.y-K))):q==H?(g.push(new mxPoint(x,v.y+v.height+K)),d=v.y+v.height+D,g.push(new mxPoint(x,d-K))):(g.push(new mxPoint(x,v.y+
-v.height+K)),g.push(new mxPoint(x,H.y-K)));else v=t[0],z=t[2],d=v.y+v.height+(z.y-v.y-v.height-q.height)/2,g.push(new mxPoint(x,v.y+v.height+K)),g.push(new mxPoint(x,d-K)),g.push(new mxPoint(x,d+q.height+K)),g.push(new mxPoint(x,z.y-K));for(z=0;z<g.length;z+=2)A=g[z],E=g[z+1],A=y(A,E,null!=I?I[z/2]:null,!0),A.node.style.visibility="visible",A.redraw(),B.push(A);for(z=g.length/2;null!=I&&z<I.length;z++)I[z].destroy();k.guidesArrVer=B;d-=b.y;g=!0}else F(!1,!0)}if(u||g)return q=new mxPoint(m,d),t=a.call(this,
-b,q,f,l),u&&!g?q.y=t.y:g&&!u&&(q.x=t.x),t.y!=q.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),t.x!=q.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),q;F(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var l=0;l<b.length;l++)b[l].node.style.visibility=a?"visible":"hidden";if(null!=
-d)for(l=0;l<d.length;l++)d[l].node.style.visibility=a?"visible":"hidden"};var b=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){b.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var f=0;f<a.length;f++)a[f].destroy();this.guidesArrVer=null}if(null!=c){for(f=0;f<c.length;f++)c[f].destroy();this.guidesArrHor=null}}})();function mxRuler(a,c,b,d){function m(){var c=a.diagramContainer;u.style.top=c.offsetTop-l+"px";u.style.left=c.offsetLeft-l+"px";u.style.width=(b?0:c.offsetWidth)+l+"px";u.style.height=(b?c.offsetHeight:0)+l+"px"}function f(a,b,c){var d;return function(){var f=this,g=arguments,l=c&&!d;clearTimeout(d);d=setTimeout(function(){d=null;c||a.apply(f,g)},b);l&&a.apply(f,g)}}var l=this.RULER_THICKNESS,n=this;this.unit=c;var p="dark"!=window.uiTheme?{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb",
-strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"}:{bkgClr:"#202020",outBkgClr:"#2a2a2a",cornerClr:"#2a2a2a",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"},u=document.createElement("div");u.style.position="absolute";u.style.background=p.bkgClr;u.style[b?"borderRight":"borderBottom"]="0.5px solid "+p.strokeClr;u.style.borderLeft="0.5px solid "+p.strokeClr;document.body.appendChild(u);mxEvent.disableContextMenu(u);this.editorUiRefresh=a.refresh;a.refresh=function(b){n.editorUiRefresh.apply(a,
-arguments);m()};m();var g=document.createElement("canvas");g.width=u.offsetWidth;g.height=u.offsetHeight;u.style.overflow="hidden";g.style.position="relative";u.appendChild(g);var k=g.getContext("2d");this.ui=a;var q=a.editor.graph;this.graph=q;this.container=u;this.canvas=g;var v=function(a,c,d,f,g){a=Math.round(a);c=Math.round(c);d=Math.round(d);f=Math.round(f);k.beginPath();k.moveTo(a+.5,c+.5);k.lineTo(d+.5,f+.5);k.stroke();g&&(b?(k.save(),k.translate(a,c),k.rotate(-Math.PI/2),k.fillText(g,0,0),
-k.restore()):k.fillText(g,a,c))},y=function(){k.clearRect(0,0,g.width,g.height);k.beginPath();k.lineWidth=.7;k.strokeStyle=p.strokeClr;k.setLineDash([]);k.font="9px Arial";k.textAlign="center";var a=q.view.scale,c=q.view.getBackgroundPageBounds(),d=q.view.translate,f=q.view.getGraphBounds(),m=q.pageVisible,u=m?l+(b?c.y-q.container.scrollTop:c.x-q.container.scrollLeft):l+(b?d.y-q.container.scrollTop:d.x-q.container.scrollLeft),y=0;m&&(y=b?Math.floor(((f.y+1)/a-d.y)/q.pageFormat.height)*q.pageFormat.height*
-a:Math.floor(((f.x+1)/a-d.x)/q.pageFormat.width)*q.pageFormat.width*a);var B,F,E;switch(n.unit){case mxConstants.POINTS:B=E=10;F=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:E=10;B=mxConstants.PIXELS_PER_MM;F=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:E=.5>=a||4<=a?8:16,B=mxConstants.PIXELS_PER_INCH/E,F=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}d=B;2<=a?d=B/(2*Math.floor(a/2)):.5>=a&&(d=B*Math.floor(1/a/2)*(n.unit==mxConstants.MILLIMETERS?2:1));B=null;c=m?Math.min(u+(b?c.height:c.width),
-b?g.height:g.width):b?g.height:g.width;m&&(k.fillStyle=p.outBkgClr,b?(k.fillRect(0,l,l,u-l),k.fillRect(0,c,l,g.height)):(k.fillRect(l,0,u-l,l),k.fillRect(c,0,g.width,l)));k.fillStyle=p.fontClr;for(m=m?u:u%(d*a);m<=c;m+=d*a)if(f=Math.round((m-u)/a/d),!(m<l||f==B)){B=f;var I=null;0==f%E&&(I=n.formatText(y+f*d)+"");b?v(l-F[Math.abs(f)%E],m,l,m,I):v(m,l-F[Math.abs(f)%E],m,l,I)}k.lineWidth=1;v(b?0:l,b?l:0,l,l);k.fillStyle=p.cornerClr;k.fillRect(0,0,l,l)};this.drawRuler=y;this.sizeListener=c=f(function(){var a=
-q.container;b?(a=a.offsetHeight+l,g.height!=a&&(g.height=a,u.style.height=a+"px",y())):(a=a.offsetWidth+l,g.width!=a&&(g.width=a,u.style.width=a+"px",y()))},10);this.pageListener=function(){y()};this.scrollListener=d=f(function(){var a=b?q.container.scrollTop:q.container.scrollLeft;n.lastScroll!=a&&(n.lastScroll=a,y())},10);this.unitListener=function(a,b){n.setUnit(b.getProperty("unit"))};q.addListener(mxEvent.SIZE,c);q.container.addEventListener("scroll",d);q.view.addListener("unitChanged",this.unitListener);
-a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){p=a;u.style.background=p.bkgClr;y()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(a,c,d,f){var g;if(b&&4<a.height||!b&&4<a.width){if(null!=n.guidePart)try{k.putImageData(n.guidePart.imgData1,n.guidePart.x1,n.guidePart.y1),k.putImageData(n.guidePart.imgData2,n.guidePart.x2,n.guidePart.y2),k.putImageData(n.guidePart.imgData3,
-n.guidePart.x3,n.guidePart.y3)}catch(L){}g=n.origGuideMove.apply(this,arguments);try{var m,q,t,u,y,A,z,D,H;k.lineWidth=.5;k.strokeStyle=p.guideClr;k.setLineDash([2]);b?(q=a.y+g.y+l-this.graph.container.scrollTop,m=0,y=q+a.height/2,u=l/2,D=q+a.height,z=0,t=k.getImageData(m,q-1,l,3),v(m,q,l,q),q--,A=k.getImageData(u,y-1,l,3),v(u,y,l,y),y--,H=k.getImageData(z,D-1,l,3),v(z,D,l,D),D--):(q=0,m=a.x+g.x+l-this.graph.container.scrollLeft,y=l/2,u=m+a.width/2,D=0,z=m+a.width,t=k.getImageData(m-1,q,3,l),v(m,
-q,m,l),m--,A=k.getImageData(u-1,y,3,l),v(u,y,u,l),u--,H=k.getImageData(z-1,D,3,l),v(z,D,z,l),z--);if(null==n.guidePart||n.guidePart.x1!=m||n.guidePart.y1!=q)n.guidePart={imgData1:t,x1:m,y1:q,imgData2:A,x2:u,y2:y,imgData3:H,x3:z,y3:D}}catch(L){}}else g=n.origGuideMove.apply(this,arguments);return g};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=n.origGuideDestroy.apply(this,arguments);if(null!=n.guidePart)try{k.putImageData(n.guidePart.imgData1,n.guidePart.x1,
-n.guidePart.y1),k.putImageData(n.guidePart.imgData2,n.guidePart.x2,n.guidePart.y2),k.putImageData(n.guidePart.imgData3,n.guidePart.x3,n.guidePart.y3),n.guidePart=null}catch(A){}return a}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(a){this.unit=a;this.drawRuler()};
+null,640<=b?d("",f.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="):
+null],60)}c=k.menus.get("language");null!=c&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=b?(null==Q&&(f=p.addMenu("",c.funct),f.setAttribute("title",mxResources.get("language")),f.className="geToolbarButton",f.style.backgroundImage="url("+Editor.globeImage+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.position="absolute",f.style.height="24px",f.style.width="24px",f.style.zIndex="1",f.style.right="8px",f.style.cursor=
+"pointer",f.style.top="1"==urlParams.embed?"12px":"11px",m.appendChild(f),Q=f),k.buttonContainer.style.paddingRight="34px"):(k.buttonContainer.style.paddingRight="4px",null!=Q&&(Q.parentNode.removeChild(Q),Q=null))}v.apply(this,arguments);var g=document.createElement("div");g.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";g.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(g);null==urlParams.clibs&&
+null==urlParams.libs||c(this);var k=this,l=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));k.defaultLibraryName=mxResources.get("untitledLibrary");var m=document.createElement("div");m.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 n=null,p=new Menubar(k,m);k.statusContainer=k.createStatusContainer();k.statusContainer.style.position="relative";
+k.statusContainer.style.maxWidth="";k.statusContainer.style.marginTop="7px";k.statusContainer.style.marginLeft="6px";k.statusContainer.style.color="gray";k.statusContainer.style.cursor="default";k.editor.addListener("statusChanged",mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));var q=k.descriptorChanged;k.descriptorChanged=function(){q.apply(this,arguments);var a=k.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":
+"gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);m.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else m.removeAttribute("title")};k.setStatusText(k.editor.getStatus());m.appendChild(k.statusContainer);k.buttonContainer=document.createElement("div");k.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";m.appendChild(k.buttonContainer);k.menubarContainer=k.buttonContainer;
+k.tabContainer=document.createElement("div");k.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;visibility:hidden;";var g=k.diagramContainer.parentNode,u=document.createElement("div");u.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";k.diagramContainer.style.top="47px";var I=k.menus.get("viewZoom");
+if(null!=I){this.tabContainer.style.right="70px";var G=p.addMenu("100%",I.funct);G.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");G.style.whiteSpace="nowrap";G.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";G.style.backgroundPosition="right 6px center";G.style.backgroundRepeat="no-repeat";G.style.backgroundColor="#ffffff";G.style.paddingRight="10px";G.style.display="block";G.style.position="absolute";G.style.textDecoration="none";G.style.textDecoration="none";
+G.style.right="0px";G.style.bottom="0px";G.style.overflow="hidden";G.style.visibility="hidden";G.style.textAlign="center";G.style.color="#000";G.style.fontSize="12px";G.style.color="#707070";G.style.width="59px";G.style.cursor="pointer";G.style.borderTop="1px solid lightgray";G.style.borderLeft="1px solid lightgray";G.style.height=parseInt(k.tabContainerHeight)-1+"px";G.style.lineHeight=parseInt(k.tabContainerHeight)+1+"px";u.appendChild(G);I=mxUtils.bind(this,function(){G.innerHTML=Math.round(100*
+k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,I);k.editor.addListener("resetGraphView",I);k.editor.addListener("pageSelected",I);var K=k.setGraphEnabled;k.setGraphEnabled=function(){K.apply(this,arguments);null!=this.tabContainer&&(G.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}u.appendChild(k.tabContainer);u.appendChild(m);u.appendChild(k.diagramContainer);
+g.appendChild(u);k.updateTabContainer();var Q=null;f();mxEvent.addListener(window,"resize",function(){f();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit()})}}};
+(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,e,k){var d=c.y,g=c.x,q=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var l=this,p=new mxCellState,u=this.graph.getView().scale,v=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+g;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var t=[],z=[],y=0;y<this.states.length;y++){var C=this.states[y];C instanceof mxCellState&&(k||!this.graph.isCellSelected(C.cell))&&((p.x>=C.x&&p.x<=C.x+C.width||C.x>=p.x&&C.x<=p.x+p.width)&&(p.y>
+C.y+C.height+4||p.y+p.height+4<C.y)?t.push(C):(p.y>=C.y&&p.y<=C.y+C.height||C.y>=p.y&&C.y<=p.y+p.height)&&(p.x>C.x+C.width+4||p.x+p.width+4<C.x)&&z.push(C))}var x=0,B=0,E=C=0,A=0,F=0,D=0,H=0,J=5*u;if(1<t.length){t.push(p);t.sort(function(a,b){return a.y-b.y});var I=!1,y=p==t[0],u=p==t[t.length-1];if(!y&&!u)for(y=1;y<t.length-1;y++)if(p==t[y]){u=t[y-1];y=t[y+1];C=B=E=(y.y-u.y-u.height-p.height)/2;break}for(y=0;y<t.length-1;y++){var u=t[y],G=t[y+1],K=p==u||p==G,G=G.y-u.y-u.height,I=I|p==u;if(0==B&&
+0==x)B=G,x=1;else if(Math.abs(B-G)<=(K||1==y&&I?v:0))x+=1;else if(1<x&&I){t=t.slice(0,y+1);break}else if(3<=t.length-y&&!I)x=0,C=B=0!=E?E:0,t.splice(0,0==y?1:y),y=-1;else break;0!=C||K||(B=C=G)}3==t.length&&t[1]==p&&(C=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});I=!1;y=p==z[0];u=p==z[z.length-1];if(!y&&!u)for(y=1;y<z.length-1;y++)if(p==z[y]){u=z[y-1];y=z[y+1];D=F=H=(y.x-u.x-u.width-p.width)/2;break}for(y=0;y<z.length-1;y++){u=z[y];G=z[y+1];K=p==u||p==G;G=G.x-u.x-u.width;I|=p==
+u;if(0==F&&0==A)F=G,A=1;else if(Math.abs(F-G)<=(K||1==y&&I?v:0))A+=1;else if(1<A&&I){z=z.slice(0,y+1);break}else if(3<=z.length-y&&!I)A=0,D=F=0!=H?H:0,z.splice(0,0==y?1:y),y=-1;else break;0!=D||K||(F=D=G)}3==z.length&&z[1]==p&&(D=0)}v=function(a,b,c,d){var e=[],f;d?(d=J,f=0):(d=0,f=J);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
+mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(l.graph.getView().getOverlayPane());return a};F=function(a,b){if(a&&null!=l.guidesArrHor)for(var c=0;c<l.guidesArrHor.length;c++)l.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=l.guidesArrVer)for(c=0;c<l.guidesArrVer.length;c++)l.guidesArrVer[c].node.style.visibility="hidden"};if(1<A&&A==z.length-1){A=[];H=l.guidesArrHor;q=[];g=0;y=z[0]==p?1:0;I=z[y].y+z[y].height;if(0<D)for(y=0;y<z.length-1;y++)u=
+z[y],G=z[y+1],p==u?(g=G.x-u.width-D,q.push(new mxPoint(g+u.width+J,I)),q.push(new mxPoint(G.x-J,I))):p==G?(q.push(new mxPoint(u.x+u.width+J,I)),g=u.x+u.width+D,q.push(new mxPoint(g-J,I))):(q.push(new mxPoint(u.x+u.width+J,I)),q.push(new mxPoint(G.x-J,I)));else u=z[0],y=z[2],g=u.x+u.width+(y.x-u.x-u.width-p.width)/2,q.push(new mxPoint(u.x+u.width+J,I)),q.push(new mxPoint(g-J,I)),q.push(new mxPoint(g+p.width+J,I)),q.push(new mxPoint(y.x-J,I));for(y=0;y<q.length;y+=2)z=q[y],D=q[y+1],z=v(z,D,null!=H?
+H[y/2]:null),z.node.style.visibility="visible",z.redraw(),A.push(z);for(y=q.length/2;null!=H&&y<H.length;y++)H[y].destroy();l.guidesArrHor=A;g-=b.x;q=!0}else F(!0);if(1<x&&x==t.length-1){A=[];H=l.guidesArrVer;f=[];d=0;y=t[0]==p?1:0;x=t[y].x+t[y].width;if(0<C)for(y=0;y<t.length-1;y++)u=t[y],G=t[y+1],p==u?(d=G.y-u.height-C,f.push(new mxPoint(x,d+u.height+J)),f.push(new mxPoint(x,G.y-J))):p==G?(f.push(new mxPoint(x,u.y+u.height+J)),d=u.y+u.height+C,f.push(new mxPoint(x,d-J))):(f.push(new mxPoint(x,u.y+
+u.height+J)),f.push(new mxPoint(x,G.y-J)));else u=t[0],y=t[2],d=u.y+u.height+(y.y-u.y-u.height-p.height)/2,f.push(new mxPoint(x,u.y+u.height+J)),f.push(new mxPoint(x,d-J)),f.push(new mxPoint(x,d+p.height+J)),f.push(new mxPoint(x,y.y-J));for(y=0;y<f.length;y+=2)z=f[y],D=f[y+1],z=v(z,D,null!=H?H[y/2]:null,!0),z.node.style.visibility="visible",z.redraw(),A.push(z);for(y=f.length/2;null!=H&&y<H.length;y++)H[y].destroy();l.guidesArrVer=A;d-=b.y;f=!0}else F(!1,!0)}if(q||f)return p=new mxPoint(g,d),t=a.call(this,
+b,p,e,k),q&&!f?p.y=t.y:f&&!q&&(p.x=t.x),t.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),t.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;F(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var k=0;k<b.length;k++)b[k].node.style.visibility=a?"visible":"hidden";if(null!=
+d)for(k=0;k<d.length;k++)d[k].node.style.visibility=a?"visible":"hidden"};var b=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){b.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var e=0;e<a.length;e++)a[e].destroy();this.guidesArrVer=null}if(null!=c){for(e=0;e<c.length;e++)c[e].destroy();this.guidesArrHor=null}}})();function mxRuler(a,c,b,d){function g(){var c=a.diagramContainer;q.style.top=c.offsetTop-k+"px";q.style.left=c.offsetLeft-k+"px";q.style.width=(b?0:c.offsetWidth)+k+"px";q.style.height=(b?c.offsetHeight:0)+k+"px"}function e(a,b,c){var d;return function(){var e=this,f=arguments,g=c&&!d;clearTimeout(d);d=setTimeout(function(){d=null;c||a.apply(e,f)},b);g&&a.apply(e,f)}}var k=this.RULER_THICKNESS,m=this;this.unit=c;var n="dark"!=window.uiTheme?{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb",
+strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"}:{bkgClr:"#202020",outBkgClr:"#2a2a2a",cornerClr:"#2a2a2a",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"},q=document.createElement("div");q.style.position="absolute";q.style.background=n.bkgClr;q.style[b?"borderRight":"borderBottom"]="0.5px solid "+n.strokeClr;q.style.borderLeft="0.5px solid "+n.strokeClr;document.body.appendChild(q);mxEvent.disableContextMenu(q);this.editorUiRefresh=a.refresh;a.refresh=function(b){m.editorUiRefresh.apply(a,
+arguments);g()};g();var f=document.createElement("canvas");f.width=q.offsetWidth;f.height=q.offsetHeight;q.style.overflow="hidden";f.style.position="relative";q.appendChild(f);var l=f.getContext("2d");this.ui=a;var p=a.editor.graph;this.graph=p;this.container=q;this.canvas=f;var u=function(a,c,d,e,f){a=Math.round(a);c=Math.round(c);d=Math.round(d);e=Math.round(e);l.beginPath();l.moveTo(a+.5,c+.5);l.lineTo(d+.5,e+.5);l.stroke();f&&(b?(l.save(),l.translate(a,c),l.rotate(-Math.PI/2),l.fillText(f,0,0),
+l.restore()):l.fillText(f,a,c))},v=function(){l.clearRect(0,0,f.width,f.height);l.beginPath();l.lineWidth=.7;l.strokeStyle=n.strokeClr;l.setLineDash([]);l.font="9px Arial";l.textAlign="center";var a=p.view.scale,c=p.view.getBackgroundPageBounds(),d=p.view.translate,e=p.view.getGraphBounds(),g=p.pageVisible,q=g?k+(b?c.y-p.container.scrollTop:c.x-p.container.scrollLeft):k+(b?d.y-p.container.scrollTop:d.x-p.container.scrollLeft),v=0;g&&(v=b?Math.floor(((e.y+1)/a-d.y)/p.pageFormat.height)*p.pageFormat.height*
+a:Math.floor(((e.x+1)/a-d.x)/p.pageFormat.width)*p.pageFormat.width*a);var A,F,D;switch(m.unit){case mxConstants.POINTS:A=D=10;F=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:D=10;A=mxConstants.PIXELS_PER_MM;F=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:D=.5>=a||4<=a?8:16,A=mxConstants.PIXELS_PER_INCH/D,F=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}d=A;2<=a?d=A/(2*Math.floor(a/2)):.5>=a&&(d=A*Math.floor(1/a/2)*(m.unit==mxConstants.MILLIMETERS?2:1));A=null;c=g?Math.min(q+(b?c.height:c.width),
+b?f.height:f.width):b?f.height:f.width;g&&(l.fillStyle=n.outBkgClr,b?(l.fillRect(0,k,k,q-k),l.fillRect(0,c,k,f.height)):(l.fillRect(k,0,q-k,k),l.fillRect(c,0,f.width,k)));l.fillStyle=n.fontClr;for(g=g?q:q%(d*a);g<=c;g+=d*a)if(e=Math.round((g-q)/a/d),!(g<k||e==A)){A=e;var H=null;0==e%D&&(H=m.formatText(v+e*d)+"");b?u(k-F[Math.abs(e)%D],g,k,g,H):u(g,k-F[Math.abs(e)%D],g,k,H)}l.lineWidth=1;u(b?0:k,b?k:0,k,k);l.fillStyle=n.cornerClr;l.fillRect(0,0,k,k)};this.drawRuler=v;this.sizeListener=c=e(function(){var a=
+p.container;b?(a=a.offsetHeight+k,f.height!=a&&(f.height=a,q.style.height=a+"px",v())):(a=a.offsetWidth+k,f.width!=a&&(f.width=a,q.style.width=a+"px",v()))},10);this.pageListener=function(){v()};this.scrollListener=d=e(function(){var a=b?p.container.scrollTop:p.container.scrollLeft;m.lastScroll!=a&&(m.lastScroll=a,v())},10);this.unitListener=function(a,b){m.setUnit(b.getProperty("unit"))};p.addListener(mxEvent.SIZE,c);p.container.addEventListener("scroll",d);p.view.addListener("unitChanged",this.unitListener);
+a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){n=a;q.style.background=n.bkgClr;v()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(a,c,d,e){var f;if(b&&4<a.height||!b&&4<a.width){if(null!=m.guidePart)try{l.putImageData(m.guidePart.imgData1,m.guidePart.x1,m.guidePart.y1),l.putImageData(m.guidePart.imgData2,m.guidePart.x2,m.guidePart.y2),l.putImageData(m.guidePart.imgData3,
+m.guidePart.x3,m.guidePart.y3)}catch(K){}f=m.origGuideMove.apply(this,arguments);try{var g,p,q,t,v,y,z,C,G;l.lineWidth=.5;l.strokeStyle=n.guideClr;l.setLineDash([2]);b?(p=a.y+f.y+k-this.graph.container.scrollTop,g=0,v=p+a.height/2,t=k/2,C=p+a.height,z=0,q=l.getImageData(g,p-1,k,3),u(g,p,k,p),p--,y=l.getImageData(t,v-1,k,3),u(t,v,k,v),v--,G=l.getImageData(z,C-1,k,3),u(z,C,k,C),C--):(p=0,g=a.x+f.x+k-this.graph.container.scrollLeft,v=k/2,t=g+a.width/2,C=0,z=g+a.width,q=l.getImageData(g-1,p,3,k),u(g,
+p,g,k),g--,y=l.getImageData(t-1,v,3,k),u(t,v,t,k),t--,G=l.getImageData(z-1,C,3,k),u(z,C,z,k),z--);if(null==m.guidePart||m.guidePart.x1!=g||m.guidePart.y1!=p)m.guidePart={imgData1:q,x1:g,y1:p,imgData2:y,x2:t,y2:v,imgData3:G,x3:z,y3:C}}catch(K){}}else f=m.origGuideMove.apply(this,arguments);return f};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=m.origGuideDestroy.apply(this,arguments);if(null!=m.guidePart)try{l.putImageData(m.guidePart.imgData1,m.guidePart.x1,
+m.guidePart.y1),l.putImageData(m.guidePart.imgData2,m.guidePart.x2,m.guidePart.y2),l.putImageData(m.guidePart.imgData3,m.guidePart.x3,m.guidePart.y3),m.guidePart=null}catch(z){}return a}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(a){this.unit=a;this.drawRuler()};
mxRuler.prototype.formatText=function(a){switch(this.unit){case mxConstants.POINTS:return Math.round(a);case mxConstants.MILLIMETERS:return(a/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.INCHES:return(a/mxConstants.PIXELS_PER_INCH).toFixed(2)}};
mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener("unitChanged",this.unitListener);this.ui.removeListener("pageViewChanged",this.pageListener);this.ui.removeListener("pageScaleChanged",this.pageListener);this.ui.removeListener("pageFormatChanged",
this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};
function mxDualRuler(a,c){var b=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=a.getDiagramContainerOffset;a.getDiagramContainerOffset=function(){return b};this.editorUiRefresh=a.refresh;this.ui=a;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(a,c,!0);this.hRuler=new mxRuler(a,c,!1,!0);var d=mxUtils.bind(this,function(b){var c=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,
-function(b){c=null!=a.currentMenu;mxEvent.consume(b)}),null,mxUtils.bind(this,function(d){if(a.editor.graph.isEnabled()&&!a.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(d)||mxEvent.isPopupTrigger(d))){a.editor.graph.popupMenuHandler.hideMenu();a.hideCurrentMenu();if(!mxEvent.isTouchEvent(d)||!c){var f=new mxPopupMenu(mxUtils.bind(this,function(b,c){a.menus.addMenuItems(b,["points","millimeters"],c)}));f.div.className+=" geMenubarMenu";f.smartSeparators=!0;f.showDisabled=!0;f.autoExpand=!0;f.hideMenu=
-mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(f,arguments);a.resetCurrentMenu();f.destroy()});var l=mxEvent.getClientX(d),m=mxEvent.getClientY(d);f.popup(l,m,null,d);a.setCurrentMenu(f,b)}mxEvent.consume(d)}}))});d(this.hRuler.container);d(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.setUnit=function(a){this.vRuler.setUnit(a);this.hRuler.setUnit(a)};mxDualRuler.prototype.setStyle=function(a){this.vRuler.setStyle(a);this.hRuler.setStyle(a)};
-mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(a){var c=null!=a.view&&null!=a.view.canvas?a.view.canvas.ownerSVGElement:null;if(null!=a.container&&null!=c){var b=mxFreehand.prototype.NORMAL_SMOOTHING,d=null,m=[],f,l=[],n,p=!1,u=!0,g=[],k=!1,q=!1;this.setClosedPath=function(a){p=a};this.setAutoClose=function(a){u=a};this.setStopClickEnabled=function(a){q=a};this.setSmoothing=function(a){b=a};var v=function(b){k=b;a.getRubberband().setEnabled(!b);a.graphHandler.setSelectEnabled(!b);a.graphHandler.setMoveEnabled(!b);a.container.style.cursor=
-b?"crosshair":"";a.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){v(!0)};this.isDrawing=function(){return k};var y=mxUtils.bind(this,function(a){if(d){var b=q&&0<l.length&&null!=n&&2>n.length;b||l.push.apply(l,n);n=[];l.push(null);m.push(d);d=null;b&&this.stopDrawing();mxEvent.consume(a)}});this.stopDrawing=function(){if(0<m.length){for(var b=l[0].x,c=l[0].x,f=l[0].y,g=l[0].y,k=1;k<l.length;k++)null!=l[k]&&(b=Math.max(b,l[k].x),c=Math.min(c,l[k].x),f=Math.max(f,
-l[k].y),g=Math.min(g,l[k].y));b-=c;f-=g;if(0<b&&0<f){var n=100/b,q=100/f;l.map(function(a){if(null==a)return a;a.x=(a.x-c)*n;a.y=(a.y-g)*q;return a});for(var t='<shape strokewidth="inherit"><foreground>',y=0,k=0;k<l.length;k++){var z=l[k];if(null==z){var z=!1,y=l[y],A=l[k-1];!p&&u&&(z=y.x-A.x,A=y.y-A.y,z=Math.sqrt(z*z+A*A)<=a.tolerance);if(p||z)t+='<line x="'+y.x.toFixed(2)+'" y="'+y.y.toFixed(2)+'"/>';t+="</path>"+(p||z?"<fillstroke/>":"<stroke/>");y=k+1}else t=k==y?t+('<path><move x="'+z.x.toFixed(2)+
-'" y="'+z.y.toFixed(2)+'"/>'):t+('<line x="'+z.x.toFixed(2)+'" y="'+z.y.toFixed(2)+'"/>')}var k=mxConstants.STYLE_SHAPE+"=stencil("+Graph.compress(t+"</foreground></shape>")+");fillColor=none;",t=a.view.scale,y=a.view.translate,L=new mxCell("",new mxGeometry(c/t-y.x,g/t-y.y,b/t,f/t),k);L.vertex=1;a.model.beginUpdate();try{L=a.addCell(L)}finally{a.model.endUpdate()}a.fireEvent(new mxEventObject("cellsInserted","cells",[L]));a.fireEvent(new mxEventObject("freehandInserted","cell",L));setTimeout(function(){a.setSelectionCells([L])},
-10)}for(k=0;k<m.length;k++)m[k].parentNode.removeChild(m[k]);d=null;m=[];l=[]}v(!1)};mxEvent.addGestureListeners(c,function(b){if(k){var m=parseFloat(a.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1),m=Math.max(1,m*a.view.scale);d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("fill","none");d.setAttribute("stroke",a.currentVertexStyle[mxConstants.STYLE_STROKECOLOR]||"#000");d.setAttribute("stroke-width",m);if("1"==a.currentVertexStyle[mxConstants.STYLE_DASHED]){var p=
-a.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",p=p.split(" ").map(function(a){return parseFloat(a)*m}).join(" ");d.setAttribute("stroke-dasharray",p)}g=[];p=t(b);A(p);f="M"+p.x+" "+p.y;l.push(p);n=[];d.setAttribute("d",f);c.appendChild(d);mxEvent.consume(b)}},function(a){if(d){A(t(a));var b=z(0);if(b){f+=" L"+b.x+" "+b.y;l.push(b);var c="";n=[];for(var k=2;k<g.length;k+=2)b=z(k),c+=" L"+b.x+" "+b.y,n.push(b);d.setAttribute("d",f+c)}mxEvent.consume(a)}},y);var t=function(b){return mxUtils.convertPoint(a.container,
-mxEvent.getClientX(b),mxEvent.getClientY(b))},A=function(a){for(g.push(a);g.length>b;)g.shift()},z=function(a){var c=g.length;if(1===c%2||c>=b){var d=0,f=0,k,l=0;for(k=a;k<c;k++)l++,a=g[k],d+=a.x,f+=a.y;return{x:d/l,y:f/l}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;
+function(b){c=null!=a.currentMenu;mxEvent.consume(b)}),null,mxUtils.bind(this,function(d){if(a.editor.graph.isEnabled()&&!a.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(d)||mxEvent.isPopupTrigger(d))){a.editor.graph.popupMenuHandler.hideMenu();a.hideCurrentMenu();if(!mxEvent.isTouchEvent(d)||!c){var e=new mxPopupMenu(mxUtils.bind(this,function(b,c){a.menus.addMenuItems(b,["points","millimeters"],c)}));e.div.className+=" geMenubarMenu";e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=
+mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);a.resetCurrentMenu();e.destroy()});var g=mxEvent.getClientX(d),k=mxEvent.getClientY(d);e.popup(g,k,null,d);a.setCurrentMenu(e,b)}mxEvent.consume(d)}}))});d(this.hRuler.container);d(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.setUnit=function(a){this.vRuler.setUnit(a);this.hRuler.setUnit(a)};mxDualRuler.prototype.setStyle=function(a){this.vRuler.setStyle(a);this.hRuler.setStyle(a)};
+mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(a){var c=null!=a.view&&null!=a.view.canvas?a.view.canvas.ownerSVGElement:null;if(null!=a.container&&null!=c){var b=mxFreehand.prototype.NORMAL_SMOOTHING,d=null,g=[],e,k=[],m,n=!1,q=!0,f=[],l=!1,p=!1;this.setClosedPath=function(a){n=a};this.setAutoClose=function(a){q=a};this.setStopClickEnabled=function(a){p=a};this.setSmoothing=function(a){b=a};var u=function(b){l=b;a.getRubberband().setEnabled(!b);a.graphHandler.setSelectEnabled(!b);a.graphHandler.setMoveEnabled(!b);a.container.style.cursor=
+b?"crosshair":"";a.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){u(!0)};this.isDrawing=function(){return l};var v=mxUtils.bind(this,function(a){if(d){var b=p&&0<k.length&&null!=m&&2>m.length;b||k.push.apply(k,m);m=[];k.push(null);g.push(d);d=null;b&&this.stopDrawing();mxEvent.consume(a)}});this.stopDrawing=function(){if(0<g.length){for(var b=k[0].x,c=k[0].x,e=k[0].y,f=k[0].y,l=1;l<k.length;l++)null!=k[l]&&(b=Math.max(b,k[l].x),c=Math.min(c,k[l].x),e=Math.max(e,
+k[l].y),f=Math.min(f,k[l].y));b-=c;e-=f;if(0<b&&0<e){var m=100/b,p=100/e;k.map(function(a){if(null==a)return a;a.x=(a.x-c)*m;a.y=(a.y-f)*p;return a});for(var t='<shape strokewidth="inherit"><foreground>',v=0,l=0;l<k.length;l++){var y=k[l];if(null==y){var y=!1,v=k[v],z=k[l-1];!n&&q&&(y=v.x-z.x,z=v.y-z.y,y=Math.sqrt(y*y+z*z)<=a.tolerance);if(n||y)t+='<line x="'+v.x.toFixed(2)+'" y="'+v.y.toFixed(2)+'"/>';t+="</path>"+(n||y?"<fillstroke/>":"<stroke/>");v=l+1}else t=l==v?t+('<path><move x="'+y.x.toFixed(2)+
+'" y="'+y.y.toFixed(2)+'"/>'):t+('<line x="'+y.x.toFixed(2)+'" y="'+y.y.toFixed(2)+'"/>')}var l=mxConstants.STYLE_SHAPE+"=stencil("+Graph.compress(t+"</foreground></shape>")+");fillColor=none;",t=a.view.scale,v=a.view.translate,K=new mxCell("",new mxGeometry(c/t-v.x,f/t-v.y,b/t,e/t),l);K.vertex=1;a.model.beginUpdate();try{K=a.addCell(K)}finally{a.model.endUpdate()}a.fireEvent(new mxEventObject("cellsInserted","cells",[K]));a.fireEvent(new mxEventObject("freehandInserted","cell",K));setTimeout(function(){a.setSelectionCells([K])},
+10)}for(l=0;l<g.length;l++)g[l].parentNode.removeChild(g[l]);d=null;g=[];k=[]}u(!1)};mxEvent.addGestureListeners(c,function(b){if(l){var g=parseFloat(a.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1),g=Math.max(1,g*a.view.scale);d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("fill","none");d.setAttribute("stroke",a.currentVertexStyle[mxConstants.STYLE_STROKECOLOR]||"#000");d.setAttribute("stroke-width",g);if("1"==a.currentVertexStyle[mxConstants.STYLE_DASHED]){var n=
+a.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",n=n.split(" ").map(function(a){return parseFloat(a)*g}).join(" ");d.setAttribute("stroke-dasharray",n)}f=[];n=t(b);z(n);e="M"+n.x+" "+n.y;k.push(n);m=[];d.setAttribute("d",e);c.appendChild(d);mxEvent.consume(b)}},function(a){if(d){z(t(a));var b=y(0);if(b){e+=" L"+b.x+" "+b.y;k.push(b);var c="";m=[];for(var g=2;g<f.length;g+=2)b=y(g),c+=" L"+b.x+" "+b.y,m.push(b);d.setAttribute("d",e+c)}mxEvent.consume(a)}},v);var t=function(b){return mxUtils.convertPoint(a.container,
+mxEvent.getClientX(b),mxEvent.getClientY(b))},z=function(a){for(f.push(a);f.length>b;)f.shift()},y=function(a){var c=f.length;if(1===c%2||c>=b){var d=0,e=0,g,k=0;for(g=a;g<c;g++)k++,a=f[g],d+=a.x,e+=a.y;return{x:d/k,y:e/k}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;
diff --git a/src/main/webapp/js/diagramly/Dialogs.js b/src/main/webapp/js/diagramly/Dialogs.js
index cadabbd1..36a65b07 100644
--- a/src/main/webapp/js/diagramly/Dialogs.js
+++ b/src/main/webapp/js/diagramly/Dialogs.js
@@ -9881,3 +9881,217 @@ var BtnDialog = function(editorUi, peer, btnLbl, fn)
this.container = div;
};
+
+/**
+ * Aspect Dialog
+ * @module drawio/aspect-dialog
+ */
+function AspectDialog(editorUi, pageId, layerIds, okFn, cancelFn)
+{
+ this.aspect = {pageId : pageId || editorUi.pages[0].getId(), layerIds : layerIds || []};
+ var div = document.createElement('div');
+
+ var title = document.createElement('h5');
+ title.style.margin = '0 0 10px';
+ mxUtils.write(title, mxResources.get('pages'));
+ div.appendChild(title);
+
+ var pagesContainer = document.createElement('div');
+ pagesContainer.className = 'geAspectDlgList';
+ div.appendChild(pagesContainer);
+
+ title = document.createElement('h5');
+ title.style.margin = '0 0 10px';
+ mxUtils.write(title, mxResources.get('layers'));
+ div.appendChild(title);
+
+ var layersContainer = document.createElement('div');
+ layersContainer.className = 'geAspectDlgList';
+ div.appendChild(layersContainer);
+
+ this.pagesContainer = pagesContainer;
+ this.layersContainer = layersContainer;
+ this.ui = editorUi;
+
+ var btns = document.createElement('div');
+ btns.style.marginTop = '16px';
+ btns.style.textAlign = 'center';
+
+ var cancelBtn = mxUtils.button(mxResources.get('cancel'), function()
+ {
+ editorUi.hideDialog();
+
+ if (cancelFn != null)
+ {
+ cancelFn();
+ }
+ });
+
+ cancelBtn.className = 'geBtn';
+
+ if (editorUi.editor.cancelFirst)
+ {
+ btns.appendChild(cancelBtn);
+ }
+
+ var okBtn = mxUtils.button(mxResources.get('ok'), mxUtils.bind(this, function()
+ {
+ editorUi.hideDialog();
+ okFn({pageId: this.selectedPage, layerIds: Object.keys(this.selectedLayers)});
+ }));
+
+ btns.appendChild(okBtn);
+ okBtn.className = 'geBtn gePrimaryBtn';
+
+ if (!editorUi.editor.cancelFirst)
+ {
+ btns.appendChild(cancelBtn);
+ }
+
+ okBtn.setAttribute('disabled', 'disabled');
+ this.okBtn = okBtn;
+ div.appendChild(btns);
+ this.container = div;
+};
+
+//Drawing the graph with dialog not visible doesn't get dimensions right. It has to be visible!
+AspectDialog.prototype.init = function()
+{
+ for (var i = 0; i < this.ui.pages.length; i++)
+ {
+ var page = this.ui.updatePageRoot(this.ui.pages[i]);
+
+ this.createPageItem(page.getId(), page.getName(), page.node, page.root);
+ }
+};
+
+AspectDialog.prototype.createViewer = function(container, pageNode, layerId)
+{
+ mxEvent.disableContextMenu(container);
+ container.style.userSelect = 'none';
+
+ var graph = new Graph(container);
+ graph.setTooltips(false);
+ graph.setEnabled(false);
+ graph.setPanning(false);
+ graph.minFitScale = null;
+ graph.maxFitScale = null;
+ graph.centerZoom = true;
+
+ var node = pageNode.firstElementChild;
+
+ if (node != null)
+ {
+ var bg = node.getAttribute('background');
+
+ if (bg == null || bg == '' || bg == mxConstants.NONE)
+ {
+ bg = '#ffffff';
+ }
+
+ container.style.backgroundColor = bg;
+
+ var codec = new mxCodec(node.ownerDocument);
+ var model = graph.getModel();
+ codec.decode(node, model);
+
+ var childCount = model.getChildCount(model.root);
+
+ var showAll = layerId == null;
+
+ // handle layers visibility
+ for (var i = 0; i < childCount; i++)
+ {
+ var child = model.getChildAt(model.root, i);
+ model.setVisible(child, showAll || layerId == child.id);
+ }
+
+ graph.maxFitScale = 1;
+ graph.fit(0);
+ graph.center();
+ }
+
+ return graph;
+};
+
+AspectDialog.prototype.createPageItem = function(pageId, pageName, pageNode, pageRoot)
+{
+ var $listItem = document.createElement('div');
+ $listItem.className = 'geAspectDlgListItem';
+ $listItem.setAttribute('data-page-id', pageId)
+ $listItem.innerHTML = '<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">' + pageName + '</div>';
+
+ this.pagesContainer.appendChild($listItem);
+
+ var graph = this.createViewer($listItem.childNodes[0], pageNode);
+
+ var onClick = mxUtils.bind(this, function()
+ {
+ if (this.selectedItem != null)
+ {
+ this.selectedItem.className = 'geAspectDlgListItem';
+ }
+
+ this.selectedItem = $listItem;
+ this.selectedPage = pageId;
+ $listItem.className += ' geAspectDlgListItemSelected';
+ this.layersContainer.innerHTML = '';
+ this.selectedLayers = {};
+ this.okBtn.setAttribute('disabled', 'disabled');
+
+ var graphModel = graph.model;
+ var layers = graphModel.getChildCells(graphModel.getRoot());
+
+ for (var i = 0; i < layers.length; i++)
+ {
+ this.createLayerItem(layers[i], pageId, graph, pageNode);
+ }
+ });
+
+ mxEvent.addListener($listItem, 'click', onClick);
+
+ if(this.aspect.pageId == pageId)
+ {
+ onClick();
+ }
+};
+
+AspectDialog.prototype.createLayerItem = function(layer, pageId, graph, pageNode)
+{
+ var graphModel = graph.model;
+ var layerName = graph.convertValueToString(layer) || (mxResources.get('background') || 'Background');
+ var $listItem = document.createElement('div');
+ $listItem.setAttribute('data-layer-id', layer.id);
+ $listItem.className = 'geAspectDlgListItem';
+ $listItem.innerHTML = '<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">' + layerName + '</div>';
+ this.layersContainer.appendChild($listItem);
+
+ this.createViewer($listItem.childNodes[0], pageNode, layer.id);
+
+ var onClick = mxUtils.bind(this, function()
+ {
+ if ($listItem.className.indexOf('geAspectDlgListItemSelected') >= 0) //Selected
+ {
+ $listItem.className = 'geAspectDlgListItem';
+ delete this.selectedLayers[layer.id];
+
+ if (Object.keys(this.selectedLayers).length == 0)
+ {
+ this.okBtn.setAttribute('disabled', 'disabled');
+ }
+ }
+ else
+ {
+ $listItem.className += ' geAspectDlgListItemSelected';
+ this.selectedLayers[layer.id] = true;
+ this.okBtn.removeAttribute('disabled');
+ }
+ });
+
+ mxEvent.addListener($listItem, 'click', onClick);
+
+ if(this.aspect.layerIds.indexOf(layer.id) != -1)
+ {
+ onClick();
+ }
+}; \ No newline at end of file
diff --git a/src/main/webapp/js/diagramly/DriveFile.js b/src/main/webapp/js/diagramly/DriveFile.js
index b6b607d7..df347ee6 100644
--- a/src/main/webapp/js/diagramly/DriveFile.js
+++ b/src/main/webapp/js/diagramly/DriveFile.js
@@ -78,7 +78,7 @@ DriveFile.prototype.getMode = function()
DriveFile.prototype.getPublicUrl = function(fn)
{
this.ui.drive.executeRequest({
- url: '/files/' + this.desc.id + '/permissions'
+ url: '/files/' + this.desc.id + '/permissions?supportsTeamDrives=true'
},
mxUtils.bind(this, function(resp)
{
@@ -97,6 +97,9 @@ DriveFile.prototype.getPublicUrl = function(fn)
}
fn(null);
+ }), mxUtils.bind(this, function()
+ {
+ fn(null)
}));
};
diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.js
index daf6ec75..2744be4e 100644
--- a/src/main/webapp/js/diagramly/EditorUi.js
+++ b/src/main/webapp/js/diagramly/EditorUi.js
@@ -8838,7 +8838,7 @@
{
graph.getModel().endUpdate();
}
- }, function(err)
+ }, function(e)
{
ui.handleError(e);
});
@@ -11131,16 +11131,27 @@
postDataBack(uri);
});
+ var pageId = data.pageId || (this.pages != null? this.pages[0].getId() : null);
+
// LATER: Uses external export if current page (not first page) has mathEnabled
if (this.isExportToCanvas())
{
- // Exports PNG for first page while other page is visible by creating a graph
+ // Exports PNG for first/specific page while other page is visible by creating a graph
// LATER: Add caching for the graph or SVG while not on first page
- if (this.pages != null && this.currentPage != this.pages[0])
+ if (this.pages != null && this.currentPage.getId() != pageId)
{
var graphGetGlobalVariable = graph.getGlobalVariable;
graph = this.createTemporaryGraph(graph.getStylesheet());
- var page = this.pages[0];
+ var page;
+
+ for (var i = 0; i < this.pages.length; i++)
+ {
+ if (this.pages[i].getId() == pageId)
+ {
+ page = this.updatePageRoot(this.pages[i]);
+ break;
+ }
+ }
graph.getGlobalVariable = function(name)
{
@@ -11160,6 +11171,24 @@
graph.model.setRoot(page.root);
}
+ //Set visible layers based on message setting
+ if (data.layerIds != null)
+ {
+ var graphModel = graph.model;
+ var layers = graphModel.getChildCells(graphModel.getRoot());
+ var layerIdsMap = {};
+
+ for (var i = 0; i < data.layerIds.length; i++)
+ {
+ layerIdsMap[data.layerIds[i]] = true;
+ }
+
+ for (var i = 0; i < layers.length; i++)
+ {
+ graphModel.setVisible(layers[i], layerIdsMap[layers[i].id] || false);
+ }
+ }
+
this.exportToCanvas(mxUtils.bind(this, function(canvas)
{
processUri(canvas.toDataURL('image/png'));
@@ -11174,8 +11203,10 @@
// Double encoding for XML arg is needed for UTF8 encoding
var req = new mxXmlRequest(EXPORT_URL, 'format=png&embedXml=' +
((data.format == 'xmlpng') ? '1' : '0') +
+ (pageId != null? '&pageId=' + pageId : '') +
+ (data.layerIds != null? '&extras=' + encodeURIComponent(JSON.stringify({layerIds: data.layerIds})) : '') +
(data.scale != null? '&scale=' + data.scale : '') +'&base64=1&xml=' +
- encodeURIComponent(encodeURIComponent(xml)));
+ encodeURIComponent(xml));
req.send(mxUtils.bind(this, function(req)
{
diff --git a/src/main/webapp/js/diagramly/GitHubClient.js b/src/main/webapp/js/diagramly/GitHubClient.js
index 65fbaade..d9760cd7 100644
--- a/src/main/webapp/js/diagramly/GitHubClient.js
+++ b/src/main/webapp/js/diagramly/GitHubClient.js
@@ -888,34 +888,74 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
}));
});
- var selectFile = mxUtils.bind(this, function()
+ // Adds paging for repos, branches and files (files limited to 1000 by API)
+ var nextPageDiv = null;
+ var scrollFn = null;
+ var pageSize = 100;
+
+ var selectFile = mxUtils.bind(this, function(page)
{
+ if (page == null)
+ {
+ div.innerHTML = '';
+ page = 1;
+ }
+
var req = new mxXmlRequest(this.baseUrl + '/repos/' + org + '/' + repo +
- '/contents/' + path + '?ref=' + encodeURIComponent(ref), null, 'GET');
- dlg.okButton.removeAttribute('disabled');
- div.innerHTML = '';
+ '/contents/' + path + '?ref=' + encodeURIComponent(ref) +
+ '&per_page=' + pageSize + '&page=' + page, null, 'GET');
this.ui.spinner.spin(div, mxResources.get('loading'));
+ dlg.okButton.removeAttribute('disabled');
+
+ if (scrollFn != null)
+ {
+ mxEvent.removeListener(div, 'scroll', scrollFn);
+ scrollFn = null;
+ }
+
+ if (nextPageDiv != null && nextPageDiv.parentNode != null)
+ {
+ nextPageDiv.parentNode.removeChild(nextPageDiv);
+ }
+
+ nextPageDiv = document.createElement('a');
+ nextPageDiv.style.display = 'block';
+ nextPageDiv.setAttribute('href', 'javascript:void(0);');
+ mxUtils.write(nextPageDiv, mxResources.get('more') + '...');
+
+ var nextPage = mxUtils.bind(this, function()
+ {
+ selectFile(page + 1);
+ });
+
+ mxEvent.addListener(nextPageDiv, 'click', nextPage);
this.executeRequest(req, mxUtils.bind(this, function(req)
{
- updatePathInfo();
this.ui.spinner.stop();
- var files = JSON.parse(req.getText());
- div.appendChild(createLink('../ [Up]', mxUtils.bind(this, function()
+
+ if (page == 1)
{
- if (path == '')
- {
- path = null;
- selectRepo();
- }
- else
+ updatePathInfo();
+
+ div.appendChild(createLink('../ [Up]', mxUtils.bind(this, function()
{
- var tokens = path.split('/');
- path = tokens.slice(0, tokens.length - 1).join('/');
- selectFile();
- }
- }), '4px'));
+ if (path == '')
+ {
+ path = null;
+ selectRepo();
+ }
+ else
+ {
+ var tokens = path.split('/');
+ path = tokens.slice(0, tokens.length - 1).join('/');
+ selectFile();
+ }
+ }), '4px'));
+ }
+ var files = JSON.parse(req.getText());
+
if (files == null || files.length == 0)
{
mxUtils.write(div, mxResources.get('noFiles'));
@@ -923,6 +963,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
else
{
var gray = true;
+ var count = 0;
var listFiles = mxUtils.bind(this, function(showFolders)
{
@@ -959,6 +1000,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
})));
div.appendChild(temp);
+ count++;
}
}))(files[i], i);
}
@@ -970,14 +1012,25 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
{
listFiles(false);
}
+
+ // LATER: Paging not supported for contents in GitHub
+// if (count == pageSize)
+// {
+// div.appendChild(nextPageDiv);
+//
+// scrollFn = function()
+// {
+// if (div.scrollTop >= div.scrollHeight - div.offsetHeight)
+// {
+// nextPage();
+// }
+// };
+//
+// mxEvent.addListener(div, 'scroll', scrollFn);
+// }
}
}), error, true);
});
-
- // Adds paging for repos and branches (files limited to 1000 by API)
- var pageSize = 100;
- var nextPageDiv = null;
- var scrollFn = null;
var selectRef = mxUtils.bind(this, function(page)
{
@@ -992,6 +1045,12 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
dlg.okButton.setAttribute('disabled', 'disabled');
this.ui.spinner.spin(div, mxResources.get('loading'));
+ if (scrollFn != null)
+ {
+ mxEvent.removeListener(div, 'scroll', scrollFn);
+ scrollFn = null;
+ }
+
if (nextPageDiv != null && nextPageDiv.parentNode != null)
{
nextPageDiv.parentNode.removeChild(nextPageDiv);
@@ -1004,7 +1063,6 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
var nextPage = mxUtils.bind(this, function()
{
- mxEvent.removeListener(div, 'scroll', scrollFn);
selectRef(page + 1);
});
@@ -1082,6 +1140,11 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
dlg.okButton.setAttribute('disabled', 'disabled');
this.ui.spinner.spin(div, mxResources.get('loading'));
+ if (scrollFn != null)
+ {
+ mxEvent.removeListener(div, 'scroll', scrollFn);
+ }
+
if (nextPageDiv != null && nextPageDiv.parentNode != null)
{
nextPageDiv.parentNode.removeChild(nextPageDiv);
@@ -1094,7 +1157,6 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
var nextPage = mxUtils.bind(this, function()
{
- mxEvent.removeListener(div, 'scroll', scrollFn);
selectRepo(page + 1);
});
diff --git a/src/main/webapp/js/diagramly/GitLabClient.js b/src/main/webapp/js/diagramly/GitLabClient.js
index b25fd180..e2f17265 100644
--- a/src/main/webapp/js/diagramly/GitLabClient.js
+++ b/src/main/webapp/js/diagramly/GitLabClient.js
@@ -768,34 +768,72 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
}));
});
- var selectFile = mxUtils.bind(this, function()
+ // Adds paging for repos, branches and files
+ var nextPageDiv = null;
+ var scrollFn = null;
+ var pageSize = 100;
+
+ var selectFile = mxUtils.bind(this, function(page)
{
+ if (page == null)
+ {
+ div.innerHTML = '';
+ page = 1;
+ }
+
var req = new mxXmlRequest(this.baseUrl + '/projects/' + encodeURIComponent(org + '/' + repo) +
- '/repository/tree?path=' + path + '&ref=' + ref, null, 'GET');
- dlg.okButton.removeAttribute('disabled');
- div.innerHTML = '';
+ '/repository/tree?path=' + path + '&ref=' + ref + '&per_page=' + pageSize + '&page=' + page, null, 'GET');
this.ui.spinner.spin(div, mxResources.get('loading'));
+ dlg.okButton.removeAttribute('disabled');
+
+ if (scrollFn != null)
+ {
+ mxEvent.removeListener(div, 'scroll', scrollFn);
+ scrollFn = null;
+ }
+
+ if (nextPageDiv != null && nextPageDiv.parentNode != null)
+ {
+ nextPageDiv.parentNode.removeChild(nextPageDiv);
+ }
+
+ nextPageDiv = document.createElement('a');
+ nextPageDiv.style.display = 'block';
+ nextPageDiv.setAttribute('href', 'javascript:void(0);');
+ mxUtils.write(nextPageDiv, mxResources.get('more') + '...');
+
+ var nextPage = mxUtils.bind(this, function()
+ {
+ selectFile(page + 1);
+ });
+
+ mxEvent.addListener(nextPageDiv, 'click', nextPage);
this.executeRequest(req, mxUtils.bind(this, function(req)
{
- updatePathInfo(!ref);
this.ui.spinner.stop();
- var files = JSON.parse(req.getText());
- div.appendChild(createLink('../ [Up]', mxUtils.bind(this, function()
+ if (page == 1)
{
- if (path == '')
- {
- path = null;
- selectRepo();
- }
- else
+ updatePathInfo(!ref);
+
+ div.appendChild(createLink('../ [Up]', mxUtils.bind(this, function()
{
- var tokens = path.split('/');
- path = tokens.slice(0, tokens.length - 1).join('/');
- selectFile();
- }
- }), '4px'));
+ if (path == '')
+ {
+ path = null;
+ selectRepo();
+ }
+ else
+ {
+ var tokens = path.split('/');
+ path = tokens.slice(0, tokens.length - 1).join('/');
+ selectFile();
+ }
+ }), '4px'));
+ }
+
+ var files = JSON.parse(req.getText());
if (files == null || files.length == 0)
{
@@ -804,6 +842,7 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
else
{
var gray = true;
+ var count = 0;
var listFiles = mxUtils.bind(this, function(showFolders)
{
@@ -840,6 +879,7 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
})));
div.appendChild(temp);
+ count++;
}
}))(files[i]);
}
@@ -851,14 +891,24 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
{
listFiles(false);
}
+
+ if (count == pageSize)
+ {
+ div.appendChild(nextPageDiv);
+
+ scrollFn = function()
+ {
+ if (div.scrollTop >= div.scrollHeight - div.offsetHeight)
+ {
+ nextPage();
+ }
+ };
+
+ mxEvent.addListener(div, 'scroll', scrollFn);
+ }
}
}), error, true);
});
-
- // Adds paging for repos and branches (files limited to 1000 by API)
- var pageSize = 100;
- var nextPageDiv = null;
- var scrollFn = null;
var selectRef = mxUtils.bind(this, function(page)
{
@@ -873,6 +923,12 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
dlg.okButton.setAttribute('disabled', 'disabled');
this.ui.spinner.spin(div, mxResources.get('loading'));
+ if (scrollFn != null)
+ {
+ mxEvent.removeListener(div, 'scroll', scrollFn);
+ scrollFn = null;
+ }
+
if (nextPageDiv != null && nextPageDiv.parentNode != null)
{
nextPageDiv.parentNode.removeChild(nextPageDiv);
@@ -885,7 +941,6 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
var nextPage = mxUtils.bind(this, function()
{
- mxEvent.removeListener(div, 'scroll', scrollFn);
selectRef(page + 1);
});
@@ -962,7 +1017,13 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
div.innerHTML = '';
page = 1;
}
-
+
+ if (scrollFn != null)
+ {
+ mxEvent.removeListener(div, 'scroll', scrollFn);
+ scrollFn = null;
+ }
+
if (nextPageDiv != null && nextPageDiv.parentNode != null)
{
nextPageDiv.parentNode.removeChild(nextPageDiv);
@@ -975,7 +1036,6 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
var nextPage = mxUtils.bind(this, function()
{
- mxEvent.removeListener(div, 'scroll', scrollFn);
selectRepo(page + 1);
});
diff --git a/src/main/webapp/js/diagramly/GraphViewer.js b/src/main/webapp/js/diagramly/GraphViewer.js
index 4ca8ef21..c24dfe6e 100644
--- a/src/main/webapp/js/diagramly/GraphViewer.js
+++ b/src/main/webapp/js/diagramly/GraphViewer.js
@@ -292,6 +292,15 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)
this.graph.panningHandler.ignoreCell = true;
this.graph.setPanning(false);
+ if (this.graphConfig.toolbar != null)
+ {
+ this.addToolbar();
+ }
+ else if (this.graphConfig.title != null && this.showTitleAsTooltip)
+ {
+ container.setAttribute('title', this.graphConfig.title);
+ }
+
this.addSizeHandler();
this.showLayers(this.graph);
this.addClickHandler(this.graph);
@@ -325,15 +334,6 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)
return done;
};
- if (this.graphConfig.toolbar != null)
- {
- this.addToolbar();
- }
- else if (this.graphConfig.title != null && this.showTitleAsTooltip)
- {
- container.setAttribute('title', this.graphConfig.title);
- }
-
this.fireEvent(new mxEventObject('render'));
});
@@ -749,30 +749,37 @@ GraphViewer.prototype.updateContainerHeight = function(container, height)
GraphViewer.prototype.showLayers = function(graph, sourceGraph)
{
var layers = this.graphConfig.layers;
+ var idx = (layers != null) ? layers.split(' ') : [];
+ var layerIds = this.graphConfig.layerIds;
- if (layers != null || sourceGraph != null)
+ if (idx.length > 0 || layerIds != null || sourceGraph != null)
{
- var idx = (layers != null) ? layers.split(' ') : null;
+ var source = (sourceGraph != null) ? sourceGraph.getModel() : null;
+ var model = graph.getModel();
+ model.beginUpdate();
- if (sourceGraph != null || idx.length > 0)
+ try
{
- var source = (sourceGraph != null) ? sourceGraph.getModel() : null;
- var model = graph.getModel();
- model.beginUpdate();
+ var childCount = model.getChildCount(model.root);
- try
+ // Hides all layers
+ for (var i = 0; i < childCount; i++)
{
- var childCount = model.getChildCount(model.root);
-
- // Hides all layers
- for (var i = 0; i < childCount; i++)
+ model.setVisible(model.getChildAt(model.root, i),
+ (sourceGraph != null) ? source.isVisible(source.getChildAt(source.root, i)) : false);
+ }
+
+ // Shows specified layers (eg. 0 1 3)
+ if (source == null)
+ {
+ if (layerIds != null)
{
- model.setVisible(model.getChildAt(model.root, i),
- (sourceGraph != null) ? source.isVisible(source.getChildAt(source.root, i)) : false);
+ for (var i = 0; i < layerIds.length; i++)
+ {
+ model.setVisible(model.getCell(layerIds[i]), true);
+ }
}
-
- // Shows specified layers (eg. 0 1 3)
- if (source == null)
+ else
{
for (var i = 0; i < idx.length; i++)
{
@@ -780,10 +787,10 @@ GraphViewer.prototype.showLayers = function(graph, sourceGraph)
}
}
}
- finally
- {
- model.endUpdate();
- }
+ }
+ finally
+ {
+ model.endUpdate();
}
}
};
diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js
index ef07ac51..5bfb8f3e 100644
--- a/src/main/webapp/js/viewer.min.js
+++ b/src/main/webapp/js/viewer.min.js
@@ -106,7 +106,7 @@ window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefi
(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&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];
null!=a&&(DRAWIO_GITLAB_ID=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.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0";
if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);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:"4.0.5",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:"4.0.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")&&
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_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg",
@@ -1476,7 +1476,7 @@ mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=nul
function mxGraphHandler(a){this.graph=a;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,function(){this.updatePreview();this.updateHint()});this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,function(a,c){this.reset()});this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,function(a,c){if(null!=this.first)try{this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),
this.updatePreview(!0),window.setTimeout(mxUtils.bind(this,function(){this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.cells,!1),this.updatePreview())}),0)}catch(d){this.reset()}});this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50;mxGraphHandler.prototype.enabled=!0;mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;
mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;mxGraphHandler.prototype.removeEmptyParents=!1;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;mxGraphHandler.prototype.minimumSize=6;
-mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};
+mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};
mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};
mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a};mxGraphHandler.prototype.getInitialCellForEvent=function(a){return a.getCell()};mxGraphHandler.prototype.isDelayedSelection=function(a,b){return this.graph.isCellSelected(a)};mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()};
mxGraphHandler.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=b.getState()&&!mxEvent.isMultiTouchEvent(b.getEvent())){var c=this.getInitialCellForEvent(b);this.delayedSelection=this.isDelayedSelection(c,b);this.cell=null;this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(c,b.getEvent());if(this.isMoveEnabled()){var d=this.graph.model,e=d.getGeometry(c);this.graph.isCellMovable(c)&&(!d.isEdge(c)||1<this.graph.getSelectionCount()||
@@ -1488,14 +1488,14 @@ mxGraphHandler.prototype.createPreviewShape=function(a){a=new mxRectangleShape(a
mxGraphHandler.prototype.start=function(a,b,c){this.cell=a;this.first=mxUtils.convertPoint(this.graph.container,b,c);this.cells=this.getCells(this.cell);this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);this.allCells=new mxDictionary;this.cloning=!1;for(b=this.cellCount=0;b<this.cells.length;b++)this.cellCount+=this.addStates(this.cells[b],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var d=this.graph.model.getParent(a),
e=2>this.graph.model.getChildCount(d);this.guide.isStateIgnored=mxUtils.bind(this,function(a){var b=this.graph.model.getParent(a.cell);return!this.cloning&&this.isCellMoving(a.cell)||a.cell!=(this.target||d)&&!e&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&b!=(this.target||d)})}};
mxGraphHandler.prototype.addStates=function(a,b){var c=this.graph.view.getState(a),d=0;if(null!=c&&null==b.get(a)){b.put(a,c);d++;for(var c=this.graph.model.getChildCount(a),e=0;e<c;e++)d+=this.addStates(this.graph.model.getChildAt(a,e),b)}return d};mxGraphHandler.prototype.isCellMoving=function(a){return null!=this.allCells.get(a)};mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent()):!0};
-mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());var b=this.graph.view.scale;return new mxPoint(this.roundLength((a.x-this.first.x)/b)*b,this.roundLength((a.y-this.first.y)/b)*b)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){};
-mxGraphHandler.prototype.roundLength=function(a){return Math.round(2*a)/2};
+mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());var b=this.graph.view.scale;return new mxPoint(this.roundLength((a.x-this.first.x-this.graph.panDx)/b)*b,this.roundLength((a.y-this.first.y-this.graph.panDy)/b)*b)};mxGraphHandler.prototype.updateHint=function(a){};
+mxGraphHandler.prototype.removeHint=function(){};mxGraphHandler.prototype.roundLength=function(a){return Math.round(2*a)/2};
mxGraphHandler.prototype.mouseMove=function(a,b){var c=this.graph;if(!b.isConsumed()&&c.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds)if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{var d=this.getDelta(b),e=d.x,d=d.y,f=c.tolerance;if(null!=this.shape||this.livePreviewActive||Math.abs(e)>f||Math.abs(d)>f){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var g=c.isCloneEvent(b.getEvent())&&c.isCellsCloneable()&&this.isCloneEnabled(),
-k=c.isGridEnabledEvent(b.getEvent()),f=!0;this.cloning=g;var l=null,m=b.getCell();c.isDropEnabled()&&this.highlightEnabled&&(l=c.getDropTarget(this.cells,b.getEvent(),m,g));var n=c.getView().getState(l),p=!1;null==n||c.model.getParent(this.cell)==l&&!g?(this.target=null,this.connectOnDrop&&null!=m&&1==this.cells.length&&c.getModel().isVertex(m)&&c.isCellConnectable(m)&&(n=c.getView().getState(m),null!=n&&(l=null==c.getEdgeValidationError(null,this.cell,m)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,
-this.setHighlightColor(l),p=!0))):(this.target!=l&&(this.target=l,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0);null!=n&&p?this.highlight.highlight(n):this.highlight.hide();this.livePreviewActive&&g?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&mxClient.IS_SVG?(this.setHandlesVisibleForCells(this.cells,!1),this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds));
+k=c.isGridEnabledEvent(b.getEvent()),l=b.getCell(),f=!0,m=null;this.cloning=g;c.isDropEnabled()&&this.highlightEnabled&&(m=c.getDropTarget(this.cells,b.getEvent(),l,g));var n=c.getView().getState(m),p=!1;null==n||c.model.getParent(this.cell)==m&&!g?(this.target=null,this.connectOnDrop&&null!=l&&1==this.cells.length&&c.getModel().isVertex(l)&&c.isCellConnectable(l)&&(n=c.getView().getState(l),null!=n&&(l=null==c.getEdgeValidationError(null,this.cell,l)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,
+this.setHighlightColor(l),p=!0))):(this.target!=m&&(this.target=m,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0);null!=n&&p?this.highlight.highlight(n):this.highlight.hide();this.livePreviewActive&&g?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?(this.setHandlesVisibleForCells(this.cells,!1),this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds));
null!=this.guide&&this.useGuidesForEvent(b)?(d=this.guide.move(this.bounds,new mxPoint(e,d),k,g),f=!1,e=d.x,d=d.y):k&&(k=c.getView().translate,n=c.getView().scale,g=this.bounds.x-(c.snap(this.bounds.x/n-k.x)+k.x)*n,k=this.bounds.y-(c.snap(this.bounds.y/n-k.y)+k.y)*n,d=this.snap(new mxPoint(e,d)),e=d.x-g,d=d.y-k);null!=this.guide&&f&&this.guide.hide();c.isConstrainedEvent(b.getEvent())&&(Math.abs(e)>Math.abs(d)?d=0:e=0);this.currentDx=e;this.currentDy=d;this.updatePreview()}this.updateHint(b);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,
b);mxEvent.consume(b.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||b.isConsumed()||null==b.getState()&&null==b.sourceState||c.isMouseDown||(e=c.getCursorForMouseEvent(b),null==e&&c.isEnabled()&&c.isCellMovable(b.getCell())&&(e=c.getModel().isEdge(b.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=e&&null!=b.sourceState&&b.sourceState.setCursor(e))};
-mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&this.updateLivePreview(this.currentDx-this.graph.panDx,this.currentDy-this.graph.panDy):this.updatePreviewShape()};mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};
+mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&this.updateLivePreview(this.currentDx,this.currentDy):this.updatePreviewShape()};mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};
mxGraphHandler.prototype.updateLivePreview=function(a,b){var c=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,function(d,e){var f=e.clone();c.push([e,f]);null!=e.shape&&(null==e.shape.originalPointerEvents&&(e.shape.originalPointerEvents=e.shape.pointerEvents),e.shape.pointerEvents=!1,null!=e.text&&null!=e.text.node&&(f=e.text.node,null!=f.firstChild&&null!=f.firstChild.firstChild&&"foreignObject"==f.firstChild.firstChild.nodeName?f.firstChild.firstChild.setAttribute("pointer-events",
"none"):null!=f.ownerSVGElement?f.setAttribute("pointer-events","none"):f.style.pointerEvents="none"));this.graph.model.isVertex(e.cell)&&(e.x+=a,e.y+=b,this.cloning||(e.view.graph.cellRenderer.redraw(e,!0),e.view.invalidate(e.cell),e.invalid=!1),null!=e.control&&null!=e.control.node&&(e.control.node.style.visibility="hidden"))}));for(var d=this.graph.view.scale,e=0;e<c.length;e++){var f=c[e][0];if(this.graph.model.isEdge(f.cell)){var g=this.graph.getCellGeometry(f.cell),k=[];if(null!=g&&null!=g.points)for(var l=
0;l<g.points.length;l++)null!=g.points[l]&&k.push(new mxPoint(g.points[l].x+a/d,g.points[l].y+b/d));var g=f.visibleSourceState,l=f.visibleTargetState,m=c[e][1].absolutePoints;null!=g&&this.isCellMoving(g.cell)?f.view.updateFixedTerminalPoint(f,g,!0,this.graph.getConnectionConstraint(f,g,!0)):(g=m[0],f.setAbsoluteTerminalPoint(new mxPoint(g.x+a,g.y+b),!0),g=null);null!=l&&this.isCellMoving(l.cell)?f.view.updateFixedTerminalPoint(f,l,!1,this.graph.getConnectionConstraint(f,l,!1)):(l=m[m.length-1],f.setAbsoluteTerminalPoint(new mxPoint(l.x+
@@ -1508,7 +1508,7 @@ mxGraphHandler.prototype.selectDelayed=function(a){this.graph.isCellSelected(thi
mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.cells,!0));this.destroyShapes();this.removeHint();this.delayedSelection=!1;this.livePreviewUsed=this.livePreviewActive=null;this.cellWasClicked=!1;this.cellCount=this.currentDy=this.currentDx=null;this.cloning=!1;this.cell=this.cells=this.first=this.target=this.guides=this.allCells=null};
mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);var d=Math.sin(-d),e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return!mxUtils.contains(a,c.x,c.y)}return!1};
mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));var g=this.graph.getModel().getParent(this.cell);null==e&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(g,a,f)&&(e=this.graph.getDefaultParent());d=d&&!this.graph.isCellLocked(e||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{g=[];if(!d&&null!=e&&this.removeEmptyParents){for(var k=new mxDictionary,l=0;l<a.length;l++)k.put(a[l],!0);for(l=0;l<a.length;l++){var m=
-this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b-this.graph.panDx/this.graph.view.scale,c-this.graph.panDy/this.graph.view.scale,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])};
+this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b,c,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])};
mxGraphHandler.prototype.shouldRemoveParent=function(a){var b=this.graph.view.getState(a);return null!=b&&(this.graph.model.isEdge(b.cell)||this.graph.model.isVertex(b.cell))&&this.graph.isCellDeletable(b.cell)&&0==this.graph.model.getChildCount(b.cell)?(a=mxUtils.getValue(b.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),b=mxUtils.getValue(b.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE),a==mxConstants.NONE&&b==mxConstants.NONE):!1};
mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)};
mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.refreshHandler=null);this.destroyShapes();this.removeHint()};
@@ -1983,7 +1983,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,b,f,d,l){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=d||this.createGraph(b,f);this.editable=null!=l?l:!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,b,e,d,k){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=d||this.createGraph(b,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=
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(b){}})();Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS;
Editor.helpImage=mxClient.IS_SVG?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6Ii8+PHBhdGggZD0iTTExIDE4aDJ2LTJoLTJ2MnptMS0xNkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTAtMTRjLTIuMjEgMC00IDEuNzktNCA0aDJjMC0xLjEuOS0yIDItMnMyIC45IDIgMmMwIDItMyAxLjc1LTMgNWgyYzAtMi4yNSAzLTIuNSAzLTUgMC0yLjIxLTEuNzktNC00LTR6Ii8+PC9zdmc+":IMAGE_PATH+
@@ -2007,27 +2007,27 @@ Editor.fullscreenLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAA
Editor.ctrlKey=mxClient.IS_MAC?"Cmd":"Ctrl";Editor.popupsAllowed=!0;mxUtils.extend(Editor,mxEventSource);Editor.prototype.originalNoForeignObject=mxClient.NO_FO;Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif";Editor.prototype.extendCanvas=!0;Editor.prototype.chromeless=!1;Editor.prototype.cancelFirst=!0;
Editor.prototype.enabled=!0;Editor.prototype.filename=null;Editor.prototype.modified=!1;Editor.prototype.autosave=!0;Editor.prototype.initialTopSpacing=0;Editor.prototype.appName=document.title;Editor.prototype.editBlankUrl=window.location.protocol+"//"+window.location.host+"/";Editor.prototype.defaultGraphOverflow="hidden";Editor.prototype.init=function(){};Editor.prototype.isChromelessView=function(){return this.chromeless};Editor.prototype.setAutosave=function(a){this.autosave=a;this.fireEvent(new mxEventObject("autosaveChanged"))};
Editor.prototype.getEditBlankUrl=function(a){return this.editBlankUrl+a};
-Editor.prototype.editAsNew=function(a,b){var f=null!=b?"?title="+encodeURIComponent(b):"";null!=urlParams.ui&&(f+=(0<f.length?"&":"?")+"ui="+urlParams.ui);null==this.editorWindow||this.editorWindow.closed?"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?(null==this.editorWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(b){"ready"==b.data&&b.source==this.editorWindow&&this.editorWindow.postMessage(a,"*")})),this.editorWindow=this.graph.openLink(this.getEditBlankUrl(f+
-(0<f.length?"&":"?")+"client=1"),null,!0)):this.editorWindow=this.graph.openLink(this.getEditBlankUrl(f)+"#R"+encodeURIComponent(a)):this.editorWindow.focus()};Editor.prototype.createGraph=function(a,b){var f=new Graph(null,b,null,null,a);f.transparentBackground=!1;this.chromeless||(f.isBlankLink=function(a){return!this.isExternalProtocol(a)});return f};
+Editor.prototype.editAsNew=function(a,b){var e=null!=b?"?title="+encodeURIComponent(b):"";null!=urlParams.ui&&(e+=(0<e.length?"&":"?")+"ui="+urlParams.ui);null==this.editorWindow||this.editorWindow.closed?"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?(null==this.editorWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(b){"ready"==b.data&&b.source==this.editorWindow&&this.editorWindow.postMessage(a,"*")})),this.editorWindow=this.graph.openLink(this.getEditBlankUrl(e+
+(0<e.length?"&":"?")+"client=1"),null,!0)):this.editorWindow=this.graph.openLink(this.getEditBlankUrl(e)+"#R"+encodeURIComponent(a)):this.editorWindow.focus()};Editor.prototype.createGraph=function(a,b){var e=new Graph(null,b,null,null,a);e.transparentBackground=!1;this.chromeless||(e.isBlankLink=function(a){return!this.isExternalProtocol(a)});return e};
Editor.prototype.resetGraph=function(){this.graph.gridEnabled=!this.isChromelessView()||"1"==urlParams.grid;this.graph.graphHandler.guidesEnabled=!0;this.graph.setTooltips(!0);this.graph.setConnectable(!0);this.graph.foldingEnabled=!0;this.graph.scrollbars=this.graph.defaultScrollbars;this.graph.pageVisible=this.graph.defaultPageVisible;this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;this.graph.background=null;this.graph.pageScale=mxGraph.prototype.pageScale;
this.graph.pageFormat=mxGraph.prototype.pageFormat;this.graph.currentScale=1;this.graph.currentTranslate.x=0;this.graph.currentTranslate.y=0;this.updateGraphComponents();this.graph.view.setScale(1)};
Editor.prototype.readGraphState=function(a){this.graph.gridEnabled="0"!=a.getAttribute("grid")&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.gridSize=parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize;this.graph.graphHandler.guidesEnabled="0"!=a.getAttribute("guides");this.graph.setTooltips("0"!=a.getAttribute("tooltips"));this.graph.setConnectable("0"!=a.getAttribute("connect"));this.graph.connectionArrowsEnabled="0"!=a.getAttribute("arrows");this.graph.foldingEnabled=
"0"!=a.getAttribute("fold");this.isChromelessView()&&this.graph.foldingEnabled&&(this.graph.foldingEnabled="1"==urlParams.nav,this.graph.cellRenderer.forceControlClickHandler=this.graph.foldingEnabled);var b=parseFloat(a.getAttribute("pageScale"));!isNaN(b)&&0<b?this.graph.pageScale=b:this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.isLightboxView()||this.graph.isViewer()?this.graph.pageVisible=!1:(b=a.getAttribute("page"),this.graph.pageVisible=null!=b?"0"!=b:this.graph.defaultPageVisible);
-this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;var b=parseFloat(a.getAttribute("pageWidth")),f=parseFloat(a.getAttribute("pageHeight"));isNaN(b)||isNaN(f)||(this.graph.pageFormat=new mxRectangle(0,0,b,f));a=a.getAttribute("background");this.graph.background=null!=a&&0<a.length?a:null};
-Editor.prototype.setGraphXml=function(a){if(null!=a){var b=new mxCodec(a.ownerDocument);if("mxGraphModel"==a.nodeName){this.graph.model.beginUpdate();try{this.graph.model.clear(),this.graph.view.scale=1,this.readGraphState(a),this.updateGraphComponents(),b.decode(a,this.graph.getModel())}finally{this.graph.model.endUpdate()}this.fireEvent(new mxEventObject("resetGraphView"))}else if("root"==a.nodeName){this.resetGraph();var f=b.document.createElement("mxGraphModel");f.appendChild(a);b.decode(f,this.graph.getModel());
+this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;var b=parseFloat(a.getAttribute("pageWidth")),e=parseFloat(a.getAttribute("pageHeight"));isNaN(b)||isNaN(e)||(this.graph.pageFormat=new mxRectangle(0,0,b,e));a=a.getAttribute("background");this.graph.background=null!=a&&0<a.length?a:null};
+Editor.prototype.setGraphXml=function(a){if(null!=a){var b=new mxCodec(a.ownerDocument);if("mxGraphModel"==a.nodeName){this.graph.model.beginUpdate();try{this.graph.model.clear(),this.graph.view.scale=1,this.readGraphState(a),this.updateGraphComponents(),b.decode(a,this.graph.getModel())}finally{this.graph.model.endUpdate()}this.fireEvent(new mxEventObject("resetGraphView"))}else if("root"==a.nodeName){this.resetGraph();var e=b.document.createElement("mxGraphModel");e.appendChild(a);b.decode(e,this.graph.getModel());
this.updateGraphComponents();this.fireEvent(new mxEventObject("resetGraphView"))}else throw{message:mxResources.get("cannotOpenFile"),node:a,toString:function(){return this.message}};}else this.resetGraph(),this.graph.model.clear(),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":this.defaultGraphOverflow,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,b=new mxUndoManager;this.undoListener=function(a,f){b.undoableEditHappened(f.getProperty("edit"))};var f=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,f);a.getView().addListener(mxEvent.UNDO,f);f=function(b,f){var d=a.getSelectionCellsForChanges(f.getProperty("edit").changes);a.getModel();for(var l=[],x=0;x<d.length;x++)null!=a.view.getState(d[x])&&l.push(d[x]);a.setSelectionCells(l)};
-b.addListener(mxEvent.UNDO,f);b.addListener(mxEvent.REDO,f);return b};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)};
+Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(a,e){b.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(b,e){var d=a.getSelectionCellsForChanges(e.getProperty("edit").changes);a.getModel();for(var k=[],v=0;v<d.length;v++)null!=a.view.getState(d[v])&&k.push(d[v]);a.setSelectionCells(k)};
+b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);return b};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,b,f,d,l,n,t,x,A,C,c){var g=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(g=80);f+=g;d+=g;var k=f,q=d,p=mxUtils.getDocumentSize(),m=p.height,z=Math.max(1,Math.round((p.width-f-64)/2)),D=Math.max(1,Math.round((m-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");f=null!=document.body?Math.min(f,document.body.scrollWidth-64):f;d=Math.min(d,m-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=m+"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));p=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=p.x+"px";this.bg.style.top=p.y+"px";z+=p.x;D+=p.y;l&&document.body.appendChild(this.bg);var u=a.createDiv(A?"geTransDialog":"geDialog");l=this.getPosition(z,D,f,d);z=l.x;D=l.y;u.style.width=
-f+"px";u.style.height=d+"px";u.style.left=z+"px";u.style.top=D+"px";u.style.zIndex=this.zIndex;u.appendChild(b);document.body.appendChild(u);!x&&b.clientHeight>u.clientHeight-64&&(b.style.overflowY="auto");n&&(n=document.createElement("img"),n.setAttribute("src",Dialog.prototype.closeImage),n.setAttribute("title",mxResources.get("close")),n.className="geDialogClose",n.style.top=D+14+"px",n.style.left=z+f+38-g+"px",n.style.zIndex=this.zIndex,mxEvent.addListener(n,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})),
-document.body.appendChild(n),this.dialogImg=n,c||mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=C){var c=C();null!=c&&(k=f=c.w,q=d=c.h)}c=mxUtils.getDocumentSize();m=c.height;this.bg.style.height=m+"px";z=Math.max(1,Math.round((c.width-f-64)/2));D=Math.max(1,Math.round((m-d-a.footerHeight)/3));f=null!=document.body?Math.min(k,document.body.scrollWidth-64):k;d=Math.min(q,m-64);c=this.getPosition(z,
-D,f,d);z=c.x;D=c.y;u.style.left=z+"px";u.style.top=D+"px";u.style.width=f+"px";u.style.height=d+"px";!x&&b.clientHeight>u.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=D+14+"px",this.dialogImg.style.left=z+f+38-g+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=t;this.container=u;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1;
+function Dialog(a,b,e,d,k,m,p,v,B,z,c){var f=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(f=80);e+=f;d+=f;var g=e,t=d,n=mxUtils.getDocumentSize(),l=n.height,x=Math.max(1,Math.round((n.width-e-64)/2)),A=Math.max(1,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=null!=document.body?Math.min(e,document.body.scrollWidth-64):e;d=Math.min(d,l-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=l+"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));n=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=n.x+"px";this.bg.style.top=n.y+"px";x+=n.x;A+=n.y;k&&document.body.appendChild(this.bg);var q=a.createDiv(B?"geTransDialog":"geDialog");k=this.getPosition(x,A,e,d);x=k.x;A=k.y;q.style.width=
+e+"px";q.style.height=d+"px";q.style.left=x+"px";q.style.top=A+"px";q.style.zIndex=this.zIndex;q.appendChild(b);document.body.appendChild(q);!v&&b.clientHeight>q.clientHeight-64&&(b.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=A+14+"px",m.style.left=x+e+38-f+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})),
+document.body.appendChild(m),this.dialogImg=m,c||mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=z){var c=z();null!=c&&(g=e=c.w,t=d=c.h)}c=mxUtils.getDocumentSize();l=c.height;this.bg.style.height=l+"px";x=Math.max(1,Math.round((c.width-e-64)/2));A=Math.max(1,Math.round((l-d-a.footerHeight)/3));e=null!=document.body?Math.min(g,document.body.scrollWidth-64):g;d=Math.min(t,l-64);c=this.getPosition(x,
+A,e,d);x=c.x;A=c.y;q.style.left=x+"px";q.style.top=A+"px";q.style.width=e+"px";q.style.height=d+"px";!v&&b.clientHeight>q.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=A+14+"px",this.dialogImg.style.left=x+e+38-f+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=p;this.container=q;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";
Dialog.prototype.clearImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==":IMAGE_PATH+
@@ -2036,155 +2036,155 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA
"/locked.png";
Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+
"/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,b){return new mxPoint(a,b)};Dialog.prototype.close=function(a,b){if(null!=this.onDialogClose){if(0==this.onDialogClose(a,b))return!1;this.onDialogClose=null}null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)};
-var ErrorDialog=function(a,b,f,d,l,n,t,x,A,C,c){A=null!=A?A:!0;var g=document.createElement("div");g.style.textAlign="center";if(null!=b){var k=document.createElement("div");k.style.padding="0px";k.style.margin="0px";k.style.fontSize="18px";k.style.paddingBottom="16px";k.style.marginBottom="10px";k.style.borderBottom="1px solid #c0c0c0";k.style.color="gray";k.style.whiteSpace="nowrap";k.style.textOverflow="ellipsis";k.style.overflow="hidden";mxUtils.write(k,b);k.setAttribute("title",b);g.appendChild(k)}b=
-document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.innerHTML=f;g.appendChild(b);f=document.createElement("div");f.style.marginTop="12px";f.style.textAlign="center";null!=n&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();n()}),b.className="geBtn",f.appendChild(b),f.style.textAlign="center");null!=C&&(C=mxUtils.button(C,function(){null!=c&&c()}),C.className="geBtn",f.appendChild(C));var q=mxUtils.button(d,function(){A&&a.hideDialog();null!=l&&l()});
-q.className="geBtn";f.appendChild(q);null!=t&&(d=mxUtils.button(t,function(){A&&a.hideDialog();null!=x&&x()}),d.className="geBtn gePrimaryBtn",f.appendChild(d));this.init=function(){q.focus()};g.appendChild(f);this.container=g},PrintDialog=function(a,b){this.create(a,b)};
-PrintDialog.prototype.create=function(a){function b(a){var b=x.checked||C.checked,d=parseInt(g.value)/100;isNaN(d)&&(d=1,g.value="100%");var d=.75*d,k=f.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,q=1/f.pageScale;if(b){var u=x.checked?1:parseInt(c.value);isNaN(u)||(q=mxUtils.getScaleForPageCount(u,f,k))}f.getGraphBounds();var l=u=0,k=mxRectangle.fromRectangle(k);k.width=Math.ceil(k.width*d);k.height=Math.ceil(k.height*d);q*=d;!b&&f.pageVisible?(d=f.getPageLayout(),u-=d.x*k.width,l-=d.y*k.height):
-b=!0;b=PrintDialog.createPrintPreview(f,q,k,0,u,l,b);b.open();a&&PrintDialog.printPreview(b)}var f=a.editor.graph,d,l,n=document.createElement("table");n.style.width="100%";n.style.height="100%";var t=document.createElement("tbody");d=document.createElement("tr");var x=document.createElement("input");x.setAttribute("type","checkbox");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";l.appendChild(x);var A=document.createElement("span");mxUtils.write(A," "+mxResources.get("fitPage"));
-l.appendChild(A);mxEvent.addListener(A,"click",function(a){x.checked=!x.checked;C.checked=!x.checked;mxEvent.consume(a)});mxEvent.addListener(x,"change",function(){C.checked=!x.checked});d.appendChild(l);t.appendChild(d);d=d.cloneNode(!1);var C=document.createElement("input");C.setAttribute("type","checkbox");l=document.createElement("td");l.style.fontSize="10pt";l.appendChild(C);A=document.createElement("span");mxUtils.write(A," "+mxResources.get("posterPrint")+":");l.appendChild(A);mxEvent.addListener(A,
-"click",function(a){C.checked=!C.checked;x.checked=!C.checked;mxEvent.consume(a)});d.appendChild(l);var c=document.createElement("input");c.setAttribute("value","1");c.setAttribute("type","number");c.setAttribute("min","1");c.setAttribute("size","4");c.setAttribute("disabled","disabled");c.style.width="50px";l=document.createElement("td");l.style.fontSize="10pt";l.appendChild(c);mxUtils.write(l," "+mxResources.get("pages")+" (max)");d.appendChild(l);t.appendChild(d);mxEvent.addListener(C,"change",
-function(){C.checked?c.removeAttribute("disabled"):c.setAttribute("disabled","disabled");x.checked=!C.checked});d=d.cloneNode(!1);l=document.createElement("td");mxUtils.write(l,mxResources.get("pageScale")+":");d.appendChild(l);l=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";l.appendChild(g);d.appendChild(l);t.appendChild(d);d=document.createElement("tr");l=document.createElement("td");l.colSpan=2;
-l.style.paddingTop="20px";l.setAttribute("align","right");A=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});A.className="geBtn";a.editor.cancelFirst&&l.appendChild(A);if(PrintDialog.previewEnabled){var k=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});k.className="geBtn";l.appendChild(k)}k=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});k.className="geBtn gePrimaryBtn";l.appendChild(k);a.editor.cancelFirst||
-l.appendChild(A);d.appendChild(l);t.appendChild(d);n.appendChild(t);this.container=n};PrintDialog.printPreview=function(a){try{if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}}catch(f){}};
-PrintDialog.createPrintPreview=function(a,b,f,d,l,n,t){b=new mxPrintPreview(a,b,f,d,l,n);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=t;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var x=b.writeHead;b.writeHead=function(a){x.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 b};
+var ErrorDialog=function(a,b,e,d,k,m,p,v,B,z,c){B=null!=B?B:!0;var f=document.createElement("div");f.style.textAlign="center";if(null!=b){var g=document.createElement("div");g.style.padding="0px";g.style.margin="0px";g.style.fontSize="18px";g.style.paddingBottom="16px";g.style.marginBottom="10px";g.style.borderBottom="1px solid #c0c0c0";g.style.color="gray";g.style.whiteSpace="nowrap";g.style.textOverflow="ellipsis";g.style.overflow="hidden";mxUtils.write(g,b);g.setAttribute("title",b);f.appendChild(g)}b=
+document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.innerHTML=e;f.appendChild(b);e=document.createElement("div");e.style.marginTop="12px";e.style.textAlign="center";null!=m&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();m()}),b.className="geBtn",e.appendChild(b),e.style.textAlign="center");null!=z&&(z=mxUtils.button(z,function(){null!=c&&c()}),z.className="geBtn",e.appendChild(z));var t=mxUtils.button(d,function(){B&&a.hideDialog();null!=k&&k()});
+t.className="geBtn";e.appendChild(t);null!=p&&(d=mxUtils.button(p,function(){B&&a.hideDialog();null!=v&&v()}),d.className="geBtn gePrimaryBtn",e.appendChild(d));this.init=function(){t.focus()};f.appendChild(e);this.container=f},PrintDialog=function(a,b){this.create(a,b)};
+PrintDialog.prototype.create=function(a){function b(a){var b=v.checked||z.checked,d=parseInt(f.value)/100;isNaN(d)&&(d=1,f.value="100%");var d=.75*d,g=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,t=1/e.pageScale;if(b){var q=v.checked?1:parseInt(c.value);isNaN(q)||(t=mxUtils.getScaleForPageCount(q,e,g))}e.getGraphBounds();var k=q=0,g=mxRectangle.fromRectangle(g);g.width=Math.ceil(g.width*d);g.height=Math.ceil(g.height*d);t*=d;!b&&e.pageVisible?(d=e.getPageLayout(),q-=d.x*g.width,k-=d.y*g.height):
+b=!0;b=PrintDialog.createPrintPreview(e,t,g,0,q,k,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,d,k,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var v=document.createElement("input");v.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(v);var B=document.createElement("span");mxUtils.write(B," "+mxResources.get("fitPage"));
+k.appendChild(B);mxEvent.addListener(B,"click",function(a){v.checked=!v.checked;z.checked=!v.checked;mxEvent.consume(a)});mxEvent.addListener(v,"change",function(){z.checked=!v.checked});d.appendChild(k);p.appendChild(d);d=d.cloneNode(!1);var z=document.createElement("input");z.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(z);B=document.createElement("span");mxUtils.write(B," "+mxResources.get("posterPrint")+":");k.appendChild(B);mxEvent.addListener(B,
+"click",function(a){z.checked=!z.checked;v.checked=!z.checked;mxEvent.consume(a)});d.appendChild(k);var c=document.createElement("input");c.setAttribute("value","1");c.setAttribute("type","number");c.setAttribute("min","1");c.setAttribute("size","4");c.setAttribute("disabled","disabled");c.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);p.appendChild(d);mxEvent.addListener(z,"change",
+function(){z.checked?c.removeAttribute("disabled"):c.setAttribute("disabled","disabled");v.checked=!z.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var f=document.createElement("input");f.setAttribute("value","100 %");f.setAttribute("size","5");f.style.width="50px";k.appendChild(f);d.appendChild(k);p.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2;
+k.style.paddingTop="20px";k.setAttribute("align","right");B=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});B.className="geBtn";a.editor.cancelFirst&&k.appendChild(B);if(PrintDialog.previewEnabled){var g=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});g.className="geBtn";k.appendChild(g)}g=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});g.className="geBtn gePrimaryBtn";k.appendChild(g);a.editor.cancelFirst||
+k.appendChild(B);d.appendChild(k);p.appendChild(d);m.appendChild(p);this.container=m};PrintDialog.printPreview=function(a){try{if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}}catch(e){}};
+PrintDialog.createPrintPreview=function(a,b,e,d,k,m,p){b=new mxPrintPreview(a,b,e,d,k,m);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=p;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var v=b.writeHead;b.writeHead=function(a){v.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 b};
PrintDialog.previewEnabled=!0;
-var PageSetupDialog=function(a){function b(){null==c||c==mxConstants.NONE?(C.style.backgroundColor="",C.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(C.style.backgroundColor=c,C.style.backgroundImage="")}function f(){null==q?(k.removeAttribute("title"),k.style.fontSize="",k.innerHTML=mxResources.get("change")+"..."):(k.setAttribute("title",q.src),k.style.fontSize="11px",k.innerHTML=q.src.substring(0,42)+"...")}var d=a.editor.graph,l,n,t=document.createElement("table");t.style.width=
-"100%";t.style.height="100%";var x=document.createElement("tbody");l=document.createElement("tr");n=document.createElement("td");n.style.verticalAlign="top";n.style.fontSize="10pt";mxUtils.write(n,mxResources.get("paperSize")+":");l.appendChild(n);n=document.createElement("td");n.style.verticalAlign="top";n.style.fontSize="10pt";var A=PageSetupDialog.addPageFormatPanel(n,"pagesetupdialog",d.pageFormat);l.appendChild(n);x.appendChild(l);l=document.createElement("tr");n=document.createElement("td");
-mxUtils.write(n,mxResources.get("background")+":");l.appendChild(n);n=document.createElement("td");n.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 c=d.background;b();mxEvent.addListener(C,"click",function(g){a.pickColor(c||"none",function(a){c=a;b()});mxEvent.consume(g)});
-n.appendChild(C);mxUtils.write(n,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=d.getGridSize();n.appendChild(g);mxEvent.addListener(g,"change",function(){var a=parseInt(g.value);g.value=Math.max(1,isNaN(a)?d.getGridSize():a)});l.appendChild(n);x.appendChild(l);l=document.createElement("tr");n=document.createElement("td");mxUtils.write(n,mxResources.get("image")+
-":");l.appendChild(n);n=document.createElement("td");var k=document.createElement("a");k.style.textDecoration="underline";k.style.cursor="pointer";k.style.color="#a0a0a0";var q=d.backgroundImage;mxEvent.addListener(k,"click",function(c){a.showBackgroundImageDialog(function(a){q=a;f()});mxEvent.consume(c)});f();n.appendChild(k);l.appendChild(n);x.appendChild(l);l=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.paddingTop="16px";n.setAttribute("align","right");var p=
-mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});p.className="geBtn";a.editor.cancelFirst&&n.appendChild(p);var m=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==g.value&&d.setGridSize(parseInt(g.value));var b=new ChangePageSetup(a,c,q,A.get());b.ignoreColor=d.background==c;b.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=q?q.src:null);d.pageFormat.width==b.previousFormat.width&&d.pageFormat.height==b.previousFormat.height&&
-b.ignoreColor&&b.ignoreImage||d.model.execute(b)});m.className="geBtn gePrimaryBtn";n.appendChild(m);a.editor.cancelFirst||n.appendChild(p);l.appendChild(n);x.appendChild(l);t.appendChild(x);this.container=t};
-PageSetupDialog.addPageFormatPanel=function(a,b,f,d){function l(a,b,d){if(d||g!=document.activeElement&&k!=document.activeElement){a=!1;for(b=0;b<p.length;b++)d=p[b],u?"custom"==d.key&&(x.value=d.key,u=!1):null!=d.format&&("a4"==d.key?826==f.width?(f=mxRectangle.fromRectangle(f),f.width=827):826==f.height&&(f=mxRectangle.fromRectangle(f),f.height=827):"a5"==d.key&&(584==f.width?(f=mxRectangle.fromRectangle(f),f.width=583):584==f.height&&(f=mxRectangle.fromRectangle(f),f.height=583)),f.width==d.format.width&&
-f.height==d.format.height?(x.value=d.key,n.setAttribute("checked","checked"),n.defaultChecked=!0,n.checked=!0,t.removeAttribute("checked"),t.defaultChecked=!1,t.checked=!1,a=!0):f.width==d.format.height&&f.height==d.format.width&&(x.value=d.key,n.removeAttribute("checked"),n.defaultChecked=!1,n.checked=!1,t.setAttribute("checked","checked"),t.defaultChecked=!0,a=t.checked=!0));a?(A.style.display="",c.style.display="none"):(g.value=f.width/100,k.value=f.height/100,n.setAttribute("checked","checked"),
-x.value="custom",A.style.display="none",c.style.display="")}}b="format-"+b;var n=document.createElement("input");n.setAttribute("name",b);n.setAttribute("type","radio");n.setAttribute("value","portrait");var t=document.createElement("input");t.setAttribute("name",b);t.setAttribute("type","radio");t.setAttribute("value","landscape");var x=document.createElement("select");x.style.marginBottom="8px";x.style.width="202px";var A=document.createElement("div");A.style.marginLeft="4px";A.style.width="210px";
-A.style.height="24px";n.style.marginRight="6px";A.appendChild(n);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));A.appendChild(b);t.style.marginLeft="10px";t.style.marginRight="6px";A.appendChild(t);var C=document.createElement("span");C.style.width="100px";mxUtils.write(C,mxResources.get("landscape"));A.appendChild(C);var c=document.createElement("div");c.style.marginLeft="4px";c.style.width="210px";c.style.height="24px";var g=document.createElement("input");
-g.setAttribute("size","7");g.style.textAlign="right";c.appendChild(g);mxUtils.write(c," in x ");var k=document.createElement("input");k.setAttribute("size","7");k.style.textAlign="right";c.appendChild(k);mxUtils.write(c," in");A.style.display="none";c.style.display="none";for(var q={},p=PageSetupDialog.getFormats(),m=0;m<p.length;m++){var z=p[m];q[z.key]=z;var D=document.createElement("option");D.setAttribute("value",z.key);mxUtils.write(D,z.title);x.appendChild(D)}var u=!1;l();a.appendChild(x);mxUtils.br(a);
-a.appendChild(A);a.appendChild(c);var F=f,y=function(a,b){var m=q[x.value];null!=m.format?(g.value=m.format.width/100,k.value=m.format.height/100,c.style.display="none",A.style.display=""):(A.style.display="none",c.style.display="");m=parseFloat(g.value);if(isNaN(m)||0>=m)g.value=f.width/100;m=parseFloat(k.value);if(isNaN(m)||0>=m)k.value=f.height/100;m=new mxRectangle(0,0,Math.floor(100*parseFloat(g.value)),Math.floor(100*parseFloat(k.value)));"custom"!=x.value&&t.checked&&(m=new mxRectangle(0,0,
-m.height,m.width));b&&u||m.width==F.width&&m.height==F.height||(F=m,null!=d&&d(F))};mxEvent.addListener(b,"click",function(a){n.checked=!0;y(a);mxEvent.consume(a)});mxEvent.addListener(C,"click",function(a){t.checked=!0;y(a);mxEvent.consume(a)});mxEvent.addListener(g,"blur",y);mxEvent.addListener(g,"click",y);mxEvent.addListener(k,"blur",y);mxEvent.addListener(k,"click",y);mxEvent.addListener(t,"change",y);mxEvent.addListener(n,"change",y);mxEvent.addListener(x,"change",function(a){u="custom"==x.value;
-y(a,!0)});y();return{set:function(a){f=a;l(null,null,!0)},get:function(){return F},widthInput:g,heightInput:k}};
+var PageSetupDialog=function(a){function b(){null==c||c==mxConstants.NONE?(z.style.backgroundColor="",z.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(z.style.backgroundColor=c,z.style.backgroundImage="")}function e(){null==t?(g.removeAttribute("title"),g.style.fontSize="",g.innerHTML=mxResources.get("change")+"..."):(g.setAttribute("title",t.src),g.style.fontSize="11px",g.innerHTML=t.src.substring(0,42)+"...")}var d=a.editor.graph,k,m,p=document.createElement("table");p.style.width=
+"100%";p.style.height="100%";var v=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 B=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",d.pageFormat);k.appendChild(m);v.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 z=document.createElement("button");z.style.width="18px";z.style.height="18px";z.style.marginRight="20px";z.style.backgroundPosition="center center";z.style.backgroundRepeat="no-repeat";var c=d.background;b();mxEvent.addListener(z,"click",function(f){a.pickColor(c||"none",function(a){c=a;b()});mxEvent.consume(f)});
+m.appendChild(z);mxUtils.write(m,mxResources.get("gridSize")+":");var f=document.createElement("input");f.setAttribute("type","number");f.setAttribute("min","0");f.style.width="40px";f.style.marginLeft="6px";f.value=d.getGridSize();m.appendChild(f);mxEvent.addListener(f,"change",function(){var a=parseInt(f.value);f.value=Math.max(1,isNaN(a)?d.getGridSize():a)});k.appendChild(m);v.appendChild(k);k=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+
+":");k.appendChild(m);m=document.createElement("td");var g=document.createElement("a");g.style.textDecoration="underline";g.style.cursor="pointer";g.style.color="#a0a0a0";var t=d.backgroundImage;mxEvent.addListener(g,"click",function(c){a.showBackgroundImageDialog(function(a){t=a;e()});mxEvent.consume(c)});e();m.appendChild(g);k.appendChild(m);v.appendChild(k);k=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var n=
+mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&m.appendChild(n);var l=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==f.value&&d.setGridSize(parseInt(f.value));var b=new ChangePageSetup(a,c,t,B.get());b.ignoreColor=d.background==c;b.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=t?t.src:null);d.pageFormat.width==b.previousFormat.width&&d.pageFormat.height==b.previousFormat.height&&
+b.ignoreColor&&b.ignoreImage||d.model.execute(b)});l.className="geBtn gePrimaryBtn";m.appendChild(l);a.editor.cancelFirst||m.appendChild(n);k.appendChild(m);v.appendChild(k);p.appendChild(v);this.container=p};
+PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,b,d){if(d||f!=document.activeElement&&g!=document.activeElement){a=!1;for(b=0;b<n.length;b++)d=n[b],q?"custom"==d.key&&(v.value=d.key,q=!1):null!=d.format&&("a4"==d.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==d.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==d.format.width&&
+e.height==d.format.height?(v.value=d.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==d.format.height&&e.height==d.format.width&&(v.value=d.key,m.removeAttribute("checked"),m.defaultChecked=!1,m.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(B.style.display="",c.style.display="none"):(f.value=e.width/100,g.value=e.height/100,m.setAttribute("checked","checked"),
+v.value="custom",B.style.display="none",c.style.display="")}}b="format-"+b;var m=document.createElement("input");m.setAttribute("name",b);m.setAttribute("type","radio");m.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",b);p.setAttribute("type","radio");p.setAttribute("value","landscape");var v=document.createElement("select");v.style.marginBottom="8px";v.style.width="202px";var B=document.createElement("div");B.style.marginLeft="4px";B.style.width="210px";
+B.style.height="24px";m.style.marginRight="6px";B.appendChild(m);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));B.appendChild(b);p.style.marginLeft="10px";p.style.marginRight="6px";B.appendChild(p);var z=document.createElement("span");z.style.width="100px";mxUtils.write(z,mxResources.get("landscape"));B.appendChild(z);var c=document.createElement("div");c.style.marginLeft="4px";c.style.width="210px";c.style.height="24px";var f=document.createElement("input");
+f.setAttribute("size","7");f.style.textAlign="right";c.appendChild(f);mxUtils.write(c," in x ");var g=document.createElement("input");g.setAttribute("size","7");g.style.textAlign="right";c.appendChild(g);mxUtils.write(c," in");B.style.display="none";c.style.display="none";for(var t={},n=PageSetupDialog.getFormats(),l=0;l<n.length;l++){var x=n[l];t[x.key]=x;var A=document.createElement("option");A.setAttribute("value",x.key);mxUtils.write(A,x.title);v.appendChild(A)}var q=!1;k();a.appendChild(v);mxUtils.br(a);
+a.appendChild(B);a.appendChild(c);var F=e,y=function(a,b){var l=t[v.value];null!=l.format?(f.value=l.format.width/100,g.value=l.format.height/100,c.style.display="none",B.style.display=""):(B.style.display="none",c.style.display="");l=parseFloat(f.value);if(isNaN(l)||0>=l)f.value=e.width/100;l=parseFloat(g.value);if(isNaN(l)||0>=l)g.value=e.height/100;l=new mxRectangle(0,0,Math.floor(100*parseFloat(f.value)),Math.floor(100*parseFloat(g.value)));"custom"!=v.value&&p.checked&&(l=new mxRectangle(0,0,
+l.height,l.width));b&&q||l.width==F.width&&l.height==F.height||(F=l,null!=d&&d(F))};mxEvent.addListener(b,"click",function(a){m.checked=!0;y(a);mxEvent.consume(a)});mxEvent.addListener(z,"click",function(a){p.checked=!0;y(a);mxEvent.consume(a)});mxEvent.addListener(f,"blur",y);mxEvent.addListener(f,"click",y);mxEvent.addListener(g,"blur",y);mxEvent.addListener(g,"click",y);mxEvent.addListener(p,"change",y);mxEvent.addListener(m,"change",y);mxEvent.addListener(v,"change",function(a){q="custom"==v.value;
+y(a,!0)});y();return{set:function(a){e=a;k(null,null,!0)},get:function(){return F},widthInput:f,heightInput:g}};
PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",
format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},
{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,1600,900)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1920,1200)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1600,1200)},{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 d=a.container.firstChild;null!=d&&d.nodeType!=mxConstants.NODETYPE_ELEMENT;)d=d.nextSibling;null!=d&&(this.backgroundPageShape=this.createBackgroundPageShape(b),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect=
mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(a.container),d.style.position="absolute",a.container.insertBefore(this.backgroundPageShape.node,d),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(c){a.dblClick(c)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),
mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();a.isMouseDown&&!mxEvent.isConsumed(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=b,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=
-null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,d=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",c="none",g="";if(a.isGridEnabled()){g=10;mxClient.IS_SVG?(c=unescape(encodeURIComponent(this.createSvgGrid(d))),c=window.btoa?btoa(c):Base64.encode(c,!0),c="url(data:image/svg+xml;base64,"+c+")",g=a.gridSize*this.scale*this.gridSteps):
-c="url("+this.gridImage+")";var k=d=0;null!=a.view.backgroundPageShape&&(k=this.getBackgroundPageBounds(),d=1+k.x,k=1+k.y);g=-Math.round(g-mxUtils.mod(this.translate.x*this.scale-d,g))+"px "+-Math.round(g-mxUtils.mod(this.translate.y*this.scale-k,g))+"px"}d=a.view.canvas;null!=d.ownerSVGElement&&(d=d.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=g,a.view.backgroundPageShape.node.style.backgroundImage=c,a.view.backgroundPageShape.node.style.backgroundColor=
-b,a.container.className="geDiagramContainer geDiagramBackdrop",d.style.backgroundImage="none",d.style.backgroundColor=""):(a.container.className="geDiagramContainer",d.style.backgroundPosition=g,d.style.backgroundColor=b,d.style.backgroundImage=c)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var d=this.gridSteps*b,c=[],g=1;g<this.gridSteps;g++){var k=g*b;c.push("M 0 "+k+" L "+d+" "+k+" M "+k+" 0 L "+k+" "+d)}return'<svg width="'+
-d+'" height="'+d+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+d+'" height="'+d+'" patternUnits="userSpaceOnUse"><path d="'+c.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+d+" 0 L 0 0 0 "+d+'" 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 f=
-this.view.canvas;null!=f.ownerSVGElement&&(f=f.ownerSVGElement);var c=this.gridSize*this.view.scale*this.view.gridSteps,c=-Math.round(c-mxUtils.mod(this.view.translate.x*this.view.scale+b,c))+"px "+-Math.round(c-mxUtils.mod(this.view.translate.y*this.view.scale+d,c))+"px";f.style.backgroundPosition=c}};mxGraph.prototype.updatePageBreaks=function(a,b,d){var c=this.view.scale,g=this.view.translate,k=this.pageFormat,f=c*this.pageScale,p=this.view.getBackgroundPageBounds();b=p.width;d=p.height;var m=
-new mxRectangle(c*g.x,c*g.y,k.width*f,k.height*f),z=(a=a&&Math.min(m.width,m.height)>this.minPageBreakDist)?Math.ceil(d/m.height)-1:0,D=a?Math.ceil(b/m.width)-1:0,u=p.x+b,l=p.y+d;null==this.horizontalPageBreaks&&0<z&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<D&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?z:D,g=0;g<=c;g++){var b=a==this.horizontalPageBreaks?[new mxPoint(Math.round(p.x),Math.round(p.y+(g+1)*m.height)),
-new mxPoint(Math.round(u),Math.round(p.y+(g+1)*m.height))]:[new mxPoint(Math.round(p.x+(g+1)*m.width),Math.round(p.y)),new mxPoint(Math.round(p.x+(g+1)*m.width),Math.round(l))];null!=a[g]?(a[g].points=b,a[g].redraw()):(b=new mxPolyline(b,this.pageBreakColor),b.dialect=this.dialect,b.isDashed=this.pageBreakDashed,b.pointerEvents=!1,b.init(this.view.backgroundPane),b.redraw(),a[g]=b)}for(g=c;g<a.length;g++)a[g].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
-var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,f){for(var c=0;c<d.length;c++)if(this.graph.getModel().isVertex(d[c])){var g=this.graph.getCellGeometry(d[c]);if(null!=g&&g.relative)return!1}return b.apply(this,arguments)};var f=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=f.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,d){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,d=0<a.height?a.y/this.scale-this.translate.y:0,c=this.graph.pageFormat,g=this.graph.pageScale,k=c.width*g,c=c.height*g,g=Math.floor(Math.min(0,b)/k),f=Math.floor(Math.min(0,
-d)/c);return new mxRectangle(this.scale*(this.translate.x+g*k),this.scale*(this.translate.y+f*c),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/k)-g)*k,this.scale*(Math.ceil(Math.max(1,d+a.height/this.scale)/c)-f)*c)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.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=b+"px")};var l=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,d,c,g,k){var f=l.apply(this,arguments);null==k||k||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var n=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),d=b.getParent(this.graph.getSelectionCell()),c=n.apply(this,arguments),g=b.getParent(c);
-if(null==d||d!=c&&d!=g)for(;!this.graph.isCellSelected(c)&&!this.graph.isCellSelected(g)&&b.isVertex(g)&&!this.graph.isContainer(g);)c=g,g=this.graph.getModel().getParent(c);return c};var t=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var d=t.apply(this,arguments);if(!d)for(var c=this.graph.getModel(),g=c.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&c.isVertex(g)){d=!0;break}g=c.getParent(g)}return d};mxGraphHandler.prototype.selectDelayed=
+null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,d=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",c="none",f="";if(a.isGridEnabled()){f=10;mxClient.IS_SVG?(c=unescape(encodeURIComponent(this.createSvgGrid(d))),c=window.btoa?btoa(c):Base64.encode(c,!0),c="url(data:image/svg+xml;base64,"+c+")",f=a.gridSize*this.scale*this.gridSteps):
+c="url("+this.gridImage+")";var g=d=0;null!=a.view.backgroundPageShape&&(g=this.getBackgroundPageBounds(),d=1+g.x,g=1+g.y);f=-Math.round(f-mxUtils.mod(this.translate.x*this.scale-d,f))+"px "+-Math.round(f-mxUtils.mod(this.translate.y*this.scale-g,f))+"px"}d=a.view.canvas;null!=d.ownerSVGElement&&(d=d.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=f,a.view.backgroundPageShape.node.style.backgroundImage=c,a.view.backgroundPageShape.node.style.backgroundColor=
+b,a.container.className="geDiagramContainer geDiagramBackdrop",d.style.backgroundImage="none",d.style.backgroundColor=""):(a.container.className="geDiagramContainer",d.style.backgroundPosition=f,d.style.backgroundColor=b,d.style.backgroundImage=c)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var d=this.gridSteps*b,c=[],f=1;f<this.gridSteps;f++){var g=f*b;c.push("M 0 "+g+" L "+d+" "+g+" M "+g+" 0 L "+g+" "+d)}return'<svg width="'+
+d+'" height="'+d+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+d+'" height="'+d+'" patternUnits="userSpaceOnUse"><path d="'+c.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+d+" 0 L 0 0 0 "+d+'" 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 e=
+this.view.canvas;null!=e.ownerSVGElement&&(e=e.ownerSVGElement);var c=this.gridSize*this.view.scale*this.view.gridSteps,c=-Math.round(c-mxUtils.mod(this.view.translate.x*this.view.scale+b,c))+"px "+-Math.round(c-mxUtils.mod(this.view.translate.y*this.view.scale+d,c))+"px";e.style.backgroundPosition=c}};mxGraph.prototype.updatePageBreaks=function(a,b,d){var c=this.view.scale,f=this.view.translate,g=this.pageFormat,e=c*this.pageScale,n=this.view.getBackgroundPageBounds();b=n.width;d=n.height;var l=
+new mxRectangle(c*f.x,c*f.y,g.width*e,g.height*e),x=(a=a&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(d/l.height)-1:0,A=a?Math.ceil(b/l.width)-1:0,q=n.x+b,k=n.y+d;null==this.horizontalPageBreaks&&0<x&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<A&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?x:A,f=0;f<=c;f++){var b=a==this.horizontalPageBreaks?[new mxPoint(Math.round(n.x),Math.round(n.y+(f+1)*l.height)),
+new mxPoint(Math.round(q),Math.round(n.y+(f+1)*l.height))]:[new mxPoint(Math.round(n.x+(f+1)*l.width),Math.round(n.y)),new mxPoint(Math.round(n.x+(f+1)*l.width),Math.round(k))];null!=a[f]?(a[f].points=b,a[f].redraw()):(b=new mxPolyline(b,this.pageBreakColor),b.dialect=this.dialect,b.isDashed=this.pageBreakDashed,b.pointerEvents=!1,b.init(this.view.backgroundPane),b.redraw(),a[f]=b)}for(f=c;f<a.length;f++)a[f].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
+var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,e){for(var c=0;c<d.length;c++)if(this.graph.getModel().isVertex(d[c])){var f=this.graph.getCellGeometry(d[c]);if(null!=f&&f.relative)return!1}return b.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,d){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,d=0<a.height?a.y/this.scale-this.translate.y:0,c=this.graph.pageFormat,f=this.graph.pageScale,g=c.width*f,c=c.height*f,f=Math.floor(Math.min(0,b)/g),e=Math.floor(Math.min(0,
+d)/c);return new mxRectangle(this.scale*(this.translate.x+f*g),this.scale*(this.translate.y+e*c),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/g)-f)*g,this.scale*(Math.ceil(Math.max(1,d+a.height/this.scale)/c)-e)*c)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.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=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,d,c,f,g){var e=k.apply(this,arguments);null==g||g||mxEvent.addListener(e,"mousedown",function(a){mxEvent.consume(a)});return e};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),d=b.getParent(this.graph.getSelectionCell()),c=m.apply(this,arguments),f=b.getParent(c);
+if(null==d||d!=c&&d!=f)for(;!this.graph.isCellSelected(c)&&!this.graph.isCellSelected(f)&&b.isVertex(f)&&!this.graph.isContainer(f);)c=f,f=this.graph.getModel().getParent(c);return c};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var d=p.apply(this,arguments);if(!d)for(var c=this.graph.getModel(),f=c.getParent(a);null!=f;){if(this.graph.isCellSelected(f)&&c.isVertex(f)){d=!0;break}f=c.getParent(f)}return d};mxGraphHandler.prototype.selectDelayed=
function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var d=this.graph.view.getState(b);if(null==d||!a.isSource(d.control))for(var d=this.graph.getModel(),c=d.getParent(b);!this.graph.isCellSelected(c)&&d.isVertex(c);)b=c,c=d.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),d=b.getParent(a);b.isVertex(d)&&!this.graph.isContainer(d);)this.graph.isCellSelected(d)&&
-(a=d),d=b.getParent(d);return a}})();EditorUi=function(a,b,f){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var d=this.editor.graph;d.lightbox=f;d.useCssTransforms&&(this.lazyZoomDelay=0);mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);
-this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,d.isEnabled=function(){return!1},d.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();if(!d.standalone){this.createDivs();this.createUi();this.refresh();var l=mxUtils.bind(this,function(a){null==a&&(a=window.event);return d.isEditing()||null!=a&&this.isSelectionAllowed(a)});this.container==document.body&&(this.menubarContainer.onselectstart=
-l,this.menubarContainer.onmousedown=l,this.toolbarContainer.onselectstart=l,this.toolbarContainer.onmousedown=l,this.diagramContainer.onselectstart=l,this.diagramContainer.onmousedown=l,this.sidebarContainer.onselectstart=l,this.sidebarContainer.onmousedown=l,this.formatContainer.onselectstart=l,this.formatContainer.onmousedown=l,this.footerContainer.onselectstart=l,this.footerContainer.onmousedown=l,null!=this.tabContainer&&(this.tabContainer.onselectstart=l));!this.editor.chromeless||this.editor.editable?
-(b=function(a){if(null!=a){var c=mxEvent.getSource(a);if("A"==c.nodeName)for(;null!=c;){if("geHint"==c.className)return!0;c=c.parentNode}}return l(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",b):this.diagramContainer.oncontextmenu=b):d.panningHandler.usePopupTrigger=!1;d.init(this.diagramContainer);mxClient.IS_SVG&&null!=d.view.getDrawPane()&&(b=d.view.getDrawPane().ownerSVGElement,null!=b&&(b.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 n=!1,t=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=
-function(a,c){return n||t.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32==a.which?(n=!0,this.hoverIcons.reset(),d.container.style.cursor="move",d.isEditing()||mxEvent.getSource(a)!=d.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog(null,!0)});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){d.container.style.cursor="";n=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);
-var x=d.panningHandler.isForcePanningEvent;d.panningHandler.isForcePanningEvent=function(a){return x.apply(this,arguments)||n||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var A=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return A.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,c=null,g=null,k=null,q=mxUtils.bind(this,function(){if(null!=this.toolbar&&C!=d.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,b=[];null!=a;){var f=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=f}a=this.toolbar.fontMenu;f=this.toolbar.sizeMenu;if(null==k)this.toolbar.createTextToolbar();else{for(var m=0;m<k.length;m++)this.toolbar.container.appendChild(k[m]);
-this.toolbar.fontMenu=c;this.toolbar.sizeMenu=g}C=d.cellEditor.isContentEditing();c=a;g=f;k=b}}),p=this,m=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){m.apply(this,arguments);q();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=p.toolbar)){var g=c.fontFamily;"'"==g.charAt(0)&&(g=
-g.substring(1));"'"==g.charAt(g.length-1)&&(g=g.substring(0,g.length-1));p.toolbar.setFontName(g);p.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var z=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){z.apply(this,arguments);q()};d.container.setAttribute("tabindex",
-"0");d.container.style.cursor="default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(O){}var D=d.fireMouseEvent;d.fireMouseEvent=function(a,c,g){a==mxEvent.MOUSE_DOWN&&this.container.focus();D.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,g){this.menus.createPopupMenu(a,c,g)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));
-this.keyHandler=this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var u="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),F="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){try{var c=d.view.getState(a);if(null!=c){var g=a.clone();g.style="";var b=d.getCellStyle(g);a=[];var g=[],k;for(k in c.style)b[k]!=c.style[k]&&(a.push(c.style[k]),g.push(k));for(var f=d.getModel().getStyle(c.cell),m=
-null!=f?f.split(";"):[],f=0;f<m.length;f++){var v=m[f],p=v.indexOf("=");if(0<=p){k=v.substring(0,p);var q=v.substring(p+1);null!=b[k]&&"none"==q&&(a.push(q),g.push(k))}}d.getModel().isEdge(c.cell)?d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",g,"values",a,"cells",[c.cell]))}}catch(H){this.handleError(H)}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);
-this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var y=["fontFamily","fontSize","fontColor"],G="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),v=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],y,["opacity"],["align"],["html"]];for(a=0;a<v.length;a++)for(b=0;b<v[a].length;b++)u.push(v[a][b]);for(a=0;a<F.length;a++)0>
-mxUtils.indexOf(u,F[a])&&u.push(F[a]);var B=function(a,c){var g=d.getModel();g.beginUpdate();try{if(c)for(var b=g.isEdge(p),k=b?d.currentEdgeStyle:d.currentVertexStyle,b=["fontSize","fontFamily","fontColor"],f=0;f<b.length;f++){var m=k[b[f]];null!=m&&d.setCellStyles(b[f],m,a)}else for(m=0;m<a.length;m++){for(var p=a[m],q=g.getStyle(p),B=null!=q?q.split(";"):[],z=u.slice(),f=0;f<B.length;f++){var l=B[f],D=l.indexOf("=");if(0<=D){var y=l.substring(0,D),ba=mxUtils.indexOf(z,y);0<=ba&&z.splice(ba,1);
-for(var O=0;O<v.length;O++){var n=v[O];if(0<=mxUtils.indexOf(n,y))for(var x=0;x<n.length;x++){var Z=mxUtils.indexOf(z,n[x]);0<=Z&&z.splice(Z,1)}}}}for(var k=(b=g.isEdge(p))?d.currentEdgeStyle:d.currentVertexStyle,t=g.getStyle(p),f=0;f<z.length;f++){var y=z[f],G=k[y];null==G||"shape"==y&&!b||b&&!(0>mxUtils.indexOf(F,y))||(t=mxUtils.setStyle(t,y,G))}g.setStyle(p,t)}}finally{g.endUpdate()}};d.addListener("cellsInserted",function(a,c){B(c.getProperty("cells"))});d.addListener("textInserted",function(a,
-c){B(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var g=[c.getProperty("cell")];c.getProperty("terminalInserted")&&g.push(c.getProperty("terminal"));B(g)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var g=c.getProperty("cells"),b=!1,k=!1;if(0<g.length)for(var f=0;f<g.length&&(b=d.getModel().isVertex(g[f])||b,!(k=d.getModel().isEdge(g[f])||k)||!b);f++);else k=b=!0;for(var g=c.getProperty("keys"),m=c.getProperty("values"),f=0;f<g.length;f++){var v=
-0<=mxUtils.indexOf(y,g[f]);if("strokeColor"!=g[f]||null!=m[f]&&"none"!=m[f])if(0<=mxUtils.indexOf(F,g[f]))k||0<=mxUtils.indexOf(G,g[f])?null==m[f]?delete d.currentEdgeStyle[g[f]]:d.currentEdgeStyle[g[f]]=m[f]:b&&0<=mxUtils.indexOf(u,g[f])&&(null==m[f]?delete d.currentVertexStyle[g[f]]:d.currentVertexStyle[g[f]]=m[f]);else if(0<=mxUtils.indexOf(u,g[f])){if(b||v)null==m[f]?delete d.currentVertexStyle[g[f]]:d.currentVertexStyle[g[f]]=m[f];if(k||v||0<=mxUtils.indexOf(G,g[f]))null==m[f]?delete d.currentEdgeStyle[g[f]]:
-d.currentEdgeStyle[g[f]]=m[f]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==d.currentEdgeStyle.edgeStyle&&"1"==d.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==d.currentEdgeStyle.edgeStyle||"none"==d.currentEdgeStyle.edgeStyle||
+(a=d),d=b.getParent(d);return a}})();EditorUi=function(a,b,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var d=this.editor.graph;d.lightbox=e;d.useCssTransforms&&(this.lazyZoomDelay=0);mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);
+this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,d.isEnabled=function(){return!1},d.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();if(!d.standalone){this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return d.isEditing()||null!=a&&this.isSelectionAllowed(a)});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?
+(b=function(a){if(null!=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",b):this.diagramContainer.oncontextmenu=b):d.panningHandler.usePopupTrigger=!1;d.init(this.diagramContainer);mxClient.IS_SVG&&null!=d.view.getDrawPane()&&(b=d.view.getDrawPane().ownerSVGElement,null!=b&&(b.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(),d.container.style.cursor="move",d.isEditing()||mxEvent.getSource(a)!=d.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog(null,!0)});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){d.container.style.cursor="";m=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);
+var v=d.panningHandler.isForcePanningEvent;d.panningHandler.isForcePanningEvent=function(a){return v.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 B=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return B.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 z=!1,c=null,f=null,g=null,t=mxUtils.bind(this,function(){if(null!=this.toolbar&&z!=d.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,b=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==g)this.toolbar.createTextToolbar();else{for(var l=0;l<g.length;l++)this.toolbar.container.appendChild(g[l]);
+this.toolbar.fontMenu=c;this.toolbar.sizeMenu=f}z=d.cellEditor.isContentEditing();c=a;f=e;g=b}}),n=this,l=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){l.apply(this,arguments);t();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=n.toolbar)){var f=c.fontFamily;"'"==f.charAt(0)&&(f=
+f.substring(1));"'"==f.charAt(f.length-1)&&(f=f.substring(0,f.length-1));n.toolbar.setFontName(f);n.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var x=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){x.apply(this,arguments);t()};d.container.setAttribute("tabindex",
+"0");d.container.style.cursor="default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(K){}var A=d.fireMouseEvent;d.fireMouseEvent=function(a,c,f){a==mxEvent.MOUSE_DOWN&&this.container.focus();A.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,f){this.menus.createPopupMenu(a,c,f)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));
+this.keyHandler=this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var q="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),F="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){try{var c=d.view.getState(a);if(null!=c){var f=a.clone();f.style="";var b=d.getCellStyle(f);a=[];var f=[],g;for(g in c.style)b[g]!=c.style[g]&&(a.push(c.style[g]),f.push(g));for(var e=d.getModel().getStyle(c.cell),l=
+null!=e?e.split(";"):[],e=0;e<l.length;e++){var u=l[e],n=u.indexOf("=");if(0<=n){g=u.substring(0,n);var t=u.substring(n+1);null!=b[g]&&"none"==t&&(a.push(t),f.push(g))}}d.getModel().isEdge(c.cell)?d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",a,"cells",[c.cell]))}}catch(G){this.handleError(G)}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);
+this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var y=["fontFamily","fontSize","fontColor"],E="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),u=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],y,["opacity"],["align"],["html"]];for(a=0;a<u.length;a++)for(b=0;b<u[a].length;b++)q.push(u[a][b]);for(a=0;a<F.length;a++)0>
+mxUtils.indexOf(q,F[a])&&q.push(F[a]);var C=function(a,c){var f=d.getModel();f.beginUpdate();try{if(c)for(var b=f.isEdge(n),g=b?d.currentEdgeStyle:d.currentVertexStyle,b=["fontSize","fontFamily","fontColor"],e=0;e<b.length;e++){var l=g[b[e]];null!=l&&d.setCellStyles(b[e],l,a)}else for(l=0;l<a.length;l++){for(var n=a[l],t=f.getStyle(n),C=null!=t?t.split(";"):[],x=q.slice(),e=0;e<C.length;e++){var y=C[e],A=y.indexOf("=");if(0<=A){var k=y.substring(0,A),ca=mxUtils.indexOf(x,k);0<=ca&&x.splice(ca,1);
+for(var K=0;K<u.length;K++){var m=u[K];if(0<=mxUtils.indexOf(m,k))for(var v=0;v<m.length;v++){var Y=mxUtils.indexOf(x,m[v]);0<=Y&&x.splice(Y,1)}}}}for(var g=(b=f.isEdge(n))?d.currentEdgeStyle:d.currentVertexStyle,p=f.getStyle(n),e=0;e<x.length;e++){var k=x[e],E=g[k];null==E||"shape"==k&&!b||b&&!(0>mxUtils.indexOf(F,k))||(p=mxUtils.setStyle(p,k,E))}f.setStyle(n,p)}}finally{f.endUpdate()}};d.addListener("cellsInserted",function(a,c){C(c.getProperty("cells"))});d.addListener("textInserted",function(a,
+c){C(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var f=[c.getProperty("cell")];c.getProperty("terminalInserted")&&f.push(c.getProperty("terminal"));C(f)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var f=c.getProperty("cells"),b=!1,g=!1;if(0<f.length)for(var e=0;e<f.length&&(b=d.getModel().isVertex(f[e])||b,!(g=d.getModel().isEdge(f[e])||g)||!b);e++);else g=b=!0;for(var f=c.getProperty("keys"),l=c.getProperty("values"),e=0;e<f.length;e++){var u=
+0<=mxUtils.indexOf(y,f[e]);if("strokeColor"!=f[e]||null!=l[e]&&"none"!=l[e])if(0<=mxUtils.indexOf(F,f[e]))g||0<=mxUtils.indexOf(E,f[e])?null==l[e]?delete d.currentEdgeStyle[f[e]]:d.currentEdgeStyle[f[e]]=l[e]:b&&0<=mxUtils.indexOf(q,f[e])&&(null==l[e]?delete d.currentVertexStyle[f[e]]:d.currentVertexStyle[f[e]]=l[e]);else if(0<=mxUtils.indexOf(q,f[e])){if(b||u)null==l[e]?delete d.currentVertexStyle[f[e]]:d.currentVertexStyle[f[e]]=l[e];if(g||u||0<=mxUtils.indexOf(E,f[e]))null==l[e]?delete d.currentEdgeStyle[f[e]]:
+d.currentEdgeStyle[f[e]]=l[e]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==d.currentEdgeStyle.edgeStyle&&"1"==d.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==d.currentEdgeStyle.edgeStyle||"none"==d.currentEdgeStyle.edgeStyle||
null==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&
(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==d.currentEdgeStyle.shape?"geSprite geSprite-linkedge":"flexArrow"==d.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==d.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_STARTARROW],
-mxUtils.getValue(d.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("end",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_ENDARROW],mxUtils.getValue(d.currentEdgeStyle,"endFill","1"))))}));null!=this.toolbar&&(a=mxUtils.bind(this,function(){var a=d.currentVertexStyle.fontFamily||"Helvetica",c=String(d.currentVertexStyle.fontSize||"12"),g=d.getView().getState(d.getSelectionCell());
-null!=g&&(a=g.style[mxConstants.STYLE_FONTFAMILY]||a,c=g.style[mxConstants.STYLE_FONTSIZE]||c,10<a.length&&(a=a.substring(0,8)+"..."));this.toolbar.setFontName(a);this.toolbar.setFontSize(c)}),d.getSelectionModel().addListener(mxEvent.CHANGE,a),d.getModel().addListener(mxEvent.CHANGE,a));d.addListener(mxEvent.CELLS_ADDED,function(a,c){var g=c.getProperty("cells"),b=c.getProperty("parent");d.getModel().isLayer(b)&&!d.isCellVisible(b)&&null!=g&&0<g.length&&d.getModel().setVisible(b,!0)});this.gestureHandler=
+mxUtils.getValue(d.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("end",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_ENDARROW],mxUtils.getValue(d.currentEdgeStyle,"endFill","1"))))}));null!=this.toolbar&&(a=mxUtils.bind(this,function(){var a=d.currentVertexStyle.fontFamily||"Helvetica",c=String(d.currentVertexStyle.fontSize||"12"),f=d.getView().getState(d.getSelectionCell());
+null!=f&&(a=f.style[mxConstants.STYLE_FONTFAMILY]||a,c=f.style[mxConstants.STYLE_FONTSIZE]||c,10<a.length&&(a=a.substring(0,8)+"..."));this.toolbar.setFontName(a);this.toolbar.setFontSize(c)}),d.getSelectionModel().addListener(mxEvent.CHANGE,a),d.getModel().addListener(mxEvent.CHANGE,a));d.addListener(mxEvent.CELLS_ADDED,function(a,c){var f=c.getProperty("cells"),b=c.getProperty("parent");d.getModel().isLayer(b)&&!d.isCellVisible(b)&&null!=f&&0<f.length&&d.getModel().setVisible(b,!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(){d.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){d.view.validateBackground()}));
d.addListener("gridSizeChanged",mxUtils.bind(this,function(){d.isGridEnabled()&&d.view.validateBackground()}));this.editor.resetGraph()}this.init();d.standalone||this.open()};mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=38;EditorUi.prototype.footerHeight=28;
EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.hsplitPosition=640>=screen.width?118:"large"!=urlParams["sidebar-entries"]?212:240;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;
EditorUi.prototype.init=function(){var a=this.editor.graph;if(!a.standalone){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 b=a.setDefaultParent,f=this;this.editor.graph.setDefaultParent=function(){b.apply(this,arguments);f.updateActionStates()};a.editLink=f.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.onKeyDown=function(a){var b=this.editor.graph;9==a.which&&b.isEnabled()&&!mxEvent.isAltDown(a)&&(b.isEditing()?b.stopEditing(!1):b.selectCell(!mxEvent.isShiftDown(a)),mxEvent.consume(a))};
+var b=a.setDefaultParent,e=this;this.editor.graph.setDefaultParent=function(){b.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 b=this.editor.graph;9==a.which&&b.isEnabled()&&!mxEvent.isAltDown(a)&&(b.isEditing()?b.stopEditing(!1):b.selectCell(!mxEvent.isShiftDown(a)),mxEvent.consume(a))};
EditorUi.prototype.onKeyPress=function(a){var b=this.editor.graph;!this.isImmediateEditingEvent(a)||b.isEditing()||b.isSelectionEmpty()||0===a.which||27===a.which||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(b.escape(),b.startEditing(),mxClient.IS_FF&&(b=b.cellEditor,b.textarea.innerHTML=String.fromCharCode(a.which),a=document.createRange(),a.selectNodeContents(b.textarea),a.collapse(!1),b=window.getSelection(),b.removeAllRanges(),b.addRange(a)))};
EditorUi.prototype.isImmediateEditingEvent=function(a){return!0};
-EditorUi.prototype.getCssClassForMarker=function(a,b,f,d){return"flexArrow"==b?null!=f&&f!=mxConstants.NONE?"geSprite geSprite-"+a+"blocktrans":"geSprite geSprite-noarrow":f==mxConstants.ARROW_CLASSIC?"1"==d?"geSprite geSprite-"+a+"classic":"geSprite geSprite-"+a+"classictrans":f==mxConstants.ARROW_CLASSIC_THIN?"1"==d?"geSprite geSprite-"+a+"classicthin":"geSprite geSprite-"+a+"classicthintrans":f==mxConstants.ARROW_OPEN?"geSprite geSprite-"+a+"open":f==mxConstants.ARROW_OPEN_THIN?"geSprite geSprite-"+
-a+"openthin":f==mxConstants.ARROW_BLOCK?"1"==d?"geSprite geSprite-"+a+"block":"geSprite geSprite-"+a+"blocktrans":f==mxConstants.ARROW_BLOCK_THIN?"1"==d?"geSprite geSprite-"+a+"blockthin":"geSprite geSprite-"+a+"blockthintrans":f==mxConstants.ARROW_OVAL?"1"==d?"geSprite geSprite-"+a+"oval":"geSprite geSprite-"+a+"ovaltrans":f==mxConstants.ARROW_DIAMOND?"1"==d?"geSprite geSprite-"+a+"diamond":"geSprite geSprite-"+a+"diamondtrans":f==mxConstants.ARROW_DIAMOND_THIN?"1"==d?"geSprite geSprite-"+a+"thindiamond":
-"geSprite geSprite-"+a+"thindiamondtrans":"openAsync"==f?"geSprite geSprite-"+a+"openasync":"dash"==f?"geSprite geSprite-"+a+"dash":"cross"==f?"geSprite geSprite-"+a+"cross":"async"==f?"1"==d?"geSprite geSprite-"+a+"async":"geSprite geSprite-"+a+"asynctrans":"circle"==f||"circlePlus"==f?"1"==d||"circle"==f?"geSprite geSprite-"+a+"circle":"geSprite geSprite-"+a+"circleplus":"ERone"==f?"geSprite geSprite-"+a+"erone":"ERmandOne"==f?"geSprite geSprite-"+a+"eronetoone":"ERmany"==f?"geSprite geSprite-"+
-a+"ermany":"ERoneToMany"==f?"geSprite geSprite-"+a+"eronetomany":"ERzeroToOne"==f?"geSprite geSprite-"+a+"eroneopt":"ERzeroToMany"==f?"geSprite geSprite-"+a+"ermanyopt":"geSprite geSprite-noarrow"};EditorUi.prototype.createMenus=function(){return null};
-EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b=this.actions.get("paste"),f=this.actions.get("pasteHere");b.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));f.setEnabled(b.isEnabled())};
-EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(d){d.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};mxClipboard.copy=function(b){var d=null;if(b.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{for(var d=d||b.getSelectionCells(),d=b.getExportableCells(b.model.getTopmostCells(d)),f={},l=b.createCellLookup(d),n=b.cloneCells(d,null,f),c=new mxGraphModel,g=c.getChildAt(c.getRoot(),
-0),k=0;k<n.length;k++)c.add(g,n[k]);b.updateCustomLinks(b.createCellMapping(f,l),n);mxClipboard.insertCount=1;mxClipboard.setCells(n)}a.updatePasteActionStates();return d};var f=mxClipboard.paste;mxClipboard.paste=function(b){var d=null;b.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):d=f.apply(this,arguments);a.updatePasteActionStates();return d};var d=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){d.apply(this,arguments);a.updatePasteActionStates()};
-var l=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){l.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;
+EditorUi.prototype.getCssClassForMarker=function(a,b,e,d){return"flexArrow"==b?null!=e&&e!=mxConstants.NONE?"geSprite geSprite-"+a+"blocktrans":"geSprite geSprite-noarrow":e==mxConstants.ARROW_CLASSIC?"1"==d?"geSprite geSprite-"+a+"classic":"geSprite geSprite-"+a+"classictrans":e==mxConstants.ARROW_CLASSIC_THIN?"1"==d?"geSprite geSprite-"+a+"classicthin":"geSprite geSprite-"+a+"classicthintrans":e==mxConstants.ARROW_OPEN?"geSprite geSprite-"+a+"open":e==mxConstants.ARROW_OPEN_THIN?"geSprite geSprite-"+
+a+"openthin":e==mxConstants.ARROW_BLOCK?"1"==d?"geSprite geSprite-"+a+"block":"geSprite geSprite-"+a+"blocktrans":e==mxConstants.ARROW_BLOCK_THIN?"1"==d?"geSprite geSprite-"+a+"blockthin":"geSprite geSprite-"+a+"blockthintrans":e==mxConstants.ARROW_OVAL?"1"==d?"geSprite geSprite-"+a+"oval":"geSprite geSprite-"+a+"ovaltrans":e==mxConstants.ARROW_DIAMOND?"1"==d?"geSprite geSprite-"+a+"diamond":"geSprite geSprite-"+a+"diamondtrans":e==mxConstants.ARROW_DIAMOND_THIN?"1"==d?"geSprite geSprite-"+a+"thindiamond":
+"geSprite geSprite-"+a+"thindiamondtrans":"openAsync"==e?"geSprite geSprite-"+a+"openasync":"dash"==e?"geSprite geSprite-"+a+"dash":"cross"==e?"geSprite geSprite-"+a+"cross":"async"==e?"1"==d?"geSprite geSprite-"+a+"async":"geSprite geSprite-"+a+"asynctrans":"circle"==e||"circlePlus"==e?"1"==d||"circle"==e?"geSprite geSprite-"+a+"circle":"geSprite geSprite-"+a+"circleplus":"ERone"==e?"geSprite geSprite-"+a+"erone":"ERmandOne"==e?"geSprite geSprite-"+a+"eronetoone":"ERmany"==e?"geSprite geSprite-"+
+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,b=this.actions.get("paste"),e=this.actions.get("pasteHere");b.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));e.setEnabled(b.isEnabled())};
+EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(d){d.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};mxClipboard.copy=function(b){var d=null;if(b.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{for(var d=d||b.getSelectionCells(),d=b.getExportableCells(b.model.getTopmostCells(d)),e={},k=b.createCellLookup(d),m=b.cloneCells(d,null,e),c=new mxGraphModel,f=c.getChildAt(c.getRoot(),
+0),g=0;g<m.length;g++)c.add(f,m[g]);b.updateCustomLinks(b.createCellMapping(e,k),m);mxClipboard.insertCount=1;mxClipboard.setCells(m)}a.updatePasteActionStates();return d};var e=mxClipboard.paste;mxClipboard.paste=function(b){var d=null;b.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):d=e.apply(this,arguments);a.updatePasteActionStates();return d};var d=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){d.apply(this,arguments);a.updatePasteActionStates()};
+var k=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){k.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,g){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,f=this;if(this.editor.isChromelessView()){this.chromelessResize=b=mxUtils.bind(this,function(c,g,b,d){if(null!=a.container&&!a.isViewer()){b=null!=b?b:0;d=null!=d?d:0;var k=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),f=mxUtils.hasScrollbars(a.container),m=a.view.translate,v=a.view.scale,p=mxRectangle.fromRectangle(k);
-p.x=p.x/v-m.x;p.y=p.y/v-m.y;p.width/=v;p.height/=v;var m=a.container.scrollTop,q=a.container.scrollLeft,B=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)B+=3;var u=a.container.offsetWidth-B,B=a.container.offsetHeight-B;c=c?Math.max(.3,Math.min(g||1,u/p.width)):v;g=(u-c*p.width)/2/c;var z=0==this.lightboxVerticalDivider?0:(B-c*p.height)/this.lightboxVerticalDivider/c;f&&(g=Math.max(g,0),z=Math.max(z,0));if(f||k.width<u||k.height<B)a.view.scaleAndTranslate(c,
-Math.floor(g-p.x),Math.floor(z-p.y)),a.container.scrollTop=m*c/v,a.container.scrollLeft=q*c/v;else if(0!=b||0!=d)k=a.view.translate,a.view.setTranslate(Math.floor(k.x+b/v),Math.floor(k.y+d/v))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});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){var l=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";
-this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=a.isViewer()?"0":"50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var n=mxUtils.bind(this,function(){var c=
-mxUtils.getCurrentStyle(a.container);a.isViewer()?this.chromelessToolbar.style.top="0":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",n);n();var t=0,n=mxUtils.bind(this,function(a,c,g){t++;var b=document.createElement("span");b.style.paddingLeft="8px";b.style.paddingRight="8px";b.style.cursor="pointer";mxEvent.addListener(b,"click",a);null!=g&&b.setAttribute("title",
-g);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);b.appendChild(a);this.chromelessToolbar.appendChild(b);return b});null!=l.backBtn&&n(mxUtils.bind(this,function(a){window.location.href=l.backBtn.url;mxEvent.consume(a)}),Editor.backLargeImage,mxResources.get("back",null,"Back"));var x=n(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),A=document.createElement("div");
-A.style.display="inline-block";A.style.verticalAlign="top";A.style.fontFamily="Helvetica,Arial";A.style.marginTop="8px";A.style.fontSize="14px";A.style.color="#ffffff";this.chromelessToolbar.appendChild(A);var C=n(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&&(A.innerHTML="",mxUtils.write(A,mxUtils.indexOf(this.pages,
-this.currentPage)+1+" / "+this.pages.length))});x.style.paddingLeft="0px";x.style.paddingRight="4px";C.style.paddingLeft="4px";C.style.paddingRight="0px";var g=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(C.style.display="",x.style.display="",A.style.display="inline-block"):(C.style.display="none",x.style.display="none",A.style.display="none");c()});this.editor.addListener("resetGraphView",g);this.editor.addListener("pageSelected",c);n(mxUtils.bind(this,
-function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");n(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 k=null,q=null,p=mxUtils.bind(this,function(a){null!=k&&(window.clearTimeout(k),fadeThead=null);null!=q&&(window.clearTimeout(q),fadeThead2=null);k=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);k=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),600)}),a||200)}),m=mxUtils.bind(this,function(a){null!=k&&(window.clearTimeout(k),fadeThead=null);null!=q&&(window.clearTimeout(q),
-fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var z=n(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 g=z.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=g.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+
-this.chromelessToolbar.offsetHeight+4+"px";g=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=g.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),D=a.getModel();D.addListener(mxEvent.CHANGE,function(){z.style.display=1<D.getChildCount(D.root)?"":"none"})}this.addChromelessToolbarItems(n);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||n(mxUtils.bind(this,function(c){null!=
-this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(c)}),Editor.editLargeImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(g=0;g<this.lightboxToolbarActions.length;g++){var u=this.lightboxToolbarActions[g];n(u.fn,u.icon,u.tooltip)}null!=l.refreshBtn&&n(mxUtils.bind(this,function(a){l.refreshBtn.url?window.location.href=l.refreshBtn.url:
-window.location.reload();mxEvent.consume(a)}),Editor.refreshLargeImage,mxResources.get("refresh",null,"Refresh"));null!=l.fullscreenBtn&&window.self!==window.top&&n(mxUtils.bind(this,function(c){l.fullscreenBtn.url?a.openLink(l.fullscreenBtn.url):a.openLink(window.location.href);mxEvent.consume(c)}),Editor.fullscreenLargeImage,mxResources.get("openInNewWindow",null,"Open in New Window"));(l.closeBtn&&window.self===window.top||a.lightbox&&("1"==urlParams.close||this.container!=document.body))&&n(mxUtils.bind(this,
-function(a){"1"==urlParams.close||l.closeBtn?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";a.isViewer()||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)||
-m(30),p())}));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)?p():m(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?p():m(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||
-m(30)}));var F=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,g){this.startX=g.getGraphX();this.startY=g.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,g){mxEvent.isTouchEvent(g.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<F&&Math.abs(this.scrollTop-a.container.scrollTop)<F&&Math.abs(this.startX-g.getGraphX())<F&&Math.abs(this.startY-g.getGraphY())<
-F&&(0<parseFloat(f.chromelessToolbar.style.opacity||0)?p():m(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var y=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}y.apply(this,arguments)};if(!a.isViewer()){var G=a.sizeDidChange;a.sizeDidChange=
-function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),g=this.getPagePadding(),b=this.getPageSize(),d=Math.ceil(2*g.x+c.width*b.width),k=Math.ceil(2*g.y+c.height*b.height),f=a.minimumGraphSize;if(null==f||f.width!=d||f.height!=k)a.minimumGraphSize=new mxRectangle(0,0,d,k);d=g.x-c.x*b.width;g=g.y-c.y*b.height;this.autoTranslate||this.view.translate.x==d&&this.view.translate.y==g?G.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(d,g),a.container.scrollLeft+=Math.round((d-c)*a.view.scale),a.container.scrollTop+=Math.round((g-b)*a.view.scale),this.autoTranslate=!1)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var v=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=
+this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,f){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,e=this;if(this.editor.isChromelessView()){this.chromelessResize=b=mxUtils.bind(this,function(c,f,b,d){if(null!=a.container&&!a.isViewer()){b=null!=b?b:0;d=null!=d?d:0;var g=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=mxUtils.hasScrollbars(a.container),l=a.view.translate,u=a.view.scale,n=mxRectangle.fromRectangle(g);
+n.x=n.x/u-l.x;n.y=n.y/u-l.y;n.width/=u;n.height/=u;var l=a.container.scrollTop,t=a.container.scrollLeft,C=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)C+=3;var q=a.container.offsetWidth-C,C=a.container.offsetHeight-C;c=c?Math.max(.3,Math.min(f||1,q/n.width)):u;f=(q-c*n.width)/2/c;var x=0==this.lightboxVerticalDivider?0:(C-c*n.height)/this.lightboxVerticalDivider/c;e&&(f=Math.max(f,0),x=Math.max(x,0));if(e||g.width<q||g.height<C)a.view.scaleAndTranslate(c,
+Math.floor(f-n.x),Math.floor(x-n.y)),a.container.scrollTop=l*c/u,a.container.scrollLeft=t*c/u;else if(0!=b||0!=d)g=a.view.translate,a.view.setTranslate(Math.floor(g.x+b/u),Math.floor(g.y+d/u))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});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){var k=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";
+this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=a.isViewer()?"0":"50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var m=mxUtils.bind(this,function(){var c=
+mxUtils.getCurrentStyle(a.container);a.isViewer()?this.chromelessToolbar.style.top="0":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",m);m();var p=0,m=mxUtils.bind(this,function(a,c,f){p++;var b=document.createElement("span");b.style.paddingLeft="8px";b.style.paddingRight="8px";b.style.cursor="pointer";mxEvent.addListener(b,"click",a);null!=f&&b.setAttribute("title",
+f);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",c);b.appendChild(a);this.chromelessToolbar.appendChild(b);return b});null!=k.backBtn&&m(mxUtils.bind(this,function(a){window.location.href=k.backBtn.url;mxEvent.consume(a)}),Editor.backLargeImage,mxResources.get("back",null,"Back"));var v=m(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),B=document.createElement("div");
+B.style.display="inline-block";B.style.verticalAlign="top";B.style.fontFamily="Helvetica,Arial";B.style.marginTop="8px";B.style.fontSize="14px";B.style.color="#ffffff";this.chromelessToolbar.appendChild(B);var z=m(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&&(B.innerHTML="",mxUtils.write(B,mxUtils.indexOf(this.pages,
+this.currentPage)+1+" / "+this.pages.length))});v.style.paddingLeft="0px";v.style.paddingRight="4px";z.style.paddingLeft="4px";z.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(z.style.display="",v.style.display="",B.style.display="inline-block"):(z.style.display="none",v.style.display="none",B.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);m(mxUtils.bind(this,
+function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");m(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,t=null,n=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=t&&(window.clearTimeout(t),fadeThead2=null);g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);g=null;t=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";t=null}),600)}),a||200)}),l=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=t&&(window.clearTimeout(t),
+fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var x=m(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 f=x.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=f.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+
+this.chromelessToolbar.offsetHeight+4+"px";f=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=f.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),A=a.getModel();A.addListener(mxEvent.CHANGE,function(){x.style.display=1<A.getChildCount(A.root)?"":"none"})}this.addChromelessToolbarItems(m);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||m(mxUtils.bind(this,function(c){null!=
+this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(c)}),Editor.editLargeImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(f=0;f<this.lightboxToolbarActions.length;f++){var q=this.lightboxToolbarActions[f];m(q.fn,q.icon,q.tooltip)}null!=k.refreshBtn&&m(mxUtils.bind(this,function(a){k.refreshBtn.url?window.location.href=k.refreshBtn.url:
+window.location.reload();mxEvent.consume(a)}),Editor.refreshLargeImage,mxResources.get("refresh",null,"Refresh"));null!=k.fullscreenBtn&&window.self!==window.top&&m(mxUtils.bind(this,function(c){k.fullscreenBtn.url?a.openLink(k.fullscreenBtn.url):a.openLink(window.location.href);mxEvent.consume(c)}),Editor.fullscreenLargeImage,mxResources.get("openInNewWindow",null,"Open in New Window"));(k.closeBtn&&window.self===window.top||a.lightbox&&("1"==urlParams.close||this.container!=document.body))&&m(mxUtils.bind(this,
+function(a){"1"==urlParams.close||k.closeBtn?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";a.isViewer()||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),n())}));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)?n():l(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?n():l(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||
+l(30)}));var F=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,f){this.startX=f.getGraphX();this.startY=f.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,f){mxEvent.isTouchEvent(f.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<F&&Math.abs(this.scrollTop-a.container.scrollTop)<F&&Math.abs(this.startX-f.getGraphX())<F&&Math.abs(this.startY-f.getGraphY())<
+F&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?n():l(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var y=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}y.apply(this,arguments)};if(!a.isViewer()){var E=a.sizeDidChange;a.sizeDidChange=
+function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),f=this.getPagePadding(),b=this.getPageSize(),d=Math.ceil(2*f.x+c.width*b.width),g=Math.ceil(2*f.y+c.height*b.height),e=a.minimumGraphSize;if(null==e||e.width!=d||e.height!=g)a.minimumGraphSize=new mxRectangle(0,0,d,g);d=f.x-c.x*b.width;f=f.y-c.y*b.height;this.autoTranslate||this.view.translate.x==d&&this.view.translate.y==f?E.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(d,f),a.container.scrollLeft+=Math.round((d-c)*a.view.scale),a.container.scrollTop+=Math.round((f-b)*a.view.scale),this.autoTranslate=!1)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var u=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=(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);this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale*
-this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),g=0,d=0;null!=v&&(g=a.container.offsetWidth/2-v.x+c.x,d=a.container.offsetHeight/2-v.y+c.y);c=this.view.scale;this.zoom(this.cumulativeZoomFactor);this.view.scale!=c&&(null!=b&&f.chromelessResize(!1,null,g*(this.cumulativeZoomFactor-1),d*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==g&&0==d||(a.container.scrollLeft-=g*(this.cumulativeZoomFactor-
-1),a.container.scrollTop-=d*(this.cumulativeZoomFactor-1)));this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),this.lazyZoomDelay)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(c,g){if((null==this.dialogs||0==this.dialogs.length)&&a.isZoomWheelEvent(c))for(var b=mxEvent.getSource(c);null!=b;){if(b==a.container)return v=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c)),a.lazyZoom(g),mxEvent.consume(c),!1;b=b.parentNode}}),a.container)};
+this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),f=0,d=0;null!=u&&(f=a.container.offsetWidth/2-u.x+c.x,d=a.container.offsetHeight/2-u.y+c.y);c=this.view.scale;this.zoom(this.cumulativeZoomFactor);this.view.scale!=c&&(null!=b&&e.chromelessResize(!1,null,f*(this.cumulativeZoomFactor-1),d*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==f&&0==d||(a.container.scrollLeft-=f*(this.cumulativeZoomFactor-
+1),a.container.scrollTop-=d*(this.cumulativeZoomFactor-1)));this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),this.lazyZoomDelay)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(c,f){if((null==this.dialogs||0==this.dialogs.length)&&a.isZoomWheelEvent(c))for(var b=mxEvent.getSource(c);null!=b;){if(b==a.container)return u=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c)),a.lazyZoom(f),mxEvent.consume(c),!1;b=b.parentNode}}),a.container)};
EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))};
EditorUi.prototype.createTemporaryGraph=function(a){a=new Graph(document.createElement("div"),null,null,a);a.resetViewOnRootChange=!1;a.setConnectable(!1);a.gridEnabled=!1;a.autoScroll=!1;a.setTooltips(!1);a.setEnabled(!1);a.container.style.visibility="hidden";a.container.style.position="absolute";a.container.style.overflow="hidden";a.container.style.height="1px";a.container.style.width="1px";return a};
EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0<a.length&&(a="#"+a);this.editor.graph.addClickHandler(a)};EditorUi.prototype.toggleFormatPanel=function(a){null!=this.format&&(this.formatWidth=a||0<this.formatWidth?0:240,this.formatContainer.style.display=a||0<this.formatWidth?"":"none",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))};
-EditorUi.prototype.lightboxFit=function(a){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var b=urlParams.border,f=60;null!=b&&(f=parseInt(b));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(f,null,null,null,null,null,a);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&&0==a.getChildCount(a.getChildAt(a.root,0))};
+EditorUi.prototype.lightboxFit=function(a){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var b=urlParams.border,e=60;null!=b&&(e=parseInt(b));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(e,null,null,null,null,null,a);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&&0==a.getChildCount(a.getChildAt(a.root,0))};
EditorUi.prototype.isSelectionAllowed=function(a){return"SELECT"==mxEvent.getSource(a).nodeName||"INPUT"==mxEvent.getSource(a).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(a))};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})};EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")};
-EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var f=mxUtils.parseXml(a);this.editor.setGraphXml(f.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=b&&(this.editor.setFilename(b),this.updateDocumentTitle())}catch(d){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+d.message)}}))}catch(a){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();
+EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var e=mxUtils.parseXml(a);this.editor.setGraphXml(e.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=b&&(this.editor.setFilename(b),this.updateDocumentTitle())}catch(d){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+d.message)}}))}catch(a){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();
this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.setCurrentMenu=function(a,b){this.currentMenuElt=b;this.currentMenu=a};EditorUi.prototype.resetCurrentMenu=function(){this.currentMenu=this.currentMenuElt=null};EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())};
EditorUi.prototype.updateDocumentTitle=function(){var a=this.editor.getOrCreateFilename();null!=this.editor.appName&&(a+=" - "+this.editor.appName);document.title=a};EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)};EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(a){}};
-EditorUi.prototype.undo=function(){try{var a=this.editor.graph;if(a.isEditing()){var b=a.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);b==a.cellEditor.textarea.innerHTML&&(a.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(f){}};EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canRedo()};EditorUi.prototype.canUndo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canUndo()};
-EditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0,f;for(f in urlParams)a=0==b?a+"?":a+"&",a+=f+"="+urlParams[f],b++;return a};
-EditorUi.prototype.setScrollbars=function(a){var b=this.editor.graph,f=b.container.style.overflow;b.scrollbars=a;this.editor.updateGraphComponents();f!=b.container.style.overflow&&("hidden"==b.container.style.overflow?(a=b.view.translate,b.view.setTranslate(a.x-b.container.scrollLeft/b.view.scale,a.y-b.container.scrollTop/b.view.scale),b.container.scrollLeft=0,b.container.scrollTop=0,b.minimumGraphSize=null,b.sizeDidChange()):(a=b.view.translate.x,f=b.view.translate.y,b.view.translate.x=0,b.view.translate.y=
-0,b.sizeDidChange(),b.container.scrollLeft-=Math.round(a*b.view.scale),b.container.scrollTop-=Math.round(f*b.view.scale)));this.fireEvent(new mxEventObject("scrollbarsChanged"))};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};
+EditorUi.prototype.undo=function(){try{var a=this.editor.graph;if(a.isEditing()){var b=a.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);b==a.cellEditor.textarea.innerHTML&&(a.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(e){}};EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canRedo()};EditorUi.prototype.canUndo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canUndo()};
+EditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0,e;for(e in urlParams)a=0==b?a+"?":a+"&",a+=e+"="+urlParams[e],b++;return a};
+EditorUi.prototype.setScrollbars=function(a){var b=this.editor.graph,e=b.container.style.overflow;b.scrollbars=a;this.editor.updateGraphComponents();e!=b.container.style.overflow&&("hidden"==b.container.style.overflow?(a=b.view.translate,b.view.setTranslate(a.x-b.container.scrollLeft/b.view.scale,a.y-b.container.scrollTop/b.view.scale),b.container.scrollLeft=0,b.container.scrollTop=0,b.minimumGraphSize=null,b.sizeDidChange()):(a=b.view.translate.x,e=b.view.translate.y,b.view.translate.x=0,b.view.translate.y=
+0,b.sizeDidChange(),b.container.scrollLeft-=Math.round(a*b.view.scale),b.container.scrollTop-=Math.round(e*b.view.scale)));this.fireEvent(new mxEventObject("scrollbarsChanged"))};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};
EditorUi.prototype.resetScrollbars=function(){var a=this.editor.graph;if(!this.editor.extendCanvas)a.container.scrollTop=0,a.container.scrollLeft=0,mxUtils.hasScrollbars(a.container)||a.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(a.container))if(a.pageVisible){var b=a.getPagePadding();a.container.scrollTop=Math.floor(b.y-this.editor.initialTopSpacing)-1;a.container.scrollLeft=Math.floor(Math.min(b.x,(a.container.scrollWidth-a.container.clientWidth)/2))-
-1;b=a.getGraphBounds();0<b.width&&0<b.height&&(b.x>a.container.scrollLeft+.9*a.container.clientWidth&&(a.container.scrollLeft=Math.min(b.x+b.width-a.container.clientWidth,b.x-10)),b.y>a.container.scrollTop+.9*a.container.clientHeight&&(a.container.scrollTop=Math.min(b.y+b.height-a.container.clientHeight,b.y-10)))}else{var b=a.getGraphBounds(),f=Math.max(b.width,a.scrollTileSize.width*a.view.scale);a.container.scrollTop=Math.floor(Math.max(0,b.y-Math.max(20,(a.container.clientHeight-Math.max(b.height,
-a.scrollTileSize.height*a.view.scale))/4)));a.container.scrollLeft=Math.floor(Math.max(0,b.x-Math.max(0,(a.container.clientWidth-f)/2)))}else a.pageVisible?(b=a.view.getBackgroundPageBounds(),a.view.setTranslate(Math.floor(Math.max(0,(a.container.clientWidth-b.width)/2)-b.x),Math.floor(Math.max(0,(a.container.clientHeight-b.height)/2)-b.y))):(b=a.getGraphBounds(),a.view.setTranslate(Math.floor(Math.max(0,Math.max(0,(a.container.clientWidth-b.width)/2)-b.x)),Math.floor(Math.max(0,Math.max(20,(a.container.clientHeight-
+1;b=a.getGraphBounds();0<b.width&&0<b.height&&(b.x>a.container.scrollLeft+.9*a.container.clientWidth&&(a.container.scrollLeft=Math.min(b.x+b.width-a.container.clientWidth,b.x-10)),b.y>a.container.scrollTop+.9*a.container.clientHeight&&(a.container.scrollTop=Math.min(b.y+b.height-a.container.clientHeight,b.y-10)))}else{var b=a.getGraphBounds(),e=Math.max(b.width,a.scrollTileSize.width*a.view.scale);a.container.scrollTop=Math.floor(Math.max(0,b.y-Math.max(20,(a.container.clientHeight-Math.max(b.height,
+a.scrollTileSize.height*a.view.scale))/4)));a.container.scrollLeft=Math.floor(Math.max(0,b.x-Math.max(0,(a.container.clientWidth-e)/2)))}else a.pageVisible?(b=a.view.getBackgroundPageBounds(),a.view.setTranslate(Math.floor(Math.max(0,(a.container.clientWidth-b.width)/2)-b.x),Math.floor(Math.max(0,(a.container.clientHeight-b.height)/2)-b.y))):(b=a.getGraphBounds(),a.view.setTranslate(Math.floor(Math.max(0,Math.max(0,(a.container.clientWidth-b.width)/2)-b.x)),Math.floor(Math.max(0,Math.max(20,(a.container.clientHeight-
b.height)/4))-b.y)))};
-EditorUi.prototype.setPageVisible=function(a){var b=this.editor.graph,f=mxUtils.hasScrollbars(b.container),d=0,l=0;f&&(d=b.view.translate.x*b.view.scale-b.container.scrollLeft,l=b.view.translate.y*b.view.scale-b.container.scrollTop);b.pageVisible=a;b.pageBreaksVisible=a;b.preferPageSize=a;b.view.validateBackground();f&&(a=b.getSelectionCells(),b.clearSelection(),b.setSelectionCells(a));b.sizeDidChange();f&&(b.container.scrollLeft=b.view.translate.x*b.view.scale-d,b.container.scrollTop=b.view.translate.y*
-b.view.scale-l);this.fireEvent(new mxEventObject("pageViewChanged"))};function ChangePageSetup(a,b,f,d){this.ui=a;this.previousColor=this.color=b;this.previousImage=this.image=f;this.previousFormat=this.format=d;this.ignoreImage=this.ignoreColor=!1}
+EditorUi.prototype.setPageVisible=function(a){var b=this.editor.graph,e=mxUtils.hasScrollbars(b.container),d=0,k=0;e&&(d=b.view.translate.x*b.view.scale-b.container.scrollLeft,k=b.view.translate.y*b.view.scale-b.container.scrollTop);b.pageVisible=a;b.pageBreaksVisible=a;b.preferPageSize=a;b.view.validateBackground();e&&(a=b.getSelectionCells(),b.clearSelection(),b.setSelectionCells(a));b.sizeDidChange();e&&(b.container.scrollLeft=b.view.translate.x*b.view.scale-d,b.container.scrollTop=b.view.translate.y*
+b.view.scale-k);this.fireEvent(new mxEventObject("pageViewChanged"))};function ChangePageSetup(a,b,e,d){this.ui=a;this.previousColor=this.color=b;this.previousImage=this.image=e;this.previousFormat=this.format=d;this.ignoreImage=this.ignoreColor=!1}
ChangePageSetup.prototype.execute=function(){var a=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var b=a.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=b}this.ignoreImage||(this.image=this.previousImage,b=a.backgroundImage,this.ui.setBackgroundImage(this.previousImage),this.previousImage=b);null!=this.previousFormat&&(this.format=this.previousFormat,b=a.pageFormat,this.previousFormat.width!=b.width||this.previousFormat.height!=b.height)&&(this.ui.setPageFormat(this.previousFormat),
-this.previousFormat=b);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,f,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);return d};mxCodecRegistry.register(a)})();
+this.previousFormat=b);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,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);return d};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"),b=this.actions.get("redo"),f=this.editor.undoManager,d=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});f.addListener(mxEvent.ADD,d);f.addListener(mxEvent.UNDO,d);f.addListener(mxEvent.REDO,d);f.addListener(mxEvent.CLEAR,d);var l=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){l.apply(this,arguments);d()};var n=this.editor.graph.cellEditor.stopEditing;
-this.editor.graph.cellEditor.stopEditing=function(a,b){n.apply(this,arguments);d()};d()};
-EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,b=!a.isSelectionEmpty(),f=!1,d=!1,l=a.getSelectionCells();if(null!=l)for(var n=0;n<l.length;n++){var t=l[n];a.getModel().isEdge(t)&&(d=!0);a.getModel().isVertex(t)&&(f=!0);if(d&&f)break}l="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(n=
-0;n<l.length;n++)this.actions.get(l[n]).setEnabled(b);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(d);this.actions.get("rotation").setEnabled(f);this.actions.get("wordWrap").setEnabled(f);this.actions.get("autosize").setEnabled(f);d=f&&1==
+EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),b=this.actions.get("redo"),e=this.editor.undoManager,d=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,d);e.addListener(mxEvent.UNDO,d);e.addListener(mxEvent.REDO,d);e.addListener(mxEvent.CLEAR,d);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);d()};var m=this.editor.graph.cellEditor.stopEditing;
+this.editor.graph.cellEditor.stopEditing=function(a,b){m.apply(this,arguments);d()};d()};
+EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,b=!a.isSelectionEmpty(),e=!1,d=!1,k=a.getSelectionCells();if(null!=k)for(var m=0;m<k.length;m++){var p=k[m];a.getModel().isEdge(p)&&(d=!0);a.getModel().isVertex(p)&&(e=!0);if(d&&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(b);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(d);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);d=e&&1==
a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||d&&!a.isContainer(a.getSelectionCell()));this.actions.get("ungroup").setEnabled(1==a.getSelectionCount()&&(0<a.getModel().getChildCount(a.getSelectionCell())||d&&a.isContainer(a.getSelectionCell())));this.actions.get("removeFromGroup").setEnabled(d&&a.getModel().isVertex(a.getModel().getParent(a.getSelectionCell())));a.view.getState(a.getSelectionCell());this.menus.get("navigation").setEnabled(b||null!=a.view.currentRoot);
-this.actions.get("collapsible").setEnabled(f&&(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()));b=1==a.getSelectionCount()&&a.isCellFoldable(a.getSelectionCell());this.actions.get("expand").setEnabled(b);this.actions.get("collapse").setEnabled(b);
-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);b=a.isEnabled()&&!a.isCellLocked(a.getDefaultParent());this.menus.get("layout").setEnabled(b);this.menus.get("insert").setEnabled(b);this.menus.get("direction").setEnabled(b&&f);this.menus.get("align").setEnabled(b&&
-f&&1<a.getSelectionCount());this.menus.get("distribute").setEnabled(b&&f&&1<a.getSelectionCount());this.actions.get("selectVertices").setEnabled(b);this.actions.get("selectEdges").setEnabled(b);this.actions.get("selectAll").setEnabled(b);this.actions.get("selectNone").setEnabled(b);this.updatePasteActionStates()};EditorUi.prototype.zeroOffset=new mxPoint(0,0);EditorUi.prototype.getDiagramContainerOffset=function(){return this.zeroOffset};
-EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var b=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),f=this.container.clientWidth,d=this.container.clientHeight;this.container==document.body&&(f=document.body.clientWidth||document.documentElement.clientWidth,d=b?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var l=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&&
-(l=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var n=Math.max(0,Math.min(this.hsplitPosition,f-this.splitSize-20)),t=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",t+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",t+=this.toolbarHeight);0<t&&!mxClient.IS_QUIRKS&&(t+=1);var x=0;if(null!=this.sidebarFooterContainer){var A=
-this.footerHeight+l,x=Math.max(0,Math.min(d-t-A,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=n+"px";this.sidebarFooterContainer.style.height=x+"px";this.sidebarFooterContainer.style.bottom=A+"px"}A=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=t+"px";this.sidebarContainer.style.width=n+"px";this.formatContainer.style.top=t+"px";this.formatContainer.style.width=A+"px";this.formatContainer.style.display=null!=this.format?"":"none";var C=this.getDiagramContainerOffset(),
-c=null!=this.hsplit.parentNode?n+this.splitSize:0;this.diagramContainer.style.left=c+C.x+"px";this.diagramContainer.style.top=t+C.y+"px";this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+l+"px";this.hsplit.style.left=n+"px";this.footerContainer.style.display=0==this.footerHeight?"none":"";null!=this.tabContainer&&(this.tabContainer.style.left=c+"px");b?(this.menubarContainer.style.width=f+"px",
-this.toolbarContainer.style.width=this.menubarContainer.style.width,b=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=b-x+"px",this.formatContainer.style.height=b+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,f-n-this.splitSize-A)+"px":f+"px",this.footerContainer.style.width=this.menubarContainer.style.width,x=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&(this.tabContainer.style.width=
-this.diagramContainer.style.width,this.tabContainer.style.bottom=this.footerHeight+l+"px",x-=this.tabContainer.clientHeight),this.diagramContainer.style.height=x+"px",this.hsplit.style.height=x+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=l+"px"),this.diagramContainer.style.right=A+"px",f=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+l+"px",this.tabContainer.style.right=this.diagramContainer.style.right,f=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=
-this.footerHeight+x+l+"px",this.formatContainer.style.bottom=this.footerHeight+l+"px",this.diagramContainer.style.bottom=this.footerHeight+l+f+"px");a&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null};
+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()));b=1==a.getSelectionCount()&&a.isCellFoldable(a.getSelectionCell());this.actions.get("expand").setEnabled(b);this.actions.get("collapse").setEnabled(b);
+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);b=a.isEnabled()&&!a.isCellLocked(a.getDefaultParent());this.menus.get("layout").setEnabled(b);this.menus.get("insert").setEnabled(b);this.menus.get("direction").setEnabled(b&&e);this.menus.get("align").setEnabled(b&&
+e&&1<a.getSelectionCount());this.menus.get("distribute").setEnabled(b&&e&&1<a.getSelectionCount());this.actions.get("selectVertices").setEnabled(b);this.actions.get("selectEdges").setEnabled(b);this.actions.get("selectAll").setEnabled(b);this.actions.get("selectNone").setEnabled(b);this.updatePasteActionStates()};EditorUi.prototype.zeroOffset=new mxPoint(0,0);EditorUi.prototype.getDiagramContainerOffset=function(){return this.zeroOffset};
+EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var b=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,d=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,d=b?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 v=0;if(null!=this.sidebarFooterContainer){var B=
+this.footerHeight+k,v=Math.max(0,Math.min(d-p-B,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=v+"px";this.sidebarFooterContainer.style.bottom=B+"px"}B=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=B+"px";this.formatContainer.style.display=null!=this.format?"":"none";var z=this.getDiagramContainerOffset(),
+c=null!=this.hsplit.parentNode?m+this.splitSize:0;this.diagramContainer.style.left=c+z.x+"px";this.diagramContainer.style.top=p+z.y+"px";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";this.footerContainer.style.display=0==this.footerHeight?"none":"";null!=this.tabContainer&&(this.tabContainer.style.left=c+"px");b?(this.menubarContainer.style.width=e+"px",
+this.toolbarContainer.style.width=this.menubarContainer.style.width,b=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=b-v+"px",this.formatContainer.style.height=b+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-m-this.splitSize-B)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,v=Math.max(0,d-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",v-=this.tabContainer.clientHeight),this.diagramContainer.style.height=v+"px",this.hsplit.style.height=v+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=k+"px"),this.diagramContainer.style.right=B+"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+v+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};
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};
@@ -2193,82 +2193,82 @@ 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 b=document.createElement("div");b.className=a;return b};
-EditorUi.prototype.addSplitHandler=function(a,b,f,d){function l(a){if(null!=t){var g=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));d(Math.max(0,x+(b?g.x-t.x:t.y-g.y)-f));mxEvent.consume(a);x!=c()&&(A=!0,C=null)}}function n(a){l(a);t=x=null}var t=null,x=null,A=!0,C=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var c=mxUtils.bind(this,function(){var c=parseInt(b?a.style.left:a.style.bottom);b||(c=c+f-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){t=new mxPoint(mxEvent.getClientX(a),
-mxEvent.getClientY(a));x=c();A=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){if(!A&&this.hsplitClickEnabled){var g=null!=C?C-f:0;C=c();d(g);mxEvent.consume(a)}}));mxEvent.addGestureListeners(document,null,l,n);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,l,n)})};
-EditorUi.prototype.handleError=function(a,b,f,d,l){a=null!=a&&null!=a.error?a.error:a;if(null!=a||null!=b){l=mxUtils.htmlEntities(mxResources.get("unknownError"));var n=mxResources.get("ok");b=null!=b?b:mxResources.get("error");null!=a&&null!=a.message&&(l=mxUtils.htmlEntities(a.message));this.showError(b,l,n,f,null,null,null,null,null,null,null,null,d?f:null)}else null!=f&&f()};
-EditorUi.prototype.showError=function(a,b,f,d,l,n,t,x,A,C,c,g,k){a=new ErrorDialog(this,a,b,f||mxResources.get("ok"),d,l,n,t,g,x,A);b=Math.ceil(null!=b?b.length/50:1);this.showDialog(a.container,C||340,c||100+20*b,!0,!1,k);a.init()};EditorUi.prototype.showDialog=function(a,b,f,d,l,n,t,x,A,C){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,f,d,l,n,t,x,A,C);this.dialogs.push(this.dialog)};
-EditorUi.prototype.hideDialog=function(a,b){if(null!=this.dialogs&&0<this.dialogs.length){var f=this.dialogs.pop();0==f.close(a,b)?this.dialogs.push(f):(this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog")),null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():
-(mxUtils.clearSelection(),this.editor.graph.container.focus())}),0))}};EditorUi.prototype.pickColor=function(a,b){var f=this.editor.graph,d=f.cellEditor.saveSelection(),l=226+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12)),n=new ColorDialog(this,a||"none",function(a){f.cellEditor.restoreSelection(d);b(a)},function(){f.cellEditor.restoreSelection(d)});this.showDialog(n.container,230,l,!0,!1);n.init()};
+EditorUi.prototype.addSplitHandler=function(a,b,e,d){function k(a){if(null!=p){var f=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));d(Math.max(0,v+(b?f.x-p.x:p.y-f.y)-e));mxEvent.consume(a);v!=c()&&(B=!0,z=null)}}function m(a){k(a);p=v=null}var p=null,v=null,B=!0,z=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var c=mxUtils.bind(this,function(){var c=parseInt(b?a.style.left:a.style.bottom);b||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){p=new mxPoint(mxEvent.getClientX(a),
+mxEvent.getClientY(a));v=c();B=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){if(!B&&this.hsplitClickEnabled){var f=null!=z?z-e:0;z=c();d(f);mxEvent.consume(a)}}));mxEvent.addGestureListeners(document,null,k,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,m)})};
+EditorUi.prototype.handleError=function(a,b,e,d,k){a=null!=a&&null!=a.error?a.error:a;if(null!=a||null!=b){k=mxUtils.htmlEntities(mxResources.get("unknownError"));var m=mxResources.get("ok");b=null!=b?b:mxResources.get("error");null!=a&&null!=a.message&&(k=mxUtils.htmlEntities(a.message));this.showError(b,k,m,e,null,null,null,null,null,null,null,null,d?e:null)}else null!=e&&e()};
+EditorUi.prototype.showError=function(a,b,e,d,k,m,p,v,B,z,c,f,g){a=new ErrorDialog(this,a,b,e||mxResources.get("ok"),d,k,m,p,f,v,B);b=Math.ceil(null!=b?b.length/50:1);this.showDialog(a.container,z||340,c||100+20*b,!0,!1,g);a.init()};EditorUi.prototype.showDialog=function(a,b,e,d,k,m,p,v,B,z){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,e,d,k,m,p,v,B,z);this.dialogs.push(this.dialog)};
+EditorUi.prototype.hideDialog=function(a,b){if(null!=this.dialogs&&0<this.dialogs.length){var e=this.dialogs.pop();0==e.close(a,b)?this.dialogs.push(e):(this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog")),null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():
+(mxUtils.clearSelection(),this.editor.graph.container.focus())}),0))}};EditorUi.prototype.pickColor=function(a,b){var e=this.editor.graph,d=e.cellEditor.saveSelection(),k=226+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12)),m=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(d);b(a)},function(){e.cellEditor.restoreSelection(d)});this.showDialog(m.container,230,k,!0,!1);m.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 b=null;try{var f=a.indexOf("&lt;mxGraphModel ");if(0<=f){var d=a.lastIndexOf("&lt;/mxGraphModel&gt;");d>f&&(b=a.substring(f,d+21).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}}catch(l){}return b};
-EditorUi.prototype.extractGraphModelFromEvent=function(a){var b=null,f=null;null!=a&&(a=null!=a.dataTransfer?a.dataTransfer:a.clipboardData,null!=a&&(10==document.documentMode||11==document.documentMode?f=a.getData("Text"):(f=0<=mxUtils.indexOf(a.types,"text/html")?a.getData("text/html"):null,mxUtils.indexOf(a.types,null==f||0==f.length)&&(f=a.getData("text/plain"))),null!=f&&(f=Graph.zapGremlins(mxUtils.trim(f)),a=this.extractGraphModelFromHtml(f),null!=a&&(f=a))));null!=f&&this.isCompatibleString(f)&&
-(b=f);return b};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.extractGraphModelFromHtml=function(a){var b=null;try{var e=a.indexOf("&lt;mxGraphModel ");if(0<=e){var d=a.lastIndexOf("&lt;/mxGraphModel&gt;");d>e&&(b=a.substring(e,d+21).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}}catch(k){}return b};
+EditorUi.prototype.extractGraphModelFromEvent=function(a){var b=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=Graph.zapGremlins(mxUtils.trim(e)),a=this.extractGraphModelFromHtml(e),null!=a&&(e=a))));null!=e&&this.isCompatibleString(e)&&
+(b=e);return b};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 b=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(a)&&!mxUtils.confirm(mxResources.get("replaceIt",[a])))return;localStorage.setItem(a,b);this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}else if(b.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(a)+"&xml="+encodeURIComponent(b))).simulate(document,
-"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(b);return}this.editor.setModified(!1);this.editor.setFilename(a);this.updateDocumentTitle()}catch(f){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}};
-EditorUi.prototype.executeLayout=function(a,b,f){var d=this.editor.graph;if(d.isEnabled()){d.getModel().beginUpdate();try{a()}catch(l){throw l;}finally{this.allowAnimation&&b&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(d),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){d.getModel().endUpdate();null!=f&&f()})),a.startAnimation()):(d.getModel().endUpdate(),null!=f&&f())}}};
-EditorUi.prototype.showImageDialog=function(a,b,f,d){d=this.editor.graph.cellEditor;var l=d.saveSelection(),n=mxUtils.prompt(a,b);d.restoreSelection(l);if(null!=n&&0<n.length){var t=new Image;t.onload=function(){f(n,t.width,t.height)};t.onerror=function(){f(null);mxUtils.alert(mxResources.get("fileNotFound"))};t.src=n}else f(null)};EditorUi.prototype.showLinkDialog=function(a,b,f){a=new LinkDialog(this,a,b,f);this.showDialog(a.container,420,90,!0,!0);a.init()};
+"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(b);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,b,e){var d=this.editor.graph;if(d.isEnabled()){d.getModel().beginUpdate();try{a()}catch(k){throw k;}finally{this.allowAnimation&&b&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(d),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){d.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(d.getModel().endUpdate(),null!=e&&e())}}};
+EditorUi.prototype.showImageDialog=function(a,b,e,d){d=this.editor.graph.cellEditor;var k=d.saveSelection(),m=mxUtils.prompt(a,b);d.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,b,e){a=new LinkDialog(this,a,b,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,480,420,!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 b=mxUtils.prompt(mxResources.get("backgroundImage"),"");if(null!=b&&0<b.length){var f=new Image;f.onload=function(){a(new mxImage(b,f.width,f.height))};f.onerror=function(){a(null);mxUtils.alert(mxResources.get("fileNotFound"))};f.src=b}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,b,f){mxUtils.confirm(a)?null!=b&&b():null!=f&&f()};
+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 b=mxUtils.prompt(mxResources.get("backgroundImage"),"");if(null!=b&&0<b.length){var e=new Image;e.onload=function(){a(new mxImage(b,e.width,e.height))};e.onerror=function(){a(null);mxUtils.alert(mxResources.get("fileNotFound"))};e.src=b}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,b,e){mxUtils.confirm(a)?null!=b&&b():null!=e&&e()};
EditorUi.prototype.createOutline=function(a){var b=new mxOutline(this.editor.graph);b.border=20;mxEvent.addListener(window,"resize",function(){b.update()});this.addListener("pageFormatChanged",function(){b.update()});return b};EditorUi.prototype.altShiftActions={67:"clearWaypoints",65:"connectionArrows",76:"editLink",80:"connectionPoints",84:"editTooltip",86:"pasteSize",88:"copySize"};
-EditorUi.prototype.createKeyHandler=function(a){function b(a,c,b){t.push(function(){if(!d.isSelectionEmpty()&&d.isEnabled())if(c=null!=c?c:1,b){d.getModel().beginUpdate();try{for(var g=d.getSelectionCells(),k=0;k<g.length;k++)if(d.getModel().isVertex(g[k])&&d.isCellResizable(g[k])){var f=d.getCellGeometry(g[k]);null!=f&&(f=f.clone(),37==a?f.width=Math.max(0,f.width-c):38==a?f.height=Math.max(0,f.height-c):39==a?f.width+=c:40==a&&(f.height+=c),d.getModel().setGeometry(g[k],f))}}finally{d.getModel().endUpdate()}}else g=
-d.getSelectionCell(),k=d.model.getParent(g),f=null,1==d.getSelectionCount()&&d.model.isVertex(g)&&null!=d.layoutManager&&!d.isCellLocked(g)&&(f=d.layoutManager.getLayout(k)),null!=f&&f.constructor==mxStackLayout?(f=k.getIndex(g),37==a||38==a?d.model.add(k,g,Math.max(0,f-1)):39!=a&&40!=a||d.model.add(k,g,Math.min(d.model.getChildCount(k),f+1))):(k=g=0,37==a?g=-c:38==a?k=-c:39==a?g=c:40==a&&(k=c),d.moveCells(d.getMovableCells(d.getSelectionCells()),g,k))});null!=x&&window.clearTimeout(x);x=window.setTimeout(function(){if(0<
-t.length){d.getModel().beginUpdate();try{for(var a=0;a<t.length;a++)t[a]();t=[]}finally{d.getModel().endUpdate()}d.scrollCellToVisible(d.getSelectionCell())}},200)}var f=this,d=this.editor.graph,l=new mxKeyHandler(d),n=l.isEventIgnored;l.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)&&n.apply(this,arguments)};l.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()&&(null==f.dialogs||0==f.dialogs.length)};l.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var t=[],x=null,A={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},C=l.getFunction;mxKeyHandler.prototype.getFunction=function(a){if(d.isEnabled()){if(mxEvent.isShiftDown(a)&&
-mxEvent.isAltDown(a)){var c=f.actions.get(f.altShiftActions[a.keyCode]);if(null!=c)return c.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){d.selectParentCell()}:function(){d.selectChildCell()};if(null!=A[a.keyCode]&&!d.isSelectionEmpty())if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){if(d.model.isVertex(d.getSelectionCell()))return function(){var c=d.connectVertex(d.getSelectionCell(),A[a.keyCode],d.defaultEdgeLength,a,!0);null!=c&&0<c.length&&(1==c.length&&
-d.model.isEdge(c[0])?d.setSelectionCell(d.model.getTerminal(c[0],!1)):d.setSelectionCell(c[c.length-1]),d.scrollCellToVisible(d.getSelectionCell()),null!=f.hoverIcons&&f.hoverIcons.update(d.view.getState(d.getSelectionCell())))}}else return this.isControlDown(a)?function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null,!0)}:function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null)}}return C.apply(this,arguments)};l.bindAction=mxUtils.bind(this,function(a,c,b,d){var g=this.actions.get(b);
-null!=g&&(b=function(){g.isEnabled()&&g.funct()},c?d?l.bindControlShiftKey(a,b):l.bindControlKey(a,b):d?l.bindShiftKey(a,b):l.bindKey(a,b))});var c=l.escape;l.escape=function(a){c.apply(this,arguments)};l.enter=function(){};l.bindControlShiftKey(36,function(){d.exitGroup()});l.bindControlShiftKey(35,function(){d.enterGroup()});l.bindKey(36,function(){d.home()});l.bindKey(35,function(){d.refresh()});l.bindAction(107,!0,"zoomIn");l.bindAction(109,!0,"zoomOut");l.bindAction(80,!0,"print");l.bindAction(79,
-!0,"outline",!0);l.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)l.bindControlKey(36,function(){d.isEnabled()&&d.foldCells(!0)}),l.bindControlKey(35,function(){d.isEnabled()&&d.foldCells(!1)}),l.bindControlKey(13,function(){d.isEnabled()&&d.setSelectionCells(d.duplicateCells(d.getSelectionCells(),!1))}),l.bindAction(8,!1,"delete"),l.bindAction(8,!0,"deleteAll"),l.bindAction(46,!1,"delete"),l.bindAction(46,!0,"deleteAll"),l.bindAction(72,!0,"resetView"),l.bindAction(72,
-!0,"fitWindow",!0),l.bindAction(74,!0,"fitPage"),l.bindAction(74,!0,"fitTwoPages",!0),l.bindAction(48,!0,"customZoom"),l.bindAction(82,!0,"turn"),l.bindAction(82,!0,"clearDefaultStyle",!0),l.bindAction(83,!0,"save"),l.bindAction(83,!0,"saveAs",!0),l.bindAction(65,!0,"selectAll"),l.bindAction(65,!0,"selectNone",!0),l.bindAction(73,!0,"selectVertices",!0),l.bindAction(69,!0,"selectEdges",!0),l.bindAction(69,!0,"editStyle"),l.bindAction(66,!0,"bold"),l.bindAction(66,!0,"toBack",!0),l.bindAction(70,!0,
-"toFront",!0),l.bindAction(68,!0,"duplicate"),l.bindAction(68,!0,"setAsDefaultStyle",!0),l.bindAction(90,!0,"undo"),l.bindAction(89,!0,"autosize",!0),l.bindAction(88,!0,"cut"),l.bindAction(67,!0,"copy"),l.bindAction(86,!0,"paste"),l.bindAction(71,!0,"group"),l.bindAction(77,!0,"editData"),l.bindAction(71,!0,"grid",!0),l.bindAction(73,!0,"italic"),l.bindAction(76,!0,"lockUnlock"),l.bindAction(76,!0,"layers",!0),l.bindAction(80,!0,"formatPanel",!0),l.bindAction(85,!0,"underline"),l.bindAction(85,!0,
-"ungroup",!0),l.bindAction(190,!0,"superscript"),l.bindAction(188,!0,"subscript"),l.bindKey(13,function(){d.isEnabled()&&d.startEditingAtCell()}),l.bindKey(113,function(){d.isEnabled()&&d.startEditingAtCell()});mxClient.IS_WIN?l.bindAction(89,!0,"redo"):l.bindAction(90,!0,"redo",!0);return l};
+EditorUi.prototype.createKeyHandler=function(a){function b(a,c,b){p.push(function(){if(!d.isSelectionEmpty()&&d.isEnabled())if(c=null!=c?c:1,b){d.getModel().beginUpdate();try{for(var f=d.getSelectionCells(),g=0;g<f.length;g++)if(d.getModel().isVertex(f[g])&&d.isCellResizable(f[g])){var e=d.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),d.getModel().setGeometry(f[g],e))}}finally{d.getModel().endUpdate()}}else f=
+d.getSelectionCell(),g=d.model.getParent(f),e=null,1==d.getSelectionCount()&&d.model.isVertex(f)&&null!=d.layoutManager&&!d.isCellLocked(f)&&(e=d.layoutManager.getLayout(g)),null!=e&&e.constructor==mxStackLayout?(e=g.getIndex(f),37==a||38==a?d.model.add(g,f,Math.max(0,e-1)):39!=a&&40!=a||d.model.add(g,f,Math.min(d.model.getChildCount(g),e+1))):(g=f=0,37==a?f=-c:38==a?g=-c:39==a?f=c:40==a&&(g=c),d.moveCells(d.getMovableCells(d.getSelectionCells()),f,g))});null!=v&&window.clearTimeout(v);v=window.setTimeout(function(){if(0<
+p.length){d.getModel().beginUpdate();try{for(var a=0;a<p.length;a++)p[a]();p=[]}finally{d.getModel().endUpdate()}d.scrollCellToVisible(d.getSelectionCell())}},200)}var e=this,d=this.editor.graph,k=new mxKeyHandler(d),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=[],v=null,B={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},z=k.getFunction;mxKeyHandler.prototype.getFunction=function(a){if(d.isEnabled()){if(mxEvent.isShiftDown(a)&&
+mxEvent.isAltDown(a)){var c=e.actions.get(e.altShiftActions[a.keyCode]);if(null!=c)return c.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){d.selectParentCell()}:function(){d.selectChildCell()};if(null!=B[a.keyCode]&&!d.isSelectionEmpty())if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){if(d.model.isVertex(d.getSelectionCell()))return function(){var c=d.connectVertex(d.getSelectionCell(),B[a.keyCode],d.defaultEdgeLength,a,!0);null!=c&&0<c.length&&(1==c.length&&
+d.model.isEdge(c[0])?d.setSelectionCell(d.model.getTerminal(c[0],!1)):d.setSelectionCell(c[c.length-1]),d.scrollCellToVisible(d.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(d.view.getState(d.getSelectionCell())))}}else return this.isControlDown(a)?function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null,!0)}:function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null)}}return z.apply(this,arguments)};k.bindAction=mxUtils.bind(this,function(a,c,b,d){var f=this.actions.get(b);
+null!=f&&(b=function(){f.isEnabled()&&f.funct()},c?d?k.bindControlShiftKey(a,b):k.bindControlKey(a,b):d?k.bindShiftKey(a,b):k.bindKey(a,b))});var c=k.escape;k.escape=function(a){c.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){d.exitGroup()});k.bindControlShiftKey(35,function(){d.enterGroup()});k.bindKey(36,function(){d.home()});k.bindKey(35,function(){d.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(){d.isEnabled()&&d.foldCells(!0)}),k.bindControlKey(35,function(){d.isEnabled()&&d.foldCells(!1)}),k.bindControlKey(13,function(){d.isEnabled()&&d.setSelectionCells(d.duplicateCells(d.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(){d.isEnabled()&&d.startEditingAtCell()}),k.bindKey(113,function(){d.isEnabled()&&d.startEditingAtCell()});mxClient.IS_WIN?k.bindAction(89,!0,"redo"):k.bindAction(90,!0,"redo",!0);return k};
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 b=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog],a=0;a<b.length;a++)null!=b[a]&&null!=b[a].parentNode&&b[a].parentNode.removeChild(b[a])};"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0);(function(){var a=[["nbsp","160"],["shy","173"]],b=mxUtils.parseXml;mxUtils.parseXml=function(f){for(var d=0;d<a.length;d++)f=f.replace(new RegExp("&"+a[d][0]+";","g"),"&#"+a[d][1]+";");return b(f)}})();
+"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 b=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog],a=0;a<b.length;a++)null!=b[a]&&null!=b[a].parentNode&&b[a].parentNode.removeChild(b[a])};"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0);(function(){var a=[["nbsp","160"],["shy","173"]],b=mxUtils.parseXml;mxUtils.parseXml=function(e){for(var d=0;d<a.length;d++)e=e.replace(new RegExp("&"+a[d][0]+";","g"),"&#"+a[d][1]+";");return b(e)}})();
Date.prototype.toISOString||function(){function a(a){a=String(a);1===a.length&&(a="0"+a);return a}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();Date.now||(Date.now=function(){return(new Date).getTime()});mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;
mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{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(b){}})();
mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#e0e0e0";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;
-mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(a){this.unit!=a&&(this.unit=a,this.fireEvent(new mxEventObject("unitChanged","unit",a)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(a,b,f){return null};
-Graph=function(a,b,f,d,l,n){mxGraph.call(this,a,b,f,d);this.themes=l||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=
-null!=c?c.style:this.getCellStyle(a);return null!=a?"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.edgeMode){var t=null,x=null,A=null,C=null,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,g){if("mouseDown"==g.getProperty("eventName")&&this.isEnabled()){var b=g.getProperty("event");if(!mxEvent.isControlDown(b.getEvent())&&!mxEvent.isShiftDown(b.getEvent())){var d=b.getState();null!=d&&this.model.isEdge(d.cell)&&(t=new mxPoint(b.getGraphX(),b.getGraphY()),
-c=this.isCellSelected(d.cell),A=d,x=b,null!=d.text&&null!=d.text.boundingBox&&mxUtils.contains(d.text.boundingBox,b.getGraphX(),b.getGraphY())?C=mxEvent.LABEL_HANDLE:(d=this.selectionCellsHandler.getHandler(d.cell),null!=d&&null!=d.bends&&0<d.bends.length&&(C=d.getHandleForEvent(b))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,g){var b=this.selectionCellsHandler.handlers.map,d;for(d in b)if(null!=b[d].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&
-!mxEvent.isControlDown(g.getEvent())&&!mxEvent.isShiftDown(g.getEvent())&&!mxEvent.isAltDown(g.getEvent()))if(d=this.tolerance,null!=t&&null!=A&&null!=x){if(b=A,Math.abs(t.x-g.getGraphX())>d||Math.abs(t.y-g.getGraphY())>d){this.isCellSelected(b.cell)||this.setSelectionCell(b.cell);var k=this.selectionCellsHandler.getHandler(b.cell);if(null!=k&&null!=k.bends&&0<k.bends.length){var f=k.getHandleForEvent(x),m=this.view.getEdgeStyle(b);d=m==mxEdgeStyle.EntityRelation;c||C!=mxEvent.LABEL_HANDLE||(f=C);
-if(d&&0!=f&&f!=k.bends.length-1&&f!=mxEvent.LABEL_HANDLE)!d||null==b.visibleSourceState&&null==b.visibleTargetState||(this.graphHandler.reset(),g.consume());else if(f==mxEvent.LABEL_HANDLE||0==f||null!=b.visibleSourceState||f==k.bends.length-1||null!=b.visibleTargetState)d||f==mxEvent.LABEL_HANDLE||(d=b.absolutePoints,null!=d&&(null==m&&null==f||m==mxEdgeStyle.OrthConnector)&&(f=C,null==f&&(f=new mxRectangle(t.x,t.y),f.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(f,d[0].x,d[0].y)?
-f=0:mxUtils.contains(f,d[d.length-1].x,d[d.length-1].y)?f=k.bends.length-1:null!=m&&(2==d.length||3==d.length&&(0==Math.round(d[0].x-d[1].x)&&0==Math.round(d[1].x-d[2].x)||0==Math.round(d[0].y-d[1].y)&&0==Math.round(d[1].y-d[2].y)))?f=2:(f=mxUtils.findNearestSegment(b,t.x,t.y),f=null==m?mxEvent.VIRTUAL_HANDLE-f:f+1))),null==f&&(f=mxEvent.VIRTUAL_HANDLE)),k.start(g.getGraphX(),g.getGraphX(),f),C=t=x=A=null,c=!1,g.consume(),this.graphHandler.reset()}}}else if(b=g.getState(),null!=b&&this.model.isEdge(b.cell)){k=
-null;d=b.absolutePoints;if(null!=d)if(f=new mxRectangle(g.getGraphX(),g.getGraphY()),f.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,g.getGraphX(),g.getGraphY()))k="move";else if(mxUtils.contains(f,d[0].x,d[0].y)||mxUtils.contains(f,d[d.length-1].x,d[d.length-1].y))k="pointer";else if(null!=b.visibleSourceState||null!=b.visibleTargetState)m=this.view.getEdgeStyle(b),k="crosshair",m!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(b)&&
-(m=mxUtils.findNearestSegment(b,g.getGraphX(),g.getGraphY()),m<d.length-1&&0<=m&&(k=0==Math.round(d[m].x-d[m+1].x)?"col-resize":"row-resize"));null!=k&&b.setCursor(k)}}),mouseUp:mxUtils.bind(this,function(a,c){C=t=x=A=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==d&&this.loadStylesheet();var g=this.graphHandler.getGuideStates;
-this.graphHandler.getGuideStates=function(){var a=g.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],b=this.graph.pageFormat,d=this.graph.pageScale,k=b.width*d,b=b.height*d,d=this.graph.view.translate,f=this.graph.view.scale,m=this.graph.getPageLayout(),v=0;v<m.width;v++)c.push(new mxRectangle(((m.x+v)*k+d.x)*f,(m.y*b+d.y)*f,k*f,b*f));for(v=0;v<m.height;v++)c.push(new mxRectangle((m.x*k+d.x)*f,((m.y+v)*b+d.y)*f,k*f,b*f));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),b=[],g=0;g<c.length;g++){var d=this.graph.view.getState(c[g]),
-d=null!=d?d.style:this.graph.getCellStyle(c[g]);"1"==mxUtils.getValue(d,"part","0")?(d=this.graph.model.getParent(c[g]),this.graph.model.isVertex(d)&&0>mxUtils.indexOf(c,d)&&b.push(d)):b.push(c[g])}return b};this.connectionHandler.createTargetVertex=function(a,c){var b=this.graph.view.getState(c),b=null!=b?b.style:this.graph.getCellStyle(c);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(c),this.graph.model.isVertex(b)&&(c=b));return mxConnectionHandler.prototype.createTargetVertex.apply(this,
-arguments)};var k=new mxRubberband(this);this.getRubberband=function(){return k};var q=(new Date).getTime(),p=0,m=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;m.apply(this,arguments);a!=this.currentState?(q=(new Date).getTime(),p=0):p=(new Date).getTime()-q};var z=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<p||(null==
-this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&z.apply(this,arguments)};var D=this.isToggleEvent;this.isToggleEvent=function(a){return D.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(a)};var u=k.isForceRubberbandEvent;k.isForceRubberbandEvent=function(a){return u.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(a.getEvent())||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&
+mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(a){this.unit!=a&&(this.unit=a,this.fireEvent(new mxEventObject("unitChanged","unit",a)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(a,b,e){return null};
+Graph=function(a,b,e,d,k,m){mxGraph.call(this,a,b,e,d);this.themes=k||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=m?m:!1;a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=
+null!=c?c.style:this.getCellStyle(a);return null!=a?"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.edgeMode){var p=null,v=null,B=null,z=null,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,f){if("mouseDown"==f.getProperty("eventName")&&this.isEnabled()){var b=f.getProperty("event");if(!mxEvent.isControlDown(b.getEvent())&&!mxEvent.isShiftDown(b.getEvent())){var d=b.getState();null!=d&&this.model.isEdge(d.cell)&&(p=new mxPoint(b.getGraphX(),b.getGraphY()),
+c=this.isCellSelected(d.cell),B=d,v=b,null!=d.text&&null!=d.text.boundingBox&&mxUtils.contains(d.text.boundingBox,b.getGraphX(),b.getGraphY())?z=mxEvent.LABEL_HANDLE:(d=this.selectionCellsHandler.getHandler(d.cell),null!=d&&null!=d.bends&&0<d.bends.length&&(z=d.getHandleForEvent(b))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,f){var b=this.selectionCellsHandler.handlers.map,d;for(d in b)if(null!=b[d].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&
+!mxEvent.isControlDown(f.getEvent())&&!mxEvent.isShiftDown(f.getEvent())&&!mxEvent.isAltDown(f.getEvent()))if(d=this.tolerance,null!=p&&null!=B&&null!=v){if(b=B,Math.abs(p.x-f.getGraphX())>d||Math.abs(p.y-f.getGraphY())>d){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(v),l=this.view.getEdgeStyle(b);d=l==mxEdgeStyle.EntityRelation;c||z!=mxEvent.LABEL_HANDLE||(e=z);
+if(d&&0!=e&&e!=g.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!d||null==b.visibleSourceState&&null==b.visibleTargetState||(this.graphHandler.reset(),f.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=b.visibleSourceState||e==g.bends.length-1||null!=b.visibleTargetState)d||e==mxEvent.LABEL_HANDLE||(d=b.absolutePoints,null!=d&&(null==l&&null==e||l==mxEdgeStyle.OrthConnector)&&(e=z,null==e&&(e=new mxRectangle(p.x,p.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,d[0].x,d[0].y)?
+e=0:mxUtils.contains(e,d[d.length-1].x,d[d.length-1].y)?e=g.bends.length-1:null!=l&&(2==d.length||3==d.length&&(0==Math.round(d[0].x-d[1].x)&&0==Math.round(d[1].x-d[2].x)||0==Math.round(d[0].y-d[1].y)&&0==Math.round(d[1].y-d[2].y)))?e=2:(e=mxUtils.findNearestSegment(b,p.x,p.y),e=null==l?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),g.start(f.getGraphX(),f.getGraphX(),e),z=p=v=B=null,c=!1,f.consume(),this.graphHandler.reset()}}}else if(b=f.getState(),null!=b&&this.model.isEdge(b.cell)){g=
+null;d=b.absolutePoints;if(null!=d)if(e=new mxRectangle(f.getGraphX(),f.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,f.getGraphX(),f.getGraphY()))g="move";else if(mxUtils.contains(e,d[0].x,d[0].y)||mxUtils.contains(e,d[d.length-1].x,d[d.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,f.getGraphX(),f.getGraphY()),l<d.length-1&&0<=l&&(g=0==Math.round(d[l].x-d[l+1].x)?"col-resize":"row-resize"));null!=g&&b.setCursor(g)}}),mouseUp:mxUtils.bind(this,function(a,c){z=p=v=B=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==d&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;
+this.graphHandler.getGuideStates=function(){var a=f.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],b=this.graph.pageFormat,d=this.graph.pageScale,g=b.width*d,b=b.height*d,d=this.graph.view.translate,e=this.graph.view.scale,l=this.graph.getPageLayout(),u=0;u<l.width;u++)c.push(new mxRectangle(((l.x+u)*g+d.x)*e,(l.y*b+d.y)*e,g*e,b*e));for(u=0;u<l.height;u++)c.push(new mxRectangle((l.x*g+d.x)*e,((l.y+u)*b+d.y)*e,g*e,b*e));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),b=[],f=0;f<c.length;f++){var d=this.graph.view.getState(c[f]),
+d=null!=d?d.style:this.graph.getCellStyle(c[f]);"1"==mxUtils.getValue(d,"part","0")?(d=this.graph.model.getParent(c[f]),this.graph.model.isVertex(d)&&0>mxUtils.indexOf(c,d)&&b.push(d)):b.push(c[f])}return b};this.connectionHandler.createTargetVertex=function(a,c){var b=this.graph.view.getState(c),b=null!=b?b.style:this.graph.getCellStyle(c);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(c),this.graph.model.isVertex(b)&&(c=b));return mxConnectionHandler.prototype.createTargetVertex.apply(this,
+arguments)};var g=new mxRubberband(this);this.getRubberband=function(){return g};var t=(new Date).getTime(),n=0,l=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;l.apply(this,arguments);a!=this.currentState?(t=(new Date).getTime(),n=0):n=(new Date).getTime()-t};var x=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<n||(null==
+this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&x.apply(this,arguments)};var A=this.isToggleEvent;this.isToggleEvent=function(a){return A.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(a)};var q=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return q.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(a.getEvent())||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&
mxEvent.isTouchEvent(a.getEvent())};var F=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(F=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=F)}));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);var b=c?a.sourceState.cell:a.getCell();null!=b&&(b=this.getLinkForCell(b),null!=b&&(this.isCustomLink(b)?this.customLinkClicked(b):this.openLink(b)));this.isEnabled()&&c&&this.clearSelection()};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 G=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 G.apply(this,arguments)};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,g,d,k){k=null!=k?k:[];
-if(0<b||0<g){var f=this.getModel(),m=a+b,v=c+g;null==d&&(d=this.getCurrentRoot(),null==d&&(d=f.getRoot()));if(null!=d)for(var p=f.getChildCount(d),q=0;q<p;q++){var B=f.getChildAt(d,q),u=this.view.getState(B);if(null!=u&&this.isCellVisible(B)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var ba=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=ba&&(u=mxUtils.getBoundingBox(u,ba));(f.isEdge(B)||f.isVertex(B))&&u.x>=a&&u.y+u.height<=v&&u.y>=c&&u.x+u.width<=m&&k.push(B);this.getAllCells(a,c,
-b,g,B,k)}}}return k};var v=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:v.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 B=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=
-c.getProperty("event").getState();B=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),g=c.getProperty("cell");null==g?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),k.start(b.x,b.y)):null!=B?this.addSelectionCells(B):1<this.getSelectionCount()&&this.isCellSelected(g)&&this.removeSelectionCell(g);
-B=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 O=this.updateMouseEvent;this.updateMouseEvent=function(a){a=O.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state=null);return a}}this.currentTranslate=new mxPoint(0,0)};Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;
+this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(c?a.sourceState.cell:a.getCell())};var E=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 E.apply(this,arguments)};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,f,d,g){g=null!=g?g:[];
+if(0<b||0<f){var e=this.getModel(),l=a+b,u=c+f;null==d&&(d=this.getCurrentRoot(),null==d&&(d=e.getRoot()));if(null!=d)for(var n=e.getChildCount(d),t=0;t<n;t++){var q=e.getChildAt(d,t),C=this.view.getState(q);if(null!=C&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(C.style,"locked","0")){var ca=mxUtils.getValue(C.style,mxConstants.STYLE_ROTATION)||0;0!=ca&&(C=mxUtils.getBoundingBox(C,ca));(e.isEdge(q)||e.isVertex(q))&&C.x>=a&&C.y+C.height<=u&&C.y>=c&&C.x+C.width<=l&&g.push(q);this.getAllCells(a,c,
+b,f,q,g)}}}return g};var u=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:u.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 C=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=
+c.getProperty("event").getState();C=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),f=c.getProperty("cell");null==f?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=C?this.addSelectionCells(C):1<this.getSelectionCount()&&this.isCellSelected(f)&&this.removeSelectionCell(f);
+C=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 K=this.updateMouseEvent;this.updateMouseEvent=function(a){a=K.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state=null);return a}}this.currentTranslate=new mxPoint(0,0)};Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;
Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;
-Graph.createSvgImage=function(a,b,f){f=unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a+'px" height="'+b+'px" version="1.1">'+f+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(f):Base64.encode(f,!0)),a,b)};
-Graph.zapGremlins=function(a){for(var b=[],f=0;f<a.length;f++){var d=a.charCodeAt(f);(32<=d||9==d||10==d||13==d)&&65535!=d&&65534!=d&&b.push(a.charAt(f))}return b.join("")};Graph.stringToBytes=function(a){for(var b=Array(a.length),f=0;f<a.length;f++)b[f]=a.charCodeAt(f);return b};Graph.bytesToString=function(a){for(var b=Array(a.length),f=0;f<a.length;f++)b[f]=String.fromCharCode(a[f]);return b.join("")};Graph.compressNode=function(a){return Graph.compress(Graph.zapGremlins(mxUtils.getXml(a)))};
-Graph.compress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;var f=b?pako.deflate(encodeURIComponent(a),{to:"string"}):pako.deflateRaw(encodeURIComponent(a),{to:"string"});return window.btoa?btoa(f):Base64.encode(f,!0)};Graph.decompress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;var f=window.atob?atob(a):Base64.decode(a,!0),f=b?pako.inflate(f,{to:"string"}):pako.inflateRaw(f,{to:"string"});return Graph.zapGremlins(decodeURIComponent(f))};
+Graph.createSvgImage=function(a,b,e){e=unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a+'px" height="'+b+'px" version="1.1">'+e+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0)),a,b)};
+Graph.zapGremlins=function(a){for(var b=[],e=0;e<a.length;e++){var d=a.charCodeAt(e);(32<=d||9==d||10==d||13==d)&&65535!=d&&65534!=d&&b.push(a.charAt(e))}return b.join("")};Graph.stringToBytes=function(a){for(var b=Array(a.length),e=0;e<a.length;e++)b[e]=a.charCodeAt(e);return b};Graph.bytesToString=function(a){for(var b=Array(a.length),e=0;e<a.length;e++)b[e]=String.fromCharCode(a[e]);return b.join("")};Graph.compressNode=function(a){return Graph.compress(Graph.zapGremlins(mxUtils.getXml(a)))};
+Graph.compress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;var e=b?pako.deflate(encodeURIComponent(a),{to:"string"}):pako.deflateRaw(encodeURIComponent(a),{to:"string"});return window.btoa?btoa(e):Base64.encode(e,!0)};Graph.decompress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;var e=window.atob?atob(a):Base64.decode(a,!0),e=b?pako.inflate(e,{to:"string"}):pako.inflateRaw(e,{to:"string"});return Graph.zapGremlins(decodeURIComponent(e))};
mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!mxClient.IS_IOS;Graph.prototype.defaultPageVisible=!0;Graph.prototype.lightbox=!1;Graph.prototype.defaultPageBackgroundColor="#ffffff";
Graph.prototype.defaultPageBorderColor="#ffffff";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.selectParentAfterDelete=!1;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=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.builtInProperties=["label","tooltip","placeholders","placeholder"];Graph.prototype.standalone=!1;
-Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,f){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var b=a.view.graph.tolerance,l=!0,n=null,t=mxUtils.bind(this,function(a){l=!0;n=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),x=mxUtils.bind(this,function(a){l=l&&null!=n&&Math.abs(n.x-mxEvent.getClientX(a))<b&&Math.abs(n.y-mxEvent.getClientY(a))<b}),A=mxUtils.bind(this,function(b){if(l)for(var c=mxEvent.getSource(b);null!=
-c&&c!=f.node;){if("a"==c.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,c,b);break}c=c.parentNode}});mxEvent.addGestureListeners(f.node,t,x,A);mxEvent.addListener(f.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};
-(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO};Graph.prototype.getCellAt=function(a,b,f,t,x,A){this.useCssTransforms&&(a=a/this.currentScale-this.currentTranslate.x,b=b/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(a,
-b,f,t,x,A){t=null!=t?t:!0;x=null!=x?x:!0;null==f&&(f=this.getCurrentRoot(),null==f&&(f=this.getModel().getRoot()));if(null!=f)for(var d=this.model.getChildCount(f)-1;0<=d;d--){var c=this.model.getChildAt(f,d),g=this.getScaledCellAt(a,b,c,t,x,A);if(null!=g)return g;if(this.isCellVisible(c)&&(x&&this.model.isEdge(c)||t&&this.model.isVertex(c))&&(g=this.view.getState(c),null!=g&&(null==A||!A(g,a,b))&&this.intersects(g,a,b)))return c}return null};mxCellHighlight.prototype.getStrokeWidth=function(a){a=
-this.strokeWidth;this.graph.useCssTransforms&&(a/=this.graph.currentScale);return a};mxGraphView.prototype.getGraphBounds=function(){var a=this.graphBounds;if(this.graph.useCssTransforms)var b=this.graph.currentTranslate,f=this.graph.currentScale,a=new mxRectangle((a.x+b.x)*f,(a.y+b.y)*f,a.width*f,a.height*f);return a};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var a=mxGraphView.prototype.validate;mxGraphView.prototype.validate=
+Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var b=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))}),v=mxUtils.bind(this,function(a){k=k&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<b&&Math.abs(m.y-mxEvent.getClientY(a))<b}),B=mxUtils.bind(this,function(b){if(k)for(var c=mxEvent.getSource(b);null!=
+c&&c!=e.node;){if("a"==c.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,c,b);break}c=c.parentNode}});mxEvent.addGestureListeners(e.node,p,v,B);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};
+(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO};Graph.prototype.getCellAt=function(a,b,e,p,v,B){this.useCssTransforms&&(a=a/this.currentScale-this.currentTranslate.x,b=b/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(a,
+b,e,p,v,B){p=null!=p?p:!0;v=null!=v?v:!0;null==e&&(e=this.getCurrentRoot(),null==e&&(e=this.getModel().getRoot()));if(null!=e)for(var d=this.model.getChildCount(e)-1;0<=d;d--){var c=this.model.getChildAt(e,d),f=this.getScaledCellAt(a,b,c,p,v,B);if(null!=f)return f;if(this.isCellVisible(c)&&(v&&this.model.isEdge(c)||p&&this.model.isVertex(c))&&(f=this.view.getState(c),null!=f&&(null==B||!B(f,a,b))&&this.intersects(f,a,b)))return c}return null};mxCellHighlight.prototype.getStrokeWidth=function(a){a=
+this.strokeWidth;this.graph.useCssTransforms&&(a/=this.graph.currentScale);return a};mxGraphView.prototype.getGraphBounds=function(){var a=this.graphBounds;if(this.graph.useCssTransforms)var b=this.graph.currentTranslate,e=this.graph.currentScale,a=new mxRectangle((a.x+b.x)*e,(a.y+b.y)*e,a.width*e,a.height*e);return a};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var a=mxGraphView.prototype.validate;mxGraphView.prototype.validate=
function(b){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);a.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};Graph.prototype.updateCssTransform=function(){var a=this.view.getDrawPane();
-if(null!=a)if(a=a.parentNode,this.useCssTransforms){var b=a.getAttribute("transform");a.setAttribute("transformOrigin","0 0");a.setAttribute("transform","scale("+this.currentScale+","+this.currentScale+")translate("+this.currentTranslate.x+","+this.currentTranslate.y+")");if(b!=a.getAttribute("transform"))try{if(mxClient.IS_EDGE){var f=a.style.display;a.style.display="none";a.getBBox();a.style.display=f}}catch(t){}}else a.removeAttribute("transformOrigin"),a.removeAttribute("transform")};var b=mxGraphView.prototype.validateBackgroundPage;
-mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph.useCssTransforms,f=this.scale,n=this.translate;a&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);b.apply(this,arguments);a&&(this.scale=f,this.translate=n)};var f=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(a,b,n){var d=this.useCssTransforms,l=this.view.scale,A=this.view.translate;d&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=
-!1);f.apply(this,arguments);d&&(this.view.scale=l,this.view.translate=A,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};
-Graph.prototype.labelLinkClicked=function(a,b,f){b=b.getAttribute("href");if(null!=b&&!this.isCustomLink(b)&&mxEvent.isLeftMouseButton(f)&&!mxEvent.isPopupTrigger(f)||mxEvent.isTouchEvent(f)){if(!this.isEnabled()||this.isCellLocked(a.cell))a=this.isBlankLink(b)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(b),a);mxEvent.consume(f)}};
-Graph.prototype.openLink=function(a,b,f){var d=window;try{if("_self"==b&&window!=window.top)window.location.href=a;else if(a.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==a.charAt(this.baseUrl.length)&&"_top"==b&&window==window.top){var l=a.split("#")[1];window.location.hash=="#"+l&&(window.location.hash="");window.location.hash=l}else d=window.open(a,b),null==d||f||(d.opener=null)}catch(n){}return d};Graph.prototype.getLinkTitle=function(a){return a.substring(a.lastIndexOf("/")+1)};
+if(null!=a)if(a=a.parentNode,this.useCssTransforms){var b=a.getAttribute("transform");a.setAttribute("transformOrigin","0 0");a.setAttribute("transform","scale("+this.currentScale+","+this.currentScale+")translate("+this.currentTranslate.x+","+this.currentTranslate.y+")");if(b!=a.getAttribute("transform"))try{if(mxClient.IS_EDGE){var e=a.style.display;a.style.display="none";a.getBBox();a.style.display=e}}catch(p){}}else a.removeAttribute("transformOrigin"),a.removeAttribute("transform")};var b=mxGraphView.prototype.validateBackgroundPage;
+mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph.useCssTransforms,e=this.scale,m=this.translate;a&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);b.apply(this,arguments);a&&(this.scale=e,this.translate=m)};var e=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(a,b,m){var d=this.useCssTransforms,k=this.view.scale,B=this.view.translate;d&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=
+!1);e.apply(this,arguments);d&&(this.view.scale=k,this.view.translate=B,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};
+Graph.prototype.labelLinkClicked=function(a,b,e){b=b.getAttribute("href");if(null!=b&&!this.isCustomLink(b)&&mxEvent.isLeftMouseButton(e)&&!mxEvent.isPopupTrigger(e)||mxEvent.isTouchEvent(e)){if(!this.isEnabled()||this.isCellLocked(a.cell))a=this.isBlankLink(b)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(b),a);mxEvent.consume(e)}};
+Graph.prototype.openLink=function(a,b,e){var d=window;try{if("_self"==b&&window!=window.top)window.location.href=a;else if(a.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==a.charAt(this.baseUrl.length)&&"_top"==b&&window==window.top){var k=a.split("#")[1];window.location.hash=="#"+k&&(window.location.hash="");window.location.hash=k}else d=window.open(a,b),null==d||e||(d.opener=null)}catch(m){}return d};Graph.prototype.getLinkTitle=function(a){return a.substring(a.lastIndexOf("/")+1)};
Graph.prototype.isCustomLink=function(a){return"data:"==a.substring(0,5)};Graph.prototype.customLinkClicked=function(a){return!1};Graph.prototype.isExternalProtocol=function(a){return"mailto:"===a.substring(0,7)};Graph.prototype.isBlankLink=function(a){return!this.isExternalProtocol(a)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(a)&&a.substring(0,this.domainUrl.length)!==this.domainUrl)};
Graph.prototype.isRelativeUrl=function(a){return null!=a&&!this.absoluteUrlPattern.test(a)&&"data:"!==a.substring(0,5)&&!this.isExternalProtocol(a)};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.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.getLayout=function(a){a=this.graph.getCellStyle(a);if(null!=a){if("stackLayout"==a.childLayout){var b=new mxStackLayout(this.graph,!0);b.resizeParentMax="1"==mxUtils.getValue(a,"resizeParentMax","1");b.horizontal="1"==mxUtils.getValue(a,"horizontalStack","1");b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1");b.resizeLast="1"==mxUtils.getValue(a,"resizeLast","0");b.spacing=a.stackSpacing||
@@ -2276,43 +2276,43 @@ b.spacing;b.border=a.stackBorder||b.border;b.marginLeft=a.marginLeft||0;b.margin
!0,b.edgeRouting=!1,b.resetEdges=!1,b;if("flowLayout"==a.childLayout)return b=new mxHierarchicalLayout(this.graph,mxUtils.getValue(a,"flowOrientation",mxConstants.DIRECTION_EAST)),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.parentBorder=mxUtils.getValue(a,"parentPadding",20),b.maintainParentLocation=!0,b.intraCellSpacing=mxUtils.getValue(a,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),b.interRankCellSpacing=mxUtils.getValue(a,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),
b.interHierarchySpacing=mxUtils.getValue(a,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(a,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b;if("circleLayout"==a.childLayout)return new mxCircleLayout(this.graph);if("organicLayout"==a.childLayout)return new mxFastOrganicLayout(this.graph)}return null}};
Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};
-Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),b=this.getGraphBounds();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var f=Math.ceil(b.x/this.view.scale-this.view.translate.x),d=Math.ceil(b.y/this.view.scale-this.view.translate.y),l=Math.floor(f/a.width),n=Math.floor(d/a.height);return new mxRectangle(l,n,Math.ceil((f+Math.floor(b.width/this.view.scale))/a.width)-l,Math.ceil((d+Math.floor(b.height/this.view.scale))/a.height)-n)};
-Graph.prototype.sanitizeHtml=function(a,b){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,b;for(b in this.model.cells){var f=this.model.cells[b];this.isReplacePlaceholders(f)&&(this.view.invalidate(f,!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.getPageLayout=function(){var a=this.getPageSize(),b=this.getGraphBounds();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(b.x/this.view.scale-this.view.translate.x),d=Math.ceil(b.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),m=Math.floor(d/a.height);return new mxRectangle(k,m,Math.ceil((e+Math.floor(b.width/this.view.scale))/a.width)-k,Math.ceil((d+Math.floor(b.height/this.view.scale))/a.height)-m)};
+Graph.prototype.sanitizeHtml=function(a,b){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,b;for(b in this.model.cells){var e=this.model.cells[b];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.isMetaDown(a)&&mxClient.IS_MAC||mxEvent.isControlDown(a)&&!mxClient.IS_MAC};Graph.prototype.isTransparentClickEvent=function(a){return mxEvent.isAltDown(a)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(a)};Graph.prototype.isIgnoreTerminalEvent=function(a){return mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)};
-Graph.prototype.isSplitTarget=function(a,b,f){return!this.model.isEdge(b[0])&&!mxEvent.isAltDown(f)&&!mxEvent.isShiftDown(f)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};Graph.prototype.getLabel=function(a){var b=mxGraph.prototype.getLabel.apply(this,arguments);null!=b&&this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder")&&(b=this.replacePlaceholders(a,b));return b};
+Graph.prototype.isSplitTarget=function(a,b,e){return!this.model.isEdge(b[0])&&!mxEvent.isAltDown(e)&&!mxEvent.isShiftDown(e)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};Graph.prototype.getLabel=function(a){var b=mxGraph.prototype.getLabel.apply(this,arguments);null!=b&&this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder")&&(b=this.replacePlaceholders(a,b));return b};
Graph.prototype.isLabelMovable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(b,"labelMovable","0")))};Graph.prototype.setGridSize=function(a){this.gridSize=a;this.fireEvent(new mxEventObject("gridSizeChanged"))};
Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b};
-Graph.prototype.formatDate=function(a,b,f){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 d=this.dateFormatCache,l=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,t=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)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),f=!0);var x=f?"getUTC":"get",A=a[x+"Date"](),C=a[x+"Day"](),c=a[x+"Month"](),g=a[x+"FullYear"](),k=a[x+"Hours"](),q=a[x+"Minutes"](),p=a[x+"Seconds"](),x=a[x+"Milliseconds"](),m=f?0:a.getTimezoneOffset(),z={d:A,dd:t(A),ddd:d.i18n.dayNames[C],dddd:d.i18n.dayNames[C+7],m:c+1,mm:t(c+1),mmm:d.i18n.monthNames[c],mmmm:d.i18n.monthNames[c+
-12],yy:String(g).slice(2),yyyy:g,h:k%12||12,hh:t(k%12||12),H:k,HH:t(k),M:q,MM:t(q),s:p,ss:t(p),l:t(x,3),L:t(99<x?Math.round(x/10):x),t:12>k?"a":"p",tt:12>k?"am":"pm",T:12>k?"A":"P",TT:12>k?"AM":"PM",Z:f?"UTC":(String(a).match(l)||[""]).pop().replace(n,""),o:(0<m?"-":"+")+t(100*Math.floor(Math.abs(m)/60)+Math.abs(m)%60,4),S:["th","st","nd","rd"][3<A%10?0:(10!=A%100-A%10)*A%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in z?z[a]:a.slice(1,
+Graph.prototype.formatDate=function(a,b,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 d=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)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var v=e?"getUTC":"get",B=a[v+"Date"](),z=a[v+"Day"](),c=a[v+"Month"](),f=a[v+"FullYear"](),g=a[v+"Hours"](),t=a[v+"Minutes"](),n=a[v+"Seconds"](),v=a[v+"Milliseconds"](),l=e?0:a.getTimezoneOffset(),x={d:B,dd:p(B),ddd:d.i18n.dayNames[z],dddd:d.i18n.dayNames[z+7],m:c+1,mm:p(c+1),mmm:d.i18n.monthNames[c],mmmm:d.i18n.monthNames[c+
+12],yy:String(f).slice(2),yyyy:f,h:g%12||12,hh:p(g%12||12),H:g,HH:p(g),M:t,MM:p(t),s:n,ss:p(n),l:p(v,3),L:p(99<v?Math.round(v/10):v),t:12>g?"a":"p",tt:12>g?"am":"pm",T:12>g?"A":"P",TT:12>g?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0<l?"-":"+")+p(100*Math.floor(Math.abs(l)/60)+Math.abs(l)%60,4),S:["th","st","nd","rd"][3<B%10?0:(10!=B%100-B%10)*B%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in x?x[a]:a.slice(1,
a.length-1)})};
-Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),f=b.getChildCount(b.root),d=0;d<f;d++)mxUtils.bind(this,function(d){var f=document.createElement("div");f.style.overflow="hidden";f.style.textOverflow="ellipsis";f.style.padding="2px";f.style.whiteSpace="nowrap";var l=document.createElement("input");l.style.display="inline-block";l.setAttribute("type","checkbox");b.isVisible(d)&&(l.setAttribute("checked","checked"),
-l.defaultChecked=!0);f.appendChild(l);var x=this.convertValueToString(d)||mxResources.get("background")||"Background";f.setAttribute("title",x);mxUtils.write(f,x);a.appendChild(f);mxEvent.addListener(l,"click",function(){null!=l.getAttribute("checked")?l.removeAttribute("checked"):l.setAttribute("checked","checked");b.setVisible(d,l.checked)})})(b.getChildAt(b.root,d));return a};
-Graph.prototype.replacePlaceholders=function(a,b){var f=[];if(null!=b){for(var d=0;match=this.placeholderPattern.exec(b);){var l=match[0];if(2<l.length&&"%label%"!=l&&"%tooltip%"!=l){var n=null;if(match.index>d&&"%"==b.charAt(match.index-1))n=l.substring(1);else{var t=l.substring(1,l.length-1);if(0>t.indexOf("{"))for(var x=a;null==n&&null!=x;)null!=x.value&&"object"==typeof x.value&&(n=x.hasAttribute(t)?null!=x.getAttribute(t)?x.getAttribute(t):"":null),x=this.model.getParent(x);null==n&&(n=this.getGlobalVariable(t))}f.push(b.substring(d,
-match.index)+(null!=n?n:l));d=match.index+l.length}}f.push(b.substring(d))}return f.join("")};Graph.prototype.restoreSelection=function(a){if(null!=a&&0<a.length){for(var b=[],f=0;f<a.length;f++){var d=this.model.getCell(a[f].id);null!=d&&b.push(d)}this.setSelectionCells(b)}else this.clearSelection()};
-Graph.prototype.selectCellsForConnectVertex=function(a,b,f){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=f&&(mxEvent.isTouchEvent(b)?f.update(f.getState(this.view.getState(a[1]))):f.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)};
-Graph.prototype.connectVertex=function(a,b,f,d,l,n){if(a.geometry.relative&&this.model.isEdge(a.parent))return[];n=n?n:!1;var t=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);b==mxConstants.DIRECTION_NORTH?(t.x+=a.geometry.width/2,t.y-=f):b==mxConstants.DIRECTION_SOUTH?(t.x+=a.geometry.width/2,t.y+=a.geometry.height+f):(t.x=b==mxConstants.DIRECTION_WEST?t.x-f:t.x+(a.geometry.width+
-f),t.y+=a.geometry.height/2);f=this.view.getState(this.model.getParent(a));var x=this.view.scale,A=this.view.translate,C=A.x*x,A=A.y*x;null!=f&&this.model.isVertex(f.cell)&&(C=f.x,A=f.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(t.x+=a.parent.geometry.x,t.y+=a.parent.geometry.y);n=n||mxEvent.isControlDown(d)&&!l?null:this.getCellAt(C+t.x*x,A+t.y*x);this.model.isAncestor(n,a)&&(n=null);for(f=n;null!=f;){if(this.isCellLocked(f)){n=null;break}f=this.model.getParent(f)}null!=n&&(f=this.view.getState(a),
-x=this.view.getState(n),null!=f&&null!=x&&mxUtils.intersects(f,x)&&(n=null));if(l=!mxEvent.isShiftDown(d)||l)b==mxConstants.DIRECTION_NORTH?t.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?t.y+=a.geometry.height/2:t.x=b==mxConstants.DIRECTION_WEST?t.x-a.geometry.width/2:t.x+a.geometry.width/2;null==n||this.isCellConnectable(n)||(f=this.getModel().getParent(n),this.getModel().isVertex(f)&&this.isCellConnectable(f)&&(n=f));if(n==a||this.model.isEdge(n)||!this.isCellConnectable(n))n=null;f=[];
-this.model.beginUpdate();try{x=n;if(null==x&&l){for(var C=a,c=this.getCellGeometry(a);null!=c&&c.relative;)C=this.getModel().getParent(C),c=this.getCellGeometry(C);var g=this.view.getState(C),k=null!=g?g.style:this.getCellStyle(C);if(mxUtils.getValue(k,"part",!1)){var q=this.model.getParent(C);this.model.isVertex(q)&&(C=q)}x=this.duplicateCells([C],!1)[0];c=this.getCellGeometry(x);null!=c&&(c.x=t.x-c.width/2,c.y=t.y-c.height/2)}c=null;null!=this.layoutManager&&(c=this.layoutManager.getLayout(this.model.getParent(a)));
-var p=mxEvent.isControlDown(d)&&l||null==n&&null!=c&&c.constructor==mxStackLayout?null:this.insertEdge(this.model.getParent(a),null,"",a,x,this.createCurrentEdgeStyle());if(null!=p&&this.connectionHandler.insertBeforeSource){var m=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=p.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==p.parent&&(m=d.parent.getIndex(d),this.model.add(d.parent,p,m))}null==n&&null!=x&&null!=c&&null!=a.parent&&c.constructor==
-mxStackLayout&&b==mxConstants.DIRECTION_WEST&&(m=a.parent.getIndex(a),this.model.add(a.parent,x,m));null!=p&&f.push(p);null==n&&null!=x&&f.push(x);null==x&&null!=p&&p.geometry.setTerminalPoint(t,!1);null!=p&&this.fireEvent(new mxEventObject("cellsInserted","cells",[p]))}finally{this.model.endUpdate()}return f};
-Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),b=[],f,d;for(d in this.model.cells)if(f=this.model.cells[d],this.model.isVertex(f)||this.model.isEdge(f))this.isHtmlLabel(f)?(a.innerHTML=this.getLabel(f),f=mxUtils.extractTextWithWhitespace([a])):f=this.getLabel(f),f=mxUtils.trim(f.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<f.length&&b.push(f);return b.join(" ")};
-Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var b=a.getAttribute("placeholder"),f=a,d=null;null==d&&null!=f;)null!=f.value&&"object"==typeof f.value&&(d=f.hasAttribute(b)?null!=f.getAttribute(b)?f.getAttribute(b):"":null),f=this.model.getParent(f);return d||""}return a.value.getAttribute("label")||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};
+Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),e=b.getChildCount(b.root),d=0;d<e;d++)mxUtils.bind(this,function(d){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");b.isVisible(d)&&(k.setAttribute("checked","checked"),
+k.defaultChecked=!0);e.appendChild(k);var v=this.convertValueToString(d)||mxResources.get("background")||"Background";e.setAttribute("title",v);mxUtils.write(e,v);a.appendChild(e);mxEvent.addListener(k,"click",function(){null!=k.getAttribute("checked")?k.removeAttribute("checked"):k.setAttribute("checked","checked");b.setVisible(d,k.checked)})})(b.getChildAt(b.root,d));return a};
+Graph.prototype.replacePlaceholders=function(a,b){var e=[];if(null!=b){for(var d=0;match=this.placeholderPattern.exec(b);){var k=match[0];if(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var m=null;if(match.index>d&&"%"==b.charAt(match.index-1))m=k.substring(1);else{var p=k.substring(1,k.length-1);if(0>p.indexOf("{"))for(var v=a;null==m&&null!=v;)null!=v.value&&"object"==typeof v.value&&(m=v.hasAttribute(p)?null!=v.getAttribute(p)?v.getAttribute(p):"":null),v=this.model.getParent(v);null==m&&(m=this.getGlobalVariable(p))}e.push(b.substring(d,
+match.index)+(null!=m?m:k));d=match.index+k.length}}e.push(b.substring(d))}return e.join("")};Graph.prototype.restoreSelection=function(a){if(null!=a&&0<a.length){for(var b=[],e=0;e<a.length;e++){var d=this.model.getCell(a[e].id);null!=d&&b.push(d)}this.setSelectionCells(b)}else this.clearSelection()};
+Graph.prototype.selectCellsForConnectVertex=function(a,b,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(b)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)};
+Graph.prototype.connectVertex=function(a,b,e,d,k,m){if(a.geometry.relative&&this.model.isEdge(a.parent))return[];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);b==mxConstants.DIRECTION_NORTH?(p.x+=a.geometry.width/2,p.y-=e):b==mxConstants.DIRECTION_SOUTH?(p.x+=a.geometry.width/2,p.y+=a.geometry.height+e):(p.x=b==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 v=this.view.scale,B=this.view.translate,z=B.x*v,B=B.y*v;null!=e&&this.model.isVertex(e.cell)&&(z=e.x,B=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(d)&&!k?null:this.getCellAt(z+p.x*v,B+p.y*v);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),
+v=this.view.getState(m),null!=e&&null!=v&&mxUtils.intersects(e,v)&&(m=null));if(k=!mxEvent.isShiftDown(d)||k)b==mxConstants.DIRECTION_NORTH?p.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?p.y+=a.geometry.height/2:p.x=b==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{v=m;if(null==v&&k){for(var z=a,c=this.getCellGeometry(a);null!=c&&c.relative;)z=this.getModel().getParent(z),c=this.getCellGeometry(z);var f=this.view.getState(z),g=null!=f?f.style:this.getCellStyle(z);if(mxUtils.getValue(g,"part",!1)){var t=this.model.getParent(z);this.model.isVertex(t)&&(z=t)}v=this.duplicateCells([z],!1)[0];c=this.getCellGeometry(v);null!=c&&(c.x=p.x-c.width/2,c.y=p.y-c.height/2)}c=null;null!=this.layoutManager&&(c=this.layoutManager.getLayout(this.model.getParent(a)));
+var n=mxEvent.isControlDown(d)&&k||null==m&&null!=c&&c.constructor==mxStackLayout?null:this.insertEdge(this.model.getParent(a),null,"",a,v,this.createCurrentEdgeStyle());if(null!=n&&this.connectionHandler.insertBeforeSource){var l=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=n.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==n.parent&&(l=d.parent.getIndex(d),this.model.add(d.parent,n,l))}null==m&&null!=v&&null!=c&&null!=a.parent&&c.constructor==
+mxStackLayout&&b==mxConstants.DIRECTION_WEST&&(l=a.parent.getIndex(a),this.model.add(a.parent,v,l));null!=n&&e.push(n);null==m&&null!=v&&e.push(v);null==v&&null!=n&&n.geometry.setTerminalPoint(p,!1);null!=n&&this.fireEvent(new mxEventObject("cellsInserted","cells",[n]))}finally{this.model.endUpdate()}return e};
+Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),b=[],e,d;for(d in this.model.cells)if(e=this.model.cells[d],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&&b.push(e);return b.join(" ")};
+Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var b=a.getAttribute("placeholder"),e=a,d=null;null==d&&null!=e;)null!=e.value&&"object"==typeof e.value&&(d=e.hasAttribute(b)?null!=e.getAttribute(b)?e.getAttribute(b):"":null),e=this.model.getParent(e);return d||""}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 b=mxGraph.prototype.getCellStyle.apply(this,arguments);if(null!=a&&null!=this.layoutManager){var f=this.model.getParent(a);this.model.isVertex(f)&&this.isCellCollapsed(a)&&(f=this.layoutManager.getLayout(f),null!=f&&f.constructor==mxStackLayout&&(b[mxConstants.STYLE_HORIZONTAL]=!f.horizontal))}return b};
-Graph.prototype.updateAlternateBounds=function(a,b,f){if(null!=a&&null!=b&&null!=this.layoutManager&&null!=b.alternateBounds){var d=this.layoutManager.getLayout(this.model.getParent(a));null!=d&&d.constructor==mxStackLayout&&(d.horizontal?b.alternateBounds.height=0:b.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)};
-Graph.prototype.foldCells=function(a,b,f,d,l){b=null!=b?b:!1;null==f&&(f=this.getFoldableCells(this.getSelectionCells(),a));if(null!=f){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var n=0;n<f.length;n++){var t=this.view.getState(f[n]),x=this.getCellGeometry(f[n]);if(null!=t&&null!=x){var A=Math.round(x.width-t.width/this.view.scale),C=Math.round(x.height-t.height/this.view.scale);if(0!=C||0!=A){var c=this.model.getParent(f[n]),g=this.layoutManager.getLayout(c);
-null==g?null!=l&&this.isMoveCellsEvent(l)&&this.moveSiblings(t,c,A,C):null!=l&&mxEvent.isAltDown(l)||g.constructor!=mxStackLayout||g.resizeLast||this.resizeParentStacks(c,g,A,C)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(f)}};
-Graph.prototype.moveSiblings=function(a,b,f,d){this.model.beginUpdate();try{var l=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<l.length;b++)if(l[b]!=a.cell){var n=this.view.getState(l[b]),t=this.getCellGeometry(l[b]);null!=n&&null!=t&&(t=t.clone(),t.translate(Math.round(f*Math.max(0,Math.min(1,(n.x-a.x)/a.width))),Math.round(d*Math.max(0,Math.min(1,(n.y-a.y)/a.height)))),this.model.setGeometry(l[b],t))}}finally{this.model.endUpdate()}};
-Graph.prototype.resizeParentStacks=function(a,b,f,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var l=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==l&&!b.resizeLast;){var n=this.getCellGeometry(a),t=this.view.getState(a);null!=t&&null!=n&&(n=n.clone(),b.horizontal?n.width+=f+Math.min(0,t.width/this.view.scale-n.width):n.height+=d+Math.min(0,t.height/this.view.scale-n.height),this.model.setGeometry(a,
-n));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return null!=b&&null!=b.connectable?"0"!=b.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,b,f){f=f||this.getDefaultParent();this.isCellLocked(f)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,b,f){f=f||this.getDefaultParent();return this.isCellLocked(f)?null:mxGraph.prototype.getSwimlaneAt.apply(this,arguments)};
+Graph.prototype.getCellStyle=function(a){var b=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&&(b[mxConstants.STYLE_HORIZONTAL]=!e.horizontal))}return b};
+Graph.prototype.updateAlternateBounds=function(a,b,e){if(null!=a&&null!=b&&null!=this.layoutManager&&null!=b.alternateBounds){var d=this.layoutManager.getLayout(this.model.getParent(a));null!=d&&d.constructor==mxStackLayout&&(d.horizontal?b.alternateBounds.height=0:b.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)};
+Graph.prototype.foldCells=function(a,b,e,d,k){b=null!=b?b:!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]),v=this.getCellGeometry(e[m]);if(null!=p&&null!=v){var B=Math.round(v.width-p.width/this.view.scale),z=Math.round(v.height-p.height/this.view.scale);if(0!=z||0!=B){var c=this.model.getParent(e[m]),f=this.layoutManager.getLayout(c);
+null==f?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(p,c,B,z):null!=k&&mxEvent.isAltDown(k)||f.constructor!=mxStackLayout||f.resizeLast||this.resizeParentStacks(c,f,B,z)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}};
+Graph.prototype.moveSiblings=function(a,b,e,d){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<k.length;b++)if(k[b]!=a.cell){var m=this.view.getState(k[b]),p=this.getCellGeometry(k[b]);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(d*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(k[b],p))}}finally{this.model.endUpdate()}};
+Graph.prototype.resizeParentStacks=function(a,b,e,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var k=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==k&&!b.resizeLast;){var m=this.getCellGeometry(a),p=this.view.getState(a);null!=p&&null!=m&&(m=m.clone(),b.horizontal?m.width+=e+Math.min(0,p.width/this.view.scale-m.width):m.height+=d+Math.min(0,p.height/this.view.scale-m.height),this.model.setGeometry(a,
+m));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return null!=b&&null!=b.connectable?"0"!=b.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,b,e){e=e||this.getDefaultParent();this.isCellLocked(e)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,b,e){e=e||this.getDefaultParent();return this.isCellLocked(e)?null:mxGraph.prototype.getSwimlaneAt.apply(this,arguments)};
Graph.prototype.isCellFoldable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.foldingEnabled&&("1"==b.treeFolding||!this.isCellLocked(a)&&(this.isContainer(a)&&"0"!=b.collapsible||!this.isContainer(a)&&"1"==b.collapsible))};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};
Graph.prototype.zoom=function(a,b){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 b="";if(mxUtils.isNode(a.value)){var f=a.value.getAttribute("tooltip");if(null!=f)null!=f&&this.isReplacePlaceholders(a)&&(f=this.replacePlaceholders(a,f)),b=this.sanitizeHtml(f);else{f=this.builtInProperties;a=a.value.attributes;var d=[];this.isEnabled()&&f.push("link");for(var l=0;l<a.length;l++)0>mxUtils.indexOf(f,a[l].nodeName)&&0<a[l].nodeValue.length&&d.push({name:a[l].nodeName,value:a[l].nodeValue});d.sort(function(a,b){return a.name<b.name?
--1:a.name>b.name?1:0});for(l=0;l<d.length;l++)"link"==d[l].name&&this.isCustomLink(d[l].value)||(b+=("link"!=d[l].name?"<b>"+d[l].name+":</b> ":"")+mxUtils.htmlEntities(d[l].value)+"\n");0<b.length&&(b=b.substring(0,b.length-1),mxClient.IS_SVG&&(b='<div style="max-width:360px;">'+b+"</div>"))}}return b};Graph.prototype.stringToBytes=function(a){return Graph.stringToBytes(a)};Graph.prototype.bytesToString=function(a){return Graph.bytesToString(a)};Graph.prototype.compressNode=function(a){return Graph.compressNode(a)};
+Graph.prototype.getTooltipForCell=function(a){var b="";if(mxUtils.isNode(a.value)){var e=a.value.getAttribute("tooltip");if(null!=e)null!=e&&this.isReplacePlaceholders(a)&&(e=this.replacePlaceholders(a,e)),b=this.sanitizeHtml(e);else{e=this.builtInProperties;a=a.value.attributes;var d=[];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&&d.push({name:a[k].nodeName,value:a[k].nodeValue});d.sort(function(a,b){return a.name<b.name?
+-1:a.name>b.name?1:0});for(k=0;k<d.length;k++)"link"==d[k].name&&this.isCustomLink(d[k].value)||(b+=("link"!=d[k].name?"<b>"+d[k].name+":</b> ":"")+mxUtils.htmlEntities(d[k].value)+"\n");0<b.length&&(b=b.substring(0,b.length-1),mxClient.IS_SVG&&(b='<div style="max-width:360px;">'+b+"</div>"))}}return b};Graph.prototype.stringToBytes=function(a){return Graph.stringToBytes(a)};Graph.prototype.bytesToString=function(a){return Graph.bytesToString(a)};Graph.prototype.compressNode=function(a){return Graph.compressNode(a)};
Graph.prototype.compress=function(a,b){return Graph.compress(a,b)};Graph.prototype.decompress=function(a,b){return Graph.decompress(a,b)};Graph.prototype.zapGremlins=function(a){return Graph.zapGremlins(a)};HoverIcons=function(a){this.graph=a;this.init()};HoverIcons.prototype.arrowSpacing=2;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;
HoverIcons.prototype.cssCursor="copy";HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.arrowFill="#29b6f2";HoverIcons.prototype.triangleUp=mxClient.IS_SVG?Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-up.png",26,14);
HoverIcons.prototype.triangleRight=mxClient.IS_SVG?Graph.createSvgImage(26,18,'<path d="m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-right.png",14,26);HoverIcons.prototype.triangleDown=mxClient.IS_SVG?Graph.createSvgImage(18,26,'<path d="m 6 1 L 6 14 L 1 14 L 9 26 L 18 14 L 12 14 L 12 1 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-down.png",26,14);
@@ -2322,139 +2322,139 @@ IMAGE_PATH+"/refresh.png",38,38);HoverIcons.prototype.tolerance=mxClient.IS_TOUC
HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip"));this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip"));this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip"));this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip"));this.elts=[this.arrowUp,this.arrowRight,this.arrowDown,this.arrowLeft];this.repaintHandler=mxUtils.bind(this,function(){this.repaint()});this.graph.selectionModel.addListener(mxEvent.CHANGE,
this.repaintHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,
mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(a){null!=a.relatedTarget&&mxEvent.getSource(a)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(a){this.reset()}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(b){a.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||
-!mxEvent.isTouchEvent(b.getEvent())||this.graph.model.isVertex(b.getCell())||this.reset()});var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var f=d.getEvent();if(this.isResetEvent(f))this.reset();else if(!this.isActive()){var n=this.getState(d.getState());null==n&&mxEvent.isTouchEvent(f)||this.update(n)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var f=d.getEvent();this.isResetEvent(f)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(f)||
-this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var f=d.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(f),mxEvent.getClientY(f));this.isResetEvent(f)?this.reset():this.isActive()&&!b&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),d):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?
-this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),d.getGraphY())))):mxEvent.isTouchEvent(f)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(f)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
-HoverIcons.prototype.createArrow=function(a,b){var f=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(f=document.createElement(mxClient.VML_PREFIX+":image"),f.setAttribute("src",a.src),f.style.borderStyle="none"):(f=document.createElement("div"),f.style.backgroundImage="url("+a.src+")",f.style.backgroundPosition="center",f.style.backgroundRepeat="no-repeat"),f.style.width=a.width+4+"px",f.style.height=a.height+4+"px",f.style.display=mxClient.IS_QUIRKS?"inline":
-"inline-block"):(f=mxUtils.createImage(a.src),f.style.width=a.width+"px",f.style.height=a.height+"px",f.style.padding=this.tolerance+"px");null!=b&&f.setAttribute("title",b);f.style.position="absolute";f.style.cursor=this.cssCursor;mxEvent.addGestureListeners(f,mxUtils.bind(this,function(a){null==this.currentState||this.isResetEvent(a)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),this.drag(a,this.mouseDownPoint.x,this.mouseDownPoint.y),
-this.activeArrow=f,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redirectMouseEvents(f,this.graph,this.currentState);mxEvent.addListener(f,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isMouseEvent(a)&&(null!=this.activeArrow&&this.activeArrow!=f&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(f,100),this.activeArrow=f)}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(a){this.graph.isMouseDown||
-this.resetActiveArrow()}));return f};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};
+!mxEvent.isTouchEvent(b.getEvent())||this.graph.model.isVertex(b.getCell())||this.reset()});var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var e=d.getEvent();if(this.isResetEvent(e))this.reset();else if(!this.isActive()){var m=this.getState(d.getState());null==m&&mxEvent.isTouchEvent(e)||this.update(m)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(e)||
+this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var e=d.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.isResetEvent(e)?this.reset():this.isActive()&&!b&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),d):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?
+this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),d.getGraphY())))):mxEvent.isTouchEvent(e)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(e)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
+HoverIcons.prototype.createArrow=function(a,b){var e=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(e=document.createElement(mxClient.VML_PREFIX+":image"),e.setAttribute("src",a.src),e.style.borderStyle="none"):(e=document.createElement("div"),e.style.backgroundImage="url("+a.src+")",e.style.backgroundPosition="center",e.style.backgroundRepeat="no-repeat"),e.style.width=a.width+4+"px",e.style.height=a.height+4+"px",e.style.display=mxClient.IS_QUIRKS?"inline":
+"inline-block"):(e=mxUtils.createImage(a.src),e.style.width=a.width+"px",e.style.height=a.height+"px",e.style.padding=this.tolerance+"px");null!=b&&e.setAttribute("title",b);e.style.position="absolute";e.style.cursor=this.cssCursor;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){null==this.currentState||this.isResetEvent(a)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),this.drag(a,this.mouseDownPoint.x,this.mouseDownPoint.y),
+this.activeArrow=e,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redirectMouseEvents(e,this.graph,this.currentState);mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isMouseEvent(a)&&(null!=this.activeArrow&&this.activeArrow!=e&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(e,100),this.activeArrow=e)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){this.graph.isMouseDown||
+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 b=0;b<this.elts.length;b++)null!=this.elts[b]&&a(this.elts[b])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(a){null!=a.parentNode&&a.parentNode.removeChild(a)})};HoverIcons.prototype.setDisplay=function(a){this.visitNodes(function(b){b.style.display=a})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};
-HoverIcons.prototype.drag=function(a,b,f){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,b,f),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=b&&b.setHandlesVisible(!1),b=this.graph.connectionHandler.edgeState,null!=a&&mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)&&null!=b&&"orthogonalEdgeStyle"===
-mxUtils.getValue(b.style,mxConstants.STYLE_EDGE,null)&&(a=this.getDirection(),b.cell.style=mxUtils.setStyle(b.cell.style,"sourcePortConstraint",a),b.style.sourcePortConstraint=a))};HoverIcons.prototype.getStateAt=function(a,b,f){return this.graph.view.getState(this.graph.getCellAt(b,f))};
-HoverIcons.prototype.click=function(a,b,f){var d=f.getEvent(),l=f.getGraphX(),n=f.getGraphY(),l=this.getStateAt(a,l,n);null==l||!this.graph.model.isEdge(l.cell)||mxEvent.isControlDown(d)||l.getVisibleTerminalState(!0)!=a&&l.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d),this.graph.selectCellsForConnectVertex(a,d,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(d)?this.update(this.getState(this.graph.view.getState(a[1]))):
-this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a)):(this.graph.setSelectionCell(l.cell),this.reset());f.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.drag=function(a,b,e){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,b,e),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=b&&b.setHandlesVisible(!1),b=this.graph.connectionHandler.edgeState,null!=a&&mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)&&null!=b&&"orthogonalEdgeStyle"===
+mxUtils.getValue(b.style,mxConstants.STYLE_EDGE,null)&&(a=this.getDirection(),b.cell.style=mxUtils.setStyle(b.cell.style,"sourcePortConstraint",a),b.style.sourcePortConstraint=a))};HoverIcons.prototype.getStateAt=function(a,b,e){return this.graph.view.getState(this.graph.getCellAt(b,e))};
+HoverIcons.prototype.click=function(a,b,e){var d=e.getEvent(),k=e.getGraphX(),m=e.getGraphY(),k=this.getStateAt(a,k,m);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(d)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d),this.graph.selectCellsForConnectVertex(a,d,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(d)?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.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 b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);null!=b&&(a.x-=b.horizontalOffset/2,a.y-=b.verticalOffset/2,a.width+=b.horizontalOffset,a.height+=b.verticalOffset,null!=b.rotationShape&&null!=b.rotationShape.node&&"hidden"!=b.rotationShape.node.style.visibility&&"none"!=b.rotationShape.node.style.display&&null!=b.rotationShape.boundingBox&&a.add(b.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 b=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()),f=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),d=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!=b&&b==f&&f==d&&d==a&&(a=d=f=b=null);var l=this.graph.getCellGeometry(this.currentState.cell),n=mxUtils.bind(this,function(a,b){var d=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==d||null==l||d.height<6*l.height&&d.width<6*l.width)?b.style.visibility="hidden":b.style.visibility="visible"});
-n(b,this.arrowRight);n(f,this.arrowLeft);n(d,this.arrowUp);n(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",
+"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 b=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()),d=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!=b&&b==e&&e==d&&d==a&&(a=d=e=b=null);var k=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,b){var d=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==d||null==k||d.height<6*k.height&&d.width<6*k.width)?b.style.visibility="hidden":b.style.visibility="visible"});
+m(b,this.arrowRight);m(e,this.arrowLeft);m(d,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(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
HoverIcons.prototype.getState=function(a){if(null!=a)if(a=a.cell,this.graph.getModel().contains(a)){if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a);null!=a&&null==a.style&&(a=null)}else a=null;return a};
-HoverIcons.prototype.update=function(a,b,f){if(!this.graph.connectionArrowsEnabled||null!=a&&"0"==mxUtils.getValue(a.style,"allowArrows","1"))this.reset();else{null!=a&&null!=a.cell.geometry&&a.cell.geometry.relative&&this.graph.model.isEdge(a.cell.parent)&&(a=null);var d=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,d=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||
-this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,f))}),this.updateDelay+10))):null!=this.startTime&&(d=(new Date).getTime()-this.startTime);this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,f)?this.reset(!1):(null!=this.currentState||d>this.activationDelay)&&this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==f||!mxUtils.contains(this.bbox,
-b,f))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}};
+HoverIcons.prototype.update=function(a,b,e){if(!this.graph.connectionArrowsEnabled||null!=a&&"0"==mxUtils.getValue(a.style,"allowArrows","1"))this.reset();else{null!=a&&null!=a.cell.geometry&&a.cell.geometry.relative&&this.graph.model.isEdge(a.cell.parent)&&(a=null);var d=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,d=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||
+this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,e))}),this.updateDelay+10))):null!=this.startTime&&(d=(new Date).getTime()-this.startTime);this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,e)?this.reset(!1):(null!=this.currentState||d>this.activationDelay)&&this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==e||!mxUtils.contains(this.bbox,
+b,e))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):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 b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,d){d=null!=d?d:!0;var c=this.getState(a);null!=c&&d&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&!c.invalid&&this.updateLineJumps(c)&&this.graph.cellRenderer.redraw(c,!1,this.isRendering());c=b.apply(this,
-arguments);null!=c&&d&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};var f=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,b){return f.apply(this,arguments)||null!=a.routedPoints&&null!=b.routedPoints&&!mxUtils.equalPoints(b.routedPoints,a.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){d.apply(this,arguments);this.graph.model.isEdge(a.cell)&&
-1!=a.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var b=a.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=a.routedPoints,g=null;if(null!=b&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var d=function(c,b,d){var f=new mxPoint(b,d);f.type=c;g.push(f);f=null!=a.routedPoints?a.routedPoints[g.length-1]:null;return null==f||f.type!=c||f.x!=b||f.y!=d},f=.5*this.scale,c=!1,g=[],p=0;p<b.length-1;p++){for(var m=
-b[p+1],z=b[p],D=[],u=b[p+2];p<b.length-2&&mxUtils.ptSegDistSq(z.x,z.y,u.x,u.y,m.x,m.y)<1*this.scale*this.scale;)m=u,p++,u=b[p+2];for(var c=d(0,z.x,z.y)||c,l=0;l<this.validEdges.length;l++){var y=this.validEdges[l],x=y.absolutePoints;if(null!=x&&mxUtils.intersects(a,y)&&"1"!=y.style.noJump)for(y=0;y<x.length-1;y++){for(var v=x[y+1],B=x[y],u=x[y+2];y<x.length-2&&mxUtils.ptSegDistSq(B.x,B.y,u.x,u.y,v.x,v.y)<1*this.scale*this.scale;)v=u,y++,u=x[y+2];u=mxUtils.intersection(z.x,z.y,m.x,m.y,B.x,B.y,v.x,
-v.y);if(null!=u&&(Math.abs(u.x-z.x)>f||Math.abs(u.y-z.y)>f)&&(Math.abs(u.x-m.x)>f||Math.abs(u.y-m.y)>f)&&(Math.abs(u.x-B.x)>f||Math.abs(u.y-B.y)>f)&&(Math.abs(u.x-v.x)>f||Math.abs(u.y-v.y)>f)){v=u.x-z.x;B=u.y-z.y;u={distSq:v*v+B*B,x:u.x,y:u.y};for(v=0;v<D.length;v++)if(D[v].distSq>u.distSq){D.splice(v,0,u);u=null;break}null==u||0!=D.length&&D[D.length-1].x===u.x&&D[D.length-1].y===u.y||D.push(u)}}}for(y=0;y<D.length;y++)c=d(1,D[y].x,D[y].y)||c}u=b[b.length-1];c=d(0,u.x,u.y)||c}a.routedPoints=g;return c}return!1};
-var l=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,b,c){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)l.apply(this,arguments);else{var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,d=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,f=mxUtils.getValue(this.style,
-"jumpStyle","none"),p,m=!0,z=null,D=null;p=[];var u=null;a.begin();for(var x=0;x<this.state.routedPoints.length;x++){var y=this.state.routedPoints[x],n=new mxPoint(y.x/this.scale,y.y/this.scale);0==x?n=b[0]:x==this.state.routedPoints.length-1&&(n=b[b.length-1]);var v=!1;if(null!=z&&1==y.type){var B=this.state.routedPoints[x+1],y=B.x/this.scale-n.x,B=B.y/this.scale-n.y,y=y*y+B*B;null==u&&(u=new mxPoint(n.x-z.x,n.y-z.y),D=Math.sqrt(u.x*u.x+u.y*u.y),0<D?(u.x=u.x*d/D,u.y=u.y*d/D):u=null);y>d*d&&0<D&&
-(y=z.x-n.x,B=z.y-n.y,y=y*y+B*B,y>d*d&&(v=new mxPoint(n.x-u.x,n.y-u.y),y=new mxPoint(n.x+u.x,n.y+u.y),p.push(v),this.addPoints(a,p,c,g,!1,null,m),p=0>Math.round(u.x)||0==Math.round(u.x)&&0>=Math.round(u.y)?1:-1,m=!1,"sharp"==f?(a.lineTo(v.x-u.y*p,v.y+u.x*p),a.lineTo(y.x-u.y*p,y.y+u.x*p),a.lineTo(y.x,y.y)):"arc"==f?(p*=1.3,a.curveTo(v.x-u.y*p,v.y+u.x*p,y.x-u.y*p,y.y+u.x*p,y.x,y.y)):(a.moveTo(y.x,y.y),m=!0),p=[y],v=!0))}else u=null;v||(p.push(n),z=n)}this.addPoints(a,p,c,g,!1,null,m);a.stroke()}};var n=
-mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,g){if(null==b||null==a||"1"!=b.style.snapToPoint&&"1"!=a.style.snapToPoint)n.apply(this,arguments);else{b=this.getTerminalPort(a,b,g);var d=this.getNextPoint(a,c,g),f=this.graph.isOrthogonal(a),p=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0")),m=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=p)var z=Math.cos(-p),l=Math.sin(-p),d=mxUtils.getRotatedPoint(d,z,l,m);
-z=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);z+=parseFloat(a.style[g?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);d=this.getPerimeterPoint(b,d,0==p&&f,z);0!=p&&(z=Math.cos(p),l=Math.sin(p),d=mxUtils.getRotatedPoint(d,z,l,m));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,b,c,g,d),g)}};mxGraphView.prototype.snapToAnchorPoint=function(a,b,c,g,d){if(null!=b&&null!=a){a=this.graph.getAllConnectionConstraints(b);g=c=null;if(null!=a)for(var f=
-0;f<a.length;f++){var k=this.graph.getConnectionPoint(b,a[f]);if(null!=k){var m=(k.x-d.x)*(k.x-d.x)+(k.y-d.y)*(k.y-d.y);if(null==g||m<g)c=k,g=m}}null!=c&&(d=c)}return d};var t=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,b,c){var g=t.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=c.state&&(g=c.state.view.graph.replacePlaceholders(c.state.cell,g));return g};var x=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=
-function(a){if(null!=a.style&&"undefined"!==typeof pako){var b=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=b&&"string"===typeof b&&"stencil("==b.substring(0,8))try{var c=b.substring(8,b.length-1),g=mxUtils.parseXml(Graph.decompress(c));return new mxShape(new mxStencil(g.documentElement))}catch(k){null!=window.console&&console.log("Error in shape: "+k)}}return x.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;
+arguments);null!=c&&d&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,b){return e.apply(this,arguments)||null!=a.routedPoints&&null!=b.routedPoints&&!mxUtils.equalPoints(b.routedPoints,a.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){d.apply(this,arguments);this.graph.model.isEdge(a.cell)&&
+1!=a.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var b=a.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=a.routedPoints,f=null;if(null!=b&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var d=function(c,b,d){var e=new mxPoint(b,d);e.type=c;f.push(e);e=null!=a.routedPoints?a.routedPoints[f.length-1]:null;return null==e||e.type!=c||e.x!=b||e.y!=d},e=.5*this.scale,c=!1,f=[],n=0;n<b.length-1;n++){for(var l=
+b[n+1],x=b[n],A=[],q=b[n+2];n<b.length-2&&mxUtils.ptSegDistSq(x.x,x.y,q.x,q.y,l.x,l.y)<1*this.scale*this.scale;)l=q,n++,q=b[n+2];for(var c=d(0,x.x,x.y)||c,k=0;k<this.validEdges.length;k++){var y=this.validEdges[k],v=y.absolutePoints;if(null!=v&&mxUtils.intersects(a,y)&&"1"!=y.style.noJump)for(y=0;y<v.length-1;y++){for(var u=v[y+1],C=v[y],q=v[y+2];y<v.length-2&&mxUtils.ptSegDistSq(C.x,C.y,q.x,q.y,u.x,u.y)<1*this.scale*this.scale;)u=q,y++,q=v[y+2];q=mxUtils.intersection(x.x,x.y,l.x,l.y,C.x,C.y,u.x,
+u.y);if(null!=q&&(Math.abs(q.x-x.x)>e||Math.abs(q.y-x.y)>e)&&(Math.abs(q.x-l.x)>e||Math.abs(q.y-l.y)>e)&&(Math.abs(q.x-C.x)>e||Math.abs(q.y-C.y)>e)&&(Math.abs(q.x-u.x)>e||Math.abs(q.y-u.y)>e)){u=q.x-x.x;C=q.y-x.y;q={distSq:u*u+C*C,x:q.x,y:q.y};for(u=0;u<A.length;u++)if(A[u].distSq>q.distSq){A.splice(u,0,q);q=null;break}null==q||0!=A.length&&A[A.length-1].x===q.x&&A[A.length-1].y===q.y||A.push(q)}}}for(y=0;y<A.length;y++)c=d(1,A[y].x,A[y].y)||c}q=b[b.length-1];c=d(0,q.x,q.y)||c}a.routedPoints=f;return c}return!1};
+var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,b,c){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 f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,d=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,
+"jumpStyle","none"),n,l=!0,x=null,A=null;n=[];var q=null;a.begin();for(var v=0;v<this.state.routedPoints.length;v++){var y=this.state.routedPoints[v],m=new mxPoint(y.x/this.scale,y.y/this.scale);0==v?m=b[0]:v==this.state.routedPoints.length-1&&(m=b[b.length-1]);var u=!1;if(null!=x&&1==y.type){var C=this.state.routedPoints[v+1],y=C.x/this.scale-m.x,C=C.y/this.scale-m.y,y=y*y+C*C;null==q&&(q=new mxPoint(m.x-x.x,m.y-x.y),A=Math.sqrt(q.x*q.x+q.y*q.y),0<A?(q.x=q.x*d/A,q.y=q.y*d/A):q=null);y>d*d&&0<A&&
+(y=x.x-m.x,C=x.y-m.y,y=y*y+C*C,y>d*d&&(u=new mxPoint(m.x-q.x,m.y-q.y),y=new mxPoint(m.x+q.x,m.y+q.y),n.push(u),this.addPoints(a,n,c,f,!1,null,l),n=0>Math.round(q.x)||0==Math.round(q.x)&&0>=Math.round(q.y)?1:-1,l=!1,"sharp"==e?(a.lineTo(u.x-q.y*n,u.y+q.x*n),a.lineTo(y.x-q.y*n,y.y+q.x*n),a.lineTo(y.x,y.y)):"arc"==e?(n*=1.3,a.curveTo(u.x-q.y*n,u.y+q.x*n,y.x-q.y*n,y.y+q.x*n,y.x,y.y)):(a.moveTo(y.x,y.y),l=!0),n=[y],u=!0))}else q=null;u||(n.push(m),x=m)}this.addPoints(a,n,c,f,!1,null,l);a.stroke()}};var m=
+mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,f){if(null==b||null==a||"1"!=b.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{b=this.getTerminalPort(a,b,f);var d=this.getNextPoint(a,c,f),e=this.graph.isOrthogonal(a),n=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0")),l=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=n)var x=Math.cos(-n),A=Math.sin(-n),d=mxUtils.getRotatedPoint(d,x,A,l);
+x=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);x+=parseFloat(a.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);d=this.getPerimeterPoint(b,d,0==n&&e,x);0!=n&&(x=Math.cos(n),A=Math.sin(n),d=mxUtils.getRotatedPoint(d,x,A,l));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,b,c,f,d),f)}};mxGraphView.prototype.snapToAnchorPoint=function(a,b,c,f,d){if(null!=b&&null!=a){a=this.graph.getAllConnectionConstraints(b);f=c=null;if(null!=a)for(var e=
+0;e<a.length;e++){var g=this.graph.getConnectionPoint(b,a[e]);if(null!=g){var l=(g.x-d.x)*(g.x-d.x)+(g.y-d.y)*(g.y-d.y);if(null==f||l<f)c=g,f=l}}null!=c&&(d=c)}return d};var p=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,b,c){var f=p.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=c.state&&(f=c.state.view.graph.replacePlaceholders(c.state.cell,f));return f};var v=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=
+function(a){if(null!=a.style&&"undefined"!==typeof pako){var b=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=b&&"string"===typeof b&&"stencil("==b.substring(0,8))try{var c=b.substring(8,b.length-1),f=mxUtils.parseXml(Graph.decompress(c));return new mxShape(new mxStencil(f.documentElement))}catch(g){null!=window.console&&console.log("Error in shape: "+g)}}return v.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;
mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];
-mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var f=mxStencilRegistry.getBasenameForStencil(a);if(null!=f){b=mxStencilRegistry.libraries[f];if(null!=b){if(null==mxStencilRegistry.packages[f]){for(var d=0;d<b.length;d++){var l=b[d];if(".xml"==l.toLowerCase().substring(l.length-4,l.length))mxStencilRegistry.loadStencilSet(l,null);else if(".js"==l.toLowerCase().substring(l.length-3,l.length))try{if(mxStencilRegistry.allowEval){var n=
-mxUtils.load(l);null!=n&&200<=n.getStatus()&&299>=n.getStatus()&&eval.call(window,n.getText())}}catch(t){null!=window.console&&console.log("error in getStencil:",l,t)}}mxStencilRegistry.packages[f]=1}}else f=f.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+f+".xml",null);b=mxStencilRegistry.stencils[a]}}return b};
-mxStencilRegistry.getBasenameForStencil=function(a){var b=null;if(null!=a&&"string"===typeof a&&(a=a.split("."),0<a.length&&"mxgraph"==a[0]))for(var b=a[1],f=2;f<a.length-1;f++)b+="/"+a[f];return b};
-mxStencilRegistry.loadStencilSet=function(a,b,f,d){var l=mxStencilRegistry.packages[a];if(null!=f&&f||null==l){var n=!1;if(null==l)try{if(d){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(d){null!=d&&null!=d.documentElement&&(mxStencilRegistry.packages[a]=d,n=!0,mxStencilRegistry.parseStencilSet(d.documentElement,b,n))}));return}l=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=l;n=!0}catch(t){null!=window.console&&console.log("error in loadStencilSet:",a,t)}null!=l&&null!=
-l.documentElement&&mxStencilRegistry.parseStencilSet(l.documentElement,b,n)}};mxStencilRegistry.loadStencil=function(a,b){if(null!=b)mxUtils.get(a,mxUtils.bind(this,function(a){b(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)};
-mxStencilRegistry.parseStencilSet=function(a,b,f){if("stencils"==a.nodeName)for(var d=a.firstChild;null!=d;)"shapes"==d.nodeName&&mxStencilRegistry.parseStencilSet(d,b,f),d=d.nextSibling;else{f=null!=f?f:!0;var d=a.firstChild,l="";a=a.getAttribute("name");for(null!=a&&(l=a+".");null!=d;){if(d.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=d.getAttribute("name"),null!=a)){var l=l.toLowerCase(),n=a.replace(/ /g,"_");f&&mxStencilRegistry.addStencil(l+n.toLowerCase(),new mxStencil(d));if(null!=b){var t=d.getAttribute("w"),
-x=d.getAttribute("h"),t=null==t?80:parseInt(t,10),x=null==x?80:parseInt(x,10);b(l,n,a,t,x)}}d=d.nextSibling}}};
+mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var d=0;d<b.length;d++){var k=b[d];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);b=mxStencilRegistry.stencils[a]}}return b};
+mxStencilRegistry.getBasenameForStencil=function(a){var b=null;if(null!=a&&"string"===typeof a&&(a=a.split("."),0<a.length&&"mxgraph"==a[0]))for(var b=a[1],e=2;e<a.length-1;e++)b+="/"+a[e];return b};
+mxStencilRegistry.loadStencilSet=function(a,b,e,d){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var m=!1;if(null==k)try{if(d){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(d){null!=d&&null!=d.documentElement&&(mxStencilRegistry.packages[a]=d,m=!0,mxStencilRegistry.parseStencilSet(d.documentElement,b,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,b,m)}};mxStencilRegistry.loadStencil=function(a,b){if(null!=b)mxUtils.get(a,mxUtils.bind(this,function(a){b(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)};
+mxStencilRegistry.parseStencilSet=function(a,b,e){if("stencils"==a.nodeName)for(var d=a.firstChild;null!=d;)"shapes"==d.nodeName&&mxStencilRegistry.parseStencilSet(d,b,e),d=d.nextSibling;else{e=null!=e?e:!0;var d=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=d;){if(d.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=d.getAttribute("name"),null!=a)){var k=k.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+m.toLowerCase(),new mxStencil(d));if(null!=b){var p=d.getAttribute("w"),
+v=d.getAttribute("h"),p=null==p?80:parseInt(p,10),v=null==v?80:parseInt(v,10);b(k,m,a,p,v)}}d=d.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}function b(a,c){switch(c){case mxConstants.POINTS:return a;case mxConstants.MILLIMETERS:return(a/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.INCHES:return(a/mxConstants.PIXELS_PER_INCH).toFixed(2)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR=
"#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR="#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_OPACITY=30;mxConstants.HIGHLIGHT_SIZE=5;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=
-!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(a){return!mxEvent.isAltDown(a)};var f=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(a){return mxEvent.isControlDown(a)||f.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;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(a){return!mxEvent.isAltDown(a)};var e=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(a){return mxEvent.isControlDown(a)||e.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));for(var c in this.graph.currentEdgeStyle)a.style[c]=this.graph.currentEdgeStyle[c];return a};var d=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var a=d.apply(this,arguments);a.isDashed="1"==
-this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return a};mxConnectionHandler.prototype.updatePreview=function(a){};var l=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=l.apply(this,arguments),c=a.getCell;a.getCell=mxUtils.bind(this,function(a){var b=c.apply(this,arguments);this.error=null;return b});return a};mxConnectionHandler.prototype.isCellEnabled=function(a){return!this.graph.isCellLocked(a)};Graph.prototype.defaultVertexStyle={};
+this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return a};mxConnectionHandler.prototype.updatePreview=function(a){};var k=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=k.apply(this,arguments),c=a.getCell;a.getCell=mxUtils.bind(this,function(a){var b=c.apply(this,arguments);this.error=null;return b});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+";");null!=this.currentEdgeStyle.orthogonalLoop?a+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(a+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?
a+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(a+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"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.createCellLookup=function(a,c){c=null!=c?c:{};for(var b=0;b<a.length;b++){var g=a[b];c[mxObjectIdentity.get(g)]=g.getId();for(var d=this.model.getChildCount(g),f=0;f<d;f++)this.createCellLookup([this.model.getChildAt(g,f)],c)}return c};Graph.prototype.createCellMapping=
-function(a,c,b){b=null!=b?b:{};for(var g in a){var d=c[g];null==b[d]&&(b[d]=a[g].getId()||"")}return b};Graph.prototype.importGraphModel=function(a,c,b,g){c=null!=c?c:0;b=null!=b?b:0;var d=new mxCodec(a.ownerDocument),f=new mxGraphModel;d.decode(a,f);a=[];var d={},k={},m=f.getChildren(this.cloneCell(f.root,this.isCloneInvalidEdges(),d));if(null!=m){var v=this.createCellLookup([f.root]),m=m.slice();this.model.beginUpdate();try{if(1!=m.length||this.isCellLocked(this.getDefaultParent()))for(f=0;f<m.length;f++)a=
-a.concat(this.model.getChildren(this.moveCells([m[f]],c,b,!1,this.model.getRoot())[0]));else a=this.moveCells(f.getChildren(m[0]),c,b,!1,this.getDefaultParent()),k[f.getChildAt(f.root,0).getId()]=this.getDefaultParent().getId();this.createCellMapping(d,v,k);this.updateCustomLinks(k,a);if(g){this.isGridEnabled()&&(c=this.snap(c),b=this.snap(b));var p=this.getBoundingBoxFromGeometry(a,!0);null!=p&&this.moveCells(a,c-p.x,b-p.y)}}finally{this.model.endUpdate()}}return a};Graph.prototype.encodeCells=function(a){for(var c=
-{},b=this.cloneCells(a,null,c),g=new mxDictionary,d=0;d<a.length;d++)g.put(a[d],!0);for(d=0;d<b.length;d++){var f=this.view.getState(a[d]);if(null!=f){var k=this.getCellGeometry(b[d]);null==k||!k.relative||this.model.isEdge(a[d])||g.get(this.model.getParent(a[d]))||(k.relative=!1,k.x=f.x/f.view.scale-f.view.translate.x,k.y=f.y/f.view.scale-f.view.translate.y)}}g=new mxCodec;f=new mxGraphModel;k=f.getChildAt(f.getRoot(),0);for(d=0;d<b.length;d++)f.add(k,b[d]);this.updateCustomLinks(this.createCellMapping(c,
-this.createCellLookup(a)),b);return g.encode(f)};var n=Graph.prototype.moveCells;Graph.prototype.moveCells=function(a,c,b,g,d,f,k){k=null!=k?k:{};var m=n.apply(this,arguments);g&&this.updateCustomLinks(this.createCellMapping(k,this.createCellLookup(a)),m);return m};Graph.prototype.updateCustomLinks=function(a,c){for(var b=0;b<c.length;b++)null!=c[b]&&this.updateCustomLinksForCell(a,c[b])};Graph.prototype.updateCustomLinksForCell=function(a,c){};Graph.prototype.getAllConnectionConstraints=function(a,
-c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var g=[];try{for(var d=JSON.parse(b),b=0;b<d.length;b++){var f=d[b];g.push(new mxConnectionConstraint(new mxPoint(f[0],f[1]),2<f.length?"0"!=f[2]:!0,null,3<f.length?f[3]:0,4<f.length?f[4]:0))}}catch(R){}return g}if(null!=a.shape&&null!=a.shape.bounds){f=a.shape.direction;d=a.shape.bounds;b=a.shape.scale;g=d.width/b;d=d.height/b;if(f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH)f=g,g=d,d=f;b=a.shape.getConstraints(a.style,
-g,d);if(null!=b)return b;if(null!=a.shape.stencil&&null!=a.shape.stencil.constraints)return a.shape.stencil.constraints;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),b=0,g=0;g<c;g++){var d=this.model.getChildAt(a,g);this.model.isVertex(d)&&(d=this.getCellGeometry(d),null==d||d.relative||b++)}return 0<b||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,
+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.createCellLookup=function(a,c){c=null!=c?c:{};for(var b=0;b<a.length;b++){var f=a[b];c[mxObjectIdentity.get(f)]=f.getId();for(var d=this.model.getChildCount(f),e=0;e<d;e++)this.createCellLookup([this.model.getChildAt(f,e)],c)}return c};Graph.prototype.createCellMapping=
+function(a,c,b){b=null!=b?b:{};for(var f in a){var d=c[f];null==b[d]&&(b[d]=a[f].getId()||"")}return b};Graph.prototype.importGraphModel=function(a,c,b,f){c=null!=c?c:0;b=null!=b?b:0;var d=new mxCodec(a.ownerDocument),e=new mxGraphModel;d.decode(a,e);a=[];var d={},g={},l=e.getChildren(this.cloneCell(e.root,this.isCloneInvalidEdges(),d));if(null!=l){var u=this.createCellLookup([e.root]),l=l.slice();this.model.beginUpdate();try{if(1!=l.length||this.isCellLocked(this.getDefaultParent()))for(e=0;e<l.length;e++)a=
+a.concat(this.model.getChildren(this.moveCells([l[e]],c,b,!1,this.model.getRoot())[0]));else a=this.moveCells(e.getChildren(l[0]),c,b,!1,this.getDefaultParent()),g[e.getChildAt(e.root,0).getId()]=this.getDefaultParent().getId();this.createCellMapping(d,u,g);this.updateCustomLinks(g,a);if(f){this.isGridEnabled()&&(c=this.snap(c),b=this.snap(b));var n=this.getBoundingBoxFromGeometry(a,!0);null!=n&&this.moveCells(a,c-n.x,b-n.y)}}finally{this.model.endUpdate()}}return a};Graph.prototype.encodeCells=function(a){for(var c=
+{},b=this.cloneCells(a,null,c),f=new mxDictionary,d=0;d<a.length;d++)f.put(a[d],!0);for(d=0;d<b.length;d++){var e=this.view.getState(a[d]);if(null!=e){var g=this.getCellGeometry(b[d]);null==g||!g.relative||this.model.isEdge(a[d])||f.get(this.model.getParent(a[d]))||(g.relative=!1,g.x=e.x/e.view.scale-e.view.translate.x,g.y=e.y/e.view.scale-e.view.translate.y)}}f=new mxCodec;e=new mxGraphModel;g=e.getChildAt(e.getRoot(),0);for(d=0;d<b.length;d++)e.add(g,b[d]);this.updateCustomLinks(this.createCellMapping(c,
+this.createCellLookup(a)),b);return f.encode(e)};var m=Graph.prototype.moveCells;Graph.prototype.moveCells=function(a,c,b,f,d,e,g){g=null!=g?g:{};var l=m.apply(this,arguments);f&&this.updateCustomLinks(this.createCellMapping(g,this.createCellLookup(a)),l);return l};Graph.prototype.updateCustomLinks=function(a,c){for(var b=0;b<c.length;b++)null!=c[b]&&this.updateCustomLinksForCell(a,c[b])};Graph.prototype.updateCustomLinksForCell=function(a,c){};Graph.prototype.getAllConnectionConstraints=function(a,
+c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var f=[];try{for(var d=JSON.parse(b),b=0;b<d.length;b++){var e=d[b];f.push(new mxConnectionConstraint(new mxPoint(e[0],e[1]),2<e.length?"0"!=e[2]:!0,null,3<e.length?e[3]:0,4<e.length?e[4]:0))}}catch(R){}return f}if(null!=a.shape&&null!=a.shape.bounds){e=a.shape.direction;d=a.shape.bounds;b=a.shape.scale;f=d.width/b;d=d.height/b;if(e==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH)e=f,f=d,d=e;b=a.shape.getConstraints(a.style,
+f,d);if(null!=b)return b;if(null!=a.shape.stencil&&null!=a.shape.stencil.constraints)return a.shape.stencil.constraints;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),b=0,f=0;f<c;f++){var d=this.model.getChildAt(a,f);this.model.isVertex(d)&&(d=this.getCellGeometry(d),null==d||d.relative||b++)}return 0<b||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 b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.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(),b=[];c.beginUpdate();try{for(var g=0;g<a.length;g++){var d=a[g];if(c.isEdge(d)){var f=c.getTerminal(d,!0),k=c.getTerminal(d,!1);c.setTerminal(d,k,!0);c.setTerminal(d,f,!1);var m=c.getGeometry(d);if(null!=m){m=m.clone();null!=m.points&&m.points.reverse();var v=
-m.getTerminalPoint(!0),p=m.getTerminalPoint(!1);m.setTerminalPoint(v,!1);m.setTerminalPoint(p,!0);c.setGeometry(d,m);var q=this.view.getState(d),u=this.view.getState(f),B=this.view.getState(k);if(null!=q){var z=null!=u?this.getConnectionConstraint(q,u,!0):null,y=null!=B?this.getConnectionConstraint(q,B,!1):null;this.setConnectionConstraint(d,f,!0,y);this.setConnectionConstraint(d,k,!1,z)}b.push(d)}}else if(c.isVertex(d)&&(m=this.getCellGeometry(d),null!=m)){m=m.clone();m.x+=m.width/2-m.height/2;m.y+=
-m.height/2-m.width/2;var l=m.width;m.width=m.height;m.height=l;c.setGeometry(d,m);var D=this.view.getState(d);if(null!=D){var E=D.style[mxConstants.STYLE_DIRECTION]||"east";"east"==E?E="south":"south"==E?E="west":"west"==E?E="north":"north"==E&&(E="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,E,[d])}b.push(d)}}}finally{c.endUpdate()}return b};Graph.prototype.stencilHasPlaceholders=function(a){if(null!=a&&null!=a.fgNode)for(a=a.fgNode.firstChild;null!=a;){if("text"==a.nodeName&&"1"==a.getAttribute("placeholders"))return!0;
-a=a.nextSibling}return!1};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 b=0;b<c.length;b++){var g=this.view.getState(c[b]);null!=g&&null!=g.shape&&null!=g.shape.stencil&&this.stencilHasPlaceholders(g.shape.stencil)?this.removeStateForCell(c[b]):this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b],
-!1,!1)}}};Graph.prototype.replaceElement=function(a,c){for(var b=a.ownerDocument.createElement(null!=c?c:"span"),g=Array.prototype.slice.call(a.attributes);attr=g.pop();)b.setAttribute(attr.nodeName,attr.nodeValue);b.innerHTML=a.innerHTML;a.parentNode.replaceChild(b,a)};Graph.prototype.processElements=function(a,c){for(var b=a.getElementsByTagName("*"),g=0;g<b.length;g++)c(b[g])};Graph.prototype.updateLabelElements=function(a,c,b){a=null!=a?a:this.getSelectionCells();for(var g=document.createElement("div"),
-d=0;d<a.length;d++)if(this.isHtmlLabel(a[d])){var f=this.convertValueToString(a[d]);if(null!=f&&0<f.length){g.innerHTML=f;for(var k=g.getElementsByTagName(null!=b?b:"*"),m=0;m<k.length;m++)c(k[m]);g.innerHTML!=f&&this.cellLabelChanged(a[d],g.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,c,b){c=Graph.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var g=a.getAttribute("placeholder"),
-d=a;null!=d;){if(d==this.model.getRoot()||null!=d.value&&"object"==typeof d.value&&d.hasAttribute(g)){this.setAttributeForCell(d,g,c);break}d=this.model.getParent(d)}var f=a.value.cloneNode(!0);f.setAttribute("label",c);c=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=new mxDictionary,b=0;b<a.length;b++)c.put(a[b],!0);for(var g=[],b=0;b<a.length;b++){var d=this.model.getParent(a[b]);null==d||
-c.get(d)||(c.put(d,!0),g.push(d))}for(b=0;b<g.length;b++)if(d=this.view.getState(g[b]),null!=d&&(this.model.isEdge(d.cell)||this.model.isVertex(d.cell))&&this.isCellDeletable(d.cell)){var f=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),k=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(f==mxConstants.NONE&&k==mxConstants.NONE){f=!0;for(k=0;k<this.model.getChildCount(d.cell)&&f;k++)c.get(this.model.getChildAt(d.cell,k))||(f=!1);f&&a.push(d.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,
-arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var g=this.view.getState(a[b]);if(null!=g){var d=mxUtils.getValue(g.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(g.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);d==mxConstants.NONE&&g==mxConstants.NONE&&c.push(a[b])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,c){this.setAttributeForCell(a,
-"link",c)};Graph.prototype.setTooltipForCell=function(a,c){this.setAttributeForCell(a,"tooltip",c)};Graph.prototype.getAttributeForCell=function(a,c,b){return null!=a.value&&"object"===typeof a.value?a.value.getAttribute(c)||b:b};Graph.prototype.setAttributeForCell=function(a,c,b){var g;null!=a.value&&"object"==typeof a.value?g=a.value.cloneNode(!0):(g=mxUtils.createXmlDocument().createElement("UserObject"),g.setAttribute("label",a.value||""));null!=b?g.setAttribute(c,b):g.removeAttribute(c);this.model.setValue(a,
-g)};Graph.prototype.getDropTarget=function(a,c,b,g){this.getModel();if(mxEvent.isAltDown(c))return null;for(var d=0;d<a.length;d++)if(this.model.isEdge(this.model.getParent(a[d])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,c){if(this.isEnabled()){var b=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),
-mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(c)){var g=this.model.isEdge(c)?this.view.getState(c):null,d=mxEvent.getSource(a);this.firstClickState!=g||this.firstClickSource!=d||null!=g&&null!=g.text&&null!=g.text.node&&null!=g.text.boundingBox&&(mxUtils.contains(g.text.boundingBox,b.x,b.y)||mxUtils.isAncestorNode(g.text.node,mxEvent.getSource(a)))||(null!=g||this.isCellLocked(this.getDefaultParent()))&&(null==g||this.isCellLocked(g.cell))||!(null!=g||mxClient.IS_VML&&d==this.view.getCanvas()||
-mxClient.IS_SVG&&d==this.view.getCanvas().ownerSVGElement)||(c=this.addText(b.x,b.y,g))}mxGraph.prototype.dblClick.call(this,a,c)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),c=this.container.scrollLeft/this.view.scale-this.view.translate.x,b=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var g=this.getPageLayout(),d=this.getPageSize(),c=Math.max(c,g.x*d.width),b=Math.max(b,g.y*d.height);return new mxPoint(this.snap(c+a),this.snap(b+a))};
-Graph.prototype.getFreeInsertPoint=function(){var a=this.view,c=this.getGraphBounds(),b=this.getInsertPoint(),g=this.snap(Math.round(Math.max(b.x,c.x/a.scale-a.translate.x+(0==c.width?2*this.gridSize:0)))),a=this.snap(Math.round(Math.max(b.y,(c.y+c.height)/a.scale-a.translate.y+2*this.gridSize)));return new mxPoint(g,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,b){var g=new mxCell;g.value="Text";g.style="text;html=1;resizable=0;points=[];";g.geometry=
-new mxGeometry(0,0,0,0);g.vertex=!0;if(null!=b){g.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";g.geometry.relative=!0;g.connectable=!1;var d=this.view.getRelativePoint(b,a,c);g.geometry.x=Math.round(1E4*d.x)/1E4;g.geometry.y=Math.round(d.y);g.geometry.offset=new mxPoint(0,0);var d=this.view.getPoint(b,g.geometry),f=this.view.scale;g.geometry.offset=new mxPoint(Math.round((a-d.x)/f),Math.round((c-d.y)/f))}else g.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",
-d=this.view.translate,g.geometry.width=40,g.geometry.height=20,g.geometry.x=Math.round(a/this.view.scale)-d.x,g.geometry.y=Math.round(c/this.view.scale)-d.y;this.getModel().beginUpdate();try{this.addCells([g],null!=b?b.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[g])),this.autoSizeCell(g)}finally{this.getModel().endUpdate()}return g};Graph.prototype.addClickHandler=function(a,c,b){var g=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var b=
-0;b<a.length;b++){var g=this.getAbsoluteUrl(a[b].getAttribute("href"));null!=g&&(a[b].setAttribute("rel",this.linkRelation),a[b].setAttribute("href",g),null!=c&&mxEvent.addGestureListeners(a[b],null,null,c))}});this.model.addListener(mxEvent.CHANGE,g);g();var d=this.container.style.cursor,f=this.getTolerance(),k=this,m={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(k,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){var c=
-a.sourceState;if(null==c||null==k.getLinkForCell(c.cell))a=k.getCellAt(a.getGraphX(),a.getGraphY(),null,null,null,function(a,c,b){return null==k.getLinkForCell(a.cell)}),c=k.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=k.container.scrollLeft;this.scrollTop=k.container.scrollTop;null==this.currentLink&&
-"auto"==k.container.style.overflow&&(k.container.style.cursor="move");this.updateCurrentState(c)},mouseMove:function(a,c){if(k.isMouseDown){if(null!=this.currentLink){var b=Math.abs(this.startX-c.getGraphX()),g=Math.abs(this.startY-c.getGraphY());(b>f||g>f)&&this.clear()}}else{for(b=c.getSource();null!=b&&"a"!=b.nodeName.toLowerCase();)b=b.parentNode;null!=b?this.clear():(null!=k.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&k.tooltipHandler.reset(c,!0,this.currentState),(null==
-this.currentState||c.getState()!=this.currentState&&null!=c.sourceState||!k.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c))}},mouseUp:function(a,g){for(var d=g.getSource(),m=g.getEvent();null!=d&&"a"!=d.nodeName.toLowerCase();)d=d.parentNode;null==d&&Math.abs(this.scrollLeft-k.container.scrollLeft)<f&&Math.abs(this.scrollTop-k.container.scrollTop)<f&&(null==g.sourceState||!g.isSource(g.sourceState.control))&&((mxEvent.isLeftMouseButton(m)||mxEvent.isMiddleMouseButton(m))&&
-!mxEvent.isPopupTrigger(m)||mxEvent.isTouchEvent(m))&&(null!=this.currentLink?(d=k.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&d||null==c||c(m,this.currentLink),mxEvent.isConsumed(m)||(m=mxEvent.isMiddleMouseButton(m)?"_blank":d?k.linkTarget:"_top",k.openLink(this.currentLink,m),g.consume())):null!=b&&!g.isConsumed()&&Math.abs(this.scrollLeft-k.container.scrollLeft)<f&&Math.abs(this.scrollTop-k.container.scrollTop)<f&&Math.abs(this.startX-g.getGraphX())<f&&Math.abs(this.startY-
-g.getGraphY())<f&&b(g.getEvent()));this.clear()},activate:function(a){this.currentLink=k.getAbsoluteUrl(k.getLinkForCell(a.cell));null!=this.currentLink&&(k.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=k.container&&(k.container.style.cursor=d);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide();null!=k.tooltipHandler&&k.tooltipHandler.hide()}};k.click=function(a){};k.addMouseListener(m);mxEvent.addListener(document,
-"mouseleave",function(a){m.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),g=this.gridSize,d=[];b.beginUpdate();try{for(var f=this.cloneCells(a,!1,null,!0),k=0;k<a.length;k++){var m=b.getParent(a[k]),v=this.moveCells([f[k]],g,g,!1)[0];d.push(v);if(c)b.add(m,f[k]);else{var p=m.getIndex(a[k]);b.add(m,f[k],p+1)}}}finally{b.endUpdate()}return d};Graph.prototype.insertImage=function(a,c,b){if(null!=
-a&&null!=this.cellEditor.textarea){for(var g=this.cellEditor.textarea.getElementsByTagName("img"),d=[],f=0;f<g.length;f++)d.push(g[f]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==d.length+1)for(f=a.length-1;0<=f;f--)if(0==f||a[f]!=d[f-1]){a[f].setAttribute("width",c);a[f].setAttribute("height",b);break}}};Graph.prototype.insertLink=function(a){if(null!=this.cellEditor.textarea)if(0==a.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var c=
-this.cellEditor.textarea.getElementsByTagName("a"),b=[],g=0;g<c.length;g++)b.push(c[g]);document.execCommand("createlink",!1,mxUtils.trim(a));c=this.cellEditor.textarea.getElementsByTagName("a");if(c.length==b.length+1)for(g=c.length-1;0<=g;g--)if(c[g]!=b[g-1]){for(c=c[g].getElementsByTagName("a");0<c.length;){for(b=c[0].parentNode;null!=c[0].firstChild;)b.insertBefore(c[0].firstChild,c[0]);b.removeChild(c[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(a))};Graph.prototype.isCellResizable=
-function(a){var c=mxGraph.prototype.isCellResizable.apply(this,arguments),b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return c||"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==b[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,c){null==c&&(c=this.getSelectionCells());if(null!=c&&1<c.length){for(var b=[],g=null,d=null,f=0;f<c.length;f++)if(this.getModel().isVertex(c[f])){var k=this.view.getState(c[f]);if(null!=k){var m=a?k.getCenterX():
-k.getCenterY(),g=null!=g?Math.max(g,m):m,d=null!=d?Math.min(d,m):m;b.push(k)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});k=this.view.translate;m=this.view.scale;d=d/m-(a?k.x:k.y);g=g/m-(a?k.x:k.y);this.getModel().beginUpdate();try{for(var v=(g-d)/(b.length-1),g=d,f=1;f<b.length-1;f++){var p=this.view.getState(this.model.getParent(b[f].cell)),q=this.getCellGeometry(b[f].cell),g=g+v;null!=q&&null!=p&&(q=q.clone(),a?q.x=Math.round(g-q.width/2)-p.origin.x:q.y=Math.round(g-q.height/
-2)-p.origin.y,this.getModel().setGeometry(b[f].cell,q))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};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,b,g,d,f,k,m,v,p){var q=this.useCssTransforms;q&&(this.useCssTransforms=!1,
-this.view.revalidate(),this.sizeDidChange());try{c=null!=c?c:1;b=null!=b?b:0;d=null!=d?d:!0;f=null!=f?f:!0;k=null!=k?k:!0;var u=f||g?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==u)throw Error(mxResources.get("drawingEmpty"));var B=this.view.scale,z=mxUtils.createXmlDocument(),y=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"svg"):z.createElement("svg");null!=a&&(null!=y.style?y.style.backgroundColor=a:y.setAttribute("style","background-color:"+a));null==
-z.createElementNS?(y.setAttribute("xmlns",mxConstants.NS_SVG),y.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):y.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/B;var l=Math.max(1,Math.ceil(u.width*a)+2*b)+(p?5:0),D=Math.max(1,Math.ceil(u.height*a)+2*b)+(p?5:0);y.setAttribute("version","1.1");y.setAttribute("width",l+"px");y.setAttribute("height",D+"px");y.setAttribute("viewBox",(d?"-0.5 -0.5":"0 0")+" "+l+" "+D);z.appendChild(y);var E=null!=z.createElementNS?
-z.createElementNS(mxConstants.NS_SVG,"g"):z.createElement("g");y.appendChild(E);var x=this.createSvgCanvas(E);x.foOffset=d?-.5:0;x.textOffset=d?-.5:0;x.imageOffset=d?-.5:0;x.translate(Math.floor((b/c-u.x)/B),Math.floor((b/c-u.y)/B));var n=document.createElement("textarea"),O=x.createAlternateContent;x.createAlternateContent=function(a,c,b,g,d,f,k,m,v,p,q,u,B){var z=this.state;if(null!=this.foAltText&&(0==g||0!=z.fontSize&&f.length<5*g/z.fontSize)){var y=this.createElement("text");y.setAttribute("x",
-Math.round(g/2));y.setAttribute("y",Math.round((d+z.fontSize)/2));y.setAttribute("fill",z.fontColor||"black");y.setAttribute("text-anchor","middle");y.setAttribute("font-size",Math.round(z.fontSize)+"px");y.setAttribute("font-family",z.fontFamily);(z.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold");(z.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");(z.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&
-y.setAttribute("text-decoration","underline");try{return n.innerHTML=f,y.textContent=n.value,y}catch(ra){return O.apply(this,arguments)}}else return O.apply(this,arguments)};var I=this.backgroundImage;if(null!=I){c=B/c;var t=this.view.translate,G=new mxRectangle(t.x*c,t.y*c,I.width*c,I.height*c);mxUtils.intersects(u,G)&&x.image(t.x,t.y,I.width,I.height,I.src,!0)}x.scale(a);x.textEnabled=k;m=null!=m?m:this.createSvgImageExport();var F=m.drawCellState,ba=m.getLinkForCellState;m.getLinkForCellState=
-function(a,c){var b=ba.apply(this,arguments);return null==b||a.view.graph.isCustomLink(b)?null:b};m.drawCellState=function(a,c){for(var b=a.view.graph,g=b.isCellSelected(a.cell),d=b.model.getParent(a.cell);!f&&!g&&null!=d;)g=b.isCellSelected(d),d=b.model.getParent(d);(f||g)&&F.apply(this,arguments)};m.drawState(this.getView().getState(this.model.root),x);this.updateSvgLinks(y,v,!0);return y}finally{q&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.updateSvgLinks=
-function(a,c,b){a=a.getElementsByTagName("a");for(var g=0;g<a.length;g++){var d=a[g].getAttribute("href");null==d&&(d=a[g].getAttribute("xlink:href"));null!=d&&(null!=c&&/^https?:\/\//.test(d)?a[g].setAttribute("target",c):b&&this.isCustomLink(d)&&a[g].setAttribute("href","javascript:void(0);"))}};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,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.getParentByNames=function(a,c,b){for(;null!=a&&!(0<=mxUtils.indexOf(c,a.nodeName));){if(a==b)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 b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,c){for(var b=a.tBodies[0],g=b.rows[0].cells,d=0,f=0;f<g.length;f++)var k=g[f].getAttribute("colspan"),d=d+(null!=k?parseInt(k):1);b=b.insertRow(c);for(f=0;f<d;f++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=
-function(a,c){a.tBodies[0].deleteRow(c)};Graph.prototype.insertColumn=function(a,c){var b=a.tHead;if(null!=b)for(var g=0;g<b.rows.length;g++){var d=document.createElement("th");b.rows[g].appendChild(d);mxUtils.br(d)}b=a.tBodies[0];for(g=0;g<b.rows.length;g++)d=b.rows[g].insertCell(c),mxUtils.br(d);return b.rows[0].cells[0<=c?c:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var b=a.tBodies[0].rows,g=0;g<b.length;g++)b[g].cells.length>c&&b[g].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 b=document.createElement("div");b.innerHTML=a;a=document.createDocumentFragment();for(var g;g=b.firstChild;)lastNode=a.appendChild(g);c.insertNode(a)}}else(c=document.selection)&&"Control"!=c.type&&c.createRange().pasteHTML(a)};Graph.prototype.createLinkForHint=function(a,c){function b(a,c){a.length>c&&(a=a.substring(0,Math.round(c/2))+"..."+a.substring(a.length-
-Math.round(c/4)));return a}a=null!=a?a:"javascript:void(0);";if(null==c||0==c.length)c=this.isCustomLink(a)?this.getLinkTitle(a):a;var g=document.createElement("a");g.setAttribute("rel",this.linkRelation);g.setAttribute("href",this.getAbsoluteUrl(a));g.setAttribute("title",b(this.isCustomLink(a)?this.getLinkTitle(a):a,80));null!=this.linkTarget&&g.setAttribute("target",this.linkTarget);mxUtils.write(g,b(c,40));this.isCustomLink(a)&&mxEvent.addListener(g,"click",mxUtils.bind(this,function(c){this.customLinkClicked(a);
-mxEvent.consume(c)}));return g};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,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 b=this.getCellAt(c.graphX,c.graphY);null!=b&&this.isSwimlane(b)&&this.hitsSwimlaneContent(b,c.graphX,
-c.graphY)||(c.state=this.view.getState(b),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,b=!1,g=!1,d=this.fireMouseEvent;this.fireMouseEvent=function(a,f,k){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),c=this.isCellSelected(f.getCell()),b=this.isSelectionEmpty(),g=this.popupMenuHandler.isMenuShowing());d.apply(this,arguments)};this.popupMenuHandler.mouseUp=
-mxUtils.bind(this,function(a,d){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==d.getState()||!d.isSource(d.getState().control))&&(this.popupMenuHandler.popupTrigger||!g&&!mxEvent.isMouseEvent(d.getEvent())&&(b&&null==d.getCell()&&this.isSelectionEmpty()||c&&this.isCellSelected(d.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);
+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(),b=[];c.beginUpdate();try{for(var f=0;f<a.length;f++){var d=a[f];if(c.isEdge(d)){var e=c.getTerminal(d,!0),g=c.getTerminal(d,!1);c.setTerminal(d,g,!0);c.setTerminal(d,e,!1);var l=c.getGeometry(d);if(null!=l){l=l.clone();null!=l.points&&l.points.reverse();var u=
+l.getTerminalPoint(!0),n=l.getTerminalPoint(!1);l.setTerminalPoint(u,!1);l.setTerminalPoint(n,!0);c.setGeometry(d,l);var t=this.view.getState(d),C=this.view.getState(e),q=this.view.getState(g);if(null!=t){var x=null!=C?this.getConnectionConstraint(t,C,!0):null,y=null!=q?this.getConnectionConstraint(t,q,!1):null;this.setConnectionConstraint(d,e,!0,y);this.setConnectionConstraint(d,g,!1,x)}b.push(d)}}else if(c.isVertex(d)&&(l=this.getCellGeometry(d),null!=l)){l=l.clone();l.x+=l.width/2-l.height/2;l.y+=
+l.height/2-l.width/2;var A=l.width;l.width=l.height;l.height=A;c.setGeometry(d,l);var k=this.view.getState(d);if(null!=k){var D=k.style[mxConstants.STYLE_DIRECTION]||"east";"east"==D?D="south":"south"==D?D="west":"west"==D?D="north":"north"==D&&(D="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,D,[d])}b.push(d)}}}finally{c.endUpdate()}return b};Graph.prototype.stencilHasPlaceholders=function(a){if(null!=a&&null!=a.fgNode)for(a=a.fgNode.firstChild;null!=a;){if("text"==a.nodeName&&"1"==a.getAttribute("placeholders"))return!0;
+a=a.nextSibling}return!1};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 b=0;b<c.length;b++){var f=this.view.getState(c[b]);null!=f&&null!=f.shape&&null!=f.shape.stencil&&this.stencilHasPlaceholders(f.shape.stencil)?this.removeStateForCell(c[b]):this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b],
+!1,!1)}}};Graph.prototype.replaceElement=function(a,c){for(var b=a.ownerDocument.createElement(null!=c?c:"span"),f=Array.prototype.slice.call(a.attributes);attr=f.pop();)b.setAttribute(attr.nodeName,attr.nodeValue);b.innerHTML=a.innerHTML;a.parentNode.replaceChild(b,a)};Graph.prototype.processElements=function(a,c){for(var b=a.getElementsByTagName("*"),f=0;f<b.length;f++)c(b[f])};Graph.prototype.updateLabelElements=function(a,c,b){a=null!=a?a:this.getSelectionCells();for(var f=document.createElement("div"),
+d=0;d<a.length;d++)if(this.isHtmlLabel(a[d])){var e=this.convertValueToString(a[d]);if(null!=e&&0<e.length){f.innerHTML=e;for(var g=f.getElementsByTagName(null!=b?b:"*"),l=0;l<g.length;l++)c(g[l]);f.innerHTML!=e&&this.cellLabelChanged(a[d],f.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,c,b){c=Graph.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var f=a.getAttribute("placeholder"),
+d=a;null!=d;){if(d==this.model.getRoot()||null!=d.value&&"object"==typeof d.value&&d.hasAttribute(f)){this.setAttributeForCell(d,f,c);break}d=this.model.getParent(d)}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,b=0;b<a.length;b++)c.put(a[b],!0);for(var f=[],b=0;b<a.length;b++){var d=this.model.getParent(a[b]);null==d||
+c.get(d)||(c.put(d,!0),f.push(d))}for(b=0;b<f.length;b++)if(d=this.view.getState(f[b]),null!=d&&(this.model.isEdge(d.cell)||this.model.isVertex(d.cell))&&this.isCellDeletable(d.cell)){var e=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&g==mxConstants.NONE){e=!0;for(g=0;g<this.model.getChildCount(d.cell)&&e;g++)c.get(this.model.getChildAt(d.cell,g))||(e=!1);e&&a.push(d.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,
+arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var f=this.view.getState(a[b]);if(null!=f){var d=mxUtils.getValue(f.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),f=mxUtils.getValue(f.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);d==mxConstants.NONE&&f==mxConstants.NONE&&c.push(a[b])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,c){this.setAttributeForCell(a,
+"link",c)};Graph.prototype.setTooltipForCell=function(a,c){this.setAttributeForCell(a,"tooltip",c)};Graph.prototype.getAttributeForCell=function(a,c,b){return null!=a.value&&"object"===typeof a.value?a.value.getAttribute(c)||b:b};Graph.prototype.setAttributeForCell=function(a,c,b){var f;null!=a.value&&"object"==typeof a.value?f=a.value.cloneNode(!0):(f=mxUtils.createXmlDocument().createElement("UserObject"),f.setAttribute("label",a.value||""));null!=b?f.setAttribute(c,b):f.removeAttribute(c);this.model.setValue(a,
+f)};Graph.prototype.getDropTarget=function(a,c,b,f){this.getModel();if(mxEvent.isAltDown(c))return null;for(var d=0;d<a.length;d++)if(this.model.isEdge(this.model.getParent(a[d])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,c){if(this.isEnabled()){var b=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),
+mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(c)){var f=this.model.isEdge(c)?this.view.getState(c):null,d=mxEvent.getSource(a);this.firstClickState!=f||this.firstClickSource!=d||null!=f&&null!=f.text&&null!=f.text.node&&null!=f.text.boundingBox&&(mxUtils.contains(f.text.boundingBox,b.x,b.y)||mxUtils.isAncestorNode(f.text.node,mxEvent.getSource(a)))||(null!=f||this.isCellLocked(this.getDefaultParent()))&&(null==f||this.isCellLocked(f.cell))||!(null!=f||mxClient.IS_VML&&d==this.view.getCanvas()||
+mxClient.IS_SVG&&d==this.view.getCanvas().ownerSVGElement)||(c=this.addText(b.x,b.y,f))}mxGraph.prototype.dblClick.call(this,a,c)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),c=this.container.scrollLeft/this.view.scale-this.view.translate.x,b=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var f=this.getPageLayout(),d=this.getPageSize(),c=Math.max(c,f.x*d.width),b=Math.max(b,f.y*d.height);return new mxPoint(this.snap(c+a),this.snap(b+a))};
+Graph.prototype.getFreeInsertPoint=function(){var a=this.view,c=this.getGraphBounds(),b=this.getInsertPoint(),f=this.snap(Math.round(Math.max(b.x,c.x/a.scale-a.translate.x+(0==c.width?2*this.gridSize:0)))),a=this.snap(Math.round(Math.max(b.y,(c.y+c.height)/a.scale-a.translate.y+2*this.gridSize)));return new mxPoint(f,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,b){var f=new mxCell;f.value="Text";f.style="text;html=1;resizable=0;points=[];";f.geometry=
+new mxGeometry(0,0,0,0);f.vertex=!0;if(null!=b){f.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";f.geometry.relative=!0;f.connectable=!1;var d=this.view.getRelativePoint(b,a,c);f.geometry.x=Math.round(1E4*d.x)/1E4;f.geometry.y=Math.round(d.y);f.geometry.offset=new mxPoint(0,0);var d=this.view.getPoint(b,f.geometry),e=this.view.scale;f.geometry.offset=new mxPoint(Math.round((a-d.x)/e),Math.round((c-d.y)/e))}else f.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;",
+d=this.view.translate,f.geometry.width=40,f.geometry.height=20,f.geometry.x=Math.round(a/this.view.scale)-d.x,f.geometry.y=Math.round(c/this.view.scale)-d.y;this.getModel().beginUpdate();try{this.addCells([f],null!=b?b.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[f])),this.autoSizeCell(f)}finally{this.getModel().endUpdate()}return f};Graph.prototype.addClickHandler=function(a,c,b){var f=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var b=
+0;b<a.length;b++){var f=this.getAbsoluteUrl(a[b].getAttribute("href"));null!=f&&(a[b].setAttribute("rel",this.linkRelation),a[b].setAttribute("href",f),null!=c&&mxEvent.addGestureListeners(a[b],null,null,c))}});this.model.addListener(mxEvent.CHANGE,f);f();var d=this.container.style.cursor,e=this.getTolerance(),g=this,l={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,b){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 b=Math.abs(this.startX-c.getGraphX()),f=Math.abs(this.startY-c.getGraphY());(b>e||f>e)&&this.clear()}}else{for(b=c.getSource();null!=b&&"a"!=b.nodeName.toLowerCase();)b=b.parentNode;null!=b?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,f){for(var d=f.getSource(),l=f.getEvent();null!=d&&"a"!=d.nodeName.toLowerCase();)d=d.parentNode;null==d&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==f.sourceState||!f.isSource(f.sourceState.control))&&((mxEvent.isLeftMouseButton(l)||mxEvent.isMiddleMouseButton(l))&&
+!mxEvent.isPopupTrigger(l)||mxEvent.isTouchEvent(l))&&(null!=this.currentLink?(d=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&d||null==c||c(l,this.currentLink),mxEvent.isConsumed(l)||(l=mxEvent.isMiddleMouseButton(l)?"_blank":d?g.linkTarget:"_top",g.openLink(this.currentLink,l),f.consume())):null!=b&&!f.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&Math.abs(this.startX-f.getGraphX())<e&&Math.abs(this.startY-
+f.getGraphY())<e&&b(f.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=d);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 b=this.getModel(),f=this.gridSize,d=[];b.beginUpdate();try{for(var e=this.cloneCells(a,!1,null,!0),g=0;g<a.length;g++){var l=b.getParent(a[g]),u=this.moveCells([e[g]],f,f,!1)[0];d.push(u);if(c)b.add(l,e[g]);else{var n=l.getIndex(a[g]);b.add(l,e[g],n+1)}}}finally{b.endUpdate()}return d};Graph.prototype.insertImage=function(a,c,b){if(null!=
+a&&null!=this.cellEditor.textarea){for(var f=this.cellEditor.textarea.getElementsByTagName("img"),d=[],e=0;e<f.length;e++)d.push(f[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==d.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=d[e-1]){a[e].setAttribute("width",c);a[e].setAttribute("height",b);break}}};Graph.prototype.insertLink=function(a){if(null!=this.cellEditor.textarea)if(0==a.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var c=
+this.cellEditor.textarea.getElementsByTagName("a"),b=[],f=0;f<c.length;f++)b.push(c[f]);document.execCommand("createlink",!1,mxUtils.trim(a));c=this.cellEditor.textarea.getElementsByTagName("a");if(c.length==b.length+1)for(f=c.length-1;0<=f;f--)if(c[f]!=b[f-1]){for(c=c[f].getElementsByTagName("a");0<c.length;){for(b=c[0].parentNode;null!=c[0].firstChild;)b.insertBefore(c[0].firstChild,c[0]);b.removeChild(c[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(a))};Graph.prototype.isCellResizable=
+function(a){var c=mxGraph.prototype.isCellResizable.apply(this,arguments),b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return c||"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==b[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,c){null==c&&(c=this.getSelectionCells());if(null!=c&&1<c.length){for(var b=[],f=null,d=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(),f=null!=f?Math.max(f,l):l,d=null!=d?Math.min(d,l):l;b.push(g)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});g=this.view.translate;l=this.view.scale;d=d/l-(a?g.x:g.y);f=f/l-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var u=(f-d)/(b.length-1),f=d,e=1;e<b.length-1;e++){var n=this.view.getState(this.model.getParent(b[e].cell)),t=this.getCellGeometry(b[e].cell),f=f+u;null!=t&&null!=n&&(t=t.clone(),a?t.x=Math.round(f-t.width/2)-n.origin.x:t.y=Math.round(f-t.height/
+2)-n.origin.y,this.getModel().setGeometry(b[e].cell,t))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};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,b,f,d,e,g,l,u,n){var t=this.useCssTransforms;t&&(this.useCssTransforms=!1,
+this.view.revalidate(),this.sizeDidChange());try{c=null!=c?c:1;b=null!=b?b:0;d=null!=d?d:!0;e=null!=e?e:!0;g=null!=g?g:!0;var C=e||f?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==C)throw Error(mxResources.get("drawingEmpty"));var q=this.view.scale,x=mxUtils.createXmlDocument(),y=null!=x.createElementNS?x.createElementNS(mxConstants.NS_SVG,"svg"):x.createElement("svg");null!=a&&(null!=y.style?y.style.backgroundColor=a:y.setAttribute("style","background-color:"+a));null==
+x.createElementNS?(y.setAttribute("xmlns",mxConstants.NS_SVG),y.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):y.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/q;var k=Math.max(1,Math.ceil(C.width*a)+2*b)+(n?5:0),A=Math.max(1,Math.ceil(C.height*a)+2*b)+(n?5:0);y.setAttribute("version","1.1");y.setAttribute("width",k+"px");y.setAttribute("height",A+"px");y.setAttribute("viewBox",(d?"-0.5 -0.5":"0 0")+" "+k+" "+A);x.appendChild(y);var D=null!=x.createElementNS?
+x.createElementNS(mxConstants.NS_SVG,"g"):x.createElement("g");y.appendChild(D);var v=this.createSvgCanvas(D);v.foOffset=d?-.5:0;v.textOffset=d?-.5:0;v.imageOffset=d?-.5:0;v.translate(Math.floor((b/c-C.x)/q),Math.floor((b/c-C.y)/q));var m=document.createElement("textarea"),K=v.createAlternateContent;v.createAlternateContent=function(a,c,b,f,d,e,g,l,u,n,t,C,q){var x=this.state;if(null!=this.foAltText&&(0==f||0!=x.fontSize&&e.length<5*f/x.fontSize)){var y=this.createElement("text");y.setAttribute("x",
+Math.round(f/2));y.setAttribute("y",Math.round((d+x.fontSize)/2));y.setAttribute("fill",x.fontColor||"black");y.setAttribute("text-anchor","middle");y.setAttribute("font-size",Math.round(x.fontSize)+"px");y.setAttribute("font-family",x.fontFamily);(x.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold");(x.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");(x.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&
+y.setAttribute("text-decoration","underline");try{return m.innerHTML=e,y.textContent=m.value,y}catch(ra){return K.apply(this,arguments)}}else return K.apply(this,arguments)};var H=this.backgroundImage;if(null!=H){c=q/c;var E=this.view.translate,p=new mxRectangle(E.x*c,E.y*c,H.width*c,H.height*c);mxUtils.intersects(C,p)&&v.image(E.x,E.y,H.width,H.height,H.src,!0)}v.scale(a);v.textEnabled=g;l=null!=l?l:this.createSvgImageExport();var F=l.drawCellState,P=l.getLinkForCellState;l.getLinkForCellState=function(a,
+c){var b=P.apply(this,arguments);return null==b||a.view.graph.isCustomLink(b)?null:b};l.drawCellState=function(a,c){for(var b=a.view.graph,f=b.isCellSelected(a.cell),d=b.model.getParent(a.cell);!e&&!f&&null!=d;)f=b.isCellSelected(d),d=b.model.getParent(d);(e||f)&&F.apply(this,arguments)};l.drawState(this.getView().getState(this.model.root),v);this.updateSvgLinks(y,u,!0);return y}finally{t&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.updateSvgLinks=function(a,
+c,b){a=a.getElementsByTagName("a");for(var f=0;f<a.length;f++){var d=a[f].getAttribute("href");null==d&&(d=a[f].getAttribute("xlink:href"));null!=d&&(null!=c&&/^https?:\/\//.test(d)?a[f].setAttribute("target",c):b&&this.isCustomLink(d)&&a[f].setAttribute("href","javascript:void(0);"))}};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,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.getParentByNames=function(a,c,b){for(;null!=a&&!(0<=mxUtils.indexOf(c,a.nodeName));){if(a==b)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 b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,c){for(var b=a.tBodies[0],f=b.rows[0].cells,d=0,e=0;e<f.length;e++)var g=f[e].getAttribute("colspan"),d=d+(null!=g?parseInt(g):1);b=b.insertRow(c);for(e=0;e<d;e++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=
+function(a,c){a.tBodies[0].deleteRow(c)};Graph.prototype.insertColumn=function(a,c){var b=a.tHead;if(null!=b)for(var f=0;f<b.rows.length;f++){var d=document.createElement("th");b.rows[f].appendChild(d);mxUtils.br(d)}b=a.tBodies[0];for(f=0;f<b.rows.length;f++)d=b.rows[f].insertCell(c),mxUtils.br(d);return b.rows[0].cells[0<=c?c:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var b=a.tBodies[0].rows,f=0;f<b.length;f++)b[f].cells.length>c&&b[f].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 b=document.createElement("div");b.innerHTML=a;a=document.createDocumentFragment();for(var f;f=b.firstChild;)lastNode=a.appendChild(f);c.insertNode(a)}}else(c=document.selection)&&"Control"!=c.type&&c.createRange().pasteHTML(a)};Graph.prototype.createLinkForHint=function(a,c){function b(a,c){a.length>c&&(a=a.substring(0,Math.round(c/2))+"..."+a.substring(a.length-
+Math.round(c/4)));return a}a=null!=a?a:"javascript:void(0);";if(null==c||0==c.length)c=this.isCustomLink(a)?this.getLinkTitle(a):a;var f=document.createElement("a");f.setAttribute("rel",this.linkRelation);f.setAttribute("href",this.getAbsoluteUrl(a));f.setAttribute("title",b(this.isCustomLink(a)?this.getLinkTitle(a):a,80));null!=this.linkTarget&&f.setAttribute("target",this.linkTarget);mxUtils.write(f,b(c,40));this.isCustomLink(a)&&mxEvent.addListener(f,"click",mxUtils.bind(this,function(c){this.customLinkClicked(a);
+mxEvent.consume(c)}));return f};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,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 b=this.getCellAt(c.graphX,c.graphY);null!=b&&this.isSwimlane(b)&&this.hitsSwimlaneContent(b,c.graphX,
+c.graphY)||(c.state=this.view.getState(b),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,b=!1,f=!1,d=this.fireMouseEvent;this.fireMouseEvent=function(a,e,g){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),c=this.isCellSelected(e.getCell()),b=this.isSelectionEmpty(),f=this.popupMenuHandler.isMenuShowing());d.apply(this,arguments)};this.popupMenuHandler.mouseUp=
+mxUtils.bind(this,function(a,d){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==d.getState()||!d.isSource(d.getState().control))&&(this.popupMenuHandler.popupTrigger||!f&&!mxEvent.isMouseEvent(d.getEvent())&&(b&&null==d.getCell()&&this.isSelectionEmpty()||c&&this.isCellSelected(d.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.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.alignText=function(a,c){!this.isTableSelected()==(null==c||!mxEvent.isShiftDown(c))&&(this.graph.cellEditor.setAlign(a),this.graph.processElements(this.textarea,function(a){a.removeAttribute("align");a.style.textAlign=null}));document.execCommand("justify"+a.toLowerCase(),!1,null)};mxCellEditor.prototype.saveSelection=
-function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount){for(var c=[],b=0,g=a.rangeCount;b<g;++b)c.push(a.getRangeAt(b));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,b=a.length;c<b;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(X){}};
-var t=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br","1"));t.apply(this,arguments)};var x=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?x.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};
-mxCellEditor.prototype.escapeCancelsEditing=!1;var A=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){A.apply(this,arguments);var b=this.graph.view.getState(a);this.textarea.className=null!=b&&1==b.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);var b=this.graph.getModel().getParent(a),g=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(b)&&
-null!=g&&g.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 C=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(a){function c(a,b){b.originalNode=a;a=a.firstChild;for(var g=b.firstChild;null!=a&&null!=
-g;)c(a,g),a=a.nextSibling,g=g.nextSibling;return b}function b(a,c){if(null!=a)if(c.originalNode!=a)g(a);else for(a=a.firstChild,c=c.firstChild;null!=a;){var d=a.nextSibling;null==c?g(a):(b(a,c),c=c.nextSibling);a=d}}function g(a){for(var c=a.firstChild;null!=c;){var b=c.nextSibling;g(c);c=b}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)}C.apply(this,arguments);mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var g=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){null!=this.textarea&&
-(0<=this.textarea.innerHTML.indexOf("<o:OfficeDocumentSettings>")||0<=this.textarea.innerHTML.indexOf("\x3c!--[if !mso]>"))&&b(this.textarea,g)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell);if(null!=a){var c=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br","1"),b=this.saveSelection();if(this.codeViewMode){m=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<m.length&&"\n"==m.charAt(m.length-1)&&(m=m.substring(0,m.length-1));m=this.graph.sanitizeHtml(c?
-m.replace(/\n/g,"<br/>"):m,!0);this.textarea.className="mxCellEditor geContentEditable";var g=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),d=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),f=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,k=(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(g*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(g)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=f?"bold":"normal";this.textarea.style.fontStyle=k?"italic":"";this.textarea.style.fontFamily=
-c;this.textarea.style.textAlign=d;this.textarea.style.padding="0px";this.textarea.innerHTML!=m&&(this.textarea.innerHTML=m,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 m=mxUtils.htmlEntities(this.textarea.innerHTML);mxClient.IS_QUIRKS||8==document.documentMode||
-(m=mxUtils.replaceTrailingNewlines(m,"<div><br></div>"));m=this.graph.sanitizeHtml(c?m.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):m,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var g=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(g*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(g)+"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!=m&&(this.textarea.innerHTML=m);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=b;this.resize()}};var c=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,b){if(null!=this.textarea)if(a=this.graph.getView().getState(this.editingCell),
-this.codeViewMode&&null!=a){var g=a.view.scale;this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*g;this.bounds.height=60*g;var d=null!=a.text?a.text.margin:null;null==d&&(d=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+=d.x*this.bounds.width;this.bounds.y+=d.y*this.bounds.height}this.textarea.style.width=
-Math.round((this.bounds.width-4)/g)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/g)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/g)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*g);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/g)+(this.textarea.offsetWidth-
-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*g);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=g:mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+g+","+g+")")}else this.textarea.style.height="",this.textarea.style.overflow="",c.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=
+function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount){for(var c=[],b=0,f=a.rangeCount;b<f;++b)c.push(a.getRangeAt(b));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,b=a.length;c<b;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(V){}};
+var p=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br","1"));p.apply(this,arguments)};var v=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?v.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};
+mxCellEditor.prototype.escapeCancelsEditing=!1;var B=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){B.apply(this,arguments);var b=this.graph.view.getState(a);this.textarea.className=null!=b&&1==b.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);var b=this.graph.getModel().getParent(a),f=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(b)&&
+null!=f&&f.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 z=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(a){function c(a,b){b.originalNode=a;a=a.firstChild;for(var f=b.firstChild;null!=a&&null!=
+f;)c(a,f),a=a.nextSibling,f=f.nextSibling;return b}function b(a,c){if(null!=a)if(c.originalNode!=a)f(a);else for(a=a.firstChild,c=c.firstChild;null!=a;){var d=a.nextSibling;null==c?f(a):(b(a,c),c=c.nextSibling);a=d}}function f(a){for(var c=a.firstChild;null!=c;){var b=c.nextSibling;f(c);c=b}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)}z.apply(this,arguments);mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var f=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){null!=this.textarea&&
+(0<=this.textarea.innerHTML.indexOf("<o:OfficeDocumentSettings>")||0<=this.textarea.innerHTML.indexOf("\x3c!--[if !mso]>"))&&b(this.textarea,f)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell);if(null!=a){var c=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br","1"),b=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 f=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),d=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(f*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(f)+"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=d;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(/&lt;br\s*.?&gt;/g,"<br>"):l,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var f=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(f*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(f)+"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.switchSelectionState=b;this.resize()}};var c=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,b){if(null!=this.textarea)if(a=this.graph.getView().getState(this.editingCell),
+this.codeViewMode&&null!=a){var f=a.view.scale;this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*f;this.bounds.height=60*f;var d=null!=a.text?a.text.margin:null;null==d&&(d=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+=d.x*this.bounds.width;this.bounds.y+=d.y*this.bounds.height}this.textarea.style.width=
+Math.round((this.bounds.width-4)/f)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/f)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/f)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*f);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/f)+(this.textarea.offsetWidth-
+this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*f);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=f:mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+f+","+f+")")}else this.textarea.style.height="",this.textarea.style.overflow="",c.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=
function(a,c){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var b=this.graph.getEditingValue(a.cell,c);"1"==mxUtils.getValue(a.style,"nl2Br","1")&&(b=b.replace(/\n/g,"<br/>"));return b=this.graph.sanitizeHtml(b,!0)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(a){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var c=this.graph.sanitizeHtml(this.textarea.innerHTML,
-!0);return c="1"==mxUtils.getValue(a.style,"nl2Br","1")?c.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):c.replace(/\r\n/g,"").replace(/\n/g,"")};var g=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&&this.toggleViewMode();g.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(ba){}};var k=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,
-c){this.graph.getModel().beginUpdate();try{if(k.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==c&&b==mxConstants.NONE&&g==mxConstants.NONE&&this.graph.removeCells([a.cell],!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var c=mxUtils.getValue(a.style,
-mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);null!=c&&c!=mxConstants.NONE||!(null!=a.cell.geometry&&0<a.cell.geometry.width)||0==mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0)&&0!=mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)||(c=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,null));c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize=function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var q=
-mxGraphHandler.prototype.moveCells;mxGraphHandler.prototype.moveCells=function(a,c,b,g,d,f){mxEvent.isAltDown(f)&&(d=null);q.apply(this,arguments)};mxGraphView.prototype.formatUnitText=function(a){return a?b(a,this.unit):a};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var g=this.graph.view.translate,d=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/d-g.x);g=this.roundLength((this.bounds.y+
-this.currentDy)/d-g.y);d=this.graph.view.unit;this.hint.innerHTML=b(c,d)+", "+b(g,d);this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,c){return!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&
+!0);return c="1"==mxUtils.getValue(a.style,"nl2Br","1")?c.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):c.replace(/\r\n/g,"").replace(/\n/g,"")};var f=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&&this.toggleViewMode();f.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(ca){}};var g=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,
+c){this.graph.getModel().beginUpdate();try{if(g.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),f=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==c&&b==mxConstants.NONE&&f==mxConstants.NONE&&this.graph.removeCells([a.cell],!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var c=mxUtils.getValue(a.style,
+mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);null!=c&&c!=mxConstants.NONE||!(null!=a.cell.geometry&&0<a.cell.geometry.width)||0==mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0)&&0!=mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)||(c=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,null));c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize=function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var t=
+mxGraphHandler.prototype.moveCells;mxGraphHandler.prototype.moveCells=function(a,c,b,f,d,e){mxEvent.isAltDown(e)&&(d=null);t.apply(this,arguments)};mxGraphView.prototype.formatUnitText=function(a){return a?b(a,this.unit):a};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var f=this.graph.view.translate,d=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/d-f.x);f=this.roundLength((this.bounds.y+
+this.currentDy)/d-f.y);d=this.graph.view.unit;this.hint.innerHTML=b(c,d)+", "+b(f,d);this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,c){return!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&
!mxEvent.isControlDown(c.getEvent())&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,c){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(c.getEvent())||mxEvent.isMetaDown(c.getEvent())};
-var p=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),c=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(c/=2,a.x=this.sizers[0].bounds.width+c,a.y=this.sizers[0].bounds.height+c):a=p.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(c){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));
-if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"&deg;";else{c=this.state.view.scale;var g=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/c),g)+" x "+b(this.roundLength(this.bounds.height/c),g)}c=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==c&&(c=this.bounds);this.hint.style.left=c.x+Math.round((c.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=
-c.y+c.height+12+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var m=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(a,c){m.apply(this,arguments);null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display=
-"none")};var z=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(a,c){z.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(c,g){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var d=this.graph.view.translate,f=this.graph.view.scale,k=this.roundLength(g.x/f-d.x),d=this.roundLength(g.y/f-d.y),f=this.graph.view.unit;this.hint.innerHTML=
-b(k,f)+", "+b(d,f);this.hint.style.visibility="visible";if(this.isSource||this.isTarget)null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(k=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*k.x)+"%, "+Math.round(100*k.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(c.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(c.getGraphY(),g.y)+this.state.view.graph.gridSize+
+var n=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),c=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(c/=2,a.x=this.sizers[0].bounds.width+c,a.y=this.sizers[0].bounds.height+c):a=n.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(c){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));
+if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"&deg;";else{c=this.state.view.scale;var f=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/c),f)+" x "+b(this.roundLength(this.bounds.height/c),f)}c=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==c&&(c=this.bounds);this.hint.style.left=c.x+Math.round((c.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=
+c.y+c.height+12+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var l=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(a,c){l.apply(this,arguments);null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display=
+"none")};var x=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(a,c){x.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(c,f){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var d=this.graph.view.translate,e=this.graph.view.scale,g=this.roundLength(f.x/e-d.x),d=this.roundLength(f.y/e-d.y),e=this.graph.view.unit;this.hint.innerHTML=
+b(g,e)+", "+b(d,e);this.hint.style.visibility="visible";if(this.isSource||this.isTarget)null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(g=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*g.x)+"%, "+Math.round(100*g.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(c.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(c.getGraphY(),f.y)+this.state.view.graph.gridSize+
"px";null!=this.linkHint&&(this.linkHint.style.display="none")};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/>'):new mxImage(IMAGE_PATH+"/handle-main.png",17,17);HoverIcons.prototype.secondaryHandle=mxClient.IS_SVG?Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>'):
new mxImage(IMAGE_PATH+"/handle-secondary.png",17,17);HoverIcons.prototype.fixedHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/><path d="m 7 7 L 11 11 M 7 11 L 11 7" stroke="#fff"/>'):new mxImage(IMAGE_PATH+"/handle-fixed.png",17,17);HoverIcons.prototype.terminalHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/><circle cx="9" cy="9" r="2" stroke="#fff" fill="transparent"/>'):
new mxImage(IMAGE_PATH+"/handle-terminal.png",17,17);HoverIcons.prototype.rotationHandle=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAYAAACkCdXRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA6ZJREFUeNqM001IY1cUB/D/fYmm2sbR2lC1zYlgoRG6MpEyBlpxM9iFIGKFIm3s0lCKjOByhCLZCFqLBF1YFVJdSRbdFHRhBbULtRuFVBTzYRpJgo2mY5OX5N9Fo2TG+eiFA/dd3vvd8+65ByTxshARTdf1JySp6/oTEdFe9T5eg5lIcnBwkCSZyWS+exX40oyur68/KxaLf5Okw+H4X+A9JBaLfUySZ2dnnJqaosPhIAACeC34DJRKpb7IZrMcHx+nwWCgUopGo/EOKwf9fn/1CzERUevr6+9ls1mOjIwQAH0+H4PBIKPR6D2ofAQCgToRUeVYJUkuLy8TANfW1kiS8/PzCy84Mw4MDBAAZ2dnmc/nub+/X0MSEBF1cHDwMJVKsaGhgV6vl+l0mqOjo1+KyKfl1dze3l4NBoM/PZ+diFSLiIKIGBOJxA9bW1sEwNXVVSaTyQMRaRaRxrOzs+9J8ujoaE5EPhQRq67rcZ/PRwD0+/3Udf03EdEgIqZisZibnJykwWDg4eEhd3Z2xkXELCJvPpdBrYjUiEhL+Xo4HH4sIhUaAKNSqiIcDsNkMqG+vh6RSOQQQM7tdhsAQCkFAHC73UUATxcWFqypVApmsxnDw8OwWq2TADQNgAYAFosF+XweyWQSdru9BUBxcXFRB/4rEgDcPouIIx6P4+bmBi0tLSCpAzBqAIqnp6c/dnZ2IpfLYXNzE62traMADACKNputpr+/v8lms9UAKAAwiMjXe3t7KBQKqKurQy6Xi6K0i2l6evpROp1mbW0t29vbGY/Hb8/IVIqq2zlJXl1dsaOjg2azmefn5wwEAl+JSBVExCgi75PkzMwMlVJsbGxkIpFgPp8PX15ePopEIs3JZPITXdf/iEajbGpqolKKExMT1HWdHo/nIxGpgIgoEXnQ3d39kCTHxsYIgC6Xi3NzcwyHw8xkMozFYlxaWmJbWxuVUuzt7WUul6PX6/1cRN4WEe2uA0SkaWVl5XGpRVhdXU0A1DSNlZWVdz3qdDrZ09PDWCzG4+Pjn0XEWvp9KJKw2WwKwBsA3gHQHAqFfr24uMDGxgZ2d3cRiUQAAHa7HU6nE319fTg5Ofmlq6vrGwB/AngaCoWK6rbsNptNA1AJoA7Aux6Pp3NoaMhjsVg+QNmIRqO/u1yubwFEASRKUAEA7rASqABUAKgC8KAUb5XWCOAfAFcA/gJwDSB7C93DylCtdM8qABhLc5TumV6KQigUeubjfwcAHkQJ94ndWeYAAAAASUVORK5CYII=":
@@ -2464,326 +2464,326 @@ HoverIcons.prototype.refreshTarget,Sidebar.prototype.roundDrop=HoverIcons.protot
HoverIcons.prototype.triangleDown.src,(new Image).src=HoverIcons.prototype.triangleLeft.src,(new Image).src=HoverIcons.prototype.refreshTarget.src,(new Image).src=HoverIcons.prototype.roundDrop.src);mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSizers=!0;mxVertexHandler.prototype.livePreview=!0;mxGraphHandler.prototype.maxLivePreview=16;mxRubberband.prototype.defaultOpacity=30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=
!0;mxVertexHandler.prototype.rotationHandleVSpacing=-20;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=
function(a){return!mxEvent.isShiftDown(a.getEvent())};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 D=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,c){D.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=
+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 A=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,c){A.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 b=null!=this.div&&"none"!=this.div.style.display,
-g=null,d=null,f=null,k=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(g=this.first.x,d=this.first.y,f=(this.currentX-g)/this.graph.view.scale,k=(this.currentY-d)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(f=this.graph.snap(f),k=this.graph.snap(k),this.graph.isGridEnabled()||(Math.abs(f)<this.graph.tolerance&&(f=0),Math.abs(k)<this.graph.tolerance&&(k=0))));this.reset();if(b){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var f=new mxRectangle(this.x,
-this.y,this.width,this.height),m=this.graph.getCells(f.x,f.y,f.width,f.height);this.graph.removeSelectionCells(m)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(m=this.graph.getCellsBeyond(g,d,this.graph.getDefaultParent(),!0,!0),b=0;b<m.length;b++)if(this.graph.isCellMovable(m[b])){var v=this.graph.view.getState(m[b]),p=this.graph.getCellGeometry(m[b]);null!=v&&null!=p&&(p=p.clone(),p.translate(f,k),this.graph.model.setGeometry(m[b],p))}}finally{this.graph.model.endUpdate()}}else f=
-new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(f,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var b=mxUtils.getScrollOrigin(this.graph.container),g=mxUtils.getOffset(this.graph.container);b.x-=g.x;b.y-=g.y;var g=c.getX()+b.x,b=c.getY()+b.y,d=this.first.x-g,f=this.first.y-b,k=this.graph.tolerance;if(null!=this.div||Math.abs(d)>k||Math.abs(f)>k)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),
-this.update(g,b),this.isSpaceEvent(c)?(g=this.x+this.width,b=this.y+this.height,d=this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(this.width=this.graph.snap(this.width/d)*d,this.height=this.graph.snap(this.height/d)*d,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=g-this.width),this.y<this.first.y&&(this.y=b-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor=
+f=null,d=null,e=null,g=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(f=this.first.x,d=this.first.y,e=(this.currentX-f)/this.graph.view.scale,g=(this.currentY-d)/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(b){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(f,d,this.graph.getDefaultParent(),!0,!0),b=0;b<l.length;b++)if(this.graph.isCellMovable(l[b])){var u=this.graph.view.getState(l[b]),n=this.graph.getCellGeometry(l[b]);null!=u&&null!=n&&(n=n.clone(),n.translate(e,g),this.graph.model.setGeometry(l[b],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 b=mxUtils.getScrollOrigin(this.graph.container),f=mxUtils.getOffset(this.graph.container);b.x-=f.x;b.y-=f.y;var f=c.getX()+b.x,b=c.getY()+b.y,d=this.first.x-f,e=this.first.y-b,g=this.graph.tolerance;if(null!=this.div||Math.abs(d)>g||Math.abs(e)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),
+this.update(f,b),this.isSpaceEvent(c)?(f=this.x+this.width,b=this.y+this.height,d=this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(this.width=this.graph.snap(this.width/d)*d,this.height=this.graph.snap(this.height/d)*d,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=f-this.width),this.y<this.first.y&&(this.y=b-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor=
"white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"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 u=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),
-this.secondDiv=null);u.apply(this,arguments)};var F=(new Date).getTime(),y=0,G=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,g){G.apply(this,arguments);b!=this.currentTerminalState?(F=(new Date).getTime(),y=0):y=(new Date).getTime()-F;this.currentTerminalState=b};var v=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&
-2E3<y||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&v.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,g=this.state.getVisibleTerminalState(b),d=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,
-g,b):null,b=null!=(null!=d?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),d):null)?this.fixedHandleImage:null!=d&&null!=g?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var B=mxVertexHandler.prototype.createSizerShape;
-mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return B.apply(this,arguments)};var O=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),g=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=g&&g.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 O.apply(this,arguments)};var Z=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var a=Z.apply(this,arguments),c=[],b=0;b<a.length;b++)"1"!=mxUtils.getValue(a[b].style,"part","0")&&c.push(a[b]);return c};var I=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),
-b=c.getParent(a.cell),g=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=g&&g.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):I.apply(this,arguments)};var Q=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),g=b.getParent(this.state.cell),d=this.graph.getCellGeometry(this.state.cell);
-(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(g)||null==d||!d.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&Q.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};
-var E=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){E.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var L=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(a,c){L.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&
-(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display="")};var P=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){P.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var c=mxUtils.bind(this,function(){null!=this.specialHandle&&(this.specialHandle.node.style.display=this.graph.isEnabled()&&
+"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 q=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),
+this.secondDiv=null);q.apply(this,arguments)};var F=(new Date).getTime(),y=0,E=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,f){E.apply(this,arguments);b!=this.currentTerminalState?(F=(new Date).getTime(),y=0):y=(new Date).getTime()-F;this.currentTerminalState=b};var u=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&
+2E3<y||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&u.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,f=this.state.getVisibleTerminalState(b),d=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,
+f,b):null,b=null!=(null!=d?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),d):null)?this.fixedHandleImage:null!=d&&null!=f?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var C=mxVertexHandler.prototype.createSizerShape;
+mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return C.apply(this,arguments)};var K=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),f=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=f&&f.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 K.apply(this,arguments)};var Y=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var a=Y.apply(this,arguments),c=[],b=0;b<a.length;b++)"1"!=mxUtils.getValue(a[b].style,"part","0")&&c.push(a[b]);return c};var H=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),
+b=c.getParent(a.cell),f=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=f&&f.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):H.apply(this,arguments)};var O=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),f=b.getParent(this.state.cell),d=this.graph.getCellGeometry(this.state.cell);
+(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(f)||null==d||!d.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&O.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};
+var D=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){D.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var L=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(a,c){L.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&
+(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display="")};var Q=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){Q.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var c=mxUtils.bind(this,function(){null!=this.specialHandle&&(this.specialHandle.node.style.display=this.graph.isEnabled()&&
this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none");this.redrawHandles()});this.changeHandler=mxUtils.bind(this,function(a,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));c()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.changeHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.editingHandler=mxUtils.bind(this,function(a,c){this.redrawHandles()});this.graph.addListener(mxEvent.EDITING_STOPPED,
-this.editingHandler);var b=this.graph.getLinkForCell(this.state.cell),g=this.graph.getLinksForState(this.state);this.updateLinkHint(b,g);if(null!=b||null!=g&&0<g.length)a=!0;a&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(c,b){if(null==c&&(null==b||0==b.length)||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=c||null!=b&&0<b.length){null==this.linkHint&&(this.linkHint=a(),this.linkHint.style.padding=
-"6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint));this.linkHint.innerHTML="";if(null!=c&&(this.linkHint.appendChild(this.graph.createLinkForHint(c)),this.graph.isEnabled()&&"function"===typeof this.graph.editLink)){var g=document.createElement("img");g.setAttribute("src",Editor.editImage);g.setAttribute("title",mxResources.get("editLink"));g.setAttribute("width","11");g.setAttribute("height","11");g.style.marginLeft="10px";
-g.style.marginBottom="-1px";g.style.cursor="pointer";this.linkHint.appendChild(g);mxEvent.addListener(g,"click",mxUtils.bind(this,function(a){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(a)}));g=document.createElement("img");g.setAttribute("src",Dialog.prototype.clearImage);g.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));g.setAttribute("width","13");g.setAttribute("height","10");g.style.marginLeft="4px";g.style.marginBottom="-1px";
-g.style.cursor="pointer";this.linkHint.appendChild(g);mxEvent.addListener(g,"click",mxUtils.bind(this,function(a){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(a)}))}if(null!=b)for(g=0;g<b.length;g++){var d=document.createElement("div");d.style.marginTop=null!=c||0<g?"6px":"0px";d.appendChild(this.graph.createLinkForHint(b[g].getAttribute("href"),mxUtils.getTextContent(b[g])));this.linkHint.appendChild(d)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;
-var T=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){T.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":
+this.editingHandler);var b=this.graph.getLinkForCell(this.state.cell),f=this.graph.getLinksForState(this.state);this.updateLinkHint(b,f);if(null!=b||null!=f&&0<f.length)a=!0;a&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(c,b){if(null==c&&(null==b||0==b.length)||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=c||null!=b&&0<b.length){null==this.linkHint&&(this.linkHint=a(),this.linkHint.style.padding=
+"6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint));this.linkHint.innerHTML="";if(null!=c&&(this.linkHint.appendChild(this.graph.createLinkForHint(c)),this.graph.isEnabled()&&"function"===typeof this.graph.editLink)){var f=document.createElement("img");f.setAttribute("src",Editor.editImage);f.setAttribute("title",mxResources.get("editLink"));f.setAttribute("width","11");f.setAttribute("height","11");f.style.marginLeft="10px";
+f.style.marginBottom="-1px";f.style.cursor="pointer";this.linkHint.appendChild(f);mxEvent.addListener(f,"click",mxUtils.bind(this,function(a){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(a)}));f=document.createElement("img");f.setAttribute("src",Dialog.prototype.clearImage);f.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));f.setAttribute("width","13");f.setAttribute("height","10");f.style.marginLeft="4px";f.style.marginBottom="-1px";
+f.style.cursor="pointer";this.linkHint.appendChild(f);mxEvent.addListener(f,"click",mxUtils.bind(this,function(a){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(a)}))}if(null!=b)for(f=0;f<b.length;f++){var d=document.createElement("div");d.style.marginTop=null!=c||0<f?"6px":"0px";d.appendChild(this.graph.createLinkForHint(b[f].getAttribute("href"),mxUtils.getTextContent(b[f])));this.linkHint.appendChild(d)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;
+var P=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){P.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":
"none")});this.changeHandler=mxUtils.bind(this,function(c,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));a();this.redrawHandles()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.changeHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);var c=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=c||null!=b&&0<b.length)this.updateLinkHint(c,b),this.redrawHandles()};
-var ta=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){ta.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var W=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?
+var ba=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){ba.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var W=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?
"none":"");W.apply(this);if(null!=this.state&&null!=this.linkHint){var a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),b=mxUtils.getBoundingBox(c,this.state.style[mxConstants.STYLE_ROTATION]||"0",a),a=null!=b?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,c=null!=this.state.text?this.state.text.boundingBox:null;null==b&&(b=this.state);b=b.y+b.height;
-null!=c&&(b=Math.max(b,c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){H.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),
-this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var aa=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(aa.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 na=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){na.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var ja=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){ja.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),
-this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function f(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function l(){mxCylinder.call(this)}function n(){mxActor.call(this)}function t(){mxCylinder.call(this)}function x(){mxActor.call(this)}function A(){mxActor.call(this)}function C(){mxActor.call(this)}function c(){mxActor.call(this)}function g(){mxActor.call(this)}function k(){mxActor.call(this)}function q(){mxActor.call(this)}function p(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,p.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,p.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,p.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,p.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
-this.canvas.curveTo=mxUtils.bind(this,p.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,p.prototype.arcTo)}function m(){mxRectangleShape.call(this)}function z(){mxRectangleShape.call(this)}function D(){mxActor.call(this)}function u(){mxActor.call(this)}function F(){mxActor.call(this)}function y(){mxRectangleShape.call(this)}function G(){mxRectangleShape.call(this)}function v(){mxCylinder.call(this)}function B(){mxShape.call(this)}function O(){mxShape.call(this)}
-function Z(){mxEllipse.call(this)}function I(){mxShape.call(this)}function Q(){mxShape.call(this)}function E(){mxRectangleShape.call(this)}function L(){mxShape.call(this)}function P(){mxShape.call(this)}function T(){mxShape.call(this)}function ta(){mxShape.call(this)}function W(){mxShape.call(this)}function H(){mxCylinder.call(this)}function aa(){mxDoubleEllipse.call(this)}function na(){mxDoubleEllipse.call(this)}function ja(){mxArrowConnector.call(this);this.spacing=0}function ba(){mxArrowConnector.call(this);
-this.spacing=0}function ka(){mxActor.call(this)}function S(){mxRectangleShape.call(this)}function X(){mxActor.call(this)}function pa(){mxActor.call(this)}function ga(){mxActor.call(this)}function R(){mxActor.call(this)}function la(){mxActor.call(this)}function M(){mxActor.call(this)}function J(){mxActor.call(this)}function ea(){mxActor.call(this)}function N(){mxActor.call(this)}function U(){mxActor.call(this)}function ha(){mxEllipse.call(this)}function ia(){mxEllipse.call(this)}function K(){mxEllipse.call(this)}
-function qa(){mxRhombus.call(this)}function ca(){mxEllipse.call(this)}function da(){mxEllipse.call(this)}function Ba(){mxEllipse.call(this)}function xa(){mxEllipse.call(this)}function Aa(){mxActor.call(this)}function ma(){mxActor.call(this)}function fa(){mxActor.call(this)}function sa(){mxConnector.call(this)}function Fa(a,c,b,g,d,f,k,m,v,p){k+=v;var Y=g.clone();g.x-=d*(2*k+v);g.y-=f*(2*k+v);d*=k+v;f*=k+v;return function(){a.ellipse(Y.x-d-k,Y.y-f-k,2*k,2*k);p?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,
-mxCylinder);a.prototype.size=20;a.prototype.darkOpacity=0;a.prototype.darkOpacity2=0;a.prototype.paintVertexShape=function(a,c,b,g,d){var f=Math.max(0,Math.min(g,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),k=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),Y=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));a.translate(c,b);a.begin();a.moveTo(0,0);a.lineTo(g-f,0);a.lineTo(g,
-f);a.lineTo(g,d);a.lineTo(f,d);a.lineTo(0,d-f);a.lineTo(0,0);a.close();a.end();a.fillAndStroke();this.outline||(a.setShadow(!1),0!=k&&(a.setFillAlpha(Math.abs(k)),a.setFillColor(0>k?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(g-f,0),a.lineTo(g,f),a.lineTo(f,f),a.close(),a.fill()),0!=Y&&(a.setFillAlpha(Math.abs(Y)),a.setFillColor(0>Y?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(f,f),a.lineTo(f,d),a.lineTo(0,d-f),a.close(),a.fill()),a.begin(),a.moveTo(f,d),a.lineTo(f,f),a.lineTo(0,
-0),a.moveTo(f,f),a.lineTo(g,f),a.end(),a.stroke())};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 ua=Math.tan(mxUtils.toRadians(30)),oa=(.5-ua)/2;mxUtils.extend(b,mxActor);b.prototype.size=20;b.prototype.redrawPath=function(a,c,b,g,d){c=Math.min(g,d/ua);a.translate((g-c)/2,(d-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",b);mxUtils.extend(f,mxCylinder);f.prototype.size=20;f.prototype.redrawPath=function(a,c,b,g,d,f){c=Math.min(g,d/(.5+ua));f?(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((g-c)/2,(d-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",f);mxUtils.extend(d,mxCylinder);d.prototype.redrawPath=function(a,c,b,g,d,f){c=Math.min(d/2,Math.round(d/8)+this.strokewidth-1);if(f&&null!=this.fill||!f&&null==this.fill)a.moveTo(0,c),a.curveTo(0,2*c,g,2*c,g,c),f||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,g,2*c,g,c),f||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,g,2*c,g,c),f||(a.stroke(),a.begin()),a.translate(0,-c);f||(a.moveTo(0,
-c),a.curveTo(0,-c/3,g,-c/3,g,c),a.lineTo(g,d-c),a.curveTo(g,d+c/3,0,d+c/3,0,d-c),a.close())};d.prototype.getLabelMargins=function(a){return new mxRectangle(0,2.5*Math.min(a.height/2,Math.round(a.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",d);mxUtils.extend(l,mxCylinder);l.prototype.size=30;l.prototype.darkOpacity=0;l.prototype.paintVertexShape=function(a,c,b,g,d){var f=Math.max(0,Math.min(g,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),k=
-Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));a.translate(c,b);a.begin();a.moveTo(0,0);a.lineTo(g-f,0);a.lineTo(g,f);a.lineTo(g,d);a.lineTo(0,d);a.lineTo(0,0);a.close();a.end();a.fillAndStroke();this.outline||(a.setShadow(!1),0!=k&&(a.setFillAlpha(Math.abs(k)),a.setFillColor(0>k?"#FFFFFF":"#000000"),a.begin(),a.moveTo(g-f,0),a.lineTo(g-f,f),a.lineTo(g,f),a.close(),a.fill()),a.begin(),a.moveTo(g-f,0),a.lineTo(g-f,f),a.lineTo(g,f),a.end(),a.stroke())};
-mxCellRenderer.registerShape("note",l);mxUtils.extend(n,mxActor);n.prototype.redrawPath=function(a,c,b,g,d){a.moveTo(0,0);a.quadTo(g/2,.5*d,g,0);a.quadTo(.5*g,d/2,g,d);a.quadTo(g/2,.5*d,0,d);a.quadTo(.5*g,d/2,0,0);a.end()};mxCellRenderer.registerShape("switch",n);mxUtils.extend(t,mxCylinder);t.prototype.tabWidth=60;t.prototype.tabHeight=20;t.prototype.tabPosition="right";t.prototype.redrawPath=function(a,c,b,g,d,f){c=Math.max(0,Math.min(g,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));
-b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var k=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);f?"left"==k?(a.moveTo(0,b),a.lineTo(c,b)):(a.moveTo(g-c,b),a.lineTo(g,b)):("left"==k?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,b),a.lineTo(g,b)):(a.moveTo(0,b),a.lineTo(g-c,b),a.lineTo(g-c,0),a.lineTo(g,0)),a.lineTo(g,d),a.lineTo(0,d),a.lineTo(0,b),a.close());a.end()};mxCellRenderer.registerShape("folder",t);mxUtils.extend(x,mxActor);x.prototype.size=
-30;x.prototype.isRoundable=function(){return!0};x.prototype.redrawPath=function(a,c,b,g,d){c=Math.max(0,Math.min(g,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(g,0),new mxPoint(g,d),new mxPoint(0,d),new mxPoint(0,c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",x);mxUtils.extend(A,mxActor);A.prototype.size=.4;A.prototype.redrawPath=
-function(a,c,b,g,d){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(g/4,1.4*c,g/2,c/2);a.quadTo(3*g/4,c*(1-1.4),g,c/2);a.lineTo(g,d-c/2);a.quadTo(3*g/4,d-1.4*c,g/2,d-c/2);a.quadTo(g/4,d-c*(1-1.4),0,d-c/2);a.lineTo(0,c/2);a.close();a.end()};A.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=mxUtils.getValue(this.style,"size",this.size),b=a.width,g=a.height;if(null==this.direction||this.direction==
-mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return c*=g,new mxRectangle(a.x,a.y+c,b,g-2*c);c*=b;return new mxRectangle(a.x+c,a.y,b-2*c,g)}return a};mxCellRenderer.registerShape("tape",A);mxUtils.extend(C,mxActor);C.prototype.size=.3;C.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*a.height):null};C.prototype.redrawPath=function(a,c,b,g,d){c=d*Math.max(0,
-Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(g,0);a.lineTo(g,d-c/2);a.quadTo(3*g/4,d-1.4*c,g/2,d-c/2);a.quadTo(g/4,d-c*(1-1.4),0,d-c/2);a.lineTo(0,c/2);a.close();a.end()};mxCellRenderer.registerShape("document",C);var La=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(a,c,b,g){var d=mxUtils.getValue(this.style,"size");return null!=d?g*Math.max(0,Math.min(1,d)):La.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=
-function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,a.height*c),0,0)}return null};mxUtils.extend(c,mxActor);c.prototype.size=.2;c.prototype.isRoundable=function(){return!0};c.prototype.redrawPath=function(a,c,b,g,d){c=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
-2;this.addPoints(a,[new mxPoint(0,d),new mxPoint(c,0),new mxPoint(g,0),new mxPoint(g-c,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",c);mxUtils.extend(g,mxActor);g.prototype.size=.2;g.prototype.isRoundable=function(){return!0};g.prototype.redrawPath=function(a,c,b,g,d){c=g*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,
-d),new mxPoint(c,0),new mxPoint(g-c,0),new mxPoint(g,d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("trapezoid",g);mxUtils.extend(k,mxActor);k.prototype.size=.5;k.prototype.redrawPath=function(a,c,b,g,d){a.setFillColor(null);c=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(g,0),new mxPoint(c,0),new mxPoint(c,d/2),new mxPoint(0,d/2),new mxPoint(c,
-d/2),new mxPoint(c,d),new mxPoint(g,d)],this.isRounded,b,!1);a.end()};mxCellRenderer.registerShape("curlyBracket",k);mxUtils.extend(q,mxActor);q.prototype.redrawPath=function(a,c,b,g,d){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=g/5;a.rect(0,0,c,d);a.fillAndStroke();a.rect(2*c,0,c,d);a.fillAndStroke();a.rect(4*c,0,c,d);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",q);p.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=
-c;this.firstX=a;this.firstY=c};p.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)};p.prototype.quadTo=function(a,c,b,g){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=g};p.prototype.curveTo=function(a,c,b,g,d,f){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=f};p.prototype.arcTo=function(a,c,b,g,
-d,f,k){this.originalArcTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=k};p.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var b=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},g=Math.abs(a-this.lastX),d=Math.abs(c-this.lastY),f=Math.sqrt(g*g+d*d);if(2>f){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;return}var k=Math.round(f/10),m=this.defaultVariation;5>k&&(k=5,m/=3);for(var Y=b(a-this.lastX)*g/k,b=b(c-this.lastY)*d/k,
-g=g/f,d=d/f,f=0;f<k;f++){var v=(Math.random()-.5)*m;this.originalLineTo.call(this.canvas,Y*f+this.lastX-v*d,b*f+this.lastY-v*g)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};p.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 Ca=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 p(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Ca.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var Ma=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==
-this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Ma.apply(this,arguments)};var Da=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,c,b,g,d){if(null==a.handJiggle)Da.apply(this,arguments);else{var f=!0;null!=this.style&&(f="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(f||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)f||null!=this.fill&&this.fill!=mxConstants.NONE||
-(a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?f=Math.min(g/2,Math.min(d/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.min(g*f,d*f)),a.moveTo(c+f,b),a.lineTo(c+g-f,b),a.quadTo(c+g,b,c+g,b+f),a.lineTo(c+g,b+d-f),a.quadTo(c+g,b+d,c+g-f,b+d),a.lineTo(c+f,b+d),a.quadTo(c,b+d,c,b+d-f),
-a.lineTo(c,b+f),a.quadTo(c,b,c+f,b)):(a.moveTo(c,b),a.lineTo(c+g,b),a.lineTo(c+g,b+d),a.lineTo(c,b+d),a.lineTo(c,b)),a.close(),a.end(),a.fillAndStroke()}};var ya=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,c,b,g,d){null==a.handJiggle&&ya.apply(this,arguments)};mxUtils.extend(m,mxRectangleShape);m.prototype.size=.1;m.prototype.isHtmlAllowed=function(){return!1};m.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,b=a.height;a=new mxRectangle(a.x,a.y,c,b);var g=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,g=Math.max(g,Math.min(c*d,b*d));a.x+=Math.round(g);a.width-=Math.round(2*g)}return a};m.prototype.paintForeground=
-function(a,c,b,g,d){var f=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var k=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.max(f,Math.min(g*k,d*k));f=Math.round(f);a.begin();a.moveTo(c+f,b);a.lineTo(c+f,b+d);a.moveTo(c+g-f,b);a.lineTo(c+g-f,b+d);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",m);mxUtils.extend(z,
-mxRectangleShape);z.prototype.paintBackground=function(a,c,b,g,d){a.setFillColor(mxConstants.NONE);a.rect(c,b,g,d);a.fill()};z.prototype.paintForeground=function(a,c,b,g,d){};mxCellRenderer.registerShape("transparent",z);mxUtils.extend(D,mxHexagon);D.prototype.size=30;D.prototype.position=.5;D.prototype.position2=.5;D.prototype.base=20;D.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};D.prototype.isRoundable=
-function(){return!0};D.prototype.redrawPath=function(a,c,b,g,d){c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var f=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),k=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),m=Math.max(0,Math.min(g,parseFloat(mxUtils.getValue(this.style,"base",this.base))));
-this.addPoints(a,[new mxPoint(0,0),new mxPoint(g,0),new mxPoint(g,d-b),new mxPoint(Math.min(g,f+m),d-b),new mxPoint(k,d),new mxPoint(Math.max(0,f),d-b),new mxPoint(0,d-b)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",D);mxUtils.extend(u,mxActor);u.prototype.size=.2;u.prototype.fixedSize=20;u.prototype.isRoundable=function(){return!0};u.prototype.redrawPath=function(a,c,b,g,d){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(g,parseFloat(mxUtils.getValue(this.style,
-"size",this.fixedSize)))):g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(g-c,0),new mxPoint(g,d/2),new mxPoint(g-c,d),new mxPoint(0,d),new mxPoint(c,d/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",u);mxUtils.extend(F,mxHexagon);F.prototype.size=.25;F.prototype.isRoundable=function(){return!0};F.prototype.redrawPath=
-function(a,c,b,g,d){c=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(g-c,0),new mxPoint(g,.5*d),new mxPoint(g-c,d),new mxPoint(c,d),new mxPoint(0,.5*d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",F);mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.paintForeground=function(a,
-c,b,g,d){var f=Math.min(g/5,d/5)+1;a.begin();a.moveTo(c+g/2,b+f);a.lineTo(c+g/2,b+d-f);a.moveTo(c+f,b+d/2);a.lineTo(c+g-f,b+d/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",y);var va=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,b,g,d){va.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var f=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=f;b+=f;g-=2*f;d-=2*f;0<g&&0<d&&(a.setShadow(!1),va.apply(this,[a,c,b,g,d]))}};mxUtils.extend(G,mxRectangleShape);G.prototype.isHtmlAllowed=function(){return!1};G.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};G.prototype.paintForeground=function(a,c,b,g,d){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var f=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=f;b+=f;g-=2*f;d-=2*f;0<g&&0<d&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var f=0,k;do{k=mxCellRenderer.defaultShapes[this.style["symbol"+
-f]];if(null!=k){var m=this.style["symbol"+f+"Align"],Y=this.style["symbol"+f+"VerticalAlign"],v=this.style["symbol"+f+"Width"],p=this.style["symbol"+f+"Height"],q=this.style["symbol"+f+"Spacing"]||0,u=this.style["symbol"+f+"VSpacing"]||q,B=this.style["symbol"+f+"ArcSpacing"];null!=B&&(B*=this.getArcSize(g+this.strokewidth,d+this.strokewidth),q+=B,u+=B);var B=c,z=b,B=m==mxConstants.ALIGN_CENTER?B+(g-v)/2:m==mxConstants.ALIGN_RIGHT?B+(g-v-q):B+q,z=Y==mxConstants.ALIGN_MIDDLE?z+(d-p)/2:Y==mxConstants.ALIGN_BOTTOM?
-z+(d-p-u):z+u;a.save();m=new k;m.style=this.style;k.prototype.paintVertexShape.call(m,a,B,z,v,p);a.restore()}f++}while(null!=k)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",G);mxUtils.extend(v,mxCylinder);v.prototype.redrawPath=function(a,c,b,g,d,f){f?(a.moveTo(0,0),a.lineTo(g/2,d/2),a.lineTo(g,0),a.end()):(a.moveTo(0,0),a.lineTo(g,0),a.lineTo(g,d),a.lineTo(0,d),a.close())};mxCellRenderer.registerShape("message",v);mxUtils.extend(B,mxShape);
-B.prototype.paintBackground=function(a,c,b,g,d){a.translate(c,b);a.ellipse(g/4,0,g/2,d/4);a.fillAndStroke();a.begin();a.moveTo(g/2,d/4);a.lineTo(g/2,2*d/3);a.moveTo(g/2,d/3);a.lineTo(0,d/3);a.moveTo(g/2,d/3);a.lineTo(g,d/3);a.moveTo(g/2,2*d/3);a.lineTo(0,d);a.moveTo(g/2,2*d/3);a.lineTo(g,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(O,mxShape);O.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};O.prototype.paintBackground=function(a,
-c,b,g,d){a.translate(c,b);a.begin();a.moveTo(0,d/4);a.lineTo(0,3*d/4);a.end();a.stroke();a.begin();a.moveTo(0,d/2);a.lineTo(g/6,d/2);a.end();a.stroke();a.ellipse(g/6,0,5*g/6,d);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",O);mxUtils.extend(Z,mxEllipse);Z.prototype.paintVertexShape=function(a,c,b,g,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+g/8,b+d);a.lineTo(c+7*g/8,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",Z);mxUtils.extend(I,
-mxShape);I.prototype.paintVertexShape=function(a,c,b,g,d){a.translate(c,b);a.begin();a.moveTo(g,0);a.lineTo(0,d);a.moveTo(0,0);a.lineTo(g,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",I);mxUtils.extend(Q,mxShape);Q.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};Q.prototype.paintBackground=function(a,c,b,g,d){a.translate(c,b);a.begin();a.moveTo(3*g/8,d/8*1.1);a.lineTo(5*g/8,0);a.end();a.stroke();a.ellipse(0,d/8,g,7*d/8);a.fillAndStroke()};
-Q.prototype.paintForeground=function(a,c,b,g,d){a.begin();a.moveTo(3*g/8,d/8*1.1);a.lineTo(5*g/8,d/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",Q);mxUtils.extend(E,mxRectangleShape);E.prototype.size=40;E.prototype.isHtmlAllowed=function(){return!1};E.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)};E.prototype.paintBackground=function(a,c,b,g,
-d){var f=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),k=mxUtils.getValue(this.style,"participant");null==k||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,b,g,f):(k=this.state.view.graph.cellRenderer.getShape(k),null!=k&&k!=E&&(k=new k,k.apply(this.state),a.save(),k.paintVertexShape(a,c,b,g,f),a.restore()));f<d&&(a.setDashed(!0),a.begin(),a.moveTo(c+g/2,b+f),a.lineTo(c+g/2,b+d),a.end(),a.stroke())};E.prototype.paintForeground=function(a,
-c,b,g,d){var f=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,b,g,Math.min(d,f))};mxCellRenderer.registerShape("umlLifeline",E);mxUtils.extend(L,mxShape);L.prototype.width=60;L.prototype.height=30;L.prototype.corner=10;L.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))};L.prototype.paintBackground=function(a,c,b,g,d){var f=this.corner,k=Math.min(g,Math.max(f,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),m=Math.min(d,Math.max(1.5*f,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),v=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);v!=mxConstants.NONE&&(a.setFillColor(v),a.rect(c,b,g,d),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=
-mxConstants.NONE?(this.getGradientBounds(a,c,b,g,d),a.setGradient(this.fill,this.gradient,c,b,g,d,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,b);a.lineTo(c+k,b);a.lineTo(c+k,b+Math.max(0,m-1.5*f));a.lineTo(c+Math.max(0,k-f),b+m);a.lineTo(c,b+m);a.close();a.fillAndStroke();a.begin();a.moveTo(c+k,b);a.lineTo(c+g,b);a.lineTo(c+g,b+d);a.lineTo(c,b+d);a.lineTo(c,b+m);a.stroke()};mxCellRenderer.registerShape("umlFrame",L);mxPerimeter.LifelinePerimeter=function(a,c,b,g){g=E.prototype.size;
-null!=c&&(g=mxUtils.getValue(c.style,"size",g)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;b.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+g,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(a,c,b,g){g=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);
-mxPerimeter.BackbonePerimeter=function(a,c,b,g){g=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;null!=c.style.backboneSize&&(g+=parseFloat(c.style.backboneSize)*c.view.scale/2-1);if("south"==c.style[mxConstants.STYLE_DIRECTION]||"north"==c.style[mxConstants.STYLE_DIRECTION])return b.x<a.getCenterX()&&(g=-1*(g+1)),new mxPoint(a.getCenterX()+g,Math.min(a.y+a.height,Math.max(a.y,b.y)));b.y<a.getCenterY()&&(g=-1*(g+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,b.x)),
-a.getCenterY()+g)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,c,b,g){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(c.style,"size",D.prototype.size))*c.view.scale))),c.style),c,b,g)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,b,g,d){var f=c.prototype.size;
-null!=b&&(f=mxUtils.getValue(b.style,"size",f));var k=a.x,m=a.y,v=a.width,p=a.height;b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH?(f=p*Math.max(0,Math.min(1,f)),m=[new mxPoint(k,m),new mxPoint(k+v,m+f),new mxPoint(k+v,m+p),new mxPoint(k,m+p-f),new mxPoint(k,m)]):(f=v*Math.max(0,Math.min(1,f)),m=[new mxPoint(k+f,m),new mxPoint(k+v,m),new mxPoint(k+v-f,m+p),new mxPoint(k,
-m+p),new mxPoint(k+f,m)]);p=a.getCenterX();a=a.getCenterY();a=new mxPoint(p,a);d&&(g.x<k||g.x>k+v?a.y=g.y:a.x=g.x);return mxUtils.getPerimeterPoint(m,a,g)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var f=g.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,"size",f));var k=a.x,m=a.y,v=a.width,p=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;
-c==mxConstants.DIRECTION_EAST?(f=v*Math.max(0,Math.min(1,f)),m=[new mxPoint(k+f,m),new mxPoint(k+v-f,m),new mxPoint(k+v,m+p),new mxPoint(k,m+p),new mxPoint(k+f,m)]):c==mxConstants.DIRECTION_WEST?(f=v*Math.max(0,Math.min(1,f)),m=[new mxPoint(k,m),new mxPoint(k+v,m),new mxPoint(k+v-f,m+p),new mxPoint(k+f,m+p),new mxPoint(k,m)]):c==mxConstants.DIRECTION_NORTH?(f=p*Math.max(0,Math.min(1,f)),m=[new mxPoint(k,m+f),new mxPoint(k+v,m),new mxPoint(k+v,m+p),new mxPoint(k,m+p-f),new mxPoint(k,m+f)]):(f=p*Math.max(0,
-Math.min(1,f)),m=[new mxPoint(k,m),new mxPoint(k+v,m+f),new mxPoint(k+v,m+p-f),new mxPoint(k,m+p),new mxPoint(k,m)]);p=a.getCenterX();a=a.getCenterY();a=new mxPoint(p,a);d&&(b.x<k||b.x>k+v?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(m,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,b,g){var d="0"!=mxUtils.getValue(c.style,"fixedSize","0"),f=d?u.prototype.fixedSize:u.prototype.size;null!=c&&(f=mxUtils.getValue(c.style,
-"size",f));var k=a.x,m=a.y,v=a.width,p=a.height,Y=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?(d=d?Math.max(0,Math.min(v,f)):v*Math.max(0,Math.min(1,f)),m=[new mxPoint(k,m),new mxPoint(k+v-d,m),new mxPoint(k+v,a),new mxPoint(k+v-d,m+p),new mxPoint(k,m+p),new mxPoint(k+d,a),new mxPoint(k,m)]):c==mxConstants.DIRECTION_WEST?(d=d?Math.max(0,Math.min(v,f)):v*Math.max(0,
-Math.min(1,f)),m=[new mxPoint(k+d,m),new mxPoint(k+v,m),new mxPoint(k+v-d,a),new mxPoint(k+v,m+p),new mxPoint(k+d,m+p),new mxPoint(k,a),new mxPoint(k+d,m)]):c==mxConstants.DIRECTION_NORTH?(d=d?Math.max(0,Math.min(p,f)):p*Math.max(0,Math.min(1,f)),m=[new mxPoint(k,m+d),new mxPoint(Y,m),new mxPoint(k+v,m+d),new mxPoint(k+v,m+p),new mxPoint(Y,m+p-d),new mxPoint(k,m+p),new mxPoint(k,m+d)]):(d=d?Math.max(0,Math.min(p,f)):p*Math.max(0,Math.min(1,f)),m=[new mxPoint(k,m),new mxPoint(Y,m+d),new mxPoint(k+
-v,m),new mxPoint(k+v,m+p-d),new mxPoint(Y,m+p),new mxPoint(k,m+p-d),new mxPoint(k,m)]);Y=new mxPoint(Y,a);g&&(b.x<k||b.x>k+v?Y.y=b.y:Y.x=b.x);return mxUtils.getPerimeterPoint(m,Y,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,g){var d=F.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d));var f=a.x,k=a.y,m=a.width,v=a.height,p=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?(d=v*Math.max(0,Math.min(1,d)),k=[new mxPoint(p,k),new mxPoint(f+m,k+d),new mxPoint(f+m,k+v-d),new mxPoint(p,k+v),new mxPoint(f,k+v-d),new mxPoint(f,k+d),new mxPoint(p,k)]):(d=m*Math.max(0,Math.min(1,d)),k=[new mxPoint(f+d,k),new mxPoint(f+m-d,k),new mxPoint(f+m,a),new mxPoint(f+m-d,k+v),new mxPoint(f+d,k+v),new mxPoint(f,a),new mxPoint(f+d,k)]);p=new mxPoint(p,a);g&&(b.x<f||b.x>f+
-m?p.y=b.y:p.x=b.x);return mxUtils.getPerimeterPoint(k,p,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(P,mxShape);P.prototype.size=10;P.prototype.paintBackground=function(a,c,b,g,d){var f=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((g-f)/2,0,f,f);a.fillAndStroke();a.begin();a.moveTo(g/2,f);a.lineTo(g/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",P);mxUtils.extend(T,mxShape);T.prototype.size=
-10;T.prototype.inset=2;T.prototype.paintBackground=function(a,c,b,g,d){var f=parseFloat(mxUtils.getValue(this.style,"size",this.size)),k=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.begin();a.moveTo(g/2,f+k);a.lineTo(g/2,d);a.end();a.stroke();a.begin();a.moveTo((g-f)/2-k,f/2);a.quadTo((g-f)/2-k,f+k,g/2,f+k);a.quadTo((g+f)/2+k,f+k,(g+f)/2+k,f/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",T);mxUtils.extend(ta,mxShape);ta.prototype.paintBackground=
-function(a,c,b,g,d){a.translate(c,b);a.begin();a.moveTo(0,0);a.quadTo(g,0,g,d/2);a.quadTo(g,d,0,d);a.end();a.stroke()};mxCellRenderer.registerShape("requiredInterface",ta);mxUtils.extend(W,mxShape);W.prototype.inset=2;W.prototype.paintBackground=function(a,c,b,g,d){var f=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.ellipse(0,f,g-2*f,d-2*f);a.fillAndStroke();a.begin();a.moveTo(g/2,0);a.quadTo(g,0,g,d/2);a.quadTo(g,d,g/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",
-W);mxUtils.extend(H,mxCylinder);H.prototype.jettyWidth=32;H.prototype.jettyHeight=12;H.prototype.redrawPath=function(a,c,b,g,d,f){var k=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=k/2;var k=b+k/2,m=.3*d-c/2,v=.7*d-c/2;f?(a.moveTo(b,m),a.lineTo(k,m),a.lineTo(k,m+c),a.lineTo(b,m+c),a.moveTo(b,v),a.lineTo(k,v),a.lineTo(k,v+c),a.lineTo(b,v+c)):(a.moveTo(b,0),a.lineTo(g,0),a.lineTo(g,d),a.lineTo(b,d),
-a.lineTo(b,v+c),a.lineTo(0,v+c),a.lineTo(0,v),a.lineTo(b,v),a.lineTo(b,m+c),a.lineTo(0,m+c),a.lineTo(0,m),a.lineTo(b,m),a.close());a.end()};mxCellRenderer.registerShape("component",H);mxUtils.extend(aa,mxDoubleEllipse);aa.prototype.outerStroke=!0;aa.prototype.paintVertexShape=function(a,c,b,g,d){var f=Math.min(4,Math.min(g/5,d/5));0<g&&0<d&&(a.ellipse(c+f,b+f,g-2*f,d-2*f),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,b,g,d),a.stroke())};mxCellRenderer.registerShape("endState",
-aa);mxUtils.extend(na,aa);na.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",na);mxUtils.extend(ja,mxArrowConnector);ja.prototype.defaultWidth=4;ja.prototype.isOpenEnded=function(){return!0};ja.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};ja.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",ja);mxUtils.extend(ba,mxArrowConnector);ba.prototype.defaultWidth=
-10;ba.prototype.defaultArrowWidth=20;ba.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};ba.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};ba.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",ba);mxUtils.extend(ka,
-mxActor);ka.prototype.size=30;ka.prototype.isRoundable=function(){return!0};ka.prototype.redrawPath=function(a,c,b,g,d){c=Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,d),new mxPoint(0,c),new mxPoint(g,0),new mxPoint(g,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",ka);mxUtils.extend(S,mxRectangleShape);S.prototype.dx=20;S.prototype.dy=
-20;S.prototype.isHtmlAllowed=function(){return!1};S.prototype.paintForeground=function(a,c,b,g,d){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var f=0;if(this.isRounded)var k=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.max(f,Math.min(g*k,d*k));k=Math.max(f,Math.min(g,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));f=Math.max(f,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(c,
-b+f);a.lineTo(c+g,b+f);a.end();a.stroke();a.begin();a.moveTo(c+k,b);a.lineTo(c+k,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("internalStorage",S);mxUtils.extend(X,mxActor);X.prototype.dx=20;X.prototype.dy=20;X.prototype.redrawPath=function(a,c,b,g,d){c=Math.max(0,Math.min(g,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var f=mxUtils.getValue(this.style,
-mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(g,0),new mxPoint(g,b),new mxPoint(c,b),new mxPoint(c,d),new mxPoint(0,d)],this.isRounded,f,!0);a.end()};mxCellRenderer.registerShape("corner",X);mxUtils.extend(pa,mxActor);pa.prototype.redrawPath=function(a,c,b,g,d){a.moveTo(0,0);a.lineTo(0,d);a.end();a.moveTo(g,0);a.lineTo(g,d);a.end();a.moveTo(0,d/2);a.lineTo(g,d/2);a.end()};mxCellRenderer.registerShape("crossbar",pa);mxUtils.extend(ga,mxActor);
-ga.prototype.dx=20;ga.prototype.dy=20;ga.prototype.redrawPath=function(a,c,b,g,d){c=Math.max(0,Math.min(g,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(g,0),new mxPoint(g,b),new mxPoint((g+c)/2,b),new mxPoint((g+c)/2,d),
-new mxPoint((g-c)/2,d),new mxPoint((g-c)/2,b),new mxPoint(0,b)],this.isRounded,f,!0);a.end()};mxCellRenderer.registerShape("tee",ga);mxUtils.extend(R,mxActor);R.prototype.arrowWidth=.3;R.prototype.arrowSize=.2;R.prototype.redrawPath=function(a,c,b,g,d){var f=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(d-f)/2;var f=b+f,k=mxUtils.getValue(this.style,
-mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(g-c,b),new mxPoint(g-c,0),new mxPoint(g,d/2),new mxPoint(g-c,d),new mxPoint(g-c,f),new mxPoint(0,f)],this.isRounded,k,!0);a.end()};mxCellRenderer.registerShape("singleArrow",R);mxUtils.extend(la,mxActor);la.prototype.redrawPath=function(a,c,b,g,d){var f=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",R.prototype.arrowWidth))));c=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
-"arrowSize",R.prototype.arrowSize))));b=(d-f)/2;var f=b+f,k=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,d/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(g-c,b),new mxPoint(g-c,0),new mxPoint(g,d/2),new mxPoint(g-c,d),new mxPoint(g-c,f),new mxPoint(c,f),new mxPoint(c,d)],this.isRounded,k,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",la);mxUtils.extend(M,mxActor);M.prototype.size=.1;M.prototype.redrawPath=function(a,c,
-b,g,d){c=g*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(c,0);a.lineTo(g,0);a.quadTo(g-2*c,d/2,g,d);a.lineTo(c,d);a.quadTo(c-2*c,d/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",M);mxUtils.extend(J,mxActor);J.prototype.redrawPath=function(a,c,b,g,d){a.moveTo(0,0);a.quadTo(g,0,g,d/2);a.quadTo(g,d,0,d);a.close();a.end()};mxCellRenderer.registerShape("or",J);mxUtils.extend(ea,mxActor);ea.prototype.redrawPath=function(a,c,b,g,d){a.moveTo(0,
-0);a.quadTo(g,0,g,d/2);a.quadTo(g,d,0,d);a.quadTo(g/2,d/2,0,0);a.close();a.end()};mxCellRenderer.registerShape("xor",ea);mxUtils.extend(N,mxActor);N.prototype.size=20;N.prototype.isRoundable=function(){return!0};N.prototype.redrawPath=function(a,c,b,g,d){c=Math.min(g/2,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(g-c,0),new mxPoint(g,.8*c),new mxPoint(g,
-d),new mxPoint(0,d),new mxPoint(0,.8*c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("loopLimit",N);mxUtils.extend(U,mxActor);U.prototype.size=.375;U.prototype.isRoundable=function(){return!0};U.prototype.redrawPath=function(a,c,b,g,d){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(g,0),new mxPoint(g,d-c),new mxPoint(g/
-2,d),new mxPoint(0,d-c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("offPageConnector",U);mxUtils.extend(ha,mxEllipse);ha.prototype.paintVertexShape=function(a,c,b,g,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+g/2,b+d);a.lineTo(c+g,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("tapeData",ha);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=function(a,c,b,g,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);
-a.begin();a.moveTo(c,b+d/2);a.lineTo(c+g,b+d/2);a.end();a.stroke();a.begin();a.moveTo(c+g/2,b);a.lineTo(c+g/2,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("orEllipse",ia);mxUtils.extend(K,mxEllipse);K.prototype.paintVertexShape=function(a,c,b,g,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(c+.145*g,b+.145*d);a.lineTo(c+.855*g,b+.855*d);a.end();a.stroke();a.begin();a.moveTo(c+.855*g,b+.145*d);a.lineTo(c+.145*g,b+.855*d);a.end();a.stroke()};
-mxCellRenderer.registerShape("sumEllipse",K);mxUtils.extend(qa,mxRhombus);qa.prototype.paintVertexShape=function(a,c,b,g,d){mxRhombus.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(c,b+d/2);a.lineTo(c+g,b+d/2);a.end();a.stroke()};mxCellRenderer.registerShape("sortShape",qa);mxUtils.extend(ca,mxEllipse);ca.prototype.paintVertexShape=function(a,c,b,g,d){a.begin();a.moveTo(c,b);a.lineTo(c+g,b);a.lineTo(c+g/2,b+d/2);a.close();a.fillAndStroke();a.begin();a.moveTo(c,
-b+d);a.lineTo(c+g,b+d);a.lineTo(c+g/2,b+d/2);a.close();a.fillAndStroke()};mxCellRenderer.registerShape("collate",ca);mxUtils.extend(da,mxEllipse);da.prototype.paintVertexShape=function(a,c,b,g,d){var f=b+d-5;a.begin();a.moveTo(c,b);a.lineTo(c,b+d);a.moveTo(c,f);a.lineTo(c+10,f-5);a.moveTo(c,f);a.lineTo(c+10,f+5);a.moveTo(c,f);a.lineTo(c+g,f);a.moveTo(c+g,b);a.lineTo(c+g,b+d);a.moveTo(c+g,f);a.lineTo(c+g-10,f-5);a.moveTo(c+g,f);a.lineTo(c+g-10,f+5);a.end();a.stroke()};mxCellRenderer.registerShape("dimension",
-da);mxUtils.extend(Ba,mxEllipse);Ba.prototype.paintVertexShape=function(a,c,b,g,d){this.outline||a.setStrokeColor(null);mxRectangleShape.prototype.paintBackground.apply(this,arguments);null!=this.style&&(a.setStrokeColor(this.stroke),a.rect(c,b,g,d),a.fill(),a.begin(),a.moveTo(c,b),"1"==mxUtils.getValue(this.style,"top","1")?a.lineTo(c+g,b):a.moveTo(c+g,b),"1"==mxUtils.getValue(this.style,"right","1")?a.lineTo(c+g,b+d):a.moveTo(c+g,b+d),"1"==mxUtils.getValue(this.style,"bottom","1")?a.lineTo(c,b+
-d):a.moveTo(c,b+d),"1"==mxUtils.getValue(this.style,"left","1")&&a.lineTo(c,b-this.strokewidth/2),a.end(),a.stroke())};mxCellRenderer.registerShape("partialRectangle",Ba);mxUtils.extend(xa,mxEllipse);xa.prototype.paintVertexShape=function(a,c,b,g,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(c+g/2,b),a.lineTo(c+g/2,b+d)):(a.moveTo(c,b+d/2),a.lineTo(c+g,b+d/2));a.end();a.stroke()};mxCellRenderer.registerShape("lineEllipse",
-xa);mxUtils.extend(Aa,mxActor);Aa.prototype.redrawPath=function(a,c,b,g,d){c=Math.min(g,d/2);a.moveTo(0,0);a.lineTo(g-c,0);a.quadTo(g,0,g,d/2);a.quadTo(g,d,g-c,d);a.lineTo(0,d);a.close();a.end()};mxCellRenderer.registerShape("delay",Aa);mxUtils.extend(ma,mxActor);ma.prototype.size=.2;ma.prototype.redrawPath=function(a,c,b,g,d){c=Math.min(d,g);var f=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(d-f)/2;b=c+f;var k=(g-f)/2,f=k+f;a.moveTo(0,c);a.lineTo(k,c);a.lineTo(k,
-0);a.lineTo(f,0);a.lineTo(f,c);a.lineTo(g,c);a.lineTo(g,b);a.lineTo(f,b);a.lineTo(f,d);a.lineTo(k,d);a.lineTo(k,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",ma);mxUtils.extend(fa,mxActor);fa.prototype.size=.25;fa.prototype.redrawPath=function(a,c,b,g,d){c=Math.min(g,d/2);b=Math.min(g-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*g);a.moveTo(0,d/2);a.lineTo(b,0);a.lineTo(g-c,0);a.quadTo(g,0,g,d/2);a.quadTo(g,d,g-c,d);a.lineTo(b,d);a.close();a.end()};
-mxCellRenderer.registerShape("display",fa);mxUtils.extend(sa,mxConnector);sa.prototype.origPaintEdgeShape=sa.prototype.paintEdgeShape;sa.prototype.paintEdgeShape=function(a,c,b){for(var g=[],d=0;d<c.length;d++)g.push(mxUtils.clone(c[d]));var d=a.state.dashed,f=a.state.fixDash;sa.prototype.origPaintEdgeShape.apply(this,[a,g,b]);3<=a.state.strokeWidth&&(g=mxUtils.getValue(this.style,"fillColor",null),null!=g&&(a.setStrokeColor(g),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(d,f),sa.prototype.origPaintEdgeShape.apply(this,
-[a,c,b])))};mxCellRenderer.registerShape("filledEdge",sa);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,g,d,f,k,m,v,p){var q=d*(k+v+1),B=f*(k+v+1);return function(){a.begin();
-a.moveTo(g.x-q/2-B/2,g.y-B/2+q/2);a.lineTo(g.x+B/2-3*q/2,g.y-3*B/2-q/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,g,d,f,k,m,v,p){var q=d*(k+v+1),B=f*(k+v+1);return function(){a.begin();a.moveTo(g.x-q/2-B/2,g.y-B/2+q/2);a.lineTo(g.x+B/2-3*q/2,g.y-3*B/2-q/2);a.moveTo(g.x-q/2+B/2,g.y-B/2-q/2);a.lineTo(g.x-B/2-3*q/2,g.y-3*B/2+q/2);a.stroke()}});mxMarker.addMarker("circle",Fa);mxMarker.addMarker("circlePlus",function(a,c,b,g,d,f,k,m,v,p){var q=g.clone(),B=Fa.apply(this,arguments),u=d*(k+
-2*v),z=f*(k+2*v);return function(){B.apply(this,arguments);a.begin();a.moveTo(q.x-d*v,q.y-f*v);a.lineTo(q.x-2*u+d*v,q.y-2*z+f*v);a.moveTo(q.x-u-z+f*v,q.y-z+u-d*v);a.lineTo(q.x+z-u-f*v,q.y-z-u+d*v);a.stroke()}});mxMarker.addMarker("halfCircle",function(a,c,b,g,d,f,k,m,v,p){var q=d*(k+v+1),B=f*(k+v+1),u=g.clone();g.x-=q;g.y-=B;return function(){a.begin();a.moveTo(u.x-B,u.y+q);a.quadTo(g.x-B,g.y+q,g.x,g.y);a.quadTo(g.x+B,g.y-q,u.x+B,u.y-q);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,g,d,
-f,k,m,v,p){c=d*v*1.118;b=f*v*1.118;d*=k+v;f*=k+v;var q=g.clone();q.x-=c;q.y-=b;g.x+=1*-d-c;g.y+=1*-f-b;return function(){a.begin();a.moveTo(q.x,q.y);m?a.lineTo(q.x-d-f/2,q.y-f+d/2):a.lineTo(q.x+f/2-d,q.y-f-d/2);a.lineTo(q.x-d,q.y-f);a.close();p?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,g,d,f,k,m,v,p,q){f*=m+p;k*=m+p;var B=d.clone();return function(){c.begin();c.moveTo(B.x,B.y);v?c.lineTo(B.x-f-k/a,B.y-k+f/a):c.lineTo(B.x+k/a-f,B.y-
-k-f/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ga=function(a,c,b){return za(a,["width"],c,function(c,g,d,f,k){k=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(f.x+g*c/4+d*k/2,f.y+d*c/4-g*k/2)},function(c,g,d,f,k,m){c=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,k.x,k.y,m.x,m.y));a.style.width=Math.round(2*c)/a.view.scale-b})},za=function(a,c,b,g,d){return V(a,c,function(c){var d=a.absolutePoints,f=d.length-1;c=a.view.translate;var k=a.view.scale,m=b?d[0]:d[f],d=b?d[1]:d[f-
-1],f=d.x-m.x,v=d.y-m.y,p=Math.sqrt(f*f+v*v),m=g.call(this,p,f/p,v/p,m,d);return new mxPoint(m.x/k-c.x,m.y/k-c.y)},function(c,g,f){var k=a.absolutePoints,m=k.length-1;c=a.view.translate;var v=a.view.scale,p=b?k[0]:k[m],k=b?k[1]:k[m-1],m=k.x-p.x,q=k.y-p.y,B=Math.sqrt(m*m+q*q);g.x=(g.x+c.x)*v;g.y=(g.y+c.y)*v;d.call(this,B,m/B,q/B,p,k,g,f)})},wa=function(a){return function(c){return[V(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",R.prototype.arrowWidth))),
-g=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",R.prototype.arrowSize)));return new mxPoint(c.x+(1-g)*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))})]}},Na=function(a,c,b){return function(g){var d=[V(g,["size"],function(b){var g=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+g,b.y+g)},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(g.style,mxConstants.STYLE_ROUNDED,!1)&&d.push(ra(g));return d}},Ha=function(a,c,b,g,d){b=null!=b?b:1;return function(f){var k=[V(f,["size"],function(c){var b=null!=d?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,g=parseFloat(mxUtils.getValue(this.state.style,"size",b?d:a));return new mxPoint(c.x+
-Math.max(0,Math.min(c.width,g*(b?1:c.width))),c.getCenterY())},function(a,c,g){var k=null!=d?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=k?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));k&&!mxEvent.isAltDown(g.getEvent())&&(a=f.view.graph.snap(a));this.state.style.size=a},null,g)];c&&mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,!1)&&k.push(ra(f));return k}},Oa=function(a){return function(c){var b=[V(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(ra(c));return b}},Ea=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ra(a));return c}},ra=function(a,c){return V(a,[mxConstants.STYLE_ARCSIZE],function(b){var g=null!=c?c:b.height/8;if("1"==mxUtils.getValue(a.style,
-mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var d=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,d),b.y+g)}d=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)*d),b.y+g)},function(c,b,g){"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))))})},V=function(a,c,b,g,d,f){var k=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);k.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};k.getPosition=b;k.setPosition=g;k.ignoreGrid=null!=d?d:!0;if(f){var m=k.positionChanged;k.positionChanged=
-function(){m.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return k},Ia={link:function(a){return[Ga(a,!0,10),Ga(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(za(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,g,d,f){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;f=3*mxUtils.getNumber(a.style,
-mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(f+a.shape.strokewidth*a.view.scale)+g*c/2,d.y+g*(f+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,g,d,f,k,m,v){b=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,k.x,k.y,m.x,m.y));g=mxUtils.ptLineDist(f.x,f.y,f.x+d,f.y-g,m.x,m.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(g-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(v.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=
-a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(v.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(za(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,g,d,f){c=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;f=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/
-5)*a.view.scale;return new mxPoint(d.x+b*(f+a.shape.strokewidth*a.view.scale)+g*c/2,d.y+g*(f+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,g,d,f,k,m,v){b=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,k.x,k.y,m.x,m.y));g=mxUtils.ptLineDist(f.x,f.y,f.x+d,f.y-g,m.x,m.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(g-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(v.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=
-a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(v.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(za(a,
-["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,g,d,f){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;f=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(f+a.shape.strokewidth*a.view.scale)-g*c/2,d.y+g*(f+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,g,d,f,k,m,v){b=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,k.x,k.y,m.x,m.y));g=mxUtils.ptLineDist(f.x,f.y,f.x+d,f.y-g,m.x,m.y);a.style[mxConstants.STYLE_ENDSIZE]=
-Math.round(100*(g-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(v.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(v.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(za(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],
-!1,function(c,b,g,d,f){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;f=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(f+a.shape.strokewidth*a.view.scale)-g*c/2,d.y+g*(f+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,g,d,f,k,m,v){b=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,k.x,k.y,m.x,m.y));g=mxUtils.ptLineDist(f.x,f.y,f.x+d,f.y-g,m.x,m.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(g-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(v.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(v.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=[V(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(ra(a,b/2))}return c},label:Ea(),ext:Ea(),rectangle:Ea(),triangle:Ea(),rhombus:Ea(),umlLifeline:function(a){return[V(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,
-parseFloat(mxUtils.getValue(this.state.style,"size",E.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[V(a,["width","height"],function(a){var c=Math.max(L.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,"width",L.prototype.width))),b=Math.max(1.5*L.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",L.prototype.height)));
-return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(L.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*L.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},process:function(a){var c=[V(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,"size",m.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(ra(a));return c},cross:function(a){return[V(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",ma.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[V(a,["size"],function(a){var c=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",l.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=[V(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",ka.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(ra(a));return c},dataStorage:function(a){return[V(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",M.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=[V(a,["size","position"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",D.prototype.size))),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",D.prototype.position)));mxUtils.getValue(this.state.style,"base",D.prototype.base);return new mxPoint(a.x+b*a.width,a.y+a.height-c)},function(a,c){mxUtils.getValue(this.state.style,"base",D.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}),V(a,["position2"],function(a){var c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",D.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}),V(a,["base"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",D.prototype.size))),
-b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",D.prototype.position))),g=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"base",D.prototype.base)));return new mxPoint(a.x+Math.min(a.width,b*a.width+g),a.y+a.height-c)},function(a,c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",D.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(a.width,c.x-a.x-b*a.width)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,
-!1)&&c.push(ra(a));return c},internalStorage:function(a){var c=[V(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",S.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",S.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,
-!1)&&c.push(ra(a));return c},corner:function(a){return[V(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",X.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",X.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},tee:function(a){return[V(a,["dx","dy"],function(a){var c=
-Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",ga.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",ga.prototype.dy)));return new mxPoint(a.x+(a.width+c)/2,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,2*Math.min(a.width/2,c.x-a.x-a.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},singleArrow:wa(1),doubleArrow:wa(.5),folder:function(a){return[V(a,["tabWidth","tabHeight"],function(a){var c=
-Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",t.prototype.tabWidth))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",t.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",t.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(c=a.width-c);return new mxPoint(a.x+c,a.y+b)},function(a,c){var b=Math.max(0,Math.min(a.width,c.x-a.x));mxUtils.getValue(this.state.style,"tabPosition",t.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&
-(b=a.width-b);this.state.style.tabWidth=Math.round(b);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},document:function(a){return[V(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",C.prototype.size))));return new mxPoint(a.x+3*a.width/4,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))})]},tape:function(a){return[V(a,["size"],function(a){var c=Math.max(0,
-Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",A.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[V(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:Ha(u.prototype.size,!0,null,!0,u.prototype.fixedSize),hexagon:Ha(F.prototype.size,!0,.5,!0),curlyBracket:Ha(k.prototype.size,!1),display:Ha(fa.prototype.size,!1),cube:Na(1,a.prototype.size,!1),card:Na(.5,x.prototype.size,!0),loopLimit:Na(.5,N.prototype.size,!0),trapezoid:Oa(.5),parallelogram:Oa(1)};Graph.createHandle=V;Graph.handleFactory=Ia;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=Ia[a];null==a&&null!=this.state.shape&&this.state.shape.isRoundable()&&(a=Ia[mxConstants.SHAPE_RECTANGLE]);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=Ia[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Ja=new mxPoint(1,0),Ka=new mxPoint(1,0),wa=mxUtils.toRadians(-30),Ja=mxUtils.getRotatedPoint(Ja,Math.cos(wa),Math.sin(wa)),wa=mxUtils.toRadians(-150),Ka=mxUtils.getRotatedPoint(Ka,Math.cos(wa),Math.sin(wa));mxEdgeStyle.IsometricConnector=function(a,c,b,g,d){var f=a.view;g=null!=g&&0<g.length?g[0]:null;var k=a.absolutePoints,m=k[0],k=k[k.length-1];null!=
-g&&(g=f.transformControlPoint(a,g));null==m&&null!=c&&(m=new mxPoint(c.getCenterX(),c.getCenterY()));null==k&&null!=b&&(k=new mxPoint(b.getCenterX(),b.getCenterY()));var v=Ja.x,p=Ja.y,q=Ka.x,B=Ka.y,u="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=k&&null!=m){a=function(a,c,b){a-=z.x;var g=c-z.y;c=(B*a-q*g)/(v*B-p*q);a=(p*a-v*g)/(p*q-v*B);u?(b&&(z=new mxPoint(z.x+v*c,z.y+p*c),d.push(z)),z=new mxPoint(z.x+q*a,z.y+B*a)):(b&&(z=new mxPoint(z.x+q*a,z.y+B*a),d.push(z)),z=new mxPoint(z.x+
-v*c,z.y+p*c));d.push(z)};var z=m;null==g&&(g=new mxPoint(m.x+(k.x-m.x)/2,m.y+(k.y-m.y)/2));a(g.x,g.y,!0);a(k.x,k.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Pa=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Pa.apply(this,arguments)};b.prototype.constraints=[];f.prototype.getConstraints=function(a,c,b){a=[];var g=
-Math.tan(mxUtils.toRadians(30)),d=(.5-g)/2,g=Math.min(c,b/(.5+g));c=(c-g)/2;b=(b-g)/2;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b+.25*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*g,b+g*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+g,b+.25*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+g,b+.75*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*g,b+(1-d)*g));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,c,b+.75*g));return a};D.prototype.getConstraints=function(a,c,b){a=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var g=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1));a.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b-g)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b-g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,
-b-g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-g)));c>=2*g&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};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,
+null!=c&&(b=Math.max(b,c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var G=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){G.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),
+this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Z=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Z.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 na=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){na.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var ja=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){ja.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),
+this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function m(){mxActor.call(this)}function p(){mxCylinder.call(this)}function v(){mxActor.call(this)}function B(){mxActor.call(this)}function z(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function t(){mxActor.call(this)}function n(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,n.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,n.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,n.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,n.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
+this.canvas.curveTo=mxUtils.bind(this,n.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,n.prototype.arcTo)}function l(){mxRectangleShape.call(this)}function x(){mxRectangleShape.call(this)}function A(){mxActor.call(this)}function q(){mxActor.call(this)}function F(){mxActor.call(this)}function y(){mxRectangleShape.call(this)}function E(){mxRectangleShape.call(this)}function u(){mxCylinder.call(this)}function C(){mxShape.call(this)}function K(){mxShape.call(this)}
+function Y(){mxEllipse.call(this)}function H(){mxShape.call(this)}function O(){mxShape.call(this)}function D(){mxRectangleShape.call(this)}function L(){mxShape.call(this)}function Q(){mxShape.call(this)}function P(){mxShape.call(this)}function ba(){mxShape.call(this)}function W(){mxShape.call(this)}function G(){mxCylinder.call(this)}function Z(){mxDoubleEllipse.call(this)}function na(){mxDoubleEllipse.call(this)}function ja(){mxArrowConnector.call(this);this.spacing=0}function ca(){mxArrowConnector.call(this);
+this.spacing=0}function ka(){mxActor.call(this)}function S(){mxRectangleShape.call(this)}function V(){mxActor.call(this)}function pa(){mxActor.call(this)}function ga(){mxActor.call(this)}function R(){mxActor.call(this)}function la(){mxActor.call(this)}function M(){mxActor.call(this)}function I(){mxActor.call(this)}function ea(){mxActor.call(this)}function N(){mxActor.call(this)}function T(){mxActor.call(this)}function ha(){mxEllipse.call(this)}function ia(){mxEllipse.call(this)}function J(){mxEllipse.call(this)}
+function qa(){mxRhombus.call(this)}function aa(){mxEllipse.call(this)}function da(){mxEllipse.call(this)}function Aa(){mxEllipse.call(this)}function wa(){mxEllipse.call(this)}function za(){mxActor.call(this)}function ma(){mxActor.call(this)}function fa(){mxActor.call(this)}function sa(){mxConnector.call(this)}function Ea(a,c,b,f,d,e,g,l,u,n){g+=u;var X=f.clone();f.x-=d*(2*g+u);f.y-=e*(2*g+u);d*=g+u;e*=g+u;return function(){a.ellipse(X.x-d-g,X.y-e-g,2*g,2*g);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,
+mxCylinder);a.prototype.size=20;a.prototype.darkOpacity=0;a.prototype.darkOpacity2=0;a.prototype.paintVertexShape=function(a,c,b,f,d){var e=Math.max(0,Math.min(f,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),g=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),X=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));a.translate(c,b);a.begin();a.moveTo(0,0);a.lineTo(f-e,0);a.lineTo(f,
+e);a.lineTo(f,d);a.lineTo(e,d);a.lineTo(0,d-e);a.lineTo(0,0);a.close();a.end();a.fillAndStroke();this.outline||(a.setShadow(!1),0!=g&&(a.setFillAlpha(Math.abs(g)),a.setFillColor(0>g?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(f-e,0),a.lineTo(f,e),a.lineTo(e,e),a.close(),a.fill()),0!=X&&(a.setFillAlpha(Math.abs(X)),a.setFillColor(0>X?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(e,e),a.lineTo(e,d),a.lineTo(0,d-e),a.close(),a.fill()),a.begin(),a.moveTo(e,d),a.lineTo(e,e),a.lineTo(0,
+0),a.moveTo(e,e),a.lineTo(f,e),a.end(),a.stroke())};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 ta=Math.tan(mxUtils.toRadians(30)),oa=(.5-ta)/2;mxUtils.extend(b,mxActor);b.prototype.size=20;b.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(f,d/ta);a.translate((f-c)/2,(d-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",b);mxUtils.extend(e,mxCylinder);e.prototype.size=20;e.prototype.redrawPath=function(a,c,b,f,d,e){c=Math.min(f,d/(.5+ta));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((f-c)/2,(d-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(d,mxCylinder);d.prototype.redrawPath=function(a,c,b,f,d,e){c=Math.min(d/2,Math.round(d/8)+this.strokewidth-1);if(e&&null!=this.fill||!e&&null==this.fill)a.moveTo(0,c),a.curveTo(0,2*c,f,2*c,f,c),e||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,f,2*c,f,c),e||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,f,2*c,f,c),e||(a.stroke(),a.begin()),a.translate(0,-c);e||(a.moveTo(0,
+c),a.curveTo(0,-c/3,f,-c/3,f,c),a.lineTo(f,d-c),a.curveTo(f,d+c/3,0,d+c/3,0,d-c),a.close())};d.prototype.getLabelMargins=function(a){return new mxRectangle(0,2.5*Math.min(a.height/2,Math.round(a.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",d);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.darkOpacity=0;k.prototype.paintVertexShape=function(a,c,b,f,d){var e=Math.max(0,Math.min(f,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),g=
+Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));a.translate(c,b);a.begin();a.moveTo(0,0);a.lineTo(f-e,0);a.lineTo(f,e);a.lineTo(f,d);a.lineTo(0,d);a.lineTo(0,0);a.close();a.end();a.fillAndStroke();this.outline||(a.setShadow(!1),0!=g&&(a.setFillAlpha(Math.abs(g)),a.setFillColor(0>g?"#FFFFFF":"#000000"),a.begin(),a.moveTo(f-e,0),a.lineTo(f-e,e),a.lineTo(f,e),a.close(),a.fill()),a.begin(),a.moveTo(f-e,0),a.lineTo(f-e,e),a.lineTo(f,e),a.end(),a.stroke())};
+mxCellRenderer.registerShape("note",k);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,0);a.quadTo(f/2,.5*d,f,0);a.quadTo(.5*f,d/2,f,d);a.quadTo(f/2,.5*d,0,d);a.quadTo(.5*f,d/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,b,f,d,e){c=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));
+b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var g=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);e?"left"==g?(a.moveTo(0,b),a.lineTo(c,b)):(a.moveTo(f-c,b),a.lineTo(f,b)):("left"==g?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,b),a.lineTo(f,b)):(a.moveTo(0,b),a.lineTo(f-c,b),a.lineTo(f-c,0),a.lineTo(f,0)),a.lineTo(f,d),a.lineTo(0,d),a.lineTo(0,b),a.close());a.end()};mxCellRenderer.registerShape("folder",p);mxUtils.extend(v,mxActor);v.prototype.size=
+30;v.prototype.isRoundable=function(){return!0};v.prototype.redrawPath=function(a,c,b,f,d){c=Math.max(0,Math.min(f,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(f,0),new mxPoint(f,d),new mxPoint(0,d),new mxPoint(0,c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",v);mxUtils.extend(B,mxActor);B.prototype.size=.4;B.prototype.redrawPath=
+function(a,c,b,f,d){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(f/4,1.4*c,f/2,c/2);a.quadTo(3*f/4,c*(1-1.4),f,c/2);a.lineTo(f,d-c/2);a.quadTo(3*f/4,d-1.4*c,f/2,d-c/2);a.quadTo(f/4,d-c*(1-1.4),0,d-c/2);a.lineTo(0,c/2);a.close();a.end()};B.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=mxUtils.getValue(this.style,"size",this.size),b=a.width,f=a.height;if(null==this.direction||this.direction==
+mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return c*=f,new mxRectangle(a.x,a.y+c,b,f-2*c);c*=b;return new mxRectangle(a.x+c,a.y,b-2*c,f)}return a};mxCellRenderer.registerShape("tape",B);mxUtils.extend(z,mxActor);z.prototype.size=.3;z.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*a.height):null};z.prototype.redrawPath=function(a,c,b,f,d){c=d*Math.max(0,
+Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(f,0);a.lineTo(f,d-c/2);a.quadTo(3*f/4,d-1.4*c,f/2,d-c/2);a.quadTo(f/4,d-c*(1-1.4),0,d-c/2);a.lineTo(0,c/2);a.close();a.end()};mxCellRenderer.registerShape("document",z);var Ka=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(a,c,b,f){var d=mxUtils.getValue(this.style,"size");return null!=d?f*Math.max(0,Math.min(1,d)):Ka.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=
+function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,a.height*c),0,0)}return null};mxUtils.extend(c,mxActor);c.prototype.size=.2;c.prototype.isRoundable=function(){return!0};c.prototype.redrawPath=function(a,c,b,f,d){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
+2;this.addPoints(a,[new mxPoint(0,d),new mxPoint(c,0),new mxPoint(f,0),new mxPoint(f-c,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",c);mxUtils.extend(f,mxActor);f.prototype.size=.2;f.prototype.isRoundable=function(){return!0};f.prototype.redrawPath=function(a,c,b,f,d){c=f*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,
+d),new mxPoint(c,0),new mxPoint(f-c,0),new mxPoint(f,d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("trapezoid",f);mxUtils.extend(g,mxActor);g.prototype.size=.5;g.prototype.redrawPath=function(a,c,b,f,d){a.setFillColor(null);c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(f,0),new mxPoint(c,0),new mxPoint(c,d/2),new mxPoint(0,d/2),new mxPoint(c,
+d/2),new mxPoint(c,d),new mxPoint(f,d)],this.isRounded,b,!1);a.end()};mxCellRenderer.registerShape("curlyBracket",g);mxUtils.extend(t,mxActor);t.prototype.redrawPath=function(a,c,b,f,d){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=f/5;a.rect(0,0,c,d);a.fillAndStroke();a.rect(2*c,0,c,d);a.fillAndStroke();a.rect(4*c,0,c,d);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",t);n.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=
+c;this.firstX=a;this.firstY=c};n.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)};n.prototype.quadTo=function(a,c,b,f){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=f};n.prototype.curveTo=function(a,c,b,f,d,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=e};n.prototype.arcTo=function(a,c,b,f,
+d,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=g};n.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var b=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},f=Math.abs(a-this.lastX),d=Math.abs(c-this.lastY),e=Math.sqrt(f*f+d*d);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 X=b(a-this.lastX)*f/g,b=b(c-this.lastY)*d/g,
+f=f/e,d=d/e,e=0;e<g;e++){var u=(Math.random()-.5)*l;this.originalLineTo.call(this.canvas,X*e+this.lastX-u*d,b*e+this.lastY-u*f)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};n.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 Ba=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 n(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Ba.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var La=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==
+this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&La.apply(this,arguments)};var Ca=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,c,b,f,d){if(null==a.handJiggle)Ca.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(f/2,Math.min(d/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(f*e,d*e)),a.moveTo(c+e,b),a.lineTo(c+f-e,b),a.quadTo(c+f,b,c+f,b+e),a.lineTo(c+f,b+d-e),a.quadTo(c+f,b+d,c+f-e,b+d),a.lineTo(c+e,b+d),a.quadTo(c,b+d,c,b+d-e),
+a.lineTo(c,b+e),a.quadTo(c,b,c+e,b)):(a.moveTo(c,b),a.lineTo(c+f,b),a.lineTo(c+f,b+d),a.lineTo(c,b+d),a.lineTo(c,b)),a.close(),a.end(),a.fillAndStroke()}};var xa=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,c,b,f,d){null==a.handJiggle&&xa.apply(this,arguments)};mxUtils.extend(l,mxRectangleShape);l.prototype.size=.1;l.prototype.isHtmlAllowed=function(){return!1};l.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,b=a.height;a=new mxRectangle(a.x,a.y,c,b);var f=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.max(f,Math.min(c*d,b*d));a.x+=Math.round(f);a.width-=Math.round(2*f)}return a};l.prototype.paintForeground=
+function(a,c,b,f,d){var e=f*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(f*g,d*g));e=Math.round(e);a.begin();a.moveTo(c+e,b);a.lineTo(c+e,b+d);a.moveTo(c+f-e,b);a.lineTo(c+f-e,b+d);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",l);mxUtils.extend(x,
+mxRectangleShape);x.prototype.paintBackground=function(a,c,b,f,d){a.setFillColor(mxConstants.NONE);a.rect(c,b,f,d);a.fill()};x.prototype.paintForeground=function(a,c,b,f,d){};mxCellRenderer.registerShape("transparent",x);mxUtils.extend(A,mxHexagon);A.prototype.size=30;A.prototype.position=.5;A.prototype.position2=.5;A.prototype.base=20;A.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};A.prototype.isRoundable=
+function(){return!0};A.prototype.redrawPath=function(a,c,b,f,d){c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),g=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),l=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"base",this.base))));
+this.addPoints(a,[new mxPoint(0,0),new mxPoint(f,0),new mxPoint(f,d-b),new mxPoint(Math.min(f,e+l),d-b),new mxPoint(g,d),new mxPoint(Math.max(0,e),d-b),new mxPoint(0,d-b)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",A);mxUtils.extend(q,mxActor);q.prototype.size=.2;q.prototype.fixedSize=20;q.prototype.isRoundable=function(){return!0};q.prototype.redrawPath=function(a,c,b,f,d){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,
+"size",this.fixedSize)))):f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(f-c,0),new mxPoint(f,d/2),new mxPoint(f-c,d),new mxPoint(0,d),new mxPoint(c,d/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",q);mxUtils.extend(F,mxHexagon);F.prototype.size=.25;F.prototype.isRoundable=function(){return!0};F.prototype.redrawPath=
+function(a,c,b,f,d){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(f-c,0),new mxPoint(f,.5*d),new mxPoint(f-c,d),new mxPoint(c,d),new mxPoint(0,.5*d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",F);mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.paintForeground=function(a,
+c,b,f,d){var e=Math.min(f/5,d/5)+1;a.begin();a.moveTo(c+f/2,b+e);a.lineTo(c+f/2,b+d-e);a.moveTo(c+e,b+d/2);a.lineTo(c+f-e,b+d/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",y);var ua=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,b,f,d){ua.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;b+=e;f-=2*e;d-=2*e;0<f&&0<d&&(a.setShadow(!1),ua.apply(this,[a,c,b,f,d]))}};mxUtils.extend(E,mxRectangleShape);E.prototype.isHtmlAllowed=function(){return!1};E.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};E.prototype.paintForeground=function(a,c,b,f,d){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;b+=e;f-=2*e;d-=2*e;0<f&&0<d&&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"],X=this.style["symbol"+e+"VerticalAlign"],u=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],t=this.style["symbol"+e+"Spacing"]||0,C=this.style["symbol"+e+"VSpacing"]||t,q=this.style["symbol"+e+"ArcSpacing"];null!=q&&(q*=this.getArcSize(f+this.strokewidth,d+this.strokewidth),t+=q,C+=q);var q=c,x=b,q=l==mxConstants.ALIGN_CENTER?q+(f-u)/2:l==mxConstants.ALIGN_RIGHT?q+(f-u-t):q+t,x=X==mxConstants.ALIGN_MIDDLE?x+(d-n)/2:X==mxConstants.ALIGN_BOTTOM?
+x+(d-n-C):x+C;a.save();l=new g;l.style=this.style;g.prototype.paintVertexShape.call(l,a,q,x,u,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",E);mxUtils.extend(u,mxCylinder);u.prototype.redrawPath=function(a,c,b,f,d,e){e?(a.moveTo(0,0),a.lineTo(f/2,d/2),a.lineTo(f,0),a.end()):(a.moveTo(0,0),a.lineTo(f,0),a.lineTo(f,d),a.lineTo(0,d),a.close())};mxCellRenderer.registerShape("message",u);mxUtils.extend(C,mxShape);
+C.prototype.paintBackground=function(a,c,b,f,d){a.translate(c,b);a.ellipse(f/4,0,f/2,d/4);a.fillAndStroke();a.begin();a.moveTo(f/2,d/4);a.lineTo(f/2,2*d/3);a.moveTo(f/2,d/3);a.lineTo(0,d/3);a.moveTo(f/2,d/3);a.lineTo(f,d/3);a.moveTo(f/2,2*d/3);a.lineTo(0,d);a.moveTo(f/2,2*d/3);a.lineTo(f,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlActor",C);mxUtils.extend(K,mxShape);K.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};K.prototype.paintBackground=function(a,
+c,b,f,d){a.translate(c,b);a.begin();a.moveTo(0,d/4);a.lineTo(0,3*d/4);a.end();a.stroke();a.begin();a.moveTo(0,d/2);a.lineTo(f/6,d/2);a.end();a.stroke();a.ellipse(f/6,0,5*f/6,d);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",K);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+f/8,b+d);a.lineTo(c+7*f/8,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",Y);mxUtils.extend(H,
+mxShape);H.prototype.paintVertexShape=function(a,c,b,f,d){a.translate(c,b);a.begin();a.moveTo(f,0);a.lineTo(0,d);a.moveTo(0,0);a.lineTo(f,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",H);mxUtils.extend(O,mxShape);O.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};O.prototype.paintBackground=function(a,c,b,f,d){a.translate(c,b);a.begin();a.moveTo(3*f/8,d/8*1.1);a.lineTo(5*f/8,0);a.end();a.stroke();a.ellipse(0,d/8,f,7*d/8);a.fillAndStroke()};
+O.prototype.paintForeground=function(a,c,b,f,d){a.begin();a.moveTo(3*f/8,d/8*1.1);a.lineTo(5*f/8,d/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",O);mxUtils.extend(D,mxRectangleShape);D.prototype.size=40;D.prototype.isHtmlAllowed=function(){return!1};D.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)};D.prototype.paintBackground=function(a,c,b,f,
+d){var e=Math.max(0,Math.min(d,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,b,f,e):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=D&&(g=new g,g.apply(this.state),a.save(),g.paintVertexShape(a,c,b,f,e),a.restore()));e<d&&(a.setDashed(!0),a.begin(),a.moveTo(c+f/2,b+e),a.lineTo(c+f/2,b+d),a.end(),a.stroke())};D.prototype.paintForeground=function(a,
+c,b,f,d){var e=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,b,f,Math.min(d,e))};mxCellRenderer.registerShape("umlLifeline",D);mxUtils.extend(L,mxShape);L.prototype.width=60;L.prototype.height=30;L.prototype.corner=10;L.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))};L.prototype.paintBackground=function(a,c,b,f,d){var e=this.corner,g=Math.min(f,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),l=Math.min(d,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),u=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);u!=mxConstants.NONE&&(a.setFillColor(u),a.rect(c,b,f,d),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=
+mxConstants.NONE?(this.getGradientBounds(a,c,b,f,d),a.setGradient(this.fill,this.gradient,c,b,f,d,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,b);a.lineTo(c+g,b);a.lineTo(c+g,b+Math.max(0,l-1.5*e));a.lineTo(c+Math.max(0,g-e),b+l);a.lineTo(c,b+l);a.close();a.fillAndStroke();a.begin();a.moveTo(c+g,b);a.lineTo(c+f,b);a.lineTo(c+f,b+d);a.lineTo(c,b+d);a.lineTo(c,b+l);a.stroke()};mxCellRenderer.registerShape("umlFrame",L);mxPerimeter.LifelinePerimeter=function(a,c,b,f){f=D.prototype.size;
+null!=c&&(f=mxUtils.getValue(c.style,"size",f)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;b.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+f,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(a,c,b,f){f=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);
+mxPerimeter.BackbonePerimeter=function(a,c,b,f){f=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;null!=c.style.backboneSize&&(f+=parseFloat(c.style.backboneSize)*c.view.scale/2-1);if("south"==c.style[mxConstants.STYLE_DIRECTION]||"north"==c.style[mxConstants.STYLE_DIRECTION])return b.x<a.getCenterX()&&(f=-1*(f+1)),new mxPoint(a.getCenterX()+f,Math.min(a.y+a.height,Math.max(a.y,b.y)));b.y<a.getCenterY()&&(f=-1*(f+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,b.x)),
+a.getCenterY()+f)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,c,b,f){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(c.style,"size",A.prototype.size))*c.view.scale))),c.style),c,b,f)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,b,f,d){var e=c.prototype.size;
+null!=b&&(e=mxUtils.getValue(b.style,"size",e));var g=a.x,l=a.y,u=a.width,n=a.height;b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH?(e=n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+u,l+e),new mxPoint(g+u,l+n),new mxPoint(g,l+n-e),new mxPoint(g,l)]):(e=u*Math.max(0,Math.min(1,e)),l=[new mxPoint(g+e,l),new mxPoint(g+u,l),new mxPoint(g+u-e,l+n),new mxPoint(g,
+l+n),new mxPoint(g+e,l)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(f.x<g||f.x>g+u?a.y=f.y:a.x=f.x);return mxUtils.getPerimeterPoint(l,a,f)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var e=f.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,l=a.y,u=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?(e=u*Math.max(0,Math.min(1,e)),l=[new mxPoint(g+e,l),new mxPoint(g+u-e,l),new mxPoint(g+u,l+n),new mxPoint(g,l+n),new mxPoint(g+e,l)]):c==mxConstants.DIRECTION_WEST?(e=u*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+u,l),new mxPoint(g+u-e,l+n),new mxPoint(g+e,l+n),new mxPoint(g,l)]):c==mxConstants.DIRECTION_NORTH?(e=n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+e),new mxPoint(g+u,l),new mxPoint(g+u,l+n),new mxPoint(g,l+n-e),new mxPoint(g,l+e)]):(e=n*Math.max(0,
+Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+u,l+e),new mxPoint(g+u,l+n-e),new mxPoint(g,l+n),new mxPoint(g,l)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<g||b.x>g+u?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(l,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,b,f){var d="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=d?q.prototype.fixedSize:q.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,
+"size",e));var g=a.x,l=a.y,u=a.width,n=a.height,X=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?(d=d?Math.max(0,Math.min(u,e)):u*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+u-d,l),new mxPoint(g+u,a),new mxPoint(g+u-d,l+n),new mxPoint(g,l+n),new mxPoint(g+d,a),new mxPoint(g,l)]):c==mxConstants.DIRECTION_WEST?(d=d?Math.max(0,Math.min(u,e)):u*Math.max(0,
+Math.min(1,e)),l=[new mxPoint(g+d,l),new mxPoint(g+u,l),new mxPoint(g+u-d,a),new mxPoint(g+u,l+n),new mxPoint(g+d,l+n),new mxPoint(g,a),new mxPoint(g+d,l)]):c==mxConstants.DIRECTION_NORTH?(d=d?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+d),new mxPoint(X,l),new mxPoint(g+u,l+d),new mxPoint(g+u,l+n),new mxPoint(X,l+n-d),new mxPoint(g,l+n),new mxPoint(g,l+d)]):(d=d?Math.max(0,Math.min(n,e)):n*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(X,l+d),new mxPoint(g+
+u,l),new mxPoint(g+u,l+n-d),new mxPoint(X,l+n),new mxPoint(g,l+n-d),new mxPoint(g,l)]);X=new mxPoint(X,a);f&&(b.x<g||b.x>g+u?X.y=b.y:X.x=b.x);return mxUtils.getPerimeterPoint(l,X,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,f){var d=F.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d));var e=a.x,g=a.y,l=a.width,u=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?(d=u*Math.max(0,Math.min(1,d)),g=[new mxPoint(n,g),new mxPoint(e+l,g+d),new mxPoint(e+l,g+u-d),new mxPoint(n,g+u),new mxPoint(e,g+u-d),new mxPoint(e,g+d),new mxPoint(n,g)]):(d=l*Math.max(0,Math.min(1,d)),g=[new mxPoint(e+d,g),new mxPoint(e+l-d,g),new mxPoint(e+l,a),new mxPoint(e+l-d,g+u),new mxPoint(e+d,g+u),new mxPoint(e,a),new mxPoint(e+d,g)]);n=new mxPoint(n,a);f&&(b.x<e||b.x>e+
+l?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(g,n,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(Q,mxShape);Q.prototype.size=10;Q.prototype.paintBackground=function(a,c,b,f,d){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((f-e)/2,0,e,e);a.fillAndStroke();a.begin();a.moveTo(f/2,e);a.lineTo(f/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",Q);mxUtils.extend(P,mxShape);P.prototype.size=
+10;P.prototype.inset=2;P.prototype.paintBackground=function(a,c,b,f,d){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size)),g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.begin();a.moveTo(f/2,e+g);a.lineTo(f/2,d);a.end();a.stroke();a.begin();a.moveTo((f-e)/2-g,e/2);a.quadTo((f-e)/2-g,e+g,f/2,e+g);a.quadTo((f+e)/2+g,e+g,(f+e)/2+g,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",P);mxUtils.extend(ba,mxShape);ba.prototype.paintBackground=
+function(a,c,b,f,d){a.translate(c,b);a.begin();a.moveTo(0,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,0,d);a.end();a.stroke()};mxCellRenderer.registerShape("requiredInterface",ba);mxUtils.extend(W,mxShape);W.prototype.inset=2;W.prototype.paintBackground=function(a,c,b,f,d){var e=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.ellipse(0,e,f-2*e,d-2*e);a.fillAndStroke();a.begin();a.moveTo(f/2,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,f/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",
+W);mxUtils.extend(G,mxCylinder);G.prototype.jettyWidth=32;G.prototype.jettyHeight=12;G.prototype.redrawPath=function(a,c,b,f,d,e){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=g/2;var g=b+g/2,l=.3*d-c/2,u=.7*d-c/2;e?(a.moveTo(b,l),a.lineTo(g,l),a.lineTo(g,l+c),a.lineTo(b,l+c),a.moveTo(b,u),a.lineTo(g,u),a.lineTo(g,u+c),a.lineTo(b,u+c)):(a.moveTo(b,0),a.lineTo(f,0),a.lineTo(f,d),a.lineTo(b,d),
+a.lineTo(b,u+c),a.lineTo(0,u+c),a.lineTo(0,u),a.lineTo(b,u),a.lineTo(b,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(b,l),a.close());a.end()};mxCellRenderer.registerShape("component",G);mxUtils.extend(Z,mxDoubleEllipse);Z.prototype.outerStroke=!0;Z.prototype.paintVertexShape=function(a,c,b,f,d){var e=Math.min(4,Math.min(f/5,d/5));0<f&&0<d&&(a.ellipse(c+e,b+e,f-2*e,d-2*e),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,b,f,d),a.stroke())};mxCellRenderer.registerShape("endState",Z);
+mxUtils.extend(na,Z);na.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",na);mxUtils.extend(ja,mxArrowConnector);ja.prototype.defaultWidth=4;ja.prototype.isOpenEnded=function(){return!0};ja.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};ja.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",ja);mxUtils.extend(ca,mxArrowConnector);ca.prototype.defaultWidth=
+10;ca.prototype.defaultArrowWidth=20;ca.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};ca.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};ca.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",ca);mxUtils.extend(ka,
+mxActor);ka.prototype.size=30;ka.prototype.isRoundable=function(){return!0};ka.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,d),new mxPoint(0,c),new mxPoint(f,0),new mxPoint(f,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",ka);mxUtils.extend(S,mxRectangleShape);S.prototype.dx=20;S.prototype.dy=
+20;S.prototype.isHtmlAllowed=function(){return!1};S.prototype.paintForeground=function(a,c,b,f,d){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e=0;if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(f*g,d*g));g=Math.max(e,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));e=Math.max(e,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(c,
+b+e);a.lineTo(c+f,b+e);a.end();a.stroke();a.begin();a.moveTo(c+g,b);a.lineTo(c+g,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("internalStorage",S);mxUtils.extend(V,mxActor);V.prototype.dx=20;V.prototype.dy=20;V.prototype.redrawPath=function(a,c,b,f,d){c=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,
+mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(f,0),new mxPoint(f,b),new mxPoint(c,b),new mxPoint(c,d),new mxPoint(0,d)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("corner",V);mxUtils.extend(pa,mxActor);pa.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,0);a.lineTo(0,d);a.end();a.moveTo(f,0);a.lineTo(f,d);a.end();a.moveTo(0,d/2);a.lineTo(f,d/2);a.end()};mxCellRenderer.registerShape("crossbar",pa);mxUtils.extend(ga,mxActor);
+ga.prototype.dx=20;ga.prototype.dy=20;ga.prototype.redrawPath=function(a,c,b,f,d){c=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(f,0),new mxPoint(f,b),new mxPoint((f+c)/2,b),new mxPoint((f+c)/2,d),
+new mxPoint((f-c)/2,d),new mxPoint((f-c)/2,b),new mxPoint(0,b)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("tee",ga);mxUtils.extend(R,mxActor);R.prototype.arrowWidth=.3;R.prototype.arrowSize=.2;R.prototype.redrawPath=function(a,c,b,f,d){var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(d-e)/2;var e=b+e,g=mxUtils.getValue(this.style,
+mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(f-c,b),new mxPoint(f-c,0),new mxPoint(f,d/2),new mxPoint(f-c,d),new mxPoint(f-c,e),new mxPoint(0,e)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("singleArrow",R);mxUtils.extend(la,mxActor);la.prototype.redrawPath=function(a,c,b,f,d){var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",R.prototype.arrowWidth))));c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
+"arrowSize",R.prototype.arrowSize))));b=(d-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,d/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(f-c,b),new mxPoint(f-c,0),new mxPoint(f,d/2),new mxPoint(f-c,d),new mxPoint(f-c,e),new mxPoint(c,e),new mxPoint(c,d)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",la);mxUtils.extend(M,mxActor);M.prototype.size=.1;M.prototype.redrawPath=function(a,c,
+b,f,d){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(c,0);a.lineTo(f,0);a.quadTo(f-2*c,d/2,f,d);a.lineTo(c,d);a.quadTo(c-2*c,d/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",M);mxUtils.extend(I,mxActor);I.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,0,d);a.close();a.end()};mxCellRenderer.registerShape("or",I);mxUtils.extend(ea,mxActor);ea.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,
+0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,0,d);a.quadTo(f/2,d/2,0,0);a.close();a.end()};mxCellRenderer.registerShape("xor",ea);mxUtils.extend(N,mxActor);N.prototype.size=20;N.prototype.isRoundable=function(){return!0};N.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(f/2,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(f-c,0),new mxPoint(f,.8*c),new mxPoint(f,
+d),new mxPoint(0,d),new mxPoint(0,.8*c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("loopLimit",N);mxUtils.extend(T,mxActor);T.prototype.size=.375;T.prototype.isRoundable=function(){return!0};T.prototype.redrawPath=function(a,c,b,f,d){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(f,0),new mxPoint(f,d-c),new mxPoint(f/
+2,d),new mxPoint(0,d-c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("offPageConnector",T);mxUtils.extend(ha,mxEllipse);ha.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+f/2,b+d);a.lineTo(c+f,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("tapeData",ha);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);
+a.begin();a.moveTo(c,b+d/2);a.lineTo(c+f,b+d/2);a.end();a.stroke();a.begin();a.moveTo(c+f/2,b);a.lineTo(c+f/2,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("orEllipse",ia);mxUtils.extend(J,mxEllipse);J.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(c+.145*f,b+.145*d);a.lineTo(c+.855*f,b+.855*d);a.end();a.stroke();a.begin();a.moveTo(c+.855*f,b+.145*d);a.lineTo(c+.145*f,b+.855*d);a.end();a.stroke()};
+mxCellRenderer.registerShape("sumEllipse",J);mxUtils.extend(qa,mxRhombus);qa.prototype.paintVertexShape=function(a,c,b,f,d){mxRhombus.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(c,b+d/2);a.lineTo(c+f,b+d/2);a.end();a.stroke()};mxCellRenderer.registerShape("sortShape",qa);mxUtils.extend(aa,mxEllipse);aa.prototype.paintVertexShape=function(a,c,b,f,d){a.begin();a.moveTo(c,b);a.lineTo(c+f,b);a.lineTo(c+f/2,b+d/2);a.close();a.fillAndStroke();a.begin();a.moveTo(c,
+b+d);a.lineTo(c+f,b+d);a.lineTo(c+f/2,b+d/2);a.close();a.fillAndStroke()};mxCellRenderer.registerShape("collate",aa);mxUtils.extend(da,mxEllipse);da.prototype.paintVertexShape=function(a,c,b,f,d){var e=b+d-5;a.begin();a.moveTo(c,b);a.lineTo(c,b+d);a.moveTo(c,e);a.lineTo(c+10,e-5);a.moveTo(c,e);a.lineTo(c+10,e+5);a.moveTo(c,e);a.lineTo(c+f,e);a.moveTo(c+f,b);a.lineTo(c+f,b+d);a.moveTo(c+f,e);a.lineTo(c+f-10,e-5);a.moveTo(c+f,e);a.lineTo(c+f-10,e+5);a.end();a.stroke()};mxCellRenderer.registerShape("dimension",
+da);mxUtils.extend(Aa,mxEllipse);Aa.prototype.paintVertexShape=function(a,c,b,f,d){this.outline||a.setStrokeColor(null);mxRectangleShape.prototype.paintBackground.apply(this,arguments);null!=this.style&&(a.setStrokeColor(this.stroke),a.rect(c,b,f,d),a.fill(),a.begin(),a.moveTo(c,b),"1"==mxUtils.getValue(this.style,"top","1")?a.lineTo(c+f,b):a.moveTo(c+f,b),"1"==mxUtils.getValue(this.style,"right","1")?a.lineTo(c+f,b+d):a.moveTo(c+f,b+d),"1"==mxUtils.getValue(this.style,"bottom","1")?a.lineTo(c,b+
+d):a.moveTo(c,b+d),"1"==mxUtils.getValue(this.style,"left","1")&&a.lineTo(c,b-this.strokewidth/2),a.end(),a.stroke())};mxCellRenderer.registerShape("partialRectangle",Aa);mxUtils.extend(wa,mxEllipse);wa.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(c+f/2,b),a.lineTo(c+f/2,b+d)):(a.moveTo(c,b+d/2),a.lineTo(c+f,b+d/2));a.end();a.stroke()};mxCellRenderer.registerShape("lineEllipse",
+wa);mxUtils.extend(za,mxActor);za.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(f,d/2);a.moveTo(0,0);a.lineTo(f-c,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,f-c,d);a.lineTo(0,d);a.close();a.end()};mxCellRenderer.registerShape("delay",za);mxUtils.extend(ma,mxActor);ma.prototype.size=.2;ma.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(d,f);var e=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(d-e)/2;b=c+e;var g=(f-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(f,c);a.lineTo(f,b);a.lineTo(e,b);a.lineTo(e,d);a.lineTo(g,d);a.lineTo(g,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",ma);mxUtils.extend(fa,mxActor);fa.prototype.size=.25;fa.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(f,d/2);b=Math.min(f-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*f);a.moveTo(0,d/2);a.lineTo(b,0);a.lineTo(f-c,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,f-c,d);a.lineTo(b,d);a.close();a.end()};
+mxCellRenderer.registerShape("display",fa);mxUtils.extend(sa,mxConnector);sa.prototype.origPaintEdgeShape=sa.prototype.paintEdgeShape;sa.prototype.paintEdgeShape=function(a,c,b){for(var f=[],d=0;d<c.length;d++)f.push(mxUtils.clone(c[d]));var d=a.state.dashed,e=a.state.fixDash;sa.prototype.origPaintEdgeShape.apply(this,[a,f,b]);3<=a.state.strokeWidth&&(f=mxUtils.getValue(this.style,"fillColor",null),null!=f&&(a.setStrokeColor(f),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(d,e),sa.prototype.origPaintEdgeShape.apply(this,
+[a,c,b])))};mxCellRenderer.registerShape("filledEdge",sa);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,f,d,e,g,l,u,n){var t=d*(g+u+1),q=e*(g+u+1);return function(){a.begin();
+a.moveTo(f.x-t/2-q/2,f.y-q/2+t/2);a.lineTo(f.x+q/2-3*t/2,f.y-3*q/2-t/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,f,d,e,g,l,u,n){var t=d*(g+u+1),q=e*(g+u+1);return function(){a.begin();a.moveTo(f.x-t/2-q/2,f.y-q/2+t/2);a.lineTo(f.x+q/2-3*t/2,f.y-3*q/2-t/2);a.moveTo(f.x-t/2+q/2,f.y-q/2-t/2);a.lineTo(f.x-q/2-3*t/2,f.y-3*q/2+t/2);a.stroke()}});mxMarker.addMarker("circle",Ea);mxMarker.addMarker("circlePlus",function(a,c,b,f,d,e,g,l,u,n){var t=f.clone(),q=Ea.apply(this,arguments),C=d*(g+
+2*u),x=e*(g+2*u);return function(){q.apply(this,arguments);a.begin();a.moveTo(t.x-d*u,t.y-e*u);a.lineTo(t.x-2*C+d*u,t.y-2*x+e*u);a.moveTo(t.x-C-x+e*u,t.y-x+C-d*u);a.lineTo(t.x+x-C-e*u,t.y-x-C+d*u);a.stroke()}});mxMarker.addMarker("halfCircle",function(a,c,b,f,d,e,g,l,u,n){var t=d*(g+u+1),q=e*(g+u+1),C=f.clone();f.x-=t;f.y-=q;return function(){a.begin();a.moveTo(C.x-q,C.y+t);a.quadTo(f.x-q,f.y+t,f.x,f.y);a.quadTo(f.x+q,f.y-t,C.x+q,C.y-t);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,f,d,
+e,g,l,u,n){c=d*u*1.118;b=e*u*1.118;d*=g+u;e*=g+u;var t=f.clone();t.x-=c;t.y-=b;f.x+=1*-d-c;f.y+=1*-e-b;return function(){a.begin();a.moveTo(t.x,t.y);l?a.lineTo(t.x-d-e/2,t.y-e+d/2):a.lineTo(t.x+e/2-d,t.y-e-d/2);a.lineTo(t.x-d,t.y-e);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,f,d,e,g,l,u,n,t){e*=l+n;g*=l+n;var q=d.clone();return function(){c.begin();c.moveTo(q.x,q.y);u?c.lineTo(q.x-e-g/a,q.y-g+e/a):c.lineTo(q.x+g/a-e,q.y-
+g-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Fa=function(a,c,b){return ya(a,["width"],c,function(c,f,d,e,g){g=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(e.x+f*c/4+d*g/2,e.y+d*c/4-f*g/2)},function(c,f,d,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-b})},ya=function(a,c,b,f,d){return U(a,c,function(c){var d=a.absolutePoints,e=d.length-1;c=a.view.translate;var g=a.view.scale,l=b?d[0]:d[e],d=b?d[1]:d[e-
+1],e=d.x-l.x,u=d.y-l.y,n=Math.sqrt(e*e+u*u),l=f.call(this,n,e/n,u/n,l,d);return new mxPoint(l.x/g-c.x,l.y/g-c.y)},function(c,f,e){var g=a.absolutePoints,l=g.length-1;c=a.view.translate;var u=a.view.scale,n=b?g[0]:g[l],g=b?g[1]:g[l-1],l=g.x-n.x,t=g.y-n.y,q=Math.sqrt(l*l+t*t);f.x=(f.x+c.x)*u;f.y=(f.y+c.y)*u;d.call(this,q,l/q,t/q,n,g,f,e)})},va=function(a){return function(c){return[U(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",R.prototype.arrowWidth))),
+f=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",R.prototype.arrowSize)));return new mxPoint(c.x+(1-f)*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))})]}},Ma=function(a,c,b){return function(f){var d=[U(f,["size"],function(b){var f=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+f,b.y+f)},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(f.style,mxConstants.STYLE_ROUNDED,!1)&&d.push(ra(f));return d}},Ga=function(a,c,b,f,d){b=null!=b?b:1;return function(e){var g=[U(e,["size"],function(c){var b=null!=d?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,f=parseFloat(mxUtils.getValue(this.state.style,"size",b?d:a));return new mxPoint(c.x+
+Math.max(0,Math.min(c.width,f*(b?1:c.width))),c.getCenterY())},function(a,c,f){var g=null!=d?"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(f.getEvent())&&(a=e.view.graph.snap(a));this.state.style.size=a},null,f)];c&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&g.push(ra(e));return g}},Na=function(a){return function(c){var b=[U(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style,
+"size",f.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(ra(c));return b}},Da=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ra(a));return c}},ra=function(a,c){return U(a,[mxConstants.STYLE_ARCSIZE],function(b){var f=null!=c?c:b.height/8;if("1"==mxUtils.getValue(a.style,
+mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var d=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,d),b.y+f)}d=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)*d),b.y+f)},function(c,b,f){"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))))})},U=function(a,c,b,f,d,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=f;g.ignoreGrid=null!=d?d:!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},Ha={link:function(a){return[Fa(a,!0,10),Fa(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(ya(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,f,d,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(d.x+b*(e+a.shape.strokewidth*a.view.scale)+f*c/2,d.y+f*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,f,d,e,g,l,u){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));f=mxUtils.ptLineDist(e.x,e.y,e.x+d,e.y-f,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(f-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(u.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=
+a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(u.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(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,f,d,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(d.x+b*(e+a.shape.strokewidth*a.view.scale)+f*c/2,d.y+f*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,f,d,e,g,l,u){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));f=mxUtils.ptLineDist(e.x,e.y,e.x+d,e.y-f,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(f-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(u.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=
+a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(u.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(ya(a,
+["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,f,d,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(d.x+b*(e+a.shape.strokewidth*a.view.scale)-f*c/2,d.y+f*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,f,d,e,g,l,u){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));f=mxUtils.ptLineDist(e.x,e.y,e.x+d,e.y-f,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]=
+Math.round(100*(f-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(u.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(u.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(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],
+!1,function(c,b,f,d,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(d.x+b*(e+a.shape.strokewidth*a.view.scale)-f*c/2,d.y+f*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,f,d,e,g,l,u){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));f=mxUtils.ptLineDist(e.x,e.y,e.x+d,e.y-f,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(f-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(u.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(u.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=[U(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(ra(a,b/2))}return c},label:Da(),ext:Da(),rectangle:Da(),triangle:Da(),rhombus:Da(),umlLifeline:function(a){return[U(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,
+parseFloat(mxUtils.getValue(this.state.style,"size",D.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[U(a,["width","height"],function(a){var c=Math.max(L.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,"width",L.prototype.width))),b=Math.max(1.5*L.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",L.prototype.height)));
+return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(L.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*L.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},process:function(a){var c=[U(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,"size",l.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(ra(a));return c},cross:function(a){return[U(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",ma.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[U(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=[U(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",ka.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(ra(a));return c},dataStorage:function(a){return[U(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",M.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=[U(a,["size","position"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",A.prototype.size))),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",A.prototype.position)));mxUtils.getValue(this.state.style,"base",A.prototype.base);return new mxPoint(a.x+b*a.width,a.y+a.height-c)},function(a,c){mxUtils.getValue(this.state.style,"base",A.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}),U(a,["position2"],function(a){var c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",A.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}),U(a,["base"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",A.prototype.size))),
+b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",A.prototype.position))),f=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"base",A.prototype.base)));return new mxPoint(a.x+Math.min(a.width,b*a.width+f),a.y+a.height-c)},function(a,c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",A.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(a.width,c.x-a.x-b*a.width)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,
+!1)&&c.push(ra(a));return c},internalStorage:function(a){var c=[U(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",S.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",S.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,
+!1)&&c.push(ra(a));return c},corner:function(a){return[U(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",V.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",V.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},tee:function(a){return[U(a,["dx","dy"],function(a){var c=
+Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",ga.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",ga.prototype.dy)));return new mxPoint(a.x+(a.width+c)/2,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,2*Math.min(a.width/2,c.x-a.x-a.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},singleArrow:va(1),doubleArrow:va(.5),folder:function(a){return[U(a,["tabWidth","tabHeight"],function(a){var c=
+Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",p.prototype.tabWidth))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",p.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",p.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(c=a.width-c);return new mxPoint(a.x+c,a.y+b)},function(a,c){var b=Math.max(0,Math.min(a.width,c.x-a.x));mxUtils.getValue(this.state.style,"tabPosition",p.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&
+(b=a.width-b);this.state.style.tabWidth=Math.round(b);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},document:function(a){return[U(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",z.prototype.size))));return new mxPoint(a.x+3*a.width/4,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))})]},tape:function(a){return[U(a,["size"],function(a){var c=Math.max(0,
+Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",B.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[U(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",T.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:Ga(q.prototype.size,!0,null,!0,q.prototype.fixedSize),hexagon:Ga(F.prototype.size,!0,.5,!0),curlyBracket:Ga(g.prototype.size,!1),display:Ga(fa.prototype.size,!1),cube:Ma(1,a.prototype.size,!1),card:Ma(.5,v.prototype.size,!0),loopLimit:Ma(.5,N.prototype.size,!0),trapezoid:Na(.5),parallelogram:Na(1)};Graph.createHandle=U;Graph.handleFactory=Ha;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=Ha[a];null==a&&null!=this.state.shape&&this.state.shape.isRoundable()&&(a=Ha[mxConstants.SHAPE_RECTANGLE]);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=Ha[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Ia=new mxPoint(1,0),Ja=new mxPoint(1,0),va=mxUtils.toRadians(-30),Ia=mxUtils.getRotatedPoint(Ia,Math.cos(va),Math.sin(va)),va=mxUtils.toRadians(-150),Ja=mxUtils.getRotatedPoint(Ja,Math.cos(va),Math.sin(va));mxEdgeStyle.IsometricConnector=function(a,c,b,f,d){var e=a.view;f=null!=f&&0<f.length?f[0]:null;var g=a.absolutePoints,l=g[0],g=g[g.length-1];null!=
+f&&(f=e.transformControlPoint(a,f));null==l&&null!=c&&(l=new mxPoint(c.getCenterX(),c.getCenterY()));null==g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var u=Ia.x,n=Ia.y,t=Ja.x,q=Ja.y,C="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=l){a=function(a,c,b){a-=x.x;var f=c-x.y;c=(q*a-t*f)/(u*q-n*t);a=(n*a-u*f)/(n*t-u*q);C?(b&&(x=new mxPoint(x.x+u*c,x.y+n*c),d.push(x)),x=new mxPoint(x.x+t*a,x.y+q*a)):(b&&(x=new mxPoint(x.x+t*a,x.y+q*a),d.push(x)),x=new mxPoint(x.x+
+u*c,x.y+n*c));d.push(x)};var x=l;null==f&&(f=new mxPoint(l.x+(g.x-l.x)/2,l.y+(g.y-l.y)/2));a(f.x,f.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Oa=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Oa.apply(this,arguments)};b.prototype.constraints=[];e.prototype.getConstraints=function(a,c,b){a=[];var f=
+Math.tan(mxUtils.toRadians(30)),d=(.5-f)/2,f=Math.min(c,b/(.5+f));c=(c-f)/2;b=(b-f)/2;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b+.25*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*f,b+f*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+f,b+.25*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+f,b+.75*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*f,b+(1-d)*f));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,c,b+.75*f));return a};A.prototype.getConstraints=function(a,c,b){a=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var f=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1));a.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b-f)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,
+b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-f)));c>=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};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;y.prototype.constraints=mxRectangleShape.prototype.constraints;l.prototype.getConstraints=function(a,c,b){a=[];var g=Math.max(0,Math.min(c,
-Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-g),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-g,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*g,.5*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b+g)));a.push(new mxConnectionConstraint(new mxPoint(1,
-1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c>=2*g&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};x.prototype.getConstraints=function(a,c,b){a=[];var g=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,.5*(c+g),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,.5*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b+g)));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(1,
-.5),!1));c>=2*g&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};a.prototype.getConstraints=function(a,c,b){a=[];var g=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-g),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-g,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*g,.5*g));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,c,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b+g)));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+g),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,b-.5*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-g)));return a};
-t.prototype.getConstraints=function(a,c,b){a=[];var g=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(a.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,0)),a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,g,d)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+g),d))):(a.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*g,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-g,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-g,d)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-g),d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(0,
+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;y.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,
+Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*f,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(1,
+1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c>=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};v.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,.5*(c+f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(1,
+.5),!1));c>=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};a.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*f,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,c,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,b-.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-f)));return a};
+p.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(a.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0)),a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,f,d)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),d))):(a.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*f,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,d)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,c,.25*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.75*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,0,.75*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b));a.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return a};S.prototype.constraints=mxRectangleShape.prototype.constraints;M.prototype.constraints=mxRectangleShape.prototype.constraints;ha.prototype.constraints=mxEllipse.prototype.constraints;ia.prototype.constraints=mxEllipse.prototype.constraints;
-K.prototype.constraints=mxEllipse.prototype.constraints;xa.prototype.constraints=mxEllipse.prototype.constraints;ka.prototype.constraints=mxRectangleShape.prototype.constraints;Aa.prototype.constraints=mxRectangleShape.prototype.constraints;fa.prototype.getConstraints=function(a,c,b){a=[];var g=Math.min(c,b/2),d=Math.min(c-g,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*c);a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c-g),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-g,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-g,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c-g),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));return a};N.prototype.constraints=mxRectangleShape.prototype.constraints;U.prototype.constraints=
+J.prototype.constraints=mxEllipse.prototype.constraints;wa.prototype.constraints=mxEllipse.prototype.constraints;ka.prototype.constraints=mxRectangleShape.prototype.constraints;za.prototype.constraints=mxRectangleShape.prototype.constraints;fa.prototype.getConstraints=function(a,c,b){a=[];var f=Math.min(c,b/2),d=Math.min(c-f,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*c);a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c-f),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));return a};N.prototype.constraints=mxRectangleShape.prototype.constraints;T.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)];B.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,
-1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];H.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,
+.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];C.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,
+1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];G.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,
1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,
-1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];n.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,
-1),!1)];A.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)];u.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),
+1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];m.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,
+1),!1)];B.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)];q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),
!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,
-.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];P.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=
+.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=
[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,
.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,
.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,
-.25),!1)];c.prototype.constraints=mxRectangleShape.prototype.constraints;g.prototype.constraints=mxRectangleShape.prototype.constraints;C.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),
-!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;ga.prototype.getConstraints=function(a,c,b){a=[];var g=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,
-0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*c+.25*g,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+g),d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+g),.5*(b+d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+g),b));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,.5*(c-g),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-g),.5*(b+d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-g),d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*c-.25*g,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*d));return a};X.prototype.getConstraints=function(a,c,b){a=[];var g=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,
-"dx",this.dx)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+g),d));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,g,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,.5*(b+d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,b));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return a};pa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
-1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];R.prototype.getConstraints=function(a,c,b){a=[];var g=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
-"arrowSize",this.arrowSize)))),g=(b-g)/2;a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-d),g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-d),b-g));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,0,b-g));return a};la.prototype.getConstraints=function(a,c,b){a=[];var g=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",R.prototype.arrowWidth)))),d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",R.prototype.arrowSize)))),g=(b-g)/2;a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,g));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,c-d,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,b-g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));return a};ma.prototype.getConstraints=function(a,c,b){a=[];var g=Math.min(b,c),d=Math.max(0,Math.min(g,g*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),g=(b-d)/2,f=g+d,k=(c-d)/2,d=k+d;a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,k,.5*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,k,0));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,.5*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,k,b-.5*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,k,b));a.push(new mxConnectionConstraint(new mxPoint(.5,
-1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b-.5*g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+d),g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,g));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,f));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,.5*(c+d),f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,k,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*k,g));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,g));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*k,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,k,g));return a};E.prototype.constraints=
-null;J.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)];ea.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)];ta.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)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()}
-Actions.prototype.init=function(){function a(a){d.escape();var b=d.getDeletableCells(d.getSelectionCells());if(null!=b&&0<b.length){var f=d.selectParentAfterDelete?d.model.getParents(b):null;d.removeCells(b,a);if(null!=f){a=[];for(b=0;b<f.length;b++)d.model.contains(f[b])&&(d.model.isVertex(f[b])||d.model.isEdge(f[b]))&&a.push(f[b]);d.setSelectionCells(a)}}}var b=this.editorUi,f=b.editor,d=f.graph,l=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",
-function(){d.openLink(b.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";b.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){b.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var d=mxUtils.parseXml(a);f.graph.setSelectionCells(f.graph.importGraphModel(d.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+
-": "+c.message)}}));b.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=l;this.addAction("save",function(){b.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=l;this.addAction("saveAs...",function(){b.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=l;this.addAction("export...",function(){b.showDialog((new ExportDialog(b)).container,300,296,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(b);b.showDialog(a.container,
-620,420,!0,!1);a.init()});this.addAction("pageSetup...",function(){b.showDialog((new PageSetupDialog(b)).container,320,220,!0,!0)}).isEnabled=l;this.addAction("print...",function(){b.showDialog((new PrintDialog(b)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(d,null,10,10)});this.addAction("undo",function(){b.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){b.redo()},null,"sprite-redo",mxClient.IS_WIN?
+.25),!1)];c.prototype.constraints=mxRectangleShape.prototype.constraints;f.prototype.constraints=mxRectangleShape.prototype.constraints;z.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),
+!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;ga.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,
+0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*c+.25*f,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),.5*(b+d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),b));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,.5*(c-f),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),.5*(b+d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*c-.25*f,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*d));return a};V.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,
+"dx",this.dx)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),d));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,f,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,.5*(b+d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,b));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return a};pa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
+1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];R.prototype.getConstraints=function(a,c,b){a=[];var f=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
+"arrowSize",this.arrowSize)))),f=(b-f)/2;a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-d),f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-d),b-f));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,0,b-f));return a};la.prototype.getConstraints=function(a,c,b){a=[];var f=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",R.prototype.arrowWidth)))),d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",R.prototype.arrowSize)))),f=(b-f)/2;a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,f));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,c-d,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));return a};ma.prototype.getConstraints=function(a,c,b){a=[];var f=Math.min(b,c),d=Math.max(0,Math.min(f,f*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),f=(b-d)/2,e=f+d,g=(c-d)/2,d=g+d;a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,g,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,0));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,b-.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,b));a.push(new mxConnectionConstraint(new mxPoint(.5,
+1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b-.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+d),f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,f));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,e));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,.5*(c+d),e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,f));return a};D.prototype.constraints=
+null;I.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)];ea.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)];ba.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)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()}
+Actions.prototype.init=function(){function a(a){d.escape();var b=d.getDeletableCells(d.getSelectionCells());if(null!=b&&0<b.length){var e=d.selectParentAfterDelete?d.model.getParents(b):null;d.removeCells(b,a);if(null!=e){a=[];for(b=0;b<e.length;b++)d.model.contains(e[b])&&(d.model.isVertex(e[b])||d.model.isEdge(e[b]))&&a.push(e[b]);d.setSelectionCells(a)}}}var b=this.editorUi,e=b.editor,d=e.graph,k=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",
+function(){d.openLink(b.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";b.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){b.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var d=mxUtils.parseXml(a);e.graph.setSelectionCells(e.graph.importGraphModel(d.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+
+": "+c.message)}}));b.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=k;this.addAction("save",function(){b.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=k;this.addAction("saveAs...",function(){b.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=k;this.addAction("export...",function(){b.showDialog((new ExportDialog(b)).container,300,296,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(b);b.showDialog(a.container,
+620,420,!0,!1);a.init()});this.addAction("pageSetup...",function(){b.showDialog((new PageSetupDialog(b)).container,320,220,!0,!0)}).isEnabled=k;this.addAction("print...",function(){b.showDialog((new PrintDialog(b)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(d,null,10,10)});this.addAction("undo",function(){b.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){b.redo()},null,"sprite-redo",mxClient.IS_WIN?
Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&mxClipboard.paste(d)},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(a){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){d.getModel().beginUpdate();
-try{var b=mxClipboard.paste(d);if(null!=b){a=!0;for(var f=0;f<b.length&&a;f++)a=a&&d.model.isEdge(b[f]);var c=d.view.translate,g=d.view.scale,k=c.x,q=c.y,c=null;if(1==b.length&&a){var p=d.getCellGeometry(b[0]);null!=p&&(c=p.getTerminalPoint(!0))}c=null!=c?c:d.getBoundingBoxFromGeometry(b,a);if(null!=c){var m=Math.round(d.snap(d.popupMenuHandler.triggerX/g-k)),z=Math.round(d.snap(d.popupMenuHandler.triggerY/g-q));d.cellsMoved(b,m-c.x,z-c.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("copySize",
-function(a){a=d.getSelectionCell();d.isEnabled()&&null!=a&&d.getModel().isVertex(a)&&(a=d.getCellGeometry(a),null!=a&&(b.copiedSize=new mxRectangle(a.x,a.y,a.width,a.height)))},null,null,"Alt+Shit+X");this.addAction("pasteSize",function(a){if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=b.copiedSize){d.getModel().beginUpdate();try{var f=d.getSelectionCells();for(a=0;a<f.length;a++)if(d.getModel().isVertex(f[a])){var l=d.getCellGeometry(f[a]);null!=l&&(l=l.clone(),l.width=b.copiedSize.width,l.height=
-b.copiedSize.height,d.getModel().setGeometry(f[a],l))}}finally{d.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(){d.setSelectionCells(d.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){d.turnShapes(d.getSelectionCells())},
+try{var b=mxClipboard.paste(d);if(null!=b){a=!0;for(var e=0;e<b.length&&a;e++)a=a&&d.model.isEdge(b[e]);var c=d.view.translate,f=d.view.scale,g=c.x,t=c.y,c=null;if(1==b.length&&a){var n=d.getCellGeometry(b[0]);null!=n&&(c=n.getTerminalPoint(!0))}c=null!=c?c:d.getBoundingBoxFromGeometry(b,a);if(null!=c){var l=Math.round(d.snap(d.popupMenuHandler.triggerX/f-g)),x=Math.round(d.snap(d.popupMenuHandler.triggerY/f-t));d.cellsMoved(b,l-c.x,x-c.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("copySize",
+function(a){a=d.getSelectionCell();d.isEnabled()&&null!=a&&d.getModel().isVertex(a)&&(a=d.getCellGeometry(a),null!=a&&(b.copiedSize=new mxRectangle(a.x,a.y,a.width,a.height)))},null,null,"Alt+Shit+X");this.addAction("pasteSize",function(a){if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=b.copiedSize){d.getModel().beginUpdate();try{var e=d.getSelectionCells();for(a=0;a<e.length;a++)if(d.getModel().isVertex(e[a])){var k=d.getCellGeometry(e[a]);null!=k&&(k=k.clone(),k.width=b.copiedSize.width,k.height=
+b.copiedSize.height,d.getModel().setGeometry(e[a],k))}}finally{d.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(){d.setSelectionCells(d.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){d.turnShapes(d.getSelectionCells())},
null,null,Editor.ctrlKey+"+R"));this.addAction("selectVertices",function(){d.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){d.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){d.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){d.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();
try{var a=d.isCellMovable(d.getSelectionCell())?1:0;d.toggleCellStyles(mxConstants.STYLE_MOVABLE,a);d.toggleCellStyles(mxConstants.STYLE_RESIZABLE,a);d.toggleCellStyles(mxConstants.STYLE_ROTATABLE,a);d.toggleCellStyles(mxConstants.STYLE_DELETABLE,a);d.toggleCellStyles(mxConstants.STYLE_EDITABLE,a);d.toggleCellStyles("connectable",a)}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("home",function(){d.home()},null,null,"Home");this.addAction("exitGroup",function(){d.exitGroup()},
null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){d.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){d.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){d.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){d.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){d.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("group",
function(){1==d.getSelectionCount()?d.setCellStyles("container","1"):d.setSelectionCell(d.groupCells(null,0))},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){1==d.getSelectionCount()&&0==d.getModel().getChildCount(d.getSelectionCell())?d.setCellStyles("container","0"):d.setSelectionCells(d.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){d.removeCellsFromParent()});this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},
-null,null,"F2/Enter");this.addAction("editData...",function(){var a=d.getSelectionCell()||d.getModel().getRoot();b.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),f="";if(mxUtils.isNode(d.value)){var c=d.value.getAttribute("tooltip");null!=c&&(f=c)}f=new TextareaDialog(b,mxResources.get("editTooltip")+":",f,function(c){a.setTooltipForCell(d,c)});b.showDialog(f.container,
-320,200,!0,!0);f.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=d.getLinkForCell(d.getSelectionCell());null!=a&&d.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),f=a.getLinkForCell(d)||"";b.showLinkDialog(f,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+
-"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())})).isEnabled=l;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var f=null,c=d.getLinkTitle(a);null!=b&&0<b.length&&(f=b[0].iconUrl,c=b[0].name||b[0].type,c=c.charAt(0).toUpperCase()+c.substring(1),30<c.length&&
-(c=c.substring(0,30)+"..."));var g=d.getFreeInsertPoint(),f=new mxCell(c,new mxGeometry(g.x,g.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=f?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+f:"spacing=10;"));f.vertex=!0;d.setLinkForCell(f,a);d.cellSizeUpdated(f,!0);d.getModel().beginUpdate();try{f=d.addCell(f),d.fireEvent(new mxEventObject("cellsInserted","cells",[f]))}finally{d.getModel().endUpdate()}d.setSelectionCell(f);d.scrollCellToVisible(d.getSelectionCell())}})})).isEnabled=
-l;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=a.getSelectedElement(),f=a.getParentByName(d,"A",a.cellEditor.textarea),c="";if(null==f&&null!=d&&null!=d.getElementsByTagName)for(var g=d.getElementsByTagName("a"),k=0;k<g.length&&null==f;k++)g[k].textContent==d.textContent&&(f=g[k]);null!=f&&"A"==f.nodeName&&(c=f.getAttribute("href")||"",a.selectNode(f));var q=a.cellEditor.saveSelection();b.showLinkDialog(c,mxResources.get("apply"),
-mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(q);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=l;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(d.getModel().getChildCount(f))d.updateGroupBounds([f],20);else{var c=d.view.getState(f),g=d.getCellGeometry(f);d.getModel().isVertex(f)&&null!=c&&null!=c.text&&
-null!=g&&d.isWrapping(f)?(g=g.clone(),g.height=c.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(f,g)):d.updateCellSize(f)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var f="1";d.stopEditing();d.getModel().beginUpdate();try{if("1"==a.style.html){var f=null,l=d.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(l=l.replace(/\n/g,
-"").replace(/<br\s*.?>/g,"\n"));var c=document.createElement("div");c.innerHTML=l;l=mxUtils.extractTextWithWhitespace(c.childNodes);d.cellLabelChanged(a.cell,l)}else l=mxUtils.htmlEntities(d.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>")),d.cellLabelChanged(a.cell,d.sanitizeHtml(l));d.setCellStyles("html",f);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=f?f:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});
-this.addAction("wordWrap",function(){var a=d.getView().getState(d.getSelectionCell()),b="wrap";d.stopEditing();null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",f=d.getView().getState(d.getSelectionCell());null!=f&&(a=f.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,a)},
+null,null,"F2/Enter");this.addAction("editData...",function(){var a=d.getSelectionCell()||d.getModel().getRoot();b.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),e="";if(mxUtils.isNode(d.value)){var c=d.value.getAttribute("tooltip");null!=c&&(e=c)}e=new TextareaDialog(b,mxResources.get("editTooltip")+":",e,function(c){a.setTooltipForCell(d,c)});b.showDialog(e.container,
+320,200,!0,!0);e.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=d.getLinkForCell(d.getSelectionCell());null!=a&&d.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),e=a.getLinkForCell(d)||"";b.showLinkDialog(e,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+
+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())})).isEnabled=k;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var e=null,c=d.getLinkTitle(a);null!=b&&0<b.length&&(e=b[0].iconUrl,c=b[0].name||b[0].type,c=c.charAt(0).toUpperCase()+c.substring(1),30<c.length&&
+(c=c.substring(0,30)+"..."));var f=d.getFreeInsertPoint(),e=new mxCell(c,new mxGeometry(f.x,f.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=e?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+e:"spacing=10;"));e.vertex=!0;d.setLinkForCell(e,a);d.cellSizeUpdated(e,!0);d.getModel().beginUpdate();try{e=d.addCell(e),d.fireEvent(new mxEventObject("cellsInserted","cells",[e]))}finally{d.getModel().endUpdate()}d.setSelectionCell(e);d.scrollCellToVisible(d.getSelectionCell())}})})).isEnabled=
+k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=a.getSelectedElement(),e=a.getParentByName(d,"A",a.cellEditor.textarea),c="";if(null==e&&null!=d&&null!=d.getElementsByTagName)for(var f=d.getElementsByTagName("a"),g=0;g<f.length&&null==e;g++)f[g].textContent==d.textContent&&(e=f[g]);null!=e&&"A"==e.nodeName&&(c=e.getAttribute("href")||"",a.selectNode(e));var t=a.cellEditor.saveSelection();b.showLinkDialog(c,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=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var e=a[b];if(d.getModel().getChildCount(e))d.updateGroupBounds([e],20);else{var c=d.view.getState(e),f=d.getCellGeometry(e);d.getModel().isVertex(e)&&null!=c&&null!=c.text&&
+null!=f&&d.isWrapping(e)?(f=f.clone(),f.height=c.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(e,f)):d.updateCellSize(e)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var e="1";d.stopEditing();d.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,k=d.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(k=k.replace(/\n/g,
+"").replace(/<br\s*.?>/g,"\n"));var c=document.createElement("div");c.innerHTML=k;k=mxUtils.extractTextWithWhitespace(c.childNodes);d.cellLabelChanged(a.cell,k)}else k=mxUtils.htmlEntities(d.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(k=k.replace(/\n/g,"<br/>")),d.cellLabelChanged(a.cell,d.sanitizeHtml(k));d.setCellStyles("html",e);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});
+this.addAction("wordWrap",function(){var a=d.getView().getState(d.getSelectionCell()),b="wrap";d.stopEditing();null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",e=d.getView().getState(d.getSelectionCell());null!=e&&(a=e.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,a)},
mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");b.showDialog(a.container,375,80,!0,!0);a.init()});this.addAction("resetView",function(){d.zoomTo(1);b.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){d.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");this.addAction("zoomOut",function(a){d.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){var a=d.isSelectionEmpty()?
-d.getGraphBounds():d.getBoundingBox(d.getSelectionCells()),b=d.view.translate,f=d.view.scale;a.width/=f;a.height/=f;a.x=a.x/f-b.x;a.y=a.y/f-b.y;var f=d.container.clientWidth-10,c=d.container.clientHeight-10,g=Math.floor(20*Math.min(f/a.width,c/a.height))/20;d.zoomTo(g);mxUtils.hasScrollbars(d.container)&&(d.container.scrollTop=(a.y+b.y)*g-Math.max((c-a.height*g)/2+5,0),d.container.scrollLeft=(a.x+b.x)*g-Math.max((f-a.width*g)/2+5,0))},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",
+d.getGraphBounds():d.getBoundingBox(d.getSelectionCells()),b=d.view.translate,e=d.view.scale;a.width/=e;a.height/=e;a.x=a.x/e-b.x;a.y=a.y/e-b.y;var e=d.container.clientWidth-10,c=d.container.clientHeight-10,f=Math.floor(20*Math.min(e/a.width,c/a.height))/20;d.zoomTo(f);mxUtils.hasScrollbars(d.container)&&(d.container.scrollTop=(a.y+b.y)*f-Math.max((c-a.height*f)/2+5,0),d.container.scrollLeft=(a.x+b.x)*f-Math.max((e-a.width*f)/2+5,0))},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",
mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/a.width/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=a.y*d.view.scale-1,d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,
function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/(2*a.width)/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=Math.min(a.y,(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=Math.min(a.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",
mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();d.zoomTo(Math.floor(20*(d.container.clientWidth-10)/d.pageFormat.width/d.pageScale)/20);if(mxUtils.hasScrollbars(d.container)){var a=d.getPagePadding();d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),
mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&d.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*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,
-300,80,!0,!0);a.init()}));var n=null,n=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");n.setToggleAction(!0);n.setSelectedCallback(function(){return d.isGridEnabled()});n.setEnabled(!1);n=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});n.setToggleAction(!0);n.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});
-n.setEnabled(!1);n=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});n.setToggleAction(!0);n.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});n=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!d.foldingEnabled;d.model.execute(a)});n.setToggleAction(!0);n.setSelectedCallback(function(){return d.foldingEnabled});n.isEnabled=l;n=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});
-n.setToggleAction(!0);n.setSelectedCallback(function(){return d.scrollbars});n=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));n.setToggleAction(!0);n.setSelectedCallback(function(){return d.pageVisible});n=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");n.setToggleAction(!0);n.setSelectedCallback(function(){return d.connectionArrowsEnabled});
-n=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");n.setToggleAction(!0);n.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});n=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});n.setToggleAction(!0);n.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});
-n.isEnabled=l;n=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});n.setToggleAction(!0);n.setSelectedCallback(function(){return b.editor.autosave});n.isEnabled=l;n.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+a+".html")});var t=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){t||(b.showDialog((new AboutDialog(b)).container,
-320,280,!0,!0,function(){t=!1}),t=!0)},null,null,"F1"));n=mxUtils.bind(this,function(a,b,f,c){return this.addAction(a,function(){if(null!=f&&d.cellEditor.isContentEditing())f();else{d.stopEditing(!1);d.getModel().beginUpdate();try{d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b),(b&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?
-d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(d.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&d.replaceElement(a)})}finally{d.getModel().endUpdate()}}},null,null,c)});n("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");n("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",
-!1,null)},Editor.ctrlKey+"+I");n("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});
+300,80,!0,!0);a.init()}));var m=null,m=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.isGridEnabled()});m.setEnabled(!1);m=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});
+m.setEnabled(!1);m=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});m=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!d.foldingEnabled;d.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.foldingEnabled});m.isEnabled=k;m=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});
+m.setToggleAction(!0);m.setSelectedCallback(function(){return d.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return d.pageVisible});m=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionArrowsEnabled});
+m=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});m=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});
+m.isEnabled=k;m=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.editor.autosave});m.isEnabled=k;m.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(b.showDialog((new AboutDialog(b)).container,
+320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));m=mxUtils.bind(this,function(a,b,e,c){return this.addAction(a,function(){if(null!=e&&d.cellEditor.isContentEditing())e();else{d.stopEditing(!1);d.getModel().beginUpdate();try{d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b),(b&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?
+d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(d.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&d.replaceElement(a)})}finally{d.getModel().endUpdate()}}},null,null,c)});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(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});
this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,
null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,
mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("sharp",
function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("rounded",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged",
-"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!d.isSelectionEmpty()&&d.isEnabled()){d.getModel().beginUpdate();try{var a=d.getSelectionCells(),f=d.view.getState(a[0]),l=null!=f?f.style:d.getCellStyle(a[0]),c="1"==mxUtils.getValue(l,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,c);d.setCellStyles(mxConstants.STYLE_CURVED,
+"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!d.isSelectionEmpty()&&d.isEnabled()){d.getModel().beginUpdate();try{var a=d.getSelectionCells(),e=d.view.getState(a[0]),k=null!=e?e.style:d.getCellStyle(a[0]),c="1"==mxUtils.getValue(k,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,c);d.setCellStyles(mxConstants.STYLE_CURVED,
null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[c,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"1"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});
-this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),f="1";null!=a&&null!=d.getFoldingImage(a)&&(f="0");d.setCellStyles("collapsible",f);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[f],"cells",d.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=d.getSelectionCells();if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",
+this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),e="1";null!=a&&null!=d.getFoldingImage(a)&&(e="0");d.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=d.getSelectionCells();if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",
function(b){null!=b&&d.setCellStyle(mxUtils.trim(b),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&b.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){d.isEnabled()&&b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();
-if(null!=a&&d.getModel().isEdge(a)){var b=f.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var l=d.view.translate,c=d.view.scale,g=l.x,l=l.y,a=d.getModel().getParent(a),k=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=k;)g+=k.x,l+=k.y,a=d.getModel().getParent(a),k=d.getCellGeometry(a);g=Math.round(d.snap(d.popupMenuHandler.triggerX/c-g));c=Math.round(d.snap(d.popupMenuHandler.triggerY/c-l));b.addPointAt(b.state,g,c)}}});this.addAction("removeWaypoint",function(){var a=
-b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(d.getModel().isEdge(f)){var c=d.getCellGeometry(f);null!=c&&(c=c.clone(),c.points=null,d.getModel().setGeometry(f,c))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");n=this.addAction("subscript",mxUtils.bind(this,
-function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");n=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",f=d.getView().getState(d.getSelectionCell()),l="";null!=
-f&&(l=f.style[mxConstants.STYLE_IMAGE]||l);var c=d.cellEditor.saveSelection();b.showImageDialog(a,l,function(a,b,f){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(c),d.insertImage(a,b,f);else{var g=d.getSelectionCells();if(null!=a&&(0<a.length||0<g.length)){var k=null;d.getModel().beginUpdate();try{if(0==g.length){var q=d.getFreeInsertPoint(),k=g=[d.insertVertex(d.getDefaultParent(),null,"",q.x,q.y,b,f,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
-d.fireEvent(new mxEventObject("cellsInserted","cells",k))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,g);var l=d.view.getState(g[0]),u=null!=l?l.style:d.getCellStyle(g[0]);"image"!=u[mxConstants.STYLE_SHAPE]&&"label"!=u[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",g):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,g);if(1==d.getSelectionCount()&&null!=b&&null!=f){var n=g[0],y=d.getModel().getGeometry(n);null!=y&&(y=y.clone(),y.width=b,y.height=f,
-d.getModel().setGeometry(n,y))}}finally{d.getModel().endUpdate()}null!=k&&(d.setSelectionCells(k),d.scrollCellToVisible(k[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=l;n=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
-function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));n=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+
-"+Shift+P");n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));n=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),
-b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};
-Actions.prototype.addAction=function(a,b,f,d,l){var n;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),n=mxResources.get(a)+"..."):n=mxResources.get(a);return this.put(a,new Action(n,b,f,d,l))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};function Action(a,b,f,d,l){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=f?f:!0;this.iconCls=d;this.shortcut=l;this.visible=!0}
+if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var k=d.view.translate,c=d.view.scale,f=k.x,k=k.y,a=d.getModel().getParent(a),g=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=g;)f+=g.x,k+=g.y,a=d.getModel().getParent(a),g=d.getCellGeometry(a);f=Math.round(d.snap(d.popupMenuHandler.triggerX/c-f));c=Math.round(d.snap(d.popupMenuHandler.triggerY/c-k));b.addPointAt(b.state,f,c)}}});this.addAction("removeWaypoint",function(){var a=
+b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var e=a[b];if(d.getModel().isEdge(e)){var c=d.getCellGeometry(e);null!=c&&(c=c.clone(),c.points=null,d.getModel().setGeometry(e,c))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this,
+function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),k="";null!=
+e&&(k=e.style[mxConstants.STYLE_IMAGE]||k);var c=d.cellEditor.saveSelection();b.showImageDialog(a,k,function(a,b,e){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(c),d.insertImage(a,b,e);else{var f=d.getSelectionCells();if(null!=a&&(0<a.length||0<f.length)){var g=null;d.getModel().beginUpdate();try{if(0==f.length){var t=d.getFreeInsertPoint(),g=f=[d.insertVertex(d.getDefaultParent(),null,"",t.x,t.y,b,e,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
+d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,f);var k=d.view.getState(f[0]),q=null!=k?k.style:d.getCellStyle(f[0]);"image"!=q[mxConstants.STYLE_SHAPE]&&"label"!=q[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",f):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,f);if(1==d.getSelectionCount()&&null!=b&&null!=e){var m=f[0],y=d.getModel().getGeometry(m);null!=y&&(y=y.clone(),y.width=b,y.height=e,
+d.getModel().setGeometry(m,y))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
+function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.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(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+
+"+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));m=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),
+b.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,b,e,d,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,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;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};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,b){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=b||"";this.shadowPages=null;this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";
DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;
DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.errorReportsEnabled=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};
DrawioFile.prototype.synchronizeFile=function(a,b){this.savingFile?null!=b&&b({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,b):this.updateFile(a,b)};
-DrawioFile.prototype.updateFile=function(a,b,f,d){null!=f&&f()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():this.getLatestVersion(mxUtils.bind(this,function(l){try{null!=f&&f()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():null!=l?this.mergeFile(l,a,b,d):this.reloadFile(a,b))}catch(n){null!=b&&b(n)}}),b))};
-DrawioFile.prototype.mergeFile=function(a,b,f,d){var l=!0;try{this.stats.fileMerged++;var n=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),t=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=t&&0<t.length){this.shadowPages=t;this.backupPatch=this.isModified()?this.ui.diffPages(n,this.ui.pages):null;var x=[this.ui.diffPages(null!=d?d:n,this.shadowPages)];if(!this.ignorePatches(x)){var A=this.ui.patchPages(n,
-x[0]);d={};var C=this.ui.getHashValueForPages(A,d),n={},c=this.ui.getHashValueForPages(this.shadowPages,n);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",x,"checksum",c==C,C);if(null!=C&&C!=c){var g=this.compressReportData(this.getAnonymizedXmlForPages(t)),k=this.compressReportData(this.getAnonymizedXmlForPages(A)),q=this.ui.hashValue(a.getCurrentEtag()),p=this.ui.hashValue(this.getCurrentEtag());this.checksumError(f,x,"Shadow Details: "+JSON.stringify(d)+
-"\nChecksum: "+C+"\nCurrent: "+c+"\nCurrent Details: "+JSON.stringify(n)+"\nFrom: "+q+"\nTo: "+p+"\n\nFile Data:\n"+g+"\nPatched Shadow:\n"+k,null,"mergeFile");return}this.patch(x,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw l=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(D){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
-null!=f&&f(D);try{if(l)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,D);else{var m=this.getCurrentUser(),z=null!=m?m.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,D)}}catch(u){}}};
-DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),f=b.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var l=b.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(l=this.ui.anonymizeNode(l,!0));l.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,l,!0);f.appendChild(l)}return mxUtils.getPrettyXml(f)};
-DrawioFile.prototype.compressReportData=function(a,b,f){b=null!=b?b:1E4;null!=f&&null!=a&&a.length>f?a=a.substring(0,f)+"[...]":null!=a&&a.length>b&&(a=Graph.compress(a)+"\n");return a};
-DrawioFile.prototype.checksumError=function(a,b,f,d,l){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var n=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(b,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
-25E3):"n/a";this.sendErrorReport("Checksum Error in "+l+" "+this.getHash(),(null!=f?f:"")+"\n\nPatches:\n"+d+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==d?n(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==d?n(a):n(null)}),function(){})}else{var t=this.getCurrentUser(),x=null!=t?t.id:"unknown";EditorUi.logError("Checksum Error in "+l+" "+this.getId(),null,this.getMode()+"."+this.getId(),"user_"+x+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync"));
-try{EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+this.getHash(),action:l,label:"user_"+x+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")})}catch(A){}}}catch(A){}};
-DrawioFile.prototype.sendErrorReport=function(a,b,f,d){try{var l=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),n=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),t=this.getCurrentUser(),x=null!=t?this.ui.hashValue(t.id):"unknown",A=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",C=this.getTitle(),c=C.lastIndexOf("."),t="xml";0<c&&(t=C.substring(c));var g=null!=f?f.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+
-":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+t+")\nUser="+x+A+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+
-(null!=f?"\n\nError: "+f.message:"")+"\n\nStack:\n"+g+"\n\nShadow:\n"+l+"\n\nData:\n"+n,d)}catch(k){}};
-DrawioFile.prototype.reloadFile=function(a,b){try{this.ui.spinner.stop();var f=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),f=this.ui.editor.graph.getSelectionCells(),n=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(n,b,f);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=
-this.stats);null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()}catch(d){null!=b&&b(d)}};DrawioFile.prototype.copyFile=function(a,b){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};
-DrawioFile.prototype.ignorePatches=function(a){for(var b=!0,f=0;f<a.length&&b;f++)b=b&&0==Object.keys(a[f]).length;return b};
-DrawioFile.prototype.patch=function(a,b){var f=this.ui.editor.undoManager,d=f.history.slice(),l=f.indexOfNextAdd,n=this.ui.editor.graph;n.container.style.visibility="hidden";var t=this.changeListenerEnabled;this.changeListenerEnabled=!1;var x=n.foldingEnabled,A=n.mathEnabled,C=n.cellRenderer.redraw;n.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());C.apply(this,arguments)};n.model.beginUpdate();try{for(var c=
-0;c<a.length;c++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[c],!0,b,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{n.container.style.visibility="";n.model.endUpdate();n.cellRenderer.redraw=C;this.changeListenerEnabled=t;f.history=d;f.indexOfNextAdd=l;f.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)A!=
-n.mathEnabled?(this.ui.editor.updateGraphComponents(),n.refresh()):(x!=n.foldingEnabled?n.view.revalidate():n.view.validate(),n.sizeDidChange());this.ui.updateTabContainer()}};
-DrawioFile.prototype.save=function(a,b,f,d,l,n){try{if(this.isEditable())if(!l&&this.invalidChecksum)if(null!=f)f({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=b&&b();else if(null!=f)f({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(t){if(null!=f)f(t);else throw t;}};
-DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed()))};DrawioFile.prototype.isCompressedStorage=function(){return!0};DrawioFile.prototype.isCompressed=function(){var a=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=a?"false"!=a:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.saveAs=function(a,b,f){};DrawioFile.prototype.saveFile=function(a,b,f,d){};
-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.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,f){};
-DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,b,f){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
+DrawioFile.prototype.updateFile=function(a,b,e,d){null!=e&&e()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():this.getLatestVersion(mxUtils.bind(this,function(k){try{null!=e&&e()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():null!=k?this.mergeFile(k,a,b,d):this.reloadFile(a,b))}catch(m){null!=b&&b(m)}}),b))};
+DrawioFile.prototype.mergeFile=function(a,b,e,d){var k=!0;try{this.stats.fileMerged++;var m=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),p=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=p&&0<p.length){this.shadowPages=p;this.backupPatch=this.isModified()?this.ui.diffPages(m,this.ui.pages):null;var v=[this.ui.diffPages(null!=d?d:m,this.shadowPages)];if(!this.ignorePatches(v)){var B=this.ui.patchPages(m,
+v[0]);d={};var z=this.ui.getHashValueForPages(B,d),m={},c=this.ui.getHashValueForPages(this.shadowPages,m);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",v,"checksum",c==z,z);if(null!=z&&z!=c){var f=this.compressReportData(this.getAnonymizedXmlForPages(p)),g=this.compressReportData(this.getAnonymizedXmlForPages(B)),t=this.ui.hashValue(a.getCurrentEtag()),n=this.ui.hashValue(this.getCurrentEtag());this.checksumError(e,v,"Shadow Details: "+JSON.stringify(d)+
+"\nChecksum: "+z+"\nCurrent: "+c+"\nCurrent Details: "+JSON.stringify(m)+"\nFrom: "+t+"\nTo: "+n+"\n\nFile Data:\n"+f+"\nPatched Shadow:\n"+g,null,"mergeFile");return}this.patch(v,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw k=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(A){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
+null!=e&&e(A);try{if(k)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,A);else{var l=this.getCurrentUser(),x=null!=l?l.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),x,A)}}catch(q){}}};
+DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),e=b.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var k=b.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(k=this.ui.anonymizeNode(k,!0));k.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,k,!0);e.appendChild(k)}return mxUtils.getPrettyXml(e)};
+DrawioFile.prototype.compressReportData=function(a,b,e){b=null!=b?b:1E4;null!=e&&null!=a&&a.length>e?a=a.substring(0,e)+"[...]":null!=a&&a.length>b&&(a=Graph.compress(a)+"\n");return a};
+DrawioFile.prototype.checksumError=function(a,b,e,d,k){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var m=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(b,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
+25E3):"n/a";this.sendErrorReport("Checksum Error in "+k+" "+this.getHash(),(null!=e?e:"")+"\n\nPatches:\n"+d+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==d?m(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==d?m(a):m(null)}),function(){})}else{var p=this.getCurrentUser(),v=null!=p?p.id:"unknown";EditorUi.logError("Checksum Error in "+k+" "+this.getId(),null,this.getMode()+"."+this.getId(),"user_"+v+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync"));
+try{EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+this.getHash(),action:k,label:"user_"+v+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")})}catch(B){}}}catch(B){}};
+DrawioFile.prototype.sendErrorReport=function(a,b,e,d){try{var k=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),m=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),p=this.getCurrentUser(),v=null!=p?this.ui.hashValue(p.id):"unknown",B=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",z=this.getTitle(),c=z.lastIndexOf("."),p="xml";0<c&&(p=z.substring(c));var f=null!=e?e.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+
+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+p+")\nUser="+v+B+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+
+(null!=e?"\n\nError: "+e.message:"")+"\n\nStack:\n"+f+"\n\nShadow:\n"+k+"\n\nData:\n"+m,d)}catch(g){}};
+DrawioFile.prototype.reloadFile=function(a,b){try{this.ui.spinner.stop();var e=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),e=this.ui.editor.graph.getSelectionCells(),m=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(m,b,e);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=
+this.stats);null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}catch(d){null!=b&&b(d)}};DrawioFile.prototype.copyFile=function(a,b){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};
+DrawioFile.prototype.ignorePatches=function(a){for(var b=!0,e=0;e<a.length&&b;e++)b=b&&0==Object.keys(a[e]).length;return b};
+DrawioFile.prototype.patch=function(a,b){var e=this.ui.editor.undoManager,d=e.history.slice(),k=e.indexOfNextAdd,m=this.ui.editor.graph;m.container.style.visibility="hidden";var p=this.changeListenerEnabled;this.changeListenerEnabled=!1;var v=m.foldingEnabled,B=m.mathEnabled,z=m.cellRenderer.redraw;m.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());z.apply(this,arguments)};m.model.beginUpdate();try{for(var c=
+0;c<a.length;c++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[c],!0,b,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{m.container.style.visibility="";m.model.endUpdate();m.cellRenderer.redraw=z;this.changeListenerEnabled=p;e.history=d;e.indexOfNextAdd=k;e.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)B!=
+m.mathEnabled?(this.ui.editor.updateGraphComponents(),m.refresh()):(v!=m.foldingEnabled?m.view.revalidate():m.view.validate(),m.sizeDidChange());this.ui.updateTabContainer()}};
+DrawioFile.prototype.save=function(a,b,e,d,k,m){try{if(this.isEditable())if(!k&&this.invalidChecksum)if(null!=e)e({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=b&&b();else if(null!=e)e({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(p){if(null!=e)e(p);else throw p;}};
+DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed()))};DrawioFile.prototype.isCompressedStorage=function(){return!0};DrawioFile.prototype.isCompressed=function(){var a=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=a?"false"!=a:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.saveAs=function(a,b,e){};DrawioFile.prototype.saveFile=function(a,b,e,d){};
+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.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,e){};
+DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};
DrawioFile.prototype.open=function(){this.stats.opened++;var a=this.getData();null!=a&&(this.ui.setFileData(a),this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,b){a(null)};
DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.patchDescriptor=function(a,b){this.setDescriptorEtag(a,this.getDescriptorEtag(b))};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};
DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(a,b){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};
DrawioFile.prototype.setCurrentRevisionId=function(a){this.setDescriptorRevisionId(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentRevisionId=function(){return this.getDescriptorRevisionId(this.getDescriptor())};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};
DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorRevisionId=function(a,b){this.setDescriptorEtag(a,b)};DrawioFile.prototype.getDescriptorRevisionId=function(a){return this.getDescriptorEtag(a)};DrawioFile.prototype.setDescriptorEtag=function(a,b){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
-DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,b){var f=null!=b?b.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=f&&f.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged",
+DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,b){var e=null!=b?b.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=e&&e.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged",
this.changeListener),this.ui.addListener("pageScaleChanged",this.changeListener),this.ui.addListener("backgroundColorChanged",this.changeListener),this.ui.addListener("backgroundImageChanged",this.changeListener),this.ui.addListener("foldingEnabledChanged",this.changeListener),this.ui.addListener("mathEnabledChanged",this.changeListener),this.ui.addListener("gridEnabledChanged",this.changeListener),this.ui.addListener("guidesEnabledChanged",this.changeListener),this.ui.addListener("pageViewChanged",
this.changeListener),this.ui.addListener("connectionPointsChanged",this.changeListener),this.ui.addListener("connectionArrowsChanged",this.changeListener))};
DrawioFile.prototype.addAllSavedStatus=function(a){null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this&&(a=null!=a?a:mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey)),this.ui.editor.setStatus('<div title="'+a+'">'+a+"</div>"),a=this.ui.statusContainer.getElementsByTagName("div"),0<a.length&&this.isRevisionHistorySupported()&&(a[0].style.cursor="pointer",a[0].style.textDecoration="underline",mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))))};
-DrawioFile.prototype.addUnsavedStatus=function(a){if(!this.inConflictState&&null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this)if(a instanceof Error&&null!=a.message&&""!=a.message){var b=mxUtils.htmlEntities(mxResources.get("unsavedChanges"));this.ui.editor.setStatus('<div title="'+b+'" class="geStatusAlert" style="overflow:hidden;">'+b+" ("+mxUtils.htmlEntities(a.message)+")</div>")}else{b=this.getErrorMessage(a);if(null==b&&null!=this.lastSaved){var f=this.ui.timeSince(new Date(this.lastSaved));
-null!=f&&(b=mxResources.get("lastSaved",[f]))}null!=b&&60<b.length&&(b=b.substring(0,60)+"...");b=mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+(null!=b&&""!=b?" ("+mxUtils.htmlEntities(b)+")":"");this.ui.editor.setStatus('<div title="'+b+'" class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+b+"</div>");b=this.ui.statusContainer.getElementsByTagName("div");null!=b&&0<b.length?mxEvent.addListener(b[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null!=
+DrawioFile.prototype.addUnsavedStatus=function(a){if(!this.inConflictState&&null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this)if(a instanceof Error&&null!=a.message&&""!=a.message){var b=mxUtils.htmlEntities(mxResources.get("unsavedChanges"));this.ui.editor.setStatus('<div title="'+b+'" class="geStatusAlert" style="overflow:hidden;">'+b+" ("+mxUtils.htmlEntities(a.message)+")</div>")}else{b=this.getErrorMessage(a);if(null==b&&null!=this.lastSaved){var e=this.ui.timeSince(new Date(this.lastSaved));
+null!=e&&(b=mxResources.get("lastSaved",[e]))}null!=b&&60<b.length&&(b=b.substring(0,60)+"...");b=mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+(null!=b&&""!=b?" ("+mxUtils.htmlEntities(b)+")":"");this.ui.editor.setStatus('<div title="'+b+'" class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+b+"</div>");b=this.ui.statusContainer.getElementsByTagName("div");null!=b&&0<b.length?mxEvent.addListener(b[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null!=
this.ui.mode&&this.isEditable()?"save":"saveAs").funct()})):(b=mxUtils.htmlEntities(mxResources.get("unsavedChanges")),this.ui.editor.setStatus('<div title="'+b+'" class="geStatusAlert" style="overflow:hidden;">'+b+" ("+mxUtils.htmlEntities(a.message)+")</div>"))}};
-DrawioFile.prototype.addConflictStatus=function(a,b){this.invalidChecksum&&null==b&&(b=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=b&&""!=b?" ("+mxUtils.htmlEntities(b)+")":""));this.ui.spinner.stop();this.clearAutosave();var f=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;null!=f&&0<f.length?mxEvent.addListener(f[0],"click",mxUtils.bind(this,function(b){"IMG"!=mxEvent.getSource(b).nodeName&&
+DrawioFile.prototype.addConflictStatus=function(a,b){this.invalidChecksum&&null==b&&(b=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=b&&""!=b?" ("+mxUtils.htmlEntities(b)+")":""));this.ui.spinner.stop();this.clearAutosave();var e=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;null!=e&&0<e.length?mxEvent.addListener(e[0],"click",mxUtils.bind(this,function(b){"IMG"!=mxEvent.getSource(b).nodeName&&
a()})):this.ui.alert(mxUtils.htmlEntities(mxResources.get("fileChangedSync")),a)};DrawioFile.prototype.setConflictStatus=function(a){this.ui.editor.setStatus('<div title="'+a+'" class="geStatusAlert geBlink" style="cursor:pointer;overflow:hidden;">'+a+' <a href="https://desk.draw.io/support/solutions/articles/16000087947" target="_blank"><img border="0" style="margin-left:2px;cursor:help;opacity:0.5;width:16px;height:16px;" valign="bottom" src="'+Editor.helpImage+'" style=""/></a></div>')};
-DrawioFile.prototype.showRefreshDialog=function(a,b,f){null==f&&(f=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(a,b)})):(this.addConflictStatus(mxUtils.bind(this,function(){this.showRefreshDialog(a,b)}),f),this.ui.showError(mxResources.get("error")+" ("+f+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,
+DrawioFile.prototype.showRefreshDialog=function(a,b,e){null==e&&(e=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(a,b)})):(this.addConflictStatus(mxUtils.bind(this,function(){this.showRefreshDialog(a,b)}),e),this.ui.showError(mxResources.get("error")+" ("+e+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,
b)}),null,mxResources.get("synchronize"),mxUtils.bind(this,function(){this.reloadFile(a,b)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150))};
-DrawioFile.prototype.showCopyDialog=function(a,b,f){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,b)}),null,mxResources.get("overwrite"),f,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150)};
+DrawioFile.prototype.showCopyDialog=function(a,b,e){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,b)}),null,mxResources.get("overwrite"),e,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150)};
DrawioFile.prototype.showConflictDialog=function(a,b){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),a,null,mxResources.get("synchronize"),b,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),340,150)};
-DrawioFile.prototype.redirectToNewApp=function(a){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var b=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),f=mxUtils.bind(this,function(){var d=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==b?window.location.reload():window.location.href=b});null==a&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),
-mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):d()});null!=a?this.isModified()?this.ui.confirm(mxResources.get("redirectToNewApp"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()}),f,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(mxResources.get("redirectToNewApp"),f,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()})):this.ui.alert(mxResources.get("redirectToNewApp"),
-f)}};DrawioFile.prototype.handleFileSuccess=function(a){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.isModified()?this.fileChanged():a?(this.addAllSavedStatus(),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.editor.setStatus(""))};
-DrawioFile.prototype.handleFileError=function(a,b){this.ui.spinner.stop();if(this.ui.getCurrentFile()==this)if(this.inConflictState)this.handleConflictError(a,b);else if(this.isModified()&&this.addUnsavedStatus(a),b)this.ui.handleError(a,null!=a?mxResources.get("errorSavingFile"):null);else if(!this.isModified()){var f=null!=a?null!=a.error?a.error.message:a.message:null;null!=f&&60<f.length&&(f=f.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+
-mxUtils.htmlEntities(mxResources.get("error"))+(null!=f?" ("+mxUtils.htmlEntities(f)+")":"")+"</div>")}};
-DrawioFile.prototype.handleConflictError=function(a,b){var f=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),l=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,f,d,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage))}),n=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&
-this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,f,d,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(f,d,l):this.invalidChecksum?this.showRefreshDialog(f,d,this.getErrorMessage(a)):b?this.showConflictDialog(l,n):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));
-this.synchronizeFile(f,d)}),this.getErrorMessage(a))};DrawioFile.prototype.getErrorMessage=function(a){return null!=a?null!=a.error?a.error.message:a.message:null};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};
+DrawioFile.prototype.redirectToNewApp=function(a){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var b=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),e=mxUtils.bind(this,function(){var d=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==b?window.location.reload():window.location.href=b});null==a&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),
+mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):d()});null!=a?this.isModified()?this.ui.confirm(mxResources.get("redirectToNewApp"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()}),e,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(mxResources.get("redirectToNewApp"),e,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()})):this.ui.alert(mxResources.get("redirectToNewApp"),
+e)}};DrawioFile.prototype.handleFileSuccess=function(a){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.isModified()?this.fileChanged():a?(this.addAllSavedStatus(),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.editor.setStatus(""))};
+DrawioFile.prototype.handleFileError=function(a,b){this.ui.spinner.stop();if(this.ui.getCurrentFile()==this)if(this.inConflictState)this.handleConflictError(a,b);else if(this.isModified()&&this.addUnsavedStatus(a),b)this.ui.handleError(a,null!=a?mxResources.get("errorSavingFile"):null);else if(!this.isModified()){var e=null!=a?null!=a.error?a.error.message:a.message:null;null!=e&&60<e.length&&(e=e.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+
+mxUtils.htmlEntities(mxResources.get("error"))+(null!=e?" ("+mxUtils.htmlEntities(e)+")":"")+"</div>")}};
+DrawioFile.prototype.handleConflictError=function(a,b){var e=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),k=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,e,d,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage))}),m=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&
+this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,e,d,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(e,d,k):this.invalidChecksum?this.showRefreshDialog(e,d,this.getErrorMessage(a)):b?this.showConflictDialog(k,m):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));
+this.synchronizeFile(e,d)}),this.getErrorMessage(a))};DrawioFile.prototype.getErrorMessage=function(a){return null!=a?null!=a.error?a.error.message:a.message:null};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};
DrawioFile.prototype.fileChanged=function(){this.lastChanged=new Date;this.setModified(!0);this.isAutosave()?(this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=
this.lastChanged)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus())};
-DrawioFile.prototype.fileSaved=function(a,b,f,d){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=f&&f()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),b,f,d,a)}catch(t){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(t);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,t);else{var l=
-this.getCurrentUser(),n=null!=l?l.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),n,t)}}catch(x){}}};
-DrawioFile.prototype.autosave=function(a,b,f,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());a=Date.now()-this.lastAutosave<b?a:0;this.clearAutosave();var l=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==l&&(this.autosaveThread=null);if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();null!=f&&f(a)}),mxUtils.bind(this,
-function(a){null!=d&&d(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=f&&f(null)}),a);this.autosaveThread=l};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.fileSaved=function(a,b,e,d){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=e&&e()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),b,e,d,a)}catch(p){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(p);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,p);else{var k=
+this.getCurrentUser(),m=null!=k?k.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),m,p)}}catch(v){}}};
+DrawioFile.prototype.autosave=function(a,b,e,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());a=Date.now()-this.lastAutosave<b?a:0;this.clearAutosave();var k=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==k&&(this.autosaveThread=null);if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();null!=e&&e(a)}),mxUtils.bind(this,
+function(a){null!=d&&d(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=e&&e(null)}),a);this.autosaveThread=k};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.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};
-DrawioFile.prototype.close=function(a){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,b){if(null!=a&&null!=b){var f=a.lastIndexOf("."),d=0<f?a.substring(f):"",f=b.lastIndexOf(".");return d===(0<f?b.substring(f):"")}return a==b};
+DrawioFile.prototype.close=function(a){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,b){if(null!=a&&null!=b){var e=a.lastIndexOf("."),d=0<e?a.substring(e):"",e=b.lastIndexOf(".");return d===(0<e?b.substring(e):"")}return a==b};
DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.stats.destroyed++;this.clearAutosave();this.removeListeners();null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};
-DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(a,b){a([])};DrawioFile.prototype.addComment=function(a,b,f){b(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(a,b){return new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};LocalFile=function(a,b,f,d){DrawioFile.call(this,a,b);this.title=f;this.mode=d?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,b,f){this.saveAs(this.title,b,f)};LocalFile.prototype.saveAs=function(a,b,f){this.saveFile(a,!1,b,f)};
-LocalFile.prototype.saveFile=function(a,b,f,d){this.title=a;this.updateFileData();b=this.getData();var l=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),n=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,l?"image/png":"text/xml",l);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)+
-(l?"&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!=f&&f()});l?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){n(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):n(b)};LocalFile.prototype.rename=function(a,b,f){this.title=a;this.descriptorChanged();null!=b&&b()};
+DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(a,b){a([])};DrawioFile.prototype.addComment=function(a,b,e){b(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(a,b){return new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};LocalFile=function(a,b,e,d){DrawioFile.call(this,a,b);this.title=e;this.mode=d?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,b,e){this.saveAs(this.title,b,e)};LocalFile.prototype.saveAs=function(a,b,e){this.saveFile(a,!1,b,e)};
+LocalFile.prototype.saveFile=function(a,b,e,d){this.title=a;this.updateFileData();b=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)}),d,this.ui.getCurrentFile()!=this?this.getData():null):m(b)};LocalFile.prototype.rename=function(a,b,e){this.title=a;this.descriptorChanged();null!=b&&b()};
LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};(function(){Editor.prototype.appName="draw.io";Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];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==":
@@ -2807,51 +2807,51 @@ defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},{val:"rectangle
dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter",dispName:"Step"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1.5,isVisible:function(a){return"1"==mxUtils.getValue(a.style,"comic","0")}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"collapsible",dispName:"Collapsible",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",defVal:!1},{name:"recursiveResize",
dispName:"Resize Children",type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",
dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",type:"bool",defVal:!1}];Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## The label is concatenated in the form fromlabel + label + tolabel if all are defined.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle or a JSON string as used in Layout, Apply.\n## Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nEvan Miller,CFO,emi,Office 1,,me@example.com,#dae8fc,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nRon Donovan,System Admin,rdo,Office 3,Evan Miller,me@example.com,#d5e8d4,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nTessa Valet,HR Director,tva,Office 4,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\n';
-Editor.fastCompress=function(a){return null==a||0==a.length||"undefined"===typeof pako?a:pako.deflateRaw(a,{to:"string"})};Editor.fastDecompress=function(a){return null==a||0==a.length||"undefined"===typeof pako?a:pako.inflateRaw(a,{to:"string"})};Editor.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==typeof pako){var b=a.ownerDocument.getElementsByTagName("div"),g=[];if(null!=b&&0<b.length)for(var d=0;d<b.length;d++)if("mxgraph"==b[d].getAttribute("class")){g.push(b[d]);break}0<g.length&&
-(b=g[0].getAttribute("data-mxgraph"),null!=b?(g=JSON.parse(b),null!=g&&null!=g.xml&&(g=mxUtils.parseXml(g.xml),a=g.documentElement)):(g=g[0].getElementsByTagName("div"),0<g.length&&(b=mxUtils.getTextContent(g[0]),b=Graph.decompress(b),0<b.length&&(g=mxUtils.parseXml(b),a=g.documentElement))))}if(null!=a&&"svg"==a.nodeName)if(b=a.getAttribute("content"),null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),
-null!=b&&0<b.length)a=mxUtils.parseXml(b).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||c||(g=null,"diagram"==a.nodeName?g=a:"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),0<b.length&&(g=b[Math.max(0,Math.min(b.length-1,urlParams.page||0))])),null!=g&&(a=Editor.parseDiagramNode(g)));null==a||"mxGraphModel"==a.nodeName||c&&"mxfile"==a.nodeName||(a=null);return a};Editor.parseDiagramNode=function(a){var c=mxUtils.trim(mxUtils.getTextContent(a)),b=null;0<
+Editor.fastCompress=function(a){return null==a||0==a.length||"undefined"===typeof pako?a:pako.deflateRaw(a,{to:"string"})};Editor.fastDecompress=function(a){return null==a||0==a.length||"undefined"===typeof pako?a:pako.inflateRaw(a,{to:"string"})};Editor.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==typeof pako){var b=a.ownerDocument.getElementsByTagName("div"),f=[];if(null!=b&&0<b.length)for(var d=0;d<b.length;d++)if("mxgraph"==b[d].getAttribute("class")){f.push(b[d]);break}0<f.length&&
+(b=f[0].getAttribute("data-mxgraph"),null!=b?(f=JSON.parse(b),null!=f&&null!=f.xml&&(f=mxUtils.parseXml(f.xml),a=f.documentElement)):(f=f[0].getElementsByTagName("div"),0<f.length&&(b=mxUtils.getTextContent(f[0]),b=Graph.decompress(b),0<b.length&&(f=mxUtils.parseXml(b),a=f.documentElement))))}if(null!=a&&"svg"==a.nodeName)if(b=a.getAttribute("content"),null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),
+null!=b&&0<b.length)a=mxUtils.parseXml(b).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||c||(f=null,"diagram"==a.nodeName?f=a:"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),0<b.length&&(f=b[Math.max(0,Math.min(b.length-1,urlParams.page||0))])),null!=f&&(a=Editor.parseDiagramNode(f)));null==a||"mxGraphModel"==a.nodeName||c&&"mxfile"==a.nodeName||(a=null);return a};Editor.parseDiagramNode=function(a){var c=mxUtils.trim(mxUtils.getTextContent(a)),b=null;0<
c.length?(a=Graph.decompress(c),null!=a&&0<a.length&&(b=mxUtils.parseXml(a).documentElement)):(a=mxUtils.getChildNodes(a),0<a.length&&(b=mxUtils.createXmlDocument(),b.appendChild(b.importNode(a[0],!0)),b=b.documentElement));return b};Editor.getDiagramNodeXml=function(a){var c=mxUtils.getTextContent(a),b=null;0<c.length?b=Graph.decompress(c):null!=a.firstChild&&(b=mxUtils.getXml(a.firstChild));return b};Editor.extractGraphModelFromPng=function(a){var c=null;try{var b=a.substring(a.indexOf(",")+1),
-g=window.atob&&!mxClient.IS_SF?atob(b):Base64.decode(b,!0);EditorUi.parsePng(g,mxUtils.bind(this,function(a,b,d){a=g.substring(a+8,a+8+d);"zTXt"==b?(d=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,d)&&(a=pako.inflateRaw(a.substring(d+2),{to:"string"}).replace(/\+/g," "),null!=a&&0<a.length&&(c=a))):"tEXt"==b&&(a=a.split(String.fromCharCode(0)),1<a.length&&("mxGraphModel"==a[0]||"mxfile"==a[0])&&(c=a[1]));if(null!=c||"IDAT"==b)return!0}))}catch(I){}null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));
-null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));return c};Editor.extractParserError=function(a,c){var b=null,g=null!=a?a.getElementsByTagName("parsererror"):null;null!=g&&0<g.length&&(b=c||mxResources.get("invalidChars"),g=g[0].getElementsByTagName("div"),0<g.length&&(b=mxUtils.getTextContent(g[0])));return b};Editor.configure=function(a,c){if(null!=a){Editor.config=a;Editor.configVersion=a.version;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=
+f=window.atob&&!mxClient.IS_SF?atob(b):Base64.decode(b,!0);EditorUi.parsePng(f,mxUtils.bind(this,function(a,b,d){a=f.substring(a+8,a+8+d);"zTXt"==b?(d=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,d)&&(a=pako.inflateRaw(a.substring(d+2),{to:"string"}).replace(/\+/g," "),null!=a&&0<a.length&&(c=a))):"tEXt"==b&&(a=a.split(String.fromCharCode(0)),1<a.length&&("mxGraphModel"==a[0]||"mxfile"==a[0])&&(c=a[1]));if(null!=c||"IDAT"==b)return!0}))}catch(H){}null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));
+null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c));return c};Editor.extractParserError=function(a,c){var b=null,f=null!=a?a.getElementsByTagName("parsererror"):null;null!=f&&0<f.length&&(b=c||mxResources.get("invalidChars"),f=f[0].getElementsByTagName("div"),0<f.length&&(b=mxUtils.getTextContent(f[0])));return b};Editor.configure=function(a,c){if(null!=a){Editor.config=a;Editor.configVersion=a.version;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=
a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes;Graph.prototype.defaultEdgeLength=a.defaultEdgeLength||Graph.prototype.defaultEdgeLength;DrawioFile.prototype.autosaveDelay=a.autosaveDelay||DrawioFile.prototype.autosaveDelay;null!=a.templateFile&&(EditorUi.templateFile=a.templateFile);null!=a.globalVars&&
(Editor.globalVars=a.globalVars);null!=a.compressXml&&(Editor.compressXml=a.compressXml);a.customFonts&&(Menus.prototype.defaultFonts=a.customFonts.concat(Menus.prototype.defaultFonts));a.customPresetColors&&(ColorDialog.prototype.presetColors=a.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=a.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=a.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=a.css){var b=document.createElement("style");
-b.setAttribute("type","text/css");b.appendChild(document.createTextNode(a.css));var g=document.getElementsByTagName("script")[0];g.parentNode.insertBefore(b,g)}null!=a.libraries&&(Sidebar.prototype.customEntries=a.libraries);null!=a.enabledLibraries&&(Sidebar.prototype.enabledLibraries=a.enabledLibraries);null!=a.defaultLibraries&&(Sidebar.prototype.defaultEntries=a.defaultLibraries);null!=a.defaultCustomLibraries&&(Editor.defaultCustomLibraries=a.defaultCustomLibraries);null!=a.enableCustomLibraries&&
+b.setAttribute("type","text/css");b.appendChild(document.createTextNode(a.css));var f=document.getElementsByTagName("script")[0];f.parentNode.insertBefore(b,f)}null!=a.libraries&&(Sidebar.prototype.customEntries=a.libraries);null!=a.enabledLibraries&&(Sidebar.prototype.enabledLibraries=a.enabledLibraries);null!=a.defaultLibraries&&(Sidebar.prototype.defaultEntries=a.defaultLibraries);null!=a.defaultCustomLibraries&&(Editor.defaultCustomLibraries=a.defaultCustomLibraries);null!=a.enableCustomLibraries&&
(Editor.enableCustomLibraries=a.enableCustomLibraries);null!=a.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=a.defaultVertexStyle);null!=a.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=a.defaultEdgeStyle);a.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=a.emptyDiagramXml);a.thumbWidth&&(Sidebar.prototype.thumbWidth=a.thumbWidth);a.thumbHeight&&(Sidebar.prototype.thumbHeight=a.thumbHeight);a.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=a.emptyLibraryXml);a.sidebarWidth&&
-(EditorUi.prototype.hsplitPosition=a.sidebarWidth);a.fontCss&&(b=document.createElement("style"),b.setAttribute("type","text/css"),b.appendChild(document.createTextNode(a.fontCss)),g=document.getElementsByTagName("script")[0],g.parentNode.insertBefore(b,g),Editor.prototype.fontCss=a.fontCss);if(null!=a.plugins&&!c)for(App.initPluginCallback(),b=0;b<a.plugins.length;b++)mxscript(a.plugins[b])}};Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=
+(EditorUi.prototype.hsplitPosition=a.sidebarWidth);a.fontCss&&(b=document.createElement("style"),b.setAttribute("type","text/css"),b.appendChild(document.createTextNode(a.fontCss)),f=document.getElementsByTagName("script")[0],f.parentNode.insertBefore(b,f),Editor.prototype.fontCss=a.fontCss);if(null!=a.plugins&&!c)for(App.initPluginCallback(),b=0;b<a.plugins.length;b++)mxscript(a.plugins[b])}};Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=
20;Editor.guid=function(a){a=null!=a?a:Editor.GUID_LENGTH;for(var c=[],b=0;b<a;b++)c.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return c.join("")};Editor.prototype.timeout=25E3;Editor.prototype.useForeignObjectForMath=!1;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(c){c=null!=c&&"mxlibrary"!=c.nodeName?this.extractGraphModel(c):null;
-if(null!=c){var b=c.getElementsByTagName("parsererror");if(null!=b&&0<b.length){var b=b[0],g=b.getElementsByTagName("div");null!=g&&0<g.length&&(b=g[0]);throw{message:mxUtils.getTextContent(b)};}if("mxGraphModel"==c.nodeName){b=c.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=b&&""!=b)b!=this.graph.currentStyle&&(g=null!=this.graph.themes?this.graph.themes[b]:mxUtils.load(STYLE_PATH+"/"+b+".xml").getDocumentElement(),null!=g&&(d=new mxCodec(g.ownerDocument),d.decode(g,this.graph.getStylesheet())));
-else if(g=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),null!=g){var d=new mxCodec(g.ownerDocument);d.decode(g,this.graph.getStylesheet())}this.graph.currentStyle=b;this.graph.mathEnabled="1"==urlParams.math||"1"==c.getAttribute("math");b=c.getAttribute("backgroundImage");null!=b?(b=JSON.parse(b),this.graph.setBackgroundImage(new mxImage(b.src,b.width,b.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled&&
+if(null!=c){var b=c.getElementsByTagName("parsererror");if(null!=b&&0<b.length){var b=b[0],f=b.getElementsByTagName("div");null!=f&&0<f.length&&(b=f[0]);throw{message:mxUtils.getTextContent(b)};}if("mxGraphModel"==c.nodeName){b=c.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=b&&""!=b)b!=this.graph.currentStyle&&(f=null!=this.graph.themes?this.graph.themes[b]:mxUtils.load(STYLE_PATH+"/"+b+".xml").getDocumentElement(),null!=f&&(d=new mxCodec(f.ownerDocument),d.decode(f,this.graph.getStylesheet())));
+else if(f=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),null!=f){var d=new mxCodec(f.ownerDocument);d.decode(f,this.graph.getStylesheet())}this.graph.currentStyle=b;this.graph.mathEnabled="1"==urlParams.math||"1"==c.getAttribute("math");b=c.getAttribute("backgroundImage");null!=b?(b=JSON.parse(b),this.graph.setBackgroundImage(new mxImage(b.src,b.width,b.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled&&
!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==c.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var b=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var c=b.apply(this,
arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&c.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));c.setAttribute("math",this.graph.mathEnabled?"1":"0");c.setAttribute("shadow",this.graph.shadowVisible?"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var c=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=c&&(null!=c&&"<"!=
-c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(Z){}return!1};Editor.prototype.extractGraphModel=function(a,c){return Editor.extractGraphModel.apply(this,arguments)};var f=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=
-null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();f.apply(this,arguments)};var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){d.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?
+c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(Y){}return!1};Editor.prototype.extractGraphModel=function(a,c){return Editor.extractGraphModel.apply(this,arguments)};var e=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=
+null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();e.apply(this,arguments)};var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){d.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?
!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(a,c){a=null!=a?a:DRAW_MATH_URL+"/MathJax.js?config=TeX-MML-AM_HTMLorMML";Editor.mathJaxQueue=[];Editor.doMathJaxRender=function(a){window.setTimeout(function(){"hidden"!=a.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])},0)};window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",
AuthorInit:function(){MathJax.Hub.Config(c||{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&&!this.graph.blockMathRender&&Editor.MathJaxRender(this.graph.container)}))};var g=document.getElementsByTagName("script");
-if(null!=g&&0<g.length){var d=document.createElement("script");d.type="text/javascript";d.src=a;g[0].parentNode.appendChild(d)}};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,g,d){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==g?c.push(g.replace(/\\"/g,'"')):void 0!==d&&c.push(d);return""});/,\s*$/.test(a)&&c.push("");return c};Editor.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?:\/\/[^\/]*\.blob.core.windows.net\//.test(a)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var c=a.convert,b=this;a.convert=function(g){if(null!=g){var d="http://"==g.substring(0,7)||"https://"==g.substring(0,8);d&&!navigator.onLine?g=EditorUi.prototype.svgBrokenImage.src:!d||g.substring(0,
-a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&b.isCorsEnabledForUrl(g)?"chrome-extension://"==g.substring(0,19)||mxClient.IS_CHROMEAPP||(g=c.apply(this,arguments)):g=PROXY_URL+"?url="+encodeURIComponent(g)}return g};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=function(a,c){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){c(this.createSvgDataUri(a.getText()))}),
-function(){c(EditorUi.prototype.svgBrokenImage.src)});else{var b=new Image;EditorUi.prototype.crossOriginImages&&(b.crossOrigin="anonymous");b.onload=function(){var a=document.createElement("canvas"),g=a.getContext("2d");a.height=b.height;a.width=b.width;g.drawImage(b,0,0);try{c(a.toDataURL())}catch(Q){c(EditorUi.prototype.svgBrokenImage.src)}};b.onerror=function(){c(EditorUi.prototype.svgBrokenImage.src)};b.src=a}};Editor.prototype.convertImages=function(a,c,b,g){null==g&&(g=this.createImageUrlConverter());
-var d=0,f=b||{};b=mxUtils.bind(this,function(b,k){for(var m=a.getElementsByTagName(b),p=0;p<m.length;p++)mxUtils.bind(this,function(b){var m=g.convert(b.getAttribute(k));if(null!=m&&"data:"!=m.substring(0,5)){var p=f[m];null==p?(d++,this.convertImageToDataUri(m,function(g){null!=g&&(f[m]=g,b.setAttribute(k,g));d--;0==d&&c(a)})):b.setAttribute(k,p)}else null!=m&&b.setAttribute(k,m)})(m[p])});b("image","xlink:href");b("img","src");0==d&&c(a)};Editor.prototype.base64Encode=function(a){for(var c="",b=
-0,g=a.length,d,f,k;b<g;){d=a.charCodeAt(b++)&255;if(b==g){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4);c+="==";break}f=a.charCodeAt(b++);if(b==g){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(f&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&
-15)<<2);c+="=";break}k=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(f&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(k&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return c};Editor.prototype.loadUrl=function(a,c,b,g,d,f){try{var k=g||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||
-/(\.gif)($|\?)/i.test(a);d=null!=d?d:!0;var m=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=c){var g=a.getText();if(k){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var g=Array(a.length),d=0;d<a.length;d++)g[d]=String.fromCharCode(a[d]);g=g.join("")}f=null!=f?f:"data:image/png;base64,";g=f+this.base64Encode(g)}c(g)}}else null!=
-b&&b({code:App.ERROR_UNKNOWN},a)}),function(){null!=b&&b({code:App.ERROR_UNKNOWN})},k,this.timeout,function(){d&&null!=b&&b({code:App.ERROR_TIMEOUT,retry:m})})});m()}catch(P){null!=b&&b(P)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.fontCss.split("url("),g=0,d={},f=mxUtils.bind(this,function(){if(0==g){for(var f=[b[0]],k=1;k<b.length;k++){var m=
-b[k].indexOf(")");f.push('url("');f.push(d[c(b[k].substring(0,m))]);f.push('"'+b[k].substring(m))}this.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var k=1;k<b.length;k++){var m=b[k].indexOf(")"),p=null,v=b[k].indexOf("format(",m);0<v&&(p=c(b[k].substring(v+7,b[k].indexOf(")",v))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;g++;var c="application/x-font-ttf";if("svg"==p||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==p||"embedded-opentype"==p||/(\.otf)($|\?)/i.test(a))c=
-"application/x-font-opentype";else if("woff"==p||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==p||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==p||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==p||/(\.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){d[a]=c;g--;f()}),mxUtils.bind(this,
-function(a){g--;f()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[k].substring(0,m)),p)}}else a()};Editor.prototype.convertMath=function(a,c,b,g){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(c),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){g()}))}),0)):g()};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=
-function(a,c,b,g,d,f,k,m,p,q,u,z,l,y){f=null!=f?f:!0;z=null!=z?z:this.graph;l=null!=l?l:0;var v=p?null:z.background;v==mxConstants.NONE&&(v=null);null==v&&(v=g);null==v&&0==p&&(v=this.graph.defaultPageBackgroundColor);this.convertImages(z.getSvg(v,null,null,y,null,null!=k?k:!0,null,null,null,q),mxUtils.bind(this,function(b){var g=new Image;g.onload=mxUtils.bind(this,function(){try{var k=document.createElement("canvas"),p=parseInt(b.getAttribute("width")),q=parseInt(b.getAttribute("height"));m=null!=
-m?m:1;null!=c&&(m=f?Math.min(1,Math.min(3*c/(4*q),c/p)):c/p);p=Math.ceil(m*p)+2*l;q=Math.ceil(m*q)+2*l;k.setAttribute("width",p);k.setAttribute("height",q);var u=k.getContext("2d");null!=v&&(u.beginPath(),u.rect(0,0,p,q),u.fillStyle=v,u.fill());u.scale(m,m);mxClient.IS_SF?window.setTimeout(function(){u.drawImage(g,l/m,l/m);a(k)},0):(u.drawImage(g,l/m,l/m),a(k))}catch(R){null!=d&&d(R)}});g.onerror=function(a){null!=d&&d(a)};try{q&&this.graph.addSvgShadow(b);var k=mxUtils.bind(this,function(){if(null!=
-this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;b.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(z,b,!0,mxUtils.bind(this,function(){g.src=this.createSvgDataUri(mxUtils.getXml(b))}))});this.loadFonts(k)}catch(S){null!=d&&d(S)}}),b,u)};Editor.prototype.writeGraphModelToPng=function(a,c,b,g,d){function f(a,c){var b=p;p+=c;return a.substring(b,p)}function k(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
-8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function m(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 p=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(f(a,4),"IHDR"!=f(a,4))null!=d&&d();else{f(a,17);d=a.substring(0,p);do{var v=k(a);if("IDAT"==f(a,4)){d=a.substring(0,p-8);b=b+String.fromCharCode(0)+("zTXt"==c?String.fromCharCode(0):"")+g;g=4294967295;
-g=EditorUi.prototype.updateCRC(g,c,0,4);g=EditorUi.prototype.updateCRC(g,b,0,b.length);d+=m(b.length)+c+b+m(g^4294967295);d+=a.substring(p-8,a.length);break}d+=a.substring(p-8,p-4+v);f(a,v);f(a,4)}while(v);return"data:image/png;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";var l=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){l.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);
-mxSettings.save()};var n=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){n.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 t=Format.prototype.init;Format.prototype.init=function(){t.apply(this,arguments);
-this.editorUi.editor.addListener("fileLoaded",this.update)};var x=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?x.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 A=DiagramFormatPanel.prototype.addView;
-DiagramFormatPanel.prototype.addView=function(a){a=A.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,g=this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var g=new ChangePageSetup(c);g.ignoreColor=!0;g.ignoreImage=!0;g.shadowVisible=a;b.model.execute(g)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},
-destroy:function(){c.removeListener(this.listener)}});Editor.shadowOptionEnabled||(g.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(g,60));a.appendChild(g)}return a};var C=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(a){a=C.apply(this,arguments);var c=this.editorUi,b=c.editor.graph;if(b.isEnabled()){var g=c.getCurrentFile();if(null!=g&&g.isAutosaveOptional()){var d=this.createOption(mxResources.get("autosave"),function(){return c.editor.autosave},
-function(a){c.editor.setAutosave(a);c.editor.autosave&&g.isModified()&&g.fileChanged()},{install:function(a){this.listener=function(){a(c.editor.autosave)};c.editor.addListener("autosaveChanged",this.listener)},destroy:function(){c.editor.removeListener(this.listener)}});a.appendChild(d)}}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){d=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return b.mathEnabled},function(a){c.actions.get("mathematicalTypesetting").funct()},
-{install:function(a){this.listener=function(){a(b.mathEnabled)};c.addListener("mathEnabledChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});d.style.paddingTop="5px";a.appendChild(d);var f=c.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");f.style.position="relative";f.style.marginLeft="6px";f.style.top="2px";d.appendChild(f)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",
+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&&!this.graph.blockMathRender&&Editor.MathJaxRender(this.graph.container)}))};var f=document.getElementsByTagName("script");
+if(null!=f&&0<f.length){var d=document.createElement("script");d.type="text/javascript";d.src=a;f[0].parentNode.appendChild(d)}};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,f,d){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==f?c.push(f.replace(/\\"/g,'"')):void 0!==d&&c.push(d);return""});/,\s*$/.test(a)&&c.push("");return c};Editor.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?:\/\/[^\/]*\.blob.core.windows.net\//.test(a)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var c=a.convert,b=this;a.convert=function(f){if(null!=f){var d="http://"==f.substring(0,7)||"https://"==f.substring(0,8);d&&!navigator.onLine?f=EditorUi.prototype.svgBrokenImage.src:!d||f.substring(0,
+a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&b.isCorsEnabledForUrl(f)?"chrome-extension://"==f.substring(0,19)||mxClient.IS_CHROMEAPP||(f=c.apply(this,arguments)):f=PROXY_URL+"?url="+encodeURIComponent(f)}return f};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=function(a,c){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){c(this.createSvgDataUri(a.getText()))}),
+function(){c(EditorUi.prototype.svgBrokenImage.src)});else{var b=new Image;EditorUi.prototype.crossOriginImages&&(b.crossOrigin="anonymous");b.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=b.height;a.width=b.width;f.drawImage(b,0,0);try{c(a.toDataURL())}catch(O){c(EditorUi.prototype.svgBrokenImage.src)}};b.onerror=function(){c(EditorUi.prototype.svgBrokenImage.src)};b.src=a}};Editor.prototype.convertImages=function(a,c,b,f){null==f&&(f=this.createImageUrlConverter());
+var d=0,e=b||{};b=mxUtils.bind(this,function(b,g){for(var l=a.getElementsByTagName(b),n=0;n<l.length;n++)mxUtils.bind(this,function(b){var l=f.convert(b.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var n=e[l];null==n?(d++,this.convertImageToDataUri(l,function(f){null!=f&&(e[l]=f,b.setAttribute(g,f));d--;0==d&&c(a)})):b.setAttribute(g,n)}else null!=l&&b.setAttribute(g,l)})(l[n])});b("image","xlink:href");b("img","src");0==d&&c(a)};Editor.prototype.base64Encode=function(a){for(var c="",b=
+0,f=a.length,d,e,g;b<f;){d=a.charCodeAt(b++)&255;if(b==f){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4);c+="==";break}e=a.charCodeAt(b++);if(b==f){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(e&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&
+15)<<2);c+="=";break}g=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(e&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return c};Editor.prototype.loadUrl=function(a,c,b,f,d,e){try{var g=f||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||
+/(\.gif)($|\?)/i.test(a);d=null!=d?d:!0;var l=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=c){var f=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),d=0;d<a.length;d++)f[d]=String.fromCharCode(a[d]);f=f.join("")}e=null!=e?e:"data:image/png;base64,";f=e+this.base64Encode(f)}c(f)}}else null!=
+b&&b({code:App.ERROR_UNKNOWN},a)}),function(){null!=b&&b({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){d&&null!=b&&b({code:App.ERROR_TIMEOUT,retry:l})})});l()}catch(Q){null!=b&&b(Q)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.fontCss.split("url("),f=0,d={},e=mxUtils.bind(this,function(){if(0==f){for(var e=[b[0]],g=1;g<b.length;g++){var l=
+b[g].indexOf(")");e.push('url("');e.push(d[c(b[g].substring(0,l))]);e.push('"'+b[g].substring(l))}this.resolvedFontCss=e.join("");a()}});if(0<b.length)for(var g=1;g<b.length;g++){var l=b[g].indexOf(")"),n=null,u=b[g].indexOf("format(",l);0<u&&(n=c(b[g].substring(u+7,b[g].indexOf(")",u))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;f++;var c="application/x-font-ttf";if("svg"==n||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(a))c=
+"application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.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){d[a]=c;f--;e()}),mxUtils.bind(this,
+function(a){f--;e()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[g].substring(0,l)),n)}}else a()};Editor.prototype.convertMath=function(a,c,b,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(c),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){f()}))}),0)):f()};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=
+function(a,c,b,f,d,e,g,l,n,t,q,x,y,k){e=null!=e?e:!0;x=null!=x?x:this.graph;y=null!=y?y:0;var u=n?null:x.background;u==mxConstants.NONE&&(u=null);null==u&&(u=f);null==u&&0==n&&(u=this.graph.defaultPageBackgroundColor);this.convertImages(x.getSvg(u,null,null,k,null,null!=g?g:!0,null,null,null,t),mxUtils.bind(this,function(b){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var g=document.createElement("canvas"),n=parseInt(b.getAttribute("width")),t=parseInt(b.getAttribute("height"));l=null!=
+l?l:1;null!=c&&(l=e?Math.min(1,Math.min(3*c/(4*t),c/n)):c/n);n=Math.ceil(l*n)+2*y;t=Math.ceil(l*t)+2*y;g.setAttribute("width",n);g.setAttribute("height",t);var q=g.getContext("2d");null!=u&&(q.beginPath(),q.rect(0,0,n,t),q.fillStyle=u,q.fill());q.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){q.drawImage(f,y/l,y/l);a(g)},0):(q.drawImage(f,y/l,y/l),a(g))}catch(R){null!=d&&d(R)}});f.onerror=function(a){null!=d&&d(a)};try{t&&this.graph.addSvgShadow(b);var g=mxUtils.bind(this,function(){if(null!=
+this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;b.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(x,b,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(b))}))});this.loadFonts(g)}catch(S){null!=d&&d(S)}}),b,q)};Editor.prototype.writeGraphModelToPng=function(a,c,b,f,d){function e(a,c){var b=n;n+=c;return a.substring(b,n)}function g(a){a=e(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
+8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function l(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 n=0;if(e(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(e(a,4),"IHDR"!=e(a,4))null!=d&&d();else{e(a,17);d=a.substring(0,n);do{var u=g(a);if("IDAT"==e(a,4)){d=a.substring(0,n-8);b=b+String.fromCharCode(0)+("zTXt"==c?String.fromCharCode(0):"")+f;f=4294967295;
+f=EditorUi.prototype.updateCRC(f,c,0,4);f=EditorUi.prototype.updateCRC(f,b,0,b.length);d+=l(b.length)+c+b+l(f^4294967295);d+=a.substring(n-8,a.length);break}d+=a.substring(n-8,n-4+u);e(a,u);e(a,4)}while(u);return"data:image/png;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";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&&(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 v=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?v.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 B=DiagramFormatPanel.prototype.addView;
+DiagramFormatPanel.prototype.addView=function(a){a=B.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,f=this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var f=new ChangePageSetup(c);f.ignoreColor=!0;f.ignoreImage=!0;f.shadowVisible=a;b.model.execute(f)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},
+destroy:function(){c.removeListener(this.listener)}});Editor.shadowOptionEnabled||(f.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(f,60));a.appendChild(f)}return a};var z=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(a){a=z.apply(this,arguments);var c=this.editorUi,b=c.editor.graph;if(b.isEnabled()){var f=c.getCurrentFile();if(null!=f&&f.isAutosaveOptional()){var d=this.createOption(mxResources.get("autosave"),function(){return c.editor.autosave},
+function(a){c.editor.setAutosave(a);c.editor.autosave&&f.isModified()&&f.fileChanged()},{install:function(a){this.listener=function(){a(c.editor.autosave)};c.editor.addListener("autosaveChanged",this.listener)},destroy:function(){c.editor.removeListener(this.listener)}});a.appendChild(d)}}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){d=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return b.mathEnabled},function(a){c.actions.get("mathematicalTypesetting").funct()},
+{install:function(a){this.listener=function(){a(b.mathEnabled)};c.addListener("mathEnabledChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});d.style.paddingTop="5px";a.appendChild(d);var e=c.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");e.style.position="relative";e.style.marginLeft="6px";e.style.top="2px";d.appendChild(e)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",
type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,
defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",
dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",
@@ -2872,58 +2872,58 @@ type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,de
{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#aa00ff",stroke:"#7700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#ffffff"},{fill:"#f0a30a",stroke:"#BD7000",font:"#ffffff"},{fill:"#e3c800",
stroke:"#B09500",font:"#ffffff"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},
{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",
-stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,c,b){if(null!=c){var g=function(a){if(null!=a)if(b)for(var g=0;g<a.length;g++)c[a[g].name]=a[g];else for(var d in c){for(var f=!1,g=0;g<a.length;g++)if(a[g].name==d&&a[g].type==c[d].type){f=!0;break}f||delete c[d]}},d=this.editorUi.editor.graph.view.getState(a);null!=d&&
-null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),g(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{g(JSON.parse(a))}catch(Q){}}};var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
-this.format.createSelectionState();"image"==a.style.shape||a.containsLabel||this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},g=a.vertices,d=a.edges,f=0;f<g.length;f++)this.findCommonProperties(g[f],b,0==f);for(f=0;f<d.length;f++)this.findCommonProperties(d[f],b,0==g.length&&0==f);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),
-b,a))}};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,
-function(a){this.editorUi.actions.get("pasteStyle").funct()}));c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return g.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,c,b){function g(a,c,b,g){u.getModel().beginUpdate();try{var d=[],f=[];if(null!=b.index){for(var k=[],m=b.parentRow.nextSibling;m&&
-m.getAttribute("data-pName")==a;)k.push(m.getAttribute("data-pValue")),m=m.nextSibling;b.index<k.length?null!=g?k.splice(g,1):k[b.index]=c:k.push(c);null!=b.size&&k.length>b.size&&(k=k.slice(0,b.size));c=k.join(",");null!=b.countProperty&&(u.setCellStyles(b.countProperty,k.length,u.getSelectionCells()),d.push(b.countProperty),f.push(k.length))}u.setCellStyles(a,c,u.getSelectionCells());d.push(a);f.push(c);if(null!=b.dependentProps)for(a=0;a<b.dependentProps.length;a++){var p=b.dependentPropsDefVal[a],
-q=b.dependentPropsVals[a];if(q.length>c)q=q.slice(0,c);else for(var z=q.length;z<c;z++)q.push(p);q=q.join(",");u.setCellStyles(b.dependentProps[a],q,u.getSelectionCells());d.push(b.dependentProps[a]);f.push(q)}if("function"==typeof b.onChange)b.onChange(u,c);v.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",f,"cells",u.getSelectionCells()))}finally{u.getModel().endUpdate()}}function d(c,b,g){var d=mxUtils.getOffset(a,!0),f=mxUtils.getOffset(c,!0);b.style.position="absolute";
-b.style.left=f.x-d.x+"px";b.style.top=f.y-d.y+"px";b.style.width=c.offsetWidth+"px";b.style.height=c.offsetHeight-(g?4:0)+"px";b.style.zIndex=5}function f(a,c,b){var d=document.createElement("div");d.style.width="32px";d.style.height="4px";d.style.margin="2px";d.style.border="1px solid black";d.style.background=c&&"none"!=c?c:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(v,function(f){this.editorUi.pickColor(c,function(c){d.style.background="none"==c?"url('"+Dialog.prototype.noColorImage+
-"')":c;g(a,c,b)});mxEvent.consume(f)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(d);return btn}function k(a,c,b,d,f,k,m){null!=c&&(c=c.split(","),z.push({name:a,values:c,type:b,defVal:d,countProperty:f,parentRow:k,isDeletable:!0,flipBkg:m}));btn=mxUtils.button("+",mxUtils.bind(v,function(c){for(var p=k,v=0;null!=p.nextSibling;)if(p.nextSibling.getAttribute("data-pName")==a)p=p.nextSibling,v++;else break;var u={type:b,parentRow:k,index:v,isDeletable:!0,
-defVal:d,countProperty:f},v=q(a,"",u,0==v%2,m);g(a,d,u);p.parentNode.insertBefore(v,p.nextSibling);mxEvent.consume(c)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function m(a,c,b,g,d,f,k){if(0<d){var m=Array(d);c=null!=c?c.split(","):[];for(var p=0;p<d;p++)m[p]=null!=c[p]?c[p]:null!=g?g:"";z.push({name:a,values:m,type:b,defVal:g,parentRow:f,flipBkg:k,size:d})}return document.createElement("div")}function p(a,c,b){var d=document.createElement("input");d.type=
-"checkbox";d.checked="1"==c;mxEvent.addListener(d,"change",function(){g(a,d.checked?"1":"0",b)});return d}function q(c,b,q,u,z){var y=q.dispName,l=q.type,D=document.createElement("tr");D.className="gePropRow"+(z?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";D.setAttribute("data-pName",c);D.setAttribute("data-pValue",b);u=!1;null!=q.index&&(D.setAttribute("data-index",q.index),y=(null!=y?y:"")+"["+q.index+"]",u=!0);var B=document.createElement("td");B.className="gePropRowCell";B.innerHTML=mxUtils.htmlEntities(mxResources.get(y,
-null,y));u&&(B.style.textAlign="right");D.appendChild(B);B=document.createElement("td");B.className="gePropRowCell";if("color"==l)B.appendChild(f(c,b,q));else if("bool"==l||"boolean"==l)B.appendChild(p(c,b,q));else if("enum"==l){var E=q.enumList;for(z=0;z<E.length;z++)if(y=E[z],y.val==b){B.innerHTML=mxUtils.htmlEntities(mxResources.get(y.dispName,null,y.dispName));break}mxEvent.addListener(B,"click",mxUtils.bind(v,function(){var f=document.createElement("select");d(B,f);for(var k=0;k<E.length;k++){var m=
-E[k],p=document.createElement("option");p.value=mxUtils.htmlEntities(m.val);p.innerHTML=mxUtils.htmlEntities(mxResources.get(m.dispName,null,m.dispName));f.appendChild(p)}f.value=b;a.appendChild(f);mxEvent.addListener(f,"change",function(){var a=mxUtils.htmlEntities(f.value);g(c,a,q)});f.focus();mxEvent.addListener(f,"blur",function(){a.removeChild(f)})}))}else"dynamicArr"==l?B.appendChild(k(c,b,q.subType,q.subDefVal,q.countProperty,D,z)):"staticArr"==l?B.appendChild(m(c,b,q.subType,q.subDefVal,q.size,
-D,z)):(B.innerHTML=b,mxEvent.addListener(B,"click",mxUtils.bind(v,function(){function f(){var a=k.value,a=0==a.length&&"string"!=l?0:a;q.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",l="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=q.min&&a<q.min?a=q.min:null!=q.max&&a>q.max&&(a=q.max);a=mxUtils.htmlEntities(("int"==l?parseInt(a):a)+"");g(c,a,q)}var k=document.createElement("input");d(B,k,!0);k.value=b;k.className="gePropEditor";"int"!=l&&"float"!=l||q.allowAuto||(k.type="number",k.step=
-"int"==l?"1":"any",null!=q.min&&(k.min=parseFloat(q.min)),null!=q.max&&(k.max=parseFloat(q.max)));a.appendChild(k);mxEvent.addListener(k,"keypress",function(a){13==a.keyCode&&f()});k.focus();mxEvent.addListener(k,"blur",function(){f()})})));q.isDeletable&&(z=mxUtils.button("-",mxUtils.bind(v,function(a){g(c,"",q,q.index);mxEvent.consume(a)})),z.style.height="16px",z.style.width="25px",z.style["float"]="right",z.className="geColorBtn",B.appendChild(z));D.appendChild(B);return D}var v=this,u=this.editorUi.editor.graph,
-z=[];a.style.position="relative";a.style.padding="0";var l=document.createElement("table");l.style.whiteSpace="nowrap";l.style.width="100%";var y=document.createElement("tr");y.className="gePropHeader";var D=document.createElement("th");D.className="gePropHeaderCell";var B=document.createElement("img");B.src=Sidebar.prototype.expandedImage;D.appendChild(B);mxUtils.write(D,mxResources.get("property"));y.style.cursor="pointer";var n=function(){var c=l.querySelectorAll(".gePropNonHeaderRow"),b;if(v.editorUi.propertiesCollapsed){B.src=
-Sidebar.prototype.collapsedImage;b="none";for(var g=a.childNodes.length-1;0<=g;g--)try{var d=a.childNodes[g],f=d.nodeName.toUpperCase();"INPUT"!=f&&"SELECT"!=f||a.removeChild(d)}catch(K){}}else B.src=Sidebar.prototype.expandedImage,b="";for(g=0;g<c.length;g++)c[g].style.display=b};mxEvent.addListener(y,"click",function(){v.editorUi.propertiesCollapsed=!v.editorUi.propertiesCollapsed;n()});y.appendChild(D);D=document.createElement("th");D.className="gePropHeaderCell";D.innerHTML=mxResources.get("value");
-y.appendChild(D);l.appendChild(y);var G=!1,t=!1,F;for(F in c)if(y=c[F],"function"!=typeof y.isVisible||y.isVisible(b)){var x=null!=b.style[F]?mxUtils.htmlEntities(b.style[F]+""):y.defVal;if("separator"==y.type)t=!t;else{if("staticArr"==y.type)y.size=parseInt(b.style[y.sizeProperty]||c[y.sizeProperty].defVal)||0;else if(null!=y.dependentProps){for(var O=y.dependentProps,A=[],C=[],D=0;D<O.length;D++){var J=b.style[O[D]];C.push(c[O[D]].subDefVal);A.push(null!=J?J.split(","):[])}y.dependentPropsDefVal=
-C;y.dependentPropsVals=A}l.appendChild(q(F,x,y,G,t));G=!G}}for(D=0;D<z.length;D++)for(y=z[D],c=y.parentRow,b=0;b<y.values.length;b++)F=q(y.name,y.values[b],{type:y.type,parentRow:y.parentRow,isDeletable:y.isDeletable,index:b,defVal:y.defVal,countProperty:y.countProperty,size:y.size},0==b%2,y.flipBkg),c.parentNode.insertBefore(F,c.nextSibling),c=F;a.appendChild(l);n();return a};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){g.getModel().beginUpdate();
-try{var b=g.getSelectionCells();for(c=0;c<b.length;c++){for(var d=g.getModel().getStyle(b[c]),k=0;k<f.length;k++)d=mxUtils.removeStylename(d,f[k]);var m=g.getModel().isVertex(b[c])?g.defaultVertexStyle:g.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(m,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(m,mxConstants.STYLE_FILLCOLOR,
-null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(m,mxConstants.STYLE_STROKECOLOR,null)),g.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(m,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(m,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(m,
-mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(m,mxConstants.STYLE_GRADIENTCOLOR,null)),g.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(m,mxConstants.STYLE_FONTCOLOR,null))));g.getModel().setStyle(b[c],d)}}finally{g.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";if(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%)":a.fill==mxConstants.NONE?c.style.background="url('"+Dialog.prototype.noColorImage+"')":c.style.backgroundColor=""==a.fill?mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"):a.fill||mxUtils.getValue(g.defaultVertexStyle,
-mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"),c.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"):"1px solid "+(a.stroke||mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"));else{var b=mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),k=mxUtils.getValue(g.defaultVertexStyle,
-mxConstants.STYLE_STROKECOLOR,"#000000");c.style.backgroundColor=b;c.style.border="1px solid "+k}d.appendChild(c)}d.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(d),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 g=this.editorUi.editor.graph,d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.paddingLeft="24px";d.style.paddingRight="20px";
-a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(d);var f="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 k=document.createElement("div");k.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(k,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var m=document.createElement("div");m.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(k),a.appendChild(m));mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(k);b(m);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 g=this.editorUi.editor.graph,d=g.view.getState(g.getSelectionCell());1==g.getSelectionCount()&&null!=d&&null!=d.shape&&null!=d.shape.stencil?(c=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
+stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,c,b){if(null!=c){var f=function(a){if(null!=a)if(b)for(var f=0;f<a.length;f++)c[a[f].name]=a[f];else for(var d in c){for(var e=!1,f=0;f<a.length;f++)if(a[f].name==d&&a[f].type==c[d].type){e=!0;break}e||delete c[d]}},d=this.editorUi.editor.graph.view.getState(a);null!=d&&
+null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),f(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(O){}}};var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
+this.format.createSelectionState();"image"==a.style.shape||a.containsLabel||this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},f=a.vertices,d=a.edges,e=0;e<f.length;e++)this.findCommonProperties(f[e],b,0==e);for(e=0;e<d.length;e++)this.findCommonProperties(d[e],b,0==f.length&&0==e);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),
+b,a))}};var f=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,
+function(a){this.editorUi.actions.get("pasteStyle").funct()}));c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return f.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,c,b){function f(a,c,b,f){q.getModel().beginUpdate();try{var d=[],e=[];if(null!=b.index){for(var g=[],l=b.parentRow.nextSibling;l&&
+l.getAttribute("data-pName")==a;)g.push(l.getAttribute("data-pValue")),l=l.nextSibling;b.index<g.length?null!=f?g.splice(f,1):g[b.index]=c:g.push(c);null!=b.size&&g.length>b.size&&(g=g.slice(0,b.size));c=g.join(",");null!=b.countProperty&&(q.setCellStyles(b.countProperty,g.length,q.getSelectionCells()),d.push(b.countProperty),e.push(g.length))}q.setCellStyles(a,c,q.getSelectionCells());d.push(a);e.push(c);if(null!=b.dependentProps)for(a=0;a<b.dependentProps.length;a++){var n=b.dependentPropsDefVal[a],
+t=b.dependentPropsVals[a];if(t.length>c)t=t.slice(0,c);else for(var x=t.length;x<c;x++)t.push(n);t=t.join(",");q.setCellStyles(b.dependentProps[a],t,q.getSelectionCells());d.push(b.dependentProps[a]);e.push(t)}if("function"==typeof b.onChange)b.onChange(q,c);u.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",e,"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}}function d(c,b,f){var d=mxUtils.getOffset(a,!0),e=mxUtils.getOffset(c,!0);b.style.position="absolute";
+b.style.left=e.x-d.x+"px";b.style.top=e.y-d.y+"px";b.style.width=c.offsetWidth+"px";b.style.height=c.offsetHeight-(f?4:0)+"px";b.style.zIndex=5}function e(a,c,b){var d=document.createElement("div");d.style.width="32px";d.style.height="4px";d.style.margin="2px";d.style.border="1px solid black";d.style.background=c&&"none"!=c?c:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(u,function(e){this.editorUi.pickColor(c,function(c){d.style.background="none"==c?"url('"+Dialog.prototype.noColorImage+
+"')":c;f(a,c,b)});mxEvent.consume(e)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(d);return btn}function g(a,c,b,d,e,g,l){null!=c&&(c=c.split(","),x.push({name:a,values:c,type:b,defVal:d,countProperty:e,parentRow:g,isDeletable:!0,flipBkg:l}));btn=mxUtils.button("+",mxUtils.bind(u,function(c){for(var n=g,u=0;null!=n.nextSibling;)if(n.nextSibling.getAttribute("data-pName")==a)n=n.nextSibling,u++;else break;var q={type:b,parentRow:g,index:u,isDeletable:!0,
+defVal:d,countProperty:e},u=t(a,"",q,0==u%2,l);f(a,d,q);n.parentNode.insertBefore(u,n.nextSibling);mxEvent.consume(c)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function l(a,c,b,f,d,e,g){if(0<d){var l=Array(d);c=null!=c?c.split(","):[];for(var n=0;n<d;n++)l[n]=null!=c[n]?c[n]:null!=f?f:"";x.push({name:a,values:l,type:b,defVal:f,parentRow:e,flipBkg:g,size:d})}return document.createElement("div")}function n(a,c,b){var d=document.createElement("input");d.type=
+"checkbox";d.checked="1"==c;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",b)});return d}function t(c,b,t,q,x){var k=t.dispName,y=t.type,A=document.createElement("tr");A.className="gePropRow"+(x?"Dark":"")+(q?"Alt":"")+" gePropNonHeaderRow";A.setAttribute("data-pName",c);A.setAttribute("data-pValue",b);q=!1;null!=t.index&&(A.setAttribute("data-index",t.index),k=(null!=k?k:"")+"["+t.index+"]",q=!0);var C=document.createElement("td");C.className="gePropRowCell";C.innerHTML=mxUtils.htmlEntities(mxResources.get(k,
+null,k));q&&(C.style.textAlign="right");A.appendChild(C);C=document.createElement("td");C.className="gePropRowCell";if("color"==y)C.appendChild(e(c,b,t));else if("bool"==y||"boolean"==y)C.appendChild(n(c,b,t));else if("enum"==y){var m=t.enumList;for(x=0;x<m.length;x++)if(k=m[x],k.val==b){C.innerHTML=mxUtils.htmlEntities(mxResources.get(k.dispName,null,k.dispName));break}mxEvent.addListener(C,"click",mxUtils.bind(u,function(){var e=document.createElement("select");d(C,e);for(var g=0;g<m.length;g++){var l=
+m[g],n=document.createElement("option");n.value=mxUtils.htmlEntities(l.val);n.innerHTML=mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));e.appendChild(n)}e.value=b;a.appendChild(e);mxEvent.addListener(e,"change",function(){var a=mxUtils.htmlEntities(e.value);f(c,a,t)});e.focus();mxEvent.addListener(e,"blur",function(){a.removeChild(e)})}))}else"dynamicArr"==y?C.appendChild(g(c,b,t.subType,t.subDefVal,t.countProperty,A,x)):"staticArr"==y?C.appendChild(l(c,b,t.subType,t.subDefVal,t.size,
+A,x)):(C.innerHTML=b,mxEvent.addListener(C,"click",mxUtils.bind(u,function(){function e(){var a=g.value,a=0==a.length&&"string"!=y?0:a;t.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",y="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=t.min&&a<t.min?a=t.min:null!=t.max&&a>t.max&&(a=t.max);a=mxUtils.htmlEntities(("int"==y?parseInt(a):a)+"");f(c,a,t)}var g=document.createElement("input");d(C,g,!0);g.value=b;g.className="gePropEditor";"int"!=y&&"float"!=y||t.allowAuto||(g.type="number",g.step=
+"int"==y?"1":"any",null!=t.min&&(g.min=parseFloat(t.min)),null!=t.max&&(g.max=parseFloat(t.max)));a.appendChild(g);mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&e()});g.focus();mxEvent.addListener(g,"blur",function(){e()})})));t.isDeletable&&(x=mxUtils.button("-",mxUtils.bind(u,function(a){f(c,"",t,t.index);mxEvent.consume(a)})),x.style.height="16px",x.style.width="25px",x.style["float"]="right",x.className="geColorBtn",C.appendChild(x));A.appendChild(C);return A}var u=this,q=this.editorUi.editor.graph,
+x=[];a.style.position="relative";a.style.padding="0";var y=document.createElement("table");y.style.whiteSpace="nowrap";y.style.width="100%";var k=document.createElement("tr");k.className="gePropHeader";var A=document.createElement("th");A.className="gePropHeaderCell";var C=document.createElement("img");C.src=Sidebar.prototype.expandedImage;A.appendChild(C);mxUtils.write(A,mxResources.get("property"));k.style.cursor="pointer";var m=function(){var c=y.querySelectorAll(".gePropNonHeaderRow"),b;if(u.editorUi.propertiesCollapsed){C.src=
+Sidebar.prototype.collapsedImage;b="none";for(var f=a.childNodes.length-1;0<=f;f--)try{var d=a.childNodes[f],e=d.nodeName.toUpperCase();"INPUT"!=e&&"SELECT"!=e||a.removeChild(d)}catch(J){}}else C.src=Sidebar.prototype.expandedImage,b="";for(f=0;f<c.length;f++)c[f].style.display=b};mxEvent.addListener(k,"click",function(){u.editorUi.propertiesCollapsed=!u.editorUi.propertiesCollapsed;m()});k.appendChild(A);A=document.createElement("th");A.className="gePropHeaderCell";A.innerHTML=mxResources.get("value");
+k.appendChild(A);y.appendChild(k);var E=!1,F=!1,p;for(p in c)if(k=c[p],"function"!=typeof k.isVisible||k.isVisible(b)){var v=null!=b.style[p]?mxUtils.htmlEntities(b.style[p]+""):k.defVal;if("separator"==k.type)F=!F;else{if("staticArr"==k.type)k.size=parseInt(b.style[k.sizeProperty]||c[k.sizeProperty].defVal)||0;else if(null!=k.dependentProps){for(var K=k.dependentProps,B=[],z=[],A=0;A<K.length;A++){var I=b.style[K[A]];z.push(c[K[A]].subDefVal);B.push(null!=I?I.split(","):[])}k.dependentPropsDefVal=
+z;k.dependentPropsVals=B}y.appendChild(t(p,v,k,E,F));E=!E}}for(A=0;A<x.length;A++)for(k=x[A],c=k.parentRow,b=0;b<k.values.length;b++)p=t(k.name,k.values[b],{type:k.type,parentRow:k.parentRow,isDeletable:k.isDeletable,index:b,defVal:k.defVal,countProperty:k.countProperty,size:k.size},0==b%2,k.flipBkg),c.parentNode.insertBefore(p,c.nextSibling),c=p;a.appendChild(y);m();return a};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){f.getModel().beginUpdate();
+try{var b=f.getSelectionCells();for(c=0;c<b.length;c++){for(var d=f.getModel().getStyle(b[c]),g=0;g<e.length;g++)d=mxUtils.removeStylename(d,e[g]);var l=f.getModel().isVertex(b[c])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(l,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(l,mxConstants.STYLE_FILLCOLOR,
+null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(l,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(l,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(l,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(l,
+mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(l,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(l,mxConstants.STYLE_FONTCOLOR,null))));f.getModel().setStyle(b[c],d)}}finally{f.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";if(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%)":a.fill==mxConstants.NONE?c.style.background="url('"+Dialog.prototype.noColorImage+"')":c.style.backgroundColor=""==a.fill?mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"):a.fill||mxUtils.getValue(f.defaultVertexStyle,
+mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"),c.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"):"1px solid "+(a.stroke||mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"));else{var b=mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),g=mxUtils.getValue(f.defaultVertexStyle,
+mxConstants.STYLE_STROKECOLOR,"#000000");c.style.backgroundColor=b;c.style.border="1px solid "+g}d.appendChild(c)}d.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(d),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 f=this.editorUi.editor.graph,d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.paddingLeft="24px";d.style.paddingRight="20px";
+a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(d);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()&&
+(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 f=this.editorUi.editor.graph,d=f.view.getState(f.getSelectionCell());1==f.getSelectionCount()&&null!=d&&null!=d.shape&&null!=d.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 k=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;try{if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=document.createEventObject(a),c.type=a.type,c.canBubble=a.canBubble,c.cancelable=a.cancelable,c.view=a.view,c.detail=a.detail,c.screenX=a.screenX,c.screenY=a.screenY,c.clientX=a.clientX,c.clientY=a.clientY,c.ctrlKey=a.ctrlKey,c.altKey=a.altKey,c.shiftKey=a.shiftKey,c.metaKey=a.metaKey,c.button=
-a.button,c.relatedTarget=a.relatedTarget}catch(Q){}}k.apply(this,arguments);window.mxFreehand&&(this.freehand=new mxFreehand(this));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 g=this.layoutManager.getLayout;
+"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var g=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;try{if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=document.createEventObject(a),c.type=a.type,c.canBubble=a.canBubble,c.cancelable=a.cancelable,c.view=a.view,c.detail=a.detail,c.screenX=a.screenX,c.screenY=a.screenY,c.clientX=a.clientX,c.clientY=a.clientY,c.ctrlKey=a.ctrlKey,c.altKey=a.altKey,c.shiftKey=a.shiftKey,c.metaKey=a.metaKey,c.button=
+a.button,c.relatedTarget=a.relatedTarget}catch(O){}}g.apply(this,arguments);window.mxFreehand&&(this.freehand=new mxFreehand(this));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 f=this.layoutManager.getLayout;
this.layoutManager.getLayout=function(a){var c=this.graph.getCellStyle(a);if(null!=c){if("rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.gridSize=null!=c.rackUnitSize?parseFloat(c.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;b.fill=!0;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.allowGaps=c.allowGaps||0;b.resizeParent=!1;return b}if("undefined"!==typeof mxTableLayout&&"tableLayout"==
c.childLayout)return b=new mxTableLayout(this.graph),b.rows=c.tableRows||2,b.columns=c.tableColumns||2,b.colPercentages=c.colPercentages,b.rowPercentages=c.rowPercentages,b.equalColumns="1"==mxUtils.getValue(c,"equalColumns",b.colPercentages?"0":"1"),b.equalRows="1"==mxUtils.getValue(c,"equalRows",b.rowPercentages?"0":"1"),b.resizeParent="1"==mxUtils.getValue(c,"resizeParent","1"),b.border=c.tableBorder||b.border,b.marginLeft=c.marginLeft||0,b.marginRight=c.marginRight||0,b.marginTop=c.marginTop||
-0,b.marginBottom=c.marginBottom||0,b.autoAddCol="1"==mxUtils.getValue(c,"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(c,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=c.colWidths||"100",b.rowHeights=c.rowHeights||"50",b}return g.apply(this,arguments)};this.updateGlobalUrlVariables()};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));
-if(null!=a)for(var c in a)this.globalVars[c]=a[c]}catch(O){null!=window.console&&console.log("Error in vars URL parameter: "+O)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var q=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var c=q.apply(this,arguments);null==c&&null!=this.globalVars&&(c=this.globalVars[a]);return c};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=
-this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var p=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;null!=this.themes&&"darkTheme"==this.defaultThemeName&&(a=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var c=p.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return c};var m=Graph.prototype.isCssTransformsSupported;
-Graph.prototype.isCssTransformsSupported=function(){return m.apply(this,arguments)&&!mxClient.IS_SF};var z=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){z.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||
+0,b.marginBottom=c.marginBottom||0,b.autoAddCol="1"==mxUtils.getValue(c,"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(c,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=c.colWidths||"100",b.rowHeights=c.rowHeights||"50",b}return f.apply(this,arguments)};this.updateGlobalUrlVariables()};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));
+if(null!=a)for(var c in a)this.globalVars[c]=a[c]}catch(K){null!=window.console&&console.log("Error in vars URL parameter: "+K)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var t=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var c=t.apply(this,arguments);null==c&&null!=this.globalVars&&(c=this.globalVars[a]);return c};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=
+this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var n=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;null!=this.themes&&"darkTheme"==this.defaultThemeName&&(a=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var c=n.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return c};var l=Graph.prototype.isCssTransformsSupported;
+Graph.prototype.isCssTransformsSupported=function(){return l.apply(this,arguments)&&!mxClient.IS_SF};var x=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){x.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||
this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",a.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,a.ownerSVGElement))}};
-var D=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){D.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++){var b=a.actions[c];if(null!=b.open)if(this.isCustomLink(b.open)){if(!this.customLinkClicked(b.open))return}else this.openLink(b.open)}this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)b=
-a.actions[c],null!=b.toggle&&this.toggleCells(this.getCellsForAction(b.toggle,!0)),null!=b.show&&this.setCellsVisible(this.getCellsForAction(b.show,!0),!0),null!=b.hide&&this.setCellsVisible(this.getCellsForAction(b.hide,!0),!1)}finally{this.model.endUpdate()}for(c=0;c<a.actions.length;c++){var b=a.actions[c],g=[];null!=b.select&&this.isEnabled()&&(g=this.getCellsForAction(b.select),this.setSelectionCells(g));null!=b.highlight&&(g=this.getCellsForAction(b.highlight),this.highlightCells(g,b.highlight.color,
-b.highlight.duration,b.highlight.opacity));null!=b.scroll&&(g=this.getCellsForAction(b.scroll));0<g.length&&this.scrollCellToVisible(g[0])}}};Graph.prototype.updateCustomLinksForCell=function(a,c){var b=this.getLinkForCell(c);null!=b&&"data:action/json,"==b.substring(0,17)&&this.setLinkForCell(c,this.updateCustomLink(a,b));if(this.isHtmlLabel(c)){var g=document.createElement("div");g.innerHTML=this.getLabel(c);for(var d=g.getElementsByTagName("a"),f=!1,k=0;k<d.length;k++)b=d[k].getAttribute("href"),
-null!=b&&"data:action/json,"==b.substring(0,17)&&(d[k].setAttribute("href",this.updateCustomLink(a,b)),f=!0);f&&this.labelChanged(c,g.innerHTML)}};Graph.prototype.updateCustomLink=function(a,c){if("data:action/json,"==c.substring(0,17))try{var b=JSON.parse(c.substring(17));null!=b.actions&&(this.updateCustomLinkActions(a,b.actions),c="data:action/json,"+JSON.stringify(b))}catch(Z){}return c};Graph.prototype.updateCustomLinkActions=function(a,c){for(var b=0;b<c.length;b++){var g=c[b];this.updateCustomLinkAction(a,
-g.toggle);this.updateCustomLinkAction(a,g.show);this.updateCustomLinkAction(a,g.hide);this.updateCustomLinkAction(a,g.select);this.updateCustomLinkAction(a,g.highlight);this.updateCustomLinkAction(a,g.scroll)}};Graph.prototype.updateCustomLinkAction=function(a,c){if(null!=c&&null!=c.cells){for(var b=[],g=0;g<c.cells.length;g++)if("*"==c.cells[g])b.push(c.cells[g]);else{var d=a[c.cells[g]];null!=d?""!=d&&b.push(d):b.push(c.cells[g])}c.cells=b}};Graph.prototype.getCellsForAction=function(a,c){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags,
-null,null,c))};Graph.prototype.getCellsById=function(a){var c=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var g=this.getDefaultParent(),c=c.concat(this.model.filterDescendants(function(a){return a!=g},g));else{var d=this.model.getCell(a[b]);null!=d&&c.push(d)}return c};Graph.prototype.getCellsForTags=function(a,c,b,g){var d=[];if(null!=a){c=null!=c?c:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var f=0,k={},m=0;m<a.length;m++)0<a[m].length&&(k[a[m].toLowerCase()]=
-!0,f++);for(m=0;m<c.length;m++)if(g&&this.model.getParent(c[m])==this.model.root||this.model.isVertex(c[m])||this.model.isEdge(c[m])){var p=null!=c[m].value&&"object"==typeof c[m].value?mxUtils.trim(c[m].value.getAttribute(b)||""):"",q=!1;if(0<p.length){if(p=p.toLowerCase().split(" "),p.length>=a.length){for(var u=q=0;u<p.length&&q<f;u++)null!=k[p[u]]&&q++;q=q==f}}else q=0==a.length;q&&d.push(c[m])}}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,g){for(var d=0;d<a.length;d++)this.highlightCell(a[d],c,b,g)};Graph.prototype.highlightCell=function(a,c,b,g){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style,
-mxConstants.STYLE_STROKEWIDTH,1)+4),f=new mxCellHighlight(this,c,d,!1);null!=g&&(f.opacity=g);f.highlight(a);window.setTimeout(function(){null!=f.shape&&(mxUtils.setPrefixedStyle(f.shape.node.style,"transition","all 1200ms ease-in-out"),f.shape.node.style.opacity=0);window.setTimeout(function(){f.destroy()},1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;var g=a.ownerDocument,d=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"filter"):g.createElement("filter");
-d.setAttribute("id",this.shadowId);var f=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):g.createElement("feGaussianBlur");f.setAttribute("in","SourceAlpha");f.setAttribute("stdDeviation",this.svgShadowBlur);f.setAttribute("result","blur");d.appendChild(f);f=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feOffset"):g.createElement("feOffset");f.setAttribute("in","blur");f.setAttribute("dx",this.svgShadowSize);f.setAttribute("dy",this.svgShadowSize);f.setAttribute("result",
-"offsetBlur");d.appendChild(f);f=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feFlood"):g.createElement("feFlood");f.setAttribute("flood-color",this.svgShadowColor);f.setAttribute("flood-opacity",this.svgShadowOpacity);f.setAttribute("result","offsetColor");d.appendChild(f);f=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feComposite"):g.createElement("feComposite");f.setAttribute("in","offsetColor");f.setAttribute("in2","offsetBlur");f.setAttribute("operator","in");
-f.setAttribute("result","offsetBlur");d.appendChild(f);f=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"feBlend"):g.createElement("feBlend");f.setAttribute("in","SourceGraphic");f.setAttribute("in2","offsetBlur");d.appendChild(f);f=a.getElementsByTagName("defs");0==f.length?(g=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"defs"):g.createElement("defs"),null!=a.firstChild?a.insertBefore(g,a.firstChild):a.appendChild(g)):g=f[0];g.appendChild(d);b||(c=null!=c?c:a.getElementsByTagName("g")[0],
+var A=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){A.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++){var b=a.actions[c];if(null!=b.open)if(this.isCustomLink(b.open)){if(!this.customLinkClicked(b.open))return}else this.openLink(b.open)}this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)b=
+a.actions[c],null!=b.toggle&&this.toggleCells(this.getCellsForAction(b.toggle,!0)),null!=b.show&&this.setCellsVisible(this.getCellsForAction(b.show,!0),!0),null!=b.hide&&this.setCellsVisible(this.getCellsForAction(b.hide,!0),!1)}finally{this.model.endUpdate()}for(c=0;c<a.actions.length;c++){var b=a.actions[c],f=[];null!=b.select&&this.isEnabled()&&(f=this.getCellsForAction(b.select),this.setSelectionCells(f));null!=b.highlight&&(f=this.getCellsForAction(b.highlight),this.highlightCells(f,b.highlight.color,
+b.highlight.duration,b.highlight.opacity));null!=b.scroll&&(f=this.getCellsForAction(b.scroll));0<f.length&&this.scrollCellToVisible(f[0])}}};Graph.prototype.updateCustomLinksForCell=function(a,c){var b=this.getLinkForCell(c);null!=b&&"data:action/json,"==b.substring(0,17)&&this.setLinkForCell(c,this.updateCustomLink(a,b));if(this.isHtmlLabel(c)){var f=document.createElement("div");f.innerHTML=this.getLabel(c);for(var d=f.getElementsByTagName("a"),e=!1,g=0;g<d.length;g++)b=d[g].getAttribute("href"),
+null!=b&&"data:action/json,"==b.substring(0,17)&&(d[g].setAttribute("href",this.updateCustomLink(a,b)),e=!0);e&&this.labelChanged(c,f.innerHTML)}};Graph.prototype.updateCustomLink=function(a,c){if("data:action/json,"==c.substring(0,17))try{var b=JSON.parse(c.substring(17));null!=b.actions&&(this.updateCustomLinkActions(a,b.actions),c="data:action/json,"+JSON.stringify(b))}catch(Y){}return c};Graph.prototype.updateCustomLinkActions=function(a,c){for(var b=0;b<c.length;b++){var f=c[b];this.updateCustomLinkAction(a,
+f.toggle);this.updateCustomLinkAction(a,f.show);this.updateCustomLinkAction(a,f.hide);this.updateCustomLinkAction(a,f.select);this.updateCustomLinkAction(a,f.highlight);this.updateCustomLinkAction(a,f.scroll)}};Graph.prototype.updateCustomLinkAction=function(a,c){if(null!=c&&null!=c.cells){for(var b=[],f=0;f<c.cells.length;f++)if("*"==c.cells[f])b.push(c.cells[f]);else{var d=a[c.cells[f]];null!=d?""!=d&&b.push(d):b.push(c.cells[f])}c.cells=b}};Graph.prototype.getCellsForAction=function(a,c){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags,
+null,null,c))};Graph.prototype.getCellsById=function(a){var c=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var f=this.getDefaultParent(),c=c.concat(this.model.filterDescendants(function(a){return a!=f},f));else{var d=this.model.getCell(a[b]);null!=d&&c.push(d)}return c};Graph.prototype.getCellsForTags=function(a,c,b,f){var d=[];if(null!=a){c=null!=c?c:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var e=0,g={},l=0;l<a.length;l++)0<a[l].length&&(g[a[l].toLowerCase()]=
+!0,e++);for(l=0;l<c.length;l++)if(f&&this.model.getParent(c[l])==this.model.root||this.model.isVertex(c[l])||this.model.isEdge(c[l])){var n=null!=c[l].value&&"object"==typeof c[l].value?mxUtils.trim(c[l].value.getAttribute(b)||""):"",t=!1;if(0<n.length){if(n=n.toLowerCase().split(" "),n.length>=a.length){for(var q=t=0;q<n.length&&t<e;q++)null!=g[n[q]]&&t++;t=t==e}}else t=0==a.length;t&&d.push(c[l])}}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,f){for(var d=0;d<a.length;d++)this.highlightCell(a[d],c,b,f)};Graph.prototype.highlightCell=function(a,c,b,f){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style,
+mxConstants.STYLE_STROKEWIDTH,1)+4),e=new mxCellHighlight(this,c,d,!1);null!=f&&(e.opacity=f);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 f=a.ownerDocument,d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");
+d.setAttribute("id",this.shadowId);var e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");e.setAttribute("in","SourceAlpha");e.setAttribute("stdDeviation",this.svgShadowBlur);e.setAttribute("result","blur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");e.setAttribute("in","blur");e.setAttribute("dx",this.svgShadowSize);e.setAttribute("dy",this.svgShadowSize);e.setAttribute("result",
+"offsetBlur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");e.setAttribute("flood-color",this.svgShadowColor);e.setAttribute("flood-opacity",this.svgShadowOpacity);e.setAttribute("result","offsetColor");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):f.createElement("feComposite");e.setAttribute("in","offsetColor");e.setAttribute("in2","offsetBlur");e.setAttribute("operator","in");
+e.setAttribute("result","offsetBlur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");e.setAttribute("in","SourceGraphic");e.setAttribute("in2","offsetBlur");d.appendChild(e);e=a.getElementsByTagName("defs");0==e.length?(f=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"defs"):f.createElement("defs"),null!=a.firstChild?a.insertBefore(f,a.firstChild):a.appendChild(f)):f=e[0];f.appendChild(d);b||(c=null!=c?c:a.getElementsByTagName("g")[0],
null!=c&&(c.setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6),c=a.getAttribute("viewBox"),null!=c&&0<c.length&&(c=c.split(" "),3<c.length&&(w=parseFloat(c[2])+6,h=parseFloat(c[3])+6,a.setAttribute("viewBox",c[0]+" "+c[1]+" "+w+" "+h))))));return d};Graph.prototype.setShadowVisible=function(a,c){mxClient.IS_SVG&&(c=null!=c?c:!0,(this.shadowVisible=
a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),c&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var a=this.model.getChildCount(this.model.root),c,b=0;do c=this.model.getChildAt(this.model.root,b);while(b++<a&&"1"==mxUtils.getValue(this.getCellStyle(c),"locked","0"));null!=c&&this.setDefaultParent(c)}};mxStencilRegistry.libraries.mockup=
[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",STENCIL_PATH+"/bpmn.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+
@@ -2934,420 +2934,421 @@ a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this
[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.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.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.aws4=
[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.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 u=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,g,d,f,k,m,p,q){if(null!=b&&null==mxMarker.markers[b]){var z=this.getPackageForType(b);null!=z&&mxStencilRegistry.getStencil(z)}return u.apply(this,arguments)};PrintDialog.prototype.create=
-function(a,c){function b(){l.value=Math.max(1,Math.min(m,Math.max(parseInt(l.value),parseInt(y.value))));y.value=Math.max(1,Math.min(m,Math.min(parseInt(l.value),parseInt(y.value))))}function g(c){function b(c,b,f){var k=c.getGraphBounds(),m=0,p=0,q=ha.get(),u=1/c.pageScale,z=G.checked;if(z)var u=parseInt(N.value),y=parseInt(U.value),u=Math.min(q.height*y/(k.height/c.view.scale),q.width*u/(k.width/c.view.scale));else u=parseInt(n.value)/(100*c.pageScale),isNaN(u)&&(g=1/c.pageScale,n.value="100 %");
-q=mxRectangle.fromRectangle(q);q.width=Math.ceil(q.width*g);q.height=Math.ceil(q.height*g);u*=g;!z&&c.pageVisible?(k=c.getPageLayout(),m-=k.x*q.width,p-=k.y*q.height):z=!0;if(null==b){b=PrintDialog.createPrintPreview(c,u,q,0,m,p,z);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var v=b.writeHead;b.writeHead=function(c){v.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 l=b.renderPage;b.renderPage=function(a,c,b,g,d,f){var k=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var m=l.apply(this,arguments);mxClient.NO_FO=k;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:m.className="geDisableMathJax";return m}}c=null;null!=d.themes&&"darkTheme"==d.defaultThemeName&&(c=d.stylesheet,d.stylesheet=d.getDefaultStylesheet(),d.refresh());b.open(null,null,f,!0);null!=c&&(d.stylesheet=
-c,d.refresh())}else{q=c.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";b.backgroundColor=q;b.autoOrigin=z;b.appendGraph(c,u,m,p,f,!0)}return b}var g=parseInt(ia.value)/100;isNaN(g)&&(g=1,ia.value="100 %");var g=.75*g,f=y.value,k=l.value,m=!u.checked,q=null;m&&(m=f==p&&k==p);if(!m&&null!=a.pages&&a.pages.length){var z=0,m=a.pages.length-1;u.checked||(z=parseInt(f)-1,m=parseInt(k)-1);for(var v=z;v<=m;v++){var D=a.pages[v],f=D==a.currentPage?d:null;if(null==f){var f=a.createTemporaryGraph(d.getStylesheet()),
-k=!0,z=!1,t=null,B=null;null==D.viewState&&null==D.root&&a.updatePageRoot(D);null!=D.viewState&&(k=D.viewState.pageVisible,z=D.viewState.mathEnabled,t=D.viewState.background,B=D.viewState.backgroundImage);f.background=t;f.backgroundImage=null!=B?new mxImage(B.src,B.width,B.height):null;f.pageVisible=k;f.mathEnabled=z;var F=f.getGlobalVariable;f.getGlobalVariable=function(c){return"page"==c?D.getName():"pagenumber"==c?v+1:"pagecount"==c?null!=a.pages?a.pages.length:1:F.apply(this,arguments)};document.body.appendChild(f.container);
-a.updatePageRoot(D);f.model.setRoot(D.root)}q=b(f,q,v!=m);f!=d&&f.container.parentNode.removeChild(f.container)}}else q=b(d);null==q?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(q.mathEnabled&&(m=q.wnd.document,m.writeln('<script type="text/x-mathjax-config">'),m.writeln("MathJax.Hub.Config({"),m.writeln("showMathMenu: false,"),m.writeln('messageStyle: "none",'),m.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),m.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
-m.writeln('"HTML-CSS": {'),m.writeln("imageFont: null"),m.writeln("},"),m.writeln("TeX: {"),m.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),m.writeln("},"),m.writeln("tex2jax: {"),m.writeln('\tignoreClass: "geDisableMathJax"'),m.writeln("},"),m.writeln("asciimath2jax: {"),m.writeln('\tignoreClass: "geDisableMathJax"'),m.writeln("}"),m.writeln("});"),c&&(m.writeln("MathJax.Hub.Queue(function () {"),m.writeln("window.print();"),m.writeln("});")),m.writeln("\x3c/script>"),
-m.writeln('<script type="text/javascript" src="'+DRAW_MATH_URL+'/MathJax.js">\x3c/script>')),q.closeDocument(),!q.mathEnabled&&c&&PrintDialog.printPreview(q))}var d=a.editor.graph,f=document.createElement("div"),k=document.createElement("h3");k.style.width="100%";k.style.textAlign="center";k.style.marginTop="0px";mxUtils.write(k,c||mxResources.get("print"));f.appendChild(k);var m=1,p=1,q=document.createElement("div");q.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");q.appendChild(u);k=document.createElement("span");mxUtils.write(k,mxResources.get("printAllPages"));q.appendChild(k);mxUtils.br(q);var z=u.cloneNode(!0);u.setAttribute("checked","checked");z.setAttribute("value","range");q.appendChild(z);k=document.createElement("span");mxUtils.write(k,mxResources.get("pages")+
-":");q.appendChild(k);var y=document.createElement("input");y.style.cssText="margin:0 8px 0 8px;";y.setAttribute("value","1");y.setAttribute("type","number");y.setAttribute("min","1");y.style.width="50px";q.appendChild(y);k=document.createElement("span");mxUtils.write(k,mxResources.get("to"));q.appendChild(k);var l=y.cloneNode(!0);q.appendChild(l);mxEvent.addListener(y,"focus",function(){z.checked=!0});mxEvent.addListener(l,"focus",function(){z.checked=!0});mxEvent.addListener(y,"change",b);mxEvent.addListener(l,
-"change",b);if(null!=a.pages&&(m=a.pages.length,null!=a.currentPage))for(k=0;k<a.pages.length;k++)if(a.currentPage==a.pages[k]){p=k+1;y.value=p;l.value=p;break}y.setAttribute("max",m);l.setAttribute("max",m);1<m&&f.appendChild(q);var v=document.createElement("div");v.style.marginBottom="10px";var D=document.createElement("input");D.style.marginRight="8px";D.setAttribute("value","adjust");D.setAttribute("type","radio");D.setAttribute("name","printZoom");v.appendChild(D);k=document.createElement("span");
-mxUtils.write(k,mxResources.get("adjustTo"));v.appendChild(k);var n=document.createElement("input");n.style.cssText="margin:0 8px 0 8px;";n.setAttribute("value","100 %");n.style.width="50px";v.appendChild(n);mxEvent.addListener(n,"focus",function(){D.checked=!0});f.appendChild(v);var q=q.cloneNode(!1),G=D.cloneNode(!0);G.setAttribute("value","fit");D.setAttribute("checked","checked");k=document.createElement("div");k.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";
-k.appendChild(G);q.appendChild(k);v=document.createElement("table");v.style.display="inline-block";var t=document.createElement("tbody"),B=document.createElement("tr"),F=B.cloneNode(!0),x=document.createElement("td"),A=x.cloneNode(!0),C=x.cloneNode(!0),M=x.cloneNode(!0),J=x.cloneNode(!0),ea=x.cloneNode(!0);x.style.textAlign="right";M.style.textAlign="right";mxUtils.write(x,mxResources.get("fitTo"));var N=document.createElement("input");N.style.cssText="margin:0 8px 0 8px;";N.setAttribute("value",
-"1");N.setAttribute("min","1");N.setAttribute("type","number");N.style.width="40px";A.appendChild(N);k=document.createElement("span");mxUtils.write(k,mxResources.get("fitToSheetsAcross"));C.appendChild(k);mxUtils.write(M,mxResources.get("fitToBy"));var U=N.cloneNode(!0);J.appendChild(U);mxEvent.addListener(N,"focus",function(){G.checked=!0});mxEvent.addListener(U,"focus",function(){G.checked=!0});k=document.createElement("span");mxUtils.write(k,mxResources.get("fitToSheetsDown"));ea.appendChild(k);
-B.appendChild(x);B.appendChild(A);B.appendChild(C);F.appendChild(M);F.appendChild(J);F.appendChild(ea);t.appendChild(B);t.appendChild(F);v.appendChild(t);q.appendChild(v);f.appendChild(q);q=document.createElement("div");k=document.createElement("div");k.style.fontWeight="bold";k.style.marginBottom="12px";mxUtils.write(k,mxResources.get("paperSize"));q.appendChild(k);k=document.createElement("div");k.style.marginBottom="12px";var ha=PageSetupDialog.addPageFormatPanel(k,"printdialog",a.editor.graph.pageFormat||
-mxConstants.PAGE_FORMAT_A4_PORTRAIT);q.appendChild(k);k=document.createElement("span");mxUtils.write(k,mxResources.get("pageScale"));q.appendChild(k);var ia=document.createElement("input");ia.style.cssText="margin:0 8px 0 8px;";ia.setAttribute("value","100 %");ia.style.width="60px";q.appendChild(ia);f.appendChild(q);k=document.createElement("div");k.style.cssText="text-align:right;margin:48px 0 0 0;";q=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});q.className="geBtn";a.editor.cancelFirst&&
-k.appendChild(q);a.isOffline()||(v=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),v.className="geBtn",k.appendChild(v));PrintDialog.previewEnabled&&(v=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();g(!1)}),v.className="geBtn",k.appendChild(v));v=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();g(!0)});v.className="geBtn gePrimaryBtn";k.appendChild(v);
-a.editor.cancelFirst||k.appendChild(q);f.appendChild(k);this.container=f};var F=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=
+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 q=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,f,d,e,g,l,n,t){if(null!=b&&null==mxMarker.markers[b]){var x=this.getPackageForType(b);null!=x&&mxStencilRegistry.getStencil(x)}return q.apply(this,arguments)};PrintDialog.prototype.create=
+function(a,c){function b(){y.value=Math.max(1,Math.min(l,Math.max(parseInt(y.value),parseInt(k.value))));k.value=Math.max(1,Math.min(l,Math.min(parseInt(y.value),parseInt(k.value))))}function f(c){function b(c,b,e){var g=c.getGraphBounds(),l=0,n=0,t=ha.get(),q=1/c.pageScale,x=E.checked;if(x)var q=parseInt(N.value),k=parseInt(T.value),q=Math.min(t.height*k/(g.height/c.view.scale),t.width*q/(g.width/c.view.scale));else q=parseInt(m.value)/(100*c.pageScale),isNaN(q)&&(f=1/c.pageScale,m.value="100 %");
+t=mxRectangle.fromRectangle(t);t.width=Math.ceil(t.width*f);t.height=Math.ceil(t.height*f);q*=f;!x&&c.pageVisible?(g=c.getPageLayout(),l-=g.x*t.width,n-=g.y*t.height):x=!0;if(null==b){b=PrintDialog.createPrintPreview(c,q,t,0,l,n,x);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var u=b.writeHead;b.writeHead=function(c){u.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 y=b.renderPage;b.renderPage=function(a,c,b,f,d,e){var g=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var l=y.apply(this,arguments);mxClient.NO_FO=g;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:l.className="geDisableMathJax";return l}}c=null;null!=d.themes&&"darkTheme"==d.defaultThemeName&&(c=d.stylesheet,d.stylesheet=d.getDefaultStylesheet(),d.refresh());b.open(null,null,e,!0);null!=c&&(d.stylesheet=
+c,d.refresh())}else{t=c.background;if(null==t||""==t||t==mxConstants.NONE)t="#ffffff";b.backgroundColor=t;b.autoOrigin=x;b.appendGraph(c,q,l,n,e,!0)}return b}var f=parseInt(ia.value)/100;isNaN(f)&&(f=1,ia.value="100 %");var f=.75*f,e=k.value,g=y.value,l=!q.checked,t=null;l&&(l=e==n&&g==n);if(!l&&null!=a.pages&&a.pages.length){var x=0,l=a.pages.length-1;q.checked||(x=parseInt(e)-1,l=parseInt(g)-1);for(var u=x;u<=l;u++){var A=a.pages[u],e=A==a.currentPage?d:null;if(null==e){var e=a.createTemporaryGraph(d.getStylesheet()),
+g=!0,x=!1,p=null,F=null;null==A.viewState&&null==A.root&&a.updatePageRoot(A);null!=A.viewState&&(g=A.viewState.pageVisible,x=A.viewState.mathEnabled,p=A.viewState.background,F=A.viewState.backgroundImage);e.background=p;e.backgroundImage=null!=F?new mxImage(F.src,F.width,F.height):null;e.pageVisible=g;e.mathEnabled=x;var D=e.getGlobalVariable;e.getGlobalVariable=function(c){return"page"==c?A.getName():"pagenumber"==c?u+1:"pagecount"==c?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(e.container);
+a.updatePageRoot(A);e.model.setRoot(A.root)}t=b(e,t,u!=l);e!=d&&e.container.parentNode.removeChild(e.container)}}else t=b(d);null==t?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(l=t.wnd.document,l.writeln('<script type="text/x-mathjax-config">'),l.writeln("MathJax.Hub.Config({"),l.writeln("showMathMenu: false,"),l.writeln('messageStyle: "none",'),l.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),l.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
+l.writeln('"HTML-CSS": {'),l.writeln("imageFont: null"),l.writeln("},"),l.writeln("TeX: {"),l.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),l.writeln("},"),l.writeln("tex2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("},"),l.writeln("asciimath2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("}"),l.writeln("});"),c&&(l.writeln("MathJax.Hub.Queue(function () {"),l.writeln("window.print();"),l.writeln("});")),l.writeln("\x3c/script>"),
+l.writeln('<script type="text/javascript" src="'+DRAW_MATH_URL+'/MathJax.js">\x3c/script>')),t.closeDocument(),!t.mathEnabled&&c&&PrintDialog.printPreview(t))}var d=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 l=1,n=1,t=document.createElement("div");t.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";
+var q=document.createElement("input");q.style.cssText="margin-right:8px;margin-bottom:8px;";q.setAttribute("value","all");q.setAttribute("type","radio");q.setAttribute("name","pages-printdialog");t.appendChild(q);g=document.createElement("span");mxUtils.write(g,mxResources.get("printAllPages"));t.appendChild(g);mxUtils.br(t);var x=q.cloneNode(!0);q.setAttribute("checked","checked");x.setAttribute("value","range");t.appendChild(x);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+
+":");t.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";t.appendChild(k);g=document.createElement("span");mxUtils.write(g,mxResources.get("to"));t.appendChild(g);var y=k.cloneNode(!0);t.appendChild(y);mxEvent.addListener(k,"focus",function(){x.checked=!0});mxEvent.addListener(y,"focus",function(){x.checked=!0});mxEvent.addListener(k,"change",b);mxEvent.addListener(y,
+"change",b);if(null!=a.pages&&(l=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){n=g+1;k.value=n;y.value=n;break}k.setAttribute("max",l);y.setAttribute("max",l);1<l&&e.appendChild(t);var u=document.createElement("div");u.style.marginBottom="10px";var A=document.createElement("input");A.style.marginRight="8px";A.setAttribute("value","adjust");A.setAttribute("type","radio");A.setAttribute("name","printZoom");u.appendChild(A);g=document.createElement("span");
+mxUtils.write(g,mxResources.get("adjustTo"));u.appendChild(g);var m=document.createElement("input");m.style.cssText="margin:0 8px 0 8px;";m.setAttribute("value","100 %");m.style.width="50px";u.appendChild(m);mxEvent.addListener(m,"focus",function(){A.checked=!0});e.appendChild(u);var t=t.cloneNode(!1),E=A.cloneNode(!0);E.setAttribute("value","fit");A.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";
+g.appendChild(E);t.appendChild(g);u=document.createElement("table");u.style.display="inline-block";var F=document.createElement("tbody"),p=document.createElement("tr"),C=p.cloneNode(!0),v=document.createElement("td"),B=v.cloneNode(!0),z=v.cloneNode(!0),M=v.cloneNode(!0),I=v.cloneNode(!0),ea=v.cloneNode(!0);v.style.textAlign="right";M.style.textAlign="right";mxUtils.write(v,mxResources.get("fitTo"));var N=document.createElement("input");N.style.cssText="margin:0 8px 0 8px;";N.setAttribute("value",
+"1");N.setAttribute("min","1");N.setAttribute("type","number");N.style.width="40px";B.appendChild(N);g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsAcross"));z.appendChild(g);mxUtils.write(M,mxResources.get("fitToBy"));var T=N.cloneNode(!0);I.appendChild(T);mxEvent.addListener(N,"focus",function(){E.checked=!0});mxEvent.addListener(T,"focus",function(){E.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));ea.appendChild(g);
+p.appendChild(v);p.appendChild(B);p.appendChild(z);C.appendChild(M);C.appendChild(I);C.appendChild(ea);F.appendChild(p);F.appendChild(C);u.appendChild(F);t.appendChild(u);e.appendChild(t);t=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom="12px";mxUtils.write(g,mxResources.get("paperSize"));t.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var ha=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||
+mxConstants.PAGE_FORMAT_A4_PORTRAIT);t.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));t.appendChild(g);var ia=document.createElement("input");ia.style.cssText="margin:0 8px 0 8px;";ia.setAttribute("value","100 %");ia.style.width="60px";t.appendChild(ia);e.appendChild(t);g=document.createElement("div");g.style.cssText="text-align:right;margin:48px 0 0 0;";t=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});t.className="geBtn";a.editor.cancelFirst&&
+g.appendChild(t);a.isOffline()||(u=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),u.className="geBtn",g.appendChild(u));PrintDialog.previewEnabled&&(u=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),u.className="geBtn",g.appendChild(u));u=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});u.className="geBtn gePrimaryBtn";g.appendChild(u);
+a.editor.cancelFirst||g.appendChild(t);e.appendChild(g);this.container=e};var F=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)):(F.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))};Editor.prototype.useCanvasForExport=!1;try{var y=
-document.createElement("canvas"),G=new Image;G.onload=function(){try{y.getContext("2d").drawImage(G,0,0);var a=y.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(B){}};G.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(v){}})();
-(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,f,d){d.ui=a.ui;return f};a.afterDecode=function(a,f,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="@DRAWIO-VERSION@";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";
-EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";Editor.cacheTimeout=1E4;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.logError=function(a,b,d,f,p){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,
-d,f,p);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var c=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",g=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";p=null!=p?p:Error(a);(new Image).src=g+"/log?severity="+c+"&v="+encodeURIComponent(EditorUi.VERSION)+
-"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(d)+(null!=f?":colno:"+encodeURIComponent(f):"")+(null!=p&&null!=p.stack?"&stack="+encodeURIComponent(p.stack):"")}}catch(D){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else 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(k){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var a=
-[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);console.log.apply(console,a)}}catch(k){}};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=f;f+=c;return a.substring(b,f)}function g(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var f=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=g(a);var k=c(a,4);if(null!=b&&
-b(f-8,k,d))break;value=c(a,d);c(a,4);if("IEND"==k)break}while(d)}};EditorUi.removeChildNodes=function(a){for(;null!=a.firstChild;)a.removeChild(a.firstChild)};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.sidebarFooterHeight=38;EditorUi.prototype.defaultCustomShapeStyle=
+document.createElement("canvas"),E=new Image;E.onload=function(){try{y.getContext("2d").drawImage(E,0,0);var a=y.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(C){}};E.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(u){}})();
+(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,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="@DRAWIO-VERSION@";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";
+EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";Editor.cacheTimeout=1E4;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.logError=function(a,b,d,e,n){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,
+d,e,n);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var c=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";n=null!=n?n:Error(a);(new Image).src=f+"/log?severity="+c+"&v="+encodeURIComponent(EditorUi.VERSION)+
+"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(d)+(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=n&&null!=n.stack?"&stack="+encodeURIComponent(n.stack):"")}}catch(A){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else 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.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(g){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var a=
+[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);console.log.apply(console,a)}}catch(g){}};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.removeChildNodes=function(a){for(;null!=a.firstChild;)a.removeChild(a.firstChild)};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.sidebarFooterHeight=38;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.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=
-!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(p){}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(m){}};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(p){}try{b=
-document.createElement("canvas");b.width=b.height=1;var f=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==f.match("image/jpeg")}catch(p){}})();EditorUi.prototype.openLink=function(a,b,d){return this.editor.graph.openLink(a,b,d)};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);null!=d&&d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);
+!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(n){}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(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(n){}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(n){}})();EditorUi.prototype.openLink=function(a,b,d){return this.editor.graph.openLink(a,b,d)};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);null!=d&&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(a){return this.isOfflineApp()||
-!navigator.onLine||!a&&"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}),g=c.spin;c.spin=function(d,f){var k=!1;this.active||(g.call(this,d),this.active=!0,null!=f&&(k=document.createElement("div"),k.style.position="absolute",k.style.whiteSpace="nowrap",k.style.background="#4B4243",
-k.style.color="white",k.style.fontFamily="Helvetica, Arial",k.style.fontSize="9pt",k.style.padding="6px",k.style.paddingLeft="10px",k.style.paddingRight="10px",k.style.zIndex=2E9,k.style.left=Math.max(0,a)+"px",k.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(k.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(k.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(k.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=f.substring(f.length-3,f.length)&&"!"!=
-f.charAt(f.length-1)&&(f+="..."),k.innerHTML=f,d.appendChild(k),c.status=k,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(k.style.left=Math.round(Math.max(0,a-k.offsetWidth/2))+"px",k.style.top=Math.round(Math.max(0,b+70-k.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,f)}));this.stop();return a}),k=!0);return k};var f=c.stop;c.stop=function(){f.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.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(q){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&&
+!navigator.onLine||!a&&"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"),"..."!=e.substring(e.length-3,e.length)&&"!"!=
+e.charAt(e.length-1)&&(e+="..."),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.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(t){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&&
177==a.charCodeAt(5)&&26==a.charCodeAt(6)&&225==a.charCodeAt(7)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&4==a.charCodeAt(3)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&6==a.charCodeAt(3)};EditorUi.prototype.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};var a=EditorUi.prototype.extractGraphModelFromHtml;
-EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("&lt;mxfile ");if(0<=d){var f=c.lastIndexOf("&lt;/mxfile&gt;");f>d&&(b=c.substring(d,f+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var p=mxUtils.parseXml(c),m=this.editor.extractGraphModel(p.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=m?mxUtils.getXml(m):""}catch(z){}return b};EditorUi.prototype.validateFileData=
+EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("&lt;mxfile ");if(0<=d){var e=c.lastIndexOf("&lt;/mxfile&gt;");e>d&&(b=c.substring(d,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var n=mxUtils.parseXml(c),l=this.editor.extractGraphModel(n.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=l?mxUtils.getXml(l):""}catch(x){}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));a=Graph.zapGremlins(a)}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 f=d.length-1;0<=f;f--){var m=this.updatePageRoot(new DiagramPage(d[f]));null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[f+1]));c.model.execute(new ChangePage(this,m,0==f?m: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(f=0;f<b.length;f++)c.model.execute(new ChangePage(this,b[f],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,f,p,m,z,l,u,n,y){b=null!=b?b:this.editor.graph;p=null!=p?p:!1;u=null!=u?u:!0;var c,g=null;null==
-d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":g=c=f;if(null==a)return"";var k=a;if("mxfile"!=k.nodeName.toLowerCase()){if(y){var q=a.ownerDocument.createElement("diagram");q.setAttribute("id",Editor.guid());q.appendChild(a)}else{q=Graph.zapGremlins(mxUtils.getXml(a));k=Graph.compress(q);if(Graph.decompress(k)!=q)return q;q=a.ownerDocument.createElement("diagram");q.setAttribute("id",Editor.guid());mxUtils.setTextContent(q,k)}k=a.ownerDocument.createElement("mxfile");k.appendChild(q)}n?
-(k=k.cloneNode(!0),k.removeAttribute("modified"),k.removeAttribute("host"),k.removeAttribute("agent"),k.removeAttribute("etag"),k.removeAttribute("userAgent"),k.removeAttribute("version"),k.removeAttribute("editor"),k.removeAttribute("type")):(k.removeAttribute("userAgent"),k.removeAttribute("version"),k.removeAttribute("editor"),k.removeAttribute("pages"),k.removeAttribute("type"),mxClient.IS_CHROMEAPP?k.setAttribute("host","Chrome"):EditorUi.isElectronApp?k.setAttribute("host","Electron"):k.setAttribute("host",
-window.location.hostname),k.setAttribute("modified",(new Date).toISOString()),k.setAttribute("agent",navigator.userAgent),k.setAttribute("version",EditorUi.VERSION),k.setAttribute("etag",Editor.guid()),a=null!=d?d.getMode():this.mode,null!=a&&k.setAttribute("type",a),null!=this.pages&&k.setAttribute("pages",this.pages.length));y=y?mxUtils.getPrettyXml(k):mxUtils.getXml(k);if(!m&&!p&&(z||null!=d&&/(\.html)$/i.test(d.getTitle())))y=this.getHtml2(mxUtils.getXml(k),b,null!=d?d.getTitle():null,c,g);else if(m||
-!p&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(f=null),y=this.getEmbeddedSvg(y,b,f,null,l,u,g);return y};EditorUi.prototype.getXmlFileData=function(a,b,d){a=null!=a?a:!0;b=null!=b?b:!1;d=null!=d?d:!Editor.compressXml;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(d?(EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(c)):(c=Graph.compressNode(c),mxUtils.setTextContent(this.currentPage.node,
+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,n,l,x,k,q,m,y){b=null!=b?b:this.editor.graph;n=null!=n?n:!1;q=null!=q?q:!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()){if(y){var t=a.ownerDocument.createElement("diagram");t.setAttribute("id",Editor.guid());t.appendChild(a)}else{t=Graph.zapGremlins(mxUtils.getXml(a));g=Graph.compress(t);if(Graph.decompress(g)!=t)return t;t=a.ownerDocument.createElement("diagram");t.setAttribute("id",Editor.guid());mxUtils.setTextContent(t,g)}g=a.ownerDocument.createElement("mxfile");g.appendChild(t)}m?
+(g=g.cloneNode(!0),g.removeAttribute("modified"),g.removeAttribute("host"),g.removeAttribute("agent"),g.removeAttribute("etag"),g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type")):(g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("pages"),g.removeAttribute("type"),mxClient.IS_CHROMEAPP?g.setAttribute("host","Chrome"):EditorUi.isElectronApp?g.setAttribute("host","Electron"):g.setAttribute("host",
+window.location.hostname),g.setAttribute("modified",(new Date).toISOString()),g.setAttribute("agent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("etag",Editor.guid()),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a),null!=this.pages&&g.setAttribute("pages",this.pages.length));y=y?mxUtils.getPrettyXml(g):mxUtils.getXml(g);if(!l&&!n&&(x||null!=d&&/(\.html)$/i.test(d.getTitle())))y=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(l||
+!n&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(e=null),y=this.getEmbeddedSvg(y,b,e,null,k,q,f);return y};EditorUi.prototype.getXmlFileData=function(a,b,d){a=null!=a?a:!0;b=null!=b?b:!1;d=null!=d?d:!Editor.compressXml;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(d?(EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(c)):(c=Graph.compressNode(c),mxUtils.setTextContent(this.currentPage.node,
c)),c=this.fileNode.cloneNode(!1),b)c.appendChild(this.currentPage.node);else for(b=0;b<this.pages.length;b++)this.currentPage!=this.pages[b]&&(this.pages[b].needsUpdate?(a=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[b].root)),this.editor.graph.saveViewState(this.pages[b].viewState,a),d?(EditorUi.removeChildNodes(this.pages[b].node),this.pages[b].node.appendChild(a)):mxUtils.setTextContent(this.pages[b].node,Graph.compressNode(a)),delete this.pages[b].needsUpdate):
-d&&(a=Editor.parseDiagramNode(this.pages[b].node),EditorUi.removeChildNodes(this.pages[b].node),this.pages[b].node.appendChild(a))),c.appendChild(this.pages[b].node);return c};EditorUi.prototype.anonymizeString=function(a,b){for(var c=[],g=0;g<a.length;g++){var d=a.charAt(g);0<=EditorUi.ignoredAnonymizedChars.indexOf(d)?c.push(d):isNaN(parseInt(d))?d.toLowerCase()!=d?c.push(String.fromCharCode(65+Math.round(25*Math.random()))):d.toUpperCase()!=d?c.push(String.fromCharCode(97+Math.round(25*Math.random()))):
-/\s/.test(d)?c.push(" "):c.push("?"):c.push(b?"0":Math.round(9*Math.random()))}return c.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var c=0;c<a[EditorUi.DIFF_INSERT].length;c++)try{var b=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][c].data).documentElement.cloneNode(!1);null!=b.getAttribute("name")&&b.setAttribute("name",this.anonymizeString(b.getAttribute("name")));a[EditorUi.DIFF_INSERT][c].data=mxUtils.getXml(b)}catch(m){a[EditorUi.DIFF_INSERT][c].data=
-m.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var d in a[EditorUi.DIFF_UPDATE]){var f=a[EditorUi.DIFF_UPDATE][d];null!=f.name&&(f.name=this.anonymizeString(f.name));null!=f.cells&&(c=mxUtils.bind(this,function(a){var c=f.cells[a];if(null!=c){for(var b in c)null!=c[b].value&&(c[b].value="["+c[b].value.length+"]"),null!=c[b].xmlValue&&(c[b].xmlValue="["+c[b].xmlValue.length+"]"),null!=c[b].style&&(c[b].style="["+c[b].style.length+"]"),0==Object.keys(c[b]).length&&delete c[b];0==Object.keys(c).length&&
-delete f.cells[a]}}),c(EditorUi.DIFF_INSERT),c(EditorUi.DIFF_UPDATE),0==Object.keys(f.cells).length&&delete f.cells);0==Object.keys(f).length&&delete a[EditorUi.DIFF_UPDATE][d]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var c=0;c<a.attributes.length;c++)"as"!=a.attributes[c].name&&a.setAttribute(a.attributes[c].name,this.anonymizeString(a.attributes[c].value,b));if(null!=a.childNodes)for(c=
-0;c<a.childNodes.length;c++)this.anonymizeAttributes(a.childNodes[c],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var c=a.getElementsByTagName("mxCell"),g=0;g<c.length;g++)null!=c[g].getAttribute("value")&&c[g].setAttribute("value","["+c[g].getAttribute("value").length+"]"),null!=c[g].getAttribute("xmlValue")&&c[g].setAttribute("xmlValue","["+c[g].getAttribute("xmlValue").length+"]"),null!=c[g].getAttribute("style")&&c[g].setAttribute("style","["+c[g].getAttribute("style").length+"]"),null!=
-c[g].parentNode&&"root"!=c[g].parentNode.nodeName&&null!=c[g].parentNode.parentNode&&(c[g].setAttribute("id",c[g].parentNode.getAttribute("id")),c[g].parentNode.parentNode.replaceChild(c[g],c[g].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var c=this.getCurrentFile();null!=c&&(c.savingFile?this.handleError({message:mxResources.get("busy")}):!a&&c.invalidChecksum?c.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(c.clearAutosave(),
-this.editor.setStatus(""),a?c.reloadFile(mxUtils.bind(this,function(){c.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){c.handleFileError(a,!0)})):c.synchronizeFile(mxUtils.bind(this,function(){c.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){c.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=function(a,b,d,f,p,m,z,l,u,n){p=null!=p?p:!0;m=null!=m?m:!1;var c=this.editor.graph;if(b||!a&&null!=u&&/(\.svg)$/i.test(u.getTitle()))if(n=
-!1,null!=this.pages&&this.currentPage!=this.pages[0]){var g=c.getGlobalVariable,c=this.createTemporaryGraph(c.getStylesheet()),k=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(k.root)}z=null!=z?z:this.getXmlFileData(p,m,n);u=null!=u?u:this.getCurrentFile();a=this.createFileData(z,c,u,window.location.href,a,b,d,f,p,l,n);c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);
-return a};EditorUi.prototype.getHtml=function(a,b,d,f,p,m){m=null!=m?m:!0;var c=null,g=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var c=m?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),k=b.view.scale;m=Math.floor(c.x/k-b.view.translate.x);k=Math.floor(c.y/k-b.view.translate.y);c=b.background;null==p&&(b=this.getBasenames().join(";"),0<b.length&&(g=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",m);a.setAttribute("y0",k)}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!=f&&a.setAttribute("edit",f));null!=p&&(p=p.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";f=Graph.compress(a);Graph.decompress(f)!=a&&(f=encodeURIComponent(a));return(null==p?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=p?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+
-(null==p?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=p?'<meta http-equiv="refresh" content="0;URL=\''+p+"'\"/>\n":"")+"</head>\n<body"+(null==p&&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;">'+f+"</div>\n</div>\n"+(null==p?'<script type="text/javascript" src="'+g+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+
-p+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,f,p){b=EditorUi.drawHost+"/js/viewer.min.js";null!=p&&(p=p.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==p?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
-"")+"<!DOCTYPE html>\n<html"+(null!=p?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==p?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=p?'<meta http-equiv="refresh" content="0;URL=\''+p+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==p?'<script type="text/javascript" src="'+
-b+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+p+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/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;a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=Editor.extractParserError(a,mxResources.get("invalidOrMissingFile"));if(c)throw Error(c);
+d&&(a=Editor.parseDiagramNode(this.pages[b].node),EditorUi.removeChildNodes(this.pages[b].node),this.pages[b].node.appendChild(a))),c.appendChild(this.pages[b].node);return c};EditorUi.prototype.anonymizeString=function(a,b){for(var c=[],f=0;f<a.length;f++){var d=a.charAt(f);0<=EditorUi.ignoredAnonymizedChars.indexOf(d)?c.push(d):isNaN(parseInt(d))?d.toLowerCase()!=d?c.push(String.fromCharCode(65+Math.round(25*Math.random()))):d.toUpperCase()!=d?c.push(String.fromCharCode(97+Math.round(25*Math.random()))):
+/\s/.test(d)?c.push(" "):c.push("?"):c.push(b?"0":Math.round(9*Math.random()))}return c.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var c=0;c<a[EditorUi.DIFF_INSERT].length;c++)try{var b=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][c].data).documentElement.cloneNode(!1);null!=b.getAttribute("name")&&b.setAttribute("name",this.anonymizeString(b.getAttribute("name")));a[EditorUi.DIFF_INSERT][c].data=mxUtils.getXml(b)}catch(l){a[EditorUi.DIFF_INSERT][c].data=
+l.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var d in a[EditorUi.DIFF_UPDATE]){var e=a[EditorUi.DIFF_UPDATE][d];null!=e.name&&(e.name=this.anonymizeString(e.name));null!=e.cells&&(c=mxUtils.bind(this,function(a){var c=e.cells[a];if(null!=c){for(var b in c)null!=c[b].value&&(c[b].value="["+c[b].value.length+"]"),null!=c[b].xmlValue&&(c[b].xmlValue="["+c[b].xmlValue.length+"]"),null!=c[b].style&&(c[b].style="["+c[b].style.length+"]"),0==Object.keys(c[b]).length&&delete c[b];0==Object.keys(c).length&&
+delete e.cells[a]}}),c(EditorUi.DIFF_INSERT),c(EditorUi.DIFF_UPDATE),0==Object.keys(e.cells).length&&delete e.cells);0==Object.keys(e).length&&delete a[EditorUi.DIFF_UPDATE][d]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var c=0;c<a.attributes.length;c++)"as"!=a.attributes[c].name&&a.setAttribute(a.attributes[c].name,this.anonymizeString(a.attributes[c].value,b));if(null!=a.childNodes)for(c=
+0;c<a.childNodes.length;c++)this.anonymizeAttributes(a.childNodes[c],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var c=a.getElementsByTagName("mxCell"),f=0;f<c.length;f++)null!=c[f].getAttribute("value")&&c[f].setAttribute("value","["+c[f].getAttribute("value").length+"]"),null!=c[f].getAttribute("xmlValue")&&c[f].setAttribute("xmlValue","["+c[f].getAttribute("xmlValue").length+"]"),null!=c[f].getAttribute("style")&&c[f].setAttribute("style","["+c[f].getAttribute("style").length+"]"),null!=
+c[f].parentNode&&"root"!=c[f].parentNode.nodeName&&null!=c[f].parentNode.parentNode&&(c[f].setAttribute("id",c[f].parentNode.getAttribute("id")),c[f].parentNode.parentNode.replaceChild(c[f],c[f].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var c=this.getCurrentFile();null!=c&&(c.savingFile?this.handleError({message:mxResources.get("busy")}):!a&&c.invalidChecksum?c.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(c.clearAutosave(),
+this.editor.setStatus(""),a?c.reloadFile(mxUtils.bind(this,function(){c.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){c.handleFileError(a,!0)})):c.synchronizeFile(mxUtils.bind(this,function(){c.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){c.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=function(a,b,d,e,n,l,x,k,q,m){n=null!=n?n:!0;l=null!=l?l:!1;var c=this.editor.graph;if(b||!a&&null!=q&&/(\.svg)$/i.test(q.getTitle()))if(m=
+!1,null!=this.pages&&this.currentPage!=this.pages[0]){var f=c.getGlobalVariable,c=this.createTemporaryGraph(c.getStylesheet()),g=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(g.root)}x=null!=x?x:this.getXmlFileData(n,l,m);q=null!=q?q:this.getCurrentFile();a=this.createFileData(x,c,q,window.location.href,a,b,d,e,n,k,m);c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);
+return a};EditorUi.prototype.getHtml=function(a,b,d,e,n,l){l=null!=l?l:!0;var c=null,f=EditorUi.drawHost+"/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==n&&(b=this.getBasenames().join(";"),0<b.length&&(f=EditorUi.drawHost+"/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!=n&&(n=n.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";e=Graph.compress(a);Graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+
+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+"</head>\n<body"+(null==n&&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==n?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+
+n+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,e,n){b=EditorUi.drawHost+"/js/viewer.min.js";null!=n&&(n=n.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==n?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
+"")+"<!DOCTYPE html>\n<html"+(null!=n?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==n?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=n?'<meta http-equiv="refresh" content="0;URL=\''+n+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==n?'<script type="text/javascript" src="'+
+b+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+n+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/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;a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=Editor.extractParserError(a,mxResources.get("invalidOrMissingFile"));if(c)throw Error(c);
c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a&&"mxfile"==a.nodeName&&(c=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<c.length||1==c.length&&c[0].hasAttribute("name"))){var b=null;this.fileNode=a;this.pages=[];for(a=0;a<c.length;a++){null==c[a].getAttribute("id")&&c[a].setAttribute("id",a);var d=new DiagramPage(c[a]);null==d.getName()&&d.setName(mxResources.get("pageWithNumber",[a+1]));this.pages.push(d);null!=urlParams["page-id"]&&d.getId()==urlParams["page-id"]&&
(b=d)}this.currentPage=null!=b?b:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);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)||/(\.drawio)$/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,f,p,m,z,l,u,n){try{f=null!=f?f:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!p),g=c+"."+a;if("xml"==a){var k='<?xml version="1.0" encoding="UTF-8"?>\n'+this.getFileData(!0,null,null,null,f,p,null,null,null,b);this.saveData(g,a,k,"text/xml")}else if("html"==a)k=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(g,a,k,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?g=c+".png":"jpeg"==
-a&&(g=c+".jpg"),this.saveRequest(g,a,mxUtils.bind(this,function(c,b){try{var g=this.editor.graph.pageVisible;null!=m&&(this.editor.graph.pageVisible=m);var d=this.createDownloadRequest(c,a,f,b,z,p,l,u,n);this.editor.graph.pageVisible=g;return d}catch(T){this.handleError(T)}}));else{var q=null,D=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(q)}))});
-if("svg"==a){var t=this.editor.graph.background;if(z||t==mxConstants.NONE)t=null;var F=this.editor.graph.getSvg(t,null,null,null,null,f);d&&this.editor.graph.addSvgShadow(F);this.convertImages(F,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();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 g=c+".svg",q=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();
-D(a)}),f)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,f,p,m,z,l,u){var c=this.editor.graph,g=c.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==m?!1:"xmlpng"!=b);var k="",q="";if(g.width*g.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};g="0";"pdf"==b&&0==m&&(q="&allPages=1");if("xmlpng"==b&&(g="1",b="png",null!=this.pages&&null!=this.currentPage))for(m=0;m<this.pages.length;m++)if(this.pages[m]==this.currentPage){k=
-"&from="+m;break}m=c.background;"png"==b&&p?m=mxConstants.NONE:p||null!=m&&m!=mxConstants.NONE||(m="#ffffff");p={globalVars:c.getExportVariables()};u&&(p.grid={size:c.gridSize,steps:c.view.gridSteps,color:c.view.gridColor});return new mxXmlRequest(EXPORT_URL,"format="+b+k+q+"&bg="+(null!=m?m:mxConstants.NONE)+"&base64="+f+"&embedXml="+g+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(p))+(null!=z?"&scale="+z:"")+(null!=l?"&border="+
-l:""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,d){var c=window.location.hash,g=mxUtils.bind(this,function(g){var d=null!=a.data?a.data:"";null!=g&&0<g.length&&(0<d.length&&(d+="\n"),d+=g);g=new LocalFile(this,"csv"!=a.format&&0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);g.getHash=function(){return c};this.fileLoaded(g);"csv"==a.format&&this.importCsv(d,mxUtils.bind(this,
-function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var f=null!=a.interval?parseInt(a.interval):6E4,k=null,m=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()),p()):this.handleError({message:mxResources.get("error")+
-" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),p=mxUtils.bind(this,function(){window.clearTimeout(k);k=window.setTimeout(m,f)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){p();m()}));p();m()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var f=a.url;/^https?:\/\//.test(f)&&!this.editor.isCorsEnabledForUrl(f)&&(f=PROXY_URL+"?url="+encodeURIComponent(f));this.loadUrl(f,mxUtils.bind(this,function(a){g(a)}),mxUtils.bind(this,function(a){null!=d&&
-d(a)}))}else g("")};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||f.warningImage,a.tooltip,a.align,a.valign,a.offset);c.addListener(mxEvent.CLICK,function(c,b){d.alert(a.tooltip)});return c}var b=null,d=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var f=this.editor.graph,m=f.getModel();m.beginUpdate();var z=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var l=m.getCell(a.getAttribute("id"));
-if(null!=l){try{var u=a.getAttribute("value");if(null!=u){var n=mxUtils.parseXml(u).documentElement;if(null!=n)if("1"==n.getAttribute("replace-value"))m.setValue(l,n);else for(var y=n.attributes,t=0;t<y.length;t++)f.setAttributeForCell(l,y[t].nodeName,0<y[t].nodeValue.length?y[t].nodeValue:null)}}catch(L){null!=window.console&&console.log("Error in value for "+l.id+": "+L)}try{var v=a.getAttribute("style");null!=v&&f.model.setStyle(l,v)}catch(L){null!=window.console&&console.log("Error in style for "+
-l.id+": "+L)}try{var B=a.getAttribute("icon");if(null!=B){var x=0<B.length?JSON.parse(B):null;null!=x&&x.append||f.removeCellOverlays(l);null!=x&&f.addCellOverlay(l,c(x))}}catch(L){null!=window.console&&console.log("Error in icon for "+l.id+": "+L)}try{var A=a.getAttribute("geometry");if(null!=A){var A=JSON.parse(A),I=f.getCellGeometry(l);if(null!=I){I=I.clone();for(key in A){var C=parseFloat(A[key]);"dx"==key?I.x+=C:"dy"==key?I.y+=C:"dw"==key?I.width+=C:"dh"==key?I.height+=C:I[key]=parseFloat(A[key])}f.model.setGeometry(l,
-I)}}}catch(L){null!=window.console&&console.log("Error in icon for "+l.id+": "+L)}}}else if("model"==a.nodeName){for(var E=a.firstChild;null!=E&&E.nodeType!=mxConstants.NODETYPE_ELEMENT;)E=E.nextSibling;null!=E&&(new mxCodec(a.firstChild)).decode(E,m)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(f.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))f.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==
-a.nodeName&&(z=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{m.endUpdate()}null!=z&&this.chromelessResize&&this.chromelessResize(!0,z)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,g="",d=c.lastIndexOf(".");0<=d&&(g=c.substring(d),c=c.substring(0,d));if(b)var f=new Date,d=f.getFullYear(),z=f.getMonth()+1,l=f.getDate(),u=f.getHours(),n=f.getMinutes(),f=f.getSeconds(),c=
-c+(" "+(d+"-"+z+"-"+l+"-"+u+"-"+n+"-"+f));return c=mxResources.get("copyOf",[c])+g};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var g=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();
+function(a,b,d,e,n,l,x,k,q,m){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!n),f=c+"."+a;if("xml"==a){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+this.getFileData(!0,null,null,null,e,n,null,null,null,b);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 f=this.editor.graph.pageVisible;null!=l&&(this.editor.graph.pageVisible=l);var d=this.createDownloadRequest(c,a,e,b,x,n,k,q,m);this.editor.graph.pageVisible=f;return d}catch(P){this.handleError(P)}}));else{var t=null,A=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(t)}))});
+if("svg"==a){var p=this.editor.graph.background;if(x||p==mxConstants.NONE)p=null;var F=this.editor.graph.getSvg(p,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(F);this.convertImages(F,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();A('<?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",t=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();
+A(a)}),e)}}catch(O){this.handleError(O)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,e,n,l,x,k,q){var c=this.editor.graph,f=c.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==l?!1:"xmlpng"!=b);var g="",t="";if(f.width*f.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};f="0";"pdf"==b&&0==l&&(t="&allPages=1");if("xmlpng"==b&&(f="1",b="png",null!=this.pages&&null!=this.currentPage))for(l=0;l<this.pages.length;l++)if(this.pages[l]==this.currentPage){g=
+"&from="+l;break}l=c.background;"png"==b&&n?l=mxConstants.NONE:n||null!=l&&l!=mxConstants.NONE||(l="#ffffff");n={globalVars:c.getExportVariables()};q&&(n.grid={size:c.gridSize,steps:c.view.gridSteps,color:c.view.gridColor});return new mxXmlRequest(EXPORT_URL,"format="+b+g+t+"&bg="+(null!=l?l:mxConstants.NONE)+"&base64="+e+"&embedXml="+f+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(n))+(null!=x?"&scale="+x:"")+(null!=k?"&border="+
+k:""))};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(f){var d=null!=a.data?a.data:"";null!=f&&0<f.length&&(0<d.length&&(d+="\n"),d+=f);f=new LocalFile(this,"csv"!=a.format&&0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);f.getHash=function(){return c};this.fileLoaded(f);"csv"==a.format&&this.importCsv(d,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,l=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(l,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){n();l()}));n();l()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&!this.editor.isCorsEnabledForUrl(e)&&(e=PROXY_URL+"?url="+encodeURIComponent(e));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=d&&
+d(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||e.warningImage,a.tooltip,a.align,a.valign,a.offset);c.addListener(mxEvent.CLICK,function(c,b){d.alert(a.tooltip)});return c}var b=null,d=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var e=this.editor.graph,l=e.getModel();l.beginUpdate();var x=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var k=l.getCell(a.getAttribute("id"));
+if(null!=k){try{var q=a.getAttribute("value");if(null!=q){var m=mxUtils.parseXml(q).documentElement;if(null!=m)if("1"==m.getAttribute("replace-value"))l.setValue(k,m);else for(var y=m.attributes,p=0;p<y.length;p++)e.setAttributeForCell(k,y[p].nodeName,0<y[p].nodeValue.length?y[p].nodeValue:null)}}catch(L){null!=window.console&&console.log("Error in value for "+k.id+": "+L)}try{var u=a.getAttribute("style");null!=u&&e.model.setStyle(k,u)}catch(L){null!=window.console&&console.log("Error in style for "+
+k.id+": "+L)}try{var v=a.getAttribute("icon");if(null!=v){var B=0<v.length?JSON.parse(v):null;null!=B&&B.append||e.removeCellOverlays(k);null!=B&&e.addCellOverlay(k,c(B))}}catch(L){null!=window.console&&console.log("Error in icon for "+k.id+": "+L)}try{var z=a.getAttribute("geometry");if(null!=z){var z=JSON.parse(z),H=e.getCellGeometry(k);if(null!=H){H=H.clone();for(key in z){var O=parseFloat(z[key]);"dx"==key?H.x+=O:"dy"==key?H.y+=O:"dw"==key?H.width+=O:"dh"==key?H.height+=O:H[key]=parseFloat(z[key])}e.model.setGeometry(k,
+H)}}}catch(L){null!=window.console&&console.log("Error in icon for "+k.id+": "+L)}}}else if("model"==a.nodeName){for(var D=a.firstChild;null!=D&&D.nodeType!=mxConstants.NODETYPE_ELEMENT;)D=D.nextSibling;null!=D&&(new mxCodec(a.firstChild)).decode(D,l)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(e.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))e.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==
+a.nodeName&&(x=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{l.endUpdate()}null!=x&&this.chromelessResize&&this.chromelessResize(!0,x)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,f="",d=c.lastIndexOf(".");0<=d&&(f=c.substring(d),c=c.substring(0,d));if(b)var e=new Date,d=e.getFullYear(),k=e.getMonth()+1,A=e.getDate(),q=e.getHours(),m=e.getMinutes(),e=e.getSeconds(),c=
+c+(" "+(d+"-"+k+"-"+A+"-"+q+"-"+m+"-"+e));return c=mxResources.get("copyOf",[c])+f};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var f=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();
this.editor.undoManager.clear();this.setBackgroundImage(null);!b&&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.editor.setStatus("");this.updateUi();b||this.showSplash()});if(null!=a)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(a);a.addListener("descriptorChanged",
this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();a.isEditable()?a.isModified()?(a.addUnsavedStatus(),null!=a.backupPatch&&a.patch([a.backupPatch])):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"));g=!0;this.isOffline()||null==a.getMode()||EditorUi.logEvent({category:a.getMode().toUpperCase()+"-OPEN-FILE-"+
-a.getHash(),action:"size_"+a.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")});if(this.editor.editable&&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(z){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(z){}}catch(z){this.fileLoadedError=z;null!=window.console&&(console.error(z),console.log("error in fileLoaded:",a,z));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!=z&&null!=z.message?":err:"+encodeURIComponent(z.message):"")+(null!=z&&null!=z.stack?"&stack="+encodeURIComponent(z.stack):"")}catch(D){}var f=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):
-null!=c?this.fileLoaded(c):d()});b?f():this.handleError(z,mxResources.get("errorLoadingFile"),f,!0)}else d();return g};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,g=new mxGraphModel,d=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var f=0;f<a.length;f++){this.updatePageRoot(a[f]);var z=a[f].node.cloneNode(!1);z.removeAttribute("name");g.root=a[f].root;var l=d.encode(g);this.editor.graph.saveViewState(a[f].viewState,l,!0);l.removeAttribute("pageWidth");
-l.removeAttribute("pageHeight");z.appendChild(l);null!=b&&(b.eltCount+=z.getElementsByTagName("*").length,b.nodeCount+=z.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(z,function(a,c,b,g){return!g||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=c&&"y"!=c&&"width"!=c&&"height"!=c?g&&"mxCell"==a.nodeName&&"previous"==c?null:b:Math.round(b)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,d){var c=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===
-typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(c^=this.hashValue(a.nodeName,b,d));if(null!=a.attributes){null!=d&&(d.attrCount+=a.attributes.length);for(var g=0;g<a.attributes.length;g++){var f=a.attributes[g].name,k=null!=b?b(a,f,a.attributes[g].value,!0):a.attributes[g].value;null!=k&&(c^=this.hashValue(f,b,d)+this.hashValue(k,b,d))}}if(null!=a.childNodes)for(g=0;g<a.childNodes.length;g++)c=(c<<5)-c+this.hashValue(a.childNodes[g],b,d)<<0}else if(null!=a&&"function"!==
-typeof a){a=String(a);b=0;null!=d&&(d.byteCount+=a.length);for(g=0;g<a.length;g++)b=(b<<5)-b+a.charCodeAt(g)<<0;c^=b}return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,f,p,m,z){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",
+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"));f=!0;this.isOffline()||null==a.getMode()||EditorUi.logEvent({category:a.getMode().toUpperCase()+"-OPEN-FILE-"+
+a.getHash(),action:"size_"+a.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")});if(this.editor.editable&&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(x){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(x){}}catch(x){this.fileLoadedError=x;null!=window.console&&(console.error(x),console.log("error in fileLoaded:",a,x));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!=x&&null!=x.message?":err:"+encodeURIComponent(x.message):"")+(null!=x&&null!=x.stack?"&stack="+encodeURIComponent(x.stack):"")}catch(A){}var e=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):
+null!=c?this.fileLoaded(c):d()});b?e():this.handleError(x,mxResources.get("errorLoadingFile"),e,!0)}else d();return f};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,f=new mxGraphModel,d=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var e=0;e<a.length;e++){this.updatePageRoot(a[e]);var k=a[e].node.cloneNode(!1);k.removeAttribute("name");f.root=a[e].root;var A=d.encode(f);this.editor.graph.saveViewState(a[e].viewState,A,!0);A.removeAttribute("pageWidth");
+A.removeAttribute("pageHeight");k.appendChild(A);null!=b&&(b.eltCount+=k.getElementsByTagName("*").length,b.nodeCount+=k.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(k,function(a,c,b,f){return!f||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=c&&"y"!=c&&"width"!=c&&"height"!=c?f&&"mxCell"==a.nodeName&&"previous"==c?null:b:Math.round(b)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,d){var c=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===
+typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(c^=this.hashValue(a.nodeName,b,d));if(null!=a.attributes){null!=d&&(d.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=a.attributes[f].name,g=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;null!=g&&(c^=this.hashValue(e,b,d)+this.hashValue(g,b,d))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)c=(c<<5)-c+this.hashValue(a.childNodes[f],b,d)<<0}else if(null!=a&&"function"!==
+typeof a){a=String(a);b=0;null!=d&&(d.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;c^=b}return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,n,l,k){};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 g=null,f=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==g&&(g=document.createElement("div"),g.className="geDropTarget",mxUtils.write(g,mxResources.get("dragElementsHere"))),b.appendChild(g)):this.addLibraryEntries(c,b)});null!=this.sidebar&&
-null!=b&&this.sidebar.addEntries(b);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){f(b,a)}));this.repositionLibrary(c);var l=k.parentNode.previousSibling;d=l.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&l.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var u=document.createElement("div");u.style.position="absolute";u.style.right="0px";u.style.top="0px";u.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||
-(u.style.backgroundColor="inherit");l.style.position="relative";var n=document.createElement("img");n.setAttribute("src",Dialog.prototype.closeImage);n.setAttribute("title",mxResources.get("close"));n.setAttribute("valign","absmiddle");n.setAttribute("border","0");n.style.margin="0 3px";var y=null;if(".scratchpad"!=a.title||this.closableScratchpad)u.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});
-null!=y?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var t=this.editor.graph,v=null,B=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=n.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",u.insertBefore(v,u.firstChild),l.style.paddingRight=18*u.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=v&&null!=v.parentNode&&(v.parentNode.removeChild(v),l.style.paddingRight=18*u.childNodes.length+"px")})):null==y&&(y=n.cloneNode(!1),y.setAttribute("src",IMAGE_PATH+"/download.png"),y.setAttribute("title",mxResources.get("save")),u.insertBefore(y,u.firstChild),
-mxEvent.addListener(y,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==y||a.isModified()||(l.style.paddingRight=18*u.childNodes.length+"px",y.parentNode.removeChild(y),y=null)});mxEvent.consume(c)})),l.style.paddingRight=18*u.childNodes.length+"px")}),A=mxUtils.bind(this,function(a,c,d,f){a=t.cloneCells(mxUtils.sortCells(t.model.getTopmostCells(a)));for(var m=0;m<a.length;m++){var p=t.getCellGeometry(a[m]);null!=p&&
-p.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,f||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=f&&(a.title=f);b.push(a);x(d);null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)}),I=mxUtils.bind(this,function(a){if(t.isSelectionEmpty())t.getRubberband().isActive()?(t.getRubberband().execute(a),t.getRubberband().reset()):this.showError(mxResources.get("error"),
-mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=t.getSelectionCells(),b=t.view.getBounds(c),d=t.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=t.view.translate.x;b.y-=t.view.translate.y;A(c,b)}mxEvent.consume(a)});mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){t.isMouseDown&&null!=t.panningManager&&null!=t.graphHandler.shape&&(t.graphHandler.shape.node.style.visibility="hidden",k.style.backgroundColor="#f1f3f4",k.style.cursor="copy",t.panningManager.stop(),
-t.autoScroll=!1,null!=t.graphHandler.guide&&t.graphHandler.guide.setVisible(!1),null!=t.graphHandler.hint&&(t.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){t.isMouseDown&&null!=t.panningManager&&null!=t.graphHandler&&(k.style.backgroundColor="",k.style.cursor="default",this.sidebar.showTooltips=!0,t.panningManager.stop(),t.graphHandler.reset(),t.isMouseDown=!1,t.autoScroll=!0,I(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,
-function(a){t.isMouseDown&&null!=t.graphHandler.shape&&(t.graphHandler.shape.node.style.visibility="visible",k.style.backgroundColor="",k.style.cursor="",t.autoScroll=!0,null!=t.graphHandler.guide&&t.graphHandler.guide.setVisible(!0),null!=t.graphHandler.hint&&(t.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){k.style.backgroundColor="#f1f3f4";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.cursor="";k.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,m,p,q,u,l,z,v){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,q,u),c)],c[0].vertex=!0,A(c,new mxRectangle(0,
-0,q,u),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null);else{var y=!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var m=mxUtils.parseXml(c);if("mxlibrary"==m.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(m.documentElement));f(p,k);b=b.concat(p);x(a);this.spinner.stop();y=!0}catch(M){}else if("mxfile"==m.documentElement.nodeName)try{for(var q=m.documentElement.getElementsByTagName("diagram"),
-m=0;m<q.length;m++){var u=this.stringToCells(Editor.getDiagramNodeXml(q[m])),l=this.editor.graph.getBoundingBoxFromGeometry(u);A(u,new mxRectangle(0,0,l.width,l.height),a)}y=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}}y||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});null!=v&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?
-this.importVisio(v,function(a){n(a,"text/xml")},null,l):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?n(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):n(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",
-function(a){k.style.cursor="";k.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));n=n.cloneNode(!1);n.setAttribute("src",Editor.editImage);n.setAttribute("title",mxResources.get("edit"));u.insertBefore(n,u.firstChild);mxEvent.addListener(n,"click",B);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&B(a)});d=n.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));u.insertBefore(d,u.firstChild);mxEvent.addListener(d,
-"click",I);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)})),u.insertBefore(d,u.firstChild))}l.appendChild(u);l.style.paddingRight=18*u.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=
-function(a,b){for(var c=0;c<a.length;c++){var d=a[c],g=d.data;if(null!=g){var g=this.convertDataUri(g),f="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(f+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(f+"image="+g,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(g=this.stringToCells(Graph.decompress(d.xml)),0<g.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(g,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=
+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){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),f.className="geDropTarget",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});null!=this.sidebar&&
+null!=b&&this.sidebar.addEntries(b);d=null!=d&&0<d.length?d:a.getTitle();var g=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var k=g.parentNode.previousSibling;d=k.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&k.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var q=document.createElement("div");q.style.position="absolute";q.style.right="0px";q.style.top="0px";q.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||
+(q.style.backgroundColor="inherit");k.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 y=null;if(".scratchpad"!=a.title||this.closableScratchpad)q.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!=y?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var p=this.editor.graph,u=null,v=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),g,b,a,a.getMode());mxEvent.consume(c)}),B=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u),u=m.cloneNode(!1),u.setAttribute("src",Editor.spinImage),u.setAttribute("title",
+mxResources.get("saving")),u.style.cursor="default",u.style.marginRight="2px",u.style.marginTop="-2px",q.insertBefore(u,q.firstChild),k.style.paddingRight=18*q.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=u&&null!=u.parentNode&&(u.parentNode.removeChild(u),k.style.paddingRight=18*q.childNodes.length+"px")})):null==y&&(y=m.cloneNode(!1),y.setAttribute("src",IMAGE_PATH+"/download.png"),y.setAttribute("title",mxResources.get("save")),q.insertBefore(y,q.firstChild),
+mxEvent.addListener(y,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==y||a.isModified()||(k.style.paddingRight=18*q.childNodes.length+"px",y.parentNode.removeChild(y),y=null)});mxEvent.consume(c)})),k.style.paddingRight=18*q.childNodes.length+"px")}),z=mxUtils.bind(this,function(a,c,d,e){a=p.cloneCells(mxUtils.sortCells(p.model.getTopmostCells(a)));for(var l=0;l<a.length;l++){var n=p.getCellGeometry(a[l]);null!=n&&
+n.translate(-c.x,-c.y)}g.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);B(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(p.isSelectionEmpty())p.getRubberband().isActive()?(p.getRubberband().execute(a),p.getRubberband().reset()):this.showError(mxResources.get("error"),
+mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=p.getSelectionCells(),b=p.view.getBounds(c),d=p.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=p.view.translate.x;b.y-=p.view.translate.y;z(c,b)}mxEvent.consume(a)});mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(a){p.isMouseDown&&null!=p.panningManager&&null!=p.graphHandler.shape&&(p.graphHandler.shape.node.style.visibility="hidden",g.style.backgroundColor="#f1f3f4",g.style.cursor="copy",p.panningManager.stop(),
+p.autoScroll=!1,null!=p.graphHandler.guide&&p.graphHandler.guide.setVisible(!1),null!=p.graphHandler.hint&&(p.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){p.isMouseDown&&null!=p.panningManager&&null!=p.graphHandler&&(g.style.backgroundColor="",g.style.cursor="default",this.sidebar.showTooltips=!0,p.panningManager.stop(),p.graphHandler.reset(),p.isMouseDown=!1,p.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,
+function(a){p.isMouseDown&&null!=p.graphHandler.shape&&(p.graphHandler.shape.node.style.visibility="visible",g.style.backgroundColor="",g.style.cursor="",p.autoScroll=!0,null!=p.graphHandler.guide&&p.graphHandler.guide.setVisible(!0),null!=p.graphHandler.hint&&(p.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(a){g.style.backgroundColor="#f1f3f4";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.cursor="";g.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,l,n,t,q,k,x,u){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,t,q),c)],c[0].vertex=!0,z(c,new mxRectangle(0,
+0,t,q),a,mxEvent.isAltDown(a)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var y=!1,m=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var l=mxUtils.parseXml(c);if("mxlibrary"==l.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(l.documentElement));e(n,g);b=b.concat(n);B(a);this.spinner.stop();y=!0}catch(M){}else if("mxfile"==l.documentElement.nodeName)try{for(var t=l.documentElement.getElementsByTagName("diagram"),
+l=0;l<t.length;l++){var q=this.stringToCells(Editor.getDiagramNodeXml(t[l])),k=this.editor.graph.getBoundingBoxFromGeometry(q);z(q,new mxRectangle(0,0,k.width,k.height),a)}y=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}}y||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=u&&null!=k&&(/(\.v(dx|sdx?))($|\?)/i.test(k)||/(\.vs(x|sx?))($|\?)/i.test(k))?
+this.importVisio(u,function(a){m(a,"text/xml")},null,k):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,k)&&null!=u?this.parseFile(u,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?m(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):m(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"dragleave",
+function(a){g.style.cursor="";g.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));q.insertBefore(m,q.firstChild);mxEvent.addListener(m,"click",v);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&v(a)});d=m.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));q.insertBefore(d,q.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)})),q.insertBefore(d,q.firstChild))}k.appendChild(q);k.style.paddingRight=18*q.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=
+function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),e="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(e+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(e+"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(Graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=
function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.offline||EditorUi.isElectronApp||("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.createFooter=function(){return document.getElementById("geFooter")});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):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultPageBorderColor="#505759",Format.prototype.inactiveTabBackgroundColor=
"black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",
Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display=
-"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var c=document.getElementById("geFooter");null!=c&&(this.footerHeight=a,c.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,d,f,p){a=new ImageDialog(this,a,b,d,f,p);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);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 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,f,p){a=new LibraryDialog(this,a,b,d,f,p);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var b=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var c=
+"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var c=document.getElementById("geFooter");null!=c&&(this.footerHeight=a,c.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,d,e,n){a=new ImageDialog(this,a,b,d,e,n);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);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 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,n){a=new LibraryDialog(this,a,b,d,e,n);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var b=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var c=
b.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&c.refresh()}));return c};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position="absolute";a.style.overflow="hidden";var b=document.createElement("a");b.className="geTitle";b.style.color="#DF6C0C";b.style.fontWeight="bold";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML=
-'<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));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,f,p){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},
-g=null!=a&&null!=a.error?a.error:a;if(null!=g||null!=b){var k=mxUtils.htmlEntities(mxResources.get("unknownError")),q=mxResources.get("ok"),l=null;b=null!=b?b:mxResources.get("error");if(null!=g)if(null!=g.retry&&(q=mxResources.get("cancel"),l=function(){c();g.retry()}),404==g.code||404==g.status||403==g.code){var k=403==g.code?null!=g.message?mxUtils.htmlEntities(g.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=p?p:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+
-(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":"")),y=window.location.hash;if(null!=y&&("#G"==y.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==y.substring(0,45))&&(null!=a&&null!=a.error&&(null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason||null!=a.error.data&&0<a.error.data.length&&"fileAccess"==a.error.data[0].reason)||404==g.code||404==g.status)){y="#U"==y.substring(0,2)?y.substring(45,
-y.lastIndexOf("%26ex")):y.substring(2);this.showError(b,k,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+y);this.handleError(a,b,d,f,p)}),l,mxResources.get("changeUser"),mxUtils.bind(this,function(){function a(){g.innerHTML="";for(var a=0;a<c.length;a++){var b=document.createElement("option");mxUtils.write(b,c[a].displayName);b.value=a;g.appendChild(b);b=document.createElement("option");b.innerHTML="&nbsp;&nbsp;&nbsp;";
-mxUtils.write(b,"<"+c[a].email+">");b.setAttribute("disabled","disabled");g.appendChild(b)}b=document.createElement("option");mxUtils.write(b,mxResources.get("addAccount"));b.value=c.length;g.appendChild(b)}var c=this.drive.getUsersList(),b=document.createElement("div"),d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+": ");b.appendChild(d);var g=document.createElement("select");g.style.width="200px";a();mxEvent.addListener(g,"change",mxUtils.bind(this,
-function(){var b=g.value,d=c.length!=b;d&&this.drive.setUser(c[b]);this.drive.authorize(d,mxUtils.bind(this,function(){d||(c=this.drive.getUsersList(),a())}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}));b.appendChild(g);b=new CustomDialog(this,b,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(b.container,300,75,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){window.location.hash=""}),480,150);return}}else null!=g.message?
-k=mxUtils.htmlEntities(g.message):null!=g.response&&null!=g.response.error?k=mxUtils.htmlEntities(g.response.error):"undefined"!==typeof window.App&&(g.code==App.ERROR_TIMEOUT?k=mxUtils.htmlEntities(mxResources.get("timeout")):g.code==App.ERROR_BUSY&&(k=mxUtils.htmlEntities(mxResources.get("busy"))));var n=null,v=null;null!=g&&null!=g.helpLink&&(n=mxResources.get("help"),v=mxUtils.bind(this,function(){return this.editor.graph.openLink(g.helpLink)}));this.showError(b,k,q,d,l,null,null,n,v,null,null,
-null,f?d:null)}else null!=d&&d()};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,f,p,m){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},f,p);this.showDialog(a.container,340,90,!0,m);a.init()};EditorUi.prototype.setCurrentFile=function(a){null!=
-a&&(a.opened=new Date);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,f){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,"tEXt","mxfile",encodeURIComponent(b)));0<f&&(c=this.writeGraphModelToPng(c,"pHYs","dpi",f));return c};EditorUi.prototype.saveCanvas=function(a,b,d,f,p){var c="jpeg"==d?"jpg":d;f=this.getBaseFilename(f)+"."+c;a=this.createImageDataUri(a,b,d,p);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&&
+'<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));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,e,n){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){var g=mxUtils.htmlEntities(mxResources.get("unknownError")),t=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(t=mxResources.get("cancel"),k=function(){c();f.retry()}),404==f.code||404==f.status||403==f.code){var g=403==f.code?null!=f.message?mxUtils.htmlEntities(f.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=n?n:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+
+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":"")),y=window.location.hash;if(null!=y&&("#G"==y.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==y.substring(0,45))&&(null!=a&&null!=a.error&&(null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason||null!=a.error.data&&0<a.error.data.length&&"fileAccess"==a.error.data[0].reason)||404==f.code||404==f.status)){y="#U"==y.substring(0,2)?y.substring(45,
+y.lastIndexOf("%26ex")):y.substring(2);this.showError(b,g,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+y);this.handleError(a,b,d,e,n)}),k,mxResources.get("changeUser"),mxUtils.bind(this,function(){function a(){f.innerHTML="";for(var a=0;a<c.length;a++){var b=document.createElement("option");mxUtils.write(b,c[a].displayName);b.value=a;f.appendChild(b);b=document.createElement("option");b.innerHTML="&nbsp;&nbsp;&nbsp;";
+mxUtils.write(b,"<"+c[a].email+">");b.setAttribute("disabled","disabled");f.appendChild(b)}b=document.createElement("option");mxUtils.write(b,mxResources.get("addAccount"));b.value=c.length;f.appendChild(b)}var c=this.drive.getUsersList(),b=document.createElement("div"),d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+": ");b.appendChild(d);var f=document.createElement("select");f.style.width="200px";a();mxEvent.addListener(f,"change",mxUtils.bind(this,
+function(){var b=f.value,d=c.length!=b;d&&this.drive.setUser(c[b]);this.drive.authorize(d,mxUtils.bind(this,function(){d||(c=this.drive.getUsersList(),a())}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}));b.appendChild(f);b=new CustomDialog(this,b,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(b.container,300,75,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){window.location.hash=""}),480,150);return}}else null!=f.message?
+g=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error?g=mxUtils.htmlEntities(f.response.error):"undefined"!==typeof window.App&&(f.code==App.ERROR_TIMEOUT?g=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY&&(g=mxUtils.htmlEntities(mxResources.get("busy"))));var m=null,u=null;null!=f&&null!=f.helpLink&&(m=mxResources.get("help"),u=mxUtils.bind(this,function(){return this.editor.graph.openLink(f.helpLink)}));this.showError(b,g,t,d,k,null,null,m,u,null,null,
+null,e?d:null)}else null!=d&&d()};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,n,l){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,n);this.showDialog(a.container,340,90,!0,l);a.init()};EditorUi.prototype.setCurrentFile=function(a){null!=
+a&&(a.opened=new Date);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,e){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,"tEXt","mxfile",encodeURIComponent(b)));0<e&&(c=this.writeGraphModelToPng(c,"pHYs","dpi",e));return c};EditorUi.prototype.saveCanvas=function(a,b,d,e,n){var c="jpeg"==d?"jpg":d;e=this.getBaseFilename(e)+"."+c;a=this.createImageDataUri(a,b,d,n);this.saveData(e,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.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=
-function(a,b,d,f,p){if(window.Blob&&navigator.msSaveOrOpenBlob)a=f?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{var c=document.createElement("a"),g=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof c.download;if(mxClient.IS_GC)var k=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),
-g=65==(k?parseInt(k[2],10):!1)?!1:g;if(g||this.isOffline()){c.href=URL.createObjectURL(f?this.base64ToBlob(a,d):new Blob([a],{type:d}));g?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(u){}}else this.createEchoRequest(a,b,d,f,p).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,f,p,m){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,
-a+(null!=d?"&mime="+d:"")+(null!=p?"&format="+p:"")+(null!=m?"&base64="+m:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(f?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,g=Math.ceil(d/1024),f=Array(g),l=0;l<g;++l){for(var n=1024*l,u=Math.min(n+1024,d),t=Array(u-n),y=0;n<u;++y,++n)t[y]=c[n].charCodeAt(0);f[l]=new Uint8Array(t)}return new Blob(f,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,f,p,m,l){m=null!=m?m:!1;l=null!=l?l:
-"vsdx"!=p&&(!mxClient.IS_IOS||!navigator.standalone);p=this.getServiceCount(m);isLocalStorage&&p++;var c=4>=p?2:6<p?4:3;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 g=window.open("about:blank");null==g?mxUtils.popup(a,!0):(g.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"<pre>"),g.document.close())}else this.openInNewWindow(a,d,f);else b==App.MODE_DEVICE||"download"==b?
-this.doSaveLocalFile(a,c,d,f):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(g){try{this.exportFile(a,c,d,f,b,g)}catch(v){this.handleError(v)}}))}catch(G){this.handleError(G)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,m,l,null,1<p,c,a,d,f);m=this.isServices(p)?p>c?390:270:160;this.showDialog(b.container,400,m,!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||null==c.document?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&&null!=c.document||mxUtils.popup(a,!0)};var f=EditorUi.prototype.addChromelessToolbarItems;
+function(a,b,d,e,n){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{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(q){}}else this.createEchoRequest(a,b,d,e,n).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,n,l){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,
+a+(null!=d?"&mime="+d:"")+(null!=n?"&format="+n:"")+(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),k=0;k<f;++k){for(var m=1024*k,q=Math.min(m+1024,d),p=Array(q-m),y=0;m<q;++y,++m)p[y]=c[m].charCodeAt(0);e[k]=new Uint8Array(p)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,n,l,k){l=null!=l?l:!1;k=null!=k?k:
+"vsdx"!=n&&(!mxClient.IS_IOS||!navigator.standalone);n=this.getServiceCount(l);isLocalStorage&&n++;var c=4>=n?2:6<n?4:3;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("<pre>"+mxUtils.htmlEntities(a,!1)+"<pre>"),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(u){this.handleError(u)}}))}catch(E){this.handleError(E)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,l,k,null,1<n,c,a,d,e);l=this.isServices(n)?n>c?390:270:160;this.showDialog(b.container,400,l,!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||null==c.document?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&&null!=c.document||mxUtils.popup(a,!0)};var e=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 g=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});g.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){g.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,
+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.style.backgroundColor="white";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"))}f.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,d,f,p){this.isLocalFileSave()?this.saveLocalFile(d,a,f,p,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,f,p,b,c)}),d,p,f)};EditorUi.prototype.saveRequest=function(a,
-b,d,f,p,m,l){l=null!=l?l:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);isLocalStorage&&c++;var g=4>=c?2:6<c?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var g=d("_blank"==c?null:a,c==App.MODE_DEVICE||"download"==c||null==c||"_blank"==c?"0":"1");null!=g&&(c==App.MODE_DEVICE||"download"==c||"_blank"==c?g.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){m=null!=m?m:"pdf"==b?"application/pdf":"image/"+
-b;if(null!=f)try{this.exportFile(f,a,m,!0,c,d)}catch(B){this.handleError(B)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,m,!0,c,d)}catch(B){this.handleError(B)}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,l,null,1<c,g,f,m,p);c=this.isServices(c)?4<c?390:270:160;this.showDialog(a.container,380,c,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,f,p,m){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,f,p,m,l,n,u,t){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 g=this.editor.graph.getSvg(c,a,l,n,null,d,null,null,"blank"==t?"_blank":"self"==t?"_top":null);f&&this.editor.graph.addSvgShadow(g);var k=this.getBaseFilename()+".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();p&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,u,null,null,null,!1));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='<?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);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(k,"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,g,!1,mxUtils.bind(this,function(){m?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(g,q,this.thumbImageCache)):q(g)}))}};EditorUi.prototype.addRadiobox=function(a,b,d,f,p,m,l){return this.addCheckbox(a,d,f,p,m,l,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,d,f,p,m,l,n){m=null!=m?m:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop=
-"16px";c.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();c.id=l;null!=n&&c.setAttribute("name",n);d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);f&&c.setAttribute("disabled","disabled");m&&(a.appendChild(c),d=document.createElement("label"),mxUtils.write(d,b),d.setAttribute("for",l),a.appendChild(d),p||mxUtils.br(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(),g="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(g=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));f.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");
-f.appendChild(d);a.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if("custom"==f.value){var a=new FilenameDialog(this,g,mxResources.get("ok"),function(a){null!=a?g=a:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.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)?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")}));
-mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===f.value?"_blank":g:null},getEditInput:function(){return c},getEditSelect:function(){return f}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){l.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 g=document.createElement("option");g.setAttribute("value","auto");mxUtils.write(g,mxResources.get("automatic"));d.appendChild(g);g=document.createElement("option");g.setAttribute("value","blank");mxUtils.write(g,mxResources.get("openInNewWindow"));d.appendChild(g);g=document.createElement("option");g.setAttribute("value",
-"self");mxUtils.write(g,mxResources.get("openInThisWindow"));d.appendChild(g);b&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(g));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var f="#0000ff",l=null,l=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(f||"none",function(a){f=a;c()});mxEvent.consume(a)}));c();l.style.padding=mxClient.IS_FF?
-"4px 2px 4px 2px":"4px";l.style.marginLeft="4px";l.style.height="22px";l.style.width="22px";l.style.position="relative";l.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";l.className="geColorBtn";a.appendChild(l);mxUtils.br(a);return{getColor:function(){return f},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,f,p,m,l,n){var c=this.getCurrentFile(),g=[];f&&(g.push("lightbox=1"),"auto"!=a&&g.push("target="+a),null!=
-b&&b!=mxConstants.NONE&&g.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=p&&0<p.length&&g.push("edit="+encodeURIComponent(p)),m&&g.push("layers=1"),this.editor.graph.foldingEnabled&&g.push("nav=1"));d&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&g.push("page-id="+this.currentPage.getId());a=!0;null!=l?d="#U"+encodeURIComponent(l):(c=this.getCurrentFile(),n||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,null,null,
-null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&g.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host+"/")+(0<g.length?"?"+g.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,f,p,m,l,n,u,t,y){this.getBasenames();
-var c={};""!=p&&p!=mxConstants.NONE&&(c.highlight=p);"auto"!==f&&(c.target=f);u||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];l&&(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);n&&d.push("layers");0<d.length&&(u&&d.push("lightbox"),c.toolbar=d.join(" "));null!=t&&0<t.length&&(c.edit=t);null!=a?c.url=a:c.xml=this.getFileData(!0,
-null,null,null,null,!l);b='<div class="mxgraph" style="'+(m?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";y(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+
-"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,f){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,mxResources.get("html"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(g);var k=document.createElement("div");k.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");g=l.cloneNode(!0);g.setAttribute("value","copy");k.appendChild(g);var q=document.createElement("span");mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(q);mxUtils.br(k);k.appendChild(l);q=document.createElement("span");mxUtils.write(q,mxResources.get("publicDiagramUrl"));k.appendChild(q);var n=this.getCurrentFile();
-null==d&&null!=n&&n.constructor==window.DriveFile&&(q=document.createElement("a"),q.style.paddingLeft="12px",q.style.color="gray",q.setAttribute("href","javascript:void(0);"),mxUtils.write(q,mxResources.get("share")),k.appendChild(q),mxEvent.addListener(q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(n.getId())})));g.setAttribute("checked","checked");null==d&&l.setAttribute("disabled","disabled");c.appendChild(k);var y=this.addLinkSection(c),t=this.addCheckbox(c,
-mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.style.marginRight="12px";v.value="100%";c.appendChild(v);var B=this.addCheckbox(c,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,x=x=this.addCheckbox(c,mxResources.get("allPages"),k,!k),A=this.addCheckbox(c,mxResources.get("layers"),!0),I=this.addCheckbox(c,mxResources.get("lightbox"),
-!0),C=this.addEditButton(c,I),E=C.getEditInput();E.style.marginBottom="16px";mxEvent.addListener(I,"change",function(){I.checked?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled");E.checked&&I.checked?C.getEditSelect().removeAttribute("disabled"):C.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){f(l.checked?d:null,t.checked,v.value,y.getTarget(),y.getColor(),B.checked,x.checked,A.checked,I.checked,C.getLink())}),null,a,
-b);this.showDialog(a.container,340,384,!0,!0);g.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,f,p,m){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,a||mxResources.get("link"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(g);var k=this.getCurrentFile(),g="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=k&&k.constructor==window.DriveFile&&
-!b){a=80;var g="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var q=document.createElement("div");q.style.whiteSpace="normal";mxUtils.write(q,mxResources.get("linkAccountRequired"));l.appendChild(q);q=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));q.style.marginTop=
-"12px";q.className="geBtn";l.appendChild(q);c.appendChild(l);q=document.createElement("a");q.style.paddingLeft="12px";q.style.color="gray";q.style.fontSize="11px";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("check"));l.appendChild(q);mxEvent.addListener(q,"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 n=null,v=null;if(null!=d||null!=f)a+=30,mxUtils.write(c,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",c.appendChild(n),mxUtils.write(c,mxResources.get("height")+":"),
-v=document.createElement("input"),v.setAttribute("type","text"),v.style.width="50px",v.style.marginLeft="6px",v.style.marginBottom="10px",v.value=f+"px",c.appendChild(v),mxUtils.br(c);var t=this.addLinkSection(c,m);d=null!=this.pages&&1<this.pages.length;var x=null;if(null==k||k.constructor!=window.DriveFile||b)x=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var A=this.addCheckbox(c,mxResources.get("lightbox"),!0),I=this.addEditButton(c,A),C=I.getEditInput(),E=this.addCheckbox(c,mxResources.get("layers"),
-!0);E.style.marginLeft=C.style.marginLeft;E.style.marginBottom="16px";E.style.marginTop="8px";mxEvent.addListener(A,"change",function(){A.checked?(E.removeAttribute("disabled"),C.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"));C.checked&&A.checked?I.getEditSelect().removeAttribute("disabled"):I.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){p(t.getTarget(),t.getColor(),null==x?
-!0:x.checked,A.checked,I.getLink(),E.checked,null!=n?n.value:null,null!=v?v.value:null)}),null,mxResources.get("create"),g);this.showDialog(b.container,340,254+a,!0,!0);null!=n?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):t.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,f,p){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,
-mxResources.get("image"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(p?"10":"4")+"px";c.appendChild(g);if(p){mxUtils.write(c,mxResources.get("zoom")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.marginRight="16px";k.style.width="60px";k.style.marginLeft="4px";k.style.marginRight="12px";k.value=this.lastExportZoom||"100%";c.appendChild(k);mxUtils.write(c,mxResources.get("borderWidth")+":");var l=document.createElement("input");l.setAttribute("type",
-"text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.value=this.lastExportBorder||"0";c.appendChild(l);mxUtils.br(c)}var q=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),y=f?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0),g=this.editor.graph,n=f?null:this.addCheckbox(c,mxResources.get("transparentBackground"),g.background==mxConstants.NONE||null==g.background);null!=n&&(n.style.marginBottom="16px");a=
-new CustomDialog(this,c,mxUtils.bind(this,function(){var a=parseInt(k.value)/100||1,c=parseInt(l.value)||0;d(!q.checked,null!=y?y.checked:!1,null!=n?n.checked:!1,a,c)}),null,a,b);this.showDialog(a.container,300,(p?25:0)+(f?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,f,p,m,l,n){l=null!=l?l:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=this.editor.graph,k="jpeg"==n?196:300,q=document.createElement("h3");mxUtils.write(q,a);q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";
-c.appendChild(q);mxUtils.write(c,mxResources.get("zoom")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.style.marginRight="12px";v.value=this.lastExportZoom||"100%";c.appendChild(v);mxUtils.write(c,mxResources.get("borderWidth")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.marginRight="16px";z.style.width="60px";z.style.marginLeft="4px";z.value=this.lastExportBorder||
-"0";c.appendChild(z);mxUtils.br(c);var t=this.addCheckbox(c,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=n),D=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,g.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");m&&(c.appendChild(x),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),k+=26,mxEvent.addListener(D,"change",function(){D.checked?
-x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));g.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var A=this.addCheckbox(c,mxResources.get("shadow"),g.shadowVisible),E=document.createElement("input");E.style.marginTop="16px";E.style.marginRight="8px";E.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||E.setAttribute("disabled","disabled");b&&(c.appendChild(E),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),k+=
-26);var L=null;if("png"==n||"jpeg"==n)L=this.addCheckbox(c,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),k+=26;var P=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=n),T=null!=this.pages&&1<this.pages.length,C=this.addCheckbox(c,T?mxResources.get("allPages"):"",T,!T,null,"jpeg"!=n);C.style.marginLeft="24px";C.style.marginBottom="16px";T||(C.style.display="none");mxEvent.addListener(P,"change",function(){P.checked&&T?C.removeAttribute("disabled"):
-C.setAttribute("disabled","disabled")});l&&T||C.setAttribute("disabled","disabled");var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";W.style.marginRight="10px";W.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));W.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));W.appendChild(a);a=document.createElement("option");
-a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));W.appendChild(a);"svg"==n&&(mxUtils.write(c,mxResources.get("links")+":"),c.appendChild(W),mxUtils.br(c),mxUtils.br(c),k+=26);d=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=z.value;this.lastExportZoom=v.value;p(v.value,t.checked,!D.checked,A.checked,P.checked,E.checked,z.value,x.checked,!C.checked,W.value,null!=L?L.checked:null)}),null,d,f);this.showDialog(d.container,340,k,!0,!0,null,
-null,null,null,!0);v.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?v.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,f,p){var c=document.createElement("div");c.style.whiteSpace="nowrap";var g=this.editor.graph;if(null!=b){var k=document.createElement("h3");mxUtils.write(k,b);k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(k)}var l=this.addCheckbox(c,mxResources.get("fit"),
-!0),q=this.addCheckbox(c,mxResources.get("shadow"),g.shadowVisible&&f,!f),n=this.addCheckbox(c,d),t=this.addCheckbox(c,mxResources.get("lightbox"),!0),v=this.addEditButton(c,t),x=v.getEditInput(),A=1<g.model.getChildCount(g.model.getRoot()),C=this.addCheckbox(c,mxResources.get("layers"),A,!A);C.style.marginLeft=x.style.marginLeft;C.style.marginBottom="12px";C.style.marginTop="8px";mxEvent.addListener(t,"change",function(){t.checked?(A&&C.removeAttribute("disabled"),x.removeAttribute("disabled")):
-(C.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"));x.checked&&t.checked?v.getEditSelect().removeAttribute("disabled"):v.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(l.checked,q.checked,n.checked,t.checked,v.getLink(),C.checked)}),null,mxResources.get("embed"),p);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,f,p,m,l,n){function c(c){var b=" ",k="";f&&(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('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(p?"&edit=_blank":"")+(m?"&layers=1":"")+"');}})(this);\"",k+="cursor:pointer;");a&&(k+="max-width:100%;");var q="";d&&(q=' width="'+Math.round(g.width)+'" height="'+Math.round(g.height)+'"');l('<img src="'+c+'"'+q+(""!=k?' style="'+k+'"':"")+b+"/>")}var g=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=f?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,
-mxUtils.bind(this,function(a){n({message:mxResources.get("unknownError")})}),null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),g.width*g.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var k="";d&&(k="&w="+Math.round(2*g.width)+"&h="+Math.round(2*g.height));var q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(f?"1":"0")+k+"&xml="+encodeURIComponent(b));q.send(mxUtils.bind(this,function(){200<=q.getStatus()&&299>=q.getStatus()?c("data:image/png;base64,"+q.getText()):n({message:mxResources.get("unknownError")})}))}else n({message:mxResources.get("drawingTooLarge")})};
-EditorUi.prototype.createEmbedSvg=function(a,b,d,f,p,m,l){var c=this.editor.graph.getSvg(),g=c.getElementsByTagName("a");if(null!=g)for(var k=0;k<g.length;k++){var q=g[k].getAttribute("href");null!=q&&"#"==q.charAt(0)&&"_blank"==g[k].getAttribute("target")&&g[k].removeAttribute("target")}f&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var n=" ",v="";f&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(p?"&edit=_blank":"")+(m?"&layers=1":"")+"');}})(this);\"",v+="cursor:pointer;");a&&(v+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){l('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=v?' style="'+v+'"':"")+n+"/>")}))}else v="",f&&(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('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(p?"&edit=_blank":"")+(m?"&layers=1":"")+"');}}})(this);"),v+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),v+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=v&&c.setAttribute("style",v),l(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,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,
-function(){f()}))}),0)):f()};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],g=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:g.apply(this,arguments)}}}null!=c&&(a=Editor.parseDiagramNode(c))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(m){}finally{this.editor.graph=
-d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){try{var c=this.editor.graph,g=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),g=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),f=c.getGlobalVariable,k=this.pages[0];c.getGlobalVariable=function(a){return"page"==
-a?k.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(k.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==g&&(g=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var f=d.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"tEXt","mxfile",encodeURIComponent(g));a(f.substring(f.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(F){null!=b&&b(F)}}),null,null,null,mxUtils.bind(this,
-function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)}catch(D){null!=b&&b(D)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,d,f,p,m,l){l=b.background;l==mxConstants.NONE&&(l=null);m=b.getSvg(l,null,null,null,null,m);b.shadowVisible&&b.addSvgShadow(m);null!=a&&m.setAttribute("content",a);null!=d&&m.setAttribute("resource",d);if(null!=p)this.convertImages(m,mxUtils.bind(this,function(a){p((f?"":'<?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(f?"":'<?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(m)};EditorUi.prototype.exportImage=function(a,b,d,f,p,m,l,n,u,t,y){u=null!=u?u:"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,p?this.getFileData(!0,null,null,null,d,n):null,u,!n,y)}catch(B){"Invalid image"==B.message?this.downloadFile(u):this.handleError(B)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,f,null,null,m,l,t)}catch(v){this.spinner.stop(),this.handleError(v)}}};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,f={},m=mxUtils.bind(this,function(){if(0==d){for(var g=[b[0]],k=1;k<b.length;k++){var m=b[k].indexOf(")");g.push('url("');g.push(f[c(b[k].substring(0,m))]);g.push('"'+b[k].substring(m))}this.editor.resolvedFontCss=g.join("");a()}});if(0<b.length)for(var l=1;l<b.length;l++){var n=b[l].indexOf(")"),u=null,t=b[l].indexOf("format(",n);0<t&&(u=c(b[l].substring(t+7,b[l].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==
-f[a]){f[a]=a;d++;var c="application/x-font-ttf";if("svg"==u||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==u||"embedded-opentype"==u||/(\.otf)($|\?)/i.test(a))c="application/x-font-opentype";else if("woff"==u||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==u||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==u||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==u||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=
-a;/^https?:\/\//.test(b)&&!this.editor.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){f[a]=c;d--;m()}),mxUtils.bind(this,function(a){d--;m()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[l].substring(0,n)),u)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,f,p,m,l,n,u,t,y,x,v,B,A){try{m=null!=m?m:!0;l=null!=l?l:!0;x=null!=x?x:this.editor.graph;v=null!=v?v:0;var c=u?null:x.background;c==mxConstants.NONE&&(c=null);
-null==c&&(c=f);null==c&&0==u&&(c="#ffffff");this.convertImages(x.getSvg(null,null,null,B,null,l,null,null,null,t),mxUtils.bind(this,function(d){var g=new Image;g.onload=mxUtils.bind(this,function(){try{var f=function(){mxClient.IS_SF?window.setTimeout(function(){u.drawImage(g,v/n,v/n);a(k)},0):(u.drawImage(g,v/n,v/n),a(k))},k=document.createElement("canvas"),l=parseInt(d.getAttribute("width")),q=parseInt(d.getAttribute("height"));n=null!=n?n:1;null!=b&&(n=m?Math.min(1,Math.min(3*b/(4*q),b/l)):b/l);
-l=Math.ceil(n*l)+2*v;q=Math.ceil(n*q)+2*v;k.setAttribute("width",l);k.setAttribute("height",q);var u=k.getContext("2d");null!=c&&(u.beginPath(),u.rect(0,0,l,q),u.fillStyle=c,u.fill());u.scale(n,n);if(A){var y=x.view,t=btoa(unescape(encodeURIComponent(y.createSvgGrid(y.gridColor)))),t="data:image/svg+xml;base64,"+t,z=x.gridSize*y.gridSteps*n,D=x.getGraphBounds(),E=D.x*n,B=D.y*n,F=new Image;F.src=t;F.onload=function(){for(var a=-Math.round(z-mxUtils.mod(y.translate.x*n-E,z)),c=-Math.round(z-mxUtils.mod(y.translate.y*
-n-B,z));a<l;a+=z)for(var b=c;b<q;b+=z)u.drawImage(F,a/n,b/n);f()}}else f()}catch(X){null!=p&&p(X)}});g.onerror=function(a){null!=p&&p(a)};try{t&&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(x,d,!0,mxUtils.bind(this,function(){g.src=this.createSvgDataUri(mxUtils.getXml(d))}))});
-this.loadFonts(f)}catch(L){null!=p&&p(L)}}),d,y)}catch(I){null!=p&&p(I)}};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,d=this;a.convert=function(c){if(null!=c){var g="http://"==c.substring(0,7)||"https://"==c.substring(0,8);g&&!navigator.onLine?c=d.svgBrokenImage.src:!g||c.substring(0,a.baseUrl.length)==a.baseUrl||d.crossOriginImages&&d.editor.isCorsEnabledForUrl(c)?"chrome-extension://"==c.substring(0,19)||mxClient.IS_CHROMEAPP||
-(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};EditorUi.prototype.convertImages=function(a,b,d,f){null==f&&(f=this.createImageUrlConverter());var c=0,g=d||{};d=mxUtils.bind(this,function(d,k){for(var m=a.getElementsByTagName(d),l=0;l<m.length;l++)mxUtils.bind(this,function(d){try{if(null!=d){var m=f.convert(d.getAttribute(k));if(null!=m&&"data:"!=m.substring(0,5)){var l=g[m];null==l?(c++,this.convertImageToDataUri(m,function(f){null!=f&&(g[m]=f,d.setAttribute(k,
-f));c--;0==c&&b(a)})):d.setAttribute(k,l)}else null!=m&&d.setAttribute(k,m)}}catch(B){}})(m[l])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,f,l,m,n){try{var c=!n&&(f||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));l=null!=l?l:!0;var g=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var g=a.getText();if(c){if((9==document.documentMode||
-10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var g=Array(a.length),f=0;f<a.length;f++)g[f]=String.fromCharCode(a[f]);g=g.join("")}m=null!=m?m:"data:image/png;base64,";g=m+this.base64Encode(g)}b(g)}}else null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()})},c,this.timeout,function(){l&&null!=d&&d({code:App.ERROR_TIMEOUT,
-retry:g})})});g()}catch(F){null!=d&&d(F)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){try{var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b(this.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(d);c&&b(this.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(d);c&&b(this.svgBrokenImage.src)});
-else{var g=new Image,f=this;this.crossOriginImages&&(g.crossOrigin="anonymous");g.onload=function(){window.clearTimeout(d);if(c)try{var a=document.createElement("canvas"),k=a.getContext("2d");a.height=g.height;a.width=g.width;k.drawImage(g,0,0);b(a.toDataURL())}catch(u){b(f.svgBrokenImage.src)}};g.onerror=function(){window.clearTimeout(d);c&&b(f.svgBrokenImage.src)};g.src=a}}catch(z){b(this.svgBrokenImage.src)}};EditorUi.prototype.importXml=function(a,b,d,f,l){b=null!=b?b:0;d=null!=d?d:0;var c=[];
-try{var g=this.editor.graph;if(null!=a&&0<a.length){g.model.beginUpdate();try{var k=mxUtils.parseXml(a),p=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=p&&"mxfile"==p.nodeName&&null!=this.pages){var q=p.getElementsByTagName("diagram");if(1==q.length)p=Editor.parseDiagramNode(q[0]);else if(1<q.length){a={};var k=[],n=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(p=Editor.parseDiagramNode(q[0]),f=!1,n=1);for(;n<q.length;n++){var t=q[n].getAttribute("id");
-q[n].removeAttribute("id");var v=this.updatePageRoot(new DiagramPage(q[n]));a[t]=q[n].getAttribute("id");var x=this.pages.length;null==v.getName()&&v.setName(mxResources.get("pageWithNumber",[x+1]));g.model.execute(new ChangePage(this,v,v,x,!0));k.push(v)}this.updatePageLinks(a,k)}}null!=p&&"mxGraphModel"===p.nodeName&&(c=g.importGraphModel(p,b,d,f))}finally{g.model.endUpdate()}}}catch(O){if(l)throw O;this.handleError(O)}return c};EditorUi.prototype.updatePageLinks=function(a,b){for(var c=0;c<b.length;c++)this.updatePageLinksForCell(a,
-b[c].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var c=document.createElement("div"),d=this.editor.graph,g=d.getLinkForCell(b);null!=g&&d.setLinkForCell(b,this.updatePageLink(a,g));if(d.isHtmlLabel(b)){c.innerHTML=d.getLabel(b);for(var f=c.getElementsByTagName("a"),l=!1,n=0;n<f.length;n++)g=f[n].getAttribute("href"),null!=g&&(f[n].setAttribute("href",this.updatePageLink(a,g)),l=!0);l&&d.labelChanged(b,c.innerHTML)}for(n=0;n<d.model.getChildCount(b);n++)this.updatePageLinksForCell(a,
-d.model.getChildAt(b,n))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var c=a[b.substring(b.indexOf(",")+1)];b=null!=c?"data:page/id,"+c:null}else if("data:action/json,"==b.substring(0,17))try{var d=JSON.parse(b.substring(17));if(null!=d.actions){for(var g=0;g<d.actions.length;g++){var f=d.actions[g];null!=f.open&&"data:page/id,"==f.open.substring(0,13)&&(c=a[f.open.substring(f.open.indexOf(",")+1)],null!=c?f.open="data:page/id,"+c:delete f.open)}b="data:action/json,"+
-JSON.stringify(d)}}catch(z){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,d,f){f=null!=f?f: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){var c=this.isRemoteVisioFormat(f);try{var g="UNKNOWN-VISIO",k=f.lastIndexOf(".");0<=k&&k<f.length&&(g=f.substring(k+1).toUpperCase());
-EditorUi.logEvent({category:g+"-MS-IMPORT-FILE",action:"filename_"+f,label:c?"remote":"local"})}catch(F){}if(c)if(null!=VSD_CONVERT_URL){c=new FormData;c.append("file1",a,f);var l=new XMLHttpRequest;l.open("POST",VSD_CONVERT_URL);l.responseType="blob";this.addRemoteServiceSecurityCheck(l);l.onreadystatechange=mxUtils.bind(this,function(){if(4==l.readyState)if(200<=l.status&&299>=l.status)try{var a=l.response;if("text/xml"==a.type){var c=new FileReader;c.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(v){d({message:mxResources.get("errorLoadingFile")})}});
-c.readAsText(a)}else this.doImportVisio(a,b,d,f)}catch(G){d(G)}else d({})});l.send(c)}else d({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else try{this.doImportVisio(a,b,d,f)}catch(F){d(F)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.importGraphML=
-function(a,b,d){d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,d)}catch(p){d(p)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?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()||this.handleError({message:mxResources.get("unknownError")})}catch(g){this.handleError(g)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,
-b,d){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length})}catch(p){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(p){d(p)}}else d({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",
-c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.generatePlantUmlImage=function(a,b,d,f){function c(a,c,b){c1=a>>2;c2=(a&3)<<4|c>>4;c3=(c&15)<<2|b>>6;c4=b&63;r="";r+=g(c1&63);r+=g(c2&63);r+=g(c3&63);return r+=g(c4&63)}function g(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"}var k=new XMLHttpRequest;k.open("GET",("txt"==b?PLANT_URL+"/txt/":"png"==b?PLANT_URL+"/png/":
-PLANT_URL+"/svg/")+function(a){r="";for(i=0;i<a.length;i+=3)r=i+2==a.length?r+c(a.charCodeAt(i),a.charCodeAt(i+1),0):i+1==a.length?r+c(a.charCodeAt(i),0,0):r+c(a.charCodeAt(i),a.charCodeAt(i+1),a.charCodeAt(i+2));return r}(pako.deflateRaw(a,{to:"string"})),!0);"txt"!=b&&(k.responseType="blob");k.onload=function(a){if(200<=this.status&&300>this.status)if("txt"==b)d(this.response);else{var c=new FileReader;c.readAsDataURL(this.response);c.onloadend=function(a){var b=new Image;b.onload=function(){var a=
-b.width,g=b.height;if(0==a&&0==g){var f=c.result,k=f.indexOf(","),f=decodeURIComponent(escape(atob(f.substring(k+1)))),f=mxUtils.parseXml(f).getElementsByTagName("svg");0<f.length&&(a=parseFloat(f[0].getAttribute("width")),g=parseFloat(f[0].getAttribute("height")))}d(c.result,a,g)};b.src=c.result};c.onerror=function(a){f(a)}}else f(a)};k.onerror=function(a){f(a)};k.send()};EditorUi.prototype.insertAsPreText=function(a,b,d){var c=this.editor.graph,g=null;c.getModel().beginUpdate();try{g=c.insertVertex(null,
-null,"<pre>"+a+"</pre>",b,d,1,1,"text;html=1;align=left;verticalAlign=top;"),c.updateCellSize(g,!0)}finally{c.getModel().endUpdate()}return g};EditorUi.prototype.insertTextAt=function(a,b,d,f,l,m,n){m=null!=m?m:!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()&&(l||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var g=this.extractGraphModelFromPng(a),k=this.importXml(g,b,d,m,!0);if(0<k.length)return k}if("data:image/svg+xml;"==a.substring(0,19))try{if(g=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(g=a.substring(a.indexOf(",")+1),g=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0)):g=decodeURIComponent(a.substring(a.indexOf(",")+
-1)),k=this.importXml(g,b,d,m,!0),0<k.length)return k}catch(y){}this.loadImage(a,mxUtils.bind(this,function(g){if("data:"==a.substring(0,5))this.resizeImage(g,a,mxUtils.bind(this,function(a,g,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),g,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/g.width,this.maxImageSize/
-g.height)),k=Math.round(g.width*f);g=Math.round(g.height*f);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),k,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var g=null;c.getModel().beginUpdate();try{g=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(f?"html=1;":"")),c.updateCellSize(g),c.fireEvent(new mxEventObject("textInserted","cells",
-[g]))}finally{c.getModel().endUpdate()}c.setSelectionCell(g)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,m);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,d,m))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{c=this.editor.graph;l=null;c.getModel().beginUpdate();try{l=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),
-1,1,"text;"+(f?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[l])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),a.length>this.maxTextBytes&&(a=a.substring(0,this.maxTextBytes)+"..."),l.value=a,c.updateCellSize(l),/\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(l.value)&&c.setLinkForCell(l,
-l.value),l.geometry.width+=c.gridSize,l.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[l]}}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)};
+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"))}e.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,d,e,n){this.isLocalFileSave()?this.saveLocalFile(d,a,e,n,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,n,b,c)}),d,n,e)};EditorUi.prototype.saveRequest=function(a,
+b,d,e,n,l,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);isLocalStorage&&c++;var f=4>=c?2:6<c?4:3;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(C){this.handleError(C)}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(C){this.handleError(C)}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,k,null,1<c,f,e,l,n);c=this.isServices(c)?4<c?390:270:160;this.showDialog(a.container,380,c,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,n,l){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,n,l,k,m,q,p){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,k,m,null,d,null,null,"blank"==p?"_blank":"self"==p?"_top":null);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0,null,null,null,d,q,null,null,null,!1));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='<?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);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(){l?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,t,this.thumbImageCache)):t(f)}))}};EditorUi.prototype.addRadiobox=function(a,b,d,e,n,l,k){return this.addCheckbox(a,d,e,n,l,k,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,d,e,n,l,k,m){l=null!=l?l:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop=
+"16px";c.setAttribute("type",k?"radio":"checkbox");k="geCheckbox-"+Editor.guid();c.id=k;null!=m&&c.setAttribute("name",m);d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");l&&(a.appendChild(c),d=document.createElement("label"),mxUtils.write(d,b),d.setAttribute("for",k),a.appendChild(d),n||mxUtils.br(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(){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,d,e,n,l,k,m){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!=n&&0<n.length&&f.push("edit="+encodeURIComponent(n)),l&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));d&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&f.push("page-id="+this.currentPage.getId());a=!0;null!=k?d="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),m||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,null,null,
+null,null,null,null,!0):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)?EditorUi.drawHost:"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,n,l,k,m,q,p,y){this.getBasenames();
+var c={};""!=n&&n!=mxConstants.NONE&&(c.highlight=n);"auto"!==e&&(c.target=e);q||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];k&&(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);m&&d.push("layers");0<d.length&&(q&&d.push("lightbox"),c.toolbar=d.join(" "));null!=p&&0<p.length&&(c.edit=p);null!=a?c.url=a:c.xml=this.getFileData(!0,
+null,null,null,null,!k);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):"";y(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+
+"/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 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 q=document.createElement("span");mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(q);mxUtils.br(g);g.appendChild(k);q=document.createElement("span");mxUtils.write(q,mxResources.get("publicDiagramUrl"));g.appendChild(q);var t=this.getCurrentFile();
+null==d&&null!=t&&t.constructor==window.DriveFile&&(q=document.createElement("a"),q.style.paddingLeft="12px",q.style.color="gray",q.setAttribute("href","javascript:void(0);"),mxUtils.write(q,mxResources.get("share")),g.appendChild(q),mxEvent.addListener(q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(t.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(g);var y=this.addLinkSection(c),m=this.addCheckbox(c,
+mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.style.marginRight="12px";u.value="100%";c.appendChild(u);var p=this.addCheckbox(c,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,v=v=this.addCheckbox(c,mxResources.get("allPages"),g,!g),B=this.addCheckbox(c,mxResources.get("layers"),!0),H=this.addCheckbox(c,mxResources.get("lightbox"),
+!0),z=this.addEditButton(c,H),D=z.getEditInput();D.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled");D.checked&&H.checked?z.getEditSelect().removeAttribute("disabled"):z.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,m.checked,u.value,y.getTarget(),y.getColor(),p.checked,v.checked,B.checked,H.checked,z.getLink())}),null,a,
+b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,n,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",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 t=document.createElement("div");t.style.whiteSpace="normal";mxUtils.write(t,mxResources.get("linkAccountRequired"));k.appendChild(t);t=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));t.style.marginTop=
+"12px";t.className="geBtn";k.appendChild(t);c.appendChild(k);t=document.createElement("a");t.style.paddingLeft="12px";t.style.color="gray";t.style.fontSize="11px";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("check"));k.appendChild(t);mxEvent.addListener(t,"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,u=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,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%",c.appendChild(m),mxUtils.write(c,mxResources.get("height")+":"),
+u=document.createElement("input"),u.setAttribute("type","text"),u.style.width="50px",u.style.marginLeft="6px",u.style.marginBottom="10px",u.value=e+"px",c.appendChild(u),mxUtils.br(c);var p=this.addLinkSection(c,l);d=null!=this.pages&&1<this.pages.length;var v=null;if(null==g||g.constructor!=window.DriveFile||b)v=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var B=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,B),z=H.getEditInput(),D=this.addCheckbox(c,mxResources.get("layers"),
+!0);D.style.marginLeft=z.style.marginLeft;D.style.marginBottom="16px";D.style.marginTop="8px";mxEvent.addListener(B,"change",function(){B.checked?(D.removeAttribute("disabled"),z.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"));z.checked&&B.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){n(p.getTarget(),p.getColor(),null==v?
+!0:v.checked,B.checked,H.getLink(),D.checked,null!=m?m.value:null,null!=u?u.value:null)}),null,mxResources.get("create"),f);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)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e,n){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:"+(n?"10":"4")+"px";c.appendChild(f);if(n){mxUtils.write(c,mxResources.get("zoom")+":");var g=document.createElement("input");g.setAttribute("type","text");g.style.marginRight="16px";g.style.width="60px";g.style.marginLeft="4px";g.style.marginRight="12px";g.value=this.lastExportZoom||"100%";c.appendChild(g);mxUtils.write(c,mxResources.get("borderWidth")+":");var k=document.createElement("input");k.setAttribute("type",
+"text");k.style.marginRight="16px";k.style.width="60px";k.style.marginLeft="4px";k.value=this.lastExportBorder||"0";c.appendChild(k);mxUtils.br(c)}var t=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),m=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0),f=this.editor.graph,p=e?null:this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=p&&(p.style.marginBottom="16px");a=
+new CustomDialog(this,c,mxUtils.bind(this,function(){var a=parseInt(g.value)/100||1,c=parseInt(k.value)||0;d(!t.checked,null!=m?m.checked:!1,null!=p?p.checked:!1,a,c)}),null,a,b);this.showDialog(a.container,300,(n?25:0)+(e?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,n,l,k,m){k=null!=k?k:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph,g="jpeg"==m?196:300,t=document.createElement("h3");mxUtils.write(t,a);t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";
+c.appendChild(t);mxUtils.write(c,mxResources.get("zoom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.style.marginRight="12px";u.value=this.lastExportZoom||"100%";c.appendChild(u);mxUtils.write(c,mxResources.get("borderWidth")+":");var x=document.createElement("input");x.setAttribute("type","text");x.style.marginRight="16px";x.style.width="60px";x.style.marginLeft="4px";x.value=this.lastExportBorder||
+"0";c.appendChild(x);mxUtils.br(c);var p=this.addCheckbox(c,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=m),A=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(A,"change",function(){A.checked?
+v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));f.isSelectionEmpty()||(v.setAttribute("checked","checked"),v.defaultChecked=!0);var B=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),D=document.createElement("input");D.style.marginTop="16px";D.style.marginRight="8px";D.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||D.setAttribute("disabled","disabled");b&&(c.appendChild(D),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=
+26);var L=null;if("png"==m||"jpeg"==m)L=this.addCheckbox(c,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),g+=26;var z=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=m),P=null!=this.pages&&1<this.pages.length,ba=this.addCheckbox(c,P?mxResources.get("allPages"):"",P,!P,null,"jpeg"!=m);ba.style.marginLeft="24px";ba.style.marginBottom="16px";P||(ba.style.display="none");mxEvent.addListener(z,"change",function(){z.checked&&P?ba.removeAttribute("disabled"):
+ba.setAttribute("disabled","disabled")});k&&P||ba.setAttribute("disabled","disabled");var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";W.style.marginRight="10px";W.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));W.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));W.appendChild(a);a=document.createElement("option");
+a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));W.appendChild(a);"svg"==m&&(mxUtils.write(c,mxResources.get("links")+":"),c.appendChild(W),mxUtils.br(c),mxUtils.br(c),g+=26);d=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=x.value;this.lastExportZoom=u.value;n(u.value,p.checked,!A.checked,B.checked,z.checked,D.checked,x.value,v.checked,!ba.checked,W.value,null!=L?L.checked:null)}),null,d,e);this.showDialog(d.container,340,g,!0,!0,null,
+null,null,null,!0);u.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,n){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 k=this.addCheckbox(c,mxResources.get("fit"),
+!0),t=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,!e),m=this.addCheckbox(c,d),p=this.addCheckbox(c,mxResources.get("lightbox"),!0),u=this.addEditButton(c,p),v=u.getEditInput(),B=1<f.model.getChildCount(f.model.getRoot()),z=this.addCheckbox(c,mxResources.get("layers"),B,!B);z.style.marginLeft=v.style.marginLeft;z.style.marginBottom="12px";z.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(B&&z.removeAttribute("disabled"),v.removeAttribute("disabled")):
+(z.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"));v.checked&&p.checked?u.getEditSelect().removeAttribute("disabled"):u.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(k.checked,t.checked,m.checked,p.checked,u.getLink(),z.checked)}),null,mxResources.get("embed"),n);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,n,l,k,m){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('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(n?"&edit=_blank":"")+(l?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var t="";d&&(t=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');k('<img src="'+c+'"'+t+(""!=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){m({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 t=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));t.send(mxUtils.bind(this,function(){200<=t.getStatus()&&299>=t.getStatus()?c("data:image/png;base64,"+t.getText()):m({message:mxResources.get("unknownError")})}))}else m({message:mxResources.get("drawingTooLarge")})};
+EditorUi.prototype.createEmbedSvg=function(a,b,d,e,n,l,k){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var t=f[g].getAttribute("href");null!=t&&"#"==t.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 m=" ",u="";e&&(m="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(n?"&edit=_blank":"")+(l?"&layers=1":"")+"');}})(this);\"",u+="cursor:pointer;");a&&(u+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){k('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=u?' style="'+u+'"':"")+m+"/>")}))}else u="",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('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(n?"&edit=_blank":"")+(l?"&layers=1":"")+"');}}})(this);"),u+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),u+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=u&&c.setAttribute("style",u),k(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){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,
+function(){e()}))}),0)):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&&(a=Editor.parseDiagramNode(c))}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){try{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,null,null,null,null,null,null,null,null,!1));var e=d.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"tEXt","mxfile",encodeURIComponent(f));a(e.substring(e.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(F){null!=b&&b(F)}}),null,null,null,mxUtils.bind(this,
+function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)}catch(A){null!=b&&b(A)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,d,e,n,l,k){k=b.background;k==mxConstants.NONE&&(k=null);l=b.getSvg(k,null,null,null,null,l);b.shadowVisible&&b.addSvgShadow(l);null!=a&&l.setAttribute("content",a);null!=d&&l.setAttribute("resource",d);if(null!=n)this.convertImages(l,mxUtils.bind(this,function(a){n((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(l)};EditorUi.prototype.exportImage=function(a,b,d,e,k,l,m,p,q,v,y){q=null!=q?q:"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,p):null,q,!p,y)}catch(C){"Invalid image"==C.message?this.downloadFile(q):this.handleError(C)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,l,m,v)}catch(u){this.spinner.stop(),this.handleError(u)}}};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 l=b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,l))]);f.push('"'+b[g].substring(l))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var k=1;k<b.length;k++){var m=b[k].indexOf(")"),q=null,p=b[k].indexOf("format(",m);0<p&&(q=c(b[k].substring(p+7,b[k].indexOf(")",p))));mxUtils.bind(this,function(a){if(null==
+e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==q||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==q||"embedded-opentype"==q||/(\.otf)($|\?)/i.test(a))c="application/x-font-opentype";else if("woff"==q||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==q||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==q||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==q||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=
+a;/^https?:\/\//.test(b)&&!this.editor.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[k].substring(0,m)),q)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,k,l,m,p,q,v,y,E,u,C,B){try{l=null!=l?l:!0;m=null!=m?m:!0;E=null!=E?E:this.editor.graph;u=null!=u?u:0;var c=q?null:E.background;c==mxConstants.NONE&&(c=null);
+null==c&&(c=e);null==c&&0==q&&(c="#ffffff");this.convertImages(E.getSvg(null,null,null,C,null,m,null,null,null,v),mxUtils.bind(this,function(d){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var e=function(){mxClient.IS_SF?window.setTimeout(function(){q.drawImage(f,u/p,u/p);a(g)},0):(q.drawImage(f,u/p,u/p),a(g))},g=document.createElement("canvas"),n=parseInt(d.getAttribute("width")),t=parseInt(d.getAttribute("height"));p=null!=p?p:1;null!=b&&(p=l?Math.min(1,Math.min(3*b/(4*t),b/n)):b/n);
+n=Math.ceil(p*n)+2*u;t=Math.ceil(p*t)+2*u;g.setAttribute("width",n);g.setAttribute("height",t);var q=g.getContext("2d");null!=c&&(q.beginPath(),q.rect(0,0,n,t),q.fillStyle=c,q.fill());q.scale(p,p);if(B){var m=E.view,y=btoa(unescape(encodeURIComponent(m.createSvgGrid(m.gridColor)))),y="data:image/svg+xml;base64,"+y,x=E.gridSize*m.gridSteps*p,A=E.getGraphBounds(),v=A.x*p,D=A.y*p,C=new Image;C.src=y;C.onload=function(){for(var a=-Math.round(x-mxUtils.mod(m.translate.x*p-v,x)),c=-Math.round(x-mxUtils.mod(m.translate.y*
+p-D,x));a<n;a+=x)for(var b=c;b<t;b+=x)q.drawImage(C,a/p,b/p);e()}}else e()}catch(V){null!=k&&k(V)}});f.onerror=function(a){null!=k&&k(a)};try{v&&this.editor.graph.addSvgShadow(d);var e=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(E,d,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(d))}))});
+this.loadFonts(e)}catch(L){null!=k&&k(L)}}),d,y)}catch(H){null!=k&&k(H)}};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,d=this;a.convert=function(c){if(null!=c){var f="http://"==c.substring(0,7)||"https://"==c.substring(0,8);f&&!navigator.onLine?c=d.svgBrokenImage.src:!f||c.substring(0,a.baseUrl.length)==a.baseUrl||d.crossOriginImages&&d.editor.isCorsEnabledForUrl(c)?"chrome-extension://"==c.substring(0,19)||mxClient.IS_CHROMEAPP||
+(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 l=a.getElementsByTagName(d),k=0;k<l.length;k++)mxUtils.bind(this,function(d){try{if(null!=d){var l=e.convert(d.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var k=f[l];null==k?(c++,this.convertImageToDataUri(l,function(e){null!=e&&(f[l]=e,d.setAttribute(g,
+e));c--;0==c&&b(a)})):d.setAttribute(g,k)}else null!=l&&d.setAttribute(g,l)}}catch(C){}})(l[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,k,l,m){try{var c=!m&&(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 f=a.getText();if(c){if((9==document.documentMode||
+10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}l=null!=l?l:"data:image/png;base64,";f=l+this.base64Encode(f)}b(f)}}else null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()})},c,this.timeout,function(){k&&null!=d&&d({code:App.ERROR_TIMEOUT,
+retry:f})})});f()}catch(F){null!=d&&d(F)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){try{var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b(this.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(d);c&&b(this.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(d);c&&b(this.svgBrokenImage.src)});
+else{var f=new Image,e=this;this.crossOriginImages&&(f.crossOrigin="anonymous");f.onload=function(){window.clearTimeout(d);if(c)try{var a=document.createElement("canvas"),g=a.getContext("2d");a.height=f.height;a.width=f.width;g.drawImage(f,0,0);b(a.toDataURL())}catch(q){b(e.svgBrokenImage.src)}};f.onerror=function(){window.clearTimeout(d);c&&b(e.svgBrokenImage.src)};f.src=a}}catch(x){b(this.svgBrokenImage.src)}};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){f.model.beginUpdate();try{var g=mxUtils.parseXml(a),n=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var t=n.getElementsByTagName("diagram");if(1==t.length)n=Editor.parseDiagramNode(t[0]);else if(1<t.length){a={};var g=[],m=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(n=Editor.parseDiagramNode(t[0]),e=!1,m=1);for(;m<t.length;m++){var p=t[m].getAttribute("id");
+t[m].removeAttribute("id");var u=this.updatePageRoot(new DiagramPage(t[m]));a[p]=t[m].getAttribute("id");var v=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[v+1]));f.model.execute(new ChangePage(this,u,u,v,!0));g.push(u)}this.updatePageLinks(a,g)}}null!=n&&"mxGraphModel"===n.nodeName&&(c=f.importGraphModel(n,b,d,e))}finally{f.model.endUpdate()}}}catch(K){if(k)throw K;this.handleError(K)}return c};EditorUi.prototype.updatePageLinks=function(a,b){for(var c=0;c<b.length;c++)this.updatePageLinksForCell(a,
+b[c].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var c=document.createElement("div"),d=this.editor.graph,f=d.getLinkForCell(b);null!=f&&d.setLinkForCell(b,this.updatePageLink(a,f));if(d.isHtmlLabel(b)){c.innerHTML=d.getLabel(b);for(var e=c.getElementsByTagName("a"),k=!1,m=0;m<e.length;m++)f=e[m].getAttribute("href"),null!=f&&(e[m].setAttribute("href",this.updatePageLink(a,f)),k=!0);k&&d.labelChanged(b,c.innerHTML)}for(m=0;m<d.model.getChildCount(b);m++)this.updatePageLinksForCell(a,
+d.model.getChildAt(b,m))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var c=a[b.substring(b.indexOf(",")+1)];b=null!=c?"data:page/id,"+c:null}else if("data:action/json,"==b.substring(0,17))try{var d=JSON.parse(b.substring(17));if(null!=d.actions){for(var f=0;f<d.actions.length;f++){var e=d.actions[f];null!=e.open&&"data:page/id,"==e.open.substring(0,13)&&(c=a[e.open.substring(e.open.indexOf(",")+1)],null!=c?e.open="data:page/id,"+c:delete e.open)}b="data:action/json,"+
+JSON.stringify(d)}}catch(x){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};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){var c=this.isRemoteVisioFormat(e);try{var f="UNKNOWN-VISIO",g=e.lastIndexOf(".");0<=g&&g<e.length&&(f=e.substring(g+1).toUpperCase());
+EditorUi.logEvent({category:f+"-MS-IMPORT-FILE",action:"filename_"+e,label:c?"remote":"local"})}catch(F){}if(c)if(null!=VSD_CONVERT_URL){c=new FormData;c.append("file1",a,e);var k=new XMLHttpRequest;k.open("POST",VSD_CONVERT_URL);k.responseType="blob";this.addRemoteServiceSecurityCheck(k);k.onreadystatechange=mxUtils.bind(this,function(){if(4==k.readyState)if(200<=k.status&&299>=k.status)try{var a=k.response;if("text/xml"==a.type){var c=new FileReader;c.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(u){d({message:mxResources.get("errorLoadingFile")})}});
+c.readAsText(a)}else this.doImportVisio(a,b,d,e)}catch(E){d(E)}else d({})});k.send(c)}else d({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else try{this.doImportVisio(a,b,d,e)}catch(F){d(F)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.importGraphML=
+function(a,b,d){d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,d)}catch(n){d(n)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?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()||this.handleError({message:mxResources.get("unknownError")})}catch(f){this.handleError(f)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,
+b,d){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length})}catch(n){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(n){d(n)}}else d({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",
+c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.generatePlantUmlImage=function(a,b,d,e){function c(a,c,b){c1=a>>2;c2=(a&3)<<4|c>>4;c3=(c&15)<<2|b>>6;c4=b&63;r="";r+=f(c1&63);r+=f(c2&63);r+=f(c3&63);return r+=f(c4&63)}function f(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"}var g=new XMLHttpRequest;g.open("GET",("txt"==b?PLANT_URL+"/txt/":"png"==b?PLANT_URL+"/png/":
+PLANT_URL+"/svg/")+function(a){r="";for(i=0;i<a.length;i+=3)r=i+2==a.length?r+c(a.charCodeAt(i),a.charCodeAt(i+1),0):i+1==a.length?r+c(a.charCodeAt(i),0,0):r+c(a.charCodeAt(i),a.charCodeAt(i+1),a.charCodeAt(i+2));return r}(pako.deflateRaw(a,{to:"string"})),!0);"txt"!=b&&(g.responseType="blob");g.onload=function(a){if(200<=this.status&&300>this.status)if("txt"==b)d(this.response);else{var c=new FileReader;c.readAsDataURL(this.response);c.onloadend=function(a){var b=new Image;b.onload=function(){var a=
+b.width,f=b.height;if(0==a&&0==f){var e=c.result,g=e.indexOf(","),e=decodeURIComponent(escape(atob(e.substring(g+1)))),e=mxUtils.parseXml(e).getElementsByTagName("svg");0<e.length&&(a=parseFloat(e[0].getAttribute("width")),f=parseFloat(e[0].getAttribute("height")))}d(c.result,a,f)};b.src=c.result};c.onerror=function(a){e(a)}}else e(a)};g.onerror=function(a){e(a)};g.send()};EditorUi.prototype.insertAsPreText=function(a,b,d){var c=this.editor.graph,f=null;c.getModel().beginUpdate();try{f=c.insertVertex(null,
+null,"<pre>"+a+"</pre>",b,d,1,1,"text;html=1;align=left;verticalAlign=top;"),c.updateCellSize(f,!0)}finally{c.getModel().endUpdate()}return f};EditorUi.prototype.insertTextAt=function(a,b,d,e,k,l,m){l=null!=l?l:!0;m=null!=m?m:!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,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(f){if("data:"==a.substring(0,5))this.resizeImage(f,a,mxUtils.bind(this,function(a,f,e){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),m,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/
+f.height)),g=Math.round(f.width*e);f=Math.round(f.height*e);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),g,f,"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=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,l);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,d,l))}),mxUtils.bind(this,function(a){this.handleError(a)}));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])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),a.length>this.maxTextBytes&&(a=a.substring(0,this.maxTextBytes)+"..."),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.isLucidChartData=function(a){return null!=a&&('{"state":"{\\"Properties\\":'==a.substring(0,26)||'{"Properties":'==a.substring(0,14))};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport){if(null==this.importFileInputElt){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.type="",c.type="file",c.value="")}));c.style.display=
"none";document.body.appendChild(c);this.importFileInputElt=c}this.importFileInputElt.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&&/(\.v(dx|sdx?))($|\?)/i.test(c)){var b=new Blob([a],{type:"application/octet-stream"});this.importVisio(b,mxUtils.bind(this,function(a){this.importXml(a,
-0,0,!0)}),null,c)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var g=this.dialog,f=g.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;f.apply(g,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(a,b,d){var c=this,g=mxUtils.bind(this,function(){this.loadingExtensions=
-!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(g){if(0==Object.keys(g.files).length)d();else{var f=0,k,m=!1;g.forEach(function(a,c){var g=c.name.toLowerCase();"diagram/diagram.xml"==g?(m=!0,c.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):d()})):0==g.indexOf("versions/")&&(g=parseInt(g.substr(9)),g>f&&(f=g,k=c))});0<f?k.async("string").then(function(g){!c.isOffline()&&(new XMLHttpRequest).upload&&c.isRemoteFileFormat(g,a.name)?c.parseFile(new Blob([g],{type:"application/octet-stream"}),
-mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):d())}),a.name):d()}):m||d()}},function(a){d(a)}):d()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?g():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",g))};EditorUi.prototype.importFile=function(a,b,d,f,l,m,n,t,u,x,y){x=null!=x?x:!0;var c=!1,g=null,k=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,f,x);null!=t&&t(c)});"image"==b.substring(0,5)?(u=!1,"image/png"==b.substring(0,9)&&(b=y?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(g=this.importXml(b,d,f,x),u=!0)),u||(b=this.editor.graph,y=a.indexOf(";"),0<y&&(a=a.substring(0,y)+a.substring(a.indexOf(",",y+1))),x&&b.isGridEnabled()&&(d=b.snap(d),f=b.snap(f)),g=[b.insertVertex(null,null,"",d,f,l,m,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
-a+";")])):/(\.*<graphml )/.test(a)?(c=!0,this.importGraphML(a,k)):null!=u&&null!=n&&(/(\.v(dx|sdx?))($|\?)/i.test(n)||/(\.vs(x|sx?))($|\?)/i.test(n))?(c=!0,this.importVisio(u,k)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,n)?(c=!0,this.parseFile(null!=u?u:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?k(a.responseText):null!=t&&t(null))}),n)):0==a.indexOf("PK")&&null!=u?(c=!0,this.importZipFile(u,
-k,mxUtils.bind(this,function(){g=this.insertTextAt(this.validateFileData(a),d,f,!0,null,x);t(g)}))):/(\.v(sd|dx))($|\?)/i.test(n)||/(\.vs(s|x))($|\?)/i.test(n)||(g=this.insertTextAt(this.validateFileData(a),d,f,!0,null,x));c||null==t||t(g);return g};EditorUi.prototype.base64Encode=function(a){for(var c="",b=0,d=a.length,f,m,l;b<d;){f=a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&
-3)<<4);c+="==";break}m=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(m&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((m&15)<<2);c+="=";break}l=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&
-3)<<4|(m&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((m&15)<<2|(l&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l&63)}return c};EditorUi.prototype.importFiles=function(a,b,d,f,l,m,n,t,u,x,y,A){b=null!=b?b:0;d=null!=d?d:0;f=null!=f?f:this.maxImageSize;x=null!=x?x:this.maxImageBytes;var c=null!=b&&null!=d,g=!0,k=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=y||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,
-6)&&a[q].size>p){k=!0;break}var z=mxUtils.bind(this,function(){var k=this.editor.graph,p=k.gridSize;l=null!=l?l:mxUtils.bind(this,function(a,b,d,g,f,k,m,l,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,m)),null):this.importFile(a,b,d,g,f,k,m,l,p,c,A)});m=null!=m?m:mxUtils.bind(this,function(a){k.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,v=q,u=[],z=mxUtils.bind(this,function(a,
-c){u[a]=c;if(0==--v){this.spinner.stop();if(null!=t)t(u);else{var b=[];k.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var g=u[d]();null!=g&&(b=b.concat(g))}}finally{k.getModel().endUpdate()}}m(b)}}),B=0;B<q;B++)mxUtils.bind(this,function(c){var m=a[c];if(null!=m){var q=new FileReader;q.onload=mxUtils.bind(this,function(a){if(null==n||n(m))if("image/"==m.type.substring(0,6))if("image/svg"==m.type.substring(0,9)){var q=a.target.result,v=q.indexOf(","),u=decodeURIComponent(escape(atob(q.substring(v+
-1)))),t=mxUtils.parseXml(u),u=t.getElementsByTagName("svg");if(0<u.length){var u=u[0],E=A?null:u.getAttribute("content");null!=E&&"<"!=E.charAt(0)&&"%"!=E.charAt(0)&&(E=unescape(window.atob?atob(E):Base64.decode(E,!0)));null!=E&&"%"==E.charAt(0)&&(E=decodeURIComponent(E));null==E||"<mxfile "!==E.substring(0,8)&&"<mxGraphModel "!==E.substring(0,14)?z(c,mxUtils.bind(this,function(){try{if(q.substring(0,v+1),null!=t){var a=t.getElementsByTagName("svg");if(0<a.length){var g=a[0],n=parseFloat(g.getAttribute("width")),
-u=parseFloat(g.getAttribute("height")),y=g.getAttribute("viewBox");if(null==y||0==y.length)g.setAttribute("viewBox","0 0 "+n+" "+u);else if(isNaN(n)||isNaN(u)){var z=y.split(" ");3<z.length&&(n=parseFloat(z[2]),u=parseFloat(z[3]))}q=this.createSvgDataUri(mxUtils.getXml(g));var x=Math.min(1,Math.min(f/Math.max(1,n)),f/Math.max(1,u)),E=l(q,m.type,b+c*p,d+c*p,Math.max(1,Math.round(n*x)),Math.max(1,Math.round(u*x)),m.name);if(isNaN(n)||isNaN(u)){var B=new Image;B.onload=mxUtils.bind(this,function(){n=
-Math.max(1,B.width);u=Math.max(1,B.height);E[0].geometry.width=n;E[0].geometry.height=u;g.setAttribute("viewBox","0 0 "+n+" "+u);q=this.createSvgDataUri(mxUtils.getXml(g));var a=q.indexOf(";");0<a&&(q=q.substring(0,a)+q.substring(q.indexOf(",",a+1)));k.setCellStyles("image",q,[E[0]])});B.src=this.createSvgDataUri(mxUtils.getXml(g))}return E}}}catch(ca){}return null})):z(c,mxUtils.bind(this,function(){return l(E,"text/xml",b+c*p,d+c*p,0,0,m.name)}))}else z(c,mxUtils.bind(this,function(){return null}))}else{u=
-!1;if("image/png"==m.type){var B=A?null:this.extractGraphModelFromPng(a.target.result);if(null!=B&&0<B.length){var D=new Image;D.src=a.target.result;z(c,mxUtils.bind(this,function(){return l(B,"text/xml",b+c*p,d+c*p,D.width,D.height,m.name)}));u=!0}}u||(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(k){this.resizeImage(k,a.target.result,mxUtils.bind(this,function(k,n,q){z(c,mxUtils.bind(this,function(){if(null!=k&&k.length<x){var v=g&&this.isResampleImage(a.target.result,y)?Math.min(1,Math.min(f/n,f/q)):1;return l(k,m.type,b+c*p,d+c*p,Math.round(n*v),Math.round(q*v),m.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),g,f,y)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else l(a.target.result,
-m.type,b+c*p,d+c*p,240,160,m.name,function(a){z(c,function(){return a})},m)});/(\.v(dx|sdx?))($|\?)/i.test(m.name)||/(\.vs(x|sx?))($|\?)/i.test(m.name)?l(null,m.type,b+c*p,d+c*p,240,160,m.name,function(a){z(c,function(){return a})},m):"image"==m.type.substring(0,5)?q.readAsDataURL(m):q.readAsText(m)}})(B)});if(k){k=[];for(q=0;q<a.length;q++)k.push(a[q]);a=k;this.confirmImageResize(function(a){g=a;z()},u)}else z()};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,g=function(d,g){if(d||b)mxSettings.setResizeImages(d?g:null),mxSettings.save();c();a(g)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){g(a,!0)},function(a){g(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):g(!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 g=new XMLHttpRequest;g.open("POST",OPEN_URL);g.onreadystatechange=function(){b(g)};g.send(c);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(m){}};EditorUi.prototype.isResampleImage=function(a,
-b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,f,l,m){l=null!=l?l:this.maxImageSize;var c=Math.max(1,a.width),g=Math.max(1,a.height);if(f&&this.isResampleImage(b,m))try{var k=Math.max(c/l,g/l);if(1<k){var p=Math.round(c/k),n=Math.round(g/k),q=document.createElement("canvas");q.width=p;q.height=n;q.getContext("2d").drawImage(a,0,0,p,n);var v=q.toDataURL();if(v.length<b.length){var t=document.createElement("canvas");t.width=p;t.height=n;var x=
-t.toDataURL();v!==x&&(b=v,c=p,g=n)}}}catch(Z){}d(b,c,g)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var l=d,n=0;8>n;n++)l=1==(l&1)?3988292384^l>>>1:l>>>1,EditorUi.prototype.crcTable[d]=l;EditorUi.prototype.updateCRC=function(a,b,d,f){for(var c=0;c<f;c++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(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,f,l){function c(a,c){var b=p;p+=c;return a.substring(b,p)}function g(a){a=c(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 p=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=l&&l();else if(c(a,
-4),"IHDR"!=c(a,4))null!=l&&l();else{c(a,17);l=a.substring(0,p);do{var n=g(a);if("IDAT"==c(a,4)){l=a.substring(0,p-8);"pHYs"==b&&"dpi"==d?(d=Math.round(f/.0254),d=k(d)+k(d)+String.fromCharCode(1)):d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+f;f=4294967295;f=this.updateCRC(f,b,0,4);f=this.updateCRC(f,d,0,d.length);l+=k(d.length)+b+d+k(f^4294967295);l+=a.substring(p-8,a.length);break}l+=a.substring(p-8,p-4+n);c(a,n);c(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(l):
-Base64.encode(l,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){return Editor.extractGraphModelFromPng(a)};EditorUi.prototype.loadImage=function(a,b,d){try{var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a}catch(p){if(null!=d)d(p);else throw p;}};var t=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());
-var a=this,b=this.editor.graph,d=b.cellEditor.startEditing;b.cellEditor.startEditing=function(c,g){var f=this.graph.getAttributeForCell(c,"plantUmlData");if(null!=f){var k=JSON.parse(f),f=new TextareaDialog(a,mxResources.get("plantUml")+":",k.data,function(d){null!=d&&a.spinner.spin(document.body,mxResources.get("inserting"))&&a.generatePlantUmlImage(d,k.format,function(g,f,m){a.spinner.stop();b.getModel().beginUpdate();try{if("txt"==k.format)b.labelChanged(c,"<pre>"+g+"</pre>"),b.updateCellSize(c,
-!0);else{b.setCellStyles("image",a.convertDataUri(g),[c]);var l=b.model.getGeometry(c);null!=l&&(l=l.clone(),l.width=f,l.height=m,b.cellsResized([c],[l],!1))}b.setAttributeForCell(c,"plantUmlData",JSON.stringify({data:d,format:k.format}))}finally{b.getModel().endUpdate()}},function(b){a.handleError(e)})},null,null,400,220);a.showDialog(f.container,420,300,!0,!0);f.init()}else d.apply(this,arguments)};b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),
-c=!0}catch(O){a.handleError(O)}return c};var f=this.clearDefaultStyle;this.clearDefaultStyle=function(){f.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var l=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var c=0;c<a.pages.length;c++)if(a.pages[c]==a.currentPage){0<c&&(b+=(0<b.length?"&":
-"?")+"page="+c);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return l.apply(this,arguments)};var m=b.addClickHandler;b.addClickHandler=function(a,c,d){var g=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!=g&&g(a,c)};m.call(this,a,c,d)};t.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 n=b.getExportVariables;b.getExportVariables=function(){var b=n.apply(this,arguments);b.pagecount=null!=a.pages?a.pages.length:1;b.page=null!=a.currentPage?a.currentPage.getName():"";b.pagenumber=null!=a.pages&&null!=a.currentPage?mxUtils.indexOf(a.pages,
-a.currentPage)+1:1;return b};var x=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:"pagecount"==b?null!=a.pages?a.pages.length:1:x.apply(this,arguments)};var u=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var g=c.getAttribute("href");if(null==g||!b.isCustomLink(g)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))u.apply(this,arguments);
-else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(g),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 A=this.actions.get("print");A.setEnabled(!mxClient.IS_IOS||!navigator.standalone);A.visible=A.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"find"),this.keyHandler.bindAction(67,
+0,0,!0)}),null,c)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var f=this.dialog,e=f.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(f,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(a,b,d){var c=this,f=mxUtils.bind(this,function(){this.loadingExtensions=
+!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(f){if(0==Object.keys(f.files).length)d();else{var e=0,g,l=!1;f.forEach(function(a,c){var f=c.name.toLowerCase();"diagram/diagram.xml"==f?(l=!0,c.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):d()})):0==f.indexOf("versions/")&&(f=parseInt(f.substr(9)),f>e&&(e=f,g=c))});0<e?g.async("string").then(function(f){!c.isOffline()&&(new XMLHttpRequest).upload&&c.isRemoteFileFormat(f,a.name)?c.parseFile(new Blob([f],{type:"application/octet-stream"}),
+mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):d())}),a.name):d()}):l||d()}},function(a){d(a)}):d()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.importFile=function(a,b,d,e,k,l,m,p,q,v,y){v=null!=v?v:!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,m)):c=this.importXml(a,d,e,v);null!=p&&p(c)});"image"==b.substring(0,5)?(q=!1,"image/png"==b.substring(0,9)&&(b=y?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,v),q=!0)),q||(b=this.editor.graph,y=a.indexOf(";"),0<y&&(a=a.substring(0,y)+a.substring(a.indexOf(",",y+1))),v&&b.isGridEnabled()&&(d=b.snap(d),e=b.snap(e)),f=[b.insertVertex(null,null,"",d,e,k,l,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+a+";")])):/(\.*<graphml )/.test(a)?(c=!0,this.importGraphML(a,g)):null!=q&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(c=!0,this.importVisio(q,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(c=!0,this.parseFile(null!=q?q: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!=p&&p(null))}),m)):0==a.indexOf("PK")&&null!=q?(c=!0,this.importZipFile(q,
+g,mxUtils.bind(this,function(){f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,v);p(f)}))):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,v));c||null==p||p(f);return f};EditorUi.prototype.base64Encode=function(a){for(var c="",b=0,d=a.length,e,l,k;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}k=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&
+3)<<4|(l&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l&15)<<2|(k&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return c};EditorUi.prototype.importFiles=function(a,b,d,e,k,l,m,p,q,v,y,E){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;v=null!=v?v:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=y||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,
+6)&&a[t].size>n){g=!0;break}var x=mxUtils.bind(this,function(){var g=this.editor.graph,n=g.gridSize;k=null!=k?k:mxUtils.bind(this,function(a,b,d,f,e,g,l,k,n){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,l)),null):this.importFile(a,b,d,f,e,g,l,k,n,c,E)});l=null!=l?l:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,t=q,u=[],x=mxUtils.bind(this,function(a,
+c){u[a]=c;if(0==--t){this.spinner.stop();if(null!=p)p(u);else{var b=[];g.getModel().beginUpdate();try{for(var d=0;d<u.length;d++){var f=u[d]();null!=f&&(b=b.concat(f))}}finally{g.getModel().endUpdate()}}l(b)}}),A=0;A<q;A++)mxUtils.bind(this,function(c){var l=a[c];if(null!=l){var q=new FileReader;q.onload=mxUtils.bind(this,function(a){if(null==m||m(l))if("image/"==l.type.substring(0,6))if("image/svg"==l.type.substring(0,9)){var q=a.target.result,t=q.indexOf(","),u=decodeURIComponent(escape(atob(q.substring(t+
+1)))),p=mxUtils.parseXml(u),u=p.getElementsByTagName("svg");if(0<u.length){var u=u[0],D=E?null:u.getAttribute("content");null!=D&&"<"!=D.charAt(0)&&"%"!=D.charAt(0)&&(D=unescape(window.atob?atob(D):Base64.decode(D,!0)));null!=D&&"%"==D.charAt(0)&&(D=decodeURIComponent(D));null==D||"<mxfile "!==D.substring(0,8)&&"<mxGraphModel "!==D.substring(0,14)?x(c,mxUtils.bind(this,function(){try{if(q.substring(0,t+1),null!=p){var a=p.getElementsByTagName("svg");if(0<a.length){var f=a[0],m=parseFloat(f.getAttribute("width")),
+u=parseFloat(f.getAttribute("height")),y=f.getAttribute("viewBox");if(null==y||0==y.length)f.setAttribute("viewBox","0 0 "+m+" "+u);else if(isNaN(m)||isNaN(u)){var x=y.split(" ");3<x.length&&(m=parseFloat(x[2]),u=parseFloat(x[3]))}q=this.createSvgDataUri(mxUtils.getXml(f));var v=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,u)),D=k(q,l.type,b+c*n,d+c*n,Math.max(1,Math.round(m*v)),Math.max(1,Math.round(u*v)),l.name);if(isNaN(m)||isNaN(u)){var A=new Image;A.onload=mxUtils.bind(this,function(){m=
+Math.max(1,A.width);u=Math.max(1,A.height);D[0].geometry.width=m;D[0].geometry.height=u;f.setAttribute("viewBox","0 0 "+m+" "+u);q=this.createSvgDataUri(mxUtils.getXml(f));var a=q.indexOf(";");0<a&&(q=q.substring(0,a)+q.substring(q.indexOf(",",a+1)));g.setCellStyles("image",q,[D[0]])});A.src=this.createSvgDataUri(mxUtils.getXml(f))}return D}}}catch(aa){}return null})):x(c,mxUtils.bind(this,function(){return k(D,"text/xml",b+c*n,d+c*n,0,0,l.name)}))}else x(c,mxUtils.bind(this,function(){return null}))}else{u=
+!1;if("image/png"==l.type){var A=E?null:this.extractGraphModelFromPng(a.target.result);if(null!=A&&0<A.length){var P=new Image;P.src=a.target.result;x(c,mxUtils.bind(this,function(){return k(A,"text/xml",b+c*n,d+c*n,P.width,P.height,l.name)}));u=!0}}u||(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,m,q){x(c,mxUtils.bind(this,function(){if(null!=g&&g.length<v){var t=f&&this.isResampleImage(a.target.result,y)?Math.min(1,Math.min(e/m,e/q)):1;return k(g,l.type,b+c*n,d+c*n,Math.round(m*t),Math.round(q*t),l.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,y)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else k(a.target.result,
+l.type,b+c*n,d+c*n,240,160,l.name,function(a){x(c,function(){return a})},l)});/(\.v(dx|sdx?))($|\?)/i.test(l.name)||/(\.vs(x|sx?))($|\?)/i.test(l.name)?k(null,l.type,b+c*n,d+c*n,240,160,l.name,function(a){x(c,function(){return a})},l):"image"==l.type.substring(0,5)?q.readAsDataURL(l):q.readAsText(l)}})(A)});if(g){g=[];for(t=0;t<a.length;t++)g.push(a[t]);a=g;this.confirmImageResize(function(a){f=a;x()},q)}else x()};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,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(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):f(!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 f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.send(c);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(l){}};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,l){k=null!=k?k: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/k,f/k);if(1<g){var n=Math.round(c/g),m=Math.round(f/g),t=document.createElement("canvas");t.width=n;t.height=m;t.getContext("2d").drawImage(a,0,0,n,m);var u=t.toDataURL();if(u.length<b.length){var p=document.createElement("canvas");p.width=n;p.height=m;var v=
+p.toDataURL();u!==v&&(b=u,c=n,f=m)}}}catch(Y){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var k=d,m=0;8>m;m++)k=1==(k&1)?3988292384^k>>>1:k>>>1,EditorUi.prototype.crcTable[d]=k;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(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=n;n+=c;return a.substring(b,n)}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 n=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,n);do{var m=f(a);if("IDAT"==c(a,4)){k=a.substring(0,n-8);"pHYs"==b&&"dpi"==d?(d=Math.round(e/.0254),d=g(d)+g(d)+String.fromCharCode(1)):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(n-8,a.length);break}k+=a.substring(n-8,n-4+m);c(a,m);c(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(k):
+Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){return Editor.extractGraphModelFromPng(a)};EditorUi.prototype.loadImage=function(a,b,d){try{var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a}catch(n){if(null!=d)d(n);else throw n;}};var p=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());
+var a=this,b=this.editor.graph,d=b.cellEditor.startEditing;b.cellEditor.startEditing=function(c,f){var e=this.graph.getAttributeForCell(c,"plantUmlData");if(null!=e){var g=JSON.parse(e),e=new TextareaDialog(a,mxResources.get("plantUml")+":",g.data,function(d){null!=d&&a.spinner.spin(document.body,mxResources.get("inserting"))&&a.generatePlantUmlImage(d,g.format,function(f,e,l){a.spinner.stop();b.getModel().beginUpdate();try{if("txt"==g.format)b.labelChanged(c,"<pre>"+f+"</pre>"),b.updateCellSize(c,
+!0);else{b.setCellStyles("image",a.convertDataUri(f),[c]);var k=b.model.getGeometry(c);null!=k&&(k=k.clone(),k.width=e,k.height=l,b.cellsResized([c],[k],!1))}b.setAttributeForCell(c,"plantUmlData",JSON.stringify({data:d,format:g.format}))}finally{b.getModel().endUpdate()}},function(b){a.handleError(b)})},null,null,400,220);a.showDialog(e.container,420,300,!0,!0);e.init()}else d.apply(this,arguments)};b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),
+c=!0}catch(K){a.handleError(K)}return c};var e=this.clearDefaultStyle;this.clearDefaultStyle=function(){e.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var k=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var c=0;c<a.pages.length;c++)if(a.pages[c]==a.currentPage){0<c&&(b+=(0<b.length?"&":
+"?")+"page="+c);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return k.apply(this,arguments)};var l=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)};l.call(this,a,c,d)};p.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 m=b.getExportVariables;b.getExportVariables=function(){var b=m.apply(this,arguments);b.pagecount=null!=a.pages?a.pages.length:1;b.page=null!=a.currentPage?a.currentPage.getName():"";b.pagenumber=null!=a.pages&&null!=a.currentPage?mxUtils.indexOf(a.pages,
+a.currentPage)+1:1;return b};var v=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:"pagecount"==b?null!=a.pages?a.pages.length:1:v.apply(this,arguments)};var q=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var f=c.getAttribute("href");if(null==f||!b.isCustomLink(f)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))q.apply(this,arguments);
+else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(f),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 B=this.actions.get("print");B.setEnabled(!mxClient.IS_IOS||!navigator.standalone);B.visible=B.isEnabled();if(!this.editor.chromeless||this.editor.editable)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_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize"),this.installImagePasteHandler(),this.installNativeClipboardHandler();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,g,f,k){b.insertImage(a,f,k)},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 g=this.maxImageSize,g=Math.min(1,Math.min(g/Math.max(1,d)),g/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*g,a*g)})):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()})))}));"undefined"!==typeof window.mxSettings&&(A=this.editor.graph.view,A.setUnit(mxSettings.getUnit()),A.addListener("unitChanged",function(a,b){mxSettings.setUnit(b.getProperty("unit"));mxSettings.save()}),this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:
-new mxDualRuler(this,A.unit),this.refresh());if("1"==urlParams.styledev){A=document.getElementById("geFooter");null!=A&&(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)})),A.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 y=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==
-this.styleInput?!0:y.apply(this,arguments)}}A=document.getElementById("geInfo");null!=A&&A.parentNode.removeChild(A);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var C=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=C&&(C.parentNode.removeChild(C),C=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=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!=C&&(C.parentNode.removeChild(C),C=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,g=b.view.scale,f=c.x/g-d.x,k=c.y/g-d.y;mxEvent.isAltDown(a)&&(k=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,k,this.maxImageSize,null,null,null,
-null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var m=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,k,!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 p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?
-(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var n=!0,q=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(l,f,k,!0,p,null,n))});p&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;q()},mxEvent.isControlDown(a)):q()}else null!=m&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(m)?this.loadImage(decodeURIComponent(m),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,k,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+m+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(m,f,k,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
-f,k,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var c=b.getProperty("edit");null!=c&&this.updateEditReferences(c)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var a=
-this.editor.graph;a.container.addEventListener("paste",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,d=!1,g=0;g<c.types.length;g++)if("text/"===c.types[g].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var l=f[index];if("file"===l.kind){if(a.isEditing())this.importFiles([l.getAsFile()],0,0,this.maxImageSize,function(b,c,d,g,f,k){a.insertImage(b,f,k)},function(){},function(a){return"image/"==a.type.substring(0,
-6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var n=this.editor.graph.getInsertPoint();this.importFiles([l.getAsFile()],n.x,n.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(u){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function a(){window.setTimeout(function(){d.innerHTML="&nbsp;";d.focus();document.execCommand("selectAll",!1,null)},0)}var b=this.editor.graph,d=document.createElement("div");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect",
-"off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");d.style.position="absolute";d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.display="block";d.contentEditable=!0;mxUtils.setOpacity(d,0);d.style.width="1px";d.style.height="1px";d.innerHTML="&nbsp;";var f=!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)||f||(d.style.left=b.container.scrollLeft+10+"px",d.style.top=b.container.scrollTop+10+"px",b.container.appendChild(d),f=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){d.focus();document.execCommand("selectAll",!1,null)},0):(d.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(){!f||224!=c&&17!=c&&91!=c||(f=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),d.parentNode.removeChild(d),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(d,"copy",mxUtils.bind(this,function(c){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(d),a()}catch(z){this.handleError(z)}}));mxEvent.addListener(d,"cut",mxUtils.bind(this,function(c){if(b.isEnabled())try{mxClipboard.copy(b),
-this.copyCells(d,!0),a()}catch(z){this.handleError(z)}}));mxEvent.addListener(d,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(d.innerHTML="&nbsp;",d.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,d);d.innerHTML="&nbsp;"}),0))}),!0);var l=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==d?!0:l.apply(this,arguments)}};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,
+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,f,e,g){b.insertImage(a,e,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 f=this.maxImageSize,f=Math.min(1,Math.min(f/Math.max(1,d)),f/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*f,a*f)})):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()})))}));"undefined"!==typeof window.mxSettings&&(B=this.editor.graph.view,B.setUnit(mxSettings.getUnit()),B.addListener("unitChanged",function(a,b){mxSettings.setUnit(b.getProperty("unit"));mxSettings.save()}),this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:
+new mxDualRuler(this,B.unit),this.refresh());if("1"==urlParams.styledev){B=document.getElementById("geFooter");null!=B&&(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)})),B.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 y=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==
+this.styleInput?!0:y.apply(this,arguments)}}B=document.getElementById("geInfo");null!=B&&B.parentNode.removeChild(B);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var z=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),z=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==z&&(!mxClient.IS_IE||10<document.documentMode)&&(z=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!=z&&(z.parentNode.removeChild(z),z=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,g=c.y/f-d.y;mxEvent.isAltDown(a)&&(g=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,e,g,this.maxImageSize,null,null,null,
+null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var l=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,e,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 n=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?
+(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(n=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var m=!0,q=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k,e,g,!0,n,null,m))});n&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;q()},mxEvent.isControlDown(a)):q()}else null!=l&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)?this.loadImage(decodeURIComponent(l),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,"",e,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+l+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(l,e,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
+e,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var c=b.getProperty("edit");null!=c&&this.updateEditReferences(c)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var a=
+this.editor.graph;a.container.addEventListener("paste",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,d=!1,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){d=!0;break}if(!d){var e=c.items;for(index in e){var k=e[index];if("file"===k.kind){if(a.isEditing())this.importFiles([k.getAsFile()],0,0,this.maxImageSize,function(b,c,d,f,e,g){a.insertImage(b,e,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 m=this.editor.graph.getInsertPoint();this.importFiles([k.getAsFile()],m.x,m.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(q){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function a(){window.setTimeout(function(){d.innerHTML="&nbsp;";d.focus();document.execCommand("selectAll",!1,null)},0)}var b=this.editor.graph,d=document.createElement("div");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect",
+"off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");d.style.position="absolute";d.style.whiteSpace="nowrap";d.style.overflow="hidden";d.style.display="block";d.contentEditable=!0;mxUtils.setOpacity(d,0);d.style.width="1px";d.style.height="1px";d.innerHTML="&nbsp;";var e=!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)||e||(d.style.left=b.container.scrollLeft+10+"px",d.style.top=b.container.scrollTop+10+"px",b.container.appendChild(d),e=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){d.focus();document.execCommand("selectAll",!1,null)},0):(d.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(){!e||224!=c&&17!=c&&91!=c||(e=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),d.parentNode.removeChild(d),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(d,"copy",mxUtils.bind(this,function(c){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(d),a()}catch(x){this.handleError(x)}}));mxEvent.addListener(d,"cut",mxUtils.bind(this,function(c){if(b.isEnabled())try{mxClipboard.copy(b),
+this.copyCells(d,!0),a()}catch(x){this.handleError(x)}}));mxEvent.addListener(d,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(d.innerHTML="&nbsp;",d.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,d);d.innerHTML="&nbsp;"}),0))}),!0);var k=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==d?!0:k.apply(this,arguments)}};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(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}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();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(a){a.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(c){}this.fireEvent(new mxEventObject("styleChanged",
"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(a,b){mxSettings.setCustomFonts(this.menus.customFonts);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("dark"==uiTheme);this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){console.log("gridColorChanged",this.editor.graph.view.gridColor);mxSettings.setGridColor(this.editor.graph.view.gridColor,"dark"==uiTheme);
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())),g=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(g));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=g,c.pasteCounter=0);a.focus();
+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())),f=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(f));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=f,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.convertLucidChart(d,mxUtils.bind(this,function(a){var b=this.editor.graph;b.setSelectionCells(this.importXml(a,0,0));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,
-function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,g=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var l=g.lastIndexOf("%3E");0<=l&&l<g.length-3&&(g=g.substring(0,l+3))}catch(u){}try{var c=b.getElementsByTagName("span"),n=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(g);this.isCompatibleString(n)&&(f=!0,g=n)}catch(u){}d.lastPasteXml==g?d.pasteCounter++:(d.lastPasteXml=
-g,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=g&&0<g.length&&(f||this.isCompatibleString(g)?d.setSelectionCells(this.importXml(g,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==g&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(g,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(u){}}}}};
+function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),e=!1;try{var k=f.lastIndexOf("%3E");0<=k&&k<f.length-3&&(f=f.substring(0,k+3))}catch(q){}try{var c=b.getElementsByTagName("span"),m=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(f);this.isCompatibleString(m)&&(e=!0,f=m)}catch(q){}d.lastPasteXml==f?d.pasteCounter++:(d.lastPasteXml=
+f,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=f&&0<f.length&&(e||this.isCompatibleString(f)?d.setSelectionCells(this.importXml(f,c,c)):(e=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==f&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(f,e.x+c,e.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(q){}}}}};
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?EditorUi.drawHost+"/":
-"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,f;if(null==a){f=document.body;var m=document.documentElement;d=(f.clientWidth||m.clientWidth)-3;f=Math.max(f.clientHeight||0,m.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,f=a.clientHeight;m=document.createElement("div");m.style.zIndex=mxPopupMenu.prototype.zIndex+
-2;m.style.border="3px dotted rgb(254, 137, 12)";m.style.pointerEvents="none";m.style.position="absolute";m.style.top=b+"px";m.style.left=c+"px";m.style.width=Math.max(0,d-3)+"px";m.style.height=Math.max(0,f-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(m):document.body.appendChild(m);return m};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){try{var d=c.target.result,g=a.name;if(null!=g&&0<g.length){!this.useCanvasForExport&&/(\.png)$/i.test(g)&&(g=g.substring(0,g.length-4)+".drawio");
-var f=mxUtils.bind(this,function(a){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";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,g))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,g,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(g)||/(\.vs(x|sx?))($|\?)/i.test(g))this.importVisio(a,
-mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,g))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(this.isLucidChartData(d))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,g,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));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(F){this.handleError(F,mxResources.get("errorLoadingFile"))}}else 0==d.indexOf("PK")?this.importZipFile(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(d,g,b)})):("image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,g,b))}}catch(F){this.handleError(F)}});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(),g=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))});if(null!=a&&0<a.length)null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?g():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,g,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(){null!=c&&c.isModified()?
-this.confirm(mxResources.get("allChangesLost"),null,g,mxResources.get("cancel"),mxResources.get("discardChanges")):g()})));else throw Error(mxResources.get("notADiagramFile"));};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,g=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(g[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(g[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(g[mxConstants.STYLE_ENDARROW])));for(var g=d.model.getChildCount(a),f=0;f<g;f++)this.addBasenamesForCell(d.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=
+"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 l=document.documentElement;d=(e.clientWidth||l.clientWidth)-3;e=Math.max(e.clientHeight||0,l.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;l=document.createElement("div");l.style.zIndex=mxPopupMenu.prototype.zIndex+
+2;l.style.border="3px dotted rgb(254, 137, 12)";l.style.pointerEvents="none";l.style.position="absolute";l.style.top=b+"px";l.style.left=c+"px";l.style.width=Math.max(0,d-3)+"px";l.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(l):document.body.appendChild(l);return l};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){try{var d=c.target.result,f=a.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".drawio");
+var e=mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";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,f))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,
+mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?e(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},
+mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,f,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));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(F){this.handleError(F,mxResources.get("errorLoadingFile"))}}else 0==d.indexOf("PK")?this.importZipFile(a,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(d,f,b)})):("image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b))}}catch(F){this.handleError(F)}});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(),f=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))});if(null!=a&&0<a.length)null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?f():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=c&&c.isModified()?
+this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var 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,f=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(f[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(f[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(f[mxConstants.STYLE_ENDARROW])));for(var f=d.model.getChildCount(a),e=0;e<f;e++)this.addBasenamesForCell(d.model.getChildAt(a,e),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.ruler&&(this.ruler.hRuler.container.style.visibility=a?"":"hidden",this.ruler.vRuler.container.style.visibility=a?"":"hidden");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 b=this.editor.graph;return{event:a,
-pageVisible:b.pageVisible,translate:b.view.translate,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,f=null,m=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,
-m);mxEvent.addListener(window,"message",mxUtils.bind(this,function(g){if(g.source==(window.opener||window.parent)){var k=g.data,m=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"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=Graph.decompress(a)))}catch(T){}return a});if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(P){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();m=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):
-null,function(a){null!=a&&l.postMessage(JSON.stringify({event:"prompt",value:a,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(m.container,300,80,!0,!1);m.init();return}if("draft"==k.action){var n=m(k.xml);this.spinner.stop();m=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),n,mxUtils.bind(this,function(){this.hideDialog();l.postMessage(JSON.stringify({event:"draft",result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();
-l.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();l.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{m.init()}catch(P){l.postMessage(JSON.stringify({event:"draft",error:P.toString(),
-message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var m=1==k.enableRecent,n=1==k.enableSearch,p=1==k.enableCustomTemp,m=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?l.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,g,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,m?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",
-null,null,a,function(){a(null,"Network Error!")})}):null,n?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,mxUtils.bind(this,function(a,b,c){l.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")}),null,null,p?mxUtils.bind(this,function(a){this.remoteInvoke("getCustomTemplates",null,null,a,function(){a({},0)})}):null);this.showDialog(m.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
-m.init();return}if("textContent"==k.action){m=this.getDiagramTextContent();l.postMessage(JSON.stringify({event:"textContent",data:m,message:k}),"*");return}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 q=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||
-k.show?this.spinner.spin(document.body,q):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 t=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var x=this.editor.graph,z=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.message=
-k;b.data=a;b.xml=encodeURIComponent(t);l.postMessage(JSON.stringify(b),"*")}),A=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(t)));x!=this.editor.graph&&x.container.parentNode.removeChild(x.container);z(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var C=x.getGlobalVariable,x=this.createTemporaryGraph(x.getStylesheet()),E=this.pages[0];x.getGlobalVariable=function(a){return"page"==
-a?E.getName():"pagenumber"==a?1:C.apply(this,arguments)};document.body.appendChild(x.container);x.model.setRoot(E.root)}this.exportToCanvas(mxUtils.bind(this,function(a){A(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){A(null)}),null,null,k.scale,null,null,null,x)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+(null!=k.scale?"&scale="+k.scale:"")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(t)))).send(mxUtils.bind(this,function(a){200<=
-a.getStatus()&&299>=a.getStatus()?z("data:image/png;base64,"+a.getText()):A(null)}),mxUtils.bind(this,function(){A(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);q=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))m=this.getXmlFileData(),q.xml=mxUtils.getXml(m),q.data=this.getFileData(null,null,!0,null,null,null,m),q.format=k.format;else if("html"==k.format)t=this.editor.getGraphXml(),q.data=
-this.getHtml(t,this.editor.graph),q.xml=mxUtils.getXml(t),q.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;m=this.editor.graph.background;m==mxConstants.NONE&&(m=null);q.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);q.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(q.xml,this.editor.graph,
-null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();q.data=this.createSvgDataUri(a);l.postMessage(JSON.stringify(q),"*")})):this.convertImages(this.editor.graph.getSvg(m),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();q.data=this.createSvgDataUri(mxUtils.getXml(a));l.postMessage(JSON.stringify(q),"*")}));return}m="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(m));
-q.data=this.createSvgDataUri(m)}l.postMessage(JSON.stringify(q),"*")}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&&(n=document.createElement("span"),mxUtils.write(n,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",
-this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(n),this.embedFilenameSpan=n),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):k.xml;else{"remoteInvokeReady"==k.action?this.handleRemoteInvokeReady(l):"remoteInvoke"==k.action?this.handleRemoteInvoke(k):"remoteInvokeResponse"==
-k.action?this.handleRemoteInvokeResponse(k):l.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}var D=mxUtils.bind(this,function(g,k){c=!0;try{a(g,k)}catch(W){this.handleError(W)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var m=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=m();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=m();
-if(d!=f&&!c){var g=this.createLoadMessage("autosave");g.xml=d;d=JSON.stringify(g);(window.opener||window.parent).postMessage(d,"*")}f=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||l.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=k&&"function"===typeof k.substring&&"data:application/vnd.visio;base64,"==k.substring(0,34)?(m="0M8R4KGxGuE"==k.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(k.substring(k.indexOf(",")+
-1)),function(a){D(a,g)},mxUtils.bind(this,function(a){this.handleError(a)}),m)):null!=k&&"function"===typeof k.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,"")?this.parseFile(new Blob([k],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&D(a.responseText,g)}),""):null!=k&&"function"===typeof k.substring&&this.isLucidChartData(k)?this.convertLucidChart(k,
-mxUtils.bind(this,function(a){D(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(k=m(k),D(k,g))}}));var l=window.opener||window.parent,m="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";l.postMessage(m,"*")};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":"0px";a.style.paddingLeft="8px";a.style.paddingBottom=
-"2px";var b=document.createElement("button");b.className="geBigButton";"1"==urlParams.noSaveBtn?(mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)):(mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),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.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",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.className=
-"geBigButton geBigStandardButton";b.style.marginLeft="6px";b.style.marginRight="20px";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.isOffline()?null:"https://about.draw.io/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),g=0;g<a.length;g++){var f=new window[a[g].layout](c);if(null!=a[g].config)for(var l in a[g].config)f[l]=a[g].config[l];this.executeLayout(function(){f.execute(c.getDefaultParent(),
-0==d.length?null:d)},g==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],g=[],f={};if(0<c.length){var l={},n=null,t=null,x=null,y=null,A=null,v=null,B=null,C=null,Z="",I="auto",Q="auto",E=null,L=null,P=40,T=40,ta=100,W=0,H=this.editor.graph;H.getGraphBounds();for(var aa=function(){null!=b?b(fa):(H.setSelectionCells(fa),H.scrollCellToVisible(H.getSelectionCell()))},na=H.getFreeInsertPoint(),ja=na.x,ba=na.y,na=ba,ka=null,S="auto",C=null,X=[],pa=null,ga=null,R=
-0;R<c.length&&"#"==c[R].charAt(0);){a=c[R];for(R++;R<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[R].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[R].substring(1)),R++;if("#"!=a.charAt(1)){var la=a.indexOf(":");if(0<la){var M=mxUtils.trim(a.substring(1,la)),J=mxUtils.trim(a.substring(la+1));"label"==M?ka=H.sanitizeHtml(J):"labelname"==M&&0<J.length&&"-"!=J?y=J:"labels"==M&&0<J.length&&"-"!=J?A=JSON.parse(J):"style"==M?n=J:"parentstyle"==M?v=J:"stylename"==M&&0<J.length&&"-"!=J?x=J:"styles"==
-M&&0<J.length&&"-"!=J?t=JSON.parse(J):"identity"==M&&0<J.length&&"-"!=J?B=J:"parent"==M&&0<J.length&&"-"!=J?C=J:"namespace"==M&&0<J.length&&"-"!=J?Z=J:"width"==M?I=J:"height"==M?Q=J:"left"==M&&0<J.length?E=J:"top"==M&&0<J.length?L=J:"ignore"==M?ga=J.split(","):"connect"==M?X.push(JSON.parse(J)):"link"==M?pa=J:"padding"==M?W=parseFloat(J):"edgespacing"==M?P=parseFloat(J):"nodespacing"==M?T=parseFloat(J):"levelspacing"==M?ta=parseFloat(J):"layout"==M&&(S=J)}}}if(null==c[R])throw Error(mxResources.get("invalidOrMissingFile"));
-var ea=this.editor.csvToArray(c[R]),M=la=null;if(null!=B||null!=C)for(var N=0;N<ea.length;N++)B==ea[N]&&(la=N),C==ea[N]&&(M=N);null==ka&&(ka="%"+ea[0]+"%");if(null!=X)for(var U=0;U<X.length;U++)null==l[X[U].to]&&(l[X[U].to]={});H.model.beginUpdate();try{for(N=R+1;N<c.length;N++){var ha=this.editor.csvToArray(c[N]);if(null==ha){var ia=40<c[N].length?c[N].substring(0,40)+"...":c[N];throw Error(N+" ("+ia+") "+mxResources.get("containsValidationErrors"));}if(ha.length==ea.length){var K=null,qa=null!=
-la?Z+ha[la]:null;null!=qa&&(K=H.model.getCell(qa));var B=null!=K,ca=new mxCell(ka,new mxGeometry(ja,na,0,0),n||"whiteSpace=wrap;html=1;");ca.vertex=!0;ca.id=qa;for(var da=0;da<ha.length;da++)H.setAttributeForCell(ca,ea[da],ha[da]);if(null!=y&&null!=A){var Ba=A[ca.getAttribute(y)];null!=Ba&&H.labelChanged(ca,Ba)}if(null!=x&&null!=t){var xa=t[ca.getAttribute(x)];null!=xa&&(ca.style=xa)}H.setAttributeForCell(ca,"placeholders","1");ca.style=H.replacePlaceholders(ca,ca.style);B&&(H.model.setGeometry(K,
-ca.geometry),H.model.setStyle(K,ca.style),0>mxUtils.indexOf(g,K)&&g.push(K));K=ca;if(!B)for(U=0;U<X.length;U++)l[X[U].to][K.getAttribute(X[U].to)]=K;null!=pa&&"link"!=pa&&(H.setLinkForCell(K,K.getAttribute(pa)),H.setAttributeForCell(K,pa,null));H.fireEvent(new mxEventObject("cellsInserted","cells",[K]));var Aa=this.editor.graph.getPreferredSizeForCell(K);K.vertex&&(null!=E&&null!=K.getAttribute(E)&&(K.geometry.x=ja+parseFloat(K.getAttribute(E))),null!=L&&null!=K.getAttribute(L)&&(K.geometry.y=ba+
-parseFloat(K.getAttribute(L))),"@"==I.charAt(0)&&null!=K.getAttribute(I.substring(1))?K.geometry.width=parseFloat(K.getAttribute(I.substring(1))):K.geometry.width="auto"==I?Aa.width+W:parseFloat(I),"@"==Q.charAt(0)&&null!=K.getAttribute(Q.substring(1))?K.geometry.height=parseFloat(K.getAttribute(Q.substring(1))):K.geometry.height="auto"==Q?Aa.height+W:parseFloat(Q),na+=K.geometry.height+T);B?(null==f[qa]&&(f[qa]=[]),f[qa].push(K)):(C=null!=M?H.model.getCell(Z+ha[M]):null,d.push(K),null!=C?(C.style=
-H.replacePlaceholders(C,v),H.addCell(K,C)):g.push(H.addCell(K)))}}for(var ma=g.slice(),fa=g.slice(),U=0;U<X.length;U++)for(var sa=X[U],N=0;N<g.length;N++){var K=g[N],Fa=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){H.setAttributeForCell(b,c.from,null);for(var d=d.split(","),g=0;g<d.length;g++){var f=l[c.to][d[g]];if(null!=f){var k=c.label;null!=c.fromlabel&&(k=(b.getAttribute(c.fromlabel)||"")+(k||""));null!=c.tolabel&&(k=(k||"")+(f.getAttribute(c.tolabel)||""));fa.push(H.insertEdge(null,
-null,k||"",c.invert?f:a,c.invert?a:f,c.style||H.createCurrentEdgeStyle()));mxUtils.remove(c.invert?a:f,ma)}}}});Fa(K,K,sa);if(null!=f[K.id])for(da=0;da<f[K.id].length;da++)Fa(K,f[K.id][da],sa)}if(null!=ga)for(N=0;N<d.length;N++)for(K=d[N],da=0;da<ga.length;da++)H.setAttributeForCell(K,mxUtils.trim(ga[da]),null);if(0<g.length){var ua=new mxParallelEdgeLayout(H);ua.spacing=P;var oa=function(){0<ua.spacing&&ua.execute(H.getDefaultParent());for(var a=0;a<g.length;a++){var b=H.getCellGeometry(g[a]);b.x=
-Math.round(H.snap(b.x));b.y=Math.round(H.snap(b.y));"auto"==I&&(b.width=Math.round(H.snap(b.width)));"auto"==Q&&(b.height=Math.round(H.snap(b.height)))}};if("["==S.charAt(0)){var La=aa;H.view.validate();this.executeLayoutList(JSON.parse(S),function(){oa();La()});aa=null}else if("circle"==S){var Ca=new mxCircleLayout(H);Ca.resetEdges=!1;var Ma=Ca.isVertexIgnored;Ca.isVertexIgnored=function(a){return Ma.apply(this,arguments)||0>mxUtils.indexOf(g,a)};this.executeLayout(function(){Ca.execute(H.getDefaultParent());
-oa()},!0,aa);aa=null}else if("horizontaltree"==S||"verticaltree"==S||"auto"==S&&fa.length==2*g.length-1&&1==ma.length){H.view.validate();var Da=new mxCompactTreeLayout(H,"horizontaltree"==S);Da.levelDistance=T;Da.edgeRouting=!1;Da.resetEdges=!1;this.executeLayout(function(){Da.execute(H.getDefaultParent(),0<ma.length?ma[0]:null)},!0,aa);aa=null}else if("horizontalflow"==S||"verticalflow"==S||"auto"==S&&1==ma.length){H.view.validate();var ya=new mxHierarchicalLayout(H,"horizontalflow"==S?mxConstants.DIRECTION_WEST:
-mxConstants.DIRECTION_NORTH);ya.intraCellSpacing=T;ya.parallelEdgeSpacing=P;ya.interRankCellSpacing=ta;ya.disableEdgeStyle=!1;this.executeLayout(function(){ya.execute(H.getDefaultParent(),fa);H.moveCells(fa,ja,ba)},!0,aa);aa=null}else if("organic"==S||"auto"==S&&fa.length>g.length){H.view.validate();var va=new mxFastOrganicLayout(H);va.forceConstant=3*T;va.resetEdges=!1;var Ga=va.isVertexIgnored;va.isVertexIgnored=function(a){return Ga.apply(this,arguments)||0>mxUtils.indexOf(g,a)};ua=new mxParallelEdgeLayout(H);
-ua.spacing=P;this.executeLayout(function(){va.execute(H.getDefaultParent());oa()},!0,aa);aa=null}}this.hideDialog()}finally{H.model.endUpdate()}null!=aa&&aa()}}catch(za){this.handleError(za)}};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,560,130,!0,!0);a.init()};var x=
-EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=x.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 f=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 f.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 m=b.init;b.init=function(){m.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"),g=b.source,f=b.outline;f.pageScale=g.pageScale;f.pageFormat=g.pageFormat;f.background=g.background;f.pageVisible=g.pageVisible;f.background=g.background;var k=mxUtils.getCurrentStyle(g.container);f.container.style.backgroundColor=k.backgroundColor;null!=g.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&
-(f.view.backgroundPageShape.fill=g.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=1;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.gitLab||c++;b&&a&&isLocalStorage&&"1"==urlParams.browser&&
-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.actions.get("undo").setEnabled(this.canUndo()&&
-a);this.actions.get("redo").setEnabled(this.canRedo()&&a);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 f=applicationCache;if(null!=f&&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 f=window.applicationCache,l=null,b=mxUtils.bind(this,function(){var a=f.status,b;a==f.CHECKING&&(a=f.DOWNLOADING);switch(a){case f.UNCACHED:b="";break;case f.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case f.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';
-break;case f.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case f.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!=l&&(this.offlineStatus.innerHTML=b,l=a)});mxEvent.addListener(f,"checking",b);mxEvent.addListener(f,"noupdate",b);mxEvent.addListener(f,"downloading",b);mxEvent.addListener(f,
-"progress",b);mxEvent.addListener(f,"cached",b);mxEvent.addListener(f,"updateready",b);mxEvent.addListener(f,"obsolete",b);mxEvent.addListener(f,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||
-"1"==urlParams.embed&&this.editor.graph.isEnabled()};var A=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){A.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("hidden"!=this.diagramContainer.style.visibility);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 C=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.editUpdateListener&&(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener=
-null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);C.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,f,l,m,n){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(f,l,m)),"image/svg+xml");else{var g=
-a.getFileData(!0,null,null,null,null,!0),k=c.getGraphBounds(),p=Math.floor(k.width*l/c.view.scale),t=Math.floor(k.height*l/c.view.scale);if(g.length<=MAX_REQUEST_SIZE&&p*t<MAX_AREA)if(a.hideDialog(),"png"!=d&&"jpg"!=d&&"jpeg"!=d||!a.isExportToCanvas()){var v={globalVars:c.getExportVariables()};a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(v))+(0<n?"&dpi="+
-n:"")+"&bg="+(null!=f?f:"none")+"&w="+p+"&h="+t+"&border="+m+"&xml="+encodeURIComponent(g))})}else"png"==d?a.exportImage(l,null==f||"none"==f,!0,!1,!1,m,!0,!1,null,null,n):a.exportImage(l,!1,!0,!1,!1,m,!0,!1,"jpeg");else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var f=this.getFutureCellForEdit(c.model,
-a,d.source.id);f!=d.source&&(d.source=f)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,d){var c=a.getCell(d);if(null==c)for(var f=b.changes.length-1;0<=f;f--){var g=b.changes[f];if(g.constructor==mxChildChange&&null!=g.child&&g.child.id==d){a.contains(g.previous)&&(c=g.child);break}}return c};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);
-var a=this.editor.graph,b="";if(null!=this.pages)for(var d=0;d<this.pages.length;d++){var f=a;this.currentPage!=this.pages[d]&&(f=this.createTemporaryGraph(a.getStylesheet()),f.model.setRoot(this.pages[d].root));b+=this.pages[d].getName()+" "+f.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b={},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,
-mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var f=document.createElement("div");f.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";f.innerHTML='<div style="text-align:center;padding:8px;"><img src="/images/spin.gif"></div>';var m={};try{var l=mxSettings.getCustomLibraries();for(a=0;a<l.length;a++){var n=l[a];if("R"==n.substring(0,1)){var t=JSON.parse(decodeURIComponent(n.substring(1)));m[t[0]]={id:t[0],
-title:t[1],downloadUrl:t[2]}}}}catch(F){}this.remoteInvoke("getCustomLibraries",null,null,function(a){f.innerHTML="";if(0==a.length)f.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];m[d.id]&&(b[d.id]=d);var g=this.addCheckbox(f,d.title,m[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},mxUtils.bind(this,function(a){f.innerHTML=
-"";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));f.appendChild(b)}));c.appendChild(f);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==m[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,
-function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(B){this.handleError(B,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in m)b[c]||this.closeLibrary(new RemoteLibrary(this,null,m[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763");this.showDialog(c.container,340,375,!0,!0,
-null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error?
-c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,d,f,l){var c=!0,g=window.setTimeout(mxUtils.bind(this,function(){c=!1;l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),k=mxUtils.bind(this,function(){window.clearTimeout(g);c&&f.apply(this,arguments)});d=d||{};d.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:k,error:l});
-a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,msgMarkers:d});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var f=
-a.functionArgs;Array.isArray(f)||(f=[]);if(d.isAsync)f.push(function(){b(Array.prototype.slice.apply(arguments))}),f.push(function(a){b(null,a||"Unkown Error")}),this[c].apply(this,f);else{var m=this[c].apply(this,f);b([m])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(z){b(null,"Invalid Call: An error occured, "+z.message)}};EditorUi.prototype.commentsSupported=function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var a=
-this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(a,b){var c=this.getCurrentFile();null!=c?c.getComments(a,b):a([])};EditorUi.prototype.addComment=function(a,b,d){var c=this.getCurrentFile();null!=c?c.addComment(a,b,d):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile();return null!=a?
-a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!=
-c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language","da, mi, en, de-DE")}})();
-var CommentsWindow=function(a,b,f,d,l,n){function t(){for(var a=u.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==u&&b++;F.style.display=0==b?"block":"none"}function x(a,b,c,d){function f(){b.removeChild(l);b.removeChild(n);k.style.display="block";g.style.display="block"}m={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var g=b.querySelector(".geCommentTxt"),k=b.querySelector(".geCommentActionsList"),l=document.createElement("textarea");l.className=
-"geCommentEditTxtArea";l.style.minHeight=g.offsetHeight+"px";l.value=a.content;b.insertBefore(l,g);var n=document.createElement("div");n.className="geCommentEditBtns";var p=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),t()):f();m=null});p.className="geCommentEditBtn";n.appendChild(p);var v=mxUtils.button(mxResources.get("save"),function(){g.innerHTML="";a.content=l.value;mxUtils.write(g,a.content);f();c(a);m=null});mxEvent.addListener(l,"keydown",mxUtils.bind(this,
-function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(v.click(),mxEvent.consume(a)):27==a.keyCode&&(p.click(),mxEvent.consume(a)))}));v.focus();v.className="geCommentEditBtn gePrimaryBtn";n.appendChild(v);b.insertBefore(n,g);k.style.display="none";g.style.display="none";l.focus()}function A(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),f=a.timeSince(d);null==f&&(f=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
-[f],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function C(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function c(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function g(a){a.style.border="";a.removeChild(a.busyImg)}function k(b,d,f,l,n){function y(a,c,d){var f=document.createElement("li");f.className="geCommentAction";var g=document.createElement("a");g.className=
-"geCommentActionLnk";mxUtils.write(g,a);f.appendChild(g);mxEvent.addListener(g,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});P.appendChild(f);d&&(f.style.display="none")}function z(){function a(b){c.push(d);if(null!=b.replies)for(var f=0;f<b.replies.length;f++)d=d.nextSibling,a(b.replies[f])}var c=[],d=B;a(b);return{pdiv:d,replies:c}}function E(d,f,m,n,p){function t(){C(u);b.addReply(y,function(a){y.id=a;b.replies.push(y);g(u);m&&m()},function(b){v();c(u);a.handleError(b,null,
-null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},n,p)}function v(){x(y,u,function(a){t()},!0)}var q=z().pdiv,y=a.newComment(d,a.getCurrentUser());y.pCommentId=b.id;null==b.replies&&(b.replies=[]);var u=k(y,b.replies,q,l+1);f?v():t()}if(n||!b.isResolved){F.style.display="none";var B=document.createElement("div");B.className="geCommentContainer";B.setAttribute("data-commentId",b.id);B.style.marginLeft=20*l+5+"px";b.isResolved&&"dark"!=uiTheme&&(B.style.backgroundColor="ghostWhite");
-var D=document.createElement("div");D.className="geCommentHeader";var G=document.createElement("img");G.className="geCommentUserImg";G.src=b.user.pictureUrl||Editor.userImage;D.appendChild(G);G=document.createElement("div");G.className="geCommentHeaderTxt";D.appendChild(G);var L=document.createElement("div");L.className="geCommentUsername";mxUtils.write(L,b.user.displayName||"");G.appendChild(L);L=document.createElement("div");L.className="geCommentDate";L.setAttribute("data-commentId",b.id);A(b,
-L);G.appendChild(L);B.appendChild(D);D=document.createElement("div");D.className="geCommentTxt";mxUtils.write(D,b.content||"");B.appendChild(D);D=document.createElement("div");D.className="geCommentActions";var P=document.createElement("ul");P.className="geCommentActionsList";D.appendChild(P);q||0!=l&&!p||y(mxResources.get("reply"),function(){E("",!0)},b.isResolved);G=a.getCurrentUser();null==G||G.id!=b.user.id||q||(y(mxResources.get("edit"),function(){function d(){x(b,B,function(){C(B);b.editComment(b.content,
-function(){g(B)},function(b){c(B);d();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}d()},b.isResolved),y(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){C(B);b.deleteComment(function(){for(var a=z(b).replies,c=0;c<a.length;c++)u.removeChild(a[c]);for(c=0;c<d.length;c++)if(d[c]==b){d.splice(c,1);break}F.style.display=0==u.getElementsByTagName("div").length?"block":"none"},function(b){c(B);a.handleError(b,null,null,
-null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));q||0!=l||y(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",f=z(b).replies,g="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",k=0;k<f.length;k++){f[k].style.backgroundColor=g;for(var m=f[k].querySelectorAll(".geCommentAction"),
-l=0;l<m.length;l++)m[l]!=c.parentNode&&(m[l].style.display=d);v||(f[k].style.display="none")}t()}b.isResolved?E(mxResources.get("reOpened")+": ",!0,c,!1,!0):E(mxResources.get("markedAsResolved"),!1,c,!0)});B.appendChild(D);null!=f?u.insertBefore(B,f.nextSibling):u.appendChild(B);for(f=0;null!=b.replies&&f<b.replies.length;f++)D=b.replies[f],D.isResolved=b.isResolved,k(D,b.replies,null,l+1,n);null!=m&&(m.comment.id==b.id?(n=b.content,b.content=m.comment.content,x(b,B,m.saveCallback,m.deleteOnCancel),
-b.content=n):null==m.comment.id&&m.comment.pCommentId==b.id&&(u.appendChild(m.div),x(m.comment,m.div,m.saveCallback,m.deleteOnCancel)));return B}}var q=!a.canComment(),p=a.canReplyToReplies(),m=null,z=document.createElement("div");z.className="geCommentsWin";z.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var D=EditorUi.compactUi?"26px":"30px",u=document.createElement("div");u.className="geCommentsList";u.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":
-Dialog.backdropColor;u.style.bottom=parseInt(D)+7+"px";z.appendChild(u);var F=document.createElement("span");F.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(F,mxResources.get("noCommentsFound"));var y=document.createElement("div");y.className="geToolbarContainer geCommentsToolbar";y.style.height=D;y.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";y.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(y.style.filter=
-"none");D=document.createElement("a");D.className="geButton";mxClient.IS_QUIRKS&&(D.style.filter="none");if(!q){var G=D.cloneNode();G.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';G.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(G,"click",function(b){function d(){x(f,m,function(b){C(m);a.addComment(b,function(a){b.id=a;B.push(b);g(m)},function(b){c(m);d();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},
-!0)}var f=a.newComment("",a.getCurrentUser()),m=k(f,B,null,0);d();b.preventDefault();mxEvent.consume(b)});y.appendChild(G)}G=D.cloneNode();G.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';G.setAttribute("title",mxResources.get("showResolved"));var v=!1;"dark"==uiTheme&&(G.style.filter="invert(100%)");mxEvent.addListener(G,"click",function(a){this.className=(v=!v)?"geButton geCheckedBtn":"geButton";O();a.preventDefault();mxEvent.consume(a)});y.appendChild(G);a.commentsRefreshNeeded()&&
-(G=D.cloneNode(),G.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',G.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(G.style.filter="invert(100%)"),mxEvent.addListener(G,"click",function(a){O();a.preventDefault();mxEvent.consume(a)}),y.appendChild(G));a.commentsSaveNeeded()&&(D=D.cloneNode(),D.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',D.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&
-(D.style.filter="invert(100%)"),mxEvent.addListener(D,"click",function(a){n();a.preventDefault();mxEvent.consume(a)}),y.appendChild(D));z.appendChild(y);var B=[],O=mxUtils.bind(this,function(){this.hasError=!1;if(null!=m){m.div=m.div.cloneNode(!0);var b=m.div.querySelector(".geCommentEditTxtArea"),c=m.div.querySelector(".geCommentEditBtns");m.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}u.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+
-'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";p=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});u.innerHTML="";u.appendChild(F);F.style.display="block";B=a;for(a=0;a<B.length;a++)b(B[a].replies),k(B[a],B,
-null,0,v);null!=m&&null==m.comment.id&&null==m.comment.pCommentId&&(u.appendChild(m.div),x(m.comment,m.div,m.saveCallback,m.deleteOnCancel))},mxUtils.bind(this,function(a){u.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):u.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});O();this.refreshComments=O;y=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(A(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])}
-if(this.window.isVisible()){for(var b=u.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var f=b[d];c[f.getAttribute("data-commentId")]=f}for(d=0;d<B.length;d++)a(B[d])}});setInterval(y,6E4);this.refreshCommentsTime=y;this.window=new mxWindow(mxResources.get("comments"),z,b,f,d,l,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,
-mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var Z=mxUtils.bind(this,function(){var a=this.window.getX(),
-b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",Z);this.destroy=function(){mxEvent.removeListener(window,"resize",Z);this.window.destroy()}},ConfirmDialog=function(a,b,f,d,l,n,t,x,A,C){var c=document.createElement("div");c.style.textAlign="center";var g=document.createElement("div");g.style.padding="6px";g.style.overflow="auto";g.style.maxHeight="44px";g.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(g.style.height="60px");mxUtils.write(g,b);c.appendChild(g);
-null!=C&&(g=document.createElement("div"),g.style.padding="6px 0 6px 0",b=document.createElement("img"),b.setAttribute("src",C),g.appendChild(b),c.appendChild(g));C=document.createElement("div");C.style.textAlign="center";C.style.whiteSpace="nowrap";var k=document.createElement("input");k.setAttribute("type","checkbox");n=mxUtils.button(n||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(k.checked)});n.className="geBtn";null!=x&&(n.innerHTML=x+"<br>"+n.innerHTML,n.style.paddingBottom=
-"8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");a.editor.cancelFirst&&C.appendChild(n);var q=mxUtils.button(l||mxResources.get("ok"),function(){a.hideDialog();null!=f&&f(k.checked)});C.appendChild(q);null!=t?(q.innerHTML=t+"<br>"+q.innerHTML+"<br>",q.style.paddingBottom="8px",q.style.paddingTop="8px",q.style.height="auto",q.className="geBtn",q.style.width="40%"):q.className="geBtn gePrimaryBtn";a.editor.cancelFirst||C.appendChild(n);c.appendChild(C);A?(C.style.marginTop=
-"10px",g=document.createElement("p"),g.style.marginTop="20px",g.appendChild(k),l=document.createElement("span"),mxUtils.write(l," "+mxResources.get("rememberThisSetting")),g.appendChild(l),c.appendChild(g),mxEvent.addListener(l,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)})):C.style.marginTop="12px";this.init=function(){q.focus()};this.container=c};function DiagramPage(a,b){this.node=a;null!=b?this.node.setAttribute("id",b):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}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,f){this.ui=a;this.page=b;this.previous=this.name=f}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
-function MovePage(a,b,f){this.ui=a;this.oldIndex=b;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,b,f){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b),null!=f&&(b.viewState=f,this.neverShown=!1))}
-SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,b=this.ui.editor,f=b.graph,d=Graph.compressNode(b.getGraphXml(!0));mxUtils.setTextContent(a.node,d);a.viewState=f.getViewState();a.root=f.model.root;null!=a.model&&a.model.rootChanged(a.root);f.view.clear(a.root,!0);f.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;f.model.prefix=Editor.guid()+"-";f.model.rootChanged(a.root);
-f.setViewState(a.viewState);f.gridEnabled=f.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);b.updateGraphComponents();f.view.validate();f.blockMathRender=!0;f.sizeDidChange();f.blockMathRender=!1;this.neverShown&&(this.neverShown=!1,f.selectUnlockedLayer());b.graph.fireEvent(new mxEventObject(mxEvent.ROOT));b.fireEvent(new mxEventObject("pageSelected","change",this))}};
-function ChangePage(a,b,f,d,l){SelectPage.call(this,a,f);this.relatedPage=b;this.index=d;this.previousIndex=null;this.noSelect=l}mxUtils.extend(ChangePage,SelectPage);
+pageVisible:b.pageVisible,translate:b.view.translate,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,l=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,
+l);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){if(f.source==(window.opener||window.parent)){var g=f.data,l=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"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=Graph.decompress(a)))}catch(ba){}return a});if("json"==urlParams.proto){try{g=JSON.parse(g)}catch(P){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();l=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):
+null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:g}),"*")},null!=g.titleKey?mxResources.get(g.titleKey):g.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==g.action){var m=l(g.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[g.name||this.defaultFilename]),m,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:g}),"*")}),mxUtils.bind(this,function(){this.hideDialog();
+k.postMessage(JSON.stringify({event:"draft",result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(P){k.postMessage(JSON.stringify({event:"draft",error:P.toString(),
+message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var l=1==g.enableRecent,m=1==g.enableSearch,n=1==g.enableCustomTemp,l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=g.callback?k.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,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",
+null,null,a,function(){a(null,"Network Error!")})}):null,m?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,mxUtils.bind(this,function(a,b,c){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")}),null,null,n?mxUtils.bind(this,function(a){this.remoteInvoke("getCustomTemplates",null,null,a,function(){a({},0)})}):null);this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
+l.init();return}if("textContent"==g.action){l=this.getDiagramTextContent();k.postMessage(JSON.stringify({event:"textContent",data:l,message:g}),"*");return}if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var p=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||
+g.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var t=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var v=this.editor.graph,x=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=
+g;b.data=a;b.xml=encodeURIComponent(t);k.postMessage(JSON.stringify(b),"*")}),A=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(t)));v!=this.editor.graph&&v.container.parentNode.removeChild(v.container);x(a)}),m=g.pageId||(null!=this.pages?this.pages[0].getId():null);if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage.getId()!=m){for(var B=v.getGlobalVariable,v=this.createTemporaryGraph(v.getStylesheet()),
+D,l=0;l<this.pages.length;l++)if(this.pages[l].getId()==m){D=this.updatePageRoot(this.pages[l]);break}v.getGlobalVariable=function(a){return"page"==a?D.getName():"pagenumber"==a?1:B.apply(this,arguments)};document.body.appendChild(v.container);v.model.setRoot(D.root)}if(null!=g.layerIds){for(var m=v.model,n=m.getChildCells(m.getRoot()),z={},l=0;l<g.layerIds.length;l++)z[g.layerIds[l]]=!0;for(l=0;l<n.length;l++)m.setVisible(n[l],z[n[l].id]||!1)}this.exportToCanvas(mxUtils.bind(this,function(a){A(a.toDataURL("image/png"))}),
+null,null,null,mxUtils.bind(this,function(){A(null)}),null,null,g.scale,null,null,null,v)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+(null!=m?"&pageId="+m:"")+(null!=g.layerIds?"&extras="+encodeURIComponent(JSON.stringify({layerIds:g.layerIds})):"")+(null!=g.scale?"&scale="+g.scale:"")+"&base64=1&xml="+encodeURIComponent(t))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?x("data:image/png;base64,"+a.getText()):A(null)}),mxUtils.bind(this,
+function(){A(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);p=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=g.format;else if("html"==g.format)t=this.editor.getGraphXml(),p.data=this.getHtml(t,this.editor.graph),p.xml=mxUtils.getXml(t),p.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=
+null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);p.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=
+this.createSvgDataUri(a);k.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(p),"*")}return}if("load"==
+g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(m=document.createElement("span"),mxUtils.write(m,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight=
+"38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(m),this.embedFilenameSpan=m),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):g.xml;else{"remoteInvokeReady"==g.action?this.handleRemoteInvokeReady(k):"remoteInvoke"==g.action?this.handleRemoteInvoke(g):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):k.postMessage(JSON.stringify({error:"unknownMessage",
+data:JSON.stringify(g)}),"*");return}}var Q=mxUtils.bind(this,function(f,g){c=!0;try{a(f,g)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var l=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();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||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=g&&"function"===typeof g.substring&&"data:application/vnd.visio;base64,"==g.substring(0,34)?(l="0M8R4KGxGuE"==g.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){Q(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=g&&"function"===typeof g.substring&&
+!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,"")?this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&Q(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){Q(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(g=l(g),Q(g,f))}}));var k=
+window.opener||window.parent,l="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(l,"*")};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":"0px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";"1"==urlParams.noSaveBtn?(mxUtils.write(b,
+mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)):(mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),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.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",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.className="geBigButton geBigStandardButton";b.style.marginLeft="6px";b.style.marginRight="20px";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.isOffline()?
+null:"https://about.draw.io/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),f=0;f<a.length;f++){var e=new window[a[f].layout](c);if(null!=a[f].config)for(var k in a[f].config)e[k]=a[f].config[k];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=
+function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var k={},m=null,p=null,v=null,y=null,B=null,u=null,z=null,K=null,Y="",H="auto",O="auto",D=null,L=null,Q=40,P=40,ba=100,W=0,G=this.editor.graph;G.getGraphBounds();for(var Z=function(){null!=b?b(fa):(G.setSelectionCells(fa),G.scrollCellToVisible(G.getSelectionCell()))},na=G.getFreeInsertPoint(),ja=na.x,ca=na.y,na=ca,ka=null,S="auto",K=null,V=[],pa=null,ga=null,R=0;R<c.length&&"#"==c[R].charAt(0);){a=c[R];for(R++;R<c.length&&"\\"==a.charAt(a.length-
+1)&&"#"==c[R].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[R].substring(1)),R++;if("#"!=a.charAt(1)){var la=a.indexOf(":");if(0<la){var M=mxUtils.trim(a.substring(1,la)),I=mxUtils.trim(a.substring(la+1));"label"==M?ka=G.sanitizeHtml(I):"labelname"==M&&0<I.length&&"-"!=I?y=I:"labels"==M&&0<I.length&&"-"!=I?B=JSON.parse(I):"style"==M?m=I:"parentstyle"==M?u=I:"stylename"==M&&0<I.length&&"-"!=I?v=I:"styles"==M&&0<I.length&&"-"!=I?p=JSON.parse(I):"identity"==M&&0<I.length&&"-"!=I?z=I:"parent"==
+M&&0<I.length&&"-"!=I?K=I:"namespace"==M&&0<I.length&&"-"!=I?Y=I:"width"==M?H=I:"height"==M?O=I:"left"==M&&0<I.length?D=I:"top"==M&&0<I.length?L=I:"ignore"==M?ga=I.split(","):"connect"==M?V.push(JSON.parse(I)):"link"==M?pa=I:"padding"==M?W=parseFloat(I):"edgespacing"==M?Q=parseFloat(I):"nodespacing"==M?P=parseFloat(I):"levelspacing"==M?ba=parseFloat(I):"layout"==M&&(S=I)}}}if(null==c[R])throw Error(mxResources.get("invalidOrMissingFile"));var ea=this.editor.csvToArray(c[R]),M=la=null;if(null!=z||
+null!=K)for(var N=0;N<ea.length;N++)z==ea[N]&&(la=N),K==ea[N]&&(M=N);null==ka&&(ka="%"+ea[0]+"%");if(null!=V)for(var T=0;T<V.length;T++)null==k[V[T].to]&&(k[V[T].to]={});G.model.beginUpdate();try{for(N=R+1;N<c.length;N++){var ha=this.editor.csvToArray(c[N]);if(null==ha){var ia=40<c[N].length?c[N].substring(0,40)+"...":c[N];throw Error(N+" ("+ia+") "+mxResources.get("containsValidationErrors"));}if(ha.length==ea.length){var J=null,qa=null!=la?Y+ha[la]:null;null!=qa&&(J=G.model.getCell(qa));var z=null!=
+J,aa=new mxCell(ka,new mxGeometry(ja,na,0,0),m||"whiteSpace=wrap;html=1;");aa.vertex=!0;aa.id=qa;for(var da=0;da<ha.length;da++)G.setAttributeForCell(aa,ea[da],ha[da]);if(null!=y&&null!=B){var Aa=B[aa.getAttribute(y)];null!=Aa&&G.labelChanged(aa,Aa)}if(null!=v&&null!=p){var wa=p[aa.getAttribute(v)];null!=wa&&(aa.style=wa)}G.setAttributeForCell(aa,"placeholders","1");aa.style=G.replacePlaceholders(aa,aa.style);z&&(G.model.setGeometry(J,aa.geometry),G.model.setStyle(J,aa.style),0>mxUtils.indexOf(f,
+J)&&f.push(J));J=aa;if(!z)for(T=0;T<V.length;T++)k[V[T].to][J.getAttribute(V[T].to)]=J;null!=pa&&"link"!=pa&&(G.setLinkForCell(J,J.getAttribute(pa)),G.setAttributeForCell(J,pa,null));G.fireEvent(new mxEventObject("cellsInserted","cells",[J]));var za=this.editor.graph.getPreferredSizeForCell(J);J.vertex&&(null!=D&&null!=J.getAttribute(D)&&(J.geometry.x=ja+parseFloat(J.getAttribute(D))),null!=L&&null!=J.getAttribute(L)&&(J.geometry.y=ca+parseFloat(J.getAttribute(L))),"@"==H.charAt(0)&&null!=J.getAttribute(H.substring(1))?
+J.geometry.width=parseFloat(J.getAttribute(H.substring(1))):J.geometry.width="auto"==H?za.width+W:parseFloat(H),"@"==O.charAt(0)&&null!=J.getAttribute(O.substring(1))?J.geometry.height=parseFloat(J.getAttribute(O.substring(1))):J.geometry.height="auto"==O?za.height+W:parseFloat(O),na+=J.geometry.height+P);z?(null==e[qa]&&(e[qa]=[]),e[qa].push(J)):(K=null!=M?G.model.getCell(Y+ha[M]):null,d.push(J),null!=K?(K.style=G.replacePlaceholders(K,u),G.addCell(J,K)):f.push(G.addCell(J)))}}for(var ma=f.slice(),
+fa=f.slice(),T=0;T<V.length;T++)for(var sa=V[T],N=0;N<f.length;N++){var J=f[N],Ea=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){G.setAttributeForCell(b,c.from,null);for(var d=d.split(","),f=0;f<d.length;f++){var e=k[c.to][d[f]];if(null!=e){var g=c.label;null!=c.fromlabel&&(g=(b.getAttribute(c.fromlabel)||"")+(g||""));null!=c.tolabel&&(g=(g||"")+(e.getAttribute(c.tolabel)||""));fa.push(G.insertEdge(null,null,g||"",c.invert?e:a,c.invert?a:e,c.style||G.createCurrentEdgeStyle()));
+mxUtils.remove(c.invert?a:e,ma)}}}});Ea(J,J,sa);if(null!=e[J.id])for(da=0;da<e[J.id].length;da++)Ea(J,e[J.id][da],sa)}if(null!=ga)for(N=0;N<d.length;N++)for(J=d[N],da=0;da<ga.length;da++)G.setAttributeForCell(J,mxUtils.trim(ga[da]),null);if(0<f.length){var ta=new mxParallelEdgeLayout(G);ta.spacing=Q;var oa=function(){0<ta.spacing&&ta.execute(G.getDefaultParent());for(var a=0;a<f.length;a++){var b=G.getCellGeometry(f[a]);b.x=Math.round(G.snap(b.x));b.y=Math.round(G.snap(b.y));"auto"==H&&(b.width=Math.round(G.snap(b.width)));
+"auto"==O&&(b.height=Math.round(G.snap(b.height)))}};if("["==S.charAt(0)){var Ka=Z;G.view.validate();this.executeLayoutList(JSON.parse(S),function(){oa();Ka()});Z=null}else if("circle"==S){var Ba=new mxCircleLayout(G);Ba.resetEdges=!1;var La=Ba.isVertexIgnored;Ba.isVertexIgnored=function(a){return La.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){Ba.execute(G.getDefaultParent());oa()},!0,Z);Z=null}else if("horizontaltree"==S||"verticaltree"==S||"auto"==S&&fa.length==
+2*f.length-1&&1==ma.length){G.view.validate();var Ca=new mxCompactTreeLayout(G,"horizontaltree"==S);Ca.levelDistance=P;Ca.edgeRouting=!1;Ca.resetEdges=!1;this.executeLayout(function(){Ca.execute(G.getDefaultParent(),0<ma.length?ma[0]:null)},!0,Z);Z=null}else if("horizontalflow"==S||"verticalflow"==S||"auto"==S&&1==ma.length){G.view.validate();var xa=new mxHierarchicalLayout(G,"horizontalflow"==S?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);xa.intraCellSpacing=P;xa.parallelEdgeSpacing=Q;
+xa.interRankCellSpacing=ba;xa.disableEdgeStyle=!1;this.executeLayout(function(){xa.execute(G.getDefaultParent(),fa);G.moveCells(fa,ja,ca)},!0,Z);Z=null}else if("organic"==S||"auto"==S&&fa.length>f.length){G.view.validate();var ua=new mxFastOrganicLayout(G);ua.forceConstant=3*P;ua.resetEdges=!1;var Fa=ua.isVertexIgnored;ua.isVertexIgnored=function(a){return Fa.apply(this,arguments)||0>mxUtils.indexOf(f,a)};ta=new mxParallelEdgeLayout(G);ta.spacing=Q;this.executeLayout(function(){ua.execute(G.getDefaultParent());
+oa()},!0,Z);Z=null}}this.hideDialog()}finally{G.model.endUpdate()}null!=Z&&Z()}}catch(ya){this.handleError(ya)}};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,560,130,!0,!0);a.init()};var v=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=
+v.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 l=b.init;b.init=function(){l.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"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var g=mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=g.backgroundColor;null!=f.view.backgroundPageShape&&null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.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=1;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.gitLab||c++;b&&a&&isLocalStorage&&"1"==urlParams.browser&&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.actions.get("undo").setEnabled(this.canUndo()&&a);this.actions.get("redo").setEnabled(this.canRedo()&&a);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="";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=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var B=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=
+function(){B.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("hidden"!=this.diagramContainer.style.visibility);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 z=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.editUpdateListener&&(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener=null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);z.apply(this,
+arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,k,l,m){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,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),n=Math.floor(g.width*k/c.view.scale),p=Math.floor(g.height*k/c.view.scale);
+if(f.length<=MAX_REQUEST_SIZE&&n*p<MAX_AREA)if(a.hideDialog(),"png"!=d&&"jpg"!=d&&"jpeg"!=d||!a.isExportToCanvas()){var u={globalVars:c.getExportVariables()};a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(u))+(0<m?"&dpi="+m:"")+"&bg="+(null!=e?e:"none")+"&w="+n+"&h="+p+"&border="+l+"&xml="+encodeURIComponent(f))})}else"png"==d?a.exportImage(k,null==e||"none"==
+e,!0,!1,!1,l,!0,!1,null,null,m):a.exportImage(k,!1,!0,!1,!1,l,!0,!1,"jpeg");else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var e=this.getFutureCellForEdit(c.model,a,d.source.id);e!=d.source&&(d.source=e)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,
+a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,d){var c=a.getCell(d);if(null==c)for(var e=b.changes.length-1;0<=e;e--){var f=b.changes[e];if(f.constructor==mxChildChange&&null!=f.child&&f.child.id==d){a.contains(f.previous)&&(c=f.child);break}}return c};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var a=this.editor.graph,b="";if(null!=this.pages)for(var d=0;d<this.pages.length;d++){var e=a;this.currentPage!=
+this.pages[d]&&(e=this.createTemporaryGraph(a.getStylesheet()),e.model.setRoot(this.pages[d].root));b+=this.pages[d].getName()+" "+e.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b={},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";
+c.appendChild(d);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<div style="text-align:center;padding:8px;"><img src="/images/spin.gif"></div>';var l={};try{var k=mxSettings.getCustomLibraries();for(a=0;a<k.length;a++){var m=k[a];if("R"==m.substring(0,1)){var p=JSON.parse(decodeURIComponent(m.substring(1)));l[p[0]]={id:p[0],title:p[1],downloadUrl:p[2]}}}}catch(F){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML=
+"";if(0==a.length)e.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];l[d.id]&&(b[d.id]=d);var f=this.addCheckbox(e,d.title,l[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,f)}},mxUtils.bind(this,function(a){e.innerHTML="";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,
+mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));e.appendChild(b)}));c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==l[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(C){this.handleError(C,
+mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in l)b[c]||this.closeLibrary(new RemoteLibrary(this,null,l[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763");this.showDialog(c.container,340,375,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=
+[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=
+function(a,b,d,e,k){var c=!0,f=window.setTimeout(mxUtils.bind(this,function(){c=!1;k({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),g=mxUtils.bind(this,function(){window.clearTimeout(f);c&&e.apply(this,arguments)});d=d||{};d.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:g,error:k});a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,msgMarkers:d});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};
+EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var e=a.functionArgs;Array.isArray(e)||(e=[]);if(d.isAsync)e.push(function(){b(Array.prototype.slice.apply(arguments))}),e.push(function(a){b(null,a||"Unkown Error")}),
+this[c].apply(this,e);else{var l=this[c].apply(this,e);b([l])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(x){b(null,"Invalid Call: An error occured, "+x.message)}};EditorUi.prototype.commentsSupported=function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var a=this.getCurrentFile();return null!=
+a?a.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(a,b){var c=this.getCurrentFile();null!=c?c.getComments(a,b):a([])};EditorUi.prototype.addComment=function(a,b,d){var c=this.getCurrentFile();null!=c?c.addComment(a,b,d):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile();return null!=a?a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=
+function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!=c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();
+return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language","da, mi, en, de-DE")}})();
+var CommentsWindow=function(a,b,e,d,k,m){function p(){for(var a=q.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==q&&b++;F.style.display=0==b?"block":"none"}function v(a,b,c,d){function e(){b.removeChild(k);b.removeChild(m);g.style.display="block";f.style.display="block"}l={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),k=document.createElement("textarea");k.className=
+"geCommentEditTxtArea";k.style.minHeight=f.offsetHeight+"px";k.value=a.content;b.insertBefore(k,f);var m=document.createElement("div");m.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),p()):e();l=null});n.className="geCommentEditBtn";m.appendChild(n);var u=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=k.value;mxUtils.write(f,a.content);e();c(a);l=null});mxEvent.addListener(k,"keydown",mxUtils.bind(this,
+function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(u.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));u.focus();u.className="geCommentEditBtn gePrimaryBtn";m.appendChild(u);b.insertBefore(m,f);g.style.display="none";f.style.display="none";k.focus()}function B(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
+[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function z(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function c(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function f(a){a.style.border="";a.removeChild(a.busyImg)}function g(b,d,e,k,m){function y(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
+"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});Q.appendChild(e);d&&(e.style.display="none")}function D(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=A;a(b);return{pdiv:d,replies:c}}function x(d,e,l,m,n){function p(){z(y);b.addReply(t,function(a){t.id=a;b.replies.push(t);f(y);l&&l()},function(b){u();c(y);a.handleError(b,null,
+null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},m,n)}function u(){v(t,y,function(a){p()},!0)}var q=D().pdiv,t=a.newComment(d,a.getCurrentUser());t.pCommentId=b.id;null==b.replies&&(b.replies=[]);var y=g(t,b.replies,q,k+1);e?u():p()}if(m||!b.isResolved){F.style.display="none";var A=document.createElement("div");A.className="geCommentContainer";A.setAttribute("data-commentId",b.id);A.style.marginLeft=20*k+5+"px";b.isResolved&&"dark"!=uiTheme&&(A.style.backgroundColor="ghostWhite");
+var C=document.createElement("div");C.className="geCommentHeader";var E=document.createElement("img");E.className="geCommentUserImg";E.src=b.user.pictureUrl||Editor.userImage;C.appendChild(E);E=document.createElement("div");E.className="geCommentHeaderTxt";C.appendChild(E);var L=document.createElement("div");L.className="geCommentUsername";mxUtils.write(L,b.user.displayName||"");E.appendChild(L);L=document.createElement("div");L.className="geCommentDate";L.setAttribute("data-commentId",b.id);B(b,
+L);E.appendChild(L);A.appendChild(C);C=document.createElement("div");C.className="geCommentTxt";mxUtils.write(C,b.content||"");A.appendChild(C);C=document.createElement("div");C.className="geCommentActions";var Q=document.createElement("ul");Q.className="geCommentActionsList";C.appendChild(Q);t||0!=k&&!n||y(mxResources.get("reply"),function(){x("",!0)},b.isResolved);E=a.getCurrentUser();null==E||E.id!=b.user.id||t||(y(mxResources.get("edit"),function(){function d(){v(b,A,function(){z(A);b.editComment(b.content,
+function(){f(A)},function(b){c(A);d();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}d()},b.isResolved),y(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){z(A);b.deleteComment(function(){for(var a=D(b).replies,c=0;c<a.length;c++)q.removeChild(a[c]);for(c=0;c<d.length;c++)if(d[c]==b){d.splice(c,1);break}F.style.display=0==q.getElementsByTagName("div").length?"block":"none"},function(b){c(A);a.handleError(b,null,null,
+null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));t||0!=k||y(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=D(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var l=e[g].querySelectorAll(".geCommentAction"),
+k=0;k<l.length;k++)l[k]!=c.parentNode&&(l[k].style.display=d);u||(e[g].style.display="none")}p()}b.isResolved?x(mxResources.get("reOpened")+": ",!0,c,!1,!0):x(mxResources.get("markedAsResolved"),!1,c,!0)});A.appendChild(C);null!=e?q.insertBefore(A,e.nextSibling):q.appendChild(A);for(e=0;null!=b.replies&&e<b.replies.length;e++)C=b.replies[e],C.isResolved=b.isResolved,g(C,b.replies,null,k+1,m);null!=l&&(l.comment.id==b.id?(m=b.content,b.content=l.comment.content,v(b,A,l.saveCallback,l.deleteOnCancel),
+b.content=m):null==l.comment.id&&l.comment.pCommentId==b.id&&(q.appendChild(l.div),v(l.comment,l.div,l.saveCallback,l.deleteOnCancel)));return A}}var t=!a.canComment(),n=a.canReplyToReplies(),l=null,x=document.createElement("div");x.className="geCommentsWin";x.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var A=EditorUi.compactUi?"26px":"30px",q=document.createElement("div");q.className="geCommentsList";q.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":
+Dialog.backdropColor;q.style.bottom=parseInt(A)+7+"px";x.appendChild(q);var F=document.createElement("span");F.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(F,mxResources.get("noCommentsFound"));var y=document.createElement("div");y.className="geToolbarContainer geCommentsToolbar";y.style.height=A;y.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";y.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(y.style.filter=
+"none");A=document.createElement("a");A.className="geButton";mxClient.IS_QUIRKS&&(A.style.filter="none");if(!t){var E=A.cloneNode();E.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';E.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(E,"click",function(b){function d(){v(e,l,function(b){z(l);a.addComment(b,function(a){b.id=a;C.push(b);f(l)},function(b){c(l);d();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},
+!0)}var e=a.newComment("",a.getCurrentUser()),l=g(e,C,null,0);d();b.preventDefault();mxEvent.consume(b)});y.appendChild(E)}E=A.cloneNode();E.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';E.setAttribute("title",mxResources.get("showResolved"));var u=!1;"dark"==uiTheme&&(E.style.filter="invert(100%)");mxEvent.addListener(E,"click",function(a){this.className=(u=!u)?"geButton geCheckedBtn":"geButton";K();a.preventDefault();mxEvent.consume(a)});y.appendChild(E);a.commentsRefreshNeeded()&&
+(E=A.cloneNode(),E.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',E.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(E.style.filter="invert(100%)"),mxEvent.addListener(E,"click",function(a){K();a.preventDefault();mxEvent.consume(a)}),y.appendChild(E));a.commentsSaveNeeded()&&(A=A.cloneNode(),A.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',A.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&
+(A.style.filter="invert(100%)"),mxEvent.addListener(A,"click",function(a){m();a.preventDefault();mxEvent.consume(a)}),y.appendChild(A));x.appendChild(y);var C=[],K=mxUtils.bind(this,function(){this.hasError=!1;if(null!=l){l.div=l.div.cloneNode(!0);var b=l.div.querySelector(".geCommentEditTxtArea"),c=l.div.querySelector(".geCommentEditBtns");l.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}q.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+
+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";n=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});q.innerHTML="";q.appendChild(F);F.style.display="block";C=a;for(a=0;a<C.length;a++)b(C[a].replies),g(C[a],C,
+null,0,u);null!=l&&null==l.comment.id&&null==l.comment.pCommentId&&(q.appendChild(l.div),v(l.comment,l.div,l.saveCallback,l.deleteOnCancel))},mxUtils.bind(this,function(a){q.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):q.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});K();this.refreshComments=K;y=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(B(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])}
+if(this.window.isVisible()){for(var b=q.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<C.length;d++)a(C[d])}});setInterval(y,6E4);this.refreshCommentsTime=y;this.window=new mxWindow(mxResources.get("comments"),x,b,e,d,k,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,
+mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.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)};var Y=mxUtils.bind(this,function(){var a=this.window.getX(),
+b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",Y);this.destroy=function(){mxEvent.removeListener(window,"resize",Y);this.window.destroy()}},ConfirmDialog=function(a,b,e,d,k,m,p,v,B,z){var c=document.createElement("div");c.style.textAlign="center";var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight="44px";f.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(f.style.height="60px");mxUtils.write(f,b);c.appendChild(f);
+null!=z&&(f=document.createElement("div"),f.style.padding="6px 0 6px 0",b=document.createElement("img"),b.setAttribute("src",z),f.appendChild(b),c.appendChild(f));z=document.createElement("div");z.style.textAlign="center";z.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");m=mxUtils.button(m||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(g.checked)});m.className="geBtn";null!=v&&(m.innerHTML=v+"<br>"+m.innerHTML,m.style.paddingBottom=
+"8px",m.style.paddingTop="8px",m.style.height="auto",m.style.width="40%");a.editor.cancelFirst&&z.appendChild(m);var t=mxUtils.button(k||mxResources.get("ok"),function(){a.hideDialog();null!=e&&e(g.checked)});z.appendChild(t);null!=p?(t.innerHTML=p+"<br>"+t.innerHTML+"<br>",t.style.paddingBottom="8px",t.style.paddingTop="8px",t.style.height="auto",t.className="geBtn",t.style.width="40%"):t.className="geBtn gePrimaryBtn";a.editor.cancelFirst||z.appendChild(m);c.appendChild(z);B?(z.style.marginTop=
+"10px",f=document.createElement("p"),f.style.marginTop="20px",f.appendChild(g),k=document.createElement("span"),mxUtils.write(k," "+mxResources.get("rememberThisSetting")),f.appendChild(k),c.appendChild(f),mxEvent.addListener(k,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)})):z.style.marginTop="12px";this.init=function(){t.focus()};this.container=c};function DiagramPage(a,b){this.node=a;null!=b?this.node.setAttribute("id",b):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}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,e){this.ui=a;this.page=b;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
+function MovePage(a,b,e){this.ui=a;this.oldIndex=b;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,b,e){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b),null!=e&&(b.viewState=e,this.neverShown=!1))}
+SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,b=this.ui.editor,e=b.graph,d=Graph.compressNode(b.getGraphXml(!0));mxUtils.setTextContent(a.node,d);a.viewState=e.getViewState();a.root=e.model.root;null!=a.model&&a.model.rootChanged(a.root);e.view.clear(a.root,!0);e.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;e.model.prefix=Editor.guid()+"-";e.model.rootChanged(a.root);
+e.setViewState(a.viewState);e.gridEnabled=e.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);b.updateGraphComponents();e.view.validate();e.blockMathRender=!0;e.sizeDidChange();e.blockMathRender=!1;this.neverShown&&(this.neverShown=!1,e.selectUnlockedLayer());b.graph.fireEvent(new mxEventObject(mxEvent.ROOT));b.fireEvent(new mxEventObject("pageSelected","change",this))}};
+function ChangePage(a,b,e,d,k){SelectPage.call(this,a,e);this.relatedPage=b;this.index=d;this.previousIndex=null;this.noSelect=k}mxUtils.extend(ChangePage,SelectPage);
ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var a=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(a,1);this.index=a}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};EditorUi.prototype.tabContainerHeight=38;
EditorUi.prototype.getSelectedPageIndex=function(){var a=null;if(null!=this.pages&&null!=this.currentPage)for(var b=0;b<this.pages.length;b++)if(this.pages[b]==this.currentPage){a=b;break}return a};EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var b=0;b<this.pages.length;b++)if(this.pages[b].getId()==a)return this.pages[b];return null};
EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,b=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var d=this.tabContainer.style.height;
-this.tabContainer.style.height=null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":this.tabContainerHeight+"px";d!=this.tabContainer.style.height&&this.refresh(!1)}b.apply(a.view,arguments)});var f=null,d=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=f&&(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),f=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(){null!=this.editor&&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,b){for(var f=b.getProperty("edit").changes,l=0;l<f.length;l++)if(f[l]instanceof SelectPage||f[l]instanceof RenamePage||f[l]instanceof MovePage||f[l]instanceof mxRootChange){d();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}};
-EditorUi.prototype.restoreViewState=function(a,b,f){a=null!=a?this.getPageById(a.getId()):null;var d=this.editor.graph;null!=a&&null!=this.currentPage&&null!=this.pages&&(a!=this.currentPage?this.selectPage(a,!0,b):(d.setViewState(b),this.editor.updateGraphComponents(),d.view.revalidate(),d.sizeDidChange()),d.container.scrollLeft=d.view.translate.x*d.view.scale+b.scrollLeft,d.container.scrollTop=d.view.translate.y*d.view.scale+b.scrollTop,d.restoreSelection(f))};
-Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),f=parseFloat(a.getAttribute("pageScale")),d=parseFloat(a.getAttribute("pageWidth")),l=parseFloat(a.getAttribute("pageHeight")),n=a.getAttribute("background"),t=a.getAttribute("backgroundImage"),t=null!=t&&0<t.length?JSON.parse(t):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!=b?"0"!=b:this.defaultPageVisible,background:null!=n&&0<n.length?n:null,backgroundImage:null!=t?new mxImage(t.src,t.width,t.height):null,pageScale:isNaN(f)?mxGraph.prototype.pageScale:f,pageFormat:isNaN(d)||isNaN(l)?mxSettings.getPageFormat():new mxRectangle(0,0,d,l),tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"==a.getAttribute("math"),
+this.tabContainer.style.height=null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":this.tabContainerHeight+"px";d!=this.tabContainer.style.height&&this.refresh(!1)}b.apply(a.view,arguments)});var e=null,d=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(){null!=this.editor&&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,b){for(var e=b.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){d();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)}};
+EditorUi.prototype.restoreViewState=function(a,b,e){a=null!=a?this.getPageById(a.getId()):null;var d=this.editor.graph;null!=a&&null!=this.currentPage&&null!=this.pages&&(a!=this.currentPage?this.selectPage(a,!0,b):(d.setViewState(b),this.editor.updateGraphComponents(),d.view.revalidate(),d.sizeDidChange()),d.container.scrollLeft=d.view.translate.x*d.view.scale+b.scrollLeft,d.container.scrollTop=d.view.translate.y*d.view.scale+b.scrollTop,d.restoreSelection(e))};
+Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),e=parseFloat(a.getAttribute("pageScale")),d=parseFloat(a.getAttribute("pageWidth")),k=parseFloat(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!=b?"0"!=b:this.defaultPageVisible,background:null!=m&&0<m.length?m:null,backgroundImage:null!=p?new mxImage(p.src,p.width,p.height):null,pageScale:isNaN(e)?mxGraph.prototype.pageScale:e,pageFormat:isNaN(d)||isNaN(k)?mxSettings.getPageFormat():new mxRectangle(0,0,d,k),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.saveViewState=function(a,b,f){f||(b.setAttribute("grid",null==a||a.gridEnabled?"1":"0"),b.setAttribute("gridSize",null!=a?a.gridSize:mxGraph.prototype.gridSize),b.setAttribute("guides",null==a||a.guidesEnabled?"1":"0"),b.setAttribute("tooltips",null==a||a.tooltips?"1":"0"),b.setAttribute("connect",null==a||a.connect?"1":"0"),b.setAttribute("arrows",null==a||a.arrows?"1":"0"),b.setAttribute("page",null==a&&this.defaultPageVisible||null!=a&&a.pageVisible?"1":"0"),b.setAttribute("fold",
-null==a||a.foldingEnabled?"1":"0"));b.setAttribute("pageScale",null!=a&&null!=a.pageScale?a.pageScale:mxGraph.prototype.pageScale);f=null!=a?a.pageFormat:mxSettings.getPageFormat();null!=f&&(b.setAttribute("pageWidth",f.width),b.setAttribute("pageHeight",f.height));null!=a&&null!=a.background&&b.setAttribute("background",a.background);null!=a&&null!=a.backgroundImage&&b.setAttribute("backgroundImage",JSON.stringify(a.backgroundImage));b.setAttribute("math",null!=a&&a.mathEnabled?"1":"0");b.setAttribute("shadow",
+Graph.prototype.saveViewState=function(a,b,e){e||(b.setAttribute("grid",null==a||a.gridEnabled?"1":"0"),b.setAttribute("gridSize",null!=a?a.gridSize:mxGraph.prototype.gridSize),b.setAttribute("guides",null==a||a.guidesEnabled?"1":"0"),b.setAttribute("tooltips",null==a||a.tooltips?"1":"0"),b.setAttribute("connect",null==a||a.connect?"1":"0"),b.setAttribute("arrows",null==a||a.arrows?"1":"0"),b.setAttribute("page",null==a&&this.defaultPageVisible||null!=a&&a.pageVisible?"1":"0"),b.setAttribute("fold",
+null==a||a.foldingEnabled?"1":"0"));b.setAttribute("pageScale",null!=a&&null!=a.pageScale?a.pageScale:mxGraph.prototype.pageScale);e=null!=a?a.pageFormat:mxSettings.getPageFormat();null!=e&&(b.setAttribute("pageWidth",e.width),b.setAttribute("pageHeight",e.height));null!=a&&null!=a.background&&b.setAttribute("background",a.background);null!=a&&null!=a.backgroundImage&&b.setAttribute("backgroundImage",JSON.stringify(a.backgroundImage));b.setAttribute("math",null!=a&&a.mathEnabled?"1":"0");b.setAttribute("shadow",
null!=a&&a.shadowVisible?"1":"0")};
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}};
@@ -3355,199 +3356,200 @@ Graph.prototype.setViewState=function(a){null!=a?(this.lastPasteXml=a.lastPasteX
this.pageFormat=a.pageFormat,this.view.currentRoot=a.currentRoot,this.defaultParent=a.defaultParent,this.connectionArrowsEnabled=a.arrows,this.setTooltips(a.tooltips),this.setConnectable(a.connect),this.view.scale=null!=a.scale?a.scale:1,null==this.view.currentRoot||this.model.contains(this.view.currentRoot)||(this.view.currentRoot=null),null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer()),null!=a.translate&&(this.view.translate=
a.translate)):(this.view.currentRoot=null,this.view.scale=1,this.gridEnabled=!0,this.gridSize=mxGraph.prototype.gridSize,this.pageScale=mxGraph.prototype.pageScale,this.pageFormat=mxSettings.getPageFormat(),this.pageVisible=this.defaultPageVisible,this.backgroundImage=this.background=null,this.scrollbars=this.defaultScrollbars,this.foldingEnabled=this.graphHandler.guidesEnabled=!0,this.setShadowVisible(!1,!1),this.defaultParent=null,this.setTooltips(!0),this.setConnectable(!0),this.lastPasteXml=null,
this.pasteCounter=0,this.mathEnabled=!1,this.connectionArrowsEnabled=!0);this.preferPageSize=this.pageBreaksVisible=this.pageVisible;this.fireEvent(new mxEventObject("viewStateChanged","state",a))};
-EditorUi.prototype.updatePageRoot=function(a){if(null==a.root){var b=this.editor.extractGraphModel(a.node),f=Editor.extractParserError(b);if(f)throw Error(f);null!=b?(a.graphModelNode=b,a.viewState=this.editor.graph.createViewState(b),f=new mxCodec(b.ownerDocument),a.root=f.decode(b).root):a.root=this.editor.graph.model.createRoot()}else if(null==a.viewState){if(null==a.graphModelNode){b=this.editor.extractGraphModel(a.node);if(f=Editor.extractParserError(b))throw Error(f);null!=b&&(a.graphModelNode=
+EditorUi.prototype.updatePageRoot=function(a){if(null==a.root){var b=this.editor.extractGraphModel(a.node),e=Editor.extractParserError(b);if(e)throw Error(e);null!=b?(a.graphModelNode=b,a.viewState=this.editor.graph.createViewState(b),e=new mxCodec(b.ownerDocument),a.root=e.decode(b).root):a.root=this.editor.graph.model.createRoot()}else if(null==a.viewState){if(null==a.graphModelNode){b=this.editor.extractGraphModel(a.node);if(e=Editor.extractParserError(b))throw Error(e);null!=b&&(a.graphModelNode=
b)}null!=a.graphModelNode&&(a.viewState=this.editor.graph.createViewState(a.graphModelNode))}return a};
-EditorUi.prototype.selectPage=function(a,b,f){try{if(a!=this.currentPage){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);b=null!=b?b:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var d=this.editor.graph.model.createUndoableEdit();d.ignoreEdit=!0;var l=new SelectPage(this,a,f);l.execute();d.add(l);d.notify();this.editor.graph.tooltipHandler.hide();b||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))}}catch(n){this.handleError(n)}};
+EditorUi.prototype.selectPage=function(a,b,e){try{if(a!=this.currentPage){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);b=null!=b?b:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var d=this.editor.graph.model.createUndoableEdit();d.ignoreEdit=!0;var k=new SelectPage(this,a,e);k.execute();d.add(k);d.notify();this.editor.graph.tooltipHandler.hide();b||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))}}catch(m){this.handleError(m)}};
EditorUi.prototype.selectNextPage=function(a){var b=this.currentPage;null!=b&&null!=this.pages&&(b=mxUtils.indexOf(this.pages,b),a?this.selectPage(this.pages[mxUtils.mod(b+1,this.pages.length)]):a||this.selectPage(this.pages[mxUtils.mod(b-1,this.pages.length)]))};
-EditorUi.prototype.insertPage=function(a,b){if(this.editor.graph.isEnabled()){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);a=null!=a?a:this.createPage(null,this.createPageId());b=null!=b?b:this.pages.length;var f=new ChangePage(this,a,a,b);this.editor.graph.model.execute(f)}return a};EditorUi.prototype.createPageId=function(){var a;do a=Editor.guid();while(null!=this.getPageById(a));return a};
-EditorUi.prototype.createPage=function(a,b){var f=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"),b);f.setName(null!=a?a:this.createPageName());return f};EditorUi.prototype.createPageName=function(){for(var a={},b=0;b<this.pages.length;b++){var f=this.pages[b].getName();null!=f&&0<f.length&&(a[f]=f)}b=this.pages.length;do f=mxResources.get("pageWithNumber",[++b]);while(null!=a[f]);return f};
-EditorUi.prototype.removePage=function(a){try{var b=this.editor.graph,f=mxUtils.indexOf(this.pages,a);if(b.isEnabled()&&0<=f){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);b.model.beginUpdate();try{var d=this.currentPage;d==a&&1<this.pages.length?(f==this.pages.length-1?f--:f++,d=this.pages[f]):1>=this.pages.length&&(d=this.insertPage(),b.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));b.model.execute(new ChangePage(this,a,d))}finally{b.model.endUpdate()}}}catch(l){this.handleError(l)}return a};
-EditorUi.prototype.duplicatePage=function(a,b){var f=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var l=a.node.cloneNode(!1);l.removeAttribute("id");f=new DiagramPage(l);f.root=d.cloneCell(d.model.root);f.viewState=d.getViewState();f.viewState.scale=1;f.viewState.scrollLeft=null;f.viewState.scrollTop=null;f.viewState.currentRoot=null;f.viewState.defaultParent=null;f.setName(b);f=this.insertPage(f,mxUtils.indexOf(this.pages,a)+1)}}catch(n){this.handleError(n)}return f};
+EditorUi.prototype.insertPage=function(a,b){if(this.editor.graph.isEnabled()){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);a=null!=a?a:this.createPage(null,this.createPageId());b=null!=b?b:this.pages.length;var e=new ChangePage(this,a,a,b);this.editor.graph.model.execute(e)}return a};EditorUi.prototype.createPageId=function(){var a;do a=Editor.guid();while(null!=this.getPageById(a));return a};
+EditorUi.prototype.createPage=function(a,b){var e=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"),b);e.setName(null!=a?a:this.createPageName());return e};EditorUi.prototype.createPageName=function(){for(var a={},b=0;b<this.pages.length;b++){var e=this.pages[b].getName();null!=e&&0<e.length&&(a[e]=e)}b=this.pages.length;do e=mxResources.get("pageWithNumber",[++b]);while(null!=a[e]);return e};
+EditorUi.prototype.removePage=function(a){try{var b=this.editor.graph,e=mxUtils.indexOf(this.pages,a);if(b.isEnabled()&&0<=e){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);b.model.beginUpdate();try{var d=this.currentPage;d==a&&1<this.pages.length?(e==this.pages.length-1?e--:e++,d=this.pages[e]):1>=this.pages.length&&(d=this.insertPage(),b.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));b.model.execute(new ChangePage(this,a,d))}finally{b.model.endUpdate()}}}catch(k){this.handleError(k)}return a};
+EditorUi.prototype.duplicatePage=function(a,b){var e=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var k=a.node.cloneNode(!1);k.removeAttribute("id");e=new DiagramPage(k);e.root=d.cloneCell(d.model.root);e.viewState=d.getViewState();e.viewState.scale=1;e.viewState.scrollLeft=null;e.viewState.scrollTop=null;e.viewState.currentRoot=null;e.viewState.defaultParent=null;e.setName(b);e=this.insertPage(e,mxUtils.indexOf(this.pages,a)+1)}}catch(m){this.handleError(m)}return e};
EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var b=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(b){null!=b&&0<b.length&&this.editor.graph.model.execute(new RenamePage(this,a,b))}),mxResources.get("rename"));this.showDialog(b.container,300,80,!0,!0);b.init()}return a};EditorUi.prototype.movePage=function(a,b){this.editor.graph.model.execute(new MovePage(this,a,b))};
EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.className="geTabContainer";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,b=document.createElement("div");b.style.position="relative";b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.verticalAlign="top";b.style.height=this.tabContainer.style.height;b.style.whiteSpace="nowrap";b.style.overflow="hidden";b.style.fontSize="13px";b.style.marginLeft="30px";for(var f=this.editor.isChromelessView()?29:59,d=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
-f)/this.pages.length)+1),l=null,n=0;n<this.pages.length;n++)mxUtils.bind(this,function(d,c){this.pages[d]==this.currentPage?(c.className="geActivePage",c.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):c.className="geInactivePage";c.setAttribute("draggable","true");mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),l=d):mxEvent.consume(b)}));mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(a){a.stopPropagation();
-a.preventDefault()}));mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null!=l&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=l&&d!=l&&this.movePage(l,d);l=null;a.stopPropagation();a.preventDefault()}));b.appendChild(c)})(n,this.createTabForPage(this.pages[n],d,this.pages[n]!=this.currentPage,n+1));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);d=this.createPageMenuTab();
-this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(b.clientWidth>this.tabContainer.clientWidth-f){null!=d&&(d.style.position="absolute",d.style.right="0px",b.style.marginRight="30px");var t=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");t.style.position="absolute";t.style.right=this.editor.chromeless?"29px":"55px";t.style.fontSize="13pt";this.tabContainer.appendChild(t);var x=this.createControlTab(4,"&nbsp;&#10095;");
-x.style.position="absolute";x.style.right=this.editor.chromeless?"0px":"29px";x.style.fontSize="13pt";this.tabContainer.appendChild(x);var A=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=A+"px";mxEvent.addListener(t,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,A-20);mxUtils.setOpacity(t,0<b.scrollLeft?100:50);mxUtils.setOpacity(x,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(t,0<b.scrollLeft?100:
-50);mxUtils.setOpacity(x,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(x,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,A-20);mxUtils.setOpacity(t,0<b.scrollLeft?100:50);mxUtils.setOpacity(x,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,b=document.createElement("div");b.style.position="relative";b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.verticalAlign="top";b.style.height=this.tabContainer.style.height;b.style.whiteSpace="nowrap";b.style.overflow="hidden";b.style.fontSize="13px";b.style.marginLeft="30px";for(var e=this.editor.isChromelessView()?29:59,d=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(d,c){this.pages[d]==this.currentPage?(c.className="geActivePage",c.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):c.className="geInactivePage";c.setAttribute("draggable","true");mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),k=d):mxEvent.consume(b)}));mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(a){a.stopPropagation();
+a.preventDefault()}));mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=k&&d!=k&&this.movePage(k,d);k=null;a.stopPropagation();a.preventDefault()}));b.appendChild(c)})(m,this.createTabForPage(this.pages[m],d,this.pages[m]!=this.currentPage,m+1));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);d=this.createPageMenuTab();
+this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(b.clientWidth>this.tabContainer.clientWidth-e){null!=d&&(d.style.position="absolute",d.style.right="0px",b.style.marginRight="30px");var p=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");p.style.position="absolute";p.style.right=this.editor.chromeless?"29px":"55px";p.style.fontSize="13pt";this.tabContainer.appendChild(p);var v=this.createControlTab(4,"&nbsp;&#10095;");
+v.style.position="absolute";v.style.right=this.editor.chromeless?"0px":"29px";v.style.fontSize="13pt";this.tabContainer.appendChild(v);var B=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=B+"px";mxEvent.addListener(p,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,B-20);mxUtils.setOpacity(p,0<b.scrollLeft?100:50);mxUtils.setOpacity(v,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(p,0<b.scrollLeft?100:
+50);mxUtils.setOpacity(v,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(v,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,B-20);mxUtils.setOpacity(p,0<b.scrollLeft?100:50);mxUtils.setOpacity(v,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
EditorUi.prototype.createTab=function(a){var b=document.createElement("div");b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.whiteSpace="nowrap";b.style.boxSizing="border-box";b.style.position="relative";b.style.overflow="hidden";b.style.textAlign="center";b.style.marginLeft="-1px";b.style.height=this.tabContainer.clientHeight+"px";b.style.padding="12px 4px 8px 4px";b.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #e8eaed";b.style.borderTopStyle="none";b.style.borderBottomStyle=
"none";b.style.backgroundColor=this.tabContainer.style.backgroundColor;b.style.cursor="move";b.style.color="gray";a&&(mxEvent.addListener(b,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(b.style.backgroundColor="dark"==uiTheme?"black":"#e8eaed",mxEvent.consume(a))})),mxEvent.addListener(b,"mouseleave",mxUtils.bind(this,function(a){b.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return b};
-EditorUi.prototype.createControlTab=function(a,b){var f=this.createTab(!0);f.style.lineHeight=this.tabContainerHeight+"px";f.style.paddingTop=a+"px";f.style.cursor="pointer";f.style.width="30px";f.innerHTML=b;null!=f.firstChild&&null!=f.firstChild.style&&mxUtils.setOpacity(f.firstChild,40);return f};
+EditorUi.prototype.createControlTab=function(a,b){var e=this.createTab(!0);e.style.lineHeight=this.tabContainerHeight+"px";e.style.paddingTop=a+"px";e.style.cursor="pointer";e.style.width="30px";e.innerHTML=b;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;margin-top:5px;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.marginLeft="0px";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var d=
-0;d<this.pages.length;d++)mxUtils.bind(this,function(d){var c=a.addItem(this.pages[d].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[d])}),b);this.pages[d]==this.currentPage&&a.addCheckmark(c,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 f=this.currentPage;null!=f&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this,
-function(){this.removePage(f)}),b),a.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(f,f.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(f,mxResources.get("copyOf",[f.getName()]))}),b))}}));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=
-mxEvent.getClientX(a),l=mxEvent.getClientY(a);b.popup(d,l,null,a);this.setCurrentMenu(b);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,b,f,d){f=this.createTab(f);var l=a.getName()||mxResources.get("untitled"),n=a.getId();f.setAttribute("title",l+(null!=n?" ("+n+")":"")+" ["+d+"]");mxUtils.write(f,l);f.style.maxWidth=b+"px";f.style.width=b+"px";this.addTabListeners(a,f);42<b&&(f.style.textOverflow="ellipsis");return f};
-EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var f=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,l=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){d=null!=this.currentMenu;l=a==this.currentPage;f.isMouseDown||l||this.selectPage(a)}),null,mxUtils.bind(this,function(n){if(f.isEnabled()&&!f.isMouseDown&&(mxEvent.isTouchEvent(n)&&l||mxEvent.isPopupTrigger(n))){f.popupMenuHandler.hideMenu();
-this.hideCurrentMenu();if(!mxEvent.isTouchEvent(n)||!d){var t=new mxPopupMenu(this.createPageMenu(a));t.div.className+=" geMenubarMenu";t.smartSeparators=!0;t.showDisabled=!0;t.autoExpand=!0;t.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(t,arguments);this.resetCurrentMenu();t.destroy()});var x=mxEvent.getClientX(n),A=mxEvent.getClientY(n);t.popup(x,A,null,n);this.setCurrentMenu(t,b)}mxEvent.consume(n)}}))};
-EditorUi.prototype.createPageMenu=function(a,b){return mxUtils.bind(this,function(f,d){f.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),d);f.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),d);f.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,b)}),d);f.addSeparator(d);f.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
-mxResources.get("copyOf",[a.getName()]))}),d)})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(b){a.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,f,d){d.ui=a.ui;return f};a.afterDecode=function(a,f,d){a=d.oldIndex;d.oldIndex=d.newIndex;d.newIndex=a;return d};mxCodecRegistry.register(a)})();
-(function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,f,d){d.ui=a.ui;return f};a.afterDecode=function(a,f,d){a=d.previous;d.previous=d.name;d.name=a;return d};mxCodecRegistry.register(a)})();
-(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),b="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,d,l){l.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(l.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.viewState&&l.setAttribute("viewState",JSON.stringify(d.relatedPage.viewState,function(a,d){return 0>mxUtils.indexOf(b,
-a)?d:void 0})),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,l));return l};a.beforeDecode=function(a,b,l){l.ui=a.ui;l.relatedPage=l.ui.getPageById(b.getAttribute("relatedPage"));if(null==l.relatedPage){var d=b.ownerDocument.createElement("diagram");d.setAttribute("id",b.getAttribute("relatedPage"));d.setAttribute("name",b.getAttribute("name"));l.relatedPage=new DiagramPage(d);d=b.getAttribute("viewState");null!=d&&(l.relatedPage.viewState=JSON.parse(d),b.removeAttribute("viewState"));
-b=b.cloneNode(!0);d=b.firstChild;if(null!=d)for(l.relatedPage.root=a.decodeCell(d,!1),l=d.nextSibling,d.parentNode.removeChild(d),d=l;null!=d;){l=d.nextSibling;if(d.nodeType==mxConstants.NODETYPE_ELEMENT){var f=d.getAttribute("id");null==a.lookup(f)&&a.decodeCell(d)}d.parentNode.removeChild(d);d=l}}return b};a.afterDecode=function(a,b,l){l.index=l.previousIndex;return l};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";EditorUi.prototype.altShiftActions[68]=
-"selectDescendants";var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,d,f,x,A){d=null!=d?d:!1;null==f&&(f=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var l=f.slice(),c=[],g=0;g<f.length;g++){var k=this.view.getState(f[g]),n=null!=k?k.style:this.getCellStyle(f[g]);"1"==mxUtils.getValue(n,"treeFolding","0")&&(this.traverse(f[g],!0,mxUtils.bind(this,function(a,b){null!=b&&c.push(b);a!=f[g]&&c.push(a);return a==f[g]||!this.model.isCollapsed(a)})),
-this.model.setCollapsed(f[g],a))}for(g=0;g<c.length;g++)this.model.setVisible(c[g],!a);f=l;f=b.apply(this,arguments)}finally{this.model.endUpdate()}return f};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){f.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return z.isVertex(a)&&f(a)}function d(a){var b=!1;null!=a&&(b=m.view.getState(a),b="1"==(null!=b?b.style:m.getCellStyle(a)).treeMoving);
-return b}function f(a){var b=!1;null!=a&&(a=z.getParent(a),b=m.view.getState(a),b="tree"==(null!=b?b.style:m.getCellStyle(a)).containerType);return b}function x(a){var b=!1;null!=a&&(a=z.getParent(a),b=m.view.getState(a),m.view.getState(a),b=null!=(null!=b?b.style:m.getCellStyle(a)).childLayout);return b}function A(a){a=m.view.getState(a);if(null!=a){var b=m.getIncomingEdges(a.cell);if(0<b.length&&(b=m.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 C(a,b){b=null!=b?b:!0;m.model.beginUpdate();try{var c=m.model.getParent(a),d=m.getIncomingEdges(a),f=m.cloneCells([d[0],a]);m.model.setTerminal(f[0],m.model.getTerminal(d[0],!0),!0);var g=A(a),k=c.geometry;g==mxConstants.DIRECTION_SOUTH||
-g==mxConstants.DIRECTION_NORTH?f[1].geometry.x+=b?a.geometry.width+10:-f[1].geometry.width-10:f[1].geometry.y+=b?a.geometry.height+10:-f[1].geometry.height-10;m.view.currentRoot!=c&&(f[1].geometry.x-=k.x,f[1].geometry.y-=k.y);var l=m.view.getState(a),n=m.view.scale;if(null!=l){var p=mxRectangle.fromRectangle(l);g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH?p.x+=(b?a.geometry.width+10:-f[1].geometry.width-10)*n:p.y+=(b?a.geometry.height+10:-f[1].geometry.height-10)*n;var t=m.getOutgoingEdges(m.model.getTerminal(d[0],
-!0));if(null!=t){for(var v=g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH,q=k=d=0;q<t.length;q++){var y=m.model.getTerminal(t[q],!1);if(g==A(y)){var u=m.view.getState(y);y!=a&&null!=u&&(v&&b!=u.getCenterX()<l.getCenterX()||!v&&b!=u.getCenterY()<l.getCenterY())&&mxUtils.intersects(p,u)&&(d=10+Math.max(d,(Math.min(p.x+p.width,u.x+u.width)-Math.max(p.x,u.x))/n),k=10+Math.max(k,(Math.min(p.y+p.height,u.y+u.height)-Math.max(p.y,u.y))/n))}}v?k=0:d=0;for(q=0;q<t.length;q++)if(y=m.model.getTerminal(t[q],
-!1),g==A(y)&&(u=m.view.getState(y),y!=a&&null!=u&&(v&&b!=u.getCenterX()<l.getCenterX()||!v&&b!=u.getCenterY()<l.getCenterY()))){var x=[];m.traverse(u.cell,!0,function(a,b){null!=b&&x.push(b);x.push(a);return!0});m.moveCells(x,(b?1:-1)*d,(b?1:-1)*k)}}}return m.addCells(f,c)}finally{m.model.endUpdate()}}function c(a){m.model.beginUpdate();try{var b=A(a),c=m.getIncomingEdges(a),d=m.cloneCells([c[0],a]);m.model.setTerminal(c[0],d[1],!1);m.model.setTerminal(d[0],d[1],!0);m.model.setTerminal(d[0],a,!1);
-var f=m.model.getParent(a),g=f.geometry,k=[];m.view.currentRoot!=f&&(d[1].geometry.x-=g.x,d[1].geometry.y-=g.y);m.traverse(a,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});var l=a.geometry.width+40,n=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?l=0:b==mxConstants.DIRECTION_NORTH?(l=0,n=-n):b==mxConstants.DIRECTION_WEST?(l=-l,n=0):b==mxConstants.DIRECTION_EAST&&(n=0);m.moveCells(k,l,n);return m.addCells(d,f)}finally{m.model.endUpdate()}}function g(a){m.model.beginUpdate();try{var b=
-m.model.getParent(a),c=m.getIncomingEdges(a),d=m.cloneCells([c[0],a]);m.model.setTerminal(d[0],a,!0);var c=m.getOutgoingEdges(a),f=b.geometry,g=[];m.view.currentRoot==b&&(f=new mxRectangle);for(var k=0;k<c.length;k++){var l=m.model.getTerminal(c[k],!1);null!=l&&g.push(l)}var n=m.view.getBounds(g),p=A(a),t=m.view.translate,v=m.view.scale;p==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==n?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(n.x+n.width)/v-t.x-f.x+10,d[1].geometry.y+=d[1].geometry.height-
-f.y+40):p==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==n?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(n.x+n.width)/v-t.x+-f.x+10,d[1].geometry.y-=d[1].geometry.height+f.y+40):(d[1].geometry.x=p==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width+f.x+40):d[1].geometry.x+(d[1].geometry.width-f.x+40),d[1].geometry.y=null==n?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(n.y+n.height)/v-t.y+-f.y+10);return m.addCells(d,b)}finally{m.model.endUpdate()}}function k(a,
-b,c){a=m.getOutgoingEdges(a);c=m.view.getState(c);var d=[];if(null!=c&&null!=a){for(var f=0;f<a.length;f++){var g=m.view.getState(m.model.getTerminal(a[f],!1));null!=g&&(!b&&Math.min(g.x+g.width,c.x+c.width)>=Math.max(g.x,c.x)||b&&Math.min(g.y+g.height,c.y+c.height)>=Math.max(g.y,c.y))&&d.push(g)}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 q(a,b){var c=A(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
-c==mxConstants.DIRECTION_WEST)==d&&c!=b?p.actions.get("selectParent").funct():c==b?(d=m.getOutgoingEdges(a),null!=d&&0<d.length&&m.setSelectionCell(m.model.getTerminal(d[0],!1))):(c=m.getIncomingEdges(a),null!=c&&0<c.length&&(d=k(m.model.getTerminal(c[0],!0),d,a),c=m.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&&m.setSelectionCell(d[c].cell)))))}var p=this,m=p.editor.graph,z=m.getModel(),D=p.menus.createPopupMenu;
-p.menus.createPopupMenu=function(a,c,d){D.apply(this,arguments);if(1==m.getSelectionCount()){c=m.getSelectionCell();var f=m.getOutgoingEdges(c);a.addSeparator();null!=f&&0<f.length&&(b(m.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(m.getSelectionCell())&&(a.addSeparator(),0<m.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};p.actions.addAction("selectChildren",function(){if(m.isEnabled()&&
-1==m.getSelectionCount()){var a=m.getSelectionCell(),a=m.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(m.model.getTerminal(a[c],!1));m.setSelectionCells(b)}}},null,null,"Alt+Shift+X");p.actions.addAction("selectSiblings",function(){if(m.isEnabled()&&1==m.getSelectionCount()){var a=m.getSelectionCell(),a=m.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=m.getOutgoingEdges(m.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(m.model.getTerminal(a[c],
-!1));m.setSelectionCells(b)}}},null,null,"Alt+Shift+S");p.actions.addAction("selectParent",function(){if(m.isEnabled()&&1==m.getSelectionCount()){var a=m.getSelectionCell(),a=m.getIncomingEdges(a);null!=a&&0<a.length&&m.setSelectionCell(m.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");p.actions.addAction("selectDescendants",function(){if(m.isEnabled()&&1==m.getSelectionCount()){var a=m.getSelectionCell(),b=[];m.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});m.setSelectionCells(b)}},
-null,null,"Alt+Shift+D");var u=m.removeCells;m.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 d=[],g=0;g<a.length;g++){var k=a[g];z.isEdge(k)&&f(k)&&(d.push(k),k=z.getTerminal(k,!1));b(k)?(m.traverse(k,!0,function(a,b){null!=b&&d.push(b);d.push(a);return!0}),k=m.getIncomingEdges(a[g]),a=a.concat(k)):d.push(a[g])}a=d;return u.apply(this,arguments)};p.hoverIcons.getStateAt=function(a,c,
-d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var F=m.duplicateCells;m.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),f=0;f<d.length;f++){var g=m.view.getState(d[f]);if(null!=g&&b(g.cell))for(var k=m.getIncomingEdges(g.cell),g=0;g<k.length;g++)mxUtils.remove(k[g],a)}this.model.beginUpdate();try{var l=F.call(this,a,c);if(l.length==a.length)for(f=0;f<a.length;f++)if(b(a[f])){var n=m.getIncomingEdges(l[f]),k=m.getIncomingEdges(a[f]);
-if(0==n.length&&0<k.length){var p=this.cloneCell(k[0]);this.addEdge(p,m.getDefaultParent(),this.model.getTerminal(k[0],!0),l[f])}}}finally{this.model.endUpdate()}return l};var y=m.moveCells;m.moveCells=function(a,c,d,f,g,k,l){var n=null;this.model.beginUpdate();try{var p=g,t=this.view.getState(g),v=null!=t?t.style:this.getCellStyle(g);if(null!=a&&b(g)&&"1"==mxUtils.getValue(v,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||m.model.isEdge(a[q])&&null==m.model.getTerminal(a[q],!0)){g=m.model.getParent(a[q]);
-break}if(null!=p&&g!=p&&null!=this.view.getState(a[0])){var u=m.getIncomingEdges(a[0]);if(0<u.length){var x=m.view.getState(m.model.getTerminal(u[0],!0));if(null!=x){var z=m.view.getState(p);null!=z&&(c=(z.getCenterX()-x.getCenterX())/m.view.scale,d=(z.getCenterY()-x.getCenterY())/m.view.scale)}}}}n=y.apply(this,arguments);if(null!=n&&null!=a&&n.length==a.length)for(q=0;q<n.length;q++)if(this.model.isEdge(n[q]))b(p)&&0>mxUtils.indexOf(n,this.model.getTerminal(n[q],!0))&&this.model.setTerminal(n[q],
-p,!0);else if(b(a[q])&&(u=m.getIncomingEdges(a[q]),0<u.length))if(!f)b(p)&&0>mxUtils.indexOf(a,this.model.getTerminal(u[0],!0))&&this.model.setTerminal(u[0],p,!0);else if(0==m.getIncomingEdges(n[q]).length){t=p;if(null==t||t==m.model.getParent(a[q]))t=m.model.getTerminal(u[0],!0);f=this.cloneCell(u[0]);this.addEdge(f,m.getDefaultParent(),t,n[q])}}finally{this.model.endUpdate()}return n};if(null!=p.sidebar){var G=p.sidebar.dropAndConnect;p.sidebar.dropAndConnect=function(a,c,d,f){var g=m.model,k=null;
-g.beginUpdate();try{if(k=G.apply(this,arguments),b(a))for(var l=0;l<k.length;l++)if(g.isEdge(k[l])&&null==g.getTerminal(k[l],!0)){g.setTerminal(k[l],a,!0);var n=m.getCellGeometry(k[l]);n.points=null;null!=n.getTerminalPoint(!0)&&n.setTerminalPoint(null,!0)}}finally{g.endUpdate()}return k}}var v={88:p.actions.get("selectChildren"),84:p.actions.get("selectSubtree"),80:p.actions.get("selectParent"),83:p.actions.get("selectSiblings")},B=p.onKeyDown;p.onKeyDown=function(a){try{if(m.isEnabled()&&!m.isEditing()&&
-b(m.getSelectionCell())&&1==m.getSelectionCount()){var d=null;0<m.getIncomingEdges(m.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(m.getSelectionCell()):g(m.getSelectionCell()):13==a.which&&(d=C(m.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&m.model.isEdge(d[0])?m.setSelectionCell(m.model.getTerminal(d[0],!1)):m.setSelectionCell(d[d.length-1]),null!=p.hoverIcons&&p.hoverIcons.update(m.view.getState(m.getSelectionCell())),m.startEditingAtCell(m.getSelectionCell()),
-mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var f=v[a.keyCode];null!=f&&(f.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(q(m.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(q(m.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(q(m.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(q(m.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(T){console.log("error",
-T)}mxEvent.isConsumed(a)||B.apply(this,arguments)};var O=m.connectVertex;m.connectVertex=function(a,d,f,k,l,n){var p=m.getIncomingEdges(a);return b(a)&&0<p.length?(f=A(a),k=f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST,l=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,f==d?g(a):k==l?c(a):C(a,d!=mxConstants.DIRECTION_NORTH&&d!=mxConstants.DIRECTION_WEST)):O.call(this,a,d,f,k,l,n)};m.getSubtree=function(a){var c=[a];!d(a)&&!b(a)||x(a)||m.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 Z=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){Z.apply(this,arguments);(d(this.state.cell)||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",
+0;d<this.pages.length;d++)mxUtils.bind(this,function(d){var c=a.addItem(this.pages[d].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[d])}),b);this.pages[d]==this.currentPage&&a.addCheckmark(c,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))}}));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=
+mxEvent.getClientX(a),k=mxEvent.getClientY(a);b.popup(d,k,null,a);this.setCurrentMenu(b);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,b,e,d){e=this.createTab(e);var k=a.getName()||mxResources.get("untitled"),m=a.getId();e.setAttribute("title",k+(null!=m?" ("+m+")":"")+" ["+d+"]");mxUtils.write(e,k);e.style.maxWidth=b+"px";e.style.width=b+"px";this.addTabListeners(a,e);42<b&&(e.style.textOverflow="ellipsis");return e};
+EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var e=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,k=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){d=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();
+this.hideCurrentMenu();if(!mxEvent.isTouchEvent(m)||!d){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 v=mxEvent.getClientX(m),B=mxEvent.getClientY(m);p.popup(v,B,null,m);this.setCurrentMenu(p,b)}mxEvent.consume(m)}}))};
+EditorUi.prototype.createPageMenu=function(a,b){return mxUtils.bind(this,function(e,d){e.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),d);e.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),d);e.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,b)}),d);e.addSeparator(d);e.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
+mxResources.get("copyOf",[a.getName()]))}),d)})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(b){a.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){a=d.oldIndex;d.oldIndex=d.newIndex;d.newIndex=a;return d};mxCodecRegistry.register(a)})();
+(function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){a=d.previous;d.previous=d.name;d.name=a;return d};mxCodecRegistry.register(a)})();
+(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),b="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,d,k){k.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(k.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.viewState&&k.setAttribute("viewState",JSON.stringify(d.relatedPage.viewState,function(a,d){return 0>mxUtils.indexOf(b,
+a)?d:void 0})),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,k));return k};a.beforeDecode=function(a,b,k){k.ui=a.ui;k.relatedPage=k.ui.getPageById(b.getAttribute("relatedPage"));if(null==k.relatedPage){var d=b.ownerDocument.createElement("diagram");d.setAttribute("id",b.getAttribute("relatedPage"));d.setAttribute("name",b.getAttribute("name"));k.relatedPage=new DiagramPage(d);d=b.getAttribute("viewState");null!=d&&(k.relatedPage.viewState=JSON.parse(d),b.removeAttribute("viewState"));
+b=b.cloneNode(!0);d=b.firstChild;if(null!=d)for(k.relatedPage.root=a.decodeCell(d,!1),k=d.nextSibling,d.parentNode.removeChild(d),d=k;null!=d;){k=d.nextSibling;if(d.nodeType==mxConstants.NODETYPE_ELEMENT){var e=d.getAttribute("id");null==a.lookup(e)&&a.decodeCell(d)}d.parentNode.removeChild(d);d=k}}return b};a.afterDecode=function(a,b,k){k.index=k.previousIndex;return k};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";EditorUi.prototype.altShiftActions[68]=
+"selectDescendants";var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,d,e,v,B){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var k=e.slice(),c=[],f=0;f<e.length;f++){var g=this.view.getState(e[f]),m=null!=g?g.style:this.getCellStyle(e[f]);"1"==mxUtils.getValue(m,"treeFolding","0")&&(this.traverse(e[f],!0,mxUtils.bind(this,function(a,b){null!=b&&c.push(b);a!=e[f]&&c.push(a);return a==e[f]||!this.model.isCollapsed(a)})),
+this.model.setCollapsed(e[f],a))}for(f=0;f<c.length;f++)this.model.setVisible(c[f],!a);e=k;e=b.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 x.isVertex(a)&&e(a)}function d(a){var b=!1;null!=a&&(b=l.view.getState(a),b="1"==(null!=b?b.style:l.getCellStyle(a)).treeMoving);
+return b}function e(a){var b=!1;null!=a&&(a=x.getParent(a),b=l.view.getState(a),b="tree"==(null!=b?b.style:l.getCellStyle(a)).containerType);return b}function v(a){var b=!1;null!=a&&(a=x.getParent(a),b=l.view.getState(a),l.view.getState(a),b=null!=(null!=b?b.style:l.getCellStyle(a)).childLayout);return b}function B(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 z(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=B(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;l.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=l.view.getState(a),m=l.view.scale;if(null!=k){var n=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*m:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*m;var p=l.getOutgoingEdges(l.model.getTerminal(d[0],
+!0));if(null!=p){for(var u=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=g=d=0;q<p.length;q++){var t=l.model.getTerminal(p[q],!1);if(f==B(t)){var v=l.view.getState(t);t!=a&&null!=v&&(u&&b!=v.getCenterX()<k.getCenterX()||!u&&b!=v.getCenterY()<k.getCenterY())&&mxUtils.intersects(n,v)&&(d=10+Math.max(d,(Math.min(n.x+n.width,v.x+v.width)-Math.max(n.x,v.x))/m),g=10+Math.max(g,(Math.min(n.y+n.height,v.y+v.height)-Math.max(n.y,v.y))/m))}}u?g=0:d=0;for(q=0;q<p.length;q++)if(t=l.model.getTerminal(p[q],
+!1),f==B(t)&&(v=l.view.getState(t),t!=a&&null!=v&&(u&&b!=v.getCenterX()<k.getCenterX()||!u&&b!=v.getCenterY()<k.getCenterY()))){var y=[];l.traverse(v.cell,!0,function(a,b){null!=b&&y.push(b);y.push(a);return!0});l.moveCells(y,(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=B(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 k=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,m=-m):b==mxConstants.DIRECTION_WEST?(k=-k,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);l.moveCells(g,k,m);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 k=l.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var m=l.view.getBounds(f),n=B(a),p=l.view.translate,u=l.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/u-p.x-e.x+10,d[1].geometry.y+=d[1].geometry.height-
+e.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/u-p.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+(d[1].geometry.width-e.x+40),d[1].geometry.y=null==m?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(m.y+m.height)/u-p.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 t(a,b){var c=B(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
+c==mxConstants.DIRECTION_WEST)==d&&c!=b?n.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 n=this,l=n.editor.graph,x=l.getModel(),A=n.menus.createPopupMenu;
+n.menus.createPopupMenu=function(a,c,d){A.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))}};n.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");n.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");n.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");n.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+D");var q=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 d=[],f=0;f<a.length;f++){var g=a[f];x.isEdge(g)&&e(g)&&(d.push(g),g=x.getTerminal(g,!1));b(g)?(l.traverse(g,!0,function(a,b){null!=b&&d.push(b);d.push(a);return!0}),g=l.getIncomingEdges(a[f]),a=a.concat(g)):d.push(a[f])}a=d;return q.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c,
+d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var F=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 k=F.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var m=l.getIncomingEdges(k[e]),g=l.getIncomingEdges(a[e]);
+if(0==m.length&&0<g.length){var n=this.cloneCell(g[0]);this.addEdge(n,l.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var y=l.moveCells;l.moveCells=function(a,c,d,e,f,g,k){var m=null;this.model.beginUpdate();try{var n=f,p=this.view.getState(f),u=null!=p?p.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(u,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||l.model.isEdge(a[q])&&null==l.model.getTerminal(a[q],!0)){f=l.model.getParent(a[q]);
+break}if(null!=n&&f!=n&&null!=this.view.getState(a[0])){var t=l.getIncomingEdges(a[0]);if(0<t.length){var v=l.view.getState(l.model.getTerminal(t[0],!0));if(null!=v){var x=l.view.getState(n);null!=x&&(c=(x.getCenterX()-v.getCenterX())/l.view.scale,d=(x.getCenterY()-v.getCenterY())/l.view.scale)}}}}m=y.apply(this,arguments);if(null!=m&&null!=a&&m.length==a.length)for(q=0;q<m.length;q++)if(this.model.isEdge(m[q]))b(n)&&0>mxUtils.indexOf(m,this.model.getTerminal(m[q],!0))&&this.model.setTerminal(m[q],
+n,!0);else if(b(a[q])&&(t=l.getIncomingEdges(a[q]),0<t.length))if(!e)b(n)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],n,!0);else if(0==l.getIncomingEdges(m[q]).length){p=n;if(null==p||p==l.model.getParent(a[q]))p=l.model.getTerminal(t[0],!0);e=this.cloneCell(t[0]);this.addEdge(e,l.getDefaultParent(),p,m[q])}}finally{this.model.endUpdate()}return m};if(null!=n.sidebar){var E=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=l.model,g=null;
+f.beginUpdate();try{if(g=E.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var m=l.getCellGeometry(g[k]);m.points=null;null!=m.getTerminalPoint(!0)&&m.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var u={88:n.actions.get("selectChildren"),84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},C=n.onKeyDown;n.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=z(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!=n.hoverIcons&&n.hoverIcons.update(l.view.getState(l.getSelectionCell())),l.startEditingAtCell(l.getSelectionCell()),
+mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=u[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(t(l.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(t(l.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(t(l.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(t(l.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(P){console.log("error",
+P)}mxEvent.isConsumed(a)||C.apply(this,arguments)};var K=l.connectVertex;l.connectVertex=function(a,d,e,g,k,m){var n=l.getIncomingEdges(a);return b(a)&&0<n.length?(e=B(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==k?c(a):z(a,d!=mxConstants.DIRECTION_NORTH&&d!=mxConstants.DIRECTION_WEST)):K.call(this,a,d,e,g,k,m)};l.getSubtree=function(a){var c=[a];!d(a)&&!b(a)||v(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 Y=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){Y.apply(this,arguments);(d(this.state.cell)||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 I=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){I.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 Q=mxVertexHandler.prototype.destroy;
-mxVertexHandler.prototype.destroy=function(a,b){Q.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.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;");
+this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var H=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){H.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 O=mxVertexHandler.prototype.destroy;
+mxVertexHandler.prototype.destroy=function(a,b){O.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.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 mindmaps 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;treeMoving=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;treeMoving=1;");d.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");f.geometry.relative=!0;f.edge=!0;b.insertEdge(f,!0);d.insertEdge(f,!1);var c=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;treeMoving=1;");
-c.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);c.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;treeMoving=1;");k.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-l.geometry.relative=!0;l.edge=!0;b.insertEdge(l,!0);k.insertEdge(l,!1);var n=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;treeMoving=1;");n.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);n.insertEdge(m,!1);a.insert(f);a.insert(g);a.insert(l);a.insert(m);a.insert(b);a.insert(d);a.insert(c);a.insert(k);a.insert(n);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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;treeMoving=1;");a.vertex=
+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;treeMoving=1;");d.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");e.geometry.relative=!0;e.edge=!0;b.insertEdge(e,!0);d.insertEdge(e,!1);var c=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;treeMoving=1;");
+c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");f.geometry.relative=!0;f.edge=!0;b.insertEdge(f,!0);c.insertEdge(f,!1);var g=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;treeMoving=1;");g.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+k.geometry.relative=!0;k.edge=!0;b.insertEdge(k,!0);g.insertEdge(k,!1);var m=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;treeMoving=1;");m.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+l.geometry.relative=!0;l.edge=!0;b.insertEdge(l,!0);m.insertEdge(l,!1);a.insert(e);a.insert(f);a.insert(k);a.insert(l);a.insert(b);a.insert(d);a.insert(c);a.insert(g);a.insert(m);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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;treeMoving=1;");a.vertex=
!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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;treeMoving=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 mindmaps 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;treeMoving=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 d=new mxCell("Organization",new mxGeometry(80,40,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;container=1;recursiveResize=0;");b.setAttributeForCell(d,"treeRoot","1");d.vertex=!0;var f=new mxCell("Division",new mxGeometry(20,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");f.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");
-l.geometry.relative=!0;l.edge=!0;d.insertEdge(l,!0);f.insertEdge(l,!1);var c=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");c.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");g.geometry.relative=!0;g.edge=!0;d.insertEdge(g,!0);c.insertEdge(g,!1);a.insert(l);a.insert(g);a.insert(d);a.insert(f);
+a.vertex=!0;var d=new mxCell("Organization",new mxGeometry(80,40,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;container=1;recursiveResize=0;");b.setAttributeForCell(d,"treeRoot","1");d.vertex=!0;var e=new mxCell("Division",new mxGeometry(20,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");e.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");
+k.geometry.relative=!0;k.edge=!0;d.insertEdge(k,!0);e.insertEdge(k,!1);var c=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");f.geometry.relative=!0;f.edge=!0;d.insertEdge(f,!0);c.insertEdge(f,!1);a.insert(k);a.insert(f);a.insert(d);a.insert(e);
a.insert(c);return sb.createVertexTemplateFromCells([a],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;treeMoving=1;container=1;recursiveResize=0;");b.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;treeMoving=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;treeMoving=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;treeMoving=1;");d.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");f.geometry.setTerminalPoint(new mxPoint(110,-40),!0);f.geometry.relative=!0;f.edge=!0;d.insertEdge(f,!1);return sb.createVertexTemplateFromCells([b,f,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 l(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(566,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 b(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,218);a.sidebarWindow=new l(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var g=a.menus.get(c),k=f.addMenu(d,mxUtils.bind(this,function(){g.funct.apply(this,arguments)}));k.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;cusor:pointer;";
-k.className="geTitle";b.appendChild(k);return k}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";d.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(d,mxResources.get("moreShapes"));b.appendChild(d);mxEvent.addListener(d,"click",function(){a.actions.get("shapes").funct()});var f=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 g=document.createElement("span");g.style.cssText="position:relative;top:6px;";mxUtils.write(g,mxResources.get("newLibrary"));d.appendChild(g);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";g=document.createElement("span");g.style.cssText="position:relative;top:6px;";mxUtils.write(g,mxResources.get("openLibrary"));d.appendChild(g);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("openLibrary").funct)}else d=
+new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;treeMoving=1;");d.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");e.geometry.setTerminalPoint(new mxPoint(110,-40),!0);e.geometry.relative=!0;e.edge=!0;d.insertEdge(e,!1);return sb.createVertexTemplateFromCells([b,e,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(566,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 b(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,218);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;cusor:pointer;";
+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";d.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';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.boxSizing="border-box",d.style.paddingRight="6px",d.style.paddingLeft="6px",d.style.height="32px",d.style.left="0",d=c("openLibraryFrom",mxResources.get("openLibraryFrom")),d.style.borderLeft="1px solid lightgray",d.style.boxSizing="border-box",d.style.paddingRight="6px",d.style.paddingLeft="6px",d.style.height="32px",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||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
+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||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
try{var d=document.createElement("style");d.type="text/css";d.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }html body table.mxWindow td.mxWindowPane div.mxWindowPane *:not(svg *) { font-size:9pt; }table.mxWindow * { font-size:13px; }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; }html body a.geMenuItem { opacity: 0.75; cursor: pointer; user-select:none; }html body a.geMenuItem[disabled] { opacity: 0.2; }html body a.geMenuItem[disabled]:active { opacity: 0.2; }html body div.geActivePage { opacity: 0.7; }html body a.geMenuItem:active { opacity: 0.2; }html body .geToolbarButton { opacity: 0.3; }html body .geToolbarButton:active { opacity: 0.15; }html body .geStatus:active { opacity: 0.5; }html table.mxPopupMenu tr.mxPopupMenuItemHover:active { opacity:0.7; }html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding:2px;display:inline-block; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; border: none !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }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:0px; 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; 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); }.geToolbarContainer { background:#fff !important; }div.geSidebarContainer { background-color: #ffffff; }div.geSidebarContainer .geTitle { background-color:#fdfdfd; }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; }"+
-(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(d)}catch(m){}var l=function(a,b,c,d,f,g,k){var m=document.createElement("div");m.className="geSidebarContainer";m.style.position="absolute";m.style.width="100%";m.style.height="100%";m.style.border="1px solid whiteSmoke";m.style.overflowX="hidden";m.style.overflowY="auto";k(m);this.window=new mxWindow(b,m,c,d,f,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
+(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(d)}catch(l){}var k=function(a,b,c,d,e,f,g){var l=document.createElement("div");l.className="geSidebarContainer";l.style.position="absolute";l.style.width="100%";l.style.height="100%";l.style.border="1px solid whiteSmoke";l.style.overflowX="hidden";l.style.overflowY="auto";g(l);this.window=new mxWindow(b,l,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)};mxClient.IS_SF&&
(this.window.div.onselectstart=mxUtils.bind(this,function(b){null==b&&(b=window.event);return null!=b&&a.isSelectionAllowed(b)}))};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;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR=
"#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=35;mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";Format.prototype.inactiveTabBackgroundColor=
-"#f0f0f0";mxGraphHandler.prototype.previewColor="#C0C0C0";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=!0;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var n=EditorUi.prototype.updateTabContainer;EditorUi.prototype.updateTabContainer=
-function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px");n.apply(this,arguments)};var t=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){t.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var x=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(a,b){null!=b.shortcut&&900>f&&!mxClient.IS_IOS?a.firstChild.nextSibling.setAttribute("title",
-b.shortcut):x.apply(this,arguments)};var A=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){A.apply(this,arguments);if(null!=this.userElement){var a=this.userElement;a.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+a.style.display;a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.userImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height=
-"24px";a.style.width="24px";a.style.cssFloat="right";a.setAttribute("title",mxResources.get("changeUser"));"none"!=a.style.display&&(a.style.display="inline-block")}};var C=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){C.apply(this,arguments);if(null!=this.shareButton){var a=this.shareButton;a.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage=
+"#f0f0f0";mxGraphHandler.prototype.previewColor="#C0C0C0";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;Format.prototype.showCloseButton=!1;EditorUi.prototype.closableScratchpad=!1;EditorUi.prototype.toolbarHeight=46;EditorUi.prototype.footerHeight=0;Graph.prototype.editAfterInsert=!0;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var m=EditorUi.prototype.updateTabContainer;EditorUi.prototype.updateTabContainer=
+function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom=this.tabContainerHeight+"px");m.apply(this,arguments)};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(a,b){null!=b.shortcut&&900>e&&!mxClient.IS_IOS?a.firstChild.nextSibling.setAttribute("title",
+b.shortcut):v.apply(this,arguments)};var B=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){B.apply(this,arguments);if(null!=this.userElement){var a=this.userElement;a.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+a.style.display;a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage="url("+Editor.userImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height=
+"24px";a.style.width="24px";a.style.cssFloat="right";a.setAttribute("title",mxResources.get("changeUser"));"none"!=a.style.display&&(a.style.display="inline-block")}};var z=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){z.apply(this,arguments);if(null!=this.shareButton){var a=this.shareButton;a.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";a.className="geToolbarButton";a.innerHTML="";a.style.backgroundImage=
"url("+Editor.shareImage+")";a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height="24px";a.style.width="24px"}};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.buttonContainer){var a=document.createElement("div");a.style.display="inline-block";a.style.position="relative";a.style.marginTop="8px";a.style.marginRight="4px";var b=document.createElement("a");b.className="geMenuItem gePrimaryBtn";b.style.marginLeft=
"8px";b.style.padding="6px";"1"==urlParams.noSaveBtn?(mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)):(mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),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.className="geMenuItem",b.style.marginLeft="6px",b.style.padding="6px",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.className="geMenuItem";b.style.marginLeft=
-"6px";b.style.padding="6px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);a.y+=40;return a};var c=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,d){var f=this.editorUi.editor.graph;a.smartSeparators=!0;c.apply(this,arguments);
-mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResources.get("apply"),function(a){b(parseFloat(a))},mxResources.get("spacing"));this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()});1==f.getSelectionCount()?(this.addMenuItems(a,["editTooltip","-","editStyle","editGeometry","-"],null,d),f.isCellFoldable(f.getSelectionCell())&&this.addMenuItems(a,f.isCellCollapsed(b)?["expand"]:["collapse"],null,d),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],
-null,d),a.addSeparator(),this.addSubmenu("layout",a)):f.isSelectionEmpty()&&f.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,d),a.addSeparator(),this.addSubmenu("layout",a),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-","exitGroup"],null,d)):f.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,d)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):
-a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var g=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),
-this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);g.apply(this,arguments)};var k=
-EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){k.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var q=Menus.prototype.init;Menus.prototype.init=function(){q.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("createShape").label=
+"6px";b.style.padding="6px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);a.y+=40;return a};var c=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,d){var e=this.editorUi.editor.graph;a.smartSeparators=!0;c.apply(this,arguments);
+mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResources.get("apply"),function(a){b(parseFloat(a))},mxResources.get("spacing"));this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()});1==e.getSelectionCount()?(this.addMenuItems(a,["editTooltip","-","editStyle","editGeometry","-"],null,d),e.isCellFoldable(e.getSelectionCell())&&this.addMenuItems(a,e.isCellCollapsed(b)?["expand"]:["collapse"],null,d),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],
+null,d),a.addSeparator(),this.addSubmenu("layout",a)):e.isSelectionEmpty()&&e.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,d),a.addSeparator(),this.addSubmenu("layout",a),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-","exitGroup"],null,d)):e.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,d)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):
+a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var f=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),
+this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);f.apply(this,arguments)};var g=
+EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){g.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var t=Menus.prototype.init;Menus.prototype.init=function(){t.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";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("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.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){var d=c.getCurrentFile();c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(c.menus.addMenuItems(a,["new","open","-"],b),EditorUi.isElectronApp&&c.menus.addMenuItems(a,["synchronize","-"],b),c.menus.addMenuItems(a,["save","saveAs","-"],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),isLocalStorage&&this.addSubmenu("openRecent",a,b),a.addSeparator(b),null!=d&&d.constructor==DriveFile&&c.menus.addMenuItems(a,["share"],b),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||c.menus.addMenuItems(a,["synchronize"],b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);c.menus.addMenuItems(a,["-","outline","layers"],
b);c.commentsSupported()&&c.menus.addMenuItems(a,["comments"],b);c.menus.addMenuItems(a,["-","find","tags"],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"])})));this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["save","makeCopy","-","rename","moveToFolder"],
-b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));c.menus.addMenuItems(a,["-","autosave"],b);null!=d&&d.isRevisionHistorySupported()&&c.menus.addMenuItems(a,["-","revisionHistory"],b)})));var f=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){f.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,
-["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var g=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=g&&c.menus.addSubmenu("language",a,b);c.menus.addSubmenu("units",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips","ruler"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],
+b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));c.menus.addMenuItems(a,["-","autosave"],b);null!=d&&d.isRevisionHistorySupported()&&c.menus.addMenuItems(a,["-","revisionHistory"],b)})));var e=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){e.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,
+["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var f=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=f&&c.menus.addSubmenu("language",a,b);c.menus.addSubmenu("units",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips","ruler"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],
b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b));a.addSeparator(b)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),b)})));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);c.insertTemplateEnabled&&!c.isOffline()&&
-c.menus.addMenuItems(a,["insertTemplate"],b);a.addSeparator(b);this.addMenuItems(a,["createShape","insertFreehand","-"],b);this.addSubmenu("insertLayout",a,b,mxResources.get("layout"));this.addSubmenu("insertAdvanced",a,b,mxResources.get("advanced"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),l=function(a,
-b,d,f){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,f);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 -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a,
-"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],b)})))};var p=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=l.menus.get(a),f=x.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),t);f.className="geMenuItem";f.style.display="inline-block";f.style.boxSizing="border-box";f.style.top="6px";f.style.marginRight=
-"6px";f.style.height="30px";f.style.paddingTop="6px";f.style.paddingBottom="6px";f.style.cursor="pointer";f.setAttribute("title",mxResources.get(a));l.menus.menuCreated(d,f,"geMenuItem");null!=c?(f.style.backgroundImage="url("+c+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.width="34px",f.innerHTML=""):b||(f.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",f.style.backgroundPosition="right 6px center",
-f.style.backgroundRepeat="no-repeat",f.style.paddingRight="22px");return f}function c(a,b,c,d,f,g){var k=document.createElement("a");k.className="geMenuItem";k.style.display="inline-block";k.style.boxSizing="border-box";k.style.height="30px";k.style.padding="6px";k.style.position="relative";k.style.verticalAlign="top";k.style.top="0px";null!=l.statusContainer?q.insertBefore(k,l.statusContainer):q.appendChild(k);null!=g?(k.style.backgroundImage="url("+g+")",k.style.backgroundPosition="center center",
-k.style.backgroundRepeat="no-repeat",k.style.backgroundSize="24px 24px",k.style.width="34px"):mxUtils.write(k,a);mxEvent.addListener(k,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(k,"click",function(a){"disabled"!=k.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(k.style.marginRight="4px");null!=d&&k.setAttribute("title",d);null!=f&&(a=function(){f.isEnabled()?(k.removeAttribute("disabled"),k.style.cursor="pointer"):
-(k.setAttribute("disabled","disabled"),k.style.cursor="default")},f.addListener("stateChanged",a),a());return k}function d(a,b){var c=document.createElement("div");c.className="geMenuItem";c.style.display="inline-block";c.style.verticalAlign="top";c.style.marginRight="6px";c.style.padding="0 4px 0 4px";c.style.height="30px";c.style.position="relative";c.style.top="0px";for(var d=0;d<a.length;d++)null!=a[d]&&(a[d].style.margin="0px",a[d].style.boxShadow="none",c.appendChild(a[d]));null!=b&&mxUtils.setOpacity(c,
-b);null!=l.statusContainer?q.insertBefore(c,l.statusContainer):q.appendChild(c);return c}function g(){for(var b=q.firstChild;null!=b;){var g=b.nextSibling;"geMenuItem"!=b.className&&"geItem"!=b.className||b.parentNode.removeChild(b);b=g}t=q.firstChild;f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(b=1E3>f)||a("diagram");d([b?a("diagram",null,IMAGE_PATH+"/drawlogo.svg"):null,c(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),
-l.actions.get("image"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),c(mxResources.get("format"),l.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+l.actions.get("formatPanel").shortcut+")",l.actions.get("image"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
-null)],b?60:null);g=a("insert",!0,b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null);d([g,c(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==":
-null)],b?60:null);if(411<=f&&(g=l.actions.get("undo"),b=l.actions.get("redo"),g=c("",g.funct,null,mxResources.get("undo")+" ("+g.shortcut+")",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),b=c("",
-b.funct,null,mxResources.get("redo")+" ("+b.shortcut+")",b,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg=="),d([g,b],60),480<=f)){var b=l.actions.get("zoomIn"),g=l.actions.get("zoomOut"),k=l.actions.get("resetView");
-d([c("",function(){n.popupMenuHandler.hideMenu();var a=n.view.scale,b=n.view.translate.x,c=n.view.translate.y;l.actions.get("resetView").funct();1E-5>Math.abs(a-n.view.scale)&&b==n.view.translate.x&&c==n.view.translate.y&&l.actions.get(n.pageVisible?"fitPage":"fitWindow").funct()},!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",k,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg=="),
-640<=f?c("",b.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",b,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="):
-null,640<=f?c("",g.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="):
-null],60)}b=l.menus.get("language");null!=b&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=f?(null==P&&(g=x.addMenu("",b.funct),g.setAttribute("title",mxResources.get("language")),g.className="geToolbarButton",g.style.backgroundImage="url("+Editor.globeImage+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.position="absolute",g.style.height="24px",g.style.width="24px",g.style.zIndex="1",g.style.right="8px",g.style.cursor=
-"pointer",g.style.top="1"==urlParams.embed?"12px":"11px",q.appendChild(g),P=g),l.buttonContainer.style.paddingRight="34px"):(l.buttonContainer.style.paddingRight="4px",null!=P&&(P.parentNode.removeChild(P),P=null))}p.apply(this,arguments);var k=document.createElement("div");k.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";k.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(k);null==urlParams.clibs&&
-null==urlParams.libs||b(this);var l=this,n=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));l.defaultLibraryName=mxResources.get("untitledLibrary");var q=document.createElement("div");q.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 t=null,x=new Menubar(l,q);l.statusContainer=l.createStatusContainer();l.statusContainer.style.position="relative";
-l.statusContainer.style.maxWidth="";l.statusContainer.style.marginTop="7px";l.statusContainer.style.marginLeft="6px";l.statusContainer.style.color="gray";l.statusContainer.style.cursor="default";l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));var A=l.descriptorChanged;l.descriptorChanged=function(){A.apply(this,arguments);var a=l.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":
-"gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);q.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else q.removeAttribute("title")};l.setStatusText(l.editor.getStatus());q.appendChild(l.statusContainer);l.buttonContainer=document.createElement("div");l.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";q.appendChild(l.buttonContainer);l.menubarContainer=l.buttonContainer;
-l.tabContainer=document.createElement("div");l.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;visibility:hidden;";var k=l.diagramContainer.parentNode,C=document.createElement("div");C.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";l.diagramContainer.style.top="47px";var Q=l.menus.get("viewZoom");
-if(null!=Q){this.tabContainer.style.right="70px";var E=x.addMenu("100%",Q.funct);E.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");E.style.whiteSpace="nowrap";E.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";E.style.backgroundPosition="right 6px center";E.style.backgroundRepeat="no-repeat";E.style.backgroundColor="#ffffff";E.style.paddingRight="10px";E.style.display="block";E.style.position="absolute";E.style.textDecoration="none";E.style.textDecoration="none";
-E.style.right="0px";E.style.bottom="0px";E.style.overflow="hidden";E.style.visibility="hidden";E.style.textAlign="center";E.style.color="#000";E.style.fontSize="12px";E.style.color="#707070";E.style.width="59px";E.style.cursor="pointer";E.style.borderTop="1px solid lightgray";E.style.borderLeft="1px solid lightgray";E.style.height=parseInt(l.tabContainerHeight)-1+"px";E.style.lineHeight=parseInt(l.tabContainerHeight)+1+"px";C.appendChild(E);Q=mxUtils.bind(this,function(){E.innerHTML=Math.round(100*
-l.editor.graph.view.scale)+"%"});l.editor.graph.view.addListener(mxEvent.EVENT_SCALE,Q);l.editor.addListener("resetGraphView",Q);l.editor.addListener("pageSelected",Q);var L=l.setGraphEnabled;l.setGraphEnabled=function(){L.apply(this,arguments);null!=this.tabContainer&&(E.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}C.appendChild(l.tabContainer);C.appendChild(q);C.appendChild(l.diagramContainer);
-k.appendChild(C);l.updateTabContainer();var P=null;g();mxEvent.addListener(window,"resize",function(){g();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit()})}}};
-(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var b=EditorUi.initTheme;EditorUi.initTheme=function(){b.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();DrawioComment=function(a,b,f,d,l,n,t){this.file=a;this.id=b;this.content=f;this.modifiedDate=d;this.createdDate=l;this.isResolved=n;this.user=t;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,b,f,d,l){b()};DrawioComment.prototype.editComment=function(a,b,f){b()};DrawioComment.prototype.deleteComment=function(a,b){a()};DrawioUser=function(a,b,f,d,l){this.id=a;this.email=b;this.displayName=f;this.pictureUrl=d;this.locale=l};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\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\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\nback=Back\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\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\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\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\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\ncompress=Compress\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\ncopyCreated=A copy of the file was created.\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\ncurrentPage=Current page\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\ndownloadDesktop=Download draw.io Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\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.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified. Do you want to synchronize those changes?\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\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)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\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\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngooglePlus=Google+\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\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>.\ninvalidInput=Invalid input\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\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\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\nno=No\nnoPickFolder=No, pick folder\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\nrelative=Relative\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 shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\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\nsimpleViewer=Simple Viewer\nsize=Size\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\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\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\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\nuseOffline=Use Offline\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\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\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please, check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrwaDiag=draw.io diagram\nunknownErr=Unkown Error\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occured, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound=Gliffy diagram "{1}" found. Importing\nconfAGliffyDiagImported=Gliffy diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported Gliffy diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing Gliffy diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching Gliffy diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occured!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nworking=Working\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\npickGDriveFile=Pick Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="#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,b,f){this.init(a,b,f)};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.center=!1;GraphViewer.prototype.allowZoomIn=!1;
+c.menus.addMenuItems(a,["insertTemplate"],b);a.addSeparator(b);this.addMenuItems(a,["createShape","insertFreehand","-"],b);this.addSubmenu("insertLayout",a,b,mxResources.get("layout"));this.addSubmenu("insertAdvanced",a,b,mxResources.get("advanced"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b)})));var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),k=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<g.length;c++)"-"==g[c]?a.addSeparator(b):k(a,b,mxResources.get(g[c])+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a,
+"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],b)})))};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=k.menus.get(a),e=v.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),t);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight=
+"6px";e.style.height="30px";e.style.paddingTop="6px";e.style.paddingBottom="6px";e.style.cursor="pointer";e.setAttribute("title",mxResources.get(a));k.menus.menuCreated(d,e,"geMenuItem");null!=c?(e.style.backgroundImage="url("+c+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.width="34px",e.innerHTML=""):b||(e.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",e.style.backgroundPosition="right 6px center",
+e.style.backgroundRepeat="no-repeat",e.style.paddingRight="22px");return e}function c(a,b,c,d,e,f){var g=document.createElement("a");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";null!=k.statusContainer?p.insertBefore(g,k.statusContainer):p.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,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));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);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),g.style.cursor="pointer"):
+(g.setAttribute("disabled","disabled"),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function d(a,b){var c=document.createElement("div");c.className="geMenuItem";c.style.display="inline-block";c.style.verticalAlign="top";c.style.marginRight="6px";c.style.padding="0 4px 0 4px";c.style.height="30px";c.style.position="relative";c.style.top="0px";for(var d=0;d<a.length;d++)null!=a[d]&&(a[d].style.margin="0px",a[d].style.boxShadow="none",c.appendChild(a[d]));null!=b&&mxUtils.setOpacity(c,
+b);null!=k.statusContainer?p.insertBefore(c,k.statusContainer):p.appendChild(c);return c}function f(){for(var b=p.firstChild;null!=b;){var f=b.nextSibling;"geMenuItem"!=b.className&&"geItem"!=b.className||b.parentNode.removeChild(b);b=f}t=p.firstChild;e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(b=1E3>e)||a("diagram");d([b?a("diagram",null,IMAGE_PATH+"/drawlogo.svg"):null,c(mxResources.get("shapes"),k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),
+k.actions.get("image"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),c(mxResources.get("format"),k.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+k.actions.get("formatPanel").shortcut+")",k.actions.get("image"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
+null)],b?60:null);f=a("insert",!0,b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null);d([f,c(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==":
+null)],b?60:null);if(411<=e&&(f=k.actions.get("undo"),b=k.actions.get("redo"),f=c("",f.funct,null,mxResources.get("undo")+" ("+f.shortcut+")",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),b=c("",
+b.funct,null,mxResources.get("redo")+" ("+b.shortcut+")",b,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg=="),d([f,b],60),480<=e)){var b=k.actions.get("zoomIn"),f=k.actions.get("zoomOut"),g=k.actions.get("resetView");
+d([c("",function(){m.popupMenuHandler.hideMenu();var a=m.view.scale,b=m.view.translate.x,c=m.view.translate.y;k.actions.get("resetView").funct();1E-5>Math.abs(a-m.view.scale)&&b==m.view.translate.x&&c==m.view.translate.y&&k.actions.get(m.pageVisible?"fitPage":"fitWindow").funct()},!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg=="),
+640<=e?c("",b.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",b,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="):
+null,640<=e?c("",f.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="):
+null],60)}b=k.menus.get("language");null!=b&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=e?(null==Q&&(f=v.addMenu("",b.funct),f.setAttribute("title",mxResources.get("language")),f.className="geToolbarButton",f.style.backgroundImage="url("+Editor.globeImage+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.position="absolute",f.style.height="24px",f.style.width="24px",f.style.zIndex="1",f.style.right="8px",f.style.cursor=
+"pointer",f.style.top="1"==urlParams.embed?"12px":"11px",p.appendChild(f),Q=f),k.buttonContainer.style.paddingRight="34px"):(k.buttonContainer.style.paddingRight="4px",null!=Q&&(Q.parentNode.removeChild(Q),Q=null))}n.apply(this,arguments);var g=document.createElement("div");g.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";g.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(g);null==urlParams.clibs&&
+null==urlParams.libs||b(this);var k=this,m=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));k.defaultLibraryName=mxResources.get("untitledLibrary");var p=document.createElement("div");p.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 t=null,v=new Menubar(k,p);k.statusContainer=k.createStatusContainer();k.statusContainer.style.position="relative";
+k.statusContainer.style.maxWidth="";k.statusContainer.style.marginTop="7px";k.statusContainer.style.marginLeft="6px";k.statusContainer.style.color="gray";k.statusContainer.style.cursor="default";k.editor.addListener("statusChanged",mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));var B=k.descriptorChanged;k.descriptorChanged=function(){B.apply(this,arguments);var a=k.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":
+"gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);p.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else p.removeAttribute("title")};k.setStatusText(k.editor.getStatus());p.appendChild(k.statusContainer);k.buttonContainer=document.createElement("div");k.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";p.appendChild(k.buttonContainer);k.menubarContainer=k.buttonContainer;
+k.tabContainer=document.createElement("div");k.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;visibility:hidden;";var g=k.diagramContainer.parentNode,z=document.createElement("div");z.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";k.diagramContainer.style.top="47px";var O=k.menus.get("viewZoom");
+if(null!=O){this.tabContainer.style.right="70px";var D=v.addMenu("100%",O.funct);D.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");D.style.whiteSpace="nowrap";D.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";D.style.backgroundPosition="right 6px center";D.style.backgroundRepeat="no-repeat";D.style.backgroundColor="#ffffff";D.style.paddingRight="10px";D.style.display="block";D.style.position="absolute";D.style.textDecoration="none";D.style.textDecoration="none";
+D.style.right="0px";D.style.bottom="0px";D.style.overflow="hidden";D.style.visibility="hidden";D.style.textAlign="center";D.style.color="#000";D.style.fontSize="12px";D.style.color="#707070";D.style.width="59px";D.style.cursor="pointer";D.style.borderTop="1px solid lightgray";D.style.borderLeft="1px solid lightgray";D.style.height=parseInt(k.tabContainerHeight)-1+"px";D.style.lineHeight=parseInt(k.tabContainerHeight)+1+"px";z.appendChild(D);O=mxUtils.bind(this,function(){D.innerHTML=Math.round(100*
+k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,O);k.editor.addListener("resetGraphView",O);k.editor.addListener("pageSelected",O);var L=k.setGraphEnabled;k.setGraphEnabled=function(){L.apply(this,arguments);null!=this.tabContainer&&(D.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}z.appendChild(k.tabContainer);z.appendChild(p);z.appendChild(k.diagramContainer);
+g.appendChild(z);k.updateTabContainer();var Q=null;f();mxEvent.addListener(window,"resize",function(){f();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit()})}}};
+(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var b=EditorUi.initTheme;EditorUi.initTheme=function(){b.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();DrawioComment=function(a,b,e,d,k,m,p){this.file=a;this.id=b;this.content=e;this.modifiedDate=d;this.createdDate=k;this.isResolved=m;this.user=p;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,b,e,d,k){b()};DrawioComment.prototype.editComment=function(a,b,e){b()};DrawioComment.prototype.deleteComment=function(a,b){a()};DrawioUser=function(a,b,e,d,k){this.id=a;this.email=b;this.displayName=e;this.pictureUrl=d;this.locale=k};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\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\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\nback=Back\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\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\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\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\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\ncompress=Compress\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\ncopyCreated=A copy of the file was created.\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\ncurrentPage=Current page\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\ndownloadDesktop=Download draw.io Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\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.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified. Do you want to synchronize those changes?\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\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)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\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\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngooglePlus=Google+\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\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>.\ninvalidInput=Invalid input\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\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\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\nno=No\nnoPickFolder=No, pick folder\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\nrelative=Relative\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 shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\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\nsimpleViewer=Simple Viewer\nsize=Size\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\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\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\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\nuseOffline=Use Offline\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\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\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please, check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrwaDiag=draw.io diagram\nunknownErr=Unkown Error\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occured, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound=Gliffy diagram "{1}" found. Importing\nconfAGliffyDiagImported=Gliffy diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported Gliffy diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing Gliffy diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching Gliffy diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occured!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nworking=Working\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\npickGDriveFile=Pick Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="#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,b,e){this.init(a,b,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.center=!1;GraphViewer.prototype.allowZoomIn=!1;
GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;
-GraphViewer.prototype.init=function(a,b,f){this.graphConfig=null!=f?f:{};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.center=null!=this.graphConfig.center?this.graphConfig.center:this.center;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;this.toolbarItems=null!=
+GraphViewer.prototype.init=function(a,b,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.center=null!=this.graphConfig.center?this.graphConfig.center:this.center;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.pageId=this.graphConfig.pageId;
this.editor=null;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=b&&(this.xmlDocument=b.ownerDocument,this.xmlNode=b,this.xml=mxUtils.getXml(b),null!=a)){var d=mxUtils.bind(this,function(){this.graph=new Graph(a);this.graph.defaultPageBackgroundColor="transparent";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);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");this.xmlNode=this.editor.extractGraphModel(this.xmlNode,!0);var d=this;this.graph.getImageFromBundles=function(a){return d.getImageUrl(a)};mxClient.IS_SVG&&this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);
-if("mxfile"==b.nodeName){var f=b.getElementsByTagName("diagram");if(0<f.length){if(null!=this.pageId)for(var l=0;l<f.length;l++)if(this.pageId==f[l].getAttribute("id")){this.currentPage=l;break}var n=this.graph.getGlobalVariable,d=this;this.graph.getGlobalVariable=function(a){var b=f[d.currentPage];return"page"==a?b.getAttribute("name")||"Page-"+(d.currentPage+1):"pagenumber"==a?d.currentPage+1:"pagecount"==a?f.length:n.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(a){this.handlingResize||
-(this.currentPage=mxUtils.mod(a,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(a){for(var b=!1,c=0;c<this.diagrams.length;c++)if(this.diagrams[c].getAttribute("id")==a){this.selectPage(c);b=!0;break}return b};l=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",
-l);l();urlParams.page=d.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};d=this;this.graph.customLinkClicked=function(a){var b=!0;if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");
-d.selectPageById(a.substring(c+1))||(b=!1,alert(mxResources.get("pageNotFound")||"Page not found"))}else this.handleCustomLink(a);return b};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",this.graphConfig.title);this.fireEvent(new mxEventObject("render"))});f=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof f){var l=this.getObservableParent(a),
-n=new f(mxUtils.bind(this,function(b){0<a.offsetWidth&&(n.disconnect(),d())}));n.observe(l,{attributes:!0})}else d()}};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};
+if("mxfile"==b.nodeName){var e=b.getElementsByTagName("diagram");if(0<e.length){if(null!=this.pageId)for(var k=0;k<e.length;k++)if(this.pageId==e[k].getAttribute("id")){this.currentPage=k;break}var m=this.graph.getGlobalVariable,d=this;this.graph.getGlobalVariable=function(a){var b=e[d.currentPage];return"page"==a?b.getAttribute("name")||"Page-"+(d.currentPage+1):"pagenumber"==a?d.currentPage+1:"pagecount"==a?e.length:m.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(a){this.handlingResize||
+(this.currentPage=mxUtils.mod(a,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(a){for(var b=!1,c=0;c<this.diagrams.length;c++)if(this.diagrams[c].getAttribute("id")==a){this.selectPage(c);b=!0;break}return b};k=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",
+k);k();urlParams.page=d.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);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",this.graphConfig.title);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};d=this;this.graph.customLinkClicked=function(a){var b=!0;if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");d.selectPageById(a.substring(c+1))||(b=!1,alert(mxResources.get("pageNotFound")||"Page not found"))}else this.handleCustomLink(a);return b};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(b){0<a.offsetWidth&&(m.disconnect(),d())}));m.observe(k,{attributes:!0})}else d()}};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,b=this.graph.getGraphBounds(),f=!1;a.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var d=mxUtils.bind(this,function(){if(!f){f=!0;var b=this.graph.getGraphBounds();a.style.overflow=1!=this.graphConfig["toolbar-nohide"]?b.width+2*this.graph.border>a.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){var b=a.getBoundingClientRect(),d=mxUtils.getScrollOrigin(document.body),
-d="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-d.x,top:-d.y},b={left:b.left-d.left,top:b.top-d.top,bottom:b.bottom-d.top,right:b.right-d.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"}f=
-!1}}),l=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(b){var d=a.offsetWidth;d==l||this.handlingResize||(this.handlingResize=!0,"auto"==a.style.overflow&&(a.style.overflow="hidden"),this.graph.maxFitScale=null!=b?b:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(),(this.center||0==this.graphConfig.resize&&""!=a.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=a.style.height||this.updateContainerHeight(a,Math.max(this.minHeight,
-this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},l=d,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=!1}),0))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",d),this.graph.addListener("size",d)):new ResizeSensor(this.graph.container,d));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=
-new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=a.style.height&&this.autoFit||this.updateContainerWidth(a,b.width+2*this.graph.border),0==this.graphConfig.resize&&""!=a.style.height||this.updateContainerHeight(a,Math.max(this.minHeight,b.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var n=l=null,d=mxUtils.bind(this,function(){window.clearTimeout(n);this.handlingResize||(n=window.setTimeout(mxUtils.bind(this,this.fitGraph),
-100))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?mxEvent.addListener(window,"resize",d):new ResizeSensor(this.graph.container,d))}else mxClient.IS_QUIRKS||9>=document.documentMode||this.graph.addListener("size",d);var t=mxUtils.bind(this,function(){var d=a.style.minWidth;this.widthIsEmpty&&(a.style.minWidth="100%");var f=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=a.style.height&&this.autoFit?a.offsetHeight:void 0;if(0<a.offsetWidth&&(this.allowZoomIn||
-b.width+2*this.graph.border>a.offsetWidth||b.height+2*this.graph.border>f)){var n=null;null!=f&&b.height+2*this.graph.border>f-2&&(n=(f-2*this.graph.border-2)/b.height);this.fitGraph(n)}else this.widthIsEmpty||0!=this.graphConfig.resize||""==a.style.height?(this.graph.view.setTranslate(Math.floor(this.graph.border-b.x/this.graph.view.scale),Math.floor(this.graph.border-b.y/this.graph.view.scale)),l=a.offsetWidth):this.graph.center((!this.widthIsEmpty||b.width<this.minWidth)&&1!=this.graphConfig.resize);
-a.style.minWidth=d});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(t,0):t();this.positionGraph=function(){b=this.graph.getGraphBounds();l=null;t()}};GraphViewer.prototype.updateContainerWidth=function(a,b){a.style.width=b+"px"};GraphViewer.prototype.updateContainerHeight=function(a,b){if(this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||mxClient.IS_QUIRKS||8==document.documentMode)a.style.height=b+"px"};
-GraphViewer.prototype.showLayers=function(a,b){var f=this.graphConfig.layers;if(null!=f||null!=b)if(f=null!=f?f.split(" "):null,null!=b||0<f.length){var d=null!=b?b.getModel():null,l=a.getModel();l.beginUpdate();try{for(var n=l.getChildCount(l.root),t=0;t<n;t++)l.setVisible(l.getChildAt(l.root,t),null!=b?d.isVisible(d.getChildAt(d.root,t)):!1);if(null==d)for(t=0;t<f.length;t++)l.setVisible(l.getChildAt(l.root,parseInt(f[t])),!0)}finally{l.endUpdate()}}};
-GraphViewer.prototype.addToolbar=function(){function a(a,b,d,g){var k=document.createElement("div");k.style.borderRight="1px solid #d0d0d0";k.style.padding="3px 6px 3px 6px";mxEvent.addListener(k,"click",a);null!=d&&k.setAttribute("title",d);k.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==g||g?(mxEvent.addListener(k,"mouseenter",function(){k.style.backgroundColor="#ddd"}),mxEvent.addListener(k,"mouseleave",
-function(){k.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),k.style.cursor="pointer"):mxUtils.setOpacity(k,30);k.appendChild(a);f.appendChild(k);c++;return k}var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var f=b.ownerDocument.createElement("div");f.style.position="absolute";f.style.overflow="hidden";f.style.boxSizing="border-box";
-f.style.whiteSpace="nowrap";f.style.textAlign="left";f.style.zIndex=this.toolbarZIndex;f.style.backgroundColor="#eee";f.style.height=this.toolbarHeight+"px";this.toolbar=f;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(f.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(f,30);var d=null,l=null,n=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=l&&(window.clearTimeout(l),fadeThead2=null);d=window.setTimeout(mxUtils.bind(this,
-function(){mxUtils.setOpacity(f,0);d=null;l=window.setTimeout(mxUtils.bind(this,function(){f.style.display="none";l=null}),100)}),a||200)}),t=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=l&&(window.clearTimeout(l),fadeThead2=null);f.style.display="";mxUtils.setOpacity(f,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(t(30),n())}));mxEvent.addListener(f,mxClient.IS_POINTER?
-"pointermove":"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(f,"mouseenter",mxUtils.bind(this,function(a){t(100)}));mxEvent.addListener(f,"mousemove",mxUtils.bind(this,function(a){t(100);mxEvent.consume(a)}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||t(30)}));var x=this.graph,A=x.getTolerance();x.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();
-this.scrollLeft=x.container.scrollLeft;this.scrollTop=x.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-x.container.scrollLeft)<A&&Math.abs(this.scrollTop-x.container.scrollTop)<A&&Math.abs(this.startX-b.getGraphX())<A&&Math.abs(this.startY-b.getGraphY())<A&&(0<parseFloat(f.style.opacity||0)?n():t(30))}})}for(var C=this.toolbarItems,c=0,g=null,k=null,q=0;q<C.length;q++){var p=C[q];if("pages"==p){k=b.ownerDocument.createElement("div");
-k.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(k,70);var m=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");m.style.borderRightStyle="none";m.style.paddingLeft="0px";m.style.paddingRight="0px";f.appendChild(k);var z=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
-1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");z.style.paddingLeft="0px";z.style.paddingRight="0px";p=mxUtils.bind(this,function(){k.innerHTML="";mxUtils.write(k,this.currentPage+1+" / "+this.diagrams.length);k.style.display=1<this.diagrams.length?"inline-block":"none";m.style.display=k.style.display;z.style.display=k.style.display});this.addListener("graphChanged",p);p()}else if("zoom"==p)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"==p){if(this.layersEnabled){var D=this.graph.getModel(),u=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=u.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");D.addListener(mxEvent.CHANGE,function(){u.style.display=1<D.getChildCount(D.root)?"inline-block":"none"});u.style.display=1<D.getChildCount(D.root)?"inline-block":"none"}}else"lightbox"==p?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(p=this.graphConfig["toolbar-buttons"][p],
-null!=p&&a(null==p.enabled||p.enabled?p.handler:function(){},p.image,p.title,p.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*c);null!=this.graphConfig.title&&(C=b.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),f.appendChild(C));this.minToolbarWidth=34*c;var F=b.style.border,C=mxUtils.bind(this,function(){f.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";f.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var a=b.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},a={left:a.left-c.left,top:a.top-
-c.top,bottom:a.bottom-c.top,right:a.right-c.left};f.style.left=a.left+"px";"bottom"==this.graphConfig["toolbar-position"]?f.style.top=a.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(f.style.marginTop=-this.toolbarHeight+"px",f.style.top=a.top+1+"px"):f.style.top=a.top+"px";"1px solid transparent"==F&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(f);var d=mxUtils.bind(this,function(){null!=f.parentNode&&f.parentNode.removeChild(f);null!=g&&(g.parentNode.removeChild(g),
-g=null);b.style.border=F});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==b||a==f||a==g)return;a=a.parentNode}d()});mxEvent.addListener(document,"mouseleave",function(a){d()})}else f.style.top=-this.toolbarHeight+"px",b.appendChild(f)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",C):C()};
-GraphViewer.prototype.addClickHandler=function(a,b){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(f,d){if(null==d){var l=mxEvent.getSource(f);"a"==l.nodeName.toLowerCase()&&(d=l.getAttribute("href"))}null!=b?null==d||a.isExternalProtocol(d)||a.isBlankLink(d)||window.setTimeout(function(){b.destroy()},0):null!=d&&null==b&&a.isCustomLink(d)&&(mxEvent.isTouchEvent(f)||!mxEvent.isPopupTrigger(f))&&a.customLinkClicked(d)&&mxEvent.consume(f)}),
+GraphViewer.prototype.addSizeHandler=function(){var a=this.graph.container,b=this.graph.getGraphBounds(),e=!1;a.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var d=mxUtils.bind(this,function(){if(!e){e=!0;var b=this.graph.getGraphBounds();a.style.overflow=1!=this.graphConfig["toolbar-nohide"]?b.width+2*this.graph.border>a.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){var b=a.getBoundingClientRect(),d=mxUtils.getScrollOrigin(document.body),
+d="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-d.x,top:-d.y},b={left:b.left-d.left,top:b.top-d.top,bottom:b.bottom-d.top,right:b.right-d.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;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(b){var d=a.offsetWidth;d==k||this.handlingResize||(this.handlingResize=!0,"auto"==a.style.overflow&&(a.style.overflow="hidden"),this.graph.maxFitScale=null!=b?b:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(),(this.center||0==this.graphConfig.resize&&""!=a.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=a.style.height||this.updateContainerHeight(a,Math.max(this.minHeight,
+this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=d,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=!1}),0))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",d),this.graph.addListener("size",d)):new ResizeSensor(this.graph.container,d));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=
+new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=a.style.height&&this.autoFit||this.updateContainerWidth(a,b.width+2*this.graph.border),0==this.graphConfig.resize&&""!=a.style.height||this.updateContainerHeight(a,Math.max(this.minHeight,b.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var m=k=null,d=mxUtils.bind(this,function(){window.clearTimeout(m);this.handlingResize||(m=window.setTimeout(mxUtils.bind(this,this.fitGraph),
+100))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?mxEvent.addListener(window,"resize",d):new ResizeSensor(this.graph.container,d))}else mxClient.IS_QUIRKS||9>=document.documentMode||this.graph.addListener("size",d);var p=mxUtils.bind(this,function(){var d=a.style.minWidth;this.widthIsEmpty&&(a.style.minWidth="100%");var e=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=a.style.height&&this.autoFit?a.offsetHeight:void 0;if(0<a.offsetWidth&&(this.allowZoomIn||
+b.width+2*this.graph.border>a.offsetWidth||b.height+2*this.graph.border>e)){var m=null;null!=e&&b.height+2*this.graph.border>e-2&&(m=(e-2*this.graph.border-2)/b.height);this.fitGraph(m)}else this.widthIsEmpty||0!=this.graphConfig.resize||""==a.style.height?(this.graph.view.setTranslate(Math.floor(this.graph.border-b.x/this.graph.view.scale),Math.floor(this.graph.border-b.y/this.graph.view.scale)),k=a.offsetWidth):this.graph.center((!this.widthIsEmpty||b.width<this.minWidth)&&1!=this.graphConfig.resize);
+a.style.minWidth=d});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(p,0):p();this.positionGraph=function(){b=this.graph.getGraphBounds();k=null;p()}};GraphViewer.prototype.updateContainerWidth=function(a,b){a.style.width=b+"px"};GraphViewer.prototype.updateContainerHeight=function(a,b){if(this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||mxClient.IS_QUIRKS||8==document.documentMode)a.style.height=b+"px"};
+GraphViewer.prototype.showLayers=function(a,b){var e=this.graphConfig.layers,e=null!=e?e.split(" "):[],d=this.graphConfig.layerIds;if(0<e.length||null!=d||null!=b){var k=null!=b?b.getModel():null,m=a.getModel();m.beginUpdate();try{for(var p=m.getChildCount(m.root),v=0;v<p;v++)m.setVisible(m.getChildAt(m.root,v),null!=b?k.isVisible(k.getChildAt(k.root,v)):!1);if(null==k)if(null!=d)for(v=0;v<d.length;v++)m.setVisible(m.getCell(d[v]),!0);else for(v=0;v<e.length;v++)m.setVisible(m.getChildAt(m.root,parseInt(e[v])),
+!0)}finally{m.endUpdate()}}};
+GraphViewer.prototype.addToolbar=function(){function a(a,b,d,f){var g=document.createElement("div");g.style.borderRight="1px solid #d0d0d0";g.style.padding="3px 6px 3px 6px";mxEvent.addListener(g,"click",a);null!=d&&g.setAttribute("title",d);g.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==f||f?(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);c++;return g}var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";
+e.style.whiteSpace="nowrap";e.style.textAlign="left";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 d=null,k=null,m=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);d=window.setTimeout(mxUtils.bind(this,
+function(){mxUtils.setOpacity(e,0);d=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),p=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),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":"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 v=this.graph,B=v.getTolerance();v.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();
+this.scrollLeft=v.container.scrollLeft;this.scrollTop=v.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-v.container.scrollLeft)<B&&Math.abs(this.scrollTop-v.container.scrollTop)<B&&Math.abs(this.startX-b.getGraphX())<B&&Math.abs(this.startY-b.getGraphY())<B&&(0<parseFloat(e.style.opacity||0)?m():p(30))}})}for(var z=this.toolbarItems,c=0,f=null,g=null,t=0;t<z.length;t++){var n=z[t];if("pages"==n){g=b.ownerDocument.createElement("div");
+g.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(g,70);var l=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");l.style.borderRightStyle="none";l.style.paddingLeft="0px";l.style.paddingRight="0px";e.appendChild(g);var x=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
+1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");x.style.paddingLeft="0px";x.style.paddingRight="0px";n=mxUtils.bind(this,function(){g.innerHTML="";mxUtils.write(g,this.currentPage+1+" / "+this.diagrams.length);g.style.display=1<this.diagrams.length?"inline-block":"none";l.style.display=g.style.display;x.style.display=g.style.display});this.addListener("graphChanged",n);n()}else if("zoom"==n)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"==n){if(this.layersEnabled){var A=this.graph.getModel(),q=a(mxUtils.bind(this,function(a){if(null!=f)f.parentNode.removeChild(f),
+f=null;else{f=this.graph.createLayersDialog();mxEvent.addListener(f,"mouseleave",function(){f.parentNode.removeChild(f);f=null});a=q.getBoundingClientRect();f.style.width="140px";f.style.padding="2px 0px 2px 0px";f.style.border="1px solid #d0d0d0";f.style.backgroundColor="#eee";f.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";f.style.fontSize="11px";f.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(f,80);var b=mxUtils.getDocumentScrollOrigin(document);f.style.left=b.x+a.left+
+"px";f.style.top=b.y+a.bottom+"px";document.body.appendChild(f)}}),Editor.layersImage,mxResources.get("layers")||"Layers");A.addListener(mxEvent.CHANGE,function(){q.style.display=1<A.getChildCount(A.root)?"inline-block":"none"});q.style.display=1<A.getChildCount(A.root)?"inline-block":"none"}}else"lightbox"==n?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(n=this.graphConfig["toolbar-buttons"][n],
+null!=n&&a(null==n.enabled||n.enabled?n.handler:function(){},n.image,n.title,n.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*c);null!=this.graphConfig.title&&(z=b.ownerDocument.createElement("div"),z.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;",z.setAttribute("title",this.graphConfig.title),mxUtils.write(z,this.graphConfig.title),mxUtils.setOpacity(z,
+70),e.appendChild(z));this.minToolbarWidth=34*c;var F=b.style.border,z=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var a=b.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},a={left:a.left-c.left,top:a.top-
+c.top,bottom:a.bottom-c.top,right:a.right-c.left};e.style.left=a.left+"px";"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"==F&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var d=mxUtils.bind(this,function(){null!=e.parentNode&&e.parentNode.removeChild(e);null!=f&&(f.parentNode.removeChild(f),
+f=null);b.style.border=F});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==b||a==e||a==f)return;a=a.parentNode}d()});mxEvent.addListener(document,"mouseleave",function(a){d()})}else e.style.top=-this.toolbarHeight+"px",b.appendChild(e)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",z):z()};
+GraphViewer.prototype.addClickHandler=function(a,b){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,d){if(null==d){var k=mxEvent.getSource(e);"a"==k.nodeName.toLowerCase()&&(d=k.getAttribute("href"))}null!=b?null==d||a.isExternalProtocol(d)||a.isBlankLink(d)||window.setTimeout(function(){b.destroy()},0):null!=d&&null==b&&a.isCustomLink(d)&&(mxEvent.isTouchEvent(e)||!mxEvent.isPopupTrigger(e))&&a.customLinkClicked(d)&&mxEvent.consume(e)}),
mxUtils.bind(this,function(a){null!=b||!this.lightboxClickEnabled||mxEvent.isTouchEvent(a)&&0!=this.toolbarItems.length||this.showLightbox()}))};
-GraphViewer.prototype.showLightbox=function(a,b,f){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;f={client:1,lightbox:1,target:null!=f?f:"blank"};a&&(f.edit=this.graphConfig.edit||"_blank");if(null!=b?b:1)f.close=1;this.layersEnabled&&(f.layers=1);null!=this.graphConfig&&0!=this.graphConfig.nav&&(f.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&&
-(f.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(f.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,"*")})):f.data=encodeURIComponent(this.xml);a="www.draw.io";"1"==urlParams.dev&&(f.dev="1",f.drawdev=
-"1",a="test.draw.io");this.lightboxWindow=window.open("https://"+a+"/#P"+encodeURIComponent(JSON.stringify(f)))}else this.lightboxWindow.focus();else this.showLocalLightbox()};
+GraphViewer.prototype.showLightbox=function(a,b,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!=b?b: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),b=document.createElement("div");mxClient.IS_QUIRKS?(b.style.position="absolute",b.style.left=a.x+"px",b.style.top=a.y+"px",b.style.width=document.body.offsetWidth+"px",b.style.height=document.body.offsetHeight+"px"):b.style.cssText="position:fixed;top:0;left:0;bottom:0;right:0;";b.style.zIndex=this.lightboxZIndex;b.style.backgroundColor="#000000";mxUtils.setOpacity(b,70);document.body.appendChild(b);
-var f=document.createElement("img");f.setAttribute("border","0");f.setAttribute("src",Editor.closeImage);mxClient.IS_QUIRKS?(f.style.position="absolute",f.style.right="32px",f.style.top=a.y+32+"px"):f.style.cssText="position:fixed;top:32px;right:32px;";f.style.cursor="pointer";mxEvent.addListener(f,"click",function(){d.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||
+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(){d.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,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var d=new EditorUi(new Editor(!0),document.createElement("div"),!0);d.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";d.refresh=
-function(){};var l=mxUtils.bind(this,function(a){27==a.keyCode&&d.destroy()}),n=d.destroy;d.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",l);document.body.removeChild(b);document.body.removeChild(f);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;n.apply(this,arguments)};var t=d.editor.graph,x=t.container;x.style.overflow="hidden";this.lightboxChrome?(x.style.border="1px solid #c0c0c0",x.style.margin="40px",mxEvent.addListener(document.documentElement,
-"keydown",l)):(b.style.display="none",f.style.display="none");var A=this;t.getImageFromBundles=function(a){return A.getImageUrl(a)};var C=d.createTemporaryGraph;d.createTemporaryGraph=function(){var a=C.apply(this,arguments);a.getImageFromBundles=function(a){return A.getImageUrl(a)};return a};this.graphConfig.move&&(t.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(x.style,"border-radius","4px"),x.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
-"hidden";mxClient.IS_SF||mxClient.IS_EDGE||(mxUtils.setPrefixedStyle(x.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(x.style,"transition","all .25s ease-in-out"));this.addClickHandler(t,d);window.setTimeout(mxUtils.bind(this,function(){x.style.outline="none";x.style.zIndex=this.lightboxZIndex;f.style.zIndex=this.lightboxZIndex;document.body.appendChild(x);document.body.appendChild(f);d.setFileData(this.xml);mxUtils.setPrefixedStyle(x.style,"transform","rotateY(0deg)");d.chromelessToolbar.style.bottom=
-"60px";d.chromelessToolbar.style.zIndex=this.lightboxZIndex;document.body.appendChild(d.chromelessToolbar);d.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});mxClient.IS_QUIRKS&&(x.style.position="absolute",x.style.display="block",x.style.left=a.x+"px",x.style.top=a.y+"px",x.style.width=document.body.clientWidth-80+"px",x.style.height=document.body.clientHeight-80+"px",x.style.backgroundColor="white",d.chromelessToolbar.style.display="block",d.chromelessToolbar.style.position="absolute",
-d.chromelessToolbar.style.bottom="",d.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");d.lightboxFit();d.chromelessResize();this.showLayers(t,this.graph);mxEvent.addListener(b,"click",function(){d.destroy()})}),0);return d};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(f){throw a.innerHTML=f.message,f;}})};
-GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var b=document.getElementsByClassName(a);a=[];for(var f=0;f<b.length;f++)a.push(b[f]);return a}for(var d=document.getElementsByTagName("*"),b=[],f=0;f<d.length;f++){var l=d[f].className;null!=l&&0<l.length&&(l=l.split(" "),0<=mxUtils.indexOf(l,a)&&b.push(d[f]))}return b};
-GraphViewer.createViewerForElement=function(a,b){var f=a.getAttribute("data-mxgraph");if(null!=f){var d=JSON.parse(f),l=function(f){f=mxUtils.parseXml(f);f=new GraphViewer(a,f.documentElement,d);null!=b&&b(f)};null!=d.url?GraphViewer.getUrl(d.url,function(a){l(a)}):l(d.xml)}};
+function(){};var k=mxUtils.bind(this,function(a){27==a.keyCode&&d.destroy()}),m=d.destroy;d.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(b);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var p=d.editor.graph,v=p.container;v.style.overflow="hidden";this.lightboxChrome?(v.style.border="1px solid #c0c0c0",v.style.margin="40px",mxEvent.addListener(document.documentElement,
+"keydown",k)):(b.style.display="none",e.style.display="none");var B=this;p.getImageFromBundles=function(a){return B.getImageUrl(a)};var z=d.createTemporaryGraph;d.createTemporaryGraph=function(){var a=z.apply(this,arguments);a.getImageFromBundles=function(a){return B.getImageUrl(a)};return a};this.graphConfig.move&&(p.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(v.style,"border-radius","4px"),v.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
+"hidden";mxClient.IS_SF||mxClient.IS_EDGE||(mxUtils.setPrefixedStyle(v.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(v.style,"transition","all .25s ease-in-out"));this.addClickHandler(p,d);window.setTimeout(mxUtils.bind(this,function(){v.style.outline="none";v.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(v);document.body.appendChild(e);d.setFileData(this.xml);mxUtils.setPrefixedStyle(v.style,"transform","rotateY(0deg)");d.chromelessToolbar.style.bottom=
+"60px";d.chromelessToolbar.style.zIndex=this.lightboxZIndex;document.body.appendChild(d.chromelessToolbar);d.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});mxClient.IS_QUIRKS&&(v.style.position="absolute",v.style.display="block",v.style.left=a.x+"px",v.style.top=a.y+"px",v.style.width=document.body.clientWidth-80+"px",v.style.height=document.body.clientHeight-80+"px",v.style.backgroundColor="white",d.chromelessToolbar.style.display="block",d.chromelessToolbar.style.position="absolute",
+d.chromelessToolbar.style.bottom="",d.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");d.lightboxFit();d.chromelessResize();this.showLayers(p,this.graph);mxEvent.addListener(b,"click",function(){d.destroy()})}),0);return d};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 b=document.getElementsByClassName(a);a=[];for(var e=0;e<b.length;e++)a.push(b[e]);return a}for(var d=document.getElementsByTagName("*"),b=[],e=0;e<d.length;e++){var k=d[e].className;null!=k&&0<k.length&&(k=k.split(" "),0<=mxUtils.indexOf(k,a)&&b.push(d[e]))}return b};
+GraphViewer.createViewerForElement=function(a,b){var e=a.getAttribute("data-mxgraph");if(null!=e){var d=JSON.parse(e),k=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,d);null!=b&&b(e)};null!=d.url?GraphViewer.getUrl(d.url,function(a){k(a)}):k(d.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(b){}};
-GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,f){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var d=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;d.open("GET",a);d.onload=function(){b(null!=d.getText?d.getText():d.responseText)};d.onerror=f;d.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0;
-(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(f,d){function l(){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 n(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function t(b,c){if(!b.resizedAttached)b.resizedAttached=
-new l,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"==n(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],f=d.childNodes[0],g=b.resizeSensor.childNodes[1],k=function(){f.style.width="100000px";f.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;g.scrollLeft=1E5;g.scrollTop=1E5};k();var t=!1,u=function(){b.resizedAttached&&(t&&(b.resizedAttached.call(),t=!1),a(u))};a(u);var x,y,A,v,B=function(){if((A=b.offsetWidth)!=x||(v=b.offsetHeight)!=y)t=!0,x=A,y=v;k()},C=function(a,b,c){a.attachEvent?
-a.attachEvent("on"+b,c):a.addEventListener(b,c)};C(d,"scroll",B);C(g,"scroll",B)}var x=function(){GraphViewer.resizeSensorEnabled&&d()},A=Object.prototype.toString.call(f),C="[object Array]"===A||"[object NodeList]"===A||"[object HTMLCollection]"===A||"undefined"!==typeof jQuery&&f instanceof jQuery||"undefined"!==typeof Elements&&f instanceof Elements;if(C)for(var A=0,c=f.length;A<c;A++)t(f[A],x);else t(f,x);this.detach=function(){if(C)for(var a=0,c=f.length;a<c;a++)b.detach(f[a]);else b.detach(f)}};
+GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,e){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var d=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;d.open("GET",a);d.onload=function(){b(null!=d.getText?d.getText():d.responseText)};d.onerror=e;d.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0;
+(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,d){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>';
+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,q=function(){b.resizedAttached&&(p&&(b.resizedAttached.call(),p=!1),a(q))};a(q);var v,y,z,u,B=function(){if((z=b.offsetWidth)!=v||(u=b.offsetHeight)!=y)p=!0,v=z,y=u;g()},K=function(a,b,c){a.attachEvent?
+a.attachEvent("on"+b,c):a.addEventListener(b,c)};K(d,"scroll",B);K(f,"scroll",B)}var v=function(){GraphViewer.resizeSensorEnabled&&d()},B=Object.prototype.toString.call(e),z="[object Array]"===B||"[object NodeList]"===B||"[object HTMLCollection]"===B||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(z)for(var B=0,c=e.length;B<c;B++)p(e[B],v);else p(e,v);this.detach=function(){if(z)for(var a=0,c=e.length;a<c;a++)b.detach(e[a]);else b.detach(e)}};
b.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=b})();
(function(){Editor.initMath();GraphViewer.initCss();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();
diff --git a/src/main/webapp/plugins/cConf-1-4-8.js b/src/main/webapp/plugins/cConf-1-4-8.js
index 1217f108..66e89564 100644
--- a/src/main/webapp/plugins/cConf-1-4-8.js
+++ b/src/main/webapp/plugins/cConf-1-4-8.js
@@ -253,6 +253,95 @@ Draw.loadPlugin(function(ui)
div.appendChild(zoomOpt);
+ //Page and layers settings
+ div.appendChild(this.createTitle(mxResources.get('pageLayers', null, 'Page and Layers')));
+
+ var hasAspect = false;
+ var pageId = null, layerIds = null;
+
+ var customizeBtn = mxUtils.button(mxResources.get('customize', null, 'Customize'), function()
+ {
+
+ var dlg = new AspectDialog(ui, pageId, layerIds, function(info)
+ {
+ pageId = info.pageId;
+ layerIds = info.layerIds;
+ macroData.aspect = pageId + ' ' + layerIds.join(' ');
+ ui.remoteInvoke('setAspect', [macroData.aspect], null, function(){}, function(){}); //Notify plugin of the change, ignoring both success and error callbacks
+ });
+
+ ui.showDialog(dlg.container, 700, 465, true, true);
+ dlg.init();
+ });
+
+ customizeBtn.className = 'geColorBtn';
+ customizeBtn.style.marginLeft = '10px';
+ customizeBtn.style.padding = '2px';
+ customizeBtn.setAttribute('disabled', 'disabled');
+
+ if (macroData.aspect != null)
+ {
+ var aspectArray = macroData.aspect.split(' ');
+
+ if (aspectArray.length > 1)
+ {
+ pageId = aspectArray[0];
+ layerIds = aspectArray.slice(1);
+ hasAspect = true;
+ customizeBtn.removeAttribute('disabled');
+ }
+ }
+
+ var firstPageRadio = ui.addRadiobox(div, 'pageLayers', mxResources.get('firstPage', null, 'First Page (All Layers)'), !hasAspect);
+ firstPageRadio.style.marginTop = '4px';
+
+ mxEvent.addListener(firstPageRadio, 'change', function()
+ {
+ if (this.checked)
+ {
+ macroData.aspect = null;
+ ui.remoteInvoke('setAspect', [macroData.aspect], null, function(){}, function(){}); //Notify plugin of the change, ignoring both success and error callbacks
+ customizeBtn.setAttribute('disabled', 'disabled');
+ }
+ });
+
+ var currentStateRadio = ui.addRadiobox(div, 'pageLayers', mxResources.get('curEditorState', null, 'Current Editor State'), false);
+ currentStateRadio.style.marginTop = '8px';
+
+ mxEvent.addListener(currentStateRadio, 'change', function()
+ {
+ if (this.checked)
+ {
+ var curPage = ui.updatePageRoot(ui.currentPage);
+ var layerIds = [], layers = curPage.root.children;
+
+ for (var i = 0; i < layers.length; i++)
+ {
+ if (layers[i].visible != false)
+ {
+ layerIds.push(layers[i].id);
+ }
+ }
+
+ macroData.aspect = curPage.getId() + ' ' + layerIds.join(' ');
+ ui.remoteInvoke('setAspect', [macroData.aspect], null, function(){}, function(){}); //Notify plugin of the change, ignoring both success and error callbacks
+ customizeBtn.setAttribute('disabled', 'disabled');
+ }
+ });
+
+ var customStateRadio = ui.addRadiobox(div, 'pageLayers', mxResources.get('custom', null, 'Custom'), hasAspect, false, true);
+ customStateRadio.style.marginTop = '8px';
+
+ mxEvent.addListener(customStateRadio, 'change', function()
+ {
+ if (this.checked)
+ {
+ customizeBtn.removeAttribute('disabled');
+ }
+ });
+
+ div.appendChild(customizeBtn);
+
return div;
};
diff --git a/src/main/webapp/resources/dia_ro.txt b/src/main/webapp/resources/dia_ro.txt
index 17591c28..c1e35a9c 100644
--- a/src/main/webapp/resources/dia_ro.txt
+++ b/src/main/webapp/resources/dia_ro.txt
@@ -685,7 +685,7 @@ support=Suport
sysml=SysML
tags=Tag-uri
table=Tabel
-tables=Tables
+tables=Tabele
takeOver=Take Over
targetSpacing=Spațierea țintei
template=Template
@@ -699,7 +699,7 @@ title=Titlu
to=către
toBack=Înapoi
toFront=Înainte
-toolbar=Toolbar
+toolbar=Unelte
tooltips=Sfaturi pentru folosirea instrumentelor
top=Sus
topAlign=Aliniere sus
@@ -768,13 +768,13 @@ venndiagrams=Diagrame Venn
webEmailOrOther=Web, e-mail sau orice alta adresa online
webLink=Web Link
wireframes=Wireframe-uri
-property=Property
-value=Value
+property=Proprietate
+value=Valoare
showMore=Show More
showLess=Show Less
-myDiagrams=My Diagrams
-allDiagrams=All Diagrams
-recentlyUsed=Recently used
+myDiagrams=Diagramele mele
+allDiagrams=Toate diagramele
+recentlyUsed=Folosite recent
listView=List view
gridView=Grid view
resultsFor=Results for '{1}'
diff --git a/src/main/webapp/styles/grapheditor.css b/src/main/webapp/styles/grapheditor.css
index bec89972..d536f8a5 100644
--- a/src/main/webapp/styles/grapheditor.css
+++ b/src/main/webapp/styles/grapheditor.css
@@ -1440,3 +1440,47 @@ html td.mxWindowTitle {
top: 5px;
right: 5px;
}
+
+.geAspectDlgListItem
+{
+ width : 120px;
+ height : 120px;
+ display : inline-block;
+ border: 3px solid #F0F0F0;
+ border-radius: 5px;
+ padding: 5px;
+ margin : 2px 2px 20px 2px;
+}
+
+.geAspectDlgListItem:hover
+{
+ border: 3px solid #c5c5c5;
+}
+
+.geAspectDlgListItemSelected
+{
+ border: 3px solid #3b73af;
+}
+
+.geAspectDlgListItemSelected:hover
+{
+ border: 3px solid #405a86;
+}
+
+.geAspectDlgListItemText
+{
+ text-overflow: ellipsis;
+ max-width: 100%;
+ min-height : 2em;
+ overflow : hidden;
+ text-align : center;
+ margin-top : 10px;
+}
+
+.geAspectDlgList
+{
+ min-height: 184px;
+ white-space: nowrap;
+ overflow-x : auto;
+ overflow-y : hidden;
+} \ No newline at end of file