10.7.6 release

This commit is contained in:
David Benson 2019-06-11 17:38:10 +01:00
parent eb9cc5c2b3
commit 1d1e7eac5d
16 changed files with 566 additions and 247 deletions

View file

@ -1,3 +1,8 @@
11-JUN-2019: 10.7.6
- Removes fallback to print dialog if offline in Electron
- Fixes broken link if Google Drive is not loading
04-JUN-2019: 10.7.5
- Fixes Math rendering in graph viewer

View file

@ -1 +1 @@
10.7.5
10.7.6

View file

@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 06/04/2019 02:23 PM
# 06/11/2019 05:23 pm
app.html
index.html?offline=1

View file

@ -24,6 +24,8 @@ const __DEV__ = process.env.NODE_ENV === 'development'
let windowsRegistry = []
let cmdQPressed = false
let firstWinLoaded = false
let firstWinFilePath = null
function createWindow (opt = {})
{
@ -176,6 +178,7 @@ app.on('ready', e =>
})
let argv = process.argv
// https://github.com/electron/electron/issues/4690#issuecomment-217435222
if (process.defaultApp != true)
{
@ -219,7 +222,7 @@ app.on('ready', e =>
'export all pages (for PDF format only)')
.option('-p, --page-index <pageIndex>',
'selects a specific page, if not specified and the format is an image, the first page is selected', parseInt)
.option('-g, --page-rage <from>..<to>',
.option('-g, --page-range <from>..<to>',
'selects a page range (for PDF format only)', argsRange)
.parse(argv)
@ -469,6 +472,20 @@ app.on('ready', e =>
win.webContents.on('did-finish-load', function()
{
if (firstWinFilePath != null)
{
if (program.args != null)
{
program.args.push(firstWinFilePath);
}
else
{
program.args = [firstWinFilePath];
}
}
firstWinLoaded = true;
win.webContents.send('args-obj', program);
win.webContents.setZoomFactor(1);
@ -618,6 +635,31 @@ app.on('activate', function ()
}
})
app.on('will-finish-launching', function()
{
app.on("open-file", function(event, path)
{
event.preventDefault();
if (firstWinLoaded)
{
let win = createWindow();
win.webContents.on('did-finish-load', function()
{
win.webContents.send('args-obj', {args: [path]});
win.webContents.setZoomFactor(1);
win.webContents.setVisualZoomLevelLimits(1, 1);
win.webContents.setLayoutZoomLevelLimits(0, 0);
});
}
else
{
firstWinFilePath = path
}
});
});
autoUpdater.on('error', e => log.error('@error@\n', e))

View file

@ -360,6 +360,7 @@
// Electron
if (mxIsElectron)
{
mxscript('js/diagramly/DesktopLibrary.js');
mxscript('js/diagramly/ElectronApp.js');
}

View file

@ -7917,7 +7917,7 @@ DrawioFile.prototype.updateFile=function(a,c,b,d){null!=b&&b()||(this.ui.getCurr
DrawioFile.prototype.mergeFile=function(a,c,b,d){var e=!0;try{this.stats.fileMerged++;var g=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(g,this.ui.pages):null;var m=[this.ui.diffPages(null!=d?d:g,this.shadowPages)];if(!this.ignorePatches(m)){var n=this.ui.patchPages(g,
m[0]);d={};var t=this.ui.getHashValueForPages(n,d),g={},f=this.ui.getHashValueForPages(this.shadowPages,g);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",m,"checksum",f==t,t);if(null!=t&&t!=f){var k=this.compressReportData(this.getAnonymizedXmlForPages(l)),p=this.compressReportData(this.getAnonymizedXmlForPages(n)),u=this.ui.hashValue(a.getCurrentEtag()),q=this.ui.hashValue(this.getCurrentEtag());this.checksumError(b,m,"Shadow Details: "+JSON.stringify(d)+
"\nChecksum: "+t+"\nCurrent: "+f+"\nCurrent Details: "+JSON.stringify(g)+"\nFrom: "+u+"\nTo: "+q+"\n\nFile Data:\n"+k+"\nPatched Shadow:\n"+p,null,"mergeFile");return}this.patch(m,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw e=!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(e)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,y);else{var x=this.getCurrentUser(),z=null!=x?x.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,y)}}catch(C){}}};
null!=b&&b(y);try{if(e)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,y);else{var x=this.getCurrentUser(),A=null!=x?x.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),A,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 e=c.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(e=this.ui.anonymizeNode(e,!0));e.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,e,!0);b.appendChild(e)}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,e){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 g=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)),
@ -7981,11 +7981,11 @@ StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,argum
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(d,p,g,e,q,u){function A(){mxEvent.addListener(v,"click",null!=u?u:function(){g!=App.MODE_GOOGLE||a.isDriveDomain()?g==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(g,t.checked);c()})):g==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(g,t.checked);
var StorageDialog=function(a,c,b){function d(d,p,g,e,q,u){function z(){mxEvent.addListener(v,"click",null!=u?u:function(){g!=App.MODE_GOOGLE||a.isDriveDomain()?g==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(g,t.checked);c()})):g==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(g,t.checked);
c()})):(a.setMode(g,t.checked),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}var v=document.createElement("a");v.style.overflow="hidden";v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";v.className="geBaseButton";v.style.boxSizing="border-box";v.style.fontSize="11px";v.style.position="relative";v.style.margin="4px";v.style.padding="8px 10px 12px 10px";v.style.width="88px";v.style.height="100px";v.style.whiteSpace="nowrap";v.setAttribute("title",p);mxClient.IS_QUIRKS&&
(v.style.cssFloat="left",v.style.zoom="1");var x=document.createElement("div");x.style.textOverflow="ellipsis";x.style.overflow="hidden";if(null!=d){var l=document.createElement("img");l.setAttribute("src",d);l.setAttribute("border","0");l.setAttribute("align","absmiddle");l.style.width="60px";l.style.height="60px";l.style.paddingBottom="6px";v.appendChild(l)}else x.style.paddingTop="5px",x.style.whiteSpace="normal",mxClient.IS_IOS?(v.style.padding="0px 10px 20px 10px",v.style.top="6px"):mxClient.IS_FF&&
(x.style.paddingTop="0px",x.style.marginTop="-2px");v.appendChild(x);mxUtils.write(x,p);if(null!=q)for(d=0;d<q.length;d++)mxUtils.br(x),mxUtils.write(x,q[d]);if(null!=e&&null==a[e]){l.style.visibility="hidden";mxUtils.setOpacity(x,10);var B=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});B.spin(v);var m=window.setTimeout(function(){null==a[e]&&(B.stop(),v.style.display="none")},3E4);a.addListener("clientLoaded",
mxUtils.bind(this,function(b,c){null!=a[e]&&c.getProperty("client")==a[e]&&(window.clearTimeout(m),mxUtils.setOpacity(x,100),l.style.visibility="",B.stop(),A(),"drive"==e&&null!=k.parentNode&&k.parentNode.removeChild(k))}))}else A();n.appendChild(v);++f>=b&&(mxUtils.br(n),f=0)}b=null!=b?b:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var g=a.addLanguageMenu(e,!0);null!=g&&(g.style.bottom=parseInt("28px")-
mxUtils.bind(this,function(b,c){null!=a[e]&&c.getProperty("client")==a[e]&&(window.clearTimeout(m),mxUtils.setOpacity(x,100),l.style.visibility="",B.stop(),z(),"drive"==e&&null!=k.parentNode&&k.parentNode.removeChild(k))}))}else z();n.appendChild(v);++f>=b&&(mxUtils.br(n),f=0)}b=null!=b?b:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var g=a.addLanguageMenu(e,!0);null!=g&&(g.style.bottom=parseInt("28px")-
3+"px");if(!a.isOffline()&&1<a.getServiceCount()){g=document.createElement("a");g.setAttribute("href","https://about.draw.io/support/");g.setAttribute("title",mxResources.get("help"));g.setAttribute("target","_blank");g.style.position="absolute";g.style.textDecoration="none";g.style.cursor="pointer";g.style.fontSize="12px";g.style.bottom="28px";g.style.left="26px";g.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";g.appendChild(l);mxUtils.write(g,mxResources.get("help"));e.appendChild(g)}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";mxUtils.write(m,mxResources.get("decideLater"));a.isOfflineApp()?m.style.right="20px":(mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,0)"),m.style.left=
"50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)m.style.marginLeft=-Math.round(m.clientWidth/2)+"px"};e.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});var n=document.createElement("div");mxClient.IS_QUIRKS&&(n.style.whiteSpace="nowrap",n.style.cssFloat="left");n.style.border="1px solid #d3d3d3";n.style.borderWidth="1px 0px 1px 0px";
@ -7995,14 +7995,14 @@ mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof wind
u.appendChild(q);for(q=0;q<p.length;q++)(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)+")");u.appendChild(c)})(p[q]);g.appendChild(u);mxEvent.addListener(u,"change",function(b){""!=u.value&&a.loadFile(u.value)})}else g.style.marginTop="20px",n.style.padding="30px 0px 26px 0px";!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11||(p=
document.createElement("div"),p.style.cursor="pointer",p.style.padding="18px 0px 6px 0px",p.style.fontSize="12px",p.style.color="gray",mxUtils.write(p,mxResources.get("import")+": "+mxResources.get("gliffy")+", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(p,"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.value=""});b.style.display="none";document.body.appendChild(b);a.storageFileInputElt=b}a.storageFileInputElt.click()}),g.appendChild(p),n.style.paddingBottom="4px");n.appendChild(g);mxEvent.addListener(l,"click",function(a){t.checked=!t.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://plus.google.com/u/0/+DrawIo1/posts/1HTrfsb5wDN" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",e.appendChild(k))},5E3);this.container=e},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 e="";a.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",e=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",e=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",e=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+"/github-logo.svg",e=mxResources.get("github")):a.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",
e=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",e=mxResources.get("browser")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",e=mxResources.get("device"));var g=document.createElement("div");g.style.margin="4px 0px 0px 0px";var l=document.createElement("button");l.className="geBigButton";l.style.overflow="hidden";l.style.width="340px";mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(g.style.padding="42px 0px 56px 0px",l.style.marginBottom="12px"):(b.appendChild(d),
mxUtils.write(b,e),c.appendChild(b),g.style.border="1px solid #d3d3d3",g.style.borderWidth="1px 0px 1px 0px",g.style.padding="18px 0px 24px 0px",l.style.marginBottom="8px");mxClient.IS_QUIRKS&&(g.style.whiteSpace="nowrap",g.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()});g.appendChild(l);mxUtils.br(g);l=document.createElement("button");l.className=
"geBigButton";l.style.marginBottom="22px";l.style.overflow="hidden";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()});g.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_TRELLO?
mxResources.get("trello"):a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(d=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";g.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),
"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>",e.appendChild(k))},5E3);this.container=e},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 e="";a.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",e=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",e=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",e=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+"/github-logo.svg",e=mxResources.get("github")):a.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",e=mxResources.get("trello")):
a.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",e=mxResources.get("browser")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",e=mxResources.get("device"));var g=document.createElement("div");g.style.margin="4px 0px 0px 0px";var l=document.createElement("button");l.className="geBigButton";l.style.overflow="hidden";l.style.width="340px";mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(g.style.padding="42px 0px 56px 0px",l.style.marginBottom="12px"):(b.appendChild(d),mxUtils.write(b,e),c.appendChild(b),
g.style.border="1px solid #d3d3d3",g.style.borderWidth="1px 0px 1px 0px",g.style.padding="18px 0px 24px 0px",l.style.marginBottom="8px");mxClient.IS_QUIRKS&&(g.style.whiteSpace="nowrap",g.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()});g.appendChild(l);mxUtils.br(g);l=document.createElement("button");l.className="geBigButton";l.style.marginBottom=
"22px";l.style.overflow="hidden";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()});g.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_TRELLO?mxResources.get("trello"):
a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(d=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";g.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),
function(){b()})});g.appendChild(c)},b=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=b?(l.style.marginBottom="24px",d=document.createElement("a"),d.setAttribute("href","javascript:void(0)"),d.style.display="inline-block",d.style.marginTop="6px",mxUtils.write(d,mxResources.get("changeUser")+" ("+b.displayName+")"),l.style.marginBottom="16px",g.style.paddingBottom="18px",mxEvent.addListener(d,"click",function(){a.hideDialog();a.drive.clearUserId();a.drive.setUser(null);gapi.auth.signOut();
a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();a.showSplash()})),mxUtils.bind(this,function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})}))}),g.appendChild(d)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?d(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?d(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_TRELLO&&null!=
a.trello?a.trello.isAuthorized()&&d(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&d(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")}),mxUtils.br(g),d=document.createElement("a"),d.setAttribute("href","javascript:void(0)"),d.style.display="inline-block",d.style.marginTop="8px",mxUtils.write(d,mxResources.get("changeStorage")),mxEvent.addListener(d,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),g.appendChild(d));
@ -8015,15 +8015,15 @@ encodeURIComponent(m.value);a.openLink(b)}catch(p){a.handleError({message:p.mess
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")})}}),t=document.createElement("img"),t.setAttribute("src",Editor.tweetImage),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("border","0"),t.style.marginBottom="5px",f.appendChild(t),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",g.appendChild(f))}t=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.appendChild(t);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?t.className="geBtn gePrimaryBtn":(g.appendChild(f),f.className="geBtn gePrimaryBtn",t.className="geBtn"):(g.appendChild(n),t.className="geBtn",n.className="geBtn gePrimaryBtn");d.appendChild(g);this.container=d};EmbedDialog.showPreviewOption=!0;
var GoogleSitesDialog=function(a,c){function b(){var a=null!=v&&null!=v.getTitle()?v.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<G.length&&(b+="&s="+G);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=k.value&&(b+="&height="+k.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(x.checked?"1":"0");b+="&fit="+(A.checked?"1":"0");
b+="&resize="+(C.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+n;e.mathEnabled&&(b+="&math=1");y.checked?b+="&edit=_blank":z.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));t.value=b}else v.constructor==DriveFile||v.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=v.getHash().substring(1),b=v.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
var GoogleSitesDialog=function(a,c){function b(){var a=null!=v&&null!=v.getTitle()?v.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<G.length&&(b+="&s="+G);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=k.value&&(b+="&height="+k.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(x.checked?"1":"0");b+="&fit="+(z.checked?"1":"0");
b+="&resize="+(C.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+n;e.mathEnabled&&(b+="&math=1");y.checked?b+="&edit=_blank":A.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));t.value=b}else v.constructor==DriveFile||v.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=v.getHash().substring(1),b=v.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
a&&(b+="&title="+encodeURIComponent(a)),""!=k.value&&(a=parseInt(k.value)+parseInt(f.value),b+="&height="+a),t.value=b):t.value=""}var d=document.createElement("div"),e=a.editor.graph,g=e.getGraphBounds(),l=e.view.scale,m=Math.floor(g.x/l-e.view.translate.x),n=Math.floor(g.y/l-e.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var t=document.createElement("input");t.setAttribute("type","text");t.style.marginBottom="8px";t.style.marginTop="2px";t.style.width="410px";
d.appendChild(t);mxUtils.br(d);this.init=function(){t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.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 k=document.createElement("input");k.setAttribute("type",
"text");k.setAttribute("size","4");k.style.marginLeft="4px";k.value=Math.ceil(g.height/l);d.appendChild(k);mxUtils.br(d);g=document.createElement("hr");g.setAttribute("size","1");g.style.marginBottom="16px";g.style.marginTop="16px";d.appendChild(g);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 q=document.createElement("input");q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;q.style.marginLeft="16px";d.appendChild(q);mxUtils.write(d,mxResources.get("pan")+" ");var x=document.createElement("input");
x.setAttribute("type","checkbox");x.setAttribute("checked","checked");x.defaultChecked=!0;x.style.marginLeft="8px";d.appendChild(x);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 A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";d.appendChild(A);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 G=a.getBasenames().join(";"),v=a.getCurrentFile();mxEvent.addListener(q,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(A,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(B,"change",b);mxEvent.addListener(k,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(p,"change",b);b();
x.setAttribute("type","checkbox");x.setAttribute("checked","checked");x.defaultChecked=!0;x.style.marginLeft="8px";d.appendChild(x);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 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 z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";d.appendChild(z);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 G=a.getBasenames().join(";"),v=a.getCurrentFile();mxEvent.addListener(q,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(A,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(B,"change",b);mxEvent.addListener(k,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(p,"change",b);b();
mxEvent.addListener(t,"click",function(){t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)});g=document.createElement("div");g.style.paddingTop="12px";g.style.textAlign="right";l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn gePrimaryBtn";g.appendChild(l);d.appendChild(g);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 g=new Graph(c);g.setCellsCloneable(!0);g.setPanning(!0);g.setAllowDanglingEdges(!1);g.connectionHandler.select=!1;g.view.setTranslate(20,20);g.border=20;g.panningHandler.useLeftButtonForPanning=!0;var l="curved=1;";g.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))})};g.getAllConnectionConstraints=function(){return null};g.connectionHandler.marker.highlight.keepOnTop=
@ -8063,11 +8063,11 @@ m.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setNa
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 t=document.createElement("option");t.setAttribute("value","plantUmlPng");mxUtils.write(t,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(t),m.appendChild(f));var k=e();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(m);mxEvent.addListener(m,"change",function(){var a=e();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);n=mxUtils.button(mxResources.get("insert"),
function(){a.hideDialog();d(l.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,e,g,l,m,n,t,f,k,p,u,q,x,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=!1}function C(){if(Y)b||a.hideDialog(),u(Y,Z,F.value);else if(d)b||a.hideDialog(),d(ha,F.value);else{var c=
F.value;null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,ha,null!=V&&0<V.length?V:null,null,function(){a.hideDialog()},null,b)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function A(a,b,c,f,d){null!=ea&&(ea.style.backgroundColor="transparent",ea.style.border="1px solid transparent");D.removeAttribute("disabled");ha=b;V=c;ea=a;Y=f;Z=d;ea.style.backgroundColor=m;ea.style.border=n}function B(b,c,f,d,k,p,g,e,u,v){var q=document.createElement("div");q.className=
"geTemplate";q.style.height=ga+"px";q.style.width=Q+"px";null!=d&&0<d.length&&q.setAttribute("title",d);if(null!=p)q.style.backgroundImage="url("+p+")",q.style.backgroundSize="contain",q.style.backgroundPosition="center center",q.style.backgroundRepeat="no-repeat",mxEvent.addListener(q,"click",function(a){A(q,null,null,b,g)}),mxEvent.addListener(q,"dblclick",function(a){C()});else if(!v&&null!=b&&0<b.length){f=u||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";q.style.backgroundImage="url("+f+
")";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";var l=!1;mxEvent.addListener(q,"click",function(f){D.setAttribute("disabled","disabled");q.style.backgroundColor="transparent";q.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;E.spin(M);mxUtils.get(f,mxUtils.bind(this,function(a){E.stop();200<=a.getStatus()&&299>=a.getStatus()&&(A(q,a.getText(),c),l&&C())}))});
mxEvent.addListener(q,"dblclick",function(a){l=!0})}else q.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>",k&&A(q),null!=e?mxEvent.addListener(q,"click",e):(mxEvent.addListener(q,"click",function(a){A(q,null,null,b,g)}),mxEvent.addListener(q,"dblclick",function(a){C()}));M.appendChild(q)}function G(){N&&(N=!1,mxEvent.addListener(M,"scroll",function(a){M.scrollTop+M.clientHeight>=
function(){a.hideDialog();d(l.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,e,g,l,m,n,t,f,k,p,u,q,x,A){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=!1}function C(){if(Y)b||a.hideDialog(),u(Y,Z,F.value);else if(d)b||a.hideDialog(),d(ha,F.value);else{var c=
F.value;null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,ha,null!=V&&0<V.length?V:null,null,function(){a.hideDialog()},null,b)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function z(a,b,c,f,d){null!=ea&&(ea.style.backgroundColor="transparent",ea.style.border="1px solid transparent");D.removeAttribute("disabled");ha=b;V=c;ea=a;Y=f;Z=d;ea.style.backgroundColor=m;ea.style.border=n}function B(b,c,f,d,k,p,g,e,u,v){var q=document.createElement("div");q.className=
"geTemplate";q.style.height=ga+"px";q.style.width=Q+"px";null!=d&&0<d.length&&q.setAttribute("title",d);if(null!=p)q.style.backgroundImage="url("+p+")",q.style.backgroundSize="contain",q.style.backgroundPosition="center center",q.style.backgroundRepeat="no-repeat",mxEvent.addListener(q,"click",function(a){z(q,null,null,b,g)}),mxEvent.addListener(q,"dblclick",function(a){C()});else if(!v&&null!=b&&0<b.length){f=u||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";q.style.backgroundImage="url("+f+
")";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";var l=!1;mxEvent.addListener(q,"click",function(f){D.setAttribute("disabled","disabled");q.style.backgroundColor="transparent";q.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;E.spin(M);mxUtils.get(f,mxUtils.bind(this,function(a){E.stop();200<=a.getStatus()&&299>=a.getStatus()&&(z(q,a.getText(),c),l&&C())}))});
mxEvent.addListener(q,"dblclick",function(a){l=!0})}else q.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>",k&&z(q),null!=e?mxEvent.addListener(q,"click",e):(mxEvent.addListener(q,"click",function(a){z(q,null,null,b,g)}),mxEvent.addListener(q,"dblclick",function(a){C()}));M.appendChild(q)}function G(){N&&(N=!1,mxEvent.addListener(M,"scroll",function(a){M.scrollTop+M.clientHeight>=
M.scrollHeight&&(y(),mxEvent.consume(a))}));var a=null;if(0<aa){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"));O.appendChild(b);for(var c in ca){var f=document.createElement("div"),b=c,d=ca[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+" ("+d.length+")");mxUtils.write(f,f.getAttribute("title"));null!=t&&(f.style.padding=t);O.appendChild(f);(function(b,c){mxEvent.addListener(f,"click",function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=l,M.scrollTop=0,M.innerHTML="",J=0,U=ca[b],L=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");O.appendChild(b)}for(c in R)f=document.createElement("div"),
b=mxResources.get(c),d=R[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+" ("+d.length+")"),mxUtils.write(f,f.getAttribute("title")),null!=t&&(f.style.padding=t),O.appendChild(f),null==a&&0<d.length&&(a=f,a.style.backgroundColor=l,U=d),function(b,c){mxEvent.addListener(f,"click",
@ -8081,23 +8081,23 @@ f)M.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagram
var S=document.createElement("input");S.style.marginRight="10px";S.style.marginLeft="10px";S.style.width="220px";mxEvent.addListener(S,"keypress",function(a){13==a.keyCode&&X(!0)});x.appendChild(S);H=mxUtils.button(mxResources.get("search"),function(){X(!0)});H.className="geBtn";x.appendChild(H)}W(0)}var V=null,ha=null,ea=null,Y=null,Z=null,M=document.createElement("div");M.style.border="1px solid #d3d3d3";M.style.position="absolute";M.style.left="160px";M.style.right="34px";K=(b?72:40)+(K?30:0);
M.style.top=K+"px";M.style.bottom="68px";M.style.margin="6px 0 0 -1px";M.style.padding="6px";M.style.overflow="auto";var O=document.createElement("div");O.style.cssText="position:absolute;left:30px;width:128px;top:"+K+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var ga=140,Q=140,R={},ca={},aa=0,N=!0;R.basic=[{title:"blankDiagram",select:!0}];var U=R.basic;if(!c){var ba=function(){mxUtils.get(fa,function(a){if(!da){da=!0;for(a=a.getXml().documentElement.firstChild;null!=
a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=a.getAttribute("section");null==c&&(c=b.indexOf("/"),c=b.substring(0,c));b=R[c];null==b&&(b=[],R[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview")})}}a=a.nextSibling}E.stop();G()}})};v.appendChild(O);v.appendChild(M);var da=!1,fa=f;/^https?:\/\//.test(fa)&&!a.editor.isCorsEnabledForUrl(fa)&&(fa=PROXY_URL+
"?url="+encodeURIComponent(fa));E.spin(M);null!=z?z(function(a,b){ca=a;T=aa=b;ba()},ba):ba();P=R}mxEvent.addListener(F,"keypress",function(b){a.dialog.container.firstChild==v&&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";z=mxUtils.button(mxResources.get("cancel"),function(){null!=g&&g();a.hideDialog(!0)});z.className="geBtn";!a.editor.cancelFirst||
e&&null==g||f.appendChild(z);c||a.isOffline()||!b||null!=d||e||(K=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),K.className="geBtn",f.appendChild(K));c||"1"==urlParams.embed||e||(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(F.value)+
"?url="+encodeURIComponent(fa));E.spin(M);null!=A?A(function(a,b){ca=a;T=aa=b;ba()},ba):ba();P=R}mxEvent.addListener(F,"keypress",function(b){a.dialog.container.firstChild==v&&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";A=mxUtils.button(mxResources.get("cancel"),function(){null!=g&&g();a.hideDialog(!0)});A.className="geBtn";!a.editor.cancelFirst||
e&&null==g||f.appendChild(A);c||a.isOffline()||!b||null!=d||e||(K=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),K.className="geBtn",f.appendChild(K));c||"1"==urlParams.embed||e||(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(F.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&&q&&(q=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()}),q.className="geBtn",f.appendChild(q));f.appendChild(D);a.editor.cancelFirst||null!=d||e&&null==g||f.appendChild(z);v.appendChild(f);this.container=v},CreateDialog=function(a,c,b,d,e,g,l,m,n,t,f,k,p,u,q,x){function z(b,f,d,p){function g(){mxEvent.addListener(e,"click",function(){var b=d;if(l){var f=A.value,k=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var b=null!=b?b:v.value,p="";b==
App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?p=a.gitHub.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<=k&&(f=f.substring(0,k));A.value=f+p}}y(d)})}var e=document.createElement("a");e.style.overflow="hidden";var u=document.createElement("img");u.src=b;u.setAttribute("border","0");u.setAttribute("align","absmiddle");u.style.width="60px";u.style.height="60px";u.style.paddingBottom=
""});b.style.display="none";document.body.appendChild(b);a.newDlgFileInputElt=b}a.newDlgFileInputElt.click()}),q.className="geBtn",f.appendChild(q));f.appendChild(D);a.editor.cancelFirst||null!=d||e&&null==g||f.appendChild(A);v.appendChild(f);this.container=v},CreateDialog=function(a,c,b,d,e,g,l,m,n,t,f,k,p,u,q,x){function A(b,f,d,p){function g(){mxEvent.addListener(e,"click",function(){var b=d;if(l){var f=z.value,k=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var b=null!=b?b:v.value,p="";b==
App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?p=a.gitHub.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<=k&&(f=f.substring(0,k));z.value=f+p}}y(d)})}var e=document.createElement("a");e.style.overflow="hidden";var u=document.createElement("img");u.src=b;u.setAttribute("border","0");u.setAttribute("align","absmiddle");u.style.width="60px";u.style.height="60px";u.style.paddingBottom=
"6px";e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";e.className="geBaseButton";e.style.position="relative";e.style.margin="4px";e.style.padding="8px 8px 10px 8px";e.style.whiteSpace="nowrap";e.appendChild(u);mxClient.IS_QUIRKS&&(e.style.cssFloat="left",e.style.zoom="1");e.style.color="gray";e.style.fontSize="11px";var q=document.createElement("div");e.appendChild(q);mxUtils.write(q,f);if(null!=p&&null==a[p]){u.style.visibility="hidden";mxUtils.setOpacity(q,10);var x=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});x.spin(e);var m=window.setTimeout(function(){null==a[p]&&(x.stop(),e.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(m),mxUtils.setOpacity(q,100),u.style.visibility="",x.stop(),g())}))}else g();B.appendChild(e);++G==k&&(mxUtils.br(B),G=0)}function y(c){var f=A.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,
c)}l=null!=l?l:!0;m=null!=m?m:!0;k=null!=k?k:4;g=document.createElement("div");null==d&&a.addLanguageMenu(g);var C=document.createElement("h2");mxUtils.write(C,e||mxResources.get("create"));C.style.marginTop="0px";C.style.marginBottom="24px";g.appendChild(C);mxUtils.write(g,mxResources.get("filename")+":");var A=document.createElement("input");A.setAttribute("value",c);A.style.width="280px";A.style.marginLeft="10px";A.style.marginBottom="20px";this.init=function(){A.focus();mxClient.IS_GC||mxClient.IS_FF||
5<=document.documentMode||mxClient.IS_QUIRKS?A.select():document.execCommand("selectAll",!1,null)};g.appendChild(A);null!=x&&g.appendChild(FilenameDialog.createTypeHint(a,A,x));null!=p&&null!=u&&"image/"==u.substring(0,6)&&(A.style.width="160px",e=null,"image/svg+xml"==u&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(p),p=e.getElementsByTagName("svg")[0],u=parseInt(p.getAttribute("width")),q=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+u+" "+q),p.setAttribute("width",
length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});x.spin(e);var m=window.setTimeout(function(){null==a[p]&&(x.stop(),e.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(m),mxUtils.setOpacity(q,100),u.style.visibility="",x.stop(),g())}))}else g();B.appendChild(e);++G==k&&(mxUtils.br(B),G=0)}function y(c){var f=z.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,
c)}l=null!=l?l:!0;m=null!=m?m:!0;k=null!=k?k:4;g=document.createElement("div");null==d&&a.addLanguageMenu(g);var C=document.createElement("h2");mxUtils.write(C,e||mxResources.get("create"));C.style.marginTop="0px";C.style.marginBottom="24px";g.appendChild(C);mxUtils.write(g,mxResources.get("filename")+":");var z=document.createElement("input");z.setAttribute("value",c);z.style.width="280px";z.style.marginLeft="10px";z.style.marginBottom="20px";this.init=function(){z.focus();mxClient.IS_GC||mxClient.IS_FF||
5<=document.documentMode||mxClient.IS_QUIRKS?z.select():document.execCommand("selectAll",!1,null)};g.appendChild(z);null!=x&&g.appendChild(FilenameDialog.createTypeHint(a,z,x));null!=p&&null!=u&&"image/"==u.substring(0,6)&&(z.style.width="160px",e=null,"image/svg+xml"==u&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(p),p=e.getElementsByTagName("svg")[0],u=parseInt(p.getAttribute("width")),q=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+u+" "+q),p.setAttribute("width",
"120px"),p.setAttribute("height","80px")):(e=document.createElement("img"),e.setAttribute("src","data:"+u+(q?";base64,":";utf8,")+p)),e.style.position="absolute",e.style.top="70px",e.style.right="100px",e.style.maxWidth="120px",e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),g.appendChild(e),n&&Editor.popupsAllowed&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){y("_blank")})));mxUtils.br(g);var B=document.createElement("div");B.style.textAlign=
"center";var G=0;B.style.marginTop="6px";g.appendChild(B);var v=document.createElement("select");v.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")),v.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")),v.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")),v.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")),v.appendChild(p),z(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.TrelloClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_TRELLO),mxUtils.write(p,mxResources.get("trello")),v.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")),v.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")),v.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!=t&&(f=mxUtils.button(mxResources.get("help"),function(){a.openLink(t)}),f.className="geBtn",m.appendChild(f));f=mxUtils.button(mxResources.get("cancel"),function(){null!=
"center";var G=0;B.style.marginTop="6px";g.appendChild(B);var v=document.createElement("select");v.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")),v.appendChild(p),A(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")),v.appendChild(p),a.mode==App.MODE_ONEDRIVE&&p.setAttribute("selected","selected"),A(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")),v.appendChild(p),a.mode==App.MODE_DROPBOX&&p.setAttribute("selected","selected"),
A(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")),v.appendChild(p),A(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.TrelloClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_TRELLO),mxUtils.write(p,mxResources.get("trello")),v.appendChild(p),
A(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")),v.appendChild(p),a.mode!=App.MODE_DEVICE&&m||p.setAttribute("selected","selected"),f&&A(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")),v.appendChild(m),a.mode==App.MODE_BROWSER&&m.setAttribute("selected","selected"),A(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));m=document.createElement("div");m.style.marginTop="26px";m.style.textAlign="center";null!=t&&(f=mxUtils.button(mxResources.get("help"),function(){a.openLink(t)}),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(A,"keypress",function(b){13==b.keyCode?y(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});g.appendChild(m);this.container=g};CreateDialog.showDownloadButton=!0;
n.className="geBtn",m.appendChild(n));a.editor.cancelFirst||m.appendChild(f);mxEvent.addListener(z,"keypress",function(b){13==b.keyCode?y(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});g.appendChild(m);this.container=g};CreateDialog.showDownloadButton=!0;
var PopupDialog=function(a,c,b,d,e){e=null!=e?e:!0;var g=document.createElement("div");g.style.textAlign="left";mxUtils.write(g,mxResources.get("fileOpenLocation"));mxUtils.br(g);mxUtils.br(g);var l=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();null!=d&&d()});l.className="geBtn";l.style.marginBottom="8px";l.style.width="280px";g.appendChild(l);mxUtils.br(g);var m=mxUtils.button(mxResources.get("openInNewWindow"),function(){e&&a.hideDialog();null!=b&&b();a.openLink(c,
null,!0)});m.className="geBtn gePrimaryBtn";m.style.width=l.style.width;g.appendChild(m);mxUtils.br(g);mxUtils.br(g);mxUtils.write(g,mxResources.get("allowPopups"));this.container=g},ImageDialog=function(a,c,b,d,e,g){g=null!=g?g:!0;var l=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";
@ -8112,20 +8112,20 @@ function(){a.spinner.stop();a.hideDialog()});c.className="geBtn";a.editor.cancel
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=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).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,e){function g(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 l=document.createElement("div");mxUtils.write(l,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");
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 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="440px";n.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";n.style.backgroundRepeat="no-repeat";n.style.backgroundPosition="100% 50%";n.style.paddingRight="14px";var t=document.createElement("div");t.setAttribute("title",mxResources.get("reset"));t.style.position="relative";t.style.left="-16px";t.style.width="12px";t.style.height="14px";t.style.cursor="pointer";
t.style.display=mxClient.IS_VML?"inline":"inline-block";t.style.top=(mxClient.IS_VML?0:3)+"px";t.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(t,"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 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 p=document.createElement("select");p.style.width="420px";if(e&&null!=a.pages){null!=c&&"data:page/id,"==c.substring(0,13)?(k.setAttribute("checked","checked"),k.defaultChecked=!0):(n.setAttribute("value",c),f.setAttribute("checked","checked"),f.defaultChecked=!0);n.style.width="420px";m.appendChild(f);m.appendChild(n);m.appendChild(t);mxUtils.br(m);m.appendChild(k);e=!1;for(t=0;t<a.pages.length;t++){var u=
document.createElement("option");mxUtils.write(u,a.pages[t].getName()||mxResources.get("pageWithNumber",[t+1]));u.setAttribute("value","data:page/id,"+a.pages[t].getId());c==u.getAttribute("value")&&(u.setAttribute("selected","selected"),e=!0);p.appendChild(u)}if(!e&&k.checked){var q=document.createElement("option");mxUtils.write(q,mxResources.get("pageNotFound"));q.setAttribute("disabled","disabled");q.setAttribute("selected","selected");q.setAttribute("value","pageNotFound");p.appendChild(q);mxEvent.addListener(p,
"change",function(){null==q.parentNode||q.selected||q.parentNode.removeChild(q)})}m.appendChild(p)}else n.setAttribute("value",c),m.appendChild(n),m.appendChild(t);l.appendChild(m);var x=mxUtils.button(b,function(){a.hideDialog();d(k.checked?"pageNotFound"!==p.value?p.value:c:n.value,LinkDialog.selectedDocs)});x.style.verticalAlign="middle";x.className="geBtn gePrimaryBtn";this.init=function(){k.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");k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(n,"focus",function(){k.removeAttribute("checked");f.setAttribute("checked","checked");f.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(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,x.click());a.stopPropagation();a.preventDefault()}),!1)}};var z=document.createElement("div");
z.style.marginTop="20px";z.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.style.verticalAlign="middle";b.className="geBtn";a.editor.cancelFirst&&z.appendChild(b);m=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});m.style.verticalAlign="middle";m.className="geBtn";z.appendChild(m);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(m.style.display="none");LinkDialog.selectedDocs=null;LinkDialog.filePicked=
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,x.click());a.stopPropagation();a.preventDefault()}),!1)}};var A=document.createElement("div");
A.style.marginTop="20px";A.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.style.verticalAlign="middle";b.className="geBtn";a.editor.cancelFirst&&A.appendChild(b);m=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});m.style.verticalAlign="middle";m.className="geBtn";A.appendChild(m);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(m.style.display="none");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&&g(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=gapi.auth.getToken().access_token,c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),f=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),d=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),
b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(c).addView(f).addView(d).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.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).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&&g(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&&g(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&&g(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()}})});mxEvent.addListener(n,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),d(k.checked?p.value:n.value,LinkDialog.selectedDocs))});z.appendChild(x);a.editor.cancelFirst||z.appendChild(b);l.appendChild(z);this.container=
n.focus()})});null!=a.gitHub&&g(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()}})});mxEvent.addListener(n,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),d(k.checked?p.value:n.value,LinkDialog.selectedDocs))});A.appendChild(x);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","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",
@ -8136,31 +8136,31 @@ mxEvent.addListener(d,"change",function(){0<d.value.length&&0<g.test(d.value)?e.
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(e)):(b.appendChild(e),b.appendChild(m));c.appendChild(b);this.container=c};FeedbackDialog.maxAttachmentSize=1E6;
var RevisionDialog=function(a,c,b){var d=document.createElement("div"),e=document.createElement("h3");e.style.marginTop="0px";mxUtils.write(e,mxResources.get("revisionHistory"));d.appendChild(e);var g=document.createElement("div");g.style.position="absolute";g.style.overflow="auto";g.style.width="170px";g.style.height="378px";d.appendChild(g);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 m=new Graph(l);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,t=null,f=0,k=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=t&&null!=t[f]?t[f].getAttribute("name"):"pagenumber"==a?f+1:k.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(),q=null,x=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 A=mxUtils.button("",function(){null!=z&&m.zoomOut()});A.className="geSprite geSprite-zoomout";A.setAttribute("title",mxResources.get("zoomOut"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,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 G=mxUtils.button("",function(){null!=z&&(m.zoomActual(),m.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 v=document.createElement("div");v.style.position="absolute";v.style.textAlign="right";v.style.color="gray";v.style.marginTop="10px";v.style.backgroundColor="transparent";v.style.top="440px";v.style.right="32px";v.style.maxWidth="380px";v.style.cursor="default";var K=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"))}});K.className="geBtn";K.setAttribute("disabled","disabled");var H=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);
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(),q=null,x=null,A=null,y=null,C=mxUtils.button("",function(){null!=A&&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 z=mxUtils.button("",function(){null!=A&&m.zoomOut()});z.className="geSprite geSprite-zoomout";z.setAttribute("title",mxResources.get("zoomOut"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var B=mxUtils.button("",function(){null!=A&&(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 G=mxUtils.button("",function(){null!=A&&(m.zoomActual(),m.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 v=document.createElement("div");v.style.position="absolute";v.style.textAlign="right";v.style.color="gray";v.style.marginTop="10px";v.style.backgroundColor="transparent";v.style.top="440px";v.style.right="32px";v.style.maxWidth="380px";v.style.cursor="default";var K=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"))}});K.className="geBtn";K.setAttribute("disabled","disabled");var H=mxUtils.button(mxResources.get("restore"),function(){null!=A&&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)})})});H.className="geBtn";H.setAttribute("disabled","disabled");var F=document.createElement("select");F.setAttribute("disabled","disabled");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";var J=null;mxEvent.addListener(F,"change",function(a){null!=J&&(J(a),mxEvent.consume(a))});
var E=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))});E.className="geBtn";E.setAttribute("disabled","disabled");null!=b&&(E.style.display="none");var D=mxUtils.button(mxResources.get("show"),function(){null!=x&&a.openLink(x.getUrl(F.selectedIndex))});D.className="geBtn gePrimaryBtn";D.setAttribute("disabled","disabled");null!=b&&(D.style.display=
var E=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))});E.className="geBtn";E.setAttribute("disabled","disabled");null!=b&&(E.style.display="none");var D=mxUtils.button(mxResources.get("show"),function(){null!=x&&a.openLink(x.getUrl(F.selectedIndex))});D.className="geBtn gePrimaryBtn";D.setAttribute("disabled","disabled");null!=b&&(D.style.display=
"none",H.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var I=document.createElement("div");I.className="geToolbarContainer";I.style.backgroundColor="transparent";I.style.padding="2px";I.style.border="none";I.style.left="199px";I.style.top="442px";var L=null;if(null!=c&&0<c.length){l.style.cursor="move";var P=document.createElement("table");P.style.border="1px solid lightGray";P.style.borderCollapse=
"collapse";P.style.borderSpacing="0px";P.style.width="100%";var T=document.createElement("tbody"),W=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var X=c.length-1;0<=X;X--){var S=function(b){var d=new Date(b.modifiedDate),k=null;if(0<=d.getTime()){var g=function(c){p.stop();var e=mxUtils.parseXml(c),g=a.editor.extractGraphModel(e.documentElement,!0);if(null!=g){var q=function(a){null!=a&&(a=x(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));
return a},x=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,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};F.style.display="none";F.innerHTML="";z=e;y=c;t=parseSelectFunction=null;f=0;if("mxfile"==g.nodeName){e=g.getElementsByTagName("diagram");t=[];for(c=0;c<e.length;c++)t.push(e[c]);f=Math.min(n,t.length-1);0<t.length&&q(t[f]);if(1<t.length)for(F.removeAttribute("disabled"),
return a},x=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,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};F.style.display="none";F.innerHTML="";A=e;y=c;t=parseSelectFunction=null;f=0;if("mxfile"==g.nodeName){e=g.getElementsByTagName("diagram");t=[];for(c=0;c<e.length;c++)t.push(e[c]);f=Math.min(n,t.length-1);0<t.length&&q(t[f]);if(1<t.length)for(F.removeAttribute("disabled"),
F.style.display="",c=0;c<t.length;c++)e=document.createElement("option"),mxUtils.write(e,t[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),F.appendChild(e);J=function(){try{var b=parseInt(F.value);q(t[b]);f=n=b}catch(aa){F.value=n,a.handleError(aa)}}}else x(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");v.innerHTML="";mxUtils.write(v,(null!=c?c+" ":"")+d.toLocaleDateString()+" "+
d.toLocaleTimeString());v.setAttribute("title",k.getAttribute("title"));C.removeAttribute("disabled");A.removeAttribute("disabled");B.removeAttribute("disabled");G.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&H.removeAttribute("disabled"),K.removeAttribute("disabled"),D.removeAttribute("disabled"),E.removeAttribute("disabled"));mxUtils.setOpacity(C,60);mxUtils.setOpacity(A,60);mxUtils.setOpacity(B,60);mxUtils.setOpacity(G,60)}else F.style.display="none",F.innerHTML=
d.toLocaleTimeString());v.setAttribute("title",k.getAttribute("title"));C.removeAttribute("disabled");z.removeAttribute("disabled");B.removeAttribute("disabled");G.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&H.removeAttribute("disabled"),K.removeAttribute("disabled"),D.removeAttribute("disabled"),E.removeAttribute("disabled"));mxUtils.setOpacity(C,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(B,60);mxUtils.setOpacity(G,60)}else F.style.display="none",F.innerHTML=
"",v.innerHTML="",mxUtils.write(v,mxResources.get("errorLoadingFile"))},k=document.createElement("tr");k.style.borderBottom="1px solid lightGray";k.style.fontSize="12px";k.style.cursor="pointer";var e=document.createElement("td");e.style.padding="6px";e.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(e,mxResources.get("current")):d.toDateString()===W?mxUtils.write(e,d.toLocaleTimeString()):mxUtils.write(e,d.toLocaleDateString()+" "+d.toLocaleTimeString());k.appendChild(e);k.setAttribute("title",
d.toLocaleDateString()+" "+d.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(k,"click",function(a){x!=b&&(p.stop(),null!=q&&(q.style.backgroundColor=""),x=b,q=k,q.style.backgroundColor="#ebf2f9",y=z=null,v.removeAttribute("title"),v.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),l.style.backgroundColor="#ffffff",m.getModel().clear(),H.setAttribute("disabled",
"disabled"),K.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),mxUtils.setOpacity(C,20),mxUtils.setOpacity(A,20),mxUtils.setOpacity(B,20),mxUtils.setOpacity(G,20),p.spin(l),b.getXml(function(a){if(x==b)try{g(a)}catch(ga){v.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
d.toLocaleDateString()+" "+d.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(k,"click",function(a){x!=b&&(p.stop(),null!=q&&(q.style.backgroundColor=""),x=b,q=k,q.style.backgroundColor="#ebf2f9",y=A=null,v.removeAttribute("title"),v.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),l.style.backgroundColor="#ffffff",m.getModel().clear(),H.setAttribute("disabled",
"disabled"),K.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),mxUtils.setOpacity(C,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(B,20),mxUtils.setOpacity(G,20),p.spin(l),b.getXml(function(a){if(x==b)try{g(a)}catch(ga){v.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
": "+ga.message)}},function(a){p.stop();F.style.display="none";F.innerHTML="";v.innerHTML="";mxUtils.write(v,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(k,"dblclick",function(a){D.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);T.appendChild(k)}return k}(c[X]);null!=S&&X==c.length-1&&(L=S)}P.appendChild(T);g.appendChild(P)}else null==u||null==a.drive&&u.constructor==window.DriveFile||
null==a.dropbox&&u.constructor==window.DropboxFile?(l.style.display="none",I.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(l.style.display="none",I.style.display="none",mxUtils.write(g,mxResources.get("noRevisions")));this.init=function(){null!=L&&L.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";I.appendChild(F);I.appendChild(C);I.appendChild(A);I.appendChild(G);I.appendChild(B);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(K),
null==a.dropbox&&u.constructor==window.DropboxFile?(l.style.display="none",I.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(l.style.display="none",I.style.display="none",mxUtils.write(g,mxResources.get("noRevisions")));this.init=function(){null!=L&&L.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";I.appendChild(F);I.appendChild(C);I.appendChild(z);I.appendChild(G);I.appendChild(B);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(K),
e.appendChild(E),e.appendChild(H),e.appendChild(D)):(e.appendChild(K),e.appendChild(E),e.appendChild(H),e.appendChild(D),e.appendChild(g));d.appendChild(e);d.appendChild(I);d.appendChild(v);this.container=d},DraftDialog=function(a,c,b,d,e,g,l,m){var n=document.createElement("div"),t=document.createElement("div");t.style.marginTop="0px";t.style.whiteSpace="nowrap";t.style.overflow="auto";mxUtils.write(t,c);n.appendChild(t);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 k=new Graph(f);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 p=a.editor.extractGraphModel(c.documentElement,!0),u=0,q=null,x=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==
a&&null!=q&&null!=q[u]?q[u].getAttribute("name"):"pagenumber"==a?u+1:x.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);t=mxUtils.button("",function(){k.maxFitScale=8;k.fit(8);k.center()});t.className="geSprite geSprite-fit";t.setAttribute("title",mxResources.get("fit"));t.style.outline="none";t.style.border="none";t.style.margin="2px";mxUtils.setOpacity(t,60);var z=mxUtils.button("",function(){k.zoomActual();k.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);e=mxUtils.button(l||mxResources.get("discard"),e);e.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(g||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position="absolute";g.style.bottom="30px";g.style.width=
"none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);t=mxUtils.button("",function(){k.maxFitScale=8;k.fit(8);k.center()});t.className="geSprite geSprite-fit";t.setAttribute("title",mxResources.get("fit"));t.style.outline="none";t.style.border="none";t.style.margin="2px";mxUtils.setOpacity(t,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);e=mxUtils.button(l||mxResources.get("discard"),e);e.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(g||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position="absolute";g.style.bottom="30px";g.style.width=
"640px";g.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";f.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(y,"change",function(a){u=parseInt(y.value);b(q[u]);mxEvent.consume(a)});if("mxfile"==p.nodeName){var c=p.getElementsByTagName("diagram");q=[];for(var d=0;d<c.length;d++)q.push(c[d]);0<q.length&&b(q[u]);if(1<q.length)for(y.style.display="",d=0;d<q.length;d++)c=document.createElement("option"),mxUtils.write(c,q[d].getAttribute("name")||mxResources.get("pageWithNumber",[d+1])),c.setAttribute("value",
d),d==u&&c.setAttribute("selected","selected"),y.appendChild(c)}else a(p)};l.appendChild(y);l.appendChild(c);l.appendChild(b);l.appendChild(z);l.appendChild(t);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?(g.appendChild(c),null!=m&&g.appendChild(m),g.appendChild(e),g.appendChild(d)):(g.appendChild(d),g.appendChild(e),null!=m&&g.appendChild(m),
d),d==u&&c.setAttribute("selected","selected"),y.appendChild(c)}else a(p)};l.appendChild(y);l.appendChild(c);l.appendChild(b);l.appendChild(A);l.appendChild(t);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?(g.appendChild(c),null!=m&&g.appendChild(m),g.appendChild(e),g.appendChild(d)):(g.appendChild(d),g.appendChild(e),null!=m&&g.appendChild(m),
g.appendChild(c));n.appendChild(g);n.appendChild(l);this.container=n},FindWindow=function(a,c,b,d,e){function g(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 d=mxUtils.trim(b[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&d.substring(0,c.length)===c||null!=a&&a.test(d))return!0}}return!1}function l(){var a=n.model.getDescendants(n.model.getRoot()),b=p.value.toLowerCase(),
c=u.checked?new RegExp(b):null,d=null;t!=b&&(t=b,f=null);var k=null==f;if(0<b.length)for(var e=0;e<a.length;e++){var q=n.view.getState(a[e]);if(null!=q&&null!=q.cell.value&&(k||null==d)&&(n.model.isVertex(q.cell)||n.model.isEdge(q.cell))&&(n.isHtmlLabel(q.cell)?(x.innerHTML=n.getLabel(q.cell),label=mxUtils.extractTextWithWhitespace([x])):label=n.getLabel(q.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||g(c,q.cell,b))||
null!=c&&(c.test(label)||g(c,q.cell,b))))if(k){d=q;break}else null==d&&(d=q);k=k||q==f}null!=d?(f=d,n.scrollCellToVisible(f.cell),n.isEnabled()?n.setSelectionCell(f.cell):n.highlightCell(f.cell)):n.isEnabled()&&n.clearSelection();return 0==b.length||null!=d}var m=a.actions.get("find"),n=a.editor.graph,t=null,f=null,k=document.createElement("div");k.style.userSelect="none";k.style.overflow="hidden";k.style.padding="10px";k.style.height="100%";var p=document.createElement("input");p.setAttribute("placeholder",
@ -8168,8 +8168,8 @@ mxResources.get("find"));p.setAttribute("type","text");p.style.marginTop="4px";p
"relative";q.style.marginLeft="6px";q.style.top="-1px";k.appendChild(q);var x=document.createElement("div");mxUtils.br(k);q=mxUtils.button(mxResources.get("reset"),function(){p.value="";p.style.backgroundColor="";t=f=null;p.focus()});q.setAttribute("title",mxResources.get("reset"));q.style.marginTop="6px";q.style.marginRight="4px";q.className="geBtn";k.appendChild(q);q=mxUtils.button(mxResources.get("find"),function(){try{p.style.backgroundColor=l()?"":"#ffcfcf"}catch(y){a.handleError(y)}});q.setAttribute("title",
mxResources.get("find")+" (Enter)");q.style.marginTop="6px";q.className="geBtn gePrimaryBtn";k.appendChild(q);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(t!=p.value.toLowerCase()||13==a.keyCode)try{p.style.backgroundColor=l()?"":"#ffcfcf"}catch(C){p.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(k,"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"),k,c,b,d,e,!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()}},TagsWindow=function(a,c,b,d,e){var g=a.editor.graph,l="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=
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()}},TagsWindow=function(a,c,b,d,e){var g=a.editor.graph,l="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 t=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000046966");t.firstChild.style.marginBottom="6px";t.style.marginLeft="6px";m.appendChild(t)}mxEvent.addListener(n,"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()});
n.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(m);t=mxUtils.button(mxResources.get("hide"),function(){var a=g.getCellsForTags(n.value.split(" "),void 0,l,!0);g.setCellsVisible(a,!1)});t.setAttribute("title",mxResources.get("hide"));t.style.marginTop="8px";t.style.marginRight="4px";t.className="geBtn";m.appendChild(t);t=mxUtils.button(mxResources.get("show"),function(){var a=g.getCellsForTags(n.value.split(" "),void 0,l,!0);g.setCellsVisible(a,!0);if(g.isEnabled()){for(var b=
[],c=0;c<a.length;c++)(g.model.isVertex(a[c])||g.model.isEdge(a[c]))&&b.push(a[c]);g.setSelectionCells(b)}else for(c=0;c<a.length;c++)g.highlightCell(a[c])});t.setAttribute("title",mxResources.get("show"));t.style.marginTop="8px";t.style.marginRight="4px";t.className="geBtn";m.appendChild(t);var f=a.actions.get("tags"),t=mxUtils.button(mxResources.get("close"),function(){f.funct()});t.setAttribute("title",mxResources.get("close")+" (Enter/Esc)");t.style.marginTop="8px";t.className="geBtn gePrimaryBtn";
@ -8187,9 +8187,9 @@ c.style.padding="6px 0px 6px 20px";mxUtils.write(c,b.title);f.appendChild(c);for
null!=p&&(p.style.backgroundColor="");p=c;p.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(c,"click",v);mxEvent.addListener(c,"dblclick",function(a){e.checked=!e.checked;mxEvent.consume(a)});u.push(function(){return e.checked?b.id:null});0==g&&0==d&&v()})(b.entries[d])})(b[g]);d.style.padding="30px";d.appendChild(n);d.appendChild(f);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=n.style.width,b.style.paddingTop="12px");var x=document.createElement("input");x.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)n=document.createElement("span"),n.style.paddingRight="20px",n.appendChild(x),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),x.checked=!0,x.defaultChecked=
!0,mxEvent.addListener(n,"click",function(a){mxEvent.getSource(a)!=x&&(x.checked=!x.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(n.style.position="relative",n.style.top="-6px"),b.appendChild(n);n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";c=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(";"),x.checked,!0)});c.className=
"geBtn gePrimaryBtn"}else{var z=document.createElement("table"),n=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";m=document.createElement("tr");z.style.width="100%";c=document.createElement("td");var e=document.createElement("td"),l=document.createElement("td"),y=mxUtils.bind(this,function(b,c,f){var d=document.createElement("input");d.type="checkbox";z.appendChild(d);d.checked=a.sidebar.isEntryVisible(f);var k=document.createElement("span");mxUtils.write(k,c);c=document.createElement("div");
c.style.display="block";c.appendChild(d);c.appendChild(k);mxEvent.addListener(k,"click",function(a){d.checked=!d.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return d.checked?f:null}});m.appendChild(c);m.appendChild(e);m.appendChild(l);n.appendChild(m);z.appendChild(n);for(var u=[],C=0,g=0;g<b.length;g++)for(n=0;n<b[g].entries.length;n++)C++;for(var A=[c,e,l],B=0,g=0;g<b.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];u.push(y(A[Math.floor(B/(C/3))],
c.title,c.id));B++}})(b[g]);d.appendChild(z);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";x=document.createElement("input");isLocalStorage&&(x.setAttribute("type","checkbox"),x.checked=!0,x.defaultChecked=!0,b.appendChild(x),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),b.appendChild(n),mxEvent.addListener(n,"click",function(a){x.checked=!x.checked;mxEvent.consume(a)}));d.appendChild(b);n=mxUtils.button(mxResources.get("cancel"),
"geBtn gePrimaryBtn"}else{var A=document.createElement("table"),n=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";m=document.createElement("tr");A.style.width="100%";c=document.createElement("td");var e=document.createElement("td"),l=document.createElement("td"),y=mxUtils.bind(this,function(b,c,f){var d=document.createElement("input");d.type="checkbox";A.appendChild(d);d.checked=a.sidebar.isEntryVisible(f);var k=document.createElement("span");mxUtils.write(k,c);c=document.createElement("div");
c.style.display="block";c.appendChild(d);c.appendChild(k);mxEvent.addListener(k,"click",function(a){d.checked=!d.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return d.checked?f:null}});m.appendChild(c);m.appendChild(e);m.appendChild(l);n.appendChild(m);A.appendChild(n);for(var u=[],C=0,g=0;g<b.length;g++)for(n=0;n<b[g].entries.length;n++)C++;for(var z=[c,e,l],B=0,g=0;g<b.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];u.push(y(z[Math.floor(B/(C/3))],
c.title,c.id));B++}})(b[g]);d.appendChild(A);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";x=document.createElement("input");isLocalStorage&&(x.setAttribute("type","checkbox"),x.checked=!0,x.defaultChecked=!0,b.appendChild(x),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),b.appendChild(n),mxEvent.addListener(n,"click",function(a){x.checked=!x.checked;mxEvent.consume(a)}));d.appendChild(b);n=mxUtils.button(mxResources.get("cancel"),
function(){a.hideDialog()});n.className="geBtn";c=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(";"):"",x.checked);a.hideDialog()});c.className="geBtn gePrimaryBtn";b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="right"}a.editor.cancelFirst?(b.appendChild(n),b.appendChild(c)):(b.appendChild(c),b.appendChild(n));d.appendChild(b);this.container=
d},PluginsDialog=function(a){function c(){if(0==e.length)d.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{d.innerHTML="";for(var b=0;b<e.length;b++){var k=document.createElement("span");k.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";k.appendChild(p);mxUtils.write(k,e[b]);d.appendChild(k);mxUtils.br(d);
mxEvent.addListener(p,"click",function(b){return function(){a.confirm(mxResources.get("delete")+' "'+e[b]+'"?',function(){e.splice(b,1);c()})}}(b))}}}var b=document.createElement("div"),d=document.createElement("div");d.style.height="120px";d.style.overflow="auto";var e=mxSettings.getPlugins().slice();b.appendChild(d);c();var g=mxUtils.button(mxResources.get("add"),function(){var b="",d=urlParams.p;if(null!=d&&0<d.length){for(var p=d.split(";"),d=0;d<p.length;d++){var g=App.pluginRegistry[p[d]];null!=
@ -8199,32 +8199,32 @@ l.className="geBtn";var m=mxUtils.button(mxResources.get("apply"),function(){mxS
"...");l.appendChild(m);g.appendChild(l);var l=document.createElement("tr"),n=document.createElement("td"),t=document.createElement("td");e.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()};t.appendChild(f);l.appendChild(n);l.appendChild(t);g.appendChild(l);l=document.createElement("tr");n=document.createElement("td");t=document.createElement("td");
mxUtils.write(n,mxResources.get("top")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value="0";t.appendChild(k);l.appendChild(n);l.appendChild(t);g.appendChild(l);l=document.createElement("tr");n=document.createElement("td");t=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";t.appendChild(p);l.appendChild(n);l.appendChild(t);
g.appendChild(l);l=document.createElement("tr");n=document.createElement("td");t=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";t.appendChild(u);l.appendChild(n);l.appendChild(t);g.appendChild(l);l=document.createElement("tr");n=document.createElement("td");t=document.createElement("td");mxUtils.write(n,mxResources.get("circle")+":");l.appendChild(n);var q=document.createElement("input");
q.setAttribute("type","checkbox");t.appendChild(q);l.appendChild(t);g.appendChild(l);e.appendChild(g);d.appendChild(e);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";var x=new Image,z=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var c=document.createElement("canvas"),d=c.getContext("2d"),e=x.width,g=x.height,l=parseInt(f.value),v=parseInt(k.value),e=Math.max(1,e-l-parseInt(p.value)),g=Math.max(1,g-v-parseInt(u.value));c.width=e;c.height=
g;q.checked&&(d.fillStyle="#000000",d.arc(e/2,g/2,Math.min(e/2,g/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(x,l,v,e,g,0,0,e,g);b(c.toDataURL())});z.className="geBtn gePrimaryBtn";z.setAttribute("disabled","disabled");x.onload=function(){z.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+": "+x.width+" "+mxResources.get("height")+": "+x.height)};x.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(e),c.appendChild(z)):(c.appendChild(z),c.appendChild(e));d.appendChild(c);this.container=d},EditGeometryDialog=function(a,c){var b=a.editor.graph,d=1==c.length?b.getCellGeometry(c[0]):null,e=document.createElement("div"),g=document.createElement("table"),l=document.createElement("tbody"),m=document.createElement("tr"),n=document.createElement("td"),t=document.createElement("td");g.style.paddingLeft="6px";mxUtils.write(n,
q.setAttribute("type","checkbox");t.appendChild(q);l.appendChild(t);g.appendChild(l);e.appendChild(g);d.appendChild(e);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";var x=new Image,A=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var c=document.createElement("canvas"),d=c.getContext("2d"),e=x.width,g=x.height,l=parseInt(f.value),v=parseInt(k.value),e=Math.max(1,e-l-parseInt(p.value)),g=Math.max(1,g-v-parseInt(u.value));c.width=e;c.height=
g;q.checked&&(d.fillStyle="#000000",d.arc(e/2,g/2,Math.min(e/2,g/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(x,l,v,e,g,0,0,e,g);b(c.toDataURL())});A.className="geBtn gePrimaryBtn";A.setAttribute("disabled","disabled");x.onload=function(){A.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+": "+x.width+" "+mxResources.get("height")+": "+x.height)};x.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(e),c.appendChild(A)):(c.appendChild(A),c.appendChild(e));d.appendChild(c);this.container=d},EditGeometryDialog=function(a,c){var b=a.editor.graph,d=1==c.length?b.getCellGeometry(c[0]):null,e=document.createElement("div"),g=document.createElement("table"),l=document.createElement("tbody"),m=document.createElement("tr"),n=document.createElement("td"),t=document.createElement("td");g.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()};t.appendChild(f);m.appendChild(n);m.appendChild(t);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");t=document.createElement("td");mxUtils.write(n,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width=
"100px";k.value=null!=d?d.x:"";t.appendChild(k);m.appendChild(n);m.appendChild(t);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");t=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:"";t.appendChild(p);m.appendChild(n);m.appendChild(t);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");t=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:"";t.appendChild(u);m.appendChild(n);m.appendChild(t);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");t=document.createElement("td");mxUtils.write(n,mxResources.get("dy")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=d&&null!=d.offset?
d.offset.y:"";t.appendChild(q);m.appendChild(n);m.appendChild(t);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");t=document.createElement("td");mxUtils.write(n,mxResources.get("width")+":");var x=document.createElement("input");x.setAttribute("type","text");x.style.width="100px";x.value=null!=d?d.width:"";t.appendChild(x);m.appendChild(n);m.appendChild(t);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");t=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:"";t.appendChild(z);m.appendChild(n);m.appendChild(t);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");t=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]),
mxResources.get("height")+":");var A=document.createElement("input");A.setAttribute("type","text");A.style.width="100px";A.value=null!=d?d.height:"";t.appendChild(A);m.appendChild(n);m.appendChild(t);l.appendChild(m);m=document.createElement("tr");n=document.createElement("td");t=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):"";t.appendChild(y);m.appendChild(n);m.appendChild(t);l.appendChild(m);g.appendChild(l);e.appendChild(g);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(k.value).length&&(e.x=Number(k.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(q.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.y=Number(q.value))),b.isCellResizable(c[d])&&(0<mxUtils.trim(x.value).length&&(e.width=Number(x.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,
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(q.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.y=Number(q.value))),b.isCellResizable(c[d])&&(0<mxUtils.trim(x.value).length&&(e.width=Number(x.value)),0<mxUtils.trim(A.value).length&&(e.height=Number(A.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(e,"keypress",function(a){13==a.keyCode&&C.click()});g=document.createElement("div");g.style.marginTop="20px";g.style.textAlign="right";a.editor.cancelFirst?(g.appendChild(d),g.appendChild(C)):(g.appendChild(C),g.appendChild(d));e.appendChild(g);this.container=e},LibraryDialog=function(a,c,b,d,e,g){function l(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,d,k,p,e,g,v,n){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==x[b]){var y=function(){L.innerHTML="";L.style.cursor="pointer";L.style.whiteSpace="nowrap";L.style.textOverflow="ellipsis";mxUtils.write(L,null!=F.title&&0<F.title.length?F.title:mxResources.get("untitled"));L.style.color=null==F.title||0==F.title.length?"#d0d0d0":""};u.style.backgroundImage=
"";q.style.display="none";var K=p,t=e;if(p>a.maxImageSize||e>a.maxImageSize){var G=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=G;e*=G}K>t?(t=Math.round(100*t/K),K=100):(K=Math.round(100*K/t),t=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 D=document.createElement("img");D.setAttribute("src",A.convert(b));D.style.width=K+"px";D.style.height=t+"px";D.style.margin="10px";D.style.paddingBottom=Math.floor((100-t)/2)+"px";D.style.paddingLeft=Math.floor((100-K)/2)+"px";E.appendChild(D)}else if(null!=g){var J=a.stringToCells(Graph.decompress(g.xml));0<J.length&&(a.sidebar.createThumb(J,100,100,E,null,!0,!1),E.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",E.firstChild.style.cursor="")}var H=document.createElement("img");
b){var D=document.createElement("img");D.setAttribute("src",z.convert(b));D.style.width=K+"px";D.style.height=t+"px";D.style.margin="10px";D.style.paddingBottom=Math.floor((100-t)/2)+"px";D.style.paddingLeft=Math.floor((100-K)/2)+"px";E.appendChild(D)}else if(null!=g){var J=a.stringToCells(Graph.decompress(g.xml));0<J.length&&(a.sidebar.createThumb(J,100,100,E,null,!0,!1),E.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",E.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(d){x[b]=null;for(var k=0;k<f.length;k++)if(null!=f[k].data&&f[k].data==b||null!=f[k].xml&&null!=c&&f[k].xml==
c.xml){f.splice(k,1);break}E.parentNode.removeChild(a);0==f.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",q.style.display="");mxEvent.consume(d)});mxEvent.addListener(H,"dblclick",function(a){mxEvent.consume(a)})})(E,b,g);E.appendChild(H);E.style.marginBottom="30px";var L=document.createElement("div");L.style.position="absolute";L.style.boxSizing="border-box";L.style.bottom="-18px";L.style.left="10px";L.style.right="10px";L.style.backgroundColor="#ffffff";L.style.overflow=
"hidden";L.style.textAlign="center";var F=null;null!=b?(F={data:b,w:p,h:e,title:n},null!=v&&(F.aspect=v),x[b]=D,f.push(F)):null!=g&&(g.aspect="fixed",f.push(g),F=g);mxEvent.addListener(L,"keydown",function(a){13==a.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(a))});y();E.appendChild(L);mxEvent.addListener(L,"mousedown",function(a){"true"!=L.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,F.title||"",mxResources.get("ok"),function(a){null!=a&&(F.title=a,y())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=L.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==F.title||0==F.title.length)L.innerHTML="";L.style.textOverflow="";L.style.whiteSpace="";L.style.cursor="text";L.style.color="";L.setAttribute("contentEditable","true");L.focus();document.execCommand("selectAll",
!1,null);C=function(){L.removeAttribute("contentEditable");L.style.cursor="pointer";F.title=L.innerHTML;y()};mxEvent.consume(b)}};mxEvent.addListener(L,"click",J);mxEvent.addListener(E,"dblclick",J);u.appendChild(E);mxEvent.addListener(E,"dragstart",function(a){null==b&&null!=g&&(H.style.visibility="hidden",L.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",g.xml);z=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);H.style.visibility="";L.style.visibility=""},0)});mxEvent.addListener(E,"dragend",function(a){"hidden"==H.style.visibility&&(H.style.visibility="",L.style.visibility="");z=null;mxUtils.setOpacity(E,100);mxUtils.setPrefixedStyle(E.style,"transform",null)})}else B||(B=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=!1;try{if(a.spinner.stop(),K=mxUtils.parseXml(b),"mxlibrary"==K.documentElement.nodeName){t=JSON.parse(mxUtils.getTextContent(K.documentElement));
!1,null);C=function(){L.removeAttribute("contentEditable");L.style.cursor="pointer";F.title=L.innerHTML;y()};mxEvent.consume(b)}};mxEvent.addListener(L,"click",J);mxEvent.addListener(E,"dblclick",J);u.appendChild(E);mxEvent.addListener(E,"dragstart",function(a){null==b&&null!=g&&(H.style.visibility="hidden",L.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",g.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);H.style.visibility="";L.style.visibility=""},0)});mxEvent.addListener(E,"dragend",function(a){"hidden"==H.style.visibility&&(H.style.visibility="",L.style.visibility="");A=null;mxUtils.setOpacity(E,100);mxUtils.setPrefixedStyle(E.style,"transform",null)})}else B||(B=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=!1;try{if(a.spinner.stop(),K=mxUtils.parseXml(b),"mxlibrary"==K.documentElement.nodeName){t=JSON.parse(mxUtils.getTextContent(K.documentElement));
if(null!=t&&0<t.length)for(var I=0;I<t.length;I++)null!=t[I].xml?m(null,null,0,0,0,0,t[I]):m(t[I].data,null,0,0,t[I].w,t[I].h,null,"fixed",t[I].title);p=!0}else if("mxfile"==K.documentElement.nodeName){for(var P=K.documentElement.getElementsByTagName("diagram"),I=0;I<P.length;I++){var t=mxUtils.getTextContent(P[I]),J=a.stringToCells(Graph.decompress(t)),Q=a.editor.graph.getBoundingBoxFromGeometry(J);m(null,null,0,0,0,0,{xml:t,w:Q.width,h:Q.height})}p=!0}}catch(R){}p||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(R){}return null}
function n(a){a.dataTransfer.dropEffect=null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function t(b){b.stopPropagation();b.preventDefault();B=!1;y=l(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,G(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=
function n(a){a.dataTransfer.dropEffect=null!=A?"move":"copy";a.stopPropagation();a.preventDefault()}function t(b){b.stopPropagation();b.preventDefault();B=!1;y=l(b);if(null!=A)null!=y&&y<u.children.length?(f.splice(y>A?y-1:y,0,f.splice(A,1)[0]),u.insertBefore(u.children[A],u.children[y])):(f.push(f.splice(A,1)[0]),u.appendChild(u.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){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 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 p=document.createElement("input");p.setAttribute("value",c);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width="500px";null==e||e.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==e||e.isRenamable())p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};k.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 q=document.createElement("div");q.style.position="absolute";q.style.width="640px";q.style.top="260px";q.style.textAlign="center";q.style.fontSize="22px";q.style.color="#a0c3ff";
mxUtils.write(q,mxResources.get("dragImagesHere"));b.appendChild(q);var x={},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 A=new mxUrlConverter,B=!1;if(null!=d)for(c=0;c<d.length;c++)k=d[c],m(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(u,"dragleave",function(a){q.style.cursor=
mxUtils.write(q,mxResources.get("dragImagesHere"));b.appendChild(q);var x={},A=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 z=new mxUrlConverter,B=!1;if(null!=d)for(c=0;c<d.length;c++)k=d[c],m(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(u,"dragleave",function(a){q.style.cursor=
"";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==q){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var G=function(b){return function(c,f,d,k,p,e,g,v,q){null!=q&&(/(\.vsdx)($|\?)/i.test(q.name)||/(\.vssx)($|\?)/i.test(q.name))?a.importVisio(q,mxUtils.bind(this,function(c){a.spinner.stop();m(c,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," "))})):null!=q&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,q.name)?
a.parseFile(q,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(m(c.responseText,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(m(c,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",n);mxEvent.addListener(u,"drop",t);mxEvent.addListener(q,"dragover",n);mxEvent.addListener(q,
"drop",t);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);k=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,
@ -8247,22 +8247,22 @@ TemplatesDialog.prototype.init=function(a,c,b,d,e,g,l,m,n,t){function f(){null!=
k+".svg";return!0}function p(a){function b(a){V.removeChild(f);G.removeChild(c);V.scrollTop=k}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 f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var d=document.createElement("img");d.src=a;f.appendChild(d);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var k=V.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);V.appendChild(f);V.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function u(a,b,c){if(null!=F){for(var f=F.className.split(" "),d=0;d<f.length;d++)if(-1<f[d].indexOf("Active")){f.splice(d,1);break}F.className=f.join(" ")}null!=a?(F=a,F.className+=" "+b,J=c,Z.className="geTempDlgCreateBtn"):(J=F=null,Z.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
function q(b){if(null!=J){var f=J;J=null;Z.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";f.isExternal?(1==b?t(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 x(a){a=a?"":"none";for(var b=G.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display=
a}function z(a,b,c){function f(){Z.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));x(!b)}W.innerHTML="";u();L=a;var d=null;if(c){d=document.createElement("table");d.className="geTempDlgDiagramsListGrid";var k=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=
mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));k.appendChild(e);d.appendChild(k);W.appendChild(d)}for(k=0;k<a.length;k++){a[k].isExternal=!b;var g=a[k].url,e=mxUtils.htmlEntities(a[k].title),v=a[k].tooltip||a[k].title,l=a[k].imgUrl,A=mxUtils.htmlEntities(a[k].changedBy||""),m=mxUtils.htmlEntities(a[k].lastModifiedOn||
a}function A(a,b,c){function f(){Z.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));x(!b)}W.innerHTML="";u();L=a;var d=null;if(c){d=document.createElement("table");d.className="geTempDlgDiagramsListGrid";var k=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=
mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));k.appendChild(e);d.appendChild(k);W.appendChild(d)}for(k=0;k<a.length;k++){a[k].isExternal=!b;var g=a[k].url,e=mxUtils.htmlEntities(a[k].title),v=a[k].tooltip||a[k].title,l=a[k].imgUrl,z=mxUtils.htmlEntities(a[k].changedBy||""),m=mxUtils.htmlEntities(a[k].lastModifiedOn||
"");l||(l=TEMPLATE_PATH+"/"+g.substring(0,g.length-4)+".png");g=c?50:15;null!=e&&e.length>g&&(e=e.substring(0,g)+"&hellip;");if(c){var B=document.createElement("tr"),l=document.createElement("td"),n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramListPreviewBtn";n.setAttribute("title",mxResources.get("preview"));l.appendChild(n);v=document.createElement("span");v.className="geTempDlgDiagramTitle";v.innerHTML=e;l.appendChild(v);B.appendChild(l);l=document.createElement("td");
l.innerHTML=A;B.appendChild(l);l=document.createElement("td");l.innerHTML=m;B.appendChild(l);d.appendChild(B);null==F&&(f(),u(B,"geTempDlgDiagramsListGridActive",a[k]));(function(a,b){mxEvent.addListener(B,"click",function(){F!=b&&(f(),u(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(B,"dblclick",q);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],B)}else{var y=document.createElement("div");y.className="geTempDlgDiagramTile";y.setAttribute("title",v);null==F&&(f(),u(y,"geTempDlgDiagramTileActive",
a[k]));A=document.createElement("div");A.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,A);z.src=l;A.appendChild(z);y.appendChild(A);A=document.createElement("div");A.className="geTempDlgDiagramTileLbl";A.innerHTML=null!=e?e:"";y.appendChild(A);
l.innerHTML=z;B.appendChild(l);l=document.createElement("td");l.innerHTML=m;B.appendChild(l);d.appendChild(B);null==F&&(f(),u(B,"geTempDlgDiagramsListGridActive",a[k]));(function(a,b){mxEvent.addListener(B,"click",function(){F!=b&&(f(),u(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(B,"dblclick",q);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],B)}else{var y=document.createElement("div");y.className="geTempDlgDiagramTile";y.setAttribute("title",v);null==F&&(f(),u(y,"geTempDlgDiagramTileActive",
a[k]));z=document.createElement("div");z.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,z);A.src=l;z.appendChild(A);y.appendChild(z);z=document.createElement("div");z.className="geTempDlgDiagramTileLbl";z.innerHTML=null!=e?e:"";y.appendChild(z);
n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramPreviewBtn";n.setAttribute("title",mxResources.get("preview"));y.appendChild(n);(function(a,b){mxEvent.addListener(y,"click",function(){F!=b&&(f(),u(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(y,"dblclick",q);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],y);W.appendChild(y)}}}function y(a,b){Y.innerHTML="";u();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var d=a[f];d.isCategory=!0;
var k=document.createElement("div"),p=mxResources.get(d.title);null==p&&(p=d.title.substring(0,1).toUpperCase()+d.title.substring(1));k.className="geTempDlgNewDiagramCatItem";k.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"&hellip;");null==F&&(Z.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),x(),u(k,"geTempDlgNewDiagramCatItemActive",d));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var g=document.createElement("img");
g.src=NEW_DIAGRAM_CATS_PATH+"/"+d.img;e.appendChild(g);k.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;k.appendChild(e);Y.appendChild(k);(function(a,b){mxEvent.addListener(k,"click",function(){F!=b&&(Z.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),x(),u(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(k,"dblclick",q)})(d,k)}T.style.display=5>a.length?"none":""}function C(a){var b=G.querySelector(".geTemplatesList"),
c;for(c in a){var f=document.createElement("div"),d=mxResources.get(c),k=a[c];null==d&&(d=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";f.setAttribute("title",d+" ("+k.length+")");d=mxUtils.htmlEntities(d);15<d.length&&(d=d.substring(0,15)+"&hellip;");f.innerHTML=d+" ("+k.length+")";b.appendChild(f);(function(b,c,d){mxEvent.addListener(f,"click",function(){H!=d&&(null!=H?(H.style.fontWeight="normal",H.style.textDecoration="none"):(ea.style.display="none",ha.style.minHeight=
"100%"),H=d,H.style.fontWeight="bold",H.style.textDecoration="underline",V.scrollTop=0,v&&(K=!0),X.innerHTML=c,S.style.display="none",z(a[b],!0))})})(c,d,f)}}function A(a){l&&(V.scrollTop=0,W.innerHTML="",M.spin(W),K=!1,v=!0,X.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),P=null,l(aa,a?null:g))}function B(a){f();V.scrollTop=0;W.innerHTML="";M.spin(W);K=!1;v=!0;N=null;X.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+' "'+
"100%"),H=d,H.style.fontWeight="bold",H.style.textDecoration="underline",V.scrollTop=0,v&&(K=!0),X.innerHTML=c,S.style.display="none",A(a[b],!0))})})(c,d,f)}}function z(a){l&&(V.scrollTop=0,W.innerHTML="",M.spin(W),K=!1,v=!0,X.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),P=null,l(aa,a?null:g))}function B(a){f();V.scrollTop=0;W.innerHTML="";M.spin(W);K=!1;v=!0;N=null;X.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+' "'+
mxUtils.htmlEntities(a)+'"';m(a,aa,D?null:g);P=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";e=null!=e?e:NEW_DIAGRAM_CATS_PATH+"/index.xml";var G=this.container,v=!1,K=!1,H=null,F=null,J=null,E=!1,D=!0,I=!1,L=[],P,T=G.querySelector(".geTempDlgShowAllBtn"),W=G.querySelector(".geTempDlgDiagramsTiles"),X=G.querySelector(".geTempDlgDiagramsListTitle"),S=G.querySelector(".geTempDlgDiagramsListBtns"),V=G.querySelector(".geTempDlgContent"),ha=G.querySelector(".geTempDlgDiagramsList"),ea=G.querySelector(".geTempDlgNewDiagramCat"),
Y=G.querySelector(".geTempDlgNewDiagramCatList"),Z=G.querySelector(".geTempDlgCreateBtn"),M=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(){f();ea.style.display="";ha.style.minHeight="calc(100% - 280px)";A(D)});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){k(this,"geTempDlgAllDiagramsBtnImg",
"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(D=!0,null==P?A(D):B(P))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){k(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(D=!1,null==P?A(D):B(P))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){k(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
"tiles",!1)&&(I=!0,z(L,!1,I))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){k(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(I=!1,z(L,!1,I))});mxEvent.addListener(T,"click",function(){E?(ea.style.height="280px",Y.style.height="190px",T.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),y(R)):(ea.style.height="440px",Y.style.height="355px",T.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
Y=G.querySelector(".geTempDlgNewDiagramCatList"),Z=G.querySelector(".geTempDlgCreateBtn"),M=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(){f();ea.style.display="";ha.style.minHeight="calc(100% - 280px)";z(D)});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){k(this,"geTempDlgAllDiagramsBtnImg",
"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(D=!0,null==P?z(D):B(P))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){k(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(D=!1,null==P?z(D):B(P))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){k(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
"tiles",!1)&&(I=!0,A(L,!1,I))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){k(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(I=!1,A(L,!1,I))});mxEvent.addListener(T,"click",function(){E?(ea.style.height="280px",Y.style.height="190px",T.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),y(R)):(ea.style.height="440px",Y.style.height="355px",T.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
null,"- Show less")),y(R,!0));E=!E});var O=!1,ga=!1,Q={},R=[],ca=1;mxUtils.get(d,function(a){if(!O){O=!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=Q[b];null==c&&(ca++,c=[],Q[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=a.nextSibling}C(Q)}});mxUtils.get(e,
function(a){if(!ga){ga=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&R.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),title:a.getAttribute("title")}),a=a.nextSibling;y(R)}});var aa=function(a,b){S.style.display="";M.stop();v=!1;K?K=!1:b?W.innerHTML=b:0==a.length?W.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):z(a,!1,I)};A(D);var N=null;m&&mxEvent.addListener(G.querySelector(".geTempDlgSearchBox"),
function(a){if(!ga){ga=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&R.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),title:a.getAttribute("title")}),a=a.nextSibling;y(R)}});var aa=function(a,b){S.style.display="";M.stop();v=!1;K?K=!1:b?W.innerHTML=b:0==a.length?W.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):A(a,!1,I)};z(D);var N=null;m&&mxEvent.addListener(G.querySelector(".geTempDlgSearchBox"),
"keyup",function(a){var b=this;null!=N&&clearTimeout(N);13==a.keyCode?B(b.value):N=setTimeout(function(){B(b.value)},500)});mxEvent.addListener(Z,"click",q);mxEvent.addListener(G.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){q(!0)});mxEvent.addListener(G.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})};
var BtnDialog=function(a,c,b,d){var e=document.createElement("div");e.style.textAlign="center";var g=document.createElement("p");g.style.fontSize="16pt";g.style.padding="0px";g.style.margin="0px";g.style.color="gray";mxUtils.write(g,mxResources.get("done"));var l="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight="10px";c==a.drive?(l=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?
(l=mxResources.get("dropbox"),m.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(l=mxResources.get("oneDrive"),m.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(l=mxResources.get("github"),m.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.trello&&(l=mxResources.get("trello"),m.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(m,b.firstChild);
@ -8319,8 +8319,8 @@ d=0;d<a.length;d++)f[d]=String.fromCharCode(a[d]);f=f.join("")}k=null!=k?k:"data
"g"),"")},c=this.fontCss.split("url("),f=0,d={},k=mxUtils.bind(this,function(){if(0==f){for(var k=[c[0]],p=1;p<c.length;p++){var e=c[p].indexOf(")");k.push('url("');k.push(d[b(c[p].substring(0,e))]);k.push('"'+c[p].substring(e))}this.resolvedFontCss=k.join("");a()}});if(0<c.length)for(var p=1;p<c.length;p++){var e=c[p].indexOf(")"),g=null,q=c[p].indexOf("format(",e);0<q&&(g=b(c[p].substring(q+7,c[p].indexOf(")",q))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;f++;var b="application/x-font-ttf";
if("svg"==g||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==g||"embedded-opentype"==g||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==g||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==g||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==g||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==g||/(\.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){d[a]=b;f--;k()}),mxUtils.bind(this,function(a){f--;k()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[p].substring(0,e)),g)}}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,d,k,p,e,g,q,u,l,A,m){k=null!=k?k:!0;l=null!=l?l:this.graph;A=null!=A?A:0;var v=g?null:l.background;v==mxConstants.NONE&&(v=null);null==v&&(v=f);null==v&&0==g&&(v=this.graph.defaultPageBackgroundColor);this.convertImages(l.getSvg(v,null,null,m,null,null!=p?p:!0,null,null,null,q),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var p=
document.createElement("canvas"),g=parseInt(c.getAttribute("width")),q=parseInt(c.getAttribute("height"));e=null!=e?e:1;null!=b&&(e=k?Math.min(1,Math.min(3*b/(4*q),b/g)):b/g);g=Math.ceil(e*g)+2*A;q=Math.ceil(e*q)+2*A;p.setAttribute("width",g);p.setAttribute("height",q);var u=p.getContext("2d");null!=v&&(u.beginPath(),u.rect(0,0,g,q),u.fillStyle=v,u.fill());u.scale(e,e);mxClient.IS_SF?window.setTimeout(function(){u.drawImage(f,A/e,A/e);a(p)},0):(u.drawImage(f,A/e,A/e),a(p))}catch(Q){null!=d&&d(Q)}});
function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,b,c,f,d,k,p,e,g,q,u,l,z,m){k=null!=k?k:!0;l=null!=l?l:this.graph;z=null!=z?z:0;var v=g?null:l.background;v==mxConstants.NONE&&(v=null);null==v&&(v=f);null==v&&0==g&&(v=this.graph.defaultPageBackgroundColor);this.convertImages(l.getSvg(v,null,null,m,null,null!=p?p:!0,null,null,null,q),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var p=
document.createElement("canvas"),g=parseInt(c.getAttribute("width")),q=parseInt(c.getAttribute("height"));e=null!=e?e:1;null!=b&&(e=k?Math.min(1,Math.min(3*b/(4*q),b/g)):b/g);g=Math.ceil(e*g)+2*z;q=Math.ceil(e*q)+2*z;p.setAttribute("width",g);p.setAttribute("height",q);var u=p.getContext("2d");null!=v&&(u.beginPath(),u.rect(0,0,g,q),u.fillStyle=v,u.fill());u.scale(e,e);mxClient.IS_SF?window.setTimeout(function(){u.drawImage(f,z/e,z/e);a(p)},0):(u.drawImage(f,z/e,z/e),a(p))}catch(Q){null!=d&&d(Q)}});
f.onerror=function(a){null!=d&&d(a)};try{q&&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(l,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(p)}catch(Z){null!=d&&d(Z)}}),c,u)};Editor.prototype.writeGraphModelToPng=function(a,b,c,f,
d){function k(a,b){var c=g;g+=b;return a.substring(c,g)}function p(a){a=k(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 g=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(k(a,4),"IHDR"!=k(a,4))null!=d&&d();else{k(a,17);d=a.substring(0,g);do{var q=p(a);
if("IDAT"==k(a,4)){d=a.substring(0,g-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);d+=e(c.length)+b+c+e(f^4294967295);d+=a.substring(g-8,a.length);break}d+=a.substring(g-8,g-4+q);k(a,q);k(a,4)}while(q);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";
@ -8356,19 +8356,19 @@ this.format.createSelectionState();"image"==a.style.shape||a.containsLabel||this
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 f(a,b,c,f){l.getModel().beginUpdate();try{var d=[],k=[];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&&(l.setCellStyles(c.countProperty,p.length,l.getSelectionCells()),d.push(c.countProperty),k.push(p.length))}l.setCellStyles(a,b,l.getSelectionCells());d.push(a);k.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var g=c.dependentPropsDefVal[a],
q=c.dependentPropsVals[a];if(q.length>b)q=q.slice(0,b);else for(var A=q.length;A<b;A++)q.push(g);q=q.join(",");l.setCellStyles(c.dependentProps[a],q,l.getSelectionCells());d.push(c.dependentProps[a]);k.push(q)}if("function"==typeof c.onChange)c.onChange(l,b);u.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",k,"cells",l.getSelectionCells()))}finally{l.getModel().endUpdate()}}function d(b,c,f){var d=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(b,!0);c.style.position="absolute";
q=c.dependentPropsVals[a];if(q.length>b)q=q.slice(0,b);else for(var z=q.length;z<b;z++)q.push(g);q=q.join(",");l.setCellStyles(c.dependentProps[a],q,l.getSelectionCells());d.push(c.dependentProps[a]);k.push(q)}if("function"==typeof c.onChange)c.onChange(l,b);u.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",k,"cells",l.getSelectionCells()))}finally{l.getModel().endUpdate()}}function d(b,c,f){var d=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(b,!0);c.style.position="absolute";
c.style.left=k.x-d.x+"px";c.style.top=k.y-d.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(f?4:0)+"px";c.style.zIndex=5}function k(a,b,c){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=b&&"none"!=b?b:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(u,function(k){this.editorUi.pickColor(b,function(b){d.style.background="none"==b?"url('"+Dialog.prototype.noColorImage+
"')":b;f(a,b,c)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(d);return btn}function p(a,b,c,d,k,p,e){null!=b&&(b=b.split(","),A.push({name:a,values:b,type:c,defVal:d,countProperty:k,parentRow:p,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(u,function(b){for(var g=p,u=0;null!=g.nextSibling;)if(g.nextSibling.getAttribute("data-pName")==a)g=g.nextSibling,u++;else break;var l={type:c,parentRow:p,index:u,isDeletable:!0,
defVal:d,countProperty:k},u=q(a,"",l,0==u%2,e);f(a,d,l);g.parentNode.insertBefore(u,g.nextSibling);mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function e(a,b,c,f,d,k,p){if(0<d){var e=Array(d);b=null!=b?b.split(","):[];for(var g=0;g<d;g++)e[g]=null!=b[g]?b[g]:null!=f?f:"";A.push({name:a,values:e,type:c,defVal:f,parentRow:k,flipBkg:p,size:d})}return document.createElement("div")}function g(a,b,c){var d=document.createElement("input");d.type=
"checkbox";d.checked="1"==b;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",c)});return d}function q(b,c,q,l,A){var x=q.dispName,m=q.type,v=document.createElement("tr");v.className="gePropRow"+(A?"Dark":"")+(l?"Alt":"")+" gePropNonHeaderRow";v.setAttribute("data-pName",b);v.setAttribute("data-pValue",c);l=!1;null!=q.index&&(v.setAttribute("data-index",q.index),x=(null!=x?x:"")+"["+q.index+"]",l=!0);var B=document.createElement("td");B.className="gePropRowCell";B.innerHTML=mxUtils.htmlEntities(mxResources.get(x,
null,x));l&&(B.style.textAlign="right");v.appendChild(B);B=document.createElement("td");B.className="gePropRowCell";if("color"==m)B.appendChild(k(b,c,q));else if("bool"==m||"boolean"==m)B.appendChild(g(b,c,q));else if("enum"==m){var n=q.enumList;for(A=0;A<n.length;A++)if(x=n[A],x.val==c){B.innerHTML=mxUtils.htmlEntities(mxResources.get(x.dispName,null,x.dispName));break}mxEvent.addListener(B,"click",mxUtils.bind(u,function(){var k=document.createElement("select");d(B,k);for(var p=0;p<n.length;p++){var e=
n[p],g=document.createElement("option");g.value=mxUtils.htmlEntities(e.val);g.innerHTML=mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));k.appendChild(g)}k.value=c;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);f(b,a,q)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==m?B.appendChild(p(b,c,q.subType,q.subDefVal,q.countProperty,v,A)):"staticArr"==m?B.appendChild(e(b,c,q.subType,q.subDefVal,q.size,
v,A)):(B.innerHTML=c,mxEvent.addListener(B,"click",mxUtils.bind(u,function(){function k(){var a=p.value,a=0==a.length&&"string"!=m?0:a;q.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",m="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"==m?parseInt(a):a)+"");f(b,a,q)}var p=document.createElement("input");d(B,p,!0);p.value=c;p.className="gePropEditor";"int"!=m&&"float"!=m||q.allowAuto||(p.type="number",p.step=
"int"==m?"1":"any",null!=q.min&&(p.min=parseFloat(q.min)),null!=q.max&&(p.max=parseFloat(q.max)));a.appendChild(p);mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&k()});p.focus();mxEvent.addListener(p,"blur",function(){k()})})));q.isDeletable&&(A=mxUtils.button("-",mxUtils.bind(u,function(a){f(b,"",q,q.index);mxEvent.consume(a)})),A.style.height="16px",A.style.width="25px",A.style["float"]="right",A.className="geColorBtn",B.appendChild(A));v.appendChild(B);return v}var u=this,l=this.editorUi.editor.graph,
A=[];a.style.position="relative";a.style.padding="0";var m=document.createElement("table");m.style.whiteSpace="nowrap";m.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";var v=document.createElement("th");v.className="gePropHeaderCell";var B=document.createElement("img");B.src=Sidebar.prototype.expandedImage;v.appendChild(B);mxUtils.write(v,mxResources.get("property"));x.style.cursor="pointer";var n=function(){var b=m.querySelectorAll(".gePropNonHeaderRow"),c;if(u.editorUi.propertiesCollapsed){B.src=
"')":b;f(a,b,c)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(d);return btn}function p(a,b,c,d,k,p,e){null!=b&&(b=b.split(","),z.push({name:a,values:b,type:c,defVal:d,countProperty:k,parentRow:p,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(u,function(b){for(var g=p,u=0;null!=g.nextSibling;)if(g.nextSibling.getAttribute("data-pName")==a)g=g.nextSibling,u++;else break;var l={type:c,parentRow:p,index:u,isDeletable:!0,
defVal:d,countProperty:k},u=q(a,"",l,0==u%2,e);f(a,d,l);g.parentNode.insertBefore(u,g.nextSibling);mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function e(a,b,c,f,d,k,p){if(0<d){var e=Array(d);b=null!=b?b.split(","):[];for(var g=0;g<d;g++)e[g]=null!=b[g]?b[g]:null!=f?f:"";z.push({name:a,values:e,type:c,defVal:f,parentRow:k,flipBkg:p,size:d})}return document.createElement("div")}function g(a,b,c){var d=document.createElement("input");d.type=
"checkbox";d.checked="1"==b;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",c)});return d}function q(b,c,q,l,z){var x=q.dispName,m=q.type,v=document.createElement("tr");v.className="gePropRow"+(z?"Dark":"")+(l?"Alt":"")+" gePropNonHeaderRow";v.setAttribute("data-pName",b);v.setAttribute("data-pValue",c);l=!1;null!=q.index&&(v.setAttribute("data-index",q.index),x=(null!=x?x:"")+"["+q.index+"]",l=!0);var B=document.createElement("td");B.className="gePropRowCell";B.innerHTML=mxUtils.htmlEntities(mxResources.get(x,
null,x));l&&(B.style.textAlign="right");v.appendChild(B);B=document.createElement("td");B.className="gePropRowCell";if("color"==m)B.appendChild(k(b,c,q));else if("bool"==m||"boolean"==m)B.appendChild(g(b,c,q));else if("enum"==m){var n=q.enumList;for(z=0;z<n.length;z++)if(x=n[z],x.val==c){B.innerHTML=mxUtils.htmlEntities(mxResources.get(x.dispName,null,x.dispName));break}mxEvent.addListener(B,"click",mxUtils.bind(u,function(){var k=document.createElement("select");d(B,k);for(var p=0;p<n.length;p++){var e=
n[p],g=document.createElement("option");g.value=mxUtils.htmlEntities(e.val);g.innerHTML=mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));k.appendChild(g)}k.value=c;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);f(b,a,q)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==m?B.appendChild(p(b,c,q.subType,q.subDefVal,q.countProperty,v,z)):"staticArr"==m?B.appendChild(e(b,c,q.subType,q.subDefVal,q.size,
v,z)):(B.innerHTML=c,mxEvent.addListener(B,"click",mxUtils.bind(u,function(){function k(){var a=p.value,a=0==a.length&&"string"!=m?0:a;q.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",m="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"==m?parseInt(a):a)+"");f(b,a,q)}var p=document.createElement("input");d(B,p,!0);p.value=c;p.className="gePropEditor";"int"!=m&&"float"!=m||q.allowAuto||(p.type="number",p.step=
"int"==m?"1":"any",null!=q.min&&(p.min=parseFloat(q.min)),null!=q.max&&(p.max=parseFloat(q.max)));a.appendChild(p);mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&k()});p.focus();mxEvent.addListener(p,"blur",function(){k()})})));q.isDeletable&&(z=mxUtils.button("-",mxUtils.bind(u,function(a){f(b,"",q,q.index);mxEvent.consume(a)})),z.style.height="16px",z.style.width="25px",z.style["float"]="right",z.className="geColorBtn",B.appendChild(z));v.appendChild(B);return v}var u=this,l=this.editorUi.editor.graph,
z=[];a.style.position="relative";a.style.padding="0";var m=document.createElement("table");m.style.whiteSpace="nowrap";m.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";var v=document.createElement("th");v.className="gePropHeaderCell";var B=document.createElement("img");B.src=Sidebar.prototype.expandedImage;v.appendChild(B);mxUtils.write(v,mxResources.get("property"));x.style.cursor="pointer";var n=function(){var b=m.querySelectorAll(".gePropNonHeaderRow"),c;if(u.editorUi.propertiesCollapsed){B.src=
Sidebar.prototype.collapsedImage;c="none";for(var f=a.childNodes.length-1;0<=f;f--)try{var d=a.childNodes[f],k=d.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(d)}catch(ja){}}else B.src=Sidebar.prototype.expandedImage,c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(x,"click",function(){u.editorUi.propertiesCollapsed=!u.editorUi.propertiesCollapsed;n()});x.appendChild(v);v=document.createElement("th");v.className="gePropHeaderCell";v.innerHTML=mxResources.get("value");
x.appendChild(v);m.appendChild(x);var y=!1,z=!1,C;for(C in b)if(x=b[C],"function"!=typeof x.isVisible||x.isVisible(c)){var t=null!=c.style[C]?mxUtils.htmlEntities(c.style[C]+""):x.defVal;if("separator"==x.type)z=!z;else{if("staticArr"==x.type)x.size=parseInt(c.style[x.sizeProperty]||b[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var G=x.dependentProps,K=[],H=[],v=0;v<G.length;v++){var aa=c.style[G[v]];H.push(b[G[v]].subDefVal);K.push(null!=aa?aa.split(","):[])}x.dependentPropsDefVal=
H;x.dependentPropsVals=K}m.appendChild(q(C,t,x,y,z));y=!y}}for(v=0;v<A.length;v++)for(x=A[v],b=x.parentRow,c=0;c<x.values.length;c++)C=q(x.name,x.values[c],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:c,defVal:x.defVal,countProperty:x.countProperty,size:x.size},0==c%2,x.flipBkg),b.parentNode.insertBefore(C,b.nextSibling),b=C;a.appendChild(m);n();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();
x.appendChild(v);m.appendChild(x);var y=!1,A=!1,C;for(C in b)if(x=b[C],"function"!=typeof x.isVisible||x.isVisible(c)){var t=null!=c.style[C]?mxUtils.htmlEntities(c.style[C]+""):x.defVal;if("separator"==x.type)A=!A;else{if("staticArr"==x.type)x.size=parseInt(c.style[x.sizeProperty]||b[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var G=x.dependentProps,K=[],H=[],v=0;v<G.length;v++){var aa=c.style[G[v]];H.push(b[G[v]].subDefVal);K.push(null!=aa?aa.split(","):[])}x.dependentPropsDefVal=
H;x.dependentPropsVals=K}m.appendChild(q(C,t,x,y,A));y=!y}}for(v=0;v<z.length;v++)for(x=z[v],b=x.parentRow,c=0;c<x.values.length;c++)C=q(x.name,x.values[c],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:c,defVal:x.defVal,countProperty:x.countProperty,size:x.size},0==c%2,x.flipBkg),b.parentNode.insertBefore(C,b.nextSibling),b=C;a.appendChild(m);n();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 d=f.getModel().getStyle(c[b]),p=0;p<k.length;p++)d=mxUtils.removeStylename(d,k[p]);var e=f.getModel().isVertex(c[b])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,
null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(e,
mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null))));f.getModel().setStyle(c[b],d)}}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&&
@ -8387,7 +8387,7 @@ this.graph.getCellStyle(a);if(null!=b){if("rack"==b.childLayout){var c=new mxSta
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 f.apply(this,arguments)}};var u=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;if(null!=this.themes&&"darkTheme"==this.defaultThemeName){a=this.stylesheet;this.stylesheet=new mxStylesheet;var b=this.themes["default-style2"];(new mxCodec(b.ownerDocument)).decode(b,this.getStylesheet());this.refresh()}b=u.apply(this,arguments);null!=
a&&(this.stylesheet=a,this.refresh());return b};var q=Graph.prototype.isCssTransformsSupported;Graph.prototype.isCssTransformsSupported=function(){return q.apply(this,arguments)&&!mxClient.IS_SF};var x=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var b=x.apply(this,arguments);if(null==b){if(null==this.globalUrlVars&&null!=urlParams.vars)try{this.globalUrlVars=JSON.parse(decodeURIComponent(urlParams.vars))}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+
H)}null!=this.globalUrlVars&&(b=this.globalUrlVars[a])}return b};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&&
H)}null!=this.globalUrlVars&&(b=this.globalUrlVars[a])}return b};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||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 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++)if(null!=a.actions[b].open)if(this.isCustomLink(a.actions[b].open)){if(!this.customLinkClicked(a.actions[b].open))return}else this.openLink(a.actions[b].open);this.model.beginUpdate();try{for(b=0;b<a.actions.length;b++)this.handleLinkAction(a.actions[b])}finally{this.model.endUpdate()}}};
Graph.prototype.handleLinkAction=function(a){var b=[];null!=a.select&&this.isEnabled()&&(b=this.getCellsForAction(a.select),this.setSelectionCells(b));null!=a.highlight&&(b=this.getCellsForAction(a.highlight),this.highlightCells(b,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle,!0));null!=a.show&&this.setCellsVisible(this.getCellsForAction(a.show,!0),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide,!0),
@ -8409,30 +8409,30 @@ mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButt
[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 C=mxMarker.createMarker;mxMarker.createMarker=
function(a,b,c,f,d,k,p,e,g,q){if(null!=c&&null==mxMarker.markers[c]){var u=this.getPackageForType(c);null!=u&&mxStencilRegistry.getStencil(u)}return C.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){x.value=Math.max(1,Math.min(e,Math.max(parseInt(x.value),parseInt(A.value))));A.value=Math.max(1,Math.min(e,Math.min(parseInt(x.value),parseInt(A.value))))}function f(b){function c(b,c,d){var k=b.getGraphBounds(),p=0,e=0,g=da.get(),q=1/b.pageScale,u=y.checked;if(u)var q=
function(a,b,c,f,d,k,p,e,g,q){if(null!=c&&null==mxMarker.markers[c]){var u=this.getPackageForType(c);null!=u&&mxStencilRegistry.getStencil(u)}return C.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){x.value=Math.max(1,Math.min(e,Math.max(parseInt(x.value),parseInt(z.value))));z.value=Math.max(1,Math.min(e,Math.min(parseInt(x.value),parseInt(z.value))))}function f(b){function c(b,c,d){var k=b.getGraphBounds(),p=0,e=0,g=da.get(),q=1/b.pageScale,u=y.checked;if(u)var q=
parseInt(U.value),l=parseInt(ba.value),q=Math.min(g.height*l/(k.height/b.view.scale),g.width*q/(k.width/b.view.scale));else q=parseInt(n.value)/(100*b.pageScale),isNaN(q)&&(f=1/b.pageScale,n.value="100 %");g=mxRectangle.fromRectangle(g);g.width=Math.ceil(g.width*f);g.height=Math.ceil(g.height*f);q*=f;!u&&b.pageVisible?(k=b.getPageLayout(),p-=k.x*g.width,e-=k.y*g.height):u=!0;if(null==c){c=PrintDialog.createPrintPreview(b,q,g,0,p,e,u);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&
(c.title=b.getTitle());var A=c.writeHead;c.writeHead=function(b){A.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 x=c.renderPage;c.renderPage=function(a,b,c,f,d,k){var p=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=x.apply(this,arguments);mxClient.NO_FO=p;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||
!0:e.className="geDisableMathJax";return e}}c.open(null,null,d,!0)}else{g=b.background;if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=g;c.autoOrigin=u;c.appendGraph(b,q,p,e,d,!0)}return c}var f=parseInt(fa.value)/100;isNaN(f)&&(f=1,fa.value="100 %");var f=.75*f,k=A.value,p=x.value,e=!u.checked,q=null;e&&(e=k==g&&p==g);if(!e&&null!=a.pages&&a.pages.length){var l=0,e=a.pages.length-1;u.checked||(l=parseInt(k)-1,e=parseInt(p)-1);for(var m=l;m<=e;m++){var B=a.pages[m],k=B==a.currentPage?
d:null;if(null==k){var k=a.createTemporaryGraph(d.getStylesheet()),p=!0,l=!1,v=null,z=null;null==B.viewState&&null==B.root&&a.updatePageRoot(B);null!=B.viewState&&(p=B.viewState.pageVisible,l=B.viewState.mathEnabled,v=B.viewState.background,z=B.viewState.backgroundImage);k.background=v;k.backgroundImage=null!=z?new mxImage(z.src,z.width,z.height):null;k.pageVisible=p;k.mathEnabled=l;var C=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?B.getName():"pagenumber"==a?m+1:C.apply(this,
(c.title=b.getTitle());var z=c.writeHead;c.writeHead=function(b){z.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 x=c.renderPage;c.renderPage=function(a,b,c,f,d,k){var p=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=x.apply(this,arguments);mxClient.NO_FO=p;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||
!0:e.className="geDisableMathJax";return e}}c.open(null,null,d,!0)}else{g=b.background;if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=g;c.autoOrigin=u;c.appendGraph(b,q,p,e,d,!0)}return c}var f=parseInt(fa.value)/100;isNaN(f)&&(f=1,fa.value="100 %");var f=.75*f,k=z.value,p=x.value,e=!u.checked,q=null;e&&(e=k==g&&p==g);if(!e&&null!=a.pages&&a.pages.length){var l=0,e=a.pages.length-1;u.checked||(l=parseInt(k)-1,e=parseInt(p)-1);for(var m=l;m<=e;m++){var B=a.pages[m],k=B==a.currentPage?
d:null;if(null==k){var k=a.createTemporaryGraph(d.getStylesheet()),p=!0,l=!1,v=null,A=null;null==B.viewState&&null==B.root&&a.updatePageRoot(B);null!=B.viewState&&(p=B.viewState.pageVisible,l=B.viewState.mathEnabled,v=B.viewState.background,A=B.viewState.backgroundImage);k.background=v;k.backgroundImage=null!=A?new mxImage(A.src,A.width,A.height):null;k.pageVisible=p;k.mathEnabled=l;var C=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?B.getName():"pagenumber"==a?m+1:C.apply(this,
arguments)};document.body.appendChild(k.container);a.updatePageRoot(B);k.model.setRoot(B.root)}q=c(k,q,m!=e);k!=d&&k.container.parentNode.removeChild(k.container)}}else q=c(d);null==q?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(q.mathEnabled&&(e=q.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>')),q.closeDocument(),!q.mathEnabled&&b&&PrintDialog.printPreview(q))}var d=a.editor.graph,k=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"));k.appendChild(p);var e=1,g=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);p=document.createElement("span");mxUtils.write(p,mxResources.get("printAllPages"));q.appendChild(p);mxUtils.br(q);var l=u.cloneNode(!0);u.setAttribute("checked","checked");l.setAttribute("value","range");q.appendChild(l);
p=document.createElement("span");mxUtils.write(p,mxResources.get("pages")+":");q.appendChild(p);var A=document.createElement("input");A.style.cssText="margin:0 8px 0 8px;";A.setAttribute("value","1");A.setAttribute("type","number");A.setAttribute("min","1");A.style.width="50px";q.appendChild(A);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));q.appendChild(p);var x=A.cloneNode(!0);q.appendChild(x);mxEvent.addListener(A,"focus",function(){l.checked=!0});mxEvent.addListener(x,
"focus",function(){l.checked=!0});mxEvent.addListener(A,"change",c);mxEvent.addListener(x,"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]){g=p+1;A.value=g;x.value=g;break}A.setAttribute("max",e);x.setAttribute("max",e);1<e&&k.appendChild(q);var m=document.createElement("div");m.style.marginBottom="10px";var B=document.createElement("input");B.style.marginRight="8px";B.setAttribute("value","adjust");B.setAttribute("type",
p=document.createElement("span");mxUtils.write(p,mxResources.get("pages")+":");q.appendChild(p);var z=document.createElement("input");z.style.cssText="margin:0 8px 0 8px;";z.setAttribute("value","1");z.setAttribute("type","number");z.setAttribute("min","1");z.style.width="50px";q.appendChild(z);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));q.appendChild(p);var x=z.cloneNode(!0);q.appendChild(x);mxEvent.addListener(z,"focus",function(){l.checked=!0});mxEvent.addListener(x,
"focus",function(){l.checked=!0});mxEvent.addListener(z,"change",c);mxEvent.addListener(x,"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]){g=p+1;z.value=g;x.value=g;break}z.setAttribute("max",e);x.setAttribute("max",e);1<e&&k.appendChild(q);var m=document.createElement("div");m.style.marginBottom="10px";var B=document.createElement("input");B.style.marginRight="8px";B.setAttribute("value","adjust");B.setAttribute("type",
"radio");B.setAttribute("name","printZoom");m.appendChild(B);p=document.createElement("span");mxUtils.write(p,mxResources.get("adjustTo"));m.appendChild(p);var n=document.createElement("input");n.style.cssText="margin:0 8px 0 8px;";n.setAttribute("value","100 %");n.style.width="50px";m.appendChild(n);mxEvent.addListener(n,"focus",function(){B.checked=!0});k.appendChild(m);var q=q.cloneNode(!1),y=B.cloneNode(!0);y.setAttribute("value","fit");B.setAttribute("checked","checked");p=document.createElement("div");
p.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";p.appendChild(y);q.appendChild(p);m=document.createElement("table");m.style.display="inline-block";var v=document.createElement("tbody"),z=document.createElement("tr"),C=z.cloneNode(!0),t=document.createElement("td"),G=t.cloneNode(!0),K=t.cloneNode(!0),ca=t.cloneNode(!0),aa=t.cloneNode(!0),N=t.cloneNode(!0);t.style.textAlign="right";ca.style.textAlign="right";mxUtils.write(t,mxResources.get("fitTo"));var U=document.createElement("input");
p.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";p.appendChild(y);q.appendChild(p);m=document.createElement("table");m.style.display="inline-block";var v=document.createElement("tbody"),A=document.createElement("tr"),C=A.cloneNode(!0),t=document.createElement("td"),G=t.cloneNode(!0),K=t.cloneNode(!0),ca=t.cloneNode(!0),aa=t.cloneNode(!0),N=t.cloneNode(!0);t.style.textAlign="right";ca.style.textAlign="right";mxUtils.write(t,mxResources.get("fitTo"));var U=document.createElement("input");
U.style.cssText="margin:0 8px 0 8px;";U.setAttribute("value","1");U.setAttribute("min","1");U.setAttribute("type","number");U.style.width="40px";G.appendChild(U);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));K.appendChild(p);mxUtils.write(ca,mxResources.get("fitToBy"));var ba=U.cloneNode(!0);aa.appendChild(ba);mxEvent.addListener(U,"focus",function(){y.checked=!0});mxEvent.addListener(ba,"focus",function(){y.checked=!0});p=document.createElement("span");mxUtils.write(p,
mxResources.get("fitToSheetsDown"));N.appendChild(p);z.appendChild(t);z.appendChild(G);z.appendChild(K);C.appendChild(ca);C.appendChild(aa);C.appendChild(N);v.appendChild(z);v.appendChild(C);m.appendChild(v);q.appendChild(m);k.appendChild(q);q=document.createElement("div");p=document.createElement("div");p.style.fontWeight="bold";p.style.marginBottom="12px";mxUtils.write(p,mxResources.get("paperSize"));q.appendChild(p);p=document.createElement("div");p.style.marginBottom="12px";var da=PageSetupDialog.addPageFormatPanel(p,
mxResources.get("fitToSheetsDown"));N.appendChild(p);A.appendChild(t);A.appendChild(G);A.appendChild(K);C.appendChild(ca);C.appendChild(aa);C.appendChild(N);v.appendChild(A);v.appendChild(C);m.appendChild(v);q.appendChild(m);k.appendChild(q);q=document.createElement("div");p=document.createElement("div");p.style.fontWeight="bold";p.style.marginBottom="12px";mxUtils.write(p,mxResources.get("paperSize"));q.appendChild(p);p=document.createElement("div");p.style.marginBottom="12px";var da=PageSetupDialog.addPageFormatPanel(p,
"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);q.appendChild(p);p=document.createElement("span");mxUtils.write(p,mxResources.get("pageScale"));q.appendChild(p);var fa=document.createElement("input");fa.style.cssText="margin:0 8px 0 8px;";fa.setAttribute("value","100 %");fa.style.width="60px";q.appendChild(fa);k.appendChild(q);p=document.createElement("div");p.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&&p.appendChild(q);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",p.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),m.className="geBtn",p.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});m.className=
"geBtn gePrimaryBtn";p.appendChild(m);a.editor.cancelFirst||p.appendChild(q);k.appendChild(p);this.container=k};var A=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)):(A.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))};
"geBtn gePrimaryBtn";p.appendChild(m);a.editor.cancelFirst||p.appendChild(q);k.appendChild(p);this.container=k};var z=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)):(z.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"),G=new Image;G.onload=function(){try{B.getContext("2d").drawImage(G,0,0);var a=B.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(K){}};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){}})();
var ErrorDialog=function(a,c,b,d,e,g,l,m,n,t,f){n=null!=n?n:!0;var k=document.createElement("div");k.style.textAlign="center";if(null!=c){var p=document.createElement("div");p.style.padding="0px";p.style.margin="0px";p.style.fontSize="18px";p.style.paddingBottom="16px";p.style.marginBottom="10px";p.style.borderBottom="1px solid #c0c0c0";p.style.color="gray";p.style.whiteSpace="nowrap";p.style.textOverflow="ellipsis";p.style.overflow="hidden";mxUtils.write(p,c);p.setAttribute("title",c);k.appendChild(p)}c=
document.createElement("div");c.style.lineHeight="1.2em";c.style.padding="6px";c.innerHTML=b;k.appendChild(c);b=document.createElement("div");b.style.marginTop="12px";b.style.textAlign="center";null!=g&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();g()}),c.className="geBtn",b.appendChild(c),b.style.textAlign="center");null!=t&&(t=mxUtils.button(t,function(){null!=f&&f()}),t.className="geBtn",b.appendChild(t));var u=mxUtils.button(d,function(){n&&a.hideDialog();null!=e&&e()});
u.className="geBtn";b.appendChild(u);null!=l&&(d=mxUtils.button(l,function(){n&&a.hideDialog();null!=m&&m()}),d.className="geBtn gePrimaryBtn",b.appendChild(d));this.init=function(){u.focus()};k.appendChild(b);this.container=k};
(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="10.7.5";EditorUi.compactUi="atlas"!=uiTheme;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.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!=
(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="10.7.6";EditorUi.compactUi="atlas"!=uiTheme;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.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",k=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e=null!=e?e:Error(a);(new Image).src=k+"/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.dev){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);
@ -8449,11 +8449,11 @@ p.style.fontFamily="Helvetica, Arial",p.style.fontSize="9pt",p.style.padding="6p
f.status=null)};f.pause=function(){return function(){}};return f};EditorUi.parsePng=function(a,b,c){function f(a,b){var c=k;k+=b;return a.substring(c,k)}function d(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var k=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=d(a);var p=f(a,4);if(null!=b&&b(k-8,p,c))break;value=f(a,c);f(a,4);if("IEND"==p)break}while(c)}};
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 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),g=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=g?mxUtils.getXml(g):""}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"/>'+
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),g=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=g?mxUtils.getXml(g):""}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,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,g,l,m,n,A){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;n=null!=n?n:!0;var f,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?f="_blank":k=f=d;if(null==a)return"";var p=
a;if("mxfile"!=p.nodeName.toLowerCase()){var q=Graph.zapGremlins(mxUtils.getXml(a)),p=Graph.compress(q);if(Graph.decompress(p)!=q)return q;q=a.ownerDocument.createElement("diagram");q.setAttribute("id",Editor.guid());mxUtils.setTextContent(q,p);p=a.ownerDocument.createElement("mxfile");p.appendChild(q)}A?(p=p.cloneNode(!0),p.removeAttribute("userAgent"),p.removeAttribute("version"),p.removeAttribute("editor"),p.removeAttribute("type")):(p.removeAttribute("userAgent"),p.removeAttribute("version"),
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,g,l,m,n,z){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;n=null!=n?n:!0;var f,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?f="_blank":k=f=d;if(null==a)return"";var p=
a;if("mxfile"!=p.nodeName.toLowerCase()){var q=Graph.zapGremlins(mxUtils.getXml(a)),p=Graph.compress(q);if(Graph.decompress(p)!=q)return q;q=a.ownerDocument.createElement("diagram");q.setAttribute("id",Editor.guid());mxUtils.setTextContent(q,p);p=a.ownerDocument.createElement("mxfile");p.appendChild(q)}z?(p=p.cloneNode(!0),p.removeAttribute("userAgent"),p.removeAttribute("version"),p.removeAttribute("editor"),p.removeAttribute("type")):(p.removeAttribute("userAgent"),p.removeAttribute("version"),
p.removeAttribute("editor"),p.removeAttribute("type"),p.setAttribute("modified",(new Date).toISOString()),p.setAttribute("host",window.location.hostname),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));a=mxUtils.getXml(p);if(!g&&!e&&(l||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(p),b,null!=c?c.getTitle():null,f,k);else if(g||!e&&
null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,b,d,null,m,n,k);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(c=Graph.compressNode(c),mxUtils.setTextContent(this.currentPage.node,c),c=this.fileNode.cloneNode(!1),b)c.appendChild(this.currentPage.node);else for(var f=0;f<this.pages.length;f++){if(this.currentPage!=
this.pages[f]&&this.pages[f].needsUpdate){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[f].root));this.editor.graph.saveViewState(this.pages[f].viewState,d);mxUtils.setTextContent(this.pages[f].node,Graph.compressNode(d));delete this.pages[f].needsUpdate}c.appendChild(this.pages[f].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))?
@ -8482,17 +8482,17 @@ this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!
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 k=null!=a.interval?parseInt(a.interval):6E4,e=null,p=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()),g()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(e);e=window.setTimeout(p,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();p()}));g();p()}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||f.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,c){d.alert(a.tooltip)});return b}var c=null,d=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:
null,null!=a&&"updates"==a.nodeName)){var f=this.editor.graph,e=f.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var l=e.getCell(a.getAttribute("id"));if(null!=l){try{var m=a.getAttribute("value");if(null!=m){var A=mxUtils.parseXml(m).documentElement;if(null!=A)if("1"==A.getAttribute("replace-value"))e.setValue(l,A);else for(var B=A.attributes,n=0;n<B.length;n++)f.setAttributeForCell(l,B[n].nodeName,0<B[n].nodeValue.length?B[n].nodeValue:null)}}catch(I){null!=
null,null!=a&&"updates"==a.nodeName)){var f=this.editor.graph,e=f.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var l=e.getCell(a.getAttribute("id"));if(null!=l){try{var m=a.getAttribute("value");if(null!=m){var z=mxUtils.parseXml(m).documentElement;if(null!=z)if("1"==z.getAttribute("replace-value"))e.setValue(l,z);else for(var B=z.attributes,n=0;n<B.length;n++)f.setAttributeForCell(l,B[n].nodeName,0<B[n].nodeValue.length?B[n].nodeValue:null)}}catch(I){null!=
window.console&&console.log("Error in value for "+l.id+": "+I)}try{var v=a.getAttribute("style");null!=v&&f.model.setStyle(l,v)}catch(I){null!=window.console&&console.log("Error in style for "+l.id+": "+I)}try{var t=a.getAttribute("icon");if(null!=t){var H=0<t.length?JSON.parse(t):null;null!=H&&H.append||f.removeCellOverlays(l);null!=H&&f.addCellOverlay(l,b(H))}}catch(I){null!=window.console&&console.log("Error in icon for "+l.id+": "+I)}try{var F=a.getAttribute("geometry");if(null!=F){var F=JSON.parse(F),
J=f.getCellGeometry(l);if(null!=J){J=J.clone();for(key in F){var E=parseFloat(F[key]);"dx"==key?J.x+=E:"dy"==key?J.y+=E:"dw"==key?J.width+=E:"dh"==key?J.height+=E:J[key]=parseFloat(F[key])}f.model.setGeometry(l,J)}}}catch(I){null!=window.console&&console.log("Error in icon for "+l.id+": "+I)}}}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,e)}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&&(g=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=g&&this.chromelessResize&&this.chromelessResize(!0,g)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,
d="",f=c.lastIndexOf(".");0<=f&&(d=c.substring(f),c=c.substring(0,f));if(b)var k=new Date,f=k.getFullYear(),e=k.getMonth()+1,g=k.getDate(),l=k.getHours(),A=k.getMinutes(),k=k.getSeconds(),c=c+(" "+(f+"-"+e+"-"+g+"-"+l+"-"+A+"-"+k));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var d=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();
d="",f=c.lastIndexOf(".");0<=f&&(d=c.substring(f),c=c.substring(0,f));if(b)var k=new Date,f=k.getFullYear(),e=k.getMonth()+1,g=k.getDate(),l=k.getHours(),z=k.getMinutes(),k=k.getSeconds(),c=c+(" "+(f+"-"+e+"-"+g+"-"+l+"-"+z+"-"+k));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var d=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();
this.editor.undoManager.clear();var f=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"));d=!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.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 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):f()});b?k():this.handleError(z,mxResources.get("errorLoadingFile"),k,!0)}else f();return d};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,d=new mxGraphModel,f=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 e=
this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));d=!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.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(y){}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):f()});b?k():this.handleError(A,mxResources.get("errorLoadingFile"),k,!0)}else f();return d};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,d=new mxGraphModel,f=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 e=
a[k].node.cloneNode(!1);e.removeAttribute("name");d.root=a[k].root;var g=f.encode(d);this.editor.graph.saveViewState(a[k].viewState,g,!0);g.removeAttribute("pageWidth");g.removeAttribute("pageHeight");e.appendChild(g);null!=b&&(b.eltCount+=e.getElementsByTagName("*").length,b.nodeCount+=e.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(e,function(a,b,c,d){return!d||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=b&&"height"!=b?d&&"mxCell"==a.nodeName&&"previous"==
b?null:c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var k=a.attributes[f].name,e=null!=b?b(a,k,a.attributes[f].value,!0):a.attributes[f].value;null!=e&&(d^=this.hashValue(k,
b,c)+this.hashValue(e,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,e,g,l){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||
@ -8511,9 +8511,9 @@ f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),E=mxUt
function(){},mxUtils.bind(this,function(a){v.isMouseDown&&null!=v.panningManager&&null!=v.graphHandler.shape&&(v.graphHandler.shape.node.style.visibility="hidden",g.style.backgroundColor="#f1f3f4",g.style.cursor="copy",v.panningManager.stop(),v.autoScroll=!1,null!=v.graphHandler.guide&&v.graphHandler.guide.setVisible(!1),null!=v.graphHandler.hint&&(v.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){v.isMouseDown&&null!=v.panningManager&&null!=v.graphHandler&&
(g.style.backgroundColor="",g.style.cursor="default",this.sidebar.showTooltips=!0,v.panningManager.stop(),v.graphHandler.reset(),v.isMouseDown=!1,v.autoScroll=!0,E(a),mxEvent.consume(a))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(a){v.isMouseDown&&null!=v.graphHandler.shape&&(v.graphHandler.shape.node.style.visibility="visible",g.style.backgroundColor="",g.style.cursor="",v.autoScroll=!0,null!=v.graphHandler.guide&&v.graphHandler.guide.setVisible(!0),null!=v.graphHandler.hint&&
(v.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,e,p,l,q,m,u,A){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,l,q),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,l,q),a,mxEvent.isAltDown(a)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var B=!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var e=
function(c,d,e,p,l,q,m,u,z){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,l,q),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,l,q),a,mxEvent.isAltDown(a)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var B=!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var e=
mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(e.documentElement));k(p,g);b=b.concat(p);F(a);this.spinner.stop();B=!0}catch(aa){}else if("mxfile"==e.documentElement.nodeName)try{for(var l=e.documentElement.getElementsByTagName("diagram"),e=0;e<l.length;e++){var p=mxUtils.getTextContent(l[e]),q=this.stringToCells(Graph.decompress(p)),m=this.editor.graph.getBoundingBoxFromGeometry(q);J(q,new mxRectangle(0,0,m.width,m.height),a)}B=!0}catch(aa){null!=
window.console&&console.log("error in drop handler:",aa)}}B||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=A&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?this.importVisio(A,function(a){n(a,"text/xml")},null,m):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,m)&&null!=A?this.parseFile(A,mxUtils.bind(this,function(a){4==
window.console&&console.log("error in drop handler:",aa)}}B||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=z&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?this.importVisio(z,function(a){n(a,"text/xml")},null,m):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,m)&&null!=z?this.parseFile(z,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(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"));
l.insertBefore(m,l.firstChild);mxEvent.addListener(m,"click",H);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&H(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",E);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))}p.appendChild(l);p.style.paddingRight=18*l.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),k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(k+="aspect=fixed;");
@ -8529,7 +8529,7 @@ return a};EditorUi.prototype.handleError=function(a,b,c,d,e){var f=null!=this.sp
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+")":"")),q=window.location.hash;if(null!=q&&("#G"==q.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==q.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)){q="#U"==q.substring(0,2)?q.substring(45,q.lastIndexOf("%26ex")):q.substring(2);this.showError(b,g,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+q);this.handleError(a,b,c,d,e)}),l,mxResources.get("changeUser"),mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&(this.drive.clearUserId(),gapi.auth.signOut(),window.location.reload())}),
mxResources.get("cancel"),mxUtils.bind(this,function(){window.location.hash=""}),480,150);return}}else null!=k.message?g=mxUtils.htmlEntities(k.message):null!=k.response&&null!=k.response.error?g=mxUtils.htmlEntities(k.response.error):"undefined"!==window.App&&(k.code==App.ERROR_TIMEOUT?g=mxUtils.htmlEntities(mxResources.get("timeout")):k.code==App.ERROR_BUSY&&(g=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,g,p,c,l,null,null,null,null,null,null,null,d?c:null)}else null!=c&&c()};
EditorUi.prototype.showError=function(a,b,c,d,e,g,l,m,n,A,B,t,v){a=new ErrorDialog(this,a,b,c||mxResources.get("ok"),d,e,g,l,t,m,n);this.showDialog(a.container,A||340,B||(null!=b&&120<b.length?180:150),!0,!1,v);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e,g){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};
EditorUi.prototype.showError=function(a,b,c,d,e,g,l,m,n,z,B,t,v){a=new ErrorDialog(this,a,b,c||mxResources.get("ok"),d,e,g,l,t,m,n);this.showDialog(a.container,z||340,B||(null!=b&&120<b.length?180:150),!0,!1,v);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e,g){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,g);a.init()};EditorUi.prototype.setCurrentFile=function(a){null!=a&&(a.opened=(new Date).getTime());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){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(Graph.compress(b))));return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,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,
@ -8546,8 +8546,8 @@ null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.max
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,g,l){l=null!=l?l:!mxClient.IS_IOS||!navigator.standalone;var f=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,f){if("_blank"==f||null!=a&&0<a.length){var e=c("_blank"==f?null:a,f==App.MODE_DEVICE||"download"==f||null==f||"_blank"==f?"0":"1");null!=e&&(f==App.MODE_DEVICE||"download"==f||"_blank"==f?e.simulate(document,"_blank"):this.pickFolder(f,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,
a,g,!0,f,c)}catch(v){this.handleError(v)}else this.spinner.spin(document.body,mxResources.get("saving"))&&e.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=e.getStatus()&&299>=e.getStatus())try{this.exportFile(e.getText(),a,g,!0,f,c)}catch(v){this.handleError(v)}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<f,4<f?3:4,d,g,e);this.showDialog(a.container,380,1==f?160:4<f?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,g,l,m,n,A){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 k=this.editor.graph.getSvg(f,a,l,m,null,c,null,null,"blank"==A?"_blank":"self"==A?"_top":null);d&&this.editor.graph.addSvgShadow(k);var p=this.getBaseFilename()+".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,n));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");
!1,!1,l,null,1<f,4<f?3:4,d,g,e);this.showDialog(a.container,380,1==f?160:4<f?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,g,l,m,n,z){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 k=this.editor.graph.getSvg(f,a,l,m,null,c,null,null,"blank"==z?"_blank":"self"==z?"_top":null);d&&this.editor.graph.addSvgShadow(k);var p=this.getBaseFilename()+".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,n));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='<!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,
k,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(k,q,this.thumbImageCache)):q(k)}))}};EditorUi.prototype.addRadiobox=function(a,b,c,d,e,g,l){return this.addCheckbox(a,c,d,e,g,l,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,g,l,m){g=null!=g?g:!0;var f=document.createElement("input");f.style.marginRight="8px";f.style.marginTop="16px";f.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();f.id=l;null!=m&&f.setAttribute("name",
m);c&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);d&&f.setAttribute("disabled","disabled");g&&(a.appendChild(f),c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",l),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);
@ -8558,8 +8558,8 @@ getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(
"frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||
mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,g,l,m){var f=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&k.push("edit="+encodeURIComponent(e)),g&&
k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&k.push("page-id="+this.currentPage.getId());a=!0;null!=l?c="#U"+encodeURIComponent(l):(f=this.getCurrentFile(),m||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&&k.push("title="+encodeURIComponent(f.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,e,g,l,m,n,A,B){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);n||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);
isNaN(c)||100==c||(f.zoom=c/100);c=[];l&&(c.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),f.resize=!0);m&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),f.toolbar=c.join(" "));null!=A&&0<A.length&&(f.edit=A);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+
f.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(f.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,e,g,l,m,n,z,B){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);n||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);
isNaN(c)||100==c||(f.zoom=c/100);c=[];l&&(c.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),f.resize=!0);m&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),f.toolbar=c.join(" "));null!=z&&0<z.length&&(f.edit=z);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+
'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";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 e=document.createElement("h3");
mxUtils.write(e,mxResources.get("html"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(e);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");e=g.cloneNode(!0);e.setAttribute("value",
"copy");k.appendChild(e);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(p);mxUtils.br(k);k.appendChild(g);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));k.appendChild(p);var l=this.getCurrentFile();null==c&&null!=l&&l.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")),
@ -8576,10 +8576,10 @@ document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRem
!0),e=this.editor.graph,p=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=p&&(p.style.marginBottom="16px");a=new CustomDialog(this,f,mxUtils.bind(this,function(){c(!k.checked,null!=g?g.checked:!1,null!=p?p.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,g,l,m){l=null!=l?l:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=
this.editor.graph,p="jpeg"==m?196:300,q=document.createElement("h3");mxUtils.write(q,a);q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";f.appendChild(q);mxUtils.write(f,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%";f.appendChild(n);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 x=this.addCheckbox(f,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=m),t=this.addCheckbox(f,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");g&&(f.appendChild(y),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),p+=26,mxEvent.addListener(t,"change",function(){t.checked?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(y.setAttribute("checked","checked"),y.defaultChecked=!0);var z=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible),D=document.createElement("input");D.style.marginTop="16px";D.style.marginRight="8px";D.setAttribute("type",
"disabled");y.setAttribute("type","checkbox");g&&(f.appendChild(y),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),p+=26,mxEvent.addListener(t,"change",function(){t.checked?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(y.setAttribute("checked","checked"),y.defaultChecked=!0);var A=this.addCheckbox(f,mxResources.get("shadow"),k.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&&(f.appendChild(D),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),p+=26);var I=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=m),L=null!=this.pages&&1<this.pages.length,P=this.addCheckbox(f,L?mxResources.get("allPages"):"",L,!L,null,"jpeg"!=m);P.style.marginLeft="24px";P.style.marginBottom="16px";L||(P.style.display="none");mxEvent.addListener(I,"change",function(){I.checked&&
L?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled")});l&&L||P.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"==m&&(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=n.value;e(n.value,x.checked,!t.checked,z.checked,I.checked,D.checked,u.value,y.checked,!P.checked,T.value)}),null,c,d);this.showDialog(c.container,340,
a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));T.appendChild(a);"svg"==m&&(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=n.value;e(n.value,x.checked,!t.checked,A.checked,I.checked,D.checked,u.value,y.checked,!P.checked,T.value)}),null,c,d);this.showDialog(c.container,340,
p,!0,!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,e){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=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";f.appendChild(g)}var p=this.addCheckbox(f,mxResources.get("fit"),
!0),l=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible&&d,!d),m=this.addCheckbox(f,c),q=this.addCheckbox(f,mxResources.get("lightbox"),!0),n=this.addEditButton(f,q),u=n.getEditInput(),t=1<k.model.getChildCount(k.model.getRoot()),F=this.addCheckbox(f,mxResources.get("layers"),t,!t);F.style.marginLeft=u.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(q,"change",function(){q.checked?(t&&F.removeAttribute("disabled"),u.removeAttribute("disabled")):
(F.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"));u.checked&&q.checked?n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){a(p.checked,l.checked,m.checked,q.checked,n.getLink(),F.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,g,l,m){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('"+
@ -8591,24 +8591,24 @@ EditorUi.drawHost+"/?client=1&lightbox=1"+(e?"&edit=_blank":"")+(g?"&layers=1":"
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],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=Graph.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=
this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(x){}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()),
e=d.getGlobalVariable,g=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0));var e=c.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(Graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(A){null!=
b&&b(A)}}),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,g,l){l=b.background;l==mxConstants.NONE&&(l=null);g=b.getSvg(l,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=e)this.convertImages(g,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')+
e=d.getGlobalVariable,g=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0));var e=c.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(Graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(z){null!=
b&&b(z)}}),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,g,l){l=b.background;l==mxConstants.NONE&&(l=null);g=b.getSvg(l,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=e)this.convertImages(g,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(g)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,l,m,n){n=null!=n?n:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();
try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,m):null,n)}catch(G){"Invalid image"==G.message?this.downloadFile(n):this.handleError(G)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,l)}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,f={},e=mxUtils.bind(this,function(){if(0==d){for(var e=[c[0]],g=1;g<c.length;g++){var k=c[g].indexOf(")");e.push('url("');e.push(f[b(c[g].substring(0,k))]);e.push('"'+c[g].substring(k))}this.editor.resolvedFontCss=e.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var l=c[g].indexOf(")"),m=null,n=c[g].indexOf("format(",l);0<n&&(m=b(c[g].substring(n+7,c[g].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==
f[a]){f[a]=a;d++;var b="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==m||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==m||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==m||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==m||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=
a;/^https?:\/\//.test(c)&&!this.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[g].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,l,m,n,A,B,t,v,K){g=null!=g?g:!0;t=null!=t?t:this.editor.graph;v=null!=v?v:0;var f=n?null:t.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==
f&&0==n&&(f="#ffffff");this.convertImages(t.getSvg(f,null,null,K,null,null!=l?l:!0,null,null,null,A),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),l=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=b&&(m=g?Math.min(1,Math.min(3*b/(4*l),b/p)):b/p);p=Math.ceil(m*p)+2*v;l=Math.ceil(m*l)+2*v;k.setAttribute("width",p);k.setAttribute("height",l);var q=k.getContext("2d");null!=f&&(q.beginPath(),
q.rect(0,0,p,l),q.fillStyle=f,q.fill());q.scale(m,m);mxClient.IS_SF?window.setTimeout(function(){q.drawImage(d,v/m,v/m);a(k)},0):(q.drawImage(d,v/m,v/m),a(k))}catch(T){null!=e&&e(T)}});d.onerror=function(a){null!=e&&e(a)};try{A&&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(t,
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[g].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,l,m,n,z,B,t,v,K){g=null!=g?g:!0;t=null!=t?t:this.editor.graph;v=null!=v?v:0;var f=n?null:t.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==
f&&0==n&&(f="#ffffff");this.convertImages(t.getSvg(f,null,null,K,null,null!=l?l:!0,null,null,null,z),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),l=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=b&&(m=g?Math.min(1,Math.min(3*b/(4*l),b/p)):b/p);p=Math.ceil(m*p)+2*v;l=Math.ceil(m*l)+2*v;k.setAttribute("width",p);k.setAttribute("height",l);var q=k.getContext("2d");null!=f&&(q.beginPath(),
q.rect(0,0,p,l),q.fillStyle=f,q.fill());q.scale(m,m);mxClient.IS_SF?window.setTimeout(function(){q.drawImage(d,v/m,v/m);a(k)},0):(q.drawImage(d,v/m,v/m),a(k))}catch(T){null!=e&&e(T)}});d.onerror=function(a){null!=e&&e(a)};try{z&&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(t,
c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(D){null!=e&&e(D)}}),c,B)};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)&&(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,e=c||{};c=mxUtils.bind(this,function(c,g){for(var k=a.getElementsByTagName(c),p=0;p<k.length;p++)mxUtils.bind(this,function(c){var k=d.convert(c.getAttribute(g));if(null!=k&&"data:"!=k.substring(0,5)){var p=e[k];null==p?(f++,this.convertImageToDataUri(k,function(d){null!=d&&(e[k]=d,c.setAttribute(g,
d));f--;0==f&&b(a)})):c.setAttribute(g,p)}else null!=k&&c.setAttribute(g,k)})(k[p])});c("image","xlink:href");c("img","src");0==f&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,g,l){try{var f=!l&&(d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));e=null!=e?e:!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(f){if((9==document.documentMode||10==document.documentMode)&&
"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);d=d.join("")}g=null!=g?g:"data:image/png;base64,";d=g+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:k})})});k()}catch(A){null!=
c&&c(A)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image,d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,
0,0);try{b(a.toDataURL())}catch(z){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var f=[];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 l=p.getElementsByTagName("diagram");if(1==l.length)p=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(l[0]))).documentElement;
"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);d=d.join("")}g=null!=g?g:"data:image/png;base64,";d=g+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:k})})});k()}catch(z){null!=
c&&c(z)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image,d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,
0,0);try{b(a.toDataURL())}catch(A){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var f=[];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 l=p.getElementsByTagName("diagram");if(1==l.length)p=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(l[0]))).documentElement;
else if(1<l.length)for(a=0,null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(p=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(l[0]))).documentElement,d=!1,a=1);a<l.length;a++){l[a].removeAttribute("id");var m=this.updatePageRoot(new DiagramPage(l[a])),n=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[n+1]));g.model.execute(new ChangePage(this,m,m,n,!0))}}null!=p&&"mxGraphModel"===p.nodeName&&(f=g.importGraphModel(p,b,c,d))}finally{g.model.endUpdate()}}}catch(v){if(e)throw v;
this.handleError(v)}return f};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)if(this.isRemoteVisioFormat(d)&&null!=VSD_CONVERT_URL){var f=new FormData;f.append("file1",a,d);var e=new XMLHttpRequest;e.open("POST",VSD_CONVERT_URL);
e.responseType="blob";e.onreadystatechange=mxUtils.bind(this,function(){if(4==e.readyState)if(200<=e.status&&299>=e.status)try{e.response.name=d,this.doImportVisio(e.response,b,c)}catch(y){c(y)}else c({})});e.send(f)}else try{this.doImportVisio(a,b,c)}catch(y){c(y)}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=
e.responseType="blob";e.onreadystatechange=mxUtils.bind(this,function(){if(4==e.readyState)if(200<=e.status&&299>=e.status)try{this.doImportVisio(e.response,b,c,d)}catch(y){c(y)}else c({})});e.send(f)}else try{this.doImportVisio(a,b,c,d)}catch(y){c(y)}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(q){c(q)}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){console.log(a);var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{b(LucidImporter.importState(JSON.parse(a)))}catch(q){c(q)}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.insertAsPreText=
@ -8622,18 +8622,18 @@ f.setLinkForCell(e,e.value),e.geometry.width+=f.gridSize,e.geometry.height+=f.gr
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)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){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.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 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.importFile=function(a,b,c,d,e,g,l,m,n,A,t){A=null!=A?A:!0;var f=!1,k=null,p=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):b=this.importXml(a,c,d,A);null!=m&&m(b)});"image"==b.substring(0,5)?(n=!1,"image/png"==b.substring(0,9)&&(b=t?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,d,A),n=!0)),n||(k=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",
b+1))),A&&k.isGridEnabled()&&(c=k.snap(c),d=k.snap(d)),k=[k.insertVertex(null,null,"",c,d,e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(f=!0,this.importGraphML(a,p)):null!=n&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?(f=!0,this.importVisio(n,p)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(f=!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?p(a.responseText):null!=m&&m(null))}),l)):/(\.v(sd|dx))($|\?)/i.test(l)||/(\.vs(s|x))($|\?)/i.test(l)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,A));f||null==m||m(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,f,e,g;c<d;){f=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>
EditorUi.prototype.importFile=function(a,b,c,d,e,g,l,m,n,z,t){z=null!=z?z:!0;var f=!1,k=null,p=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):b=this.importXml(a,c,d,z);null!=m&&m(b)});"image"==b.substring(0,5)?(n=!1,"image/png"==b.substring(0,9)&&(b=t?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,d,z),n=!0)),n||(k=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",
b+1))),z&&k.isGridEnabled()&&(c=k.snap(c),d=k.snap(d)),k=[k.insertVertex(null,null,"",c,d,e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(f=!0,this.importGraphML(a,p)):null!=n&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?(f=!0,this.importVisio(n,p)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(f=!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?p(a.responseText):null!=m&&m(null))}),l)):/(\.v(sd|dx))($|\?)/i.test(l)||/(\.vs(s|x))($|\?)/i.test(l)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,z));f||null==m||m(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,f,e,g;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}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>
2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,l,m,n,A,t,G){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;A=null!=A?A:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&
2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,l,m,n,z,t,G){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;z=null!=z?z:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&
null!=a)for(var q=t||this.resampleThreshold,u=0;u<a.length;u++)if("image/"==a[u].type.substring(0,6)&&a[u].size>q){p=!0;break}var B=mxUtils.bind(this,function(){var p=this.editor.graph,n=p.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,k,l,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,d,e,g,k,l,p,f,G)});g=null!=g?g:mxUtils.bind(this,function(a){p.setSelectionCells(a)});if(this.spinner.spin(document.body,
mxResources.get("loading")))for(var q=a.length,u=q,B=[],x=mxUtils.bind(this,function(a,b){B[a]=b;if(0==--u){this.spinner.stop();if(null!=m)m(B);else{var c=[];p.getModel().beginUpdate();try{for(var d=0;d<B.length;d++){var f=B[d]();null!=f&&(c=c.concat(f))}}finally{p.getModel().endUpdate()}}g(c)}}),v=0;v<q;v++)mxUtils.bind(this,function(f){var g=a[f];if(null!=g){var m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==l||l(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,
9)){var m=a.target.result,q=m.indexOf(","),u=decodeURIComponent(escape(atob(m.substring(q+1)))),B=mxUtils.parseXml(u),u=B.getElementsByTagName("svg");if(0<u.length){var u=u[0],v=G?null:u.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?x(f,mxUtils.bind(this,function(){try{if(m.substring(0,q+1),null!=
B){var a=B.getElementsByTagName("svg");if(0<a.length){var k=a[0],l=parseFloat(k.getAttribute("width")),A=parseFloat(k.getAttribute("height")),u=k.getAttribute("viewBox");if(null==u||0==u.length)k.setAttribute("viewBox","0 0 "+l+" "+A);else if(isNaN(l)||isNaN(A)){var t=u.split(" ");3<t.length&&(l=parseFloat(t[2]),A=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(k));var x=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,A)),v=e(m,g.type,b+f*n,c+f*n,Math.max(1,Math.round(l*x)),Math.max(1,
Math.round(A*x)),g.name);if(isNaN(l)||isNaN(A)){var G=new Image;G.onload=mxUtils.bind(this,function(){l=Math.max(1,G.width);A=Math.max(1,G.height);v[0].geometry.width=l;v[0].geometry.height=A;k.setAttribute("viewBox","0 0 "+l+" "+A);m=this.createSvgDataUri(mxUtils.getXml(k));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));p.setCellStyles("image",m,[v[0]])});G.src=this.createSvgDataUri(mxUtils.getXml(k))}return v}}}catch(pa){}return null})):x(f,mxUtils.bind(this,function(){return e(v,
B){var a=B.getElementsByTagName("svg");if(0<a.length){var k=a[0],l=parseFloat(k.getAttribute("width")),z=parseFloat(k.getAttribute("height")),u=k.getAttribute("viewBox");if(null==u||0==u.length)k.setAttribute("viewBox","0 0 "+l+" "+z);else if(isNaN(l)||isNaN(z)){var t=u.split(" ");3<t.length&&(l=parseFloat(t[2]),z=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(k));var x=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,z)),v=e(m,g.type,b+f*n,c+f*n,Math.max(1,Math.round(l*x)),Math.max(1,
Math.round(z*x)),g.name);if(isNaN(l)||isNaN(z)){var G=new Image;G.onload=mxUtils.bind(this,function(){l=Math.max(1,G.width);z=Math.max(1,G.height);v[0].geometry.width=l;v[0].geometry.height=z;k.setAttribute("viewBox","0 0 "+l+" "+z);m=this.createSvgDataUri(mxUtils.getXml(k));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));p.setCellStyles("image",m,[v[0]])});G.src=this.createSvgDataUri(mxUtils.getXml(k))}return v}}}catch(pa){}return null})):x(f,mxUtils.bind(this,function(){return e(v,
"text/xml",b+f*n,c+f*n,0,0,g.name)}))}else x(f,mxUtils.bind(this,function(){return null}))}else{u=!1;if("image/png"==g.type){var y=G?null:this.extractGraphModelFromPng(a.target.result);if(null!=y&&0<y.length){var E=new Image;E.src=a.target.result;x(f,mxUtils.bind(this,function(){return e(y,"text/xml",b+f*n,c+f*n,E.width,E.height,g.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(l){this.resizeImage(l,a.target.result,mxUtils.bind(this,function(l,p,m){x(f,mxUtils.bind(this,function(){if(null!=l&&l.length<A){var q=k&&this.isResampleImage(a.target.result,t)?Math.min(1,Math.min(d/p,d/m)):1;return e(l,g.type,b+f*n,c+f*n,Math.round(p*q),Math.round(m*q),g.name)}this.handleError({message:mxResources.get("imageTooBig")});
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(l){this.resizeImage(l,a.target.result,mxUtils.bind(this,function(l,p,m){x(f,mxUtils.bind(this,function(){if(null!=l&&l.length<z){var q=k&&this.isResampleImage(a.target.result,t)?Math.min(1,Math.min(d/p,d/m)):1;return e(l,g.type,b+f*n,c+f*n,Math.round(p*q),Math.round(m*q),g.name)}this.handleError({message:mxResources.get("imageTooBig")});
return null}))}),k,d,t)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*n,c+f*n,240,160,g.name,function(a){x(f,function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?e(null,g.type,b+f*n,c+f*n,240,160,g.name,function(a){x(f,function(){return a})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g):m.readAsText(g)}})(v)});if(p){p=[];for(u=0;u<a.length;u++)p.push(a[u]);
a=p;this.confirmImageResize(function(a){k=a;B()},n)}else B()};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)};
@ -8647,13 +8647,13 @@ var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(
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 d.apply(this,arguments)};var e=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null!=c&&b.isCustomLink(c)&&(mxEvent.isTouchEvent(a)||!mxEvent.isPopupTrigger(a))&&
b.customLinkClicked(c)&&mxEvent.consume(a);null!=f&&f(a,c)};e.call(this,a,c,d)};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 g=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:g.apply(this,arguments)};var m=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))m.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 n=this.actions.get("print");n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();if(!this.editor.chromeless||this.editor.editable){var t=function(){window.setTimeout(function(){A.innerHTML="&nbsp;";A.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);
c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var n=this.actions.get("print");n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();if(!this.editor.chromeless||this.editor.editable){var t=function(){window.setTimeout(function(){z.innerHTML="&nbsp;";z.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);
this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize");mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,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 g=e[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],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]()});else{var k=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(X){}}),!1);var A=document.createElement("div");
A.style.position="absolute";A.style.whiteSpace="nowrap";A.style.overflow="hidden";A.style.display="block";A.contentEditable=!0;mxUtils.setOpacity(A,0);A.style.width="1px";A.style.height="1px";A.innerHTML="&nbsp;";var B=!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)||B||(A.style.left=b.container.scrollLeft+10+"px",A.style.top=b.container.scrollTop+10+"px",b.container.appendChild(A),B=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){A.focus();document.execCommand("selectAll",!1,null)},0):(A.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(){!B||224!=c&&17!=c&&91!=c||(B=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),A.parentNode.removeChild(A),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(A,"copy",mxUtils.bind(this,function(a){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(A),t()}catch(E){this.handleError(E)}}));mxEvent.addListener(A,"cut",mxUtils.bind(this,function(a){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(A,
!0),t()}catch(E){this.handleError(E)}}));mxEvent.addListener(A,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(A.innerHTML="&nbsp;",A.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,A);A.innerHTML="&nbsp;"}),0))}),!0);var G=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==A?!0:G.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||
c.types[f].substring(0,5)){d=!0;break}if(!d){var e=c.items;for(index in e){var g=e[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],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]()});else{var k=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(X){}}),!1);var z=document.createElement("div");
z.style.position="absolute";z.style.whiteSpace="nowrap";z.style.overflow="hidden";z.style.display="block";z.contentEditable=!0;mxUtils.setOpacity(z,0);z.style.width="1px";z.style.height="1px";z.innerHTML="&nbsp;";var B=!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)||B||(z.style.left=b.container.scrollLeft+10+"px",z.style.top=b.container.scrollTop+10+"px",b.container.appendChild(z),B=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){z.focus();document.execCommand("selectAll",!1,null)},0):(z.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(){!B||224!=c&&17!=c&&91!=c||(B=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),z.parentNode.removeChild(z),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(z,"copy",mxUtils.bind(this,function(a){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(z),t()}catch(E){this.handleError(E)}}));mxEvent.addListener(z,"cut",mxUtils.bind(this,function(a){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(z,
!0),t()}catch(E){this.handleError(E)}}));mxEvent.addListener(z,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(z.innerHTML="&nbsp;",z.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,z);z.innerHTML="&nbsp;"}),0))}),!0);var G=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==z?!0:G.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||
0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();
a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,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,
@ -8685,7 +8685,7 @@ d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getCh
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(A){this.handleError(A,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(A){this.handleError(A)}});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])};
try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(z){this.handleError(z)}});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]));
@ -8703,7 +8703,7 @@ null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteIn
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"==k.action){l=this.getDiagramTextContent();g.postMessage(JSON.stringify({event:"textContent",data:l,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 q=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var t=this.editor.graph,u=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(q);g.postMessage(JSON.stringify(b),"*")}),x=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(Graph.compress(q))));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container);u(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var t=this.createTemporaryGraph(t.getStylesheet()),
y=t.getGlobalVariable,z=this.pages[0];t.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:y.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){x(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){x(null)}),null,null,null,null,null,null,t)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(q)))).send(mxUtils.bind(this,
y=t.getGlobalVariable,A=this.pages[0];t.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:y.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){x(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){x(null)}),null,null,null,null,null,null,t)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(q)))).send(mxUtils.bind(this,
function(a){200<=a.getStatus()&&299>=a.getStatus()?u("data:image/png;base64,"+a.getText()):x(null)}),mxUtils.bind(this,function(){x(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)q=this.editor.getGraphXml(),
n.data=this.getHtml(q,this.editor.graph),n.xml=mxUtils.getXml(q),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==k.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,
function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=
@ -8752,36 +8752,36 @@ p=Math.floor(l.height*e/f.view.scale);k.length<=MAX_REQUEST_SIZE&&m*p<MAX_AREA?(
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,c){var d=a.getCell(c);if(null==d)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==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 e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<img src="/images/spin.gif">';
var f={};try{var g=mxSettings.getCustomLibraries();for(a=0;a<g.length;a++){var l=g[a];if("R"==l.substring(0,1)){var m=JSON.parse(decodeURIComponent(l.substring(1)));f[m[0]]={id:m[0],title:m[1],downloadUrl:m[2]}}}}catch(A){}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];f[d.id]&&
var f={};try{var g=mxSettings.getCustomLibraries();for(a=0;a<g.length;a++){var l=g[a];if("R"==l.substring(0,1)){var m=JSON.parse(decodeURIComponent(l.substring(1)));f[m[0]]={id:m[0],title:m[1],downloadUrl:m[2]}}}}catch(z){}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];f[d.id]&&
(b[d.id]=d);var g=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},function(){this.handleError(null,mxResources.get("errorLoadingFile"))});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==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(K){this.handleError(K,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)};
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){c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:d,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,
"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)}})();
var CommentsWindow=function(a,c,b,d,e,g){function l(){for(var a=C.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==C&&b++;A.style.display=0==b?"block":"none"}function m(a,b,c,d){function e(){b.removeChild(k);b.removeChild(m);g.style.display="block";f.style.display="block"}x={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),k=document.createElement("textarea");k.className=
var CommentsWindow=function(a,c,b,d,e,g){function l(){for(var a=C.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==C&&b++;z.style.display=0==b?"block":"none"}function m(a,b,c,d){function e(){b.removeChild(k);b.removeChild(m);g.style.display="block";f.style.display="block"}x={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),l()):e();x=null});n.className="geCommentEditBtn";m.appendChild(n);var p=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=k.value;mxUtils.write(f,a.content);e();c(a);x=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?(p.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));p.focus();p.className="geCommentEditBtn gePrimaryBtn";m.appendChild(p);b.insertBefore(m,f);g.style.display="none";f.style.display="none";k.focus()}function n(b,c){c.innerHTML="";var d=a.timeSince(new Date(b.modifiedDate));null==d&&(d=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
[d],"{1} ago"))}function t(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src="/images/spin.gif";a.appendChild(b);a.busyImg=b}function f(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function k(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)});L.appendChild(e);d&&(e.style.display="none")}function G(){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=E;a(b);return{pdiv:d,replies:c}}function y(c,d,g,l,n){function A(){t(u);b.addReply(v,function(a){v.id=a;b.replies.push(v);k(u);g&&g()},function(b){q();f(u);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},l,n)}function q(){m(v,
u,function(a){A()},!0)}var B=G().pdiv,v=a.newComment(c,a.getCurrentUser());v.pCommentId=b.id;null==b.replies&&(b.replies=[]);var u=p(v,b.replies,B,e+1);d?q():A()}if(g||!b.isResolved){A.style.display="none";var E=document.createElement("div");E.className="geCommentContainer";E.setAttribute("data-commentId",b.id);E.style.marginLeft=20*e+5+"px";b.isResolved&&"dark"!=uiTheme&&(E.style.backgroundColor="ghostWhite");var z=document.createElement("div");z.className="geCommentHeader";var D=document.createElement("img");
D.className="geCommentUserImg";D.src=b.user.pictureUrl||Editor.userImage;z.appendChild(D);D=document.createElement("div");D.className="geCommentHeaderTxt";z.appendChild(D);var K=document.createElement("div");K.className="geCommentUsername";mxUtils.write(K,b.user.displayName||"");D.appendChild(K);K=document.createElement("div");K.className="geCommentDate";K.setAttribute("data-commentId",b.id);n(b,K);D.appendChild(K);E.appendChild(z);z=document.createElement("div");z.className="geCommentTxt";mxUtils.write(z,
b.content||"");E.appendChild(z);z=document.createElement("div");z.className="geCommentActions";var L=document.createElement("ul");L.className="geCommentActionsList";z.appendChild(L);u||0!=e&&!q||B(mxResources.get("reply"),function(){y("",!0)},b.isResolved);D=a.getCurrentUser();null==D||D.id!=b.user.id||u||(B(mxResources.get("edit"),function(){function c(){m(b,E,function(){t(E);b.editComment(b.content,function(){k(E)},function(b){f(E);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(){t(E);b.deleteComment(function(){for(var a=G(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}A.style.display=0==C.getElementsByTagName("div").length?"block":"none"},function(b){f(E);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));u||0!=e||B(b.isResolved?mxResources.get("reopen"):
"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});L.appendChild(e);d&&(e.style.display="none")}function G(){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=E;a(b);return{pdiv:d,replies:c}}function y(c,d,g,l,n){function z(){t(u);b.addReply(v,function(a){v.id=a;b.replies.push(v);k(u);g&&g()},function(b){q();f(u);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},l,n)}function q(){m(v,
u,function(a){z()},!0)}var B=G().pdiv,v=a.newComment(c,a.getCurrentUser());v.pCommentId=b.id;null==b.replies&&(b.replies=[]);var u=p(v,b.replies,B,e+1);d?q():z()}if(g||!b.isResolved){z.style.display="none";var E=document.createElement("div");E.className="geCommentContainer";E.setAttribute("data-commentId",b.id);E.style.marginLeft=20*e+5+"px";b.isResolved&&"dark"!=uiTheme&&(E.style.backgroundColor="ghostWhite");var A=document.createElement("div");A.className="geCommentHeader";var D=document.createElement("img");
D.className="geCommentUserImg";D.src=b.user.pictureUrl||Editor.userImage;A.appendChild(D);D=document.createElement("div");D.className="geCommentHeaderTxt";A.appendChild(D);var K=document.createElement("div");K.className="geCommentUsername";mxUtils.write(K,b.user.displayName||"");D.appendChild(K);K=document.createElement("div");K.className="geCommentDate";K.setAttribute("data-commentId",b.id);n(b,K);D.appendChild(K);E.appendChild(A);A=document.createElement("div");A.className="geCommentTxt";mxUtils.write(A,
b.content||"");E.appendChild(A);A=document.createElement("div");A.className="geCommentActions";var L=document.createElement("ul");L.className="geCommentActionsList";A.appendChild(L);u||0!=e&&!q||B(mxResources.get("reply"),function(){y("",!0)},b.isResolved);D=a.getCurrentUser();null==D||D.id!=b.user.id||u||(B(mxResources.get("edit"),function(){function c(){m(b,E,function(){t(E);b.editComment(b.content,function(){k(E)},function(b){f(E);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(){t(E);b.deleteComment(function(){for(var a=G(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}z.style.display=0==C.getElementsByTagName("div").length?"block":"none"},function(b){f(E);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=G(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var k=e[g].querySelectorAll(".geCommentAction"),m=0;m<k.length;m++)k[m]!=c.parentNode&&(k[m].style.display=d);v||(e[g].style.display="none")}l()}
b.isResolved?y(mxResources.get("reOpened")+": ",!0,c,!1,!0):y(mxResources.get("markedAsResolved"),!1,c,!0)});E.appendChild(z);null!=d?C.insertBefore(E,d.nextSibling):C.appendChild(E);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!=x&&(x.comment.id==b.id?(g=b.content,b.content=x.comment.content,m(b,E,x.saveCallback,x.deleteOnCancel),b.content=g):null==x.comment.id&&x.comment.pCommentId==b.id&&(C.appendChild(x.div),m(x.comment,
x.div,x.saveCallback,x.deleteOnCancel)));return E}}var u=!a.canComment(),q=a.canReplyToReplies(),x=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 A=document.createElement("span");
A.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(A,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=
b.isResolved?y(mxResources.get("reOpened")+": ",!0,c,!1,!0):y(mxResources.get("markedAsResolved"),!1,c,!0)});E.appendChild(A);null!=d?C.insertBefore(E,d.nextSibling):C.appendChild(E);for(d=0;null!=b.replies&&d<b.replies.length;d++)A=b.replies[d],A.isResolved=b.isResolved,p(A,b.replies,null,e+1,g);null!=x&&(x.comment.id==b.id?(g=b.content,b.content=x.comment.content,m(b,E,x.saveCallback,x.deleteOnCancel),b.content=g):null==x.comment.id&&x.comment.pCommentId==b.id&&(C.appendChild(x.div),m(x.comment,
x.div,x.saveCallback,x.deleteOnCancel)));return E}}var u=!a.canComment(),q=a.canReplyToReplies(),x=null,A=document.createElement("div");A.className="geCommentsWin";A.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";A.appendChild(C);var z=document.createElement("span");
z.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(z,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 G=y.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(){m(d,e,function(b){t(e);a.addComment(b,function(a){b.id=a;K.push(b);k(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,K,null,0);c();b.preventDefault();
mxEvent.consume(b)});B.appendChild(G)}G=y.cloneNode();G.innerHTML='<img src="/images/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";H();a.preventDefault();mxEvent.consume(a)});B.appendChild(G);a.commentsRefreshNeeded()&&(G=y.cloneNode(),G.innerHTML='<img src="/images/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){H();a.preventDefault();mxEvent.consume(a)}),B.appendChild(G));a.commentsSaveNeeded()&&(y=y.cloneNode(),y.innerHTML='<img src="/images/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){g();a.preventDefault();mxEvent.consume(a)}),
B.appendChild(y));z.appendChild(B);var K=[],H=mxUtils.bind(this,function(){if(null!=x){x.div=x.div.cloneNode(!0);var b=x.div.querySelector(".geCommentEditTxtArea"),c=x.div.querySelector(".geCommentEditBtns");x.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="/images/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";q=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(A);A.style.display="block";K=a;for(a=0;a<K.length;a++)b(K[a].replies),p(K[a],K,null,0,v);null!=x&&null==x.comment.id&&null==x.comment.pCommentId&&(C.appendChild(x.div),m(x.comment,x.div,x.saveCallback,x.deleteOnCancel))},
B.appendChild(y));A.appendChild(B);var K=[],H=mxUtils.bind(this,function(){if(null!=x){x.div=x.div.cloneNode(!0);var b=x.div.querySelector(".geCommentEditTxtArea"),c=x.div.querySelector(".geCommentEditBtns");x.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="/images/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";q=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(z);z.style.display="block";K=a;for(a=0;a<K.length;a++)b(K[a].replies),p(K[a],K,null,0,v);null!=x&&null==x.comment.id&&null==x.comment.pCommentId&&(C.appendChild(x.div),m(x.comment,x.div,x.saveCallback,x.deleteOnCancel))},
function(){C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))}):C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});H();this.refreshComments=H;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<K.length;d++)a(K[d])}});setInterval(B,6E4);
this.refreshCommentsTime=B;this.window=new mxWindow(mxResources.get("comments"),z,c,b,d,e,!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;
this.refreshCommentsTime=B;this.window=new mxWindow(mxResources.get("comments"),A,c,b,d,e,!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 F=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",F);this.destroy=function(){mxEvent.removeListener(window,"resize",F);this.window.destroy()}},
ConfirmDialog=function(a,c,b,d,e,g,l,m,n,t){var f=document.createElement("div");f.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);f.appendChild(k);null!=t&&(k=document.createElement("div"),k.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",t),k.appendChild(c),f.appendChild(k));t=document.createElement("div");
t.style.textAlign="center";t.style.whiteSpace="nowrap";var p=document.createElement("input");p.setAttribute("type","checkbox");g=mxUtils.button(g||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(p.checked)});g.className="geBtn";null!=m&&(g.innerHTML=m+"<br>"+g.innerHTML,g.style.paddingBottom="8px",g.style.paddingTop="8px",g.style.height="auto",g.style.width="40%");a.editor.cancelFirst&&t.appendChild(g);var u=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=b&&
@ -8789,8 +8789,8 @@ b(p.checked)});t.appendChild(u);null!=l?(u.innerHTML=l+"<br>"+u.innerHTML+"<br>"
mxEvent.addListener(e,"click",function(a){p.checked=!p.checked;mxEvent.consume(a)})):t.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,e){var g={},l=[],m={},n={},t={},f={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var k in d[EditorUi.DIFF_UPDATE])g[k]=d[EditorUi.DIFF_UPDATE][k];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(k in c[EditorUi.DIFF_UPDATE])d=
c[EditorUi.DIFF_UPDATE][k],null!=d.previous&&(f[d.previous]=k);if(null!=a){var p="";for(d=0;d<a.length;d++){var u=a[d].getId();t[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 q={},x=mxUtils.bind(this,function(a){var d=null!=a?a.getId():"";if(null!=a&&!q[d]){q[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,g[a.getId()],e),!b||null==k.cells&&null==k.view||(a.needsUpdate=!0))}a=f[d];null!=a&&(delete f[d],x(t[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=t[a.getId()];null==c?x(a):(c.root=a.root,this.currentPage==c?this.editor.graph.model.setRoot(c.root):b&&(c.needsUpdate=!0))});x();for(k in f)x(t[f[k]]),
delete f[k];for(k in m)z(m[k]),delete m[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)}};
null!=k.view&&this.patchViewState(a,k.view),null!=k.cells&&this.patchPage(a,k.cells,g[a.getId()],e),!b||null==k.cells&&null==k.view||(a.needsUpdate=!0))}a=f[d];null!=a&&(delete f[d],x(t[a]));a=m[d];null!=a&&(delete m[d],A(a))}),A=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var c=t[a.getId()];null==c?x(a):(c.root=a.root,this.currentPage==c?this.editor.graph.model.setRoot(c.root):b&&(c.needsUpdate=!0))});x();for(k in f)x(t[f[k]]),
delete f[k];for(k in m)A(m[k]),delete m[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 e=0;e<c[EditorUi.DIFF_INSERT].length;e++){var g=c[EditorUi.DIFF_INSERT][e],l=null!=g.parent?g.parent:"",m=null!=g.previous?g.previous:"";b(l).inserted[m]=g}if(null!=c[EditorUi.DIFF_UPDATE])for(var n in c[EditorUi.DIFF_UPDATE])g=c[EditorUi.DIFF_UPDATE][n],null!=g.previous&&(l=g.parent,null==l&&(e=a.getCell(n),null!=e&&(e=
a.getParent(e),null!=e&&(l=e.getId()))),null!=l&&(b(l).moved[g.previous]=n));return d};
EditorUi.prototype.patchPage=function(a,c,b,d){var e=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),g=this.createParentLookup(e,c);e.beginUpdate();try{var l=e.updateEdgeParent,m=new mxDictionary,n=[];e.updateEdgeParent=function(a,b){!m.get(a)&&d&&(m.put(a,!0),n.push(a))};var t=g[""],f=null!=t&&null!=t.inserted?t.inserted[""]:null,k=null;null!=f&&(k=this.getCellForJson(f));if(null==k){var p=null!=t&&null!=t.moved?t.moved[""]:null;null!=p&&(k=e.getCell(p))}null!=k&&(e.setRoot(k),
@ -8845,7 +8845,7 @@ 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.setDescriptorEtag(a,this.file.getCurrentEtag()),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==d||!d()){var e=this.file.getDescriptorSecret(a),g=this.file.getDescriptorEtag(a),l=this.file.getCurrentEtag();if(l==g)null!=c&&c();else if(this.isValidState()){var m=0,n=!1,t=mxUtils.bind(this,function(){if(null==d||!d())if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var f=!0,k=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(l)+"&to="+encodeURIComponent(g)+(null!=e?"&secret="+encodeURIComponent(e):""),mxUtils.bind(this,function(e){this.file.stats.bytesReceived+=e.getText().length;window.clearTimeout(k);if(f&&(null==d||!d()))if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var g=null,p=[];if(200<=e.getStatus()&&299>=e.getStatus()&&0<e.getText().length)try{var x=JSON.parse(e.getText());if(null!=x&&0<x.length)for(var z=0;z<x.length;z++){var y=this.stringToObject(x[z]);
"&from="+encodeURIComponent(l)+"&to="+encodeURIComponent(g)+(null!=e?"&secret="+encodeURIComponent(e):""),mxUtils.bind(this,function(e){this.file.stats.bytesReceived+=e.getText().length;window.clearTimeout(k);if(f&&(null==d||!d()))if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var g=null,p=[];if(200<=e.getStatus()&&299>=e.getStatus()&&0<e.getText().length)try{var x=JSON.parse(e.getText());if(null!=x&&0<x.length)for(var A=0;A<x.length;A++){var y=this.stringToObject(x[A]);
if(y.v>DrawioFileSync.PROTOCOL){n=!0;p=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)g=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,g,a,c,b,d)):m<=this.maxCacheReadyRetries&&!n&&401!=e.getStatus()?(m++,this.file.stats.cacheMiss++,window.setTimeout(t,(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(t,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,e,g){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),m=this.file.getDescriptorEtag(b);if(!l){for(g=0;g<a.length;g++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
@ -8942,17 +8942,17 @@ DriveClient.prototype.getXmlFile=function(a,c,b,d,e){try{var g=gapi.auth.getToke
l)?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(q){if(null!=b)b(q);else throw q;}}),a.title):c(g?new LocalFile(this.ui,d,a.title,!0):new DriveFile(this.ui,d,a))}}catch(u){if(null!=b)b(u);else throw u;}}),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(m){if(null!=b)b(m);else throw m;}};
DriveClient.prototype.saveFile=function(a,c,b,d,e,g,l,m){var n=mxUtils.bind(this,function(b){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()+"."+a.desc.headRevisionId+"."+a.desc.modifiedDate+"-size-"+a.getSize(),action:c,label:(null!=this.user?this.user.id:"unknown-user")+"."+(null!=a.sync?a.sync.clientId+"-chan-"+
(a.sync.channelId||"none"):"-nosync")+(this.ui.editor.autosave?"-autosave-on":"-autosave-off")})}}catch(A){}}),t=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:"unknown")+"."+(null!=a.sync?a.sync.clientId:"nosync")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(C){}});
try{if(a.isEditable()&&null!=a.desc){var f=(new Date).getTime(),k=a.desc.etag,p=a.desc.modifiedDate,u=a.desc.headRevisionId,q=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;g=null!=g?g:!1;var x=mxUtils.bind(this,function(d,e,A){try{var B=null,x=!1,v={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)?(v.mimeType=this.xmlMimeType,B=a.desc,x=c=!0):"application/octet-stream"==v.mimeType&&
(v.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)}));A||(null!=d||g||(d=this.placeholderThumbnail,e=this.placeholderMimeType),null!=d&&null!=e&&(v.thumbnail={image:d,mimeType:e}));var z=a.getData(),y=mxUtils.bind(this,function(d){try{a.saveDelay=(new Date).getTime()-f;var e=(new Date(d.modifiedDate)).getTime()-
(a.sync.channelId||"none"):"-nosync")+(this.ui.editor.autosave?"-autosave-on":"-autosave-off")})}}catch(z){}}),t=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:"unknown")+"."+(null!=a.sync?a.sync.clientId:"nosync")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(C){}});
try{if(a.isEditable()&&null!=a.desc){var f=(new Date).getTime(),k=a.desc.etag,p=a.desc.modifiedDate,u=a.desc.headRevisionId,q=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;g=null!=g?g:!1;var x=mxUtils.bind(this,function(d,e,z){try{var B=null,x=!1,v={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)?(v.mimeType=this.xmlMimeType,B=a.desc,x=c=!0):"application/octet-stream"==v.mimeType&&
(v.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)}));z||(null!=d||g||(d=this.placeholderThumbnail,e=this.placeholderMimeType),null!=d&&null!=e&&(v.thumbnail={image:d,mimeType:e}));var y=a.getData(),A=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||k==d.etag||c&&u==d.headRevisionId){var g=[];0>=e&&g.push("invalid modified time");k==d.etag&&g.push("stale etag");c&&u==d.headRevisionId&&g.push("stale revision");var l=g.join(", ");n({message:mxResources.get("errorSavingFile")+": "+l},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:"unknown")+"."+(null!=
a.sync?a.sync.clientId:"nosync")+"\nErrors="+l+"\nOld="+u+" "+p+" 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-"+u+"."+p+"-"+this.ui.hashValue(k)+"-to-"+d.headRevisionId+"."+d.modifiedDate+"-"+this.ui.hashValue(d.etag)+(0<l.length?"-errors-"+l:""),null!=this.user?this.user.id:"unknown")}catch(L){}}else{b(d,z);if(null!=B){this.executeRequest(gapi.client.drive.revisions.get({fileId:B.id,
a.sync?a.sync.clientId:"nosync")+"\nErrors="+l+"\nOld="+u+" "+p+" 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-"+u+"."+p+"-"+this.ui.hashValue(k)+"-to-"+d.headRevisionId+"."+d.modifiedDate+"-"+this.ui.hashValue(d.etag)+(0<l.length?"-errors-"+l:""),null!=this.user?this.user.id:"unknown")}catch(L){}}else{b(d,y);if(null!=B){this.executeRequest(gapi.client.drive.revisions.get({fileId:B.id,
revisionId:B.headRevisionId,supportsTeamDrives:!0}),mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest(gapi.client.drive.revisions.update({fileId:B.id,revisionId:B.headRevisionId,resource:a}))})));try{EditorUi.logEvent({category:a.convertedFrom+"-CONVERT-FILE-"+a.getHash(),action:"from-"+B.id+"."+B.headRevisionId+"-to-"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?this.user.id:"unknown-user."+(null!=a.sync?a.sync.clientId:"nosync")})}catch(L){}}try{EditorUi.logEvent({category:"SUCCESS-SAVE-FILE-"+
a.getHash()+"."+u+"."+p,action:"saved-"+d.headRevisionId+"."+d.modifiedDate+"-size-"+a.getSize(),label:(null!=this.user?this.user.id:"unknown-user")+"."+(null!=a.sync?a.sync.clientId+"-chan-"+(a.sync.channelId||"none"):"-nosync")+(this.ui.editor.autosave?"-autosave-on":"-autosave-off")})}catch(L){}}}catch(L){t(L)}}),C=mxUtils.bind(this,function(b,e){try{null!=m&&(v.properties=m);var f=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),g=0,k=mxUtils.bind(this,
function(d){try{var l=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),v,b,c||d||l,e,d?null:f,x),y,mxUtils.bind(this,function(b){try{a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){try{if(null!=c&&c.etag==f)if(g<this.maxRetries)g++,window.setTimeout(k,2*g*this.coolOff*(1+.1*(Math.random()-
function(d){try{var l=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),v,b,c||d||l,e,d?null:f,x),A,mxUtils.bind(this,function(b){try{a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){try{if(null!=c&&c.etag==f)if(g<this.maxRetries)g++,window.setTimeout(k,2*g*this.coolOff*(1+.1*(Math.random()-
.5)));else{k(!0);try{EditorUi.logError("Warning: Stale Etag Overwrite "+a.getHash(),null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown."+(null!=a.sync?a.sync.clientId:"nosync"))}catch(V){}}else null!=n&&n(b,c)}catch(V){t(V)}}),mxUtils.bind(this,function(){null!=n&&n(b)})):n(b)}catch(S){t(S)}}))}catch(X){t(X)}});if(q&&null==d){var p=new Image;p.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/p.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;
b.height=Math.floor(p.height*a);b.getContext("2d").drawImage(p,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");v.thumbnail={image:c,mimeType:"image/png"};k(!1)}catch(S){k(!1)}});p.src="data:image/png;base64,"+b}else k(!1)}catch(T){t(T)}});q?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){C(a,!0)}),n,this.ui.getCurrentFile()!=a?z:null):C(z,!1)}catch(J){t(J)}}),z=mxUtils.bind(this,function(){(g||q||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(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(A){b=null}x(b,"image/png")}catch(A){t(A)}})))&&x(null,null,a.constructor!=DriveLibrary)});e||!c?z():this.verifyMimeType(a.getId(),z,!0)}else this.ui.editor.graph.reset(),
b.height=Math.floor(p.height*a);b.getContext("2d").drawImage(p,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");v.thumbnail={image:c,mimeType:"image/png"};k(!1)}catch(S){k(!1)}});p.src="data:image/png;base64,"+b}else k(!1)}catch(T){t(T)}});q?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){C(a,!0)}),n,this.ui.getCurrentFile()!=a?y:null):C(y,!1)}catch(J){t(J)}}),A=mxUtils.bind(this,function(){(g||q||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(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(z){b=null}x(b,"image/png")}catch(z){t(z)}})))&&x(null,null,a.constructor!=DriveLibrary)});e||!c?A():this.verifyMimeType(a.getId(),A,!0)}else this.ui.editor.graph.reset(),
null!=n&&n({message:mxResources.get("readOnly")})}catch(y){t(y)}};
DriveClient.prototype.verifyMimeType=function(a,c,b,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var e=(new Date).getTime();if(b||e-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=e,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType",supportsTeamDrives:!0}),mxUtils.bind(this,function(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!=
c&&c()})))};
@ -8986,13 +8986,13 @@ DriveClient.prototype.jsonToCell=function(a,c){var b=new mxCell;b.id=a.cellId.js
DriveClient.prototype.checkRealtimeFiles=function(a){var c=null!=this.user&&null!=this.user.email?this.user.email:null;this.executeRequest(gapi.client.drive.files.list({maxResults:1,q:"mimeType='application/vnd.jgraph.mxfile.realtime'"+(null!=c?" and '"+c+"' in writers":""),includeTeamDriveItems:!0,supportsTeamDrives:!0}),mxUtils.bind(this,function(b){null!=b&&(null!=b.nextPageToken||null!=b.items&&0<b.items.length)&&a()}))};
DriveClient.prototype.convertRealtimeFiles=function(){var a=document.createElement("div");a.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;padding:8px;background:#ffffff;z-index:2;overflow:auto;white-space:nowrap;line-height:1.5em;";document.body.appendChild(a);var c=Date.now(),b=mxUtils.bind(this,function(b,c){a.innerHTML+=b+(c?"":"<br>");a.scrollTop=a.scrollHeight});b("draw.io ("+EditorUi.VERSION+") is searching files to be converted...");this.ui.spinner.spin(document.body,
"Searching files...")?this.checkToken(mxUtils.bind(this,function(){var a={},e=0,g=0,l=0,m=0,n=0,t=0,f=0,k=0,p=0,u=null!=this.user&&null!=this.user.email?this.user.email:null,q="mimeType='application/vnd.jgraph.mxfile.realtime'"+(null!=u?" and '"+u+"' in writers":""),x=mxUtils.bind(this,function(){this.ui.spinner.stop();b("<br>Conversion complete. Successfully converted "+e+" file(s).",!0);0<f?b(" Failed to convert "+f+' file(s).<br><br><b>ACTION REQUIRED:</b><br><ul><li>Click <a target="_blank" href="https://drive.google.com/drive/u/0/search?q=type:application/vnd.jgraph.mxfile.realtime">here</a> to list all affected files</li><li>Open each file in turn by right-clicking the file and selecting open with draw.io</li><li>Open each file in turn. When loaded, select File->Save</li></ul>'):
b("<br><br>This window can now be closed.");try{var a=Date.now()-c;EditorUi.logEvent({category:"AUTO-CONVERT",action:"total-"+k+"-xml-"+l+"-json-"+g+"-done-"+e+"-fail-"+f+"-load-"+m+"-save-"+t+"-invalid-"+n+"-dt-"+Math.round(a/1E3),label:null!=this.user?this.user.id:"unknown-user"})}catch(G){}}),z=function(a){return null==a?"":null!=a.message?a.message:null!=a.error&&null!=a.error.message?a.error.message:""},y=mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,"Converting "+k+" file(s)")){b("Found "+
k+" file(s). This will take up to "+Math.ceil(5E3*k/6E4)+" minute(s). <b>Please do not close this window!</b><br>");var c=0,d=mxUtils.bind(this,function(A,B){var v={maxResults:1,q:q,includeTeamDriveItems:!0,supportsTeamDrives:!0};null!=A&&(v.pageToken=A);var u=!0,G=window.setTimeout(mxUtils.bind(this,function(){u=!1;d(A,B)}),this.ui.timeout);this.executeRequest(gapi.client.drive.files.list(v),mxUtils.bind(this,function(q){window.clearTimeout(G);if(u){var v=mxUtils.bind(this,function(){null!=q.nextPageToken?
d(q.nextPageToken):x()});if(null!=q&&null!=q.error)p++,4>p?d(A,B):(this.ui.spinner.stop(),b("Query for next file failed multiple times. Exiting.<br><br>This window can now be closed."));else if(null==q||null!=q.items&&0!=q.items.length||null==q.nextPageToken)if(null!=q&&null!=q.items&&0<q.items.length){var E=q.items[0].id;this.ui.spinner.stop();c++;this.ui.spinner.spin(document.body,"Converting file "+c+" of "+k)&&(b("Converting "+c+" of "+k+': "'+mxUtils.htmlEntities(q.items[0].title)+'" (<a href="https://drive.google.com/open?id='+
b("<br><br>This window can now be closed.");try{var a=Date.now()-c;EditorUi.logEvent({category:"AUTO-CONVERT",action:"total-"+k+"-xml-"+l+"-json-"+g+"-done-"+e+"-fail-"+f+"-load-"+m+"-save-"+t+"-invalid-"+n+"-dt-"+Math.round(a/1E3),label:null!=this.user?this.user.id:"unknown-user"})}catch(G){}}),A=function(a){return null==a?"":null!=a.message?a.message:null!=a.error&&null!=a.error.message?a.error.message:""},y=mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,"Converting "+k+" file(s)")){b("Found "+
k+" file(s). This will take up to "+Math.ceil(5E3*k/6E4)+" minute(s). <b>Please do not close this window!</b><br>");var c=0,d=mxUtils.bind(this,function(z,B){var v={maxResults:1,q:q,includeTeamDriveItems:!0,supportsTeamDrives:!0};null!=z&&(v.pageToken=z);var u=!0,G=window.setTimeout(mxUtils.bind(this,function(){u=!1;d(z,B)}),this.ui.timeout);this.executeRequest(gapi.client.drive.files.list(v),mxUtils.bind(this,function(q){window.clearTimeout(G);if(u){var v=mxUtils.bind(this,function(){null!=q.nextPageToken?
d(q.nextPageToken):x()});if(null!=q&&null!=q.error)p++,4>p?d(z,B):(this.ui.spinner.stop(),b("Query for next file failed multiple times. Exiting.<br><br>This window can now be closed."));else if(null==q||null!=q.items&&0!=q.items.length||null==q.nextPageToken)if(null!=q&&null!=q.items&&0<q.items.length){var E=q.items[0].id;this.ui.spinner.stop();c++;this.ui.spinner.spin(document.body,"Converting file "+c+" of "+k)&&(b("Converting "+c+" of "+k+': "'+mxUtils.htmlEntities(q.items[0].title)+'" (<a href="https://drive.google.com/open?id='+
E+'" target="_blank">'+E+"</a>)... ",!0),window.setTimeout(mxUtils.bind(this,function(){null==a[E]?(u=a[E]=!0,G=window.setTimeout(mxUtils.bind(this,function(){u=!1;f++;m++;b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Timeout');v()}),this.ui.timeout),this.getFile(E,mxUtils.bind(this,function(a){window.clearTimeout(G);u&&(a.constructor==DriveFile?("json"==a.convertedFrom?g++:l++,u=!0,G=window.setTimeout(mxUtils.bind(this,function(){u=!1;f++;t++;b('<img src="'+
this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Timeout');v()}),this.ui.timeout),this.saveFile(a,null,mxUtils.bind(this,function(){window.clearTimeout(G);u&&(e++,b('OK <img src="'+Editor.checkmarkImage+'" border="0" valign="middle"/>'),v())}),mxUtils.bind(this,function(a){window.clearTimeout(G);u&&(a=z(a),f++,t++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+a),v())}))):(f++,n++,b('<img src="'+this.ui.editor.graph.warningImage.src+
'" border="0" valign="absmiddle"/> Invalid file'),v()))}),mxUtils.bind(this,function(a){window.clearTimeout(G);u&&(a=z(a),f++,m++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+a),v())}))):(this.ui.spinner.stop(),b("Search returned duplicate file "+E+". Exiting.<br><br>This window can now be closed."))}),null!=B?B:2E3))}else x();else d(q.nextPageToken,1E4)}}))});d()}}),C={maxResults:1E4,q:q,includeTeamDriveItems:!0,supportsTeamDrives:!0},A=mxUtils.bind(this,
function(a){null!=a&&(C.pageToken=a);this.executeRequest(gapi.client.drive.files.list(C),mxUtils.bind(this,function(a){k+=null!=a&&null!=a.items?a.items.length:0;null!=a.nextPageToken?A(a.nextPageToken):(this.ui.spinner.stop(),this.ui.confirm("You are about to convert "+k+" file(s)",mxUtils.bind(this,function(){y()}),mxUtils.bind(this,function(){b("Cancelled by user.<br><br>This window can now be closed.")})))}))});A()})):(this.ui.spinner.stop(),b("Busy. <br><br>This window can now be closed."))};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};
this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Timeout');v()}),this.ui.timeout),this.saveFile(a,null,mxUtils.bind(this,function(){window.clearTimeout(G);u&&(e++,b('OK <img src="'+Editor.checkmarkImage+'" border="0" valign="middle"/>'),v())}),mxUtils.bind(this,function(a){window.clearTimeout(G);u&&(a=A(a),f++,t++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+a),v())}))):(f++,n++,b('<img src="'+this.ui.editor.graph.warningImage.src+
'" border="0" valign="absmiddle"/> Invalid file'),v()))}),mxUtils.bind(this,function(a){window.clearTimeout(G);u&&(a=A(a),f++,m++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+a),v())}))):(this.ui.spinner.stop(),b("Search returned duplicate file "+E+". Exiting.<br><br>This window can now be closed."))}),null!=B?B:2E3))}else x();else d(q.nextPageToken,1E4)}}))});d()}}),C={maxResults:1E4,q:q,includeTeamDriveItems:!0,supportsTeamDrives:!0},z=mxUtils.bind(this,
function(a){null!=a&&(C.pageToken=a);this.executeRequest(gapi.client.drive.files.list(C),mxUtils.bind(this,function(a){k+=null!=a&&null!=a.items?a.items.length:0;null!=a.nextPageToken?z(a.nextPageToken):(this.ui.spinner.stop(),this.ui.confirm("You are about to convert "+k+" file(s)",mxUtils.bind(this,function(){y()}),mxUtils.bind(this,function(){b("Cancelled by user.<br><br>This window can now be closed.")})))}))});z()})):(this.ui.spinner.stop(),b("Busy. <br><br>This window can now be closed."))};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=[],g=b.entries.length-1;0<=g;g--)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[g]);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){this.doSave(this.getTitle(),c,b)};DropboxFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};
@ -9053,7 +9053,7 @@ b,e))}),b)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authentic
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,e){e=null!=e?e:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var d=JSON.parse(a.getText()),g=/\.png$/i.test(d.name);if(/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||!this.ui.useCanvasForExport&&g)this.ui.convertFile(d["@microsoft.graph.downloadUrl"],d.name,null!=d.file?d.file.mimeType:null,this.extension,c,b);else{var n=!0,t=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(t),n){var f=g?a.lastIndexOf(","):-1,l=null;if(0<f){var m=this.ui.extractGraphModelFromPng(a.substring(f+1));null!=m&&0<m.length?a=m:l=new LocalFile(this.ui,a,d.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var q=a.substring(22);a=window.atob&&!mxClient.IS_SF?atob(q):Base64.decode(q)}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!=l?c(l):e?c(new OneDriveLibrary(this.ui,a,d)):c(new OneDriveFile(this.ui,a,d))}}catch(x){if(null!=b)b(x);else throw x;
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):e?c(new OneDriveLibrary(this.ui,a,d)):c(new OneDriveFile(this.ui,a,d))}}catch(x){if(null!=b)b(x);else throw x;
}}),mxUtils.bind(this,function(a){window.clearTimeout(t);n&&b(this.parseRequestText(a))}),g||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(e){e?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 e=this.getItemRef(a);c.driveId!=e.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,e){this.insertFile(a,c,b,d,!0,e)};
@ -9087,7 +9087,7 @@ GitHubClient.prototype.getFile=function(a,c,b,d,e){d=null!=d?d:!1;var g=a.split(
a=new mxXmlRequest(this.baseUrl+"/repos/"+l+"/"+m+"/contents/"+a+"?ref="+n+e,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{c(this.createGitHubFile(l,m,n,JSON.parse(a.getText()),d))}catch(f){b(f)}}),b))};
GitHubClient.prototype.createGitHubFile=function(a,c,b,d,e){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&&("PG14ZmlsZS"==c.substring(0,10)?c=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c):/\.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 e?new GitHubLibrary(this.ui,c,a):new GitHubFile(this.ui,c,a)};GitHubClient.prototype.insertLibrary=function(a,c,b,d,e){this.insertFile(a,c,b,d,!0,e,!1)};
GitHubClient.prototype.insertFile=function(a,c,b,d,e,g,l){e=null!=e?e:!1;g=g.split("/");var m=g[0],n=g[1],t=g[2],f=g.slice(3,g.length).join("/");0<f.length&&(f+="/");f+=a;this.checkExists(m+"/"+n+"/"+t+"/"+f,!0,mxUtils.bind(this,function(g,p){g?e?(l||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(m,n,t,f,a,c,p,mxUtils.bind(this,function(a){try{var c=JSON.parse(a.getText());b(this.createGitHubFile(m,n,t,c.content,e))}catch(z){d(z)}}),d)}),d)):b(new GitHubFile(this.ui,
GitHubClient.prototype.insertFile=function(a,c,b,d,e,g,l){e=null!=e?e:!1;g=g.split("/");var m=g[0],n=g[1],t=g[2],f=g.slice(3,g.length).join("/");0<f.length&&(f+="/");f+=a;this.checkExists(m+"/"+n+"/"+t+"/"+f,!0,mxUtils.bind(this,function(g,p){g?e?(l||(c=Base64.encode(c)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(m,n,t,f,a,c,p,mxUtils.bind(this,function(a){try{var c=JSON.parse(a.getText());b(this.createGitHubFile(m,n,t,c.content,e))}catch(A){d(A)}}),d)}),d)):b(new GitHubFile(this.ui,
c,{org:m,repo:n,ref:t,name:a,path:f,sha:p,isNew:!0})):d()}))};GitHubClient.prototype.showCommitDialog=function(a,c,b,d){var e=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(c?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){e();b(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){d()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
GitHubClient.prototype.writeFile=function(a,c,b,d,e,g,l,m,n){g.length>=this.maxFileSize?n({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(g.length)+" / 1 MB)"}):(b={path:d,branch:decodeURIComponent(b),message:e,content:g},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){m(a)}),n))};
GitHubClient.prototype.checkExists=function(a,c,b){this.getFile(a,mxUtils.bind(this,function(d){if(c&&null!=d.meta){var e=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){e();b(!0,d.meta.sha)},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)};
@ -9095,14 +9095,14 @@ GitHubClient.prototype.saveFile=function(a,c,b,d,e){var g=a.meta.org,l=a.meta.re
Base64.encode(a.getData()))});d?this.getFile(g+"/"+l+"/"+encodeURIComponent(m)+"/"+n,mxUtils.bind(this,function(b){a.meta.sha=b.meta.sha;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,e=null,g=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="224px";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";l.appendChild(m);var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.overflow="auto";n.style.lineHeight="1.2em";
n.style.height="194px";l.appendChild(n);var t=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){c(b+"/"+d+"/"+encodeURIComponent(e)+"/"+g)}));this.ui.showDialog(t.container,340,270,!0,!0);a&&t.okButton.parentNode.removeChild(t.okButton);var f=mxUtils.bind(this,function(a,b){var c=document.createElement("a");c.setAttribute("href","javascript:void(0);");mxUtils.write(c,a);mxEvent.addListener(c,"click",b);return c}),k=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom=
"8px";c.appendChild(f(b+"/"+d,mxUtils.bind(this,function(){g=null;y()})));a||(mxUtils.write(c," / "),c.appendChild(f(decodeURIComponent(e),mxUtils.bind(this,function(){g=null;z()}))));if(null!=g&&0<g.length){var k=g.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(f(k[a],mxUtils.bind(this,function(){g=k.slice(0,a+1).join("/");u()})))})(a)}n.appendChild(c)}),p=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();
"8px";c.appendChild(f(b+"/"+d,mxUtils.bind(this,function(){g=null;y()})));a||(mxUtils.write(c," / "),c.appendChild(f(decodeURIComponent(e),mxUtils.bind(this,function(){g=null;A()}))));if(null!=g&&0<g.length){var k=g.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(f(k[a],mxUtils.bind(this,function(){g=k.slice(0,a+1).join("/");u()})))})(a)}n.appendChild(c)}),p=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();
null!=this.getUser()?(g=e=d=b=null,y()):this.ui.hideDialog()}))}),u=mxUtils.bind(this,function(){var l=new mxXmlRequest(this.baseUrl+"/repos/"+b+"/"+d+"/contents/"+g+"?ref="+encodeURIComponent(e),null,"GET");t.okButton.removeAttribute("disabled");n.innerHTML="";this.ui.spinner.spin(n,mxResources.get("loading"));this.executeRequest(l,mxUtils.bind(this,function(l){k();this.ui.spinner.stop();var m=JSON.parse(l.getText());n.appendChild(f("../ [Up]",mxUtils.bind(this,function(){if(""==g)g=null,y();else{var a=
g.split("/");g=a.slice(0,a.length-1).join("/");u()}})));mxUtils.br(n);null==m||0==m.length?mxUtils.write(n,mxResources.get("noFiles")):(l=mxUtils.bind(this,function(k){for(var l=0;l<m.length;l++)mxUtils.bind(this,function(l){k==("dir"==l.type)&&(n.appendChild(f(l.name+("dir"==l.type?"/":""),mxUtils.bind(this,function(){"dir"==l.type?(g=l.path,u()):a&&"file"==l.type&&(this.ui.hideDialog(),c(b+"/"+d+"/"+encodeURIComponent(e)+"/"+l.path))}))),mxUtils.br(n))})(m[l])}),l(!0),a&&l(!1))}),p,!0)}),q=null,
x=null,z=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");t.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(n,
"scroll",x);z(a+1)});mxEvent.addListener(q,"click",l);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(k(!0),n.appendChild(f("../ [Up]",mxUtils.bind(this,function(){g=null;y()}))),mxUtils.br(n));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){n.appendChild(f(a.name,mxUtils.bind(this,function(){e=a.name;g="";u()})));mxUtils.br(n)})(b[c]);100==b.length&&(n.appendChild(q),
x=null,A=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");t.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(n,
"scroll",x);A(a+1)});mxEvent.addListener(q,"click",l);this.executeRequest(c,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(k(!0),n.appendChild(f("../ [Up]",mxUtils.bind(this,function(){g=null;y()}))),mxUtils.br(n));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){n.appendChild(f(a.name,mxUtils.bind(this,function(){e=a.name;g="";u()})));mxUtils.br(n)})(b[c]);100==b.length&&(n.appendChild(q),
x=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&l()},mxEvent.addListener(n,"scroll",x))}}),p)}),y=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");t.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(n,mxResources.get("loading"));null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");
mxUtils.write(q,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(n,"scroll",x);y(a+1)});mxEvent.addListener(q,"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(f(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,g=e=null,z()):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;e=decodeURIComponent(a.meta.ref);g="";u()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),
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,g=e=null,A()):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;e=decodeURIComponent(a.meta.ref);g="";u()}),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 l=0;l<c.length;l++)mxUtils.bind(this,function(a){n.appendChild(f(a.full_name,mxUtils.bind(this,function(){b=a.owner.login;d=a.name;e=a.default_branch;g="";u()})));mxUtils.br(n)})(c[l])}100==c.length&&(n.appendChild(q),x=function(){n.scrollTop>=n.scrollHeight-n.offsetHeight&&k()},mxEvent.addListener(n,"scroll",
x))}),p)});y()};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)};
@ -9189,7 +9189,7 @@ App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxVie
App.prototype.getThumbnail=function(a,c){var b=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var d=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),e=d.getGlobalVariable,g=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(g.root)}if(mxClient.IS_CHROMEAPP||!d.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
function(a){try{d!=this.editor.graph&&null!=d.container.parentNode&&d.container.parentNode.removeChild(d.container)}catch(y){a=null}c(a)}),a,this.thumbImageCache,"#ffffff",function(){c()},null,null,null,null,null,null,d),b=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var l=document.createElement("canvas"),m=d.getGraphBounds(),n=a/m.width,n=Math.min(1,Math.min(3*a/(4*m.height),n)),t=Math.floor(m.x),f=Math.floor(m.y);l.setAttribute("width",Math.ceil(n*(m.width+4)));l.setAttribute("height",
Math.ceil(n*(m.height+4)));var k=l.getContext("2d");k.scale(n,n);k.translate(-t,-f);var p=d.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";k.save();k.fillStyle=p;k.fillRect(t,f,Math.ceil(m.width+4),Math.ceil(m.height+4));k.restore();var u=new mxJsCanvas(l),q=new mxAsyncCanvas(this.thumbImageCache);u.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(d.getView().getState(d.model.root),q);q.finish(mxUtils.bind(this,function(){try{x.drawState(d.getView().getState(d.model.root),u),d!=this.editor.graph&&null!=d.container.parentNode&&d.container.parentNode.removeChild(d.container)}catch(z){l=null}c(l)}));b=!0}}catch(z){d!=this.editor.graph&&null!=d.container.parentNode&&d.container.parentNode.removeChild(d.container)}return b};
-.5),b.restore())};x.drawText=function(a,b){};x.drawState(d.getView().getState(d.model.root),q);q.finish(mxUtils.bind(this,function(){try{x.drawState(d.getView().getState(d.model.root),u),d!=this.editor.graph&&null!=d.container.parentNode&&d.container.parentNode.removeChild(d.container)}catch(A){l=null}c(l)}));b=!0}}catch(A){d!=this.editor.graph&&null!=d.container.parentNode&&d.container.parentNode.removeChild(d.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="default")}if(b)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var e=new Date;e.setYear(e.getFullYear()+1);document.cookie="MODE="+c+"; expires="+e.toUTCString()}}catch(g){}}})();
@ -9262,13 +9262,14 @@ mxResources.get("browser")+")":a.constructor==LocalLibrary&&(c+=" ("+mxResources
App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a,c){c||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),c=mxUtils.bind(this,function(b,c){var d=0,g=[],l=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var a=b.length-1;0<=a;a--)null!=g[a]&&this.loadLibrary(g[a]);null!=c&&c()}});if(null!=b)for(var m=0;m<b.length;m++){var n=encodeURIComponent(decodeURIComponent(b[m]));mxUtils.bind(this,
function(b,c){if(null!=b&&0<b.length&&null==this.pendingLibraries[b]&&null==this.sidebar.palettes[b]){d++;var e=mxUtils.bind(this,function(a){delete this.pendingLibraries[b];g[c]=a;d--;l()}),f=mxUtils.bind(this,function(c){a(b,c);d--;l()});this.pendingLibraries[b]=!0;var m=b.substring(0,1);if("L"==m)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var a=decodeURIComponent(b.substring(1));this.getLocalData(a,mxUtils.bind(this,function(b){".scratchpad"==a&&
null==b&&(b=this.emptyLibraryXml);null!=b?e(new StorageLibrary(this,b,a)):f()}))}catch(C){f()}}),0);else if("U"==m){var n=decodeURIComponent(b.substring(1));if(!this.isOffline()){m=n;this.editor.isCorsEnabledForUrl(m)||(m="t="+(new Date).getTime(),m=PROXY_URL+"?url="+encodeURIComponent(n)+"&"+m);try{mxUtils.get(m,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{e(new UrlLibrary(this,a.getText(),n))}catch(C){f()}else f()}),function(){f()})}catch(y){f()}}}else if("R"==m){if(m=
decodeURIComponent(b.substring(1)),!this.isOffline())try{var m=JSON.parse(m),t={id:m[0],title:m[1],downloadUrl:m[2]};this.remoteInvoke("getFileContent",[t.downloadUrl],null,mxUtils.bind(this,function(a){try{e(new RemoteLibrary(this,a,t))}catch(C){f()}}),function(){f()})}catch(y){f()}}else{var z=null;"G"==m?null!=this.drive&&null!=this.drive.user&&(z=this.drive):"H"==m?null!=this.gitHub&&null!=this.gitHub.getUser()&&(z=this.gitHub):"T"==m?null!=this.trello&&this.trello.isAuthorized()&&(z=this.trello):
"D"==m?null!=this.dropbox&&null!=this.dropbox.getUser()&&(z=this.dropbox):"W"==m&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(z=this.oneDrive);null!=z?z.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(a){try{e(a)}catch(C){f()}}),function(a){f()}):f(!0)}}})(n,m)}l()});c(mxSettings.getCustomLibraries(),function(){c((urlParams.clibs||"").split(";"))})}};
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"),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.padding="0 10px 0 10px",this.shareButton.style.marginTop="-4px",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),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()}),e=mxUtils.bind(this,function(a){b.handleFileError(a,!0)});try{a==b.getTitle()?b.save(!0,d,e):b.saveAs(a,d,e)}catch(g){b.handleFileError(g,!0)}}};
decodeURIComponent(b.substring(1)),!this.isOffline())try{var m=JSON.parse(m),t={id:m[0],title:m[1],downloadUrl:m[2]};this.remoteInvoke("getFileContent",[t.downloadUrl],null,mxUtils.bind(this,function(a){try{e(new RemoteLibrary(this,a,t))}catch(C){f()}}),function(){f()})}catch(y){f()}}else if("S"==m&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(b.substring(1)),function(a){e(a)},f)}catch(y){f()}else{var A=null;"G"==m?null!=this.drive&&null!=this.drive.user&&(A=this.drive):"H"==
m?null!=this.gitHub&&null!=this.gitHub.getUser()&&(A=this.gitHub):"T"==m?null!=this.trello&&this.trello.isAuthorized()&&(A=this.trello):"D"==m?null!=this.dropbox&&null!=this.dropbox.getUser()&&(A=this.dropbox):"W"==m&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(A=this.oneDrive);null!=A?A.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(a){try{e(a)}catch(C){f()}}),function(a){f()}):f(!0)}}})(n,m)}l()});c(mxSettings.getCustomLibraries(),function(){c((urlParams.clibs||
"").split(";"))})}};
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"),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.padding="0 10px 0 10px",this.shareButton.style.marginTop="-4px",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),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()}),e=mxUtils.bind(this,function(a){b.handleFileError(a,!0)});try{a==b.getTitle()?b.save(!0,d,e):b.saveAs(a,d,e)}catch(g){b.handleFileError(g,!0)}}};
App.prototype.pickFolder=function(a,c,b,d,e){b=null!=b?b:!0;var g=this.spinner.pause();b&&a==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(a){g();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)}}),e):b&&a==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(a){g();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){g();c(a)})):b&&a==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(a){g();c(a)})):EditorUi.prototype.pickFolder.apply(this,arguments)};
App.prototype.exportFile=function(a,c,b,d,e,g){e==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)})):e==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(c,a,g,mxUtils.bind(this,function(a){this.spinner.stop()}),
@ -9325,10 +9326,10 @@ function(b,c,d,e,f,g,k,l,m,n){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,
a.showDialog(b.container,620,440,!0,!0)})).isEnabled=e;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(c?"compressed":"allPages"),!0);g.style.marginBottom="16px";mxEvent.addListener(f,"change",function(){f.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("xml",c?!g.checked:null,null,!f.checked,c?null:!g.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!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(a.isOffline()||a.printPdfExport)a.showDialog((new PrintDialog(a,mxResources.get("formatPdf"))).container,
360,null!=a.pages&&1<a.pages.length?420:360,!0,!0);else{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=146;if(a.pdfPageExport&&!b){var g=a.addRadiobox(c,
"pages",mxResources.get("allPages"),!0),f=a.addRadiobox(c,"pages",mxResources.get("currentPage",null,"Current Page"),!1),k=a.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),l=a.addCheckbox(c,mxResources.get("crop"),!1,!0);mxEvent.addListener(g,"change",e);mxEvent.addListener(f,"change",e);mxEvent.addListener(k,"change",e);f=205}else k=a.addCheckbox(c,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),l=a.addCheckbox(c,mxResources.get("crop"),!d.pageVisible||
!a.pdfPageExport,!a.pdfPageExport),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,mxResources.get("export"));a.showDialog(c.container,300,f,!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"),
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=146;if(a.pdfPageExport&&!b){var g=a.addRadiobox(c,"pages",mxResources.get("allPages"),!0),f=a.addRadiobox(c,"pages",mxResources.get("currentPage",
null,"Current Page"),!1),k=a.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),l=a.addCheckbox(c,mxResources.get("crop"),!1,!0);mxEvent.addListener(g,"change",e);mxEvent.addListener(f,"change",e);mxEvent.addListener(k,"change",e);f=205}else k=a.addCheckbox(c,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),l=a.addCheckbox(c,mxResources.get("crop"),!d.pageVisible||!a.pdfPageExport,!a.pdfPageExport),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,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");var t=a.actions.addAction("synchronize",function(){a.synchronizeCurrentFile("none"==
DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&(t.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&&(t=a.actions.addAction("mathematicalTypesetting",
@ -9394,11 +9395,11 @@ mxResources.get("saving"))&&b.saveAs(c,mxUtils.bind(this,function(c){b.desc=c;b.
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(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"],c)})));var x=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,e())},z=function(a,b,c,e){var f=
urlParams.embed||a.isOffline()||this.addMenuItems(b,["-","googleDocs","googleSlides"],c)})));var x=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,e())},A=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=e;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=e;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=e;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=e;var y=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):x(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&&
!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(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=e;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=e;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=e;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=e;var y=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):x(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.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);y(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c,null,e())})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){y(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,
c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):g&&"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)},
@ -9486,19 +9487,19 @@ b?b.style:q.getCellStyle(a)).containerType);return b}function d(a){var b=!1;null
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 n(a,b){b=null!=b?b:!0;q.model.beginUpdate();try{var c=q.model.getParent(a),d=q.getIncomingEdges(a),e=q.cloneCells([d[0],a]);q.model.setTerminal(e[0],q.model.getTerminal(d[0],!0),!0);var f=m(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;q.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=q.view.getState(a),l=q.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)*l:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=q.getOutgoingEdges(q.model.getTerminal(d[0],!0));if(null!=p){for(var t=f==mxConstants.DIRECTION_SOUTH||
f==mxConstants.DIRECTION_NORTH,u=g=d=0;u<p.length;u++){var x=q.model.getTerminal(p[u],!1);if(f==m(x)){var v=q.view.getState(x);x!=a&&null!=v&&(t&&b!=v.getCenterX()<k.getCenterX()||!t&&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))/l),g=10+Math.max(g,(Math.min(n.y+n.height,v.y+v.height)-Math.max(n.y,v.y))/l))}}t?g=0:d=0;for(u=0;u<p.length;u++)if(x=q.model.getTerminal(p[u],!1),f==m(x)&&(v=q.view.getState(x),x!=a&&null!=
v&&(t&&b!=v.getCenterX()<k.getCenterX()||!t&&b!=v.getCenterY()<k.getCenterY()))){var z=[];q.traverse(v.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});q.moveCells(z,(b?1:-1)*d,(b?1:-1)*g)}}}return q.addCells(e,c)}finally{q.model.endUpdate()}}function t(a){q.model.beginUpdate();try{var b=m(a),c=q.getIncomingEdges(a),d=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],d[1],!1);q.model.setTerminal(d[0],d[1],!0);q.model.setTerminal(d[0],a,!1);var e=q.model.getParent(a),f=e.geometry,g=[];q.view.currentRoot!=
v&&(t&&b!=v.getCenterX()<k.getCenterX()||!t&&b!=v.getCenterY()<k.getCenterY()))){var B=[];q.traverse(v.cell,!0,function(a,b){null!=b&&B.push(b);B.push(a);return!0});q.moveCells(B,(b?1:-1)*d,(b?1:-1)*g)}}}return q.addCells(e,c)}finally{q.model.endUpdate()}}function t(a){q.model.beginUpdate();try{var b=m(a),c=q.getIncomingEdges(a),d=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],d[1],!1);q.model.setTerminal(d[0],d[1],!0);q.model.setTerminal(d[0],a,!1);var e=q.model.getParent(a),f=e.geometry,g=[];q.view.currentRoot!=
e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);q.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);q.moveCells(g,k,l);return q.addCells(d,e)}finally{q.model.endUpdate()}}function f(a){q.model.beginUpdate();try{var b=q.model.getParent(a),c=q.getIncomingEdges(a),d=q.cloneCells([c[0],
a]);q.model.setTerminal(d[0],a,!0);var c=q.getOutgoingEdges(a),e=b.geometry,f=[];q.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=q.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var l=q.view.getBounds(f),n=m(a),p=q.view.translate,t=q.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/t-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==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/t-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==l?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(l.y+l.height)/t-p.y+-e.y+10);return q.addCells(d,b)}finally{q.model.endUpdate()}}function k(a,b,c){a=q.getOutgoingEdges(a);c=q.view.getState(c);var d=
[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=q.view.getState(q.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 p(a,b){var c=m(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==d&&c!=b?u.actions.get("selectParent").funct():
c==b?(d=q.getOutgoingEdges(a),null!=d&&0<d.length&&q.setSelectionCell(q.model.getTerminal(d[0],!1))):(c=q.getIncomingEdges(a),null!=c&&0<c.length&&(d=k(q.model.getTerminal(c[0],!0),d,a),c=q.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&&q.setSelectionCell(d[c].cell)))))}var u=this,q=u.editor.graph,x=q.getModel(),z=u.menus.createPopupMenu;u.menus.createPopupMenu=function(a,c,d){z.apply(this,arguments);
c==b?(d=q.getOutgoingEdges(a),null!=d&&0<d.length&&q.setSelectionCell(q.model.getTerminal(d[0],!1))):(c=q.getIncomingEdges(a),null!=c&&0<c.length&&(d=k(q.model.getTerminal(c[0],!0),d,a),c=q.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&&q.setSelectionCell(d[c].cell)))))}var u=this,q=u.editor.graph,x=q.getModel(),A=u.menus.createPopupMenu;u.menus.createPopupMenu=function(a,c,d){A.apply(this,arguments);
if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(q.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(q.getSelectionCell())&&(a.addSeparator(),0<q.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};u.actions.addAction("selectChildren",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),
a=q.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+X");u.actions.addAction("selectSiblings",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=q.getOutgoingEdges(q.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+S");
u.actions.addAction("selectParent",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);null!=a&&0<a.length&&q.setSelectionCell(q.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");u.actions.addAction("selectDescendants",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+D");var y=q.removeCells;
q.removeCells=function(a,d){d=null!=d?d:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));d&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];x.isEdge(g)&&c(g)&&(e.push(g),g=x.getTerminal(g,!1));b(g)?(q.traverse(g,!0,function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=q.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return y.apply(this,arguments)};u.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
d))};var C=q.duplicateCells;q.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],a)}this.model.beginUpdate();try{var k=C.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=q.getIncomingEdges(k[e]),g=q.getIncomingEdges(a[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,
q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var A=q.moveCells;q.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 t=0;t<a.length;t++)if(b(a[t])||q.model.isEdge(a[t])&&null==q.model.getTerminal(a[t],!0)){f=q.model.getParent(a[t]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var u=
q.getIncomingEdges(a[0]);if(0<u.length){var x=q.view.getState(q.model.getTerminal(u[0],!0));if(null!=x){var v=q.view.getState(m);null!=v&&(c=(v.getCenterX()-x.getCenterX())/q.view.scale,d=(v.getCenterY()-x.getCenterY())/q.view.scale)}}}}l=A.apply(this,arguments);if(null!=l&&null!=a&&l.length==a.length)for(t=0;t<l.length;t++)if(this.model.isEdge(l[t]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[t],!0))&&this.model.setTerminal(l[t],m,!0);else if(b(a[t])&&(u=q.getIncomingEdges(a[t]),0<u.length))if(!e)b(m)&&
q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var z=q.moveCells;q.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 t=0;t<a.length;t++)if(b(a[t])||q.model.isEdge(a[t])&&null==q.model.getTerminal(a[t],!0)){f=q.model.getParent(a[t]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var u=
q.getIncomingEdges(a[0]);if(0<u.length){var x=q.view.getState(q.model.getTerminal(u[0],!0));if(null!=x){var v=q.view.getState(m);null!=v&&(c=(v.getCenterX()-x.getCenterX())/q.view.scale,d=(v.getCenterY()-x.getCenterY())/q.view.scale)}}}}l=z.apply(this,arguments);if(null!=l&&null!=a&&l.length==a.length)for(t=0;t<l.length;t++)if(this.model.isEdge(l[t]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[t],!0))&&this.model.setTerminal(l[t],m,!0);else if(b(a[t])&&(u=q.getIncomingEdges(a[t]),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==q.getIncomingEdges(l[t]).length){n=m;if(null==n||n==q.model.getParent(a[t]))n=q.model.getTerminal(u[0],!0);e=this.cloneCell(u[0]);this.addEdge(e,q.getDefaultParent(),n,l[t])}}finally{this.model.endUpdate()}return l};if(null!=u.sidebar){var B=u.sidebar.dropAndConnect;u.sidebar.dropAndConnect=function(a,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=B.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=q.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var G={88:u.actions.get("selectChildren"),84:u.actions.get("selectSubtree"),80:u.actions.get("selectParent"),83:u.actions.get("selectSiblings")},v=u.onKeyDown;u.onKeyDown=function(a){try{if(q.isEnabled()&&!q.isEditing()&&b(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&
(9==a.which?c=mxEvent.isShiftDown(a)?t(q.getSelectionCell()):f(q.getSelectionCell()):13==a.which&&(c=n(q.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],!1)):q.setSelectionCell(c[c.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(q.view.getState(q.getSelectionCell())),q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=G[a.keyCode];
@ -9580,13 +9581,13 @@ k.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;he
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";u.appendChild(D);E=mxUtils.bind(this,function(){D.innerHTML=Math.round(100*k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,
E);k.editor.addListener("resetGraphView",E);k.editor.addListener("pageSelected",E);var I=k.setGraphEnabled;k.setGraphEnabled=function(){I.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")}}u.appendChild(k.tabContainer);u.appendChild(m);u.appendChild(k.diagramContainer);g.appendChild(u);k.updateTabContainer();var L=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,g,l){var d=c.y,e=c.x,t=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var k=this,p=new mxCellState,u=this.graph.getView().scale,q=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+e;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var x=[],z=[],y=0;y<this.states.length;y++){var C=this.states[y];C instanceof mxCellState&&(l||!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)?x.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 A=0,B=0,G=C=0,v=0,K=0,H=0,F=0,J=5*u;if(1<x.length){x.push(p);x.sort(function(a,b){return a.y-b.y});var E=!1,y=p==x[0],u=p==x[x.length-1];if(!y&&!u)for(y=1;y<x.length-1;y++)if(p==x[y]){u=x[y-1];y=x[y+1];C=B=G=(y.y-u.y-u.height-p.height)/2;break}for(y=0;y<x.length-1;y++){var u=x[y],D=x[y+1],I=p==u||p==D,D=D.y-u.y-u.height,E=E|p==u;if(0==B&&
0==A)B=D,A=1;else if(Math.abs(B-D)<=(I||1==y&&E?q:0))A+=1;else if(1<A&&E){x=x.slice(0,y+1);break}else if(3<=x.length-y&&!E)A=0,C=B=0!=G?G:0,x.splice(0,0==y?1:y),y=-1;else break;0!=C||I||(B=C=D)}3==x.length&&x[1]==p&&(C=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});E=!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];H=K=F=(y.x-u.x-u.width-p.width)/2;break}for(y=0;y<z.length-1;y++){u=z[y];D=z[y+1];I=p==u||p==D;D=D.x-u.x-u.width;E|=p==
u;if(0==K&&0==v)K=D,v=1;else if(Math.abs(K-D)<=(I||1==y&&E?q:0))v+=1;else if(1<v&&E){z=z.slice(0,y+1);break}else if(3<=z.length-y&&!E)v=0,H=K=0!=F?F:0,z.splice(0,0==y?1:y),y=-1;else break;0!=H||I||(K=H=D)}3==z.length&&z[1]==p&&(H=0)}q=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(k.graph.getView().getOverlayPane());return a};K=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<v&&v==z.length-1){v=[];F=k.guidesArrHor;t=[];e=0;y=z[0]==p?1:0;E=z[y].y+z[y].height;if(0<H)for(y=0;y<z.length-1;y++)u=
z[y],D=z[y+1],p==u?(e=D.x-u.width-H,t.push(new mxPoint(e+u.width+J,E)),t.push(new mxPoint(D.x-J,E))):p==D?(t.push(new mxPoint(u.x+u.width+J,E)),e=u.x+u.width+H,t.push(new mxPoint(e-J,E))):(t.push(new mxPoint(u.x+u.width+J,E)),t.push(new mxPoint(D.x-J,E)));else u=z[0],y=z[2],e=u.x+u.width+(y.x-u.x-u.width-p.width)/2,t.push(new mxPoint(u.x+u.width+J,E)),t.push(new mxPoint(e-J,E)),t.push(new mxPoint(e+p.width+J,E)),t.push(new mxPoint(y.x-J,E));for(y=0;y<t.length;y+=2)z=t[y],H=t[y+1],z=q(z,H,null!=F?
F[y/2]:null),z.node.style.visibility="visible",z.redraw(),v.push(z);for(y=t.length/2;null!=F&&y<F.length;y++)F[y].destroy();k.guidesArrHor=v;e-=b.x;t=!0}else K(!0);if(1<A&&A==x.length-1){v=[];F=k.guidesArrVer;f=[];d=0;y=x[0]==p?1:0;A=x[y].x+x[y].width;if(0<C)for(y=0;y<x.length-1;y++)u=x[y],D=x[y+1],p==u?(d=D.y-u.height-C,f.push(new mxPoint(A,d+u.height+J)),f.push(new mxPoint(A,D.y-J))):p==D?(f.push(new mxPoint(A,u.y+u.height+J)),d=u.y+u.height+C,f.push(new mxPoint(A,d-J))):(f.push(new mxPoint(A,u.y+
u.height+J)),f.push(new mxPoint(A,D.y-J)));else u=x[0],y=x[2],d=u.y+u.height+(y.y-u.y-u.height-p.height)/2,f.push(new mxPoint(A,u.y+u.height+J)),f.push(new mxPoint(A,d-J)),f.push(new mxPoint(A,d+p.height+J)),f.push(new mxPoint(A,y.y-J));for(y=0;y<f.length;y+=2)z=f[y],H=f[y+1],z=q(z,H,null!=F?F[y/2]:null,!0),z.node.style.visibility="visible",z.redraw(),v.push(z);for(y=f.length/2;null!=F&&y<F.length;y++)F[y].destroy();k.guidesArrVer=v;d-=b.y;f=!0}else K(!1,!0)}if(t||f)return p=new mxPoint(e,d),x=a.call(this,
(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,g,l){var d=c.y,e=c.x,t=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var k=this,p=new mxCellState,u=this.graph.getView().scale,q=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+e;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var x=[],A=[],y=0;y<this.states.length;y++){var C=this.states[y];C instanceof mxCellState&&(l||!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)?x.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)&&A.push(C))}var z=0,B=0,G=C=0,v=0,K=0,H=0,F=0,J=5*u;if(1<x.length){x.push(p);x.sort(function(a,b){return a.y-b.y});var E=!1,y=p==x[0],u=p==x[x.length-1];if(!y&&!u)for(y=1;y<x.length-1;y++)if(p==x[y]){u=x[y-1];y=x[y+1];C=B=G=(y.y-u.y-u.height-p.height)/2;break}for(y=0;y<x.length-1;y++){var u=x[y],D=x[y+1],I=p==u||p==D,D=D.y-u.y-u.height,E=E|p==u;if(0==B&&
0==z)B=D,z=1;else if(Math.abs(B-D)<=(I||1==y&&E?q:0))z+=1;else if(1<z&&E){x=x.slice(0,y+1);break}else if(3<=x.length-y&&!E)z=0,C=B=0!=G?G:0,x.splice(0,0==y?1:y),y=-1;else break;0!=C||I||(B=C=D)}3==x.length&&x[1]==p&&(C=0)}if(1<A.length){A.push(p);A.sort(function(a,b){return a.x-b.x});E=!1;y=p==A[0];u=p==A[A.length-1];if(!y&&!u)for(y=1;y<A.length-1;y++)if(p==A[y]){u=A[y-1];y=A[y+1];H=K=F=(y.x-u.x-u.width-p.width)/2;break}for(y=0;y<A.length-1;y++){u=A[y];D=A[y+1];I=p==u||p==D;D=D.x-u.x-u.width;E|=p==
u;if(0==K&&0==v)K=D,v=1;else if(Math.abs(K-D)<=(I||1==y&&E?q:0))v+=1;else if(1<v&&E){A=A.slice(0,y+1);break}else if(3<=A.length-y&&!E)v=0,H=K=0!=F?F:0,A.splice(0,0==y?1:y),y=-1;else break;0!=H||I||(K=H=D)}3==A.length&&A[1]==p&&(H=0)}q=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(k.graph.getView().getOverlayPane());return a};K=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<v&&v==A.length-1){v=[];F=k.guidesArrHor;t=[];e=0;y=A[0]==p?1:0;E=A[y].y+A[y].height;if(0<H)for(y=0;y<A.length-1;y++)u=
A[y],D=A[y+1],p==u?(e=D.x-u.width-H,t.push(new mxPoint(e+u.width+J,E)),t.push(new mxPoint(D.x-J,E))):p==D?(t.push(new mxPoint(u.x+u.width+J,E)),e=u.x+u.width+H,t.push(new mxPoint(e-J,E))):(t.push(new mxPoint(u.x+u.width+J,E)),t.push(new mxPoint(D.x-J,E)));else u=A[0],y=A[2],e=u.x+u.width+(y.x-u.x-u.width-p.width)/2,t.push(new mxPoint(u.x+u.width+J,E)),t.push(new mxPoint(e-J,E)),t.push(new mxPoint(e+p.width+J,E)),t.push(new mxPoint(y.x-J,E));for(y=0;y<t.length;y+=2)A=t[y],H=t[y+1],A=q(A,H,null!=F?
F[y/2]:null),A.node.style.visibility="visible",A.redraw(),v.push(A);for(y=t.length/2;null!=F&&y<F.length;y++)F[y].destroy();k.guidesArrHor=v;e-=b.x;t=!0}else K(!0);if(1<z&&z==x.length-1){v=[];F=k.guidesArrVer;f=[];d=0;y=x[0]==p?1:0;z=x[y].x+x[y].width;if(0<C)for(y=0;y<x.length-1;y++)u=x[y],D=x[y+1],p==u?(d=D.y-u.height-C,f.push(new mxPoint(z,d+u.height+J)),f.push(new mxPoint(z,D.y-J))):p==D?(f.push(new mxPoint(z,u.y+u.height+J)),d=u.y+u.height+C,f.push(new mxPoint(z,d-J))):(f.push(new mxPoint(z,u.y+
u.height+J)),f.push(new mxPoint(z,D.y-J)));else u=x[0],y=x[2],d=u.y+u.height+(y.y-u.y-u.height-p.height)/2,f.push(new mxPoint(z,u.y+u.height+J)),f.push(new mxPoint(z,d-J)),f.push(new mxPoint(z,d+p.height+J)),f.push(new mxPoint(z,y.y-J));for(y=0;y<f.length;y+=2)A=f[y],H=f[y+1],A=q(A,H,null!=F?F[y/2]:null,!0),A.node.style.visibility="visible",A.redraw(),v.push(A);for(y=f.length/2;null!=F&&y<F.length;y++)F[y].destroy();k.guidesArrVer=v;d-=b.y;f=!0}else K(!1,!0)}if(t||f)return p=new mxPoint(e,d),x=a.call(this,
b,p,g,l),t&&!f?p.y=x.y:f&&!t&&(p.x=x.x),x.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),x.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;K(!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 g=0;g<a.length;g++)a[g].destroy();this.guidesArrVer=null}if(null!=c){for(g=0;g<c.length;g++)c[g].destroy();this.guidesArrHor=null}}})();

