UNPKG

@zklogic/draw.io

Version:

Draw.IO - Graph Editor integration in Angular-cli

1 lines 128 kB
App=function(t,e,i){if(EditorUi.call(this,t,e,null!=i?i:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,(function(){var t=this.getCurrentFile();if(null!=t&&t.isModified()){var e={category:"DISCARD-FILE-"+t.getHash(),action:(t.savingFile?"saving":"")+(t.savingFile&&null!=t.savingFileTime?"_"+Math.round((Date.now()-t.savingFileTime.getTime())/1e3):"")+(null!=t.saveLevel?"-sl_"+t.saveLevel:"")+"-age_"+(null!=t.ageStart?Math.round((Date.now()-t.ageStart.getTime())/1e3):"x")+(this.editor.autosave?"":"-nosave")+(t.isAutosave()?"":"-noauto")+"-open_"+(null!=t.opened?Math.round((Date.now()-t.opened.getTime())/1e3):"x")+"-save_"+(null!=t.lastSaved?Math.round((Date.now()-t.lastSaved.getTime())/1e3):"x")+"-change_"+(null!=t.lastChanged?Math.round((Date.now()-t.lastChanged.getTime())/1e3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1e3),label:null!=t.sync?"client_"+t.sync.clientId:"nosync"};t.constructor==DriveFile&&null!=t.desc&&null!=this.drive&&(e.label+=(null!=this.drive.user?"-user_"+this.drive.user.id:"-nouser")+"-rev_"+t.desc.headRevisionId+"-mod_"+t.desc.modifiedDate+"-size_"+t.getSize()+"-mime_"+t.desc.mimeType),EditorUi.logEvent(e)}}))),this.editor.addListener("autosaveChanged",mxUtils.bind(this,(function(){var t=this.getCurrentFile();null!=t&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+t.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?"on":"off")})}))),mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":(new Image).src=mxGraph.prototype.warningImage.src,window.openWindow=mxUtils.bind(this,(function(t,e,i){if("1"==urlParams.openInSameWin||navigator.standalone)i();else{var n=null;try{n=window.open(t)}catch(t){}null==n||void 0===n?this.showDialog(new PopupDialog(this,t,e,i).container,320,140,!0,!0):null!=e&&e()}})),this.updateDocumentTitle(),this.updateUi(),window.showOpenAlert=mxUtils.bind(this,(function(t){null!=window.openFile&&window.openFile.cancel(!0),this.handleError(t)})),this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]),null!=App.DrawPlugins){for(var n=0;n<App.DrawPlugins.length;n++)try{App.DrawPlugins[n](this)}catch(t){null!=window.console&&console.log("Plugin Error:",t,App.DrawPlugins[n])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,(function(t){try{t(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}})),setTimeout(mxUtils.bind(this,(function(){App.embedModePluginsCount>0&&(App.embedModePluginsCount=0,this.initializeEmbedMode())})),5e3)}this.load()},App.ERROR_TIMEOUT="timeout",App.ERROR_BUSY="busy",App.ERROR_UNKNOWN="unknown",App.MODE_GOOGLE="google",App.MODE_DROPBOX="dropbox",App.MODE_ONEDRIVE="onedrive",App.MODE_GITHUB="github",App.MODE_GITLAB="gitlab",App.MODE_DEVICE="device",App.MODE_BROWSER="browser",App.MODE_TRELLO="trello",App.MODE_NOTION="notion",App.MODE_EMBED="embed",App.MODE_ATLAS="atlas",App.DROPBOX_APPKEY=window.DRAWIO_DROPBOX_ID,App.DROPBOX_URL=window.DRAWIO_BASE_URL+"/js/dropbox/Dropbox-sdk.min.js",App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js",App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":window.DRAWIO_BASE_URL+"/js/onedrive/OneDrive.js",App.TRELLO_URL="https://api.trello.com/1/client.js",App.TRELLO_JQUERY_URL=window.DRAWIO_BASE_URL+"/js/jquery/jquery-3.3.1.min.js",App.PUSHER_KEY="1e756b07a690c5bdb054",App.PUSHER_CLUSTER="eu",App.PUSHER_URL="https://js.pusher.com/7.0.3/pusher.min.js",App.SOCKET_IO_URL=window.DRAWIO_BASE_URL+"/js/socket.io/socket.io.min.js",App.SIMPLE_PEER_URL=window.DRAWIO_BASE_URL+"/js/socket.io/simplepeer9.10.0.min.js",App.SOCKET_IO_SRV="http://localhost:3030",App.GOOGLE_APIS="drive-share",App.startTime=new Date,App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"plugins/explore.js",ex:"plugins/explore.js",p1:"plugins/p1.js",ac:"plugins/connect.js",acj:"plugins/connectJira.js",ac148:"plugins/cConf-1-4-8.js",ac148cmnt:"plugins/cConf-comments.js",voice:"plugins/voice.js",tips:"plugins/tooltips.js",svgdata:"plugins/svgdata.js",electron:"plugins/electron.js",number:"plugins/number.js",sql:"plugins/sql.js",props:"plugins/props.js",text:"plugins/text.js",anim:"plugins/animation.js",update:"plugins/update.js",trees:"plugins/trees/trees.js",import:"plugins/import.js",replay:"plugins/replay.js",anon:"plugins/anonymize.js",tr:"plugins/trello.js",f5:"plugins/rackF5.js",tickets:"plugins/tickets.js",flow:"plugins/flow.js",webcola:"plugins/webcola/webcola.js",rnd:"plugins/random.js",page:"plugins/page.js",gd:"plugins/googledrive.js",tags:"plugins/tags.js"},App.publicPlugin=["ex","voice","tips","svgdata","number","sql","props","text","anim","update","trees","replay","anon","tickets","flow","webcola","tags"],App.loadScripts=function(t,e){for(var i=t.length,n=0;n<t.length;n++)mxscript(t[n],(function(){0==--i&&null!=e&&e()}))},App.getStoredMode=function(){var t=null;if(null==t&&isLocalStorage&&(t=localStorage.getItem(".mode")),null==t&&"undefined"!=typeof Storage){for(var e=document.cookie.split(";"),i=0;i<e.length;i++){var n=mxUtils.trim(e[i]);if("MODE="==n.substring(0,5)){t=n.substring(5);break}}if(null!=t&&isLocalStorage){var s=new Date;s.setYear(s.getFullYear()-1),document.cookie="MODE=; expires="+s.toUTCString(),localStorage.setItem(".mode",t)}}return t},mxClient.IS_CHROMEAPP||("1"!=urlParams.offline&&("db.draw.io"==window.location.hostname&&null==urlParams.mode&&(urlParams.mode="dropbox"),App.mode=urlParams.mode),null==App.mode&&(App.mode=App.getStoredMode()),null!=window.mxscript&&"1"!=urlParams.embed&&("function"==typeof window.DriveClient&&("0"!=urlParams.gapi&&isSvgBrowser&&(null==document.documentMode||document.documentMode>=10)?App.mode==App.MODE_GOOGLE||null!=urlParams.state&&""==window.location.hash||null!=window.location.hash&&"#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js"):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"==typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||document.documentMode>9)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==window.location.hash.substring(0,2)?mxscript(App.DROPBOX_URL,(function(){mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY,!0)})):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"==typeof window.OneDriveClient&&("0"!=urlParams.od&&(null==navigator.userAgent||navigator.userAgent.indexOf("MSIE")<0||document.documentMode>=10)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=null),"function"==typeof window.TrelloClient&&("1"==urlParams.tr&&isSvgBrowser&&!mxClient.IS_IE11&&(null==document.documentMode||document.documentMode>=10)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?mxscript(App.TRELLO_JQUERY_URL,(function(){mxscript(App.TRELLO_URL)})):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null))),App.clearServiceWorker=function(t){navigator.serviceWorker.getRegistrations().then((function(e){if(null!=e&&e.length>0){for(var i=0;i<e.length;i++)e[i].unregister();null!=t&&t()}}))},App.main=function(t,e){if(window.onerror=function(t,e,i,n,s){EditorUi.logError("Global: "+(null!=t?t:""),e,i,n,s,null,!0)},window.top==window.self&&(/ac\.draw\.io$/.test(window.location.hostname)||/ac-ent\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname)))document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>';else{if("1"==urlParams.embed||"1"==urlParams.lightbox){var i=document.getElementById("geInfo");null!=i&&i.parentNode.removeChild(i)}if(null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4"),null!=window.mxscript){if("1"==urlParams.dev&&null!=CryptoJS&&App.mode!=App.MODE_DROPBOX&&App.mode!=App.MODE_TRELLO){var n=document.getElementsByTagName("script");if(null!=n&&n.length>0){var s=mxUtils.getTextContent(n[0]);"0fed8c83fc7187e0b39310c4aa3e6d63"!=CryptoJS.MD5(s).toString()&&(console.log("Change bootstrap script MD5 in the previous line:",CryptoJS.MD5(s).toString()),alert("[Dev] Bootstrap script change requires update of CSP"))}null!=n&&n.length>1&&(s=mxUtils.getTextContent(n[n.length-1]),"d53805dd6f0bbba2da4966491ca0a505"!=CryptoJS.MD5(s).toString()&&(console.log("Change main script MD5 in the previous line:",CryptoJS.MD5(s).toString()),alert("[Dev] Main script change requires update of CSP")))}try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"==urlParams.dev)?App.clearServiceWorker((function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.register("/service-worker.js")}catch(t){null!=window.console&&console.error(t)}if(!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&"1"!=urlParams.embedRT||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams.rtCursors&&(mxscript(App.SOCKET_IO_URL),mxscript(App.SIMPLE_PEER_URL))),"0"!=urlParams.plugins&&"1"!=urlParams.offline){var l=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!=typeof JSON)try{null!=(o=JSON.parse(localStorage.getItem(mxSettings.key)))&&(l=o.plugins)}catch(t){}var o=urlParams.p;if(App.initPluginCallback(),null!=o&&App.loadPlugins(o.split(";")),null!=l&&l.length>0&&"0"!=urlParams.plugins){for(var r=window.location.protocol+"//"+window.location.host,a=!0,u=0;u<l.length&&a;u++)"/"!=l[u].charAt(0)&&l[u].substring(0,r.length)!=r&&(a=!1);if(a||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",[l.join("\n")]).replace(/\\n/g,"\n")))for(u=0;u<l.length;u++)try{null==App.pluginsLoaded[l[u]]&&(App.pluginsLoaded[l[u]]=!0,App.embedModePluginsCount++,"/"==l[u].charAt(0)&&(l[u]=PLUGINS_BASE_PATH+l[u]),mxscript(l[u]))}catch(t){}}}"function"==typeof window.DriveClient&&"undefined"==typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||document.documentMode>=10)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):void 0===window.gapi&&(window.DriveClient=null)}if("0"!=urlParams.math&&Editor.initMath(),"1"==urlParams.configure){var d=window.opener||window.parent,h=function(t){if(t.source==d)try{var e=JSON.parse(t.data);null!=e&&"configure"==e.action&&(mxEvent.removeListener(window,"message",h),Editor.configure(e.config,!0),mxSettings.load(),g())}catch(e){null!=window.console&&console.log("Error in configure message: "+e,t.data)}};mxEvent.addListener(window,"message",h),d.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(t){null!=window.console&&console.error(t)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var c=localStorage.getItem(Editor.configurationKey);if(null!=c)try{null!=(c=JSON.parse(c))&&(EditorUi.debug("Using local configuration",c),Editor.configure(c),mxSettings.load())}catch(t){null!=window.console&&console.error(t)}}}g()}}function p(i){mxUtils.getAll("1"!=urlParams.dev?[i]:[i,STYLE_PATH+"/default.xml"],(function(i){if(mxResources.parse(i[0].getText()),isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var n={};for(var s in App.pluginRegistry)n[App.pluginRegistry[s]]=!0;var l=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=l&&function(t){if(null!=t)for(var e=0;e<t.length;e++)if(!n[t[e]])throw new Error(mxResources.get("invalidInput")+' "'+t[e])+'"';return!0}(l.plugins)){if(EditorUi.debug("Setting configuration",JSON.stringify(l)),null!=l.merge){var o=localStorage.getItem(Editor.configurationKey);if(null!=o)try{var r=JSON.parse(o);for(var s in l.merge)r[s]=l.merge[s];l=r}catch(t){window.location.hash="",alert(t)}else l=l.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(l)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(t){window.location.hash="",alert(t)}function a(){var i=null!=e?e():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));null!=window.mxscript&&("function"==typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||document.documentMode>9)?mxscript(App.DROPBOX_URL,(function(){mxscript(App.DROPINS_URL,(function(){DrawDropboxClientCallback()}),"dropboxjs",App.DROPBOX_APPKEY)})):void 0!==window.Dropbox&&void 0!==window.Dropbox.choose||(window.DropboxClient=null),"function"==typeof window.OneDriveClient&&"undefined"==typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||navigator.userAgent.indexOf("MSIE")<0||document.documentMode>=10)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):void 0===window.OneDrive&&(window.OneDriveClient=null),"function"==typeof window.TrelloClient&&!mxClient.IS_IE11&&void 0===window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr&&(null==navigator.userAgent||navigator.userAgent.indexOf("MSIE")<0||document.documentMode>=10)?mxscript(App.TRELLO_JQUERY_URL,(function(){mxscript(App.TRELLO_URL,(function(){DrawTrelloClientCallback()}))})):void 0===window.Trello&&(window.TrelloClient=null)),null!=t&&t(i),"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",[i,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams.export&&EditorUi.debug("Export:",EXPORT_URL))}i.length>1&&(Graph.prototype.defaultThemes["default-style2"]=i[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=i[1].getDocumentElement()),"1"==urlParams.dev||EditorUi.isElectronApp?a():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],a))}),(function(t){var e=document.getElementById("geStatus");null!=e&&(e.innerHTML="Error loading page. <a>Please try refreshing.</a>",e.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en",p(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})}))}function g(){try{if(null!=mxSettings.settings){if(document.body.style.backgroundColor="dark"==uiTheme||mxSettings.settings.darkMode?Editor.darkColor:"#ffffff",null!=mxSettings.settings.autosaveDelay){var t=parseInt(mxSettings.settings.autosaveDelay);!isNaN(t)&&t>0?(DrawioFile.prototype.autosaveDelay=t,EditorUi.debug("Setting autosaveDelay",t)):EditorUi.debug("Invalid autosaveDelay",t)}null!=mxSettings.settings.defaultEdgeLength&&(t=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(t)&&t>0?(Graph.prototype.defaultEdgeLength=t,EditorUi.debug("Using defaultEdgeLength",t)):EditorUi.debug("Invalid defaultEdgeLength",t))}}catch(t){null!=window.console&&console.error(t)}if(null!=Menus.prototype.defaultFonts)for(var e=0;e<Menus.prototype.defaultFonts.length;e++){var i=Menus.prototype.defaultFonts[e];"string"!=typeof i&&null!=i.fontFamily&&null!=i.fontUrl&&Graph.addFont(i.fontFamily,i.fontUrl)}mxResources.loadDefaultBundle=!1,p(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}},mxUtils.extend(App,EditorUi),App.prototype.defaultUserPicture=IMAGE_PATH+"/default-user.jpg",App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIge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ByoIBAIueBd12TUjqAAAAAElFTkSuQmCC":IMAGE_PATH+"/fullscreen.png",App.prototype.warnInterval=3e5,App.prototype.compactMode=!1,App.prototype.fullscreenMode=!1,"1"!=urlParams.embed?App.prototype.menubarHeight=64:App.prototype.footerHeight=0,App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw=new Object,window.Draw.loadPlugin=function(t){App.DrawPlugins.push(t)})},App.pluginsLoaded={},App.embedModePluginsCount=0,App.loadPlugins=function(t,e){EditorUi.debug("Loading plugins",t);for(var i=0;i<t.length;i++)if(null!=t[i]&&t[i].length>0)try{var n=PLUGINS_BASE_PATH+App.pluginRegistry[t[i]];null!=n?null==App.pluginsLoaded[n]&&(App.pluginsLoaded[n]=!0,App.embedModePluginsCount++,void 0===window.drawDevUrl?e?mxinclude(n):mxscript(n):e?mxinclude(n):mxscript(drawDevUrl+n)):null!=window.console&&console.log("Unknown plugin:",t[i])}catch(e){null!=window.console&&console.log("Error loading plugin:",t[i],e)}},App.prototype.initializeEmbedMode=function(){if("1"==urlParams.embed){if("app.diagrams.net"==window.location.hostname&&this.showBanner("EmbedDeprecationFooter","app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net."),App.embedModePluginsCount>0||this.initEmbedDone)return;this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments)}},App.prototype.initializeViewerMode=function(){var t=window.opener||window.parent;null!=t&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,(function(){t.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")})))},App.prototype.init=function(){if(EditorUi.prototype.init.apply(this,arguments),this.defaultLibraryName=mxResources.get("untitledLibrary"),this.descriptorChangedListener=mxUtils.bind(this,this.descriptorChanged),this.gitHub=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gh||"1"==urlParams.embed&&"1"!=urlParams.gh?null:new GitHubClient(this),null!=this.gitHub&&this.gitHub.addListener("userChanged",mxUtils.bind(this,(function(){this.updateUserElement(),this.restoreLibraries()}))),this.gitLab=mxClient.IS_IE&&10!=document.documentMode&&!mxClient.IS_IE11&&!mxClient.IS_EDGE||"0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this),null!=this.gitLab&&this.gitLab.addListener("userChanged",mxUtils.bind(this,(function(){this.updateUserElement(),this.restoreLibraries()}))),this.notion="1"==urlParams.ntn?new NotionClient(this):null,null!=this.notion&&this.notion.addListener("userChanged",mxUtils.bind(this,(function(){this.updateUserElement(),this.restoreLibraries()}))),"1"!=urlParams.embed||"1"==urlParams.od){var t=mxUtils.bind(this,(function(){"undefined"!=typeof OneDrive?(this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,(function(){this.updateUserElement(),this.restoreLibraries()}))),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=t)}));t()}if("1"!=urlParams.embed||"1"==urlParams.tr){var e=mxUtils.bind(this,(function(){if(void 0!==window.Trello)try{this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,(function(){this.updateUserElement(),this.restoreLibraries()}))),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(t){null!=window.console&&console.error(t)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=e)}));e()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var i=mxUtils.bind(this,(function(){if("undefined"!=typeof gapi){var t=mxUtils.bind(this,(function(){this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,(function(){this.updateUserElement(),this.restoreLibraries(),this.checkLicense()}))),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}));null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,t),window.DrawGapiClientCallback=null):t()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=i)}));i()}if("1"!=urlParams.embed||"1"==urlParams.db){var n=mxUtils.bind(this,(function(){if("function"==typeof Dropbox&&void 0!==Dropbox.choose){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,(function(){this.updateUserElement(),this.restoreLibraries()}))),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(t){null!=window.console&&console.error(t)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=n)}));n()}if("1"!=urlParams.embed){if(this.bg=this.createBackground(),document.body.appendChild(this.bg),this.diagramContainer.style.visibility="hidden",this.formatContainer.style.visibility="hidden",this.hsplit.style.display="none",this.sidebarContainer.style.display="none",this.sidebarFooterContainer.style.display="none","1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,(function(t){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),(function(){t.prompt()}))}))),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOffline()||mxClient.IS_ANDROID||mxClient.IS_IOS||null!=urlParams.open||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,(function(){var t=this.getCurrentFile(),e=null!=t?t.getMode():null;"1"==urlParams.extAuth||e!=App.MODE_DEVICE&&e!=App.MODE_BROWSER?"1"!=urlParams.embed&&this.getServiceName():this.showDownloadDesktopBanner()}))),!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"1"!=urlParams.embed&&"auto"==DrawioFile.SYNC&&"1"!=urlParams.local&&"1"!=urlParams.stealth&&!this.isOffline()&&(!this.editor.chromeless||this.editor.editable)){var s=window.setTimeout(mxUtils.bind(this,(function(){DrawioFile.SYNC="manual";var t=this.getCurrentFile();if(null!=t&&null!=t.sync){t.sync.destroy(),t.sync=null;var e=mxUtils.htmlEntities(mxResources.get("timeout"));this.editor.setStatus('<div title="'+e+'" class="geStatusAlert">'+e+"</div>")}EditorUi.logEvent({category:"TIMEOUT-CACHE-CHECK",action:"timeout",label:408})})),Editor.cacheTimeout);(new Date).getTime(),mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,(function(t){window.clearTimeout(s)})))}}else null!=this.menubar&&(this.menubar.container.style.paddingTop="0px");this.updateHeader(),null!=this.menubar&&(this.buttonContainer=document.createElement("div"),this.buttonContainer.style.display="inline-block",this.buttonContainer.style.paddingRight="48px",this.buttonContainer.style.position="absolute",this.buttonContainer.style.right="0px",this.menubar.container.appendChild(this.buttonContainer)),"atlas"!=uiTheme&&"1"!=urlParams.atlas||null==this.menubar||(null!=this.toggleElement&&(this.toggleElement.click(),this.toggleElement.style.display="none"),this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.style.padding="1"==urlParams.atlas?"7px":"6px",this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,(function(t){this.appIconClicked(t)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)),this.editor.graph.isViewer()&&this.initializeViewerMode()},App.prototype.scheduleSanityCheck=function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=this.sanityCheckThread||(this.sanityCheckThread=window.setTimeout(mxUtils.bind(this,(function(){this.sanityCheckThread=null,this.sanityCheck()})),this.warnInterval))},App.prototype.stopSanityCheck=function(){null!=this.sanityCheckThread&&(window.clearTimeout(this.sanityCheckThread),this.sanityCheckThread=null)},App.prototype.sanityCheck=function(){var t=this.getCurrentFile();if(null!=t&&t.isModified()&&t.isAutosave()&&t.isOverdue()){var e={category:"WARN-FILE-"+t.getHash(),action:(t.savingFile?"saving":"")+(t.savingFile&&null!=t.savingFileTime?"_"+Math.round((Date.now()-t.savingFileTime.getTime())/1e3):"")+(null!=t.saveLevel?"-sl_"+t.saveLevel:"")+"-age_"+(null!=t.ageStart?Math.round((Date.now()-t.ageStart.getTime())/1e3):"x")+(this.editor.autosave?"":"-nosave")+(t.isAutosave()?"":"-noauto")+"-open_"+(null!=t.opened?Math.round((Date.now()-t.opened.getTime())/1e3):"x")+"-save_"+(null!=t.lastSaved?Math.round((Date.now()-t.lastSaved.getTime())/1e3):"x")+"-change_"+(null!=t.lastChanged?Math.round((Date.now()-t.lastChanged.getTime())/1e3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1e3),label:null!=t.sync?"client_"+t.sync.clientId:"nosync"};t.constructor==DriveFile&&null!=t.desc&&null!=this.drive&&(e.label+=(null!=this.drive.user?"-user_"+this.drive.user.id:"-nouser")+"-rev_"+t.desc.headRevisionId+"-mod_"+t.desc.modifiedDate+"-size_"+t.getSize()+"-mime_"+t.desc.mimeType),EditorUi.logEvent(e);var i=mxResources.get("ensureDataSaved");if(null!=t.lastSaved){var n=this.timeSince(t.lastSaved);null==n&&(n=mxResources.get("lessThanAMinute")),i=mxResources.get("lastSaved",[n])}this.spinner.stop(),this.showError(mxResources.get("unsavedChanges"),i,mxResources.get("ignore"),mxUtils.bind(this,(function(){this.hideDialog()})),null,mxResources.get("save"),mxUtils.bind(this,(function(){this.stopSanityCheck(),this.actions.get(null!=this.mode&&t.isEditable()?"save":"saveAs").funct()})),null,null,360,120,null,mxUtils.bind(this,(function(){this.scheduleSanityCheck()})))}},App.prototype.isDriveDomain=function(){return"0"!=urlParams.drive&&("test.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"app.diagrams.net"==window.location.hostname||"jgraph.github.io"==window.location.hostname)},App.prototype.getPusher=function(){return null==this.pusher&&"function"==typeof window.Pusher&&(this.pusher=new Pusher(App.PUSHER_KEY,{cluster:App.PUSHER_CLUSTER,encrypted:!0})),this.pusher},App.prototype.showNameChangeBanner=function(){this.showBanner("DiagramsFooter","draw.io is now diagrams.net",mxUtils.bind(this,(function(){this.openLink("https://www.diagrams.net/blog/move-diagrams-net")})))},App.prototype.showNameConfBanner=function(){this.showBanner("ConfFooter","Try draw.io for Confluence",mxUtils.bind(this,(function(){this.openLink("https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence")})),!0)},App.prototype.showDownloadDesktopBanner=function(){this.showBanner("DesktopFooter",mxResources.get("downloadDesktop"),mxUtils.bind(this,(function(){this.openLink("https://get.diagrams.net/")})))},App.prototype.showRatingBanner=function(){if(!(this.bannerShowing||this.hideBannerratingFooter||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings.closeratingFooter)){var t=document.createElement("div");t.style.cssText="position:absolute;bottom:10px;left:50%;max-width:90%;padding:18px 34px 12px 20px;font-size:16px;font-weight:bold;white-space:nowrap;cursor:pointer;z-index:"+mxPopupMenu.prototype.zIndex+";",mxUtils.setPrefixedStyle(t.style,"box-shadow","1px 1px 2px 0px #ddd"),mxUtils.setPrefixedStyle(t.style,"transform","translate(-50%,120%)"),mxUtils.setPrefixedStyle(t.style,"transition","all 1s ease"),t.className="geBtn gePrimaryBtn";var e=document.createElement("img");e.setAttribute("src",Dialog.prototype.closeImage),e.setAttribute("title",mxResources.get("close")),e.setAttribute("border","0"),e.style.cssText="position:absolute;right:10px;top:12px;filter:invert(1);padding:6px;margin:-6px;cursor:default;",t.appendChild(e);var i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==";mxUtils.write(t,"Please rate us"),document.body.appendChild(t);var n=document.createElement("img");n.setAttribute("border","0"),n.setAttribute("align","absmiddle"),n.setAttribute("title","1 star"),n.setAttribute("style","margin-top:-6px;cursor:pointer;margin-left:8px;"),n.setAttribute("src",i),t.appendChild(n);var s=document.createElement("img");s.setAttribute("border","0"),s.setAttribute("align","absmiddle"),s.setAttribute("title","2 star"),s.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;"),s.setAttribute("src",i),t.appendChild(s);var l=document.createElement("img");l.setAttribute("border","0"),l.setAttribute("align","absmiddle"),l.setAttribute("title","3 star"),l.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;"),l.setAttribute("src",i),t.appendChild(l);var o=document.createElement("img");o.setAttribute("border","0"),o.setAttribute("align","absmiddle"),o.setAttribute("title","4 star"),o.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;"),o.setAttribute("src",i),t.appendChild(o),this.bannerShowing=!0;var r=mxUtils.bind(this,(function(){null!=t.parentNode&&(t.parentNode.removeChild(t),this.bannerShowing=!1,this.hideBannerratingFooter=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeratingFooter=Date.now(),mxSettings.save()))}));mxEvent.addListener(e,"click",mxUtils.bind(this,(function(t){mxEvent.consume(t),r()}))),mxEvent.addListener(n,"click",mxUtils.bind(this,(function(t){mxEvent.consume(t),r()}))),mxEvent.addListener(s,"click",mxUtils.bind(this,(function(t){mxEvent.consume(t),r()}))),mxEvent.addListener(l,"click",mxUtils.bind(this,(function(t){mxEvent.consume(t),r()}))),mxEvent.addListener(o,"click",mxUtils.bind(this,(function(t){mxEvent.consume(t),window.open("https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence?hosting=datacenter&tab=reviews"),r()})));var a=mxUtils.bind(this,(function(){mxUtils.setPrefixedStyle(t.style,"transform","translate(-50%,120%)"),window.setTimeout(mxUtils.bind(this,(function(){r()})),1e3)}));window.setTimeout(mxUtils.bind(this,(function(){mxUtils.setPrefixedStyle(t.style,"transform","translate(-50%,0%)")})),500),window.setTimeout(a,6e4)}},App.prototype.checkLicense=function(){var t=this.drive.getUser(),e=null!=t?t.email:null;if(!this.isOffline()&&!this.editor.chromeless&&null!=e&&null!=t.id){var i=e.lastIndexOf("@"),n=i>=0?e.substring(i+1):"",s=Editor.crc32(t.id);mxUtils.post("/license","domain="+encodeURIComponent(n)+"&id="+encodeURIComponent(s)+"&ts="+(new Date).getTime(),mxUtils.bind(this,(function(t){try{if(t.getStatus()>=200&&t.getStatus()<=299){var e=t.getText();if(e.length>0){var i=JSON.parse(e);null!=i&&this.handleLicense(i,n)}}}catch(t){}})))}},App.prototype.handleLicense=function(t,e){null!=t&&null!=t.plugins&&App.loadPlugins(t.plugins.split(";"),!0)},App.prototype.getEditBlankXml=function(){var t=this.getCurrentFile();return null!=t&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?t.getData():this.getFileData(!0)},App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments),this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())},App.prototype.addRecent=function(t){if(isLocalStorage&&null!=localStorage){var e=this.getRecent();if(null==e)e=[];else for(var i=0;i<e.length;i++)e[i].id==t.id&&e.splice(i,1);null!=e&&(e.unshift(t),e=e.slice(0,10),localStorage.setItem(".recent",JSON.stringify(e)))}},App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{var t=localStorage.getItem(".recent");if(null!=t)return JSON.parse(t)}catch(t){}return null}},App.prototype.resetRecent=function(t){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent")}catch(t){}},App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");var t=this.getCurrentFile();if(null!=t){if(!(t.constructor!=LocalFile||""!=t.getHash()||t.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()||null!=t.fileHandle))return mxResources.get("ensureDataSaved");if(t.isModified())return mxResources.get("allChangesLost");t.close(!0)}},App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var t=this.editor.appName,e=this.getCurrentFile();if(this.isOfflineApp()&&(t+=" app"),null!=e&&(t=(null!=e.getTitle()?e.getTitle():this.defaultFilename)+" - "+t),document.title!=t){document.title=t;var i=this.editor.graph;i.invalidateDescendantsWithPlaceholders(i.model.getRoot()),i.view.validate()}}},App.prototype.getThumbnail=function(t,e){var i=!1;try{var n=!0,s=window.setTimeout(mxUtils.bind(this,(function(){n=!1,e(null)})),this.timeout),l=mxUtils.bind(this,(function(t){window.clearTimeout(s),n&&e(t)}));null==this.thumbImageCache&&(this.thumbImageCache=new Object);var o=this.editor.graph,r=o.backgroundImage,a=null!=o.themes&&"darkTheme"==o.defaultThemeName;if(null!=this.pages&&(a||this.currentPage!=this.pages[0])){var u=o.getGlobalVariable;(o=this.createTemporaryGraph(o.getStylesheet())).setBackgroundImage=this.editor.graph.setBackgroundImage;var d=this.pages[0];this.currentPage==d?o.setBackgroundImage(r):null!=d.viewState&&null!=d.viewState&&(r=d.viewState.backgroundImage,o.setBackgroundImage(r)),o.getGlobalVariable=function(t){return"page"==t?d.getName():"pagenumber"==t?1:u.apply(this,arguments)},o.getGlobalVariable=u,document.body.appendChild(o.container),o.model.setRoot(d.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,(function(t){try{o!=this.editor.graph&&null!=o.container.parentNode&&o.container.parentNode.removeChild(o.container)}catch(e){t=null}l(t)})),t,this.thumbImageCache,"#ffffff",(function(){l()}),null,null,null,null,null,null,o,null,null,null,null,"diagram",null),i=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var h=document.createElement("canvas"),c=o.getGraphBounds(),p=o.view.translate,g=o.view.scale;null!=r&&(c=mxRectangle.fromRectangle(c)).add(new mxRectangle((p.x+r.x)*g,(p.y+r.y)*g,r.width*g,r.height*g));var m=t/c.width;m=Math.min(1,Math.min(3*t/(4*c.height),m));var A=Math.floor(c.x),b=Math.floor(c.y);h.setAttribute("width",Math.ceil(m*(c.width+4))),h.setAttribute("height",Math.ceil(m*(c.height+4)));var f=h.getContext("2d");f.scale(m,m),f.translate(-A,-b);var x=o.background;if(null!=x&&""!=x&&x!=mxConstants.NONE||(x="#ffffff"),f.save(),f.fillStyle=x,f.fillRect(A,b,Math.ceil(c.width+4),Math.ceil(c.height+4)),f.restore(),null!=r){var w=new Image;w.src=r.src,f.drawImage(w,r.x*m,r.y*m,r.width*m,r.height*m)}var E=new mxJsCanvas(h),y=new mxAsyncCanvas(this.thumbImageCache);E.images=this.thumbImageCache.images;var v=new mxImageExport;v.drawShape=function(t,e){t.shape instanceof mxShape&&t.shape.checkBounds()&&(e.save(),e.translate(.5,.5),t.shape.paint(e),e.translate(-.5,-.5),e.restore())},v.drawText=function(t,e){},v.drawState(o.getView().getState(o.model.root),y),y.finish(mxUtils.bind(this,(function(){try{v.drawState(o.getView().getState(o.model.root),E),o!=this.editor.graph&&null!=o.container.parentNode&&o.container.parentNode.removeChild(o.container)}catch(t){h=null}l(h)}))),i=!0}}catch(t){i=!1,null!=o&&o!=this.editor.graph&&null!=o.container.parentNode&&o.container.parentNode.removeChild(o.container)}return i||window.clearTimeout(s),i},App.prototype.createBackground=function(){var t=this.createDiv("background");return t.style.position="absolute",t.style.background="white",t.style.left="0px",t.style.top="0px",t.style.bottom="0px",t.style.right="0px",mxUtils.setOpacity(t,100),t},function(){var t=EditorUi.prototype.setMode;App.prototype.setMode=function(e,i){if(t.apply(this,arguments),null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER),null!=this.appIcon){var n=this.getCurrentFile();(e=null!=n?n.getMode():e)==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):e==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):e==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=e==App.MODE_DEVICE?"pointer":"default")}if(i)try{if(isLocalStorage)localStorage.setItem(".mode",e);else if("undefined"!=typeof Storage){var s=new Date;s.setYear(s.getFullYear()+1),document.cookie="MODE="+e+"; expires="+s.toUTCString()}}catch(t){}}}(),App.prototype.appIconClicked=function(t){if(mxEvent.isAltDown(t))this.showSplash(!0);else{var e=this.getCurrentFile(),i=null!=e?e.getMode():null;if(i==App.MODE_GOOGLE)null!=e&&null!=e.desc&&null!=e.desc.parents&&e.desc.parents.length>0&&!mxEvent.isShiftDown(t)?this.openLink("https://drive.google.com/drive/folders/"+e.desc.parents[0].id):null!=e&&null!=e.getId()?this.openLink("https://drive.google.com/open?id="+e.getId()):this.openLink("https://drive.google.com/?authuser=0");else if(i==App.MODE_ONEDRIVE)if(null!=e&&null!=e.meta&&null!=e.meta.webUrl){var n=e.meta.webUrl,s=encodeURIComponent(e.meta.name);n.substring(n.length-s.length,n.length)==s&&(n=n.substring(0,n.length-s.length)),this.openLink(n)}else this.openLink("https://onedrive.live.com/");else i==App.MODE_DROPBOX?null!=e&&null!=e.stat&&null!=e.stat.path_display?(n="https://www.dropbox.com/home/Apps/drawio"+e.stat.path_display,mxEvent.isShiftDown(t)||(n=n.substring(0,n.length-e.stat.name.length)),this.openLink(n)):this.openLink("https://www.dropbox.com/"):i==App.MODE_TRELLO?this.openLink("https://trello.com/"):i==App.MODE_NOTION?this.openLink("https://www.notion.so/"):i==App.MODE_GITHUB?null!=e&&e.constructor==GitHubFile?this.openLink(e.meta.html_url):this.openLink("https://github.com/"):i==App.MODE_GITLAB?null!=e&&e.constructor==GitLabFile?this.openLink(e.meta.html_url):this.openLink(DRAWIO_GITLAB_URL):i==App.MODE_DEVICE&&this.openLink("https://get.draw.io/")}mxEvent.consume(t)},App.prototype.clearMode=function(){if(isLocalStorage)localStorage.removeItem(".mode");else if("undefined"!=typeof Storage){var t=new Date;t.setYear(t.getFullYear()-1),document.cookie="MODE=; expires="+t.toUTCString()}},App.prototype.getDiagramId=function(){var t=window.location.hash;if(null!=t&&t.length>0&&(t=t.substring(1)),null!=t&&t.length>1&&"T"==t.charAt(0)){var e=t.indexOf("#");e>0&&(t=t.substring(0,e))}return t},App.prototype.open=function(){try{if(null!=window.opener){var t=urlParams.create;if(null!=t&&(t=decodeURIComponent(t)),null!=t&&t.length>0&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)){var e=mxUtils.parseXml(window.opener[t]);this.editor.setGraphXml(e.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,(function(t,e,i){if(this.spinner.stop(),null==e){var n=urlParams.title;i=!0,e=null!=n?decodeURIComponent(n):this.defaultFilename}(this.useCanvasForExport?-1:".png"==e.substring(e.length-4))>0&&(e=e.substring(0,e.length-4)+".drawio"),this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,t,e):new LocalFile(this,t,e,i))})))}}catch(t){}},App.prototype.loadGapi=function(t){"undefined"!=typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,t)},App.prototype.load=function(){if("1"!=urlParams.embed){if(this.spinner.spin(document.body,mxResources.get("starting"))){try{this.stateArg=null!=urlParams.state&&null!=this.drive?JSON.parse(decodeURIComponent(urlParams.state)):null}catch(t){}this.editor.graph.setEnabled(null!=this.getCurrentFile()),null!=window.location.hash&&0!=window.location.hash.length||null==this.drive||null==this.stateArg||null==this.stateArg.userId||this.drive.setUserId(this.stateArg.userId),null!=urlParams.fileId?(window.location.hash="G"+urlParams.fileId,window.location.search=this.getSearch(["fileId"])):null==this.drive?(this.mode==App.MODE_GOOGLE&&(this.mode=null),this.start()):this.loadGapi(mxUtils.bind(this,(function(){this.start()})))}}else this.restoreLibraries(),"1"==urlParams.gapi&&this.loadGapi((function(){}))},App.prototype.showRefreshDialog=function(t,e){if(!this.showingRefreshDialog&&(this.showingRefreshDialog=!0,this.showError(t||mxResources.get("externalChanges"),e||mxResources.get("redirectToNewApp"),mxResources.get("refresh"),mxUtils.bind(this,(function(){var t=this.getCurrentFile();null!=t&&t.setModified(!1),this.spinner.spin(document.body,mxResources.get("connecting")),this.editor.graph.setEnabled(!1),window.location.reload()})),null,null,null,null,null,340,180),null!=this.dialog&&null!=this.dialog.container)){var i=this.createRealtimeNotice();i.style.left="0",i.style.right="0",i.style.borderRadius="0",i.style.borderLeftStyle="none",i.style.borderRightStyle="none",i.style.marginBottom="26px",i.style.padding="8px 0 8px 0",this.dialog.container.appendChild(i)}},App.prototype.showAlert=function(t){if(null!=t&&t.length>0){var e=document.createElement("div");e.className="geAlert",e.style.zIndex=2e9,e.style.left="50%",e.style.top="-100%",e.style.maxWidth="80%",e.style.width="max-content",e.style.whiteSpace="pre-wrap",mxUtils.setPrefixedStyle(e.style,"transform","translate(-50%,0%)"),mxUtils.setPrefixedStyle(e.style,"transition","all 1s ease"),e.innerHTML=t;var i=document.createElement("a");i.className="geAlertLink",i.style.textAlign="right",i.style.marginTop="20px",i.style.display="block",i.setAttribute("title",mxResources.get("close")),i.innerHTML=mxResources.get("close"),e.appendChild(i),mxEvent.addListener(i,"click",(function(t){null!=e.parentNode&&(e.parentNode.removeChild(e),mxEvent.consume(t))})),document.body.appendChild(e),window.setTimeout((function(){e.style.top="30px"}),10),window.setTimeout((function(){mxUtils.setPrefixedStyle(e.style,"transition","all 2s ease"),e.style.opacity="0",window.setTimeout((function(){null!=e.parentNode&&e.parentNode.removeChild(e)}),2e3)}),15e3)}},App.prototype.start=function(){null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg),this.restoreLibraries(),this.spinner.stop();try{var t=this;if(window.onerror=function(e,i,n,s,l){"ResizeObserver loop limit exceeded"!=e&&(EditorUi.logError("Uncaught: "+(null!=e?e:""),i,n,s,l,null,!0),t.handleError({message:e},mxResources.get("unknownError"),null,null,null,null,!0))},"1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,(function(t){var e=this.getCurrentFile();EditorUi.debug("storage event",t,e),null!=e&&".draft-alive-check"==t.key&&null!=t.newValue&&null!=e.draftId&&(this.draftAliveCheck=t.newValue,e.saveDraft())}))),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()||null!=urlParams.open||!/www\.draw\.io$/.test(window.location.hostname)||this.editor.chromeless&&!this.editor.editable||this.showNameChangeBanner()}catch(t){}mxEvent.addListener(window,"hashchange",mxUtils.bind(this,(function(t){try{this.hideDialog();var e=this.getDiagramId(),i=this.getCurrentFile();null!=i&&i.getHash()==e||this.loadFile(e,!0)}catch(t){null!=document.body&&this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,(function(){var t=this.getCurrentFile();window.location.hash=null!=t?t.getHash():""})))}})))}if((null==window.location.hash||window.location.hash.length<=1)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,(function(t){this.handleError(t,mxResources.get("errorLoadingFile"))})))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||window.location.hash.length<=1)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var e=mxUtils.bind(this,(function(){if("1"!=urlParams.client||null!=window.location.hash&&0!=window.location.hash.length&&"#P"!=window.location.hash.substring(0,2)){if(null==this.dialog)if("1"==urlParams.demo){var t=Editor.useLocalStorage;this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=t}else{var e=!1;try{e=null!=window.opener&&null!=window.opener.openFile}catch(t){}if(e)this.spinner.spin(document.body,mxResources.get("loading"));else{var i=this.getDiagramId();!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=i&&0!=i.length||this.editor.isChromelessView()?null!=i&&i.length>0?this.loadFile(i,null,null,mxUtils.bind(this,(function(){var t=decodeURIComponent(urlParams.viewbox||"");if(""!=t)try{var e=JSON.parse(t);this.editor.graph.fitWindow(e,e.border)}catch(t){console.error(t)}}))):"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts()}}}else{var n=mxUtils.bind(this,(function(t){Editor.isPngDataUrl(t)&&(t=Editor.extractGraphModelFromPng(t));var e=urlParams.title;e=null!=e?decodeURIComponent(e):this.defaultFilename;var i=new LocalFile(this,t,e,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(i.getHash=function(){return window.location.hash.substring(1)}),this.fileLoaded(i),this.getCurrentFile().setModified(!this.editor.chromeless)})),s=window.opener||window.parent;if(s!=window){var l=urlParams.create;null!=l?n(s[decodeURIComponent(l)]):null!=(l=urlParams.data)?n(decodeURIComponent(l)):this.installMessageHandler(mxUtils.bind(this,(function(t,e){e.source==s&&n(t)})))}}})),i=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||window.location.hash.length<=1)&&null!=i&&i.length>0&&this.spinner.spin(document.body,mxResources.get("loading"))){var n=mxUtils.bind(this,(function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))})),s=mxUtils.bind(this,(function(t){if(this.spinner.stop(),"0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,t,null)),this.editor.graph.setEnabled(!1),this.mode=urlParams.mode;var e=urlParams.title;e=null!=e?decodeURIComponent(e):this.defaultFilename;var i=this.getServiceCount(!0);isLocalStorage&&i++;var n=i<=4?2:i>6?4:3,s=new CreateDialog(this,e,mxUtils.bind(this,(function(t,e){if(null==e){this.hideDialog();var i=Editor.useLocalStorage;this.createFile(t.length>0?t:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0),Editor.useLocalStorage=i}else this.pickFolder(e,mxUtils.bind(this,(function(i){this.createFile(t,this.getFileData(!0),null,e,null,!0,i)})))})),null,null,null,null,"1"==urlParams.browser,null,null,!0,n,null,null,null,this.editor.fileExtensions);this.showDialog(s.container,400,i>n?390:270,!0,!1,mxUtils.bind(this,(function(t){t&&null==this.getCurrentFile()&&this.showSplash()}))),s.init()}}));if("http://"!=(i=decodeURIComponent(i)).substring(0,7)&&"https://"!=i.substring(0,8))try{null!=window.opener&&null!=window.opener[i]?s(window.opener[i]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}else this.loadTemplate(i,(function(t){s(t)}),mxUtils.bind(this,(function(){this.handleError(null,mxResources.get("errorLoadingFile"),n)})))}else(null==window.location.hash||window.location.hash.length<=1)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),window.location.hash="G"+this.stateArg.ids[0]):(null==window.location.hash||window.location.hash.length<=1)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),this.setMode(App.MODE_GOOGLE),"0"==urlParams.splash?this.createFile(null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename):this.actions.get("new").funct()):(null!=urlParams.open&&window.history&&window.history.replaceState&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["open"])),window.location.hash=urlParams.open),e())}}catch(t){this.handleError(t)}},App.prototype.loadDraft=function(t,e){this.createFile(this.defaultFilename,t,null,null,mxUtils.bind(this,(function(){window.setTimeout(mxUtils.bind(this,(function(){var t=this.getCurrentFile();null!=t&&(t.fileChanged(),null!=e&&e())})),0)})),null,null,!0)},App.prototype.filterDrafts=function(t,e,i){var n=[];function s(){i(n)}try{this.getDatabaseItems(mxUtils.bind(this,(function(i){for(var l=0;l<i.length;l++)try{var o=i[l].key;if(null!=o&&".draft_"==o.substring(0,7)){var r=JSON.parse(i[l].data);null!=r&&"draft"==r.type&&r.aliveCheck!=e&&(null==t&&null==r.fileObject||null!=r.fileObject&&r.fileObject.path==t)&&(r.key=o,n.push(r))}}catch(t){}s()}),s))}catch(t){s()}},App.prototype.checkDrafts=function(){try{var t=Editor.guid();localStorage.setItem(".draft-alive-check",t),window.setTimeout(mxUtils.bind(this,(function(){localStorage.removeItem(".draft-alive-check"),this.filterDrafts(null,t,mxUtils.bind(this,(function(t){if(1==t.length)this.loadDraft(t[0].data,mxUtils.bind(this,(function(){this.removeDatabaseItem(t[0].key)})));else if(t.length>1){var e=new Date(t[0].modified),i=new DraftDialog(this,t.length>1?mxResources.get("selectDraft"):mxResources.get("draftFound",[e.toLocaleDateString()+" "+e.toLocaleTimeString()]),t.length>1?null:t[0].data,mxUtils.bind(this,(function(e){this.hideDialog(),e=""!=e?e:0,this.loadDraft(t[e].data,mxUtils.bind(this,(function(){this.removeDatabaseItem(t[e].key)})))})),mxUtils.bind(this,(function(e,i){e=""!=e?e:0,this.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,(function(){this.removeDatabaseItem(t[e].key),null!=i&&i()})),mxResources.get("no"),mxResources.get("yes"))})),null,null,null,t.length>1?t:null);this.showDialog(i.container,640,480,!0,!1,mxUtils.bind(this,(function(t){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}))),i.init()}else"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)})))})),0)}catch(t){}},App.prototype.showSplash=function(t){if("1"!=urlParams.noFileMenu){var e=this.getServiceCount(!0),i=mxUtils.bind(this,(function(){var t=new SplashDialog(this);this.showDialog(t.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:230,!0,!0,mxUtils.bind(this,(function(t){if(t&&!mxClient.IS_CHROMEAPP){var e=Editor.useLocalStorage;this.createFile(this.defaultFilename+(EditorUi.isElectronApp?".drawio":""),null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=e}})),!0)}));if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,(function(){this.showSplash()})));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!t)null==urlParams.create&&i();else{var n=4==e?2:3,s=new StorageDialog(this,mxUtils.bind(this,(function(){this.hideDialog(),i()})),n);this.showDialog(s.container,n<3?200:300,e>3?320:210,!0,!1)}}},App.prototype.addLanguageMenu=function(t,e){var i=null;if(null!=this.menus.get("language")){if((i=document.createElement("div")).setAttribute("title",mxResources.get("language")),i.className="geIcon geSprite geSprite-globe",i.style.position="absolute",i.style.cursor="pointer",i.style.bottom="20px",i.style.right="20px",e){i.style.direction="rtl",i.style.textAlign="right",i.style.right="24px";var n=document.createElement("span");n.style.display="inline-block",n.style.fontSize="12px",n.style.margin="5px 24px 0 0",n.style.color="gray",n.style.userSelect="none",mxUtils.write(n,mxResources.get("language")),i.appendChild(n)}mxEvent.addListener(i,"click",mxUtils.bind(this,(function(t){this.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(this.menus.get("language").funct);e.div.className+=" geMenubarMenu",e.smartSeparators=!0,e.showDisabled=!0,e.autoExpand=!0,e.hideMenu=mxUtils.bind(this,(function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments),e.destroy()}));var n=mxUtils.getOffset(i);e.popup(n.x,n.y+i.offsetHeight,null,t),this.setCurrentMenu(e)}))),t.appendChild(i)}return i},App.prototype.loadFileSystemEntry=function(t,e,i){i=null!=i?i:mxUtils.bind(this,(function(t){this.handleError(t)}));try{t.getFile().then(mxUtils.bind(this,(function(n){var s=new FileReader;s.onload=mxUtils.bind(this,(function(s){try{if(null!=e){var l=s.target.result;"image/png"==n.type&&(l=this.extractGraphModelFromPng(l)),e(new LocalFile(this,l,n.name,null,t,n))}else this.openFileHandle(s.target.result,n.name,n,!1,t)}catch(s){i(s)}})),s.onerror=i,"image"!==n.type.substring(0,5)&&"application/pdf"!==n.type||"image/svg"===n.type.substring(0,9)?s.readAsText(n):s.readAsDataURL(n)})),i)}catch(t){i(t)}},App.prototype.createFileSystemOptions=function(t){var e=[],i=null;if(null!=t){var n=t.lastIndexOf(".");n>0&&(i=t.substring(n+1))}for(var s=0;s<this.editor.diagramFileTypes.length;s++){var l={description:mxResources.get(this.editor.diagramFileTypes[s].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[s].extension+")":""),accept:{}};l.accept[this.editor.diagramFileTypes[s].mimeType]=["."+this.editor.diagramFileTypes[s].extension],this.editor.diagramFileTypes[s].extension==i||this.editor.diagramFileTypes[s].extension==i?e.splice(0,0,l):e.push(l)}return{types:e,fileName:t}},App.prototype.showSaveFilePicker=function(t,e,i){e=null!=e?e:mxUtils.bind(this,(function(t){"AbortError"!=t.name&&this.handleError(t)})),i=null!=i?i:this.createFileSystemOptions(),window.showSaveFilePicker(i).then(mxUtils.bind(this,(function(i){null!=i&&i.getFile().then(mxUtils.bind(this,(function(e){t(i,e)})),e)})),e)},App.prototype.pickFile=function(t){try{if((t=null!=t?t:this.mode)==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&void 0!==google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var e=this.getPeerForMode(t);if(null!=e)e.pickFile();else if(t==App.MODE_DEVICE&&EditorUi.nativeFileSupport)window.showOpenFilePicker().then(mxUtils.bind(this,(function(t){null!=t&&t.length>0&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(t[0])})),mxUtils.bind(this,(function(t){"AbortError"!=t.name&&this.handleError(t)})));else if(t==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var i=document.createElement("input");i.setAttribute("type","file"),mxEvent.addListener(i,"change",mxUtils.bind(this,(function(){null!=i.files&&(this.openFiles(i.files),i.type="",i.type="file",i.value="")}))),i.style.display="none",document.body.appendChild(i),this.openFileInputElt=i}this.openFileInputElt.click()}else{this.hideDialog(),window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty(),window.baseUrl=this.getUrl(),window.openKey="open",window.listBrowserFiles=mxUtils.bind(this,(function(t,e){StorageFile.listFiles(this,"F",t,e)})),window.openBrowserFile=mxUtils.bind(this,(function(t,e,i){StorageFile.getFileContent(this,t,e,i)})),window.deleteBrowserFile=mxUtils.bind(this,(function(t,e,i){StorageFile.deleteFile(this,t,e,i)}));var n=Editor.useLocalStorage;Editor.useLocalStorage=t==App.MODE_BROWSER,this.openFile(),window.openFile.setConsumer(mxUtils.bind(this,(function(e,i){var n=mxUtils.bind(this,(function(){!this.useCanvasForExport&&".png"==i.substring(i.length-4)&&(i=i.substring(0,i.length-4)+".drawio"),this.fileLoaded(t==App.MODE_BROWSER?new StorageFile(this,e,i):new LocalFile(this,e,i))})),s=this.getCurrentFile();null!=s&&s.isModified()?this.confirm(mxResources.get("allChangesLost"),null,n,mxResources.get("cancel"),mxResources.get("discardChanges")):n()})));var s=this.dialog,l=s.close;this.dialog.close=mxUtils.bind(this,(function(t){Editor.useLocalStorage=n,l.apply(s,arguments),null==this.getCurrentFile()&&this.showSplash()}))}}}catch(t){this.handleError(t)}},App.prototype.pickLibrary=function(t){if((t=null!=t?t:this.mode)==App.MODE_GOOGLE||t==App.MODE_DROPBOX||t==App.MODE_ONEDRIVE||t==App.MODE_GITHUB||t==App.MODE_GITLAB||t==App.MODE_TRELLO||t==App.MODE_NOTION){var e=t==App.MODE_GOOGLE?this.drive:t==App.MODE_ONEDRIVE?this.oneDrive:t==App.MODE_GITHUB?this.gitHub:t==App.MODE_GITLAB?this.gitLab:t==App.MODE_TRELLO?this.trello:t==App.MODE_NOTION?this.notion:this.dropbox;null!=e&&e.pickLibrary(mxUtils.bind(this,(function(t,i){if(null!=i)try{this.loadLibrary(i)}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body,mxResources.get("loading"))&&e.getLibrary(t,mxUtils.bind(this,(function(t){this.spinner.stop();try{this.loadLibrary(t)}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}})),mxUtils.bind(this,(function(t){this.handleError(t,null!=t?mxResources.get("errorLoadingFile"):null)})))})))}else if(t==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var i=document.createElement("input");i.setAttribute("type","file"),mxEvent.addListener(i,"change",mxUtils.bind(this,(function(){if(null!=i.files){for(var t=0;t<i.files.length;t++)mxUtils.bind(this,(function(t){var e=new FileReader;e.onload=mxUtils.bind(this,(function(e){try{this.loadLibrary(new LocalLibrary(this,e.target.result,t.name))}catch(e){this.handleError(e,mxResources.get("errorLoadingFile"))}})),e.readAsText(t)}))(i.files[t]);i.type="",i.type="file",i.value=""}}))),i.style.display="none",document.body.appendChild(i),this.libFileInputElt=i}this.libFileInputElt.click()}else{window.openNew=!1,window.openKey="open",window.listBrowserFiles=mxUtils.bind(this,(function(t,e){StorageFile.listFiles(this,"L",t,e)})),window.openBrowserFile=mxUtils.bind(this,(function(t,e,i){StorageFile.getFileContent(this,t,e,i)})),window.deleteBrowserFile=mxUtils.bind(this,(function(t,e,i){StorageFile.deleteFile(this,t,e,i)}));var n=Editor.useLocalStorage;Editor.useLocalStorage=t==App.MODE_BROWSER,window.openFile=new OpenFile(mxUtils.bind(this,(function(t){this.hideDialog(t)}))),window.openFile.setConsumer(mxUtils.bind(this,(function(e,i){try{this.loadLibrary(t==App.MODE_BROWSER?new StorageLibrary(this,e,i):new LocalLibrary(this,e,i))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}))),this.showDialog(new OpenDialog(this).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,(function(){Editor.useLocalStorage=n,window.openFile=null}))}},App.prototype.saveLibrary=function(t,e,i,n,s,l,o){try{n=null!=n?n:this.mode,s=null!=s&&s,l=null!=l&&l;var r=this.createLibraryDataFromImages(e),a=mxUtils.bind(this,(function(t){this.spinner.stop(),null!=o&&o(),this.handleError(t,null!=t?mxResources.get("errorSavingFile"):null)}));if(null==i&&n==App.MODE_DEVICE&&(i=new LocalLibrary(this,r,t)),null==i)this.pickFolder(n,mxUtils.bind(this,(function(i){if(n==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting")))this.drive.insertFile(t,r,i,mxUtils.bind(this,(function(t){this.spinner.stop(),this.hideDialog(!0),this.libraryLoaded(t,e)})),a,this.drive.libraryMimeType);else if(n==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting")))this.gitHub.insertLibrary(t,r,mxUtils.bind(this,(function(t){this.spinner.stop(),this.hideDialog(!0),this.libraryLoaded(t,e)})),a,i);else if(n==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting")))this.gitLab.insertLibrary(t,r,mxUtils.bind(this,(function(t){this.spinner.stop(),this.hideDialog(!0),this.libraryLoaded(t,e)})),a,i);else if(n==App.MODE_NOTION&&null!=this.notion&&this.spinner.spin(document.body,mxResources.get("inserting")))this.notion.insertLibrary(t,r,mxUtils.bind(this,(function(t){this.spinner.stop(),this.hideDialog(!0),this.libraryLoaded(t,e)})),a,i);else if(n==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting")))this.trello.insertLibrary(t,r,mxUtils.bind(this,(function(t){this.spinner.stop(),this.hideDialog(!0),this.libraryLoaded(t,e)})),a,i);else if(n==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting")))this.dropbox.insertLibrary(t,r,mxUtils.bind(this,(function(t){this.spinner.stop(),this.hideDialog(!0),this.libraryLoaded(t,e)})),a,i);else if(n==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting")))this.oneDrive.insertLibrary(t,r,mxUtils.bind(this,(function(t){this.spinner.stop(),this.hideDialog(!0),this.libraryLoaded(t,e)})),a,i);else if(n==App.MODE_BROWSER){var s=mxUtils.bind(this,(function(){var i=new StorageLibrary(this,r,t);i.saveFile(t,!1,mxUtils.bind(this,(function(){this.hideDialog(!0),this.libraryLoaded(i,e)})),a)}));null==localStorage.getItem(t)?s():this.confirm(mxResources.get("replaceIt",[t]),s)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})})));else if(s||this.spinner.spin(document.body,mxResources.get("saving"))){i.setData(r);var u=mxUtils.bind(this,(function(){i.save(!0,mxUtils.bind(this,(function(t){this.spinner.stop(),this.hideDialog(!0),l||this.libraryLoaded(i,e),null!=o&&o()})),a)}));if(t!=i.getTitle()){var d=i.getHash();i.rename(t,mxUtils.bind(this,(function(t){i.constructor!=LocalLibrary&&d!=i.getHash()&&(mxSettings.removeCustomLibrary(d),mxSettings.addCustomLibrary(i.getHash())),this.removeLibrarySidebar(d),u()})),a)}else u()}}catch(t){this.handleError(t)}},App.prototype.saveFile=function(t,e){var i=this.getCurrentFile();if(null!=i){var n=mxUtils.bind(this,(function(){EditorUi.enableDrafts&&i.removeDraft(),this.getCurrentFile()==i||i.isModified()||(i.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")),null!=e&&e()}));if(t||null==i.getTitle()||null!=i.invalidFileHandle||null==this.mode)if(null!=i&&i.constructor==LocalFile&&null!=i.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,(function(t,e){i.invalidFileHandle=null,i.fileHandle=t,i.title=e.name,i.desc=e,this.save(e.name,n)})),null,this.createFileSystemOptions(i.getTitle()));else{var s=null!=i.getTitle()?i.getTitle():this.defaultFilename,l=!mxClient.IS_IOS||!navigator.standalone,o=this.mode,r=this.getServiceCount(!0);isLocalStorage&&r++;var a=r<=4?2:r>6?4:3,u=new CreateDialog(this,s,mxUtils.bind(this,(function(t,e,s){null!=t&&t.length>0&&(/(\.pdf)$/i.test(t)?this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,(function(){this.hideDialog(),this.actions.get("exportPdf").funct()})),mxUtils.bind(this,(function(){s.value=t.split(".").slice(0,-1).join("."),s.focus(),mxClient.IS_GC||mxClient.IS_FF||document.documentMode>=5?s.select():document.execCommand("selectAll",!1,null)})),mxResources.get("yes"),mxResources.get("no")):(this.hideDialog(),null==o&&e==App.MODE_DEVICE?null!=i&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,(function(t,e){i.fileHandle=t,i.mode=App.MODE_DEVICE,i.title=e.name,i.desc=e,this.setMode(App.MODE_DEVICE),this.save(e.name,n)})),mxUtils.bind(this,(function(t){"AbortError"!=t.name&&this.handleError(t)})),this.createFileSystemOptions(t)):(this.setMode(App.MODE_DEVICE),this.save(t,n)):"download"==e?new LocalFile(this,null,t).save():"_blank"==e?(window.openFile=new OpenFile((function(){window.openFile=null})),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0)):o!=e?this.pickFolder(e,mxUtils.bind(this,(function(i){this.createFile(t,this.getFileData(/(\.xml)$/i.test(t)||t.indexOf(".")<0||/(\.drawio)$/i.test(t),/(\.svg)$/i.test(t),/(\.html)$/i.test(t)),null,e,n,null==this.mode,i)}))):null!=e&&this.save(t,n)))})),mxUtils.bind(this,(function(){this.hideDialog()})),mxResources.get("saveAs"),mxResources.get("download"),null,null,l,null,!0,a,null,null,null,this.editor.fileExtensions,!1);this.showDialog(u.container,400,r>a?390:270,!0,!0),u.init()}else this.save(i.getTitle(),n)}},App.prototype.loadTemplate=function(t,e,i,n,s){var l=!1,o=t;if(!this.editor.isCorsEnabledForUrl(o)){var r="t="+(new Date).getTime();o=PROXY_URL+"?url="+encodeURIComponent(t)+"&base64=1&"+r,l=!0}var a=null!=n?n:t;this.editor.loadUrl(o,mxUtils.bind(this,(function(n){try{var o=l?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(n):atob(n):n,r=/(\.v(dx|sdx?))($|\?)/i.test(a)||/(\.vs(x|sx?))($|\?)/i.test(a);r||this.isVisioData(o)?(r||(a=s?this.isRemoteVisioData(o)?"raw.vss":"raw.vssx":this.isRemoteVisioData(o)?"raw.vsd":"raw.vsdx"),this.importVisio(this.base64ToBlob(n.substring(n.indexOf(",")+1)),(function(t){e(t)}),i,a)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(o,a)?this.parseFile(new Blob([o],{type:"application/octet-stream"}),mxUtils.bind(this,(function(t){4==t.readyState&&t.status>=200&&t.status<=299&&"<mxGraphModel"==t.responseText.substring(0,13)&&e(t.responseText)})),t):this.isLucidChartData(o)?this.convertLucidChart(o,mxUtils.bind(this,(function(t){e(t)})),mxUtils.bind(this,(function(t){i(t)}))):((/(\.png)($|\?)/i.test(a)||Editor.isPngData(o))&&(o=Editor.extractGraphModelFromPng(n)),e(o))}catch(t){i(t)}})),i,/(\.png)($|\?)/i.test(a)||/(\.v(dx|sdx?))($|\?)/i.test(a)||/(\.vs(x|sx?))($|\?)/i.test(a),null,null,l)},App.prototype.getPeerForMode=function(t){return t==App.MODE_GOOGLE?this.drive:t==App.MODE_GITHUB?this.gitHub:t==App.MODE_GITLAB?this.gitLab:t==App.MODE_DROPBOX?this.dropbox:t==App.MODE_ONEDRIVE?this.oneDrive:t==App.MODE_TRELLO?this.trello:t==App.MODE_NOTION?this.notion:null},App.prototype.createFile=function(t,e,i,n,s,l,o,r,a){if(n=r?null:null!=n?n:this.mode,null!=t&&this.spinner.spin(document.body,mxResources.get("inserting"))){e=null!=e?e:this.emptyDiagramXml;var u=mxUtils.bind(this,(function(){this.spinner.stop()})),d=mxUtils.bind(this,(function(t){u(),null==t&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=t&&this.handleError(t)}));try{n==App.MODE_GOOGLE&&null!=this.drive?(null==o&&null!=this.stateArg&&null!=this.stateArg.folderId&&(o=this.stateArg.folderId),this.drive.insertFile(t,e,o,mxUtils.bind(this,(function(t){u(),this.fileCreated(t,i,l,s,a)})),d)):n==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(t,e,mxUtils.bind(this,(function(t){u(),this.fileCreated(t,i,l,s,a)})),d,!1,o):n==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(t,e,mxUtils.bind(this,(function(t){u(),this.fileCreated(t,i,l,s,a)})),d,!1,o):n==App.MODE_NOTION&&null!=this.notion?this.notion.insertFile(t,e,mxUtils.bind(this,(function(t){u(),this.fileCreated(t,i,l,s,a)})),d,!1,o):n==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(t,e,mxUtils.bind(this,(function(t){u(),this.fileCreated(t,i,l,s,a)})),d,!1,o):n==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(t,e,mxUtils.bind(this,(function(t){u(),this.fileCreated(t,i,l,s,a)})),d):n==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(t,e,mxUtils.bind(this,(function(t){u(),this.fileCreated(t,i,l,s,a)})),d,!1,o):n==App.MODE_BROWSER?StorageFile.insertFile(this,t,e,mxUtils.bind(this,(function(t){u(),this.fileCreated(t,i,l,s,a)})),d):!r&&n==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(u(),this.showSaveFilePicker(mxUtils.bind(this,(function(t,n){var o=new LocalFile(this,e,n.name,null,t,n);o.saveFile(n.name,!1,mxUtils.bind(this,(function(){this.fileCreated(o,i,l,s,a)})),d,!0)})),mxUtils.bind(this,(function(t){"AbortError"!=t.name&&d(t)})),this.createFileSystemOptions(t))):(u(),this.fileCreated(new LocalFile(this,e,t,null==n),i,l,s,a))}catch(t){u(),this.handleError(t)}}},App.prototype.fileCreated=function(t,e,i,n,s){var l=window.location.pathname;if(null!=e&&e.length>0&&(l+="?libs="+e),null!=s&&s.length>0&&(l+="?clibs="+s),l=this.getUrl(l),t.getMode()!=App.MODE_DEVICE&&(l+="#"+t.getHash()),this.spinner.spin(document.body,mxResources.get("inserting"))){var o=t.getData(),r=o.length>0?this.editor.extractGraphModel(mxUtils.parseXml(o).documentElement,!0):null,a=window.location.protocol+"//"+window.location.hostname+l,u=r,d=null;null!=r&&/\.svg$/i.test(t.getTitle())&&(d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),u=this.decodeNodeIntoGraph(u,d)),t.setData(this.createFileData(r,d,t,a)),null!=d&&d.container.parentNode.removeChild(d.container);var h=mxUtils.bind(this,(function(){this.spinner.stop()})),c=mxUtils.bind(this,(function(){h();var o=this.getCurrentFile();null==i&&null!=o&&(i=!o.isModified()&&null==o.getMode());var r=mxUtils.bind(this,(function(){if(window.openFile=null,this.fileLoaded(t),i&&t.addAllSavedStatus(),null!=e&&this.sidebar.showEntries(e),null!=s){for(var n=[],l=s.split(";"),o=0;o<l.length;o++)n.push(decodeURIComponent(l[o]));this.loadLibraries(n)}})),a=mxUtils.bind(this,(function(){i||null==o||!o.isModified()?r():this.confirm(mxResources.get("allChangesLost"),null,r,mxResources.get("cancel"),mxResources.get("discardChanges"))}));null!=n&&n(),null==i||i?a():(t.constructor==LocalFile&&(window.openFile=new OpenFile((function(){window.openFile=null})),window.openFile.setData(t.getData(),t.getTitle(),null==t.getMode())),null!=n&&n(),window.openWindow(l,null,a))}));t.constructor==LocalFile?c():t.saveFile(t.getTitle(),!1,mxUtils.bind(this,(function(){c()})),mxUtils.bind(this,(function(t){h(),null!=t&&"AbortError"==t.name||this.handleError(t)})))}},App.prototype.loadFile=function(t,e,i,n,s){("1"==urlParams.openInSameWin||navigator.standalone)&&(e=!0),this.hideDialog();var l=mxUtils.bind(this,(function(){if(null==t||0==t.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==t.charAt(0))if(this.spinner.stop(),isLocalStorage){var s=mxUtils.bind(this,(function(t){this.handleError(t,mxResources.get("errorLoadingFile"),mxUtils.bind(this,(function(){var t=this.getCurrentFile();window.location.hash=null!=t?t.getHash():""})))}));t=decodeURIComponent(t.substring(1)),StorageFile.getFileContent(this,t,mxUtils.bind(this,(function(e){null!=e?(this.fileLoaded(new StorageFile(this,e,t)),null!=n&&n()):s({message:mxResources.get("fileNotFound")})})),s)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,(function(){var t=this.getCurrentFile();window.location.hash=null!=t?t.getHash():""})));else if(null!=i)this.spinner.stop(),this.fileLoaded(i),null!=n&&n();else if("S"==t.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+t.substring(1).substring(0,10),mxUtils.bind(this,(function(){window.location.href="https://app.diagrams.net/?desc="+t.substring(1)})));else if("R"==t.charAt(0)){this.spinner.stop();var l=decodeURIComponent(t.substring(1));"<"!=l.charAt(0)&&(l=Graph.decompress(l));var o=new LocalFile(this,l,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);o.getHash=function(){return t},this.fileLoaded(o),null!=n&&n()}else if("E"==t.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,(function(t,e){this.spinner.stop(),this.fileLoaded(new EmbedFile(this,t,e)),null!=n&&n()})),mxUtils.bind(this,(function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))})));else if("U"==t.charAt(0)){var r=decodeURIComponent(t.substring(1)),a=mxUtils.bind(this,(function(){if("https://drive.google.com/uc?id="!=r.substring(0,31)||null==this.drive&&"function"!=typeof window.DriveClient)return!1;this.hideDialog();var t=mxUtils.bind(this,(function(){if(this.spinner.stop(),null!=this.drive){var t=r.substring(31,r.lastIndexOf("&ex"));return this.loadFile("G"+t,e,null,mxUtils.bind(this,(function(){var e=this.getCurrentFile();null!=e&&this.editor.chromeless&&!this.editor.editable&&(e.getHash=function(){return"G"+t},window.location.hash="#"+e.getHash()),null!=n&&n()}))),!0}return!1}));return!t()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",t),!0}));this.loadTemplate(r,mxUtils.bind(this,(function(e){if(this.spinner.stop(),null!=e&&e.length>0){var i=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var s=r,l=r.lastIndexOf("."),o=s.lastIndexOf("/");if(l>o&&o>0){s=s.substring(o+1,l);var u=r.substring(l);this.useCanvasForExport||".png"!=u||(u=".drawio"),".svg"!==u&&".xml"!==u&&".html"!==u&&".png"!==u&&".drawio"!==u||(i=s+u)}}var d=new LocalFile(this,e,null!=urlParams.title?decodeURIComponent(urlParams.title):i,!0);d.getHash=function(){return t},this.fileLoaded(d,!0)?null!=n&&n():a()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else a()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})),mxUtils.bind(this,(function(){a()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))})),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else{var u=null;if("G"==t.charAt(0)?u=this.drive:"D"==t.charAt(0)?u=this.dropbox:"W"==t.charAt(0)?u=this.oneDrive:"H"==t.charAt(0)?u=this.gitHub:"A"==t.charAt(0)?u=this.gitLab:"T"==t.charAt(0)?u=this.trello:"N"==t.charAt(0)&&(u=this.notion),null==u)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,(function(){var t=this.getCurrentFile();window.location.hash=null!=t?t.getHash():""})));else{var d=t.charAt(0);t=decodeURIComponent(t.substring(1)),u.getFile(t,mxUtils.bind(this,(function(e){this.spinner.stop(),this.fileLoaded(e);var i=this.getCurrentFile();if(null==i)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable)i.getHash=function(){return d+t},window.location.hash="#"+i.getHash();else if(e==i&&null==e.getMode()){var s=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+s+'" class="geStatusAlert">'+s+"</div>")}null!=n&&n()})),mxUtils.bind(this,(function(e){null!=window.console&&null!=e&&console.log("error in loadFile:",t,e);var i=mxUtils.bind(this,(function(){var t=this.getCurrentFile();null==t?(window.location.hash="",this.showSplash()):window.location.hash="#"+t.getHash()}));null==e||"AbortError"!=e.name?this.handleError(e,null!=e?mxResources.get("errorLoadingFile"):null,i,null,null,"#"+d+t):i()})))}}})),o=this.getCurrentFile(),r=mxUtils.bind(this,(function(){s||null==o||!o.isModified()?l():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,(function(){null!=o&&(window.location.hash=o.getHash())})),l,mxResources.get("cancel"),mxResources.get("discardChanges"))}));null==t||0==t.length||null==o||e?r():this.showDialog(new PopupDialog(this,this.getUrl()+"#"+t,null,r).container,320,140,!0,!0)},App.prototype.getLibraryStorageHint=function(t){var e=t.getTitle();return t.constructor!=LocalLibrary&&(e+="\n"+t.getHash()),t.constructor==DriveLibrary?e+=" ("+mxResources.get("googleDrive")+")":t.constructor==GitHubLibrary?e+=" ("+mxResources.get("github")+")":t.constructor==TrelloLibrary?e+=" ("+mxResources.get("trello")+")":t.constructor==DropboxLibrary?e+=" ("+mxResources.get("dropbox")+")":t.constructor==OneDriveLibrary?e+=" ("+mxResources.get("oneDrive")+")":t.constructor==StorageLibrary?e+=" ("+mxResources.get("browser")+")":t.constructor==LocalLibrary&&(e+=" ("+mxResources.get("device")+")"),e},App.prototype.restoreLibraries=function(){this.loadLibraries(mxSettings.getCustomLibraries(),mxUtils.bind(this,(function(){this.loadLibraries((urlParams.clibs||"").split(";"))})))},App.prototype.loadLibraries=function(t,e){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries=new Object);var i=mxUtils.bind(this,(function(t,e){e||mxSettings.removeCustomLibrary(t),delete this.pendingLibraries[t]})),n=0,s=[],l=mxUtils.bind(this,(function(){if(0==n){if(null!=t)for(var i=t.length-1;i>=0;i--)null!=s[i]&&this.loadLibrary(s[i]);null!=e&&e()}}));if(null!=t){for(var o=0;o<t.length;o++){var r=encodeURIComponent(decodeURIComponent(t[o]));mxUtils.bind(this,(function(t,e){if(null!=t&&t.length>0&&null==this.pendingLibraries[t]&&null==this.sidebar.palettes[t]){n++;var o=mxUtils.bind(this,(function(i){delete this.pendingLibraries[t],s[e]=i,n--,l()})),r=mxUtils.bind(this,(function(e){i(t,e),n--,l()}));this.pendingLibraries[t]=!0;var a=t.substring(0,1);if("L"==a)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,(function(){try{var e=decodeURIComponent(t.substring(1));StorageFile.getFileContent(this,e,mxUtils.bind(this,(function(t){".scratchpad"==e&&null==t&&(t=this.emptyLibraryXml),null!=t?o(new StorageLibrary(this,t,e)):r()})),r)}catch(t){r()}})),0);else if("U"==a){var u=decodeURIComponent(t.substring(1));this.isOffline()||this.loadTemplate(u,mxUtils.bind(this,(function(t){null!=t&&t.length>0?o(new UrlLibrary(this,t,u)):r()})),(function(){r()}),null,!0)}else if("R"==a){var d=decodeURIComponent(t.substring(1));try{var h={id:(d=JSON.parse(d))[0],title:d[1],downloadUrl:d[2]};this.remoteInvoke("getFileContent",[h.downloadUrl],null,mxUtils.bind(this,(function(t){try{o(new RemoteLibrary(this,t,h))}catch(t){r()}})),(function(){r()}))}catch(t){r()}}else if("S"==a&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(t.substring(1)),(function(t){o(t)}),r)}catch(t){r()}else{var c=null;"G"==a?null!=this.drive&&null!=this.drive.user&&(c=this.drive):"H"==a?null!=this.gitHub&&null!=this.gitHub.getUser()&&(c=this.gitHub):"T"==a?null!=this.trello&&this.trello.isAuthorized()&&(c=this.trello):"D"==a?null!=this.dropbox&&null!=this.dropbox.getUser()&&(c=this.dropbox):"W"==a&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(c=this.oneDrive),null!=c?c.getLibrary(decodeURIComponent(t.substring(1)),mxUtils.bind(this,(function(t){try{o(t)}catch(t){r()}})),(function(t){r()})):r(!0)}}}))(r,o)}l()}else l()}},App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer){var t=this.getCurrentFile();if("1"==urlParams.embed&&("atlas"==uiTheme||"1"==urlParams.atlas?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",this.buttonContainer.style.right="1"==urlParams.noLangIcon?"0":"25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px")),this.commentsSupported()&&"1"!=urlParams.sketch?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"):"min"==uiTheme?this.commentButton.style.marginTop="1px":"1"==urlParams.atlas?this.commentButton.style.marginTop="-2px":this.commentButton.style.marginTop="-5px",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,(function(){this.actions.get("comments").funct()}))),this.buttonContainer.appendChild(this.commentButton),"dark"!=uiTheme&&"atlas"!=uiTheme||(this.commentButton.style.filter="invert(100%)")):null!=this.commentButton&&(this.commentButton.parentNode.removeChild(this.commentButton),this.commentButton=null),"1"==urlParams.embed||"draw.io"!=this.getServiceName()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp())null!=urlParams.notif&&this.fetchAndShowNotification(urlParams.notif);else{if(null!=t){if(null==this.shareButton){this.shareButton=document.createElement("div"),this.shareButton.className="geBtn gePrimaryBtn",this.shareButton.style.display="inline-block",this.shareButton.style.backgroundColor="#F2931E",this.shareButton.style.borderColor="#F08705",this.shareButton.style.backgroundImage="none",this.shareButton.style.padding="2px 10px 0 10px",this.shareButton.style.marginTop="-10px",this.shareButton.style.height="28px",this.shareButton.style.lineHeight="28px",this.shareButton.style.minWidth="0px",this.shareButton.style.cssFloat="right",this.shareButton.setAttribute("title",mxResources.get("share"));var e=document.createElement("img");e.setAttribute("src",this.shareImage),e.setAttribute("align","absmiddle"),e.style.marginRight="4px",e.style.marginTop="-3px",this.shareButton.appendChild(e),Editor.isDarkMode()||"atlas"==uiTheme||(this.shareButton.style.color="black",e.style.filter="invert(100%)"),mxUtils.write(this.shareButton,mxResources.get("share")),mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,(function(){this.actions.get("share").funct()}))),this.buttonContainer.appendChild(this.shareButton)}}else null!=this.shareButton&&(this.shareButton.parentNode.removeChild(this.shareButton),this.shareButton=null);"1"!=urlParams.extAuth&&this.fetchAndShowNotification("online",this.mode)}}},App.prototype.fetchAndShowNotification=function(t,e){if(!this.fetchingNotif){t=t||"online";var i=".notifCache",n=null,s=mxUtils.bind(this,(function(i){i=i.filter((function(i){return!i.targets||i.targets.indexOf(t)>-1||null!=e&&i.targets.indexOf(e)>-1}));for(var n=t+"NotifReadTS",s=null==localStorage||parseInt(localStorage.getItem(n)),l=0;l<i.length;l++)i[l].isNew=!s||i[l].timestamp>s;this.showNotification(i,n)}));try{null!=localStorage&&(n=JSON.parse(localStorage.getItem(i)))}catch(t){}null==n||n.ts+864e5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,(function(t){if(t.getStatus()>=200&&t.getStatus()<=299){var e=JSON.parse(t.getText());e.sort((function(t,e){return e.timestamp-t.timestamp})),isLocalStorage&&localStorage.setItem(i,JSON.stringify({ts:Date.now(),notifs:e})),this.fetchingNotif=!1,s(e)}})))):s(n.notifs)}},App.prototype.showNotification=function(t,e){var i=t.length;if("min"==uiTheme){i=0;for(var n=0;n<t.length;n++)t[n].isNew&&i++}if(0!=i){var s=mxUtils.bind(this,(function(){this.notificationWin.style.display="none";for(var i=this.notificationWin.querySelectorAll(".circle.active"),n=0;n<i.length;n++)i[n].className="circle";isLocalStorage&&t[0]&&localStorage.setItem(e,t[0].timestamp)}));if(null==this.notificationBtn){this.notificationBtn=document.createElement("div"),this.notificationBtn.className="geNotification-box","min"==uiTheme?(this.notificationBtn.style.width="30px",this.notificationBtn.style.top="4px"):"1"==urlParams.atlas&&(this.notificationBtn.style.top="2px");var l=document.createElement("span");l.className="geNotification-count",this.notificationBtn.appendChild(l);var o,r=document.createElement("div");r.className="geNotification-bell",r.style.opacity="min"==uiTheme?"0.5":"",(o=document.createElement("span")).className="geBell-top",r.appendChild(o),(o=document.createElement("span")).className="geBell-middle",r.appendChild(o),(o=document.createElement("span")).className="geBell-bottom",r.appendChild(o),(o=document.createElement("span")).className="geBell-rad",r.appendChild(o),this.notificationBtn.appendChild(r),this.buttonContainer.insertBefore(this.notificationBtn,this.buttonContainer.firstChild),this.notificationWin=document.createElement("div"),this.notificationWin.className="geNotifPanel",this.notificationWin.style.display="none",document.body.appendChild(this.notificationWin);var a=document.createElement("div");a.className="header";var u=document.createElement("span");u.className="title",u.textContent=mxResources.get("notifications"),a.appendChild(u);var d=document.createElement("span");d.className="closeBtn",d.textContent="x",a.appendChild(d),this.notificationWin.appendChild(a);var h=document.createElement("div");h.className="notifications clearfix";var c=document.createElement("div");c.setAttribute("id","geNotifList"),c.style.position="relative",h.appendChild(c),this.notificationWin.appendChild(h),mxEvent.addListener(this.notificationBtn,"click",mxUtils.bind(this,(function(){if("none"==this.notificationWin.style.display){this.notificationWin.style.display="",document.querySelector(".notifications").scrollTop=0;var t=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=t.top+this.notificationBtn.clientHeight+"px",this.notificationWin.style.left=t.right-this.notificationWin.clientWidth+"px",m(0)}else s()}))),mxEvent.addListener(d,"click",s)}else this.notificationBtn.style.display="";var p=0,g=document.getElementById("geNotifList");if(null!=g){for(g.innerHTML='<div class="line"></div>',n=0;n<t.length;n++)!function(t,e){e.isNew&&p++;var i=document.createElement("div");i.className="notification";var n=new Date(e.timestamp),s=t.timeSince(n);null==s&&(s=mxResources.get("lessThanAMinute")),i.innerHTML='<div class="circle'+(e.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[s],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(e.content)+"</p>",e.link&&mxEvent.addListener(i,"click",(function(){window.open(e.link,"notifWin")})),g.appendChild(i)}(this,t[n]);m(p)}}else null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));function m(t){var e=document.querySelector(".geNotification-count");if(null!=e){e.innerHTML=t,e.style.display=0==t?"none":"";var i=document.querySelector(".geNotification-bell");i.style.animation=0==t?"none":"",i.className="geNotification-bell"+(0==t?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==t?"none":""}}},App.prototype.save=function(t,e){var i=this.getCurrentFile();if(null!=i&&this.spinner.spin(document.body,mxResources.get("saving"))){this.editor.setStatus(""),this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var n=mxUtils.bind(this,(function(){i.handleFileSuccess(!0),null!=e&&e()})),s=mxUtils.bind(this,(function(n){i.isModified()&&Editor.addRetryToError(n,mxUtils.bind(this,(function(){this.save(t,e)}))),i.handleFileError(n,null==n||"AbortError"!=n.name)}));try{t==i.getTitle()?i.save(!0,n,s):i.saveAs(t,n,s)}catch(t){s(t)}}},App.prototype.pickFolder=function(t,e,i,n,s){i=null==i||i;var l=this.spinner.pause();i&&t==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,(function(t){if(l(),t.action==google.picker.Action.PICKED){var i=null;null!=t.docs&&t.docs.length>0&&"folder"==t.docs[0].type&&(i=t.docs[0].id),e(i)}})),s):i&&t==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,(function(t){var i=null;l(),null!=t&&null!=t.value&&t.value.length>0&&(i=OneDriveFile.prototype.getIdOf(t.value[0]),e(i))})),n):i&&t==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,(function(t){l(),e(t)}))):i&&t==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,(function(t){l(),e(t)}))):i&&t==App.MODE_NOTION&&null!=this.notion?this.notion.pickFolder(mxUtils.bind(this,(function(t){l(),e(t)}))):i&&t==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,(function(t){l(),e(t)}))):EditorUi.prototype.pickFolder.apply(this,arguments)},App.prototype.exportFile=function(t,e,i,n,s,l){if(s==App.MODE_DROPBOX)null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(e,n?this.base64ToBlob(t,i):t,mxUtils.bind(this,(function(){this.spinner.stop()})),mxUtils.bind(this,(function(t){this.spinner.stop(),this.handleError(t)})));else if(s==App.MODE_GOOGLE)null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(e,t,l,mxUtils.bind(this,(function(t){this.spinner.stop()})),mxUtils.bind(this,(function(t){this.spinner.stop(),this.handleError(t)})),i,n);else if(s==App.MODE_ONEDRIVE)null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(e,n?this.base64ToBlob(t,i):t,mxUtils.bind(this,(function(){this.spinner.stop()})),mxUtils.bind(this,(function(t){this.spinner.stop(),this.handleError(t)})),!1,l);else if(s==App.MODE_GITHUB)null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(e,t,mxUtils.bind(this,(function(){this.spinner.stop()})),mxUtils.bind(this,(function(t){this.spinner.stop(),this.handleError(t)})),!0,l,n);else if(s==App.MODE_GITLAB)null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitLab.insertFile(e,t,mxUtils.bind(this,(function(){this.spinner.stop()})),mxUtils.bind(this,(function(t){this.spinner.stop(),this.handleError(t)})),!0,l,n);else if(s==App.MODE_TRELLO)null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(e,n?this.base64ToBlob(t,i):t,mxUtils.bind(this,(function(){this.spinner.stop()})),mxUtils.bind(this,(function(t){this.spinner.stop(),this.handleError(t)})),!1,l);else if(s==App.MODE_BROWSER){var o=mxUtils.bind(this,(function(){localStorage.setItem(e,t)}));null==localStorage.getItem(e)?o():this.confirm(mxResources.get("replaceIt",[e]),o)}},App.prototype.descriptorChanged=function(){var t=this.getCurrentFile();if(null!=t){if(null!=this.fname){this.fnameWrapper.style.display="block",this.fname.innerHTML="";var e=null!=t.getTitle()?t.getTitle():this.defaultFilename;mxUtils.write(this.fname,e),this.fname.setAttribute("title",e+" - "+mxResources.get("rename"))}var i=this.editor.graph,n=t.isEditable()&&!t.invalidChecksum;if(i.isEnabled()&&!n&&i.reset(),i.setEnabled(n),null==urlParams.rev){this.updateDocumentTitle();var s=t.getHash();s.length>0?window.location.hash=s:window.location.hash.length>0&&(window.location.hash="")}}this.updateUi(),null==this.format||null!=t&&this.fileEditable==t.isEditable()||!this.editor.graph.isSelectionEmpty()||(this.format.refresh(),this.fileEditable=null!=t?t.isEditable():null),this.fireEvent(new mxEventObject("fileDescriptorChanged","file",t))},App.prototype.showAuthDialog=function(t,e,i,n){var s=this.spinner.pause();this.showDialog(new AuthDialog(this,t,e,mxUtils.bind(this,(function(t){try{null!=i&&i(t,mxUtils.bind(this,(function(){this.hideDialog(),s()})))}catch(t){this.editor.setStatus(mxUtils.htmlEntities(t.message))}}))).container,300,e?180:140,!0,!0,mxUtils.bind(this,(function(t){null!=n&&n(t),t&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()})))},App.prototype.convertFile=function(t,e,i,n,s,l,o,r){var a=e;/\.svg$/i.test(a)||(a=a.substring(0,e.lastIndexOf("."))+n);var u=!1;if(null!=this.gitHub&&t.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(u=!0),/\.v(dx|sdx?)$/i.test(e)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"==typeof(new XMLHttpRequest).responseType){var d=new XMLHttpRequest;if(d.open("GET",t,!0),u||(d.responseType="blob"),r)for(var h in r)d.setRequestHeader(h,r[h]);d.onload=mxUtils.bind(this,(function(){if(d.status>=200&&d.status<=299){var t=null;if(u){var i=JSON.parse(d.responseText);t=this.base64ToBlob(i.content,"application/octet-stream")}else t=new Blob([d.response],{type:"application/octet-stream"});this.importVisio(t,mxUtils.bind(this,(function(t){s(new LocalFile(this,t,a,!0))})),l,e)}else null!=l&&l({message:mxResources.get("errorLoadingFile")})})),d.onerror=l,d.send()}else{var c=mxUtils.bind(this,(function(i){try{if(/\.pdf$/i.test(e))null!=(n=Editor.extractGraphModelFromPdf(i))&&n.length>0&&s(new LocalFile(this,n,a,!0));else if(/\.png$/i.test(e)){var n=this.extractGraphModelFromPng(i);s(null!=n?new LocalFile(this,n,a,!0):new LocalFile(this,i,e,!0))}else Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(i,t)?this.parseFile(new Blob([i],{type:"application/octet-stream"}),mxUtils.bind(this,(function(t){4==t.readyState&&(t.status>=200&&t.status<=299?s(new LocalFile(this,t.responseText,a,!0)):null!=l&&l({message:mxResources.get("errorLoadingFile")}))})),e):s(new LocalFile(this,i,a,!0))}catch(t){null!=l&&l(t)}})),p=/\.png$/i.test(e)||/\.jpe?g$/i.test(e)||/\.pdf$/i.test(e)||null!=i&&"image/"==i.substring(0,6);u?mxUtils.get(t,mxUtils.bind(this,(function(t){if(t.getStatus()>=200&&t.getStatus()<=299){if(null!=s){var i=JSON.parse(t.getText()),n=i.content;"base64"===i.encoding&&(n=/\.png$/i.test(e)?"data:image/png;base64,"+n:/\.pdf$/i.test(e)?"data:application/pdf;base64,"+n:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(n):atob(n)),c(n)}}else null!=l&&l({code:App.ERROR_UNKNOWN})})),(function(){null!=l&&l({code:App.ERROR_UNKNOWN})}),!1,this.timeout,(function(){null!=l&&l({code:App.ERROR_TIMEOUT,retry:fn})}),r):null!=o?o(t,c,l,p):this.editor.loadUrl(t,c,l,p,null,null,null,r)}},App.prototype.updateHeader=function(){if(null!=this.menubar){this.appIcon=document.createElement("a"),this.appIcon.style.display="block",this.appIcon.style.position="absolute",this.appIcon.style.width="32px",this.appIcon.style.height=this.menubarHeight-28+"px",this.appIcon.style.margin="14px 0px 8px 16px",this.appIcon.style.opacity="0.85",this.appIcon.style.borderRadius="3px","dark"!=uiTheme&&(this.appIcon.style.backgroundColor="#f08705"),mxEvent.disableContextMenu(this.appIcon),mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,(function(t){this.appIconClicked(t)})));var t=mxClient.IS_SVG?"dark"==uiTheme?"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCI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tMC4xaC00bDI0LjgtNDIuNGgxOS4zCglsMjQuOSw0Mi40SDE0M2MtNi44LDAtMTIuMyw1LjQtMTIuMywxMi4ydjAuMXYzMi4xYzAsNi44LDUuNCwxMi4zLDEyLjIsMTIuM2gwLjFoNDEuN2M2LjgsMCwxMi4zLTUuNCwxMi4zLTEyLjJ2LTAuMXYtMzIuMQoJYzAtNi44LTUuNC0xMi4zLTEyLjItMTIuM0MxODQuNywxMjUuOCwxODQuNywxMjUuOCwxODQuNiwxMjUuOHoiLz4KPC9zdmc+Cg==)":"url('"+IMAGE_PATH+"/logo-white.png')";this.appIcon.style.backgroundImage=t,this.appIcon.style.backgroundPosition="center center",this.appIcon.style.backgroundSize="100% 100%",this.appIcon.style.backgroundRepeat="no-repeat",mxUtils.setPrefixedStyle(this.appIcon.style,"transition","all 125ms linear"),mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,(function(){var t=this.getCurrentFile();if(null!=t){var e=t.getMode();e==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/google-drive-logo-white.svg)",this.appIcon.style.backgroundSize="70% 70%"):e==App.MODE_DROPBOX?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)",this.appIcon.style.backgroundSize="70% 70%"):e==App.MODE_ONEDRIVE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)",this.appIcon.style.backgroundSize="70% 70%"):e==App.MODE_GITHUB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)",this.appIcon.style.backgroundSize="70% 70%"):e==App.MODE_GITLAB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/gitlab-logo-white.svg)",this.appIcon.style.backgroundSize="100% 100%"):e==App.MODE_NOTION?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/notion-logo-white.svg)",this.appIcon.style.backgroundSize="70% 70%"):e==App.MODE_TRELLO&&(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/trello-logo-white-orange.svg)",this.appIcon.style.backgroundSize="70% 70%")}}))),mxEvent.addListener(this.appIcon,"mouseout",mxUtils.bind(this,(function(){this.appIcon.style.backgroundImage=t,this.appIcon.style.backgroundSize="90% 90%"}))),"1"!=urlParams.embed&&this.menubarContainer.appendChild(this.appIcon),this.fnameWrapper=document.createElement("div"),this.fnameWrapper.style.position="absolute",this.fnameWrapper.style.right="120px",this.fnameWrapper.style.left="60px",this.fnameWrapper.style.top="9px",this.fnameWrapper.style.height="26px",this.fnameWrapper.style.display="none",this.fnameWrapper.style.overflow="hidden",this.fnameWrapper.style.textOverflow="ellipsis",this.fname=document.createElement("a"),this.fname.setAttribute("title",mxResources.get("rename")),this.fname.className="geItem",this.fname.style.padding="2px 8px 2px 8px",this.fname.style.display="inline",this.fname.style.fontSize="18px",this.fname.style.whiteSpace="nowrap",mxEvent.addListener(this.fname,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,(function(t){t.preventDefault()}))),mxEvent.addListener(this.fname,"click",mxUtils.bind(this,(function(t){var e=this.getCurrentFile();null!=e&&e.isRenamable()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),this.actions.get("rename").funct()),mxEvent.consume(t)}))),this.fnameWrapper.appendChild(this.fname),"1"!=urlParams.embed&&(this.menubarContainer.appendChild(this.fnameWrapper),this.menubar.container.style.position="absolute",this.menubar.container.style.paddingLeft="59px",this.toolbar.container.style.paddingLeft="16px",this.menubar.container.style.boxSizing="border-box",this.menubar.container.style.top="34px"),this.toggleFormatElement=document.createElement("a"),this.toggleFormatElement.setAttribute("title",mxResources.get("formatPanel")+" ("+Editor.ctrlKey+"+Shift+P)"),this.toggleFormatElement.style.position="absolute",this.toggleFormatElement.style.display="inline-block",this.toggleFormatElement.style.top="atlas"==uiTheme?"8px":"6px",this.toggleFormatElement.style.right="atlas"!=uiTheme&&"1"!=urlParams.embed?"30px":"10px",this.toggleFormatElement.style.padding="2px",this.toggleFormatElement.style.fontSize="14px",this.toggleFormatElement.className="atlas"!=uiTheme?"geButton":"",this.toggleFormatElement.style.width="16px",this.toggleFormatElement.style.height="16px",this.toggleFormatElement.style.backgroundPosition="50% 50%",this.toggleFormatElement.style.backgroundRepeat="no-repeat",this.toolbarContainer.appendChild(this.toggleFormatElement),"dark"==uiTheme&&(this.toggleFormatElement.style.filter="invert(100%)"),mxEvent.addListener(this.toggleFormatElement,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,(function(t){t.preventDefault()}))),mxEvent.addListener(this.toggleFormatElement,"click",mxUtils.bind(this,(function(t){this.actions.get("formatPanel").funct(),mxEvent.consume(t)})));var e=mxUtils.bind(this,(function(){this.formatWidth>0?this.toggleFormatElement.style.backgroundImage="url('"+this.formatShowImage+"')":this.toggleFormatElement.style.backgroundImage="url('"+this.formatHideImage+"')"}));this.addListener("formatWidthChanged",e),e(),this.fullscreenElement=document.createElement("a"),this.fullscreenElement.setAttribute("title",mxResources.get("fullscreen")),this.fullscreenElement.style.position="absolute",this.fullscreenElement.style.display="inline-block",this.fullscreenElement.style.top="atlas"==uiTheme?"8px":"6px",this.fullscreenElement.style.right="atlas"!=uiTheme&&"1"!=urlParams.embed?"50px":"30px",this.fullscreenElement.style.padding="2px",this.fullscreenElement.style.fontSize="14px",this.fullscreenElement.className="atlas"!=uiTheme?"geButton":"",this.fullscreenElement.style.width="16px",this.fullscreenElement.style.height="16px",this.fullscreenElement.style.backgroundPosition="50% 50%",this.fullscreenElement.style.backgroundRepeat="no-repeat",this.fullscreenElement.style.backgroundImage="url('"+this.fullscreenImage+"')",this.toolbarContainer.appendChild(this.fullscreenElement),mxEvent.addListener(this.fullscreenElement,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,(function(t){t.preventDefault()}))),"atlas"==uiTheme&&(mxUtils.setOpacity(this.toggleFormatElement,70),mxUtils.setOpacity(this.fullscreenElement,70));var i=this.hsplitPosition;"dark"==uiTheme&&(this.fullscreenElement.style.filter="invert(100%)"),mxEvent.addListener(this.fullscreenElement,"click",mxUtils.bind(this,(function(t){var e=this.fullscreenMode;"atlas"!=uiTheme&&"1"!=urlParams.embed&&this.toggleCompactMode(e),e||(i=this.hsplitPosition),this.hsplitPosition=e?i:0,this.toggleFormatPanel(e),this.fullscreenMode=!e,mxEvent.consume(t)}))),"1"!=urlParams.embed&&(this.toggleElement=document.createElement("a"),this.toggleElement.setAttribute("title",mxResources.get("collapseExpand")),this.toggleElement.className="geButton",this.toggleElement.style.position="absolute",this.toggleElement.style.display="inline-block",this.toggleElement.style.width="16px",this.toggleElement.style.height="16px",this.toggleElement.style.color="#666",this.toggleElement.style.top="atlas"==uiTheme?"8px":"6px",this.toggleElement.style.right="10px",this.toggleElement.style.padding="2px",this.toggleElement.style.fontSize="14px",this.toggleElement.style.textDecoration="none",this.toggleElement.style.backgroundImage="url('"+this.chevronUpImage+"')",this.toggleElement.style.backgroundPosition="50% 50%",this.toggleElement.style.backgroundRepeat="no-repeat","dark"==uiTheme&&(this.toggleElement.style.filter="invert(100%)"),mxEvent.addListener(this.toggleElement,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,(function(t){t.preventDefault()}))),mxEvent.addListener(this.toggleElement,"click",mxUtils.bind(this,(function(t){this.toggleCompactMode(),mxEvent.consume(t)}))),"atlas"!=uiTheme&&this.toolbarContainer.appendChild(this.toggleElement),!mxClient.IS_FF&&screen.height<=740&&void 0!==this.toggleElement.click&&window.setTimeout(mxUtils.bind(this,(function(){this.toggleElement.click()})),0))}},App.prototype.toggleCompactMode=function(t){(t=null!=t?t:this.compactMode)?(this.menubar.container.style.position="absolute",this.menubar.container.style.paddingLeft="59px",this.menubar.container.style.paddingTop="",this.menubar.container.style.paddingBottom="",this.menubar.container.style.top="34px",this.toolbar.container.style.paddingLeft="16px",this.buttonContainer.style.visibility="visible",this.appIcon.style.display="block",this.fnameWrapper.style.display="block",this.fnameWrapper.style.visibility="visible",this.menubarHeight=App.prototype.menubarHeight,this.refresh(),this.toggleElement.style.backgroundImage="url('"+this.chevronUpImage+"')"):(this.menubar.container.style.position="relative",this.menubar.container.style.paddingLeft="4px",this.menubar.container.style.paddingTop="0px",this.menubar.container.style.paddingBottom="0px",this.menubar.container.style.top="0px",this.toolbar.container.style.paddingLeft="8px",this.buttonContainer.style.visibility="hidden",this.appIcon.style.display="none",this.fnameWrapper.style.display="none",this.fnameWrapper.style.visibility="hidden",this.menubarHeight=EditorUi.prototype.menubarHeight,this.refresh(),this.toggleElement.style.backgroundImage="url('"+this.chevronDownImage+"')"),this.compactMode=!t},App.prototype.updateUserElement=function(){if(null!=this.drive&&null!=this.drive.getUser()||null!=this.oneDrive&&null!=this.oneDrive.getUser()||null!=this.dropbox&&null!=this.dropbox.getUser()||null!=this.gitHub&&null!=this.gitHub.getUser()||null!=this.gitLab&&null!=this.gitLab.getUser()||null!=this.notion&&null!=this.notion.getUser()||null!=this.trello&&this.trello.isAuthorized()){null==this.userElement&&(this.userElement=document.createElement("a"),this.userElement.className="geItem",this.userElement.style.position="absolute",this.userElement.style.fontSize="8pt",this.userElement.style.top="atlas"==uiTheme?"8px":"2px",this.userElement.style.right="30px",this.userElement.style.margin="4px",this.userElement.style.padding="2px",this.userElement.style.paddingRight="16px",this.userElement.style.verticalAlign="middle",this.userElement.style.backgroundImage="url("+IMAGE_PATH+"/expanded.gif)",this.userElement.style.backgroundPosition="100% 60%",this.userElement.style.backgroundRepeat="no-repeat",this.menubarContainer.appendChild(this.userElement),mxEvent.addListener(this.userElement,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,(function(t){t.preventDefault()}))),mxEvent.addListener(this.userElement,"click",mxUtils.bind(this,(function(t){if(null==this.userPanel&&((a=document.createElement("div")).className="geDialog",a.style.position="absolute",a.style.top=this.userElement.clientTop+this.userElement.clientHeight+6+"px",a.style.zIndex=5,a.style.right="36px",a.style.padding="0px",a.style.cursor="default",a.style.minWidth="300px",this.userPanel=a),null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var e=!1;this.userPanel.innerHTML="";var i=document.createElement("img");if(i.setAttribute("src",Dialog.prototype.closeImage),i.setAttribute("title",mxResources.get("close")),i.className="geDialogClose",i.style.top="8px",i.style.right="8px",mxEvent.addListener(i,"click",mxUtils.bind(this,(function(){null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)}))),this.userPanel.appendChild(i),null!=this.drive){var n=this.drive.getUsersList();if(n.length>0){var s=mxUtils.bind(this,(function(t,e){var i=this.getCurrentFile();null!=i&&i.constructor==DriveFile?(this.spinner.spin(document.body,e),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,(function(){this.spinner.stop(),t()})),2e3)):t()})),l=mxUtils.bind(this,(function(t){var e=document.createElement("tr");e.setAttribute("title","User ID: "+t.id),(i=document.createElement("td")).setAttribute("valig","middle"),i.style.height="59px",i.style.width="66px";var i,l=document.createElement("img");if(l.setAttribute("width","50"),l.setAttribute("height","50"),l.setAttribute("border","0"),l.setAttribute("src",null!=t.pictureUrl?t.pictureUrl:this.defaultUserPicture),l.style.borderRadius="50%",l.style.margin="4px 8px 0 8px",i.appendChild(l),e.appendChild(i),(i=document.createElement("td")).setAttribute("valign","middle"),i.style.whiteSpace="nowrap",i.style.paddingTop="4px",i.style.maxWidth="0",i.style.overflow="hidden",i.style.textOverflow="ellipsis",mxUtils.write(i,t.displayName+(t.isCurrent&&n.length>1?" ("+mxResources.get("default")+")":"")),null!=t.email){mxUtils.br(i);var o=document.createElement("small");o.style.color="gray",mxUtils.write(o,t.email),i.appendChild(o)}var r=document.createElement("div");r.style.marginTop="4px";var a=document.createElement("i");return mxUtils.write(a,mxResources.get("googleDrive")),r.appendChild(a),i.appendChild(r),e.appendChild(i),t.isCurrent||(e.style.cursor="pointer",e.style.opacity="0.3",mxEvent.addListener(e,"click",mxUtils.bind(this,(function(e){s(mxUtils.bind(this,(function(){this.stateArg=null,this.drive.setUser(t),this.drive.authorize(!0,mxUtils.bind(this,(function(){this.setMode(App.MODE_GOOGLE),this.hideDialog(),this.showSplash()})),mxUtils.bind(this,(function(t){this.handleError(t)})),!0)})),mxResources.get("closingFile")+"..."),mxEvent.consume(e)})))),e}));e=!0;var o=document.createElement("table");o.style.borderSpacing="0",o.style.fontSize="10pt",o.style.width="100%",o.style.padding="10px";for(var r=0;r<n.length;r++)o.appendChild(l(n[r]));this.userPanel.appendChild(o),(a=document.createElement("div")).style.textAlign="left",a.style.padding="10px",a.style.whiteSpace="nowrap",a.style.borderTop="1px solid rgb(224, 224, 224)",(u=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,(function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,(function(){s(mxUtils.bind(this,(function(){this.stateArg=null,this.drive.logout(),this.setMode(App.MODE_GOOGLE),this.hideDialog(),this.showSplash()})),mxResources.get("signOut"))})))})))).className="geBtn",u.style.float="right",a.appendChild(u),(u=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,(function(){var t=this.drive.createAuthWin();t.blur(),window.focus(),s(mxUtils.bind(this,(function(){this.stateArg=null,this.drive.authorize(!1,mxUtils.bind(this,(function(){this.setMode(App.MODE_GOOGLE),this.hideDialog(),this.showSplash()})),mxUtils.bind(this,(function(t){this.handleError(t)})),!0,t)})),mxResources.get("closingFile")+"...")})))).className="geBtn",u.style.margin="0px",a.appendChild(u),this.userPanel.appendChild(a)}}var a,u,d=mxUtils.bind(this,(function(t,i,n,s){if(null!=t){e&&this.userPanel.appendChild(document.createElement("hr")),e=!0;var l=document.createElement("table");l.style.borderSpacing="0",l.style.fontSize="10pt",l.style.width="100%",l.style.padding="10px";var o,r=document.createElement("tbody"),a=document.createElement("tr");if((o=document.createElement("td")).setAttribute("valig","top"),o.style.width="40px",null!=i){var u=document.createElement("img");u.setAttribute("width","40"),u.setAttribute("height","40"),u.setAttribute("border","0"),u.setAttribute("src",i),u.style.marginRight="6px",o.appendChild(u)}if(a.appendChild(o),(o=document.createElement("td")).setAttribute("valign","middle"),o.style.whiteSpace="nowrap",o.style.maxWidth="0",o.style.overflow="hidden",o.style.textOverflow="ellipsis",mxUtils.write(o,t.displayName),null!=t.email){mxUtils.br(o);var d=document.createElement("small");d.style.color="gray",mxUtils.write(d,t.email),o.appendChild(d)}if(null!=s){var h;(h=document.createElement("div")).style.marginTop="4px";var c=document.createElement("i");mxUtils.write(c,s),h.appendChild(c),o.appendChild(h)}if(a.appendChild(o),r.appendChild(a),l.appendChild(r),this.userPanel.appendChild(l),(h=document.createElement("div")).style.textAlign="center",h.style.padding="10px",h.style.whiteSpace="nowrap",null!=n){var p=mxUtils.button(mxResources.get("signOut"),n);p.className="geBtn",h.appendChild(p)}this.userPanel.appendChild(h)}}));null!=this.dropbox&&d(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",mxUtils.bind(this,(function(){var t=this.getCurrentFile();if(null!=t&&t.constructor==DropboxFile){var e=mxUtils.bind(this,(function(){this.dropbox.logout(),window.location.hash=""}));t.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}else this.dropbox.logout()})),mxResources.get("dropbox")),null!=this.oneDrive&&d(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.oneDrive.noLogout?null:mxUtils.bind(this,(function(){var t=this.getCurrentFile();if(null!=t&&t.constructor==OneDriveFile){var e=mxUtils.bind(this,(function(){this.oneDrive.logout(),window.location.hash=""}));t.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}else this.oneDrive.logout()})),mxResources.get("oneDrive")),null!=this.gitHub&&d(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,(function(){var t=this.getCurrentFile();if(null!=t&&t.constructor==GitHubFile){var e=mxUtils.bind(this,(function(){this.gitHub.logout(),window.location.hash=""}));t.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}else this.gitHub.logout()})),mxResources.get("github")),null!=this.gitLab&&d(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,(function(){var t=this.getCurrentFile();if(null!=t&&t.constructor==GitLabFile){var e=mxUtils.bind(this,(function(){this.gitLab.logout(),window.location.hash=""}));t.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}else this.gitLab.logout()})),mxResources.get("gitlab")),null!=this.notion&&d(this.notion.getUser(),IMAGE_PATH+"/notion-logo.svg",mxUtils.bind(this,(function(){var t=this.getCurrentFile();if(null!=t&&t.constructor==NotionFile){var e=mxUtils.bind(this,(function(){this.notion.logout(),window.location.hash=""}));t.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}else this.notion.logout()})),mxResources.get("notion")),null!=this.trello&&d(this.trello.getUser(),IMAGE_PATH+"/trello-logo.svg",mxUtils.bind(this,(function(){var t=this.getCurrentFile();if(null!=t&&t.constructor==TrelloFile){var e=mxUtils.bind(this,(function(){this.trello.logout(),window.location.hash=""}));t.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}else this.trello.logout()})),mxResources.get("trello")),e||((a=document.createElement("div")).style.textAlign="center",a.style.padding="10px",a.innerHTML=mxResources.get("notConnected"),this.userPanel.appendChild(a)),(a=document.createElement("div")).style.textAlign="center",a.style.padding="10px",a.style.background=Editor.isDarkMode()?"":"whiteSmoke",a.style.borderTop="1px solid #e0e0e0",a.style.whiteSpace="nowrap","1"==urlParams.sketch?((u=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,(function(){this.actions.get("share").funct()})))).className="geBtn",a.appendChild(u),this.userPanel.appendChild(a),this.commentsSupported()&&((u=mxUtils.button(mxResources.get("comments"),mxUtils.bind(this,(function(){this.actions.get("comments").funct()})))).className="geBtn",a.appendChild(u),this.userPanel.appendChild(a))):((u=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,(function(){mxEvent.isConsumed(t)||null==this.userPanel||null==this.userPanel.parentNode||this.userPanel.parentNode.removeChild(this.userPanel)})))).className="geBtn",a.appendChild(u),this.userPanel.appendChild(a)),document.body.appendChild(this.userPanel)}mxEvent.consume(t)}))),mxEvent.addListener(document.body,"click",mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||null==this.userPanel||null==this.userPanel.parentNode||this.userPanel.parentNode.removeChild(this.userPanel)}))));var t=null;null!=this.drive&&null!=this.drive.getUser()?t=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?t=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?t=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()?t=this.gitHub.getUser():null!=this.gitLab&&null!=this.gitLab.getUser()?t=this.gitLab.getUser():null!=this.notion&&null!=this.notion.getUser()&&(t=this.notion.getUser()),null!=t?(this.userElement.innerHTML="",screen.width>560&&(mxUtils.write(this.userElement,t.displayName),this.userElement.style.display="block")):this.userElement.style.display="none"}else null!=this.userElement&&(this.userElement.parentNode.removeChild(this.userElement),this.userElement=null)},App.prototype.getCurrentUser=function(){var t=null;return null!=this.drive&&null!=this.drive.getUser()?t=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?t=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?t=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(t=this.gitHub.getUser()),t};var editorResetGraph=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments),null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};