diff --git a/ChangeLog b/ChangeLog index 0b5a574b..995246a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +07-FEB-2017: 6.0.3.5 + +- Fixes hidden image in Chrome for image export to new window +- Fixes fallback for non-public Google Drive files +- Fixes blurred image for client-side image export in Chrome +- Uses mxGraph 3.7.0.2 beta 2 + 07-FEB-2017: 6.0.3.4 - Shows related articles in help links diff --git a/VERSION b/VERSION index a20bea8f..b6c5a6d8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0.3.4 \ No newline at end of file +6.0.3.5 \ No newline at end of file diff --git a/etc/mxgraph/mxClient.js b/etc/mxgraph/mxClient.js index e027dd0f..79691d1c 100644 --- a/etc/mxgraph/mxClient.js +++ b/etc/mxgraph/mxClient.js @@ -289,7 +289,7 @@ mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEna m);null!=n&&s.setAttribute("clip",n?"1":"0");null!=p&&s.setAttribute("rotation",p);null!=q&&s.setAttribute("dir",q);this.root.appendChild(s)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))}; function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.gradients=[];this.defs=null;this.styleEnabled=null!=b?b:!1;var c=null;if(a.ownerDocument!=document)for(c=a;null!=c&&"svg"!=c.nodeName;)c=c.parentNode;null!=c&&(0l.alpha||1>l.fillAlpha)&&m.setAttribute("opacity",l.alpha*l.fillAlpha);e=this.state.transform||"";if(g||k){var n=f=1,p=0,q=0;g&&(f=-1,p=-c-2*a);k&&(n=-1,q=-d-2*b);e+="scale("+f+","+n+")translate("+p*l.scale+","+q*l.scale+")"}0l.alpha||1>l.fillAlpha)&&m.setAttribute("opacity",l.alpha*l.fillAlpha);e=this.state.transform||"";if(g||k){var n=f=1,p=0,q=0;g&&(f=-1,p=-c-2*a);k&&(n=-1,q=-d-2*b);e+="scale("+f+","+n+")translate("+p*l.scale+","+q*l.scale+")"}0/g,"\x26gt;");a=b.value.replace(/&/g,"\x26amp;").replace(/</g, "\x26lt;").replace(/>/g,"\x26gt;").replace(/&/g,"\x26amp;").replace(/
/g,"\x3cbr /\x3e").replace(/
/g,"\x3chr /\x3e").replace(/(]+)>/gm,"$1 /\x3e")}return a}; diff --git a/war/cache.manifest b/war/cache.manifest index 711467cd..a327aa84 100644 --- a/war/cache.manifest +++ b/war/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 02/07/2017 02:19 PM +# 02/07/2017 05:29 PM /app.html /index.html?offline=1 diff --git a/war/js/app.min.js b/war/js/app.min.js index 2c50b69a..bd02a2d8 100644 --- a/war/js/app.min.js +++ b/war/js/app.min.js @@ -82,7 +82,7 @@ time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:" u.URIEFFECTS=u.J;u.M={UNSANDBOXED:2,SANDBOXED:1,DATA:0};u.ltypes=u.M;u.I={"a::href":2,"area::href":2,"audio::src":2,"blockquote::cite":2,"command::icon":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2,"video::poster":1,"video::src":2};u.LOADERTYPES=u.I;"undefined"!==typeof window&&(window.html4=u);b=function(b){function e(b,a){var d;if(O.hasOwnProperty(a))d=O[a];else{var c=a.match(M);d=c?String.fromCharCode(parseInt(c[1],10)):(c=a.match($))?String.fromCharCode(parseInt(c[1], 16)):J&&N.test(a)?(J.innerHTML="\x26"+a+";",c=J.textContent,O[a]=c):"\x26"+a+";"}return d}function g(b){return b.replace(X,e)}function k(b){return(""+b).replace(da,"\x26amp;").replace(Z,"\x26lt;").replace(aa,"\x26gt;").replace(Y,"\x26#34;")}function l(b){return b.replace(U,"\x26amp;$1").replace(Z,"\x26lt;").replace(aa,"\x26gt;")}function m(b){var a={z:b.z||b.cdata,A:b.A||b.comment,B:b.B||b.endDoc,t:b.t||b.endTag,e:b.e||b.pcdata,F:b.F||b.rcdata,H:b.H||b.startDoc,w:b.w||b.startTag};return function(b, e){var c,g=/(<\/|<\!--|<[!?]|[&<>])/g;c=b+"";if(ha)c=c.split(g);else{for(var k=[],l=0,n;(n=g.exec(c))!==f;)k.push(c.substring(l,n.index)),k.push(n[0]),l=n.index+n[0].length;k.push(c.substring(l));c=k}u(a,c,0,{r:d,C:d},e)}}function p(b,a,d,e,c){return function(){u(b,a,d,e,c)}}function u(a,d,e,f,g){try{a.H&&0==e&&a.H(g);for(var k,l,n,m=d.length;el.alpha||1>l.fillAlpha)&&n.setAttribute("opacity",l.alpha*l.fillAlpha);b=this.state.transform||"";if(g||k){var m=e=1,p=0,s=0;g&&(e=-1,p=-f-2*a);k&&(m=-1,s=-d-2*c);b+="scale("+e+","+m+")translate("+p*l.scale+","+s*l.scale+")"}0l.alpha||1>l.fillAlpha)&&n.setAttribute("opacity",l.alpha*l.fillAlpha);b=this.state.transform||"";if(g||k){var m=e=1,p=0,s=0;g&&(e=-1,p=-f-2*a);k&&(m=-1,s=-d-2*c);b+="scale("+e+","+m+")translate("+p*l.scale+","+s*l.scale+")"}0/g,"\x26gt;");a=c.value.replace(/&/g,"\x26amp;").replace(/&lt;/g, "\x26lt;").replace(/&gt;/g,"\x26gt;").replace(/&amp;/g,"\x26amp;").replace(/
/g,"\x3cbr /\x3e").replace(/
/g,"\x3chr /\x3e").replace(/(]+)>/gm,"$1 /\x3e")}return a}; @@ -2499,42 +2499,42 @@ g.getCenterY(),c=null!=c?Math.max(c,k):k,e=null!=e?Math.min(e,k):k;d.push(g)}}if Graph.prototype.isCloneEvent=function(b){return mxClient.IS_MAC&&mxEvent.isMetaDown(b)||mxEvent.isControlDown(b)};Graph.prototype.encodeCells=function(b){for(var a=this.cloneCells(b),d=0;da&&d[c].deleteCell(a)};Graph.prototype.pasteHtmlAtCaret=function(b){var a;if(window.getSelection){if(a=window.getSelection(),a.getRangeAt&&a.rangeCount){a=a.getRangeAt(0);a.deleteContents();var d=document.createElement("div");d.innerHTML=b;b=document.createDocumentFragment();for(var c;c=d.firstChild;)lastNode=b.appendChild(c);a.insertNode(b)}}else(a=document.selection)&&"Control"!=a.type&&a.createRange().pasteHTML(b)};Graph.prototype.initTouch= -function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(b,a){this.popupMenuHandler.hideMenu()});var b=this.updateMouseEvent;this.updateMouseEvent=function(a){a=b.apply(this,arguments);if(mxEvent.isTouchEvent(a.getEvent())&&null==a.getState()){var d=this.getCellAt(a.graphX,a.graphY);null!=d&&this.isSwimlane(d)&&this.hitsSwimlaneContent(d,a.graphX,a.graphY)||(a.state=this.view.getState(d),null!=a.state&& -null!=a.state.shape&&(this.container.style.cursor=a.state.shape.node.style.cursor))}null==a.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return a};var a=!1,d=!1,c=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(b,f,g){b==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),a=this.isCellSelected(f.getCell()),d=this.isSelectionEmpty(),c=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(b,e){this.popupMenuHandler.popupTrigger= -!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!c&&!mxEvent.isMouseEvent(e.getEvent())&&(d&&null==e.getCell()&&this.isSelectionEmpty()||a&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var b=this.graph.view.getState(this.editingCell);return null!=b&&1==b.style.html};mxCellEditor.prototype.saveSelection= -function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var b=[],a=0,d=sel.rangeCount;aa&&d[c].deleteCell(a)};Graph.prototype.pasteHtmlAtCaret=function(b){var a;if(window.getSelection){if(a=window.getSelection(),a.getRangeAt&&a.rangeCount){a=a.getRangeAt(0);a.deleteContents();var d=document.createElement("div");d.innerHTML=b;b=document.createDocumentFragment();for(var c;c=d.firstChild;)lastNode=b.appendChild(c);a.insertNode(b)}}else(a=document.selection)&&"Control"!=a.type&& +a.createRange().pasteHTML(b)};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(b,a){this.popupMenuHandler.hideMenu()});var b=this.updateMouseEvent;this.updateMouseEvent=function(a){a=b.apply(this,arguments);if(mxEvent.isTouchEvent(a.getEvent())&&null==a.getState()){var d=this.getCellAt(a.graphX,a.graphY);null!=d&&this.isSwimlane(d)&&this.hitsSwimlaneContent(d,a.graphX, +a.graphY)||(a.state=this.view.getState(d),null!=a.state&&null!=a.state.shape&&(this.container.style.cursor=a.state.shape.node.style.cursor))}null==a.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return a};var a=!1,d=!1,c=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(b,f,g){b==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),a=this.isCellSelected(f.getCell()),d=this.isSelectionEmpty(),c=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp= +mxUtils.bind(this,function(b,e){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!c&&!mxEvent.isMouseEvent(e.getEvent())&&(d&&null==e.getCell()&&this.isSelectionEmpty()||a&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var b=this.graph.view.getState(this.editingCell); +return null!=b&&1==b.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var b=[],a=0,d=sel.rangeCount;ae.getStatus()||299e.getStatus()||299b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),q=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var v=Math.max(g/e,q/e);if(1navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript("https://js.live.net/v5.0/wl.js"):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")), -"0"!=urlParams.plugins&&"1"!=urlParams.offline)){var a=mxSettings.getPlugins(),c=urlParams.p;if(null!=c||null!=a&&0navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript("https://js.live.net/v5.0/wl.js"):"0"== +urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=null)}"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")}if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var a=mxSettings.getPlugins(),c=urlParams.p;if(null!=c||null!=a&&0a.indexOf("DocumentClosedError")){c=a;var l=new Image,n=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";l.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity\x3d"+n+"\x26v\x3d"+encodeURIComponent(EditorUi.VERSION)+ "\x26msg\x3dclientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(e)+(null!=f?":colno:"+encodeURIComponent(f):"")+(null!=k&&null!=k.stack?"\x26stack\x3d"+encodeURIComponent(k.stack):"")}}catch(m){}};"atlas"==uiTheme&&mxClient.link("stylesheet","styles/atlas.css");if(null!=window.mxscript){"0"!=urlParams.chrome&&mxscript("js/jscolor/jscolor.js");if("1"==urlParams.offline){mxscript("js/shapes.min.js");var f=document.createElement("iframe"); f.setAttribute("width","0");f.setAttribute("height","0");f.setAttribute("src","offline.html");document.body.appendChild(f);mxStencilRegistry.stencilSet={};mxStencilRegistry.getStencil=function(a){return mxStencilRegistry.stencils[a]};mxStencilRegistry.loadStencilSet=function(a,b,c){a=a.substring(a.indexOf("/")+1);a="mxgraph."+a.substring(0,a.length-4).replace(/\//g,".");a=mxStencilRegistry.stencilSet[a];null!=a&&mxStencilRegistry.parseStencilSet(a,b,!1)};for(f=mxUtils.load("stencils.xml").getXml().documentElement.firstChild;null!= @@ -8231,10 +8230,10 @@ mxUtils.bind(this,function(a){g();this.handleError(a)}))}}; App.prototype.loadFile=function(a,c,f){this.hideDialog();f=mxUtils.bind(this,function(){if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var d=localStorage.getItem(a);if(null!=d)this.fileLoaded(new StorageFile(this,d,a));else throw{message:mxResources.get("fileNotFound")};}catch(b){this.handleError(b,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile(); window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=e)this.spinner.stop(),this.fileLoaded(e);else if("R"==a.charAt(0)){this.spinner.stop();d=decodeURIComponent(a.substring(1));"\x3c"!=d.charAt(0)&&(d=this.editor.graph.decompress(d));var e=new LocalFile(this,d,null!=urlParams.title? decodeURIComponent(urlParams.title):this.defaultFilename);e.getHash=function(){return a};this.fileLoaded(e);this.setMode(null)}else if("U"==a.charAt(0)){var f=decodeURIComponent(a.substring(1));this.loadTemplate(f,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0p&&0b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-");c=0.01+100*(c/d);d=Math.max(1-(1-a)/b*(100-c),a);var f=l.substring(0,l.indexOf("Animation")).toLowerCase();return n[e]||(q.insertRule("@"+ -(f&&"-"+f+"-"||"")+"keyframes "+e+"{0%{opacity:"+d+"}"+c+"%{opacity:"+a+"}"+(c+0.01)+"%{opacity:1}"+(c+b)%100+"%{opacity:"+a+"}100%{opacity:"+d+"}}",q.cssRules.length),n[e]=1),e}function d(a,b){var c,d,e=a.style;b=b.charAt(0).toUpperCase()+b.slice(1);for(d=0;db;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-");c=0.01+100*(c/d);d=Math.max(1-(1-a)/b*(100-c),a);var f=l.substring(0,l.indexOf("Animation")).toLowerCase();return n[e]||(p.insertRule("@"+ +(f&&"-"+f+"-"||"")+"keyframes "+e+"{0%{opacity:"+d+"}"+c+"%{opacity:"+a+"}"+(c+0.01)+"%{opacity:1}"+(c+b)%100+"%{opacity:"+a+"}100%{opacity:"+d+"}}",p.cssRules.length),n[e]=1),e}function d(a,b){var c,d,e=a.style;b=b.charAt(0).toUpperCase()+b.slice(1);for(d=0;d>1,filter:m}),c("fill",{color:"string"==typeof d.color?d.color:d.color[a%d.color.length],opacity:d.opacity}),c("stroke",{opacity:0}))))}var g,l=d.length+d.width,m=2*l;g=2*-(d.width+d.length)+"px";var n=e(f(),{position:"absolute",top:g,left:g});if(d.shadow)for(g=1;g<=d.lines;g++)k(g,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius\x3d2,makeshadow\x3d1,shadowopacity\x3d.3)");for(g=1;g<=d.lines;g++)k(g);return b(a,n)};g.prototype.opacity=function(a,b,c,d){a=a.firstChild;d=d.shadow&& -d.lines||0;a&&b+d>1)+"px"})}for(var g, m=0,n=(f.lines-1)*(1-f.direction)/2;m>10),56320+(c&1023))):c==c?String.fromCharCode(c):" ">b[1]?"":b[1]}function b(a,c){return'"'+a.replace(/[\u0000-\u001f\\\"<>]/g, c)+'"'}function c(a){return e[a]||(e[a]="\\"+a.charCodeAt(0).toString(16)+" ")}function d(a){return f[a]||(f[a]=("\u0010">a?"%0":"%")+a.charCodeAt(0).toString(16))}var e={"\\":"\\\\"},f={"\\":"%5c"},g=RegExp("\\uFEFF|U[+][0-9A-F?]{1,6}(?:-[0-9A-F]{1,6})?|url[(][\\t\\n\\f ]*(?:\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|(?:[\\t\\x21\\x23-\\x26\\x28-\\x5b\\x5d-\\x7e]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)[\\t\\n\\f ]*[)]|(?!url[(])-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*[(]|(?:@?-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))|#)(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*|\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|[-+]?(?:[0-9]+(?:[.][0-9]+)?|[.][0-9]+)(?:%|-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)?|\x3c!--|--\x3e|[\\t\\n\\f ]+|/(?:[*][^*]*[*]+(?:[^/][^*]*[*]+)*/|/[^\\n\\f]*)|[~|^$*]\x3d|[^\"'\\\\/]|/(?![/*])", -"gi"),m=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),n=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");l=function(b){return b.replace(m,a)};k=function(a){a=(""+a).replace(/\r\n?/g,"\n").match(g)||[];for(var e=0,f=" ",k=0,m=a.length;k=r?" ":/url\(/i.test(q)?"url("+b(q.replace(n,""),d)+")":q;if(f!=q||" "!=q)a[e++]=f=q}a.length=e;return a}})();"undefined"!==typeof window&&(window.lexCss=k,window.decodeCss=l);var m=function(){function a(b){b=(""+b).match(n);return!b?c:new k(g(b[1]),g(b[2]),g(b[3]),g(b[4]),g(b[5]),g(b[6]),g(b[7]))}function b(a,e){return"string"==typeof a?encodeURI(a).replace(e,d):c}function d(a){a=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(a>>4&15)+"0123456789ABCDEF".charAt(a&15)}function e(a){if(a=== +"gi"),m=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),n=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");l=function(b){return b.replace(m,a)};k=function(a){a=(""+a).replace(/\r\n?/g,"\n").match(g)||[];for(var e=0,f=" ",k=0,m=a.length;k=q?" ":/url\(/i.test(p)?"url("+b(p.replace(n,""),d)+")":p;if(f!=p||" "!=p)a[e++]=f=p}a.length=e;return a}})();"undefined"!==typeof window&&(window.lexCss=k,window.decodeCss=l);var m=function(){function a(b){b=(""+b).match(n);return!b?c:new k(g(b[1]),g(b[2]),g(b[3]),g(b[4]),g(b[5]),g(b[6]),g(b[7]))}function b(a,e){return"string"==typeof a?encodeURI(a).replace(e,d):c}function d(a){a=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(a>>4&15)+"0123456789ABCDEF".charAt(a&15)}function e(a){if(a=== c)return c;a=a.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/");for(var b=l,d;(d=a.replace(b,"$1"))!=a;a=d);return a}function f(a,b){var c=a.T(),d=b.K();d?c.ga(b.j):d=b.X();d?c.da(b.n):d=b.Y();d?c.ea(b.k):d=b.$();var k=b.g,g=e(k);if(d)c.ca(b.V()),g=g&&g.replace(m,"");else if(d=!!k){if(47!==g.charCodeAt(0))var g=e(c.g||"").replace(m,""),l=g.lastIndexOf("/")+1,g=e((l?g.substring(0,l):"")+e(k)).replace(m,"")}else g=g&&g.replace(m,""),g!==k&&c.G(g);d?c.G(g):d=b.aa();d?c.O(b.l):d=b.Z();d&&c.fa(b.o); return c}function k(a,b,c,d,e,f,g){this.j=a;this.n=b;this.k=c;this.h=d;this.g=e;this.l=f;this.o=g}function g(a){return"string"==typeof a&&0]/g,D={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a", -"\x3c":"%3c","\x3e":"%3e"},C=/^(?:([^:/?# ]+):)?/,F=/^(?:https?|mailto|data)$/i;n=function(){var a={};return function R(b,c,d,k,m){b=E(b);var n=f[b];if(!n||"object"!==typeof n)c.length=0;else{for(var q=n.cssPropBits,p=q&80,r=q&1536,u=NaN,G=0,t=0;G=x)C=q&1?C:"";else if(F=C.charCodeAt(1),H=C.charCodeAt(2),D=48<=F&&57>=F,A=48<=H&&57>=H,43===x&&(D||46===F&&A))C=q&1?(D?"":"0")+C.substring(1):"";else if(45===x&&(D||46===F&&A))C=q&4?(D?"-":"-0")+C.substring(1):q&1?"0":"";else if(46===x&&D)C=q&1?"0"+C:"";else if('url("'===C.substring(0,5))C= -d&&q&16?e(s(g(k,c[G].substring(5,C.length-2)),b,d)):"";else if("("===C.charAt(C.length-1))a:{Q=c;ea=G;C=1;$=ea+1;for(x=Q.length;$]/g,E={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a", +"\x3c":"%3c","\x3e":"%3e"},C=/^(?:([^:/?# ]+):)?/,F=/^(?:https?|mailto|data)$/i;n=function(){var a={};return function R(b,c,d,k,m){b=D(b);var n=f[b];if(!n||"object"!==typeof n)c.length=0;else{for(var p=n.cssPropBits,r=p&80,q=p&1536,u=NaN,G=0,t=0;G=x)C=p&1?C:"";else if(F=C.charCodeAt(1),H=C.charCodeAt(2),E=48<=F&&57>=F,A=48<=H&&57>=H,43===x&&(E||46===F&&A))C=p&1?(E?"":"0")+C.substring(1):"";else if(45===x&&(E||46===F&&A))C=p&4?(E?"-":"-0")+C.substring(1):p&1?"0":"";else if(46===x&&E)C=p&1?"0"+C:"";else if('url("'===C.substring(0,5))C= +d&&p&16?e(s(g(k,c[G].substring(5,C.length-2)),b,d)):"";else if("("===C.charAt(C.length-1))a:{Q=c;ea=G;C=1;$=ea+1;for(x=Q.length;$k&&" "===b[l-1]&&--l;f.startAtrule&&f.startAtrule(b[g].toLowerCase(),b.slice(k,l));d="{"===b[d]?c(b,d,e,f):d+1;f.endAtrule&&f.endAtrule()}return d}function c(b,f,k,g){++f;for(g.startBlock&&g.startBlock();fk&&" "===b[l-1]&&--l;f.startAtrule&&f.startAtrule(b[g].toLowerCase(),b.slice(k,l));d="{"===b[d]?c(b,d,e,f):d+1;f.endAtrule&&f.endAtrule()}return d}function c(b,f,k,g){++f;for(g.startBlock&&g.startBlock();fm)return m=~m,m===g?m+1:m;var n=a[m];if("{"!==n)return m===g?m+1:m;c=m+1;m>g&&" "===a[m-1]&&--m;for(k.startRuleset&&k.startRuleset(a.slice(g,m));cn)n=~n;else{for(var q=[],p=0,r=b;rn)n=~n;else{for(var p=[],r=0,q=b;q])/g;f=a+"";if(ga)f=f.split(k);else{for(var g=[],l=0,m;(m=k.exec(f))!==c;)g.push(f.substring(l,m.index)),g.push(m[0]),l=m.index+m[0].length;g.push(f.substring(l));f=g}p(b,f,0,{r:d,C:d},e)}}function q(a,b,c,d,e){return function(){p(a,b,c,d,e)}}function p(a,c,d,f,k){try{a.H&&0==d&&a.H(k);for(var g,l,m,n=c.length;dc)){for(f=k.length;--f>c;){var g=k[f].v;e.f[g]&e.c.OPTIONAL_ENDTAG||b.push("\x3c/",g,"\x3e")}c])/g;f=a+"";if(ga)f=f.split(k);else{for(var g=[],l=0,m;(m=k.exec(f))!==c;)g.push(f.substring(l,m.index)),g.push(m[0]),l=m.index+m[0].length;g.push(f.substring(l));f=g}r(b,f,0,{r:d,C:d},e)}}function p(a,b,c,d,e){return function(){r(a,b,c,d,e)}}function r(a,c,d,f,k){try{a.H&&0==d&&a.H(k);for(var g,l,m,n=c.length;dc)){for(f=k.length;--f>c;){var g=k[f].v;e.f[g]&e.c.OPTIONAL_ENDTAG||b.push("\x3c/",g,"\x3e")}c/g,U=/\"/g,Q=/^\s*([-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,ga=3==="a,b".split(/(,)/).length,ea=e.c.CDATA|e.c.RCDATA,$={},ha={},ka=/^(?:https?|mailto|data)$/i,da={};da.pa=da.escapeAttrib=g;da.ra=da.makeHtmlSanitizer=s;da.sa=da.makeSaxParser=n;da.ta=da.makeTagPolicy=V;da.wa=da.normalizeRCData=l;da.xa= da.sanitize=function(a,b,c,d){return W(a,V(b,c,d))};da.ya=da.sanitizeAttribs=X;da.za=da.sanitizeWithPolicy=W;da.Ba=da.unescapeEntities=k;return da}(t);g=e.sanitize;"undefined"!==typeof window&&(window.html=e,window.html_sanitize=g)})();var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d",encode:function(a,b){var c="",d,e,f,g,k,l,m=0;for(null!=b&&b||(a=Base64._utf8_encode(a));m>2,d=(d&3)<<4|e>>4,k=(e&15)<<2|f>>6,l=f&63,isNaN(e)?k=l=64:isNaN(f)&&(l=64),c=c+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return c},decode:function(a,b){b=null!=b?b:!1;var c="",d,e,f,g,k,l=0;for(a= a.replace(/[^A-Za-z0-9\+\/\=]/g,"");l>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|k,c+=String.fromCharCode(d),64!=g&&(c+=String.fromCharCode(e)),64!=k&&(c+=String.fromCharCode(f));b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d): (127d?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;cd?(b+=String.fromCharCode(d),c++):191d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};!function(a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=a()}(function(){return function b(c,d,e){function f(k,m){if(!d[k]){if(!c[k]){var n="function"==typeof require&&require;if(!m&&n)return n(k,!0);if(g)return g(k,!0);n=Error("Cannot find module '"+k+"'");throw n.code="MODULE_NOT_FOUND",n;}n=d[k]={exports:{}}; -c[k][0].call(n.exports,function(b){var d=c[k][1][b];return f(d?d:b)},n,n.exports,b,c,d,e)}return d[k].exports}for(var g="function"==typeof require&&require,k=0;kb.windowBits&&(b.windowBits+=16);this.err=0;this.msg= -"";this.ended=!1;this.chunks=[];this.strm=new n;this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==r)throw Error(m[c]);if(b.header&&g.deflateSetHeader(this.strm,b.header),b.dictionary){var d;if(d="string"==typeof b.dictionary?l.string2buf(b.dictionary):"[object ArrayBuffer]"===q.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=g.deflateSetDictionary(this.strm,d),c!==r)throw Error(m[c]);this._dict_set=!0}}function f(b,c){var d= -new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/deflate"),k=b("./utils/common"),l=b("./utils/strings"),m=b("./zlib/messages"),n=b("./zlib/zstream"),q=Object.prototype.toString,r=0,u=-1,p=0,s=8;e.prototype.push=function(b,c){var d,e,f=this.strm,m=this.options.chunkSize;if(this.ended)return!1;e=c===~~c?c:!0===c?4:0;"string"==typeof b?f.input=l.string2buf(b):"[object ArrayBuffer]"===q.call(b)?f.input=new Uint8Array(b):f.input=b;f.next_in=0;f.avail_in=f.input.length;do{if(0=== +c[k][0].call(n.exports,function(b){var d=c[k][1][b];return f(d?d:b)},n,n.exports,b,c,d,e)}return d[k].exports}for(var g="function"==typeof require&&require,k=0;kb.windowBits&&(b.windowBits+=16);this.err=0;this.msg= +"";this.ended=!1;this.chunks=[];this.strm=new n;this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==r)throw Error(m[c]);if(b.header&&g.deflateSetHeader(this.strm,b.header),b.dictionary){var d;if(d="string"==typeof b.dictionary?l.string2buf(b.dictionary):"[object ArrayBuffer]"===p.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=g.deflateSetDictionary(this.strm,d),c!==r)throw Error(m[c]);this._dict_set=!0}}function f(b,c){var d= +new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/deflate"),k=b("./utils/common"),l=b("./utils/strings"),m=b("./zlib/messages"),n=b("./zlib/zstream"),p=Object.prototype.toString,r=0,u=-1,q=0,s=8;e.prototype.push=function(b,c){var d,e,f=this.strm,m=this.options.chunkSize;if(this.ended)return!1;e=c===~~c?c:!0===c?4:0;"string"==typeof b?f.input=l.string2buf(b):"[object ArrayBuffer]"===p.call(b)?f.input=new Uint8Array(b):f.input=b;f.next_in=0;f.avail_in=f.input.length;do{if(0=== f.avail_out&&(f.output=new k.Buf8(m),f.next_out=0,f.avail_out=m),d=g.deflate(f,e),1!==d&&d!==r)return this.onEnd(d),this.ended=!0,!1;0!==f.avail_out&&(0!==f.avail_in||4!==e&&2!==e)||("string"===this.options.to?this.onData(l.buf2binstring(k.shrinkBuf(f.output,f.next_out))):this.onData(k.shrinkBuf(f.output,f.next_out)))}while((0c.windowBits&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||b&&b.windowBits||(c.windowBits+=32);15c.windowBits&&0===(15&c.windowBits)&&(c.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new q;this.strm.avail_out=0;b=g.inflateInit2(this.strm,c.windowBits);if(b!==m.Z_OK)throw Error(n[b]); -this.header=new r;g.inflateGetHeader(this.strm,this.header)}function f(b,c){var d=new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/inflate"),k=b("./utils/common"),l=b("./utils/strings"),m=b("./zlib/constants"),n=b("./zlib/messages"),q=b("./zlib/zstream"),r=b("./zlib/gzheader"),u=Object.prototype.toString;e.prototype.push=function(b,c){var d,e,f,n,q,r,A=this.strm,D=this.options.chunkSize,C=this.options.dictionary,F=!1;if(this.ended)return!1;e=c===~~c?c:!0===c?m.Z_FINISH:m.Z_NO_FLUSH; -"string"==typeof b?A.input=l.binstring2buf(b):"[object ArrayBuffer]"===u.call(b)?A.input=new Uint8Array(b):A.input=b;A.next_in=0;A.avail_in=A.input.length;do{if(0===A.avail_out&&(A.output=new k.Buf8(D),A.next_out=0,A.avail_out=D),d=g.inflate(A,m.Z_NO_FLUSH),d===m.Z_NEED_DICT&&C&&(r="string"==typeof C?l.string2buf(C):"[object ArrayBuffer]"===u.call(C)?new Uint8Array(C):C,d=g.inflateSetDictionary(this.strm,r)),d===m.Z_BUF_ERROR&&!0===F&&(d=m.Z_OK,F=!1),d!==m.Z_STREAM_END&&d!==m.Z_OK)return this.onEnd(d), -this.ended=!0,!1;A.next_out&&(0!==A.avail_out&&d!==m.Z_STREAM_END&&(0!==A.avail_in||e!==m.Z_FINISH&&e!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(f=l.utf8border(A.output,A.next_out),n=A.next_out-f,q=l.buf2string(A.output,f),A.next_out=n,A.avail_out=D-n,n&&k.arraySet(A.output,A.output,f,n,0),this.onData(q)):this.onData(k.shrinkBuf(A.output,A.next_out))));0===A.avail_in&&0===A.avail_out&&(F=!0)}while((0c.windowBits&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||b&&b.windowBits||(c.windowBits+=32);15c.windowBits&&0===(15&c.windowBits)&&(c.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new p;this.strm.avail_out=0;b=g.inflateInit2(this.strm,c.windowBits);if(b!==m.Z_OK)throw Error(n[b]); +this.header=new r;g.inflateGetHeader(this.strm,this.header)}function f(b,c){var d=new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/inflate"),k=b("./utils/common"),l=b("./utils/strings"),m=b("./zlib/constants"),n=b("./zlib/messages"),p=b("./zlib/zstream"),r=b("./zlib/gzheader"),u=Object.prototype.toString;e.prototype.push=function(b,c){var d,e,f,n,p,r,A=this.strm,E=this.options.chunkSize,C=this.options.dictionary,F=!1;if(this.ended)return!1;e=c===~~c?c:!0===c?m.Z_FINISH:m.Z_NO_FLUSH; +"string"==typeof b?A.input=l.binstring2buf(b):"[object ArrayBuffer]"===u.call(b)?A.input=new Uint8Array(b):A.input=b;A.next_in=0;A.avail_in=A.input.length;do{if(0===A.avail_out&&(A.output=new k.Buf8(E),A.next_out=0,A.avail_out=E),d=g.inflate(A,m.Z_NO_FLUSH),d===m.Z_NEED_DICT&&C&&(r="string"==typeof C?l.string2buf(C):"[object ArrayBuffer]"===u.call(C)?new Uint8Array(C):C,d=g.inflateSetDictionary(this.strm,r)),d===m.Z_BUF_ERROR&&!0===F&&(d=m.Z_OK,F=!1),d!==m.Z_STREAM_END&&d!==m.Z_OK)return this.onEnd(d), +this.ended=!0,!1;A.next_out&&(0!==A.avail_out&&d!==m.Z_STREAM_END&&(0!==A.avail_in||e!==m.Z_FINISH&&e!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(f=l.utf8border(A.output,A.next_out),n=A.next_out-f,p=l.buf2string(A.output,f),A.next_out=n,A.avail_out=E-n,n&&k.arraySet(A.output,A.output,f,n,0),this.onData(p)):this.onData(k.shrinkBuf(A.output,A.next_out))));0===A.avail_in&&0===A.avail_out&&(F=!0)}while((0c&&(b.subarray&&k||!b.subarray&&g))return String.fromCharCode.apply(null,f.shrinkBuf(b,c));for(var d="",e=0;eb;b++)n[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;n[254]=n[254]=1;d.string2buf=function(b){var c,d,e,k,g,l=b.length,m=0;for(k=0;kd?1:2048>d?2:65536>d?3:4;c=new f.Buf8(m);for(k=g=0;gd?c[g++]=d:2048> d?(c[g++]=192|d>>>6,c[g++]=128|63&d):65536>d?(c[g++]=224|d>>>12,c[g++]=128|d>>>6&63,c[g++]=128|63&d):(c[g++]=240|d>>>18,c[g++]=128|d>>>12&63,c[g++]=128|d>>>6&63,c[g++]=128|63&d);return c};d.buf2binstring=function(b){return e(b,b.length)};d.binstring2buf=function(b){for(var c=new f.Buf8(b.length),d=0,e=c.length;dk)m[f++]=k;else if(g=n[k],4k?m[f++]=k:(k-=65536,m[f++]=55296|k>>10&1023,m[f++]=56320|1023&k)}return e(m,f)};d.utf8border=function(b,c){var d;c=c||b.length;c>b.length&&(c=b.length);for(d=c-1;0<=d&&128===(192&b[d]);)d--;return 0>d?c:0===d?c:d+n[b[d]]>c?d:c}},{"./common":3}],5:[function(b,c,d){c.exports=function(b,c,d,k){var l=65535&b|0;b=b>>>16&65535|0;for(var m=0;0!==d;){m=2E3d;d++){b=d; for(var e=0;8>e;e++)b=1&b?3988292384^b>>>1:b>>>1;c[d]=b}return c}();c.exports=function(b,c,d,l){d=l+d;for(b^=-1;l>>8^e[255&(b^c[l])];return b^-1}},{}],8:[function(b,c,d){function e(b,c){return b.msg=C[c],c}function f(b){for(var c=b.length;0<=--c;)b[c]=0}function g(b){var c=b.state,d=c.pending;d>b.avail_out&&(d=b.avail_out);0!==d&&(y.arraySet(b.output,c.pending_buf,c.pending_out,d,b.next_out),b.next_out+=d,c.pending_out+=d,b.total_out+=d,b.avail_out-=d,c.pending-=d,0===c.pending&&(c.pending_out= -0))}function k(b,c){E._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,c);b.block_start=b.strstart;g(b.strm)}function l(b,c){b.pending_buf[b.pending++]=c}function m(b,c){b.pending_buf[b.pending++]=c>>>8&255;b.pending_buf[b.pending++]=255&c}function n(b,c){var d,e,f=b.max_chain_length,k=b.strstart,g=b.prev_length,l=b.nice_match,m=b.strstart>b.w_size-S?b.strstart-(b.w_size-S):0,n=b.window,q=b.w_mask,p=b.prev,r=b.strstart+O,u=n[k+g-1],G=n[k+g];b.prev_length>=b.good_match&& -(f>>=2);l>b.lookahead&&(l=b.lookahead);do if(d=c,n[d+g]===G&&n[d+g-1]===u&&n[d]===n[k]&&n[++d]===n[k+1]){k+=2;d++;do;while(n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&kg){if(b.match_start=c,g=e,e>=l)break;u=n[k+g-1];G=n[k+g]}}while((c=p[c&q])>m&&0!==--f);return g<=b.lookahead?g:b.lookahead}function q(b){var c,d,e,f,k=b.w_size;do{if(f=b.window_size-b.lookahead-b.strstart,b.strstart>= -k+(k-S)){y.arraySet(b.window,b.window,k,k,0);b.match_start-=k;b.strstart-=k;b.block_start-=k;c=d=b.hash_size;do e=b.head[--c],b.head[c]=e>=k?e-k:0;while(--d);c=d=k;do e=b.prev[--c],b.prev[c]=e>=k?e-k:0;while(--d);f+=k}if(0===b.strm.avail_in)break;c=b.strm;e=b.window;var g=b.strstart+b.lookahead,l=c.avail_in;if(d=(l>f&&(l=f),0===l?0:(c.avail_in-=l,y.arraySet(e,c.input,c.next_in,l,g),1===c.state.wrap?c.adler=A(c.adler,e,l,g):2===c.state.wrap&&(c.adler=D(c.adler,e,l,g)),c.next_in+=l,c.total_in+=l,l)), -b.lookahead+=d,b.lookahead+b.insert>=J){f=b.strstart-b.insert;b.ins_h=b.window[f];for(b.ins_h=(b.ins_h<=J&&(b.ins_h=(b.ins_h<< -b.hash_shift^b.window[b.strstart+J-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),0!==d&&b.strstart-d<=b.w_size-S&&(b.match_length=n(b,d)),b.match_length>=J)if(e=E._tr_tally(b,b.strstart-b.match_start,b.match_length-J),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=J){b.match_length--;do b.strstart++,b.ins_h=(b.ins_h<>>8&255;b.pending_buf[b.pending++]=255&c}function n(b,c){var d,e,f=b.max_chain_length,k=b.strstart,g=b.prev_length,l=b.nice_match,m=b.strstart>b.w_size-S?b.strstart-(b.w_size-S):0,n=b.window,p=b.w_mask,r=b.prev,q=b.strstart+O,u=n[k+g-1],s=n[k+g];b.prev_length>=b.good_match&& +(f>>=2);l>b.lookahead&&(l=b.lookahead);do if(d=c,n[d+g]===s&&n[d+g-1]===u&&n[d]===n[k]&&n[++d]===n[k+1]){k+=2;d++;do;while(n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&kg){if(b.match_start=c,g=e,e>=l)break;u=n[k+g-1];s=n[k+g]}}while((c=r[c&p])>m&&0!==--f);return g<=b.lookahead?g:b.lookahead}function p(b){var c,d,e,f,k=b.w_size;do{if(f=b.window_size-b.lookahead-b.strstart,b.strstart>= +k+(k-S)){y.arraySet(b.window,b.window,k,k,0);b.match_start-=k;b.strstart-=k;b.block_start-=k;c=d=b.hash_size;do e=b.head[--c],b.head[c]=e>=k?e-k:0;while(--d);c=d=k;do e=b.prev[--c],b.prev[c]=e>=k?e-k:0;while(--d);f+=k}if(0===b.strm.avail_in)break;c=b.strm;e=b.window;var g=b.strstart+b.lookahead,l=c.avail_in;if(d=(l>f&&(l=f),0===l?0:(c.avail_in-=l,y.arraySet(e,c.input,c.next_in,l,g),1===c.state.wrap?c.adler=A(c.adler,e,l,g):2===c.state.wrap&&(c.adler=E(c.adler,e,l,g)),c.next_in+=l,c.total_in+=l,l)), +b.lookahead+=d,b.lookahead+b.insert>=J){f=b.strstart-b.insert;b.ins_h=b.window[f];for(b.ins_h=(b.ins_h<=J&&(b.ins_h=(b.ins_h<< +b.hash_shift^b.window[b.strstart+J-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),0!==d&&b.strstart-d<=b.w_size-S&&(b.match_length=n(b,d)),b.match_length>=J)if(e=D._tr_tally(b,b.strstart-b.match_start,b.match_length-J),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=J){b.match_length--;do b.strstart++,b.ins_h=(b.ins_h<=J&&(b.ins_h=(b.ins_h<=b.match_length&&(b.strategy===R||b.match_length===J&&4096= -J&&b.match_length<=b.prev_length){f=b.strstart+b.lookahead-J;e=E._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-J);b.lookahead-=b.prev_length-1;b.prev_length-=2;do++b.strstart<=f&&(b.ins_h=(b.ins_h<c.wrap&&(c.wrap=-c.wrap),c.status=c.wrap?ca:ba,b.adler=2===c.wrap?0:1,c.last_flush=F,E._tr_init(c),H):e(b,N)}function v(b){var c=t(b);c===H&&(b=b.state,b.window_size=2*b.w_size,f(b.head),b.max_lazy_match=z[b.level].max_lazy,b.good_match=z[b.level].good_length,b.nice_match=z[b.level].nice_length,b.max_chain_length=z[b.level].max_chain,b.strstart=0,b.block_start= +this.lit_bufsize=this.l_buf=0}function t(b){var c;return b&&b.state?(b.total_in=b.total_out=0,b.data_type=V,c=b.state,c.pending=0,c.pending_out=0,0>c.wrap&&(c.wrap=-c.wrap),c.status=c.wrap?ca:ba,b.adler=2===c.wrap?0:1,c.last_flush=F,D._tr_init(c),H):e(b,N)}function v(b){var c=t(b);c===H&&(b=b.state,b.window_size=2*b.w_size,f(b.head),b.max_lazy_match=z[b.level].max_lazy,b.good_match=z[b.level].good_length,b.nice_match=z[b.level].nice_length,b.max_chain_length=z[b.level].max_chain,b.strstart=0,b.block_start= 0,b.lookahead=0,b.insert=0,b.match_length=b.prev_length=J-1,b.match_available=0,b.ins_h=0);return c}function x(b,c,d,f,k,g){if(!b)return N;var l=1;if(c===K&&(c=6),0>f?(l=0,f=-f):15k||k>B||d!==W||8>f||15c||9g||g>X)return e(b,N);8===f&&(f=9);var m=new s;return b.state=m,m.strm=b,m.wrap=l,m.gzhead=null,m.w_bits=f,m.w_size=1<b.pending_buf_size-5&&(d=b.pending_buf_size-5);;){if(1>=b.lookahead){if(q(b),0===b.lookahead&&c===F)return P;if(0===b.lookahead)break}b.strstart+=b.lookahead;b.lookahead=0;var e=b.block_start+d;if((0===b.strstart||b.strstart>=e)&&(b.lookahead=b.strstart-e,b.strstart=e,k(b,!1),0===b.strm.avail_out)||b.strstart-b.block_start>=b.w_size-S&&(k(b,!1),0===b.strm.avail_out))return P}return b.insert=0,c===G?(k(b,!0),0===b.strm.avail_out?aa:U):(b.strstart>b.block_start&&k(b,!1),P)}),new p(4,4,8, -4,r),new p(4,5,16,8,r),new p(4,6,32,32,r),new p(4,4,16,16,u),new p(8,16,32,32,u),new p(8,16,128,128,u),new p(8,32,128,256,u),new p(32,128,258,1024,u),new p(32,258,258,4096,u)];d.deflateInit=function(b,c){return x(b,c,W,15,8,0)};d.deflateInit2=x;d.deflateReset=v;d.deflateResetKeep=t;d.deflateSetHeader=function(b,c){return b&&b.state?2!==b.state.wrap?N:(b.state.gzhead=c,H):N};d.deflate=function(b,c){var d,n,p,r;if(!b||!b.state||5c)return b?e(b,N):N;if(n=b.state,!b.output||!b.input&&0!==b.avail_in|| +m.w_size),m.head=new y.Buf16(m.hash_size),m.prev=new y.Buf16(m.w_size),m.lit_bufsize=1<b.pending_buf_size-5&&(d=b.pending_buf_size-5);;){if(1>=b.lookahead){if(p(b),0===b.lookahead&&c===F)return P;if(0===b.lookahead)break}b.strstart+=b.lookahead;b.lookahead=0;var e=b.block_start+d;if((0===b.strstart||b.strstart>=e)&&(b.lookahead=b.strstart-e,b.strstart=e,k(b,!1),0===b.strm.avail_out)||b.strstart-b.block_start>=b.w_size-S&&(k(b,!1),0===b.strm.avail_out))return P}return b.insert=0,c===G?(k(b,!0),0===b.strm.avail_out?aa:U):(b.strstart>b.block_start&&k(b,!1),P)}),new q(4,4,8, +4,r),new q(4,5,16,8,r),new q(4,6,32,32,r),new q(4,4,16,16,u),new q(8,16,32,32,u),new q(8,16,128,128,u),new q(8,32,128,256,u),new q(32,128,258,1024,u),new q(32,258,258,4096,u)];d.deflateInit=function(b,c){return x(b,c,W,15,8,0)};d.deflateInit2=x;d.deflateReset=v;d.deflateResetKeep=t;d.deflateSetHeader=function(b,c){return b&&b.state?2!==b.state.wrap?N:(b.state.gzhead=c,H):N};d.deflate=function(b,c){var d,n,r,q;if(!b||!b.state||5c)return b?e(b,N):N;if(n=b.state,!b.output||!b.input&&0!==b.avail_in|| 666===n.status&&c!==G)return e(b,0===b.avail_out?-5:N);if(n.strm=b,d=n.last_flush,n.last_flush=c,n.status===ca)2===n.wrap?(b.adler=0,l(n,31),l(n,139),l(n,8),n.gzhead?(l(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),l(n,255&n.gzhead.time),l(n,n.gzhead.time>>8&255),l(n,n.gzhead.time>>16&255),l(n,n.gzhead.time>>24&255),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(l(n,255&n.gzhead.extra.length), -l(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(b.adler=D(b.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(l(n,0),l(n,0),l(n,0),l(n,0),l(n,0),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,3),n.status=ba)):(p=W+(n.w_bits-8<<4)<<8,r=-1,r=2<=n.strategy||2>n.level?0:6>n.level?1:6===n.level?2:3,p|=r<<6,0!==n.strstart&&(p|=32),n.status=ba,m(n,p+(31-p%31)),0!==n.strstart&&(m(n,b.adler>>>16),m(n,65535&b.adler)),b.adler=1);if(69===n.status)if(n.gzhead.extra){for(p=n.pending;n.gzindex< -(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>p&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p)),g(b),p=n.pending,n.pending!==n.pending_buf_size));)l(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>p&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p));n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){p=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending> -p&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p)),g(b),p=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindexp&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p));0===r&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){p=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>p&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p)), -g(b),p=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindexp&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p));0===r&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&g(b),n.pending+2<=n.pending_buf_size&&(l(n,255&b.adler),l(n,b.adler>>8&255),b.adler=0,n.status=ba)):n.status=ba),0!==n.pending){if(g(b),0===b.avail_out)return n.last_flush= --1,H}else if(0===b.avail_in&&(c<<1)-(4=J&&0n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>= -J?(u=E._tr_tally(n,1,n.match_length-J),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(u=E._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),u&&(k(n,!1),0===n.strm.avail_out)){u=P;break a}}u=(n.insert=0,c===G?(k(n,!0),0===n.strm.avail_out?aa:U):n.last_lit&&(k(n,!1),0===n.strm.avail_out)?P:Z)}else u=z[n.level].func(n,c);if(u!==aa&&u!==U||(n.status=666),u===P||u===aa)return 0===b.avail_out&&(n.last_flush=-1),H;if(u===Z&&(1===c?E._tr_align(n):5!==c&&(E._tr_stored_block(n, +l(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(b.adler=E(b.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(l(n,0),l(n,0),l(n,0),l(n,0),l(n,0),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,3),n.status=ba)):(r=W+(n.w_bits-8<<4)<<8,q=-1,q=2<=n.strategy||2>n.level?0:6>n.level?1:6===n.level?2:3,r|=q<<6,0!==n.strstart&&(r|=32),n.status=ba,m(n,r+(31-r%31)),0!==n.strstart&&(m(n,b.adler>>>16),m(n,65535&b.adler)),b.adler=1);if(69===n.status)if(n.gzhead.extra){for(r=n.pending;n.gzindex< +(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>r&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r)),g(b),r=n.pending,n.pending!==n.pending_buf_size));)l(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>r&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r));n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending> +r&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r)),g(b),r=n.pending,n.pending===n.pending_buf_size)){q=1;break}q=n.gzindexr&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r));0===q&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r)), +g(b),r=n.pending,n.pending===n.pending_buf_size)){q=1;break}q=n.gzindexr&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r));0===q&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&g(b),n.pending+2<=n.pending_buf_size&&(l(n,255&b.adler),l(n,b.adler>>8&255),b.adler=0,n.status=ba)):n.status=ba),0!==n.pending){if(g(b),0===b.avail_out)return n.last_flush= +-1,H}else if(0===b.avail_in&&(c<<1)-(4=J&&0n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>= +J?(u=D._tr_tally(n,1,n.match_length-J),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(u=D._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),u&&(k(n,!1),0===n.strm.avail_out)){u=P;break a}}u=(n.insert=0,c===G?(k(n,!0),0===n.strm.avail_out?aa:U):n.last_lit&&(k(n,!1),0===n.strm.avail_out)?P:Z)}else u=z[n.level].func(n,c);if(u!==aa&&u!==U||(n.status=666),u===P||u===aa)return 0===b.avail_out&&(n.last_flush=-1),H;if(u===Z&&(1===c?D._tr_align(n):5!==c&&(D._tr_stored_block(n, 0,0,!1),3===c&&(f(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),g(b),0===b.avail_out))return n.last_flush=-1,H}return c!==G?H:0>=n.wrap?1:(2===n.wrap?(l(n,255&b.adler),l(n,b.adler>>8&255),l(n,b.adler>>16&255),l(n,b.adler>>24&255),l(n,255&b.total_in),l(n,b.total_in>>8&255),l(n,b.total_in>>16&255),l(n,b.total_in>>24&255)):(m(n,b.adler>>>16),m(n,65535&b.adler)),g(b),0=d.w_size&&(0===g&&(f(d.head),d.strstart=0,d.block_start=0,d.insert=0),l=new y.Buf8(d.w_size),y.arraySet(l,c,e-d.w_size,d.w_size,0),c=l,e=d.w_size);l=b.avail_in;m=b.next_in;n=b.input;b.avail_in=e;b.next_in= -0;b.input=c;for(q(d);d.lookahead>=J;){e=d.strstart;k=d.lookahead-(J-1);do d.ins_h=(d.ins_h<x&&(v+=N[k++]<>>24,v>>>=C,x-=C,C=D>>>16&255,0===C)K[m++]=65535&D;else{if(!(16&C)){if(0===(64&C)){D=z[(65535&D)+(v&(1<>>=C,x-=C);15>x&&(v+=N[k++]<>>24,v>>>=C,x-=C,C=D>>>16&255, -!(16&C)){if(0===(64&C)){D=y[(65535&D)+(v&(1<r){b.msg="invalid distance too far back";d.mode=30;break a}if(v>>>=C,x-=C,C=m-n,G>C){if(C=G-C,C>p&&d.sane){b.msg="invalid distance too far back";d.mode=30;break a}if(D=0,H=t,0===s){if(D+=u-C,C>3;k-=F;x-=F<<3;b.next_in=k;b.next_out=m;b.avail_in=k=J;){e=d.strstart;k=d.lookahead-(J-1);do d.ins_h=(d.ins_h<x&&(v+=N[k++]<>>24,v>>>=C,x-=C,C=E>>>16&255,0===C)K[m++]=65535&E;else{if(!(16&C)){if(0===(64&C)){E=z[(65535&E)+(v&(1<>>=C,x-=C);15>x&&(v+=N[k++]<>>24,v>>>=C,x-=C,C=E>>>16&255, +!(16&C)){if(0===(64&C)){E=y[(65535&E)+(v&(1<r){b.msg="invalid distance too far back";d.mode=30;break a}if(v>>>=C,x-=C,C=m-n,G>C){if(C=G-C,C>q&&d.sane){b.msg="invalid distance too far back";d.mode=30;break a}if(E=0,H=t,0===s){if(E+=u-C,C>3;k-=F;x-=F<<3;b.next_in=k;b.next_out=m;b.avail_in=k>>24&255)+(b>>>8&65280)+((65280&b)<<8)+((255&b)<<24)}function f(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new u.Buf16(320);this.work= -new u.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(b){var c;return b&&b.state?(c=b.state,b.total_in=b.total_out=c.total=0,b.msg="",c.wrap&&(b.adler=1&c.wrap),c.mode=y,c.last=0,c.havedict=0,c.dmax=32768,c.head=null,c.hold=0,c.bits=0,c.lencode=c.lendyn=new u.Buf32(E),c.distcode=c.distdyn=new u.Buf32(A),c.sane=1,c.back=-1,x):z}function k(b){var c;return b&&b.state?(c=b.state,c.wsize=0,c.whave=0,c.wnext=0,g(b)):z}function l(b,c){var d,e;return b&&b.state?(e=b.state, +new u.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(b){var c;return b&&b.state?(c=b.state,b.total_in=b.total_out=c.total=0,b.msg="",c.wrap&&(b.adler=1&c.wrap),c.mode=y,c.last=0,c.havedict=0,c.dmax=32768,c.head=null,c.hold=0,c.bits=0,c.lencode=c.lendyn=new u.Buf32(D),c.distcode=c.distdyn=new u.Buf32(A),c.sane=1,c.back=-1,x):z}function k(b){var c;return b&&b.state?(c=b.state,c.wsize=0,c.whave=0,c.wnext=0,g(b)):z}function l(b,c){var d,e;return b&&b.state?(e=b.state, 0>c?(d=0,c=-c):(d=(c>>4)+1,48>c&&(c&=15)),c&&(8>c||15=b.wsize?(u.arraySet(b.window,c,d-b.wsize,b.wsize,0),b.wnext=0,b.whave=b.wsize):(f=b.wsize-b.wnext,f>e&&(f=e),u.arraySet(b.window,c,d- -e,f,b.wnext),e-=f,e?(u.arraySet(b.window,c,d-e,e,0),b.wnext=e,b.whave=b.wsize):(b.wnext+=f,b.wnext===b.wsize&&(b.wnext=0),b.whaveB;){if(0===m)break a;m--;A+=f[g++]<>>8&255;d.check=s(d.check,Q,2,0);B=A=0;d.mode=2;break}if(d.flags=0,d.head&&(d.head.done=!1), +e,f,b.wnext),e-=f,e?(u.arraySet(b.window,c,d-e,e,0),b.wnext=e,b.whave=b.wsize):(b.wnext+=f,b.wnext===b.wsize&&(b.wnext=0),b.whaveB;){if(0===m)break a;m--;A+=f[g++]<>>8&255;d.check=s(d.check,Q,2,0);B=A=0;d.mode=2;break}if(d.flags=0,d.head&&(d.head.done=!1), !(1&d.wrap)||(((255&A)<<8)+(A>>8))%31){b.msg="incorrect header check";d.mode=30;break}if(8!==(15&A)){b.msg="unknown compression method";d.mode=30;break}if(A>>>=4,B-=4,P=(15&A)+8,0===d.wbits)d.wbits=P;else if(P>d.wbits){b.msg="invalid window size";d.mode=30;break}d.dmax=1<B;){if(0===m)break a;m--;A+=f[g++]<>8&1);512&d.flags&&(Q[0]=255&A,Q[1]=A>>>8&255,d.check=s(d.check,Q,2,0));B=A=0;d.mode=3;case 3:for(;32>B;){if(0===m)break a;m--;A+=f[g++]<>>8&255,Q[2]=A>>>16&255,Q[3]=A>>>24&255,d.check=s(d.check,Q,4,0));B=A=0;d.mode=4;case 4:for(;16>B;){if(0===m)break a;m--;A+=f[g++]<>8);512&d.flags&&(Q[0]=255&A,Q[1]=A>>>8&255,d.check=s(d.check,Q,2,0));B=A=0;d.mode= 5;case 5:if(1024&d.flags){for(;16>B;){if(0===m)break a;m--;A+=f[g++]<>>8&255,d.check=s(d.check,Q,2,0));B=A=0}else d.head&&(d.head.extra=null);d.mode=6;case 6:if(1024&d.flags&&(I=d.length,I>m&&(I=m),I&&(d.head&&(P=d.head.extra_len-d.length,d.head.extra||(d.head.extra=Array(d.head.extra_len)),u.arraySet(d.head.extra,f,g,I,P)),512&d.flags&&(d.check=s(d.check,f,I,g)),m-=I,g+=I,d.length-=I),d.length))break a;d.length=0;d.mode= 7;case 7:if(2048&d.flags){if(0===m)break a;I=0;do P=f[g+I++],d.head&&P&&65536>d.length&&(d.head.name+=String.fromCharCode(P));while(P&&Id.length&&(d.head.comment+=String.fromCharCode(P));while(P&&IB;){if(0===m)break a;m--;A+=f[g++]<>9&1,d.head.done=!0);b.adler=d.check=0;d.mode=12;break;case 10:for(;32>B;){if(0===m)break a;m--;A+=f[g++]<>>= -7&B;B-=7&B;d.mode=27;break}for(;3>B;){if(0===m)break a;m--;A+=f[g++]<>>=1,B-=1,3&A){case 0:d.mode=14;break;case 1:L=d;if(D){O=void 0;q=new u.Buf32(512);r=new u.Buf32(32);for(O=0;144>O;)L.lens[O++]=8;for(;256>O;)L.lens[O++]=9;for(;280>O;)L.lens[O++]=7;for(;288>O;)L.lens[O++]=8;v(1,L.lens,0,288,q,0,L.work,{bits:9});for(O=0;32>O;)L.lens[O++]=5;v(2,L.lens,0,32,r,0,L.work,{bits:5});D=!1}L.lencode=q;L.lenbits=9;L.distcode=r;L.distbits=5;if(d.mode=20,6===c){A>>>=2;B-=2;break a}break; -case 2:d.mode=17;break;case 3:b.msg="invalid block type",d.mode=30}A>>>=2;B-=2;break;case 14:A>>>=7&B;for(B-=7&B;32>B;){if(0===m)break a;m--;A+=f[g++]<>>16^65535)){b.msg="invalid stored block lengths";d.mode=30;break}if(d.length=65535&A,A=0,B=0,d.mode=15,6===c)break a;case 15:d.mode=16;case 16:if(I=d.length){if(I>m&&(I=m),I>E&&(I=E),0===I)break a;u.arraySet(k,f,g,I,l);m-=I;g+=I;E-=I;l+=I;d.length-=I;break}d.mode=12;break;case 17:for(;14>B;){if(0===m)break a;m--;A+=f[g++]<< +9;case 9:if(512&d.flags){for(;16>B;){if(0===m)break a;m--;A+=f[g++]<>9&1,d.head.done=!0);b.adler=d.check=0;d.mode=12;break;case 10:for(;32>B;){if(0===m)break a;m--;A+=f[g++]<>>= +7&B;B-=7&B;d.mode=27;break}for(;3>B;){if(0===m)break a;m--;A+=f[g++]<>>=1,B-=1,3&A){case 0:d.mode=14;break;case 1:L=d;if(E){O=void 0;p=new u.Buf32(512);r=new u.Buf32(32);for(O=0;144>O;)L.lens[O++]=8;for(;256>O;)L.lens[O++]=9;for(;280>O;)L.lens[O++]=7;for(;288>O;)L.lens[O++]=8;v(1,L.lens,0,288,p,0,L.work,{bits:9});for(O=0;32>O;)L.lens[O++]=5;v(2,L.lens,0,32,r,0,L.work,{bits:5});E=!1}L.lencode=p;L.lenbits=9;L.distcode=r;L.distbits=5;if(d.mode=20,6===c){A>>>=2;B-=2;break a}break; +case 2:d.mode=17;break;case 3:b.msg="invalid block type",d.mode=30}A>>>=2;B-=2;break;case 14:A>>>=7&B;for(B-=7&B;32>B;){if(0===m)break a;m--;A+=f[g++]<>>16^65535)){b.msg="invalid stored block lengths";d.mode=30;break}if(d.length=65535&A,A=0,B=0,d.mode=15,6===c)break a;case 15:d.mode=16;case 16:if(I=d.length){if(I>m&&(I=m),I>D&&(I=D),0===I)break a;u.arraySet(k,f,g,I,l);m-=I;g+=I;D-=I;l+=I;d.length-=I;break}d.mode=12;break;case 17:for(;14>B;){if(0===m)break a;m--;A+=f[g++]<< B;B+=8}if(d.nlen=(31&A)+257,A>>>=5,B-=5,d.ndist=(31&A)+1,A>>>=5,B-=5,d.ncode=(15&A)+4,A>>>=4,B-=4,286B;){if(0===m)break a;m--;A+=f[g++]<>>=3;B-=3}for(;19>d.have;)d.lens[ga[d.have++]]=0;if(d.lencode=d.lendyn,d.lenbits=7,aa={bits:d.lenbits},Z=v(0,d.lens,0,19,d.lencode,0,d.work,aa),d.lenbits=aa.bits,Z){b.msg="invalid code lengths set"; d.mode=30;break}d.have=0;d.mode=19;case 19:for(;d.have>>24,O=65535&U,!(J<=B);){if(0===m)break a;m--;A+=f[g++]<O)A>>>=J,B-=J,d.lens[d.have++]=O;else{if(16===O){for(L=J+2;B>>=J,B-=J,0===d.have){b.msg="invalid bit length repeat";d.mode=30;break}P=d.lens[d.have-1];I=3+(3&A);A>>>=2;B-=2}else if(17===O){for(L=J+3;B>>=J;B-=J;P=0;I=3+(7&A); A>>>=3;B-=3}else{for(L=J+7;B>>=J;B-=J;P=0;I=11+(127&A);A>>>=7;B-=7}if(d.have+I>d.nlen+d.ndist){b.msg="invalid bit length repeat";d.mode=30;break}for(;I--;)d.lens[d.have++]=P}}if(30===d.mode)break;if(0===d.lens[256]){b.msg="invalid code -- missing end-of-block";d.mode=30;break}if(d.lenbits=9,aa={bits:d.lenbits},Z=v(1,d.lens,0,d.nlen,d.lencode,0,d.work,aa),d.lenbits=aa.bits,Z){b.msg="invalid literal/lengths set";d.mode=30;break}if(d.distbits=6,d.distcode= -d.distdyn,aa={bits:d.distbits},Z=v(2,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,aa),d.distbits=aa.bits,Z){b.msg="invalid distances set";d.mode=30;break}if(d.mode=20,6===c)break a;case 20:d.mode=21;case 21:if(6<=m&&258<=E){b.next_out=l;b.avail_out=E;b.next_in=g;b.avail_in=m;d.hold=A;d.bits=B;t(b,M);l=b.next_out;k=b.output;E=b.avail_out;g=b.next_in;f=b.input;m=b.avail_in;A=d.hold;B=d.bits;12===d.mode&&(d.back=-1);break}for(d.back=0;U=d.lencode[A&(1<>>24,L=U>>>16&255,O=65535&U,!(J<= +d.distdyn,aa={bits:d.distbits},Z=v(2,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,aa),d.distbits=aa.bits,Z){b.msg="invalid distances set";d.mode=30;break}if(d.mode=20,6===c)break a;case 20:d.mode=21;case 21:if(6<=m&&258<=D){b.next_out=l;b.avail_out=D;b.next_in=g;b.avail_in=m;d.hold=A;d.bits=B;t(b,M);l=b.next_out;k=b.output;D=b.avail_out;g=b.next_in;f=b.input;m=b.avail_in;A=d.hold;B=d.bits;12===d.mode&&(d.back=-1);break}for(d.back=0;U=d.lencode[A&(1<>>24,L=U>>>16&255,O=65535&U,!(J<= B);){if(0===m)break a;m--;A+=f[g++]<>S)],J=U>>>24,L=U>>>16&255,O=65535&U,!(S+J<=B);){if(0===m)break a;m--;A+=f[g++]<>>=S;B-=S;d.back+=S}if(A>>>=J,B-=J,d.back+=J,d.length=O,0===L){d.mode=26;break}if(32&L){d.back=-1;d.mode=12;break}if(64&L){b.msg="invalid literal/length code";d.mode=30;break}d.extra=15&L;d.mode=22;case 22:if(d.extra){for(L=d.extra;B>>=d.extra;B-=d.extra;d.back+=d.extra}d.was=d.length;d.mode=23;case 23:for(;U=d.distcode[A&(1<>>24,L=U>>>16&255,O=65535&U,!(J<=B);){if(0===m)break a;m--;A+=f[g++]<>S)],J=U>>>24,L=U>>>16&255,O=65535&U,!(S+J<=B);){if(0===m)break a;m--;A+=f[g++]<>>=S;B-=S;d.back+=S}if(A>>>=J,B-=J,d.back+=J,64&L){b.msg="invalid distance code";d.mode=30;break}d.offset=O;d.extra=15&L;d.mode=24;case 24:if(d.extra){for(L= -d.extra;B>>=d.extra;B-=d.extra;d.back+=d.extra}if(d.offset>d.dmax){b.msg="invalid distance too far back";d.mode=30;break}d.mode=25;case 25:if(0===E)break a;if(I=M-E,d.offset>I){if(I=d.offset-I,I>d.whave&&d.sane){b.msg="invalid distance too far back";d.mode=30;break}I>d.wnext?(I-=d.wnext,Y=d.wsize-I):Y=d.wnext-I;I>d.length&&(I=d.length);L=d.window}else L=k,Y=l-d.offset,I=d.length;I>E&&(I=E);E-=I;d.length-=I;do k[l++]=L[Y++];while(--I); -0===d.length&&(d.mode=21);break;case 26:if(0===E)break a;k[l++]=d.length;E--;d.mode=21;break;case 27:if(d.wrap){for(;32>B;){if(0===m)break a;m--;A|=f[g++]<B;){if(0===m)break a;m--;A+=f[g++]<d.mode&&(27>d.mode||4!==c))&&n(b,b.output,b.next_out,M-b.avail_out)?(d.mode=31,-4):(T-=b.avail_in,M-=b.avail_out,b.total_in+=T,b.total_out+=M,d.total+=M,d.wrap&&M&&(b.adler=d.check=d.flags?s(d.check,k,M,b.next_out-M):p(d.check,k,M,b.next_out-M)),b.data_type=d.bits+(d.last?64:0)+(12===d.mode?128: -0)+(20===d.mode||15===d.mode?256:0),(0===T&&0===M||4===c)&&Z===x&&(Z=-5),Z)};d.inflateEnd=function(b){if(!b||!b.state)return z;var c=b.state;return c.window&&(c.window=null),b.state=null,x};d.inflateGetHeader=function(b,c){var d;return b&&b.state?(d=b.state,0===(2&d.wrap)?z:(d.head=c,c.done=!1,x)):z};d.inflateSetDictionary=function(b,c){var d,e,f=c.length;return b&&b.state?(d=b.state,0!==d.wrap&&11!==d.mode?z:11===d.mode&&(e=1,e=p(e,c,f,0),e!==d.check)?-3:n(b,c,f,f)?(d.mode=31,-4):(d.havedict=1,x)): +d.extra;B>>=d.extra;B-=d.extra;d.back+=d.extra}if(d.offset>d.dmax){b.msg="invalid distance too far back";d.mode=30;break}d.mode=25;case 25:if(0===D)break a;if(I=M-D,d.offset>I){if(I=d.offset-I,I>d.whave&&d.sane){b.msg="invalid distance too far back";d.mode=30;break}I>d.wnext?(I-=d.wnext,Y=d.wsize-I):Y=d.wnext-I;I>d.length&&(I=d.length);L=d.window}else L=k,Y=l-d.offset,I=d.length;I>D&&(I=D);D-=I;d.length-=I;do k[l++]=L[Y++];while(--I); +0===d.length&&(d.mode=21);break;case 26:if(0===D)break a;k[l++]=d.length;D--;d.mode=21;break;case 27:if(d.wrap){for(;32>B;){if(0===m)break a;m--;A|=f[g++]<B;){if(0===m)break a;m--;A+=f[g++]<d.mode&&(27>d.mode||4!==c))&&n(b,b.output,b.next_out,M-b.avail_out)?(d.mode=31,-4):(T-=b.avail_in,M-=b.avail_out,b.total_in+=T,b.total_out+=M,d.total+=M,d.wrap&&M&&(b.adler=d.check=d.flags?s(d.check,k,M,b.next_out-M):q(d.check,k,M,b.next_out-M)),b.data_type=d.bits+(d.last?64:0)+(12===d.mode?128: +0)+(20===d.mode||15===d.mode?256:0),(0===T&&0===M||4===c)&&Z===x&&(Z=-5),Z)};d.inflateEnd=function(b){if(!b||!b.state)return z;var c=b.state;return c.window&&(c.window=null),b.state=null,x};d.inflateGetHeader=function(b,c){var d;return b&&b.state?(d=b.state,0===(2&d.wrap)?z:(d.head=c,c.done=!1,x)):z};d.inflateSetDictionary=function(b,c){var d,e,f=c.length;return b&&b.state?(d=b.state,0!==d.wrap&&11!==d.mode?z:11===d.mode&&(e=1,e=q(e,c,f,0),e!==d.check)?-3:n(b,c,f,f)?(d.mode=31,-4):(d.havedict=1,x)): z};d.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(b,c,d){var e=b("../utils/common"),f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],k=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16, -16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];c.exports=function(b,c,d,r,u,p,s,t){var v,x,z,y,E,A,D,C;y=t.bits;for(var F=0,G=0,H=0,N=0,K=0,R=0,X=0,V=v=0,W=0,B=null,T=0,M=new e.Buf16(16),R=new e.Buf16(16),I=null,Y=0,F=0;15>=F;F++)M[F]=0;for(G=0;GN&&(K=N),0===N)return u[p++]=20971520,u[p++]=20971520,t.bits=1,0;for(H=1;H=F;F++)if(v<<=1,v-=M[F],0>v)return-1;if(0< -v&&(0===b||1!==N))return-1;R[1]=0;for(F=1;15>F;F++)R[F+1]=R[F]+M[F];for(G=0;GE?(D=I[Y+s[G]],C=B[T+s[G]]):(D=96,C=0);v=1<>X)+x]=A<<24|D<<16|C|0;while(0!==x);for(v=1<>=1;if(0!==v?(W&=v-1,W+=v):W=0,G++,0===--M[F]){if(F===N)break; -F=c[d+s[G]]}if(F>K&&(W&r)!==z){0===X&&(X=K);y+=H;R=F-X;for(v=1<=v));)R++,v<<=1;if(V+=1<=F;F++)M[F]=0;for(G=0;GN&&(K=N),0===N)return u[q++]=20971520,u[q++]=20971520,t.bits=1,0;for(H=1;H=F;F++)if(v<<=1,v-=M[F],0>v)return-1;if(0< +v&&(0===b||1!==N))return-1;R[1]=0;for(F=1;15>F;F++)R[F+1]=R[F]+M[F];for(G=0;GD?(E=I[Y+s[G]],C=B[T+s[G]]):(E=96,C=0);v=1<>X)+x]=A<<24|E<<16|C|0;while(0!==x);for(v=1<>=1;if(0!==v?(W&=v-1,W+=v):W=0,G++,0===--M[F]){if(F===N)break; +F=c[d+s[G]]}if(F>K&&(W&r)!==z){0===X&&(X=K);y+=H;R=F-X;for(v=1<=v));)R++,v<<=1;if(V+=1<>>8&255}function l(b,c,d){b.bi_valid>V-d?(b.bi_buf|=c<>V-b.bi_valid,b.bi_valid+=d-V):(b.bi_buf|=c<>>=1,d<<=1;while(0<--c);return d>>>1}function q(b,c,d){var e,f=Array(X+1),k=0;for(e=1;e<=X;e++)f[e]=k=k+d[e-1]<<1;for(d=0;d<=c;d++)e=b[2*d+1],0!==e&&(b[2*d]=n(f[e]++,e))}function r(b){var c;for(c=0;c>>=1,d<<=1;while(0<--c);return d>>>1}function p(b,c,d){var e,f=Array(X+1),k=0;for(e=1;e<=X;e++)f[e]=k=k+d[e-1]<<1;for(d=0;d<=c;d++)e=b[2*d+1],0!==e&&(b[2*d]=n(f[e]++,e))}function r(b){var c;for(c=0;ce?ca[e]:ca[256+(e>>>7)],m(b,k,d),g=Y[k],0!==g&&(e-=Z[k],l(b,e,g)));while(nb.heap_len;)f=b.heap[++b.heap_len]=2>m?++m:0,k[2*f]=1,b.depth[f]=0,b.opt_len--,g&&(b.static_len-=e[2*f+1]);c.max_code=m;for(d=b.heap_len>>1;1<=d;d--)s(b,k,d);f=l; -do d=b.heap[1],b.heap[1]=b.heap[b.heap_len--],s(b,k,1),e=b.heap[1],b.heap[--b.heap_max]=d,b.heap[--b.heap_max]=e,k[2*f]=k[2*d]+k[2*e],b.depth[f]=(b.depth[d]>=b.depth[e]?b.depth[d]:b.depth[e])+1,k[2*d+1]=k[2*e+1]=f,b.heap[1]=f++,s(b,k,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];var n,p,g=c.dyn_tree,l=c.max_code,r=c.stat_desc.static_tree,u=c.stat_desc.has_stree,B=c.stat_desc.extra_bits,t=c.stat_desc.extra_base,v=c.stat_desc.max_length,x=0;for(e=0;e<=X;e++)b.bl_count[e]=0;g[2*b.heap[b.heap_max]+ -1]=0;for(d=b.heap_max+1;dv&&(e=v,x++),g[2*f+1]=e,f>l||(b.bl_count[e]++,n=0,f>=t&&(n=B[f-t]),p=g[2*f],b.opt_len+=p*(e+n),u&&(b.static_len+=p*(r[2*f+1]+n)));if(0!==x){do{for(e=v-1;0===b.bl_count[e];)e--;b.bl_count[e]--;b.bl_count[e+1]+=2;b.bl_count[v]--;x-=2}while(0l||(g[2*n+1]!==e&&(b.opt_len+=(e-g[2*n+1])*g[2*n],g[2*n+1]=e),f--)}q(k,m,b.bl_count)}function x(b,c,d){var e,f,k=-1,g=c[1],l=0,m=7, -n=4;0===g&&(m=138,n=3);c[2*(d+1)+1]=65535;for(e=0;e<=d;e++)f=g,g=c[2*(e+1)+1],++l=l?b.bl_tree[2*T]++:b.bl_tree[2*M]++,l=0,k=f,0===g?(m=138,n=3):f===g?(m=6,n=3):(m=7,n=4))}function z(b,c,d){var e,f,k=-1,g=c[1],n=0,q=7,p=4;0===g&&(q=138,p=3);for(e=0;e<=d;e++)if(f=g,g=c[2*(e+1)+1],!(++n=n? -(m(b,T,b.bl_tree),l(b,n-3,3)):(m(b,M,b.bl_tree),l(b,n-11,7));n=0;k=f;0===g?(q=138,p=3):f===g?(q=6,p=3):(q=7,p=4)}}function y(b){var c,d=4093624447;for(c=0;31>=c;c++,d>>>=1)if(1&d&&0!==b.dyn_ltree[2*c])return D;if(0!==b.dyn_ltree[18]||0!==b.dyn_ltree[20]||0!==b.dyn_ltree[26])return C;for(c=32;c=b.depth[e]?b.depth[d]:b.depth[e])+1,k[2*d+1]=k[2*e+1]=f,b.heap[1]=f++,s(b,k,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];var n,r,g=c.dyn_tree,l=c.max_code,q=c.stat_desc.static_tree,u=c.stat_desc.has_stree,B=c.stat_desc.extra_bits,t=c.stat_desc.extra_base,v=c.stat_desc.max_length,x=0;for(e=0;e<=X;e++)b.bl_count[e]=0;g[2*b.heap[b.heap_max]+ +1]=0;for(d=b.heap_max+1;dv&&(e=v,x++),g[2*f+1]=e,f>l||(b.bl_count[e]++,n=0,f>=t&&(n=B[f-t]),r=g[2*f],b.opt_len+=r*(e+n),u&&(b.static_len+=r*(q[2*f+1]+n)));if(0!==x){do{for(e=v-1;0===b.bl_count[e];)e--;b.bl_count[e]--;b.bl_count[e+1]+=2;b.bl_count[v]--;x-=2}while(0l||(g[2*n+1]!==e&&(b.opt_len+=(e-g[2*n+1])*g[2*n],g[2*n+1]=e),f--)}p(k,m,b.bl_count)}function x(b,c,d){var e,f,k=-1,g=c[1],l=0,m=7, +n=4;0===g&&(m=138,n=3);c[2*(d+1)+1]=65535;for(e=0;e<=d;e++)f=g,g=c[2*(e+1)+1],++l=l?b.bl_tree[2*T]++:b.bl_tree[2*M]++,l=0,k=f,0===g?(m=138,n=3):f===g?(m=6,n=3):(m=7,n=4))}function z(b,c,d){var e,f,k=-1,g=c[1],n=0,p=7,r=4;0===g&&(p=138,r=3);for(e=0;e<=d;e++)if(f=g,g=c[2*(e+1)+1],!(++n=n? +(m(b,T,b.bl_tree),l(b,n-3,3)):(m(b,M,b.bl_tree),l(b,n-11,7));n=0;k=f;0===g?(p=138,r=3):f===g?(p=6,r=3):(p=7,r=4)}}function y(b){var c,d=4093624447;for(c=0;31>=c;c++,d>>>=1)if(1&d&&0!==b.dyn_ltree[2*c])return E;if(0!==b.dyn_ltree[18]||0!==b.dyn_ltree[20]||0!==b.dyn_ltree[26])return C;for(c=32;ce;e++){P[e]=d;for(c=0;c<1<e;e++){Z[e]=d;for(c=0;c<1<>=7;e=c;)O[2*c+1]=8,c++,k[8]++;for(;255>=c;)O[2*c+1]=9,c++,k[9]++;for(;279>=c;)O[2*c+1]=7,c++,k[7]++;for(;287>=c;)O[2*c+1]=8,c++,k[8]++;q(O,H+1,k);for(c=0;c>>3;k=b.static_len+3+7>>>3;k<=f&&(f=k)}else f=k=d+5;if(d+4<=f&&-1!==c)E(b,c,d, +d=0;28>e;e++){P[e]=d;for(c=0;c<1<e;e++){Z[e]=d;for(c=0;c<1<>=7;e=c;)O[2*c+1]=8,c++,k[8]++;for(;255>=c;)O[2*c+1]=9,c++,k[9]++;for(;279>=c;)O[2*c+1]=7,c++,k[7]++;for(;287>=c;)O[2*c+1]=8,c++,k[8]++;p(O,H+1,k);for(c=0;c>>3;k=b.static_len+3+7>>>3;k<=f&&(f=k)}else f=k=d+5;if(d+4<=f&&-1!==c)D(b,c,d, e);else if(4===b.strategy||k===f)l(b,2+(e?1:0),3),t(b,O,S);else{l(b,4+(e?1:0),3);c=b.l_desc.max_code+1;d=b.d_desc.max_code+1;g+=1;l(b,c-257,5);l(b,d-1,5);l(b,g-4,4);for(f=0;f>>8&255,b.pending_buf[b.d_buf+2*b.last_lit+1]=255&c,b.pending_buf[b.l_buf+b.last_lit]=255&d,b.last_lit++,0===c?b.dyn_ltree[2*d]++:(b.matches++, c--,b.dyn_ltree[2*(ba[d]+G+1)]++,b.dyn_dtree[2*(256>c?ca[c]:ca[256+(c>>>7)])]++),b.last_lit===b.lit_bufsize-1};d._tr_align=function(b){l(b,2,3);m(b,W,O);16===b.bi_valid?(k(b,b.bi_buf),b.bi_buf=0,b.bi_valid=0):8<=b.bi_valid&&(b.pending_buf[b.pending++]=255&b.bi_buf,b.bi_buf>>=8,b.bi_valid-=8)}},{"../utils/common":3}],15:[function(b,c,d){c.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state= null;this.data_type=2;this.adler=0}},{}],"/":[function(b,c,d){d=b("./lib/utils/common").assign;var e=b("./lib/deflate"),f=b("./lib/inflate");b=b("./lib/zlib/constants");var g={};d(g,e,f,b);c.exports=g},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"open";window.PROXY_URL=window.PROXY_URL||"proxy";window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img"; @@ -225,8 +225,8 @@ mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(a,b,c,d mxRectangle.prototype.add=function(a){if(null!=a){var b=Math.min(this.x,a.x),c=Math.min(this.y,a.y),d=Math.max(this.x+this.width,a.x+a.width);a=Math.max(this.y+this.height,a.y+a.height);this.x=b;this.y=c;this.width=d-b;this.height=a-c}};mxRectangle.prototype.intersect=function(a){if(null!=a){var b=this.x+this.width,c=a.x+a.width,d=this.y+this.height,e=a.y+a.height;this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.width=Math.min(b,c)-this.x;this.height=Math.min(d,e)-this.y}}; mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a};mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height}; mxRectangle.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)}; -var mxEffects={animateChanges:function(a,b,c){var d=0,e=function(){for(var g=!1,k=0;kd&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;ed&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;edocument.documentMode&&(a="ms");return function(b,c,d){b[c]=d;null!=a&&0mxUtils.indexOf(b,e)))d[e]=!c&&"object"==typeof a[e]?mxUtils.clone(a[e]):a[e]}return d},equalPoints:function(a,b){if(null== a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;ce&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=q*c;q*=d;c*=r;d*=r;for(var v=Math.cos(f),x=Math.sin(f),u=-m*(n*x+d*v),p=-m*(c*x-q*v),r=[],z=0;ze&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=r;d*=r;for(var v=Math.cos(f),x=Math.sin(f),u=-m*(n*x+d*v),q=-m*(c*x-p*v),r=[],z=0;zc&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|= mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST; @@ -480,15 +480,15 @@ mxXmlCanvas2D.prototype.image=function(a,b,c,d,e,f,g,k){e=this.converter.convert mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin"));this.lastY=this.lastX=0};mxXmlCanvas2D.prototype.moveTo=function(a,b){var c=this.createElement("move");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b}; mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b};mxXmlCanvas2D.prototype.quadTo=function(a,b,c,d){var e=this.createElement("quad");e.setAttribute("x1",this.format(a));e.setAttribute("y1",this.format(b));e.setAttribute("x2",this.format(c));e.setAttribute("y2",this.format(d));this.root.appendChild(e);this.lastX=c;this.lastY=d}; mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))}; -mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,q,r){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var u=this.createElement("text");u.setAttribute("x",this.format(a));u.setAttribute("y",this.format(b));u.setAttribute("w",this.format(c));u.setAttribute("h",this.format(d));u.setAttribute("str",e);null!=f&&u.setAttribute("align",f);null!=g&&u.setAttribute("valign",g);u.setAttribute("wrap",k?"1":"0");null==l&&(l="");u.setAttribute("format",l);null!=m&&u.setAttribute("overflow", -m);null!=n&&u.setAttribute("clip",n?"1":"0");null!=q&&u.setAttribute("rotation",q);null!=r&&u.setAttribute("dir",r);this.root.appendChild(u)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))}; +mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,r){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var u=this.createElement("text");u.setAttribute("x",this.format(a));u.setAttribute("y",this.format(b));u.setAttribute("w",this.format(c));u.setAttribute("h",this.format(d));u.setAttribute("str",e);null!=f&&u.setAttribute("align",f);null!=g&&u.setAttribute("valign",g);u.setAttribute("wrap",k?"1":"0");null==l&&(l="");u.setAttribute("format",l);null!=m&&u.setAttribute("overflow", +m);null!=n&&u.setAttribute("clip",n?"1":"0");null!=p&&u.setAttribute("rotation",p);null!=r&&u.setAttribute("dir",r);this.root.appendChild(u)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))}; function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.gradients=[];this.defs=null;this.styleEnabled=null!=b?b:!1;var c=null;if(a.ownerDocument!=document)for(c=a;null!=c&&"svg"!=c.nodeName;)c=c.parentNode;null!=c&&(0l.alpha||1>l.fillAlpha)&&m.setAttribute("opacity",l.alpha*l.fillAlpha);e=this.state.transform||"";if(g||k){var n=f=1,q=0,r=0;g&&(f=-1,q=-c-2*a);k&&(n=-1,r=-d-2*b);e+="scale("+f+","+n+")translate("+q*l.scale+","+r*l.scale+")"}0l.alpha||1>l.fillAlpha)&&m.setAttribute("opacity",l.alpha*l.fillAlpha);e=this.state.transform||"";if(g||k){var n=f=1,p=0,r=0;g&&(f=-1,p=-c-2*a);k&&(n=-1,r=-d-2*b);e+="scale("+f+","+n+")translate("+p*l.scale+","+r*l.scale+")"}0/g,"\x26gt;");a=b.value.replace(/&/g,"\x26amp;").replace(/&lt;/g, "\x26lt;").replace(/&gt;/g,"\x26gt;").replace(/&amp;/g,"\x26amp;").replace(/
/g,"\x3cbr /\x3e").replace(/
/g,"\x3chr /\x3e").replace(/(]+)>/gm,"$1 /\x3e")}return a}; @@ -518,27 +518,27 @@ mxSvgCanvas2D.prototype.createDiv=function(a,b,c,d,e){c=this.state;d="display:in mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d+="text-decoration:underline;");b==mxConstants.ALIGN_CENTER?d+="text-align:center;":b==mxConstants.ALIGN_RIGHT&&(d+="text-align:right;");b="";null!=c.fontBackgroundColor&&(b+="background-color:"+c.fontBackgroundColor+";");null!=c.fontBorderColor&&(b+="border:1px solid "+c.fontBorderColor+";");mxUtils.isNode(a)||(a=this.convertHtml(a),"fill"!=e&&"width"!=e?a='\x3cdiv xmlns\x3d"http://www.w3.org/1999/xhtml" style\x3d"display:inline-block;text-align:inherit;text-decoration:inherit;'+ b+'"\x3e'+a+"\x3c/div\x3e":d+=b);if(!mxClient.IS_IE&&document.createElementNS)return e=document.createElementNS("http://www.w3.org/1999/xhtml","div"),e.setAttribute("style",d),mxUtils.isNode(a)?this.root.ownerDocument!=document?e.appendChild(a.cloneNode(!0)):e.appendChild(a):e.innerHTML=a,e;mxUtils.isNode(a)&&this.root.ownerDocument!=document&&(a=a.outerHTML);return mxUtils.parseXml('\x3cdiv xmlns\x3d"http://www.w3.org/1999/xhtml" style\x3d"'+d+'"\x3e'+a+"\x3c/div\x3e").documentElement}; mxSvgCanvas2D.prototype.invalidateCachedOffsetSize=function(a){delete a.firstChild.mxCachedOffsetWidth;delete a.firstChild.mxCachedFinalOffsetWidth;delete a.firstChild.mxCachedFinalOffsetHeight}; -mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=n&&null!=n.firstChild&&null!=n.firstChild.firstChild&&null!=n.firstChild.firstChild.firstChild){n=n.firstChild;var q=n.firstChild,r=q.firstChild;m=null!=m?m:0;var u=this.state;a+=u.dx;b+=u.dy;l?(r.style.maxHeight=Math.round(d)+"px",r.style.maxWidth=Math.round(c)+"px"):"fill"==k?(r.style.width=Math.round(c+1)+"px",r.style.height=Math.round(d+1)+"px"):"width"==k&&(r.style.width=Math.round(c+1)+"px",0u.alpha&&s.setAttribute("opacity",u.alpha);var t=this.createElement("foreignObject");t.setAttribute("style","overflow:visible;");t.setAttribute("pointer-events","all");p=this.createDiv(e,f,g,p,m);if(null!=p){null!=r&&p.setAttribute("dir",r);s.appendChild(t);this.root.appendChild(s);var v=0,x=0;r=v=2;if(mxClient.IS_IE&&(9==document.documentMode||!mxClient.IS_SVG)){var z= -document.createElement("div");z.style.cssText=p.getAttribute("style");z.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";z.style.position="absolute";z.style.visibility="hidden";x=document.createElement("div");x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.style.wordWrap=mxConstants.WORD_WRAP;x.innerHTML=mxUtils.isNode(e)?e.outerHTML:e;z.appendChild(x);document.body.appendChild(z);8!=document.documentMode&&9!=document.documentMode&&null!=u.fontBorderColor&&(v+=2,r+=2);if(k&&0< -c){var y=x.offsetWidth;if(!n&&k&&0u.alpha&&s.setAttribute("opacity",u.alpha);r=p=0;f==mxConstants.ALIGN_CENTER?p-=c/2:f==mxConstants.ALIGN_RIGHT&&(p-=c);a+=p;g==mxConstants.ALIGN_MIDDLE? -r-=d/2:g==mxConstants.ALIGN_BOTTOM&&(r-=d);"fill"!=m&&mxClient.IS_FF&&mxClient.IS_WIN&&(r-=2);b+=r;z=1!=u.scale?"scale("+u.scale+")":"";0!=u.rotation&&this.rotateHtml?(z+="rotate("+u.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*u.scale,(b+d/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy),a=b.x-c*u.scale/2,b=b.y-d*u.scale/2):(a*=u.scale,b*=u.scale);0!=q&&(z+="rotate("+q+","+-p+","+-r+")");s.setAttribute("transform","translate("+(Math.round(a)+this.foOffset)+","+(Math.round(b)+this.foOffset)+ -")"+z);t.setAttribute("width",Math.round(Math.max(1,c)));t.setAttribute("height",Math.round(Math.max(1,d)));this.root.ownerDocument!=document&&(a=this.createAlternateContent(t,a,b,c,d,e,f,g,k,l,m,n,q),null!=a&&(t.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),c=this.createElement("switch"),c.appendChild(t),c.appendChild(a),s.appendChild(c)))}}else this.plainText(a,b,c,d,e,f,g,k,m,n,q,r)}}; +-l+")");n.setAttribute("transform","translate("+Math.round(a)+","+Math.round(b)+")"+e);p.setAttribute("width",Math.round(Math.max(1,c)));p.setAttribute("height",Math.round(Math.max(1,d)))}}; +mxSvgCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,r){if(this.textEnabled&&null!=e){p=null!=p?p:0;var u=this.state;a+=u.dx;b+=u.dy;if(this.foEnabled&&"html"==l){var q="vertical-align:top;";n?q+="overflow:hidden;max-height:"+Math.round(d)+"px;max-width:"+Math.round(c)+"px;":"fill"==m?q+="width:"+Math.round(c+1)+"px;height:"+Math.round(d+1)+"px;overflow:hidden;":"width"==m&&(q+="width:"+Math.round(c+1)+"px;",0u.alpha&&s.setAttribute("opacity",u.alpha);var t=this.createElement("foreignObject");t.setAttribute("style","overflow:visible;");t.setAttribute("pointer-events","all");q=this.createDiv(e,f,g,q,m);if(null!=q){null!=r&&q.setAttribute("dir",r);s.appendChild(t);this.root.appendChild(s);var v=0,x=0;r=v=2;if(mxClient.IS_IE&&(9==document.documentMode||!mxClient.IS_SVG)){var z= +document.createElement("div");z.style.cssText=q.getAttribute("style");z.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";z.style.position="absolute";z.style.visibility="hidden";x=document.createElement("div");x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.style.wordWrap=mxConstants.WORD_WRAP;x.innerHTML=mxUtils.isNode(e)?e.outerHTML:e;z.appendChild(x);document.body.appendChild(z);8!=document.documentMode&&9!=document.documentMode&&null!=u.fontBorderColor&&(v+=2,r+=2);if(k&&0< +c){var y=x.offsetWidth;if(!n&&k&&0u.alpha&&s.setAttribute("opacity",u.alpha);r=q=0;f==mxConstants.ALIGN_CENTER?q-=c/2:f==mxConstants.ALIGN_RIGHT&&(q-=c);a+=q;g==mxConstants.ALIGN_MIDDLE? +r-=d/2:g==mxConstants.ALIGN_BOTTOM&&(r-=d);"fill"!=m&&mxClient.IS_FF&&mxClient.IS_WIN&&(r-=2);b+=r;z=1!=u.scale?"scale("+u.scale+")":"";0!=u.rotation&&this.rotateHtml?(z+="rotate("+u.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*u.scale,(b+d/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy),a=b.x-c*u.scale/2,b=b.y-d*u.scale/2):(a*=u.scale,b*=u.scale);0!=p&&(z+="rotate("+p+","+-q+","+-r+")");s.setAttribute("transform","translate("+(Math.round(a)+this.foOffset)+","+(Math.round(b)+this.foOffset)+ +")"+z);t.setAttribute("width",Math.round(Math.max(1,c)));t.setAttribute("height",Math.round(Math.max(1,d)));this.root.ownerDocument!=document&&(a=this.createAlternateContent(t,a,b,c,d,e,f,g,k,l,m,n,p),null!=a&&(t.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),c=this.createElement("switch"),c.appendChild(t),c.appendChild(a),s.appendChild(c)))}}else this.plainText(a,b,c,d,e,f,g,k,m,n,p,r)}}; mxSvgCanvas2D.prototype.createClip=function(a,b,c,d){a=Math.round(a);b=Math.round(b);c=Math.round(c);d=Math.round(d);for(var e="mx-clip-"+a+"-"+b+"-"+c+"-"+d,f=0,g=e+"-"+f;null!=document.getElementById(g);)g=e+"-"+ ++f;clip=this.createElement("clipPath");clip.setAttribute("id",g);e=this.createElement("rect");e.setAttribute("x",a);e.setAttribute("y",b);e.setAttribute("width",c);e.setAttribute("height",d);clip.appendChild(e);return clip}; -mxSvgCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,q){n=null!=n?n:0;k=this.state;var r=k.fontSize,u=this.createElement("g"),p=k.transform||"";this.updateFont(u);0!=n&&(p+="rotate("+n+","+this.format(a*k.scale)+","+this.format(b*k.scale)+")");null!=q&&u.setAttribute("direction",q);m&&0k.alpha&&u.setAttribute("opacity",k.alpha);p=e.split("\n");q=Math.round(r*mxConstants.LINE_HEIGHT);var s=r+(p.length-1)*q;n=b+r-1;g==mxConstants.ALIGN_MIDDLE?"fill"==l?n-=d/2:(m=(this.matchHtmlAlignment&&m&&0k.alpha&&u.setAttribute("opacity",k.alpha);q=e.split("\n");p=Math.round(r*mxConstants.LINE_HEIGHT);var s=r+(q.length-1)*p;n=b+r-1;g==mxConstants.ALIGN_MIDDLE?"fill"==l?n-=d/2:(m=(this.matchHtmlAlignment&&m&&0v&&(v+=2*Math.PI);v%=Math.PI;v>Math.PI/2&&(v=Math.PI-v);g=Math.cos(v);var x=Math.sin(v);8==document.documentMode&&!mxClient.IS_EM&&(e.style.display="inline-block",f.style.display="inline-block",p.style.display="inline-block");e.style.visibility="hidden";e.style.position="absolute";document.body.appendChild(e);p=e;null!=p.firstChild&&"DIV"==p.firstChild.nodeName&&(p=p.firstChild);v=p.offsetWidth+3;p=p.offsetHeight;n?(c=Math.min(c,v), -p=Math.min(p,d)):c=v;k&&(e.style.width=c+"px");if(mxClient.IS_QUIRKS&&(n||"width"==m)&&p>d)p=d,e.style.height=p+"px";d=p;n=(d-d*g+c*-x)/2-r*c*(t+0.5)+q*d*(s+0.5);k=(c-c*g+d*-x)/2+q*c*(t+0.5)+r*d*(s+0.5);"group"==l.nodeName&&"DIV"==this.root.nodeName?(m=this.createElement("div"),m.style.display="inline-block",m.style.position="absolute",m.style.left=this.format(a+(k-c/2)*u.scale)+"px",m.style.top=this.format(b+(n-d/2)*u.scale)+"px",l.parentNode.appendChild(m),m.appendChild(l)):(u=8==document.documentMode&& -!mxClient.IS_EM?1:u.scale,l.style.left=this.format(a+(k-c/2)*u)+"px",l.style.top=this.format(b+(n-d/2)*u)+"px");f.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+q+", M12\x3d"+r+", M21\x3d"+-r+", M22\x3d"+q+", sizingMethod\x3d'auto expand')";f.style.backgroundColor=this.rotatedHtmlBackground;1>this.state.alpha&&(f.style.filter+="alpha(opacity\x3d"+100*this.state.alpha+")");f.appendChild(e);e.style.position="";e.style.visibility=""}else 8!=document.documentMode||mxClient.IS_EM?(e.style.verticalAlign= -"top",1>this.state.alpha&&(l.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),u=e.parentNode,e.style.visibility="hidden",document.body.appendChild(e),c=e.offsetWidth,p=e.offsetHeight,mxClient.IS_QUIRKS&&n&&p>d&&(p=d,e.style.height=p+"px"),d=p,e.style.visibility="",u.appendChild(e),l.style.left=this.format(a+c*t*this.state.scale)+"px",l.style.top=this.format(b+d*s*this.state.scale)+"px"):(1>this.state.alpha&&(e.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),p.style.left=100*t+ -"%",p.style.top=100*s+"%")}else this.plainText(a,b,c,d,mxUtils.htmlEntities(e,!1),f,g,k,l,m,n,q,r)}}; -mxVmlCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,q,r){k=this.state;a=(a+k.dx)*k.scale;b=(b+k.dy)*k.scale;c=this.createVmlElement("shape");c.style.width="1px";c.style.height="1px";c.stroked="false";d=this.createVmlElement("fill");d.color=k.fontColor;d.opacity=100*k.alpha+"%";c.appendChild(d);d=this.createVmlElement("path");d.textpathok="true";d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0);c.appendChild(d);d=this.createVmlElement("textpath");d.style.cssText= +mxVmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,r){if(this.textEnabled&&null!=e){var u=this.state;if("html"==l){null!=u.rotation&&(b=this.rotatePoint(a,b,u.rotation,u.rotationCx,u.rotationCy),a=b.x,b=b.y);8==document.documentMode&&!mxClient.IS_EM?(a+=u.dx,b+=u.dy,"fill"!=m&&g==mxConstants.ALIGN_TOP&&(b-=1)):(a*=u.scale,b*=u.scale);l=8==document.documentMode&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");l.style.position="absolute";l.style.display="inline"; +l.style.left=this.format(a)+"px";l.style.top=this.format(b)+"px";l.style.zoom=u.scale;var q=this.createElement("div");q.style.position="relative";q.style.display="inline";var s=mxUtils.getAlignmentAsPoint(f,g),t=s.x,s=s.y;e=this.createDiv(e,f,g,m);f=this.createElement("div");null!=r&&e.setAttribute("dir",r);if(k&&0v&&(v+=2*Math.PI);v%=Math.PI;v>Math.PI/2&&(v=Math.PI-v);g=Math.cos(v);var x=Math.sin(v);8==document.documentMode&&!mxClient.IS_EM&&(e.style.display="inline-block",f.style.display="inline-block",q.style.display="inline-block");e.style.visibility="hidden";e.style.position="absolute";document.body.appendChild(e);q=e;null!=q.firstChild&&"DIV"==q.firstChild.nodeName&&(q=q.firstChild);v=q.offsetWidth+3;q=q.offsetHeight;n?(c=Math.min(c,v), +q=Math.min(q,d)):c=v;k&&(e.style.width=c+"px");if(mxClient.IS_QUIRKS&&(n||"width"==m)&&q>d)q=d,e.style.height=q+"px";d=q;n=(d-d*g+c*-x)/2-r*c*(t+0.5)+p*d*(s+0.5);k=(c-c*g+d*-x)/2+p*c*(t+0.5)+r*d*(s+0.5);"group"==l.nodeName&&"DIV"==this.root.nodeName?(m=this.createElement("div"),m.style.display="inline-block",m.style.position="absolute",m.style.left=this.format(a+(k-c/2)*u.scale)+"px",m.style.top=this.format(b+(n-d/2)*u.scale)+"px",l.parentNode.appendChild(m),m.appendChild(l)):(u=8==document.documentMode&& +!mxClient.IS_EM?1:u.scale,l.style.left=this.format(a+(k-c/2)*u)+"px",l.style.top=this.format(b+(n-d/2)*u)+"px");f.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+p+", M12\x3d"+r+", M21\x3d"+-r+", M22\x3d"+p+", sizingMethod\x3d'auto expand')";f.style.backgroundColor=this.rotatedHtmlBackground;1>this.state.alpha&&(f.style.filter+="alpha(opacity\x3d"+100*this.state.alpha+")");f.appendChild(e);e.style.position="";e.style.visibility=""}else 8!=document.documentMode||mxClient.IS_EM?(e.style.verticalAlign= +"top",1>this.state.alpha&&(l.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),u=e.parentNode,e.style.visibility="hidden",document.body.appendChild(e),c=e.offsetWidth,q=e.offsetHeight,mxClient.IS_QUIRKS&&n&&q>d&&(q=d,e.style.height=q+"px"),d=q,e.style.visibility="",u.appendChild(e),l.style.left=this.format(a+c*t*this.state.scale)+"px",l.style.top=this.format(b+d*s*this.state.scale)+"px"):(1>this.state.alpha&&(e.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),q.style.left=100*t+ +"%",q.style.top=100*s+"%")}else this.plainText(a,b,c,d,mxUtils.htmlEntities(e,!1),f,g,k,l,m,n,p,r)}}; +mxVmlCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,p,r){k=this.state;a=(a+k.dx)*k.scale;b=(b+k.dy)*k.scale;c=this.createVmlElement("shape");c.style.width="1px";c.style.height="1px";c.stroked="false";d=this.createVmlElement("fill");d.color=k.fontColor;d.opacity=100*k.alpha+"%";c.appendChild(d);d=this.createVmlElement("path");d.textpathok="true";d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0);c.appendChild(d);d=this.createVmlElement("textpath");d.style.cssText= "v-text-align:"+f;d.style.align=f;d.style.fontFamily=k.fontFamily;d.string=e;d.on="true";f=k.fontSize*k.scale/this.vmlScale;d.style.fontSize=f+"px";(k.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold");(k.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic");(k.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline");e=e.split("\n");k=f+(e.length-1)*f*mxConstants.LINE_HEIGHT;f=e=0; -g==mxConstants.ALIGN_BOTTOM?f=-k/2:g!=mxConstants.ALIGN_MIDDLE&&(f=k/2);null!=q&&(c.style.rotation=q,g=q*(Math.PI/180),e=Math.sin(g)*f,f*=Math.cos(g));c.appendChild(d);c.style.left=this.format(a-e)+"px";c.style.top=this.format(b+f)+"px";this.root.appendChild(c)};mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)}; +g==mxConstants.ALIGN_BOTTOM?f=-k/2:g!=mxConstants.ALIGN_MIDDLE&&(f=k/2);null!=p&&(c.style.rotation=p,g=p*(Math.PI/180),e=Math.sin(g)*f,f*=Math.cos(g));c.appendChild(d);c.style.left=this.format(a-e)+"px";c.style.top=this.format(b+f)+"px";this.root.appendChild(c)};mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)}; function mxGuide(a,b){this.graph=a;this.setStates(b)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=!0;mxGuide.prototype.vertical=!0;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null;mxGuide.prototype.setStates=function(a){this.states=a};mxGuide.prototype.isEnabledForEvent=function(a){return!0};mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize/2}; mxGuide.prototype.createGuideShape=function(a){a=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);a.isDashed=!0;return a}; -mxGuide.prototype.move=function(a,b,c){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=b){var d=this.graph.getView().translate,e=this.graph.getView().scale,f=b.x,g=b.y,k=!1,l=null,m=null,n=!1,q=null,r=null,u=this.getGuideTolerance(),p=u,s=u,u=a.clone();u.x+=b.x;u.y+=b.y;var t=u.x,v=u.x+u.width,x=u.getCenterX(),z=u.y,y=u.y+u.height,E=u.getCenterY();b=function(b,c){b+=this.graph.panDx;var d=!1;Math.abs(b-x)m&&(m+=2*Math.PI);m%=Math.PI;m>Math.PI/2&&(m=Math.PI-m);var k=Math.cos(m),n=Math.sin(-m),b=l*-(b+0.5),q=g*-(c+0.5),r=(g-g*k+l*n)/2+f*b-e*q;0!=m&&(c="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+e+", M12\x3d"+f+", M21\x3d"+-f+", M22\x3d"+e+", sizingMethod\x3d'auto expand')",a.filter=null!=a.filter&&0m&&(m+=2*Math.PI);m%=Math.PI;m>Math.PI/2&&(m=Math.PI-m);var k=Math.cos(m),n=Math.sin(-m),b=l*-(b+0.5),p=g*-(c+0.5),r=(g-g*k+l*n)/2+f*b-e*p;0!=m&&(c="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+e+", M12\x3d"+f+", M21\x3d"+-f+", M22\x3d"+e+", sizingMethod\x3d'auto expand')",a.filter=null!=a.filter&&0b)break;k=c}f=e.getIndex(a);f=Math.max(0,g-(g>f?1:0));d.add(e,a,f)}}; mxStackLayout.prototype.getParentSize=function(a){var b=this.graph.getModel(),c=b.getGeometry(a);if(null!=this.graph.container&&(null==c&&b.isLayer(a)||a==this.graph.getView().currentRoot))c=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1);return c}; mxStackLayout.prototype.execute=function(a){if(null!=a){var b=this.getParentSize(a),c=this.isHorizontal(),d=this.graph.getModel(),e=null;null!=b&&(e=c?b.height-this.marginTop-this.marginBottom:b.width-this.marginLeft-this.marginRight);var e=e-(2*this.spacing+2*this.border),f=this.x0+this.border+this.marginLeft,g=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(a)){var k=this.graph.getCellStyle(a),l=mxUtils.getNumber(k,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),k=1==mxUtils.getValue(k, -mxConstants.STYLE_HORIZONTAL,!0);null!=b&&(l=k?Math.min(l,b.height):Math.min(l,b.width));c==k&&(e-=l);k?g+=l:f+=l}d.beginUpdate();try{for(var l=0,k=null,m=0,n=null,q=d.getChildCount(a),r=0;rthis.wrap||!c&&k.y+k.height+p.height+2*this.spacing>this.wrap))k=null,c?g+=l+this.spacing:f+=l+this.spacing,l= -0;var l=Math.max(l,c?p.height:p.width),s=0;if(!this.borderCollapse)var t=this.graph.getCellStyle(u),s=mxUtils.getNumber(t,mxConstants.STYLE_STROKEWIDTH,1);null!=k?c?p.x=m+this.spacing+Math.floor(s/2):p.y=m+this.spacing+Math.floor(s/2):this.keepFirstLocation||(c?p.x=f:p.y=g);c?p.y=g:p.x=f;this.fill&&null!=e&&(c?p.height=e:p.width=e);this.setChildGeometry(u,p);n=u;k=p;m=c?k.x+k.width+Math.floor(s/2):k.y+k.height+Math.floor(s/2)}}}this.resizeParent&&null!=b&&null!=k&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a, +mxConstants.STYLE_HORIZONTAL,!0);null!=b&&(l=k?Math.min(l,b.height):Math.min(l,b.width));c==k&&(e-=l);k?g+=l:f+=l}d.beginUpdate();try{for(var l=0,k=null,m=0,n=null,p=d.getChildCount(a),r=0;rthis.wrap||!c&&k.y+k.height+q.height+2*this.spacing>this.wrap))k=null,c?g+=l+this.spacing:f+=l+this.spacing,l= +0;var l=Math.max(l,c?q.height:q.width),s=0;if(!this.borderCollapse)var t=this.graph.getCellStyle(u),s=mxUtils.getNumber(t,mxConstants.STYLE_STROKEWIDTH,1);null!=k?c?q.x=m+this.spacing+Math.floor(s/2):q.y=m+this.spacing+Math.floor(s/2):this.keepFirstLocation||(c?q.x=f:q.y=g);c?q.y=g:q.x=f;this.fill&&null!=e&&(c?q.height=e:q.width=e);this.setChildGeometry(u,q);n=u;k=q;m=c?k.x+k.width+Math.floor(s/2):k.y+k.height+Math.floor(s/2)}}}this.resizeParent&&null!=b&&null!=k&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a, b,k):this.resizeLast&&null!=b&&(null!=k&&null!=n)&&(c?k.width=b.width-k.x-this.spacing-this.marginRight-this.marginLeft:k.height=b.height-k.y-this.spacing-this.marginBottom,this.setChildGeometry(n,k))}finally{d.endUpdate()}}};mxStackLayout.prototype.setChildGeometry=function(a,b){var c=this.graph.getCellGeometry(a);(null==c||b.x!=c.x||b.y!=c.y||b.width!=c.width||b.height!=c.height)&&this.graph.getModel().setGeometry(a,b)}; mxStackLayout.prototype.updateParentGeometry=function(a,b,c){var d=this.isHorizontal(),e=this.graph.getModel(),f=b.clone();d?(c=c.x+c.width+this.spacing+this.marginRight,f.width=this.resizeParentMax?Math.max(f.width,c):c):(c=c.y+c.height+this.spacing+this.marginBottom,f.height=this.resizeParentMax?Math.max(f.height,c):c);(b.x!=f.x||b.y!=f.y||b.width!=f.width||b.height!=f.height)&&e.setGeometry(a,f)}; function mxPartitionLayout(a,b,c,d){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=c||0;this.border=d||0}mxPartitionLayout.prototype=new mxGraphLayout;mxPartitionLayout.prototype.constructor=mxPartitionLayout;mxPartitionLayout.prototype.horizontal=null;mxPartitionLayout.prototype.spacing=null;mxPartitionLayout.prototype.border=null;mxPartitionLayout.prototype.resizeVertices=!0;mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal}; mxPartitionLayout.prototype.moveCell=function(a,b,c){c=this.graph.getModel();var d=c.getParent(a);if(null!=a&&null!=d){for(var e=0,f=0,g=c.getChildCount(d),e=0;eb)break;f=k}}b=d.getIndex(a);b=Math.max(0,e-(e>b?1:0));c.add(d,a,b)}}; mxPartitionLayout.prototype.execute=function(a){var b=this.isHorizontal(),c=this.graph.getModel(),d=c.getGeometry(a);if(null!=this.graph.container&&(null==d&&c.isLayer(a)||a==this.graph.getView().currentRoot))d=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1);if(null!=d){for(var e=[],f=c.getChildCount(a),g=0;gg+2*this.prefHozEdgeSep&&(f-=2*this.prefHozEdgeSep);a=f/d;b=a/2;f>g+2*this.prefHozEdgeSep&&(b+=this.prefHozEdgeSep);for(var f=this.minEdgeJetty-this.prefVertEdgeOff,g=0,k=this.getVertexBounds(c),l=0;ld/2&&(f-=this.prefVertEdgeOff);b+=a;g=Math.max(g,f)}}; +e[l].cell.cell,n=this.getVertexBounds(m),m=this.graph.getEdgesBetween(c,m,!1),p=[],r=0,u=0,q=0;qd/2&&(f-=this.prefVertEdgeOff);b+=a;g=Math.max(g,f)}}; function WeightedCellSorter(a,b){this.cell=a;this.weightedValue=b}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=!1;WeightedCellSorter.prototype.visited=!1;WeightedCellSorter.prototype.rankIndex=null;WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.weightedValue>a.weightedValue?1:b.weightedValuethis.forceConstant&&(this.forceConstant= -0.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;db&&(b=0.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}}; mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;amxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null;mxSwimlaneModel.prototype.vertexMapper=null;mxSwimlaneModel.prototype.edgeMapper=null;mxSwimlaneModel.prototype.ranks=null;mxSwimlaneModel.prototype.roots=null;mxSwimlaneModel.prototype.parent=null;mxSwimlaneModel.prototype.dfsCount=0; mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1E8;mxGraphHierarchyModel.prototype.tightenToSource=!1;mxSwimlaneModel.prototype.ranksPerGroup=null; mxSwimlaneModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=a.swimlanes,f=0;f=m.length){for(var l=new mxGraphHierarchyEdge(m),n=0;nmxUtils.indexOf(c[f].connectsAsSource,l)&&c[f].connectsAsSource.push(l)}}}c[f].temp[0]=0}}; +l=a.getEdgesBetween(b[f],l,!0);if(null!=m&&0=m.length){for(var l=new mxGraphHierarchyEdge(m),n=0;nmxUtils.indexOf(c[f].connectsAsSource,l)&&c[f].connectsAsSource.push(l)}}}c[f].temp[0]=0}}; mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var a=[],b={};if(null!=this.roots)for(var c=0;cb[d.swimlaneIndex]&&(k=b[d.swimlaneIndex]);d.temp[0]=k;if(null!=f)for(c=0;c>1,++e[l]}return c}; -mxMedianHybridCrossingReduction.prototype.transpose=function(a,b){for(var c=!0,d=0;c&&10>d++;)for(var e=1==a%2&&1==d%2,c=!1,f=0;fn&&(n=l);k[n]=m}for(var q=null,r=null,u=null,p=null,s=null,t=null,v=null,x=null,l=0;ls[A]&&y++,u[z]t[A]&&y++,p[z]d++;)for(var e=1==a%2&&1==d%2,c=!1,f=0;fn&&(n=l);k[n]=m}for(var p=null,r=null,u=null,q=null,s=null,t=null,v=null,x=null,l=0;ls[A]&&y++,u[z]t[A]&&y++,q[z]a.medianValue?-1:b.medianValuet+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,v),q=!0):(m=d[l][m+1],t=m.getGeneralPurposeVariable(l),t=t-m.width/2-this.intraCellSpacing-e.width/2,t>v?(e.setGeneralPurposeVariable(l, -v),q=!0):t>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,t),q=!0)));if(q){for(e=0;et+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,v),p=!0):(m=d[l][m+1],t=m.getGeneralPurposeVariable(l),t=t-m.width/2-this.intraCellSpacing-e.width/2,t>v?(e.setGeneralPurposeVariable(l, +v),p=!0):t>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,t),p=!0)));if(p){for(e=0;e=k&&l<=r?g.setGeneralPurposeVariable(a,l):lr&&(g.setGeneralPurposeVariable(a,r),this.currentXDelta+=l-r);d[f].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,b){for(var c=0,d=0;dthis.widestRankValue&&(this.widestRankValue=k,this.widestRank=e);this.rankWidths[e]=k}!0==l&&mxLog.warn("At least one cell has no bounds");this.rankY[e]=c;k=f/2+d/2+this.interRankCellSpacing;d=f;c=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?c+k:c- +mxCoordinateAssignment.prototype.calculateWidestRank=function(a,b){var c=-this.interRankCellSpacing,d=0;this.rankWidths=[];this.rankY=[];for(var e=b.maxRank;0<=e;e--){for(var f=0,g=b.ranks[e],k=this.initialX,l=!1,m=0;mthis.widestRankValue&&(this.widestRankValue=k,this.widestRank=e);this.rankWidths[e]=k}!0==l&&mxLog.warn("At least one cell has no bounds");this.rankY[e]=c;k=f/2+d/2+this.interRankCellSpacing;d=f;c=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?c+k:c- k;for(m=0;me.maxRank-e.minRank-1)){for(var f=e.getGeneralPurposeVariable(e.minRank+1),g=!0,k=0,l=e.minRank+2;le.minRank+1;l--)r=e.getX(l-1),q==r?(n[l-e.minRank-2]=q,g++):this.repositionValid(b,e,l-1,q)?(n[l-e.minRank-2]=q,g++):(n[l-e.minRank-2]=e.getX(l-1),q=r);if(g>k||f>k)if(g>=f)for(l=e.maxRank-2;l>e.minRank;l--)e.setX(l,n[l-e.minRank-1]);else if(f>g)for(l=e.minRank+2;le.maxRank-e.minRank-1)){for(var f=e.getGeneralPurposeVariable(e.minRank+1),g=!0,k=0,l=e.minRank+2;le.minRank+1;l--)r=e.getX(l-1),p==r?(n[l-e.minRank-2]=p,g++):this.repositionValid(b,e,l-1,p)?(n[l-e.minRank-2]=p,g++):(n[l-e.minRank-2]=e.getX(l-1),p=r);if(g>k||f>k)if(g>=f)for(l=e.maxRank-2;l>e.minRank;l--)e.setX(l,n[l-e.minRank-1]);else if(f>g)for(l=e.minRank+2;le)return!1;f=b.getGeneralPurposeVariable(c);if(df){if(e==a.length-1)return!0;a=a[e+1];c=a.getGeneralPurposeVariable(c);c=c-a.width/2-this.intraCellSpacing-b.width/2;if(!(c>=d))return!1}return!0}; mxCoordinateAssignment.prototype.setCellLocations=function(a,b){this.rankTopY=[];this.rankBottomY=[];for(var c=0;ck;k++){if(-1(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep,q-=this.prefHozEdgeSep);l=(q-n)/f;n+=l/2;q=this.minEdgeJetty-this.prefVertEdgeOff;for(m=r=0;mf/2&&(q-=this.prefVertEdgeOff);for(s=0;sk;k++){if(-1(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);l=(p-n)/f;n+=l/2;p=this.minEdgeJetty-this.prefVertEdgeOff;for(m=r=0;mf/2&&(p-=this.prefVertEdgeOff);for(s=0;sa.weightedValue?-1:b.weightedValuef&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; +mxHierarchicalLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var k=b[g];if(d.isVertex(k)&&this.graph.isCellVisible(k)){for(var l=this.getEdges(k),m=0,n=0,p=0;pf&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; mxHierarchicalLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;for(var c=this.graph.model,b=[],d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;ff&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; +mxSwimlaneLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var k=b[g];if(null!=k&&d.isVertex(k)&&this.graph.isCellVisible(k)&&d.isAncestor(a,k)){for(var l=this.getEdges(k),m=0,n=0,p=0;pf&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; mxSwimlaneLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;for(var c=this.graph.model,b=[],d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f=this.swimlanes.length)&&(r>k||(!b||q)&&r==k))e= +mxSwimlaneLayout.prototype.traverse=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=d){var l=mxObjectIdentity.get(a);if(null==d[l]&&(null==g||null!=g[l])){null==e[l]&&(e[l]=a);null==d[l]&&(d[l]=a);null!==g&&delete g[l];var m=this.getEdges(a),l=this.graph.model;for(c=0;c=this.swimlanes.length)&&(r>k||(!b||p)&&r==k))e= this.traverse(n,b,m[c],d,e,f,g,r)}}else if(null==e[l])for(c=0;cb[e]?1:-1:(c=parseInt(a[e]),e=parseInt(b[e]),d=c==e?0:c>e?1:-1);break}0==d&&(c=a.length,e=b.length,c!=e&&(d=c>e?1:-1));return d}},mxPerimeter={RectanglePerimeter:function(a,b,c,d){b=a.getCenterX();var e=a.getCenterY(),f=Math.atan2(c.y-e,c.x-b),g=new mxPoint(0,0),k=Math.PI,l=Math.PI/2-f,m=Math.atan2(a.height,a.width);f<-k+m||f>k-m?(g.x=a.x,g.y=e-a.width* -Math.tan(f)/2):f<-m?(g.y=a.y,g.x=b-a.height*Math.tan(l)/2):f=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.xa.x+a.width&&(g.x=a.x+a.width),c.ya.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,k=a.height/2,l=e+g,m=f+k;b=c.x;c=c.y;var n=parseInt(b-l),q=parseInt(c-m);if(0==n&&0!=q)return new mxPoint(l, -m+k*q/Math.abs(q));if(0==n&&0==q)return new mxPoint(b,c);if(d){if(c>=f&&c<=f+a.height)return a=c-m,a=Math.sqrt(g*g*(1-a*a/(k*k)))||0,b<=e&&(a=-a),new mxPoint(l+a,c);if(b>=e&&b<=e+a.width)return a=b-l,a=Math.sqrt(k*k*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(b,m+a)}e=q/n;m-=e*l;f=g*g*e*e+k*k;a=-2*l*f;k=Math.sqrt(a*a-4*f*(g*g*e*e*l*l+k*k*l*l-g*g*k*k));g=(-a+k)/(2*f);k=(-a-k)/(2*f);l=e*g+m;m=e*k+m;e=Math.sqrt(Math.pow(g-b,2)+Math.pow(l-c,2));b=Math.sqrt(Math.pow(k-b,2)+Math.pow(m-c,2));f=c=0;e=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.xa.x+a.width&&(g.x=a.x+a.width),c.ya.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,k=a.height/2,l=e+g,m=f+k;b=c.x;c=c.y;var n=parseInt(b-l),p=parseInt(c-m);if(0==n&&0!=p)return new mxPoint(l, +m+k*p/Math.abs(p));if(0==n&&0==p)return new mxPoint(b,c);if(d){if(c>=f&&c<=f+a.height)return a=c-m,a=Math.sqrt(g*g*(1-a*a/(k*k)))||0,b<=e&&(a=-a),new mxPoint(l+a,c);if(b>=e&&b<=e+a.width)return a=b-l,a=Math.sqrt(k*k*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(b,m+a)}e=p/n;m-=e*l;f=g*g*e*e+k*k;a=-2*l*f;k=Math.sqrt(a*a-4*f*(g*g*e*e*l*l+k*k*l*l-g*g*k*k));g=(-a+k)/(2*f);k=(-a-k)/(2*f);l=e*g+m;m=e*k+m;e=Math.sqrt(Math.pow(g-b,2)+Math.pow(l-c,2));b=Math.sqrt(Math.pow(k-b,2)+Math.pow(m-c,2));f=c=0;ec?new mxPoint(g,e):new mxPoint(g,e+a);if(k==c)return g>l?new mxPoint(b,k):new mxPoint(b+f,k);var m=g,n=k;d&&(l>=b&&l<=b+f?m=l:c>=e&&c<=e+a&&(n=c));return l-s&&uMath.PI-s,s=null;p?s=d&&(e&&c.x>=n.x&&c.x<=r.x||!e&&c.y>=n.y&&c.y<=r.y)?e?new mxPoint(c.x,n.y):new mxPoint(n.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+k/2+a*Math.tan(u)/2,g+a):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+k/2-a*Math.tan(u)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+k,g+a/2+k*Math.tan(u)/2):new mxPoint(f, -g+a/2-k*Math.tan(u)/2):(d&&(d=new mxPoint(l,m),c.y>=g&&c.y<=g+a?(d.x=e?l:b==mxConstants.DIRECTION_WEST?f+k:f,d.y=c.y):c.x>=f&&c.x<=f+k&&(d.x=c.x,d.y=!e?m:b==mxConstants.DIRECTION_NORTH?g+a:g),l=d.x,m=d.y),s=e&&c.x<=f+k/2||!e&&c.y<=g+a/2?mxUtils.intersection(c.x,c.y,l,m,n.x,n.y,q.x,q.y):mxUtils.intersection(c.x,c.y,l,m,q.x,q.y,r.x,r.y));null==s&&(s=new mxPoint(l,m));return s},HexagonPerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,k=a.height,l=a.getCenterX();a=a.getCenterY();var m=c.x,n=c.y,q= --Math.atan2(n-a,m-l),r=Math.PI,u=Math.PI/2,p=new mxPoint(l,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var s=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=new mxPoint;p=new mxPoint;if(mf+k||m>e+g&&ne+g&&n>f+k)d=!1;if(d){if(s){if(m==l){if(n<=f)return new mxPoint(l,f);if(n>=f+k)return new mxPoint(l,f+k)}else if(me+g){if(n==f+k/4)return new mxPoint(e+g,f+k/4);if(n==f+3*k/4)return new mxPoint(e+g,f+3*k/4)}else if(m==e){if(na)return new mxPoint(e,f+3*k/4)}else if(m==e+g){if(na)return new mxPoint(e+g,f+3*k/4)}if(n==f)return new mxPoint(l,f);if(n==f+k)return new mxPoint(l,f+k);mf+k/4&&nf+3*k/4&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),p=new mxPoint(e+g,f+Math.floor(1.25*k))):m>l&&(n>f+k/4&&nf+3*k/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),p=new mxPoint(e,f+Math.floor(1.25*k))))}else{if(n==a){if(m<=e)return new mxPoint(e,f+k/2);if(m>=e+g)return new mxPoint(e+g,f+k/ -2)}else if(nf+k){if(m==e+g/4)return new mxPoint(e+g/4,f+k);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f+k)}else if(n==f){if(ml)return new mxPoint(e+3*g/4,f)}else if(n==f+k){if(ma)return new mxPoint(e+3*g/4,f+k)}if(m==e)return new mxPoint(e,a);if(m==e+g)return new mxPoint(e+g,a);ne+g/4&&me+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*k)),p=new mxPoint(e+Math.floor(1.25*g),f+k)):n>a&&(m>e+g/4&&me+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),p=new mxPoint(e+Math.floor(1.25*g),f)))}d= -l;q=a;m>=e&&m<=e+g?(d=m,q=n=f&&n<=f+k&&(q=n,d=m-m?(b=new mxPoint(e+g,f), -p=new mxPoint(e+g,f+k)):q>m&&qu&&qr-m&&q<=r||q<-r+m&&q>=-r?(b=new mxPoint(e,f),p=new mxPoint(e,f+k)):q<-m&&q>-u?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),p=new mxPoint(e,f+Math.floor(1.25*k))):q<-u&&q>-r+m&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),p=new mxPoint(e+g,f+ -Math.floor(1.25*k)))}else{m=Math.atan2(k/2,g/4);if(q==m)return new mxPoint(e+Math.floor(0.75*g),f);if(q==r-m)return new mxPoint(e+Math.floor(0.25*g),f);if(q==r||q==-r)return new mxPoint(e,f+Math.floor(0.5*k));if(0==q)return new mxPoint(e+g,f+Math.floor(0.5*k));if(q==-m)return new mxPoint(e+Math.floor(0.75*g),f+k);if(q==-r+m)return new mxPoint(e+Math.floor(0.25*g),f+k);0m&&qr-m&&qq&&q>-m?(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),p=new mxPoint(e+Math.floor(1.25*g),f)):q<-m&&q>-r+m?(b=new mxPoint(e,f+k),p=new mxPoint(e+g,f+k)):q<-r+m&&q>-r&&(b=new mxPoint(e-Math.floor(0.25*g),f),p=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)))}p=mxUtils.intersection(l,a,c.x,c.y,b.x,b.y,p.x,p.y)}return null==p?new mxPoint(l,a):p}}; +b,c,d){b=null!=b?b.style[mxConstants.STYLE_DIRECTION]:null;var e=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH,f=a.x,g=a.y,k=a.width;a=a.height;var l=f+k/2,m=g+a/2,n=new mxPoint(f,g),p=new mxPoint(f+k,m),r=new mxPoint(f,g+a);b==mxConstants.DIRECTION_NORTH?(n=r,p=new mxPoint(l,g),r=new mxPoint(f+k,g+a)):b==mxConstants.DIRECTION_SOUTH?(p=new mxPoint(l,g+a),r=new mxPoint(f+k,g)):b==mxConstants.DIRECTION_WEST&&(n=new mxPoint(f+k,g),p=new mxPoint(f,m),r=new mxPoint(f+k,g+a));var u=c.x- +l,q=c.y-m,u=e?Math.atan2(u,q):Math.atan2(q,u),s=e?Math.atan2(k,a):Math.atan2(a,k),q=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?u>-s&&uMath.PI-s,s=null;q?s=d&&(e&&c.x>=n.x&&c.x<=r.x||!e&&c.y>=n.y&&c.y<=r.y)?e?new mxPoint(c.x,n.y):new mxPoint(n.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+k/2+a*Math.tan(u)/2,g+a):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+k/2-a*Math.tan(u)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+k,g+a/2+k*Math.tan(u)/2):new mxPoint(f, +g+a/2-k*Math.tan(u)/2):(d&&(d=new mxPoint(l,m),c.y>=g&&c.y<=g+a?(d.x=e?l:b==mxConstants.DIRECTION_WEST?f+k:f,d.y=c.y):c.x>=f&&c.x<=f+k&&(d.x=c.x,d.y=!e?m:b==mxConstants.DIRECTION_NORTH?g+a:g),l=d.x,m=d.y),s=e&&c.x<=f+k/2||!e&&c.y<=g+a/2?mxUtils.intersection(c.x,c.y,l,m,n.x,n.y,p.x,p.y):mxUtils.intersection(c.x,c.y,l,m,p.x,p.y,r.x,r.y));null==s&&(s=new mxPoint(l,m));return s},HexagonPerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,k=a.height,l=a.getCenterX();a=a.getCenterY();var m=c.x,n=c.y,p= +-Math.atan2(n-a,m-l),r=Math.PI,u=Math.PI/2,q=new mxPoint(l,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var s=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=new mxPoint;q=new mxPoint;if(mf+k||m>e+g&&ne+g&&n>f+k)d=!1;if(d){if(s){if(m==l){if(n<=f)return new mxPoint(l,f);if(n>=f+k)return new mxPoint(l,f+k)}else if(me+g){if(n==f+k/4)return new mxPoint(e+g,f+k/4);if(n==f+3*k/4)return new mxPoint(e+g,f+3*k/4)}else if(m==e){if(na)return new mxPoint(e,f+3*k/4)}else if(m==e+g){if(na)return new mxPoint(e+g,f+3*k/4)}if(n==f)return new mxPoint(l,f);if(n==f+k)return new mxPoint(l,f+k);mf+k/4&&nf+3*k/4&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),q=new mxPoint(e+g,f+Math.floor(1.25*k))):m>l&&(n>f+k/4&&nf+3*k/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),q=new mxPoint(e,f+Math.floor(1.25*k))))}else{if(n==a){if(m<=e)return new mxPoint(e,f+k/2);if(m>=e+g)return new mxPoint(e+g,f+k/ +2)}else if(nf+k){if(m==e+g/4)return new mxPoint(e+g/4,f+k);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f+k)}else if(n==f){if(ml)return new mxPoint(e+3*g/4,f)}else if(n==f+k){if(ma)return new mxPoint(e+3*g/4,f+k)}if(m==e)return new mxPoint(e,a);if(m==e+g)return new mxPoint(e+g,a);ne+g/4&&me+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*k)),q=new mxPoint(e+Math.floor(1.25*g),f+k)):n>a&&(m>e+g/4&&me+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),q=new mxPoint(e+Math.floor(1.25*g),f)))}d= +l;p=a;m>=e&&m<=e+g?(d=m,p=n=f&&n<=f+k&&(p=n,d=m-m?(b=new mxPoint(e+g,f), +q=new mxPoint(e+g,f+k)):p>m&&pu&&pr-m&&p<=r||p<-r+m&&p>=-r?(b=new mxPoint(e,f),q=new mxPoint(e,f+k)):p<-m&&p>-u?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),q=new mxPoint(e,f+Math.floor(1.25*k))):p<-u&&p>-r+m&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),q=new mxPoint(e+g,f+ +Math.floor(1.25*k)))}else{m=Math.atan2(k/2,g/4);if(p==m)return new mxPoint(e+Math.floor(0.75*g),f);if(p==r-m)return new mxPoint(e+Math.floor(0.25*g),f);if(p==r||p==-r)return new mxPoint(e,f+Math.floor(0.5*k));if(0==p)return new mxPoint(e+g,f+Math.floor(0.5*k));if(p==-m)return new mxPoint(e+Math.floor(0.75*g),f+k);if(p==-r+m)return new mxPoint(e+Math.floor(0.25*g),f+k);0m&&pr-m&&pp&&p>-m?(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),q=new mxPoint(e+Math.floor(1.25*g),f)):p<-m&&p>-r+m?(b=new mxPoint(e,f+k),q=new mxPoint(e+g,f+k)):p<-r+m&&p>-r&&(b=new mxPoint(e-Math.floor(0.25*g),f),q=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)))}q=mxUtils.intersection(l,a,c.x,c.y,b.x,b.y,q.x,q.y)}return null==q?new mxPoint(l,a):q}}; function mxPrintPreview(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=mxRectangle.fromRectangle(null!=c?c:a.pageFormat);this.title=null!=k?k:"Printer-friendly version";this.x0=null!=e?e:0;this.y0=null!=f?f:0;this.borderColor=g;this.pageSelector=null!=l?l:!0}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0; mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=!0;mxPrintPreview.prototype.printOverlays=!1;mxPrintPreview.prototype.printControls=!1;mxPrintPreview.prototype.printBackgroundImage=!1;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null;mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null; mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=!0;mxPrintPreview.prototype.getWindow=function(){return this.wnd}; mxPrintPreview.prototype.getDoctype=function(){var a="";5==document.documentMode?a='\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3d5"\x3e':8==document.documentMode?a='\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3d8"\x3e':8n,k=f.xm;else l=Math.max(b.x,c.x),m=Math.min(b.x+b.width b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(a=Math.max(b.x,c.x),k=Math.min(b.x+b.width,c.x+c.width),a=null!=d?d.x:Math.round(k+(a-k)/2),k=f.getRoutingCenterY(b),f=f.getRoutingCenterY(c),null!=d&&(d.y>=b.y&&d.y<=b.y+b.height&&(k=d.y),d.y>=c.y&&d.y<=c.y+c.height&&(f=d.y)),!mxUtils.contains(c,a,k)&&!mxUtils.contains(b,a,k)&&e.push(new mxPoint(a,k)),!mxUtils.contains(c,a,f)&&!mxUtils.contains(b,a,f)&&e.push(new mxPoint(a,f)),1==e.length&&(null!=d?!mxUtils.contains(c, a,d.y)&&!mxUtils.contains(b,a,d.y)&&e.push(new mxPoint(a,d.y)):(f=Math.max(b.y,c.y),b=Math.min(b.y+b.height,c.y+c.height),e.push(new mxPoint(a,f+(b-f)/2)))))},TopToBottom:function(a,b,c,d,e){var f=a.view;d=null!=d&&0=b.x&&d.x<=b.x+b.width&&(a=d.x),k=null!=d?d.y:Math.round(g+(k-g)/2),!mxUtils.contains(c,a,k)&&!mxUtils.contains(b,a,k)&&e.push(new mxPoint(a,k)),a=null!=d&&d.x>=c.x&&d.x<=c.x+c.width?d.x:f.getRoutingCenterX(c),!mxUtils.contains(c,a,k)&&!mxUtils.contains(b,a,k)&&e.push(new mxPoint(a,k)),1==e.length&&(null!=d&&1==e.length?!mxUtils.contains(c,d.x,k)&&!mxUtils.contains(b,d.x,k)&&e.push(new mxPoint(d.x,k)):(f=Math.max(b.x,c.x),b=Math.min(b.x+b.width,c.x+c.width),e.push(new mxPoint(f+(b-f)/ -2,k)))))},SegmentConnector:function(a,b,c,d,e){function f(a){if(null==l||Math.abs(l.x-a.x)>=k||Math.abs(l.y-a.y)>=k)e.push(a),l=a;return l}var g=a.absolutePoints,k=Math.max(1,a.view.scale),l=0u;u++){var z=null!=t&&t.x==v.x,y=null!=t&&t.y==v.y,E=null!=s&&v.y>=s.y&& -v.y<=s.y+s.height,s=null!=s&&v.x>=s.x&&v.x<=s.x+s.width,v=y||null==t&&E,x=z||null==t&&s;if(!(0==u&&(v&&x||z&&y))){if(null!=t&&!y&&!z&&(E||s)){m=E?!1:!0;break}if(x||v){m=v;1==u&&(m=0==d.length%2?v:x);break}}s=c;t=g[r];null!=t&&(t.x=Math.round(t.x),t.y=Math.round(t.y),s=null);v=d[d.length-1];z&&y&&(d=d.slice(1))}m&&(null!=g[0]&&g[0].y!=n.y||null==g[0]&&null!=b&&(n.yb.y+b.height))?f(new mxPoint(q.x,n.y)):!m&&(null!=g[0]&&g[0].x!=n.x||null==g[0]&&null!=b&&(n.xb.x+b.width))&&f(new mxPoint(n.x, -q.y));m?q.y=n.y:q.x=n.x;for(u=0;uc.y+c.height))?f(new mxPoint(q.x,n.y)):!m&&(null!=g[r]&&g[r].x!=n.x||null==g[r]&&null!=c&&(n.xc.x+c.width))&&f(new mxPoint(n.x,q.y))));if(null==g[0]&&null!=b)for(;1< -e.length&&null!=e[1]&&mxUtils.contains(b,e[1].x,e[1].y);)e.splice(1,1);if(null==g[r]&&null!=c)for(;1=k||Math.abs(l.y-a.y)>=k)e.push(a),l=a;return l}var g=a.absolutePoints,k=Math.max(1,a.view.scale),l=0u;u++){var z=null!=t&&t.x==v.x,y=null!=t&&t.y==v.y,D=null!=s&&v.y>=s.y&& +v.y<=s.y+s.height,s=null!=s&&v.x>=s.x&&v.x<=s.x+s.width,v=y||null==t&&D,x=z||null==t&&s;if(!(0==u&&(v&&x||z&&y))){if(null!=t&&!y&&!z&&(D||s)){m=D?!1:!0;break}if(x||v){m=v;1==u&&(m=0==d.length%2?v:x);break}}s=c;t=g[r];null!=t&&(t.x=Math.round(t.x),t.y=Math.round(t.y),s=null);v=d[d.length-1];z&&y&&(d=d.slice(1))}m&&(null!=g[0]&&g[0].y!=n.y||null==g[0]&&null!=b&&(n.yb.y+b.height))?f(new mxPoint(p.x,n.y)):!m&&(null!=g[0]&&g[0].x!=n.x||null==g[0]&&null!=b&&(n.xb.x+b.width))&&f(new mxPoint(n.x, +p.y));m?p.y=n.y:p.x=n.x;for(u=0;uc.y+c.height))?f(new mxPoint(p.x,n.y)):!m&&(null!=g[r]&&g[r].x!=n.x||null==g[r]&&null!=c&&(n.xc.x+c.width))&&f(new mxPoint(n.x,p.y))));if(null==g[0]&&null!=b)for(;1< +e.length&&null!=e[1]&&mxUtils.contains(b,e[1].x,e[1].y);)e.splice(1,1);if(null==g[r]&&null!=c)for(;1 -y;y++)mxEdgeStyle.limits[y][1]=n[y][0]-x[y],mxEdgeStyle.limits[y][2]=n[y][1]-x[y],mxEdgeStyle.limits[y][4]=n[y][0]+n[y][2]+x[y],mxEdgeStyle.limits[y][8]=n[y][1]+n[y][3]+x[y];x=n[0][1]+n[0][3]/2;q=n[1][1]+n[1][3]/2;y=n[0][0]+n[0][2]/2-(n[1][0]+n[1][2]/2);E=x-q;x=0;0>y?x=0>E?2:1:0>=E&&(x=3,0==y&&(x=2));q=null;null!=b&&(q=l);b=[[0.5,0.5],[0.5,0.5]];for(y=0;2>y;y++)null!=q&&(b[y][0]=(q.x-n[y][0])/n[y][2],1>=Math.abs(q.x-n[y][0])?a[y]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(q.x-n[y][0]-n[y][2])&&(a[y]= -mxConstants.DIRECTION_MASK_EAST),b[y][1]=(q.y-n[y][1])/n[y][3],1>=Math.abs(q.y-n[y][1])?a[y]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(q.y-n[y][1]-n[y][3])&&(a[y]=mxConstants.DIRECTION_MASK_SOUTH)),q=null,null!=c&&(q=m);y=n[0][1]-(n[1][1]+n[1][3]);m=n[0][0]-(n[1][0]+n[1][2]);q=n[1][1]-(n[0][1]+n[0][3]);r=n[1][0]-(n[0][0]+n[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-z,0);mxEdgeStyle.vertexSeperations[2]=Math.max(y-z,0);mxEdgeStyle.vertexSeperations[4]=Math.max(q-z,0);mxEdgeStyle.vertexSeperations[3]= -Math.max(r-z,0);z=[];c=[];l=[];c[0]=m>=r?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;l[0]=y>=q?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;c[1]=mxUtils.reversePortConstraints(c[0]);l[1]=mxUtils.reversePortConstraints(l[0]);m=m>=r?m:r;q=y>=q?y:q;r=[[0,0],[0,0]];u=!1;for(y=0;2>y;y++)0==a[y]&&(0==(c[y]&d[y])&&(c[y]=mxUtils.reversePortConstraints(c[y])),0==(l[y]&d[y])&&(l[y]=mxUtils.reversePortConstraints(l[y])),r[y][0]=l[y],r[y][1]=c[y]);0y;y++)if(0==a[y]&&(0==(r[y][0]&d[y])&&(r[y][0]=r[y][1]),z[y]=r[y][0]&d[y],z[y]|=(r[y][1]&d[y])<<8,z[y]|=(r[1-y][y]&d[y])<<16,z[y]|=(r[1-y][1-y]&d[y])<<24,0==(z[y]&15)&&(z[y]<<=8),0==(z[y]&3840)&&(z[y]= +mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):b=2*mxEdgeStyle.orthBuffer);return b},OrthConnector:function(a,b,c,d,e){var f=a.view.graph,g=null==b?!1:f.getModel().isEdge(b.cell),k=null==c?!1:f.getModel().isEdge(c.cell),f=a.absolutePoints,l=f[0],m=f[f.length-1],n=null!=b?b.x:l.x,p=null!=b?b.y:l.y,r=null!=b?b.width:0,u=null!=b?b.height:0,q=null!=c?c.x:m.x,s=null!=c?c.y:m.y,t=null!=c?c.width:0,v=null!=c?c.height:0,f=a.view.scale*mxEdgeStyle.getJettySize(a,b,c,d,!0),x=a.view.scale* +mxEdgeStyle.getJettySize(a,b,c,d,!1);null!=b&&c==b&&(f=x=Math.max(f,x));var z=x+f,y=!1;if(null!=l&&null!=m)var y=m.x-l.x,D=m.y-l.y,y=y*y+D*D +y;y++)mxEdgeStyle.limits[y][1]=n[y][0]-x[y],mxEdgeStyle.limits[y][2]=n[y][1]-x[y],mxEdgeStyle.limits[y][4]=n[y][0]+n[y][2]+x[y],mxEdgeStyle.limits[y][8]=n[y][1]+n[y][3]+x[y];x=n[0][1]+n[0][3]/2;p=n[1][1]+n[1][3]/2;y=n[0][0]+n[0][2]/2-(n[1][0]+n[1][2]/2);D=x-p;x=0;0>y?x=0>D?2:1:0>=D&&(x=3,0==y&&(x=2));p=null;null!=b&&(p=l);b=[[0.5,0.5],[0.5,0.5]];for(y=0;2>y;y++)null!=p&&(b[y][0]=(p.x-n[y][0])/n[y][2],1>=Math.abs(p.x-n[y][0])?a[y]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(p.x-n[y][0]-n[y][2])&&(a[y]= +mxConstants.DIRECTION_MASK_EAST),b[y][1]=(p.y-n[y][1])/n[y][3],1>=Math.abs(p.y-n[y][1])?a[y]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(p.y-n[y][1]-n[y][3])&&(a[y]=mxConstants.DIRECTION_MASK_SOUTH)),p=null,null!=c&&(p=m);y=n[0][1]-(n[1][1]+n[1][3]);m=n[0][0]-(n[1][0]+n[1][2]);p=n[1][1]-(n[0][1]+n[0][3]);r=n[1][0]-(n[0][0]+n[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-z,0);mxEdgeStyle.vertexSeperations[2]=Math.max(y-z,0);mxEdgeStyle.vertexSeperations[4]=Math.max(p-z,0);mxEdgeStyle.vertexSeperations[3]= +Math.max(r-z,0);z=[];c=[];l=[];c[0]=m>=r?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;l[0]=y>=p?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;c[1]=mxUtils.reversePortConstraints(c[0]);l[1]=mxUtils.reversePortConstraints(l[0]);m=m>=r?m:r;p=y>=p?y:p;r=[[0,0],[0,0]];u=!1;for(y=0;2>y;y++)0==a[y]&&(0==(c[y]&d[y])&&(c[y]=mxUtils.reversePortConstraints(c[y])),0==(l[y]&d[y])&&(l[y]=mxUtils.reversePortConstraints(l[y])),r[y][0]=l[y],r[y][1]=c[y]);0y;y++)if(0==a[y]&&(0==(r[y][0]&d[y])&&(r[y][0]=r[y][1]),z[y]=r[y][0]&d[y],z[y]|=(r[y][1]&d[y])<<8,z[y]|=(r[1-y][y]&d[y])<<16,z[y]|=(r[1-y][1-y]&d[y])<<24,0==(z[y]&15)&&(z[y]<<=8),0==(z[y]&3840)&&(z[y]= z[y]&15|z[y]>>8),0==(z[y]&983040)&&(z[y]=z[y]&65535|(z[y]&251658240)>>8),a[y]=z[y]&15,d[y]==mxConstants.DIRECTION_MASK_WEST||d[y]==mxConstants.DIRECTION_MASK_NORTH||d[y]==mxConstants.DIRECTION_MASK_EAST||d[y]==mxConstants.DIRECTION_MASK_SOUTH))a[y]=d[y];d=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];z=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];d-=x;z-=x;1>d&&(d+=4);1>z&&(z+=4);d=mxEdgeStyle.routePatterns[d-1][z-1];mxEdgeStyle.wayPoints1[0][0]=n[0][0];mxEdgeStyle.wayPoints1[0][1]=n[0][1];switch(a[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-= f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*n[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*n[0][2];mxEdgeStyle.wayPoints1[0][1]+=n[0][3]+f;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=n[0][2]+f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*n[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*n[0][2],mxEdgeStyle.wayPoints1[0][1]-=f}f=0;c=z=0<(a[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))? -0:1;for(y=0;y>5,q<<=x,15>=4),r=0<(d[y]&mxEdgeStyle.CENTER_MASK),(u||s)&&9>q?(u=u?0:1,p=r&&0==l?n[u][0]+b[u][0]*n[u][2]:r?n[u][1]+b[u][1]* -n[u][3]:mxEdgeStyle.limits[u][q],0==l?(q=(p-mxEdgeStyle.wayPoints1[f][0])*m[0],0>5,p<<=x,15>=4),r=0<(d[y]&mxEdgeStyle.CENTER_MASK),(u||s)&&9>p?(u=u?0:1,q=r&&0==l?n[u][0]+b[u][0]*n[u][2]:r?n[u][1]+b[u][1]* +n[u][3]:mxEdgeStyle.limits[u][p],0==l?(p=(q-mxEdgeStyle.wayPoints1[f][0])*m[0],0e&&(e+=4);1>a&&(a+=4);b=routePatterns[e-1][a-1];if(0==c||0==d)null!=inlineRoutePatterns[e-1][a- 1]&&(b=inlineRoutePatterns[e-1][a-1]);return b}},mxStyleRegistry={values:[],putValue:function(a,b){mxStyleRegistry.values[a]=b},getValue:function(a){return mxStyleRegistry.values[a]},getName:function(a){for(var b in mxStyleRegistry.values)if(mxStyleRegistry.values[b]==a)return b;return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation); mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter); @@ -1219,12 +1219,12 @@ mxGraphView.prototype.getPerimeterPoint=function(a,b,c,d){var e=null;if(null!=a) mxGraphView.prototype.getRoutingCenterY=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return a.getCenterY()+b*a.height};mxGraphView.prototype.getPerimeterBounds=function(a,b){b=null!=b?b:0;null!=a&&(b+=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0));return a.getPerimeterBounds(b*this.scale)}; mxGraphView.prototype.getPerimeterFunction=function(a){a=a.style[mxConstants.STYLE_PERIMETER];if("string"==typeof a){var b=mxStyleRegistry.getValue(a);null==b&&this.isAllowEval()&&(b=mxUtils.eval(a));a=b}return"function"==typeof a?a:null};mxGraphView.prototype.getNextPoint=function(a,b,c){a=a.absolutePoints;var d=null;null!=a&&2<=a.length&&(d=a.length,d=a[c?Math.min(1,d-1):Math.max(0,d-2)]);null==d&&null!=b&&(d=new mxPoint(b.getCenterX(),b.getCenterY()));return d}; mxGraphView.prototype.getVisibleTerminal=function(a,b){for(var c=this.graph.getModel(),d=c.getTerminal(a,b),e=d;null!=d&&d!=this.currentRoot;){if(!this.graph.isCellVisible(e)||this.isCellCollapsed(d))e=d;d=c.getParent(d)}c.getParent(e)==c.getRoot()&&(e=null);return e}; -mxGraphView.prototype.updateEdgeBounds=function(a){var b=a.absolutePoints,c=b[0],d=b[b.length-1];if(c.x!=d.x||c.y!=d.y){var e=d.x-c.x,f=d.y-c.y;a.terminalDistance=Math.sqrt(e*e+f*f)}else a.terminalDistance=0;var d=0,g=[],f=c;if(null!=f){for(var c=f.x,k=f.y,l=c,m=k,n=1;n=Math.round(k+g)&&l=f?0:f*f/(a*a+m*m));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,k.x,k.y,b,c)&&(e=-e);return new mxPoint(-2*((d/2-q-a)/d),e/this.scale)}}return new mxPoint}; +mxGraphView.prototype.getRelativePoint=function(a,b,c){var d=this.graph.getModel().getGeometry(a.cell);if(null!=d){var e=a.absolutePoints.length;if(d.relative&&1=f?0:f*f/(a*a+m*m));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,k.x,k.y,b,c)&&(e=-e);return new mxPoint(-2*((d/2-p-a)/d),e/this.scale)}}return new mxPoint}; mxGraphView.prototype.updateEdgeLabelOffset=function(a){var b=a.absolutePoints;a.absoluteOffset.x=a.getCenterX();a.absoluteOffset.y=a.getCenterY();if(null!=b&&0this.model.getChildCount(b)&&c--;this.model.add(b,a[l],c+l);this.autoSizeCellsOnAdd&&this.autoSizeCell(a[l],!0);(null==k||k)&&this.isExtendParentsOnAdd(a[l])&&this.isExtendParent(a[l])&&this.extendParent(a[l]);(null==g||g)&&this.constrainChild(a[l]);null!=d&&this.cellConnected(a[l],d,!0);null!=e&&this.cellConnected(a[l],e,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",b,"index",c,"source", +mxGraph.prototype.cellsAdded=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=b&&null!=c){this.model.beginUpdate();try{for(var l=f?this.view.getState(b):null,m=null!=l?l.origin:null,n=new mxPoint(0,0),l=0;lthis.model.getChildCount(b)&&c--;this.model.add(b,a[l],c+l);this.autoSizeCellsOnAdd&&this.autoSizeCell(a[l],!0);(null==k||k)&&this.isExtendParentsOnAdd(a[l])&&this.isExtendParent(a[l])&&this.extendParent(a[l]);(null==g||g)&&this.constrainChild(a[l]);null!=d&&this.cellConnected(a[l],d,!0);null!=e&&this.cellConnected(a[l],e,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",b,"index",c,"source", d,"target",e,"absolute",f))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(a,b){if(null!=b?b:1)for(var c=this.model.getChildCount(a),d=0;df&&(n=0),b>g&&(q=0),this.view.setTranslate(Math.floor(n/2-k.x),Math.floor(q/2-k.y)),this.container.scrollLeft=(a-f)/ -2,this.container.scrollTop=(b-g)/2):this.view.setTranslate(a?Math.floor(l.x-k.x*m+n*c/m):l.x,b?Math.floor(l.y-k.y*m+q*d/m):l.y)}; +mxGraph.prototype.center=function(a,b,c,d){a=null!=a?a:!0;b=null!=b?b:!0;c=null!=c?c:0.5;d=null!=d?d:0.5;var e=mxUtils.hasScrollbars(this.container),f=this.container.clientWidth,g=this.container.clientHeight,k=this.getGraphBounds(),l=this.view.translate,m=this.view.scale,n=a?f-k.width:0,p=b?g-k.height:0;e?(k.x-=l.x,k.y-=l.y,a=this.container.scrollWidth,b=this.container.scrollHeight,a>f&&(n=0),b>g&&(p=0),this.view.setTranslate(Math.floor(n/2-k.x),Math.floor(p/2-k.y)),this.container.scrollLeft=(a-f)/ +2,this.container.scrollTop=(b-g)/2):this.view.setTranslate(a?Math.floor(l.x-k.x*m+n*c/m):l.x,b?Math.floor(l.y-k.y*m+p*d/m):l.y)}; mxGraph.prototype.zoom=function(a,b){b=null!=b?b:this.centerZoom;var c=Math.round(100*this.view.scale*a)/100,d=this.view.getState(this.getSelectionCell());a=c/this.view.scale;if(this.keepSelectionVisibleOnZoom&&null!=d)d=new mxRectangle(d.x*a,d.y*a,d.width*a,d.height*a),this.view.scale=c,this.scrollRectToVisible(d)||(this.view.revalidate(),this.view.setScale(c));else if(d=mxUtils.hasScrollbars(this.container),b&&!d){var d=this.container.offsetWidth,e=this.container.offsetHeight;if(1=a&&r.y+r.height<=l&&r.y>=b&&r.x+r.width<=k?f.push(q):this.getCells(a, -b,c,d,q,f)}}}return f};mxGraph.prototype.getCellsBeyond=function(a,b,c,d,e){var f=[];if(d||e)if(null==c&&(c=this.getDefaultParent()),null!=c)for(var g=this.model.getChildCount(c),k=0;k=a)&&(!e||m.y>=b)&&f.push(l)}return f}; -mxGraph.prototype.findTreeRoots=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;var d=[];if(null!=a){for(var e=this.getModel(),f=e.getChildCount(a),g=null,k=0,l=0;lk&&(k=n,g=m)}}0==d.length&&null!=g&&d.push(g)}return d}; +mxGraph.prototype.getCells=function(a,b,c,d,e,f){f=null!=f?f:[];if(0=a&&r.y+r.height<=l&&r.y>=b&&r.x+r.width<=k?f.push(p):this.getCells(a, +b,c,d,p,f)}}}return f};mxGraph.prototype.getCellsBeyond=function(a,b,c,d,e){var f=[];if(d||e)if(null==c&&(c=this.getDefaultParent()),null!=c)for(var g=this.model.getChildCount(c),k=0;k=a)&&(!e||m.y>=b)&&f.push(l)}return f}; +mxGraph.prototype.findTreeRoots=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;var d=[];if(null!=a){for(var e=this.getModel(),f=e.getChildCount(a),g=null,k=0,l=0;lk&&(k=n,g=m)}}0==d.length&&null!=g&&d.push(g)}return d}; mxGraph.prototype.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d)))if(d=this.model.getEdgeCount(a),0d&&(a+=c,e&&(a=this.graph.snap(a/f)*f));if(0==d||3==d||5==d)q+=b,e&&(q=this.graph.snap(q/f)*f);else if(2==d||4==d||7==d)r+=b,e&&(r=this.graph.snap(r/ -f)*f);e=r-q;c=u-a;k&&(k=this.graph.getCellGeometry(this.state.cell),null!=k&&(k=k.width/k.height,1==d||2==d||7==d||6==d?e=c*k:c=e/k,0==d&&(q=r-e,a=u-c)));l&&(e+=e-m,c+=c-n,q+=p-(q+e/2),a+=s-(a+c/2));0>e&&(q+=e,e=Math.abs(e));0>c&&(a+=c,c=Math.abs(c));d=new mxRectangle(q+g.x*f,a+g.y*f,e,c);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*f+this.minBounds.width*f+Math.max(0,this.x0*f-d.x)),d.height=Math.max(d.height,this.minBounds.y*f+this.minBounds.height*f+Math.max(0,this.y0*f-d.y))); +mxVertexHandler.prototype.union=function(a,b,c,d,e,f,g,k,l){if(this.singleSizer)return d=a.x+a.width+b,g=a.y+a.height+c,e&&(d=this.graph.snap(d/f)*f,g=this.graph.snap(g/f)*f),f=new mxRectangle(a.x,a.y,0,0),f.add(new mxRectangle(d,g,0,0)),f;var m=a.width,n=a.height,p=a.x-g.x*f,r=p+m;a=a.y-g.y*f;var u=a+n,q=p+m/2,s=a+n/2;4d&&(a+=c,e&&(a=this.graph.snap(a/f)*f));if(0==d||3==d||5==d)p+=b,e&&(p=this.graph.snap(p/f)*f);else if(2==d||4==d||7==d)r+=b,e&&(r=this.graph.snap(r/ +f)*f);e=r-p;c=u-a;k&&(k=this.graph.getCellGeometry(this.state.cell),null!=k&&(k=k.width/k.height,1==d||2==d||7==d||6==d?e=c*k:c=e/k,0==d&&(p=r-e,a=u-c)));l&&(e+=e-m,c+=c-n,p+=q-(p+e/2),a+=s-(a+c/2));0>e&&(p+=e,e=Math.abs(e));0>c&&(a+=c,c=Math.abs(c));d=new mxRectangle(p+g.x*f,a+g.y*f,e,c);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*f+this.minBounds.width*f+Math.max(0,this.x0*f-d.x)),d.height=Math.max(d.height,this.minBounds.y*f+this.minBounds.height*f+Math.max(0,this.y0*f-d.y))); return d};mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.redrawHandles();this.drawPreview()}; mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),b=this.tolerance;if(null!=this.sizers&&0this.minPageBreakDist)?Math.ceil(c/s.height)-1:0,v=a?Math.ceil(b/s.width)-1:0,x=p.x+b,z=p.y+c;null==this.horizontalPageBreaks&&0this.minPageBreakDist)?Math.ceil(c/s.height)-1:0,v=a?Math.ceil(b/s.width)-1:0,x=q.x+b,z=q.y+c;null==this.horizontalPageBreaks&&0document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",b):this.diagramContainer.oncontextmenu=b;d.init(this.diagramContainer);this.hoverIcons=this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var b=mxUtils.getOffset(this.diagramContainer);0mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=c}a=this.toolbar.fontMenu;c=this.toolbar.sizeMenu; -if(null==q)this.toolbar.createTextToolbar();else{for(var e=0;emxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=c}a=this.toolbar.fontMenu;c=this.toolbar.sizeMenu; +if(null==p)this.toolbar.createTextToolbar();else{for(var e=0;emxUtils.indexOf(x,r))&&d.setCellStyles(r,z,[g])}}}finally{d.getModel().endUpdate()}};d.addListener("cellsInserted",function(a,b){A(b.getProperty("cells"))});d.addListener("textInserted",function(a,b){A(b.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a, +"keys",[],"values",[],"cells",[]))};var z=["fontFamily","fontSize","fontColor"],y="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),D=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],z,["align"],["html"]];for(a=0;amxUtils.indexOf(x,q))&&d.setCellStyles(q,y,[g])}}}finally{d.getModel().endUpdate()}};d.addListener("cellsInserted",function(a,b){A(b.getProperty("cells"))});d.addListener("textInserted",function(a,b){A(b.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a, b){var c=[b.getProperty("cell")];b.getProperty("terminalInserted")&&c.push(b.getProperty("terminal"));A(c)});this.addListener("styleChanged",mxUtils.bind(this,function(a,b){var c=b.getProperty("cells"),e=!1,f=!1;if(0c*this.view.scale||Math.abs(f.y- -b.getGraphY())>c*this.view.scale){this.isCellSelected(d.cell)||this.setSelectionCell(d.cell);var e=this.selectionCellsHandler.getHandler(d.cell);if(null!=e&&null!=e.bends&&0c*this.view.scale){this.isCellSelected(d.cell)||this.setSelectionCell(d.cell);var e=this.selectionCellsHandler.getHandler(d.cell);if(null!=e&&null!=e.bends&&0mxUtils.indexOf(b,e)&&c.push(e)): -c.push(b[d])}return c};this.connectionHandler.createTargetVertex=function(a,b){var c=this.graph.view.getState(b),c=null!=c?c.style:this.graph.getCellStyle(b);mxUtils.getValue(c,"part",!1)&&(c=this.graph.model.getParent(b),this.graph.model.isVertex(c)&&(b=c));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var q=new mxRubberband(this);this.getRubberband=function(){return q};var r=(new Date).getTime(),u=0,p=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove= -function(){var a=this.currentState;p.apply(this,arguments);a!=this.currentState?(r=(new Date).getTime(),u=0):u=(new Date).getTime()-r};var s=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3=a&&p.y+p.height<=l&&p.y>=b&&p.x+p.width<=g)&&f.push(q);this.getAllCells(a,b,c,d,q,f)}}}return f};var E=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,b,c){return this.graph.isCellSelected(a)?!1:E.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style, +this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,b){var c=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(c,b);return c};this.getAllCells=function(a,b,c,d,e,f){f=null!=f?f:[];if(0=a&&r.y+r.height<=l&&r.y>=b&&r.x+r.width<=g)&&f.push(p);this.getAllCells(a,b,c,d,p,f)}}}return f};var D=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,b,c){return this.graph.isCellSelected(a)?!1:D.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style, "locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var A=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,b){if("mouseDown"==b.getProperty("eventName")){var c=b.getProperty("event").getState();A=null!=c&&!this.isSelectionEmpty()&&!this.isCellSelected(c.cell)?this.getSelectionCells():null}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,b){if(!mxEvent.isMultiTouchEvent(b)){var c=b.getProperty("event"),d=b.getProperty("cell"); -null==d?(c=mxUtils.convertPoint(this.container,mxEvent.getClientX(c),mxEvent.getClientY(c)),q.start(c.x,c.y)):null!=A?this.addSelectionCells(A):1r?"a":"p",tt:12>r?"am":"pm",T:12>r?"A":"P",TT:12>r?"AM":"PM",Z:c?"UTC":(String(a).match(e)||[""]).pop().replace(f,""),o:(0r?"a":"p",tt:12>r?"am":"pm",T:12>r?"A":"P",TT:12>r?"AM":"PM",Z:c?"UTC":(String(a).match(e)||[""]).pop().replace(f,""),o:(0this.activationDelay)if(this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==c||!mxUtils.contains(this.bbox,b,c)))null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!= a&&this.graph.connectionHandler.constraintHandler.reset()):this.reset()}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a}; -(function(){var a=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(b,c,f,g){if(null!=c&&null!=b&&("1"==c.style.snapToPoint||"1"==b.style.snapToPoint)){c=this.getTerminalPort(b,c,g);var k=this.getNextPoint(b,f,g),l=this.graph.isOrthogonal(b),m=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),n=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=m)var q=Math.cos(-m),r=Math.sin(-m),k=mxUtils.getRotatedPoint(k,q,r,n);q=parseFloat(b.style[mxConstants.STYLE_PERIMETER_SPACING]|| -0);q+=parseFloat(b.style[g?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(c,k,0==m&&l,q);0!=m&&(q=Math.cos(m),r=Math.sin(m),k=mxUtils.getRotatedPoint(k,q,r,n));if(null!=c){m=this.graph.getAllConnectionConstraints(c);l=n=null;for(q=0;qb&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&"Control"!=b.type&&b.createRange().pasteHTML(a)};Graph.prototype.initTouch= -function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,b.graphX,b.graphY)||(b.state=this.view.getState(c),null!=b.state&& -null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,k){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger= -!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection= -function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;bb&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&"Control"!=b.type&& +b.createRange().pasteHTML(a)};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,b.graphX, +b.graphY)||(b.state=this.view.getState(c),null!=b.state&&null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,k){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp= +mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell); +return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;bk||Math.abs(f)>k)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(d,c),this.isSpaceEvent(b)?(d=this.x+this.width,c=this.y+this.height,e=this.graph.view.scale,mxEvent.isAltDown(b.getEvent())||(this.width=this.graph.snap(this.width/e)*e,this.height=this.graph.snap(this.height/e)*e,this.graph.isGridEnabled()||(this.width=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv= this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv), -this.secondDiv=null)),b.consume()}};var p=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);p.apply(this,arguments)};var s=(new Date).getTime(),t=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d){v.apply(this,arguments);c!=this.currentTerminalState?(s=(new Date).getTime(),t=0):t=(new Date).getTime()-s;this.currentTerminalState= +this.secondDiv=null)),b.consume()}};var q=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);q.apply(this,arguments)};var s=(new Date).getTime(),t=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d){v.apply(this,arguments);c!=this.currentTerminalState?(s=(new Date).getTime(),t=0):t=(new Date).getTime()-s;this.currentTerminalState= c};var x=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,c):null,c=null!=(null!=e?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(c),e):null)?this.fixedHandleImage:null!=e&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=c)return c=new mxImageShape(new mxRectangle(0,0,c.width,c.height),c.src),c.preserveImageAspect=!1,c;c=mxConstants.HANDLE_SIZE; this.preferHtml&&(c-=1);return new mxRectangleShape(new mxRectangle(0,0,c,c),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var z=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,b,c){this.handleImage=b==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:b==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return z.apply(this,arguments)};var y=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox= -function(a){if(null!=a&&1==a.length){var b=this.graph.getModel(),c=b.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(b.isEdge(c)&&(null!=d&&d.relative)&&(b=this.graph.view.getState(a[0]),null!=b&&2>b.width&&2>b.height&&null!=b.text&&null!=b.text.boundingBox))return mxRectangle.fromRectangle(b.text.boundingBox)}return y.apply(this,arguments)};var E=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var b=this.graph.getModel(),c=b.getParent(a.cell), -d=this.graph.getCellGeometry(a.cell);return b.isEdge(c)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(b=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(b.x),Math.round(b.y),Math.round(b.width),Math.round(b.height))):E.apply(this,arguments)};var A=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,b){var c=this.graph.getModel(),d=c.getParent(this.state.cell),e=this.graph.getCellGeometry(this.state.cell); +function(a){if(null!=a&&1==a.length){var b=this.graph.getModel(),c=b.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(b.isEdge(c)&&(null!=d&&d.relative)&&(b=this.graph.view.getState(a[0]),null!=b&&2>b.width&&2>b.height&&null!=b.text&&null!=b.text.boundingBox))return mxRectangle.fromRectangle(b.text.boundingBox)}return y.apply(this,arguments)};var D=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var b=this.graph.getModel(),c=b.getParent(a.cell), +d=this.graph.getCellGeometry(a.cell);return b.isEdge(c)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(b=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(b.x),Math.round(b.y),Math.round(b.width),Math.round(b.height))):D.apply(this,arguments)};var A=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,b){var c=this.graph.getModel(),d=c.getParent(this.state.cell),e=this.graph.getCellGeometry(this.state.cell); (this.getHandleForEvent(b)==mxEvent.ROTATION_HANDLE||!c.isEdge(d)||null==e||!e.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&A.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()e)this.originalLineTo.apply(this.canvas,arguments);else{var f=Math.round(e/10),k=this.defaultVariation;5>f&&(f=5,k/=3);for(var g=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN}, -l=g(a-this.lastX)*c/f,g=g(b-this.lastY)*d/f,c=c/e,d=d/e,e=0;ee)this.originalLineTo.apply(this.canvas,arguments);else{var f=Math.round(e/10),k=this.defaultVariation;5>f&&(f=5,k/=3);for(var g=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN}, +l=g(a-this.lastX)*c/f,g=g(b-this.lastY)*d/f,c=c/e,d=d/e,e=0;ed&&(c=b.substring(d,e+15).replace(/>/g,"\x3e").replace(/</g,"\x3c").replace(/\\"/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(b),g=this.editor.extractGraphModel(f.documentElement),c=null!=g?mxUtils.getXml(g):""}catch(u){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&& 0MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";if("xmlpng"==b&&(e="1",b="png",null!=this.pages&&null!=this.currentPage))for(var g=0;g=screen.height?5:46,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left= "164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?420:340,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog= function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.setBackgroundImage(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,620,440,!0,!0,mxUtils.bind(this,function(a){a&&(null==this.getCurrentFile()&&"1"!=urlParams.embed)&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer= function(){var a=this.createDiv("geSidebarContainer");a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError= function(a,b,c){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){a=mxResources.get("unknownError");var f=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=e)if("undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxResources.get("forbidden");else if(404==e.code||404==e.status||"undefined"!= -typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxResources.get("fileNotFoundOrDenied");var p=window.location.hash;null!=p&&"#G"==p.substring(0,2)&&(p=p.substring(2),a+=' \x3ca href\x3d"https://drive.google.com/open?id\x3d'+p+'" target\x3d"_blank"\x3e'+mxResources.get("tryOpeningViaThisPage")+"\x3c/a\x3e")}else e.code==App.ERROR_TIMEOUT?(a=mxResources.get("timeout"),null!=e.retry&&(f=mxResources.get("cancel"), +typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxResources.get("fileNotFoundOrDenied");var q=window.location.hash;null!=q&&"#G"==q.substring(0,2)&&(q=q.substring(2),a+=' \x3ca href\x3d"https://drive.google.com/open?id\x3d'+q+'" target\x3d"_blank"\x3e'+mxResources.get("tryOpeningViaThisPage")+"\x3c/a\x3e")}else e.code==App.ERROR_TIMEOUT?(a=mxResources.get("timeout"),null!=e.retry&&(f=mxResources.get("cancel"), g=function(){d();e.retry()})):e.code==App.ERROR_BUSY?a=mxResources.get("busy"):null!=e.message?a=e.message:null!=e.response&&null!=e.response.error&&(a=e.response.error);this.showError(b,a,f,c,g)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,f,g){a=new ErrorDialog(this,a,b,c,d,e,f,g);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()}; EditorUi.prototype.confirm=function(a,b,c,d,e){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){f();null!=b&&b()},function(){f();null!=c&&c()},d,e)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&& 0==a.getChildCount(a.getChildAt(a.root,0))};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createPngDataUri=function(a,b){var c=a.toDataURL("image/png");if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/png"))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c, @@ -2682,87 +2682,85 @@ EditorUi.prototype.confirm=function(a,b,c,d,e){var f=null!=this.spinner&&null!=t typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,e){if(window.MSBlobBuilder&&navigator.msSaveOrOpenBlob)d=new MSBlobBuilder,d.append(a),a=d.getBlob(c),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs", !0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height="380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var f=document.createElement("a");if("undefined"!==typeof f.download||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));"undefined"!==typeof f.download?f.download=b:f.setAttribute("target", "_blank");document.body.appendChild(f);try{f.click(),window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.parentNode.removeChild(f)}catch(g){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml\x3d"+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"\x26mime\x3d"+c:"")+(null!=e?"\x26format\x3d"+e:"")+(null!=f?"\x26base64\x3d"+f:"")+(null!=b?"\x26filename\x3d"+encodeURIComponent(b):"")+(d? -"\x26binary\x3d1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),f=Array(e),g=0;ge.getStatus()||299f.status){this.spinner.stop();this.hideDialog();a="https://github.com/"+v.value+"/"+x.value+"/blob/"+E.value+"/"+z.value;var b=new ErrorDialog(this, +"\x26binary\x3d1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),f=Array(e),g=0;ge.getStatus()||299f.status){this.spinner.stop();this.hideDialog();a="https://github.com/"+v.value+"/"+x.value+"/blob/"+D.value+"/"+z.value;var b=new ErrorDialog(this, mxResources.get("published"),mxResources.get("publishedAt",['\x3ca href\x3d"'+a+'" target\x3d"_blank"\x3e'+a+"\x3c/a\x3e"]),mxResources.get("close"),mxUtils.bind(this,function(){this.hideDialog()}),null,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){window.open(a)}),!1);this.showDialog(b.container,340,170,!0,!1);b.init()}else d=this.spinner.pause(),this.handleError(JSON.parse(f.responseText))});f.open("PUT",a,!0);f.setRequestHeader("Authorization","Basic "+btoa(s.value+":"+t.value)); f.send(JSON.stringify(e))}else this.hideDialog(),this.spinner.stop(),this.handleError(JSON.parse(c.getText()))}),mxUtils.bind(this,function(a){this.hideDialog();this.spinner.stop();this.handleError({message:mxResources.get("unknownError")})}))}),null,null,c,null,!1);this.showDialog(c.container,260,260,!0,!1);c.init()};EditorUi.prototype.publishImage=function(a,b){var c=this.getCurrentFile();null!=c&&(this.isExportToCanvas()?this.showExportDialog(!1,mxResources.get("publish"),"https://support.draw.io/pages/viewpage.action?pageId\x3d12222625", -mxUtils.bind(this,function(d,e,f,g,p){d=parseInt(d);if(!isNaN(d)&&0]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/i.test(f.value)&&g.setLinkForCell(f,f.value),f.geometry.width+=g.gridSize,f.geometry.height+=g.gridSize}finally{g.getModel().endUpdate()}return[f]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024< -a);return Math.max(a,0.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="\x3d\x3d";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f& -15)<<2);b+="\x3d";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,f,g,p,s,t,v,x){var z=null!=b&&null!= -c;b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;t=null!=t?t:this.maxImageBytes;s=null!=s?s:!0;var y=this.editor.graph,E=y.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,g,k,l){return null!=a&&"\x3cmxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,e,f,g,k,l,z,x)});f=null!=f?f:mxUtils.bind(this,function(a){y.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var A= -a.length,D=A,C=[],F=mxUtils.bind(this,function(a,b){C[a]=b;if(0==--D){this.spinner.stop();if(null!=p)p(C);else{var c=[];y.getModel().beginUpdate();try{for(var d=0;db};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),p=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var s=Math.max(g/e,p/e);if(1b;b++)for(var c=b,d=0;8>d;d++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[b]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=p;p+=b;return a.substring(c,p)} -function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,p);do{var s=g(a);if("IDAT"==f(a,4)){e=a.substring(0,p-8);s=4294967295;s=this.updateCRC(s,b,0,4);s=this.updateCRC(s,d,0,d.length);e+=String.fromCharCode(c.length+ -d.length+1+("zTXt"==b?1:0)>>24&255,c.length+d.length+1+("zTXt"==b?1:0)>>16&255,c.length+d.length+1+("zTXt"==b?1:0)>>8&255,c.length+d.length+1+("zTXt"==b?1:0)&255)+b+c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d+String.fromCharCode((s^4294967295)>>24&255,(s^4294967295)>>16&255,(s^4294967295)>>8&255,(s^4294967295)&255);e+=a.substring(p-8,a.length);break}e+=a.substring(p-8,p-4+s);d=f(a,s);f(a,4)}while(s);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng= +15)<<2);b+="\x3d";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,f,g,q,s,t,v,x){var z=null!=b&&null!= +c;b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;t=null!=t?t:this.maxImageBytes;s=null!=s?s:!0;var y=this.editor.graph,D=y.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,g,k,l){return null!=a&&"\x3cmxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,e,f,g,k,l,z,x)});f=null!=f?f:mxUtils.bind(this,function(a){y.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var A= +a.length,E=A,C=[],F=mxUtils.bind(this,function(a,b){C[a]=b;if(0==--E){this.spinner.stop();if(null!=q)q(C);else{var c=[];y.getModel().beginUpdate();try{for(var d=0;db};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),q=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var s=Math.max(g/e,q/e);if(1b;b++)for(var c=b,d=0;8>d;d++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[b]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=q;q+=b;return a.substring(c,q)} +function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var q=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,q);do{var s=g(a);if("IDAT"==f(a,4)){e=a.substring(0,q-8);s=4294967295;s=this.updateCRC(s,b,0,4);s=this.updateCRC(s,d,0,d.length);e+=String.fromCharCode(c.length+ +d.length+1+("zTXt"==b?1:0)>>24&255,c.length+d.length+1+("zTXt"==b?1:0)>>16&255,c.length+d.length+1+("zTXt"==b?1:0)>>8&255,c.length+d.length+1+("zTXt"==b?1:0)&255)+b+c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d+String.fromCharCode((s^4294967295)>>24&255,(s^4294967295)>>16&255,(s^4294967295)>>8&255,(s^4294967295)&255);e+=a.substring(q-8,a.length);break}e+=a.substring(q-8,q-4+s);d=f(a,s);f(a,4)}while(s);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng= function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0document.documentMode))b= this.highlightElement();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(0mxUtils.indexOf(c,a)};this.executeLayout(function(){P.execute(v.getDefaultParent());ba()},!0,x);x=null}else if("horizontaltree"==D||"verticaltree"==D||"auto"==D&&Y.length==2*c.length-1&&1==I.length){v.view.validate();var aa=new mxCompactTreeLayout(v,"horizontaltree"==D);aa.levelDistance=s;aa.edgeRouting=!1;this.executeLayout(function(){aa.execute(v.getDefaultParent(),0c.length){v.view.validate();var Q=new mxFastOrganicLayout(v);Q.forceConstant=3*s;Q.resetEdges=!1;var ga=Q.isVertexIgnored;Q.isVertexIgnored=function(a){return ga.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(v); -ca.spacing=p;this.executeLayout(function(){Q.execute(v.getDefaultParent());ba()},!0,x);x=null}this.hideDialog()}finally{v.model.endUpdate()}null!=x&&x()}}catch(ea){this.handleError(ea)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl= +B:S,L.style||v.createCurrentEdgeStyle())),mxUtils.remove(L.invert?B:S,I))}}}}var ca=new mxParallelEdgeLayout(v);ca.spacing=q;var ba=function(){ca.execute(v.getDefaultParent());for(var a=0;amxUtils.indexOf(c,a)};this.executeLayout(function(){P.execute(v.getDefaultParent());ba()},!0,x);x=null}else if("horizontaltree"==E||"verticaltree"==E||"auto"==E&&Y.length==2*c.length-1&&1==I.length){v.view.validate();var aa=new mxCompactTreeLayout(v,"horizontaltree"==E);aa.levelDistance=s;aa.edgeRouting=!1;this.executeLayout(function(){aa.execute(v.getDefaultParent(),0c.length){v.view.validate();var Q=new mxFastOrganicLayout(v);Q.forceConstant=3*s;Q.resetEdges=!1;var ga=Q.isVertexIgnored;Q.isVertexIgnored=function(a){return ga.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(v); +ca.spacing=q;this.executeLayout(function(){Q.execute(v.getDefaultParent());ba()},!0,x);x=null}this.hideDialog()}finally{v.model.endUpdate()}null!=x&&x()}}catch(ea){this.handleError(ea)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl= function(a){a=null!=a?a:window.location.pathname;var b=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"\x26",null!=urlParams[d]&&(a+=d+"\x3d"+urlParams[d],b++))}return a};var f=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=f.apply(this,arguments),c=this.editor.graph, d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a= this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding(),e=Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2),f=Math.max(0,(b.outline.container.clientHeight/ @@ -2839,8 +2837,8 @@ null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMen 5E3)}}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),c=null!=b&&b.isEditable()||"1"==urlParams.embed;this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(c); this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!= b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed||null!=b&&!b.isRestricted());this.actions.get("github").setEnabled(null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=b&&!b.isRestricted());this.menus.get("publish").setEnabled(null!=b&&!b.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};null!= -window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,f){var g=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(g.getSvg(d,e,f)),"image/svg+xml");else{var p=a.getFileData(!0,null,null,null,null,!0),s=g.getGraphBounds(),t=Math.floor(s.width*e/g.view.scale),v=Math.floor(s.height*e/g.view.scale);p.length<= -MAX_REQUEST_SIZE&&t*v>1,filter:m}),d("fill",{color:"string"==typeof e.color?e.color:e.color[a%e.color.length],opacity:e.opacity}),d("stroke",{opacity:0}))))}var k,l=e.length+e.width,m=2*l;k=2*-(e.width+e.length)+"px";var n=b(f(),{position:"absolute",top:k,left:k});if(e.shadow)for(k=1;k<=e.lines;k++)g(k,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius\x3d2,makeshadow\x3d1,shadowopacity\x3d.3)");for(k=1;k<=e.lines;k++)g(k);return c(a,n)};g.prototype.opacity=function(b,a,d,e){b=b.firstChild;e=e.shadow&& e.lines||0;b&&a+e>1)+"px"})}for(var k, m=0,n=(e.lines-1)*(1-e.direction)/2;m>10),56320+(d&1023))):d==d?String.fromCharCode(d):" ">a[1]?"":a[1]}function a(b,d){return'"'+b.replace(/[\u0000-\u001f\\\"<>]/g,d)+'"'}function d(b){return c[b]||(c[b]="\\"+b.charCodeAt(0).toString(16)+" ")}function e(b){return f[b]||(f[b]=("\u0010">b?"%0":"%")+b.charCodeAt(0).toString(16))}var c={"\\":"\\\\"},f={"\\":"%5c"},g=RegExp("\\uFEFF|U[+][0-9A-F?]{1,6}(?:-[0-9A-F]{1,6})?|url[(][\\t\\n\\f ]*(?:\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|(?:[\\t\\x21\\x23-\\x26\\x28-\\x5b\\x5d-\\x7e]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)[\\t\\n\\f ]*[)]|(?!url[(])-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*[(]|(?:@?-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))|#)(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*|\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|[-+]?(?:[0-9]+(?:[.][0-9]+)?|[.][0-9]+)(?:%|-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)?|\x3c!--|--\x3e|[\\t\\n\\f ]+|/(?:[*][^*]*[*]+(?:[^/][^*]*[*]+)*/|/[^\\n\\f]*)|[~|^$*]\x3d|[^\"'\\\\/]|/(?![/*])", -"gi"),m=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),n=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");l=function(a){return a.replace(m,b)};k=function(b){b=(""+b).replace(/\r\n?/g,"\n").match(g)||[];for(var c=0,f=" ",k=0,m=b.length;k=t?" ":/url\(/i.test(p)?"url("+a(p.replace(n,""),e)+")":p;if(f!=p||" "!=p)b[c++]=f=p}b.length=c;return b}})();"undefined"!==typeof window&&(window.lexCss=k,window.decodeCss=l);var m=function(){function b(a){a=(""+a).match(n);return!a?f:new g(k(a[1]),k(a[2]),k(a[3]),k(a[4]),k(a[5]),k(a[6]),k(a[7]))}function a(b,e){return"string"==typeof b?encodeURI(b).replace(e,d):f}function d(b){b=b.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(b>>4&15)+"0123456789ABCDEF".charAt(b&15)}function e(b){if(b=== +"gi"),m=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),n=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");l=function(a){return a.replace(m,b)};k=function(b){b=(""+b).replace(/\r\n?/g,"\n").match(g)||[];for(var c=0,f=" ",k=0,m=b.length;k=s?" ":/url\(/i.test(p)?"url("+a(p.replace(n,""),e)+")":p;if(f!=p||" "!=p)b[c++]=f=p}b.length=c;return b}})();"undefined"!==typeof window&&(window.lexCss=k,window.decodeCss=l);var m=function(){function b(a){a=(""+a).match(n);return!a?f:new g(k(a[1]),k(a[2]),k(a[3]),k(a[4]),k(a[5]),k(a[6]),k(a[7]))}function a(b,e){return"string"==typeof b?encodeURI(b).replace(e,d):f}function d(b){b=b.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(b>>4&15)+"0123456789ABCDEF".charAt(b&15)}function e(b){if(b=== f)return f;b=b.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/");for(var a=l,d;(d=b.replace(a,"$1"))!=b;b=d);return b}function c(b,a){var d=b.T(),f=a.K();f?d.ga(a.j):f=a.X();f?d.da(a.n):f=a.Y();f?d.ea(a.k):f=a.$();var g=a.g,k=e(g);if(f)d.ca(a.V()),k=k&&k.replace(m,"");else if(f=!!g){if(47!==k.charCodeAt(0))var k=e(d.g||"").replace(m,""),l=k.lastIndexOf("/")+1,k=e((l?k.substring(0,l):"")+e(g)).replace(m,"")}else k=k&&k.replace(m,""),k!==g&&d.G(k);f?d.G(k):f=a.aa();f?d.O(a.l):f=a.Z();f&&d.fa(a.o); return d}function g(b,a,d,e,c,f,k){this.j=b;this.n=a;this.k=d;this.h=e;this.g=c;this.l=f;this.o=k}function k(b){return"string"==typeof b&&0]/g,C={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a", -"\x3c":"%3c","\x3e":"%3e"},E=/^(?:([^:/?# ]+):)?/,G=/^(?:https?|mailto|data)$/i;n=function(){var a={};return function P(d,c,f,g,m){d=D(d);var n=e[d];if(!n||"object"!==typeof n)c.length=0;else{for(var p=n.cssPropBits,q=p&80,t=p&1536,s=NaN,x=0,I=0;x=E)z=p&1?z:"";else if(G=z.charCodeAt(1),C=z.charCodeAt(2),H=48<=G&&57>=G,B=48<=C&&57>=C,43===E&&(H||46===G&&B))z=p&1?(H?"":"0")+z.substring(1):"";else if(45===E&&(H||46===G&&B))z=p&4?(H?"-":"-0")+z.substring(1):p&1?"0":"";else if(46===E&&H)z=p&1?"0"+z:"";else if('url("'===z.substring(0, -5))z=f&&p&16?b(u(k(g,c[x].substring(5,z.length-2)),d,f)):"";else if("("===z.charAt(z.length-1))a:{T=c;fa=x;z=1;ca=fa+1;for(E=T.length;ca]/g,C={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a", +"\x3c":"%3c","\x3e":"%3e"},F=/^(?:([^:/?# ]+):)?/,G=/^(?:https?|mailto|data)$/i;n=function(){var a={};return function P(d,c,f,g,m){d=D(d);var n=e[d];if(!n||"object"!==typeof n)c.length=0;else{for(var p=n.cssPropBits,q=p&80,s=p&1536,t=NaN,x=0,I=0;x=F)z=p&1?z:"";else if(G=z.charCodeAt(1),C=z.charCodeAt(2),H=48<=G&&57>=G,B=48<=C&&57>=C,43===F&&(H||46===G&&B))z=p&1?(H?"":"0")+z.substring(1):"";else if(45===F&&(H||46===G&&B))z=p&4?(H?"-":"-0")+z.substring(1):p&1?"0":"";else if(46===F&&H)z=p&1?"0"+z:"";else if('url("'===z.substring(0, +5))z=f&&p&16?b(u(k(g,c[x].substring(5,z.length-2)),d,f)):"";else if("("===z.charAt(z.length-1))a:{T=c;fa=x;z=1;ca=fa+1;for(F=T.length;cag&&" "===d[l-1]&&--l;f.startAtrule&&f.startAtrule(d[k].toLowerCase(),d.slice(g,l));e="{"===d[e]?a(d,e,c,f):e+1;f.endAtrule&&f.endAtrule()}return e}function a(c,f,g,k){++f;for(k.startBlock&&k.startBlock();fm)return m=~m,m===k?m+1:m;var n=b[m];if("{"!==n)return m===k?m+1:m;a=m+1;m>k&&" "===b[m-1]&&--m;for(g.startRuleset&&g.startRuleset(b.slice(k,m));an)n=~n;else{for(var p=[],q=0,t=a;tn)n=~n;else{for(var p=[],q=0,s=a;s])/g;c=b+"";if(ja)c=c.split(g);else{for(var k=[],l=0,m;(m=g.exec(c))!==f;)k.push(c.substring(l,m.index)),k.push(m[0]),l=m.index+m[0].length;k.push(c.substring(l));c=k}q(a,c,0,{r:d,C:d},e)}}function p(b,a,d,e,c){return function(){q(b,a,d,e,c)}}function q(a,d,e,f,g){try{a.H&&0==e&&a.H(g);for(var k,l,m,n=d.length;ec)){for(f=g.length;--f>c;){var k=g[f].v;b.f[k]&b.c.OPTIONAL_ENDTAG||e.push("\x3c/",k,"\x3e")}c/g,Y=/\"/g,T=/^\s*([-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,ja=3==="a,b".split(/(,)/).length,fa=b.c.CDATA|b.c.RCDATA,ca={},ga={},ka=/^(?:https?|mailto|data)$/i,ha={};ha.pa=ha.escapeAttrib=k;ha.ra=ha.makeHtmlSanitizer=u;ha.sa=ha.makeSaxParser=n;ha.ta=ha.makeTagPolicy=V;ha.wa=ha.normalizeRCData=l; ha.xa=ha.sanitize=function(b,a,d,e){return Q(b,V(a,d,e))};ha.ya=ha.sanitizeAttribs=W;ha.za=ha.sanitizeWithPolicy=Q;ha.Ba=ha.unescapeEntities=g;return ha}(x);g=b.sanitize;"undefined"!==typeof window&&(window.html=b,window.html_sanitize=g)})(); !function(a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=a()}(function(){return function c(f,d,b){function e(k,m){if(!d[k]){if(!f[k]){var n="function"==typeof require&&require;if(!m&&n)return n(k,!0);if(g)return g(k,!0);n=Error("Cannot find module '"+k+"'");throw n.code="MODULE_NOT_FOUND",n;}n=d[k]={exports:{}}; @@ -102,8 +102,8 @@ new b(e);if(c.push(d,!0),c.err)throw c.msg;return c.result}var g=c("./zlib/defla f.avail_out&&(f.output=new k.Buf8(m),f.next_out=0,f.avail_out=m),e=g.deflate(f,c),1!==e&&e!==s)return this.onEnd(e),this.ended=!0,!1;0!==f.avail_out&&(0!==f.avail_in||4!==c&&2!==c)||("string"===this.options.to?this.onData(l.buf2binstring(k.shrinkBuf(f.output,f.next_out))):this.onData(k.shrinkBuf(f.output,f.next_out)))}while((0e.windowBits&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15));!(0<=e.windowBits&&16>e.windowBits)||d&&d.windowBits||(e.windowBits+=32);15e.windowBits&&0===(15&e.windowBits)&&(e.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new p;this.strm.avail_out=0;d=g.inflateInit2(this.strm,e.windowBits);if(d!==m.Z_OK)throw Error(n[d]); -this.header=new s;g.inflateGetHeader(this.strm,this.header)}function e(d,e){var c=new b(e);if(c.push(d,!0),c.err)throw c.msg;return c.result}var g=c("./zlib/inflate"),k=c("./utils/common"),l=c("./utils/strings"),m=c("./zlib/constants"),n=c("./zlib/messages"),p=c("./zlib/zstream"),s=c("./zlib/gzheader"),t=Object.prototype.toString;b.prototype.push=function(b,d){var e,c,f,n,p,s,B=this.strm,C=this.options.chunkSize,E=this.options.dictionary,G=!1;if(this.ended)return!1;c=d===~~d?d:!0===d?m.Z_FINISH:m.Z_NO_FLUSH; -"string"==typeof b?B.input=l.binstring2buf(b):"[object ArrayBuffer]"===t.call(b)?B.input=new Uint8Array(b):B.input=b;B.next_in=0;B.avail_in=B.input.length;do{if(0===B.avail_out&&(B.output=new k.Buf8(C),B.next_out=0,B.avail_out=C),e=g.inflate(B,m.Z_NO_FLUSH),e===m.Z_NEED_DICT&&E&&(s="string"==typeof E?l.string2buf(E):"[object ArrayBuffer]"===t.call(E)?new Uint8Array(E):E,e=g.inflateSetDictionary(this.strm,s)),e===m.Z_BUF_ERROR&&!0===G&&(e=m.Z_OK,G=!1),e!==m.Z_STREAM_END&&e!==m.Z_OK)return this.onEnd(e), +this.header=new s;g.inflateGetHeader(this.strm,this.header)}function e(d,e){var c=new b(e);if(c.push(d,!0),c.err)throw c.msg;return c.result}var g=c("./zlib/inflate"),k=c("./utils/common"),l=c("./utils/strings"),m=c("./zlib/constants"),n=c("./zlib/messages"),p=c("./zlib/zstream"),s=c("./zlib/gzheader"),t=Object.prototype.toString;b.prototype.push=function(b,d){var e,c,f,n,p,s,B=this.strm,C=this.options.chunkSize,F=this.options.dictionary,G=!1;if(this.ended)return!1;c=d===~~d?d:!0===d?m.Z_FINISH:m.Z_NO_FLUSH; +"string"==typeof b?B.input=l.binstring2buf(b):"[object ArrayBuffer]"===t.call(b)?B.input=new Uint8Array(b):B.input=b;B.next_in=0;B.avail_in=B.input.length;do{if(0===B.avail_out&&(B.output=new k.Buf8(C),B.next_out=0,B.avail_out=C),e=g.inflate(B,m.Z_NO_FLUSH),e===m.Z_NEED_DICT&&F&&(s="string"==typeof F?l.string2buf(F):"[object ArrayBuffer]"===t.call(F)?new Uint8Array(F):F,e=g.inflateSetDictionary(this.strm,s)),e===m.Z_BUF_ERROR&&!0===G&&(e=m.Z_OK,G=!1),e!==m.Z_STREAM_END&&e!==m.Z_OK)return this.onEnd(e), this.ended=!0,!1;B.next_out&&(0!==B.avail_out&&e!==m.Z_STREAM_END&&(0!==B.avail_in||c!==m.Z_FINISH&&c!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(f=l.utf8border(B.output,B.next_out),n=B.next_out-f,p=l.buf2string(B.output,f),B.next_out=n,B.avail_out=C-n,n&&k.arraySet(B.output,B.output,f,n,0),this.onData(p)):this.onData(k.shrinkBuf(B.output,B.next_out))));0===B.avail_in&&0===B.avail_out&&(G=!0)}while((0c;c++)n[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<= c?(d[k++]=192|c>>>6,d[k++]=128|63&c):65536>c?(d[k++]=224|c>>>12,d[k++]=128|c>>>6&63,d[k++]=128|63&c):(d[k++]=240|c>>>18,d[k++]=128|c>>>12&63,d[k++]=128|c>>>6&63,d[k++]=128|63&c);return d};d.buf2binstring=function(d){return b(d,d.length)};d.binstring2buf=function(b){for(var d=new e.Buf8(b.length),c=0,f=d.length;cg)m[f++]=g;else if(k=n[g],4g?m[f++]=g:(g-=65536,m[f++]=55296|g>>10&1023,m[f++]=56320|1023&g)}return b(m,f)};d.utf8border=function(b,d){var e;d=d||b.length;d>b.length&&(d=b.length);for(e=d-1;0<=e&&128===(192&b[e]);)e--;return 0>e?d:0===e?d:e+n[b[e]]>d?e:d}},{"./common":3}],5:[function(c,f,d){f.exports=function(b,d,c,f){var l=65535&b|0;b=b>>>16&65535|0;for(var m=0;0!==c;){m=2E3c;c++){b=c; -for(var f=0;8>f;f++)b=1&b?3988292384^b>>>1:b>>>1;d[c]=b}return d}();f.exports=function(d,c,f,l){f=l+f;for(d^=-1;l>>8^b[255&(d^c[l])];return d^-1}},{}],8:[function(c,f,d){function b(b,d){return b.msg=E[d],d}function e(b){for(var d=b.length;0<=--d;)b[d]=0}function g(b){var d=b.state,e=d.pending;e>b.avail_out&&(e=b.avail_out);0!==e&&(y.arraySet(b.output,d.pending_buf,d.pending_out,e,b.next_out),b.next_out+=e,d.pending_out+=e,b.total_out+=e,b.avail_out-=e,d.pending-=e,0===d.pending&&(d.pending_out= -0))}function k(b,d){D._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,d);b.block_start=b.strstart;g(b.strm)}function l(b,d){b.pending_buf[b.pending++]=d}function m(b,d){b.pending_buf[b.pending++]=d>>>8&255;b.pending_buf[b.pending++]=255&d}function n(b,d){var e,c,f=b.max_chain_length,g=b.strstart,k=b.prev_length,l=b.nice_match,m=b.strstart>b.w_size-X?b.strstart-(b.w_size-X):0,n=b.window,p=b.w_mask,q=b.prev,t=b.strstart+R,s=n[g+k-1],u=n[g+k];b.prev_length>=b.good_match&& -(f>>=2);l>b.lookahead&&(l=b.lookahead);do if(e=d,n[e+k]===u&&n[e+k-1]===s&&n[e]===n[g]&&n[++e]===n[g+1]){g+=2;e++;do;while(n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&gk){if(b.match_start=d,k=c,c>=l)break;s=n[g+k-1];u=n[g+k]}}while((d=q[d&p])>m&&0!==--f);return k<=b.lookahead?k:b.lookahead}function p(b){var d,e,c,f,g=b.w_size;do{if(f=b.window_size-b.lookahead-b.strstart,b.strstart>= +for(var f=0;8>f;f++)b=1&b?3988292384^b>>>1:b>>>1;d[c]=b}return d}();f.exports=function(d,c,f,l){f=l+f;for(d^=-1;l>>8^b[255&(d^c[l])];return d^-1}},{}],8:[function(c,f,d){function b(b,d){return b.msg=F[d],d}function e(b){for(var d=b.length;0<=--d;)b[d]=0}function g(b){var d=b.state,e=d.pending;e>b.avail_out&&(e=b.avail_out);0!==e&&(y.arraySet(b.output,d.pending_buf,d.pending_out,e,b.next_out),b.next_out+=e,d.pending_out+=e,b.total_out+=e,b.avail_out-=e,d.pending-=e,0===d.pending&&(d.pending_out= +0))}function k(b,d){D._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,d);b.block_start=b.strstart;g(b.strm)}function l(b,d){b.pending_buf[b.pending++]=d}function m(b,d){b.pending_buf[b.pending++]=d>>>8&255;b.pending_buf[b.pending++]=255&d}function n(b,d){var e,c,f=b.max_chain_length,g=b.strstart,k=b.prev_length,l=b.nice_match,m=b.strstart>b.w_size-X?b.strstart-(b.w_size-X):0,n=b.window,p=b.w_mask,q=b.prev,s=b.strstart+R,t=n[g+k-1],u=n[g+k];b.prev_length>=b.good_match&& +(f>>=2);l>b.lookahead&&(l=b.lookahead);do if(e=d,n[e+k]===u&&n[e+k-1]===t&&n[e]===n[g]&&n[++e]===n[g+1]){g+=2;e++;do;while(n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&n[++g]===n[++e]&&gk){if(b.match_start=d,k=c,c>=l)break;t=n[g+k-1];u=n[g+k]}}while((d=q[d&p])>m&&0!==--f);return k<=b.lookahead?k:b.lookahead}function p(b){var d,e,c,f,g=b.w_size;do{if(f=b.window_size-b.lookahead-b.strstart,b.strstart>= g+(g-X)){y.arraySet(b.window,b.window,g,g,0);b.match_start-=g;b.strstart-=g;b.block_start-=g;d=e=b.hash_size;do c=b.head[--d],b.head[d]=c>=g?c-g:0;while(--e);d=e=g;do c=b.prev[--d],b.prev[d]=c>=g?c-g:0;while(--e);f+=g}if(0===b.strm.avail_in)break;d=b.strm;c=b.window;var k=b.strstart+b.lookahead,l=d.avail_in;if(e=(l>f&&(l=f),0===l?0:(d.avail_in-=l,y.arraySet(c,d.input,d.next_in,l,k),1===d.state.wrap?d.adler=B(d.adler,c,l,k):2===d.state.wrap&&(d.adler=C(d.adler,c,l,k)),d.next_in+=l,d.total_in+=l,l)), b.lookahead+=e,b.lookahead+b.insert>=J){f=b.strstart-b.insert;b.ins_h=b.window[f];for(b.ins_h=(b.ins_h<=J&&(b.ins_h=(b.ins_h<< b.hash_shift^b.window[b.strstart+J-1])&b.hash_mask,e=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),0!==e&&b.strstart-e<=b.w_size-X&&(b.match_length=n(b,e)),b.match_length>=J)if(c=D._tr_tally(b,b.strstart-b.match_start,b.match_length-J),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=J){b.match_length--;do b.strstart++,b.ins_h=(b.ins_h<e.wrap&&(e.wrap=-e.wrap),e.status=e.wrap?ea:da,d.adler=2===e.wrap?0:1,e.last_flush=G,D._tr_init(e),H):b(d,K)}function v(b){var d=x(b);d===H&&(b=b.state,b.window_size=2*b.w_size,e(b.head),b.max_lazy_match=A[b.level].max_lazy,b.good_match=A[b.level].good_length,b.nice_match=A[b.level].nice_length,b.max_chain_length=A[b.level].max_chain,b.strstart=0,b.block_start= -0,b.lookahead=0,b.insert=0,b.match_length=b.prev_length=J-1,b.match_available=0,b.ins_h=0);return d}function z(d,e,c,f,g,k){if(!d)return K;var l=1;if(e===L&&(e=6),0>f?(l=0,f=-f):15g||g>F||c!==Q||8>f||15e||9k||k>W)return b(d,K);8===f&&(f=9);var m=new u;return d.state=m,m.strm=d,m.wrap=l,m.gzhead=null,m.w_bits=f,m.w_size=1<f?(l=0,f=-f):15g||g>E||c!==Q||8>f||15e||9k||k>W)return b(d,K);8===f&&(f=9);var m=new u;return d.state=m,m.strm=d,m.wrap=l,m.gzhead=null,m.w_bits=f,m.w_size=1<b.pending_buf_size-5&&(e=b.pending_buf_size-5);;){if(1>=b.lookahead){if(p(b),0===b.lookahead&&d===G)return U;if(0===b.lookahead)break}b.strstart+=b.lookahead;b.lookahead=0;var c=b.block_start+e;if((0===b.strstart||b.strstart>=c)&&(b.lookahead=b.strstart-c,b.strstart=c,k(b,!1),0===b.strm.avail_out)||b.strstart-b.block_start>=b.w_size-X&&(k(b,!1),0===b.strm.avail_out))return U}return b.insert=0,d===I?(k(b,!0),0===b.strm.avail_out?ba:Y):(b.strstart>b.block_start&&k(b,!1),U)}),new q(4, -4,8,4,s),new q(4,5,16,8,s),new q(4,6,32,32,s),new q(4,4,16,16,t),new q(8,16,32,32,t),new q(8,16,128,128,t),new q(8,32,128,256,t),new q(32,128,258,1024,t),new q(32,258,258,4096,t)];d.deflateInit=function(b,d){return z(b,d,Q,15,8,0)};d.deflateInit2=z;d.deflateReset=v;d.deflateResetKeep=x;d.deflateSetHeader=function(b,d){return b&&b.state?2!==b.state.wrap?K:(b.state.gzhead=d,H):K};d.deflate=function(d,c){var f,n,q,t;if(!d||!d.state||5c)return d?b(d,K):K;if(n=d.state,!d.output||!d.input&&0!==d.avail_in|| +4,8,4,s),new q(4,5,16,8,s),new q(4,6,32,32,s),new q(4,4,16,16,t),new q(8,16,32,32,t),new q(8,16,128,128,t),new q(8,32,128,256,t),new q(32,128,258,1024,t),new q(32,258,258,4096,t)];d.deflateInit=function(b,d){return z(b,d,Q,15,8,0)};d.deflateInit2=z;d.deflateReset=v;d.deflateResetKeep=x;d.deflateSetHeader=function(b,d){return b&&b.state?2!==b.state.wrap?K:(b.state.gzhead=d,H):K};d.deflate=function(d,c){var f,n,q,s;if(!d||!d.state||5c)return d?b(d,K):K;if(n=d.state,!d.output||!d.input&&0!==d.avail_in|| 666===n.status&&c!==I)return b(d,0===d.avail_out?-5:K);if(n.strm=d,f=n.last_flush,n.last_flush=c,n.status===ea)2===n.wrap?(d.adler=0,l(n,31),l(n,139),l(n,8),n.gzhead?(l(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),l(n,255&n.gzhead.time),l(n,n.gzhead.time>>8&255),l(n,n.gzhead.time>>16&255),l(n,n.gzhead.time>>24&255),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(l(n,255&n.gzhead.extra.length), -l(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(d.adler=C(d.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(l(n,0),l(n,0),l(n,0),l(n,0),l(n,0),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,3),n.status=da)):(q=Q+(n.w_bits-8<<4)<<8,t=2<=n.strategy||2>n.level?0:6>n.level?1:6===n.level?2:3,q|=t<<6,0!==n.strstart&&(q|=32),n.status=da,m(n,q+(31-q%31)),0!==n.strstart&&(m(n,d.adler>>>16),m(n,65535&d.adler)),d.adler=1);if(69===n.status)if(n.gzhead.extra){for(q=n.pending;n.gzindex<(65535& +l(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(d.adler=C(d.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(l(n,0),l(n,0),l(n,0),l(n,0),l(n,0),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,3),n.status=da)):(q=Q+(n.w_bits-8<<4)<<8,s=2<=n.strategy||2>n.level?0:6>n.level?1:6===n.level?2:3,q|=s<<6,0!==n.strstart&&(q|=32),n.status=da,m(n,q+(31-q%31)),0!==n.strstart&&(m(n,d.adler>>>16),m(n,65535&d.adler)),d.adler=1);if(69===n.status)if(n.gzhead.extra){for(q=n.pending;n.gzindex<(65535& n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>q&&(d.adler=C(d.adler,n.pending_buf,n.pending-q,q)),g(d),q=n.pending,n.pending!==n.pending_buf_size));)l(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>q&&(d.adler=C(d.adler,n.pending_buf,n.pending-q,q));n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){q=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>q&& -(d.adler=C(d.adler,n.pending_buf,n.pending-q,q)),g(d),q=n.pending,n.pending===n.pending_buf_size)){t=1;break}t=n.gzindexq&&(d.adler=C(d.adler,n.pending_buf,n.pending-q,q));0===t&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){q=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>q&&(d.adler=C(d.adler,n.pending_buf,n.pending-q,q)),g(d), -q=n.pending,n.pending===n.pending_buf_size)){t=1;break}t=n.gzindexq&&(d.adler=C(d.adler,n.pending_buf,n.pending-q,q));0===t&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&g(d),n.pending+2<=n.pending_buf_size&&(l(n,255&d.adler),l(n,d.adler>>8&255),d.adler=0,n.status=da)):n.status=da),0!==n.pending){if(g(d),0===d.avail_out)return n.last_flush= --1,H}else if(0===d.avail_in&&(c<<1)-(4=J&&0n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>= -J?(s=D._tr_tally(n,1,n.match_length-J),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(s=D._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),s&&(k(n,!1),0===n.strm.avail_out)){s=U;break a}}s=(n.insert=0,c===I?(k(n,!0),0===n.strm.avail_out?ba:Y):n.last_lit&&(k(n,!1),0===n.strm.avail_out)?U:aa)}else s=A[n.level].func(n,c);if(s!==ba&&s!==Y||(n.status=666),s===U||s===ba)return 0===d.avail_out&&(n.last_flush=-1),H;if(s===aa&&(1===c?D._tr_align(n):5!==c&&(D._tr_stored_block(n, +(d.adler=C(d.adler,n.pending_buf,n.pending-q,q)),g(d),q=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexq&&(d.adler=C(d.adler,n.pending_buf,n.pending-q,q));0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){q=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>q&&(d.adler=C(d.adler,n.pending_buf,n.pending-q,q)),g(d), +q=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexq&&(d.adler=C(d.adler,n.pending_buf,n.pending-q,q));0===s&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&g(d),n.pending+2<=n.pending_buf_size&&(l(n,255&d.adler),l(n,d.adler>>8&255),d.adler=0,n.status=da)):n.status=da),0!==n.pending){if(g(d),0===d.avail_out)return n.last_flush= +-1,H}else if(0===d.avail_in&&(c<<1)-(4=J&&0n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>= +J?(t=D._tr_tally(n,1,n.match_length-J),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(t=D._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),t&&(k(n,!1),0===n.strm.avail_out)){t=U;break a}}t=(n.insert=0,c===I?(k(n,!0),0===n.strm.avail_out?ba:Y):n.last_lit&&(k(n,!1),0===n.strm.avail_out)?U:aa)}else t=A[n.level].func(n,c);if(t!==ba&&t!==Y||(n.status=666),t===U||t===ba)return 0===d.avail_out&&(n.last_flush=-1),H;if(t===aa&&(1===c?D._tr_align(n):5!==c&&(D._tr_stored_block(n, 0,0,!1),3===c&&(e(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),g(d),0===d.avail_out))return n.last_flush=-1,H}return c!==I?H:0>=n.wrap?1:(2===n.wrap?(l(n,255&d.adler),l(n,d.adler>>8&255),l(n,d.adler>>16&255),l(n,d.adler>>24&255),l(n,255&d.total_in),l(n,d.total_in>>8&255),l(n,d.total_in>>16&255),l(n,d.total_in>>24&255)):(m(n,d.adler>>>16),m(n,65535&d.adler)),g(d),0=c.w_size&&(0===k&&(e(c.head),c.strstart=0,c.block_start=0,c.insert=0),l=new y.Buf8(c.w_size),y.arraySet(l,d,f-c.w_size,c.w_size,0),d=l,f=c.w_size);l=b.avail_in;m=b.next_in;n=b.input;b.avail_in=f;b.next_in= 0;b.input=d;for(p(c);c.lookahead>=J;){f=c.strstart;g=c.lookahead-(J-1);do c.ins_h=(c.ins_h<z&&(v+=K[f++]<>>24,v>>>=E,z-=E,E=C>>>16&255,0===E)L[m++]=65535&C;else{if(!(16&E)){if(0===(64&E)){C=A[(65535&C)+(v&(1<>>=E,z-=E);15>z&&(v+=K[f++]<>>24,v>>>=E,z-=E,E=C>>>16&255, -!(16&E)){if(0===(64&E)){C=y[(65535&C)+(v&(1<s){b.msg="invalid distance too far back";c.mode=30;break a}if(v>>>=E,z-=E,E=m-n,I>E){if(E=I-E,E>q&&c.sane){b.msg="invalid distance too far back";c.mode=30;break a}if(C=0,H=x,0===u){if(C+=t-E,E>3;f-=G;z-=G<<3;b.next_in=f;b.next_out=m;b.avail_in=fz&&(v+=K[f++]<>>24,v>>>=F,z-=F,F=C>>>16&255,0===F)L[m++]=65535&C;else{if(!(16&F)){if(0===(64&F)){C=A[(65535&C)+(v&(1<>>=F,z-=F);15>z&&(v+=K[f++]<>>24,v>>>=F,z-=F,F=C>>>16&255, +!(16&F)){if(0===(64&F)){C=y[(65535&C)+(v&(1<s){b.msg="invalid distance too far back";c.mode=30;break a}if(v>>>=F,z-=F,F=m-n,I>F){if(F=I-F,F>q&&c.sane){b.msg="invalid distance too far back";c.mode=30;break a}if(C=0,H=x,0===u){if(C+=t-F,F>3;f-=G;z-=G<<3;b.next_in=f;b.next_out=m;b.avail_in=f>>24&255)+(b>>>8&65280)+((65280&b)<<8)+((255&b)<<24)}function e(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new t.Buf16(320);this.work= new t.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(b){var d;return b&&b.state?(d=b.state,b.total_in=b.total_out=d.total=0,b.msg="",d.wrap&&(b.adler=1&d.wrap),d.mode=y,d.last=0,d.havedict=0,d.dmax=32768,d.head=null,d.hold=0,d.bits=0,d.lencode=d.lendyn=new t.Buf32(D),d.distcode=d.distdyn=new t.Buf32(B),d.sane=1,d.back=-1,z):A}function k(b){var d;return b&&b.state?(d=b.state,d.wsize=0,d.whave=0,d.wnext=0,g(b)):A}function l(b,d){var e,c;return b&&b.state?(c=b.state, 0>d?(e=0,d=-d):(e=(d>>4)+1,48>d&&(d&=15)),d&&(8>d||15=b.wsize?(t.arraySet(b.window,d,e-b.wsize,b.wsize,0),b.wnext=0,b.whave=b.wsize):(f=b.wsize-b.wnext,f>c&&(f=c),t.arraySet(b.window,d,e- -c,f,b.wnext),c-=f,c?(t.arraySet(b.window,d,e-c,c,0),b.wnext=c,b.whave=b.wsize):(b.wnext+=f,b.wnext===b.wsize&&(b.wnext=0),b.whaveF;){if(0===m)break a;m--;B+=f[k++]<>>8&255;c.check=u(c.check,T,2,0);F=B=0;c.mode=2;break}if(c.flags=0,c.head&&(c.head.done=!1), -!(1&c.wrap)||(((255&B)<<8)+(B>>8))%31){d.msg="incorrect header check";c.mode=30;break}if(8!==(15&B)){d.msg="unknown compression method";c.mode=30;break}if(B>>>=4,F-=4,U=(15&B)+8,0===c.wbits)c.wbits=U;else if(U>c.wbits){d.msg="invalid window size";c.mode=30;break}c.dmax=1<F;){if(0===m)break a;m--;B+=f[k++]<>8&1);512&c.flags&&(T[0]=255&B,T[1]=B>>>8&255,c.check=u(c.check,T,2,0));F=B=0;c.mode=3;case 3:for(;32>F;){if(0===m)break a;m--;B+=f[k++]<>>8&255,T[2]=B>>>16&255,T[3]=B>>>24&255,c.check=u(c.check,T,4,0));F=B=0;c.mode=4;case 4:for(;16>F;){if(0===m)break a;m--;B+=f[k++]<>8);512&c.flags&&(T[0]=255&B,T[1]=B>>>8&255,c.check=u(c.check,T,2,0));F=B=0;c.mode= -5;case 5:if(1024&c.flags){for(;16>F;){if(0===m)break a;m--;B+=f[k++]<>>8&255,c.check=u(c.check,T,2,0));F=B=0}else c.head&&(c.head.extra=null);c.mode=6;case 6:if(1024&c.flags&&(M=c.length,M>m&&(M=m),M&&(c.head&&(U=c.head.extra_len-c.length,c.head.extra||(c.head.extra=Array(c.head.extra_len)),t.arraySet(c.head.extra,f,k,M,U)),512&c.flags&&(c.check=u(c.check,f,M,k)),m-=M,k+=M,c.length-=M),c.length))break a;c.length=0;c.mode= +c,f,b.wnext),c-=f,c?(t.arraySet(b.window,d,e-c,c,0),b.wnext=c,b.whave=b.wsize):(b.wnext+=f,b.wnext===b.wsize&&(b.wnext=0),b.whaveE;){if(0===m)break a;m--;B+=f[k++]<>>8&255;c.check=u(c.check,T,2,0);E=B=0;c.mode=2;break}if(c.flags=0,c.head&&(c.head.done=!1), +!(1&c.wrap)||(((255&B)<<8)+(B>>8))%31){d.msg="incorrect header check";c.mode=30;break}if(8!==(15&B)){d.msg="unknown compression method";c.mode=30;break}if(B>>>=4,E-=4,U=(15&B)+8,0===c.wbits)c.wbits=U;else if(U>c.wbits){d.msg="invalid window size";c.mode=30;break}c.dmax=1<E;){if(0===m)break a;m--;B+=f[k++]<>8&1);512&c.flags&&(T[0]=255&B,T[1]=B>>>8&255,c.check=u(c.check,T,2,0));E=B=0;c.mode=3;case 3:for(;32>E;){if(0===m)break a;m--;B+=f[k++]<>>8&255,T[2]=B>>>16&255,T[3]=B>>>24&255,c.check=u(c.check,T,4,0));E=B=0;c.mode=4;case 4:for(;16>E;){if(0===m)break a;m--;B+=f[k++]<>8);512&c.flags&&(T[0]=255&B,T[1]=B>>>8&255,c.check=u(c.check,T,2,0));E=B=0;c.mode= +5;case 5:if(1024&c.flags){for(;16>E;){if(0===m)break a;m--;B+=f[k++]<>>8&255,c.check=u(c.check,T,2,0));E=B=0}else c.head&&(c.head.extra=null);c.mode=6;case 6:if(1024&c.flags&&(M=c.length,M>m&&(M=m),M&&(c.head&&(U=c.head.extra_len-c.length,c.head.extra||(c.head.extra=Array(c.head.extra_len)),t.arraySet(c.head.extra,f,k,M,U)),512&c.flags&&(c.check=u(c.check,f,M,k)),m-=M,k+=M,c.length-=M),c.length))break a;c.length=0;c.mode= 7;case 7:if(2048&c.flags){if(0===m)break a;M=0;do U=f[k+M++],c.head&&U&&65536>c.length&&(c.head.name+=String.fromCharCode(U));while(U&&Mc.length&&(c.head.comment+=String.fromCharCode(U));while(U&&MF;){if(0===m)break a;m--;B+=f[k++]<>9&1,c.head.done=!0);d.adler=c.check=0;c.mode=12;break;case 10:for(;32>F;){if(0===m)break a;m--;B+=f[k++]<>>= -7&F;F-=7&F;c.mode=27;break}for(;3>F;){if(0===m)break a;m--;B+=f[k++]<>>=1,F-=1,3&B){case 0:c.mode=14;break;case 1:N=c;if(C){p=new t.Buf32(512);s=new t.Buf32(32);for(R=0;144>R;)N.lens[R++]=8;for(;256>R;)N.lens[R++]=9;for(;280>R;)N.lens[R++]=7;for(;288>R;)N.lens[R++]=8;v(1,N.lens,0,288,p,0,N.work,{bits:9});for(R=0;32>R;)N.lens[R++]=5;v(2,N.lens,0,32,s,0,N.work,{bits:5});C=!1}N.lencode=p;N.lenbits=9;N.distcode=s;N.distbits=5;if(c.mode=20,6===e){B>>>=2;F-=2;break a}break;case 2:c.mode= -17;break;case 3:d.msg="invalid block type",c.mode=30}B>>>=2;F-=2;break;case 14:B>>>=7&F;for(F-=7&F;32>F;){if(0===m)break a;m--;B+=f[k++]<>>16^65535)){d.msg="invalid stored block lengths";c.mode=30;break}if(c.length=65535&B,B=0,F=0,c.mode=15,6===e)break a;case 15:c.mode=16;case 16:if(M=c.length){if(M>m&&(M=m),M>D&&(M=D),0===M)break a;t.arraySet(g,f,k,M,l);m-=M;k+=M;D-=M;l+=M;c.length-=M;break}c.mode=12;break;case 17:for(;14>F;){if(0===m)break a;m--;B+=f[k++]<>>=5,F-=5,c.ndist=(31&B)+1,B>>>=5,F-=5,c.ncode=(15&B)+4,B>>>=4,F-=4,286F;){if(0===m)break a;m--;B+=f[k++]<>>=3;F-=3}for(;19>c.have;)c.lens[ja[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,ba={bits:c.lenbits},aa=v(0,c.lens,0,19,c.lencode,0,c.work,ba),c.lenbits=ba.bits,aa){d.msg="invalid code lengths set";c.mode=30; -break}c.have=0;c.mode=19;case 19:for(;c.have>>24,R=65535&Y,!(J<=F);){if(0===m)break a;m--;B+=f[k++]<R)B>>>=J,F-=J,c.lens[c.have++]=R;else{if(16===R){for(N=J+2;F>>=J,F-=J,0===c.have){d.msg="invalid bit length repeat";c.mode=30;break}U=c.lens[c.have-1];M=3+(3&B);B>>>=2;F-=2}else if(17===R){for(N=J+3;F>>=J;F-=J;U=0;M=3+(7&B);B>>>=3;F-= -3}else{for(N=J+7;F>>=J;F-=J;U=0;M=11+(127&B);B>>>=7;F-=7}if(c.have+M>c.nlen+c.ndist){d.msg="invalid bit length repeat";c.mode=30;break}for(;M--;)c.lens[c.have++]=U}}if(30===c.mode)break;if(0===c.lens[256]){d.msg="invalid code -- missing end-of-block";c.mode=30;break}if(c.lenbits=9,ba={bits:c.lenbits},aa=v(1,c.lens,0,c.nlen,c.lencode,0,c.work,ba),c.lenbits=ba.bits,aa){d.msg="invalid literal/lengths set";c.mode=30;break}if(c.distbits=6,c.distcode=c.distdyn, -ba={bits:c.distbits},aa=v(2,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,ba),c.distbits=ba.bits,aa){d.msg="invalid distances set";c.mode=30;break}if(c.mode=20,6===e)break a;case 20:c.mode=21;case 21:if(6<=m&&258<=D){d.next_out=l;d.avail_out=D;d.next_in=k;d.avail_in=m;c.hold=B;c.bits=F;x(d,O);l=d.next_out;g=d.output;D=d.avail_out;k=d.next_in;f=d.input;m=d.avail_in;B=c.hold;F=c.bits;12===c.mode&&(c.back=-1);break}for(c.back=0;Y=c.lencode[B&(1<>>24,N=Y>>>16&255,R=65535&Y,!(J<=F);){if(0=== -m)break a;m--;B+=f[k++]<>X)],J=Y>>>24,N=Y>>>16&255,R=65535&Y,!(X+J<=F);){if(0===m)break a;m--;B+=f[k++]<>>=X;F-=X;c.back+=X}if(B>>>=J,F-=J,c.back+=J,c.length=R,0===N){c.mode=26;break}if(32&N){c.back=-1;c.mode=12;break}if(64&N){d.msg="invalid literal/length code";c.mode=30;break}c.extra=15&N;c.mode=22;case 22:if(c.extra){for(N=c.extra;F>>=c.extra; -F-=c.extra;c.back+=c.extra}c.was=c.length;c.mode=23;case 23:for(;Y=c.distcode[B&(1<>>24,N=Y>>>16&255,R=65535&Y,!(J<=F);){if(0===m)break a;m--;B+=f[k++]<>X)],J=Y>>>24,N=Y>>>16&255,R=65535&Y,!(X+J<=F);){if(0===m)break a;m--;B+=f[k++]<>>=X;F-=X;c.back+=X}if(B>>>=J,F-=J,c.back+=J,64&N){d.msg="invalid distance code";c.mode=30;break}c.offset=R;c.extra=15&N;c.mode=24;case 24:if(c.extra){for(N=c.extra;F< -N;){if(0===m)break a;m--;B+=f[k++]<>>=c.extra;F-=c.extra;c.back+=c.extra}if(c.offset>c.dmax){d.msg="invalid distance too far back";c.mode=30;break}c.mode=25;case 25:if(0===D)break a;if(M=O-D,c.offset>M){if(M=c.offset-M,M>c.whave&&c.sane){d.msg="invalid distance too far back";c.mode=30;break}M>c.wnext?(M-=c.wnext,Z=c.wsize-M):Z=c.wnext-M;M>c.length&&(M=c.length);N=c.window}else N=g,Z=l-c.offset,M=c.length;M>D&&(M=D);D-=M;c.length-=M;do g[l++]=N[Z++];while(--M); -0===c.length&&(c.mode=21);break;case 26:if(0===D)break a;g[l++]=c.length;D--;c.mode=21;break;case 27:if(c.wrap){for(;32>F;){if(0===m)break a;m--;B|=f[k++]<F;){if(0===m)break a;m--;B+=f[k++]<c.mode&&(27>c.mode||4!==e))&&n(d,d.output,d.next_out,O-d.avail_out)?(c.mode=31,-4):(S-=d.avail_in,O-=d.avail_out,d.total_in+=S,d.total_out+=O,c.total+=O,c.wrap&&O&&(d.adler=c.check=c.flags?u(c.check,g,O,d.next_out-O):q(c.check,g,O,d.next_out-O)),d.data_type=c.bits+(c.last?64:0)+(12===c.mode? +9;case 9:if(512&c.flags){for(;16>E;){if(0===m)break a;m--;B+=f[k++]<>9&1,c.head.done=!0);d.adler=c.check=0;c.mode=12;break;case 10:for(;32>E;){if(0===m)break a;m--;B+=f[k++]<>>= +7&E;E-=7&E;c.mode=27;break}for(;3>E;){if(0===m)break a;m--;B+=f[k++]<>>=1,E-=1,3&B){case 0:c.mode=14;break;case 1:N=c;if(C){p=new t.Buf32(512);s=new t.Buf32(32);for(R=0;144>R;)N.lens[R++]=8;for(;256>R;)N.lens[R++]=9;for(;280>R;)N.lens[R++]=7;for(;288>R;)N.lens[R++]=8;v(1,N.lens,0,288,p,0,N.work,{bits:9});for(R=0;32>R;)N.lens[R++]=5;v(2,N.lens,0,32,s,0,N.work,{bits:5});C=!1}N.lencode=p;N.lenbits=9;N.distcode=s;N.distbits=5;if(c.mode=20,6===e){B>>>=2;E-=2;break a}break;case 2:c.mode= +17;break;case 3:d.msg="invalid block type",c.mode=30}B>>>=2;E-=2;break;case 14:B>>>=7&E;for(E-=7&E;32>E;){if(0===m)break a;m--;B+=f[k++]<>>16^65535)){d.msg="invalid stored block lengths";c.mode=30;break}if(c.length=65535&B,B=0,E=0,c.mode=15,6===e)break a;case 15:c.mode=16;case 16:if(M=c.length){if(M>m&&(M=m),M>D&&(M=D),0===M)break a;t.arraySet(g,f,k,M,l);m-=M;k+=M;D-=M;l+=M;c.length-=M;break}c.mode=12;break;case 17:for(;14>E;){if(0===m)break a;m--;B+=f[k++]<>>=5,E-=5,c.ndist=(31&B)+1,B>>>=5,E-=5,c.ncode=(15&B)+4,B>>>=4,E-=4,286E;){if(0===m)break a;m--;B+=f[k++]<>>=3;E-=3}for(;19>c.have;)c.lens[ja[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,ba={bits:c.lenbits},aa=v(0,c.lens,0,19,c.lencode,0,c.work,ba),c.lenbits=ba.bits,aa){d.msg="invalid code lengths set";c.mode=30; +break}c.have=0;c.mode=19;case 19:for(;c.have>>24,R=65535&Y,!(J<=E);){if(0===m)break a;m--;B+=f[k++]<R)B>>>=J,E-=J,c.lens[c.have++]=R;else{if(16===R){for(N=J+2;E>>=J,E-=J,0===c.have){d.msg="invalid bit length repeat";c.mode=30;break}U=c.lens[c.have-1];M=3+(3&B);B>>>=2;E-=2}else if(17===R){for(N=J+3;E>>=J;E-=J;U=0;M=3+(7&B);B>>>=3;E-= +3}else{for(N=J+7;E>>=J;E-=J;U=0;M=11+(127&B);B>>>=7;E-=7}if(c.have+M>c.nlen+c.ndist){d.msg="invalid bit length repeat";c.mode=30;break}for(;M--;)c.lens[c.have++]=U}}if(30===c.mode)break;if(0===c.lens[256]){d.msg="invalid code -- missing end-of-block";c.mode=30;break}if(c.lenbits=9,ba={bits:c.lenbits},aa=v(1,c.lens,0,c.nlen,c.lencode,0,c.work,ba),c.lenbits=ba.bits,aa){d.msg="invalid literal/lengths set";c.mode=30;break}if(c.distbits=6,c.distcode=c.distdyn, +ba={bits:c.distbits},aa=v(2,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,ba),c.distbits=ba.bits,aa){d.msg="invalid distances set";c.mode=30;break}if(c.mode=20,6===e)break a;case 20:c.mode=21;case 21:if(6<=m&&258<=D){d.next_out=l;d.avail_out=D;d.next_in=k;d.avail_in=m;c.hold=B;c.bits=E;x(d,O);l=d.next_out;g=d.output;D=d.avail_out;k=d.next_in;f=d.input;m=d.avail_in;B=c.hold;E=c.bits;12===c.mode&&(c.back=-1);break}for(c.back=0;Y=c.lencode[B&(1<>>24,N=Y>>>16&255,R=65535&Y,!(J<=E);){if(0=== +m)break a;m--;B+=f[k++]<>X)],J=Y>>>24,N=Y>>>16&255,R=65535&Y,!(X+J<=E);){if(0===m)break a;m--;B+=f[k++]<>>=X;E-=X;c.back+=X}if(B>>>=J,E-=J,c.back+=J,c.length=R,0===N){c.mode=26;break}if(32&N){c.back=-1;c.mode=12;break}if(64&N){d.msg="invalid literal/length code";c.mode=30;break}c.extra=15&N;c.mode=22;case 22:if(c.extra){for(N=c.extra;E>>=c.extra; +E-=c.extra;c.back+=c.extra}c.was=c.length;c.mode=23;case 23:for(;Y=c.distcode[B&(1<>>24,N=Y>>>16&255,R=65535&Y,!(J<=E);){if(0===m)break a;m--;B+=f[k++]<>X)],J=Y>>>24,N=Y>>>16&255,R=65535&Y,!(X+J<=E);){if(0===m)break a;m--;B+=f[k++]<>>=X;E-=X;c.back+=X}if(B>>>=J,E-=J,c.back+=J,64&N){d.msg="invalid distance code";c.mode=30;break}c.offset=R;c.extra=15&N;c.mode=24;case 24:if(c.extra){for(N=c.extra;E< +N;){if(0===m)break a;m--;B+=f[k++]<>>=c.extra;E-=c.extra;c.back+=c.extra}if(c.offset>c.dmax){d.msg="invalid distance too far back";c.mode=30;break}c.mode=25;case 25:if(0===D)break a;if(M=O-D,c.offset>M){if(M=c.offset-M,M>c.whave&&c.sane){d.msg="invalid distance too far back";c.mode=30;break}M>c.wnext?(M-=c.wnext,Z=c.wsize-M):Z=c.wnext-M;M>c.length&&(M=c.length);N=c.window}else N=g,Z=l-c.offset,M=c.length;M>D&&(M=D);D-=M;c.length-=M;do g[l++]=N[Z++];while(--M); +0===c.length&&(c.mode=21);break;case 26:if(0===D)break a;g[l++]=c.length;D--;c.mode=21;break;case 27:if(c.wrap){for(;32>E;){if(0===m)break a;m--;B|=f[k++]<E;){if(0===m)break a;m--;B+=f[k++]<c.mode&&(27>c.mode||4!==e))&&n(d,d.output,d.next_out,O-d.avail_out)?(c.mode=31,-4):(S-=d.avail_in,O-=d.avail_out,d.total_in+=S,d.total_out+=O,c.total+=O,c.wrap&&O&&(d.adler=c.check=c.flags?u(c.check,g,O,d.next_out-O):q(c.check,g,O,d.next_out-O)),d.data_type=c.bits+(c.last?64:0)+(12===c.mode? 128:0)+(20===c.mode||15===c.mode?256:0),(0===S&&0===O||4===e)&&aa===z&&(aa=-5),aa)};d.inflateEnd=function(b){if(!b||!b.state)return A;var d=b.state;return d.window&&(d.window=null),b.state=null,z};d.inflateGetHeader=function(b,d){var e;return b&&b.state?(e=b.state,0===(2&e.wrap)?A:(e.head=d,d.done=!1,z)):A};d.inflateSetDictionary=function(b,d){var e,c,f=d.length;return b&&b.state?(e=b.state,0!==e.wrap&&11!==e.mode?A:11===e.mode&&(c=1,c=q(c,d,f,0),c!==e.check)?-3:n(b,d,f,f)?(e.mode=31,-4):(e.havedict= 1,z)):A};d.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(c,f,d){var b=c("../utils/common"),e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],k=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l= -[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];f.exports=function(d,c,f,s,t,q,u,x){var v,z,A,y,D,B,C,E;y=x.bits;for(var G=0,I=0,H=0,K=0,L=0,P=0,W=0,V=0,Q=0,F=null,S=0,O=new b.Buf16(16),P=new b.Buf16(16),M=null,Z=0,G=0;15>=G;G++)O[G]=0;for(I=0;IK&&(L=K),0===K)return t[q++]=20971520,t[q++]=20971520,x.bits=1,0;for(H=1;H=G;G++)if(v<<=1,v-=O[G],0>v)return-1; -if(0G;G++)P[G+1]=P[G]+O[G];for(I=0;ID?(C=M[Z+u[I]],E=F[S+u[I]]):(C=96,E=0);v=1<>W)+z]=B<<24|C<<16|E|0;while(0!==z);for(v=1<>=1;if(0!==v?(Q&=v-1,Q+=v):Q=0,I++,0===--O[G]){if(G=== +[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];f.exports=function(d,c,f,s,t,q,u,x){var v,z,A,y,D,B,C,F;y=x.bits;for(var G=0,I=0,H=0,K=0,L=0,P=0,W=0,V=0,Q=0,E=null,S=0,O=new b.Buf16(16),P=new b.Buf16(16),M=null,Z=0,G=0;15>=G;G++)O[G]=0;for(I=0;IK&&(L=K),0===K)return t[q++]=20971520,t[q++]=20971520,x.bits=1,0;for(H=1;H=G;G++)if(v<<=1,v-=O[G],0>v)return-1; +if(0G;G++)P[G+1]=P[G]+O[G];for(I=0;ID?(C=M[Z+u[I]],F=E[S+u[I]]):(C=96,F=0);v=1<>W)+z]=B<<24|C<<16|F|0;while(0!==z);for(v=1<>=1;if(0!==v?(Q&=v-1,Q+=v):Q=0,I++,0===--O[G]){if(G=== K)break;G=c[f+u[I]]}if(G>L&&(Q&s)!==A){0===W&&(W=L);y+=H;P=G-W;for(v=1<=v));)P++,v<<=1;if(V+=1<>>8&255}function l(b,d,e){b.bi_valid>V-e?(b.bi_buf|=d<>V-b.bi_valid,b.bi_valid+=e-V):(b.bi_buf|=d<>>=1,e<<=1;while(0<--d);return e>>>1}function p(b,d,e){var c,f=Array(W+1),g=0;for(c=1;c<=W;c++)f[c]=g=g+e[c-1]<<1;for(e=0;e<=d;e++)c=b[2*e+1],0!==c&&(b[2*e]=n(f[c]++,c))}function s(b){var d;for(d=0;dc?ea[c]:ea[256+(c>>>7)],m(b,g,e),k=Z[g],0!==k&&(c-=aa[g],l(b,c,k)));while(nb.heap_len;)f=b.heap[++b.heap_len]=2>m?++m:0,g[2*f]=1,b.depth[f]=0,b.opt_len--,k&&(b.static_len-=c[2*f+1]);d.max_code=m;for(e=b.heap_len>>1;1<=e;e--)u(b,g,e);f=l; -do e=b.heap[1],b.heap[1]=b.heap[b.heap_len--],u(b,g,1),c=b.heap[1],b.heap[--b.heap_max]=e,b.heap[--b.heap_max]=c,g[2*f]=g[2*e]+g[2*c],b.depth[f]=(b.depth[e]>=b.depth[c]?b.depth[e]:b.depth[c])+1,g[2*e+1]=g[2*c+1]=f,b.heap[1]=f++,u(b,g,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];var n,q,k=d.dyn_tree,l=d.max_code,t=d.stat_desc.static_tree,s=d.stat_desc.has_stree,x=d.stat_desc.extra_bits,v=d.stat_desc.extra_base,z=d.stat_desc.max_length,y=0;for(c=0;c<=W;c++)b.bl_count[c]=0;k[2*b.heap[b.heap_max]+ -1]=0;for(e=b.heap_max+1;ez&&(c=z,y++),k[2*f+1]=c,f>l||(b.bl_count[c]++,n=0,f>=v&&(n=x[f-v]),q=k[2*f],b.opt_len+=q*(c+n),s&&(b.static_len+=q*(t[2*f+1]+n)));if(0!==y){do{for(c=z-1;0===b.bl_count[c];)c--;b.bl_count[c]--;b.bl_count[c+1]+=2;b.bl_count[z]--;y-=2}while(0l||(k[2*n+1]!==c&&(b.opt_len+=(c-k[2*n+1])*k[2*n],k[2*n+1]=c),f--)}p(g,m,b.bl_count)}function z(b,d,e){var c,f,g=-1,k=d[1],l=0,m=7, -n=4;0===k&&(m=138,n=3);d[2*(e+1)+1]=65535;for(c=0;c<=e;c++)f=k,k=d[2*(c+1)+1],++l=l?b.bl_tree[2*S]++:b.bl_tree[2*O]++,l=0,g=f,0===k?(m=138,n=3):f===k?(m=6,n=3):(m=7,n=4))}function A(b,d,e){var c,f,g=-1,k=d[1],n=0,p=7,q=4;0===k&&(p=138,q=3);for(c=0;c<=e;c++)if(f=k,k=d[2*(c+1)+1],!(++n=n? -(m(b,S,b.bl_tree),l(b,n-3,3)):(m(b,O,b.bl_tree),l(b,n-11,7));n=0;g=f;0===k?(p=138,q=3):f===k?(p=6,q=3):(p=7,q=4)}}function y(b){var d,e=4093624447;for(d=0;31>=d;d++,e>>>=1)if(1&e&&0!==b.dyn_ltree[2*d])return C;if(0!==b.dyn_ltree[18]||0!==b.dyn_ltree[20]||0!==b.dyn_ltree[26])return E;for(d=32;d=b.depth[c]?b.depth[e]:b.depth[c])+1,g[2*e+1]=g[2*c+1]=f,b.heap[1]=f++,u(b,g,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];var n,q,k=d.dyn_tree,l=d.max_code,s=d.stat_desc.static_tree,t=d.stat_desc.has_stree,x=d.stat_desc.extra_bits,v=d.stat_desc.extra_base,z=d.stat_desc.max_length,y=0;for(c=0;c<=W;c++)b.bl_count[c]=0;k[2*b.heap[b.heap_max]+ +1]=0;for(e=b.heap_max+1;ez&&(c=z,y++),k[2*f+1]=c,f>l||(b.bl_count[c]++,n=0,f>=v&&(n=x[f-v]),q=k[2*f],b.opt_len+=q*(c+n),t&&(b.static_len+=q*(s[2*f+1]+n)));if(0!==y){do{for(c=z-1;0===b.bl_count[c];)c--;b.bl_count[c]--;b.bl_count[c+1]+=2;b.bl_count[z]--;y-=2}while(0l||(k[2*n+1]!==c&&(b.opt_len+=(c-k[2*n+1])*k[2*n],k[2*n+1]=c),f--)}p(g,m,b.bl_count)}function z(b,d,e){var c,f,g=-1,k=d[1],l=0,m=7, +n=4;0===k&&(m=138,n=3);d[2*(e+1)+1]=65535;for(c=0;c<=e;c++)f=k,k=d[2*(c+1)+1],++l=l?b.bl_tree[2*S]++:b.bl_tree[2*O]++,l=0,g=f,0===k?(m=138,n=3):f===k?(m=6,n=3):(m=7,n=4))}function A(b,d,e){var c,f,g=-1,k=d[1],n=0,p=7,q=4;0===k&&(p=138,q=3);for(c=0;c<=e;c++)if(f=k,k=d[2*(c+1)+1],!(++n=n? +(m(b,S,b.bl_tree),l(b,n-3,3)):(m(b,O,b.bl_tree),l(b,n-11,7));n=0;g=f;0===k?(p=138,q=3):f===k?(p=6,q=3):(p=7,q=4)}}function y(b){var d,e=4093624447;for(d=0;31>=d;d++,e>>>=1)if(1&e&&0!==b.dyn_ltree[2*d])return C;if(0!==b.dyn_ltree[18]||0!==b.dyn_ltree[20]||0!==b.dyn_ltree[26])return F;for(d=32;df;f++){U[f]=c;for(d=0;d<1<f;f++){aa[f]=c;for(d=0;d<1<>=7;f=d;)R[2*d+1]=8,d++,k[8]++;for(;255>=d;)R[2*d+1]=9,d++,k[9]++;for(;279>=d;)R[2*d+1]=7,d++,k[7]++;for(;287>=d;)R[2*d+1]=8,d++,k[8]++;p(R,H+1,k);for(d=0;d>>3;g=b.static_len+3+7>>>3;g<=f&&(f=g)}else f=g=e+5;if(e+4<=f&&-1!==d)D(b,d,e, c);else if(4===b.strategy||g===f)l(b,2+(c?1:0),3),x(b,R,X);else{l(b,4+(c?1:0),3);d=b.l_desc.max_code+1;e=b.d_desc.max_code+1;k+=1;l(b,d-257,5);l(b,e-1,5);l(b,k-4,4);for(f=0;f>>8&255,b.pending_buf[b.d_buf+2*b.last_lit+1]=255&d,b.pending_buf[b.l_buf+b.last_lit]=255&e,b.last_lit++,0===d?b.dyn_ltree[2*e]++:(b.matches++, @@ -489,7 +489,7 @@ mxXmlCanvas2D.prototype.text=function(a,c,f,d,b,e,g,k,l,m,n,p,s){if(this.textEna m);null!=n&&t.setAttribute("clip",n?"1":"0");null!=p&&t.setAttribute("rotation",p);null!=s&&t.setAttribute("dir",s);this.root.appendChild(t)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))}; function mxSvgCanvas2D(a,c){mxAbstractCanvas2D.call(this);this.root=a;this.gradients=[];this.defs=null;this.styleEnabled=null!=c?c:!1;var f=null;if(a.ownerDocument!=document)for(f=a;null!=f&&"svg"!=f.nodeName;)f=f.parentNode;null!=f&&(0l.alpha||1>l.fillAlpha)&&m.setAttribute("opacity",l.alpha*l.fillAlpha);b=this.state.transform||"";if(g||k){var n=e=1,p=0,s=0;g&&(e=-1,p=-f-2*a);k&&(n=-1,s=-d-2*c);b+="scale("+e+","+n+")translate("+p*l.scale+","+s*l.scale+")"}0l.alpha||1>l.fillAlpha)&&m.setAttribute("opacity",l.alpha*l.fillAlpha);b=this.state.transform||"";if(g||k){var n=e=1,p=0,s=0;g&&(e=-1,p=-f-2*a);k&&(n=-1,s=-d-2*c);b+="scale("+e+","+n+")translate("+p*l.scale+","+s*l.scale+")"}0/g,"\x26gt;");a=c.value.replace(/&/g,"\x26amp;").replace(/&lt;/g, "\x26lt;").replace(/&gt;/g,"\x26gt;").replace(/&amp;/g,"\x26amp;").replace(/
/g,"\x3cbr /\x3e").replace(/
/g,"\x3chr /\x3e").replace(/(]+)>/gm,"$1 /\x3e")}return a}; @@ -664,7 +664,7 @@ function mxArrowConnector(a,c,f,d,b,e,g){mxShape.call(this);this.points=a;this.f mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))}; mxArrowConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var c=this.getEdgeWidth();this.isMarkerStart()&&(c=Math.max(c,this.getStartArrowWidth()));this.isMarkerEnd()&&(c=Math.max(c,this.getEndArrowWidth()));a.grow((c/2+this.strokewidth)*this.scale)}; mxArrowConnector.prototype.paintEdgeShape=function(a,c){var f=this.strokewidth;this.outline&&(f=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));for(var d=this.getStartArrowWidth()+f,b=this.getEndArrowWidth()+f,e=this.outline?this.getEdgeWidth()+f:this.getEdgeWidth(),g=this.isOpenEnded(),k=this.isMarkerStart(),l=this.isMarkerEnd(),m=g?0:this.arrowSpacing+f/2,n=this.startSize+f,f=this.endSize+f,p=this.isArrowRounded(),s=c[c.length-1],t=1;tmxUtils.indexOf(z,t))&&d.setCellStyles(t,B,[k])}}}finally{d.getModel().endUpdate()}};d.addListener("cellsInserted",function(b,a){B(a.getProperty("cells"))});d.addListener("textInserted",function(b,a){B(a.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(b, +try{if(a)for(var e=d.getModel().isEdge(k),c=e?d.currentEdgeStyle:d.currentVertexStyle,e=["fontSize","fontFamily","fontColor"],f=0;fmxUtils.indexOf(z,s))&&d.setCellStyles(s,B,[k])}}}finally{d.getModel().endUpdate()}};d.addListener("cellsInserted",function(b,a){B(a.getProperty("cells"))});d.addListener("textInserted",function(b,a){B(a.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(b, a){var d=[a.getProperty("cell")];a.getProperty("terminalInserted")&&d.push(a.getProperty("terminal"));B(d)});this.addListener("styleChanged",mxUtils.bind(this,function(b,a){var e=a.getProperty("cells"),c=!1,f=!1;if(0Q&&null!=l&&!mxEvent.isShiftDown(c)&&(mxUtils.getValue(l.style,mxConstants.STYLE_SHAPE)!=mxUtils.getValue(S,mxConstants.STYLE_SHAPE)&&mxUtils.getValue(l.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||"image"==mxUtils.getValue(S,mxConstants.STYLE_SHAPE)||1500this.dropTargetDelay&&(b.model.isVertex(l.cell)&&null!=n||b.model.isEdge(l.cell)&&b.model.isEdge(d[0]))){v=l;var m=b.model.isEdge(l.cell)?b.view.getPoint(l): -new mxPoint(l.getCenterX(),l.getCenterY()),m=new mxRectangle(m.x-this.refreshTarget.width/2,m.y-this.refreshTarget.height/2,this.refreshTarget.width,this.refreshTarget.height);C.style.left=Math.floor(m.x)+"px";C.style.top=Math.floor(m.y)+"px";null==E&&(b.container.appendChild(C),E=C.parentNode);g(a,e,m,C)}else null==v||!mxUtils.contains(v,a,e)||1500=b&&q.y+q.height<=l&&(q.y>=a&&q.x+q.width<=k)&&f.push(p);this.getAllCells(b,a,d,e,p,f)}}}return f};var D=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(b,a,d){return this.graph.isCellSelected(b)?!1:D.apply(this,arguments)};this.isCellLocked=function(b){for(b=this.view.getState(b);null!=b;){if("1"==mxUtils.getValue(b.style, +this.getLinkForCell(b))return"pointer"};this.selectRegion=function(b,a){var d=this.getAllCells(b.x,b.y,b.width,b.height);this.selectCellsForEvent(d,a);return d};this.getAllCells=function(b,a,d,e,c,f){f=null!=f?f:[];if(0=b&&q.y+q.height<=l&&(q.y>=a&&q.x+q.width<=k)&&f.push(p);this.getAllCells(b,a,d,e,p,f)}}}return f};var D=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(b,a,d){return this.graph.isCellSelected(b)?!1:D.apply(this,arguments)};this.isCellLocked=function(b){for(b=this.view.getState(b);null!=b;){if("1"==mxUtils.getValue(b.style, "locked","0"))return!0;b=this.view.getState(this.model.getParent(b.cell))}return!1};var B=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(b,a){if("mouseDown"==a.getProperty("eventName")){var d=a.getProperty("event").getState();B=null!=d&&!this.isSelectionEmpty()&&!this.isCellSelected(d.cell)?this.getSelectionCells():null}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(b,a){if(!mxEvent.isMultiTouchEvent(a)){var d=a.getProperty("event"),e=a.getProperty("cell"); null==e?(d=mxUtils.convertPoint(this.container,mxEvent.getClientX(d),mxEvent.getClientY(d)),p.start(d.x,d.y)):null!=B?this.addSelectionCells(B):1a&&d[e].deleteCell(a)};Graph.prototype.pasteHtmlAtCaret=function(b){var a;if(window.getSelection){if(a=window.getSelection(),a.getRangeAt&&a.rangeCount){a=a.getRangeAt(0);a.deleteContents();var d=document.createElement("div");d.innerHTML=b;b=document.createDocumentFragment();for(var e;e=d.firstChild;)lastNode=b.appendChild(e);a.insertNode(b)}}else(a=document.selection)&&"Control"!=a.type&&a.createRange().pasteHTML(b)};Graph.prototype.initTouch= -function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(b,a){this.popupMenuHandler.hideMenu()});var b=this.updateMouseEvent;this.updateMouseEvent=function(a){a=b.apply(this,arguments);if(mxEvent.isTouchEvent(a.getEvent())&&null==a.getState()){var d=this.getCellAt(a.graphX,a.graphY);null!=d&&this.isSwimlane(d)&&this.hitsSwimlaneContent(d,a.graphX,a.graphY)||(a.state=this.view.getState(d),null!=a.state&& -null!=a.state.shape&&(this.container.style.cursor=a.state.shape.node.style.cursor))}null==a.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return a};var a=!1,d=!1,e=!1,c=this.fireMouseEvent;this.fireMouseEvent=function(b,f,g){b==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),a=this.isCellSelected(f.getCell()),d=this.isSelectionEmpty(),e=this.popupMenuHandler.isMenuShowing());c.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(b,c){this.popupMenuHandler.popupTrigger= -!this.isEditing()&&this.isEnabled()&&(null==c.getState()||!c.isSource(c.getState().control))&&(this.popupMenuHandler.popupTrigger||!e&&!mxEvent.isMouseEvent(c.getEvent())&&(d&&null==c.getCell()&&this.isSelectionEmpty()||a&&this.isCellSelected(c.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var b=this.graph.view.getState(this.editingCell);return null!=b&&1==b.style.html};mxCellEditor.prototype.saveSelection= -function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var b=[],a=0,d=sel.rangeCount;aa&&d[e].deleteCell(a)};Graph.prototype.pasteHtmlAtCaret=function(b){var a;if(window.getSelection){if(a=window.getSelection(),a.getRangeAt&&a.rangeCount){a=a.getRangeAt(0);a.deleteContents();var d=document.createElement("div");d.innerHTML=b;b=document.createDocumentFragment();for(var e;e=d.firstChild;)lastNode=b.appendChild(e);a.insertNode(b)}}else(a=document.selection)&&"Control"!=a.type&& +a.createRange().pasteHTML(b)};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(b,a){this.popupMenuHandler.hideMenu()});var b=this.updateMouseEvent;this.updateMouseEvent=function(a){a=b.apply(this,arguments);if(mxEvent.isTouchEvent(a.getEvent())&&null==a.getState()){var d=this.getCellAt(a.graphX,a.graphY);null!=d&&this.isSwimlane(d)&&this.hitsSwimlaneContent(d,a.graphX, +a.graphY)||(a.state=this.view.getState(d),null!=a.state&&null!=a.state.shape&&(this.container.style.cursor=a.state.shape.node.style.cursor))}null==a.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return a};var a=!1,d=!1,e=!1,c=this.fireMouseEvent;this.fireMouseEvent=function(b,f,g){b==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),a=this.isCellSelected(f.getCell()),d=this.isSelectionEmpty(),e=this.popupMenuHandler.isMenuShowing());c.apply(this,arguments)};this.popupMenuHandler.mouseUp= +mxUtils.bind(this,function(b,c){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==c.getState()||!c.isSource(c.getState().control))&&(this.popupMenuHandler.popupTrigger||!e&&!mxEvent.isMouseEvent(c.getEvent())&&(d&&null==c.getCell()&&this.isSelectionEmpty()||a&&this.isCellSelected(c.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var b=this.graph.view.getState(this.editingCell); +return null!=b&&1==b.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var b=[],a=0,d=sel.rangeCount;aa.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox))return mxRectangle.fromRectangle(a.text.boundingBox)}return y.apply(this,arguments)};var D=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(b){var a=this.graph.getModel(),d=a.getParent(b.cell), e=this.graph.getCellGeometry(b.cell);return a.isEdge(d)&&null!=e&&e.relative&&2>b.width&&2>b.height&&null!=b.text&&null!=b.text.boundingBox?(a=b.text.unrotatedBoundingBox||b.text.boundingBox,new mxRectangle(Math.round(a.x),Math.round(a.y),Math.round(a.width),Math.round(a.height))):D.apply(this,arguments)};var B=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(b,a){var d=this.graph.getModel(),e=d.getParent(this.state.cell),c=this.graph.getCellGeometry(this.state.cell); (this.getHandleForEvent(a)==mxEvent.ROTATION_HANDLE||!d.isEdge(e)||null==c||!c.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&B.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()e.getStatus()||299e.getStatus()||299>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="\x3d\x3d";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f& 15)<<2);b+="\x3d";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,f,g,q,u,x,v,z){var A=null!=b&&null!= c;b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;x=null!=x?x:this.maxImageBytes;u=null!=u?u:!0;var y=this.editor.graph,D=y.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,g,k,l){return null!=a&&"\x3cmxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,e,f,g,k,l,A,z)});f=null!=f?f:mxUtils.bind(this,function(a){y.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var B= -a.length,C=B,E=[],G=mxUtils.bind(this,function(a,b){E[a]=b;if(0==--C){this.spinner.stop();if(null!=q)q(E);else{var c=[];y.getModel().beginUpdate();try{for(var d=0;db};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),q=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var u=Math.max(g/e,q/e);if(1mxUtils.indexOf(c,a)};this.executeLayout(function(){U.execute(v.getDefaultParent());da()},!0,z);z=null}else if("horizontaltree"==C||"verticaltree"==C||"auto"==C&&Z.length==2*c.length-1&&1==M.length){v.view.validate();var ba=new mxCompactTreeLayout(v,"horizontaltree"==C);ba.levelDistance=u;ba.edgeRouting=!1;this.executeLayout(function(){ba.execute(v.getDefaultParent(),0c.length){v.view.validate();var T=new mxFastOrganicLayout(v);T.forceConstant=3*u;T.resetEdges=!1;var ja=T.isVertexIgnored;T.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ea=new mxParallelEdgeLayout(v); ea.spacing=q;this.executeLayout(function(){T.execute(v.getDefaultParent());da()},!0,z);z=null}this.hideDialog()}finally{v.model.endUpdate()}null!=z&&z()}}catch(fa){this.handleError(fa)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl= @@ -7791,11 +7789,12 @@ App=function(a,c,f){EditorUi.call(this,a,c,null!=f?f:"1"==urlParams.lightbox);mx App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.DROPBOX_APPKEY="libwls2fa9szdji"; App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.js",doors:"/plugins/doors.js",electron:"plugins/electron.js",number:"/plugins/number.js",sql:"/plugins/sql.js",props:"/plugins/props.js",text:"/plugins/text.js"}; App.getStoredMode=function(){var a=null;if("undefined"!=typeof Storage)for(var c=document.cookie.split(";"),f=0;fnavigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript("https://js.live.net/v5.0/wl.js"):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")), -"0"!=urlParams.plugins&&"1"!=urlParams.offline)){var a=mxSettings.getPlugins(),c=urlParams.p;if(null!=c||null!=a&&0navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript("https://js.live.net/v5.0/wl.js"):"0"== +urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=null)}"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")}if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var a=mxSettings.getPlugins(),c=urlParams.p;if(null!=c||null!=a&&0a.indexOf("DocumentClosedError")){c=a;var l=new Image,m=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";l.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity\x3d"+m+"\x26v\x3d"+encodeURIComponent(EditorUi.VERSION)+ "\x26msg\x3dclientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(e)+(null!=f?":colno:"+encodeURIComponent(f):"")+(null!=k&&null!=k.stack?"\x26stack\x3d"+encodeURIComponent(k.stack):"")}}catch(n){}};"atlas"==uiTheme&&mxClient.link("stylesheet","styles/atlas.css");if(null!=window.mxscript){"0"!=urlParams.chrome&&mxscript("js/jscolor/jscolor.js");if("1"==urlParams.offline){mxscript("js/shapes.min.js");var f=document.createElement("iframe"); f.setAttribute("width","0");f.setAttribute("height","0");f.setAttribute("src","offline.html");document.body.appendChild(f);mxStencilRegistry.stencilSet={};mxStencilRegistry.getStencil=function(a){return mxStencilRegistry.stencils[a]};mxStencilRegistry.loadStencilSet=function(a,b,c){a=a.substring(a.indexOf("/")+1);a="mxgraph."+a.substring(0,a.length-4).replace(/\//g,".");a=mxStencilRegistry.stencilSet[a];null!=a&&mxStencilRegistry.parseStencilSet(a,b,!1)};for(f=mxUtils.load("stencils.xml").getXml().documentElement.firstChild;null!= @@ -7891,10 +7890,10 @@ mxUtils.bind(this,function(a){g();this.handleError(a)}))}}; App.prototype.loadFile=function(a,c,f){this.hideDialog();f=mxUtils.bind(this,function(){if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage)try{a=decodeURIComponent(a.substring(1));var d=localStorage.getItem(a);if(null!=d)this.fileLoaded(new StorageFile(this,d,a));else throw{message:mxResources.get("fileNotFound")};}catch(b){this.handleError(b,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile(); window.location.hash=null!=a?a.getHash():""}))}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=e)this.spinner.stop(),this.fileLoaded(e);else if("R"==a.charAt(0)){this.spinner.stop();d=decodeURIComponent(a.substring(1));"\x3c"!=d.charAt(0)&&(d=this.editor.graph.decompress(d));var e=new LocalFile(this,d,null!=urlParams.title? decodeURIComponent(urlParams.title):this.defaultFilename);e.getHash=function(){return a};this.fileLoaded(e);this.setMode(null)}else if("U"==a.charAt(0)){var f=decodeURIComponent(a.substring(1));this.loadTemplate(f,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0p&&0'); - win.document.close(); + var win = window.open('about:blank'); + + if (win == null) + { + mxUtils.popup(data, true); + } + else + { + win.document.write(''); + win.document.close(); + } } else { - // Enables page refresh and drag and drop of URL - win.location.replace('data:' + mimeType + ((base64Encoded) ? ';base64,' + - data : ';charset=utf8,' + encodeURIComponent(data))); + // win.open is workaround for cleared contents in Chrome after delay + // when using location.replace + var win = window.open('data:' + mimeType + ((base64Encoded) ? ';base64,' + + data : ';charset=utf8,' + encodeURIComponent(data))); + + if (win == null) + { + mxUtils.popup(data, true); + } } } else { - win.document.write(mxUtils.htmlEntities(data, false)); - win.document.close(); + var win = window.open('about:blank'); + + if (win == null) + { + mxUtils.popup(data, true); + } + else + { + win.document.write(mxUtils.htmlEntities(data, false)); + win.document.close(); + } } } else if (mode == App.MODE_DEVICE) @@ -2861,6 +2876,93 @@ return cb; }; + + /** + * + */ + EditorUi.prototype.addLinkSection = function(div) + { + mxUtils.write(div, mxResources.get('link') + ':'); + + var linkSelect = document.createElement('select'); + linkSelect.style.width = '100px'; + linkSelect.style.marginLeft = '6px'; + linkSelect.style.marginRight = '10px'; + linkSelect.className = 'geBtn'; + + var autoOption = document.createElement('option'); + autoOption.setAttribute('value', 'auto'); + mxUtils.write(autoOption, mxResources.get('automatic')); + linkSelect.appendChild(autoOption); + + var blankOption = document.createElement('option'); + blankOption.setAttribute('value', 'blank'); + mxUtils.write(blankOption, mxResources.get('openInNewWindow')); + linkSelect.appendChild(blankOption); + + var selfOption = document.createElement('option'); + selfOption.setAttribute('value', 'self'); + mxUtils.write(selfOption, mxResources.get('openInThisWindow')); + linkSelect.appendChild(selfOption); + + div.appendChild(linkSelect); + + mxUtils.write(div, mxResources.get('borderColor') + ':'); + + var linkButton = document.createElement('button'); + linkButton.style.width = '18px'; + linkButton.style.height = '18px'; + linkButton.style.marginLeft = '6px'; + linkButton.style.backgroundPosition = 'center center'; + linkButton.style.backgroundRepeat = 'no-repeat'; + + var linkColor = '#0000ff'; + + function updateLinkColor() + { + if (linkColor == null || linkColor == mxConstants.NONE) + { + linkButton.style.backgroundColor = ''; + linkButton.style.backgroundImage = 'url(\'' + Dialog.prototype.noColorImage + '\')'; + } + else + { + linkButton.style.backgroundColor = linkColor; + linkButton.style.backgroundImage = ''; + } + }; + + updateLinkColor(); + + mxEvent.addListener(linkButton, 'click', mxUtils.bind(this, function(evt) + { + this.pickColor(linkColor || 'none', function(color) + { + linkColor = color; + updateLinkColor(); + }); + + mxEvent.consume(evt); + })); + + div.appendChild(linkButton); + mxUtils.br(div); + + return { + getColor: function() + { + return linkColor; + }, + getTarget: function() + { + return linkSelect.value; + }, + focus: function() + { + linkSelect.focus(); + } + }; + } /** * @@ -2981,7 +3083,7 @@ params.push('target=' + linkTarget); } - if (linkColor != null) + if (linkColor != null && linkColor != mxConstants.NONE) { params.push('highlight=' + ((linkColor.charAt(0) == '#') ? linkColor.substring(1) : linkColor)); } @@ -3078,7 +3180,6 @@ radioSection.appendChild(span); mxUtils.br(radioSection); - radioSection.appendChild(publicUrlRadio); var span = document.createElement('span'); @@ -3089,15 +3190,18 @@ if (publicUrl == null && file != null && file.constructor == DriveFile) { - var shareBtn = mxUtils.button(mxResources.get('share'), mxUtils.bind(this, function() + var testLink = document.createElement('a'); + testLink.style.paddingLeft = '12px'; + testLink.style.color = 'gray'; + testLink.setAttribute('href', 'javascript:void(0);'); + mxUtils.write(testLink, mxResources.get('share')); + radioSection.appendChild(testLink); + + mxEvent.addListener(testLink, 'click', mxUtils.bind(this, function() { this.hideDialog(); this.drive.showPermissions(file.getId()); })); - shareBtn.style.marginTop = '12px'; - shareBtn.style.marginLeft = '8px'; - shareBtn.className = 'geBtn'; - radioSection.appendChild(shareBtn); } copyRadio.setAttribute('checked', 'checked'); @@ -3108,73 +3212,8 @@ } div.appendChild(radioSection); - - mxUtils.write(div, mxResources.get('link') + ':'); - var linkSelect = document.createElement('select'); - linkSelect.style.width = '100px'; - linkSelect.style.marginLeft = '6px'; - linkSelect.style.marginRight = '10px'; - linkSelect.className = 'geBtn'; - - var autoOption = document.createElement('option'); - autoOption.setAttribute('value', 'auto'); - mxUtils.write(autoOption, mxResources.get('automatic')); - linkSelect.appendChild(autoOption); - - var blankOption = document.createElement('option'); - blankOption.setAttribute('value', 'blank'); - mxUtils.write(blankOption, mxResources.get('openInNewWindow')); - linkSelect.appendChild(blankOption); - - var selfOption = document.createElement('option'); - selfOption.setAttribute('value', 'self'); - mxUtils.write(selfOption, mxResources.get('openInThisWindow')); - linkSelect.appendChild(selfOption); - - div.appendChild(linkSelect); - - mxUtils.write(div, mxResources.get('borderColor') + ':'); - - var linkButton = document.createElement('button'); - linkButton.style.width = '18px'; - linkButton.style.height = '18px'; - linkButton.style.marginLeft = '6px'; - linkButton.style.backgroundPosition = 'center center'; - linkButton.style.backgroundRepeat = 'no-repeat'; - - var linkColor = '#0000ff'; - - function updateLinkColor() - { - if (linkColor == null || linkColor == mxConstants.NONE) - { - linkButton.style.backgroundColor = ''; - linkButton.style.backgroundImage = 'url(\'' + Dialog.prototype.noColorImage + '\')'; - } - else - { - linkButton.style.backgroundColor = linkColor; - linkButton.style.backgroundImage = ''; - } - }; - - updateLinkColor(); - - mxEvent.addListener(linkButton, 'click', mxUtils.bind(this, function(evt) - { - this.pickColor(linkColor || 'none', function(color) - { - linkColor = color; - updateLinkColor(); - }); - - mxEvent.consume(evt); - })); - - div.appendChild(linkButton); - mxUtils.br(div); - + var linkSection = this.addLinkSection(div); var zoom = this.addCheckbox(div, mxResources.get('zoom'), true, null, true); mxUtils.write(div, ':'); @@ -3211,11 +3250,11 @@ var dlg = new CustomDialog(this, div, mxUtils.bind(this, function() { - fn((publicUrlRadio.checked) ? publicUrl : null, zoom.checked, zoomInput.value, linkSelect.value, - linkColor, fit.checked, allPages.checked, layers.checked, lightbox.checked, edit.checked); + fn((publicUrlRadio.checked) ? publicUrl : null, zoom.checked, zoomInput.value, linkSection.getTarget(), + linkSection.getColor(), fit.checked, allPages.checked, layers.checked, lightbox.checked, edit.checked); }), null, mxResources.get('create'), 'https://desk.draw.io/support/solutions/articles/16000042542-how-to-embed-html-'); this.showDialog(dlg.container, 320, 360, true, true); - linkSelect.focus(); + linkSection.focus(); }; /** @@ -3289,9 +3328,9 @@ widthInput.setAttribute('type', 'text'); widthInput.style.marginRight = '16px'; widthInput.style.width = '50px'; - widthInput.style.marginTop = '16px'; widthInput.style.marginLeft = '6px'; widthInput.style.marginRight = '16px'; + widthInput.style.marginBottom = '10px'; widthInput.value = '100%'; div.appendChild(widthInput); @@ -3301,81 +3340,15 @@ heightInput = document.createElement('input'); heightInput.setAttribute('type', 'text'); heightInput.style.width = '50px'; - heightInput.style.marginTop = '16px'; heightInput.style.marginLeft = '6px'; - heightInput.style.marginBottom = '6px'; + heightInput.style.marginBottom = '10px'; heightInput.value = height + 'px'; div.appendChild(heightInput); mxUtils.br(div); } - - mxUtils.write(div, mxResources.get('link') + ':'); - - var linkSelect = document.createElement('select'); - linkSelect.style.width = '100px'; - linkSelect.style.marginLeft = '6px'; - linkSelect.style.marginRight = '10px'; - linkSelect.className = 'geBtn'; - - var autoOption = document.createElement('option'); - autoOption.setAttribute('value', 'auto'); - mxUtils.write(autoOption, mxResources.get('automatic')); - linkSelect.appendChild(autoOption); - - var blankOption = document.createElement('option'); - blankOption.setAttribute('value', 'blank'); - mxUtils.write(blankOption, mxResources.get('openInNewWindow')); - linkSelect.appendChild(blankOption); - - var selfOption = document.createElement('option'); - selfOption.setAttribute('value', 'self'); - mxUtils.write(selfOption, mxResources.get('openInThisWindow')); - linkSelect.appendChild(selfOption); - - div.appendChild(linkSelect); - mxUtils.write(div, mxResources.get('borderColor') + ':'); - - var linkButton = document.createElement('button'); - linkButton.style.width = '18px'; - linkButton.style.height = '18px'; - linkButton.style.marginLeft = '6px'; - linkButton.style.backgroundPosition = 'center center'; - linkButton.style.backgroundRepeat = 'no-repeat'; - - var linkColor = '#0000ff'; - - function updateLinkColor() - { - if (linkColor == null || linkColor == mxConstants.NONE) - { - linkButton.style.backgroundColor = ''; - linkButton.style.backgroundImage = 'url(\'' + Dialog.prototype.noColorImage + '\')'; - } - else - { - linkButton.style.backgroundColor = linkColor; - linkButton.style.backgroundImage = ''; - } - }; - - updateLinkColor(); - - mxEvent.addListener(linkButton, 'click', mxUtils.bind(this, function(evt) - { - this.pickColor(linkColor || 'none', function(color) - { - linkColor = color; - updateLinkColor(); - }); - - mxEvent.consume(evt); - })); - - div.appendChild(linkButton); - mxUtils.br(div); - + var linkSection = this.addLinkSection(div); var hasPages = this.pages != null && this.pages.length > 1; var allPages = null; @@ -3407,13 +3380,13 @@ var dlg = new CustomDialog(this, div, mxUtils.bind(this, function() { - fn(linkSelect.value, linkColor, + fn(linkSection.getTarget(), linkSection.getColor(), (allPages == null) ? true : allPages.checked, lightbox.checked, edit.checked, layers.checked, (widthInput != null) ? widthInput.value : null, (heightInput != null) ? heightInput.value : null); }), null, mxResources.get('create')); - this.showDialog(dlg.container, 280, 250 + dy, true, true); + this.showDialog(dlg.container, 280, 240 + dy, true, true); if (widthInput != null) { @@ -3430,7 +3403,7 @@ } else { - linkSelect.focus(); + linkSection.focus(); } }; diff --git a/war/js/embed-static.min.js b/war/js/embed-static.min.js index 2e11b762..f7a67ba6 100644 --- a/war/js/embed-static.min.js +++ b/war/js/embed-static.min.js @@ -184,7 +184,7 @@ f)+"\n"+s+"}":"{"+w.join(",")+"}";f=s;return r}}"function"!==typeof Date.prototy e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;enavigator.userAgent.indexOf("MSIE")&& +window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"6.0.3.5",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&& 0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")|| @@ -358,7 +358,7 @@ mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0;this.path= mxAbstractCanvas2D.prototype.arcTo=function(a,b,c,d,e,f,g){a=mxUtils.arcToCurves(this.lastX,this.lastY,a,b,c,d,e,f,g);if(null!=a)for(b=0;bk.alpha||1>k.fillAlpha)&&l.setAttribute("opacity",k.alpha*k.fillAlpha);e=this.state.transform||"";if(g||h){var m=f=1,n=0,p=0;g&&(f=-1,n=-c-2*a);h&&(m=-1,p=-d-2*b);e+="scale("+f+","+m+")translate("+n*k.scale+","+p*k.scale+")"}0k.alpha||1>k.fillAlpha)&&l.setAttribute("opacity",k.alpha*k.fillAlpha);e=this.state.transform||"";if(g||h){var m=f=1,n=0,p=0;g&&(f=-1,n=-c-2*a);h&&(m=-1,p=-d-2*b);e+="scale("+f+","+m+")translate("+n*k.scale+","+p*k.scale+")"}0/g,"\x26gt;");a=b.value.replace(/&/g,"\x26amp;").replace(/&lt;/g, "\x26lt;").replace(/&gt;/g,"\x26gt;").replace(/&amp;/g,"\x26amp;").replace(/
/g,"\x3cbr /\x3e").replace(/
/g,"\x3chr /\x3e").replace(/(]+)>/gm,"$1 /\x3e")}return a}; @@ -1661,42 +1661,42 @@ g.getCenterY(),d=null!=d?Math.max(d,h):h,e=null!=e?Math.min(e,h):h;c.push(g)}}if Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var b=this.cloneCells(a),c=0;cb&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&"Control"!=b.type&&b.createRange().pasteHTML(a)};Graph.prototype.initTouch= -function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,b.graphX,b.graphY)||(b.state=this.view.getState(c),null!=b.state&& -null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,g){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger= -!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection= -function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;bb&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&"Control"!=b.type&& +b.createRange().pasteHTML(a)};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,b.graphX, +b.graphY)||(b.state=this.view.getState(c),null!=b.state&&null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,g){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp= +mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell); +return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;bnavigator.userAgent.indexOf("MSIE")&& +window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"6.0.3.5",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&& 0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&& 0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&& 0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")|| @@ -358,7 +358,7 @@ mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0;this.path= mxAbstractCanvas2D.prototype.arcTo=function(a,b,c,d,e,f,g){a=mxUtils.arcToCurves(this.lastX,this.lastY,a,b,c,d,e,f,g);if(null!=a)for(b=0;bk.alpha||1>k.fillAlpha)&&l.setAttribute("opacity",k.alpha*k.fillAlpha);e=this.state.transform||"";if(g||h){var m=f=1,n=0,p=0;g&&(f=-1,n=-c-2*a);h&&(m=-1,p=-d-2*b);e+="scale("+f+","+m+")translate("+n*k.scale+","+p*k.scale+")"}0k.alpha||1>k.fillAlpha)&&l.setAttribute("opacity",k.alpha*k.fillAlpha);e=this.state.transform||"";if(g||h){var m=f=1,n=0,p=0;g&&(f=-1,n=-c-2*a);h&&(m=-1,p=-d-2*b);e+="scale("+f+","+m+")translate("+n*k.scale+","+p*k.scale+")"}0/g,"\x26gt;");a=b.value.replace(/&/g,"\x26amp;").replace(/&lt;/g, "\x26lt;").replace(/&gt;/g,"\x26gt;").replace(/&amp;/g,"\x26amp;").replace(/
/g,"\x3cbr /\x3e").replace(/
/g,"\x3chr /\x3e").replace(/(]+)>/gm,"$1 /\x3e")}return a}; @@ -1661,42 +1661,42 @@ g.getCenterY(),d=null!=d?Math.max(d,h):h,e=null!=e?Math.min(e,h):h;c.push(g)}}if Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var b=this.cloneCells(a),c=0;cb&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&"Control"!=b.type&&b.createRange().pasteHTML(a)};Graph.prototype.initTouch= -function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,b.graphX,b.graphY)||(b.state=this.view.getState(c),null!=b.state&& -null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,g){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger= -!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection= -function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;bb&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&"Control"!=b.type&& +b.createRange().pasteHTML(a)};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,b.graphX, +b.graphY)||(b.state=this.view.getState(c),null!=b.state&&null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,g){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp= +mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell); +return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;bb;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-");c=0.01+100*(c/d);d=Math.max(1-(1-a)/b*(100-c),a);var f=l.substring(0,l.indexOf("Animation")).toLowerCase();return n[e]||(q.insertRule("@"+ -(f&&"-"+f+"-"||"")+"keyframes "+e+"{0%{opacity:"+d+"}"+c+"%{opacity:"+a+"}"+(c+0.01)+"%{opacity:1}"+(c+b)%100+"%{opacity:"+a+"}100%{opacity:"+d+"}}",q.cssRules.length),n[e]=1),e}function d(a,b){var c,d,e=a.style;b=b.charAt(0).toUpperCase()+b.slice(1);for(d=0;db;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-");c=0.01+100*(c/d);d=Math.max(1-(1-a)/b*(100-c),a);var f=l.substring(0,l.indexOf("Animation")).toLowerCase();return n[e]||(p.insertRule("@"+ +(f&&"-"+f+"-"||"")+"keyframes "+e+"{0%{opacity:"+d+"}"+c+"%{opacity:"+a+"}"+(c+0.01)+"%{opacity:1}"+(c+b)%100+"%{opacity:"+a+"}100%{opacity:"+d+"}}",p.cssRules.length),n[e]=1),e}function d(a,b){var c,d,e=a.style;b=b.charAt(0).toUpperCase()+b.slice(1);for(d=0;d>1,filter:m}),c("fill",{color:"string"==typeof d.color?d.color:d.color[a%d.color.length],opacity:d.opacity}),c("stroke",{opacity:0}))))}var g,l=d.length+d.width,m=2*l;g=2*-(d.width+d.length)+"px";var n=e(f(),{position:"absolute",top:g,left:g});if(d.shadow)for(g=1;g<=d.lines;g++)k(g,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius\x3d2,makeshadow\x3d1,shadowopacity\x3d.3)");for(g=1;g<=d.lines;g++)k(g);return b(a,n)};g.prototype.opacity=function(a,b,c,d){a=a.firstChild;d=d.shadow&& -d.lines||0;a&&b+d>1)+"px"})}for(var g, m=0,n=(f.lines-1)*(1-f.direction)/2;m>10),56320+(c&1023))):c==c?String.fromCharCode(c):" ">b[1]?"":b[1]}function b(a,c){return'"'+a.replace(/[\u0000-\u001f\\\"<>]/g,c)+'"'}function c(a){return e[a]||(e[a]="\\"+a.charCodeAt(0).toString(16)+" ")}function d(a){return f[a]||(f[a]=("\u0010">a?"%0":"%")+a.charCodeAt(0).toString(16))}var e={"\\":"\\\\"},f={"\\":"%5c"},g=RegExp("\\uFEFF|U[+][0-9A-F?]{1,6}(?:-[0-9A-F]{1,6})?|url[(][\\t\\n\\f ]*(?:\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|(?:[\\t\\x21\\x23-\\x26\\x28-\\x5b\\x5d-\\x7e]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)[\\t\\n\\f ]*[)]|(?!url[(])-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*[(]|(?:@?-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))|#)(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*|\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|[-+]?(?:[0-9]+(?:[.][0-9]+)?|[.][0-9]+)(?:%|-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)?|\x3c!--|--\x3e|[\\t\\n\\f ]+|/(?:[*][^*]*[*]+(?:[^/][^*]*[*]+)*/|/[^\\n\\f]*)|[~|^$*]\x3d|[^\"'\\\\/]|/(?![/*])", -"gi"),m=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),n=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");l=function(b){return b.replace(m,a)};k=function(a){a=(""+a).replace(/\r\n?/g,"\n").match(g)||[];for(var e=0,f=" ",k=0,m=a.length;k=r?" ":/url\(/i.test(q)?"url("+b(q.replace(n,""),d)+")":q;if(f!=q||" "!=q)a[e++]=f=q}a.length=e;return a}})();"undefined"!==typeof window&&(window.lexCss=k,window.decodeCss=l);var m=function(){function a(b){b=(""+b).match(n);return!b?c:new k(g(b[1]),g(b[2]),g(b[3]),g(b[4]),g(b[5]),g(b[6]),g(b[7]))}function b(a,e){return"string"==typeof a?encodeURI(a).replace(e,d):c}function d(a){a=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(a>>4&15)+"0123456789ABCDEF".charAt(a&15)}function e(a){if(a=== +"gi"),m=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),n=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");l=function(b){return b.replace(m,a)};k=function(a){a=(""+a).replace(/\r\n?/g,"\n").match(g)||[];for(var e=0,f=" ",k=0,m=a.length;k=q?" ":/url\(/i.test(p)?"url("+b(p.replace(n,""),d)+")":p;if(f!=p||" "!=p)a[e++]=f=p}a.length=e;return a}})();"undefined"!==typeof window&&(window.lexCss=k,window.decodeCss=l);var m=function(){function a(b){b=(""+b).match(n);return!b?c:new k(g(b[1]),g(b[2]),g(b[3]),g(b[4]),g(b[5]),g(b[6]),g(b[7]))}function b(a,e){return"string"==typeof a?encodeURI(a).replace(e,d):c}function d(a){a=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(a>>4&15)+"0123456789ABCDEF".charAt(a&15)}function e(a){if(a=== c)return c;a=a.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/");for(var b=l,d;(d=a.replace(b,"$1"))!=a;a=d);return a}function f(a,b){var c=a.T(),d=b.K();d?c.ga(b.j):d=b.X();d?c.da(b.n):d=b.Y();d?c.ea(b.k):d=b.$();var k=b.g,g=e(k);if(d)c.ca(b.V()),g=g&&g.replace(m,"");else if(d=!!k){if(47!==g.charCodeAt(0))var g=e(c.g||"").replace(m,""),l=g.lastIndexOf("/")+1,g=e((l?g.substring(0,l):"")+e(k)).replace(m,"")}else g=g&&g.replace(m,""),g!==k&&c.G(g);d?c.G(g):d=b.aa();d?c.O(b.l):d=b.Z();d&&c.fa(b.o); return c}function k(a,b,c,d,e,f,g){this.j=a;this.n=b;this.k=c;this.h=d;this.g=e;this.l=f;this.o=g}function g(a){return"string"==typeof a&&0]/g,D={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a", -"\x3c":"%3c","\x3e":"%3e"},C=/^(?:([^:/?# ]+):)?/,F=/^(?:https?|mailto|data)$/i;n=function(){var a={};return function R(b,c,d,k,m){b=E(b);var n=f[b];if(!n||"object"!==typeof n)c.length=0;else{for(var q=n.cssPropBits,p=q&80,r=q&1536,u=NaN,G=0,t=0;G=x)C=q&1?C:"";else if(F=C.charCodeAt(1),H=C.charCodeAt(2),D=48<=F&&57>=F,A=48<=H&&57>=H,43===x&&(D||46===F&&A))C=q&1?(D?"":"0")+C.substring(1):"";else if(45===x&&(D||46===F&&A))C=q&4?(D?"-":"-0")+C.substring(1):q&1?"0":"";else if(46===x&&D)C=q&1?"0"+C:"";else if('url("'===C.substring(0,5))C= -d&&q&16?e(s(g(k,c[G].substring(5,C.length-2)),b,d)):"";else if("("===C.charAt(C.length-1))a:{Q=c;ea=G;C=1;$=ea+1;for(x=Q.length;$]/g,E={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a", +"\x3c":"%3c","\x3e":"%3e"},C=/^(?:([^:/?# ]+):)?/,F=/^(?:https?|mailto|data)$/i;n=function(){var a={};return function R(b,c,d,k,m){b=D(b);var n=f[b];if(!n||"object"!==typeof n)c.length=0;else{for(var p=n.cssPropBits,r=p&80,q=p&1536,u=NaN,G=0,t=0;G=x)C=p&1?C:"";else if(F=C.charCodeAt(1),H=C.charCodeAt(2),E=48<=F&&57>=F,A=48<=H&&57>=H,43===x&&(E||46===F&&A))C=p&1?(E?"":"0")+C.substring(1):"";else if(45===x&&(E||46===F&&A))C=p&4?(E?"-":"-0")+C.substring(1):p&1?"0":"";else if(46===x&&E)C=p&1?"0"+C:"";else if('url("'===C.substring(0,5))C= +d&&p&16?e(s(g(k,c[G].substring(5,C.length-2)),b,d)):"";else if("("===C.charAt(C.length-1))a:{Q=c;ea=G;C=1;$=ea+1;for(x=Q.length;$k&&" "===b[l-1]&&--l;f.startAtrule&&f.startAtrule(b[g].toLowerCase(),b.slice(k,l));d="{"===b[d]?c(b,d,e,f):d+1;f.endAtrule&&f.endAtrule()}return d}function c(b,f,k,g){++f;for(g.startBlock&&g.startBlock();fk&&" "===b[l-1]&&--l;f.startAtrule&&f.startAtrule(b[g].toLowerCase(),b.slice(k,l));d="{"===b[d]?c(b,d,e,f):d+1;f.endAtrule&&f.endAtrule()}return d}function c(b,f,k,g){++f;for(g.startBlock&&g.startBlock();fm)return m=~m,m===g?m+1:m;var n=a[m];if("{"!==n)return m===g?m+1:m;c=m+1;m>g&&" "===a[m-1]&&--m;for(k.startRuleset&&k.startRuleset(a.slice(g,m));cn)n=~n;else{for(var q=[],p=0,r=b;rn)n=~n;else{for(var p=[],r=0,q=b;q])/g;f=a+"";if(ga)f=f.split(k);else{for(var g=[],l=0,m;(m=k.exec(f))!==c;)g.push(f.substring(l,m.index)),g.push(m[0]),l=m.index+m[0].length;g.push(f.substring(l));f=g}p(b,f,0,{r:d,C:d},e)}}function q(a,b,c,d,e){return function(){p(a,b,c,d,e)}}function p(a,c,d,f,k){try{a.H&&0==d&&a.H(k);for(var g,l,m,n=c.length;dc)){for(f=k.length;--f>c;){var g=k[f].v;e.f[g]&e.c.OPTIONAL_ENDTAG||b.push("\x3c/",g,"\x3e")}c])/g;f=a+"";if(ga)f=f.split(k);else{for(var g=[],l=0,m;(m=k.exec(f))!==c;)g.push(f.substring(l,m.index)),g.push(m[0]),l=m.index+m[0].length;g.push(f.substring(l));f=g}r(b,f,0,{r:d,C:d},e)}}function p(a,b,c,d,e){return function(){r(a,b,c,d,e)}}function r(a,c,d,f,k){try{a.H&&0==d&&a.H(k);for(var g,l,m,n=c.length;dc)){for(f=k.length;--f>c;){var g=k[f].v;e.f[g]&e.c.OPTIONAL_ENDTAG||b.push("\x3c/",g,"\x3e")}c/g,U=/\"/g,Q=/^\s*([-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,ga=3==="a,b".split(/(,)/).length,ea=e.c.CDATA|e.c.RCDATA,$={},ha={},ka=/^(?:https?|mailto|data)$/i,da={};da.pa=da.escapeAttrib=g;da.ra=da.makeHtmlSanitizer=s;da.sa=da.makeSaxParser=n;da.ta=da.makeTagPolicy=V;da.wa=da.normalizeRCData=l;da.xa= da.sanitize=function(a,b,c,d){return W(a,V(b,c,d))};da.ya=da.sanitizeAttribs=X;da.za=da.sanitizeWithPolicy=W;da.Ba=da.unescapeEntities=k;return da}(t);g=e.sanitize;"undefined"!==typeof window&&(window.html=e,window.html_sanitize=g)})(); @@ -100,92 +100,92 @@ var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 a.replace(/[^A-Za-z0-9\+\/\=]/g,"");l>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|k,c+=String.fromCharCode(d),64!=g&&(c+=String.fromCharCode(e)),64!=k&&(c+=String.fromCharCode(f));b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d): (127d?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;cd?(b+=String.fromCharCode(d),c++):191d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}}; !function(a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=a()}(function(){return function b(c,d,e){function f(k,m){if(!d[k]){if(!c[k]){var n="function"==typeof require&&require;if(!m&&n)return n(k,!0);if(g)return g(k,!0);n=Error("Cannot find module '"+k+"'");throw n.code="MODULE_NOT_FOUND",n;}n=d[k]={exports:{}}; -c[k][0].call(n.exports,function(b){var d=c[k][1][b];return f(d?d:b)},n,n.exports,b,c,d,e)}return d[k].exports}for(var g="function"==typeof require&&require,k=0;kb.windowBits&&(b.windowBits+=16);this.err=0;this.msg= -"";this.ended=!1;this.chunks=[];this.strm=new n;this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==r)throw Error(m[c]);if(b.header&&g.deflateSetHeader(this.strm,b.header),b.dictionary){var d;if(d="string"==typeof b.dictionary?l.string2buf(b.dictionary):"[object ArrayBuffer]"===q.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=g.deflateSetDictionary(this.strm,d),c!==r)throw Error(m[c]);this._dict_set=!0}}function f(b,c){var d= -new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/deflate"),k=b("./utils/common"),l=b("./utils/strings"),m=b("./zlib/messages"),n=b("./zlib/zstream"),q=Object.prototype.toString,r=0,u=-1,p=0,s=8;e.prototype.push=function(b,c){var d,e,f=this.strm,m=this.options.chunkSize;if(this.ended)return!1;e=c===~~c?c:!0===c?4:0;"string"==typeof b?f.input=l.string2buf(b):"[object ArrayBuffer]"===q.call(b)?f.input=new Uint8Array(b):f.input=b;f.next_in=0;f.avail_in=f.input.length;do{if(0=== +c[k][0].call(n.exports,function(b){var d=c[k][1][b];return f(d?d:b)},n,n.exports,b,c,d,e)}return d[k].exports}for(var g="function"==typeof require&&require,k=0;kb.windowBits&&(b.windowBits+=16);this.err=0;this.msg= +"";this.ended=!1;this.chunks=[];this.strm=new n;this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==r)throw Error(m[c]);if(b.header&&g.deflateSetHeader(this.strm,b.header),b.dictionary){var d;if(d="string"==typeof b.dictionary?l.string2buf(b.dictionary):"[object ArrayBuffer]"===p.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=g.deflateSetDictionary(this.strm,d),c!==r)throw Error(m[c]);this._dict_set=!0}}function f(b,c){var d= +new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/deflate"),k=b("./utils/common"),l=b("./utils/strings"),m=b("./zlib/messages"),n=b("./zlib/zstream"),p=Object.prototype.toString,r=0,u=-1,q=0,s=8;e.prototype.push=function(b,c){var d,e,f=this.strm,m=this.options.chunkSize;if(this.ended)return!1;e=c===~~c?c:!0===c?4:0;"string"==typeof b?f.input=l.string2buf(b):"[object ArrayBuffer]"===p.call(b)?f.input=new Uint8Array(b):f.input=b;f.next_in=0;f.avail_in=f.input.length;do{if(0=== f.avail_out&&(f.output=new k.Buf8(m),f.next_out=0,f.avail_out=m),d=g.deflate(f,e),1!==d&&d!==r)return this.onEnd(d),this.ended=!0,!1;0!==f.avail_out&&(0!==f.avail_in||4!==e&&2!==e)||("string"===this.options.to?this.onData(l.buf2binstring(k.shrinkBuf(f.output,f.next_out))):this.onData(k.shrinkBuf(f.output,f.next_out)))}while((0c.windowBits&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||b&&b.windowBits||(c.windowBits+=32);15c.windowBits&&0===(15&c.windowBits)&&(c.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new q;this.strm.avail_out=0;b=g.inflateInit2(this.strm,c.windowBits);if(b!==m.Z_OK)throw Error(n[b]); -this.header=new r;g.inflateGetHeader(this.strm,this.header)}function f(b,c){var d=new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/inflate"),k=b("./utils/common"),l=b("./utils/strings"),m=b("./zlib/constants"),n=b("./zlib/messages"),q=b("./zlib/zstream"),r=b("./zlib/gzheader"),u=Object.prototype.toString;e.prototype.push=function(b,c){var d,e,f,n,q,r,A=this.strm,D=this.options.chunkSize,C=this.options.dictionary,F=!1;if(this.ended)return!1;e=c===~~c?c:!0===c?m.Z_FINISH:m.Z_NO_FLUSH; -"string"==typeof b?A.input=l.binstring2buf(b):"[object ArrayBuffer]"===u.call(b)?A.input=new Uint8Array(b):A.input=b;A.next_in=0;A.avail_in=A.input.length;do{if(0===A.avail_out&&(A.output=new k.Buf8(D),A.next_out=0,A.avail_out=D),d=g.inflate(A,m.Z_NO_FLUSH),d===m.Z_NEED_DICT&&C&&(r="string"==typeof C?l.string2buf(C):"[object ArrayBuffer]"===u.call(C)?new Uint8Array(C):C,d=g.inflateSetDictionary(this.strm,r)),d===m.Z_BUF_ERROR&&!0===F&&(d=m.Z_OK,F=!1),d!==m.Z_STREAM_END&&d!==m.Z_OK)return this.onEnd(d), -this.ended=!0,!1;A.next_out&&(0!==A.avail_out&&d!==m.Z_STREAM_END&&(0!==A.avail_in||e!==m.Z_FINISH&&e!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(f=l.utf8border(A.output,A.next_out),n=A.next_out-f,q=l.buf2string(A.output,f),A.next_out=n,A.avail_out=D-n,n&&k.arraySet(A.output,A.output,f,n,0),this.onData(q)):this.onData(k.shrinkBuf(A.output,A.next_out))));0===A.avail_in&&0===A.avail_out&&(F=!0)}while((0c.windowBits&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||b&&b.windowBits||(c.windowBits+=32);15c.windowBits&&0===(15&c.windowBits)&&(c.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new p;this.strm.avail_out=0;b=g.inflateInit2(this.strm,c.windowBits);if(b!==m.Z_OK)throw Error(n[b]); +this.header=new r;g.inflateGetHeader(this.strm,this.header)}function f(b,c){var d=new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/inflate"),k=b("./utils/common"),l=b("./utils/strings"),m=b("./zlib/constants"),n=b("./zlib/messages"),p=b("./zlib/zstream"),r=b("./zlib/gzheader"),u=Object.prototype.toString;e.prototype.push=function(b,c){var d,e,f,n,p,r,A=this.strm,E=this.options.chunkSize,C=this.options.dictionary,F=!1;if(this.ended)return!1;e=c===~~c?c:!0===c?m.Z_FINISH:m.Z_NO_FLUSH; +"string"==typeof b?A.input=l.binstring2buf(b):"[object ArrayBuffer]"===u.call(b)?A.input=new Uint8Array(b):A.input=b;A.next_in=0;A.avail_in=A.input.length;do{if(0===A.avail_out&&(A.output=new k.Buf8(E),A.next_out=0,A.avail_out=E),d=g.inflate(A,m.Z_NO_FLUSH),d===m.Z_NEED_DICT&&C&&(r="string"==typeof C?l.string2buf(C):"[object ArrayBuffer]"===u.call(C)?new Uint8Array(C):C,d=g.inflateSetDictionary(this.strm,r)),d===m.Z_BUF_ERROR&&!0===F&&(d=m.Z_OK,F=!1),d!==m.Z_STREAM_END&&d!==m.Z_OK)return this.onEnd(d), +this.ended=!0,!1;A.next_out&&(0!==A.avail_out&&d!==m.Z_STREAM_END&&(0!==A.avail_in||e!==m.Z_FINISH&&e!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(f=l.utf8border(A.output,A.next_out),n=A.next_out-f,p=l.buf2string(A.output,f),A.next_out=n,A.avail_out=E-n,n&&k.arraySet(A.output,A.output,f,n,0),this.onData(p)):this.onData(k.shrinkBuf(A.output,A.next_out))));0===A.avail_in&&0===A.avail_out&&(F=!0)}while((0c&&(b.subarray&&k||!b.subarray&&g))return String.fromCharCode.apply(null,f.shrinkBuf(b,c));for(var d="",e=0;eb;b++)n[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;n[254]=n[254]=1;d.string2buf=function(b){var c,d,e,k,g,l=b.length,m=0;for(k=0;kd?1:2048>d?2:65536>d?3:4;c=new f.Buf8(m);for(k=g=0;gd?c[g++]=d:2048> d?(c[g++]=192|d>>>6,c[g++]=128|63&d):65536>d?(c[g++]=224|d>>>12,c[g++]=128|d>>>6&63,c[g++]=128|63&d):(c[g++]=240|d>>>18,c[g++]=128|d>>>12&63,c[g++]=128|d>>>6&63,c[g++]=128|63&d);return c};d.buf2binstring=function(b){return e(b,b.length)};d.binstring2buf=function(b){for(var c=new f.Buf8(b.length),d=0,e=c.length;dk)m[f++]=k;else if(g=n[k],4k?m[f++]=k:(k-=65536,m[f++]=55296|k>>10&1023,m[f++]=56320|1023&k)}return e(m,f)};d.utf8border=function(b,c){var d;c=c||b.length;c>b.length&&(c=b.length);for(d=c-1;0<=d&&128===(192&b[d]);)d--;return 0>d?c:0===d?c:d+n[b[d]]>c?d:c}},{"./common":3}],5:[function(b,c,d){c.exports=function(b,c,d,k){var l=65535&b|0;b=b>>>16&65535|0;for(var m=0;0!==d;){m=2E3d;d++){b=d; for(var e=0;8>e;e++)b=1&b?3988292384^b>>>1:b>>>1;c[d]=b}return c}();c.exports=function(b,c,d,l){d=l+d;for(b^=-1;l>>8^e[255&(b^c[l])];return b^-1}},{}],8:[function(b,c,d){function e(b,c){return b.msg=C[c],c}function f(b){for(var c=b.length;0<=--c;)b[c]=0}function g(b){var c=b.state,d=c.pending;d>b.avail_out&&(d=b.avail_out);0!==d&&(y.arraySet(b.output,c.pending_buf,c.pending_out,d,b.next_out),b.next_out+=d,c.pending_out+=d,b.total_out+=d,b.avail_out-=d,c.pending-=d,0===c.pending&&(c.pending_out= -0))}function k(b,c){E._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,c);b.block_start=b.strstart;g(b.strm)}function l(b,c){b.pending_buf[b.pending++]=c}function m(b,c){b.pending_buf[b.pending++]=c>>>8&255;b.pending_buf[b.pending++]=255&c}function n(b,c){var d,e,f=b.max_chain_length,k=b.strstart,g=b.prev_length,l=b.nice_match,m=b.strstart>b.w_size-S?b.strstart-(b.w_size-S):0,n=b.window,q=b.w_mask,p=b.prev,r=b.strstart+O,u=n[k+g-1],G=n[k+g];b.prev_length>=b.good_match&& -(f>>=2);l>b.lookahead&&(l=b.lookahead);do if(d=c,n[d+g]===G&&n[d+g-1]===u&&n[d]===n[k]&&n[++d]===n[k+1]){k+=2;d++;do;while(n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&kg){if(b.match_start=c,g=e,e>=l)break;u=n[k+g-1];G=n[k+g]}}while((c=p[c&q])>m&&0!==--f);return g<=b.lookahead?g:b.lookahead}function q(b){var c,d,e,f,k=b.w_size;do{if(f=b.window_size-b.lookahead-b.strstart,b.strstart>= -k+(k-S)){y.arraySet(b.window,b.window,k,k,0);b.match_start-=k;b.strstart-=k;b.block_start-=k;c=d=b.hash_size;do e=b.head[--c],b.head[c]=e>=k?e-k:0;while(--d);c=d=k;do e=b.prev[--c],b.prev[c]=e>=k?e-k:0;while(--d);f+=k}if(0===b.strm.avail_in)break;c=b.strm;e=b.window;var g=b.strstart+b.lookahead,l=c.avail_in;if(d=(l>f&&(l=f),0===l?0:(c.avail_in-=l,y.arraySet(e,c.input,c.next_in,l,g),1===c.state.wrap?c.adler=A(c.adler,e,l,g):2===c.state.wrap&&(c.adler=D(c.adler,e,l,g)),c.next_in+=l,c.total_in+=l,l)), -b.lookahead+=d,b.lookahead+b.insert>=J){f=b.strstart-b.insert;b.ins_h=b.window[f];for(b.ins_h=(b.ins_h<=J&&(b.ins_h=(b.ins_h<< -b.hash_shift^b.window[b.strstart+J-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),0!==d&&b.strstart-d<=b.w_size-S&&(b.match_length=n(b,d)),b.match_length>=J)if(e=E._tr_tally(b,b.strstart-b.match_start,b.match_length-J),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=J){b.match_length--;do b.strstart++,b.ins_h=(b.ins_h<>>8&255;b.pending_buf[b.pending++]=255&c}function n(b,c){var d,e,f=b.max_chain_length,k=b.strstart,g=b.prev_length,l=b.nice_match,m=b.strstart>b.w_size-S?b.strstart-(b.w_size-S):0,n=b.window,p=b.w_mask,r=b.prev,q=b.strstart+O,u=n[k+g-1],s=n[k+g];b.prev_length>=b.good_match&& +(f>>=2);l>b.lookahead&&(l=b.lookahead);do if(d=c,n[d+g]===s&&n[d+g-1]===u&&n[d]===n[k]&&n[++d]===n[k+1]){k+=2;d++;do;while(n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&n[++k]===n[++d]&&kg){if(b.match_start=c,g=e,e>=l)break;u=n[k+g-1];s=n[k+g]}}while((c=r[c&p])>m&&0!==--f);return g<=b.lookahead?g:b.lookahead}function p(b){var c,d,e,f,k=b.w_size;do{if(f=b.window_size-b.lookahead-b.strstart,b.strstart>= +k+(k-S)){y.arraySet(b.window,b.window,k,k,0);b.match_start-=k;b.strstart-=k;b.block_start-=k;c=d=b.hash_size;do e=b.head[--c],b.head[c]=e>=k?e-k:0;while(--d);c=d=k;do e=b.prev[--c],b.prev[c]=e>=k?e-k:0;while(--d);f+=k}if(0===b.strm.avail_in)break;c=b.strm;e=b.window;var g=b.strstart+b.lookahead,l=c.avail_in;if(d=(l>f&&(l=f),0===l?0:(c.avail_in-=l,y.arraySet(e,c.input,c.next_in,l,g),1===c.state.wrap?c.adler=A(c.adler,e,l,g):2===c.state.wrap&&(c.adler=E(c.adler,e,l,g)),c.next_in+=l,c.total_in+=l,l)), +b.lookahead+=d,b.lookahead+b.insert>=J){f=b.strstart-b.insert;b.ins_h=b.window[f];for(b.ins_h=(b.ins_h<=J&&(b.ins_h=(b.ins_h<< +b.hash_shift^b.window[b.strstart+J-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),0!==d&&b.strstart-d<=b.w_size-S&&(b.match_length=n(b,d)),b.match_length>=J)if(e=D._tr_tally(b,b.strstart-b.match_start,b.match_length-J),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=J){b.match_length--;do b.strstart++,b.ins_h=(b.ins_h<=J&&(b.ins_h=(b.ins_h<=b.match_length&&(b.strategy===R||b.match_length===J&&4096= -J&&b.match_length<=b.prev_length){f=b.strstart+b.lookahead-J;e=E._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-J);b.lookahead-=b.prev_length-1;b.prev_length-=2;do++b.strstart<=f&&(b.ins_h=(b.ins_h<c.wrap&&(c.wrap=-c.wrap),c.status=c.wrap?ca:ba,b.adler=2===c.wrap?0:1,c.last_flush=F,E._tr_init(c),H):e(b,N)}function v(b){var c=t(b);c===H&&(b=b.state,b.window_size=2*b.w_size,f(b.head),b.max_lazy_match=z[b.level].max_lazy,b.good_match=z[b.level].good_length,b.nice_match=z[b.level].nice_length,b.max_chain_length=z[b.level].max_chain,b.strstart=0,b.block_start= +this.lit_bufsize=this.l_buf=0}function t(b){var c;return b&&b.state?(b.total_in=b.total_out=0,b.data_type=V,c=b.state,c.pending=0,c.pending_out=0,0>c.wrap&&(c.wrap=-c.wrap),c.status=c.wrap?ca:ba,b.adler=2===c.wrap?0:1,c.last_flush=F,D._tr_init(c),H):e(b,N)}function v(b){var c=t(b);c===H&&(b=b.state,b.window_size=2*b.w_size,f(b.head),b.max_lazy_match=z[b.level].max_lazy,b.good_match=z[b.level].good_length,b.nice_match=z[b.level].nice_length,b.max_chain_length=z[b.level].max_chain,b.strstart=0,b.block_start= 0,b.lookahead=0,b.insert=0,b.match_length=b.prev_length=J-1,b.match_available=0,b.ins_h=0);return c}function x(b,c,d,f,k,g){if(!b)return N;var l=1;if(c===K&&(c=6),0>f?(l=0,f=-f):15k||k>B||d!==W||8>f||15c||9g||g>X)return e(b,N);8===f&&(f=9);var m=new s;return b.state=m,m.strm=b,m.wrap=l,m.gzhead=null,m.w_bits=f,m.w_size=1<b.pending_buf_size-5&&(d=b.pending_buf_size-5);;){if(1>=b.lookahead){if(q(b),0===b.lookahead&&c===F)return P;if(0===b.lookahead)break}b.strstart+=b.lookahead;b.lookahead=0;var e=b.block_start+d;if((0===b.strstart||b.strstart>=e)&&(b.lookahead=b.strstart-e,b.strstart=e,k(b,!1),0===b.strm.avail_out)||b.strstart-b.block_start>=b.w_size-S&&(k(b,!1),0===b.strm.avail_out))return P}return b.insert=0,c===G?(k(b,!0),0===b.strm.avail_out?aa:U):(b.strstart>b.block_start&&k(b,!1),P)}),new p(4,4,8, -4,r),new p(4,5,16,8,r),new p(4,6,32,32,r),new p(4,4,16,16,u),new p(8,16,32,32,u),new p(8,16,128,128,u),new p(8,32,128,256,u),new p(32,128,258,1024,u),new p(32,258,258,4096,u)];d.deflateInit=function(b,c){return x(b,c,W,15,8,0)};d.deflateInit2=x;d.deflateReset=v;d.deflateResetKeep=t;d.deflateSetHeader=function(b,c){return b&&b.state?2!==b.state.wrap?N:(b.state.gzhead=c,H):N};d.deflate=function(b,c){var d,n,p,r;if(!b||!b.state||5c)return b?e(b,N):N;if(n=b.state,!b.output||!b.input&&0!==b.avail_in|| +m.w_size),m.head=new y.Buf16(m.hash_size),m.prev=new y.Buf16(m.w_size),m.lit_bufsize=1<b.pending_buf_size-5&&(d=b.pending_buf_size-5);;){if(1>=b.lookahead){if(p(b),0===b.lookahead&&c===F)return P;if(0===b.lookahead)break}b.strstart+=b.lookahead;b.lookahead=0;var e=b.block_start+d;if((0===b.strstart||b.strstart>=e)&&(b.lookahead=b.strstart-e,b.strstart=e,k(b,!1),0===b.strm.avail_out)||b.strstart-b.block_start>=b.w_size-S&&(k(b,!1),0===b.strm.avail_out))return P}return b.insert=0,c===G?(k(b,!0),0===b.strm.avail_out?aa:U):(b.strstart>b.block_start&&k(b,!1),P)}),new q(4,4,8, +4,r),new q(4,5,16,8,r),new q(4,6,32,32,r),new q(4,4,16,16,u),new q(8,16,32,32,u),new q(8,16,128,128,u),new q(8,32,128,256,u),new q(32,128,258,1024,u),new q(32,258,258,4096,u)];d.deflateInit=function(b,c){return x(b,c,W,15,8,0)};d.deflateInit2=x;d.deflateReset=v;d.deflateResetKeep=t;d.deflateSetHeader=function(b,c){return b&&b.state?2!==b.state.wrap?N:(b.state.gzhead=c,H):N};d.deflate=function(b,c){var d,n,r,q;if(!b||!b.state||5c)return b?e(b,N):N;if(n=b.state,!b.output||!b.input&&0!==b.avail_in|| 666===n.status&&c!==G)return e(b,0===b.avail_out?-5:N);if(n.strm=b,d=n.last_flush,n.last_flush=c,n.status===ca)2===n.wrap?(b.adler=0,l(n,31),l(n,139),l(n,8),n.gzhead?(l(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),l(n,255&n.gzhead.time),l(n,n.gzhead.time>>8&255),l(n,n.gzhead.time>>16&255),l(n,n.gzhead.time>>24&255),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(l(n,255&n.gzhead.extra.length), -l(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(b.adler=D(b.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(l(n,0),l(n,0),l(n,0),l(n,0),l(n,0),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,3),n.status=ba)):(p=W+(n.w_bits-8<<4)<<8,r=2<=n.strategy||2>n.level?0:6>n.level?1:6===n.level?2:3,p|=r<<6,0!==n.strstart&&(p|=32),n.status=ba,m(n,p+(31-p%31)),0!==n.strstart&&(m(n,b.adler>>>16),m(n,65535&b.adler)),b.adler=1);if(69===n.status)if(n.gzhead.extra){for(p=n.pending;n.gzindex<(65535& -n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>p&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p)),g(b),p=n.pending,n.pending!==n.pending_buf_size));)l(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>p&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p));n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){p=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>p&& -(b.adler=D(b.adler,n.pending_buf,n.pending-p,p)),g(b),p=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindexp&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p));0===r&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){p=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>p&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p)),g(b), -p=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindexp&&(b.adler=D(b.adler,n.pending_buf,n.pending-p,p));0===r&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&g(b),n.pending+2<=n.pending_buf_size&&(l(n,255&b.adler),l(n,b.adler>>8&255),b.adler=0,n.status=ba)):n.status=ba),0!==n.pending){if(g(b),0===b.avail_out)return n.last_flush= --1,H}else if(0===b.avail_in&&(c<<1)-(4=J&&0n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>= -J?(u=E._tr_tally(n,1,n.match_length-J),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(u=E._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),u&&(k(n,!1),0===n.strm.avail_out)){u=P;break a}}u=(n.insert=0,c===G?(k(n,!0),0===n.strm.avail_out?aa:U):n.last_lit&&(k(n,!1),0===n.strm.avail_out)?P:Z)}else u=z[n.level].func(n,c);if(u!==aa&&u!==U||(n.status=666),u===P||u===aa)return 0===b.avail_out&&(n.last_flush=-1),H;if(u===Z&&(1===c?E._tr_align(n):5!==c&&(E._tr_stored_block(n, +l(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(b.adler=E(b.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(l(n,0),l(n,0),l(n,0),l(n,0),l(n,0),l(n,9===n.level?2:2<=n.strategy||2>n.level?4:0),l(n,3),n.status=ba)):(r=W+(n.w_bits-8<<4)<<8,q=2<=n.strategy||2>n.level?0:6>n.level?1:6===n.level?2:3,r|=q<<6,0!==n.strstart&&(r|=32),n.status=ba,m(n,r+(31-r%31)),0!==n.strstart&&(m(n,b.adler>>>16),m(n,65535&b.adler)),b.adler=1);if(69===n.status)if(n.gzhead.extra){for(r=n.pending;n.gzindex<(65535& +n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>r&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r)),g(b),r=n.pending,n.pending!==n.pending_buf_size));)l(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>r&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r));n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&& +(b.adler=E(b.adler,n.pending_buf,n.pending-r,r)),g(b),r=n.pending,n.pending===n.pending_buf_size)){q=1;break}q=n.gzindexr&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r));0===q&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){r=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>r&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r)),g(b), +r=n.pending,n.pending===n.pending_buf_size)){q=1;break}q=n.gzindexr&&(b.adler=E(b.adler,n.pending_buf,n.pending-r,r));0===q&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&g(b),n.pending+2<=n.pending_buf_size&&(l(n,255&b.adler),l(n,b.adler>>8&255),b.adler=0,n.status=ba)):n.status=ba),0!==n.pending){if(g(b),0===b.avail_out)return n.last_flush= +-1,H}else if(0===b.avail_in&&(c<<1)-(4=J&&0n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>= +J?(u=D._tr_tally(n,1,n.match_length-J),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(u=D._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),u&&(k(n,!1),0===n.strm.avail_out)){u=P;break a}}u=(n.insert=0,c===G?(k(n,!0),0===n.strm.avail_out?aa:U):n.last_lit&&(k(n,!1),0===n.strm.avail_out)?P:Z)}else u=z[n.level].func(n,c);if(u!==aa&&u!==U||(n.status=666),u===P||u===aa)return 0===b.avail_out&&(n.last_flush=-1),H;if(u===Z&&(1===c?D._tr_align(n):5!==c&&(D._tr_stored_block(n, 0,0,!1),3===c&&(f(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),g(b),0===b.avail_out))return n.last_flush=-1,H}return c!==G?H:0>=n.wrap?1:(2===n.wrap?(l(n,255&b.adler),l(n,b.adler>>8&255),l(n,b.adler>>16&255),l(n,b.adler>>24&255),l(n,255&b.total_in),l(n,b.total_in>>8&255),l(n,b.total_in>>16&255),l(n,b.total_in>>24&255)):(m(n,b.adler>>>16),m(n,65535&b.adler)),g(b),0=d.w_size&&(0===g&&(f(d.head),d.strstart=0,d.block_start=0,d.insert=0),l=new y.Buf8(d.w_size),y.arraySet(l,c,e-d.w_size,d.w_size,0),c=l,e=d.w_size);l=b.avail_in;m=b.next_in;n=b.input;b.avail_in=e;b.next_in= -0;b.input=c;for(q(d);d.lookahead>=J;){e=d.strstart;k=d.lookahead-(J-1);do d.ins_h=(d.ins_h<x&&(v+=N[k++]<>>24,v>>>=C,x-=C,C=D>>>16&255,0===C)K[m++]=65535&D;else{if(!(16&C)){if(0===(64&C)){D=z[(65535&D)+(v&(1<>>=C,x-=C);15>x&&(v+=N[k++]<>>24,v>>>=C,x-=C,C=D>>>16&255, -!(16&C)){if(0===(64&C)){D=y[(65535&D)+(v&(1<r){b.msg="invalid distance too far back";d.mode=30;break a}if(v>>>=C,x-=C,C=m-n,G>C){if(C=G-C,C>p&&d.sane){b.msg="invalid distance too far back";d.mode=30;break a}if(D=0,H=t,0===s){if(D+=u-C,C>3;k-=F;x-=F<<3;b.next_in=k;b.next_out=m;b.avail_in=k=J;){e=d.strstart;k=d.lookahead-(J-1);do d.ins_h=(d.ins_h<x&&(v+=N[k++]<>>24,v>>>=C,x-=C,C=E>>>16&255,0===C)K[m++]=65535&E;else{if(!(16&C)){if(0===(64&C)){E=z[(65535&E)+(v&(1<>>=C,x-=C);15>x&&(v+=N[k++]<>>24,v>>>=C,x-=C,C=E>>>16&255, +!(16&C)){if(0===(64&C)){E=y[(65535&E)+(v&(1<r){b.msg="invalid distance too far back";d.mode=30;break a}if(v>>>=C,x-=C,C=m-n,G>C){if(C=G-C,C>q&&d.sane){b.msg="invalid distance too far back";d.mode=30;break a}if(E=0,H=t,0===s){if(E+=u-C,C>3;k-=F;x-=F<<3;b.next_in=k;b.next_out=m;b.avail_in=k>>24&255)+(b>>>8&65280)+((65280&b)<<8)+((255&b)<<24)}function f(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new u.Buf16(320);this.work= -new u.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(b){var c;return b&&b.state?(c=b.state,b.total_in=b.total_out=c.total=0,b.msg="",c.wrap&&(b.adler=1&c.wrap),c.mode=y,c.last=0,c.havedict=0,c.dmax=32768,c.head=null,c.hold=0,c.bits=0,c.lencode=c.lendyn=new u.Buf32(E),c.distcode=c.distdyn=new u.Buf32(A),c.sane=1,c.back=-1,x):z}function k(b){var c;return b&&b.state?(c=b.state,c.wsize=0,c.whave=0,c.wnext=0,g(b)):z}function l(b,c){var d,e;return b&&b.state?(e=b.state, +new u.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(b){var c;return b&&b.state?(c=b.state,b.total_in=b.total_out=c.total=0,b.msg="",c.wrap&&(b.adler=1&c.wrap),c.mode=y,c.last=0,c.havedict=0,c.dmax=32768,c.head=null,c.hold=0,c.bits=0,c.lencode=c.lendyn=new u.Buf32(D),c.distcode=c.distdyn=new u.Buf32(A),c.sane=1,c.back=-1,x):z}function k(b){var c;return b&&b.state?(c=b.state,c.wsize=0,c.whave=0,c.wnext=0,g(b)):z}function l(b,c){var d,e;return b&&b.state?(e=b.state, 0>c?(d=0,c=-c):(d=(c>>4)+1,48>c&&(c&=15)),c&&(8>c||15=b.wsize?(u.arraySet(b.window,c,d-b.wsize,b.wsize,0),b.wnext=0,b.whave=b.wsize):(f=b.wsize-b.wnext,f>e&&(f=e),u.arraySet(b.window,c,d- -e,f,b.wnext),e-=f,e?(u.arraySet(b.window,c,d-e,e,0),b.wnext=e,b.whave=b.wsize):(b.wnext+=f,b.wnext===b.wsize&&(b.wnext=0),b.whaveB;){if(0===m)break a;m--;A+=f[g++]<>>8&255;d.check=s(d.check,Q,2,0);B=A=0;d.mode=2;break}if(d.flags=0,d.head&&(d.head.done=!1), +e,f,b.wnext),e-=f,e?(u.arraySet(b.window,c,d-e,e,0),b.wnext=e,b.whave=b.wsize):(b.wnext+=f,b.wnext===b.wsize&&(b.wnext=0),b.whaveB;){if(0===m)break a;m--;A+=f[g++]<>>8&255;d.check=s(d.check,Q,2,0);B=A=0;d.mode=2;break}if(d.flags=0,d.head&&(d.head.done=!1), !(1&d.wrap)||(((255&A)<<8)+(A>>8))%31){b.msg="incorrect header check";d.mode=30;break}if(8!==(15&A)){b.msg="unknown compression method";d.mode=30;break}if(A>>>=4,B-=4,P=(15&A)+8,0===d.wbits)d.wbits=P;else if(P>d.wbits){b.msg="invalid window size";d.mode=30;break}d.dmax=1<B;){if(0===m)break a;m--;A+=f[g++]<>8&1);512&d.flags&&(Q[0]=255&A,Q[1]=A>>>8&255,d.check=s(d.check,Q,2,0));B=A=0;d.mode=3;case 3:for(;32>B;){if(0===m)break a;m--;A+=f[g++]<>>8&255,Q[2]=A>>>16&255,Q[3]=A>>>24&255,d.check=s(d.check,Q,4,0));B=A=0;d.mode=4;case 4:for(;16>B;){if(0===m)break a;m--;A+=f[g++]<>8);512&d.flags&&(Q[0]=255&A,Q[1]=A>>>8&255,d.check=s(d.check,Q,2,0));B=A=0;d.mode= 5;case 5:if(1024&d.flags){for(;16>B;){if(0===m)break a;m--;A+=f[g++]<>>8&255,d.check=s(d.check,Q,2,0));B=A=0}else d.head&&(d.head.extra=null);d.mode=6;case 6:if(1024&d.flags&&(I=d.length,I>m&&(I=m),I&&(d.head&&(P=d.head.extra_len-d.length,d.head.extra||(d.head.extra=Array(d.head.extra_len)),u.arraySet(d.head.extra,f,g,I,P)),512&d.flags&&(d.check=s(d.check,f,I,g)),m-=I,g+=I,d.length-=I),d.length))break a;d.length=0;d.mode= 7;case 7:if(2048&d.flags){if(0===m)break a;I=0;do P=f[g+I++],d.head&&P&&65536>d.length&&(d.head.name+=String.fromCharCode(P));while(P&&Id.length&&(d.head.comment+=String.fromCharCode(P));while(P&&IB;){if(0===m)break a;m--;A+=f[g++]<>9&1,d.head.done=!0);b.adler=d.check=0;d.mode=12;break;case 10:for(;32>B;){if(0===m)break a;m--;A+=f[g++]<>>= -7&B;B-=7&B;d.mode=27;break}for(;3>B;){if(0===m)break a;m--;A+=f[g++]<>>=1,B-=1,3&A){case 0:d.mode=14;break;case 1:L=d;if(D){q=new u.Buf32(512);r=new u.Buf32(32);for(O=0;144>O;)L.lens[O++]=8;for(;256>O;)L.lens[O++]=9;for(;280>O;)L.lens[O++]=7;for(;288>O;)L.lens[O++]=8;v(1,L.lens,0,288,q,0,L.work,{bits:9});for(O=0;32>O;)L.lens[O++]=5;v(2,L.lens,0,32,r,0,L.work,{bits:5});D=!1}L.lencode=q;L.lenbits=9;L.distcode=r;L.distbits=5;if(d.mode=20,6===c){A>>>=2;B-=2;break a}break;case 2:d.mode= -17;break;case 3:b.msg="invalid block type",d.mode=30}A>>>=2;B-=2;break;case 14:A>>>=7&B;for(B-=7&B;32>B;){if(0===m)break a;m--;A+=f[g++]<>>16^65535)){b.msg="invalid stored block lengths";d.mode=30;break}if(d.length=65535&A,A=0,B=0,d.mode=15,6===c)break a;case 15:d.mode=16;case 16:if(I=d.length){if(I>m&&(I=m),I>E&&(I=E),0===I)break a;u.arraySet(k,f,g,I,l);m-=I;g+=I;E-=I;l+=I;d.length-=I;break}d.mode=12;break;case 17:for(;14>B;){if(0===m)break a;m--;A+=f[g++]<B;){if(0===m)break a;m--;A+=f[g++]<>9&1,d.head.done=!0);b.adler=d.check=0;d.mode=12;break;case 10:for(;32>B;){if(0===m)break a;m--;A+=f[g++]<>>= +7&B;B-=7&B;d.mode=27;break}for(;3>B;){if(0===m)break a;m--;A+=f[g++]<>>=1,B-=1,3&A){case 0:d.mode=14;break;case 1:L=d;if(E){p=new u.Buf32(512);r=new u.Buf32(32);for(O=0;144>O;)L.lens[O++]=8;for(;256>O;)L.lens[O++]=9;for(;280>O;)L.lens[O++]=7;for(;288>O;)L.lens[O++]=8;v(1,L.lens,0,288,p,0,L.work,{bits:9});for(O=0;32>O;)L.lens[O++]=5;v(2,L.lens,0,32,r,0,L.work,{bits:5});E=!1}L.lencode=p;L.lenbits=9;L.distcode=r;L.distbits=5;if(d.mode=20,6===c){A>>>=2;B-=2;break a}break;case 2:d.mode= +17;break;case 3:b.msg="invalid block type",d.mode=30}A>>>=2;B-=2;break;case 14:A>>>=7&B;for(B-=7&B;32>B;){if(0===m)break a;m--;A+=f[g++]<>>16^65535)){b.msg="invalid stored block lengths";d.mode=30;break}if(d.length=65535&A,A=0,B=0,d.mode=15,6===c)break a;case 15:d.mode=16;case 16:if(I=d.length){if(I>m&&(I=m),I>D&&(I=D),0===I)break a;u.arraySet(k,f,g,I,l);m-=I;g+=I;D-=I;l+=I;d.length-=I;break}d.mode=12;break;case 17:for(;14>B;){if(0===m)break a;m--;A+=f[g++]<>>=5,B-=5,d.ndist=(31&A)+1,A>>>=5,B-=5,d.ncode=(15&A)+4,A>>>=4,B-=4,286B;){if(0===m)break a;m--;A+=f[g++]<>>=3;B-=3}for(;19>d.have;)d.lens[ga[d.have++]]=0;if(d.lencode=d.lendyn,d.lenbits=7,aa={bits:d.lenbits},Z=v(0,d.lens,0,19,d.lencode,0,d.work,aa),d.lenbits=aa.bits,Z){b.msg="invalid code lengths set";d.mode=30;break}d.have= 0;d.mode=19;case 19:for(;d.have>>24,O=65535&U,!(J<=B);){if(0===m)break a;m--;A+=f[g++]<O)A>>>=J,B-=J,d.lens[d.have++]=O;else{if(16===O){for(L=J+2;B>>=J,B-=J,0===d.have){b.msg="invalid bit length repeat";d.mode=30;break}P=d.lens[d.have-1];I=3+(3&A);A>>>=2;B-=2}else if(17===O){for(L=J+3;B>>=J;B-=J;P=0;I=3+(7&A);A>>>=3;B-=3}else{for(L= J+7;B>>=J;B-=J;P=0;I=11+(127&A);A>>>=7;B-=7}if(d.have+I>d.nlen+d.ndist){b.msg="invalid bit length repeat";d.mode=30;break}for(;I--;)d.lens[d.have++]=P}}if(30===d.mode)break;if(0===d.lens[256]){b.msg="invalid code -- missing end-of-block";d.mode=30;break}if(d.lenbits=9,aa={bits:d.lenbits},Z=v(1,d.lens,0,d.nlen,d.lencode,0,d.work,aa),d.lenbits=aa.bits,Z){b.msg="invalid literal/lengths set";d.mode=30;break}if(d.distbits=6,d.distcode=d.distdyn,aa={bits:d.distbits}, -Z=v(2,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,aa),d.distbits=aa.bits,Z){b.msg="invalid distances set";d.mode=30;break}if(d.mode=20,6===c)break a;case 20:d.mode=21;case 21:if(6<=m&&258<=E){b.next_out=l;b.avail_out=E;b.next_in=g;b.avail_in=m;d.hold=A;d.bits=B;t(b,M);l=b.next_out;k=b.output;E=b.avail_out;g=b.next_in;f=b.input;m=b.avail_in;A=d.hold;B=d.bits;12===d.mode&&(d.back=-1);break}for(d.back=0;U=d.lencode[A&(1<>>24,L=U>>>16&255,O=65535&U,!(J<=B);){if(0===m)break a;m--;A+=f[g++]<< +Z=v(2,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,aa),d.distbits=aa.bits,Z){b.msg="invalid distances set";d.mode=30;break}if(d.mode=20,6===c)break a;case 20:d.mode=21;case 21:if(6<=m&&258<=D){b.next_out=l;b.avail_out=D;b.next_in=g;b.avail_in=m;d.hold=A;d.bits=B;t(b,M);l=b.next_out;k=b.output;D=b.avail_out;g=b.next_in;f=b.input;m=b.avail_in;A=d.hold;B=d.bits;12===d.mode&&(d.back=-1);break}for(d.back=0;U=d.lencode[A&(1<>>24,L=U>>>16&255,O=65535&U,!(J<=B);){if(0===m)break a;m--;A+=f[g++]<< B;B+=8}if(L&&0===(240&L)){S=J;ca=L;for(ba=O;U=d.lencode[ba+((A&(1<>S)],J=U>>>24,L=U>>>16&255,O=65535&U,!(S+J<=B);){if(0===m)break a;m--;A+=f[g++]<>>=S;B-=S;d.back+=S}if(A>>>=J,B-=J,d.back+=J,d.length=O,0===L){d.mode=26;break}if(32&L){d.back=-1;d.mode=12;break}if(64&L){b.msg="invalid literal/length code";d.mode=30;break}d.extra=15&L;d.mode=22;case 22:if(d.extra){for(L=d.extra;B>>=d.extra;B-=d.extra;d.back+= d.extra}d.was=d.length;d.mode=23;case 23:for(;U=d.distcode[A&(1<>>24,L=U>>>16&255,O=65535&U,!(J<=B);){if(0===m)break a;m--;A+=f[g++]<>S)],J=U>>>24,L=U>>>16&255,O=65535&U,!(S+J<=B);){if(0===m)break a;m--;A+=f[g++]<>>=S;B-=S;d.back+=S}if(A>>>=J,B-=J,d.back+=J,64&L){b.msg="invalid distance code";d.mode=30;break}d.offset=O;d.extra=15&L;d.mode=24;case 24:if(d.extra){for(L=d.extra;B>>=d.extra;B-=d.extra;d.back+=d.extra}if(d.offset>d.dmax){b.msg="invalid distance too far back";d.mode=30;break}d.mode=25;case 25:if(0===E)break a;if(I=M-E,d.offset>I){if(I=d.offset-I,I>d.whave&&d.sane){b.msg="invalid distance too far back";d.mode=30;break}I>d.wnext?(I-=d.wnext,Y=d.wsize-I):Y=d.wnext-I;I>d.length&&(I=d.length);L=d.window}else L=k,Y=l-d.offset,I=d.length;I>E&&(I=E);E-=I;d.length-=I;do k[l++]=L[Y++];while(--I);0===d.length&&(d.mode= -21);break;case 26:if(0===E)break a;k[l++]=d.length;E--;d.mode=21;break;case 27:if(d.wrap){for(;32>B;){if(0===m)break a;m--;A|=f[g++]<B;){if(0===m)break a;m--;A+=f[g++]<d.mode&&(27>d.mode||4!==c))&&n(b,b.output,b.next_out,M-b.avail_out)?(d.mode=31,-4):(T-=b.avail_in,M-=b.avail_out,b.total_in+=T,b.total_out+=M,d.total+=M,d.wrap&&M&&(b.adler=d.check=d.flags?s(d.check,k,M,b.next_out-M):p(d.check,k,M,b.next_out-M)),b.data_type=d.bits+(d.last?64:0)+(12===d.mode?128:0)+(20===d.mode||15=== -d.mode?256:0),(0===T&&0===M||4===c)&&Z===x&&(Z=-5),Z)};d.inflateEnd=function(b){if(!b||!b.state)return z;var c=b.state;return c.window&&(c.window=null),b.state=null,x};d.inflateGetHeader=function(b,c){var d;return b&&b.state?(d=b.state,0===(2&d.wrap)?z:(d.head=c,c.done=!1,x)):z};d.inflateSetDictionary=function(b,c){var d,e,f=c.length;return b&&b.state?(d=b.state,0!==d.wrap&&11!==d.mode?z:11===d.mode&&(e=1,e=p(e,c,f,0),e!==d.check)?-3:n(b,c,f,f)?(d.mode=31,-4):(d.havedict=1,x)):z};d.inflateInfo="pako inflate (from Nodeca project)"}, +m--;A+=f[g++]<>>=d.extra;B-=d.extra;d.back+=d.extra}if(d.offset>d.dmax){b.msg="invalid distance too far back";d.mode=30;break}d.mode=25;case 25:if(0===D)break a;if(I=M-D,d.offset>I){if(I=d.offset-I,I>d.whave&&d.sane){b.msg="invalid distance too far back";d.mode=30;break}I>d.wnext?(I-=d.wnext,Y=d.wsize-I):Y=d.wnext-I;I>d.length&&(I=d.length);L=d.window}else L=k,Y=l-d.offset,I=d.length;I>D&&(I=D);D-=I;d.length-=I;do k[l++]=L[Y++];while(--I);0===d.length&&(d.mode= +21);break;case 26:if(0===D)break a;k[l++]=d.length;D--;d.mode=21;break;case 27:if(d.wrap){for(;32>B;){if(0===m)break a;m--;A|=f[g++]<B;){if(0===m)break a;m--;A+=f[g++]<d.mode&&(27>d.mode||4!==c))&&n(b,b.output,b.next_out,M-b.avail_out)?(d.mode=31,-4):(T-=b.avail_in,M-=b.avail_out,b.total_in+=T,b.total_out+=M,d.total+=M,d.wrap&&M&&(b.adler=d.check=d.flags?s(d.check,k,M,b.next_out-M):q(d.check,k,M,b.next_out-M)),b.data_type=d.bits+(d.last?64:0)+(12===d.mode?128:0)+(20===d.mode||15=== +d.mode?256:0),(0===T&&0===M||4===c)&&Z===x&&(Z=-5),Z)};d.inflateEnd=function(b){if(!b||!b.state)return z;var c=b.state;return c.window&&(c.window=null),b.state=null,x};d.inflateGetHeader=function(b,c){var d;return b&&b.state?(d=b.state,0===(2&d.wrap)?z:(d.head=c,c.done=!1,x)):z};d.inflateSetDictionary=function(b,c){var d,e,f=c.length;return b&&b.state?(d=b.state,0!==d.wrap&&11!==d.mode?z:11===d.mode&&(e=1,e=q(e,c,f,0),e!==d.check)?-3:n(b,c,f,f)?(d.mode=31,-4):(d.havedict=1,x)):z};d.inflateInfo="pako inflate (from Nodeca project)"}, {"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(b,c,d){var e=b("../utils/common"),f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],k=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24, -25,25,26,26,27,27,28,28,29,29,64,64];c.exports=function(b,c,d,r,u,p,s,t){var v,x,z,y,E,A,D,C;y=t.bits;for(var F=0,G=0,H=0,N=0,K=0,R=0,X=0,V=0,W=0,B=null,T=0,M=new e.Buf16(16),R=new e.Buf16(16),I=null,Y=0,F=0;15>=F;F++)M[F]=0;for(G=0;GN&&(K=N),0===N)return u[p++]=20971520,u[p++]=20971520,t.bits=1,0;for(H=1;H=F;F++)if(v<<=1,v-=M[F],0>v)return-1;if(0F;F++)R[F+ -1]=R[F]+M[F];for(G=0;GE?(D=I[Y+s[G]],C=B[T+s[G]]):(D=96,C=0);v=1<>X)+x]=A<<24|D<<16|C|0;while(0!==x);for(v=1<>=1;if(0!==v?(W&=v-1,W+=v):W=0,G++,0===--M[F]){if(F===N)break;F=c[d+s[G]]}if(F>K&&(W&r)!==z){0===X&&(X=K);y+=H;R= -F-X;for(v=1<=v));)R++,v<<=1;if(V+=1<=F;F++)M[F]=0;for(G=0;GN&&(K=N),0===N)return u[q++]=20971520,u[q++]=20971520,t.bits=1,0;for(H=1;H=F;F++)if(v<<=1,v-=M[F],0>v)return-1;if(0F;F++)R[F+ +1]=R[F]+M[F];for(G=0;GD?(E=I[Y+s[G]],C=B[T+s[G]]):(E=96,C=0);v=1<>X)+x]=A<<24|E<<16|C|0;while(0!==x);for(v=1<>=1;if(0!==v?(W&=v-1,W+=v):W=0,G++,0===--M[F]){if(F===N)break;F=c[d+s[G]]}if(F>K&&(W&r)!==z){0===X&&(X=K);y+=H;R= +F-X;for(v=1<=v));)R++,v<<=1;if(V+=1<>>8&255}function l(b,c,d){b.bi_valid>V-d?(b.bi_buf|=c<>V-b.bi_valid,b.bi_valid+=d-V):(b.bi_buf|=c<>>=1,d<<=1;while(0<--c);return d>>>1}function q(b,c,d){var e,f=Array(X+1),k=0;for(e=1;e<=X;e++)f[e]=k=k+d[e-1]<<1;for(d=0;d<=c;d++)e=b[2*d+1],0!==e&&(b[2*d]=n(f[e]++,e))}function r(b){var c;for(c=0;ce?ca[e]:ca[256+(e>>>7)],m(b,k,d),g=Y[k], +1&b,b>>>=1,d<<=1;while(0<--c);return d>>>1}function p(b,c,d){var e,f=Array(X+1),k=0;for(e=1;e<=X;e++)f[e]=k=k+d[e-1]<<1;for(d=0;d<=c;d++)e=b[2*d+1],0!==e&&(b[2*d]=n(f[e]++,e))}function r(b){var c;for(c=0;ce?ca[e]:ca[256+(e>>>7)],m(b,k,d),g=Y[k], 0!==g&&(e-=Z[k],l(b,e,g)));while(nb.heap_len;)f=b.heap[++b.heap_len]=2>m?++m:0,k[2*f]=1,b.depth[f]=0,b.opt_len--,g&&(b.static_len-=e[2*f+1]);c.max_code=m;for(d=b.heap_len>>1;1<=d;d--)s(b,k,d);f=l;do d=b.heap[1],b.heap[1]=b.heap[b.heap_len--],s(b,k,1), -e=b.heap[1],b.heap[--b.heap_max]=d,b.heap[--b.heap_max]=e,k[2*f]=k[2*d]+k[2*e],b.depth[f]=(b.depth[d]>=b.depth[e]?b.depth[d]:b.depth[e])+1,k[2*d+1]=k[2*e+1]=f,b.heap[1]=f++,s(b,k,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];var n,p,g=c.dyn_tree,l=c.max_code,r=c.stat_desc.static_tree,u=c.stat_desc.has_stree,B=c.stat_desc.extra_bits,t=c.stat_desc.extra_base,v=c.stat_desc.max_length,x=0;for(e=0;e<=X;e++)b.bl_count[e]=0;g[2*b.heap[b.heap_max]+1]=0;for(d=b.heap_max+1;dv&&(e=v,x++),g[2*f+1]=e,f>l||(b.bl_count[e]++,n=0,f>=t&&(n=B[f-t]),p=g[2*f],b.opt_len+=p*(e+n),u&&(b.static_len+=p*(r[2*f+1]+n)));if(0!==x){do{for(e=v-1;0===b.bl_count[e];)e--;b.bl_count[e]--;b.bl_count[e+1]+=2;b.bl_count[v]--;x-=2}while(0l||(g[2*n+1]!==e&&(b.opt_len+=(e-g[2*n+1])*g[2*n],g[2*n+1]=e),f--)}q(k,m,b.bl_count)}function x(b,c,d){var e,f,k=-1,g=c[1],l=0,m=7,n=4;0===g&&(m=138,n=3);c[2*(d+1)+1]=65535;for(e=0;e<= -d;e++)f=g,g=c[2*(e+1)+1],++l=l?b.bl_tree[2*T]++:b.bl_tree[2*M]++,l=0,k=f,0===g?(m=138,n=3):f===g?(m=6,n=3):(m=7,n=4))}function z(b,c,d){var e,f,k=-1,g=c[1],n=0,q=7,p=4;0===g&&(q=138,p=3);for(e=0;e<=d;e++)if(f=g,g=c[2*(e+1)+1],!(++n=n?(m(b,T,b.bl_tree),l(b,n-3,3)):(m(b,M,b.bl_tree),l(b, -n-11,7));n=0;k=f;0===g?(q=138,p=3):f===g?(q=6,p=3):(q=7,p=4)}}function y(b){var c,d=4093624447;for(c=0;31>=c;c++,d>>>=1)if(1&d&&0!==b.dyn_ltree[2*c])return D;if(0!==b.dyn_ltree[18]||0!==b.dyn_ltree[20]||0!==b.dyn_ltree[26])return C;for(c=32;c=b.depth[e]?b.depth[d]:b.depth[e])+1,k[2*d+1]=k[2*e+1]=f,b.heap[1]=f++,s(b,k,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];var n,r,g=c.dyn_tree,l=c.max_code,q=c.stat_desc.static_tree,u=c.stat_desc.has_stree,B=c.stat_desc.extra_bits,t=c.stat_desc.extra_base,v=c.stat_desc.max_length,x=0;for(e=0;e<=X;e++)b.bl_count[e]=0;g[2*b.heap[b.heap_max]+1]=0;for(d=b.heap_max+1;dv&&(e=v,x++),g[2*f+1]=e,f>l||(b.bl_count[e]++,n=0,f>=t&&(n=B[f-t]),r=g[2*f],b.opt_len+=r*(e+n),u&&(b.static_len+=r*(q[2*f+1]+n)));if(0!==x){do{for(e=v-1;0===b.bl_count[e];)e--;b.bl_count[e]--;b.bl_count[e+1]+=2;b.bl_count[v]--;x-=2}while(0l||(g[2*n+1]!==e&&(b.opt_len+=(e-g[2*n+1])*g[2*n],g[2*n+1]=e),f--)}p(k,m,b.bl_count)}function x(b,c,d){var e,f,k=-1,g=c[1],l=0,m=7,n=4;0===g&&(m=138,n=3);c[2*(d+1)+1]=65535;for(e=0;e<= +d;e++)f=g,g=c[2*(e+1)+1],++l=l?b.bl_tree[2*T]++:b.bl_tree[2*M]++,l=0,k=f,0===g?(m=138,n=3):f===g?(m=6,n=3):(m=7,n=4))}function z(b,c,d){var e,f,k=-1,g=c[1],n=0,p=7,r=4;0===g&&(p=138,r=3);for(e=0;e<=d;e++)if(f=g,g=c[2*(e+1)+1],!(++n=n?(m(b,T,b.bl_tree),l(b,n-3,3)):(m(b,M,b.bl_tree),l(b, +n-11,7));n=0;k=f;0===g?(p=138,r=3):f===g?(p=6,r=3):(p=7,r=4)}}function y(b){var c,d=4093624447;for(c=0;31>=c;c++,d>>>=1)if(1&d&&0!==b.dyn_ltree[2*c])return E;if(0!==b.dyn_ltree[18]||0!==b.dyn_ltree[20]||0!==b.dyn_ltree[26])return C;for(c=32;ce;e++){P[e]=d;for(c=0;c<1<e;e++){Z[e]=d;for(c=0;c<1<>=7;e=c;)O[2*c+1]=8,c++,k[8]++;for(;255>=c;)O[2*c+1]=9,c++,k[9]++;for(;279>=c;)O[2*c+1]=7,c++,k[7]++;for(;287>=c;)O[2*c+1]=8,c++,k[8]++;q(O,H+1,k);for(c=0;c>>3;k=b.static_len+3+7>>>3;k<=f&&(f=k)}else f=k=d+5;if(d+4<=f&&-1!==c)E(b,c,d,e);else if(4===b.strategy||k===f)l(b,2+(e?1:0),3),t(b,O,S); +e}ba[d-1]=e;for(e=d=0;16>e;e++){Z[e]=d;for(c=0;c<1<>=7;e=c;)O[2*c+1]=8,c++,k[8]++;for(;255>=c;)O[2*c+1]=9,c++,k[9]++;for(;279>=c;)O[2*c+1]=7,c++,k[7]++;for(;287>=c;)O[2*c+1]=8,c++,k[8]++;p(O,H+1,k);for(c=0;c>>3;k=b.static_len+3+7>>>3;k<=f&&(f=k)}else f=k=d+5;if(d+4<=f&&-1!==c)D(b,c,d,e);else if(4===b.strategy||k===f)l(b,2+(e?1:0),3),t(b,O,S); else{l(b,4+(e?1:0),3);c=b.l_desc.max_code+1;d=b.d_desc.max_code+1;g+=1;l(b,c-257,5);l(b,d-1,5);l(b,g-4,4);for(f=0;f>>8&255,b.pending_buf[b.d_buf+2*b.last_lit+1]=255&c,b.pending_buf[b.l_buf+b.last_lit]=255&d,b.last_lit++,0===c?b.dyn_ltree[2*d]++:(b.matches++,c--,b.dyn_ltree[2*(ba[d]+G+1)]++,b.dyn_dtree[2*(256> c?ca[c]:ca[256+(c>>>7)])]++),b.last_lit===b.lit_bufsize-1};d._tr_align=function(b){l(b,2,3);m(b,W,O);16===b.bi_valid?(k(b,b.bi_buf),b.bi_buf=0,b.bi_valid=0):8<=b.bi_valid&&(b.pending_buf[b.pending++]=255&b.bi_buf,b.bi_buf>>=8,b.bi_valid-=8)}},{"../utils/common":3}],15:[function(b,c,d){c.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},{}],"/":[function(b, c,d){d=b("./lib/utils/common").assign;var e=b("./lib/deflate"),f=b("./lib/inflate");b=b("./lib/zlib/constants");var g={};d(g,e,f,b);c.exports=g},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});window.urlParams=window.urlParams||{};window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=window.isSvgBrowser||0>navigator.userAgent.indexOf("MSIE")||9<=document.documentMode;window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export"; @@ -230,8 +230,8 @@ mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(a,b,c,d mxRectangle.prototype.add=function(a){if(null!=a){var b=Math.min(this.x,a.x),c=Math.min(this.y,a.y),d=Math.max(this.x+this.width,a.x+a.width);a=Math.max(this.y+this.height,a.y+a.height);this.x=b;this.y=c;this.width=d-b;this.height=a-c}};mxRectangle.prototype.intersect=function(a){if(null!=a){var b=this.x+this.width,c=a.x+a.width,d=this.y+this.height,e=a.y+a.height;this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.width=Math.min(b,c)-this.x;this.height=Math.min(d,e)-this.y}}; mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a};mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height}; mxRectangle.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)}; -var mxEffects={animateChanges:function(a,b,c){var d=0,e=function(){for(var g=!1,k=0;kd&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;ed&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;edocument.documentMode&&(a="ms");return function(b,c,d){b[c]=d;null!=a&&0mxUtils.indexOf(b,e)))d[e]=!c&&"object"==typeof a[e]?mxUtils.clone(a[e]):a[e]}return d},equalPoints:function(a,b){if(null== a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;ce&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=q*c;q*=d;c*=r;d*=r;for(var v=Math.cos(f),x=Math.sin(f),u=-m*(n*x+d*v),p=-m*(c*x-q*v),r=[],z=0;ze&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=r;d*=r;for(var v=Math.cos(f),x=Math.sin(f),u=-m*(n*x+d*v),q=-m*(c*x-p*v),r=[],z=0;zc&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|= mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST; @@ -485,15 +485,15 @@ mxXmlCanvas2D.prototype.image=function(a,b,c,d,e,f,g,k){e=this.converter.convert mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin"));this.lastY=this.lastX=0};mxXmlCanvas2D.prototype.moveTo=function(a,b){var c=this.createElement("move");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b}; mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b};mxXmlCanvas2D.prototype.quadTo=function(a,b,c,d){var e=this.createElement("quad");e.setAttribute("x1",this.format(a));e.setAttribute("y1",this.format(b));e.setAttribute("x2",this.format(c));e.setAttribute("y2",this.format(d));this.root.appendChild(e);this.lastX=c;this.lastY=d}; mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))}; -mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,q,r){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var u=this.createElement("text");u.setAttribute("x",this.format(a));u.setAttribute("y",this.format(b));u.setAttribute("w",this.format(c));u.setAttribute("h",this.format(d));u.setAttribute("str",e);null!=f&&u.setAttribute("align",f);null!=g&&u.setAttribute("valign",g);u.setAttribute("wrap",k?"1":"0");null==l&&(l="");u.setAttribute("format",l);null!=m&&u.setAttribute("overflow", -m);null!=n&&u.setAttribute("clip",n?"1":"0");null!=q&&u.setAttribute("rotation",q);null!=r&&u.setAttribute("dir",r);this.root.appendChild(u)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))}; +mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,r){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var u=this.createElement("text");u.setAttribute("x",this.format(a));u.setAttribute("y",this.format(b));u.setAttribute("w",this.format(c));u.setAttribute("h",this.format(d));u.setAttribute("str",e);null!=f&&u.setAttribute("align",f);null!=g&&u.setAttribute("valign",g);u.setAttribute("wrap",k?"1":"0");null==l&&(l="");u.setAttribute("format",l);null!=m&&u.setAttribute("overflow", +m);null!=n&&u.setAttribute("clip",n?"1":"0");null!=p&&u.setAttribute("rotation",p);null!=r&&u.setAttribute("dir",r);this.root.appendChild(u)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))}; function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.gradients=[];this.defs=null;this.styleEnabled=null!=b?b:!1;var c=null;if(a.ownerDocument!=document)for(c=a;null!=c&&"svg"!=c.nodeName;)c=c.parentNode;null!=c&&(0l.alpha||1>l.fillAlpha)&&m.setAttribute("opacity",l.alpha*l.fillAlpha);e=this.state.transform||"";if(g||k){var n=f=1,q=0,r=0;g&&(f=-1,q=-c-2*a);k&&(n=-1,r=-d-2*b);e+="scale("+f+","+n+")translate("+q*l.scale+","+r*l.scale+")"}0l.alpha||1>l.fillAlpha)&&m.setAttribute("opacity",l.alpha*l.fillAlpha);e=this.state.transform||"";if(g||k){var n=f=1,p=0,r=0;g&&(f=-1,p=-c-2*a);k&&(n=-1,r=-d-2*b);e+="scale("+f+","+n+")translate("+p*l.scale+","+r*l.scale+")"}0/g,"\x26gt;");a=b.value.replace(/&/g,"\x26amp;").replace(/&lt;/g, "\x26lt;").replace(/&gt;/g,"\x26gt;").replace(/&amp;/g,"\x26amp;").replace(/
/g,"\x3cbr /\x3e").replace(/
/g,"\x3chr /\x3e").replace(/(]+)>/gm,"$1 /\x3e")}return a}; @@ -523,27 +523,27 @@ mxSvgCanvas2D.prototype.createDiv=function(a,b,c,d,e){c=this.state;d="display:in mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d+="text-decoration:underline;");b==mxConstants.ALIGN_CENTER?d+="text-align:center;":b==mxConstants.ALIGN_RIGHT&&(d+="text-align:right;");b="";null!=c.fontBackgroundColor&&(b+="background-color:"+c.fontBackgroundColor+";");null!=c.fontBorderColor&&(b+="border:1px solid "+c.fontBorderColor+";");mxUtils.isNode(a)||(a=this.convertHtml(a),"fill"!=e&&"width"!=e?a='\x3cdiv xmlns\x3d"http://www.w3.org/1999/xhtml" style\x3d"display:inline-block;text-align:inherit;text-decoration:inherit;'+ b+'"\x3e'+a+"\x3c/div\x3e":d+=b);if(!mxClient.IS_IE&&document.createElementNS)return e=document.createElementNS("http://www.w3.org/1999/xhtml","div"),e.setAttribute("style",d),mxUtils.isNode(a)?this.root.ownerDocument!=document?e.appendChild(a.cloneNode(!0)):e.appendChild(a):e.innerHTML=a,e;mxUtils.isNode(a)&&this.root.ownerDocument!=document&&(a=a.outerHTML);return mxUtils.parseXml('\x3cdiv xmlns\x3d"http://www.w3.org/1999/xhtml" style\x3d"'+d+'"\x3e'+a+"\x3c/div\x3e").documentElement}; mxSvgCanvas2D.prototype.invalidateCachedOffsetSize=function(a){delete a.firstChild.mxCachedOffsetWidth;delete a.firstChild.mxCachedFinalOffsetWidth;delete a.firstChild.mxCachedFinalOffsetHeight}; -mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=n&&null!=n.firstChild&&null!=n.firstChild.firstChild&&null!=n.firstChild.firstChild.firstChild){n=n.firstChild;var q=n.firstChild,r=q.firstChild;m=null!=m?m:0;var u=this.state;a+=u.dx;b+=u.dy;l?(r.style.maxHeight=Math.round(d)+"px",r.style.maxWidth=Math.round(c)+"px"):"fill"==k?(r.style.width=Math.round(c+1)+"px",r.style.height=Math.round(d+1)+"px"):"width"==k&&(r.style.width=Math.round(c+1)+"px",0u.alpha&&s.setAttribute("opacity",u.alpha);var t=this.createElement("foreignObject");t.setAttribute("style","overflow:visible;");t.setAttribute("pointer-events","all");p=this.createDiv(e,f,g,p,m);if(null!=p){null!=r&&p.setAttribute("dir",r);s.appendChild(t);this.root.appendChild(s);var v=0,x=0;r=v=2;if(mxClient.IS_IE&&(9==document.documentMode||!mxClient.IS_SVG)){var z= -document.createElement("div");z.style.cssText=p.getAttribute("style");z.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";z.style.position="absolute";z.style.visibility="hidden";x=document.createElement("div");x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.style.wordWrap=mxConstants.WORD_WRAP;x.innerHTML=mxUtils.isNode(e)?e.outerHTML:e;z.appendChild(x);document.body.appendChild(z);8!=document.documentMode&&9!=document.documentMode&&null!=u.fontBorderColor&&(v+=2,r+=2);if(k&&0< -c){var y=x.offsetWidth;if(!n&&k&&0u.alpha&&s.setAttribute("opacity",u.alpha);r=p=0;f==mxConstants.ALIGN_CENTER?p-=c/2:f==mxConstants.ALIGN_RIGHT&&(p-=c);a+=p;g==mxConstants.ALIGN_MIDDLE? -r-=d/2:g==mxConstants.ALIGN_BOTTOM&&(r-=d);"fill"!=m&&mxClient.IS_FF&&mxClient.IS_WIN&&(r-=2);b+=r;z=1!=u.scale?"scale("+u.scale+")":"";0!=u.rotation&&this.rotateHtml?(z+="rotate("+u.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*u.scale,(b+d/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy),a=b.x-c*u.scale/2,b=b.y-d*u.scale/2):(a*=u.scale,b*=u.scale);0!=q&&(z+="rotate("+q+","+-p+","+-r+")");s.setAttribute("transform","translate("+(Math.round(a)+this.foOffset)+","+(Math.round(b)+this.foOffset)+ -")"+z);t.setAttribute("width",Math.round(Math.max(1,c)));t.setAttribute("height",Math.round(Math.max(1,d)));this.root.ownerDocument!=document&&(a=this.createAlternateContent(t,a,b,c,d,e,f,g,k,l,m,n,q),null!=a&&(t.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),c=this.createElement("switch"),c.appendChild(t),c.appendChild(a),s.appendChild(c)))}}else this.plainText(a,b,c,d,e,f,g,k,m,n,q,r)}}; +-l+")");n.setAttribute("transform","translate("+Math.round(a)+","+Math.round(b)+")"+e);p.setAttribute("width",Math.round(Math.max(1,c)));p.setAttribute("height",Math.round(Math.max(1,d)))}}; +mxSvgCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,r){if(this.textEnabled&&null!=e){p=null!=p?p:0;var u=this.state;a+=u.dx;b+=u.dy;if(this.foEnabled&&"html"==l){var q="vertical-align:top;";n?q+="overflow:hidden;max-height:"+Math.round(d)+"px;max-width:"+Math.round(c)+"px;":"fill"==m?q+="width:"+Math.round(c+1)+"px;height:"+Math.round(d+1)+"px;overflow:hidden;":"width"==m&&(q+="width:"+Math.round(c+1)+"px;",0u.alpha&&s.setAttribute("opacity",u.alpha);var t=this.createElement("foreignObject");t.setAttribute("style","overflow:visible;");t.setAttribute("pointer-events","all");q=this.createDiv(e,f,g,q,m);if(null!=q){null!=r&&q.setAttribute("dir",r);s.appendChild(t);this.root.appendChild(s);var v=0,x=0;r=v=2;if(mxClient.IS_IE&&(9==document.documentMode||!mxClient.IS_SVG)){var z= +document.createElement("div");z.style.cssText=q.getAttribute("style");z.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";z.style.position="absolute";z.style.visibility="hidden";x=document.createElement("div");x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.style.wordWrap=mxConstants.WORD_WRAP;x.innerHTML=mxUtils.isNode(e)?e.outerHTML:e;z.appendChild(x);document.body.appendChild(z);8!=document.documentMode&&9!=document.documentMode&&null!=u.fontBorderColor&&(v+=2,r+=2);if(k&&0< +c){var y=x.offsetWidth;if(!n&&k&&0u.alpha&&s.setAttribute("opacity",u.alpha);r=q=0;f==mxConstants.ALIGN_CENTER?q-=c/2:f==mxConstants.ALIGN_RIGHT&&(q-=c);a+=q;g==mxConstants.ALIGN_MIDDLE? +r-=d/2:g==mxConstants.ALIGN_BOTTOM&&(r-=d);"fill"!=m&&mxClient.IS_FF&&mxClient.IS_WIN&&(r-=2);b+=r;z=1!=u.scale?"scale("+u.scale+")":"";0!=u.rotation&&this.rotateHtml?(z+="rotate("+u.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*u.scale,(b+d/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy),a=b.x-c*u.scale/2,b=b.y-d*u.scale/2):(a*=u.scale,b*=u.scale);0!=p&&(z+="rotate("+p+","+-q+","+-r+")");s.setAttribute("transform","translate("+(Math.round(a)+this.foOffset)+","+(Math.round(b)+this.foOffset)+ +")"+z);t.setAttribute("width",Math.round(Math.max(1,c)));t.setAttribute("height",Math.round(Math.max(1,d)));this.root.ownerDocument!=document&&(a=this.createAlternateContent(t,a,b,c,d,e,f,g,k,l,m,n,p),null!=a&&(t.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),c=this.createElement("switch"),c.appendChild(t),c.appendChild(a),s.appendChild(c)))}}else this.plainText(a,b,c,d,e,f,g,k,m,n,p,r)}}; mxSvgCanvas2D.prototype.createClip=function(a,b,c,d){a=Math.round(a);b=Math.round(b);c=Math.round(c);d=Math.round(d);for(var e="mx-clip-"+a+"-"+b+"-"+c+"-"+d,f=0,g=e+"-"+f;null!=document.getElementById(g);)g=e+"-"+ ++f;clip=this.createElement("clipPath");clip.setAttribute("id",g);e=this.createElement("rect");e.setAttribute("x",a);e.setAttribute("y",b);e.setAttribute("width",c);e.setAttribute("height",d);clip.appendChild(e);return clip}; -mxSvgCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,q){n=null!=n?n:0;k=this.state;var r=k.fontSize,u=this.createElement("g"),p=k.transform||"";this.updateFont(u);0!=n&&(p+="rotate("+n+","+this.format(a*k.scale)+","+this.format(b*k.scale)+")");null!=q&&u.setAttribute("direction",q);m&&0k.alpha&&u.setAttribute("opacity",k.alpha);p=e.split("\n");q=Math.round(r*mxConstants.LINE_HEIGHT);var s=r+(p.length-1)*q;n=b+r-1;g==mxConstants.ALIGN_MIDDLE?"fill"==l?n-=d/2:(m=(this.matchHtmlAlignment&&m&&0k.alpha&&u.setAttribute("opacity",k.alpha);q=e.split("\n");p=Math.round(r*mxConstants.LINE_HEIGHT);var s=r+(q.length-1)*p;n=b+r-1;g==mxConstants.ALIGN_MIDDLE?"fill"==l?n-=d/2:(m=(this.matchHtmlAlignment&&m&&0v&&(v+=2*Math.PI);v%=Math.PI;v>Math.PI/2&&(v=Math.PI-v);g=Math.cos(v);var x=Math.sin(v);8==document.documentMode&&!mxClient.IS_EM&&(e.style.display="inline-block",f.style.display="inline-block",p.style.display="inline-block");e.style.visibility="hidden";e.style.position="absolute";document.body.appendChild(e);p=e;null!=p.firstChild&&"DIV"==p.firstChild.nodeName&&(p=p.firstChild);v=p.offsetWidth+3;p=p.offsetHeight;n?(c=Math.min(c,v), -p=Math.min(p,d)):c=v;k&&(e.style.width=c+"px");if(mxClient.IS_QUIRKS&&(n||"width"==m)&&p>d)p=d,e.style.height=p+"px";d=p;n=(d-d*g+c*-x)/2-r*c*(t+0.5)+q*d*(s+0.5);k=(c-c*g+d*-x)/2+q*c*(t+0.5)+r*d*(s+0.5);"group"==l.nodeName&&"DIV"==this.root.nodeName?(m=this.createElement("div"),m.style.display="inline-block",m.style.position="absolute",m.style.left=this.format(a+(k-c/2)*u.scale)+"px",m.style.top=this.format(b+(n-d/2)*u.scale)+"px",l.parentNode.appendChild(m),m.appendChild(l)):(u=8==document.documentMode&& -!mxClient.IS_EM?1:u.scale,l.style.left=this.format(a+(k-c/2)*u)+"px",l.style.top=this.format(b+(n-d/2)*u)+"px");f.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+q+", M12\x3d"+r+", M21\x3d"+-r+", M22\x3d"+q+", sizingMethod\x3d'auto expand')";f.style.backgroundColor=this.rotatedHtmlBackground;1>this.state.alpha&&(f.style.filter+="alpha(opacity\x3d"+100*this.state.alpha+")");f.appendChild(e);e.style.position="";e.style.visibility=""}else 8!=document.documentMode||mxClient.IS_EM?(e.style.verticalAlign= -"top",1>this.state.alpha&&(l.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),u=e.parentNode,e.style.visibility="hidden",document.body.appendChild(e),c=e.offsetWidth,p=e.offsetHeight,mxClient.IS_QUIRKS&&n&&p>d&&(p=d,e.style.height=p+"px"),d=p,e.style.visibility="",u.appendChild(e),l.style.left=this.format(a+c*t*this.state.scale)+"px",l.style.top=this.format(b+d*s*this.state.scale)+"px"):(1>this.state.alpha&&(e.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),p.style.left=100*t+ -"%",p.style.top=100*s+"%")}else this.plainText(a,b,c,d,mxUtils.htmlEntities(e,!1),f,g,k,l,m,n,q,r)}}; -mxVmlCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,q,r){k=this.state;a=(a+k.dx)*k.scale;b=(b+k.dy)*k.scale;c=this.createVmlElement("shape");c.style.width="1px";c.style.height="1px";c.stroked="false";d=this.createVmlElement("fill");d.color=k.fontColor;d.opacity=100*k.alpha+"%";c.appendChild(d);d=this.createVmlElement("path");d.textpathok="true";d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0);c.appendChild(d);d=this.createVmlElement("textpath");d.style.cssText= +mxVmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,r){if(this.textEnabled&&null!=e){var u=this.state;if("html"==l){null!=u.rotation&&(b=this.rotatePoint(a,b,u.rotation,u.rotationCx,u.rotationCy),a=b.x,b=b.y);8==document.documentMode&&!mxClient.IS_EM?(a+=u.dx,b+=u.dy,"fill"!=m&&g==mxConstants.ALIGN_TOP&&(b-=1)):(a*=u.scale,b*=u.scale);l=8==document.documentMode&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");l.style.position="absolute";l.style.display="inline"; +l.style.left=this.format(a)+"px";l.style.top=this.format(b)+"px";l.style.zoom=u.scale;var q=this.createElement("div");q.style.position="relative";q.style.display="inline";var s=mxUtils.getAlignmentAsPoint(f,g),t=s.x,s=s.y;e=this.createDiv(e,f,g,m);f=this.createElement("div");null!=r&&e.setAttribute("dir",r);if(k&&0v&&(v+=2*Math.PI);v%=Math.PI;v>Math.PI/2&&(v=Math.PI-v);g=Math.cos(v);var x=Math.sin(v);8==document.documentMode&&!mxClient.IS_EM&&(e.style.display="inline-block",f.style.display="inline-block",q.style.display="inline-block");e.style.visibility="hidden";e.style.position="absolute";document.body.appendChild(e);q=e;null!=q.firstChild&&"DIV"==q.firstChild.nodeName&&(q=q.firstChild);v=q.offsetWidth+3;q=q.offsetHeight;n?(c=Math.min(c,v), +q=Math.min(q,d)):c=v;k&&(e.style.width=c+"px");if(mxClient.IS_QUIRKS&&(n||"width"==m)&&q>d)q=d,e.style.height=q+"px";d=q;n=(d-d*g+c*-x)/2-r*c*(t+0.5)+p*d*(s+0.5);k=(c-c*g+d*-x)/2+p*c*(t+0.5)+r*d*(s+0.5);"group"==l.nodeName&&"DIV"==this.root.nodeName?(m=this.createElement("div"),m.style.display="inline-block",m.style.position="absolute",m.style.left=this.format(a+(k-c/2)*u.scale)+"px",m.style.top=this.format(b+(n-d/2)*u.scale)+"px",l.parentNode.appendChild(m),m.appendChild(l)):(u=8==document.documentMode&& +!mxClient.IS_EM?1:u.scale,l.style.left=this.format(a+(k-c/2)*u)+"px",l.style.top=this.format(b+(n-d/2)*u)+"px");f.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+p+", M12\x3d"+r+", M21\x3d"+-r+", M22\x3d"+p+", sizingMethod\x3d'auto expand')";f.style.backgroundColor=this.rotatedHtmlBackground;1>this.state.alpha&&(f.style.filter+="alpha(opacity\x3d"+100*this.state.alpha+")");f.appendChild(e);e.style.position="";e.style.visibility=""}else 8!=document.documentMode||mxClient.IS_EM?(e.style.verticalAlign= +"top",1>this.state.alpha&&(l.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),u=e.parentNode,e.style.visibility="hidden",document.body.appendChild(e),c=e.offsetWidth,q=e.offsetHeight,mxClient.IS_QUIRKS&&n&&q>d&&(q=d,e.style.height=q+"px"),d=q,e.style.visibility="",u.appendChild(e),l.style.left=this.format(a+c*t*this.state.scale)+"px",l.style.top=this.format(b+d*s*this.state.scale)+"px"):(1>this.state.alpha&&(e.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),q.style.left=100*t+ +"%",q.style.top=100*s+"%")}else this.plainText(a,b,c,d,mxUtils.htmlEntities(e,!1),f,g,k,l,m,n,p,r)}}; +mxVmlCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,p,r){k=this.state;a=(a+k.dx)*k.scale;b=(b+k.dy)*k.scale;c=this.createVmlElement("shape");c.style.width="1px";c.style.height="1px";c.stroked="false";d=this.createVmlElement("fill");d.color=k.fontColor;d.opacity=100*k.alpha+"%";c.appendChild(d);d=this.createVmlElement("path");d.textpathok="true";d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0);c.appendChild(d);d=this.createVmlElement("textpath");d.style.cssText= "v-text-align:"+f;d.style.align=f;d.style.fontFamily=k.fontFamily;d.string=e;d.on="true";f=k.fontSize*k.scale/this.vmlScale;d.style.fontSize=f+"px";(k.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold");(k.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic");(k.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline");e=e.split("\n");k=f+(e.length-1)*f*mxConstants.LINE_HEIGHT;f=e=0; -g==mxConstants.ALIGN_BOTTOM?f=-k/2:g!=mxConstants.ALIGN_MIDDLE&&(f=k/2);null!=q&&(c.style.rotation=q,g=q*(Math.PI/180),e=Math.sin(g)*f,f*=Math.cos(g));c.appendChild(d);c.style.left=this.format(a-e)+"px";c.style.top=this.format(b+f)+"px";this.root.appendChild(c)};mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)}; +g==mxConstants.ALIGN_BOTTOM?f=-k/2:g!=mxConstants.ALIGN_MIDDLE&&(f=k/2);null!=p&&(c.style.rotation=p,g=p*(Math.PI/180),e=Math.sin(g)*f,f*=Math.cos(g));c.appendChild(d);c.style.left=this.format(a-e)+"px";c.style.top=this.format(b+f)+"px";this.root.appendChild(c)};mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)}; function mxGuide(a,b){this.graph=a;this.setStates(b)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=!0;mxGuide.prototype.vertical=!0;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null;mxGuide.prototype.setStates=function(a){this.states=a};mxGuide.prototype.isEnabledForEvent=function(a){return!0};mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize/2}; mxGuide.prototype.createGuideShape=function(a){a=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);a.isDashed=!0;return a}; -mxGuide.prototype.move=function(a,b,c){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=b){var d=this.graph.getView().translate,e=this.graph.getView().scale,f=b.x,g=b.y,k=!1,l=null,m=null,n=!1,q=null,r=null,u=this.getGuideTolerance(),p=u,s=u,u=a.clone();u.x+=b.x;u.y+=b.y;var t=u.x,v=u.x+u.width,x=u.getCenterX(),z=u.y,y=u.y+u.height,E=u.getCenterY();b=function(b,c){b+=this.graph.panDx;var d=!1;Math.abs(b-x)m&&(m+=2*Math.PI);m%=Math.PI;m>Math.PI/2&&(m=Math.PI-m);var k=Math.cos(m),n=Math.sin(-m),b=l*-(b+0.5),q=g*-(c+0.5),r=(g-g*k+l*n)/2+f*b-e*q;0!=m&&(c="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+e+", M12\x3d"+f+", M21\x3d"+-f+", M22\x3d"+e+", sizingMethod\x3d'auto expand')",a.filter=null!=a.filter&&0m&&(m+=2*Math.PI);m%=Math.PI;m>Math.PI/2&&(m=Math.PI-m);var k=Math.cos(m),n=Math.sin(-m),b=l*-(b+0.5),p=g*-(c+0.5),r=(g-g*k+l*n)/2+f*b-e*p;0!=m&&(c="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+e+", M12\x3d"+f+", M21\x3d"+-f+", M22\x3d"+e+", sizingMethod\x3d'auto expand')",a.filter=null!=a.filter&&0b)break;k=c}f=e.getIndex(a);f=Math.max(0,g-(g>f?1:0));d.add(e,a,f)}}; mxStackLayout.prototype.getParentSize=function(a){var b=this.graph.getModel(),c=b.getGeometry(a);if(null!=this.graph.container&&(null==c&&b.isLayer(a)||a==this.graph.getView().currentRoot))c=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1);return c}; mxStackLayout.prototype.execute=function(a){if(null!=a){var b=this.getParentSize(a),c=this.isHorizontal(),d=this.graph.getModel(),e=null;null!=b&&(e=c?b.height-this.marginTop-this.marginBottom:b.width-this.marginLeft-this.marginRight);var e=e-(2*this.spacing+2*this.border),f=this.x0+this.border+this.marginLeft,g=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(a)){var k=this.graph.getCellStyle(a),l=mxUtils.getNumber(k,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),k=1==mxUtils.getValue(k, -mxConstants.STYLE_HORIZONTAL,!0);null!=b&&(l=k?Math.min(l,b.height):Math.min(l,b.width));c==k&&(e-=l);k?g+=l:f+=l}d.beginUpdate();try{for(var l=0,k=null,m=0,n=null,q=d.getChildCount(a),r=0;rthis.wrap||!c&&k.y+k.height+p.height+2*this.spacing>this.wrap))k=null,c?g+=l+this.spacing:f+=l+this.spacing,l= -0;var l=Math.max(l,c?p.height:p.width),s=0;if(!this.borderCollapse)var t=this.graph.getCellStyle(u),s=mxUtils.getNumber(t,mxConstants.STYLE_STROKEWIDTH,1);null!=k?c?p.x=m+this.spacing+Math.floor(s/2):p.y=m+this.spacing+Math.floor(s/2):this.keepFirstLocation||(c?p.x=f:p.y=g);c?p.y=g:p.x=f;this.fill&&null!=e&&(c?p.height=e:p.width=e);this.setChildGeometry(u,p);n=u;k=p;m=c?k.x+k.width+Math.floor(s/2):k.y+k.height+Math.floor(s/2)}}}this.resizeParent&&null!=b&&null!=k&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a, +mxConstants.STYLE_HORIZONTAL,!0);null!=b&&(l=k?Math.min(l,b.height):Math.min(l,b.width));c==k&&(e-=l);k?g+=l:f+=l}d.beginUpdate();try{for(var l=0,k=null,m=0,n=null,p=d.getChildCount(a),r=0;rthis.wrap||!c&&k.y+k.height+q.height+2*this.spacing>this.wrap))k=null,c?g+=l+this.spacing:f+=l+this.spacing,l= +0;var l=Math.max(l,c?q.height:q.width),s=0;if(!this.borderCollapse)var t=this.graph.getCellStyle(u),s=mxUtils.getNumber(t,mxConstants.STYLE_STROKEWIDTH,1);null!=k?c?q.x=m+this.spacing+Math.floor(s/2):q.y=m+this.spacing+Math.floor(s/2):this.keepFirstLocation||(c?q.x=f:q.y=g);c?q.y=g:q.x=f;this.fill&&null!=e&&(c?q.height=e:q.width=e);this.setChildGeometry(u,q);n=u;k=q;m=c?k.x+k.width+Math.floor(s/2):k.y+k.height+Math.floor(s/2)}}}this.resizeParent&&null!=b&&null!=k&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a, b,k):this.resizeLast&&null!=b&&null!=k&&null!=n&&(c?k.width=b.width-k.x-this.spacing-this.marginRight-this.marginLeft:k.height=b.height-k.y-this.spacing-this.marginBottom,this.setChildGeometry(n,k))}finally{d.endUpdate()}}};mxStackLayout.prototype.setChildGeometry=function(a,b){var c=this.graph.getCellGeometry(a);(null==c||b.x!=c.x||b.y!=c.y||b.width!=c.width||b.height!=c.height)&&this.graph.getModel().setGeometry(a,b)}; mxStackLayout.prototype.updateParentGeometry=function(a,b,c){var d=this.isHorizontal(),e=this.graph.getModel(),f=b.clone();d?(c=c.x+c.width+this.spacing+this.marginRight,f.width=this.resizeParentMax?Math.max(f.width,c):c):(c=c.y+c.height+this.spacing+this.marginBottom,f.height=this.resizeParentMax?Math.max(f.height,c):c);(b.x!=f.x||b.y!=f.y||b.width!=f.width||b.height!=f.height)&&e.setGeometry(a,f)}; function mxPartitionLayout(a,b,c,d){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=c||0;this.border=d||0}mxPartitionLayout.prototype=new mxGraphLayout;mxPartitionLayout.prototype.constructor=mxPartitionLayout;mxPartitionLayout.prototype.horizontal=null;mxPartitionLayout.prototype.spacing=null;mxPartitionLayout.prototype.border=null;mxPartitionLayout.prototype.resizeVertices=!0;mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal}; mxPartitionLayout.prototype.moveCell=function(a,b,c){c=this.graph.getModel();var d=c.getParent(a);if(null!=a&&null!=d){for(var e=0,f=0,g=c.getChildCount(d),e=0;eb)break;f=k}}b=d.getIndex(a);b=Math.max(0,e-(e>b?1:0));c.add(d,a,b)}}; mxPartitionLayout.prototype.execute=function(a){var b=this.isHorizontal(),c=this.graph.getModel(),d=c.getGeometry(a);if(null!=this.graph.container&&(null==d&&c.isLayer(a)||a==this.graph.getView().currentRoot))d=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1);if(null!=d){for(var e=[],f=c.getChildCount(a),g=0;gg+2*this.prefHozEdgeSep&&(f-=2*this.prefHozEdgeSep);a=f/d;b=a/2;f>g+2*this.prefHozEdgeSep&&(b+=this.prefHozEdgeSep);for(var f=this.minEdgeJetty-this.prefVertEdgeOff,g=0,k=this.getVertexBounds(c),l=0;ld/2&&(f-=this.prefVertEdgeOff);b+=a;g=Math.max(g,f)}}; +e[l].cell.cell,n=this.getVertexBounds(m),m=this.graph.getEdgesBetween(c,m,!1),p=[],r=0,u=0,q=0;qd/2&&(f-=this.prefVertEdgeOff);b+=a;g=Math.max(g,f)}}; function WeightedCellSorter(a,b){this.cell=a;this.weightedValue=b}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=!1;WeightedCellSorter.prototype.visited=!1;WeightedCellSorter.prototype.rankIndex=null;WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.weightedValue>a.weightedValue?1:b.weightedValuethis.forceConstant&&(this.forceConstant= -0.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;db&&(b=0.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}}; mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;amxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null;mxSwimlaneModel.prototype.vertexMapper=null;mxSwimlaneModel.prototype.edgeMapper=null;mxSwimlaneModel.prototype.ranks=null;mxSwimlaneModel.prototype.roots=null;mxSwimlaneModel.prototype.parent=null;mxSwimlaneModel.prototype.dfsCount=0; mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1E8;mxGraphHierarchyModel.prototype.tightenToSource=!1;mxSwimlaneModel.prototype.ranksPerGroup=null; mxSwimlaneModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=a.swimlanes,f=0;f=m.length){for(var l=new mxGraphHierarchyEdge(m),n=0;nmxUtils.indexOf(c[f].connectsAsSource,l)&&c[f].connectsAsSource.push(l)}}}c[f].temp[0]=0}}; +l=a.getEdgesBetween(b[f],l,!0);if(null!=m&&0=m.length){for(var l=new mxGraphHierarchyEdge(m),n=0;nmxUtils.indexOf(c[f].connectsAsSource,l)&&c[f].connectsAsSource.push(l)}}}c[f].temp[0]=0}}; mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var a=[],b={};if(null!=this.roots)for(var c=0;cb[d.swimlaneIndex]&&(k=b[d.swimlaneIndex]);d.temp[0]=k;if(null!=f)for(c=0;c>1,++e[l]}return c}; -mxMedianHybridCrossingReduction.prototype.transpose=function(a,b){for(var c=!0,d=0;c&&10>d++;)for(var e=1==a%2&&1==d%2,c=!1,f=0;fn&&(n=l);k[n]=m}for(var q=null,r=null,u=null,p=null,s=null,t=null,v=null,x=null,l=0;ls[A]&&y++,u[z]t[A]&&y++,p[z]d++;)for(var e=1==a%2&&1==d%2,c=!1,f=0;fn&&(n=l);k[n]=m}for(var p=null,r=null,u=null,q=null,s=null,t=null,v=null,x=null,l=0;ls[A]&&y++,u[z]t[A]&&y++,q[z]a.medianValue?-1:b.medianValuet+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,v),q=!0):(m=d[l][m+1],t=m.getGeneralPurposeVariable(l),t=t-m.width/2-this.intraCellSpacing-e.width/2,t>v?(e.setGeneralPurposeVariable(l, -v),q=!0):t>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,t),q=!0)));if(q){for(e=0;et+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,v),p=!0):(m=d[l][m+1],t=m.getGeneralPurposeVariable(l),t=t-m.width/2-this.intraCellSpacing-e.width/2,t>v?(e.setGeneralPurposeVariable(l, +v),p=!0):t>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,t),p=!0)));if(p){for(e=0;e=k&&l<=r?g.setGeneralPurposeVariable(a,l):lr&&(g.setGeneralPurposeVariable(a,r),this.currentXDelta+=l-r);d[f].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,b){for(var c=0,d=0;dthis.widestRankValue&&(this.widestRankValue=k,this.widestRank=e);this.rankWidths[e]=k}!0==l&&mxLog.warn("At least one cell has no bounds");this.rankY[e]=c;k=f/2+d/2+this.interRankCellSpacing;d=f;c=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?c+k:c- +mxCoordinateAssignment.prototype.calculateWidestRank=function(a,b){var c=-this.interRankCellSpacing,d=0;this.rankWidths=[];this.rankY=[];for(var e=b.maxRank;0<=e;e--){for(var f=0,g=b.ranks[e],k=this.initialX,l=!1,m=0;mthis.widestRankValue&&(this.widestRankValue=k,this.widestRank=e);this.rankWidths[e]=k}!0==l&&mxLog.warn("At least one cell has no bounds");this.rankY[e]=c;k=f/2+d/2+this.interRankCellSpacing;d=f;c=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?c+k:c- k;for(m=0;me.maxRank-e.minRank-1)){for(var f=e.getGeneralPurposeVariable(e.minRank+1),g=!0,k=0,l=e.minRank+2;le.minRank+1;l--)r=e.getX(l-1),q==r?(n[l-e.minRank-2]=q,g++):this.repositionValid(b,e,l-1,q)?(n[l-e.minRank-2]=q,g++):(n[l-e.minRank-2]=e.getX(l-1),q=r);if(g>k||f>k)if(g>=f)for(l=e.maxRank-2;l>e.minRank;l--)e.setX(l,n[l-e.minRank-1]);else if(f>g)for(l=e.minRank+2;le.maxRank-e.minRank-1)){for(var f=e.getGeneralPurposeVariable(e.minRank+1),g=!0,k=0,l=e.minRank+2;le.minRank+1;l--)r=e.getX(l-1),p==r?(n[l-e.minRank-2]=p,g++):this.repositionValid(b,e,l-1,p)?(n[l-e.minRank-2]=p,g++):(n[l-e.minRank-2]=e.getX(l-1),p=r);if(g>k||f>k)if(g>=f)for(l=e.maxRank-2;l>e.minRank;l--)e.setX(l,n[l-e.minRank-1]);else if(f>g)for(l=e.minRank+2;le)return!1;f=b.getGeneralPurposeVariable(c);if(df){if(e==a.length-1)return!0;a=a[e+1];c=a.getGeneralPurposeVariable(c);c=c-a.width/2-this.intraCellSpacing-b.width/2;if(!(c>=d))return!1}return!0}; mxCoordinateAssignment.prototype.setCellLocations=function(a,b){this.rankTopY=[];this.rankBottomY=[];for(var c=0;ck;k++){if(-1(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep,q-=this.prefHozEdgeSep);l=(q-n)/f;n+=l/2;q=this.minEdgeJetty-this.prefVertEdgeOff;for(m=r=0;mf/2&&(q-=this.prefVertEdgeOff);for(s=0;sk;k++){if(-1(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);l=(p-n)/f;n+=l/2;p=this.minEdgeJetty-this.prefVertEdgeOff;for(m=r=0;mf/2&&(p-=this.prefVertEdgeOff);for(s=0;sa.weightedValue?-1:b.weightedValuef&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; +mxHierarchicalLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var k=b[g];if(d.isVertex(k)&&this.graph.isCellVisible(k)){for(var l=this.getEdges(k),m=0,n=0,p=0;pf&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; mxHierarchicalLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;for(var c=this.graph.model,b=[],d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;ff&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; +mxSwimlaneLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var k=b[g];if(null!=k&&d.isVertex(k)&&this.graph.isCellVisible(k)&&d.isAncestor(a,k)){for(var l=this.getEdges(k),m=0,n=0,p=0;pf&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; mxSwimlaneLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;for(var c=this.graph.model,b=[],d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f=this.swimlanes.length)&&(r>k||(!b||q)&&r==k))e= +mxSwimlaneLayout.prototype.traverse=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=d){var l=mxObjectIdentity.get(a);if(null==d[l]&&(null==g||null!=g[l])){null==e[l]&&(e[l]=a);null==d[l]&&(d[l]=a);null!==g&&delete g[l];var m=this.getEdges(a),l=this.graph.model;for(c=0;c=this.swimlanes.length)&&(r>k||(!b||p)&&r==k))e= this.traverse(n,b,m[c],d,e,f,g,r)}}else if(null==e[l])for(c=0;cb[e]?1:-1:(c=parseInt(a[e]),e=parseInt(b[e]),d=c==e?0:c>e?1:-1);break}0==d&&(c=a.length,e=b.length,c!=e&&(d=c>e?1:-1));return d}},mxPerimeter={RectanglePerimeter:function(a,b,c,d){b=a.getCenterX();var e=a.getCenterY(),f=Math.atan2(c.y-e,c.x-b),g=new mxPoint(0,0),k=Math.PI,l=Math.PI/2-f,m=Math.atan2(a.height,a.width);f<-k+m||f>k-m?(g.x=a.x,g.y=e-a.width* -Math.tan(f)/2):f<-m?(g.y=a.y,g.x=b-a.height*Math.tan(l)/2):f=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.xa.x+a.width&&(g.x=a.x+a.width),c.ya.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,k=a.height/2,l=e+g,m=f+k;b=c.x;c=c.y;var n=parseInt(b-l),q=parseInt(c-m);if(0==n&&0!=q)return new mxPoint(l, -m+k*q/Math.abs(q));if(0==n&&0==q)return new mxPoint(b,c);if(d){if(c>=f&&c<=f+a.height)return a=c-m,a=Math.sqrt(g*g*(1-a*a/(k*k)))||0,b<=e&&(a=-a),new mxPoint(l+a,c);if(b>=e&&b<=e+a.width)return a=b-l,a=Math.sqrt(k*k*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(b,m+a)}e=q/n;m-=e*l;f=g*g*e*e+k*k;a=-2*l*f;k=Math.sqrt(a*a-4*f*(g*g*e*e*l*l+k*k*l*l-g*g*k*k));g=(-a+k)/(2*f);k=(-a-k)/(2*f);l=e*g+m;m=e*k+m;e=Math.sqrt(Math.pow(g-b,2)+Math.pow(l-c,2));b=Math.sqrt(Math.pow(k-b,2)+Math.pow(m-c,2));f=c=0;e=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.xa.x+a.width&&(g.x=a.x+a.width),c.ya.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,k=a.height/2,l=e+g,m=f+k;b=c.x;c=c.y;var n=parseInt(b-l),p=parseInt(c-m);if(0==n&&0!=p)return new mxPoint(l, +m+k*p/Math.abs(p));if(0==n&&0==p)return new mxPoint(b,c);if(d){if(c>=f&&c<=f+a.height)return a=c-m,a=Math.sqrt(g*g*(1-a*a/(k*k)))||0,b<=e&&(a=-a),new mxPoint(l+a,c);if(b>=e&&b<=e+a.width)return a=b-l,a=Math.sqrt(k*k*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(b,m+a)}e=p/n;m-=e*l;f=g*g*e*e+k*k;a=-2*l*f;k=Math.sqrt(a*a-4*f*(g*g*e*e*l*l+k*k*l*l-g*g*k*k));g=(-a+k)/(2*f);k=(-a-k)/(2*f);l=e*g+m;m=e*k+m;e=Math.sqrt(Math.pow(g-b,2)+Math.pow(l-c,2));b=Math.sqrt(Math.pow(k-b,2)+Math.pow(m-c,2));f=c=0;ec?new mxPoint(g,e):new mxPoint(g,e+a);if(k==c)return g>l?new mxPoint(b,k):new mxPoint(b+f,k);var m=g,n=k;d&&(l>=b&&l<=b+f?m=l:c>=e&&c<=e+a&&(n=c));return l-s&&uMath.PI-s,s=null;p?s=d&&(e&&c.x>=n.x&&c.x<=r.x||!e&&c.y>=n.y&&c.y<=r.y)?e?new mxPoint(c.x,n.y):new mxPoint(n.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+k/2+a*Math.tan(u)/2,g+a):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+k/2-a*Math.tan(u)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+k,g+a/2+k*Math.tan(u)/2):new mxPoint(f, -g+a/2-k*Math.tan(u)/2):(d&&(d=new mxPoint(l,m),c.y>=g&&c.y<=g+a?(d.x=e?l:b==mxConstants.DIRECTION_WEST?f+k:f,d.y=c.y):c.x>=f&&c.x<=f+k&&(d.x=c.x,d.y=!e?m:b==mxConstants.DIRECTION_NORTH?g+a:g),l=d.x,m=d.y),s=e&&c.x<=f+k/2||!e&&c.y<=g+a/2?mxUtils.intersection(c.x,c.y,l,m,n.x,n.y,q.x,q.y):mxUtils.intersection(c.x,c.y,l,m,q.x,q.y,r.x,r.y));null==s&&(s=new mxPoint(l,m));return s},HexagonPerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,k=a.height,l=a.getCenterX();a=a.getCenterY();var m=c.x,n=c.y,q= --Math.atan2(n-a,m-l),r=Math.PI,u=Math.PI/2,p=new mxPoint(l,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var s=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=new mxPoint;p=new mxPoint;if(mf+k||m>e+g&&ne+g&&n>f+k)d=!1;if(d){if(s){if(m==l){if(n<=f)return new mxPoint(l,f);if(n>=f+k)return new mxPoint(l,f+k)}else if(me+g){if(n==f+k/4)return new mxPoint(e+g,f+k/4);if(n==f+3*k/4)return new mxPoint(e+g,f+3*k/4)}else if(m==e){if(na)return new mxPoint(e,f+3*k/4)}else if(m==e+g){if(na)return new mxPoint(e+g,f+3*k/4)}if(n==f)return new mxPoint(l,f);if(n==f+k)return new mxPoint(l,f+k);mf+k/4&&nf+3*k/4&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),p=new mxPoint(e+g,f+Math.floor(1.25*k))):m>l&&(n>f+k/4&&nf+3*k/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),p=new mxPoint(e,f+Math.floor(1.25*k))))}else{if(n==a){if(m<=e)return new mxPoint(e,f+k/2);if(m>=e+g)return new mxPoint(e+g,f+k/ -2)}else if(nf+k){if(m==e+g/4)return new mxPoint(e+g/4,f+k);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f+k)}else if(n==f){if(ml)return new mxPoint(e+3*g/4,f)}else if(n==f+k){if(ma)return new mxPoint(e+3*g/4,f+k)}if(m==e)return new mxPoint(e,a);if(m==e+g)return new mxPoint(e+g,a);ne+g/4&&me+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*k)),p=new mxPoint(e+Math.floor(1.25*g),f+k)):n>a&&(m>e+g/4&&me+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),p=new mxPoint(e+Math.floor(1.25*g),f)))}d= -l;q=a;m>=e&&m<=e+g?(d=m,q=n=f&&n<=f+k&&(q=n,d=m-m?(b=new mxPoint(e+g,f), -p=new mxPoint(e+g,f+k)):q>m&&qu&&qr-m&&q<=r||q<-r+m&&q>=-r?(b=new mxPoint(e,f),p=new mxPoint(e,f+k)):q<-m&&q>-u?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),p=new mxPoint(e,f+Math.floor(1.25*k))):q<-u&&q>-r+m&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),p=new mxPoint(e+g,f+ -Math.floor(1.25*k)))}else{m=Math.atan2(k/2,g/4);if(q==m)return new mxPoint(e+Math.floor(0.75*g),f);if(q==r-m)return new mxPoint(e+Math.floor(0.25*g),f);if(q==r||q==-r)return new mxPoint(e,f+Math.floor(0.5*k));if(0==q)return new mxPoint(e+g,f+Math.floor(0.5*k));if(q==-m)return new mxPoint(e+Math.floor(0.75*g),f+k);if(q==-r+m)return new mxPoint(e+Math.floor(0.25*g),f+k);0m&&qr-m&&qq&&q>-m?(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),p=new mxPoint(e+Math.floor(1.25*g),f)):q<-m&&q>-r+m?(b=new mxPoint(e,f+k),p=new mxPoint(e+g,f+k)):q<-r+m&&q>-r&&(b=new mxPoint(e-Math.floor(0.25*g),f),p=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)))}p=mxUtils.intersection(l,a,c.x,c.y,b.x,b.y,p.x,p.y)}return null==p?new mxPoint(l,a):p}}; +b,c,d){b=null!=b?b.style[mxConstants.STYLE_DIRECTION]:null;var e=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH,f=a.x,g=a.y,k=a.width;a=a.height;var l=f+k/2,m=g+a/2,n=new mxPoint(f,g),p=new mxPoint(f+k,m),r=new mxPoint(f,g+a);b==mxConstants.DIRECTION_NORTH?(n=r,p=new mxPoint(l,g),r=new mxPoint(f+k,g+a)):b==mxConstants.DIRECTION_SOUTH?(p=new mxPoint(l,g+a),r=new mxPoint(f+k,g)):b==mxConstants.DIRECTION_WEST&&(n=new mxPoint(f+k,g),p=new mxPoint(f,m),r=new mxPoint(f+k,g+a));var u=c.x- +l,q=c.y-m,u=e?Math.atan2(u,q):Math.atan2(q,u),s=e?Math.atan2(k,a):Math.atan2(a,k),q=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?u>-s&&uMath.PI-s,s=null;q?s=d&&(e&&c.x>=n.x&&c.x<=r.x||!e&&c.y>=n.y&&c.y<=r.y)?e?new mxPoint(c.x,n.y):new mxPoint(n.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+k/2+a*Math.tan(u)/2,g+a):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+k/2-a*Math.tan(u)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+k,g+a/2+k*Math.tan(u)/2):new mxPoint(f, +g+a/2-k*Math.tan(u)/2):(d&&(d=new mxPoint(l,m),c.y>=g&&c.y<=g+a?(d.x=e?l:b==mxConstants.DIRECTION_WEST?f+k:f,d.y=c.y):c.x>=f&&c.x<=f+k&&(d.x=c.x,d.y=!e?m:b==mxConstants.DIRECTION_NORTH?g+a:g),l=d.x,m=d.y),s=e&&c.x<=f+k/2||!e&&c.y<=g+a/2?mxUtils.intersection(c.x,c.y,l,m,n.x,n.y,p.x,p.y):mxUtils.intersection(c.x,c.y,l,m,p.x,p.y,r.x,r.y));null==s&&(s=new mxPoint(l,m));return s},HexagonPerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,k=a.height,l=a.getCenterX();a=a.getCenterY();var m=c.x,n=c.y,p= +-Math.atan2(n-a,m-l),r=Math.PI,u=Math.PI/2,q=new mxPoint(l,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var s=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=new mxPoint;q=new mxPoint;if(mf+k||m>e+g&&ne+g&&n>f+k)d=!1;if(d){if(s){if(m==l){if(n<=f)return new mxPoint(l,f);if(n>=f+k)return new mxPoint(l,f+k)}else if(me+g){if(n==f+k/4)return new mxPoint(e+g,f+k/4);if(n==f+3*k/4)return new mxPoint(e+g,f+3*k/4)}else if(m==e){if(na)return new mxPoint(e,f+3*k/4)}else if(m==e+g){if(na)return new mxPoint(e+g,f+3*k/4)}if(n==f)return new mxPoint(l,f);if(n==f+k)return new mxPoint(l,f+k);mf+k/4&&nf+3*k/4&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),q=new mxPoint(e+g,f+Math.floor(1.25*k))):m>l&&(n>f+k/4&&nf+3*k/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),q=new mxPoint(e,f+Math.floor(1.25*k))))}else{if(n==a){if(m<=e)return new mxPoint(e,f+k/2);if(m>=e+g)return new mxPoint(e+g,f+k/ +2)}else if(nf+k){if(m==e+g/4)return new mxPoint(e+g/4,f+k);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f+k)}else if(n==f){if(ml)return new mxPoint(e+3*g/4,f)}else if(n==f+k){if(ma)return new mxPoint(e+3*g/4,f+k)}if(m==e)return new mxPoint(e,a);if(m==e+g)return new mxPoint(e+g,a);ne+g/4&&me+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*k)),q=new mxPoint(e+Math.floor(1.25*g),f+k)):n>a&&(m>e+g/4&&me+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),q=new mxPoint(e+Math.floor(1.25*g),f)))}d= +l;p=a;m>=e&&m<=e+g?(d=m,p=n=f&&n<=f+k&&(p=n,d=m-m?(b=new mxPoint(e+g,f), +q=new mxPoint(e+g,f+k)):p>m&&pu&&pr-m&&p<=r||p<-r+m&&p>=-r?(b=new mxPoint(e,f),q=new mxPoint(e,f+k)):p<-m&&p>-u?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),q=new mxPoint(e,f+Math.floor(1.25*k))):p<-u&&p>-r+m&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),q=new mxPoint(e+g,f+ +Math.floor(1.25*k)))}else{m=Math.atan2(k/2,g/4);if(p==m)return new mxPoint(e+Math.floor(0.75*g),f);if(p==r-m)return new mxPoint(e+Math.floor(0.25*g),f);if(p==r||p==-r)return new mxPoint(e,f+Math.floor(0.5*k));if(0==p)return new mxPoint(e+g,f+Math.floor(0.5*k));if(p==-m)return new mxPoint(e+Math.floor(0.75*g),f+k);if(p==-r+m)return new mxPoint(e+Math.floor(0.25*g),f+k);0m&&pr-m&&pp&&p>-m?(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),q=new mxPoint(e+Math.floor(1.25*g),f)):p<-m&&p>-r+m?(b=new mxPoint(e,f+k),q=new mxPoint(e+g,f+k)):p<-r+m&&p>-r&&(b=new mxPoint(e-Math.floor(0.25*g),f),q=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)))}q=mxUtils.intersection(l,a,c.x,c.y,b.x,b.y,q.x,q.y)}return null==q?new mxPoint(l,a):q}}; function mxPrintPreview(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=mxRectangle.fromRectangle(null!=c?c:a.pageFormat);this.title=null!=k?k:"Printer-friendly version";this.x0=null!=e?e:0;this.y0=null!=f?f:0;this.borderColor=g;this.pageSelector=null!=l?l:!0}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0; mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=!0;mxPrintPreview.prototype.printOverlays=!1;mxPrintPreview.prototype.printControls=!1;mxPrintPreview.prototype.printBackgroundImage=!1;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null;mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null; mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=!0;mxPrintPreview.prototype.getWindow=function(){return this.wnd}; mxPrintPreview.prototype.getDoctype=function(){var a="";5==document.documentMode?a='\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3d5"\x3e':8==document.documentMode?a='\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3d8"\x3e':8n,k=f.xm;else l=Math.max(b.x,c.x),m=Math.min(b.x+b.width b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(a=Math.max(b.x,c.x),k=Math.min(b.x+b.width,c.x+c.width),a=null!=d?d.x:Math.round(k+(a-k)/2),k=f.getRoutingCenterY(b),f=f.getRoutingCenterY(c),null!=d&&(d.y>=b.y&&d.y<=b.y+b.height&&(k=d.y),d.y>=c.y&&d.y<=c.y+c.height&&(f=d.y)),!mxUtils.contains(c,a,k)&&!mxUtils.contains(b,a,k)&&e.push(new mxPoint(a,k)),!mxUtils.contains(c,a,f)&&!mxUtils.contains(b,a,f)&&e.push(new mxPoint(a,f)),1==e.length&&(null!=d?!mxUtils.contains(c, a,d.y)&&!mxUtils.contains(b,a,d.y)&&e.push(new mxPoint(a,d.y)):(f=Math.max(b.y,c.y),b=Math.min(b.y+b.height,c.y+c.height),e.push(new mxPoint(a,f+(b-f)/2)))))},TopToBottom:function(a,b,c,d,e){var f=a.view;d=null!=d&&0=b.x&&d.x<=b.x+b.width&&(a=d.x),k=null!=d?d.y:Math.round(g+(k-g)/2),!mxUtils.contains(c,a,k)&&!mxUtils.contains(b,a,k)&&e.push(new mxPoint(a,k)),a=null!=d&&d.x>=c.x&&d.x<=c.x+c.width?d.x:f.getRoutingCenterX(c),!mxUtils.contains(c,a,k)&&!mxUtils.contains(b,a,k)&&e.push(new mxPoint(a,k)),1==e.length&&(null!=d&&1==e.length?!mxUtils.contains(c,d.x,k)&&!mxUtils.contains(b,d.x,k)&&e.push(new mxPoint(d.x,k)):(f=Math.max(b.x,c.x),b=Math.min(b.x+b.width,c.x+c.width),e.push(new mxPoint(f+(b-f)/ -2,k)))))},SegmentConnector:function(a,b,c,d,e){function f(a){if(null==l||Math.abs(l.x-a.x)>=k||Math.abs(l.y-a.y)>=k)e.push(a),l=a;return l}var g=a.absolutePoints,k=Math.max(1,a.view.scale),l=0u;u++){var z=null!=t&&t.x==v.x,y=null!=t&&t.y==v.y,E=null!=s&&v.y>=s.y&& -v.y<=s.y+s.height,s=null!=s&&v.x>=s.x&&v.x<=s.x+s.width,v=y||null==t&&E,x=z||null==t&&s;if(!(0==u&&(v&&x||z&&y))){if(null!=t&&!y&&!z&&(E||s)){m=E?!1:!0;break}if(x||v){m=v;1==u&&(m=0==d.length%2?v:x);break}}s=c;t=g[r];null!=t&&(t.x=Math.round(t.x),t.y=Math.round(t.y),s=null);v=d[d.length-1];z&&y&&(d=d.slice(1))}m&&(null!=g[0]&&g[0].y!=n.y||null==g[0]&&null!=b&&(n.yb.y+b.height))?f(new mxPoint(q.x,n.y)):!m&&(null!=g[0]&&g[0].x!=n.x||null==g[0]&&null!=b&&(n.xb.x+b.width))&&f(new mxPoint(n.x, -q.y));m?q.y=n.y:q.x=n.x;for(u=0;uc.y+c.height))?f(new mxPoint(q.x,n.y)):!m&&(null!=g[r]&&g[r].x!=n.x||null==g[r]&&null!=c&&(n.xc.x+c.width))&&f(new mxPoint(n.x,q.y))));if(null==g[0]&&null!=b)for(;1< -e.length&&null!=e[1]&&mxUtils.contains(b,e[1].x,e[1].y);)e.splice(1,1);if(null==g[r]&&null!=c)for(;1=k||Math.abs(l.y-a.y)>=k)e.push(a),l=a;return l}var g=a.absolutePoints,k=Math.max(1,a.view.scale),l=0u;u++){var z=null!=t&&t.x==v.x,y=null!=t&&t.y==v.y,D=null!=s&&v.y>=s.y&& +v.y<=s.y+s.height,s=null!=s&&v.x>=s.x&&v.x<=s.x+s.width,v=y||null==t&&D,x=z||null==t&&s;if(!(0==u&&(v&&x||z&&y))){if(null!=t&&!y&&!z&&(D||s)){m=D?!1:!0;break}if(x||v){m=v;1==u&&(m=0==d.length%2?v:x);break}}s=c;t=g[r];null!=t&&(t.x=Math.round(t.x),t.y=Math.round(t.y),s=null);v=d[d.length-1];z&&y&&(d=d.slice(1))}m&&(null!=g[0]&&g[0].y!=n.y||null==g[0]&&null!=b&&(n.yb.y+b.height))?f(new mxPoint(p.x,n.y)):!m&&(null!=g[0]&&g[0].x!=n.x||null==g[0]&&null!=b&&(n.xb.x+b.width))&&f(new mxPoint(n.x, +p.y));m?p.y=n.y:p.x=n.x;for(u=0;uc.y+c.height))?f(new mxPoint(p.x,n.y)):!m&&(null!=g[r]&&g[r].x!=n.x||null==g[r]&&null!=c&&(n.xc.x+c.width))&&f(new mxPoint(n.x,p.y))));if(null==g[0]&&null!=b)for(;1< +e.length&&null!=e[1]&&mxUtils.contains(b,e[1].x,e[1].y);)e.splice(1,1);if(null==g[r]&&null!=c)for(;1y;y++)mxEdgeStyle.limits[y][1]= -n[y][0]-x[y],mxEdgeStyle.limits[y][2]=n[y][1]-x[y],mxEdgeStyle.limits[y][4]=n[y][0]+n[y][2]+x[y],mxEdgeStyle.limits[y][8]=n[y][1]+n[y][3]+x[y];x=n[0][1]+n[0][3]/2;q=n[1][1]+n[1][3]/2;y=n[0][0]+n[0][2]/2-(n[1][0]+n[1][2]/2);E=x-q;x=0;0>y?x=0>E?2:1:0>=E&&(x=3,0==y&&(x=2));q=null;null!=b&&(q=l);b=[[0.5,0.5],[0.5,0.5]];for(y=0;2>y;y++)null!=q&&(b[y][0]=(q.x-n[y][0])/n[y][2],1>=Math.abs(q.x-n[y][0])?a[y]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(q.x-n[y][0]-n[y][2])&&(a[y]=mxConstants.DIRECTION_MASK_EAST), -b[y][1]=(q.y-n[y][1])/n[y][3],1>=Math.abs(q.y-n[y][1])?a[y]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(q.y-n[y][1]-n[y][3])&&(a[y]=mxConstants.DIRECTION_MASK_SOUTH)),q=null,null!=c&&(q=m);y=n[0][1]-(n[1][1]+n[1][3]);m=n[0][0]-(n[1][0]+n[1][2]);q=n[1][1]-(n[0][1]+n[0][3]);r=n[1][0]-(n[0][0]+n[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-z,0);mxEdgeStyle.vertexSeperations[2]=Math.max(y-z,0);mxEdgeStyle.vertexSeperations[4]=Math.max(q-z,0);mxEdgeStyle.vertexSeperations[3]=Math.max(r-z,0);z=[]; -c=[];l=[];c[0]=m>=r?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;l[0]=y>=q?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;c[1]=mxUtils.reversePortConstraints(c[0]);l[1]=mxUtils.reversePortConstraints(l[0]);m=m>=r?m:r;q=y>=q?y:q;r=[[0,0],[0,0]];u=!1;for(y=0;2>y;y++)0==a[y]&&(0==(c[y]&d[y])&&(c[y]=mxUtils.reversePortConstraints(c[y])),0==(l[y]&d[y])&&(l[y]=mxUtils.reversePortConstraints(l[y])),r[y][0]=l[y],r[y][1]=c[y]);0y;y++)if(0==a[y]&&(0==(r[y][0]&d[y])&&(r[y][0]=r[y][1]),z[y]=r[y][0]&d[y],z[y]|=(r[y][1]&d[y])<<8,z[y]|=(r[1-y][y]&d[y])<<16,z[y]|=(r[1-y][1-y]&d[y])<<24,0==(z[y]&15)&&(z[y]<<=8),0==(z[y]&3840)&&(z[y]=z[y]&15|z[y]>>8),0== +mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):b=2*mxEdgeStyle.orthBuffer);return b},OrthConnector:function(a,b,c,d,e){var f=a.view.graph,g=null==b?!1:f.getModel().isEdge(b.cell),k=null==c?!1:f.getModel().isEdge(c.cell),f=a.absolutePoints,l=f[0],m=f[f.length-1],n=null!=b?b.x:l.x,p=null!=b?b.y:l.y,r=null!=b?b.width:0,u=null!=b?b.height:0,q=null!=c?c.x:m.x,s=null!=c?c.y:m.y,t=null!=c?c.width:0,v=null!=c?c.height:0,f=a.view.scale*mxEdgeStyle.getJettySize(a,b,c,d,!0),x=a.view.scale*mxEdgeStyle.getJettySize(a, +b,c,d,!1);null!=b&&c==b&&(f=x=Math.max(f,x));var z=x+f,y=!1;if(null!=l&&null!=m)var y=m.x-l.x,D=m.y-l.y,y=y*y+D*Dy;y++)mxEdgeStyle.limits[y][1]= +n[y][0]-x[y],mxEdgeStyle.limits[y][2]=n[y][1]-x[y],mxEdgeStyle.limits[y][4]=n[y][0]+n[y][2]+x[y],mxEdgeStyle.limits[y][8]=n[y][1]+n[y][3]+x[y];x=n[0][1]+n[0][3]/2;p=n[1][1]+n[1][3]/2;y=n[0][0]+n[0][2]/2-(n[1][0]+n[1][2]/2);D=x-p;x=0;0>y?x=0>D?2:1:0>=D&&(x=3,0==y&&(x=2));p=null;null!=b&&(p=l);b=[[0.5,0.5],[0.5,0.5]];for(y=0;2>y;y++)null!=p&&(b[y][0]=(p.x-n[y][0])/n[y][2],1>=Math.abs(p.x-n[y][0])?a[y]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(p.x-n[y][0]-n[y][2])&&(a[y]=mxConstants.DIRECTION_MASK_EAST), +b[y][1]=(p.y-n[y][1])/n[y][3],1>=Math.abs(p.y-n[y][1])?a[y]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(p.y-n[y][1]-n[y][3])&&(a[y]=mxConstants.DIRECTION_MASK_SOUTH)),p=null,null!=c&&(p=m);y=n[0][1]-(n[1][1]+n[1][3]);m=n[0][0]-(n[1][0]+n[1][2]);p=n[1][1]-(n[0][1]+n[0][3]);r=n[1][0]-(n[0][0]+n[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-z,0);mxEdgeStyle.vertexSeperations[2]=Math.max(y-z,0);mxEdgeStyle.vertexSeperations[4]=Math.max(p-z,0);mxEdgeStyle.vertexSeperations[3]=Math.max(r-z,0);z=[]; +c=[];l=[];c[0]=m>=r?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;l[0]=y>=p?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;c[1]=mxUtils.reversePortConstraints(c[0]);l[1]=mxUtils.reversePortConstraints(l[0]);m=m>=r?m:r;p=y>=p?y:p;r=[[0,0],[0,0]];u=!1;for(y=0;2>y;y++)0==a[y]&&(0==(c[y]&d[y])&&(c[y]=mxUtils.reversePortConstraints(c[y])),0==(l[y]&d[y])&&(l[y]=mxUtils.reversePortConstraints(l[y])),r[y][0]=l[y],r[y][1]=c[y]);0y;y++)if(0==a[y]&&(0==(r[y][0]&d[y])&&(r[y][0]=r[y][1]),z[y]=r[y][0]&d[y],z[y]|=(r[y][1]&d[y])<<8,z[y]|=(r[1-y][y]&d[y])<<16,z[y]|=(r[1-y][1-y]&d[y])<<24,0==(z[y]&15)&&(z[y]<<=8),0==(z[y]&3840)&&(z[y]=z[y]&15|z[y]>>8),0== (z[y]&983040)&&(z[y]=z[y]&65535|(z[y]&251658240)>>8),a[y]=z[y]&15,d[y]==mxConstants.DIRECTION_MASK_WEST||d[y]==mxConstants.DIRECTION_MASK_NORTH||d[y]==mxConstants.DIRECTION_MASK_EAST||d[y]==mxConstants.DIRECTION_MASK_SOUTH))a[y]=d[y];d=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];z=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];d-=x;z-=x;1>d&&(d+=4);1>z&&(z+=4);d=mxEdgeStyle.routePatterns[d-1][z-1];mxEdgeStyle.wayPoints1[0][0]=n[0][0];mxEdgeStyle.wayPoints1[0][1]=n[0][1];switch(a[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-= f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*n[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*n[0][2];mxEdgeStyle.wayPoints1[0][1]+=n[0][3]+f;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=n[0][2]+f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*n[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*n[0][2],mxEdgeStyle.wayPoints1[0][1]-=f}f=0;c=z=0<(a[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))? -0:1;for(y=0;y>5,q<<=x,15>=4),r=0<(d[y]&mxEdgeStyle.CENTER_MASK),(u||s)&&9>q?(u=u?0:1,p=r&&0==l?n[u][0]+b[u][0]*n[u][2]:r?n[u][1]+b[u][1]* -n[u][3]:mxEdgeStyle.limits[u][q],0==l?(q=(p-mxEdgeStyle.wayPoints1[f][0])*m[0],0>5,p<<=x,15>=4),r=0<(d[y]&mxEdgeStyle.CENTER_MASK),(u||s)&&9>p?(u=u?0:1,q=r&&0==l?n[u][0]+b[u][0]*n[u][2]:r?n[u][1]+b[u][1]* +n[u][3]:mxEdgeStyle.limits[u][p],0==l?(p=(q-mxEdgeStyle.wayPoints1[f][0])*m[0],0e&&(e+=4);1>a&&(a+=4);b=routePatterns[e-1][a-1];if(0==c||0==d)null!=inlineRoutePatterns[e-1][a- 1]&&(b=inlineRoutePatterns[e-1][a-1]);return b}},mxStyleRegistry={values:[],putValue:function(a,b){mxStyleRegistry.values[a]=b},getValue:function(a){return mxStyleRegistry.values[a]},getName:function(a){for(var b in mxStyleRegistry.values)if(mxStyleRegistry.values[b]==a)return b;return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation); mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter); @@ -1224,12 +1224,12 @@ mxGraphView.prototype.getPerimeterPoint=function(a,b,c,d){var e=null;if(null!=a) mxGraphView.prototype.getRoutingCenterY=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return a.getCenterY()+b*a.height};mxGraphView.prototype.getPerimeterBounds=function(a,b){b=null!=b?b:0;null!=a&&(b+=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0));return a.getPerimeterBounds(b*this.scale)}; mxGraphView.prototype.getPerimeterFunction=function(a){a=a.style[mxConstants.STYLE_PERIMETER];if("string"==typeof a){var b=mxStyleRegistry.getValue(a);null==b&&this.isAllowEval()&&(b=mxUtils.eval(a));a=b}return"function"==typeof a?a:null};mxGraphView.prototype.getNextPoint=function(a,b,c){a=a.absolutePoints;var d=null;null!=a&&2<=a.length&&(d=a.length,d=a[c?Math.min(1,d-1):Math.max(0,d-2)]);null==d&&null!=b&&(d=new mxPoint(b.getCenterX(),b.getCenterY()));return d}; mxGraphView.prototype.getVisibleTerminal=function(a,b){for(var c=this.graph.getModel(),d=c.getTerminal(a,b),e=d;null!=d&&d!=this.currentRoot;){if(!this.graph.isCellVisible(e)||this.isCellCollapsed(d))e=d;d=c.getParent(d)}c.getParent(e)==c.getRoot()&&(e=null);return e}; -mxGraphView.prototype.updateEdgeBounds=function(a){var b=a.absolutePoints,c=b[0],d=b[b.length-1];if(c.x!=d.x||c.y!=d.y){var e=d.x-c.x,f=d.y-c.y;a.terminalDistance=Math.sqrt(e*e+f*f)}else a.terminalDistance=0;var d=0,g=[],f=c;if(null!=f){for(var c=f.x,k=f.y,l=c,m=k,n=1;n=Math.round(k+g)&&l=f?0:f*f/(a*a+m*m));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,k.x,k.y,b,c)&&(e=-e);return new mxPoint(-2*((d/2-q-a)/d),e/this.scale)}}return new mxPoint}; +mxGraphView.prototype.getRelativePoint=function(a,b,c){var d=this.graph.getModel().getGeometry(a.cell);if(null!=d){var e=a.absolutePoints.length;if(d.relative&&1=f?0:f*f/(a*a+m*m));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,k.x,k.y,b,c)&&(e=-e);return new mxPoint(-2*((d/2-p-a)/d),e/this.scale)}}return new mxPoint}; mxGraphView.prototype.updateEdgeLabelOffset=function(a){var b=a.absolutePoints;a.absoluteOffset.x=a.getCenterX();a.absoluteOffset.y=a.getCenterY();if(null!=b&&0this.model.getChildCount(b)&&c--;this.model.add(b,a[l],c+l);this.autoSizeCellsOnAdd&&this.autoSizeCell(a[l],!0);(null==k||k)&&this.isExtendParentsOnAdd(a[l])&&this.isExtendParent(a[l])&&this.extendParent(a[l]);(null==g||g)&&this.constrainChild(a[l]);null!=d&&this.cellConnected(a[l],d,!0);null!=e&&this.cellConnected(a[l],e,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",b,"index",c,"source", +mxGraph.prototype.cellsAdded=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=b&&null!=c){this.model.beginUpdate();try{for(var l=f?this.view.getState(b):null,m=null!=l?l.origin:null,n=new mxPoint(0,0),l=0;lthis.model.getChildCount(b)&&c--;this.model.add(b,a[l],c+l);this.autoSizeCellsOnAdd&&this.autoSizeCell(a[l],!0);(null==k||k)&&this.isExtendParentsOnAdd(a[l])&&this.isExtendParent(a[l])&&this.extendParent(a[l]);(null==g||g)&&this.constrainChild(a[l]);null!=d&&this.cellConnected(a[l],d,!0);null!=e&&this.cellConnected(a[l],e,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",b,"index",c,"source", d,"target",e,"absolute",f))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(a,b){if(null!=b?b:1)for(var c=this.model.getChildCount(a),d=0;df&&(n=0),b>g&&(q=0),this.view.setTranslate(Math.floor(n/2-k.x),Math.floor(q/2-k.y)),this.container.scrollLeft=(a-f)/ -2,this.container.scrollTop=(b-g)/2):this.view.setTranslate(a?Math.floor(l.x-k.x*m+n*c/m):l.x,b?Math.floor(l.y-k.y*m+q*d/m):l.y)}; +mxGraph.prototype.center=function(a,b,c,d){a=null!=a?a:!0;b=null!=b?b:!0;c=null!=c?c:0.5;d=null!=d?d:0.5;var e=mxUtils.hasScrollbars(this.container),f=this.container.clientWidth,g=this.container.clientHeight,k=this.getGraphBounds(),l=this.view.translate,m=this.view.scale,n=a?f-k.width:0,p=b?g-k.height:0;e?(k.x-=l.x,k.y-=l.y,a=this.container.scrollWidth,b=this.container.scrollHeight,a>f&&(n=0),b>g&&(p=0),this.view.setTranslate(Math.floor(n/2-k.x),Math.floor(p/2-k.y)),this.container.scrollLeft=(a-f)/ +2,this.container.scrollTop=(b-g)/2):this.view.setTranslate(a?Math.floor(l.x-k.x*m+n*c/m):l.x,b?Math.floor(l.y-k.y*m+p*d/m):l.y)}; mxGraph.prototype.zoom=function(a,b){b=null!=b?b:this.centerZoom;var c=Math.round(100*this.view.scale*a)/100,d=this.view.getState(this.getSelectionCell());a=c/this.view.scale;if(this.keepSelectionVisibleOnZoom&&null!=d)d=new mxRectangle(d.x*a,d.y*a,d.width*a,d.height*a),this.view.scale=c,this.scrollRectToVisible(d)||(this.view.revalidate(),this.view.setScale(c));else if(d=mxUtils.hasScrollbars(this.container),b&&!d){var d=this.container.offsetWidth,e=this.container.offsetHeight;if(1=a&&r.y+r.height<=l&&r.y>=b&&r.x+r.width<=k?f.push(q):this.getCells(a, -b,c,d,q,f)}}}return f};mxGraph.prototype.getCellsBeyond=function(a,b,c,d,e){var f=[];if(d||e)if(null==c&&(c=this.getDefaultParent()),null!=c)for(var g=this.model.getChildCount(c),k=0;k=a)&&(!e||m.y>=b)&&f.push(l)}return f}; -mxGraph.prototype.findTreeRoots=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;var d=[];if(null!=a){for(var e=this.getModel(),f=e.getChildCount(a),g=null,k=0,l=0;lk&&(k=n,g=m)}}0==d.length&&null!=g&&d.push(g)}return d}; +mxGraph.prototype.getCells=function(a,b,c,d,e,f){f=null!=f?f:[];if(0=a&&r.y+r.height<=l&&r.y>=b&&r.x+r.width<=k?f.push(p):this.getCells(a, +b,c,d,p,f)}}}return f};mxGraph.prototype.getCellsBeyond=function(a,b,c,d,e){var f=[];if(d||e)if(null==c&&(c=this.getDefaultParent()),null!=c)for(var g=this.model.getChildCount(c),k=0;k=a)&&(!e||m.y>=b)&&f.push(l)}return f}; +mxGraph.prototype.findTreeRoots=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;var d=[];if(null!=a){for(var e=this.getModel(),f=e.getChildCount(a),g=null,k=0,l=0;lk&&(k=n,g=m)}}0==d.length&&null!=g&&d.push(g)}return d}; mxGraph.prototype.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d)))if(d=this.model.getEdgeCount(a),0d&&(a+=c,e&&(a=this.graph.snap(a/f)*f));if(0==d||3==d||5==d)q+=b,e&&(q=this.graph.snap(q/f)*f);else if(2==d||4==d||7==d)r+=b,e&&(r=this.graph.snap(r/ -f)*f);e=r-q;c=u-a;k&&(k=this.graph.getCellGeometry(this.state.cell),null!=k&&(k=k.width/k.height,1==d||2==d||7==d||6==d?e=c*k:c=e/k,0==d&&(q=r-e,a=u-c)));l&&(e+=e-m,c+=c-n,q+=p-(q+e/2),a+=s-(a+c/2));0>e&&(q+=e,e=Math.abs(e));0>c&&(a+=c,c=Math.abs(c));d=new mxRectangle(q+g.x*f,a+g.y*f,e,c);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*f+this.minBounds.width*f+Math.max(0,this.x0*f-d.x)),d.height=Math.max(d.height,this.minBounds.y*f+this.minBounds.height*f+Math.max(0,this.y0*f-d.y))); +mxVertexHandler.prototype.union=function(a,b,c,d,e,f,g,k,l){if(this.singleSizer)return d=a.x+a.width+b,g=a.y+a.height+c,e&&(d=this.graph.snap(d/f)*f,g=this.graph.snap(g/f)*f),f=new mxRectangle(a.x,a.y,0,0),f.add(new mxRectangle(d,g,0,0)),f;var m=a.width,n=a.height,p=a.x-g.x*f,r=p+m;a=a.y-g.y*f;var u=a+n,q=p+m/2,s=a+n/2;4d&&(a+=c,e&&(a=this.graph.snap(a/f)*f));if(0==d||3==d||5==d)p+=b,e&&(p=this.graph.snap(p/f)*f);else if(2==d||4==d||7==d)r+=b,e&&(r=this.graph.snap(r/ +f)*f);e=r-p;c=u-a;k&&(k=this.graph.getCellGeometry(this.state.cell),null!=k&&(k=k.width/k.height,1==d||2==d||7==d||6==d?e=c*k:c=e/k,0==d&&(p=r-e,a=u-c)));l&&(e+=e-m,c+=c-n,p+=q-(p+e/2),a+=s-(a+c/2));0>e&&(p+=e,e=Math.abs(e));0>c&&(a+=c,c=Math.abs(c));d=new mxRectangle(p+g.x*f,a+g.y*f,e,c);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*f+this.minBounds.width*f+Math.max(0,this.x0*f-d.x)),d.height=Math.max(d.height,this.minBounds.y*f+this.minBounds.height*f+Math.max(0,this.y0*f-d.y))); return d};mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.redrawHandles();this.drawPreview()}; mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),b=this.tolerance;if(null!=this.sizers&&0this.minPageBreakDist)?Math.ceil(c/s.height)-1:0,v=a?Math.ceil(b/s.width)-1:0,x=p.x+b,z=p.y+c;null==this.horizontalPageBreaks&&0this.minPageBreakDist)?Math.ceil(c/s.height)-1:0,v=a?Math.ceil(b/s.width)-1:0,x=q.x+b,z=q.y+c;null==this.horizontalPageBreaks&&0document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",b):this.diagramContainer.oncontextmenu=b;d.init(this.diagramContainer);this.hoverIcons=this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var b=mxUtils.getOffset(this.diagramContainer);0mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=c}a=this.toolbar.fontMenu;c=this.toolbar.sizeMenu; -if(null==q)this.toolbar.createTextToolbar();else{for(var e=0;emxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=c}a=this.toolbar.fontMenu;c=this.toolbar.sizeMenu; +if(null==p)this.toolbar.createTextToolbar();else{for(var e=0;emxUtils.indexOf(x,r))&&d.setCellStyles(r,z,[g])}}}finally{d.getModel().endUpdate()}};d.addListener("cellsInserted",function(a,b){A(b.getProperty("cells"))});d.addListener("textInserted",function(a,b){A(b.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a, +"keys",[],"values",[],"cells",[]))};var z=["fontFamily","fontSize","fontColor"],y="edgeStyle startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),D=["startArrow startFill startSize endArrow endFill endSize jettySize orthogonalLoop".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],z,["align"],["html"]];for(a=0;amxUtils.indexOf(x,q))&&d.setCellStyles(q,y,[g])}}}finally{d.getModel().endUpdate()}};d.addListener("cellsInserted",function(a,b){A(b.getProperty("cells"))});d.addListener("textInserted",function(a,b){A(b.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a, b){var c=[b.getProperty("cell")];b.getProperty("terminalInserted")&&c.push(b.getProperty("terminal"));A(c)});this.addListener("styleChanged",mxUtils.bind(this,function(a,b){var c=b.getProperty("cells"),e=!1,f=!1;if(0c*this.view.scale||Math.abs(f.y-b.getGraphY())> -c*this.view.scale){this.isCellSelected(d.cell)||this.setSelectionCell(d.cell);var e=this.selectionCellsHandler.getHandler(d.cell);if(null!=e&&null!=e.bends&&0mxUtils.indexOf(b,e)&&c.push(e)): -c.push(b[d])}return c};this.connectionHandler.createTargetVertex=function(a,b){var c=this.graph.view.getState(b),c=null!=c?c.style:this.graph.getCellStyle(b);mxUtils.getValue(c,"part",!1)&&(c=this.graph.model.getParent(b),this.graph.model.isVertex(c)&&(b=c));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var q=new mxRubberband(this);this.getRubberband=function(){return q};var r=(new Date).getTime(),u=0,p=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove= -function(){var a=this.currentState;p.apply(this,arguments);a!=this.currentState?(r=(new Date).getTime(),u=0):u=(new Date).getTime()-r};var s=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3=a&&(p.y+p.height<=l&&p.y>=b&&p.x+p.width<=g)&&f.push(q);this.getAllCells(a,b,c,d,q,f)}}}return f};var E=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,b,c){return this.graph.isCellSelected(a)?!1:E.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style, +this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,b){var c=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(c,b);return c};this.getAllCells=function(a,b,c,d,e,f){f=null!=f?f:[];if(0=a&&(r.y+r.height<=l&&r.y>=b&&r.x+r.width<=g)&&f.push(p);this.getAllCells(a,b,c,d,p,f)}}}return f};var D=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,b,c){return this.graph.isCellSelected(a)?!1:D.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style, "locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var A=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,b){if("mouseDown"==b.getProperty("eventName")){var c=b.getProperty("event").getState();A=null!=c&&!this.isSelectionEmpty()&&!this.isCellSelected(c.cell)?this.getSelectionCells():null}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,b){if(!mxEvent.isMultiTouchEvent(b)){var c=b.getProperty("event"),d=b.getProperty("cell"); -null==d?(c=mxUtils.convertPoint(this.container,mxEvent.getClientX(c),mxEvent.getClientY(c)),q.start(c.x,c.y)):null!=A?this.addSelectionCells(A):1r?"a":"p",tt:12>r?"am":"pm",T:12>r?"A":"P",TT:12>r?"AM":"PM",Z:c?"UTC":(String(a).match(e)||[""]).pop().replace(f,""),o:(0r?"a":"p",tt:12>r?"am":"pm",T:12>r?"A":"P",TT:12>r?"AM":"PM",Z:c?"UTC":(String(a).match(e)||[""]).pop().replace(f,""),o:(0this.activationDelay)if(this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==c||!mxUtils.contains(this.bbox,b,c)))null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!= a&&this.graph.connectionHandler.constraintHandler.reset()):this.reset()}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a}; -(function(){var a=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(b,c,f,g){if(null!=c&&null!=b&&("1"==c.style.snapToPoint||"1"==b.style.snapToPoint)){c=this.getTerminalPort(b,c,g);var k=this.getNextPoint(b,f,g),l=this.graph.isOrthogonal(b),m=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),n=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=m)var q=Math.cos(-m),r=Math.sin(-m),k=mxUtils.getRotatedPoint(k,q,r,n);q=parseFloat(b.style[mxConstants.STYLE_PERIMETER_SPACING]|| -0);q+=parseFloat(b.style[g?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(c,k,0==m&&l,q);0!=m&&(q=Math.cos(m),r=Math.sin(m),k=mxUtils.getRotatedPoint(k,q,r,n));if(null!=c){m=this.graph.getAllConnectionConstraints(c);l=n=null;for(q=0;qb&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&"Control"!=b.type&&b.createRange().pasteHTML(a)};Graph.prototype.initTouch= -function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,b.graphX,b.graphY)||(b.state=this.view.getState(c),null!=b.state&& -null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,k){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger= -!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection= -function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;bb&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&"Control"!=b.type&& +b.createRange().pasteHTML(a)};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,b.graphX, +b.graphY)||(b.state=this.view.getState(c),null!=b.state&&null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,k){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp= +mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell); +return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;bk||Math.abs(f)>k)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(d,c),this.isSpaceEvent(b)?(d=this.x+this.width,c=this.y+this.height,e=this.graph.view.scale,mxEvent.isAltDown(b.getEvent())||(this.width=this.graph.snap(this.width/e)*e,this.height=this.graph.snap(this.height/e)*e,this.graph.isGridEnabled()||(this.width=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv= this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv), -this.secondDiv=null)),b.consume()}};var p=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);p.apply(this,arguments)};var s=(new Date).getTime(),t=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d){v.apply(this,arguments);c!=this.currentTerminalState?(s=(new Date).getTime(),t=0):t=(new Date).getTime()-s;this.currentTerminalState= +this.secondDiv=null)),b.consume()}};var q=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);q.apply(this,arguments)};var s=(new Date).getTime(),t=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d){v.apply(this,arguments);c!=this.currentTerminalState?(s=(new Date).getTime(),t=0):t=(new Date).getTime()-s;this.currentTerminalState= c};var x=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,c):null,c=null!=(null!=e?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(c),e):null)?this.fixedHandleImage:null!=e&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=c)return c=new mxImageShape(new mxRectangle(0,0,c.width,c.height),c.src),c.preserveImageAspect=!1,c;c=mxConstants.HANDLE_SIZE; this.preferHtml&&(c-=1);return new mxRectangleShape(new mxRectangle(0,0,c,c),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var z=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,b,c){this.handleImage=b==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:b==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return z.apply(this,arguments)};var y=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox= -function(a){if(null!=a&&1==a.length){var b=this.graph.getModel(),c=b.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(b.isEdge(c)&&null!=d&&d.relative&&(b=this.graph.view.getState(a[0]),null!=b&&2>b.width&&2>b.height&&null!=b.text&&null!=b.text.boundingBox))return mxRectangle.fromRectangle(b.text.boundingBox)}return y.apply(this,arguments)};var E=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var b=this.graph.getModel(),c=b.getParent(a.cell), -d=this.graph.getCellGeometry(a.cell);return b.isEdge(c)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(b=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(b.x),Math.round(b.y),Math.round(b.width),Math.round(b.height))):E.apply(this,arguments)};var A=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,b){var c=this.graph.getModel(),d=c.getParent(this.state.cell),e=this.graph.getCellGeometry(this.state.cell); +function(a){if(null!=a&&1==a.length){var b=this.graph.getModel(),c=b.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(b.isEdge(c)&&null!=d&&d.relative&&(b=this.graph.view.getState(a[0]),null!=b&&2>b.width&&2>b.height&&null!=b.text&&null!=b.text.boundingBox))return mxRectangle.fromRectangle(b.text.boundingBox)}return y.apply(this,arguments)};var D=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var b=this.graph.getModel(),c=b.getParent(a.cell), +d=this.graph.getCellGeometry(a.cell);return b.isEdge(c)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(b=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(b.x),Math.round(b.y),Math.round(b.width),Math.round(b.height))):D.apply(this,arguments)};var A=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,b){var c=this.graph.getModel(),d=c.getParent(this.state.cell),e=this.graph.getCellGeometry(this.state.cell); (this.getHandleForEvent(b)==mxEvent.ROTATION_HANDLE||!c.isEdge(d)||null==e||!e.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&A.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()e)this.originalLineTo.apply(this.canvas,arguments);else{var f=Math.round(e/10),k=this.defaultVariation;5>f&&(f=5,k/=3);for(var g=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN}, -l=g(a-this.lastX)*c/f,g=g(b-this.lastY)*d/f,c=c/e,d=d/e,e=0;ee)this.originalLineTo.apply(this.canvas,arguments);else{var f=Math.round(e/10),k=this.defaultVariation;5>f&&(f=5,k/=3);for(var g=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN}, +l=g(a-this.lastX)*c/f,g=g(b-this.lastY)*d/f,c=c/e,d=d/e,e=0;ed&&(c=b.substring(d,e+15).replace(/>/g,"\x3e").replace(/</g,"\x3c").replace(/\\"/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(b),g=this.editor.extractGraphModel(f.documentElement),c=null!=g?mxUtils.getXml(g):""}catch(u){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&& 0MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";if("xmlpng"==b&&(e="1",b="png",null!=this.pages&&null!=this.currentPage))for(var g=0;g=screen.height?5:46,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left= "164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?420:340,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog= function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.setBackgroundImage(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,620,440,!0,!0,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer= function(){var a=this.createDiv("geSidebarContainer");a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError= function(a,b,c){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){a=mxResources.get("unknownError");var f=mxResources.get("ok"),g=null;b=null!=b?b:mxResources.get("error");if(null!=e)if("undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxResources.get("forbidden");else if(404==e.code||404==e.status||"undefined"!= -typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxResources.get("fileNotFoundOrDenied");var p=window.location.hash;null!=p&&"#G"==p.substring(0,2)&&(p=p.substring(2),a+=' \x3ca href\x3d"https://drive.google.com/open?id\x3d'+p+'" target\x3d"_blank"\x3e'+mxResources.get("tryOpeningViaThisPage")+"\x3c/a\x3e")}else e.code==App.ERROR_TIMEOUT?(a=mxResources.get("timeout"),null!=e.retry&&(f=mxResources.get("cancel"), +typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&e.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxResources.get("fileNotFoundOrDenied");var q=window.location.hash;null!=q&&"#G"==q.substring(0,2)&&(q=q.substring(2),a+=' \x3ca href\x3d"https://drive.google.com/open?id\x3d'+q+'" target\x3d"_blank"\x3e'+mxResources.get("tryOpeningViaThisPage")+"\x3c/a\x3e")}else e.code==App.ERROR_TIMEOUT?(a=mxResources.get("timeout"),null!=e.retry&&(f=mxResources.get("cancel"), g=function(){d();e.retry()})):e.code==App.ERROR_BUSY?a=mxResources.get("busy"):null!=e.message?a=e.message:null!=e.response&&null!=e.response.error&&(a=e.response.error);this.showError(b,a,f,c,g)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,f,g){a=new ErrorDialog(this,a,b,c,d,e,f,g);this.showDialog(a.container,340,150,!0,!1);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()}; EditorUi.prototype.confirm=function(a,b,c,d,e){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){f();null!=b&&b()},function(){f();null!=c&&c()},d,e)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&& 0==a.getChildCount(a.getChildAt(a.root,0))};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createPngDataUri=function(a,b){var c=a.toDataURL("image/png");if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/png"))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c, @@ -2695,87 +2695,85 @@ EditorUi.prototype.confirm=function(a,b,c,d,e){var f=null!=this.spinner&&null!=t typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,e){if(window.MSBlobBuilder&&navigator.msSaveOrOpenBlob)d=new MSBlobBuilder,d.append(a),a=d.getBlob(c),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs", !0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height="380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var f=document.createElement("a");if("undefined"!==typeof f.download||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));"undefined"!==typeof f.download?f.download=b:f.setAttribute("target", "_blank");document.body.appendChild(f);try{f.click(),window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.parentNode.removeChild(f)}catch(g){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml\x3d"+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"\x26mime\x3d"+c:"")+(null!=e?"\x26format\x3d"+e:"")+(null!=f?"\x26base64\x3d"+f:"")+(null!=b?"\x26filename\x3d"+encodeURIComponent(b):"")+(d? -"\x26binary\x3d1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),f=Array(e),g=0;ge.getStatus()||299f.status){this.spinner.stop();this.hideDialog();a="https://github.com/"+v.value+"/"+x.value+"/blob/"+E.value+"/"+z.value;var b=new ErrorDialog(this, +"\x26binary\x3d1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),f=Array(e),g=0;ge.getStatus()||299f.status){this.spinner.stop();this.hideDialog();a="https://github.com/"+v.value+"/"+x.value+"/blob/"+D.value+"/"+z.value;var b=new ErrorDialog(this, mxResources.get("published"),mxResources.get("publishedAt",['\x3ca href\x3d"'+a+'" target\x3d"_blank"\x3e'+a+"\x3c/a\x3e"]),mxResources.get("close"),mxUtils.bind(this,function(){this.hideDialog()}),null,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){window.open(a)}),!1);this.showDialog(b.container,340,170,!0,!1);b.init()}else d=this.spinner.pause(),this.handleError(JSON.parse(f.responseText))});f.open("PUT",a,!0);f.setRequestHeader("Authorization","Basic "+btoa(s.value+":"+t.value)); f.send(JSON.stringify(e))}else this.hideDialog(),this.spinner.stop(),this.handleError(JSON.parse(c.getText()))}),mxUtils.bind(this,function(a){this.hideDialog();this.spinner.stop();this.handleError({message:mxResources.get("unknownError")})}))}),null,null,c,null,!1);this.showDialog(c.container,260,260,!0,!1);c.init()};EditorUi.prototype.publishImage=function(a,b){var c=this.getCurrentFile();null!=c&&(this.isExportToCanvas()?this.showExportDialog(!1,mxResources.get("publish"),"https://support.draw.io/pages/viewpage.action?pageId\x3d12222625", -mxUtils.bind(this,function(d,e,f,g,p){d=parseInt(d);if(!isNaN(d)&&0]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/i.test(f.value)&&g.setLinkForCell(f,f.value),f.geometry.width+=g.gridSize,f.geometry.height+=g.gridSize}finally{g.getModel().endUpdate()}return[f]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024< -a);return Math.max(a,0.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="\x3d\x3d";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f& -15)<<2);b+="\x3d";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,f,g,p,s,t,v,x){var z=null!=b&&null!= -c;b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;t=null!=t?t:this.maxImageBytes;s=null!=s?s:!0;var y=this.editor.graph,E=y.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,g,k,l){return null!=a&&"\x3cmxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,e,f,g,k,l,z,x)});f=null!=f?f:mxUtils.bind(this,function(a){y.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var A= -a.length,D=A,C=[],F=mxUtils.bind(this,function(a,b){C[a]=b;if(0==--D){this.spinner.stop();if(null!=p)p(C);else{var c=[];y.getModel().beginUpdate();try{for(var d=0;db};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),p=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var s=Math.max(g/e,p/e);if(1b;b++)for(var c=b,d=0;8>d;d++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[b]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=p;p+=b;return a.substring(c,p)} -function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,p);do{var s=g(a);if("IDAT"==f(a,4)){e=a.substring(0,p-8);s=4294967295;s=this.updateCRC(s,b,0,4);s=this.updateCRC(s,d,0,d.length);e+=String.fromCharCode(c.length+ -d.length+1+("zTXt"==b?1:0)>>24&255,c.length+d.length+1+("zTXt"==b?1:0)>>16&255,c.length+d.length+1+("zTXt"==b?1:0)>>8&255,c.length+d.length+1+("zTXt"==b?1:0)&255)+b+c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d+String.fromCharCode((s^4294967295)>>24&255,(s^4294967295)>>16&255,(s^4294967295)>>8&255,(s^4294967295)&255);e+=a.substring(p-8,a.length);break}e+=a.substring(p-8,p-4+s);d=f(a,s);f(a,4)}while(s);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng= +15)<<2);b+="\x3d";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,f,g,q,s,t,v,x){var z=null!=b&&null!= +c;b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;t=null!=t?t:this.maxImageBytes;s=null!=s?s:!0;var y=this.editor.graph,D=y.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,g,k,l){return null!=a&&"\x3cmxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,e,f,g,k,l,z,x)});f=null!=f?f:mxUtils.bind(this,function(a){y.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var A= +a.length,E=A,C=[],F=mxUtils.bind(this,function(a,b){C[a]=b;if(0==--E){this.spinner.stop();if(null!=q)q(C);else{var c=[];y.getModel().beginUpdate();try{for(var d=0;db};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),q=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var s=Math.max(g/e,q/e);if(1b;b++)for(var c=b,d=0;8>d;d++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[b]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e>>8;return a};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=q;q+=b;return a.substring(c,q)} +function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var q=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,q);do{var s=g(a);if("IDAT"==f(a,4)){e=a.substring(0,q-8);s=4294967295;s=this.updateCRC(s,b,0,4);s=this.updateCRC(s,d,0,d.length);e+=String.fromCharCode(c.length+ +d.length+1+("zTXt"==b?1:0)>>24&255,c.length+d.length+1+("zTXt"==b?1:0)>>16&255,c.length+d.length+1+("zTXt"==b?1:0)>>8&255,c.length+d.length+1+("zTXt"==b?1:0)&255)+b+c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d+String.fromCharCode((s^4294967295)>>24&255,(s^4294967295)>>16&255,(s^4294967295)>>8&255,(s^4294967295)&255);e+=a.substring(q-8,a.length);break}e+=a.substring(q-8,q-4+s);d=f(a,s);f(a,4)}while(s);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng= function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0document.documentMode))b= this.highlightElement();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(0mxUtils.indexOf(c,a)};this.executeLayout(function(){P.execute(v.getDefaultParent());ba()},!0,x);x=null}else if("horizontaltree"==D||"verticaltree"==D||"auto"==D&&Y.length==2*c.length-1&&1==I.length){v.view.validate();var aa=new mxCompactTreeLayout(v,"horizontaltree"==D);aa.levelDistance=s;aa.edgeRouting=!1;this.executeLayout(function(){aa.execute(v.getDefaultParent(),0c.length){v.view.validate();var Q=new mxFastOrganicLayout(v);Q.forceConstant=3*s;Q.resetEdges=!1;var ga=Q.isVertexIgnored;Q.isVertexIgnored=function(a){return ga.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(v); -ca.spacing=p;this.executeLayout(function(){Q.execute(v.getDefaultParent());ba()},!0,x);x=null}this.hideDialog()}finally{v.model.endUpdate()}null!=x&&x()}}catch(ea){this.handleError(ea)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl= +B:S,L.style||v.createCurrentEdgeStyle())),mxUtils.remove(L.invert?B:S,I))}}}}var ca=new mxParallelEdgeLayout(v);ca.spacing=q;var ba=function(){ca.execute(v.getDefaultParent());for(var a=0;amxUtils.indexOf(c,a)};this.executeLayout(function(){P.execute(v.getDefaultParent());ba()},!0,x);x=null}else if("horizontaltree"==E||"verticaltree"==E||"auto"==E&&Y.length==2*c.length-1&&1==I.length){v.view.validate();var aa=new mxCompactTreeLayout(v,"horizontaltree"==E);aa.levelDistance=s;aa.edgeRouting=!1;this.executeLayout(function(){aa.execute(v.getDefaultParent(),0c.length){v.view.validate();var Q=new mxFastOrganicLayout(v);Q.forceConstant=3*s;Q.resetEdges=!1;var ga=Q.isVertexIgnored;Q.isVertexIgnored=function(a){return ga.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(v); +ca.spacing=q;this.executeLayout(function(){Q.execute(v.getDefaultParent());ba()},!0,x);x=null}this.hideDialog()}finally{v.model.endUpdate()}null!=x&&x()}}catch(ea){this.handleError(ea)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"\x3d"+urlParams[d],c="\x26")}else b=window.location.search;return b};EditorUi.prototype.getUrl= function(a){a=null!=a?a:window.location.pathname;var b=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"\x26",null!=urlParams[d]&&(a+=d+"\x3d"+urlParams[d],b++))}return a};var f=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=f.apply(this,arguments),c=this.editor.graph, d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a= this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding(),e=Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2),f=Math.max(0,(b.outline.container.clientHeight/ @@ -2852,8 +2850,8 @@ null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMen 5E3)}}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);var a=this.editor.graph,b=this.getCurrentFile(),c=null!=b&&b.isEditable()||"1"==urlParams.embed;this.actions.get("pageSetup").setEnabled(c);this.actions.get("autosave").setEnabled(null!=b&&b.isEditable()&&b.isAutosaveOptional());this.actions.get("guides").setEnabled(c); this.actions.get("shadowVisible").setEnabled(c);this.actions.get("connectionArrows").setEnabled(c);this.actions.get("connectionPoints").setEnabled(c);this.actions.get("copyStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(c&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(c);this.actions.get("createRevision").setEnabled(c);this.actions.get("moveToFolder").setEnabled(null!= b);this.actions.get("makeCopy").setEnabled(null!=b&&!b.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed||null!=b&&!b.isRestricted());this.actions.get("github").setEnabled(null!=b&&!b.isRestricted());this.actions.get("publishLink").setEnabled(null!=b&&!b.isRestricted());this.menus.get("publish").setEnabled(null!=b&&!b.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(c&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};null!= -window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,f){var g=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(g.getSvg(d,e,f)),"image/svg+xml");else{var p=a.getFileData(!0,null,null,null,null,!0),s=g.getGraphBounds(),t=Math.floor(s.width*e/g.view.scale),v=Math.floor(s.height*e/g.view.scale);p.length<= -MAX_REQUEST_SIZE&&t*v