View file

@ -4372,6 +4372,20 @@ App.prototype.restoreLibraries = function()
}
}
}
else if (service == 'S' && this.loadDesktopLib != null)
{
try
{
this.loadDesktopLib(decodeURIComponent(id.substring(1)), function(desktopLib)
{
onload(desktopLib);
}, onerror);
}
catch (e)
{
onerror();
}
}
else
{
var peer = null;

View file

@ -0,0 +1,29 @@
// Copyright (c) 2006-2019, JGraph Ltd
/**
*/
DesktopLibrary = function(ui, data, fileObj)
{
LocalLibrary.call(this, ui, data, fileObj.name);
this.fileObj = fileObj;
};
//Extends LocalLibrary
mxUtils.extend(DesktopLibrary, LocalLibrary);
/**
*
*/
DesktopLibrary.prototype.getHash = function()
{
return 'S' + encodeURIComponent(this.fileObj.path);
};
DesktopLibrary.prototype.isAutosave = function()
{
return this.fileObj != null;
};
DesktopLibrary.prototype.save = function(revision, success, error)
{
LocalFile.prototype.saveFile.apply(this, arguments);
};

View file

@ -434,7 +434,7 @@ var StorageDialog = function(editorUi, fn, rowLimit)
p3.style.fontSize = '9pt';
p3.style.marginTop = '-14px';
p3.innerHTML = '<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" ' +
'href="https://plus.google.com/u/0/+DrawIo1/posts/1HTrfsb5wDN" target="_blank">' +
'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>';
div.appendChild(p3);

View file

@ -6614,9 +6614,7 @@
{
try
{
//add back the file name
xhr.response.name = filename;
this.doImportVisio(xhr.response, done, onerror);
this.doImportVisio(xhr.response, done, onerror, filename);
}
catch (e)
{
@ -6636,7 +6634,7 @@
{
try
{
this.doImportVisio(file, done, onerror);
this.doImportVisio(file, done, onerror, filename);
}
catch (e)
{

View file

@ -87,10 +87,54 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
editorUi.openLink('https://www.draw.io/')
}));
this.put('openRecent', new Menu(function(menu, parent)
{
var recent = editorUi.getRecent();
if (recent != null)
{
for (var i = 0; i < recent.length; i++)
{
(function(entry)
{
menu.addItem(entry.title, null, function()
{
function doOpenRecent()
{
//Simulate opening a file via args
editorUi.loadArgs({args: [entry.id]});
};
var file = editorUi.getCurrentFile();
if (file != null && file.isModified())
{
editorUi.confirm(mxResources.get('allChangesLost'), null, doOpenRecent,
mxResources.get('cancel'), mxResources.get('discardChanges'));
}
else
{
doOpenRecent();
}
}, parent);
})(recent[i]);
}
menu.addSeparator(parent);
}
menu.addItem(mxResources.get('reset'), null, function()
{
editorUi.resetRecent();
}, parent);
}));
// Replaces file menu to replace openFrom menu with open and rename downloadAs to export
this.put('file', new Menu(mxUtils.bind(this, function(menu, parent)
{
this.addMenuItems(menu, ['new', 'open', '-', 'synchronize', '-', 'save', 'saveAs', '-', 'import'], parent);
this.addMenuItems(menu, ['new', 'open'], parent);
this.addSubmenu('openRecent', menu, parent);
this.addMenuItems(menu, ['-', 'synchronize', '-', 'save', 'saveAs', '-', 'import'], parent);
this.addSubmenu('exportAs', menu, parent);
menu.addSeparator(parent);
this.addSubmenu('embed', menu, parent);
@ -416,6 +460,47 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
}
}
var origFileLoaded = EditorUi.prototype.fileLoaded;
EditorUi.prototype.fileLoaded = function(file)
{
if (file != null)
{
if (file.fileObject == null)
{
var fname = file.getTitle();
var fileInfo = openFilesMap[fname];
if (fileInfo != null)
{
file.fileObject = {
name: fileInfo.name,
path: fileInfo.path,
type: fileInfo.type || 'utf-8'
};
//delete it such that it is not used again incorrectly
delete openFilesMap[fname];
}
}
if (file.fileObject != null)
{
var title = file.fileObject.path;
if (title.length > 100)
{
title = '...' + title.substr(title.length - 97);
}
this.addRecent({id: file.fileObject.path, title: title});
}
}
origFileLoaded.apply(this, arguments);
};
// Uses local picker
App.prototype.pickFile = function()
{
@ -454,8 +539,7 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
{
try
{
var library = new LocalLibrary(this, data, fileEntry.name);
library.fileObject = fileEntry;
var library = new DesktopLibrary(this, data, fileEntry);
this.loadLibrary(library);
}
catch (e)
@ -487,12 +571,29 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
}
};
//In order not to repeat the logic for opening a file, we collect files information here and use them in openLocalFile
var origOpenFiles = EditorUi.prototype.openFiles;
var openFilesMap = {};
EditorUi.prototype.openFiles = function(files, temp)
{
openFilesMap = {};
for (var i = 0; i < files.length; i++)
{
openFilesMap[files[i].name] = files[i];
}
origOpenFiles.apply(this, arguments);
};
App.prototype.readGraphFile = function(fn, fnErr, path)
{
var fs = require('fs');
var index = path.lastIndexOf('.png');
var isPng = index > -1 && index == path.length - 4;
var encoding = isPng ? 'base64' : 'utf-8'
var isVsdx = /\.vsdx$/i.test(path) || /\.vssx$/i.test(path);
var encoding = isVsdx? null : (isPng ? 'base64' : 'utf-8');
fs.readFile(path, encoding, mxUtils.bind(this, function (e, data)
{
@ -502,6 +603,55 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
}
else
{
var fileEntry = new Object();
fileEntry.path = path;
fileEntry.name = path.replace(/^.*[\\\/]/, '');
fileEntry.type = encoding;
//VSDX files are imported instead of being open
if (isVsdx)
{
var name = fileEntry.name;
this.importVisio(data, mxUtils.bind(this, function(xml)
{
var dot = name.lastIndexOf('.');
if (dot >= 0)
{
name = name.substring(0, name.lastIndexOf('.')) + '.drawio';
}
else
{
name = name + '.drawio';
}
if (xml.substring(0, 10) == '<mxlibrary')
{
// Creates new temporary file if library is dropped in splash screen
if (this.getCurrentFile() == null && urlParams['embed'] != '1')
{
this.openLocalFile(this.emptyDiagramXml, this.defaultFilename);
}
try
{
this.loadLibrary(new LocalLibrary(this, xml, name));
}
catch (e)
{
this.handleError(e, mxResources.get('errorLoadingFile'));
}
}
else
{
this.openLocalFile(xml, name);
}
}), null, name);
return;
}
if (isPng)
{
// Detecting png by extension. Would need https://github.com/mscdex/mmmagic
@ -509,11 +659,6 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
data = this.extractGraphModelFromPng('data:image/png;base64,' + data);
}
var fileEntry = new Object();
fileEntry.path = path;
fileEntry.name = path.replace(/^.*[\\\/]/, '');
fileEntry.type = encoding;
fs.stat(path, function(err, stat)
{
if (err)
@ -651,11 +796,6 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
return this.fileObject != null;
};
LocalLibrary.prototype.isAutosave = function()
{
return this.fileObject != null;
};
LocalFile.prototype.getTitle = function()
{
return (this.fileObject != null) ? this.fileObject.name : this.title;
@ -676,11 +816,6 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
this.saveFile(revision, success, error, unloading, overwrite);
};
LocalLibrary.prototype.save = function(revision, success, error)
{
LocalFile.prototype.saveFile.apply(this, arguments);
};
LocalFile.prototype.isConflict = function(stat)
{
return stat != null && this.stat != null && stat.mtimeMs != this.stat.mtimeMs;
@ -1173,7 +1308,52 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
// to give the spinner some time to stop spinning
window.setTimeout(mxUtils.bind(this, function()
{
var path = dialog.showSaveDialog({defaultPath: filename});
var dlgConfig = {defaultPath: filename};
var filters = null;
switch (format)
{
case 'xmlpng':
case 'png':
filters = [
{ name: 'PNG Images', extensions: ['png'] }
];
break;
case 'jpg':
case 'jpeg':
filters = [
{ name: 'JPEG Images', extensions: ['jpg', 'jpeg'] }
];
break;
case 'svg':
filters = [
{ name: 'SVG Images', extensions: ['svg'] }
];
break;
case 'pdf':
filters = [
{ name: 'PDF Documents', extensions: ['pdf'] }
];
break;
case 'vsdx':
filters = [
{ name: 'VSDX Documents', extensions: ['vsdx'] }
];
break;
case 'html':
filters = [
{ name: 'HTML Documents', extensions: ['html'] }
];
break;
case 'xml':
filters = [
{ name: 'XML Documents', extensions: ['xml'] }
];
break;
};
dlgConfig['filters'] = filters;
var path = dialog.showSaveDialog(dlgConfig);
if (path != null)
{
@ -1202,8 +1382,18 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
}));
}
}
}), 0);
}), 50);
};
EditorUi.prototype.addBeforeUnloadListener = function() {};
EditorUi.prototype.loadDesktopLib = function(libPath, success, error)
{
this.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
{
var library = new DesktopLibrary(this, data, fileEntry);
this.loadLibrary(library);
success(library);
}), error, libPath);
};
})();

View file

@ -208,7 +208,8 @@
editorUi.actions.put('exportPdf', new Action(mxResources.get('formatPdf') + '...', function()
{
if (editorUi.isOffline() || editorUi.printPdfExport)
if ((typeof(mxIsElectron5) === 'undefined' || !mxIsElectron5) &&
(editorUi.isOffline() || editorUi.printPdfExport))
{
// Export PDF action for chrome OS (same as print with different dialog title)
editorUi.showDialog(new PrintDialog(editorUi, mxResources.get('formatPdf')).container, 360,

View file

@ -12060,9 +12060,11 @@ com.mxgraph.io.vsdx.mxPropertiesManager.__static_initialize();
com.mxgraph.io.mxVsdxCodec.vsdxPlaceholder_$LI$();
com.mxgraph.io.mxVsdxCodec.parsererrorNS_$LI$();
EditorUi.prototype.doImportVisio = function(file, done, onerror)
EditorUi.prototype.doImportVisio = function(file, done, onerror, filename)
{
if (file.name != null && /(\.vs(x|sx?))($|\?)/i.test(file.name))
filename = filename || file.name;
if (filename != null && /(\.vs(x|sx?))($|\?)/i.test(filename))
{
new com.mxgraph.io.mxVssxCodec().decodeVssx(file, done, null, onerror);
}

View file

@ -1242,7 +1242,7 @@ d=0;4>m;m++){var n=f.IA_$LI$()[c.charAt(e++).charCodeAt(0)];0<=n?d|=n<<18-6*m:m-
G|0;0<m&&19===++x&&(a+=2,x=0)}if(n<k){for(m=G=0;a<=d-e;m++)G|=f.IA_$LI$()[c.charAt(a++).charCodeAt(0)]<<18-6*m;for(c=16;n<k;c-=8)b[n++]=G>>c|0}return b};return f}();k.__static_initialized=!1;m.mxBase64=k;k.__class="com.mxgraph.online.mxBase64"})(n.online||(n.online={}))})(c.mxgraph||(c.mxgraph={}))})(com||(com={}));com.mxgraph.online.mxBase64.IA_$LI$();com.mxgraph.online.mxBase64.CA_$LI$();com.mxgraph.online.mxBase64.__static_initialize();com.mxgraph.io.vsdx.VsdxShape.__com_mxgraph_io_vsdx_VsdxShape_LOGGER_$LI$();
com.mxgraph.io.vsdx.VsdxShape.arrowTypes_$LI$();com.mxgraph.io.vsdx.VsdxShape.arrowSizes_$LI$();com.mxgraph.io.vsdx.VsdxShape.OFFSET_ARRAY_$LI$();com.mxgraph.io.vsdx.VsdxShape.__static_initialize();com.mxgraph.io.vsdx.Shape.UNICODE_LINE_SEP_$LI$();com.mxgraph.io.vsdx.Style.lineDashPatterns_$LI$();com.mxgraph.io.vsdx.Style.styleTypes_$LI$();com.mxgraph.io.vsdx.Style.__static_initialize();com.mxgraph.online.Constants.MAX_AREA_$LI$();com.mxgraph.io.vsdx.theme.Color.NONE_$LI$();com.mxgraph.io.vsdx.mxVsdxUtils.conversionFactor_$LI$();
com.mxgraph.io.vsdx.mxVsdxTheme.colorIds_$LI$();com.mxgraph.io.vsdx.mxVsdxTheme.themesIds_$LI$();com.mxgraph.io.vsdx.mxVsdxTheme.__static_initialize();com.mxgraph.io.vsdx.mxVsdxConstants.MY_SET_$LI$();com.mxgraph.io.vsdx.mxVsdxConstants.SET_VALUES_$LI$();com.mxgraph.io.vsdx.mxPropertiesManager.defaultColors_$LI$();com.mxgraph.io.vsdx.mxPropertiesManager.__static_initialize();com.mxgraph.io.mxVsdxCodec.vsdxPlaceholder_$LI$();com.mxgraph.io.mxVsdxCodec.parsererrorNS_$LI$();
EditorUi.prototype.doImportVisio=function(c,n,m){null!=c.name&&/(\.vs(x|sx?))($|\?)/i.test(c.name)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(c,n,null,m):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(c,n,null,m)};function mxGraphMlCodec(){this.cachedRefObj={}}mxGraphMlCodec.prototype.refRegexp=/^\{y\:GraphMLReference\s+(\d+)\}$/;mxGraphMlCodec.prototype.staticRegexp=/^\{x\:Static\s+(.+)\.(.+)\}$/;
EditorUi.prototype.doImportVisio=function(c,n,m,k){k=k||c.name;null!=k&&/(\.vs(x|sx?))($|\?)/i.test(k)?(new com.mxgraph.io.mxVssxCodec).decodeVssx(c,n,null,m):(new com.mxgraph.io.mxVsdxCodec).decodeVsdx(c,n,null,m)};function mxGraphMlCodec(){this.cachedRefObj={}}mxGraphMlCodec.prototype.refRegexp=/^\{y\:GraphMLReference\s+(\d+)\}$/;mxGraphMlCodec.prototype.staticRegexp=/^\{x\:Static\s+(.+)\.(.+)\}$/;
mxGraphMlCodec.prototype.decode=function(c,n,m){try{var k=mxUtils.parseXml(c),f=this.getDirectChildNamedElements(k.documentElement,mxGraphMlConstants.GRAPH);this.initializeKeys(k.documentElement);c='<?xml version="1.0" encoding="UTF-8"?><mxfile>';for(k=0;k<f.length;k++){var e=f[k],b=this.createMxGraph(),a=b.getModel();a.beginUpdate();try{for(this.nodesMap={},this.edges=[],this.importGraph(e,b,b.getDefaultParent()),k=0;k<this.edges.length;k++)for(var d=this.edges[k],g=d.edges,p=d.parent,y=d.dx,z=d.dy,
x=0;x<g.length;x++)this.importEdge(g[x],b,p,y,z)}catch(ia){throw console.log(ia),ia;}finally{a.endUpdate()}a.beginUpdate();try{var C=b.getModel().cells,G;for(G in C){var A=C[G];if(A.edge&&0<A.getChildCount())for(k=0;k<A.getChildCount();k++){var B=A.children[k].geometry;if(B.adjustIt){var F=b.view.getState(A),D=F.absolutePoints,Z=D[0],X=D[D.length-1],fa=B.x,L=B.y,y=X.x-Z.x,z=X.y-Z.y,V=Z.x+fa*y,T=Z.y+fa*z,aa=Math.sqrt(y*y+z*z),y=y/aa,z=z/aa,V=V-L*z,T=T+L*y,ha=b.view.getRelativePoint(F,V,T);B.x=ha.x;
B.y=ha.y}}}}catch(ia){throw console.log(ia),ia;}finally{a.endUpdate()}c+=this.processPage(b,k+1)}n&&n(c+"</mxfile>")}catch(ia){m&&m(ia)}};

View file

@ -2550,9 +2550,9 @@ sa);mxUtils.extend(ja,mxConnector);ja.prototype.origPaintEdgeShape=ja.prototype.
mxCellRenderer.registerShape("filledEdge",ja);"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,n,p){var u=d*(g+n+1),t=e*(g+n+1);return function(){a.begin();
a.moveTo(f.x-u/2-t/2,f.y-t/2+u/2);a.lineTo(f.x+t/2-3*u/2,f.y-3*t/2-u/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,f,d,e,g,l,n,p){var u=d*(g+n+1),t=e*(g+n+1);return function(){a.begin();a.moveTo(f.x-u/2-t/2,f.y-t/2+u/2);a.lineTo(f.x+t/2-3*u/2,f.y-3*t/2-u/2);a.moveTo(f.x-u/2+t/2,f.y-t/2-u/2);a.lineTo(f.x-t/2-3*u/2,f.y-3*t/2+u/2);a.stroke()}});mxMarker.addMarker("circle",ta);mxMarker.addMarker("circlePlus",function(a,c,b,f,d,e,g,l,n,p){var u=f.clone(),t=ta.apply(this,arguments),k=d*(g+
2*n),y=e*(g+2*n);return function(){t.apply(this,arguments);a.begin();a.moveTo(u.x-d*n,u.y-e*n);a.lineTo(u.x-2*k+d*n,u.y-2*y+e*n);a.moveTo(u.x-k-y+e*n,u.y-y+k-d*n);a.lineTo(u.x+y-k-e*n,u.y-y-k+d*n);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,f,d,e,g,l,n,p){c=d*n*1.118;b=e*n*1.118;d*=g+n;e*=g+n;var u=f.clone();u.x-=c;u.y-=b;f.x+=1*-d-c;f.y+=1*-e-b;return function(){a.begin();a.moveTo(u.x,u.y);l?a.lineTo(u.x-d-e/2,u.y-e+d/2):a.lineTo(u.x+e/2-d,u.y-e-d/2);a.lineTo(u.x-d,u.y-e);a.close();p?
a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,f,d,e,g,l,n,u,p){e*=l+u;g*=l+u;var t=d.clone();return function(){c.begin();c.moveTo(t.x,t.y);n?c.lineTo(t.x-e-g/a,t.y-g+e/a):c.lineTo(t.x+g/a-e,t.y-g-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ha=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 Q(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,n=d.y-l.y,u=Math.sqrt(e*e+n*n),l=f.call(this,u,e/u,n/u,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 n=a.view.scale,u=b?g[0]:g[l],g=b?g[1]:g[l-1],l=g.x-u.x,
p=g.y-u.y,t=Math.sqrt(l*l+p*p);f.x=(f.x+c.x)*n;f.y=(f.y+c.y)*n;d.call(this,t,l/t,p/t,u,g,f,e)})},pa=function(a){return function(c){return[Q(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",K.prototype.arrowWidth))),f=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",K.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,
a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,f,d,e,g,l,n,p,u){e*=l+p;g*=l+p;var t=d.clone();return function(){c.begin();c.moveTo(t.x,t.y);n?c.lineTo(t.x-e-g/a,t.y-g+e/a):c.lineTo(t.x+g/a-e,t.y-g-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ha=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 Q(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,n=d.y-l.y,p=Math.sqrt(e*e+n*n),l=f.call(this,p,e/p,n/p,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 n=a.view.scale,p=b?g[0]:g[l],g=b?g[1]:g[l-1],l=g.x-p.x,
u=g.y-p.y,t=Math.sqrt(l*l+u*u);f.x=(f.x+c.x)*n;f.y=(f.y+c.y)*n;d.call(this,t,l/t,u/t,p,g,f,e)})},pa=function(a){return function(c){return[Q(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",K.prototype.arrowWidth))),f=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",K.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))})]}},Fa=function(a,c,b){return function(f){var d=[Q(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}},Aa=function(a,c,b,f,d){b=null!=b?b:1;return function(e){var g=[Q(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}},Ia=function(a){return function(c){var b=[Q(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,
@ -2586,8 +2586,8 @@ return new mxPoint(a.x+3*a.width/4,a.y+(1-c)*a.height)},function(a,c){this.state
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:Aa(t.prototype.size,!0,null,!0,t.prototype.fixedSize),hexagon:Aa(G.prototype.size,!0,.5,!0),curlyBracket:Aa(g.prototype.size,!1),display:Aa(sa.prototype.size,!1),cube:Fa(1,a.prototype.size,!1),card:Fa(.5,r.prototype.size,!0),loopLimit:Fa(.5,R.prototype.size,
!0),trapezoid:Ia(.5),parallelogram:Ia(1)};Graph.createHandle=Q;Graph.handleFactory=Ba;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=Ba[a];null==a&&null!=this.state.shape&&this.state.shape.isRoundable()&&(a=Ba[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=Ba[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Ca=new mxPoint(1,0),Da=new mxPoint(1,0),pa=mxUtils.toRadians(-30),Ca=mxUtils.getRotatedPoint(Ca,Math.cos(pa),Math.sin(pa)),pa=mxUtils.toRadians(-150),
Da=mxUtils.getRotatedPoint(Da,Math.cos(pa),Math.sin(pa));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 n=Ca.x,u=Ca.y,p=Da.x,t=Da.y,k="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=l){a=function(a,c,
b){a-=y.x;var f=c-y.y;c=(t*a-p*f)/(n*t-u*p);a=(u*a-n*f)/(u*p-n*t);k?(b&&(y=new mxPoint(y.x+n*c,y.y+u*c),d.push(y)),y=new mxPoint(y.x+p*a,y.y+t*a)):(b&&(y=new mxPoint(y.x+p*a,y.y+t*a),d.push(y)),y=new mxPoint(y.x+n*c,y.y+u*c));d.push(y)};var y=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 Na=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==
Da=mxUtils.getRotatedPoint(Da,Math.cos(pa),Math.sin(pa));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 n=Ca.x,p=Ca.y,u=Da.x,t=Da.y,k="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=l){a=function(a,c,
b){a-=y.x;var f=c-y.y;c=(t*a-u*f)/(n*t-p*u);a=(p*a-n*f)/(p*u-n*t);k?(b&&(y=new mxPoint(y.x+n*c,y.y+p*c),d.push(y)),y=new mxPoint(y.x+u*a,y.y+t*a)):(b&&(y=new mxPoint(y.x+u*a,y.y+t*a),d.push(y)),y=new mxPoint(y.x+n*c,y.y+p*c));d.push(y)};var y=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 Na=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==
mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Na.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};z.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,
@ -3090,7 +3090,7 @@ d&&d(G)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.
0,0);try{b(a.toDataURL())}catch(y){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,l){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),k=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var p=k.getElementsByTagName("diagram");if(1==p.length)k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(p[0]))).documentElement;
else if(1<p.length)for(a=0,null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(p[0]))).documentElement,e=!1,a=1);a<p.length;a++){p[a].removeAttribute("id");var m=this.updatePageRoot(new DiagramPage(p[a])),q=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[q+1]));f.model.execute(new ChangePage(this,m,m,q,!0))}}null!=k&&"mxGraphModel"===k.nodeName&&(c=f.importGraphModel(k,b,d,e))}finally{f.model.endUpdate()}}}catch(u){if(l)throw u;
this.handleError(u)}return c};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)if(this.isRemoteVisioFormat(e)&&null!=VSD_CONVERT_URL){var c=new FormData;c.append("file1",a,e);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);
f.responseType="blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{f.response.name=e,this.doImportVisio(f.response,b,d)}catch(z){d(z)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d)}catch(z){d(z)}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=
f.responseType="blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response,b,d,e)}catch(z){d(z)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d,e)}catch(z){d(z)}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(l){d(l)}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){console.log(a);var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{b(LucidImporter.importState(JSON.parse(a)))}catch(l){d(l)}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.insertAsPreText=
@ -3248,8 +3248,8 @@ var CommentsWindow=function(a,b,e,d,k,m){function q(){for(var a=t.getElementsByT
"geCommentEditTxtArea";l.style.minHeight=f.offsetHeight+"px";l.value=a.content;b.insertBefore(l,f);var k=document.createElement("div");k.className="geCommentEditBtns";var m=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),q()):e();n=null});m.className="geCommentEditBtn";k.appendChild(m);var p=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=l.value;mxUtils.write(f,a.content);e();c(a);n=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";k.appendChild(p);b.insertBefore(k,f);g.style.display="none";f.style.display="none";l.focus()}function x(b,c){c.innerHTML="";var d=a.timeSince(new Date(b.modifiedDate));null==d&&(d=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
[d],"{1} ago"))}function A(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src="/images/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 v(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)});C.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=B;a(b);return{pdiv:d,replies:c}}function y(d,e,l,m,n){function q(){A(t);b.addReply(v,function(a){v.id=a;b.replies.push(v);f(t);l&&l()},function(b){p();c(t);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},m,n)}function p(){r(v,
t,function(a){q()},!0)}var u=E().pdiv,v=a.newComment(d,a.getCurrentUser());v.pCommentId=b.id;null==b.replies&&(b.replies=[]);var t=g(v,b.replies,u,k+1);e?p():q()}if(m||!b.isResolved){G.style.display="none";var B=document.createElement("div");B.className="geCommentContainer";B.setAttribute("data-commentId",b.id);B.style.marginLeft=20*k+5+"px";b.isResolved&&"dark"!=uiTheme&&(B.style.backgroundColor="ghostWhite");var z=document.createElement("div");z.className="geCommentHeader";var D=document.createElement("img");
"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});C.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=B;a(b);return{pdiv:d,replies:c}}function y(d,e,l,m,n){function p(){A(t);b.addReply(v,function(a){v.id=a;b.replies.push(v);f(t);l&&l()},function(b){q();c(t);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},m,n)}function q(){r(v,
t,function(a){p()},!0)}var u=E().pdiv,v=a.newComment(d,a.getCurrentUser());v.pCommentId=b.id;null==b.replies&&(b.replies=[]);var t=g(v,b.replies,u,k+1);e?q():p()}if(m||!b.isResolved){G.style.display="none";var B=document.createElement("div");B.className="geCommentContainer";B.setAttribute("data-commentId",b.id);B.style.marginLeft=20*k+5+"px";b.isResolved&&"dark"!=uiTheme&&(B.style.backgroundColor="ghostWhite");var z=document.createElement("div");z.className="geCommentHeader";var D=document.createElement("img");
D.className="geCommentUserImg";D.src=b.user.pictureUrl||Editor.userImage;z.appendChild(D);D=document.createElement("div");D.className="geCommentHeaderTxt";z.appendChild(D);var F=document.createElement("div");F.className="geCommentUsername";mxUtils.write(F,b.user.displayName||"");D.appendChild(F);F=document.createElement("div");F.className="geCommentDate";F.setAttribute("data-commentId",b.id);x(b,F);D.appendChild(F);B.appendChild(z);z=document.createElement("div");z.className="geCommentTxt";mxUtils.write(z,
b.content||"");B.appendChild(z);z=document.createElement("div");z.className="geCommentActions";var C=document.createElement("ul");C.className="geCommentActionsList";z.appendChild(C);p||0!=k&&!l||v(mxResources.get("reply"),function(){y("",!0)},b.isResolved);D=a.getCurrentUser();null==D||D.id!=b.user.id||p||(v(mxResources.get("edit"),function(){function d(){r(b,B,function(){A(B);b.editComment(b.content,function(){f(B)},function(b){c(B);d();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}
d()},b.isResolved),v(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){A(B);b.deleteComment(function(){for(var a=E(b).replies,c=0;c<a.length;c++)t.removeChild(a[c]);for(c=0;c<d.length;c++)if(d[c]==b){d.splice(c,1);break}G.style.display=0==t.getElementsByTagName("div").length?"block":"none"},function(b){c(B);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));p||0!=k||v(b.isResolved?mxResources.get("reopen"):

View file

@ -4,4 +4,40 @@
Draw.loadPlugin(function(ui)
{
ui.hideFooter();
if (!window.mxIsElectron5)
{
var footer = document.createElement('div');
footer.style.cssText = 'position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;' +
'white-space:nowrap;left:50%;bottom:2px;';
footer.className = 'geStatusAlert';
mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
mxUtils.setPrefixedStyle(footer.style, 'transition', 'all 1s ease');
footer.style.whiteSpace = 'nowrap';
footer.innerHTML = '<a href="http://about.draw.io/drawio-desktop-10-7-5-release" ' +
'target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">' +
'<img src="' + this.editor.graph.warningImage.src + '" border="0" style="margin-top:-4px;margin-right:2px;" valign="middle"/>&nbsp;' +
'Important desktop security update, please upgrade. Click here.&nbsp;' +
'<img src="' + this.editor.graph.warningImage.src + '" border="0" style="margin-top:-4px;margin-left:2px;" valign="middle"/></a>';
var img = document.createElement('img');
img.setAttribute('src', Dialog.prototype.closeImage);
img.setAttribute('title', mxResources.get('close'));
img.style.position = 'absolute';
img.style.cursor = 'pointer';
img.style.right = '10px';
img.style.top = '12px';
footer.appendChild(img);
mxEvent.addListener(img, 'click', mxUtils.bind(this, function()
{
footer.parentNode.removeChild(footer);
this.hideFooter();
}));
document.body.appendChild(footer);
}
});