!function(a,c){"object"==typeof exports?module.exports=c():"function"==typeof define&&define.amd?define(c):a.Spinner=c()}(this,function(){function a(b,a){var d,e=document.createElement(b||"div");for(d in a)e[d]=a[d];return e}function c(b){for(var a=1,d=arguments.length;d>a;a++)b.appendChild(arguments[a]);return b}function f(b,a,d,e){var c=["opacity",a,~~(100*b),d,e].join("-");d=0.01+100*(d/e);e=Math.max(1-(1-b)/a*(100-d),b);var f=l.substring(0,l.indexOf("Animation")).toLowerCase();return m[c]||(p.insertRule("@"+ (f&&"-"+f+"-"||"")+"keyframes "+c+"{0%{opacity:"+e+"}"+d+"%{opacity:"+b+"}"+(d+0.01)+"%{opacity:1}"+(d+a)%100+"%{opacity:"+b+"}100%{opacity:"+e+"}}",p.cssRules.length),m[c]=1),c}function d(b,a){var d,e,c=b.style;a=a.charAt(0).toUpperCase()+a.slice(1);for(e=0;e>1,filter:n}),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,n=2*l;k=2*-(e.width+e.length)+"px";var m=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,m)};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, n=0,m=(e.lines-1)*(1-e.direction)/2;n>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"),n=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),m=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");l=function(a){return a.replace(n,b)};k=function(b){b=(""+b).replace(/\r\n?/g,"\n").match(g)||[];for(var c=0,f=" ",k=0,n=b.length;k=v?" ":/url\(/i.test(p)?"url("+a(p.replace(m,""),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 n=function(){function b(a){a=(""+a).match(m);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(n,"");else if(f=!!g){if(47!==k.charCodeAt(0))var k=e(d.g||"").replace(n,""),l=k.lastIndexOf("/")+1,k=e((l?k.substring(0,l):"")+e(g)).replace(n,"")}else k=k&&k.replace(n,""),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"},F=/^(?:([^:/?# ]+):)?/,H=/^(?:https?|mailto|data)$/i;m=function(){var a={};return function P(d,c,f,g,n){d=D(d);var m=e[d];if(!m||"object"!==typeof m)c.length=0;else{for(var p=m.cssPropBits,u=p&80,q=p&1536,t=NaN,s=0,A=0;s=F)G=p&1?G:"";else if(H=G.charCodeAt(1),C=G.charCodeAt(2),I=48<=H&&57>=H,B=48<=C&&57>=C,43===F&&(I||46===H&&B))G=p&1?(I?"":"0")+G.substring(1):"";else if(45===F&&(I||46===H&&B))G=p&4?(I?"-":"-0")+G.substring(1):p&1?"0":"";else if(46===F&&I)G=p&1?"0"+G:"";else if('url("'===G.substring(0, 5))G=f&&p&16?b(v(k(g,c[s].substring(5,G.length-2)),d,f)):"";else if("("===G.charAt(G.length-1))a:{S=c;ca=s;G=1;ba=ca+1;for(F=S.length;bag&&" "===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();fn)return n=~n,n===k?n+1:n;var m=b[n];if("{"!==m)return n===k?n+1:n;a=n+1;n>k&&" "===b[n-1]&&--n;for(g.startRuleset&&g.startRuleset(b.slice(k,n));am)m=~m;else{for(var p=[],u=0,v=a;v])/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;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,S=/^\s*([-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,ha=3==="a,b".split(/(,)/).length,ca=b.c.CDATA|b.c.RCDATA,ba={},ga={},ja=/^(?:https?|mailto|data)$/i,ea={};ea.pa=ea.escapeAttrib=k;ea.ra=ea.makeHtmlSanitizer=t;ea.sa=ea.makeSaxParser=m;ea.ta=ea.makeTagPolicy=V;ea.wa=ea.normalizeRCData=l;ea.xa= ea.sanitize=function(b,a,d,e){return Q(b,V(a,d,e))};ea.ya=ea.sanitizeAttribs=W;ea.za=ea.sanitizeWithPolicy=Q;ea.Ba=ea.unescapeEntities=g;return ea}(u);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,n){if(!d[k]){if(!f[k]){var m="function"==typeof require&&require;if(!n&&m)return m(k,!0);if(g)return g(k,!0);m=Error("Cannot find module '"+k+"'");throw m.code="MODULE_NOT_FOUND",m;}m=d[k]={exports:{}}; f[k][0].call(m.exports,function(b){var d=f[k][1][b];return e(d?d:b)},m,m.exports,c,f,d,b)}return d[k].exports}for(var g="function"==typeof require&&require,k=0;kd.windowBits&&(d.windowBits+=16);this.err=0;this.msg= "";this.ended=!1;this.chunks=[];this.strm=new m;this.strm.avail_out=0;var e=g.deflateInit2(this.strm,d.level,d.method,d.windowBits,d.memLevel,d.strategy);if(e!==s)throw Error(n[e]);if(d.header&&g.deflateSetHeader(this.strm,d.header),d.dictionary){var c;if(c="string"==typeof d.dictionary?l.string2buf(d.dictionary):"[object ArrayBuffer]"===p.call(d.dictionary)?new Uint8Array(d.dictionary):d.dictionary,e=g.deflateSetDictionary(this.strm,c),e!==s)throw Error(n[e]);this._dict_set=!0}}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/deflate"),k=c("./utils/common"),l=c("./utils/strings"),n=c("./zlib/messages"),m=c("./zlib/zstream"),p=Object.prototype.toString,s=0,t=-1,q=0,v=8;b.prototype.push=function(b,d){var e,c,f=this.strm,n=this.options.chunkSize;if(this.ended)return!1;c=d===~~d?d:!0===d?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(n),f.next_out=0,f.avail_out=n),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!==n.Z_OK)throw Error(m[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"),n=c("./zlib/constants"),m=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,m,p,s,B=this.strm,C=this.options.chunkSize,F=this.options.dictionary,H=!1;if(this.ended)return!1;c=d===~~d?d:!0===d?n.Z_FINISH:n.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,n.Z_NO_FLUSH),e===n.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===n.Z_BUF_ERROR&&!0===H&&(e=n.Z_OK,H=!1),e!==n.Z_STREAM_END&&e!==n.Z_OK)return this.onEnd(e), this.ended=!0,!1;B.next_out&&(0!==B.avail_out&&e!==n.Z_STREAM_END&&(0!==B.avail_in||c!==n.Z_FINISH&&c!==n.Z_SYNC_FLUSH)||("string"===this.options.to?(f=l.utf8border(B.output,B.next_out),m=B.next_out-f,p=l.buf2string(B.output,f),B.next_out=m,B.avail_out=C-m,m&&k.arraySet(B.output,B.output,f,m,0),this.onData(p)):this.onData(k.shrinkBuf(B.output,B.next_out))));0===B.avail_in&&0===B.avail_out&&(H=!0)}while((0d&&(b.subarray&&k||!b.subarray&&g))return String.fromCharCode.apply(null,e.shrinkBuf(b,d));for(var c="",f=0;fc;c++)m[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;m[254]=m[254]=1;d.string2buf=function(b){var d,c,f,g,k,l=b.length,n=0;for(g=0;gc?1:2048>c?2:65536>c?3:4;d=new e.Buf8(n);for(g=k=0;kc?d[k++]=c:2048> 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)n[f++]=g;else if(k=m[g],4g?n[f++]=g:(g-=65536,n[f++]=55296|g>>10&1023,n[f++]=56320|1023&g)}return b(n,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+m[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 n=0;0!==c;){n=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=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&&(z.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 n(b,d){b.pending_buf[b.pending++]=d>>>8&255;b.pending_buf[b.pending++]=255&d}function m(b,d){var e,c,f=b.max_chain_length,g=b.strstart,k=b.prev_length,l=b.nice_match,n=b.strstart>b.w_size-X?b.strstart-(b.w_size-X):0,m=b.window,p=b.w_mask,u=b.prev,v=b.strstart+R,q=m[g+k-1],x=m[g+k];b.prev_length>=b.good_match&& (f>>=2);l>b.lookahead&&(l=b.lookahead);do if(e=d,m[e+k]===x&&m[e+k-1]===q&&m[e]===m[g]&&m[++e]===m[g+1]){g+=2;e++;do;while(m[++g]===m[++e]&&m[++g]===m[++e]&&m[++g]===m[++e]&&m[++g]===m[++e]&&m[++g]===m[++e]&&m[++g]===m[++e]&&m[++g]===m[++e]&&m[++g]===m[++e]&&gk){if(b.match_start=d,k=c,c>=l)break;q=m[g+k-1];x=m[g+k]}}while((d=u[d&p])>n&&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)){z.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,z.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=m(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<=J&&(b.ins_h=(b.ins_h<=b.match_length&&(b.strategy===P||b.match_length===J&&4096= J&&b.match_length<=b.prev_length){f=b.strstart+b.lookahead-J;c=D._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<e.wrap&&(e.wrap=-e.wrap),e.status=e.wrap?fa:da,d.adler=2===e.wrap?0:1,e.last_flush=H,D._tr_init(e),I):b(d,K)}function x(b){var d=u(b);d===I&&(b=b.state,b.window_size=2*b.w_size,e(b.head),b.max_lazy_match=y[b.level].max_lazy,b.good_match=y[b.level].good_length,b.nice_match=y[b.level].nice_length,b.max_chain_length=y[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 A(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>E||c!==Q||8>f||15e||9k||k>W)return b(d,K);8===f&&(f=9);var n=new v;return d.state=n,n.strm=d,n.wrap=l,n.gzhead=null,n.w_bits=f,n.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===H)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===G?(k(b,!0),0===b.strm.avail_out?aa: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 A(b,d,Q,15,8,0)};d.deflateInit2=A;d.deflateReset=x;d.deflateResetKeep=u;d.deflateSetHeader=function(b,d){return b&&b.state?2!==b.state.wrap?K:(b.state.gzhead=d,I):K};d.deflate=function(d,c){var f,m,u,v;if(!d||!d.state||5c)return d?b(d,K):K;if(m=d.state,!d.output||!d.input&&0!==d.avail_in|| 666===m.status&&c!==G)return b(d,0===d.avail_out?-5:K);if(m.strm=d,f=m.last_flush,m.last_flush=c,m.status===fa)2===m.wrap?(d.adler=0,l(m,31),l(m,139),l(m,8),m.gzhead?(l(m,(m.gzhead.text?1:0)+(m.gzhead.hcrc?2:0)+(m.gzhead.extra?4:0)+(m.gzhead.name?8:0)+(m.gzhead.comment?16:0)),l(m,255&m.gzhead.time),l(m,m.gzhead.time>>8&255),l(m,m.gzhead.time>>16&255),l(m,m.gzhead.time>>24&255),l(m,9===m.level?2:2<=m.strategy||2>m.level?4:0),l(m,255&m.gzhead.os),m.gzhead.extra&&m.gzhead.extra.length&&(l(m,255&m.gzhead.extra.length), l(m,m.gzhead.extra.length>>8&255)),m.gzhead.hcrc&&(d.adler=C(d.adler,m.pending_buf,m.pending,0)),m.gzindex=0,m.status=69):(l(m,0),l(m,0),l(m,0),l(m,0),l(m,0),l(m,9===m.level?2:2<=m.strategy||2>m.level?4:0),l(m,3),m.status=da)):(u=Q+(m.w_bits-8<<4)<<8,v=-1,v=2<=m.strategy||2>m.level?0:6>m.level?1:6===m.level?2:3,u|=v<<6,0!==m.strstart&&(u|=32),m.status=da,n(m,u+(31-u%31)),0!==m.strstart&&(n(m,d.adler>>>16),n(m,65535&d.adler)),d.adler=1);if(69===m.status)if(m.gzhead.extra){for(u=m.pending;m.gzindex< (65535&m.gzhead.extra.length)&&(m.pending!==m.pending_buf_size||(m.gzhead.hcrc&&m.pending>u&&(d.adler=C(d.adler,m.pending_buf,m.pending-u,u)),g(d),u=m.pending,m.pending!==m.pending_buf_size));)l(m,255&m.gzhead.extra[m.gzindex]),m.gzindex++;m.gzhead.hcrc&&m.pending>u&&(d.adler=C(d.adler,m.pending_buf,m.pending-u,u));m.gzindex===m.gzhead.extra.length&&(m.gzindex=0,m.status=73)}else m.status=73;if(73===m.status)if(m.gzhead.name){u=m.pending;do{if(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending> u&&(d.adler=C(d.adler,m.pending_buf,m.pending-u,u)),g(d),u=m.pending,m.pending===m.pending_buf_size)){v=1;break}v=m.gzindexu&&(d.adler=C(d.adler,m.pending_buf,m.pending-u,u));0===v&&(m.gzindex=0,m.status=91)}else m.status=91;if(91===m.status)if(m.gzhead.comment){u=m.pending;do{if(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>u&&(d.adler=C(d.adler,m.pending_buf,m.pending-u,u)), g(d),u=m.pending,m.pending===m.pending_buf_size)){v=1;break}v=m.gzindexu&&(d.adler=C(d.adler,m.pending_buf,m.pending-u,u));0===v&&(m.status=103)}else m.status=103;if(103===m.status&&(m.gzhead.hcrc?(m.pending+2>m.pending_buf_size&&g(d),m.pending+2<=m.pending_buf_size&&(l(m,255&d.adler),l(m,d.adler>>8&255),d.adler=0,m.status=da)):m.status=da),0!==m.pending){if(g(d),0===d.avail_out)return m.last_flush= -1,I}else if(0===d.avail_in&&(c<<1)-(4=J&&0m.lookahead&&(m.match_length=m.lookahead)}if(m.match_length>= J?(q=D._tr_tally(m,1,m.match_length-J),m.lookahead-=m.match_length,m.strstart+=m.match_length,m.match_length=0):(q=D._tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++),q&&(k(m,!1),0===m.strm.avail_out)){q=U;break a}}q=(m.insert=0,c===G?(k(m,!0),0===m.strm.avail_out?aa:Y):m.last_lit&&(k(m,!1),0===m.strm.avail_out)?U:Z)}else q=y[m.level].func(m,c);if(q!==aa&&q!==Y||(m.status=666),q===U||q===aa)return 0===d.avail_out&&(m.last_flush=-1),I;if(q===Z&&(1===c?D._tr_align(m):5!==c&&(D._tr_stored_block(m, 0,0,!1),3===c&&(e(m.head),0===m.lookahead&&(m.strstart=0,m.block_start=0,m.insert=0))),g(d),0===d.avail_out))return m.last_flush=-1,I}return c!==G?I:0>=m.wrap?1:(2===m.wrap?(l(m,255&d.adler),l(m,d.adler>>8&255),l(m,d.adler>>16&255),l(m,d.adler>>24&255),l(m,255&d.total_in),l(m,d.total_in>>8&255),l(m,d.total_in>>16&255),l(m,d.total_in>>24&255)):(n(m,d.adler>>>16),n(m,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 z.Buf8(c.w_size),z.arraySet(l,d,f-c.w_size,c.w_size,0),d=l,f=c.w_size);l=b.avail_in;n=b.next_in;m=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<A&&(x+=K[f++]<>>24,x>>>=F,A-=F,F=C>>>16&255,0===F)L[n++]=65535&C;else{if(!(16&F)){if(0===(64&F)){C=y[(65535&C)+(x&(1<>>=F,A-=F);15>A&&(x+=K[f++]<>>24,x>>>=F,A-=F,F=C>>>16&255, !(16&F)){if(0===(64&F)){C=z[(65535&C)+(x&(1<s){b.msg="invalid distance too far back";c.mode=30;break a}if(x>>>=F,A-=F,F=n-m,G>F){if(F=G-F,F>q&&c.sane){b.msg="invalid distance too far back";c.mode=30;break a}if(C=0,I=u,0===v){if(C+=t-F,F>3;f-=H;A-=H<<3;b.next_in=f;b.next_out=n;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=z,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,A):y}function k(b){var d;return b&&b.state?(d=b.state,d.wsize=0,d.whave=0,d.wnext=0,g(b)):y}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.whaveE;){if(0===n)break a;n--;B+=f[k++]<>>8&255;c.check=v(c.check,S,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===n)break a;n--;B+=f[k++]<>8&1);512&c.flags&&(S[0]=255&B,S[1]=B>>>8&255,c.check=v(c.check,S,2,0));E=B=0;c.mode=3;case 3:for(;32>E;){if(0===n)break a;n--;B+=f[k++]<>>8&255,S[2]=B>>>16&255,S[3]=B>>>24&255,c.check=v(c.check,S,4,0));E=B=0;c.mode=4;case 4:for(;16>E;){if(0===n)break a;n--;B+=f[k++]<>8);512&c.flags&&(S[0]=255&B,S[1]=B>>>8&255,c.check=v(c.check,S,2,0));E=B=0;c.mode= 5;case 5:if(1024&c.flags){for(;16>E;){if(0===n)break a;n--;B+=f[k++]<>>8&255,c.check=v(c.check,S,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>n&&(M=n),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=v(c.check,f,M,k)),n-=M,k+=M,c.length-=M),c.length))break a;c.length=0;c.mode= 7;case 7:if(2048&c.flags){if(0===n)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&&ME;){if(0===n)break a;n--;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===n)break a;n--;B+=f[k++]<>>= 7&E;E-=7&E;c.mode=27;break}for(;3>E;){if(0===n)break a;n--;B+=f[k++]<>>=1,E-=1,3&B){case 0:c.mode=14;break;case 1:N=c;if(C){R=void 0;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;x(1,N.lens,0,288,p,0,N.work,{bits:9});for(R=0;32>R;)N.lens[R++]=5;x(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===n)break a;n--;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>n&&(M=n),M>D&&(M=D),0===M)break a;t.arraySet(g,f,k,M,l);n-=M;k+=M;D-=M;l+=M;c.length-=M;break}c.mode=12;break;case 17:for(;14>E;){if(0===n)break a;n--;B+=f[k++]<< E;E+=8}if(c.nlen=(31&B)+257,B>>>=5,E-=5,c.ndist=(31&B)+1,B>>>=5,E-=5,c.ncode=(15&B)+4,B>>>=4,E-=4,286E;){if(0===n)break a;n--;B+=f[k++]<>>=3;E-=3}for(;19>c.have;)c.lens[ha[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,aa={bits:c.lenbits},Z=x(0,c.lens,0,19,c.lencode,0,c.work,aa),c.lenbits=aa.bits,Z){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===n)break a;n--;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,aa={bits:c.lenbits},Z=x(1,c.lens,0,c.nlen,c.lencode,0,c.work,aa),c.lenbits=aa.bits,Z){d.msg="invalid literal/lengths set";c.mode=30;break}if(c.distbits=6,c.distcode= c.distdyn,aa={bits:c.distbits},Z=x(2,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,aa),c.distbits=aa.bits,Z){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<=n&&258<=D){d.next_out=l;d.avail_out=D;d.next_in=k;d.avail_in=n;c.hold=B;c.bits=E;u(d,O);l=d.next_out;g=d.output;D=d.avail_out;k=d.next_in;f=d.input;n=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===n)break a;n--;B+=f[k++]<>X)],J=Y>>>24,N=Y>>>16&255,R=65535&Y,!(X+J<=E);){if(0===n)break a;n--;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===n)break a;n--;B+=f[k++]<>X)],J=Y>>>24,N=Y>>>16&255,R=65535&Y,!(X+J<=E);){if(0===n)break a;n--;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>>=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,$=c.wsize-M):$=c.wnext-M;M>c.length&&(M=c.length);N=c.window}else N=g,$=l-c.offset,M=c.length;M>D&&(M=D);D-=M;c.length-=M;do g[l++]=N[$++];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===n)break a;n--;B|=f[k++]<E;){if(0===n)break a;n--;B+=f[k++]<c.mode&&(27>c.mode||4!==e))&&m(d,d.output,d.next_out,O-d.avail_out)?(c.mode=31,-4):(T-=d.avail_in,O-=d.avail_out,d.total_in+=T,d.total_out+=O,c.total+=O,c.wrap&&O&&(d.adler=c.check=c.flags?v(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===T&&0===O||4===e)&&Z===A&&(Z=-5),Z)};d.inflateEnd=function(b){if(!b||!b.state)return y;var d=b.state;return d.window&&(d.window=null),b.state=null,A};d.inflateGetHeader=function(b,d){var e;return b&&b.state?(e=b.state,0===(2&e.wrap)?y:(e.head=d,d.done=!1,A)):y};d.inflateSetDictionary=function(b,d){var e,c,f=d.length;return b&&b.state?(e=b.state,0!==e.wrap&&11!==e.mode?y:11===e.mode&&(c=1,c=q(c,d,f,0),c!==e.check)?-3:m(b,d,f,f)?(e.mode=31,-4):(e.havedict=1,A)): y};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,v,u){var x,A,y,z,D,B,C,F;z=u.bits;for(var H=0,G=0,I=0,K=0,L=0,P=0,W=0,V=x=0,Q=0,E=null,T=0,O=new b.Buf16(16),P=new b.Buf16(16),M=null,$=0,H=0;15>=H;H++)O[H]=0;for(G=0;GK&&(L=K),0===K)return t[q++]=20971520,t[q++]=20971520,u.bits=1,0;for(I=1;I=H;H++)if(x<<=1,x-=O[H],0>x)return-1;if(0< x&&(0===d||1!==K))return-1;P[1]=0;for(H=1;15>H;H++)P[H+1]=P[H]+O[H];for(G=0;GD?(C=M[$+v[G]],F=E[T+v[G]]):(C=96,F=0);x=1<>W)+A]=B<<24|C<<16|F|0;while(0!==A);for(x=1<>=1;if(0!==x?(Q&=x-1,Q+=x):Q=0,G++,0===--O[H]){if(H===K)break; H=c[f+v[G]]}if(H>L&&(Q&s)!==y){0===W&&(W=L);z+=I;P=H-W;for(x=1<=x));)P++,x<<=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]=m(f[c]++,c))}function s(b){var d;for(d=0;dc?fa[c]:fa[256+(c>>>7)],n(b,g,e),k=$[g],0!==k&&(c-=Z[g],l(b,c,k)));while(mb.heap_len;)f=b.heap[++b.heap_len]=2>n?++n:0,g[2*f]=1,b.depth[f]=0,b.opt_len--,k&&(b.static_len-=c[2*f+1]);d.max_code=n;for(e=b.heap_len>>1;1<=e;e--)v(b,g,e);f=l; do e=b.heap[1],b.heap[1]=b.heap[b.heap_len--],v(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++,v(b,g,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];var m,u,k=d.dyn_tree,l=d.max_code,q=d.stat_desc.static_tree,x=d.stat_desc.has_stree,t=d.stat_desc.extra_bits,s=d.stat_desc.extra_base,A=d.stat_desc.max_length,z=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;eA&&(c=A,z++),k[2*f+1]=c,f>l||(b.bl_count[c]++,m=0,f>=s&&(m=t[f-s]),u=k[2*f],b.opt_len+=u*(c+m),x&&(b.static_len+=u*(q[2*f+1]+m)));if(0!==z){do{for(c=A-1;0===b.bl_count[c];)c--;b.bl_count[c]--;b.bl_count[c+1]+=2;b.bl_count[A]--;z-=2}while(0l||(k[2*m+1]!==c&&(b.opt_len+=(c-k[2*m+1])*k[2*m],k[2*m+1]=c),f--)}p(g,n,b.bl_count)}function A(b,d,e){var c,f,g=-1,k=d[1],l=0,n=7, m=4;0===k&&(n=138,m=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*T]++:b.bl_tree[2*O]++,l=0,g=f,0===k?(n=138,m=3):f===k?(n=6,m=3):(n=7,m=4))}function y(b,d,e){var c,f,g=-1,k=d[1],m=0,p=7,u=4;0===k&&(p=138,u=3);for(c=0;c<=e;c++)if(f=k,k=d[2*(c+1)+1],!(++m=m? (n(b,T,b.bl_tree),l(b,m-3,3)):(n(b,O,b.bl_tree),l(b,m-11,7));m=0;g=f;0===k?(p=138,u=3):f===k?(p=6,u=3):(p=7,u=4)}}function z(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++){Z[f]=c;for(d=0;d<1<<$[f];d++)fa[c++]=f}for(c>>=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,I+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),u(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++, d--,b.dyn_ltree[2*(da[e]+G+1)]++,b.dyn_dtree[2*(256>d?fa[d]:fa[256+(d>>>7)])]++),b.last_lit===b.lit_bufsize-1};d._tr_align=function(b){l(b,2,3);n(b,Q,R);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(c,f,d){f.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(c,f,d){d=c("./lib/utils/common").assign;var b=c("./lib/deflate"),e=c("./lib/inflate");c=c("./lib/zlib/constants");var g={};d(g,b,e,c);f.exports=g},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d",encode:function(a,c){var f="",d,b,e,g,k,l,n=0;for(null!=c&&c||(a=Base64._utf8_encode(a));n>2,d=(d&3)<<4|b>>4,k=(b&15)<<2|e>>6,l=e&63,isNaN(b)?k=l=64:isNaN(e)&&(l=64),f=f+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return f},decode:function(a,c){c=null!=c?c:!1;var f="",d,b,e,g,k,l=0;for(a= a.replace(/[^A-Za-z0-9\+\/\=]/g,"");l>4,b=(b&15)<<4|g>>2,e=(g&3)<<6|k,f+=String.fromCharCode(d),64!=g&&(f+=String.fromCharCode(b)),64!=k&&(f+=String.fromCharCode(e));c||(f=Base64._utf8_decode(f));return f},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var c="",f=0;fd?c+=String.fromCharCode(d): (127d?c+=String.fromCharCode(d>>6|192):(c+=String.fromCharCode(d>>12|224),c+=String.fromCharCode(d>>6&63|128)),c+=String.fromCharCode(d&63|128))}return c},_utf8_decode:function(a){for(var c="",f=0,d=c1=c2=0;fd?(c+=String.fromCharCode(d),f++):191d?(c2=a.charCodeAt(f+1),c+=String.fromCharCode((d&31)<<6|c2&63),f+=2):(c2=a.charCodeAt(f+1),c3=a.charCodeAt(f+2),c+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),f+=3);return c}};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"; window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev?"iconSearch":"https://www.draw.io/iconSearch";window.TEMPLATE_PATH=window.TEMPLATE_PATH||"/templates";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";window.mxLoadResources=window.mxLoadResources||!1; window.mxLanguage=window.mxLanguage||function(){var a="1"==urlParams.offline?"en":urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var c=localStorage.getItem(".drawio-config");null!=c&&(a=JSON.parse(c).language||null)}catch(f){isLocalStorage=!1}return a}(); window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",ca:"Catal\u00e0",cs:"\u010ce\u0161tina",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Espa\u00f1ol",fil:"Filipino",fr:"Fran\u00e7ais",it:"Italiano",hu:"Magyar",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Portugu\u00eas (Brasil)",pt:"Portugu\u00eas (Portugal)",ro:"Rom\u00e2n\u0103",fi:"Suomi",sv:"Svenska",vi:"Ti\u1ebfng Vi\u1ec7t",tr:"T\u00fcrk\u00e7e",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac", ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",sr:"\u0421\u0440\u043f\u0441\u043a\u0438",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",he:"\u05e2\u05d1\u05e8\u05d9\u05ea",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",th:"\u0e44\u0e17\u0e22",ko:"\ud55c\uad6d\uc5b4",ja:"\u65e5\u672c\u8a9e",zh:"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09","zh-tw":"\u4e2d\u6587\uff08\u53f0\u7063\uff09"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph"); if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var c=localStorage.getItem(".drawio-config");null!=c&&(a=JSON.parse(c).ui||null)}catch(f){isLocalStorage=!1}return a}();function setCurrentXml(a,c){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,c)} (function(){if("undefined"!==typeof JSON&&isLocalStorage)try{var a=localStorage.getItem(".drawio-config"),c=!0;null!=a&&(c=JSON.parse(a).showStartScreen);!1==c&&(urlParams.splash="0")}catch(f){}})();var ex=urlParams["export"];null!=ex&&("http://"!=ex.substring(0,7)&&"https://"!=ex.substring(0,8)&&(ex="http://"+ex),EXPORT_URL=ex); if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.analytics="0",urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";var host=window.location.host,searchString="draw.io",position=host.length-searchString.length,lastIndex=host.lastIndexOf(searchString,position);-1!==lastIndex&&(lastIndex===position&&"test.draw.io"!=host)&&(window.DRAWIO_LOG_URL="https://log.draw.io");window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images"; window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"3.7.0.1",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/")|| 0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/")||null!=document.documentMode&&9<=document.documentMode,NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_WIN:0document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(a,c,f){f=f||document;if(mxClient.IS_IE6)f.write('\x3clink rel\x3d"'+a+'" href\x3d"'+c+'" charset\x3d"UTF-8" type\x3d"text/css"/\x3e');else{var d= f.createElement("link");d.setAttribute("rel",a);d.setAttribute("href",c);d.setAttribute("charset","UTF-8");d.setAttribute("type","text/css");f.getElementsByTagName("head")[0].appendChild(d)}},include:function(a){document.write('\x3cscript src\x3d"'+a+'"\x3e\x3c/script\x3e')},dispose:function(){for(var a=0;ad&&g?(d++,window.setTimeout(b,e)):null!=f&&f()},e=30;b()},cascadeOpacity:function(a,c,f){for(var d=a.model.getChildCount(c),b=0;bdocument.documentMode&&(a="ms");return function(c,f,d){c[f]=d;null!=a&&0document.documentMode))switch(c.nodeType){case 1:var d=a.createElement(c.nodeName);if(c.attributes&&0/g,"\x26gt;");if(null==c||c)a=a.replace(/\n/g,"\x26#xa;");return a},isVml:function(a){return null!=a&&"urn:schemas-microsoft-com:vml"==a.tagUrn},getXml:function(a,c){var f="";null!=window.XMLSerializer?f=(new XMLSerializer).serializeToString(a):null!=a.xml&&(f=a.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,"\x3e").replace(/\r\n/g,"\n"));return f.replace(/\n/g,c||"\x26#xa;")}, extractTextWithWhitespace:function(a){for(var c=!1,f=[],d=0;a[d];d++){var b=a[d];if(3===b.nodeType||4===b.nodeType){if(11==document.documentMode&&d==a.length-1&&0==b.nodeValue.length)break;f.push(b.nodeValue+(null==b.nextSibling||3!=b.nextSibling.nodeType?"\n":""));c=!0}else 8!==b.nodeType&&((mxClient.IS_IE||mxClient.IS_IE11)&&"P"==b.nodeName&&0==b.innerHTML.length||!c&&"BR"==b.nodeName||"DIV"==b.nodeName&&"\x3cbr\x3e"==b.innerHTML?f.push("\n"):f.push(mxUtils.extractTextWithWhitespace(b.childNodes)), c=!1)}return f.join("")},replaceTrailingNewlines:function(a,c){for(var f="";0k&&(a.style.left=Math.max(b,k-f)+"px");c=parseInt(a.offsetTop);f=parseInt(a.offsetHeight);e=d+Math.max(e.clientHeight||0,g.clientHeight);c+f>e&&(a.style.top=Math.max(d,e-f)+"px")},load:function(a){a=new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,c,f,d,b,e){a=new mxXmlRequest(a,null,"GET");null!=d&&a.setBinary(d);a.send(c,f,b,e);return a},getAll:function(a,c,f){for(var d=a.length,b=[],e=0,g=function(){0==e&&null!=f&&f();e++},k=0;kf||299mxUtils.indexOf(c,b)))d[b]=!f&&"object"==typeof a[b]?mxUtils.clone(a[b]):a[b]}return d},equalPoints:function(a,c){if(null==a&&null!=c||null!=a&&null==c||null!=a&&null!=c&&a.length!=c.length)return!1;if(null!= a&&null!=c)for(var f=0;fb&&(b+=2*Math.PI);g=2*b/Math.PI;g=Math.ceil(0>g?-1*g:g);b/=g;n=8/3*Math.sin(b/4)*Math.sin(b/4)/Math.sin(b/2);m=p*f;p*=d;f*=s;d*=s;for(var x=Math.cos(e),A=Math.sin(e),t=-n*(m*A+d*x),q=-n*(f*A-p*x),s=[],y=0;yf&&(a=3,-135>=f&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:c|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:c|=mxConstants.DIRECTION_MASK_EAST;break;case 2:c|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:c|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:c|=mxConstants.DIRECTION_MASK_WEST;break;case 1:c|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:c|=mxConstants.DIRECTION_MASK_EAST;break; case 3:c|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:c|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:c|=mxConstants.DIRECTION_MASK_WEST;break;case 2:c|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:c|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:c|=mxConstants.DIRECTION_MASK_EAST;break;case 1:c|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:c|=mxConstants.DIRECTION_MASK_WEST;break;case 3:c|=mxConstants.DIRECTION_MASK_NORTH}return c}, reversePortConstraints:function(a){var c=0,c=(a&mxConstants.DIRECTION_MASK_WEST)<<3,c=c|(a&mxConstants.DIRECTION_MASK_NORTH)<<1,c=c|(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return c|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,c,f){var d=-1;if(0f.x&&(a=f.x,k=c.x);k>g&&(k=g);ak)return!1;var b=c.y,g=f.y,l=f.x-c.x;1E-7g&&(c=g,g=b,b=c);g>e&&(g=e);bg?!1:!0},contains:function(a,c,f){return a.x<=c&&a.x+a.width>=c&&a.y<=f&&a.y+a.height>=f},intersects:function(a,c){var f=a.width,d=a.height,b=c.width,e=c.height;if(0>=b||0>=e||0>=f||0>=d)return!1;var g=a.x,k=a.y,l=c.x,n=c.y,b=b+l,e=e+n,f=f+ g,d=d+k;return(bg)&&(ek)&&(fl)&&(dn)},intersectsHotspot:function(a,c,f,d,b,e){d=null!=d?d:1;b=null!=b?b:0;e=null!=e?e:0;if(0a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,c){return(a%c+c)%c},intersection:function(a,c,f,d,b,e,g,k){var l=(k-e)*(f-a)-(g-b)*(d-c);g=((g-b)*(c-e)-(k-e)*(a-b))/l;b=((f-a)*(c-e)-(d-c)*(a-b))/l;return 0<=g&&1>=g&&0<=b&&1>=b?new mxPoint(a+g*(f-a),c+g*(d-c)):null},ptSegDistSq:function(a,c,f,d,b,e){f-=a;d-=c;b-=a;e-=c;0>=b*f+e*d?f=0:(b=f-b,e=d-e,a=b*f+e*d,f=0>=a?0:a*a/(f*f+d*d));b=b*b+e*e-f;0>b&&(b=0); return b},ptLineDist:function(a,c,f,d,b,e){return Math.abs((d-c)*b-(f-a)*e+f*c-d*a)/Math.sqrt((d-c)*(d-c)+(f-a)*(f-a))},relativeCcw:function(a,c,f,d,b,e){f-=a;d-=c;b-=a;e-=c;a=b*d-e*f;0==a&&(a=b*f+e*d,0a&&(a=0)));return 0>a?-1:0document.documentMode)?a.style.filter=100<=c?"":"alpha(opacity\x3d"+c+")":a.style.opacity=c/100},createImage:function(a){var c=null;mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(c=document.createElement(mxClient.VML_PREFIX+":image"),c.setAttribute("src",a),c.style.borderStyle="none"):(c=document.createElement("img"),c.setAttribute("src",a),c.setAttribute("border", "0"));return c},sortCells:function(a,c){c=null!=c?c:!0;var f=new mxDictionary;a.sort(function(a,b){var e=f.get(a);null==e&&(e=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),f.put(a,e));var g=f.get(b);null==g&&(g=mxCellPath.create(b).split(mxCellPath.PATH_SEPARATOR),f.put(b,g));e=mxCellPath.compare(e,g);return 0==e?0:0a.indexOf("\x3d"))?a:""},getStylenames:function(a){var c=[];if(null!=a){a=a.split(";");for(var f= 0;fa[f].indexOf("\x3d")&&c.push(a[f])}return c},indexOfStylename:function(a,c){if(null!=a&&null!=c)for(var f=a.split(";"),d=0,b=0;bmxUtils.indexOfStylename(a,c)&&(null==a?a="":0b?";":a.substring(b)):0>b||b==a.length-1?"":a.substring(b+1)}else{var e=a.indexOf(";"+c+"\x3d");0>e?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+c+"\x3d"+f+";"):(b=a.indexOf(";",e+1),a=d?a.substring(0,e+1)+c+"\x3d"+f+(0>b?";":a.substring(b)):a.substring(0,e)+(0>b?";":a.substring(b)))}return a},setCellStyleFlags:function(a,c,f,d,b){if(null!=c&&0b)b=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+b+c+"\x3d"+f:a+b+c+"\x3d0";else{var e=a.indexOf(";",b),g="",g=0>e?a.substring(b+c.length+1):a.substring(b+c.length+1,e),g=null==d?parseInt(g)^f:d?parseInt(g)|f:parseInt(g)&~f;a=a.substring(0,b)+c+"\x3d"+g+(0<=e?a.substring(e):"")}}return a},getAlignmentAsPoint:function(a,c){var f= 0,d=0;a==mxConstants.ALIGN_CENTER?f=-0.5:a==mxConstants.ALIGN_RIGHT&&(f=-1);c==mxConstants.ALIGN_MIDDLE?d=-0.5:c==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(f,d)},getSizeForString:function(a,c,f,d){c=null!=c?c:mxConstants.DEFAULT_FONTSIZE;f=null!=f?f:mxConstants.DEFAULT_FONTFAMILY;var b=document.createElement("div");b.style.fontFamily=f;b.style.fontSize=Math.round(c)+"px";b.style.lineHeight=Math.round(c*mxConstants.LINE_HEIGHT)+"px";b.style.position="absolute";b.style.visibility="hidden"; b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.zoom="1";null!=d?(b.style.width=d+"px",b.style.whiteSpace="normal"):b.style.whiteSpace="nowrap";b.innerHTML=a;document.body.appendChild(b);a=new mxRectangle(0,0,b.offsetWidth,b.offsetHeight);document.body.removeChild(b);return a},getViewXml:function(a,c,f,d,b){d=null!=d?d:0;b=null!=b?b:0;c=null!=c?c:1;null==f&&(f=[a.getModel().getRoot()]);var e=a.getView(),g=null,k=e.isEventsEnabled();e.setEventsEnabled(!1);var l=e.drawPane,n=e.overlayPane; a.dialect==mxConstants.DIALECT_SVG?(e.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),e.canvas.appendChild(e.drawPane),e.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(e.drawPane=e.drawPane.cloneNode(!1),e.canvas.appendChild(e.drawPane),e.overlayPane=e.overlayPane.cloneNode(!1));e.canvas.appendChild(e.overlayPane);var m=e.getTranslate();e.translate=new mxPoint(d,b);c=new mxTemporaryCellStates(a.getView(),c,f);try{g=(new mxCodec).encode(a.getView())}finally{c.destroy(),e.translate= m,e.canvas.removeChild(e.drawPane),e.canvas.removeChild(e.overlayPane),e.drawPane=l,e.overlayPane=n,e.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,c,f,d){if(1>a)return 1;f=null!=f?f:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var b=f.width-2*d;f=f.height-2*d;d=c.getGraphBounds().clone();c=c.getView().getScale();d.width/=c;d.height/=c;c=d.width;f=c/d.height/(b/f);d=Math.sqrt(a);var e=Math.sqrt(f);f=d*e;d/=e;if(1>f&&d>a){var g=d/a;d=a;f/=g}1>d&&f>a&&(g=f/a,f=a,d/=g);g=Math.ceil(f)* Math.ceil(d);for(e=0;g>a;){var g=Math.floor(f)/f,k=Math.floor(d)/d;1==g&&(g=Math.floor(f-1)/f);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;f*=g;d*=g;g=Math.ceil(f)*Math.ceil(d);e++;if(10document.documentMode)?function(a){mxEvent.addListener(a, "contextmenu",function(){return!1})}:function(a){a.setAttribute("oncontextmenu","return false;")}}(),getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.mozInputSource?5==a.mozInputSource:0==a.type.indexOf("touch")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&& null!=a.touches&&1navigator.userAgent.indexOf("Presto/2.5")&&(this.contentWrapper.style.overflow=a?"auto":"hidden")}; mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var a=mxUtils.getCurrentStyle(this.getElement()),a=null!=a?a.zIndex:3;if(mxWindow.activeWindow){var c=mxWindow.activeWindow.getElement();null!=c&&null!=c.style&&(c.style.zIndex=a)}c=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(a)+1;mxWindow.activeWindow=this;this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",c))}};mxWindow.prototype.getElement=function(){return this.div}; mxWindow.prototype.fit=function(){mxUtils.fit(this.div)};mxWindow.prototype.isResizable=function(){return null!=this.resize?"none"!=this.resize.style.display:!1}; mxWindow.prototype.setResizable=function(a){if(a)if(null==this.resize){this.resize=document.createElement("img");this.resize.style.position="absolute";this.resize.style.bottom="2px";this.resize.style.right="2px";this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif");this.resize.style.cursor="nw-resize";var c=null,f=null,d=null,b=null;a=mxUtils.bind(this,function(a){this.activate();c=mxEvent.getClientX(a);f=mxEvent.getClientY(a);d=this.div.offsetWidth;b=this.div.offsetHeight;mxEvent.addGestureListeners(document, null,e,g);this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",a));mxEvent.consume(a)});var e=mxUtils.bind(this,function(a){if(null!=c&&null!=f){var e=mxEvent.getClientX(a)-c,g=mxEvent.getClientY(a)-f;this.setSize(d+e,b+g);this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",a));mxEvent.consume(a)}}),g=mxUtils.bind(this,function(b){null!=c&&null!=f&&(f=c=null,mxEvent.removeGestureListeners(document,null,e,g),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",b)),mxEvent.consume(b))}); mxEvent.addGestureListeners(this.resize,a,e,g);this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")}; mxWindow.prototype.setSize=function(a,c){a=Math.max(this.minimumSize.width,a);c=Math.max(this.minimumSize.height,c);mxClient.IS_QUIRKS||(this.div.style.width=a+"px",this.div.style.height=c+"px");this.table.style.width=a+"px";this.table.style.height=c+"px";mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")};mxWindow.prototype.setMinimizable=function(a){this.minimize.style.display=a?"":"none"}; mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)}; mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img");this.minimize.setAttribute("src",this.minimizeImage);this.minimize.setAttribute("title","Minimize");this.minimize.style.cursor="pointer";this.minimize.style.marginLeft="2px";this.minimize.style.display="none";this.buttons.appendChild(this.minimize);var a=!1,c=null,f=null,d=mxUtils.bind(this,function(b){this.activate();if(a)a=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title", "Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=c,mxClient.IS_QUIRKS||(this.div.style.height=f),this.table.style.height=f,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",b));else{a=!0;this.minimize.setAttribute("src",this.normalizeImage);this.minimize.setAttribute("title","Normalize");this.contentWrapper.style.display="none";c=this.maximize.style.display;this.maximize.style.display="none";f=this.table.style.height; var d=this.getMinimumSize();0=b.x-e.x&&d>=b.y-e.y&&f<=b.x-e.x+a.container.offsetWidth&&d<=b.y-e.y+a.container.offsetHeight}; mxDragSource.prototype.mouseMove=function(a){var c=this.getGraphForEvent(a);null!=c&&!this.graphContainsEvent(c,a)&&(c=null);c!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,a),this.currentGraph=c,null!=this.currentGraph&&this.dragEnter(this.currentGraph,a));null!=this.currentGraph&&this.dragOver(this.currentGraph,a);if(null!=this.dragElement&&(null==this.previewElement||"visible"!=this.previewElement.style.visibility)){var c=mxEvent.getClientX(a),f=mxEvent.getClientY(a); null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement);this.dragElement.style.visibility="visible";null!=this.dragOffset&&(c+=this.dragOffset.x,f+=this.dragOffset.y);var d=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=c+d.x+"px";this.dragElement.style.top=f+d.y+"px"}else null!=this.dragElement&&(this.dragElement.style.visibility="hidden");mxEvent.consume(a)}; mxDragSource.prototype.mouseUp=function(a){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var c=this.currentGraph.view.scale,f=this.currentGraph.view.translate;this.drop(this.currentGraph,a,this.currentDropTarget,this.currentPoint.x/c-f.x,this.currentPoint.y/c-f.y)}this.dragExit(this.currentGraph);this.currentGraph=null}this.stopDrag();this.removeListeners();mxEvent.consume(a)}; mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null);mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler);this.mouseUpHandler=this.mouseMoveHandler=null}; mxDragSource.prototype.dragEnter=function(a,c){a.isMouseDown=!0;a.isMouseTrigger=mxEvent.isMouseEvent(c);this.previewElement=this.createPreviewElement(a);this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(a,a.graphHandler.getGuideStates()));this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(a,mxConstants.DROP_TARGET_COLOR));a.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)}; mxDragSource.prototype.dragExit=function(a,c){this.currentPoint=this.currentDropTarget=null;a.isMouseDown=!1;a.removeListener(this.eventConsumer);null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null);null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null);null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)}; mxDragSource.prototype.dragOver=function(a,c){var f=mxUtils.getOffset(a.container),d=mxUtils.getScrollOrigin(a.container),b=mxEvent.getClientX(c)-f.x+d.x-a.panDx,f=mxEvent.getClientY(c)-f.y+d.y-a.panDy;a.autoScroll&&(null==this.autoscroll||this.autoscroll)&&a.scrollPointToVisible(b,f,a.autoExtend);null!=this.currentHighlight&&a.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(a,b,f,c),d=a.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(d));if(null!=this.previewElement){null== this.previewElement.parentNode&&(a.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var d=this.isGridEnabled()&&a.isGridEnabledEvent(c),e=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(c))var e=parseInt(this.previewElement.style.width),g=parseInt(this.previewElement.style.height),e=new mxRectangle(0,0,e,g),f=new mxPoint(b,f),f=this.currentGuide.move(e,f,d),e=!1,b=f.x,f=f.y;else if(d)var d=a.view.scale, g=a.view.translate,k=a.gridSize/2,b=(a.snap(b/d-g.x-k)+g.x)*d,f=(a.snap(f/d-g.y-k)+g.y)*d;null!=this.currentGuide&&e&&this.currentGuide.hide();null!=this.previewOffset&&(b+=this.previewOffset.x,f+=this.previewOffset.y);this.previewElement.style.left=Math.round(b)+"px";this.previewElement.style.top=Math.round(f)+"px";this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(b,f)}; mxDragSource.prototype.drop=function(a,c,f,d,b){this.dropHandler(a,c,f,d,b);"hidden"!=a.container.style.visibility&&a.container.focus()};function mxToolbar(a){this.container=a}mxToolbar.prototype=new mxEventSource;mxToolbar.prototype.constructor=mxToolbar;mxToolbar.prototype.container=null;mxToolbar.prototype.enabled=!0;mxToolbar.prototype.noReset=!1;mxToolbar.prototype.updateDefaultMode=!0; mxToolbar.prototype.addItem=function(a,c,f,d,b,e){var g=document.createElement(null!=c?"img":"button"),k=b||(null!=e?"mxToolbarMode":"mxToolbarItem");g.className=k;g.setAttribute("src",c);null!=a&&(null!=c?g.setAttribute("title",a):mxUtils.write(g,a));this.container.appendChild(g);null!=f&&(mxEvent.addListener(g,"click",f),mxClient.IS_TOUCH&&mxEvent.addListener(g,"touchend",f));a=mxUtils.bind(this,function(b){null!=d?g.setAttribute("src",c):g.style.backgroundColor=""});mxEvent.addGestureListeners(g, mxUtils.bind(this,function(b){null!=d?g.setAttribute("src",d):g.style.backgroundColor="gray";if(null!=e){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var a=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu();a!=g&&(this.currentImg=g,this.menu.factoryMethod=e,a=new mxPoint(g.offsetLeft,g.offsetTop+g.offsetHeight),this.menu.popup(a.x,a.y,null,b),this.menu.isMenuShowing()&&(g.className=k+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this); g.className=k;this.currentImg=null}))}}),null,a);mxEvent.addListener(g,"mouseout",a);return g};mxToolbar.prototype.addCombo=function(a){var c=document.createElement("div");c.style.display="inline";c.className="mxToolbarComboContainer";var f=document.createElement("select");f.className=a||"mxToolbarCombo";c.appendChild(f);this.container.appendChild(c);return f}; mxToolbar.prototype.addActionCombo=function(a,c){var f=document.createElement("select");f.className=c||"mxToolbarCombo";this.addOption(f,a,null);mxEvent.addListener(f,"change",function(a){var b=f.options[f.selectedIndex];f.selectedIndex=0;null!=b.funct&&b.funct(a)});this.container.appendChild(f);return f};mxToolbar.prototype.addOption=function(a,c,f){var d=document.createElement("option");mxUtils.writeln(d,c);"function"==typeof f?d.funct=f:d.setAttribute("value",f);a.appendChild(d);return d}; mxToolbar.prototype.addSwitchMode=function(a,c,f,d,b){var e=document.createElement("img");e.initialClassName=b||"mxToolbarMode";e.className=e.initialClassName;e.setAttribute("src",c);e.altIcon=d;null!=a&&e.setAttribute("title",a);mxEvent.addListener(e,"click",mxUtils.bind(this,function(b){b=this.selectedMode.altIcon;null!=b?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",b)):this.selectedMode.className=this.selectedMode.initialClassName;this.updateDefaultMode&& (this.defaultMode=e);this.selectedMode=e;b=e.altIcon;null!=b?(e.altIcon=e.getAttribute("src"),e.setAttribute("src",b)):e.className=e.initialClassName+"Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT));f()}));this.container.appendChild(e);null==this.defaultMode&&(this.defaultMode=e,this.selectMode(e),f());return e}; mxToolbar.prototype.addMode=function(a,c,f,d,b,e){e=null!=e?e:!0;var g=document.createElement(null!=c?"img":"button");g.initialClassName=b||"mxToolbarMode";g.className=g.initialClassName;g.setAttribute("src",c);g.altIcon=d;null!=a&&g.setAttribute("title",a);this.enabled&&e&&(mxEvent.addListener(g,"click",mxUtils.bind(this,function(b){this.selectMode(g,f);this.noReset=!1})),mxEvent.addListener(g,"dblclick",mxUtils.bind(this,function(b){this.selectMode(g,f);this.noReset=!0})),null==this.defaultMode&& (this.defaultMode=g,this.defaultFunction=f,this.selectMode(g,f)));this.container.appendChild(g);return g}; mxToolbar.prototype.selectMode=function(a,c){if(this.selectedMode!=a){if(null!=this.selectedMode){var f=this.selectedMode.altIcon;null!=f?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",f)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=a;f=this.selectedMode.altIcon;null!=f?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",f)):this.selectedMode.className=this.selectedMode.initialClassName+ "Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",c))}};mxToolbar.prototype.resetMode=function(a){(a||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)};mxToolbar.prototype.addSeparator=function(a){return this.addItem(null,a,null)};mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)}; mxToolbar.prototype.addLine=function(){var a=document.createElement("hr");a.style.marginRight="6px";a.setAttribute("size","1");this.container.appendChild(a)};mxToolbar.prototype.destroy=function(){mxEvent.release(this.container);this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null;null!=this.menu&&this.menu.destroy()};function mxUndoableEdit(a,c){this.source=a;this.changes=[];this.significant=null!=c?c:!0}mxUndoableEdit.prototype.source=null; mxUndoableEdit.prototype.changes=null;mxUndoableEdit.prototype.significant=null;mxUndoableEdit.prototype.undone=!1;mxUndoableEdit.prototype.redone=!1;mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length};mxUndoableEdit.prototype.isSignificant=function(){return this.significant};mxUndoableEdit.prototype.add=function(a){this.changes.push(a)};mxUndoableEdit.prototype.notify=function(){};mxUndoableEdit.prototype.die=function(){}; mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length-1;0<=a;a--){var c=this.changes[a];null!=c.execute?c.execute():null!=c.undo&&c.undo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",c))}this.undone=!0;this.redone=!1;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()}; mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length,c=0;cthis.indexOfNextAdd)for(var a=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),c=0;cthis.dx&&Math.abs(this.dx)this.dy&&Math.abs(this.dy)b.x+(document.body.clientWidth||e.clientWidth))c.div.style.left=a.div.offsetLeft-d+(mxClient.IS_IE?6:-6)+"px";mxUtils.fit(c.div)}}; mxPopupMenu.prototype.addSeparator=function(a,c){a=a||this;if(this.smartSeparators&&!c)a.willAddSeparator=!0;else if(null!=a.tbody){a.willAddSeparator=!1;var f=document.createElement("tr"),d=document.createElement("td");d.className="mxPopupMenuIcon";d.style.padding="0 0 0 0px";f.appendChild(d);d=document.createElement("td");d.style.padding="0 0 0 0px";d.setAttribute("colSpan","2");var b=document.createElement("hr");b.setAttribute("size","1");d.appendChild(b);f.appendChild(d);a.tbody.appendChild(f)}}; mxPopupMenu.prototype.popup=function(a,c,f,d){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){this.div.style.left=a+"px";for(this.div.style.top=c+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0;this.factoryMethod(this,f,d);0this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&a>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++};mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime();this.ignoredChanges=0};mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)}; function mxAnimation(a){this.delay=null!=a?a:20}mxAnimation.prototype=new mxEventSource;mxAnimation.prototype.constructor=mxAnimation;mxAnimation.prototype.delay=null;mxAnimation.prototype.thread=null;mxAnimation.prototype.isRunning=function(){return null!=this.thread};mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))};mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))}; mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))};function mxMorphing(a,c,f,d){mxAnimation.call(this,d);this.graph=a;this.steps=null!=c?c:6;this.ease=null!=f?f:1.5}mxMorphing.prototype=new mxAnimation;mxMorphing.prototype.constructor=mxMorphing;mxMorphing.prototype.graph=null;mxMorphing.prototype.steps=null;mxMorphing.prototype.step=0;mxMorphing.prototype.ease=null; mxMorphing.prototype.cells=null;mxMorphing.prototype.updateAnimation=function(){var a=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var c=0;c=this.steps)&&this.stopAnimation()};mxMorphing.prototype.show=function(a){a.show()}; mxMorphing.prototype.animateCell=function(a,c,f){var d=this.graph.getView().getState(a),b=null;if(null!=d&&(b=this.getDelta(d),this.graph.getModel().isVertex(a)&&(0!=b.x||0!=b.y))){var e=this.graph.view.getTranslate(),g=this.graph.view.getScale();b.x+=e.x*g;b.y+=e.y*g;c.moveState(d,-b.x/this.ease,-b.y/this.ease)}if(f&&!this.stopRecursion(d,b)){d=this.graph.getModel().getChildCount(a);for(b=0;bf?";stop-opacity:"+f:"";b=this.createElement("stop"); b.setAttribute("offset","0%");b.setAttribute("style","stop-color:"+a+f);e.appendChild(b);f=1>d?";stop-opacity:"+d:"";b=this.createElement("stop");b.setAttribute("offset","100%");b.setAttribute("style","stop-color:"+c+f);e.appendChild(b);return e}; mxSvgCanvas2D.prototype.addNode=function(a,c){var f=this.node,d=this.state;if(null!=f){if("path"==f.nodeName)if(null!=this.path&&0a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);if(null!=a.fillColor)if(null!=a.gradientColor)if(a=this.getSvgGradient(a.fillColor,a.gradientColor,a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection),!mxClient.IS_CHROME_APP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document){var c=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill", "url("+c+"#"+a+")")}else this.node.setAttribute("fill","url(#"+a+")");else this.node.setAttribute("fill",a.fillColor.toLowerCase())};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(1,this.format(this.state.strokeWidth*this.state.scale))}; mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state;this.node.setAttribute("stroke",a.strokeColor.toLowerCase());(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);var c=this.getCurrentStrokeWidth();1!=c&&this.node.setAttribute("stroke-width",c);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(a.strokeWidth*a.scale))}; mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var c=a.lineCap;"flat"==c&&(c="butt");"butt"!=c&&this.node.setAttribute("stroke-linecap",c)}null!=a.miterLimit&&(!this.styleEnabled||10!=a.miterLimit)&&this.node.setAttribute("stroke-miterlimit",a.miterLimit)}; mxSvgCanvas2D.prototype.createDashPattern=function(a){var c=[];if("string"===typeof this.state.dashPattern){var f=this.state.dashPattern.split(" ");if(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}; mxSvgCanvas2D.prototype.createDiv=function(a,c,f,d,b){f=this.state;d="display:inline-block;font-size:"+f.fontSize+"px;font-family:"+f.fontFamily+";color:"+f.fontColor+";line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?f.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection)+";"+d;(f.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d+="font-weight:bold;");(f.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d+="font-style:italic;");(f.fontStyle& mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d+="text-decoration:underline;");c==mxConstants.ALIGN_CENTER?d+="text-align:center;":c==mxConstants.ALIGN_RIGHT&&(d+="text-align:right;");c="";null!=f.fontBackgroundColor&&(c+="background-color:"+f.fontBackgroundColor+";");null!=f.fontBorderColor&&(c+="border:1px solid "+f.fontBorderColor+";");mxUtils.isNode(a)||(a=this.convertHtml(a),"fill"!=b&&"width"!=b?a='\x3cdiv xmlns\x3d"http://www.w3.org/1999/xhtml" style\x3d"display:inline-block;text-align:inherit;text-decoration:inherit;'+ c+'"\x3e'+a+"\x3c/div\x3e":d+=c);if(!mxClient.IS_IE&&document.createElementNS)return b=document.createElementNS("http://www.w3.org/1999/xhtml","div"),b.setAttribute("style",d),mxUtils.isNode(a)?this.root.ownerDocument!=document?b.appendChild(a.cloneNode(!0)):b.appendChild(a):b.innerHTML=a,b;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,c,f,d,b,e,g,k,l,n,m){if(null!=m&&null!=m.firstChild&&null!=m.firstChild.firstChild&&null!=m.firstChild.firstChild.firstChild){m=m.firstChild;var p=m.firstChild,s=p.firstChild;n=null!=n?n:0;var t=this.state;a+=t.dx;c+=t.dy;l?(s.style.maxHeight=Math.round(d)+"px",s.style.maxWidth=Math.round(f)+"px"):"fill"==k?(s.style.width=Math.round(f+1)+"px",s.style.height=Math.round(d+1)+"px"):"width"==k&&(s.style.width=Math.round(f+1)+"px",0t.alpha&&v.setAttribute("opacity",t.alpha);var u=this.createElement("foreignObject");u.setAttribute("style","overflow:visible;");u.setAttribute("pointer-events","all");q=this.createDiv(b,e,g,q,n);if(null!=q){null!=s&&q.setAttribute("dir",s);v.appendChild(u);this.root.appendChild(v);var x=0,A=0;s=x=2;if(mxClient.IS_IE&&(9==document.documentMode||!mxClient.IS_SVG)){var y= document.createElement("div");y.style.cssText=q.getAttribute("style");y.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";y.style.position="absolute";y.style.visibility="hidden";A=document.createElement("div");A.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";A.style.wordWrap=mxConstants.WORD_WRAP;A.innerHTML=mxUtils.isNode(b)?b.outerHTML:b;y.appendChild(A);document.body.appendChild(y);8!=document.documentMode&&9!=document.documentMode&&null!=t.fontBorderColor&&(x+=2,s+=2);if(k&&0< f){var z=A.offsetWidth;if(!m&&k&&0t.alpha&&v.setAttribute("opacity",t.alpha);s=q=0;e==mxConstants.ALIGN_CENTER?q-=f/2:e==mxConstants.ALIGN_RIGHT&&(q-=f);a+=q;g==mxConstants.ALIGN_MIDDLE? s-=d/2:g==mxConstants.ALIGN_BOTTOM&&(s-=d);"fill"!=n&&mxClient.IS_FF&&mxClient.IS_WIN&&(s-=2);c+=s;y=1!=t.scale?"scale("+t.scale+")":"";0!=t.rotation&&this.rotateHtml?(y+="rotate("+t.rotation+","+f/2+","+d/2+")",c=this.rotatePoint((a+f/2)*t.scale,(c+d/2)*t.scale,t.rotation,t.rotationCx,t.rotationCy),a=c.x-f*t.scale/2,c=c.y-d*t.scale/2):(a*=t.scale,c*=t.scale);0!=p&&(y+="rotate("+p+","+-q+","+-s+")");v.setAttribute("transform","translate("+(Math.round(a)+this.foOffset)+","+(Math.round(c)+this.foOffset)+ ")"+y);u.setAttribute("width",Math.round(Math.max(1,f)));u.setAttribute("height",Math.round(Math.max(1,d)));this.root.ownerDocument!=document&&(a=this.createAlternateContent(u,a,c,f,d,b,e,g,k,l,n,m,p),null!=a&&(u.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),f=this.createElement("switch"),f.appendChild(u),f.appendChild(a),v.appendChild(f)))}}else this.plainText(a,c,f,d,b,e,g,k,n,m,p,s)}}; mxSvgCanvas2D.prototype.createClip=function(a,c,f,d){a=Math.round(a);c=Math.round(c);f=Math.round(f);d=Math.round(d);for(var b="mx-clip-"+a+"-"+c+"-"+f+"-"+d,e=0,g=b+"-"+e;null!=document.getElementById(g);)g=b+"-"+ ++e;clip=this.createElement("clipPath");clip.setAttribute("id",g);b=this.createElement("rect");b.setAttribute("x",a);b.setAttribute("y",c);b.setAttribute("width",f);b.setAttribute("height",d);clip.appendChild(b);return clip}; mxSvgCanvas2D.prototype.plainText=function(a,c,f,d,b,e,g,k,l,n,m,p){m=null!=m?m:0;k=this.state;var s=k.fontSize,t=this.createElement("g"),q=k.transform||"";this.updateFont(t);0!=m&&(q+="rotate("+m+","+this.format(a*k.scale)+","+this.format(c*k.scale)+")");null!=p&&t.setAttribute("direction",p);n&&0k.alpha&&t.setAttribute("opacity",k.alpha);q=b.split("\n");p=Math.round(s*mxConstants.LINE_HEIGHT);var v=s+(q.length-1)*p;m=c+s-1;g==mxConstants.ALIGN_MIDDLE?"fill"==l?m-=d/2:(n=(this.matchHtmlAlignment&&n&&0a.alpha||1>a.fillAlpha)c.opacity=100*a.alpha*a.fillAlpha+"%";return c}; mxVmlCanvas2D.prototype.createStroke=function(){var a=this.state,c=this.createVmlElement("stroke");c.endcap=a.lineCap||"flat";c.joinstyle=a.lineJoin||"miter";c.miterlimit=a.miterLimit||"10";if(1>a.alpha||1>a.strokeAlpha)c.opacity=100*a.alpha*a.strokeAlpha+"%";a.dashed&&(c.dashstyle=this.getVmlDashStyle());return c};mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var a="dash";if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");0this.state.alpha||1>this.state.fillAlpha)l.style.filter+="alpha(opacity\x3d"+100*this.state.alpha*this.state.fillAlpha+")";this.root.appendChild(l)}; mxVmlCanvas2D.prototype.createDiv=function(a,c,f,d){f=this.createElement("div");var b=this.state,e="";null!=b.fontBackgroundColor&&(e+="background-color:"+b.fontBackgroundColor+";");null!=b.fontBorderColor&&(e+="border:1px solid "+b.fontBorderColor+";");mxUtils.isNode(a)?f.appendChild(a):"fill"!=d&&"width"!=d?(d=this.createElement("div"),d.style.cssText=e,d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",d.style.zoom="1",d.style.textDecoration="inherit",d.innerHTML=a,f.appendChild(d)):(f.style.cssText= e,f.innerHTML=a);a=f.style;a.fontSize=b.fontSize/this.vmlScale+"px";a.fontFamily=b.fontFamily;a.color=b.fontColor;a.verticalAlign="top";a.textAlign=c||"left";a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT;(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic");(b.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&& (a.textDecoration="underline");return f}; mxVmlCanvas2D.prototype.text=function(a,c,f,d,b,e,g,k,l,n,m,p,s){if(this.textEnabled&&null!=b){var t=this.state;if("html"==l){null!=t.rotation&&(c=this.rotatePoint(a,c,t.rotation,t.rotationCx,t.rotationCy),a=c.x,c=c.y);8==document.documentMode&&!mxClient.IS_EM?(a+=t.dx,c+=t.dy,"fill"!=n&&g==mxConstants.ALIGN_TOP&&(c-=1)):(a*=t.scale,c*=t.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(c)+"px";l.style.zoom=t.scale;var q=this.createElement("div");q.style.position="relative";q.style.display="inline";var v=mxUtils.getAlignmentAsPoint(e,g),u=v.x,v=v.y;b=this.createDiv(b,e,g,n);e=this.createElement("div");null!=s&&b.setAttribute("dir",s);if(k&&0x&&(x+=2*Math.PI);x%=Math.PI;x>Math.PI/2&&(x=Math.PI-x);g=Math.cos(x);var A=Math.sin(x);8==document.documentMode&&!mxClient.IS_EM&&(b.style.display="inline-block",e.style.display="inline-block",q.style.display="inline-block");b.style.visibility="hidden";b.style.position="absolute";document.body.appendChild(b);q=b;null!=q.firstChild&&"DIV"==q.firstChild.nodeName&&(q=q.firstChild);x=q.offsetWidth+3;q=q.offsetHeight;m?(f=Math.min(f,x), q=Math.min(q,d)):f=x;k&&(b.style.width=f+"px");if(mxClient.IS_QUIRKS&&(m||"width"==n)&&q>d)q=d,b.style.height=q+"px";d=q;m=(d-d*g+f*-A)/2-s*f*(u+0.5)+p*d*(v+0.5);k=(f-f*g+d*-A)/2+p*f*(u+0.5)+s*d*(v+0.5);"group"==l.nodeName&&"DIV"==this.root.nodeName?(n=this.createElement("div"),n.style.display="inline-block",n.style.position="absolute",n.style.left=this.format(a+(k-f/2)*t.scale)+"px",n.style.top=this.format(c+(m-d/2)*t.scale)+"px",l.parentNode.appendChild(n),n.appendChild(l)):(t=8==document.documentMode&& !mxClient.IS_EM?1:t.scale,l.style.left=this.format(a+(k-f/2)*t)+"px",l.style.top=this.format(c+(m-d/2)*t)+"px");e.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+p+", M12\x3d"+s+", M21\x3d"+-s+", M22\x3d"+p+", sizingMethod\x3d'auto expand')";e.style.backgroundColor=this.rotatedHtmlBackground;1>this.state.alpha&&(e.style.filter+="alpha(opacity\x3d"+100*this.state.alpha+")");e.appendChild(b);b.style.position="";b.style.visibility=""}else 8!=document.documentMode||mxClient.IS_EM?(b.style.verticalAlign= "top",1>this.state.alpha&&(l.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),t=b.parentNode,b.style.visibility="hidden",document.body.appendChild(b),f=b.offsetWidth,q=b.offsetHeight,mxClient.IS_QUIRKS&&m&&q>d&&(q=d,b.style.height=q+"px"),d=q,b.style.visibility="",t.appendChild(b),l.style.left=this.format(a+f*u*this.state.scale)+"px",l.style.top=this.format(c+d*v*this.state.scale)+"px"):(1>this.state.alpha&&(b.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),q.style.left=100*u+ "%",q.style.top=100*v+"%")}else this.plainText(a,c,f,d,mxUtils.htmlEntities(b,!1),e,g,k,l,n,m,p,s)}}; mxVmlCanvas2D.prototype.plainText=function(a,c,f,d,b,e,g,k,l,n,m,p,s){k=this.state;a=(a+k.dx)*k.scale;c=(c+k.dy)*k.scale;f=this.createVmlElement("shape");f.style.width="1px";f.style.height="1px";f.stroked="false";d=this.createVmlElement("fill");d.color=k.fontColor;d.opacity=100*k.alpha+"%";f.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);f.appendChild(d);d=this.createVmlElement("textpath");d.style.cssText= "v-text-align:"+e;d.style.align=e;d.style.fontFamily=k.fontFamily;d.string=b;d.on="true";e=k.fontSize*k.scale/this.vmlScale;d.style.fontSize=e+"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");b=b.split("\n");k=e+(b.length-1)*e*mxConstants.LINE_HEIGHT;e=b=0; g==mxConstants.ALIGN_BOTTOM?e=-k/2:g!=mxConstants.ALIGN_MIDDLE&&(e=k/2);null!=p&&(f.style.rotation=p,g=p*(Math.PI/180),b=Math.sin(g)*e,e*=Math.cos(g));f.appendChild(d);f.style.left=this.format(a-b)+"px";f.style.top=this.format(c+e)+"px";this.root.appendChild(f)};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,c){this.graph=a;this.setStates(c)}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,c,f){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=c){var d=this.graph.getView().translate,b=this.graph.getView().scale,e=c.x,g=c.y,k=!1,l=null,n=null,m=!1,p=null,s=null,t=this.getGuideTolerance(),q=t,v=t,t=a.clone();t.x+=c.x;t.y+=c.y;var u=t.x,x=t.x+t.width,A=t.getCenterX(),y=t.y,z=t.y+t.height,D=t.getCenterY();c=function(b,d){b+=this.graph.panDx;var c=!1;Math.abs(b-A)this.opacity&&(c+="alpha(opacity\x3d"+this.opacity+")");this.isShadow&&(c+="progid:DXImageTransform.Microsoft.dropShadow (OffX\x3d'"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY\x3d'"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color\x3d'"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var f=this.fill,d=this.gradient,b="0",e={east:0, south:1,west:2,north:3},g=null!=this.direction?e[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+e[this.gradientDirection]-1,4));1==g?(b="1",e=f,f=d,d=e):2==g?(e=f,f=d,d=e):3==g&&(b="1");c+="progid:DXImageTransform.Microsoft.gradient(startColorStr\x3d'"+f+"', endColorStr\x3d'"+d+"', gradientType\x3d'"+b+"')"}a.style.filter=c}; mxShape.prototype.updateHtmlColors=function(a){var c=this.stroke;null!=c&&c!=mxConstants.NONE?(a.style.borderColor=c,this.isDashed?a.style.borderStyle="dashed":0=document.documentMode)?this.updateHtmlFilter():this.updateHtmlTransform(),this.updateBoundingBox();else{var a=this.createCanvas(); null!=a&&null!=a.updateText&&null!=a.invalidateCachedOffsetSize?(this.paint(a,!0),this.destroyCanvas(a),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null}; mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.color="black";this.align=mxConstants.ALIGN_CENTER;this.valign=mxConstants.ALIGN_MIDDLE;this.family=mxConstants.DEFAULT_FONTFAMILY;this.size=mxConstants.DEFAULT_FONTSIZE;this.fontStyle=mxConstants.DEFAULT_FONTSTYLE;this.spacing=2;this.spacingLeft=this.spacingBottom=this.spacingRight=this.spacingTop=0;this.horizontal=!0;delete this.background;delete this.border;this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION; delete this.margin}; mxText.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign= mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.spacingTop=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop)+this.spacing,this.spacingRight=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight)+this.spacing,this.spacingBottom=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom)+this.spacing,this.spacingLeft=mxUtils.getValue(this.style, mxConstants.STYLE_SPACING_LEFT,this.spacingLeft)+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY, 100),this.updateMargin());this.flipH=this.flipV=null};mxText.prototype.getAutoDirection=function(){var a=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=a&&0=document.documentMode)?this.updateHtmlFilter():this.updateHtmlTransform()}; mxText.prototype.updateHtmlTransform=function(){var a=this.getTextRotation(),c=this.node.style,f=this.margin.x,d=this.margin.y;0!=a?(mxUtils.setPrefixedStyle(c,"transformOrigin",100*-f+"% "+100*-d+"%"),mxUtils.setPrefixedStyle(c,"transform","translate("+100*f+"%,"+100*d+"%)scale("+this.scale+") rotate("+a+"deg)")):(mxUtils.setPrefixedStyle(c,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(c,"transform","scale("+this.scale+")translate("+100*f+"%,"+100*d+"%)"));c.left=Math.round(this.bounds.x-Math.ceil(f* ("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px";c.top=Math.round(this.bounds.y-d*("fill"!=this.overflow?3:1))+"px";c.opacity=100>this.opacity?this.opacity/100:""}; mxText.prototype.updateInnerHtml=function(a){if(mxUtils.isNode(this.value))a.innerHTML=this.value.outerHTML;else{var c=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(c=mxUtils.htmlEntities(c,!1));c=mxUtils.replaceTrailingNewlines(c,"\x3cdiv\x3e\x26nbsp;\x3c/div\x3e");c=this.replaceLinefeeds?c.replace(/\n/g,"\x3cbr/\x3e"):c;a.innerHTML='\x3cdiv style\x3d"display:inline-block;_display:inline;"\x3e'+c+"\x3c/div\x3e"}}; mxText.prototype.updateHtmlFilter=function(){var a=this.node.style,c=this.margin.x,f=this.margin.y,d=this.scale;mxUtils.setOpacity(this.node,this.opacity);var b=0,e=0,g=null!=this.state?this.state.view.textDiv:null,k=this.node;if(null!=g){g.style.overflow="";g.style.height="";g.style.width="";this.updateFont(g);this.updateSize(g,!1);this.updateInnerHtml(g);var l=Math.round(this.bounds.width/this.scale);this.wrap&&0n&&(n+=2*Math.PI);n%=Math.PI;n>Math.PI/2&&(n=Math.PI-n);var k=Math.cos(n),m=Math.sin(-n),c=l*-(c+0.5),p=g*-(f+0.5),s=(g-g*k+l*m)/2+e*c-b*p;0!=n&&(f="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+b+", M12\x3d"+e+", M21\x3d"+-e+", M22\x3d"+b+", sizingMethod\x3d'auto expand')",a.filter=null!=a.filter&&0=document.documentMode)&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;c=100>this.opacity?"alpha(opacity\x3d"+this.opacity+")":"";this.node.style.filter=c;this.flipH&&this.flipV?c+="progid:DXImageTransform.Microsoft.BasicImage(rotation\x3d2)":this.flipH?c+="progid:DXImageTransform.Microsoft.BasicImage(mirror\x3d1)": this.flipV&&(c+="progid:DXImageTransform.Microsoft.BasicImage(rotation\x3d2, mirror\x3d1)");a.style.filter!=c&&(a.style.filter=c);"image"==a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)}; function mxLabel(a,c,f,d){mxRectangleShape.call(this,a,c,f,d)}mxUtils.extend(mxLabel,mxRectangleShape);mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(a){mxShape.prototype.init.apply(this,arguments);null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))}; mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection);mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; mxLabel.prototype.paintForeground=function(a,c,f,d,b){this.paintImage(a,c,f,d,b);this.paintIndicator(a,c,f,d,b);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(a,c,f,d,b){null!=this.image&&(c=this.getImageBounds(c,f,d,b),a.image(c.x,c.y,c.width,c.height,this.image,!1,!1,!1))}; mxLabel.prototype.getImageBounds=function(a,c,f,d){var b=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),k=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;a=b==mxConstants.ALIGN_CENTER? a+(f-g)/2:b==mxConstants.ALIGN_RIGHT?a+(f-g-l):a+l;c=e==mxConstants.ALIGN_TOP?c+l:e==mxConstants.ALIGN_BOTTOM?c+(d-k-l):c+(d-k)/2;return new mxRectangle(a,c,g,k)};mxLabel.prototype.paintIndicator=function(a,c,f,d,b){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(c,f,d,b),this.indicator.paint(a)):null!=this.indicatorImage&&(c=this.getIndicatorBounds(c,f,d,b),a.image(c.x,c.y,c.width,c.height,this.indicatorImage,!1,!1,!1))}; mxLabel.prototype.getIndicatorBounds=function(a,c,f,d){var b=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),k=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;a=b==mxConstants.ALIGN_RIGHT?a+(f-g-l):b==mxConstants.ALIGN_CENTER?a+(f-g)/ 2:a+l;c=e==mxConstants.ALIGN_BOTTOM?c+(d-k-l):e==mxConstants.ALIGN_TOP?c+l:c+(d-k)/2;return new mxRectangle(a,c,g,k)}; mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var a=document.createElement("img");a.style.position="relative";a.setAttribute("border","0");var c=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);c.x-=this.bounds.x;c.y-=this.bounds.y;a.style.left=Math.round(c.x)+"px";a.style.top=Math.round(c.y)+"px";a.style.width= Math.round(c.width)+"px";a.style.height=Math.round(c.height)+"px";a.src=this.image;this.node.appendChild(a)}};function mxCylinder(a,c,f,d){mxShape.call(this);this.bounds=a;this.fill=c;this.stroke=f;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCylinder,mxShape);mxCylinder.prototype.maxHeight=40;mxCylinder.prototype.svgStrokeTolerance=0; mxCylinder.prototype.paintVertexShape=function(a,c,f,d,b){a.translate(c,f);a.begin();this.redrawPath(a,c,f,d,b,!1);a.fillAndStroke();a.setShadow(!1);a.begin();this.redrawPath(a,c,f,d,b,!0);a.stroke()}; mxCylinder.prototype.redrawPath=function(a,c,f,d,b,e){c=Math.min(this.maxHeight,Math.round(b/5));if(e&&null!=this.fill||!e&&null==this.fill)a.moveTo(0,c),a.curveTo(0,2*c,d,2*c,d,c),e||(a.stroke(),a.begin());e||(a.moveTo(0,c),a.curveTo(0,-c/3,d,-c/3,d,c),a.lineTo(d,b-c),a.curveTo(d,b+c/3,0,b+c/3,0,b-c),a.close())};function mxConnector(a,c,f){mxPolyline.call(this,a,c,f)}mxUtils.extend(mxConnector,mxPolyline); mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED];mxShape.prototype.updateBoundingBox.apply(this,arguments)};mxConnector.prototype.paintEdgeShape=function(a,c){var f=this.createMarker(a,c,!0),d=this.createMarker(a,c,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);a.setFillColor(this.stroke);a.setShadow(!1);a.setDashed(!1);null!=f&&f();null!=d&&d()}; mxConnector.prototype.createMarker=function(a,c,f){var d=null,b=c.length,e=mxUtils.getValue(this.style,f?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),g=f?c[1]:c[b-2],k=f?c[0]:c[b-1];if(null!=e&&null!=g&&null!=k){for(d=1;d=b)&&a.close(),a.fillAndStroke(),e=d)&&a.close(), a.fillAndStroke(),e=b)&&a.close(),a.fillAndStroke(),e=d)&&a.close(),a.fillAndStroke(),ec)break;k=f}e=b.getIndex(a);e=Math.max(0,g-(g>e?1:0));d.add(b,a,e)}}; mxStackLayout.prototype.getParentSize=function(a){var c=this.graph.getModel(),f=c.getGeometry(a);if(null!=this.graph.container&&(null==f&&c.isLayer(a)||a==this.graph.getView().currentRoot))f=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1);return f}; mxStackLayout.prototype.execute=function(a){if(null!=a){var c=this.getParentSize(a),f=this.isHorizontal(),d=this.graph.getModel(),b=null;null!=c&&(b=f?c.height-this.marginTop-this.marginBottom:c.width-this.marginLeft-this.marginRight);var b=b-(2*this.spacing+2*this.border),e=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!=c&&(l=k?Math.min(l,c.height):Math.min(l,c.width));f==k&&(b-=l);k?g+=l:e+=l}d.beginUpdate();try{for(var l=0,k=null,n=0,m=null,p=d.getChildCount(a),s=0;sthis.wrap||!f&&k.y+k.height+q.height+2*this.spacing>this.wrap))k=null,f?g+=l+this.spacing:e+=l+this.spacing,l= 0;var l=Math.max(l,f?q.height:q.width),v=0;if(!this.borderCollapse)var u=this.graph.getCellStyle(t),v=mxUtils.getNumber(u,mxConstants.STYLE_STROKEWIDTH,1);null!=k?f?q.x=n+this.spacing+Math.floor(v/2):q.y=n+this.spacing+Math.floor(v/2):this.keepFirstLocation||(f?q.x=e:q.y=g);f?q.y=g:q.x=e;this.fill&&null!=b&&(f?q.height=b:q.width=b);this.setChildGeometry(t,q);m=t;k=q;n=f?k.x+k.width+Math.floor(v/2):k.y+k.height+Math.floor(v/2)}}}this.resizeParent&&null!=c&&null!=k&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a, c,k):this.resizeLast&&null!=c&&(null!=k&&null!=m)&&(f?k.width=c.width-k.x-this.spacing-this.marginRight-this.marginLeft:k.height=c.height-k.y-this.spacing-this.marginBottom,this.setChildGeometry(m,k))}finally{d.endUpdate()}}};mxStackLayout.prototype.setChildGeometry=function(a,c){var f=this.graph.getCellGeometry(a);(null==f||c.x!=f.x||c.y!=f.y||c.width!=f.width||c.height!=f.height)&&this.graph.getModel().setGeometry(a,c)}; mxStackLayout.prototype.updateParentGeometry=function(a,c,f){var d=this.isHorizontal(),b=this.graph.getModel(),e=c.clone();d?(f=f.x+f.width+this.spacing+this.marginRight,e.width=this.resizeParentMax?Math.max(e.width,f):f):(f=f.y+f.height+this.spacing+this.marginBottom,e.height=this.resizeParentMax?Math.max(e.height,f):f);(c.x!=e.x||c.y!=e.y||c.width!=e.width||c.height!=e.height)&&b.setGeometry(a,e)}; function mxPartitionLayout(a,c,f,d){mxGraphLayout.call(this,a);this.horizontal=null!=c?c:!0;this.spacing=f||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,c,f){f=this.graph.getModel();var d=f.getParent(a);if(null!=a&&null!=d){for(var b=0,e=0,g=f.getChildCount(d),b=0;bc)break;e=k}}c=d.getIndex(a);c=Math.max(0,b-(b>c?1:0));f.add(d,a,c)}}; mxPartitionLayout.prototype.execute=function(a){var c=this.isHorizontal(),f=this.graph.getModel(),d=f.getGeometry(a);if(null!=this.graph.container&&(null==d&&f.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 b=[],e=f.getChildCount(a),g=0;gk.x&&(b=Math.abs(g-k.x));0>k.y&&(l=Math.abs(d-k.y));(0!=b||0!=l)&&this.moveNode(this.node,b,l);this.resizeParent&&this.adjustParents();this.edgeRouting&&this.localEdgeProcessing(this.node)}null!=this.parentX&&null!=this.parentY&&(e=this.graph.getCellGeometry(a),null!=e&&(e=e.clone(),e.x=this.parentX,e.y=this.parentY,f.setGeometry(a,e)))}}finally{f.endUpdate()}}}; mxCompactTreeLayout.prototype.moveNode=function(a,c,f){a.x+=c;a.y+=f;this.apply(a);for(a=a.child;null!=a;)this.moveNode(a,c,f),a=a.next}; mxCompactTreeLayout.prototype.sortOutgoingEdges=function(a,c){var f=new mxDictionary;c.sort(function(d,b){var e=d.getTerminal(d.getTerminal(!1)==a),c=f.get(e);null==c&&(c=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),f.put(e,c));var e=b.getTerminal(b.getTerminal(!1)==a),k=f.get(e);null==k&&(k=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),f.put(e,k));return mxCellPath.compare(c,k)})}; mxCompactTreeLayout.prototype.findRankHeights=function(a,c){if(null==this.maxRankHeight[c]||this.maxRankHeight[c]a.height&&(a.height=this.maxRankHeight[c]);for(var f=a.child;null!=f;)this.setCellHeights(f,c+1),f=f.next}; mxCompactTreeLayout.prototype.dfs=function(a,c){var f=mxCellPath.create(a),d=null;if(null!=a&&null==this.visited[f]&&!this.isVertexIgnored(a)){this.visited[f]=a;var d=this.createNode(a),f=this.graph.getModel(),b=null,e=this.graph.getEdges(a,c,this.invert,!this.invert,!1,!0),g=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(a,e);for(var k=0;k=a+f)return 0;g=0a?a*d/f-c:0a+f?(f+a)*e/b-(c+d):e-(c+d);return 0g+2*this.prefHozEdgeSep&&(e-=2*this.prefHozEdgeSep);a=e/d;c=a/2;e>g+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep);for(var e=this.minEdgeJetty-this.prefVertEdgeOff,g=0,k=this.getVertexBounds(f),l=0;ld/2&&(e-=this.prefVertEdgeOff);c+=a;g=Math.max(g,e)}}; function WeightedCellSorter(a,c){this.cell=a;this.weightedValue=c}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,c){return null!=a&&null!=c?c.weightedValue>a.weightedValue?1:c.weightedValued.theta&&bthis.forceConstant&&(this.forceConstant= 0.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;dc&&(c=0.001);var f=this.dispX[a]/c*Math.min(c,this.temperature),c=this.dispY[a]/c*Math.min(c,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=f;this.cellLocation[a][1]+=c}}; mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;athis.maxDistanceLimit||(ga?a+"-"+f:f+"-"+a):null}; mxParallelEdgeLayout.prototype.layout=function(a){var c=a[0],f=this.graph.getView(),d=this.graph.getModel(),b=d.getGeometry(f.getVisibleTerminal(c,!0)),d=d.getGeometry(f.getVisibleTerminal(c,!1));if(b==d)for(var c=b.x+b.width+this.spacing,f=b.y+b.height/2,e=0;emxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}f[d].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null;mxGraphHierarchyModel.prototype.vertexMapper=null;mxGraphHierarchyModel.prototype.edgeMapper=null;mxGraphHierarchyModel.prototype.ranks=null;mxGraphHierarchyModel.prototype.roots=null;mxGraphHierarchyModel.prototype.parent=null; mxGraphHierarchyModel.prototype.dfsCount=0;mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1E8;mxGraphHierarchyModel.prototype.tightenToSource=!1; mxGraphHierarchyModel.prototype.createInternalCells=function(a,c,f){for(var d=a.getGraph(),b=0;b=l.length){for(var k= new mxGraphHierarchyEdge(l),n=0;nmxUtils.indexOf(f[b].connectsAsSource,k)&&f[b].connectsAsSource.push(k)}}}f[b].temp[0]=0}}; mxGraphHierarchyModel.prototype.initialRank=function(){var a=[];if(null!=this.roots)for(var c=0;cd.maxRank&&0>d.minRank&&(a[d.temp[0]].push(d),d.maxRank=d.temp[0],d.minRank=d.temp[0],d.temp[0]=a[d.maxRank].length-1);if(null!=b&&null!=c&&1mxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}f[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,c,f){for(var d=a.getGraph(),b=a.swimlanes,e=0;e=n.length){for(var l=new mxGraphHierarchyEdge(n),m=0;mmxUtils.indexOf(f[e].connectsAsSource,l)&&f[e].connectsAsSource.push(l)}}}f[e].temp[0]=0}}; mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var a=[],c={};if(null!=this.roots)for(var f=0;fc[d.swimlaneIndex]&&(k=c[d.swimlaneIndex]);d.temp[0]=k;if(null!=e)for(f=0;fd.maxRank&&0>d.minRank&&(a[d.temp[0]].push(d),d.maxRank=d.temp[0],d.minRank=d.temp[0],d.temp[0]=a[d.maxRank].length-1);if(null!=b&&null!=c&&1>1,++b[l]}return f}; mxMedianHybridCrossingReduction.prototype.transpose=function(a,c){for(var f=!0,d=0;f&&10>d++;)for(var b=1==a%2&&1==d%2,f=!1,e=0;em&&(m=l);k[m]=n}for(var p=null,s=null,t=null,q=null,v=null,u=null,x=null,A=null,l=0;lv[B]&&z++,t[y]u[B]&&z++,q[y]a.medianValue?-1:c.medianValueu+1&&(n==d[l].length-1?(b.setGeneralPurposeVariable(l,x),p=!0):(n=d[l][n+1],u=n.getGeneralPurposeVariable(l),u=u-n.width/2-this.intraCellSpacing-b.width/2,u>x?(b.setGeneralPurposeVariable(l, x),p=!0):u>b.getGeneralPurposeVariable(l)+1&&(b.setGeneralPurposeVariable(l,u),p=!0)));if(p){for(b=0;b=k&&l<=s?g.setGeneralPurposeVariable(a,l):ls&&(g.setGeneralPurposeVariable(a,s),this.currentXDelta+=l-s);d[e].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,c){for(var f=0,d=0;dthis.widestRankValue&&(this.widestRankValue=k,this.widestRank=b);this.rankWidths[b]=k}!0==l&&mxLog.warn("At least one cell has no bounds");this.rankY[b]=f;k=e/2+d/2+this.interRankCellSpacing;d=e;f=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?f+k:f- k;for(n=0;nb.maxRank-b.minRank-1)){for(var e=b.getGeneralPurposeVariable(b.minRank+1),g=!0,k=0,l=b.minRank+2;lb.minRank+1;l--)s=b.getX(l-1),p==s?(m[l-b.minRank-2]=p,g++):this.repositionValid(c,b,l-1,p)?(m[l-b.minRank-2]=p,g++):(m[l-b.minRank-2]=b.getX(l-1),p=s);if(g>k||e>k)if(g>=e)for(l=b.maxRank-2;l>b.minRank;l--)b.setX(l,m[l-b.minRank-1]);else if(e>g)for(l=b.minRank+2;lb)return!1;e=c.getGeneralPurposeVariable(f);if(de){if(b==a.length-1)return!0;a=a[b+1];f=a.getGeneralPurposeVariable(f);f=f-a.width/2-this.intraCellSpacing-c.width/2;if(!(f>=d))return!1}return!0}; mxCoordinateAssignment.prototype.setCellLocations=function(a,c){this.rankTopY=[];this.rankBottomY=[];for(var f=0;fk;k++){if(-1(e+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(m+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);l=(p-m)/e;m+=l/2;p=this.minEdgeJetty-this.prefVertEdgeOff;for(n=s=0;ne/2&&(p-=this.prefVertEdgeOff);for(v=0;va.weightedValue?-1:c.weightedValuee&&(e=l,b=k)}}0==f.length&&null!=b&&f.push(b)}return f}; mxHierarchicalLayout.prototype.getEdges=function(a){var c=this.edgesCache.get(a);if(null!=c)return c;for(var f=this.graph.model,c=[],d=this.graph.isCellCollapsed(a),b=f.getChildCount(a),e=0;ec.length)){null==a&&(a=f.getParent(c[0]));this.parentY=this.parentX=null;if(a!=this.root&&null!=f.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}this.swimlanes=c;this.dummyVertices=[];for(var b=0;be&&(e=l,b=k)}}0==f.length&&null!=b&&f.push(b)}return f}; mxSwimlaneLayout.prototype.getEdges=function(a){var c=this.edgesCache.get(a);if(null!=c)return c;for(var f=this.graph.model,c=[],d=this.graph.isCellCollapsed(a),b=f.getChildCount(a),e=0;e=this.swimlanes.length)&&(s>k||(!c||p)&&s==k))b= this.traverse(m,c,n[f],d,b,e,g,s)}}else if(null==b[l])for(f=0;fmxUtils.indexOf(this.edges,a)))null==this.edges&&(this.edges=[]),this.edges.push(a);return a};mxCell.prototype.removeEdge=function(a,c){if(null!=a){if(a.getTerminal(!c)!=this&&null!=this.edges){var f=this.getEdgeIndex(a);0<=f&&this.edges.splice(f,1)}a.setTerminal(null,c)}return a}; mxCell.prototype.removeFromTerminal=function(a){var c=this.getTerminal(a);null!=c&&c.removeEdge(this,a)};mxCell.prototype.hasAttribute=function(a){var c=this.getValue();return null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT&&c.hasAttribute?c.hasAttribute(a):null!=c.getAttribute(a)};mxCell.prototype.getAttribute=function(a,c){var f=this.getValue();return(null!=f&&f.nodeType==mxConstants.NODETYPE_ELEMENT?f.getAttribute(a):null)||c}; mxCell.prototype.setAttribute=function(a,c){var f=this.getValue();null!=f&&f.nodeType==mxConstants.NODETYPE_ELEMENT&&f.setAttribute(a,c)};mxCell.prototype.clone=function(){var a=mxUtils.clone(this,this.mxTransient);a.setValue(this.cloneValue());return a};mxCell.prototype.cloneValue=function(){var a=this.getValue();null!=a&&("function"==typeof a.clone?a=a.clone():isNaN(a.nodeType)||(a=a.cloneNode(!0)));return a};function mxGeometry(a,c,f,d){mxRectangle.call(this,a,c,f,d)}mxGeometry.prototype=new mxRectangle; mxGeometry.prototype.constructor=mxGeometry;mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0;mxGeometry.prototype.alternateBounds=null;mxGeometry.prototype.sourcePoint=null;mxGeometry.prototype.targetPoint=null;mxGeometry.prototype.points=null;mxGeometry.prototype.offset=null;mxGeometry.prototype.relative=!1; mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var a=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x;this.y=this.alternateBounds.y;this.width=this.alternateBounds.width;this.height=this.alternateBounds.height;this.alternateBounds=a}};mxGeometry.prototype.getTerminalPoint=function(a){return a?this.sourcePoint:this.targetPoint};mxGeometry.prototype.setTerminalPoint=function(a,c){c?this.sourcePoint=a:this.targetPoint=a;return a}; mxGeometry.prototype.rotate=function(a,c){var f=mxUtils.toRadians(a),d=Math.cos(f),f=Math.sin(f);if(!this.relative){var b=new mxPoint(this.getCenterX(),this.getCenterY()),b=mxUtils.getRotatedPoint(b,d,f,c);this.x=Math.round(b.x-this.width/2);this.y=Math.round(b.y-this.height/2)}null!=this.sourcePoint&&(b=mxUtils.getRotatedPoint(this.sourcePoint,d,f,c),this.sourcePoint.x=Math.round(b.x),this.sourcePoint.y=Math.round(b.y));null!=this.targetPoint&&(b=mxUtils.getRotatedPoint(this.targetPoint,d,f,c),this.targetPoint.x= Math.round(b.x),this.targetPoint.y=Math.round(b.y));if(null!=this.points)for(var e=0;ec[b]?1:-1:(f=parseInt(a[b]),b=parseInt(c[b]),d=f==b?0:f>b?1:-1);break}0==d&&(f=a.length,b=c.length,f!=b&&(d=f>b?1:-1));return d}},mxPerimeter={RectanglePerimeter:function(a,c,f,d){c=a.getCenterX();var b=a.getCenterY(),e=Math.atan2(f.y-b,f.x-c),g=new mxPoint(0,0),k=Math.PI,l=Math.PI/2-e,n=Math.atan2(a.height,a.width);e<-k+n||e>k-n?(g.x=a.x,g.y=b-a.width* Math.tan(e)/2):e<-n?(g.y=a.y,g.x=c-a.height*Math.tan(l)/2):e=a.x&&f.x<=a.x+a.width?g.x=f.x:f.y>=a.y&&f.y<=a.y+a.height&&(g.y=f.y),f.xa.x+a.width&&(g.x=a.x+a.width),f.ya.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,c,f,d){var b=a.x,e=a.y,g=a.width/2,k=a.height/2,l=b+g,n=e+k;c=f.x;f=f.y;var m=parseInt(c-l),p=parseInt(f-n);if(0==m&&0!=p)return new mxPoint(l, n+k*p/Math.abs(p));if(0==m&&0==p)return new mxPoint(c,f);if(d){if(f>=e&&f<=e+a.height)return a=f-n,a=Math.sqrt(g*g*(1-a*a/(k*k)))||0,c<=b&&(a=-a),new mxPoint(l+a,f);if(c>=b&&c<=b+a.width)return a=c-l,a=Math.sqrt(k*k*(1-a*a/(g*g)))||0,f<=e&&(a=-a),new mxPoint(c,n+a)}b=p/m;n-=b*l;e=g*g*b*b+k*k;a=-2*l*e;k=Math.sqrt(a*a-4*e*(g*g*b*b*l*l+k*k*l*l-g*g*k*k));g=(-a+k)/(2*e);k=(-a-k)/(2*e);l=b*g+n;n=b*k+n;b=Math.sqrt(Math.pow(g-c,2)+Math.pow(l-f,2));c=Math.sqrt(Math.pow(k-c,2)+Math.pow(n-f,2));e=f=0;bf?new mxPoint(g,b):new mxPoint(g,b+a);if(k==f)return g>l?new mxPoint(c,k):new mxPoint(c+e,k);var n=g,m=k;d&&(l>=c&&l<=c+e?n=l:f>=b&&f<=b+a&&(m=f));return l-v&&tMath.PI-v,v=null;q?v=d&&(b&&f.x>=m.x&&f.x<=s.x||!b&&f.y>=m.y&&f.y<=s.y)?b?new mxPoint(f.x,m.y):new mxPoint(m.x,f.y):c==mxConstants.DIRECTION_NORTH?new mxPoint(e+k/2+a*Math.tan(t)/2,g+a):c==mxConstants.DIRECTION_SOUTH?new mxPoint(e+k/2-a*Math.tan(t)/2,g):c==mxConstants.DIRECTION_WEST?new mxPoint(e+k,g+a/2+k*Math.tan(t)/2):new mxPoint(e, g+a/2-k*Math.tan(t)/2):(d&&(d=new mxPoint(l,n),f.y>=g&&f.y<=g+a?(d.x=b?l:c==mxConstants.DIRECTION_WEST?e+k:e,d.y=f.y):f.x>=e&&f.x<=e+k&&(d.x=f.x,d.y=!b?n:c==mxConstants.DIRECTION_NORTH?g+a:g),l=d.x,n=d.y),v=b&&f.x<=e+k/2||!b&&f.y<=g+a/2?mxUtils.intersection(f.x,f.y,l,n,m.x,m.y,p.x,p.y):mxUtils.intersection(f.x,f.y,l,n,p.x,p.y,s.x,s.y));null==v&&(v=new mxPoint(l,n));return v},HexagonPerimeter:function(a,c,f,d){var b=a.x,e=a.y,g=a.width,k=a.height,l=a.getCenterX();a=a.getCenterY();var n=f.x,m=f.y,p= -Math.atan2(m-a,n-l),s=Math.PI,t=Math.PI/2,q=new mxPoint(l,a);c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var v=c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH;c=new mxPoint;q=new mxPoint;if(ne+k||n>b+g&&mb+g&&m>e+k)d=!1;if(d){if(v){if(n==l){if(m<=e)return new mxPoint(l,e);if(m>=e+k)return new mxPoint(l,e+k)}else if(nb+g){if(m==e+k/4)return new mxPoint(b+g,e+k/4);if(m==e+3*k/4)return new mxPoint(b+g,e+3*k/4)}else if(n==b){if(ma)return new mxPoint(b,e+3*k/4)}else if(n==b+g){if(ma)return new mxPoint(b+g,e+3*k/4)}if(m==e)return new mxPoint(l,e);if(m==e+k)return new mxPoint(l,e+k);ne+k/4&&me+3*k/4&&(c=new mxPoint(b-Math.floor(0.5*g),e+Math.floor(0.5*k)),q=new mxPoint(b+g,e+Math.floor(1.25*k))):n>l&&(m>e+k/4&&me+3*k/4&&(c=new mxPoint(b+Math.floor(1.5*g),e+Math.floor(0.5*k)),q=new mxPoint(b,e+Math.floor(1.25*k))))}else{if(m==a){if(n<=b)return new mxPoint(b,e+k/2);if(n>=b+g)return new mxPoint(b+g,e+k/ 2)}else if(me+k){if(n==b+g/4)return new mxPoint(b+g/4,e+k);if(n==b+3*g/4)return new mxPoint(b+3*g/4,e+k)}else if(m==e){if(nl)return new mxPoint(b+3*g/4,e)}else if(m==e+k){if(na)return new mxPoint(b+3*g/4,e+k)}if(n==b)return new mxPoint(b,a);if(n==b+g)return new mxPoint(b+g,a);mb+g/4&&nb+3*g/4&&(c=new mxPoint(b+Math.floor(0.5*g),e-Math.floor(0.5*k)),q=new mxPoint(b+Math.floor(1.25*g),e+k)):m>a&&(n>b+g/4&&nb+3*g/4&&(c=new mxPoint(b+Math.floor(0.5*g),e+Math.floor(1.5*k)),q=new mxPoint(b+Math.floor(1.25*g),e)))}d= l;p=a;n>=b&&n<=b+g?(d=n,p=m=e&&m<=e+k&&(p=m,d=n-n?(c=new mxPoint(b+g,e), q=new mxPoint(b+g,e+k)):p>n&&pt&&ps-n&&p<=s||p<-s+n&&p>=-s?(c=new mxPoint(b,e),q=new mxPoint(b,e+k)):p<-n&&p>-t?(c=new mxPoint(b+Math.floor(1.5*g),e+Math.floor(0.5*k)),q=new mxPoint(b,e+Math.floor(1.25*k))):p<-t&&p>-s+n&&(c=new mxPoint(b-Math.floor(0.5*g),e+Math.floor(0.5*k)),q=new mxPoint(b+g,e+ Math.floor(1.25*k)))}else{n=Math.atan2(k/2,g/4);if(p==n)return new mxPoint(b+Math.floor(0.75*g),e);if(p==s-n)return new mxPoint(b+Math.floor(0.25*g),e);if(p==s||p==-s)return new mxPoint(b,e+Math.floor(0.5*k));if(0==p)return new mxPoint(b+g,e+Math.floor(0.5*k));if(p==-n)return new mxPoint(b+Math.floor(0.75*g),e+k);if(p==-s+n)return new mxPoint(b+Math.floor(0.25*g),e+k);0n&&ps-n&&pp&&p>-n?(c=new mxPoint(b+Math.floor(0.5*g),e+Math.floor(1.5*k)),q=new mxPoint(b+Math.floor(1.25*g),e)):p<-n&&p>-s+n?(c=new mxPoint(b,e+k),q=new mxPoint(b+g,e+k)):p<-s+n&&p>-s&&(c=new mxPoint(b-Math.floor(0.25*g),e),q=new mxPoint(b+Math.floor(0.5*g),e+Math.floor(1.5*k)))}q=mxUtils.intersection(l,a,f.x,f.y,c.x,c.y,q.x,q.y)}return null==q?new mxPoint(l,a):q}}; function mxPrintPreview(a,c,f,d,b,e,g,k,l){this.graph=a;this.scale=null!=c?c:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=mxRectangle.fromRectangle(null!=f?f:a.pageFormat);this.title=null!=k?k:"Printer-friendly version";this.x0=null!=b?b:0;this.y0=null!=e?e: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':8b&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):(this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="");8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");a=this.textarea.scrollWidth;b=this.textarea.scrollHeight; 8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-d.x*(this.bounds.width-(a+1)*f)+0*a*(f-1)+2*(d.x+0.5))/f))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-d.y*(this.bounds.height-(b+0.5)*f)+0*b*(f-1)+1*Math.abs(d.y+0.5))/f))+"px",this.textarea.style.width=Math.round(a*f)+"px",this.textarea.style.height=Math.round(b*f)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-d.x*(this.bounds.width-(a+1)*f)+0*a*(f- 1)+2*(d.x+0.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-d.y*(this.bounds.height-(b+0.5)*f)+0*b*(f-1)+1*Math.abs(d.y+0.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-d.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-d.y*(this.bounds.height-4)+(-1==d.y?3:0))+1)+"px")}mxClient.IS_VML?this.textarea.style.zoom=f:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style, "transform","scale("+f+","+f+")"+(null==d?"":" translate("+100*d.x+"%,"+100*d.y+"%)")))}};mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())};mxCellEditor.prototype.getBackgroundColor=function(a){return null}; mxCellEditor.prototype.startEditing=function(a,c){this.stopEditing(!0);null==this.textarea&&this.init();null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var f=this.graph.getView().getState(a);if(null!=f){this.graph.getView();var d=mxUtils.getValue(f.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),b=mxUtils.getValue(f.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),e=mxUtils.getValue(f.style,mxConstants.STYLE_FONTCOLOR,"black"),g=mxUtils.getValue(f.style, mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),k=(mxUtils.getValue(f.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(f.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,n=(mxUtils.getValue(f.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT; this.textarea.style.backgroundColor=this.getBackgroundColor(f);this.textarea.style.textDecoration=n?"underline":"";this.textarea.style.fontWeight=k?"bold":"normal";this.textarea.style.fontStyle=l?"italic":"";this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.zIndex=this.zIndex;this.textarea.style.fontFamily=b;this.textarea.style.textAlign=g;this.textarea.style.outline="none";this.textarea.style.color=e;d=this.textDirection=mxUtils.getValue(f.style,mxConstants.STYLE_TEXT_DIRECTION, mxConstants.DEFAULT_TEXT_DIRECTION);d==mxConstants.TEXT_DIRECTION_AUTO&&null!=f&&null!=f.text&&(f.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(f.text.value))&&(d=f.text.getAutoDirection());d==mxConstants.TEXT_DIRECTION_LTR||d==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",d):this.textarea.removeAttribute("dir");this.textarea.innerHTML=this.getInitialValue(f,c)||"";this.initialValue=this.textarea.innerHTML;0==this.textarea.innerHTML.length||"\x3cbr\x3e"==this.textarea.innerHTML? (this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText();this.graph.container.appendChild(this.textarea);this.editingCell=a;this.trigger=c;this.textNode=null;null!=f.text&&this.isHideLabel(f)&&(this.textNode=f.text.node,this.textNode.style.visibility="hidden");this.autoSize&&(this.graph.model.isEdge(f.cell)||"fill"!=f.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}), 0);this.resize();try{this.textarea.focus(),this.isSelectText()&&0=l.x:null!=f&&(k=f.x+f.width=a.x:null!=c&&(l=c.x+c.widthc.x+c.width?null!=f?(d=f.x,n=Math.max(Math.abs(l-f.y),n)):a==mxConstants.DIRECTION_NORTH? l=c.y-2*k:a==mxConstants.DIRECTION_SOUTH?l=c.y+c.height+2*k:d=a==mxConstants.DIRECTION_EAST?c.x-2*n:c.x+c.width+2*n:null!=f&&(d=e.getRoutingCenterX(c),k=Math.max(Math.abs(d-f.x),n),l=f.y,n=0);b.push(new mxPoint(d-k,l-n));b.push(new mxPoint(d+k,l+n))}},ElbowConnector:function(a,c,f,d,b){var e=null!=d&&0m,k=e.xn;else l=Math.max(c.x,f.x),n=Math.min(c.x+c.width,f.x+f.width),(g=l==n)||(k=Math.max(c.y,f.y),m=Math.min(c.y+c.height,f.y+f.height),k=k==m);!k&&(g||a.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)?mxEdgeStyle.TopToBottom(a,c,f,d,b):mxEdgeStyle.SideToSide(a,c,f,d,b)},SideToSide:function(a,c,f,d,b){var e=a.view;d=null!=d&&0=c.y&&d.y<=c.y+c.height&&(k=d.y),d.y>=f.y&&d.y<=f.y+f.height&&(e=d.y)),!mxUtils.contains(f,a,k)&&!mxUtils.contains(c,a,k)&&b.push(new mxPoint(a,k)),!mxUtils.contains(f,a,e)&&!mxUtils.contains(c,a,e)&&b.push(new mxPoint(a,e)),1==b.length&&(null!=d?!mxUtils.contains(f, a,d.y)&&!mxUtils.contains(c,a,d.y)&&b.push(new mxPoint(a,d.y)):(e=Math.max(c.y,f.y),c=Math.min(c.y+c.height,f.y+f.height),b.push(new mxPoint(a,e+(c-e)/2)))))},TopToBottom:function(a,c,f,d,b){var e=a.view;d=null!=d&&0=c.x&&d.x<=c.x+c.width&&(a=d.x),k=null!=d?d.y:Math.round(g+(k-g)/2),!mxUtils.contains(f,a,k)&&!mxUtils.contains(c,a,k)&&b.push(new mxPoint(a,k)),a=null!=d&&d.x>=f.x&&d.x<=f.x+f.width?d.x:e.getRoutingCenterX(f),!mxUtils.contains(f,a,k)&&!mxUtils.contains(c,a,k)&&b.push(new mxPoint(a,k)),1==b.length&&(null!=d&&1==b.length?!mxUtils.contains(f,d.x,k)&&!mxUtils.contains(c,d.x,k)&&b.push(new mxPoint(d.x,k)):(e=Math.max(c.x,f.x),c=Math.min(c.x+c.width,f.x+f.width),b.push(new mxPoint(e+(c-e)/ 2,k)))))},SegmentConnector:function(a,c,f,d,b){function e(a){if(null==l||Math.abs(l.x-a.x)>=k||Math.abs(l.y-a.y)>=k)b.push(a),l=a;return l}var g=a.absolutePoints,k=Math.max(1,a.view.scale),l=0t;t++){var y=null!=u&&u.x==x.x,z=null!=u&&u.y==x.y,D=null!=v&&x.y>=v.y&& x.y<=v.y+v.height,v=null!=v&&x.x>=v.x&&x.x<=v.x+v.width,x=z||null==u&&D,A=y||null==u&&v;if(!(0==t&&(x&&A||y&&z))){if(null!=u&&!z&&!y&&(D||v)){n=D?!1:!0;break}if(A||x){n=x;1==t&&(n=0==d.length%2?x:A);break}}v=f;u=g[s];null!=u&&(u.x=Math.round(u.x),u.y=Math.round(u.y),v=null);x=d[d.length-1];y&&z&&(d=d.slice(1))}n&&(null!=g[0]&&g[0].y!=m.y||null==g[0]&&null!=c&&(m.yc.y+c.height))?e(new mxPoint(p.x,m.y)):!n&&(null!=g[0]&&g[0].x!=m.x||null==g[0]&&null!=c&&(m.xc.x+c.width))&&e(new mxPoint(m.x, p.y));n?p.y=m.y:p.x=m.x;for(t=0;tf.y+f.height))?e(new mxPoint(p.x,m.y)):!n&&(null!=g[s]&&g[s].x!=m.x||null==g[s]&&null!=f&&(m.xf.x+f.width))&&e(new mxPoint(m.x,p.y))));if(null==g[0]&&null!=c)for(;1< b.length&&null!=b[1]&&mxUtils.contains(c,b[1].x,b[1].y);)b.splice(1,1);if(null==g[s]&&null!=f)for(;1 z;z++)mxEdgeStyle.limits[z][1]=m[z][0]-A[z],mxEdgeStyle.limits[z][2]=m[z][1]-A[z],mxEdgeStyle.limits[z][4]=m[z][0]+m[z][2]+A[z],mxEdgeStyle.limits[z][8]=m[z][1]+m[z][3]+A[z];A=m[0][1]+m[0][3]/2;p=m[1][1]+m[1][3]/2;z=m[0][0]+m[0][2]/2-(m[1][0]+m[1][2]/2);D=A-p;A=0;0>z?A=0>D?2:1:0>=D&&(A=3,0==z&&(A=2));p=null;null!=c&&(p=l);c=[[0.5,0.5],[0.5,0.5]];for(z=0;2>z;z++)null!=p&&(c[z][0]=(p.x-m[z][0])/m[z][2],1>=Math.abs(p.x-m[z][0])?a[z]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(p.x-m[z][0]-m[z][2])&&(a[z]= mxConstants.DIRECTION_MASK_EAST),c[z][1]=(p.y-m[z][1])/m[z][3],1>=Math.abs(p.y-m[z][1])?a[z]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(p.y-m[z][1]-m[z][3])&&(a[z]=mxConstants.DIRECTION_MASK_SOUTH)),p=null,null!=f&&(p=n);z=m[0][1]-(m[1][1]+m[1][3]);n=m[0][0]-(m[1][0]+m[1][2]);p=m[1][1]-(m[0][1]+m[0][3]);s=m[1][0]-(m[0][0]+m[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(n-y,0);mxEdgeStyle.vertexSeperations[2]=Math.max(z-y,0);mxEdgeStyle.vertexSeperations[4]=Math.max(p-y,0);mxEdgeStyle.vertexSeperations[3]= Math.max(s-y,0);y=[];f=[];l=[];f[0]=n>=s?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;l[0]=z>=p?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;f[1]=mxUtils.reversePortConstraints(f[0]);l[1]=mxUtils.reversePortConstraints(l[0]);n=n>=s?n:s;p=z>=p?z:p;s=[[0,0],[0,0]];t=!1;for(z=0;2>z;z++)0==a[z]&&(0==(f[z]&d[z])&&(f[z]=mxUtils.reversePortConstraints(f[z])),0==(l[z]&d[z])&&(l[z]=mxUtils.reversePortConstraints(l[z])),s[z][0]=l[z],s[z][1]=f[z]);0z;z++)if(0==a[z]&&(0==(s[z][0]&d[z])&&(s[z][0]=s[z][1]),y[z]=s[z][0]&d[z],y[z]|=(s[z][1]&d[z])<<8,y[z]|=(s[1-z][z]&d[z])<<16,y[z]|=(s[1-z][1-z]&d[z])<<24,0==(y[z]&15)&&(y[z]<<=8),0==(y[z]&3840)&&(y[z]= y[z]&15|y[z]>>8),0==(y[z]&983040)&&(y[z]=y[z]&65535|(y[z]&251658240)>>8),a[z]=y[z]&15,d[z]==mxConstants.DIRECTION_MASK_WEST||d[z]==mxConstants.DIRECTION_MASK_NORTH||d[z]==mxConstants.DIRECTION_MASK_EAST||d[z]==mxConstants.DIRECTION_MASK_SOUTH))a[z]=d[z];d=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];y=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];d-=A;y-=A;1>d&&(d+=4);1>y&&(y+=4);d=mxEdgeStyle.routePatterns[d-1][y-1];mxEdgeStyle.wayPoints1[0][0]=m[0][0];mxEdgeStyle.wayPoints1[0][1]=m[0][1];switch(a[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-= e;mxEdgeStyle.wayPoints1[0][1]+=c[0][1]*m[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=c[0][0]*m[0][2];mxEdgeStyle.wayPoints1[0][1]+=m[0][3]+e;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=m[0][2]+e;mxEdgeStyle.wayPoints1[0][1]+=c[0][1]*m[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=c[0][0]*m[0][2],mxEdgeStyle.wayPoints1[0][1]-=e}e=0;f=y=0<(a[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))? 0:1;for(z=0;z>5,p<<=A,15>=4),s=0<(d[z]&mxEdgeStyle.CENTER_MASK),(t||v)&&9>p?(t=t?0:1,q=s&&0==l?m[t][0]+c[t][0]*m[t][2]:s?m[t][1]+c[t][1]* m[t][3]:mxEdgeStyle.limits[t][p],0==l?(p=(q-mxEdgeStyle.wayPoints1[e][0])*n[0],0b&&(b+=4);1>a&&(a+=4);c=routePatterns[b-1][a-1];if(0==f||0==d)null!=inlineRoutePatterns[b-1][a- 1]&&(c=inlineRoutePatterns[b-1][a-1]);return c}},mxStyleRegistry={values:[],putValue:function(a,c){mxStyleRegistry.values[a]=c},getValue:function(a){return mxStyleRegistry.values[a]},getName:function(a){for(var c in mxStyleRegistry.values)if(mxStyleRegistry.values[c]==a)return c;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); mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_HEXAGON,mxPerimeter.HexagonPerimeter);function mxGraphView(a){this.graph=a;this.translate=new mxPoint;this.graphBounds=new mxRectangle;this.states=new mxDictionary}mxGraphView.prototype=new mxEventSource; mxGraphView.prototype.constructor=mxGraphView;mxGraphView.prototype.EMPTY_POINT=new mxPoint;mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"";mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"";mxGraphView.prototype.allowEval=!1;mxGraphView.prototype.captureDocumentGesture=!0;mxGraphView.prototype.optimizeVmlReflows=!0;mxGraphView.prototype.rendering=!0;mxGraphView.prototype.graph=null;mxGraphView.prototype.currentRoot=null; mxGraphView.prototype.graphBounds=null;mxGraphView.prototype.scale=1;mxGraphView.prototype.translate=null;mxGraphView.prototype.states=null;mxGraphView.prototype.updateStyle=!1;mxGraphView.prototype.lastNode=null;mxGraphView.prototype.lastHtmlNode=null;mxGraphView.prototype.lastForegroundNode=null;mxGraphView.prototype.lastForegroundHtmlNode=null;mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds};mxGraphView.prototype.setGraphBounds=function(a){this.graphBounds=a}; mxGraphView.prototype.getBounds=function(a){var c=null;if(null!=a&&0 f.length||null==f[0]||null==f[f.length-1])?this.clear(a.cell,!0):(this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)))}; mxGraphView.prototype.updateVertexLabelOffset=function(a){var c=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(c==mxConstants.ALIGN_LEFT)c=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),c=null!=c?c*this.scale:a.width,a.absoluteOffset.x-=c;else if(c==mxConstants.ALIGN_RIGHT)a.absoluteOffset.x+=a.width;else if(c==mxConstants.ALIGN_CENTER&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),null!=c)){var f=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),d=0;f==mxConstants.ALIGN_CENTER?d=0.5:f==mxConstants.ALIGN_RIGHT&&(d=1);0!=d&&(a.absoluteOffset.x-=(c*this.scale-a.width)*d)}c=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);c==mxConstants.ALIGN_TOP?a.absoluteOffset.y-=a.height:c==mxConstants.ALIGN_BOTTOM&&(a.absoluteOffset.y+=a.height)};mxGraphView.prototype.resetValidationState=function(){this.lastForegroundHtmlNode=this.lastForegroundNode=this.lastHtmlNode=this.lastNode=null}; mxGraphView.prototype.stateValidated=function(a){var c=this.graph.getModel().isEdge(a.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(a.cell)&&this.graph.keepEdgesInBackground;a=this.graph.cellRenderer.insertStateAfter(a,c?this.lastForegroundNode||this.lastNode:this.lastNode,c?this.lastForegroundHtmlNode||this.lastHtmlNode:this.lastHtmlNode);c?(this.lastForegroundHtmlNode=a[1],this.lastForegroundNode=a[0]):(this.lastHtmlNode=a[1],this.lastNode=a[0])}; mxGraphView.prototype.updateFixedTerminalPoints=function(a,c,f){this.updateFixedTerminalPoint(a,c,!0,this.graph.getConnectionConstraint(a,c,!0));this.updateFixedTerminalPoint(a,f,!1,this.graph.getConnectionConstraint(a,f,!1))};mxGraphView.prototype.updateFixedTerminalPoint=function(a,c,f,d){a.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(a,c,f,d),f)}; mxGraphView.prototype.getFixedTerminalPoint=function(a,c,f,d){var b=null;null!=d&&(b=this.graph.getConnectionPoint(c,d));if(null==b&&null==c){c=this.scale;d=this.translate;var e=a.origin,b=this.graph.getCellGeometry(a.cell).getTerminalPoint(f);null!=b&&(b=new mxPoint(c*(d.x+b.x+e.x),c*(d.y+b.y+e.y)))}return b}; mxGraphView.prototype.updateBoundsFromStencil=function(a){var c=null;if(null!=a&&null!=a.shape&&null!=a.shape.stencil&&"fixed"==a.shape.stencil.aspect){var c=mxRectangle.fromRectangle(a),f=a.shape.stencil.computeAspect(a.style,a.x,a.y,a.width,a.height);a.setRect(f.x,f.y,a.shape.stencil.w0*f.width,a.shape.stencil.h0*f.height)}return c}; mxGraphView.prototype.updatePoints=function(a,c,f,d){if(null!=a){var b=[];b.push(a.absolutePoints[0]);var e=this.getEdgeStyle(a,c,f,d);if(null!=e){f=this.getTerminalPort(a,f,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(f),k=this.updateBoundsFromStencil(d);e(a,f,d,c,b);null!=g&&f.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=c)for(e=0;e=Math.round(k+g)&&l=e?0:e*e/(a*a+n*n));a>b&&(a=b);b=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,c,f));-1==mxUtils.relativeCcw(g.x,g.y,k.x,k.y,c,f)&&(b=-b);return new mxPoint(-2*((d/2-p-a)/d),b/this.scale)}}return new mxPoint}; mxGraphView.prototype.updateEdgeLabelOffset=function(a){var c=a.absolutePoints;a.absoluteOffset.x=a.getCenterX();a.absoluteOffset.y=a.getCenterY();if(null!=c&&0f&&a.x>f+2&&a.x<=c)return!0;c=this.graph.container.offsetHeight;f=this.graph.container.clientHeight;return c>f&&a.y>f+2&&a.y<=c?!0:!1}; mxGraphView.prototype.init=function(){this.installListeners();var a=this.graph;a.dialect==mxConstants.DIALECT_SVG?this.createSvg():a.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()}; mxGraphView.prototype.installListeners=function(){var a=this.graph,c=a.container;if(null!=c){mxClient.IS_TOUCH&&(mxEvent.addListener(c,"gesturestart",mxUtils.bind(this,function(d){a.fireGestureEvent(d);mxEvent.consume(d)})),mxEvent.addListener(c,"gesturechange",mxUtils.bind(this,function(d){a.fireGestureEvent(d);mxEvent.consume(d)})),mxEvent.addListener(c,"gestureend",mxUtils.bind(this,function(d){a.fireGestureEvent(d);mxEvent.consume(d)})));mxEvent.addGestureListeners(c,mxUtils.bind(this,function(d){this.isContainerEvent(d)&& (!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(d))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(d))}),mxUtils.bind(this,function(d){this.isContainerEvent(d)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(d))}),mxUtils.bind(this,function(d){this.isContainerEvent(d)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(d))}));mxEvent.addListener(c,"dblclick",mxUtils.bind(this,function(d){this.isContainerEvent(d)&&a.dblClick(d)})); var f=function(d){var b=null;mxClient.IS_TOUCH&&(b=mxEvent.getClientX(d),d=mxEvent.getClientY(d),d=mxUtils.convertPoint(c,b,d),b=a.view.getState(a.getCellAt(d.x,d.y)));return b};a.addMouseListener({mouseDown:function(d,b){a.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}});this.moveHandler=mxUtils.bind(this,function(d){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();this.captureDocumentGesture&&a.isMouseDown&&(null!=a.container&&!this.isContainerEvent(d)&& "none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&!mxEvent.isConsumed(d))&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(d,f(d)))});this.endHandler=mxUtils.bind(this,function(d){this.captureDocumentGesture&&a.isMouseDown&&(null!=a.container&&!this.isContainerEvent(d)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(d))});mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}}; mxGraphView.prototype.createHtml=function(){var a=this.graph.container;null!=a&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane), a.appendChild(this.canvas),this.updateContainerStyle(a),mxClient.IS_QUIRKS&&(a=mxUtils.bind(this,function(a){a=this.getGraphBounds();this.updateHtmlCanvasSize(a.x+a.width+this.graph.border,a.y+a.height+this.graph.border)}),mxEvent.addListener(window,"resize",a)))}; mxGraphView.prototype.updateHtmlCanvasSize=function(a,c){if(null!=this.graph.container){var f=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidthmxUtils.indexOf(c,b)&&c.push(b)}}return this.getModel().getTopmostCells(c)}; mxGraph.prototype.graphModelChanged=function(a){for(var c=0;c=b.scrollLeft&&c>=b.scrollTop&&a<=b.scrollLeft+b.clientWidth&&c<=b.scrollTop+b.clientHeight){var e=b.scrollLeft+b.clientWidth-a;if(ethis.minPageBreakDist)?Math.ceil(d.height/e.height)+1:0,k=a?Math.ceil(d.width/e.width)+1:0,l=(k-1)*e.width,n=(g-1)*e.height;null==this.horizontalPageBreaks&&0this.model.getChildCount(c)&&f--;this.model.add(c,a[k],f+k);this.autoSizeCellsOnAdd&&this.autoSizeCell(a[k],!0);this.isExtendParentsOnAdd(a[k])&&this.isExtendParent(a[k])&&this.extendParent(a[k]);(null==g||g)&&this.constrainChild(a[k]);null!=d&&this.cellConnected(a[k],d,!0);null!=b&&this.cellConnected(a[k],b,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",c,"index",f,"source",d,"target", b,"absolute",e))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(a,c){if(null!=c?c:1)for(var f=this.model.getChildCount(a),d=0;db.width&&(e=f.width-b.width,f.width-=e);d.x+d.width>b.x+b.width&&(e-=d.x+d.width-b.x-b.width-e);g=0;f.height>b.height&&(g=f.height-b.height,f.height-=g);d.y+d.height> b.y+b.height&&(g-=d.y+d.height-b.y-b.height-g);d.xe&&(m=0),c>g&&(p=0),this.view.setTranslate(Math.floor(m/2-k.x),Math.floor(p/2-k.y)),this.container.scrollLeft=(a-e)/ 2,this.container.scrollTop=(c-g)/2):this.view.setTranslate(a?Math.floor(l.x-k.x*n+m*f/n):l.x,c?Math.floor(l.y-k.y*n+p*d/n):l.y)}; mxGraph.prototype.zoom=function(a,c){c=null!=c?c:this.centerZoom;var f=Math.round(100*this.view.scale*a)/100,d=this.view.getState(this.getSelectionCell());a=f/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=f,this.scrollRectToVisible(d)||(this.view.revalidate(),this.view.setScale(f));else if(d=mxUtils.hasScrollbars(this.container),c&&!d){var d=this.container.offsetWidth,b=this.container.offsetHeight;if(1c?(c=a.height/c,f=(c-a.height)/2,a.height=c,c=Math.min(a.y,f),a.y-=c,d=Math.min(this.container.scrollHeight,a.y+a.height),a.height=d-a.y):(c*=a.width,f=(c-a.width)/2,a.width=c,c=Math.min(a.x,f),a.x-=c, f=Math.min(this.container.scrollWidth,a.x+a.width),a.width=f-a.x);c=this.container.clientWidth/a.width;f=this.view.scale*c;mxUtils.hasScrollbars(this.container)?(this.view.setScale(f),this.container.scrollLeft=Math.round(a.x*c),this.container.scrollTop=Math.round(a.y*c)):this.view.scaleAndTranslate(f,this.view.translate.x-a.x/this.view.scale,this.view.translate.y-a.y/this.view.scale)}; mxGraph.prototype.scrollCellToVisible=function(a,c){var f=-this.view.translate.x,d=-this.view.translate.y,b=this.view.getState(a);null!=b&&(f=new mxRectangle(f+b.x,d+b.y,b.width,b.height),c&&null!=this.container&&(d=this.container.clientWidth,b=this.container.clientHeight,f.x=f.getCenterX()-d/2,f.width=d,f.y=f.getCenterY()-b/2,f.height=b),d=new mxPoint(this.view.translate.x,this.view.translate.y),this.scrollRectToVisible(f)&&(f=new mxPoint(this.view.translate.x,this.view.translate.y),this.view.translate.x= d.x,this.view.translate.y=d.y,this.view.setTranslate(f.x,f.y)))}; mxGraph.prototype.scrollRectToVisible=function(a){var c=!1;if(null!=a){var f=this.container.offsetWidth,d=this.container.offsetHeight,b=Math.min(f,a.width),e=Math.min(d,a.height);if(mxUtils.hasScrollbars(this.container)){f=this.container;a.x+=this.view.translate.x;a.y+=this.view.translate.y;var g=f.scrollLeft-a.x,d=Math.max(g-f.scrollLeft,0);0g+f&&(this.view.translate.x-=(a.x+b-f-g)/l,c=!0);a.y+e>k+d&&(this.view.translate.y-=(a.y+e-d-k)/l,c=!0);a.xmxUtils.indexOf(a,g);)g=this.model.getParent(g);return!this.model.isLayer(f)&&null==g?f:null};mxGraph.prototype.getDefaultParent=function(){var a=this.getCurrentRoot();null==a&&(a=this.defaultParent,null==a&&(a=this.model.getRoot(),a=this.model.getChildAt(a,0)));return a};mxGraph.prototype.setDefaultParent=function(a){this.defaultParent=a};mxGraph.prototype.getSwimlane=function(a){for(;null!=a&&!this.isSwimlane(a);)a=this.model.getParent(a);return a}; mxGraph.prototype.getSwimlaneAt=function(a,c,f){f=f||this.getDefaultParent();if(null!=f)for(var d=this.model.getChildCount(f),b=0;ba.width*b||0a.height*b)return!0}return!1};mxGraph.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraph.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)}; mxGraph.prototype.getChildCells=function(a,c,f){a=null!=a?a:this.getDefaultParent();a=this.model.getChildCells(a,null!=c?c:!1,null!=f?f:!1);c=[];for(f=0;f=a&&s.y+s.height<=l&&s.y>=c&&s.x+s.width<=k?e.push(p):this.getCells(a, c,f,d,p,e)}}}return e};mxGraph.prototype.getCellsBeyond=function(a,c,f,d,b){var e=[];if(d||b)if(null==f&&(f=this.getDefaultParent()),null!=f)for(var g=this.model.getChildCount(f),k=0;k=a)&&(!b||n.y>=c)&&e.push(l)}return e}; mxGraph.prototype.findTreeRoots=function(a,c,f){c=null!=c?c:!1;f=null!=f?f:!1;var d=[];if(null!=a){for(var b=this.getModel(),e=b.getChildCount(a),g=null,k=0,l=0;lk&&(k=m,g=n)}}0==d.length&&null!=g&&d.push(g)}return d}; mxGraph.prototype.traverse=function(a,c,f,d,b){if(null!=f&&null!=a&&(c=null!=c?c:!0,b=b||new mxDictionary,!b.get(a)&&(b.put(a,!0),d=f(a,d),null==d||d)))if(d=this.model.getEdgeCount(a),0c?e-1:c)),this.setSelectionCell(a))};mxGraph.prototype.selectAll=function(a,c){a=a||this.getDefaultParent();var f=c?this.model.filterDescendants(function(d){return d!=a},a):this.model.getChildren(a);null!=f&&this.setSelectionCells(f)};mxGraph.prototype.selectVertices=function(a){this.selectCells(!0,!1,a)};mxGraph.prototype.selectEdges=function(a){this.selectCells(!1,!0,a)}; mxGraph.prototype.selectCells=function(a,c,f){f=f||this.getDefaultParent();var d=mxUtils.bind(this,function(b){return null!=this.view.getState(b)&&(0==this.model.getChildCount(b)&&this.model.isVertex(b)&&a&&!this.model.isEdge(this.model.getParent(b))||this.model.isEdge(b)&&c)});f=this.model.filterDescendants(d,f);this.setSelectionCells(f)}; mxGraph.prototype.selectCellForEvent=function(a,c){var f=this.isCellSelected(a);this.isToggleEvent(c)?f?this.removeSelectionCell(a):this.addSelectionCell(a):(!f||1!=this.getSelectionCount())&&this.setSelectionCell(a)};mxGraph.prototype.selectCellsForEvent=function(a,c){this.isToggleEvent(c)?this.addSelectionCells(a):this.setSelectionCells(a)}; mxGraph.prototype.createHandler=function(a){var c=null;if(null!=a)if(this.model.isEdge(a.cell))var c=a.getVisibleTerminalState(!0),f=a.getVisibleTerminalState(!1),d=this.getCellGeometry(a.cell),c=this.view.getEdgeStyle(a,null!=d?d.points:null,c,f),c=this.createEdgeHandler(a,c);else c=this.createVertexHandler(a);return c};mxGraph.prototype.createVertexHandler=function(a){return new mxVertexHandler(a)}; mxGraph.prototype.createEdgeHandler=function(a,c){return c==mxEdgeStyle.Loop||c==mxEdgeStyle.ElbowConnector||c==mxEdgeStyle.SideToSide||c==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(a):c==mxEdgeStyle.SegmentConnector||c==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(a):new mxEdgeHandler(a)};mxGraph.prototype.createEdgeSegmentHandler=function(a){return new mxEdgeSegmentHandler(a)};mxGraph.prototype.createElbowEdgeHandler=function(a){return new mxElbowEdgeHandler(a)}; mxGraph.prototype.addMouseListener=function(a){null==this.mouseListeners&&(this.mouseListeners=[]);this.mouseListeners.push(a)};mxGraph.prototype.removeMouseListener=function(a){if(null!=this.mouseListeners)for(var c=0;cthis.doubleClickCounter){if(this.doubleClickCounter++,d=!1,a==mxEvent.MOUSE_UP?c.getCell()==this.lastTouchCell&&null!=this.lastTouchCell&&(this.lastTouchTime=0,d=this.lastTouchCell,this.lastTouchCell=null,mxClient.IS_QUIRKS&&c.getSource().fireEvent("ondblclick"),this.dblClick(c.getEvent(),d),d=!0):(this.fireDoubleClick= !0,this.lastTouchTime=0),!mxClient.IS_QUIRKS||d){mxEvent.consume(c.getEvent());return}}else{if(null==this.lastTouchEvent||this.lastTouchEvent!=c.getEvent())this.lastTouchCell=c.getCell(),this.lastTouchX=c.getX(),this.lastTouchY=c.getY(),this.lastTouchTime=d,this.lastTouchEvent=c.getEvent(),this.doubleClickCounter=0}else if((this.isMouseDown||a==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;d=this.lastTouchCell;this.lastTouchCell=null;this.isMouseDown=!1;(null!=d||mxEvent.isTouchEvent(c.getEvent())&& (mxClient.IS_GC||mxClient.IS_SF))&&Math.abs(this.lastTouchX-c.getX())f.x&&(e-=f.x);0>f.y&&(g-=f.y); if(d.translate.x!=e||d.translate.y!=g)d.translate.x=e,d.translate.y=g,a=!0;var f=d.translate,b=this.source.getView().scale,e=b/d.scale,g=1/d.scale,k=this.source.container;this.bounds=new mxRectangle((f.x-c.x-this.source.panDx)/g,(f.y-c.y-this.source.panDy)/g,k.clientWidth/e,k.clientHeight/e);this.bounds.x+=this.source.container.scrollLeft*d.scale/b;this.bounds.y+=this.source.container.scrollTop*d.scale/b;f=this.selectionBorder.bounds;if(f.x!=this.bounds.x||f.y!=this.bounds.y||f.width!=this.bounds.width|| f.height!=this.bounds.height)this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw();f=this.sizer.bounds;d=new mxRectangle(this.bounds.x+this.bounds.width-f.width/2,this.bounds.y+this.bounds.height-f.height/2,f.width,f.height);if(f.x!=d.x||f.y!=d.y||f.width!=d.width||f.height!=d.height)this.sizer.bounds=d,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw();a&&this.outline.view.revalidate()}}}; mxOutline.prototype.mouseDown=function(a,c){if(this.enabled&&this.showViewport){var f=!mxEvent.isMouseEvent(c.getEvent())?this.source.tolerance:0,f=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||0=this.max)||!this.source&&(0==this.max||e>=this.max)))g+=this.countError+"\n";null!=this.validNeighbors&&null!=this.typeError&&0mxUtils.indexOf(a,e)&&(e=this.getLayout(e),null!=e&&e.moveCell(a[b],f.x,f.y))}}; mxLayoutManager.prototype.getCellsForChanges=function(a){for(var c=new mxDictionary,f=[],d=0;de||Math.abs(d)>e){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var g=f.isGridEnabledEvent(c.getEvent()), e=!0;if(null!=this.guide&&this.useGuidesForEvent(c))d=this.guide.move(this.bounds,new mxPoint(b,d),g),e=!1,b=d.x,d=d.y;else if(g)var k=f.getView().translate,l=f.getView().scale,g=this.bounds.x-(f.snap(this.bounds.x/l-k.x)+k.x)*l,k=this.bounds.y-(f.snap(this.bounds.y/l-k.y)+k.y)*l,d=this.snap(new mxPoint(b,d)),b=d.x-g,d=d.y-k;null!=this.guide&&e&&this.guide.hide();f.isConstrainedEvent(c.getEvent())&&(Math.abs(b)>Math.abs(d)?d=0:b=0);this.currentDx=b;this.currentDy=d;this.updatePreviewShape();e=null; d=c.getCell();g=f.isCloneEvent(c.getEvent())&&f.isCellsCloneable()&&this.isCloneEnabled();f.isDropEnabled()&&this.highlightEnabled&&(e=f.getDropTarget(this.cells,c.getEvent(),d,g));b=f.getView().getState(e);k=!1;null!=b&&(f.model.getParent(this.cell)!=e||g)?(this.target!=e&&(this.target=e,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),k=!0):(this.target=null,this.connectOnDrop&&null!=d&&(1==this.cells.length&&f.getModel().isVertex(d)&&f.isCellConnectable(d))&&(b=f.getView().getState(d),null!= b&&(f=null==f.getEdgeValidationError(null,this.cell,d)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(f),k=!0)));null!=b&&k?this.highlight.highlight(b):this.highlight.hide()}this.updateHint(c);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,c);mxEvent.consume(c.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!c.isConsumed()&&null!=c.getState()&&!f.isMouseDown)b=f.getCursorForMouseEvent(c),null==b&&f.isEnabled()&&f.isCellMovable(c.getCell())&& (b=f.getModel().isEdge(c.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=c.sourceState&&c.sourceState.setCursor(b)};mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())}; mxGraphHandler.prototype.setHighlightColor=function(a){null!=this.highlight&&this.highlight.setHighlightColor(a)}; mxGraphHandler.prototype.mouseUp=function(a,c){if(!c.isConsumed()){var f=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var d=c.getCell();if(this.connectOnDrop&&null==this.target&&null!=d&&f.getModel().isVertex(d)&&f.isCellConnectable(d)&&f.isEdgeValid(null,this.cell,d))f.connectionHandler.connect(this.cell,d,c.getEvent());else{var d=f.isCloneEvent(c.getEvent())&&f.isCellsCloneable()&&this.isCloneEnabled(),b=f.getView().scale,e=this.roundLength(this.currentDx/ b),b=this.roundLength(this.currentDy/b),g=this.target;f.isSplitEnabled()&&f.isSplitTarget(g,this.cells,c.getEvent())?f.splitEdge(g,this.cells,null,e,b):this.moveCells(this.cells,e,b,d,this.target,c.getEvent())}}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(c)}this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,c);this.reset()}; mxGraphHandler.prototype.selectDelayed=function(a){(!this.graph.isCellSelected(this.cell)||!this.graph.popupMenuHandler.isPopupTrigger(a))&&this.graph.selectCellForEvent(this.cell,a.getEvent())};mxGraphHandler.prototype.reset=function(){this.destroyShapes();this.removeHint();this.delayedSelection=this.cellWasClicked=!1;this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null}; mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,c,f){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){f=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(f),mxEvent.getClientY(f));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){c=Math.cos(-d);var d=Math.sin(-d),b=new mxPoint(a.getCenterX(),a.getCenterY());f=mxUtils.getRotatedPoint(f,c,d,b)}return!mxUtils.contains(a,f.x,f.y)}return!1}; mxGraphHandler.prototype.moveCells=function(a,c,f,d,b,e){d&&(a=this.graph.getCloneableCells(a));null==b&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),a,e)&&(b=this.graph.getDefaultParent());a=this.graph.moveCells(a,c-this.graph.panDx/this.graph.view.scale,f-this.graph.panDy/this.graph.view.scale,d,b,e);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0]);d&&this.graph.setSelectionCells(a)}; mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)};mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);this.destroyShapes();this.removeHint()}; function mxPanningHandler(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,function(a,f){var d=f.getProperty("eventName"),b=f.getProperty("event");d==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(b)&&(this.start(b),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",b)),b.consume())}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,function(a,f){if(this.isPinchEnabled()){var d= f.getProperty("event");!mxEvent.isConsumed(d)&&"gesturestart"==d.type?(this.initialScale=this.graph.view.scale,!this.active&&null!=this.mouseDownEvent&&(this.start(this.mouseDownEvent),this.mouseDownEvent=null)):"gestureend"==d.type&&null==this.initialScale&&(this.initialScale=null);if(null!=this.initialScale){var b=Math.round(100*this.initialScale*d.scale)/100;null!=this.minScale&&(b=Math.max(this.minScale,b));null!=this.maxScale&&(b=Math.min(this.maxScale,b));this.graph.view.scale!=b&&(this.graph.zoomTo(b), mxEvent.consume(d))}}}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler))}mxPanningHandler.prototype=new mxEventSource;mxPanningHandler.prototype.constructor=mxPanningHandler;mxPanningHandler.prototype.graph=null;mxPanningHandler.prototype.useLeftButtonForPanning=!1;mxPanningHandler.prototype.usePopupTrigger=!0;mxPanningHandler.prototype.ignoreCell=!1;mxPanningHandler.prototype.previewEnabled=!0;mxPanningHandler.prototype.useGrid=!1;mxPanningHandler.prototype.panningEnabled=!0; mxPanningHandler.prototype.pinchEnabled=!0;mxPanningHandler.prototype.maxScale=8;mxPanningHandler.prototype.minScale=0.01;mxPanningHandler.prototype.dx=null;mxPanningHandler.prototype.dy=null;mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0;mxPanningHandler.prototype.isActive=function(){return this.active||null!=this.initialScale};mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled}; mxPanningHandler.prototype.setPanningEnabled=function(a){this.panningEnabled=a};mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled};mxPanningHandler.prototype.setPinchEnabled=function(a){this.pinchEnabled=a};mxPanningHandler.prototype.isPanningTrigger=function(a){var c=a.getEvent();return this.useLeftButtonForPanning&&null==a.getState()&&mxEvent.isLeftMouseButton(c)||mxEvent.isControlDown(c)&&mxEvent.isShiftDown(c)||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)}; mxPanningHandler.prototype.isForcePanningEvent=function(a){return this.ignoreCell||mxEvent.isMultiTouchEvent(a.getEvent())};mxPanningHandler.prototype.mouseDown=function(a,c){this.mouseDownEvent=c;!c.isConsumed()&&this.isPanningEnabled()&&(!this.active&&this.isPanningTrigger(c))&&(this.start(c),this.consumePanningTrigger(c))}; mxPanningHandler.prototype.start=function(a){this.dx0=-this.graph.container.scrollLeft;this.dy0=-this.graph.container.scrollTop;this.startX=a.getX();this.startY=a.getY();this.dy=this.dx=null;this.panningTrigger=!0};mxPanningHandler.prototype.consumePanningTrigger=function(a){a.consume()}; mxPanningHandler.prototype.mouseMove=function(a,c){this.dx=c.getX()-this.startX;this.dy=c.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(this.dx=this.graph.snap(this.dx),this.dy=this.graph.snap(this.dy)),this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",c));else if(this.panningTrigger){var f=this.active;this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance;!f&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START, "event",c))}(this.active||this.panningTrigger)&&c.consume()}; mxPanningHandler.prototype.mouseUp=function(a,c){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var f=this.graph.getView().scale,d=this.graph.getView().translate;this.graph.panGraph(0,0);this.panGraph(d.x+this.dx/f,d.y+this.dy/f)}c.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",c))}this.panningTrigger=!1;this.mouseDownEvent=null;this.active=!1;this.dy=this.dx=null}; mxPanningHandler.prototype.panGraph=function(a,c){this.graph.getView().setTranslate(a,c)};mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.forcePanningHandler);this.graph.removeListener(this.gestureHandler)}; function mxPopupMenuHandler(a,c){null!=a&&(this.graph=a,this.factoryMethod=c,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(a,d){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}mxPopupMenuHandler.prototype=new mxPopupMenu;mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler;mxPopupMenuHandler.prototype.graph=null;mxPopupMenuHandler.prototype.selectOnPopup=!0; mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0;mxPopupMenuHandler.prototype.triggerX=null;mxPopupMenuHandler.prototype.triggerY=null;mxPopupMenuHandler.prototype.screenX=null;mxPopupMenuHandler.prototype.screenY=null;mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){this.graph.tooltipHandler.hide()}))};mxPopupMenuHandler.prototype.isSelectOnPopup=function(a){return this.selectOnPopup}; mxPopupMenuHandler.prototype.mouseDown=function(a,c){this.isEnabled()&&!mxEvent.isMultiTouchEvent(c.getEvent())&&(this.hideMenu(),this.triggerX=c.getGraphX(),this.triggerY=c.getGraphY(),this.screenX=mxEvent.getMainEvent(c.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(c.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(c),this.inTolerance=!0)}; mxPopupMenuHandler.prototype.mouseMove=function(a,c){if(this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(c.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(c.getEvent()).screenY-this.screenY)>this.graph.tolerance))this.inTolerance=!1}; mxPopupMenuHandler.prototype.mouseUp=function(a,c){if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var f=this.getCellForPopupEvent(c);this.graph.isEnabled()&&this.isSelectOnPopup(c)&&null!=f&&!this.graph.isCellSelected(f)?this.graph.setSelectionCell(f):this.clearSelectionOnBackground&&null==f&&this.graph.clearSelection();this.graph.tooltipHandler.hide();var d=mxUtils.getScrollOrigin();this.popup(c.getX()+d.x+1,c.getY()+d.y+1,f,c.getEvent());c.consume()}this.inTolerance= this.popupTrigger=!1};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){return a.getCell()};mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.gestureHandler);mxPopupMenu.prototype.destroy.apply(this)}; function mxCellMarker(a,c,f,d){mxEventSource.call(this);null!=a&&(this.graph=a,this.validColor=null!=c?c:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=c?f:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=d?d:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(a))}mxUtils.extend(mxCellMarker,mxEventSource);mxCellMarker.prototype.graph=null;mxCellMarker.prototype.enabled=!0;mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT;mxCellMarker.prototype.hotspotEnabled=!1; mxCellMarker.prototype.validColor=null;mxCellMarker.prototype.invalidColor=null;mxCellMarker.prototype.currentColor=null;mxCellMarker.prototype.validState=null;mxCellMarker.prototype.markedState=null;mxCellMarker.prototype.setEnabled=function(a){this.enabled=a};mxCellMarker.prototype.isEnabled=function(){return this.enabled};mxCellMarker.prototype.setHotspot=function(a){this.hotspot=a};mxCellMarker.prototype.getHotspot=function(){return this.hotspot}; mxCellMarker.prototype.setHotspotEnabled=function(a){this.hotspotEnabled=a};mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled};mxCellMarker.prototype.hasValidState=function(){return null!=this.validState};mxCellMarker.prototype.getValidState=function(){return this.validState};mxCellMarker.prototype.getMarkedState=function(){return this.markedState};mxCellMarker.prototype.reset=function(){this.validState=null;null!=this.markedState&&(this.markedState=null,this.unmark())}; mxCellMarker.prototype.process=function(a){var c=null;this.isEnabled()&&(c=this.getState(a),this.setCurrentState(c,a));return c};mxCellMarker.prototype.setCurrentState=function(a,c,f){var d=null!=a?this.isValidState(a):!1;f=null!=f?f:this.getMarkerColor(c.getEvent(),a,d);this.validState=d?a:null;if(a!=this.markedState||f!=this.currentColor)this.currentColor=f,null!=a&&null!=this.currentColor?(this.markedState=a,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark())}; mxCellMarker.prototype.markCell=function(a,c){var f=this.graph.getView().getState(a);null!=f&&(this.currentColor=null!=c?c:this.validColor,this.markedState=f,this.mark())};mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor);this.highlight.highlight(this.markedState);this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))};mxCellMarker.prototype.unmark=function(){this.mark()};mxCellMarker.prototype.isValidState=function(a){return!0}; mxCellMarker.prototype.getMarkerColor=function(a,c,f){return f?this.validColor:this.invalidColor};mxCellMarker.prototype.getState=function(a){var c=this.graph.getView();cell=this.getCell(a);c=this.getStateToMark(c.getState(cell));return null!=c&&this.intersects(c,a)?c:null};mxCellMarker.prototype.getCell=function(a){return a.getCell()};mxCellMarker.prototype.getStateToMark=function(a){return a}; mxCellMarker.prototype.intersects=function(a,c){return this.hotspotEnabled?mxUtils.intersectsHotspot(a,c.getGraphX(),c.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0};mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getModel().removeListener(this.resetHandler);this.highlight.destroy()}; function mxSelectionCellsHandler(a){mxEventSource.call(this);this.graph=a;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.refreshHandler=mxUtils.bind(this,function(a,f){this.isEnabled()&&this.refresh()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler); this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler);this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource);mxSelectionCellsHandler.prototype.graph=null;mxSelectionCellsHandler.prototype.enabled=!0;mxSelectionCellsHandler.prototype.refreshHandler=null;mxSelectionCellsHandler.prototype.maxHandlers=100; mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(a){this.enabled=a};mxSelectionCellsHandler.prototype.getHandler=function(a){return this.handlers.get(a)};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(a,c){c.reset.apply(c)})}; mxSelectionCellsHandler.prototype.refresh=function(){var a=this.handlers;this.handlers=new mxDictionary;for(var c=this.graph.getSelectionCells(),f=0;fthis.graph.tolerance||g>this.graph.tolerance))this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState), this.updateCurrentState(c,f);null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(f=[b],null!=this.waypoints&&(f=f.concat(this.waypoints)),f.push(d),this.shape.points=f),this.drawPreview());null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(c.getEvent());c.consume()}else!this.isEnabled()||!this.graph.isEnabled()?this.constraintHandler.reset():this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&& null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),c.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&(null==this.icons&&!this.graph.isMouseDown)&&c.consume();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){f=!1;d=c.getSource();for(b=0;bthis.graph.tolerance||c>this.graph.tolerance))null==this.waypoints&&(this.waypoints=[]),f=this.graph.view.scale,c=new mxPoint(this.graph.snap(a.getGraphX()/f)*f,this.graph.snap(a.getGraphY()/f)*f),this.waypoints.push(c)}; mxConnectionHandler.prototype.mouseUp=function(a,c){if(!c.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(c)){this.addWaypointForEvent(c);c.consume();return}if(null==this.error){var f=null!=this.previous?this.previous.cell:null,d=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(d=this.constraintHandler.currentFocus.cell);null==d&&null!=this.currentState&&(d=this.currentState.cell);this.connect(f,d,c.getEvent(),c.getCell())}else null!= this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0g||Math.abs(e)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(d,f),c.consume()}}; mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity));this.graph.container.appendChild(this.sharedDiv);return this.sharedDiv};mxRubberband.prototype.isActive=function(a,c){return null!=this.div&&"none"!=this.div.style.display};mxRubberband.prototype.mouseUp=function(a,c){var f=this.isActive();this.reset();f&&(this.execute(c.getEvent()),c.consume())}; mxRubberband.prototype.execute=function(a){var c=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(c,a)};mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dropHandler=this.dragHandler=null;this.currentY=this.currentX=0;this.div=this.first=null};mxRubberband.prototype.update=function(a,c){this.currentX=a;this.currentY=c;this.repaint()}; mxRubberband.prototype.repaint=function(){if(null!=this.div){var a=this.currentX-this.graph.panDx,c=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,a);this.y=Math.min(this.first.y,c);this.width=Math.max(this.first.x,a)-this.x;this.height=Math.max(this.first.y,c)-this.y;a=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px";this.div.style.top=this.y+a+"px";this.div.style.width=Math.max(1,this.width)+"px";this.div.style.height=Math.max(1, this.height)+"px"}};mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))};function mxHandle(a,c,f){this.graph=a.view.graph;this.state=a;this.cursor=null!=c?c:this.cursor;this.image=null!=f?f:this.image;this.init()}mxHandle.prototype.cursor="default";mxHandle.prototype.image=null; mxHandle.prototype.ignoreGrid=!1;mxHandle.prototype.getPosition=function(a){};mxHandle.prototype.setPosition=function(a,c,f){};mxHandle.prototype.execute=function(){};mxHandle.prototype.copyStyle=function(a){this.graph.setCellStyles(a,this.state.style[a],[this.state.cell])}; mxHandle.prototype.processEvent=function(a){var c=this.graph.view.scale,f=this.graph.view.translate,f=new mxPoint(a.getGraphX()/c-f.x,a.getGraphY()/c-f.y);null!=this.shape&&null!=this.shape.bounds&&(f.x-=this.shape.bounds.width/c/4,f.y-=this.shape.bounds.height/c/4);var c=-mxUtils.toRadians(this.getRotation()),d=-mxUtils.toRadians(this.getTotalRotation())-c,f=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(f,c),this.ignoreGrid||!this.graph.isGridEnabledEvent(a.getEvent())),d));this.setPosition(this.state.getPaintBounds(), f,a);this.positionChanged();this.redraw()};mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state);null!=this.state.shape&&this.state.shape.apply(this.state);this.graph.cellRenderer.redraw(this.state,!0)};mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0};mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0}; mxHandle.prototype.init=function(){var a=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):this.shape=this.createShape(a);this.initShape(a)};mxHandle.prototype.createShape=function(a){a=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(a,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxHandle.prototype.initShape=function(a){a&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.shape.node.style.cursor=this.cursor}; mxHandle.prototype.redraw=function(){if(null!=this.shape&&null!=this.state.shape){var a=this.getPosition(this.state.getPaintBounds());if(null!=a){var c=mxUtils.toRadians(this.getTotalRotation()),a=this.rotatePoint(this.flipPoint(a),c),c=this.graph.view.scale,f=this.graph.view.translate;this.shape.bounds.x=Math.floor((a.x+f.x)*c-this.shape.bounds.width/2);this.shape.bounds.y=Math.floor((a.y+f.y)*c-this.shape.bounds.height/2);this.state.unscaledWidth=null;this.shape.redraw()}}}; mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container};mxHandle.prototype.rotatePoint=function(a,c){var f=this.state.getCellBounds(),f=new mxPoint(f.getCenterX(),f.getCenterY()),d=Math.cos(c),b=Math.sin(c);return mxUtils.getRotatedPoint(a,d,b,f)}; mxHandle.prototype.flipPoint=function(a){if(null!=this.state.shape){var c=this.state.getCellBounds();this.state.shape.flipH&&(a.x=2*c.x+c.width-a.x);this.state.shape.flipV&&(a.y=2*c.y+c.height-a.y)}return a};mxHandle.prototype.snapPoint=function(a,c){c||(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));return a};mxHandle.prototype.setVisible=function(a){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=a?"":"none")}; mxHandle.prototype.reset=function(){this.setVisible(!0);this.state.style=this.graph.getCellStyle(this.state.cell);this.positionChanged()};mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)}; function mxVertexHandler(a){null!=a&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(a,f){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate());this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxVertexHandler.prototype.graph=null;mxVertexHandler.prototype.state=null;mxVertexHandler.prototype.singleSizer=!1; mxVertexHandler.prototype.index=null;mxVertexHandler.prototype.allowHandleBoundsCheck=!0;mxVertexHandler.prototype.handleImage=null;mxVertexHandler.prototype.tolerance=0;mxVertexHandler.prototype.rotationEnabled=!1;mxVertexHandler.prototype.parentHighlightEnabled=!1;mxVertexHandler.prototype.rotationRaster=!0;mxVertexHandler.prototype.rotationCursor="crosshair";mxVertexHandler.prototype.livePreview=!1;mxVertexHandler.prototype.manageSizers=!1;mxVertexHandler.prototype.constrainGroupByChildren=!1; mxVertexHandler.prototype.rotationHandleVSpacing=-16;mxVertexHandler.prototype.horizontalOffset=0;mxVertexHandler.prototype.verticalOffset=0; mxVertexHandler.prototype.init=function(){this.graph=this.state.view.graph;this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.selectionBorder=this.createSelectionShape(this.bounds);this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.selectionBorder.pointerEvents=!1;this.selectionBorder.rotation= Number(this.state.style[mxConstants.STYLE_ROTATION]||"0");this.selectionBorder.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state);this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX);if(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()this.state.width&&2>this.state.height)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX, mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape));this.customHandles=this.createCustomHandles();this.redraw();this.constrainGroupByChildren&&this.updateMinBounds()}; mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()this.graph.tolerance||Math.abs(a.getGraphY()-this.startY)>this.graph.tolerance))this.inTolerance=!1};mxVertexHandler.prototype.updateHint=function(a){};mxVertexHandler.prototype.removeHint=function(){};mxVertexHandler.prototype.roundAngle=function(a){return Math.round(10*a)/10}; mxVertexHandler.prototype.roundLength=function(a){return Math.round(a)}; mxVertexHandler.prototype.mouseMove=function(a,c){!c.isConsumed()&&null!=this.index?(this.checkTolerance(c),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(c):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(c):this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(c):this.resizeVertex(c),this.updateHint(c)),c.consume()):!this.graph.isMouseDown&&null!=this.getHandleForEvent(c)&&c.consume(!1)}; mxVertexHandler.prototype.moveLabel=function(a){var c=new mxPoint(a.getGraphX(),a.getGraphY()),f=this.graph.view.translate,d=this.graph.view.scale;this.graph.isGridEnabledEvent(a.getEvent())&&(c.x=(this.graph.snap(c.x/d-f.x)+f.x)*d,c.y=(this.graph.snap(c.y/d-f.y)+f.y)*d);this.moveSizerTo(this.sizers[null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1],c.x,c.y)}; mxVertexHandler.prototype.rotateVertex=function(a){var c=new mxPoint(a.getGraphX(),a.getGraphY()),f=this.state.x+this.state.width/2-c.x,d=this.state.y+this.state.height/2-c.y;this.currentAlpha=0!=f?180*Math.atan(d/f)/Math.PI+90:0>d?180:0;0k.x+k.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-k.x-k.width),this.unscaledBounds.y+this.unscaledBounds.height> k.y+k.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-k.y-k.height)));this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:b.x*e)+this.unscaledBounds.x*e,(null!=this.parentState?this.parentState.y:b.y*e)+this.unscaledBounds.y*e,this.unscaledBounds.width*e,this.unscaledBounds.height*e);g.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y);g=Math.cos(f);k=Math.sin(f); f=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY());l=f.x-c.x;d=f.y-c.y;c=g*l-k*d-l;f=k*l+g*d-d;l=this.bounds.x-this.state.x;d=this.bounds.y-this.state.y;b=g*l-k*d;g=k*l+g*d;this.bounds.x+=c;this.bounds.y+=f;this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+c/e);this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+f/e);this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width);this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height);!this.graph.isCellCollapsed(this.state.cell)&& (0!=c||0!=f)?(this.childOffsetX=this.state.x-this.bounds.x+b,this.childOffsetY=this.state.y-this.bounds.y+g):this.childOffsetY=this.childOffsetX=0;this.livePreview&&this.updateLivePreview(a);null!=this.preview&&this.drawPreview()}; mxVertexHandler.prototype.updateLivePreview=function(a){var c=this.graph.view.scale,f=this.graph.view.translate;a=this.state.clone();this.state.x=this.bounds.x;this.state.y=this.bounds.y;this.state.origin=new mxPoint(this.state.x/c-f.x,this.state.y/c-f.y);this.state.width=this.bounds.width;this.state.height=this.bounds.height;this.state.unscaledWidth=null;c=this.state.absoluteOffset;new mxPoint(c.x,c.y);this.state.absoluteOffset.x=0;this.state.absoluteOffset.y=0;c=this.graph.getCellGeometry(this.state.cell); null!=c&&(f=c.offset||this.EMPTY_POINT,null!=f&&!c.relative&&(this.state.absoluteOffset.x=this.state.view.scale*f.x,this.state.absoluteOffset.y=this.state.view.scale*f.y),this.state.view.updateVertexLabelOffset(this.state));this.state.view.graph.cellRenderer.redraw(this.state,!0);this.state.view.invalidate(this.state.cell);this.state.invalid=!1;this.state.view.validate();this.redrawHandles();this.state.setState(a)}; mxVertexHandler.prototype.mouseUp=function(a,c){if(null!=this.index&&null!=this.state){var f=new mxPoint(c.getGraphX(),c.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index<=mxEvent.CUSTOM_HANDLE)null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].execute();else if(this.index==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var d=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=d&&this.rotateCell(this.state.cell,d)}else this.rotateClick(); else{var b=this.graph.isGridEnabledEvent(c.getEvent()),e=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),g=Math.cos(-e),k=Math.sin(-e),l=f.x-this.startX,n=f.y-this.startY,f=k*l+g*n,l=g*l-k*n,n=f,m=this.graph.view.scale,p=this.isRecursiveResize(this.state,c);this.resizeCell(this.state.cell,this.roundLength(l/m),this.roundLength(n/m),this.index,b,this.isConstrainedEvent(c),p)}}finally{this.graph.getModel().endUpdate()}c.consume();this.reset()}}; mxVertexHandler.prototype.isRecursiveResize=function(a,c){return this.graph.isRecursiveResize(this.state)};mxVertexHandler.prototype.rotateClick=function(){}; mxVertexHandler.prototype.rotateCell=function(a,c,f){if(0!=c){var d=this.graph.getModel();if(d.isVertex(a)||d.isEdge(a)){if(!d.isEdge(a)){var b=this.graph.view.getState(a),b=null!=b?b.style:this.graph.getCellStyle(a);null!=b&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(b[mxConstants.STYLE_ROTATION]||0)+c,[a])}b=this.graph.getCellGeometry(a);if(null!=b){var e=this.graph.getCellGeometry(f);null!=e&&!d.isEdge(f)&&(b=b.clone(),b.rotate(c,new mxPoint(e.width/2,e.height/2)),d.setGeometry(a,b)); if(d.isVertex(a)&&!b.relative||d.isEdge(a)){f=d.getChildCount(a);for(b=0;bd&&(a+=f,b&&(a=this.graph.snap(a/e)*e));if(0==d||3==d||5==d)p+=c,b&&(p=this.graph.snap(p/e)*e);else if(2==d||4==d||7==d)s+=c,b&&(s=this.graph.snap(s/ e)*e);b=s-p;f=t-a;k&&(k=this.graph.getCellGeometry(this.state.cell),null!=k&&(k=k.width/k.height,1==d||2==d||7==d||6==d?b=f*k:f=b/k,0==d&&(p=s-b,a=t-f)));l&&(b+=b-n,f+=f-m,p+=q-(p+b/2),a+=v-(a+f/2));0>b&&(p+=b,b=Math.abs(b));0>f&&(a+=f,f=Math.abs(f));d=new mxRectangle(p+g.x*e,a+g.y*e,b,f);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*e+this.minBounds.width*e+Math.max(0,this.x0*e-d.x)),d.height=Math.max(d.height,this.minBounds.y*e+this.minBounds.height*e+Math.max(0,this.y0*e-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),c=this.tolerance;if(null!=this.sizers&&0=mxGraphHandler.prototype.maxCells)this.bends=this.createBends(),this.isVirtualBendsEnabled()&&(this.virtualBends=this.createVirtualBends());this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape=this.createLabelHandleShape();this.initBend(this.labelShape);this.labelShape.setCursor(mxConstants.CURSOR_LABEL_HANDLE);this.customHandles=this.createCustomHandles();this.redraw()};mxEdgeHandler.prototype.createCustomHandles=function(){return null}; mxEdgeHandler.prototype.isVirtualBendsEnabled=function(a){return this.virtualBendsEnabled&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)};mxEdgeHandler.prototype.isAddPointEvent=function(a){return mxEvent.isShiftDown(a)};mxEdgeHandler.prototype.isRemovePointEvent=function(a){return mxEvent.isShiftDown(a)}; mxEdgeHandler.prototype.getSelectionPoints=function(a){return a.absolutePoints};mxEdgeHandler.prototype.createParentHighlightShape=function(a){a=new mxRectangleShape(a,null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a};mxEdgeHandler.prototype.createSelectionShape=function(a){a=new this.state.shape.constructor;a.outline=!0;a.apply(this.state);a.isDashed=this.isSelectionDashed();a.stroke=this.getSelectionColor();a.isShadow=!1;return a}; mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR};mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH};mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED};mxEdgeHandler.prototype.isConnectableCell=function(a){return!0};mxEdgeHandler.prototype.getCellAt=function(a,c){return!this.outlineConnect?this.graph.getCellAt(a,c):null}; mxEdgeHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph),c=this;a.getCell=function(a){var d=mxCellMarker.prototype.getCell.apply(this,arguments);if((d==c.state.cell||null==d)&&null!=c.currentPoint)d=c.graph.getCellAt(c.currentPoint.x,c.currentPoint.y);if(null!=d&&!this.graph.isCellConnectable(d)){var b=this.graph.getModel().getParent(d);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(d=b)}b=c.graph.getModel();if(this.graph.isSwimlane(d)&&null!=c.currentPoint&& this.graph.hitsSwimlaneContent(d,c.currentPoint.x,c.currentPoint.y)||!c.isConnectableCell(d)||d==c.state.cell||null!=d&&!c.graph.connectableEdges&&b.isEdge(d)||b.isAncestor(c.state.cell,d))d=null;this.graph.isCellConnectable(d)||(d=null);return d};a.isValidState=function(a){var d=c.graph.getModel(),d=c.graph.view.getTerminalPort(a,c.graph.view.getState(d.getTerminal(c.state.cell,!c.isSource)),!c.isSource),d=null!=d?d.cell:null;c.error=c.validateConnection(c.isSource?a.cell:d,c.isSource?d:a.cell); return null==c.error};return a};mxEdgeHandler.prototype.validateConnection=function(a,c){return this.graph.getEdgeValidationError(this.state.cell,a,c)}; mxEdgeHandler.prototype.createBends=function(){for(var a=this.state.cell,c=[],f=0;f mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(f=0;fmxEvent.VIRTUAL_HANDLE&&(f[this.index-1]=d)}else this.graph.resetEdgesOnConnect&&(f=null);return null!=b?b:f}; mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){var c=mxUtils.getOffset(this.graph.container),f=a.getEvent(),d=mxEvent.getClientX(f),f=mxEvent.getClientY(f),b=document.documentElement,e=this.currentPoint.x-this.graph.container.scrollLeft+c.x-((window.pageXOffset||b.scrollLeft)-(b.clientLeft||0)),c=this.currentPoint.y-this.graph.container.scrollTop+c.y-((window.pageYOffset||b.scrollTop)-(b.clientTop||0));return this.outlineConnect&&!mxEvent.isShiftDown(a.getEvent())&&(a.isSource(this.marker.highlight.shape)|| mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,f)||(e!=d||c!=f)&&null==a.getState()&&this.marker.highlight.isHighlightAt(e,c))}; mxEdgeHandler.prototype.updatePreviewState=function(a,c,f,d,b){var e=this.isSource?f:this.state.getVisibleTerminalState(!0),g=this.isTarget?f:this.state.getVisibleTerminalState(!1),k=this.graph.getConnectionConstraint(a,e,!0),l=this.graph.getConnectionConstraint(a,g,!1),n=this.constraintHandler.currentConstraint;null==n&&b&&(null!=f?(d.isSource(this.marker.highlight.shape)&&(c=new mxPoint(d.getGraphX(),d.getGraphY())),n=this.graph.getOutlineConstraint(c,f,d),this.constraintHandler.setFocus(d,f,this.isSource), this.constraintHandler.currentConstraint=n,this.constraintHandler.currentPoint=c):n=new mxConnectionConstraint);if(this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var m=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=b?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/m/m,this.marker.highlight.repaint()): this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.marker.getValidState()==d.getState()?mxConstants.DEFAULT_VALID_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/m/m,this.marker.highlight.repaint())}this.isSource?k=n:this.isTarget&&(l=n);if(this.isSource||this.isTarget)null!=n&&null!=n.point?(a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=n.point.x,a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]= n.point.y):(delete a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);a.setVisibleTerminalState(e,!0);a.setVisibleTerminalState(g,!1);(!this.isSource||null!=e)&&a.view.updateFixedTerminalPoint(a,e,!0,k);(!this.isTarget||null!=g)&&a.view.updateFixedTerminalPoint(a,g,!1,l);if((this.isSource||this.isTarget)&&null==f)a.setAbsoluteTerminalPoint(c,this.isSource),null==this.marker.getMarkedState()&&(this.error= this.graph.allowDanglingEdges?null:"");a.view.updatePoints(a,this.points,e,g);a.view.updateFloatingTerminalPoints(a,e,g)}; mxEdgeHandler.prototype.mouseMove=function(a,c){if(null!=this.index&&null!=this.marker){this.currentPoint=this.getPointForEvent(c);this.error=null;!this.graph.isIgnoreTerminalEvent(c.getEvent())&&mxEvent.isShiftDown(c.getEvent())&&null!=this.snapPoint&&(Math.abs(this.snapPoint.x-this.currentPoint.x)mxEvent.VIRTUAL_HANDLE)null!= this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(c);else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,c);var f=this.isSource||this.isTarget?this.getPreviewTerminalState(c):null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint)this.currentPoint=this.constraintHandler.currentPoint.clone(); else if(this.outlineConnect){var d=this.isSource||this.isTarget?this.isOutlineConnectEvent(c):!1;d?f=this.marker.highlight.state:null!=f&&f!=c.getState()&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),f=null)}var b=this.clonePreviewState(this.currentPoint,null!=f?f.cell:null);this.updatePreviewState(b,this.currentPoint,f,c,d);this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor);this.abspoints= b.absolutePoints;this.active=!0}this.updateHint(c,this.currentPoint);this.drawPreview();mxEvent.consume(c.getEvent());c.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(c)&&c.consume(!1)}; mxEdgeHandler.prototype.mouseUp=function(a,c){if(null!=this.index&&null!=this.marker){var f=this.state.cell;if(c.getX()!=this.startX||c.getY()!=this.startY){var d=!this.graph.isIgnoreTerminalEvent(c.getEvent())&&this.graph.isCloneEvent(c.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)0mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){d=this.graph.getModel(); d.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].execute()}finally{d.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var b=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(b=this.constraintHandler.currentFocus.cell);null==b&&this.marker.hasValidState()&&(null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&& "white"!=this.marker.highlight.shape.stroke)&&(b=this.marker.validState.cell);if(null!=b)f=this.connect(f,b,this.isSource,d,c);else if(this.graph.isAllowDanglingEdges()){b=this.abspoints[this.isSource?0:this.abspoints.length-1];b.x=this.roundLength(b.x/this.graph.view.scale-this.graph.view.translate.x);b.y=this.roundLength(b.y/this.graph.view.scale-this.graph.view.translate.y);var e=this.graph.getView().getState(this.graph.getModel().getParent(f));null!=e&&(b.x-=e.origin.x,b.y-=e.origin.y);b.x-=this.graph.panDx/ this.graph.view.scale;b.y-=this.graph.panDy/this.graph.view.scale;f=this.changeTerminalPoint(f,b,this.isSource,d)}}else this.active?f=this.changePoints(f,this.points,d):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}null!=this.marker&&(this.reset(),f!=this.state.cell&&this.graph.setSelectionCell(f));c.consume()}}; mxEdgeHandler.prototype.reset=function(){this.snapPoint=this.points=this.label=this.index=this.error=null;this.isTarget=this.isSource=this.isLabel=this.active=!1;if(this.livePreview&&null!=this.sizers)for(var a=0;am&&(f-=f+k-m);m=l.y+l.height;d+n>m&&(d-=d+n-m)}}else null!=k&&(f-=k.x*e,d-=k.y*e)}}g=g.clone();g.x=this.graph.snap(f/e-this.graph.getView().translate.x-this.graph.gridSize/2);g.y=this.graph.snap(d/e-this.graph.getView().translate.y-this.graph.gridSize/2);c.setGeometry(g);null==a&&(a=this.graph.getDefaultParent());this.cycleAttribute(c);this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",c,"parent",a));b.beginUpdate();try{c=this.graph.addCell(c, a),null!=c&&(this.graph.constrainChild(c),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",c)))}finally{b.endUpdate()}null!=c&&(this.graph.setSelectionCell(c),this.graph.scrollCellToVisible(c),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",c)));return c}; mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)}; var mxCodecRegistry={codecs:[],aliases:[],register:function(a){if(null!=a){var c=a.getName();mxCodecRegistry.codecs[c]=a;var f=mxUtils.getFunctionName(a.template.constructor);f!=c&&mxCodecRegistry.addAlias(f,c)}return a},addAlias:function(a,c){mxCodecRegistry.aliases[a]=c},getCodec:function(a){var c=null;if(null!=a){var c=mxUtils.getFunctionName(a),f=mxCodecRegistry.aliases[c];null!=f&&(c=f);c=mxCodecRegistry.codecs[c];if(null==c)try{c=new mxObjectCodec(new a),mxCodecRegistry.register(c)}catch(d){}}return c}}; function mxCodec(a){this.document=a||mxUtils.createXmlDocument();this.objects=[]}mxCodec.prototype.document=null;mxCodec.prototype.objects=null;mxCodec.prototype.elements=null;mxCodec.prototype.encodeDefaults=!1;mxCodec.prototype.putObject=function(a,c){return this.objects[a]=c};mxCodec.prototype.getObject=function(a){var c=null;null!=a&&(c=this.objects[a],null==c&&(c=this.lookup(a),null==c&&(a=this.getElementById(a),null!=a&&(c=this.decode(a)))));return c};mxCodec.prototype.lookup=function(a){return null}; mxCodec.prototype.getElementById=function(a){if(null==this.elements){if(null==this.document.documentElement)throw Error("mxCodec constructor needs document parameter");this.elements={};this.addElement(this.document.documentElement)}return this.elements[a]};mxCodec.prototype.addElement=function(a){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var c=a.getAttribute("id");null!=c&&null==this.elements[c]&&(this.elements[c]=a)}for(a=a.firstChild;null!=a;)this.addElement(a),a=a.nextSibling}; mxCodec.prototype.getId=function(a){var c=null;null!=a&&(c=this.reference(a),null==c&&a instanceof mxCell&&(c=a.getId(),null==c&&(c=mxCellPath.create(a),0==c.length&&(c="root"))));return c};mxCodec.prototype.reference=function(a){return null};mxCodec.prototype.encode=function(a){var c=null;if(null!=a&&null!=a.constructor){var f=mxCodecRegistry.getCodec(a.constructor);null!=f?c=f.encode(this,a):mxUtils.isNode(a)?c=mxUtils.importNode(this.document,a,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(a.constructor))}return c}; mxCodec.prototype.decode=function(a,c){var f=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){f=null;try{f=window[a.nodeName]}catch(d){}f=mxCodecRegistry.getCodec(f);null!=f?f=f.decode(this,a,c):(f=a.cloneNode(!0),f.removeAttribute("as"))}return f};mxCodec.prototype.encodeCell=function(a,c,f){c.appendChild(this.encode(a));if(null==f||f){f=a.getChildCount();for(var d=0;dthis.minPageBreakDist)?Math.ceil(d/v.height)-1:0,x=b?Math.ceil(a/v.width)-1:0,A=q.x+a,y=q.y+d;null==this.horizontalPageBreaks&&0document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",c):this.diagramContainer.oncontextmenu=c;d.init(this.diagramContainer);d.cellRenderer.initializeLabel=function(b,a){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);mxEvent.addListener(a.node,"click",function(b){for(var d=mxEvent.getSource(b);null!=d&&d!=a.node;){if("A"==d.nodeName){null==d.getAttribute("target")&&null!=d.getAttribute("href")&&(window.open(d.getAttribute("href")),mxEvent.consume(b));break}d= d.parentNode}})};this.hoverIcons=this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(b){var a=mxUtils.getOffset(this.diagramContainer);0mxUtils.indexOf(this.toolbar.staticElements,b)&&(b.parentNode.removeChild(b),a.push(b));b=e}b=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==p)this.toolbar.createTextToolbar();else{for(var c=0;cmxUtils.indexOf(A,v))&&d.setCellStyles(v,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(0=screen.width?116:208;EditorUi.prototype.allowAnimation=!0; EditorUi.prototype.init=function(){var a=this.editor.graph;mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(d){9==d.which&&a.isEnabled()&&!mxEvent.isAltDown(d)&&(a.isEditing()?a.stopEditing(!1):a.selectCell(!mxEvent.isShiftDown(d)),mxEvent.consume(d))}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(d){if(this.isImmediateEditingEvent(d)&&!a.isEditing()&&(!a.isSelectionEmpty()&&0!==d.which&&!mxEvent.isAltDown(d)&&!mxEvent.isControlDown(d)&&!mxEvent.isMetaDown(d))&& (a.escape(),a.startEditing(),mxClient.IS_FF)){var b=a.cellEditor;b.textarea.innerHTML=String.fromCharCode(d.which);d=document.createRange();d.selectNodeContents(b.textarea);d.collapse(!1);b=window.getSelection();b.removeAllRanges();b.addRange(d)}}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})); var c=a.setDefaultParent,f=this;this.editor.graph.setDefaultParent=function(){c.apply(this,arguments);f.updateActionStates()};a.editLink=f.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()};EditorUi.prototype.isImmediateEditingEvent=function(a){return!0}; EditorUi.prototype.getCssClassForMarker=function(a,c,f,d){return"flexArrow"==c?null!=f&&f!=mxConstants.NONE?"geSprite geSprite-"+a+"blocktrans":"geSprite geSprite-noarrow":f==mxConstants.ARROW_CLASSIC?"1"==d?"geSprite geSprite-"+a+"classic":"geSprite geSprite-"+a+"classictrans":f==mxConstants.ARROW_CLASSIC_THIN?"1"==d?"geSprite geSprite-"+a+"classicthin":"geSprite geSprite-"+a+"classicthintrans":f==mxConstants.ARROW_OPEN?"geSprite geSprite-"+a+"open":f==mxConstants.ARROW_OPEN_THIN?"geSprite geSprite-"+ a+"openthin":f==mxConstants.ARROW_BLOCK?"1"==d?"geSprite geSprite-"+a+"block":"geSprite geSprite-"+a+"blocktrans":f==mxConstants.ARROW_BLOCK_THIN?"1"==d?"geSprite geSprite-"+a+"blockthin":"geSprite geSprite-"+a+"blockthintrans":f==mxConstants.ARROW_OVAL?"1"==d?"geSprite geSprite-"+a+"oval":"geSprite geSprite-"+a+"ovaltrans":f==mxConstants.ARROW_DIAMOND?"1"==d?"geSprite geSprite-"+a+"diamond":"geSprite geSprite-"+a+"diamondtrans":f==mxConstants.ARROW_DIAMOND_THIN?"1"==d?"geSprite geSprite-"+a+"thindiamond": "geSprite geSprite-"+a+"thindiamondtrans":"openAsync"==f?"geSprite geSprite-"+a+"openasync":"dash"==f?"geSprite geSprite-"+a+"dash":"cross"==f?"geSprite geSprite-"+a+"cross":"async"==f?"1"==d?"geSprite geSprite-"+a+"async":"geSprite geSprite-"+a+"asynctrans":"circle"==f||"circlePlus"==f?"1"==d||"circle"==f?"geSprite geSprite-"+a+"circle":"geSprite geSprite-"+a+"circleplus":"ERone"==f?"geSprite geSprite-"+a+"erone":"ERmandOne"==f?"geSprite geSprite-"+a+"eronetoone":"ERmany"==f?"geSprite geSprite-"+ a+"ermany":"ERoneToMany"==f?"geSprite geSprite-"+a+"eronetomany":"ERzeroToOne"==f?"geSprite geSprite-"+a+"eroneopt":"ERzeroToMany"==f?"geSprite geSprite-"+a+"ermanyopt":"geSprite geSprite-noarrow"};EditorUi.prototype.createMenus=function(){return null}; EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,c=this.actions.get("paste"),f=this.actions.get("pasteHere");c.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));f.setEnabled(c.isEnabled())}; EditorUi.prototype.initClipboard=function(){var a=this,c=mxClipboard.cut;mxClipboard.cut=function(b){b.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):c.apply(this,arguments);a.updatePasteActionStates()};var f=mxClipboard.copy;mxClipboard.copy=function(b){b.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):f.apply(this,arguments);a.updatePasteActionStates()};var d=mxClipboard.paste;mxClipboard.paste=function(b){var e=null;b.cellEditor.isContentEditing()?document.execCommand("paste", !1,null):e=d.apply(this,arguments);a.updatePasteActionStates();return e};var b=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){b.apply(this,arguments);a.updatePasteActionStates()};var e=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){e.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()}; EditorUi.prototype.initCanvas=function(){var a=this.editor.graph,a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var b=this.graph.getPageLayout(),a=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+b.x*a.width),this.scale*(this.translate.y+b.y*a.height),this.scale* b.width*a.width,this.scale*b.height*a.height)};a.getPreferredPageSize=function(b,a,d){b=this.getPageLayout();a=this.getPageSize();return new mxRectangle(0,0,b.width*a.width,b.height*a.height)};var c=null;if(this.editor.chromeless){this.chromelessResize=c=mxUtils.bind(this,function(b){if(null!=a.container){var d=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),e=a.view.translate,c=a.view.scale,d=mxRectangle.fromRectangle(d);d.x=d.x/c-e.x;d.y=d.y/c-e.y;d.width/=c;d.height/=c;var e= a.container.scrollTop,f=a.container.scrollLeft,g=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)g+=3;var k=a.container.offsetWidth-g,g=a.container.offsetHeight-g;b=b?Math.max(0.3,Math.min(1,k/d.width)):c;k=Math.max((k-b*d.width)/2,0)/b;g=Math.max((g-b*d.height)/4,0)/b;a.view.scaleAndTranslate(b,k-d.x,g-d.y);a.container.scrollTop=e*b/c;a.container.scrollLeft=f*b/c}});var f=mxUtils.bind(this,function(){c(!1)});mxEvent.addListener(window,"resize", f);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",f)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){c(!0)}));this.actions.get("zoomIn").funct=function(b){a.zoomIn();c(!1)};this.actions.get("zoomOut").funct=function(b){a.zoomOut();c(!1)};this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace= "nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var d=mxUtils.bind(this,function(){var b=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=b?parseInt(b["margin-bottom"]||0):0)+(null!=this.tabContainer? 20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",d);d();var b=0,d=mxUtils.bind(this,function(a,d,e){b++;var c=document.createElement("span");c.style.paddingLeft="8px";c.style.paddingRight="8px";c.style.cursor="pointer";mxEvent.addListener(c,"click",a);null!=e&&c.setAttribute("title",e);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",d);c.appendChild(a);this.chromelessToolbar.appendChild(c);return c}),e=d(mxUtils.bind(this, function(b){this.actions.get("previousPage").funct();mxEvent.consume(b)}),Editor.previousLargeImage,mxResources.get("previousPage")||"Previous Page"),g=document.createElement("div");g.style.display="inline-block";g.style.verticalAlign="top";g.style.fontFamily="Helvetica,Arial";g.style.marginTop="8px";g.style.color="#ffffff";this.chromelessToolbar.appendChild(g);var k=d(mxUtils.bind(this,function(b){this.actions.get("nextPage").funct();mxEvent.consume(b)}),Editor.nextLargeImage,mxResources.get("nextPage")|| "Next Page"),l=mxUtils.bind(this,function(){null!=this.pages&&1this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+0.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(20*this.view.scale*this.cumulativeZoomFactor)/20/this.view.scale):0.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale-0.01)/this.view.scale:(this.cumulativeZoomFactor/= this.zoomFactor,this.cumulativeZoomFactor=Math.round(20*this.view.scale*this.cumulativeZoomFactor)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(0.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){this.zoom(this.cumulativeZoomFactor);null!=c&&c(!1);if(null!=z&&mxUtils.hasScrollbars(a.container)){var b=mxUtils.getOffset(a.container),d=a.container.offsetHeight/2-z.y+b.y;a.container.scrollLeft-=(a.container.offsetWidth/ 2-z.x+b.x)*(this.cumulativeZoomFactor-1);a.container.scrollTop-=d*(this.cumulativeZoomFactor-1)}this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),20)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(b,d){if((mxEvent.isAltDown(b)||mxEvent.isControlDown(b)&&!mxClient.IS_MAC||a.panningHandler.isActive())&&(null==this.dialogs||0==this.dialogs.length))for(var e=mxEvent.getSource(b);null!=e;){if(e==a.container){z=new mxPoint(mxEvent.getClientX(b),mxEvent.getClientY(b));a.lazyZoom(d);mxEvent.consume(b); break}e=e.parentNode}}))};EditorUi.prototype.createTemporaryGraph=function(a){a=new Graph(document.createElement("div"),null,null,a);a.resetViewOnRootChange=!1;a.setConnectable(!1);a.gridEnabled=!1;a.autoScroll=!1;a.setTooltips(!1);a.setEnabled(!1);a.container.style.visibility="hidden";a.container.style.position="absolute";a.container.style.overflow="hidden";a.container.style.height="1px";a.container.style.width="1px";return a}; EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0a.container.scrollLeft+0.9*a.container.clientWidth&&(a.container.scrollLeft= Math.min(c.x+c.width-a.container.clientWidth,c.x-10)),c.y>a.container.scrollTop+0.9*a.container.clientHeight&&(a.container.scrollTop=Math.min(c.y+c.height-a.container.clientHeight,c.y-10)))}else{var c=a.getGraphBounds(),f=Math.max(c.width,a.scrollTileSize.width*a.view.scale),d=Math.max(c.height,a.scrollTileSize.height*a.view.scale);a.container.scrollTop=Math.floor(Math.max(0,c.y-Math.max(20,(a.container.clientHeight-d)/4)));a.container.scrollLeft=Math.floor(Math.max(0,c.x-Math.max(0,(a.container.clientWidth- f)/2)))}else a.pageVisible?(c=a.view.getBackgroundPageBounds(),a.view.setTranslate(Math.floor(Math.max(0,(a.container.clientWidth-c.width)/2)-c.x),Math.floor(Math.max(0,(a.container.clientHeight-c.height)/2)-c.y))):(c=a.getGraphBounds(),a.view.setTranslate(Math.floor(Math.max(0,Math.max(0,(a.container.clientWidth-c.width)/2)-c.x)),Math.floor(Math.max(0,Math.max(20,(a.container.clientHeight-c.height)/4))-c.y)))}else a.container.scrollTop=0,a.container.scrollLeft=0,mxUtils.hasScrollbars(a.container)|| a.view.setTranslate(0,0)}; EditorUi.prototype.setPageVisible=function(a){var c=this.editor.graph,f=mxUtils.hasScrollbars(c.container),d=0,b=0;f&&(d=c.view.translate.x*c.view.scale-c.container.scrollLeft,b=c.view.translate.y*c.view.scale-c.container.scrollTop);c.pageVisible=a;c.pageBreaksVisible=a;c.preferPageSize=a;c.view.validateBackground();f&&(a=c.getSelectionCells(),c.clearSelection(),c.setSelectionCells(a));c.sizeDidChange();f&&(c.container.scrollLeft=c.view.translate.x*c.view.scale-d,c.container.scrollTop=c.view.translate.y* c.view.scale-b);this.fireEvent(new mxEventObject("pageViewChanged"))};EditorUi.prototype.setBackgroundColor=function(a){this.editor.graph.background=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(a){this.editor.graph.foldingEnabled=a;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))}; EditorUi.prototype.setPageFormat=function(a){this.editor.graph.pageFormat=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(a){this.editor.graph.pageScale=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))}; EditorUi.prototype.setGridColor=function(a){this.editor.graph.view.gridColor=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))}; EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),c=this.actions.get("redo"),f=this.editor.undoManager,d=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());c.setEnabled(this.canRedo())});f.addListener(mxEvent.ADD,d);f.addListener(mxEvent.UNDO,d);f.addListener(mxEvent.REDO,d);f.addListener(mxEvent.CLEAR,d);var b=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){b.apply(this,arguments);d()};var e=this.editor.graph.cellEditor.stopEditing; this.editor.graph.cellEditor.stopEditing=function(b,a){e.apply(this,arguments);d()};d()}; EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,c=!a.isSelectionEmpty(),f=!1,d=!1,b=a.getSelectionCells();if(null!=b)for(var e=0;ef&&(c=a.substring(f,d+21).replace(/>/g,"\x3e").replace(/</g,"\x3c").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(b){}return c}; EditorUi.prototype.extractGraphModelFromEvent=function(a){var c=null,f=null;if(null!=a&&(a=null!=a.dataTransfer?a.dataTransfer:a.clipboardData,null!=a)){if(10==document.documentMode||11==document.documentMode)f=a.getData("Text");else if(f=0<=mxUtils.indexOf(a.types,"text/html")?a.getData("text/html"):null,mxUtils.indexOf(a.types,null==f||0==f.length))f=a.getData("text/plain");null!=f&&(f=this.editor.graph.zapGremlins(mxUtils.trim(f)),a=this.extractGraphModelFromHtml(f),null!=a&&(f=a))}null!=f&&this.isCompatibleString(f)&& (c=f);return c};EditorUi.prototype.isCompatibleString=function(a){return!1};EditorUi.prototype.saveFile=function(a){!a&&null!=this.editor.filename?this.save(this.editor.getOrCreateFilename()):(a=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(a){this.save(a)}),null,mxUtils.bind(this,function(a){if(null!=a&&0navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(d),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){d.getModel().endUpdate();null!=f&&f()})),a.startAnimation()):d.getModel().endUpdate()}}}; EditorUi.prototype.showImageDialog=function(a,c,f,d){d=this.editor.graph.cellEditor;var b=d.saveSelection(),e=mxUtils.prompt(a,c);d.restoreSelection(b);if(null!=e&&0this.maxTooltipWidth||d>this.maxTooltipHeight?Math.round(100*Math.min(this.maxTooltipWidth/f,this.maxTooltipHeight/d))/100:1;this.tooltip.style.display="block";this.graph2.labelsVisible=null==e||e;this.graph2.addCells(c);var g=this.graph2.getGraphBounds(),l=g.width+2*this.tooltipBorder+4,n= g.height+2*this.tooltipBorder;mxClient.IS_QUIRKS?(n+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible";this.tooltipImage.style.visibility="visible";this.tooltip.style.width=l+"px";this.tooltipTitles&&null!=b&&0Q&&null!=l&&!mxEvent.isShiftDown(c)&&(mxUtils.getValue(l.style,mxConstants.STYLE_SHAPE)!=mxUtils.getValue(T,mxConstants.STYLE_SHAPE)&&mxUtils.getValue(l.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||"image"==mxUtils.getValue(T,mxConstants.STYLE_SHAPE)||1500this.dropTargetDelay&&(b.model.isVertex(l.cell)&&null!=m||b.model.isEdge(l.cell)&&b.model.isEdge(d[0]))){x=l;var n=b.model.isEdge(l.cell)?b.view.getPoint(l): new mxPoint(l.getCenterX(),l.getCenterY()),n=new mxRectangle(n.x-this.refreshTarget.width/2,n.y-this.refreshTarget.height/2,this.refreshTarget.width,this.refreshTarget.height);C.style.left=Math.floor(n.x)+"px";C.style.top=Math.floor(n.y)+"px";null==F&&(b.container.appendChild(C),F=C.parentNode);g(a,e,n,C)}else null==x||!mxUtils.contains(x,a,e)||1500Q&&Q>this.dropTargetDelay||b.model.isEdge(f)?l:null,null!=v&&n){k=[H,G,y,z,D,B];for(n=0;nmxUtils.indexOf(b,e)){c=this.getTagsForStencil(a,e);var m=null!=k?k[e]:null;null!=m&&c.push(m);n.push(this.createVertexTemplateEntry("shape\x3d"+a+e.toLowerCase()+d,Math.round(f*g),Math.round(l*g),"",e.replace(/_/g," "),null,null,this.filterTags(c.join(" "))))}}), !0,!0);this.addPaletteFunctions(a,c,!1,n)}else this.addPalette(a,c,!1,mxUtils.bind(this,function(a){null==d&&(d="");null!=e&&e.call(this,a);if(null!=l)for(var c=0;cmxUtils.indexOf(b,c))&&a.appendChild(this.createVertexTemplate("shape\x3d"+e+c.toLowerCase()+d,Math.round(k*g),Math.round(l*g),"",c.replace(/_/g," "),!0))}),!0)}))}; Sidebar.prototype.destroy=function(){null!=this.graph&&(null!=this.graph.container&&null!=this.graph.container.parentNode&&this.graph.container.parentNode.removeChild(this.graph.container),this.graph.destroy(),this.graph=null);null!=this.pointerUpHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerUpHandler=null);null!=this.pointerDownHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler), this.pointerDownHandler=null);null!=this.pointerMoveHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerMoveHandler=null);null!=this.pointerOutHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),this.pointerOutHandler=null)};"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0);mxConstants.SHADOW_OPACITY=0.25;mxConstants.SHADOWCOLOR="#000000"; mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(c){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1; mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs\x3d":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]"; Graph=function(a,c,f,d,b){mxGraph.call(this,a,c,f,d);this.themes=b||this.defaultThemes;a=this.baseUrl;c=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0d*this.view.scale||Math.abs(e.y-a.getGraphY())> d*this.view.scale){this.isCellSelected(c.cell)||this.setSelectionCell(c.cell);var f=this.selectionCellsHandler.getHandler(c.cell);if(null!=f&&null!=f.bends&&0mxUtils.indexOf(a,e)&&d.push(e)): d.push(a[c])}return d};this.connectionHandler.createTargetVertex=function(b,a){var d=this.graph.view.getState(a),d=null!=d?d.style:this.graph.getCellStyle(a);mxUtils.getValue(d,"part",!1)&&(d=this.graph.model.getParent(a),this.graph.model.isVertex(d)&&(a=d));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var p=new mxRubberband(this);this.getRubberband=function(){return p};var s=(new Date).getTime(),t=0,q=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove= function(){var b=this.currentState;q.apply(this,arguments);b!=this.currentState?(s=(new Date).getTime(),t=0):t=(new Date).getTime()-s};var v=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(b){return null!=this.currentState&&b.getState()==this.currentState&&2E3=b&&(u.y+u.height<=l&&u.y>=a&&u.x+u.width<=k)&&f.push(p);this.getAllCells(b,a,d,c,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"),c=a.getProperty("cell"); null==c?(d=mxUtils.convertPoint(this.container,mxEvent.getClientX(d),mxEvent.getClientY(d)),p.start(d.x,d.y)):null!=B?this.addSelectionCells(B):1s?"a":"p",tt:12>s?"am":"pm",T:12>s?"A":"P",TT:12>s?"AM":"PM",Z:f?"UTC":(String(a).match(b)||[""]).pop().replace(e,""),o:(0d&&"%"==c.charAt(match.index-1))e=b.substring(1);else{var g=b.substring(1,b.length-1);if(0>g.indexOf("{"))for(var k=a;null==e&&null!=k;)null!=k.value&&"object"==typeof k.value&&(e=k.hasAttribute(g)?null!=k.getAttribute(g)?k.getAttribute(g):"":null),k=this.model.getParent(k);null==e&&(e=this.getGlobalVariable(g))}f.push(c.substring(d, match.index)+(null!=e?e:b));d=match.index+b.length}}f.push(c.substring(d));return f.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,c,f){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=f&&(mxEvent.isTouchEvent(c)?f.update(f.getState(this.view.getState(a[1]))):f.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)}; Graph.prototype.connectVertex=function(a,c,f,d,b){var e=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);c==mxConstants.DIRECTION_NORTH?(e.x+=a.geometry.width/2,e.y-=f):c==mxConstants.DIRECTION_SOUTH?(e.x+=a.geometry.width/2,e.y+=a.geometry.height+f):(e.x=c==mxConstants.DIRECTION_WEST?e.x-f:e.x+(a.geometry.width+f),e.y+=a.geometry.height/2);f=this.view.getState(this.model.getParent(a)); var g=this.view.scale,k=this.view.translate,l=k.x*g,k=k.y*g;this.model.isVertex(f.cell)&&(l=f.x,k=f.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(e.x+=a.parent.geometry.x,e.y+=a.parent.geometry.y);f=mxEvent.isControlDown(d)&&!b?null:this.getCellAt(l+e.x*g,k+e.y*g);this.model.isAncestor(f,a)&&(f=null);for(g=f;null!=g;){if(this.isCellLocked(g)){f=null;break}g=this.model.getParent(g)}null!=f&&(g=this.view.getState(a),l=this.view.getState(f),null!=g&&null!=l&&mxUtils.intersects(g,l)&&(f=null)); if(b=!mxEvent.isShiftDown(d)||b)c==mxConstants.DIRECTION_NORTH?e.y-=a.geometry.height/2:c==mxConstants.DIRECTION_SOUTH?e.y+=a.geometry.height/2:e.x=c==mxConstants.DIRECTION_WEST?e.x-a.geometry.width/2:e.x+a.geometry.width/2;null!=f&&!this.isCellConnectable(f)&&(g=this.getModel().getParent(f),this.getModel().isVertex(g)&&this.isCellConnectable(g)&&(f=g));if(f==a||this.model.isEdge(f)||!this.isCellConnectable(f))f=null;g=[];this.model.beginUpdate();try{l=f;if(null==l&&b){for(var k=a,n=this.getCellGeometry(a);null!= n&&n.relative;)k=this.getModel().getParent(k),n=this.getCellGeometry(k);var m=this.view.getState(k),p=null!=m?m.style:this.getCellStyle(k);if(mxUtils.getValue(p,"part",!1)){var s=this.model.getParent(k);this.model.isVertex(s)&&(k=s)}l=this.duplicateCells([k],!1)[0];n=this.getCellGeometry(l);null!=n&&(n.x=e.x-n.width/2,n.y=e.y-n.height/2)}n=null;null!=this.layoutManager&&(n=this.layoutManager.getLayout(this.model.getParent(a)));var t=mxEvent.isControlDown(d)&&b||null==f&&null!=n&&n.constructor==mxStackLayout? null:this.insertEdge(this.model.getParent(a),null,"",a,l,this.createCurrentEdgeStyle());if(null!=t&&this.connectionHandler.insertBeforeSource){var q=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=t.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==t.parent&&(q=d.parent.getIndex(d),d.parent.insert(t,q))}null==f&&null!=l&&(null!=n&&null!=a.parent&&n.constructor==mxStackLayout&&c==mxConstants.DIRECTION_WEST)&&(q=a.parent.getIndex(a),a.parent.insert(l, q));null!=t&&g.push(t);null==f&&null!=l&&g.push(l);null==l&&null!=t&&t.geometry.setTerminalPoint(e,!1);null!=t&&this.fireEvent(new mxEventObject("cellsInserted","cells",[t]))}finally{this.model.endUpdate()}return g}; Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),c=[],f="",d;for(d in this.model.cells)if(f=this.model.cells[d],this.model.isVertex(f)||this.model.isEdge(f))this.isHtmlLabel(f)?(a.innerHTML=this.getLabel(f),f=mxUtils.extractTextWithWhitespace([a])):f=this.getLabel(f),f=mxUtils.trim(f.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0this.view.scale?this.zoom((this.view.scale+0.01)/this.view.scale):this.zoom(Math.round(20*this.view.scale*this.zoomFactor)/20/this.view.scale)};Graph.prototype.zoomOut=function(){0.15>=this.view.scale?this.zoom((this.view.scale-0.01)/this.view.scale):this.zoom(Math.round(20*this.view.scale*(1/this.zoomFactor))/20/this.view.scale)}; Graph.prototype.getTooltipForCell=function(a){var c="";if(mxUtils.isNode(a.value)){var f=a.value.getAttribute("tooltip");if(null!=f)null!=f&&this.isReplacePlaceholders(a)&&(f=this.replacePlaceholders(a,f)),c=this.sanitizeHtml(f);else{f=["label","tooltip","placeholders"];a=a.value.attributes;this.isEnabled()&&f.push("link");for(var d=0;dmxUtils.indexOf(f,a[d].nodeName)&&0this.activationDelay)if(this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==c||null==f||!mxUtils.contains(this.bbox,c,f)))null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!= a&&this.graph.connectionHandler.constraintHandler.reset()):this.reset()}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(d,b,c,f){if(null!=b&&null!=d&&("1"==b.style.snapToPoint||"1"==d.style.snapToPoint)){b=this.getTerminalPort(d,b,f);var k=this.getNextPoint(d,c,f),l=this.graph.isOrthogonal(d),n=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0")),m=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=n)var p=Math.cos(-n),s=Math.sin(-n),k=mxUtils.getRotatedPoint(k,p,s,m);p=parseFloat(d.style[mxConstants.STYLE_PERIMETER_SPACING]|| 0);p+=parseFloat(d.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(b,k,0==n&&l,p);0!=n&&(p=Math.cos(n),s=Math.sin(n),k=mxUtils.getRotatedPoint(k,p,s,m));if(null!=b){n=this.graph.getAllConnectionConstraints(b);l=m=null;for(p=0;pf||c>f)&&this.clear()}}else"a"==a.getSource().nodeName.toLowerCase()?this.clear():null!=this.currentState&& (a.getState()==this.currentState||null==a.getState())&&g.intersects(this.currentState,a.getGraphX(),a.getGraphY())||this.updateCurrentState(a)},mouseUp:function(b,c){var e=c.getSource(),k=this.currentLink;this.clear();if("a"!=e.nodeName.toLowerCase()&&!c.isConsumed()&&(null==c.getState()||!c.isSource(c.getState().control))&&(mxEvent.isLeftMouseButton(c.getEvent())||mxEvent.isTouchEvent(c.getEvent())))null!=k?(g.isBlankLink(k)?window.open(k):(null!=a&&a(c.getEvent()),"#"==k.charAt(0)?window!=window.top? window.open(g.baseUrl+k,"_top"):window.location.hash=k:window!=window.top?window.open(g.getAbsoluteUrl(k),"_top"):window.location=k),c.consume()):null!=d&&!c.isConsumed()&&(Math.abs(this.scrollLeft-g.container.scrollLeft)a&&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;ag||Math.abs(f)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(c,d),this.isSpaceEvent(a)?(c=this.x+this.width,d=this.y+this.height,e=this.graph.view.scale,mxEvent.isAltDown(a.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)),a.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 v=(new Date).getTime(),u=0,x=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(b,a,d,c){x.apply(this,arguments);d!=this.currentTerminalState?(v=(new Date).getTime(),u=0):u=(new Date).getTime()-v;this.currentTerminalState= d};var A=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(b){return null!=this.currentTerminalState&&b.getState()==this.currentTerminalState&&2E3=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==b)?this.graph.getConnectionConstraint(this.state,c,d):null,d=null!=(null!=e?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(d),e):null)?this.fixedHandleImage:null!=e&&null!=c?this.terminalHandleImage:this.handleImage;if(null!=d)return d=new mxImageShape(new mxRectangle(0,0,d.width,d.height),d.src),d.preserveImageAspect=!1,d;d=mxConstants.HANDLE_SIZE; this.preferHtml&&(d-=1);return new mxRectangleShape(new mxRectangle(0,0,d,d),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var y=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(b,a,d){this.handleImage=a==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:a==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return y.apply(this,arguments)};var z=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox= function(b){if(null!=b&&1==b.length){var a=this.graph.getModel(),d=a.getParent(b[0]),c=this.graph.getCellGeometry(b[0]);if(a.isEdge(d)&&null!=c&&c.relative&&(a=this.graph.view.getState(b[0]),null!=a&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox))return mxRectangle.fromRectangle(a.text.boundingBox)}return z.apply(this,arguments)};var D=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(b){var a=this.graph.getModel(),d=a.getParent(b.cell), c=this.graph.getCellGeometry(b.cell);return a.isEdge(d)&&null!=c&&c.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(),c=d.getParent(this.state.cell),e=this.graph.getCellGeometry(this.state.cell); (this.getHandleForEvent(a)==mxEvent.ROTATION_HANDLE||!d.isEdge(c)||null==e||!e.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)this.originalLineTo.apply(this.canvas,arguments);else{var f=Math.round(e/10),g=this.defaultVariation;5>f&&(f=5,g/=3);for(var k=function(b){return"number"===typeof b?b?0>b?-1:1:b===b?0:NaN:NaN}, l=k(b-this.lastX)*d/f,k=k(a-this.lastY)*c/f,d=d/e,c=c/e,e=0;e/g,"\n"));else{var e=d.convertValueToString(b.cell);"0"!=mxUtils.getValue(b.style,"nl2Br","1")&&(e=e.replace(/\n/g,"\x3cbr/\x3e"));d.cellLabelChanged(b.cell,d.sanitizeHtml(e))}d.setCellStyles("html",a);c.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=a?a:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var b=d.getView().getState(d.getSelectionCell()),a="wrap";d.stopEditing();null!=b&&"wrap"== b.style[mxConstants.STYLE_WHITE_SPACE]&&(a=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,a)});this.addAction("rotation",function(){var b="0",a=d.getView().getState(d.getSelectionCell());null!=a&&(b=a.style[mxConstants.STYLE_ROTATION]||b);b=new FilenameDialog(c,b,mxResources.get("apply"),function(b){null!=b&&0document.documentMode)?b.style.filter=a?"progid:DXImageTransform.Microsoft.Gradient(StartColorStr\x3d'#c5ecff', EndColorStr\x3d'#87d4fb', GradientType\x3d0)":"":b.style.backgroundImage=a?"linear-gradient(#c5ecff 0px,#87d4fb 100%)":""}var f=this.editorUi,d=f.editor.graph,b=this.format.getSelectionState(),e=this.createTitle(mxResources.get("font"));e.style.paddingLeft="18px";e.style.paddingTop="10px"; e.style.paddingBottom="6px";a.appendChild(e);e=this.createPanel();e.style.paddingTop="2px";e.style.paddingBottom="2px";e.style.position="relative";e.style.marginLeft="-2px";e.style.borderWidth="0px";e.className="geToolbarContainer";mxClient.IS_QUIRKS&&(e.style.display="block");if(d.cellEditor.isContentEditing()){var g=e.cloneNode(),k=this.editorUi.toolbar.addMenu(mxResources.get("style"),mxResources.get("style"),!0,"formatBlock",g);k.style.color="rgb(112, 112, 112)";k.style.whiteSpace="nowrap";k.style.overflow= "hidden";k.style.margin="0px";this.addArrow(k);k.style.width="192px";k.style.height="15px";k=k.getElementsByTagName("div")[0];k.style.cssFloat="right";a.appendChild(g)}a.appendChild(e);g=this.createPanel();g.style.marginTop="8px";g.style.borderTop="1px solid #c0c0c0";g.style.paddingTop="6px";g.style.paddingBottom="6px";var l=this.editorUi.toolbar.addMenu("Helvetica",mxResources.get("fontFamily"),!0,"fontFamily",e);l.style.color="rgb(112, 112, 112)";l.style.whiteSpace="nowrap";l.style.overflow="hidden"; l.style.margin="0px";this.addArrow(l);l.style.width="192px";l.style.height="15px";mxClient.IS_FF&&(l.getElementsByTagName("div")[0].style.marginTop="-18px");k=e.cloneNode(!1);k.style.marginLeft="-3px";var n=this.editorUi.toolbar.addItems(["bold","italic","underline"],k,!0);n[0].setAttribute("title",mxResources.get("bold")+" ("+this.editorUi.actions.get("bold").shortcut+")");n[1].setAttribute("title",mxResources.get("italic")+" ("+this.editorUi.actions.get("italic").shortcut+")");n[2].setAttribute("title", mxResources.get("underline")+" ("+this.editorUi.actions.get("underline").shortcut+")");var m=this.editorUi.toolbar.addItems(["vertical"],k,!0)[0];mxClient.IS_QUIRKS&&mxUtils.br(a);a.appendChild(k);this.styleButtons(n);this.styleButtons([m]);var p=e.cloneNode(!1);p.style.marginLeft="-3px";p.style.paddingBottom="0px";var s=this.editorUi.toolbar.addButton("geSprite-left",mxResources.get("left"),d.cellEditor.isContentEditing()?function(){document.execCommand("justifyleft",!1,null)}:this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN], [mxConstants.ALIGN_LEFT]),p),t=this.editorUi.toolbar.addButton("geSprite-center",mxResources.get("center"),d.cellEditor.isContentEditing()?function(){document.execCommand("justifycenter",!1,null)}:this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER]),p),q=this.editorUi.toolbar.addButton("geSprite-right",mxResources.get("right"),d.cellEditor.isContentEditing()?function(){document.execCommand("justifyright",!1,null)}:this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN], [mxConstants.ALIGN_RIGHT]),p);this.styleButtons([s,t,q]);if(d.cellEditor.isContentEditing()){var v=this.editorUi.toolbar.addButton("geSprite-removeformat",mxResources.get("removeFormat"),function(){document.execCommand("removeformat",!1,null)},k);this.styleButtons([v])}var u=this.editorUi.toolbar.addButton("geSprite-top",mxResources.get("top"),this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP]),p),x=this.editorUi.toolbar.addButton("geSprite-middle", mxResources.get("middle"),this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE]),p),A=this.editorUi.toolbar.addButton("geSprite-bottom",mxResources.get("bottom"),this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM]),p);this.styleButtons([u,x,A]);mxClient.IS_QUIRKS&&mxUtils.br(a);a.appendChild(p);var y,z,D,B,C,F,H;d.cellEditor.isContentEditing()?(u.style.display="none",x.style.display="none", A.style.display="none",m.style.display="none",D=this.editorUi.toolbar.addButton("geSprite-justifyfull",null,function(){document.execCommand("justifyfull",!1,null)},p),this.styleButtons([D,y=this.editorUi.toolbar.addButton("geSprite-subscript",mxResources.get("subscript")+" (Ctrl+,)",function(){document.execCommand("subscript",!1,null)},p),z=this.editorUi.toolbar.addButton("geSprite-superscript",mxResources.get("superscript")+" (Ctrl+.)",function(){document.execCommand("superscript",!1,null)},p)]), D.style.marginRight="9px",v=p.cloneNode(!1),v.style.paddingTop="4px",p=[this.editorUi.toolbar.addButton("geSprite-orderedlist",mxResources.get("numberedList"),function(){document.execCommand("insertorderedlist",!1,null)},v),this.editorUi.toolbar.addButton("geSprite-unorderedlist",mxResources.get("bulletedList"),function(){document.execCommand("insertunorderedlist",!1,null)},v),this.editorUi.toolbar.addButton("geSprite-outdent",mxResources.get("decreaseIndent"),function(){document.execCommand("outdent", !1,null)},v),this.editorUi.toolbar.addButton("geSprite-indent",mxResources.get("increaseIndent"),function(){document.execCommand("indent",!1,null)},v),this.editorUi.toolbar.addButton("geSprite-code",mxResources.get("html"),function(){d.cellEditor.toggleViewMode()},v)],this.styleButtons(p),p[p.length-1].style.marginLeft="9px",mxClient.IS_QUIRKS&&(mxUtils.br(a),v.style.height="40"),a.appendChild(v)):(n[2].style.marginRight="9px",q.style.marginRight="9px");p=e.cloneNode(!1);p.style.marginLeft="0px"; p.style.paddingTop="8px";p.style.paddingBottom="4px";p.style.fontWeight="normal";mxUtils.write(p,mxResources.get("position"));var G=document.createElement("select");G.style.position="absolute";G.style.right="20px";G.style.width="97px";G.style.marginTop="-2px";for(var I="topLeft top topRight left center right bottomLeft bottom bottomRight".split(" "),K={topLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM],top:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP, mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM],topRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM],left:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE],center:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE],right:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE],bottomLeft:[mxConstants.ALIGN_LEFT, mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP],bottom:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP],bottomRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP]},v=0;ve.div.clientHeight&&(e.div.style.width="40px"); e.addListener(mxEvent.EVENT_HIDE,mxUtils.bind(this,function(){this.currentElt=null}))}g=!0;mxEvent.consume(k)}));mxEvent.addListener(a,"mousedown",mxUtils.bind(this,function(b){g=this.currentElt!=a;null!=document.documentMode&&9<=document.documentMode&&b.preventDefault()}))}};Toolbar.prototype.destroy=function(){null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null)}; function Dialog(a,c,f,d,b,e,g){var k=0;if(mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode))k=80;f+=k;d+=k;var l=Math.max(0,Math.round((document.body.scrollWidth-f)/2)),n=Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-d-a.footerHeight)/3));0document.documentMode)?20:0;a.setAttribute("width",(Editor.useLocalStorage?640:320)+c+"px");a.setAttribute("height",(Editor.useLocalStorage?480:220)+c+"px");a.setAttribute("src",OPEN_FORM);this.container=a},ColorDialog= function(a,c,f,d){function b(){var b=e(0==ColorDialog.recentColors.length?["FFFFFF"]:ColorDialog.recentColors,11,"FFFFFF",!0);b.style.marginBottom="8px";return b}function e(a,d,c,e){d=null!=d?d:12;var f=document.createElement("table");f.style.borderCollapse="collapse";f.setAttribute("cellspacing","0");f.style.marginBottom="20px";f.style.cellSpacing="0px";var l=document.createElement("tbody");f.appendChild(l);for(var m=a.length/d,p=0;pc&&ColorDialog.recentColors.pop())};ColorDialog.resetRecentColors=function(){ColorDialog.recentColors=[]}; var AboutDialog=function(a){var c=document.createElement("div");c.setAttribute("align","center");var f=document.createElement("h3");mxUtils.write(f,mxResources.get("about")+" GraphEditor");c.appendChild(f);f=document.createElement("img");f.style.border="0px";f.setAttribute("width","176");f.setAttribute("width","151");f.setAttribute("src",IMAGE_PATH+"/logo.png");c.appendChild(f);mxUtils.br(c);mxUtils.write(c,"Powered by mxGraph "+mxClient.VERSION);mxUtils.br(c);f=document.createElement("a");f.setAttribute("href", "http://www.jgraph.com/");f.setAttribute("target","_blank");mxUtils.write(f,"www.jgraph.com");c.appendChild(f);mxUtils.br(c);mxUtils.br(c);f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn gePrimaryBtn";c.appendChild(f);this.container=c},PageSetupDialog=function(a){function c(){null==m||m==mxConstants.NONE?(n.style.backgroundColor="",n.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(n.style.backgroundColor=m,n.style.backgroundImage="")}function f(){null== t?(s.removeAttribute("title"),s.style.fontSize="",s.innerHTML=mxResources.get("change")+"..."):(s.setAttribute("title",t.src),s.style.fontSize="11px",s.innerHTML=t.src.substring(0,42)+"...")}var d=a.editor.graph,b,e,g=document.createElement("table");g.style.width="100%";g.style.height="100%";var k=document.createElement("tbody");b=document.createElement("tr");e=document.createElement("td");e.style.verticalAlign="top";e.style.fontSize="10pt";mxUtils.write(e,mxResources.get("paperSize")+":");b.appendChild(e); e=document.createElement("td");e.style.verticalAlign="top";e.style.fontSize="10pt";var l=PageSetupDialog.addPageFormatPanel(e,"pagesetupdialog",d.pageFormat);b.appendChild(e);k.appendChild(b);b=document.createElement("tr");e=document.createElement("td");mxUtils.write(e,mxResources.get("background")+":");b.appendChild(e);e=document.createElement("td");e.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var n=document.createElement("button");n.style.width="18px"; n.style.height="18px";n.style.marginRight="20px";n.style.backgroundPosition="center center";n.style.backgroundRepeat="no-repeat";var m=d.background;c();mxEvent.addListener(n,"click",function(b){a.pickColor(m||"none",function(b){m=b;c()});mxEvent.consume(b)});e.appendChild(n);mxUtils.write(e,mxResources.get("gridSize")+":");var p=document.createElement("input");p.setAttribute("type","number");p.setAttribute("min","0");p.style.width="40px";p.style.marginLeft="6px";p.value=d.getGridSize();e.appendChild(p); mxEvent.addListener(p,"change",function(){var b=parseInt(p.value);p.value=Math.max(1,isNaN(b)?d.getGridSize():b)});b.appendChild(e);k.appendChild(b);b=document.createElement("tr");e=document.createElement("td");mxUtils.write(e,mxResources.get("image")+":");b.appendChild(e);e=document.createElement("td");var s=document.createElement("a");s.style.textDecoration="underline";s.style.cursor="pointer";s.style.color="#a0a0a0";var t=d.backgroundImage;mxEvent.addListener(s,"click",function(b){a.showBackgroundImageDialog(function(b){t= b;f()});mxEvent.consume(b)});f();e.appendChild(s);b.appendChild(e);k.appendChild(b);b=document.createElement("tr");e=document.createElement("td");e.colSpan=2;e.style.paddingTop="16px";e.setAttribute("align","right");var q=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});q.className="geBtn";a.editor.cancelFirst&&e.appendChild(q);var v=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();a.setPageFormat(l.get());d.background!=m&&a.setBackgroundColor(m);d.backgroundImage!== t&&a.setBackgroundImage(t);d.gridSize!==p.value&&d.setGridSize(parseInt(p.value))});v.className="geBtn gePrimaryBtn";e.appendChild(v);a.editor.cancelFirst||e.appendChild(q);b.appendChild(e);k.appendChild(b);g.appendChild(k);this.container=g}; PageSetupDialog.addPageFormatPanel=function(a,c,f,d){function b(b,a,d){if(d||p!=document.activeElement&&s!=document.activeElement){b=!1;for(a=0;aMAX_AREA||0>=t.value?"red":"";q.style.backgroundColor=t.value*q.value>MAX_AREA||0>=q.value?"red":""}var d=a.editor.graph,b= d.getGraphBounds(),e=d.view.scale,g=Math.ceil(b.width/e),k=Math.ceil(b.height/e),l,e=document.createElement("table"),n=document.createElement("tbody");e.setAttribute("cellpadding",mxClient.IS_SF?"0":"2");b=document.createElement("tr");l=document.createElement("td");l.style.fontSize="10pt";l.style.width="100px";mxUtils.write(l,mxResources.get("filename")+":");b.appendChild(l);var m=document.createElement("input");m.setAttribute("value",a.editor.getOrCreateFilename());m.style.width="180px";l=document.createElement("td"); l.appendChild(m);b.appendChild(l);n.appendChild(b);b=document.createElement("tr");l=document.createElement("td");l.style.fontSize="10pt";mxUtils.write(l,mxResources.get("format")+":");b.appendChild(l);var p=document.createElement("select");p.style.width="180px";l=document.createElement("option");l.setAttribute("value","png");mxUtils.write(l,mxResources.get("formatPng"));p.appendChild(l);l=document.createElement("option");ExportDialog.showGifOption&&(l.setAttribute("value","gif"),mxUtils.write(l,mxResources.get("formatGif")), p.appendChild(l));l=document.createElement("option");l.setAttribute("value","jpg");mxUtils.write(l,mxResources.get("formatJpg"));p.appendChild(l);l=document.createElement("option");l.setAttribute("value","pdf");mxUtils.write(l,mxResources.get("formatPdf"));p.appendChild(l);l=document.createElement("option");l.setAttribute("value","svg");mxUtils.write(l,mxResources.get("formatSvg"));p.appendChild(l);ExportDialog.showXmlOption&&(l=document.createElement("option"),l.setAttribute("value","xml"),mxUtils.write(l, mxResources.get("formatXml")),p.appendChild(l));l=document.createElement("td");l.appendChild(p);b.appendChild(l);n.appendChild(b);b=document.createElement("tr");l=document.createElement("td");l.style.fontSize="10pt";mxUtils.write(l,mxResources.get("zoom")+" (%):");b.appendChild(l);var s=document.createElement("input");s.setAttribute("type","number");s.setAttribute("value","100");s.style.width="180px";l=document.createElement("td");l.appendChild(s);b.appendChild(l);n.appendChild(b);b=document.createElement("tr"); l=document.createElement("td");l.style.fontSize="10pt";mxUtils.write(l,mxResources.get("width")+":");b.appendChild(l);var t=document.createElement("input");t.setAttribute("value",g);t.style.width="180px";l=document.createElement("td");l.appendChild(t);b.appendChild(l);n.appendChild(b);b=document.createElement("tr");l=document.createElement("td");l.style.fontSize="10pt";mxUtils.write(l,mxResources.get("height")+":");b.appendChild(l);var q=document.createElement("input");q.setAttribute("value",k);q.style.width= "180px";l=document.createElement("td");l.appendChild(q);b.appendChild(l);n.appendChild(b);b=document.createElement("tr");l=document.createElement("td");l.style.fontSize="10pt";mxUtils.write(l,mxResources.get("background")+":");b.appendChild(l);var v=document.createElement("input");v.setAttribute("type","checkbox");v.checked=null==d.background||d.background==mxConstants.NONE;l=document.createElement("td");l.appendChild(v);mxUtils.write(l,mxResources.get("transparent"));b.appendChild(l);n.appendChild(b); b=document.createElement("tr");l=document.createElement("td");l.style.fontSize="10pt";mxUtils.write(l,mxResources.get("borderWidth")+":");b.appendChild(l);var u=document.createElement("input");u.setAttribute("type","number");u.setAttribute("value","0");u.style.width="180px";l=document.createElement("td");l.appendChild(u);b.appendChild(l);n.appendChild(b);e.appendChild(n);mxEvent.addListener(p,"change",c);c();mxEvent.addListener(s,"change",function(){var b=Math.max(0,parseFloat(s.value)||100)/100; s.value=parseFloat((100*b).toFixed(2));0=parseInt(s.value))mxUtils.alert(mxResources.get("drawingEmpty"));else{var b=m.value,c=p.value,e=Math.max(0,parseFloat(s.value)||100)/100,f=Math.max(0,parseInt(u.value)),g=d.background;if(("svg"==c||"png"==c)&&v.checked)g=null;else if(null==g||g==mxConstants.NONE)g="#ffffff";ExportDialog.exportFile(a,b,c,g,e,f)}}));x.className= "geBtn gePrimaryBtn";var A=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});A.className="geBtn";a.editor.cancelFirst?(l.appendChild(A),l.appendChild(x)):(l.appendChild(x),l.appendChild(A));b.appendChild(l);n.appendChild(b);e.appendChild(n);this.container=e};ExportDialog.showGifOption=!0;ExportDialog.showXmlOption=!0; ExportDialog.exportFile=function(a,c,f,d,b,e){var g=a.editor.graph;if("xml"==f)ExportDialog.saveLocalFile(a,mxUtils.getXml(a.editor.getGraphXml()),c,f);else if("svg"==f)ExportDialog.saveLocalFile(a,mxUtils.getXml(g.getSvg(d,b,e)),c,f);else{var k=g.getGraphBounds(),l=mxUtils.createXmlDocument(),n=l.createElement("output");l.appendChild(n);l=new mxXmlCanvas2D(n);l.translate(Math.floor((e/b-k.x)/g.view.scale),Math.floor((e/b-k.y)/g.view.scale));l.scale(b/g.view.scale);(new mxImageExport).drawState(g.getView().getState(g.model.root), l);n="xml\x3d"+encodeURIComponent(mxUtils.getXml(n));l=Math.ceil(k.width*b/g.view.scale+2*e);b=Math.ceil(k.height*b/g.view.scale+2*e);n.length<=MAX_REQUEST_SIZE&&l*bb&&(d=Math.max(0,b-this.window.table.clientWidth));c+this.window.table.clientHeight>a&&(c=Math.max(0,a-this.window.table.clientHeight));(this.window.getX()!=d||this.window.getY()!=c)&&this.window.setLocation(d,c)}));var l=a.createOutline(this.window);this.window.addListener(mxEvent.RESIZE,mxUtils.bind(this,function(){l.update(!1);l.outline.sizeDidChange()}));this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){l.suspended= !1;l.outline.refresh();l.update()}));this.window.addListener(mxEvent.HIDE,mxUtils.bind(this,function(){l.suspended=!0}));this.window.addListener(mxEvent.NORMALIZE,mxUtils.bind(this,function(){l.suspended=!1;l.update()}));this.window.addListener(mxEvent.MINIMIZE,mxUtils.bind(this,function(){l.suspended=!0}));var n=l.createGraph;l.createGraph=function(b){var a=n.apply(this,arguments);a.gridEnabled=!1;a.pageScale=g.pageScale;a.pageFormat=g.pageFormat;a.background=g.background;a.pageVisible=g.pageVisible; var d=mxUtils.getCurrentStyle(g.container);k.style.backgroundColor=d.backgroundColor;return a};l.init(k);a.editor.addListener("resetGraphView",e);a.addListener("pageFormatChanged",e);a.addListener("backgroundColorChanged",e);a.addListener("backgroundImageChanged",e);a.addListener("pageViewChanged",function(){e();l.update(!0)});if(l.outline.dialect==mxConstants.DIALECT_SVG){var m=a.actions.get("zoomIn"),p=a.actions.get("zoomOut");mxEvent.addMouseWheelListener(function(b,a){for(var d=!1,c=mxEvent.getSource(b);null!= c;){if(c==l.outline.view.canvas.ownerSVGElement){d=!0;break}c=c.parentNode}d&&(a?m.funct():p.funct(),mxEvent.consume(b))})}},LayersWindow=function(a,c,f,d,b){function e(b){if(k.isEnabled()&&null!=b){var d=new FilenameDialog(a,b.value||mxResources.get("background"),mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&k.getModel().setValue(b,a)}),mxResources.get("enterName"));a.showDialog(d.container,300,100,!0,!0);d.init()}}function g(){function b(a,d,c,f){var l=document.createElement("div"); l.className="geToolbarContainer";l.style.overflow="hidden";l.style.position="relative";l.style.padding="4px";l.style.height="22px";l.style.display="block";l.style.backgroundColor="whiteSmoke";l.style.borderWidth="0px 0px 1px 0px";l.style.borderColor="#c3c3c3";l.style.borderStyle="solid";l.style.whiteSpace="nowrap";var n=document.createElement("div");n.style.display="inline-block";n.style.width="100%";n.style.textOverflow="ellipsis";n.style.overflow="hidden";mxEvent.addListener(l,"dragover",function(b){b.dataTransfer.dropEffect= "move";s=a;b.stopPropagation();b.preventDefault()});mxEvent.addListener(l,"dragstart",function(b){p=l;mxClient.IS_FF&&b.dataTransfer.setData("Text","\x3clayer/\x3e")});mxEvent.addListener(l,"dragend",function(b){null!=p&&null!=s&&k.addCell(c,k.model.root,s);s=p=null;b.stopPropagation();b.preventDefault()});var u=document.createElement("img");u.setAttribute("draggable","false");u.setAttribute("align","top");u.setAttribute("border","0");u.style.cursor="pointer";u.style.padding="4px";u.setAttribute("title", mxResources.get("lockUnlock"));var v=k.view.getState(c),x=null!=v?v.style:k.getCellStyle(c);"1"==mxUtils.getValue(x,"locked","0")?u.setAttribute("src",Dialog.prototype.lockedImage):u.setAttribute("src",Dialog.prototype.unlockedImage);mxEvent.addListener(u,"click",function(b){if(k.isEnabled()){var a=null;k.getModel().beginUpdate();try{a="1"==mxUtils.getValue(x,"locked","0")?null:"1",k.setCellStyles("locked",a,[c])}finally{k.getModel().endUpdate()}"1"==a&&k.removeSelectionCells(k.getModel().getDescendants(c)); mxEvent.consume(b)}});n.appendChild(u);u=document.createElement("input");u.setAttribute("type","checkbox");u.setAttribute("title",mxResources.get("hideIt",[c.value||mxResources.get("background")]));u.style.marginLeft="4px";u.style.marginRight="6px";u.style.marginTop="4px";n.appendChild(u);k.isEnabled()||u.setAttribute("disabled","disabled");k.model.isVisible(c)&&(u.setAttribute("checked","checked"),u.defaultChecked=!0);mxEvent.addListener(u,"click",function(b){k.isEnabled()&&(k.model.setVisible(c, !k.model.isVisible(c)),mxEvent.consume(b))});mxUtils.write(n,d);l.appendChild(n);if(k.isEnabled()){if(mxClient.IS_TOUCH||mxClient.IS_POINTER||mxClient.IS_VML||mxClient.IS_IE&&10>document.documentMode)d=document.createElement("div"),d.style.display="block",d.style.textAlign="right",d.style.whiteSpace="nowrap",d.style.position="absolute",d.style.right="6px",d.style.top="6px",0 b&&(d=Math.max(0,b-this.window.table.clientWidth));c+this.window.table.clientHeight>a&&(c=Math.max(0,a-this.window.table.clientHeight));(this.window.getX()!=d||this.window.getY()!=c)&&this.window.setLocation(d,c)}))};(function(){Sidebar.prototype.tagIndex="vX3ZcttI0vXTTPz/XIihlrvb31xqt2YsWy3K9tw5QBISMSIBNhbL6qefczKrsJBYCosmgkGCJPJUoZasrNxq+/M69nbrmRfH0Uvyt+N/yAU+D16n1VtnZ36Y/u3k+KP/yI9TQ+aFTxt/hYs0i0NXjPvgaT0a5MuuhJDt2mH2Mc69zSbKCHMRZYuNX4JKXyJ8e/FeXRqlwPkj81YllMcoi3vArP0fcRSW6MMoXa7lYZLgKfQ2+CvobprzIF5mG48lW6AlftoE4ZNLNf6ZbXdHKMZSnxz/gvtif7fhUyy85TObOlxF8qt8uEOdDIUyI84L2b6VXo/idB09RWwex7HzyTTryfFcmrVcRbSV6QaHphrV3fONH658EuzNpuQ5CENChHZaJptg6wr2ICP3G+pQg7jScd4M3Yz7LVhxgjx4AafXuNo+xEGl4dJ17BPcseUOH/Hk+EMUB39FYSqjYF3+Mgjuqx+nwVLofxSXLVB/ZbE/O10u/SQB+TkKjyOSJP4yi4OUz/Xs8/3ghyasLI22XhrISPTwBR9PPmb18T825JyhTudlxPfHjZesW4DmqD+7Xe82MO2Pwnc2yAaPzxqAobBXwZKCRzSHqZgTxrmHObVXb1vjlZd6Cy/h36tFN9StFz/76W7jLUmxlW/CSoiZrCOuAN0o84t/8fboMX3x5IeV/8PfRLutLirPATGTZey/rOIA/e/6oPNsAapgZxpniVWBzHvnh8vgcPw0gHzzF0mQ8vEWWFfYXZtowa+t1Gdgplj/UAc//hFI69ji8SmMNkmj3YsH1scZF2zLkPtgQXqWLdm0HMoy7+fgbYK60D+6J8NZ8NeDt3kuqkRBw9api/ick07GmTwJFgd0TSCTcOXLirgKdhtMELZP5sVemIKDcIgt/VBG086Pt9KPh9hSh0pLOU+LPVoz1x+DpyzWKXFyfAUGKax2mcl4Ijzv6AmNqzv0qffEK4O5iH66tJ322GE9ugm3uyyV4b6NwiCNeLUKEky3Q758QIsekNlz4W84Z8hNP/mQo2KOPdvvdtqXWUEz6EUDc2i8P452Z2ijmlErLbczDdoBc4lHiXdxIAUvsmCz0oousiQIyeA76Pu3vFCodNSD6jpIP2QL+7RoZI9U0TKN9OrJjP8m+g8XNyEES0jhzXy4ntD3NumaY2KNOSNDfO0Lj8F3/ONATF6uY0zb1gIZQberAq+Y3lymuY/wl5EZb7deiO7lqHXlMx+9HbiizNF87HfR3GII6CjaQhjCh28/Q1lF9sbXPnW00OGxW0chP9MoE5bsQlXhpUnOv1qg9nGyTRqQOXgYJbJDyNI1WWu+opfkE7Nu7LyVuWrBfZ3/8ZGTvxhGyZ/CrZvH1R4EpPJCsoBAh5HNIa1bq+5e2SN/iHbBUuSWqvxSC7gH9RmDCzgYl2jv1yT1t7i42WqfR2z6tReTVYM3yqBf7Q21Pby76MWP52sfq/kQtnx/cSfDfIsnlDr1h5hzv5OhKYql30oFHXSUZoYVidEp5cW6zXO5X5e9s4zL6h+Zn8kw/5MXAwDu/bply4lUBg8vdLtZFutYI3AMGVtJVdxrL2J/ejgtaHtUqIr8oKKiwahndY1A89eQdd+fl4n+HPvL16V0dSvQvb/Dtls59z5SaYw86qhpgkrB8kVmffBkHrmLYXMwL52OKLtSRhvFPNjudBvkuDo8EJwPsrVM24lZfwmxVwZPfQxkp2xkkc+L//hLgmWP3Mt5m8DvHDVfwOPJYLKtx3t3fqQPoF+9H2j6clvtUX/9cGF5VQ2Tqr9fBwk/DG9Tanc2/jVAp4qq6hbbPshL3EKT83aIlJ0wYEK+B/0OAR/zqzpUKa4TtxBOw/yqq4W+nV6cX11L63hPYZRg3SSb6M8d7Sbv5PjaD/1Y2Ind5zVV5xCCMzGSouv3iG1EZGTOVKiOyFu2NJ2iOl/dKaXIVtInIcVAC5azX7kDigLZU5BVWAVbfXXLlL8fUiZB086pTPh/h4S+kY+7SM+8EP2oO5wmNWv5fuyXtCWjrZ+i/xv1SxWiOJLdx26DZQrzv35KlykuDpgxFDgiMnqUoNtIr9q3arU0kO1F2sq3ARuI5oLxfCgVlwlvI1lCQ8fW/kSN3fx1uxAd22MUL4IVWK4D5edCW4x1B3pImgtEaXkguNfSz7doRjIZEcewsxceudvVbpArhGYIY2/M5pdR1kWSEX0lPA3v0hFdNA+BSFt2PyafVJN10X3zpF5m9C7saG6l+bdRKolYHS599kXIta2uQwraKEqTFJez7krW0902bru2+dasHSHrva4ahN2WN5QUAbs4Ep0vV6KVtEAT3eyUwsCHiKzetZlJBpFUCwMThQhfiEttok+J/mOkPWStQk3Wvhoqo28tsbW8xqK/X8vDNGJgO65LranwmuJ0Z33zPYehMgwLgphuz1s5lwDk0ryTXFmiFHGrqG7f0bH0FuipVPScesnR+WcWqGK5sWxLNzs/o7Ut7y2ob06OF7HvaRfoirHTJdgJ5+T45y/H06CdNNWKltJ+OG216on2rrFWYlHqh4R6/TYV3K9NFTMiTB+glnr1QLs91/b/DW+/vzvlI99xTAdhYGXpHk/ugv+rC379EzTC//5Oyjh+s/qXC5j2ASLqOv9Ss/NLQDOMfYT8Hyyn+k+fetfhas3H43L3KrxEuvXXYzRLfSs4MLcqIB/+ZCq0dydaxwnw7mIsN0ujRAT4YMB7PwlWuvydZ3FsbSNmZTphB8XL9uXQEUs62xlrnsViUqo86C+EaFoR3GHkqZpYuDuMzIpmlusOJC3TyCNrcR5oNtTdwa/H2y0Hlq5Wi1p9aSfGBBDkSuNhfpvgabixPvltPM77nhh+wOUUw74wy2H75ONPo3rdeRQOD929lPxxE0UxdEP8HxqiZnvC3u1wMiNXNc5hqKgYcR/hYhSYBcERYY7dsyA00zaQR9HzUtVufUnP114g61NfOii3hcfBJ0KtS25UqheFTwVN8r3a6Pz+gUL314oOr6TXq6lHDcqFD6GdytZYNyh2d9SrKlUQNcgOA4qxY7OWyEQ2AnA1WcWqb2uAqsG53PjYbkg7+AmURObapQrQ38guamS7XvGKTmrelpOwXglRT1pnXN1xx7j1zDtmcaRuQLYy1HwmaeFeVAP7+RF2PvErMkN82TnUa1DuoPoRnyr4jnDpDEKoBurVt3XUeFNFV0x1OP6Aic+JEPZubYle8+seeio+Ml0xoW3aoPK9aTmYe9P6j3EAk7oZd33J58oOloY79OogMb5IO8lu3J1EW8mQDSjS+GGMoH83kv7XkfTcLg6ij6Dc5LAG68A4FbUL1R0RvCtoG8QMiaJD3859mG/w2hLZPILMxWEDrzM/XtpvLjWh3aBgA5sBjKRkiuDsBI8QzTSvlWWouwnUM4VnGYw6sVdrPMohZqchFFLWy4ADDXUyXANN3m0ObkDikBuMdB5t0GN86jWE3Sco7g99lOop9w3SUOcaw2o3aaOdt41KHFCOSrRb/uBkOStA7kQFSEWdaH07tan79POi1429k8t8o/7/gJyGa9P7cOoIdtJ+4mPv1HKWnn0+jD6CQ2RR9aZOa6DOtpDDxY8kC3WnRFcGDvsGg9I+wgOWzORR1cBGlYxFot42obQb3wu/b7F6qBnph7eBS8fJMfiJX5lv7ZRwkwuDRD33r6NoRZU4/KK5KUYTbIdWaHYt1iTxQMf2cZXZ7aPxmtE6y6wSE6Yj6ucsxa698EIUtXBR0STjWto2XitocEiHO3BJK21MGC60p4EwVVblPZtIhaXYmjb1v3qODNkojgKOii02aRJg08y+zc3qC/rTmNlPbWueidJ81WXm6QahLBquIA3LhJ0YEP7Xa+N9XT+E+kKPhZtjlEh0yBTtWAs2RXt2Ar9RQwyCvaO7pEjDpdFtHHxad0UW4I8MVlas0Fh2NVBALxbqaiBf9doVRNeCgUAwmOl94hRaItrDa8UAo9AtL/x+KEWSx15hVU7U2d51ULTiYDyYPurRWQXineypB1bHEg+qA+Rqowmw+oCWTWJOhJELD7CNxCLiWuQk/dpFSQ9NVBnjQ3h8n5pWSCkhSEt1N9hLIhNi6yFuihI7/IRyD2PxNZE40Vq6GZaZ7/ZWDWOYw9YqOz7raZfYH1rKb8ZhxM4V3uEq49ETbRTwpXEbMB99SOeXc/ElMm6E1gGhcMR2hPlUgdkLqRqCdnKsTwWvtj2wSQv58PBAV+Q3LcM6bk+G+kelsa038RAYuEPk/iUTAYqX8yRw367KMFSjma3uECRal5YQXtV1bipM4ww4GNLs/r+D2X03TpIUby/PdSPl0R2zzSHaDQoSxu1NEyBUDcanNTDxAH3Bha9BQyJM67AMG6A3rOYXtIaKcITIntQo6g4LUT/tYutP3WdZq9ejxEsDjhJpbDssS0w3w56m9RlGo3I9q6nuXlP0gb+9r0Bi+4VtelajLHWG43DBllEmzcTAHy6uyIC68NfeSv3HYEKATnABPInjU2k50egY56K/3p1z+298sOk9F0C92OCS74xYUgBAMQA8jSOfvpgbqu7p1vW2xdzDQildMj3017tPGrIaGiP52xUysoXaAxIbb59dvIbeNgIjBJ1cDqHFGpCa0T4VDtlNDgRzdY7eF/FGZ9yYShGiUh9soQ/VcN04uYmmb13MqmETA5TYsPmlPwrFUomC7QM2e4qjbCdxCbzo8QT3FxQrYxTGaSSDu1aCaUcwK3ZpoRuPmIMxTEvcdBGthbh47pomRYcaO1wt1DI0FvaWbxpbNmlj5HGpkzfzZ8Q1irFtSmiNUBPmlcvIvWnpsYLdYGVr1gWCERK90gIjHB0aZgi3/Krb8KsozlOR5JH8pd8mgZYBpfEAb1fEg48Gqa5AE5ViRfoWQX4YJHOwmNjlSaBvTm/J8SVCUcK8Pc1aI/7t5qbhyKjtanUkjfl2RcwfyHyH44dReGRm5vdkh50u9AszDJNMVkUMCLGGdbRwsnoWhetKcqvYXDKiQc5zySDHTyUHwyHCDGGIEjqYarhAV6Fq6pNmQfARU258R9iJJNwwox25qyQjgx3e5vsUqOQsL+EmklUFCl4VYvb4wqTlXa7EdeUjM1q8ZTlzsUSqWfStHuzyjKO2EE+s3yOJWvebnaiof+jtkP5IAk7epICv0QYW+jeAn9NZJl+nClO2gz6oC5fh/CZZ0RsXgNRlgeQ00SBv4QttJUY2FnxouaPLWQbJMprZ5DYEKiW6afHmrZLNzuAKIGuUccoTZ4x2PrYPYQOg2Zh5DXqj3F58yZ1JXuhUITAZfJ9q0Rpx5lsm3ZJEEDbEDz41sg3tqox1Tkqk3+ChEuzgHuhtktnNGVcthC2Gj/Av0oxTuSNTalwH6bClXk7i2jS0ELhIcBGeI1ijxmFq1AM8mJpOBNroHjoQD4kCcjewEqT6iBWtW/UwLQp0LyeAXdWm3Cn+GDVCRC9WqnRTdQdiUypDa6tXnmZ0mK7iVmG1nBY4d5SdCBA5EI1/2FSAOxsONBUg4r3VSlJ0+ERzY57hWwlrItg8QUqlBdROPhTSholMVskv+5NrDNhX7DrE5Qx8PKZKZaK+18QcZ0xIOuWQahxMDatNHbakMoXrrqIjzB1R6Mnsl+PrS/p2nEeXGvzO2HSXqtbDvfvlPQOd/j8jMFCvv5dME3k6VXUfLhDGFPdvLU6iG966sCI3Yh6geWvba3TDXQVIU6oySxH4buD5gC/z279PUc4B+BSYNrna9G1e5PnJ27xUCBrm6/z83fHxMdumV4ErtDdz54n+3Fz3IUNmBcTxlCixi3Ka5GtkG5NHfFLDCqcgfOASn9FTmi0PtwwCOufvo1HGUVvBexzKvunJ/NFghDrMtLRXwBbvs3/5r+zsarbmVor7uzle1AWLbcGJpjaxoxNlbtND6ltkN9FR5fa4NYgwomzNOkIRF4ND8xaK02TZU7KzbgdIH5B/JZebzWd/lDwVZp5tG54HRf2QhsZlNtXh4heTx6Vd/deEgGin3s+XJxexft1dBLBTcaXn4LJm4i6SUkrP0mU3FRM42vHoWJCQMJHwFltv1dmxh/JkkAxxyf/pgcgMa3k1WsJNmmjLdSB570eSTR+8InPCLX/IPSXbMWQF0qlt8zB00bxggUA1SfMC9XRr2AFuXGoOsZm3YIKjJaJzTin0rgLkABYuAL34RtLgYLFjRvuaFDotYP42Y/40DHgqWDBgf3Zkyq1DQT9osQjUWe26YpTqEG6zn0e2LtWatNesC/QArh+CyRdrkoqdIk7WBGpCM8ckkNMgqn/uYMQHZjRhrZApK8fGXo2xPBgTjHoxBsyGQhzgWcU3hKem+E3gGRJlLYSa/89GRDk1MgIcoHoyMmH+pT81DpKxtNpVkuVvDAg7ZDQIm13vijavqvqvwewByPDWrD3dZjcIY1xH10qiEbn+0pGxhMX9fVEUlzNJGKr8c4sYepGmIFxqNr+3K/NO0k3nZe4iZA11LXMVQELRbYp6xjhRmTY92voI9uNKvZmdHOnhKGYnZVO8DIX7CHsarK5Gd1ZcDcW7y6DyLe3zPnHlC2nV38g5Q5KBoSWwsSf65yo6GFJLjG47tqao1p0p+NDkda/BH1r7wF/++sv72en5EQQLQcyliFy06Al00QhUiC3ueExdPBmYpLrovdiWqKHKC3SPb5eqoWhILGuFJQiuXScU1NObJJ2D6C+48pYbtkamdAerGT4j8Q5GUYHXIOp2QAaPCG3Oo8PHDYXLcBm/IpklkxctezBhQ/4hGNPzH6Oh1N/RDcFStCriG6nqAzdqkcVUFLLXvWlnN5bSCNKa5uXAzaAPDqWYKXAodwzG0ch5sF/RQfLRAj1qbjQWJb3+WDbljfZWYwKcbnoyPRhufMN7t3B/yi8d5191zMm3prHXQQ69MpwS0Bgw3NM6Sf+Vj8Znzpxz4ARJ7Rq0SYiOB9Dsil4AptP8cRjSWb6ktxsOIruhRYKkKu6zsxaI4vjw2txs4BgEg505m+Qs21AfEthf83Pf7OdCb+hVhuSe0qa3WHkBdR4rzojsiKkQzXGm+w2gaIftMaQdPvmyRTWpuDqLGANvBukERURIFZIm7Du9lOMbWlJz1NDOLtSUQ70+DVCf51eXtHp8qm7DKPeG+zm4B0IzmK202xoEnYPdUEaZorJVxEnrSBuCpNXHANZDMSaqqkYMF8Bja/zpyJKVuovDq3FDPgiRw39aRDLsaRHJuadFpHQzLeLvYxDvmvq6UREyCJF9PS0i+3paRPb1tIjs62kR2dcDEdkFQ9eHk8l5QgPiCJ7QgDiCJzQgjuAJDYgjeEID4giecDI5T2hAHMETGhBH8IQGxBE8oQFxBE9oQBzCEyI4Bn83+kxoMpPZe7HfPpnzmRGgYbLZJoi1aT+pvT9q7suPYxeLElaIEoLStP7oHqfS/tHwDDhaaXjD1INWH8EUMP4JPl5SyVrehfk4YtkeA3hoZOgBWt6ITQFKqCOovMX1RVJwnzM5AzJiScgEwmGNqsR4flHFLtraPSWfU2mf8cMRctzCqCMnq+Br8W1YvwqkWDcRjCQaNN5S+WEYMNxk0sg2K5xU5Fz5egNRPd537A4lIZTsQavm2B62190GWkbkm/RjntzKAJIshW+qtVF3HPnqBCTW6EFAE9RlcC0YY4HEOXAvUbO2qlIrP4zBml0/fC6mQ/dEMPo3ZBDmbdHjoxzN8Ios/FIR52Jvrs/tOm1T90tZBl/8guCnLL+V8Ps/nylItBdvWtAncbu7uT4rnivBAVuV0hYBjp2Q5Hu1U3dYWfpo/5uyKLP8r8oSPeTblXX3iZqI/01/Vcp64/6qlPXG/VUp6437iyxKO6rHet2/AEm8+UYF3FgvPAlBq+M2zYjIVyk3i6enuXZl/HqI/vckzzusV8PIYarPcxjLucXMgWSYqTmMaAComG0NqEnYL+byKVEljf/kqJLcfwLUr5Js+0e0Sbtyd7dgiH13NAYbqidIigCjLeQ+2Nw0Za44GrUdaeEAodKp8eC2wmmtQ3ctXs5u5JD23rJyib6itvhnrTrpP65Kqg7YPZ3SINjyxrtU277b7g7IIRqRFxwrSxu1+DGb61baIErez8hExSStTNnlbpyuyum0RBqHDnNomUYSq0hORslkkDJ7LtktjFya/LIb40xz1sRIWdLkVV9Lw+OAJDoDQ592akK8oFhHAO6OkfCBe7BFdHi2dS2RTiQcIiR90O8pcRCVFBW1HdRbQ8aqFZkJmKu31X2xTBsH/qM5/CrF2SF1j9lAeu5t/BA5jzXLpfNwwHlCkosFRtEsSZoDFA4Jq+PHtrADIQIy4eBHpceqkiimg0qEFN0XiqrEnESMzXga1JxRUAsi6c7+g+NdXIs1p020J+arJQRDkF7AkNPzwN3IikNBllHNAdsdZLIgFRDwhWrzJKkAvIjGz6a6EUHQdx22l/Y0asQYXm536atEX+Z5g8Gf3KZ4GcekHSZSFtYiNIG8FqnxTTaLwqTfdrZMCUPOga+4cLiWfhVtlL9E8RM8Uv9y7nklNK5rHWduVMhiw1VDk28dfe5Eee1l0jucwO3yQploo6e5PeGzMYLzgOrgiHw3KmQ37UhFckAjSlDjZnLo5CK9XxkZnXChHqZdyh3qVg+bvCk/5agz+KdK/Sy7sZ23Mmy29rzIetqIaUnp3mHORGpIF99Abw6aL2Zv6ah5m/y9CyKnhTylrMwe8uRMLInN9nEcqMt5Sn5EKpmzeD3wDkwtekJ+HJvEPS4HmdXiFUcH5sYLt4pEGjBhxuAqCv+ffqJjkN3dJBfO5CS9dhxMZ6SiCvwXGRFbdXRsWgOh+5bwwy5QMHZzjlDOsODg2ecBoXiWikSZtOwWuYO44SfEBk/WDfAZsg5c9M0s4ZBXY4UvticcaWsnbG3L1yFKGJMGWEAUcn0QnJIhzs+6nSsa0EHMqIeD/WUphjr1QHeqBKIW7LKLQ4oknQ+ka8j1cpHKWXSdEPn9BUSO6gihtw2vxLzcaPXtut+emJFcUMCkmlFxBBcHG+xL+jxObTrHVkEO35L8P3L8SeY8vOdYhM1ZbTLOoSrQXHAUkRzIsWPI46Jbw8cPSXFSGhu83imzkSja2RSZiJ/pkMwbEA42LKvYazji85AceXwoJ7OBHWWvOhhzup1w7pbDSg7psFnam7RudDEEPSRJ0rXhVbPb4vBmV/ovnOH9huUXTXbDMyalo6l+ZaCSC22ekbCb/1ennwOoMUgjUE3qV5MZuo74G4KqRHujc8tszx3ogiuuvaWQ7w4ySftwbs8LLI4QdCLLD5AvJdVUtY6LSCcYvTd0SqXcwp7Q50Jy+XOnwool6uwJIfvoP7Ib+pT0EaPW8Efbrok5PMoN4N42BRI1dnnkl6iMTNSnqnreF/eFH6I4wHlNiHbi1rDhvDAHHBwuiAjUgSii7RO51G88xv2AqB9fFxphL23tpOkT9JzCmbdi6FeAJI4tR4PW0KEVRHWkody5GsmBDuk4En8DJ/qf6RHkqB9V5Z47wBBaHsupqUjkdDJIXghRMUfc2s9ulEKtZC5dqKjRpYeJVbmYSxdS3JdprZFsNxXVC/i3yTIspy2Fmay80c5IGqTohjVsLpF4rVMzYsTpyW0MVAE+KAfqS3+tQpxKdFiihHOZpaprcaoFNJtRKwoUG8L2ymBAiDnEgyag8/T4nRyGuAvMOa1FgFe+UMQwz8gS5YdP8CtDqrnKBC4jib1gGqiZx5hOY9mx17KtCLCatRy8XqGdnVpK8LzzOEqSozNkfZYUYPxGRlF3Hq0DGg/b94/O4Pwjx+/BB2gj6rqWPLbK3wRyt/PACjEXnOdRQSxJn4JH6K9k4ubfugmhh+GhiCZtRf6tD6HahnG+rGYsKBB6WYn3Qc/tQ0hkTgn35PiIaWihKaBLI/gE9pfqncmLPhX/fvQ9SMS62OO5Y6QCYJ65J4xUk6dYfqucCyZ/2k/NeaR0bpizc/4ikgib9toWxfTBtog9wMYKo1VUiyoX8vnatoUhjc7FYlbKlq3VZ6FEhRNZ1PInWQLN1Dg950ToPSDaIC8E0t0IX8aTdNN22o6sWwVrSKUefd8quuWqs0s1lNsxqLtEAO3tnxmYO3RcSocKnwWRBM2q3LcI2nN6KFi+0zKX3SQ43Q9+MaFhM3rVSQXlePrd/0kT9JM+bv5FVef66LxwR0ECqp/qCwxDt4nWfMgWGOxY5ImEhCylUlL81bei1O5XcbjSRHIypxTFlp4MGMehh/JA5inIMK68cNIy9ttqMPgXNvwaKo1ShQc3+6DIdRJuMQRkPMmF4+0I/z+C9UNOVIIqFro/5llX+iBEqvnuCh8AYQekSX96AqlAVQIaSy/KvWUviEw9wPnpdjNWWyxiBYl+aaFKfJGILM8wXzoLSzC+8HQ4MEaWSj0Qxq6a7aQ/eDy07H30ypUAWo2Mh6BpAk5ohnn54FlTWYqc/yoEwA6ARcYNU+hlOn+1lRmHNbouWC2QvNMmyx0FVGonZq+dCpPrGCEj7CRVpJ8O9D6KHt8AEh/cW05caeg9/NWUWDoSJ+t/BCmtZRGYrFUriFrbNxkQV8ioLsN2Qkhoy03mjMmaYw9zRPchOeKzyUdqU0SfQ1O/QdpuQprdbp4a7d3xyTE+oBHi0s7Qs7X/AmWout8sn9U3Y6KyfhlbVl8ius3qgTtPcrqZnAVbOunvdbsQjZn5v54eB/UzCE/UGHIlzm1IyStWYr2iAiL/sx0GlmdRl6lIHmFfjOCjdi2+0j9GkQTA1BTdSQf3OknqW/Au9dFR09FCvjvhXNE9h1Z3qcsWDjGONYeyHYcaZHBXtUFa5nlqMToBqKjqAaCeO9DXikeOdePZwoMP58+olw5MBwcp5xpR0J4SrPlRjs2ATWbN3EnBX205khuQbiS7slKKZFz63g9pHi01AZpzXvIGoIeLCw4vWgn2cj/n3uIr35OwMtyznzZ7DxfzLQPmJTTabHO4QuipeQlmb+eYM8T/zNA5esaGJX+SvsdohM47ehLb3R5gPdStp3k8P+oDYAJ4q3Z3yj1ykW/HVwNHu2TikTAeSl11EmywYVXsMGNVKD/5uzTT1OdjK3G3ycTzfzTQnB+y7xiNFEYv0OU+8054aXdpXqq0cqyPBDKp2asXncQnDaCTY/UG0DGqqx/dF7BRsVONbuWvNAiNAnJKp39IMLuCWUXoXnB0bg+6W6XqSWPHgymzF50kSulF900eyayT9jl70soS6UqbeAhiYWetvb/qRKomCkoz/cSYgg4L1VadPSnXPqntjZ+Q7jpXhmQJ97ulj6xwCzj+QNPAym9qTrGqId1FML3KwMRF6dOBimklcfyQirVbOX2UdsZGu2sNwr+8V0/CTyJwJbF0Q/bXpShqSpxQAbiXc28WEK+VPj8HRy/4R3fzWagXU/p+bZyov6rfEQN4VD744a8D9cRwoZ/TLEpxVEpM8K1LPb1HDudWVe0xi0aUqPCTWyuLQ7SgEBWTz8thQEEDNIxyouqj46rNvfEDYreLqGAxnrEiozVj001J/r0HBtYwIVG3UPutfN2a+rAKZkesDTXrM2pLxBpU5kScwqWh8TSaOuGxBWXvMDg9IxLv+QGS1WMXcas9lK4R090+f0B6P+dhQTQBcQ4EmqhUpS8cQwD3ybKrZh3AQ/70pjtaTp9pJZbuGEosCY6GEksuo6HEkrbIlZhRjhyHpQkNr3694Cm2/QBmsH6LvGKbXq77VqOMIn0wGkU6YzSK9MpoFOme0SiSSWo0yvvhKDgT2HYydP4yUPI7BkFJT08DJd09DZT0+VgoeJnb5N3YzDl4fbegyMk3o1EkAfhoFDbOGBQe1whjpXhKPuJamli/9oG5hrOgqN8kC/geN2vosE7QuVpjEScsIhS+LfSyJ44xOcHVXn2B+Cn6eUeJbh8OFmi7fxk9Li3YJFPPgk0y+QDGWPSpnpJYEz0kh6dWbMTgsjCs0wQwbPIJYDidJ4DhAjcBDFe4CWC4xPWEMQJQgxGgiWSmzrXI78wzgHGsTLo+8jXmVr6Y615I33KkF+jo7Rdz3QdpzjohJK+ok3wZUKc566RIph7ypUedkK/hSTcDm8xeOZPGC3HFYQiX6FQQn9CRT64KwNQNcNKU5QJZbOAxKf6aBo8pHfJEEriE9sOFQRNZQ0kQ31d48GiOODcjgUGBgx/Cf/Qo3EDiNhwJJTJYvYBtuJYjpeiL7pDHQve7fTROBuHOhHqql5+EONacaFZPy4YXjZG2ep8W/7LDnjRQrxh7sff6Lw\x3d\x3d"; Sidebar.prototype.searchFileUrl="search.xml";Sidebar.prototype.gearImage=GRAPH_IMAGE_PATH+"/clipart/Gear_128x128.png";Sidebar.prototype.defaultEntries="general;images;uml;er;bpmn;flowchart;basic;arrows2";Sidebar.prototype.signs="Animals Food Healthcare Nature People Safety Science Sports Tech Transportation Travel".split(" ");Sidebar.prototype.gcp="Big Data;Compute;Developer Tools;Extras;Identity and Security;Machine Learning;Management Tools;Networking;Storage Databases".split(";");Sidebar.prototype.rack= "General APC Cisco Dell F5 HP IBM Oracle".split(" ");Sidebar.prototype.pids="Agitators;Apparatus Elements;Centrifuges;Compressors;Compressors ISO;Crushers Grinding;Driers;Engines;Feeders;Filters;Fittings;Flow Sensors;Heat Exchangers;Instruments;Misc;Mixers;Piping;Pumps;Pumps DIN;Pumps ISO;Separators;Shaping Machines;Valves;Vessels".split(";");Sidebar.prototype.cisco="Buildings;Computers and Peripherals;Controllers and Modules;Directors;Hubs and Gateways;Misc;Modems and Phones;People;Routers;Security;Servers;Storage;Switches;Wireless".split(";"); Sidebar.prototype.sysml="Model Elements;Blocks;Ports and Flows;Constraint Blocks;Activities;Interactions;State Machines;Use Cases;Allocations;Requirements;Profiles;Stereotypes".split(";");Sidebar.prototype.eip="Message Construction;Message Routing;Message Transformation;Messaging Channels;Messaging Endpoints;Messaging Systems;System Management".split(";");Sidebar.prototype.gmdl="Bottom Navigation;Bottom Sheets;Buttons;Cards;Chips;Dialogs;Dividers;Grid Lists;Icons;Lists;Menus;Misc;Pickers;Selection Controls;Sliders;Steppers;Tabs;Text Fields".split(";"); Sidebar.prototype.aws2="Analytics;Application Services;Compute;Database;Developer Tools;Enterprise Applications;Game Development;General;Internet of Things;Management Tools;Mobile Services;Networking;On-Demand Workforce;SDKs;Security and Identity;Storage and Content Delivery;Groups".split(";");Sidebar.prototype.office="Clouds Communications Concepts Databases Devices Security Servers Services Sites Users".split(" ");Sidebar.prototype.veeam=["2D","3D"];Sidebar.prototype.archimate3="Application;Business;Composite;Implementation and Migration;Motivation;Physical;Relationships;Strategy;Technology".split(";"); Sidebar.prototype.electrical="LogicGates Resistors Capacitors Inductors SwitchesRelays Diodes Sources Transistors Misc Audio PlcLadder Abstract Optical VacuumTubes Waveforms Instruments RotMech Transmission".split(" ");Sidebar.prototype.configuration=[{id:"general",libs:["general","misc","advanced"]},{id:"uml"},{id:"search"},{id:"er"},{id:"ios",prefix:"ios",libs:["","7icons","7ui"]},{id:"android",prefix:"android",libs:[""]},{id:"aws3d"},{id:"flowchart"},{id:"basic"},{id:"arrows"},{id:"arrows2"},{id:"lean_mapping"}, {id:"citrix"},{id:"azure"},{id:"network"},{id:"mscae",prefix:"mscae",libs:"Cloud;Enterprise;General;Intune;Other;System Center;Deprecated".split(";")},{id:"bpmn",prefix:"bpmn",libs:["","Gateways","Events"]},{id:"clipart",prefix:null,libs:"computer finance clipart networking people telco".split(" ")},{id:"eip",prefix:"eip",libs:Sidebar.prototype.eip},{id:"mockups",prefix:"mockup",libs:"Buttons Containers Forms Graphics Markup Misc Navigation Text".split(" ")},{id:"pid2",prefix:"pid2",libs:"Agitators;Apparatus Elements;Centrifuges;Compressors;Compressors ISO;Crushers Grinding;Driers;Engines;Feeders;Filters;Fittings;Flow Sensors;Heat Exchangers;Instruments;Misc;Mixers;Piping;Pumps;Pumps DIN;Pumps ISO;Separators;Shaping Machines;Valves;Vessels".split(";")}, {id:"signs",prefix:"signs",libs:Sidebar.prototype.signs},{id:"gcp",prefix:"gcp",libs:Sidebar.prototype.gcp},{id:"rack",prefix:"rack",libs:Sidebar.prototype.rack},{id:"electrical",prefix:"electrical",libs:Sidebar.prototype.electrical},{id:"aws2",prefix:"aws2",libs:Sidebar.prototype.aws2},{id:"pid",prefix:"pid",libs:Sidebar.prototype.pids},{id:"cisco",prefix:"cisco",libs:Sidebar.prototype.cisco},{id:"office",prefix:"office",libs:Sidebar.prototype.office},{id:"veeam",prefix:"veeam",libs:Sidebar.prototype.veeam}, {id:"cabinets",libs:["cabinets"]},{id:"floorplan",libs:["floorplan"]},{id:"bootstrap",libs:["bootstrap"]},{id:"gmdl",prefix:"gmdl",libs:Sidebar.prototype.gmdl},{id:"archimate3",prefix:"archimate3",libs:Sidebar.prototype.archimate3},{id:"archimate",libs:["archimate"]},{id:"webicons",libs:["webicons","weblogos"]},{id:"sysml",prefix:"sysml",libs:Sidebar.prototype.sysml}];var a=Sidebar.prototype.insertSearchHint;Sidebar.prototype.insertSearchHint=function(b,d,c,f,n,m,p,s){if(null!=s&&1==f){var t=null; if(0<=mxUtils.indexOf(s,"text"))t="Double click anywhere in the diagram to insert text.";else for(var q="line lines arrow arrows connect connection connections connector connectors curve curves link links".split(" "),v=0;vg?"":d.substring(g+1));this.createVertexTemplateEntry(d,parseInt(b[a].getAttribute("w")),parseInt(b[a].getAttribute("h")),"",c.replace(/_/g," "),null,null,this.filterTags(e.join(" ")))}}}}}}))};"1"==urlParams.savesidebar&&(Sidebar.prototype.addFoldingHandler=function(b,a,d){var c=!1;if(!mxClient.IS_IE||8<=document.documentMode)b.style.backgroundImage="none"== a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')";b.style.backgroundRepeat="no-repeat";b.style.backgroundPosition="0% 50%";var f=document.createElement("button");f.style.marginLeft="4px";mxUtils.write(f,"Save");mxEvent.addListener(b,"click",mxUtils.bind(this,function(m){if("BUTTON"==mxEvent.getSource(m).nodeName){var p=b.cloneNode(!0);p.style.backgroundImage="";p.style.textDecoration="none";p.style.fontWeight="bold";p.style.fontSize="14px";p.style.color="rgb(80, 80, 80)"; p.style.width="456px";p.style.backgroundColor="#ffffff";p.style.paddingLeft="6px";m=p.getElementsByTagName("button")[0];m.parentNode.removeChild(m);m=a.cloneNode(!0);m.style.backgroundColor="#ffffff";m.style.borderColor="transparent";m.style.width="456px";p='\x3c!DOCTYPE html\x3e\x3chtml\x3e\x3chead\x3e\x3clink rel\x3d"stylesheet" type\x3d"text/css" href\x3d"https://www.draw.io/styles/grapheditor.css"\x3e\x3c/head\x3e\x3cbody style\x3d"background:#ffffff;font-family:Helvetica,Arial;"\x3e'+p.outerHTML+ m.outerHTML+"\x3c/body\x3e\x3c/html\x3e";m.style.position="absolute";window.document.body.appendChild(m);var s=m.clientHeight+18;m.parentNode.removeChild(m);(new mxXmlRequest(EXPORT_URL,"w\x3d456\x26h\x3d"+s+"\x26html\x3d"+encodeURIComponent(this.editorUi.editor.graph.compress(p)))).simulate(document,"_blank")}else{if("none"==a.style.display){if(c)b.appendChild(f);else if(c=!0,null!=d){null!=f.parentNode&&f.parentNode.removeChild(f);b.style.cursor="wait";var t=b.innerHTML;b.innerHTML=mxResources.get("loading")+ "...";window.setTimeout(function(){d(a);b.style.cursor="";b.innerHTML=t;b.appendChild(f)},0)}else b.appendChild(f);b.style.backgroundImage="url('"+this.expandedImage+"')";a.style.display="block"}else b.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none",null!=f.parentNode&&f.parentNode.removeChild(f);mxEvent.consume(m)}}))});Sidebar.prototype.extractShapeStyle=function(b){if(null!=b&&"shape\x3d"==b.substring(0,6)){var a=b.indexOf(";");0>a&&(a=b.length);return b.substring(6, a)}return null};var c=Sidebar.prototype.getTagsForStencil;Sidebar.prototype.getTagsForStencil=function(b,a,d){var f=c.apply(this,arguments);null!=this.shapetags&&(b=b.toLowerCase(),a=a.toLowerCase(),null!=this.shapetags[b]&&f.push(this.shapetags[b]),a=b+"."+a,null!=this.shapetags[a]&&f.push(this.shapetags[a]));return f};Sidebar.prototype.initPalettes=function(){var b=GRAPH_IMAGE_PATH,a=STENCIL_PATH,d=this.signs,c=this.gcp,f=this.rack,m=this.pids,p=this.cisco,s=this.sysml,t=this.eip,q=this.gmdl;"1"== urlParams.createindex&&(mxLog.show(),mxLog.textarea.value="");this.addSearchPalette(!0);this.addGeneralPalette(!0);this.addMiscPalette(!1);this.addAdvancedPalette(!1);this.addUmlPalette(!1);this.addErPalette();this.addBasicPalette();this.addFlowchartPalette();this.addNetworkPalette();this.addAzurePalette();this.addCitrixPalette();this.addMSCAEPalette();this.addBpmnPalette(a,!1);this.addAWSPalette();this.addAWS3DPalette();this.addLeanMappingPalette();this.addIos7Palette();this.addIosPalette();this.addAndroidPalette(); this.addMockupPalette();this.addElectricalPalette();this.addOfficePalette();this.addVeeamPalette();this.addStencilPalette("arrows",mxResources.get("arrows"),a+"/arrows.xml",";html\x3d1;"+mxConstants.STYLE_VERTICAL_LABEL_POSITION+"\x3dbottom;"+mxConstants.STYLE_VERTICAL_ALIGN+"\x3dtop;"+mxConstants.STYLE_STROKEWIDTH+"\x3d2;strokeColor\x3d#000000;");this.addArrows2Palette();this.addImagePalette("computer","Clipart / Computer",b+"/lib/clip_art/computers/","_128x128.png","Antivirus Data_Filtering Database Database_Add Database_Minus Database_Move_Stack Database_Remove Fujitsu_Tablet Harddrive IBM_Tablet iMac iPad Laptop MacBook Mainframe Monitor Monitor_Tower Monitor_Tower_Behind Netbook Network Network_2 Printer Printer_Commercial Secure_System Server Server_Rack Server_Rack_Empty Server_Rack_Partial Server_Tower Software Stylus Touch USB_Hub Virtual_Application Virtual_Machine Virus Workstation".split(" "), "Antivirus;Data Filtering;Database;Database Add;Database Minus;Database Move Stack;Database Remove;Fujitsu Tablet;Harddrive;IBMTablet;iMac;iPad;Laptop;MacBook;Mainframe;Monitor;Monitor Tower;Monitor Tower Behind;Netbook;Network;Network 2;Printer;Printer Commercial;Secure System;Server;Server Rack;Server Rack Empty;Server Rack Partial;Server Tower;Software;Stylus;Touch;USB Hub;Virtual Application;Virtual Machine;Virus;Workstation".split(";"));this.addImagePalette("finance","Clipart / Finance",b+"/lib/clip_art/finance/", "_128x128.png","Arrow_Down Arrow_Up Coins Credit_Card Dollar Graph Pie_Chart Piggy_Bank Safe Shopping_Cart Stock_Down Stock_Up".split(" "),"Arrow_Down;Arrow Up;Coins;Credit Card;Dollar;Graph;Pie Chart;Piggy Bank;Safe;Shopping Basket;Stock Down;Stock Up".split(";"));this.addImagePalette("clipart","Clipart / Various",b+"/lib/clip_art/general/","_128x128.png","Battery_0 Battery_100 Battery_50 Battery_75 Battery_allstates Bluetooth Earth_globe Empty_Folder Full_Folder Gear Keys Lock Mouse_Pointer Plug Ships_Wheel Star Tire".split(" "), "Battery 0%;Battery 100%;Battery 50%;Battery 75%;Battery;Bluetooth;Globe;Empty Folder;Full Folder;Gear;Keys;Lock;Mousepointer;Plug;Ships Wheel;Star;Tire".split(";"));this.addImagePalette("networking","Clipart / Networking",b+"/lib/clip_art/networking/","_128x128.png","Bridge Certificate Certificate_Off Cloud Cloud_Computer Cloud_Computer_Private Cloud_Rack Cloud_Rack_Private Cloud_Server Cloud_Server_Private Cloud_Storage Concentrator Email Firewall_02 Firewall Firewall-page1 Ip_Camera Modem power_distribution_unit Print_Server Print_Server_Wireless Repeater Router Router_Icon Switch UPS Wireless_Router Wireless_Router_N".split(" "), "Bridge;Certificate;Certificate Off;Cloud;Cloud Computer;Cloud Computer Private;Cloud Rack;Cloud Rack Private;Cloud Server;Cloud Server Private;Cloud Storage;Concentrator;Email;Firewall 1;Firewall 2;Firewall;Camera;Modem;Power Distribution Unit;Print Server;Print Server Wireless;Repeater;Router;Router Icon;Switch;UPS;Wireless Router;Wireless Router N".split(";"),{Wireless_Router:"wireless router switch wap wifi access point wlan",Wireless_Router_N:"wireless router switch wap wifi access point wlan", Router:"router switch",Router_Icon:"router switch"});this.addImagePalette("people","Clipart / People",b+"/lib/clip_art/people/","_128x128.png","Suit_Man Suit_Man_Black Suit_Man_Blue Suit_Man_Green Suit_Man_Green_Black Suit_Woman Suit_Woman_Black Suit_Woman_Blue Suit_Woman_Green Suit_Woman_Green_Black Construction_Worker_Man Construction_Worker_Man_Black Construction_Worker_Woman Construction_Worker_Woman_Black Doctor_Man Doctor_Man_Black Doctor_Woman Doctor_Woman_Black Farmer_Man Farmer_Man_Black Farmer_Woman Farmer_Woman_Black Nurse_Man Nurse_Man_Black Nurse_Man_Green Nurse_Man_Red Nurse_Woman Nurse_Woman_Black Nurse_Woman_Green Nurse_Woman_Red Military_Officer Military_Officer_Black Military_Officer_Woman Military_Officer_Woman_Black Pilot_Man Pilot_Man_Black Pilot_Woman Pilot_Woman_Black Scientist_Man Scientist_Man_Black Scientist_Woman Scientist_Woman_Black Security_Man Security_Man_Black Security_Woman Security_Woman_Black Soldier Soldier_Black Tech_Man Tech_Man_Black Telesales_Man Telesales_Man_Black Telesales_Woman Telesales_Woman_Black Waiter Waiter_Black Waiter_Woman Waiter_Woman_Black Worker_Black Worker_Man Worker_Woman Worker_Woman_Black".split(" ")); this.addImagePalette("telco","Clipart / Telecommunication",b+"/lib/clip_art/telecommunication/","_128x128.png","BlackBerry Cellphone HTC_smartphone iPhone Palm_Treo Signal_tower_off Signal_tower_on".split(" "),"BlackBerry;Cellphone;HTC smartphone;iPhone;Palm Treo;Signaltower off;Signaltower on".split(";"));for(b=0;bmxUtils.indexOf(n,a))d=null!=s?s[a]:null,mxLog.debug('\x3cshape style\x3d"shape\x3d'+b+a+c+'" w\x3d"'+Math.round(e*p)+'" h\x3d"'+Math.round(f*p)+'"'+(null!=d?' tags\x3d"'+d+'"':"")+"/\x3e")}),!0)}}var d= Sidebar.prototype.searchEntries;Sidebar.prototype.searchEntries=function(b,a,c,f,n){var m=f;this.editorUi.enableLogging&&!this.editorUi.isOffline()&&0==c&&((new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity\x3dCONFIG\x26msg\x3dshapesearch:"+encodeURIComponent(b)+"\x26v\x3d"+encodeURIComponent(EditorUi.VERSION));f=mxUtils.bind(this,function(d,f,l,n){!this.editorUi.isOffline()&&d.length<=a/4?(l=c-Math.ceil((f-a/4)/a),mxUtils.get(ICONSEARCH_PATH+"?v\x3d2\x26q\x3d"+ encodeURIComponent(b)+"\x26p\x3d"+l+"\x26c\x3d"+a,mxUtils.bind(this,function(b){try{if(200<=b.getStatus()&&299>=b.getStatus()){var e=JSON.parse(b.getText());for(b=0;bb;b++){var e=a.cloneCell(f);e.geometry.setTerminalPoint(new mxPoint(40+60*b,0),!0);c.insertEdge(e,!1);d.push(e)}for(b=0;4>b;b++)e=a.cloneCell(f),e.geometry.setTerminalPoint(new mxPoint(40+60*b,140),!0),c.insertEdge(e,!1),d.push(e);return a.createVertexTemplateFromCells(d,c.geometry.width,c.geometry.height+120,"Bus")}),this.createVertexTemplateEntry("html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.bus;gradientColor\x3dnone;gradientDirection\x3dnorth;fontColor\x3d#ffffff;perimeter\x3dbackbonePerimeter;backboneSize\x3d20;", 200,20,"","Bus",null,null,this.getTagsForStencil("mxgraph.networks","bus backbone","computer network ").join(" ")),this.createEdgeTemplateEntry("html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.comm_link_edge;html\x3d1;",100,100,"","Comm Link",null,this.getTagsForStencil("mxgraph.networks","comm_link_edge","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.biometric_reader;", 60,100,"","Biometric Reader",null,null,this.getTagsForStencil("mxgraph.networks","biometric_reader","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.business_center;",90,100,"","Business Center",null,null,this.getTagsForStencil("mxgraph.networks", "business_center","computer network ").join(" ")),this.createVertexTemplateEntry("html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.cloud;fontColor\x3d#ffffff;",90,50,"","Cloud",null,null,this.getTagsForStencil("mxgraph.networks","cloud","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.community;", 95,100,"","Community",null,null,this.getTagsForStencil("mxgraph.networks","community","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.comm_link;",30,100,"","Comm Link (Icon)",null,null,this.getTagsForStencil("mxgraph.networks", "comm_link","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.copier;",100,100,"","Copier",null,null,this.getTagsForStencil("mxgraph.networks","copier","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.pc;", 100,70,"","PC",null,null,this.getTagsForStencil("mxgraph.networks","pc","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.desktop_pc;",30,60,"","Desktop PC",null,null,this.getTagsForStencil("mxgraph.networks","desktop_pc","computer network ").join(" ")), this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.external_storage;",90,100,"","External Storage",null,null,this.getTagsForStencil("mxgraph.networks","external_storage","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.firewall;", 100,100,"","Firewall",null,null,this.getTagsForStencil("mxgraph.networks","firewall","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.gamepad;",100,70,"","Gamepad",null,null,this.getTagsForStencil("mxgraph.networks","gamepad", "computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.hub;",100,30,"","Hub",null,null,this.getTagsForStencil("mxgraph.networks","hub","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.laptop;", 100,55,"","Laptop",null,null,this.getTagsForStencil("mxgraph.networks","laptop","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.load_balancer;",100,30,"","Load Balancer",null,null,this.getTagsForStencil("mxgraph.networks","load_balancer", "computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.mail_server;",105,105,"","Mail Server",null,null,this.getTagsForStencil("mxgraph.networks","mail_server","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.mainframe;", 80,100,"","Mainframe",null,null,this.getTagsForStencil("mxgraph.networks","mainframe","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.mobile;",50,100,"","Mobile",null,null,this.getTagsForStencil("mxgraph.networks","mobile","computer network ").join(" ")), this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.modem;",100,30,"","Modem",null,null,this.getTagsForStencil("mxgraph.networks","modem","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.monitor;", 80,65,"","Monitor",null,null,this.getTagsForStencil("mxgraph.networks","monitor","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.nas_filer;",100,35,"","NAS Filer",null,null,this.getTagsForStencil("mxgraph.networks","NAS Filer", "computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.patch_panel;",100,35,"","Patch Panel",null,null,this.getTagsForStencil("mxgraph.networks","patch_panel","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.pc;", 100,70,"","PC",null,null,this.getTagsForStencil("mxgraph.networks","pc","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.phone_1;",100,70,"","Phone",null,null,this.getTagsForStencil("mxgraph.networks","phone_1","computer network ").join(" ")), this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.phone_2;",100,90,"","Phone",null,null,this.getTagsForStencil("mxgraph.networks","phone_2","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.printer;", 100,100,"","Printer",null,null,this.getTagsForStencil("mxgraph.networks","printer","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.proxy_server;",105,105,"","Proxy Server",null,null,this.getTagsForStencil("mxgraph.networks","proxy_server", "computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.rack;",50,100,"","Rack",null,null,this.getTagsForStencil("mxgraph.networks","rack","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.radio_tower;", 55,100,"","Radio Tower",null,null,this.getTagsForStencil("mxgraph.networks","radio_tower","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.router;",100,30,"","Router",null,null,this.getTagsForStencil("mxgraph.networks","router", "computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.satellite;",100,100,"","Satellite",null,null,this.getTagsForStencil("mxgraph.networks","satellite","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.satellite_dish;", 90,100,"","Satellite Dish",null,null,this.getTagsForStencil("mxgraph.networks","satellite_dish","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.scanner;",100,75,"","Scanner",null,null,this.getTagsForStencil("mxgraph.networks", "scanner","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.secured;",80,100,"","Secured",null,null,this.getTagsForStencil("mxgraph.networks","secured","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.security_camera;", 100,75,"","Security Camera",null,null,this.getTagsForStencil("mxgraph.networks","security_camera","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.server;",90,100,"","Server",null,null,this.getTagsForStencil("mxgraph.networks", "server","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.server_storage;",105,105,"","Server Storage",null,null,this.getTagsForStencil("mxgraph.networks","server_storage","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.storage;", 100,100,"","Storage",null,null,this.getTagsForStencil("mxgraph.networks","storage","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.supercomputer;",100,100,"","Supercomputer",null,null,this.getTagsForStencil("mxgraph.networks", "supercomputer","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.switch;",100,30,"","Switch",null,null,this.getTagsForStencil("mxgraph.networks","switch","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.tablet;", 100,70,"","Tablet",null,null,this.getTagsForStencil("mxgraph.networks","tablet","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.tape_storage;",105,105,"","Tape Storage",null,null,this.getTagsForStencil("mxgraph.networks","tape_storage", "computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.terminal;",80,65,"","Terminal",null,null,this.getTagsForStencil("mxgraph.networks","terminal","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.unsecure;", 80,100,"","Unsecure",null,null,this.getTagsForStencil("mxgraph.networks","unsecure","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.ups_enterprise;",100,100,"","UPS Enterprise",null,null,this.getTagsForStencil("mxgraph.networks", "ups_enterprise","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.ups_small;",70,100,"","UPS Small",null,null,this.getTagsForStencil("mxgraph.networks","ups_small","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.usb_stick;", 45,100,"","USB Stick",null,null,this.getTagsForStencil("mxgraph.networks","usb_stick","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.users;",90,100,"","Users",null,null,this.getTagsForStencil("mxgraph.networks","users","computer network ").join(" ")), this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.user_female;",40,100,"","User Female",null,null,this.getTagsForStencil("mxgraph.networks","user_female","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.user_male;", 40,100,"","User Male",null,null,this.getTagsForStencil("mxgraph.networks","user_male","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.video_projector;",100,35,"","Video Projector",null,null,this.getTagsForStencil("mxgraph.networks", "video_projector","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.video_projector_screen;",80,100,"","Video Projector Screen",null,null,this.getTagsForStencil("mxgraph.networks","video_projector_screen","computer network ").join(" ")), this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.virtual_pc;",115,85,"","Virtual PC",null,null,this.getTagsForStencil("mxgraph.networks","virtual_pc","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.virtual_server;", 110,120,"","Virtual Server",null,null,this.getTagsForStencil("mxgraph.networks","virtual_server","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.virus;",100,90,"","Virus",null,null,this.getTagsForStencil("mxgraph.networks","virus", "computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.web_server;",105,105,"","Web Server",null,null,this.getTagsForStencil("mxgraph.networks","web_server","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.wireless_hub;", 100,85,"","Wireless Hub",null,null,this.getTagsForStencil("mxgraph.networks","wireless_hub","computer network ").join(" ")),this.createVertexTemplateEntry("fontColor\x3d#0066CC;verticalAlign\x3dtop;verticalLabelPosition\x3dbottom;labelPosition\x3dcenter;align\x3dcenter;html\x3d1;fillColor\x3d#CCCCCC;strokeColor\x3d#6881B3;gradientColor\x3dnone;gradientDirection\x3dnorth;strokeWidth\x3d2;shape\x3dmxgraph.networks.wireless_modem;",100,85,"","Wireless Modem",null,null,this.getTagsForStencil("mxgraph.networks", "wireless_modem","computer network ").join(" "))])}})(); (function(){Sidebar.prototype.addOfficePalette=function(){this.addOfficeCloudsPalette();this.addOfficeCommunicationsPalette();this.addOfficeConceptsPalette();this.addOfficeDatabasesPalette();this.addOfficeDevicesPalette();this.addOfficeSecurityPalette();this.addOfficeServersPalette();this.addOfficeServicesPalette();this.addOfficeSitesPalette();this.addOfficeUsersPalette()};Sidebar.prototype.addOfficeCloudsPalette=function(){var a=[this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.azure;",103, 66,"","Azure",null,null,this.getTagsForStencil("mxgraph.office.clouds","azure","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.cloud;",94,55,"","Cloud",null,null,this.getTagsForStencil("mxgraph.office.clouds","cloud","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.cloud_disaster;", 94,74,"","Cloud Disaster",null,null,this.getTagsForStencil("mxgraph.office.clouds","cloud disaster","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.cloud_disaster;fillColor\x3d#ff0000;",94,74,"","Cloud Disaster (Red)",null,null,this.getTagsForStencil("mxgraph.office.clouds","cloud disaster","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.cloud_exchange_online;", 100,61,"","Cloud Exchange Online",null,null,this.getTagsForStencil("mxgraph.office.clouds","cloud exchange online","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.cloud_service_request;",102,80,"","Cloud Service Request",null,null,this.getTagsForStencil("mxgraph.office.clouds","cloud service request","office cloud ").join(" ")), this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.cloud_sharepoint;",101,61,"","Cloud SharePoint",null,null,this.getTagsForStencil("mxgraph.office.clouds","cloud sharepoint","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.office_365;", 101,61,"","Office 365",null,null,this.getTagsForStencil("mxgraph.office.clouds","office 365","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.online_backup;",94,101,"","Online Backup",null,null,this.getTagsForStencil("mxgraph.office.clouds","online backup","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.online_user;", 93,74,"","Online User",null,null,this.getTagsForStencil("mxgraph.office.clouds","online user","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.private_cloud;",94,55,"","Private Cloud",null,null,this.getTagsForStencil("mxgraph.office.clouds","private cloud","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.public_cloud;", 101,81,"","Public Cloud",null,null,this.getTagsForStencil("mxgraph.office.clouds","public cloud","office cloud ").join(" ")),this.createVertexTemplateEntry("shadow\x3d0;dashed\x3d0;html\x3d1;strokeColor\x3dnone;fillColor\x3d#505050;labelPosition\x3dcenter;verticalLabelPosition\x3dbottom;verticalAlign\x3dtop;shape\x3dmxgraph.office.clouds.public_im_cloud_service;",102,99,"","Public IM Cloud Service",null,null,this.getTagsForStencil("mxgraph.office.clouds","public im instant message cloud service", "office cloud ").join(" "))];this.addPalette("officeClouds","Office / Clouds",!1,mxUtils.bind(this,function(c){for(var f=0;fthis.maxAutosaveRevisionDelay}; DrawioFile.prototype.close=function(a){this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,c){if(null!=a&&null!=c){var f=a.lastIndexOf("."),d=0d&&(b.style.paddingTop="12px",b.innerHTML="",mxUtils.write(b,mxResources.get("chooseAnOption")+":"),k.style.border= "none",k.style.padding="16px 0px 0px 0px",l.style.marginBottom="0px");this.init=function(){if(a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive){var b=function(){var c=a.oneDrive.getUser();if(null!=c){l.style.marginBottom="24px";var d=document.createElement("a");d.setAttribute("href","javascript:void(0)");d.style.display="block";d.style.marginTop="2px";mxUtils.write(d,mxResources.get("changeUser")+" ("+c.displayName+")");l.style.marginBottom="16px";k.style.paddingBottom="18px";mxEvent.addListener(d,"click", function(){a.oneDrive.logout();d.parentNode.removeChild(d);a.oneDrive.execute(b)});k.appendChild(d)}};a.oneDrive.execute(b)}};this.container=c},ConfirmDialog=function(a,c,f,d,b,e){var g=document.createElement("div");g.style.textAlign="center";var k=document.createElement("div");k.style.padding="6px";k.style.overflow="auto";k.style.maxHeight="40px";mxClient.IS_QUIRKS&&(k.style.height="60px");mxUtils.write(k,c);g.appendChild(k);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign= "center";e=mxUtils.button(e||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d()});e.className="geBtn";a.editor.cancelFirst&&c.appendChild(e);b=mxUtils.button(b||mxResources.get("ok"),function(){a.hideDialog();null!=f&&f()});c.appendChild(b);b.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(e);g.appendChild(c);this.container=g},ErrorDialog=function(a,c,f,d,b,e,g,k,l){l=null!=l?l:!0;var n=document.createElement("div");n.style.textAlign="center";if(null!=c){var m=document.createElement("div"); m.style.padding="0px";m.style.margin="0px";m.style.fontSize="18px";m.style.paddingBottom="16px";m.style.marginBottom="16px";m.style.borderBottom="1px solid #c0c0c0";m.style.color="gray";mxUtils.write(m,c);n.appendChild(m)}c=document.createElement("div");c.style.padding="6px";c.innerHTML=f;n.appendChild(c);f=document.createElement("div");f.style.marginTop="16px";f.style.textAlign="right";null!=e&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();e()}),c.className="geBtn",f.appendChild(c), f.style.textAlign="center");var p=mxUtils.button(d,function(){l&&a.hideDialog();null!=b&&b()});p.className="geBtn";f.appendChild(p);null!=g&&(d=mxUtils.button(g,function(){l&&a.hideDialog();null!=k&&k()}),d.className="geBtn gePrimaryBtn",f.appendChild(d));this.init=function(){p.focus()};n.appendChild(f);this.container=n},EmbedDialog=function(a,c,f,d,b){d=document.createElement("div");var e=/^https?:\/\//.test(c)||/^mailto:\/\//.test(c);mxUtils.write(d,mxResources.get(5E5>c.length?e?"link":"mainEmbedNotice": "preview")+":");mxUtils.br(d);var g=document.createElement("div");g.style.position="absolute";g.style.top="30px";g.style.right="30px";g.style.color="gray";mxUtils.write(g,a.formatFileSize(c.length));d.appendChild(g);var k=document.createElement("textarea");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.marginTop="10px";k.style.resize="none";k.style.height="150px";k.style.width="440px";k.style.border= "1px solid gray";k.value=mxResources.get("updatingDocument");d.appendChild(k);mxUtils.br(d);this.init=function(){window.setTimeout(function(){5E5>c.length?(k.value=c,k.focus(),mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?k.select():document.execCommand("selectAll",!1,null)):(k.setAttribute("readonly","true"),k.value=c.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};g=document.createElement("div");g.style.position="absolute";g.style.bottom="36px";g.style.right= "32px";var l=null;if(!mxClient.IS_CHROMEAPP&&!navigator.standalone&&(e||mxClient.IS_SVG&&(null==document.documentMode||9c.length?"preview":"openInNewWindow"),function(){var d=5E5>c.length?k.value:c;if(null!=b)b(d);else if(e)try{var g=window.open(d);if(null==f||0 c.length){var m=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]\x3d"+encodeURIComponent(k.value);window.open(b)}catch(c){a.handleError({message:c.message||mxResources.get("drawingTooLarge")})}}),n=document.createElement("img");n.setAttribute("src",Editor.facebookImage);n.setAttribute("valign","bottom");n.setAttribute("border","0");n.style.marginBottom="5px";m.appendChild(n);m.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)"); m.style.minWidth="46px";m.className="geBtn";g.appendChild(m)}7168>c.length&&(m=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text\x3d"+encodeURIComponent("Check out the diagram I made using @drawio")+"\x26url\x3d"+encodeURIComponent(k.value);window.open(b)}catch(c){a.handleError({message:c.message||mxResources.get("drawingTooLarge")})}}),n=document.createElement("img"),n.setAttribute("src",Editor.tweetImage),n.setAttribute("valign","bottom"),n.setAttribute("border","0"), n.style.marginBottom="5px",m.appendChild(n),m.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),m.style.minWidth="46px",m.className="geBtn",g.appendChild(m))}n=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.appendChild(n);m=mxUtils.button(mxResources.get("copy"),function(){k.focus();mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?k.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))}); 5E5>c.length?!mxClient.IS_SF&&null==document.documentMode?(g.appendChild(m),m.className="geBtn gePrimaryBtn",n.className="geBtn"):n.className="geBtn gePrimaryBtn":(g.appendChild(l),n.className="geBtn",l.className="geBtn gePrimaryBtn");d.appendChild(g);this.container=d},GoogleSitesDialog=function(a,c){function f(){var a=null!=B.getTitle()?B.getTitle():this.defaultFilename;if(z.checked&&""!=s.value){var c="https://www.draw.io/gadget.xml?type\x3d4\x26diagram\x3d"+encodeURIComponent(mxUtils.htmlEntities(s.value)); null!=a&&(c+="\x26title\x3d"+encodeURIComponent(a));0>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|c>>6;c4=c&63;r="";r+=k(c1&63);r+=k(c2&63);r+=k(c3&63);return r+=k(c4&63)},k=function(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-": 1==a?"_":"?"},g=new XMLHttpRequest;g.open("GET",d+function(a){r="";for(n=0;nthis.status?(c=new FileReader,c.readAsDataURL(this.response),c.onload=function(c){var d=new Image;d.onload=function(){a.spinner.stop(); e.getModel().beginUpdate();try{var f=e.view,k=e.getGraphBounds(),g=Math.ceil(Math.max(0,k.x/f.scale-f.translate.x)+4*e.gridSize),l=Math.ceil(Math.max(0,(k.y+k.height)/f.scale-f.translate.y)+4*e.gridSize);cell=e.insertVertex(null,null,b,e.snap(g),e.snap(l),d.width,d.height,"shape\x3dimage;noLabel\x3d1;verticalAlign\x3dtop;aspect\x3dfixed;imageAspect\x3d0;image\x3d"+a.convertDataUri(c.target.result)+";")}finally{e.getModel().endUpdate()}e.setSelectionCell(cell);e.scrollCellToVisible(e.getSelectionCell())}; d.src=c.target.result},c.onerror=function(b){a.handleError(b)}):(a.spinner.stop(),a.handleError(c))};g.onerror=function(b){a.handleError(b)};g.send()}}else if("list"==c){if(0=u.scrollHeight&&(a(),mxEvent.consume(b))});var c=null,d;for(d in z){var e=document.createElement("div"),f=mxResources.get(d),k=z[d];null==f&&(f=d.substring(0,1).toUpperCase()+d.substring(1));18c.lastIndexOf(".")&&(!v||0>e)){b=null!=b?b:y.value;var f="";b==App.MODE_GOOGLE?f=a.drive.extension:b==App.MODE_DROPBOX?f=a.dropbox.extension:b==App.MODE_ONEDRIVE?f=a.oneDrive.extension:b==App.MODE_DEVICE&&(f=".xml");0<=e&&(d=d.substring(0,e));x.value= d+f}}}function t(b){var c=x.value;if(null==b||null!=c&&0FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email\x3d"+encodeURIComponent(d.value)+"\x26version\x3d"+encodeURIComponent(EditorUi.VERSION)+ "\x26url\x3d"+encodeURIComponent(window.location.href)+"\x26body\x3d"+encodeURIComponent("Feedback:\n"+l.value+b),function(b){a.spinner.stop();200==b.getStatus()?a.alert(mxResources.get("feedbackSent")):a.alert(mxResources.get("errorSendingFeedback"))},function(){a.spinner.stop();a.alert(mxResources.get("errorSendingFeedback"))}))});b.className="geBtn gePrimaryBtn";b.setAttribute("disabled","disabled");var e=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; mxEvent.addListener(d,"change",function(){0mxUtils.indexOf(b,f[a])&&b.push(f[a]);c()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+ ")");a.showDialog(d.container,300,80,!0,!0);d.init()});e.className="geBtn";var g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";var k=mxUtils.button(mxResources.get("apply"),function(){mxSettings.setPlugins(b);mxSettings.save();a.hideDialog();a.alert(mxResources.get("restartForChangeRequired"))});k.className="geBtn gePrimaryBtn";var l=document.createElement("div");l.style.marginTop="14px";l.style.textAlign="right";a.editor.cancelFirst?(l.appendChild(g),l.appendChild(e), l.appendChild(k)):(l.appendChild(e),l.appendChild(k),l.appendChild(g));f.appendChild(l);this.container=f},EditGeometryDialog=function(a,c){var f=a.editor.graph,d=1==c.length?f.getCellGeometry(c[0]):null,b=document.createElement("div"),e=document.createElement("table"),g=document.createElement("tbody"),k=document.createElement("tr"),l=document.createElement("td"),n=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(l,mxResources.get("left")+":");var m=document.createElement("input"); m.setAttribute("type","text");m.style.width="100px";m.value=null!=d?d.x:"";this.init=function(){m.focus();m.select()};n.appendChild(m);k.appendChild(l);k.appendChild(n);g.appendChild(k);k=document.createElement("tr");l=document.createElement("td");n=document.createElement("td");mxUtils.write(l,mxResources.get("top")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=d?d.y:"";n.appendChild(p);k.appendChild(l);k.appendChild(n);g.appendChild(k); k=document.createElement("tr");l=document.createElement("td");n=document.createElement("td");mxUtils.write(l,mxResources.get("width")+":");var s=document.createElement("input");s.setAttribute("type","text");s.style.width="100px";s.value=null!=d?d.width:"";n.appendChild(s);k.appendChild(l);k.appendChild(n);g.appendChild(k);k=document.createElement("tr");l=document.createElement("td");n=document.createElement("td");mxUtils.write(l,mxResources.get("height")+":");var t=document.createElement("input"); t.setAttribute("type","text");t.style.width="100px";t.value=null!=d?d.height:"";n.appendChild(t);k.appendChild(l);k.appendChild(n);g.appendChild(k);k=document.createElement("tr");l=document.createElement("td");n=document.createElement("td");mxUtils.write(l,mxResources.get("rotation")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=1==c.length?mxUtils.getValue(f.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";n.appendChild(q);k.appendChild(l); k.appendChild(n);g.appendChild(k);e.appendChild(g);b.appendChild(e);var d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();f.getModel().beginUpdate();try{for(var b=0;ba.maxImageSize||l>a.maxImageSize){var T=Math.min(1,Math.min(a.maxImageSize/ Math.max(1,f)),a.maxImageSize/Math.max(1,l));f*=T;l*=T}y>C?(C=Math.round(C*u/y),y=u):(y=Math.round(y*x/C),C=x);var O=document.createElement("div");O.setAttribute("draggable","true");O.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";O.style.position="relative";O.style.cursor="move";mxUtils.setPrefixedStyle(O.style,"transition","transform .1s ease-in-out");if(null!=b){var M=document.createElement("img");M.setAttribute("src",D.convert(b));M.style.width=y+"px";M.style.height=C+"px";M.style.margin= "10px";M.style.paddingBottom=Math.floor((x-C)/2)+"px";M.style.paddingLeft=Math.floor((u-y)/2)+"px";O.appendChild(M)}else if(null!=n){var $=a.stringToCells(a.editor.graph.decompress(n.xml));0<$.length&&(a.sidebar.createThumb($,u,x,O,null,!0,!1),O.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",O.firstChild.style.cursor="")}var N=document.createElement("img");N.setAttribute("src",Editor.closeImage);N.setAttribute("border","0");N.setAttribute("title",mxResources.get("delete"));N.setAttribute("align", "top");N.style.paddingTop="4px";N.style.marginLeft="-22px";N.style.cursor="pointer";mxEvent.addListener(N,"dragstart",function(a){mxEvent.consume(a)});null==b&&null!=n&&(N.style.position="relative");(function(a,b,c){mxEvent.addListener(N,"click",function(d){v[b]=null;for(var e=0;eA?y-1:y,0,m.splice(A,1)[0]),t.insertBefore(t.children[A],t.children[y])):(m.push(m.splice(A,1)[0]),t.appendChild(t.children[A]));else if(0document.documentMode)?b.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr\x3d'"+a.fill+"', EndColorStr\x3d'"+ a.gradient+"', GradientType\x3d0)":b.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":b.style.backgroundColor=a.fill,b.style.border="1px solid "+a.stroke):(b.style.backgroundColor="#ffffff",b.style.border="1px solid #000000");e.appendChild(b)}e.innerHTML="";for(var k=0;k=document.documentMode)))g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/ 2))+"px";this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,f)}));this.stop();return a});g=!0}return g};var f=d.stop;d.stop=function(){f.call(this);this.active=!1;null!=d.status&&(d.status.parentNode.removeChild(d.status),d.status=null)};return d};EditorUi.parsePng=function(a,b,c){function d(a,b){var c=f;f+=b;return a.substring(c,f)}function e(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<< 24)}var f=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(d(a,4),"IHDR"!=d(a,4))null!=c&&c();else{d(a,17);do{c=e(a);var g=d(a,4);if(null!=b&&b(f-8,g,c))break;value=d(a,c);d(a,4);if("IEND"==g)break}while(c)}};EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(d){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml; EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var d=b.indexOf("\x26lt;mxfile ");if(0<=d){var e=b.lastIndexOf("\x26lt;/mxfile\x26gt;");e>d&&(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(t){}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 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, "zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c};EditorUi.prototype.saveCanvas=function(a,b){var c=this.getCurrentFile(),c=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename,d=c.lastIndexOf(".");0e.getStatus()||299f.status){this.spinner.stop();this.hideDialog();a="https://github.com/"+x.value+"/"+A.value+"/blob/"+D.value+"/"+y.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(v.value+":"+u.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,q){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,q,v,u,x,A){var y=null!=b&&null!= c;b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;u=null!=u?u:this.maxImageBytes;v=null!=v?v:!0;var z=this.editor.graph,D=z.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,y,A)});f=null!=f?f:mxUtils.bind(this,function(a){z.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var B= a.length,C=B,F=[],H=mxUtils.bind(this,function(a,b){F[a]=b;if(0==--C){this.spinner.stop();if(null!=q)q(F);else{var c=[];z.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 v=Math.max(g/e,q/e);if(1c;c++)for(var f=c,d=0;8>d;d++)f=1==(f&1)?3988292384^f>>>1:f>>>1,EditorUi.prototype.crcTable[c]=f;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 v=g(a);if("IDAT"==f(a,4)){e=a.substring(0,q-8);v=4294967295;v=this.updateCRC(v,b,0,4);v=this.updateCRC(v,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((v^4294967295)>>24&255,(v^4294967295)>>16&255,(v^4294967295)>>8&255,(v^4294967295)&255);e+=a.substring(q-8,a.length);break}e+=a.substring(q-8,q-4+v);d=f(a,v);f(a,4)}while(v);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(){U.execute(x.getDefaultParent()); da()},!0,A);A=null}else if("horizontaltree"==C||"verticaltree"==C||"auto"==C&&$.length==2*c.length-1&&1==M.length){x.view.validate();var aa=new mxCompactTreeLayout(x,"horizontaltree"==C);aa.levelDistance=v;aa.edgeRouting=!1;this.executeLayout(function(){aa.execute(x.getDefaultParent(),0c.length){x.view.validate();var S=new mxFastOrganicLayout(x);S.forceConstant=3*v;S.resetEdges=!1;var ha=S.isVertexIgnored;S.isVertexIgnored=function(a){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,a)};fa=new mxParallelEdgeLayout(x);fa.spacing=q;this.executeLayout(function(){S.execute(x.getDefaultParent());da()},!0,A);A=null}this.hideDialog()}finally{x.model.endUpdate()}null!= A&&A()}}catch(ca){this.handleError(ca)}};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 e=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=e.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width- 2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var f=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return f.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&& null!=this.source.minimumGraphSize){var d=this.source.getPagePadding(),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/a-(this.source.minimumGraphSize.height-2*d.y))/2);return new mxPoint(Math.round(e-d.x),Math.round(f-d.y-5/a))}return new mxPoint(8/a,8/a)};var g=b.init;b.init=function(){g.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale* (this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor; null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(){!this.isOfflineApp()&&this.isOffline();var a=0;null!=this.drive&&a++;null!=this.dropbox&&a++;isLocalStorage&&"0"!=urlParams.browser&&a++;mxClient.IS_IOS||a++;return a};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates(); var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed;this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c="1"!=urlParams.embed&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);a="1"==urlParams.embed||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b); this.actions.get("resetView").setEnabled(b);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){if((mxClient.IS_GC||mxClient.IS_IOS&&mxClient.IS_SF)&&null!=applicationCache){var d=applicationCache;if(null== this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus); var e=window.setTimeout(mxUtils.bind(this,function(){d.status==d.IDLE&&(this.offlineStatus.innerHTML='[\x3cimg title\x3d"Cached" border\x3d"0" src\x3d"'+IMAGE_PATH+'/checkmark.gif"/\x3e]',window.clearTimeout(e))}),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 q=a.getFileData(!0,null,null,null,null,!0),v=g.getGraphBounds(),u=Math.floor(v.width*e/g.view.scale),x=Math.floor(v.height*e/g.view.scale);q.length<=MAX_REQUEST_SIZE&&u*xmxUtils.indexOf(this.settings.customLibraries,a)&&this.settings.customLibraries.push(a);mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,this.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return this.settings.customLibraries},getPlugins:function(){return this.settings.plugins},setPlugins:function(a){this.settings.plugins=a},getRecentColors:function(){return this.settings.recentColors}, setRecentColors:function(a){this.settings.recentColors=a},getFormatWidth:function(){return parseInt(this.settings.formatWidth)},setFormatWidth:function(a){this.settings.formatWidth=a},getCurrentEdgeStyle:function(){return this.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){this.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return this.settings.currentVertexStyle},setCurrentVertexStyle:function(a){this.settings.currentVertexStyle=a},isCreateTarget:function(){return this.settings.createTarget}, setCreateTarget:function(a){this.settings.createTarget=a},getPageFormat:function(){return this.settings.pageFormat},setPageFormat:function(a){this.settings.pageFormat=a},save:function(){if(isLocalStorage&&"undefined"!==typeof JSON)try{delete this.settings.isNew,this.settings.version=12,localStorage.setItem(mxSettings.key,JSON.stringify(this.settings))}catch(a){}},load:function(){isLocalStorage&&"undefined"!==typeof JSON&&mxSettings.parse(localStorage.getItem(mxSettings.key))},parse:function(a){null!= a&&(this.settings=JSON.parse(a),null==this.settings.plugins&&(this.settings.plugins=[]),null==this.settings.recentColors&&(this.settings.recentColors=[]),null==this.settings.libraries&&(this.settings.libraries=Sidebar.prototype.defaultEntries),null==this.settings.customLibraries&&(this.settings.customLibraries=[]),null==this.settings.ui&&(this.settings.ui=""),null==this.settings.formatWidth&&(this.settings.formatWidth="240"),null!=this.settings.lastAlert&&delete this.settings.lastAlert,null==this.settings.currentEdgeStyle? this.settings.currentEdgeStyle=Graph.prototype.defaultEdgeStyle:10>=this.settings.version&&(this.settings.currentEdgeStyle.orthogonalLoop=1,this.settings.currentEdgeStyle.jettySize="auto"),null==this.settings.currentVertexStyle&&(this.settings.currentVertexStyle={}),null==this.settings.createTarget&&(this.settings.createTarget=!1),null==this.settings.pageFormat&&(this.settings.pageFormat=mxGraph.prototype.pageFormat),null==this.settings.search&&(this.settings.search=!0),null==this.settings.showStartScreen&& (this.settings.showStartScreen=!0),null==this.settings.gridColor&&(this.settings.gridColor=mxGraphView.prototype.gridColor),null==this.settings.autosave&&(this.settings.autosave=!0),null!=this.settings.scratchpadSeen&&delete this.settings.scratchpadSeen)},clear:function(){isLocalStorage&&localStorage.removeItem(mxSettings.key)}};("undefined"==typeof mxLoadSettings||mxLoadSettings)&&mxSettings.load();Graph.prototype.defaultThemes[Graph.prototype.defaultThemeName]=mxUtils.parseXml('\x3cmxStylesheet\x3e\x3cadd as\x3d"defaultVertex"\x3e\x3cadd as\x3d"shape" value\x3d"label"/\x3e\x3cadd as\x3d"perimeter" value\x3d"rectanglePerimeter"/\x3e\x3cadd as\x3d"fontSize" value\x3d"12"/\x3e\x3cadd as\x3d"fontFamily" value\x3d"Helvetica"/\x3e\x3cadd as\x3d"align" value\x3d"center"/\x3e\x3cadd as\x3d"verticalAlign" value\x3d"middle"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#ffffff"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#000000"/\x3e\x3cadd as\x3d"fontColor" value\x3d"#000000"/\x3e\x3c/add\x3e\x3cadd as\x3d"defaultEdge"\x3e\x3cadd as\x3d"shape" value\x3d"connector"/\x3e\x3cadd as\x3d"labelBackgroundColor" value\x3d"#ffffff"/\x3e\x3cadd as\x3d"endArrow" value\x3d"classic"/\x3e\x3cadd as\x3d"fontSize" value\x3d"11"/\x3e\x3cadd as\x3d"fontFamily" value\x3d"Helvetica"/\x3e\x3cadd as\x3d"align" value\x3d"center"/\x3e\x3cadd as\x3d"verticalAlign" value\x3d"middle"/\x3e\x3cadd as\x3d"rounded" value\x3d"1"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#000000"/\x3e\x3cadd as\x3d"fontColor" value\x3d"#000000"/\x3e\x3c/add\x3e\x3cadd as\x3d"fancy"\x3e\x3cadd as\x3d"shadow" value\x3d"1"/\x3e\x3cadd as\x3d"glass" value\x3d"1"/\x3e\x3c/add\x3e\x3cadd as\x3d"gray" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#B3B3B3"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#F5F5F5"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#666666"/\x3e\x3c/add\x3e\x3cadd as\x3d"blue" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#7EA6E0"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#DAE8FC"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#6C8EBF"/\x3e\x3c/add\x3e\x3cadd as\x3d"green" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#97D077"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#D5E8D4"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#82B366"/\x3e\x3c/add\x3e\x3cadd as\x3d"turquoise" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#67AB9F"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#D5E8D4"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#6A9153"/\x3e\x3c/add\x3e\x3cadd as\x3d"yellow" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#FFD966"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#FFF2CC"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#D6B656"/\x3e\x3c/add\x3e\x3cadd as\x3d"orange" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#FFA500"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#FFCD28"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#D79B00"/\x3e\x3c/add\x3e\x3cadd as\x3d"red" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#EA6B66"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#F8CECC"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#B85450"/\x3e\x3c/add\x3e\x3cadd as\x3d"pink" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#B5739D"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#E6D0DE"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#996185"/\x3e\x3c/add\x3e\x3cadd as\x3d"purple" extend\x3d"fancy"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#8C6C9C"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#E1D5E7"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#9673A6"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-gray"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#B3B3B3"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#F5F5F5"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#666666"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-blue"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#7EA6E0"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#DAE8FC"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#6C8EBF"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-green"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#97D077"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#D5E8D4"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#82B366"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-turquoise"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#67AB9F"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#D5E8D4"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#6A9153"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-yellow"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#FFD966"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#FFF2CC"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#D6B656"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-orange"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#FFA500"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#FFCD28"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#D79B00"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-red"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#EA6B66"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#F8CECC"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#B85450"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-pink"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#B5739D"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#E6D0DE"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#996185"/\x3e\x3c/add\x3e\x3cadd as\x3d"plain-purple"\x3e\x3cadd as\x3d"gradientColor" value\x3d"#8C6C9C"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#E1D5E7"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"#9673A6"/\x3e\x3c/add\x3e\x3cadd as\x3d"text"\x3e\x3cadd as\x3d"fillColor" value\x3d"none"/\x3e\x3cadd as\x3d"gradientColor" value\x3d"none"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"none"/\x3e\x3cadd as\x3d"align" value\x3d"left"/\x3e\x3cadd as\x3d"verticalAlign" value\x3d"top"/\x3e\x3c/add\x3e\x3cadd as\x3d"label"\x3e\x3cadd as\x3d"fontStyle" value\x3d"1"/\x3e\x3cadd as\x3d"align" value\x3d"left"/\x3e\x3cadd as\x3d"verticalAlign" value\x3d"middle"/\x3e\x3cadd as\x3d"spacing" value\x3d"2"/\x3e\x3cadd as\x3d"spacingLeft" value\x3d"52"/\x3e\x3cadd as\x3d"imageWidth" value\x3d"42"/\x3e\x3cadd as\x3d"imageHeight" value\x3d"42"/\x3e\x3cadd as\x3d"rounded" value\x3d"1"/\x3e\x3c/add\x3e\x3cadd as\x3d"icon" extend\x3d"label"\x3e\x3cadd as\x3d"align" value\x3d"center"/\x3e\x3cadd as\x3d"imageAlign" value\x3d"center"/\x3e\x3cadd as\x3d"verticalLabelPosition" value\x3d"bottom"/\x3e\x3cadd as\x3d"verticalAlign" value\x3d"top"/\x3e\x3cadd as\x3d"spacingTop" value\x3d"4"/\x3e\x3cadd as\x3d"labelBackgroundColor" value\x3d"#ffffff"/\x3e\x3cadd as\x3d"spacing" value\x3d"0"/\x3e\x3cadd as\x3d"spacingLeft" value\x3d"0"/\x3e\x3cadd as\x3d"spacingTop" value\x3d"6"/\x3e\x3cadd as\x3d"fontStyle" value\x3d"0"/\x3e\x3cadd as\x3d"imageWidth" value\x3d"48"/\x3e\x3cadd as\x3d"imageHeight" value\x3d"48"/\x3e\x3c/add\x3e\x3cadd as\x3d"swimlane"\x3e\x3cadd as\x3d"shape" value\x3d"swimlane"/\x3e\x3cadd as\x3d"fontSize" value\x3d"12"/\x3e\x3cadd as\x3d"fontStyle" value\x3d"1"/\x3e\x3cadd as\x3d"startSize" value\x3d"23"/\x3e\x3c/add\x3e\x3cadd as\x3d"group"\x3e\x3cadd as\x3d"verticalAlign" value\x3d"top"/\x3e\x3cadd as\x3d"fillColor" value\x3d"none"/\x3e\x3cadd as\x3d"strokeColor" value\x3d"none"/\x3e\x3cadd as\x3d"gradientColor" value\x3d"none"/\x3e\x3cadd as\x3d"pointerEvents" value\x3d"0"/\x3e\x3c/add\x3e\x3cadd as\x3d"ellipse"\x3e\x3cadd as\x3d"shape" value\x3d"ellipse"/\x3e\x3cadd as\x3d"perimeter" value\x3d"ellipsePerimeter"/\x3e\x3c/add\x3e\x3cadd as\x3d"rhombus"\x3e\x3cadd as\x3d"shape" value\x3d"rhombus"/\x3e\x3cadd as\x3d"perimeter" value\x3d"rhombusPerimeter"/\x3e\x3c/add\x3e\x3cadd as\x3d"triangle"\x3e\x3cadd as\x3d"shape" value\x3d"triangle"/\x3e\x3cadd as\x3d"perimeter" value\x3d"trianglePerimeter"/\x3e\x3c/add\x3e\x3cadd as\x3d"line"\x3e\x3cadd as\x3d"shape" value\x3d"line"/\x3e\x3cadd as\x3d"strokeWidth" value\x3d"4"/\x3e\x3cadd as\x3d"labelBackgroundColor" value\x3d"#ffffff"/\x3e\x3cadd as\x3d"verticalAlign" value\x3d"top"/\x3e\x3cadd as\x3d"spacingTop" value\x3d"8"/\x3e\x3c/add\x3e\x3cadd as\x3d"image"\x3e\x3cadd as\x3d"shape" value\x3d"image"/\x3e\x3cadd as\x3d"labelBackgroundColor" value\x3d"white"/\x3e\x3cadd as\x3d"verticalAlign" value\x3d"top"/\x3e\x3cadd as\x3d"verticalLabelPosition" value\x3d"bottom"/\x3e\x3c/add\x3e\x3cadd as\x3d"roundImage" extend\x3d"image"\x3e\x3cadd as\x3d"perimeter" value\x3d"ellipsePerimeter"/\x3e\x3c/add\x3e\x3cadd as\x3d"rhombusImage" extend\x3d"image"\x3e\x3cadd as\x3d"perimeter" value\x3d"rhombusPerimeter"/\x3e\x3c/add\x3e\x3cadd as\x3d"arrow"\x3e\x3cadd as\x3d"shape" value\x3d"arrow"/\x3e\x3cadd as\x3d"edgeStyle" value\x3d"none"/\x3e\x3cadd as\x3d"fillColor" value\x3d"#ffffff"/\x3e\x3c/add\x3e\x3c/mxStylesheet\x3e').documentElement;(!/\bMSIE 6/.test(navigator.userAgent)||window.opera)&&function(){var a,c,f,d,b,e,g,k,l,n,m,p={}.hasOwnProperty,s=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},t=function(a,b){function c(){this.constructor=a}for(var d in b)p.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};if(m=function(){return function(){throw Error("Not implemented. Did you mean to use Dropbox.Client?");}}(),m.Util=function(){return function(){}}(), m.Http=function(){return function(){}}(),m.File=function(){return function(){}}(),"undefined"!=typeof global&&"undefined"!=typeof module&&"exports"in module)c=global,f=module.require.bind(module),module.exports=m;else if("undefined"!=typeof window&&"undefined"!=typeof navigator)c=window,f=null,window.Dropbox&&!function(){var a,b,c,d;c=window.Dropbox;d=[];for(a in c)p.call(c,a)&&(b=c[a],d.push(m[a]=b));return d}(),window.Dropbox=m;else{if("undefined"==typeof self||"undefined"==typeof navigator)throw Error("dropbox.js loaded in an unsupported JavaScript environment."); c=self;f=self.importScripts.bind(self);self.Dropbox=m}if(m.Env=function(){function a(){}return a.global=c,a.require=f,a}(),m.Util.EventSource=function(){function a(b){this._cancelable=b&&b.cancelable;this._listeners=[]}return a.prototype.addListener=function(a){if("function"!=typeof a)throw new TypeError("Invalid listener type; expected function");return 0>s.call(this._listeners,a)&&this._listeners.push(a),this},a.prototype.removeListener=function(a){var b,c,d,e,f;if(this._listeners.indexOf)a=this._listeners.indexOf(a), -1!==a&&this._listeners.splice(a,1);else{f=this._listeners;b=d=0;for(e=f.length;e>d;b=++d)if(c=f[b],c===a){this._listeners.splice(b,1);break}}return this},a.prototype.dispatch=function(a){var b,c,d,e,f;f=this._listeners;d=0;for(e=f.length;e>d;d++)if(b=f[d],c=b(a),this._cancelable&&!1===c)return!1;return!0},a}(),m.AccountInfo=function(){function a(b){var c;this._json=b;this.name=b.display_name;this.email=b.email;this.countryCode=b.country||null;this.uid=b.uid.toString();b.public_app_url?(this.publicAppUrl= b.public_app_url,c=this.publicAppUrl.length-1,0<=c&&"/"===this.publicAppUrl.substring(c)&&(this.publicAppUrl=this.publicAppUrl.substring(0,c))):this.publicAppUrl=null;this.referralUrl=b.referral_link;this.quota=b.quota_info.quota;this.privateBytes=b.quota_info.normal||0;this.sharedBytes=b.quota_info.shared||0;this.usedQuota=this.privateBytes+this.sharedBytes}return a.parse=function(a){return a&&"object"==typeof a?new m.AccountInfo(a):a},a.prototype.name=null,a.prototype.email=null,a.prototype.countryCode= null,a.prototype.uid=null,a.prototype.referralUrl=null,a.prototype.publicAppUrl=null,a.prototype.quota=null,a.prototype.usedQuota=null,a.prototype.privateBytes=null,a.prototype.sharedBytes=null,a.prototype.json=function(){return this._json},a}(),m.ApiError=function(){function a(b,c,d){var e;if(this.method=c,this.url=d,this.status=b.status,b.responseType)try{e=b.response||b.responseText}catch(f){try{e=b.responseText}catch(g){e=null}}else try{e=b.responseText}catch(k){e=null}if(e)try{this.responseText= e.toString(),this.response=JSON.parse(e)}catch(l){this.response=null}else this.responseText="(no response)",this.response=null}return a.prototype.status=null,a.prototype.method=null,a.prototype.url=null,a.prototype.responseText=null,a.prototype.response=null,a.NETWORK_ERROR=0,a.NO_CONTENT=304,a.INVALID_PARAM=400,a.INVALID_TOKEN=401,a.OAUTH_ERROR=403,a.NOT_FOUND=404,a.INVALID_METHOD=405,a.NOT_ACCEPTABLE=406,a.CONFLICT=409,a.RATE_LIMITED=429,a.SERVER_ERROR=503,a.OVER_QUOTA=507,a.prototype.toString= function(){return"Dropbox API error "+this.status+" from "+this.method+" "+this.url+" :: "+this.responseText},a.prototype.inspect=function(){return this.toString()},a}(),m.AuthDriver=function(){function a(){}return a.prototype.authType=function(){return"code"},a.prototype.url=function(){return"https://some.url"},a.prototype.doAuthorize=function(a,b,c,d){return d({code:"access-code"})},a.prototype.getStateParam=function(a,b){return b(m.Util.Oauth.randomAuthStateParam())},a.prototype.resumeAuthorize= function(a,b,c){return c({code:"access-code"})},a.prototype.onAuthStepChange=function(a,b){return b()},a.oauthQueryParams="access_token expires_in scope token_type code error error_description error_uri mac_key mac_algorithm".split(" ").sort(),a}(),m.AuthDriver.autoConfigure=function(a){if("undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.id)return void a.authDriver(chrome.tabs&&chrome.tabs.create?new m.AuthDriver.ChromeExtension:new m.AuthDriver.ChromeApp);if("undefined"!=typeof window){if(window.cordova)return void a.authDriver(new m.AuthDriver.Cordova); window&&window.navigator&&a.authDriver(new m.AuthDriver.Redirect)}},m.AuthDriver.BrowserBase=function(){function a(b){b?(this.rememberUser="rememberUser"in b?b.rememberUser:!0,this.scope=b.scope||"default"):(this.rememberUser=!0,this.scope="default");this.storageKey=null;this.storage=m.AuthDriver.BrowserBase.localStorage();this.stateRe=/^[^#]+\#(.*&)?state=([^&]+)(&|$)/}return a.prototype.authType=function(){return"token"},a.prototype.onAuthStepChange=function(a,b){switch(this.setStorageKey(a),a.authStep){case m.Client.RESET:return this.loadCredentials(function(c){return function(d){return d? (a.setCredentials(d),a.authStep!==m.Client.DONE?b():c.rememberUser?(a.setCredentials(d),b()):c.forgetCredentials(b)):b()}}(this));case m.Client.DONE:return this.rememberUser?this.storeCredentials(a.credentials(),b):this.forgetCredentials(b);case m.Client.SIGNED_OUT:return this.forgetCredentials(b);case m.Client.ERROR:return this.forgetCredentials(b);default:return b(),this}},a.prototype.setStorageKey=function(a){return this.storageKey="dropbox-auth:"+this.scope+":"+a.appHash(),this},a.prototype.storeCredentials= function(a,b){var c,d;c=JSON.stringify(a);try{this.storage.setItem(this.storageKey,c)}catch(e){d=encodeURIComponent(this.storageKey),c=encodeURIComponent(c),document.cookie=""+d+"\x3d"+c+"; path\x3d/"}return b(),this},a.prototype.loadCredentials=function(a){var b,c,d,e;try{c=this.storage.getItem(this.storageKey)}catch(f){c=null}if(null===c&&(e=encodeURIComponent(this.storageKey),e.replace(/[.*+()]/g,"\\$\x26"),b=RegExp("(^|(;\\s*))"+e+"\x3d([^;]*)(;|$)"),(d=b.exec(document.cookie))&&(c=decodeURIComponent(d[3]))), !c)return a(null),this;try{a(JSON.parse(c))}catch(g){a(null)}return this},a.prototype.forgetCredentials=function(a){var b,c;try{this.storage.removeItem(this.storageKey)}catch(d){c=encodeURIComponent(this.storageKey),b=(new Date(0)).toGMTString(),document.cookie=""+c+"\x3d{}; expires\x3d"+b+"; path\x3d/"}return a(),this},a.prototype.locationStateParam=function(a){var b,c;return b=a||m.AuthDriver.BrowserBase.currentLocation(),c=this.stateRe.exec(b),c?decodeURIComponent(c[2]):null},a.prototype.replaceUrlBasename= function(a,b){var c,d,e;return d=a.indexOf("#"),-1!==d&&(a=a.substring(0,d)),e=a.indexOf("?"),-1!==e&&(a=a.substring(0,e)),c=a.split("/"),c[c.length-1]=b,c.join("/")},a.localStorage=function(){if("undefined"==typeof window)return null;try{return window.localStorage}catch(a){return null}},a.currentLocation=function(){return window.location.href},a.cleanupLocation=function(){var a,b;window.history&&window.history.replaceState?(b=this.currentLocation(),a=b.indexOf("#"),window.history.replaceState({}, document.title,b.substring(0,a))):window.location.hash=""},a}(),m.AuthDriver.Redirect=function(a){function b(a){b.__super__.constructor.call(this,a);this.receiverUrl=this.baseUrl(a)}return t(b,a),b.prototype.baseUrl=function(a){var b,c;if(c=m.AuthDriver.BrowserBase.currentLocation(),a){if(a.redirectUrl)return a.redirectUrl;if(a.redirectFile)return this.replaceUrlBasename(c,a.redirectFile)}return b=c.indexOf("#"),-1!==b&&(c=c.substring(0,b)),c},b.prototype.url=function(){return this.receiverUrl},b.prototype.doAuthorize= function(a,b,c){return this.storeCredentials(c.credentials(),function(){return window.location.assign(a)})},b.prototype.resumeAuthorize=function(a,b,c){var d;return this.locationStateParam()===a?(d=m.AuthDriver.BrowserBase.currentLocation(),m.AuthDriver.BrowserBase.cleanupLocation(),c(m.Util.Oauth.queryParamsFromUrl(d))):this.forgetCredentials(function(){return c({error:"Authorization error"})})},b}(m.AuthDriver.BrowserBase),m.AuthDriver.Popup=function(a){function b(a){b.__super__.constructor.call(this, a);this.receiverUrl=this.baseUrl(a)}return t(b,a),b.prototype.url=function(){return this.receiverUrl},b.prototype.doAuthorize=function(a,b,c,d){return this.listenForMessage(b,d),this.openWindow(a)},b.prototype.baseUrl=function(a){var b;if(b=m.AuthDriver.BrowserBase.currentLocation(),a){if(a.receiverUrl)return a.receiverUrl;if(a.receiverFile)return this.replaceUrlBasename(b,a.receiverFile)}return b},b.prototype.openWindow=function(a){return window.open(a,"_dropboxOauthSigninWindow",this.popupWindowSpec(980, 700))},b.prototype.popupWindowSpec=function(a,b){var c,d,e,f,g,k,l,m,n,u;return g=null!=(l=window.screenX)?l:window.screenLeft,k=null!=(m=window.screenY)?m:window.screenTop,f=null!=(n=window.outerWidth)?n:document.documentElement.clientWidth,c=null!=(u=window.outerHeight)?u:document.documentElement.clientHeight,d=Math.round(g+(f-a)/2),e=Math.round(k+(c-b)/2.5),g>d&&(d=g),k>e&&(e=k),"width\x3d"+a+",height\x3d"+b+","+("left\x3d"+d+",top\x3d"+e)+"dialog\x3dyes,dependent\x3dyes,scrollbars\x3dyes,location\x3dyes"}, b.prototype.listenForMessage=function(a,b){var c;return c=function(d){return function(e){var f;e=e.data?e.data:e;try{f=JSON.parse(e)._dropboxjs_oauth_info}catch(g){return}if(f)return d.locationStateParam(f)===a?(a=!1,window.removeEventListener("message",c),m.AuthDriver.Popup.onMessage.removeListener(c),b(m.Util.Oauth.queryParamsFromUrl(e))):void 0}}(this),window.addEventListener("message",c,!1),m.AuthDriver.Popup.onMessage.addListener(c)},b.locationOrigin=function(a){var b;return(b=/^(file:\/\/[^\?\#]*)(\?|\#|$)/.exec(a))? b[1]:(b=/^([^\:]+\:\/\/[^\/\?\#]*)(\/|\?|\#|$)/.exec(a),b?b[1]:a)},b.oauthReceiver=function(){window.addEventListener("load",function(){var a,b,c,d;if(d=window.location.href,a=JSON.stringify({_dropboxjs_oauth_info:d}),m.AuthDriver.BrowserBase.cleanupLocation(),b=window.opener,window.parent!==window.top&&(b||(b=window.parent)),b){try{c=window.location.origin||locationOrigin(d),b.postMessage(a,c),window.close()}catch(e){}try{return b.Dropbox.AuthDriver.Popup.onMessage.dispatch(a),window.close()}catch(f){}}})}, b.onMessage=new m.Util.EventSource,b}(m.AuthDriver.BrowserBase),m.AuthDriver.ChromeBase=function(a){function b(a){b.__super__.constructor.call(this,a);this.storageKey="dropbox_js_"+this.scope+"_credentials"}return t(b,a),b.prototype.onAuthStepChange=function(a,b){switch(a.authStep){case m.Client.RESET:return this.loadCredentials(function(c){return c&&a.setCredentials(c),b()});case m.Client.DONE:return this.storeCredentials(a.credentials(),b);case m.Client.SIGNED_OUT:return this.forgetCredentials(b); case m.Client.ERROR:return this.forgetCredentials(b);default:return b()}},b.prototype.url=function(){return this.receiverUrl},b.prototype.storeCredentials=function(a,b){var c;return c={},c[this.storageKey]=a,chrome.storage.local.set(c,b),this},b.prototype.loadCredentials=function(a){return chrome.storage.local.get(this.storageKey,function(b){return function(c){return a(c[b.storageKey]||null)}}(this)),this},b.prototype.forgetCredentials=function(a){return chrome.storage.local.remove(this.storageKey, a),this},b}(m.AuthDriver.BrowserBase),m.AuthDriver.ChromeApp=function(a){function b(a){b.__super__.constructor.call(this,a);this.receiverUrl="https://"+chrome.runtime.id+".chromiumapp.org/"}return t(b,a),b.prototype.doAuthorize=function(a,b,c,d){return chrome.identity.launchWebAuthFlow({url:a,interactive:!0},function(a){return function(c){return a.locationStateParam(c)===b?(b=!1,d(m.Util.Oauth.queryParamsFromUrl(c))):void 0}}(this))},b}(m.AuthDriver.ChromeBase),m.AuthDriver.ChromeExtension=function(a){function b(a){b.__super__.constructor.call(this, a);this.receiverUrl=chrome.runtime.getURL(a&&a.receiverPath||"chrome_oauth_receiver.html")}return t(b,a),b.prototype.doAuthorize=function(a,b,c,d){var e,f;return f=null,e=function(a){return function(c,g){var k;if((!g||!g.tab||g.tab.url.substring(0,a.receiverUrl.length)===a.receiverUrl)&&c.dropbox_oauth_receiver_href)return k=c.dropbox_oauth_receiver_href,a.locationStateParam(k)===b?(b=!1,f&&chrome.tabs.remove(f.id),chrome.runtime.onMessage.removeListener(e),d(m.Util.Oauth.queryParamsFromUrl(k))): void 0}}(this),chrome.runtime.onMessage.addListener(e),chrome.tabs.create({url:a,active:!0,pinned:!1},function(a){return f=a})},b.oauthReceiver=function(){return window.addEventListener("load",function(){var a;return a=window.location.href,window.location.hash="",chrome.runtime.sendMessage({dropbox_oauth_receiver_href:a}),window.close?window.close():void 0})},b}(m.AuthDriver.ChromeBase),m.AuthDriver.Cordova=function(a){function b(a){b.__super__.constructor.call(this,a)}return t(b,a),b.prototype.url= function(){return"https://www.dropbox.com/1/oauth2/redirect_receiver"},b.prototype.doAuthorize=function(a,b,c,d){var e,f,g;return e=window.open(a,"_blank","location\x3dyes,closebuttoncaption\x3dCancel"),/^[^/]*\/\/[^/]*\//.exec(a),g=!1,f=function(a){return function(c){if(c.url&&a.locationStateParam(c.url)===b)return g?void 0:(e.removeEventListener("loadstart",f),e.removeEventListener("loaderror",f),e.removeEventListener("loadstop",f),e.removeEventListener("exit",f),g=!0,window.setTimeout(function(){return e.close()}, 10),void d(m.Util.Oauth.queryParamsFromUrl(c.url)));"exit"===c.type&&!g&&(e.removeEventListener("loadstart",f),e.removeEventListener("loaderror",f),e.removeEventListener("loadstop",f),e.removeEventListener("exit",f),g=!0,d(new AuthError("error\x3daccess_denied\x26error_description\x3dUser+closed+browser+window")))}}(this),e.addEventListener("loadstart",f),e.addEventListener("loaderror",f),e.addEventListener("loadstop",f),e.addEventListener("exit",f)},b}(m.AuthDriver.BrowserBase),m.AuthDriver.NodeServer= function(){function a(b){this._port=(null!=b?b.port:void 0)||8912;null!=b&&b.tls?(this._tlsOptions=b.tls,("string"==typeof this._tlsOptions||this._tlsOptions instanceof Buffer)&&(this._tlsOptions={key:this._tlsOptions,cert:this._tlsOptions})):this._tlsOptions=null;this._fs=m.Env.require("fs");this._http=m.Env.require("http");this._https=m.Env.require("https");this._open=m.Env.require("open");this._callbacks={};this._nodeUrl=m.Env.require("url");this.createApp()}return a.prototype.authType=function(){return"code"}, a.prototype.url=function(){var a;return a=null===this._tlsOptions?"http":"https",""+a+"://localhost:"+this._port+"/oauth_callback"},a.prototype.doAuthorize=function(a,b,c,d){return this._callbacks[b]=d,this.openBrowser(a)},a.prototype.openBrowser=function(a){if(!a.match(/^https?:\/\//))throw Error("Not a http/https URL: "+a);return"BROWSER"in process.env?this._open(a,process.env.BROWSER):this._open(a)},a.prototype.createApp=function(){return this._app=this._tlsOptions?this._https.createServer(this._tlsOptions, function(a){return function(b,c){return a.doRequest(b,c)}}(this)):this._http.createServer(function(a){return function(b,c){return a.doRequest(b,c)}}(this)),this._app.listen(this._port)},a.prototype.closeServer=function(){return this._app.close()},a.prototype.doRequest=function(a,b){var c,d,e;return e=this._nodeUrl.parse(a.url,!0),"/oauth_callback"===e.pathname&&(d=e.query.state,this._callbacks[d]&&(this._callbacks[d](e.query),delete this._callbacks[d])),c="",a.on("data",function(a){return c+=a}), a.on("end",function(a){return function(){return a.closeBrowser(b)}}(this))},a.prototype.closeBrowser=function(a){return a.writeHead(200,{"Content-Length":104,"Content-Type":"text/html"}),a.write('\x3c!doctype html\x3e\n\x3cscript type\x3d"text/javascript"\x3ewindow.close();\x3c/script\x3e\n\x3cp\x3ePlease close this window.\x3c/p\x3e'),a.end()},a}(),m.AuthError=function(){function a(b){if(!b.error)throw Error("Not an OAuth 2.0 error: "+JSON.stringify(b));b="object"==typeof b.error&&b.error.error? b.error:b;this.code=b.error;this.description=b.error_description||null;this.uri=b.error_uri||null}return a.prototype.code=null,a.prototype.description=null,a.prototype.uri=null,a.ACCESS_DENIED="access_denied",a.INVALID_REQUEST="invalid_request",a.UNAUTHORIZED_CLIENT="unauthorized_client",a.INVALID_GRANT="invalid_grant",a.INVALID_SCOPE="invalid_scope",a.UNSUPPORTED_GRANT_TYPE="unsupported_grant_type",a.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",a.SERVER_ERROR="server_error",a.TEMPORARILY_UNAVAILABLE= "temporarily_unavailable",a.prototype.toString=function(){return"Dropbox OAuth error "+this.code+" :: "+this.description},a.prototype.inspect=function(){return this.toString()},a}(),m.Client=function(){function b(a){this._serverRoot=a.server||this._defaultServerRoot();this._maxApiServer="maxApiServer"in a?a.maxApiServer:this._defaultMaxApiServer();this._authServer=a.authServer||this._defaultAuthServer();this._fileServer=a.fileServer||this._defaultFileServer();this._downloadServer=a.downloadServer|| this._defaultDownloadServer();this._notifyServer=a.notifyServer||this._defaultNotifyServer();this.onXhr=new m.Util.EventSource({cancelable:!0});this.onError=new m.Util.EventSource;this.onAuthStepChange=new m.Util.EventSource;this._xhrOnErrorHandler=function(a){return function(b,c){return a._handleXhrError(b,c)}}(this);this._oauth=new m.Util.Oauth(a);this._uid=a.uid||null;this.authStep=this._oauth.step();this._credentials=this.authError=this._driver=null;this.setupUrls()}return b.prototype.onXhr=null, b.prototype.onError=null,b.prototype.onAuthStepChange=null,b.prototype.authDriver=function(a){return this._driver=a,this},b.prototype.dropboxUid=function(){return this._uid},b.prototype.credentials=function(){return this._credentials||this._computeCredentials(),this._credentials},b.prototype.authenticate=function(b,c){var d,e,f,g,k;if(c||"function"!=typeof b||(c=b,b=null),d=b&&"interactive"in b?b.interactive:!0,!this._driver&&this.authStep!==a.DONE&&(m.AuthDriver.autoConfigure(this),!this._driver))throw Error("OAuth driver auto-configuration failed. Call authDriver."); if(this.authStep===a.ERROR)throw Error("Client got in an error state. Call reset() to reuse it!");return g=function(b){return function(){return b.authStep=b._oauth.step(),b.authStep===a.ERROR&&(b.authError=b._oauth.error()),b._credentials=null,b.onAuthStepChange.dispatch(b),k()}}(this),f=function(b){return function(){return b.authStep=a.ERROR,b._credentials=null,b.onAuthStepChange.dispatch(b),k()}}(this),e=null,k=function(b){return function(){var l;if(e!==b.authStep&&(e=b.authStep,b._driver&&b._driver.onAuthStepChange))return void b._driver.onAuthStepChange(b, k);switch(b.authStep){case a.RESET:return d?(b._driver.getStateParam&&b._driver.getStateParam(function(c){return b.client.authStep===a.RESET&&b._oauth.setAuthStateParam(c),g()}),b._oauth.setAuthStateParam(m.Util.Oauth.randomAuthStateParam()),g()):void(c&&c(null,b));case a.PARAM_SET:return d?(l=b.authorizeUrl(),b._driver.doAuthorize(l,b._oauth.authStateParam(),b,function(a){return b._oauth.processRedirectParams(a),a.uid&&(b._uid=a.uid),g()})):void(c&&c(null,b));case a.PARAM_LOADED:return b._driver.resumeAuthorize? b._driver.resumeAuthorize(b._oauth.authStateParam(),b,function(a){return b._oauth.processRedirectParams(a),a.uid&&(b._uid=a.uid),g()}):(b._oauth.setAuthStateParam(b._oauth.authStateParam()),void g());case a.AUTHORIZED:return b.getAccessToken(function(a,c){return a?(b.authError=a,f()):(b._oauth.processRedirectParams(c),b._uid=c.uid,g())});case a.DONE:c&&c(null,b);break;case a.SIGNED_OUT:return b.authStep=a.RESET,b.reset(),k();case a.ERROR:c&&c(b.authError,b)}}}(this),k(),this},b.prototype.isAuthenticated= function(){return this.authStep===a.DONE},b.prototype.signOut=function(b,c){var d,e;if(c||"function"!=typeof b||(c=b,b=null),d=b&&b.mustInvalidate,this.authStep!==a.DONE)throw Error("This client doesn't have a user's token");return e=new m.Util.Xhr("POST",this._urls.signOut),e.signWithOauth(this._oauth),this._dispatchXhr(e,function(b){return function(e){if(e)if(e.status===m.ApiError.INVALID_TOKEN)e=null;else if(d)return void(c&&c(e));return b.authStep=a.RESET,b.reset(),b.authStep=a.SIGNED_OUT,b.onAuthStepChange.dispatch(b), b._driver&&b._driver.onAuthStepChange?b._driver.onAuthStepChange(b,function(){return c?c(null):void 0}):c?c(null):void 0}}(this))},b.prototype.signOff=function(a,b){return this.signOut(a,b)},b.prototype.getAccountInfo=function(a,b){var c,d;return b||"function"!=typeof a||(b=a,a=null),c=!1,a&&a.httpCache&&(c=!0),d=new m.Util.Xhr("GET",this._urls.accountInfo),d.signWithOauth(this._oauth,c),this._dispatchXhr(d,function(a,c){return b(a,m.AccountInfo.parse(c),c)})},b.prototype.getUserInfo=function(a,b){return this.getAccountInfo(a, b)},b.prototype.readFile=function(a,b,c){var d,e,f,g,k,l,n;return c||"function"!=typeof b||(c=b,b=null),e={},l="text",g=null,d=!1,b&&(b.versionTag?e.rev=b.versionTag:b.rev&&(e.rev=b.rev),b.arrayBuffer?l="arraybuffer":b.blob?l="blob":b.buffer?l="buffer":b.binary&&(l="b"),b.length?(null!=b.start?(k=b.start,f=b.start+b.length-1):(k="",f=b.length),g="bytes\x3d"+k+"-"+f):null!=b.start&&(g="bytes\x3d"+b.start+"-"),b.httpCache&&(d=!0)),n=new m.Util.Xhr("GET",""+this._urls.getFile+"/"+this._urlEncodePath(a)), n.setParams(e).signWithOauth(this._oauth,d),n.setResponseType(l),g&&(g&&n.setHeader("Range",g),n.reportResponseHeaders()),this._dispatchXhr(n,function(a,b,d,e){var f;return f=e?m.Http.RangeInfo.parse(e["content-range"]):null,c(a,b,m.File.Stat.parse(d),f)})},b.prototype.writeFile=function(a,b,c,d){var e;return d||"function"!=typeof c||(d=c,c=null),e=m.Util.Xhr.canSendForms&&"object"==typeof b,e?this._writeFileUsingForm(a,b,c,d):this._writeFileUsingPut(a,b,c,d)},b.prototype._writeFileUsingForm=function(a, b,c,d){var e,f,g,k;return g=a.lastIndexOf("/"),-1===g?(e=a,a=""):(e=a.substring(g),a=a.substring(0,g)),f={file:e},c&&(c.noOverwrite&&(f.overwrite="false"),c.lastVersionTag?f.parent_rev=c.lastVersionTag:(c.parentRev||c.parent_rev)&&(f.parent_rev=c.parentRev||c.parent_rev)),k=new m.Util.Xhr("POST",""+this._urls.postFile+"/"+this._urlEncodePath(a)),k.setParams(f).signWithOauth(this._oauth).setFileField("file",e,b,"application/octet-stream"),delete f.file,this._dispatchXhr(k,function(a,b){return d?d(a, m.File.Stat.parse(b)):void 0})},b.prototype._writeFileUsingPut=function(a,b,c,d){var e,f;return e={},c&&(c.noOverwrite&&(e.overwrite="false"),c.lastVersionTag?e.parent_rev=c.lastVersionTag:(c.parentRev||c.parent_rev)&&(e.parent_rev=c.parentRev||c.parent_rev)),f=new m.Util.Xhr("POST",""+this._urls.putFile+"/"+this._urlEncodePath(a)),f.setBody(b).setParams(e).signWithOauth(this._oauth),this._dispatchXhr(f,function(a,b){return d?d(a,m.File.Stat.parse(b)):void 0})},b.prototype.resumableUploadStep=function(a, b,c){var d,e;return b?(d={offset:b.offset},b.tag&&(d.upload_id=b.tag)):d={offset:0},e=new m.Util.Xhr("POST",this._urls.chunkedUpload),e.setBody(a).setParams(d).signWithOauth(this._oauth),this._dispatchXhr(e,function(a,b){return a&&a.status===m.ApiError.INVALID_PARAM&&a.response&&a.response.upload_id&&a.response.offset?c(null,m.Http.UploadCursor.parse(a.response)):c(a,m.Http.UploadCursor.parse(b))})},b.prototype.resumableUploadFinish=function(a,b,c,d){var e,f;return d||"function"!=typeof c||(d=c,c= null),e={upload_id:b.tag},c&&(c.lastVersionTag?e.parent_rev=c.lastVersionTag:(c.parentRev||c.parent_rev)&&(e.parent_rev=c.parentRev||c.parent_rev),c.noOverwrite&&(e.overwrite="false")),f=new m.Util.Xhr("POST",""+this._urls.commitChunkedUpload+"/"+this._urlEncodePath(a)),f.setParams(e).signWithOauth(this._oauth),this._dispatchXhr(f,function(a,b){return d?d(a,m.File.Stat.parse(b)):void 0})},b.prototype.stat=function(a,b,c){var d,e,f;return c||"function"!=typeof b||(c=b,b=null),e={},d=!1,b&&(b.versionTag? e.rev=b.versionTag:b.rev&&(e.rev=b.rev),b.contentHash?e.hash=b.contentHash:b.hash&&(e.hash=b.hash),(b.removed||b.deleted)&&(e.include_deleted="true"),b.readDir&&(e.list="true",!0!==b.readDir&&(e.file_limit=b.readDir.toString())),b.cacheHash&&(e.hash=b.cacheHash),b.httpCache&&(d=!0)),e.include_deleted||(e.include_deleted="false"),e.list||(e.list="false"),f=new m.Util.Xhr("GET",""+this._urls.metadata+"/"+this._urlEncodePath(a)),f.setParams(e).signWithOauth(this._oauth,d),this._dispatchXhr(f,function(a, b){var d,e,f;f=m.File.Stat.parse(b);if(null!=b&&b.contents){var g,k,l,n;l=b.contents;n=[];g=0;for(k=l.length;k>g;g++)e=l[g],n.push(m.File.Stat.parse(e));e=n}else e=void 0;return d=e,c(a,f,d)})},b.prototype.readdir=function(a,b,c){var d;return c||"function"!=typeof b||(c=b,b=null),d={readDir:!0},b&&(null!=b.limit&&(d.readDir=b.limit),b.versionTag?d.versionTag=b.versionTag:b.rev&&(d.versionTag=b.rev),b.contentHash?d.contentHash=b.contentHash:b.hash&&(d.contentHash=b.hash),(b.removed||b.deleted)&&(d.removed= b.removed||b.deleted),b.httpCache&&(d.httpCache=b.httpCache)),this.stat(a,d,function(a,b,d){var e,f;if(d){var g,k,l;l=[];g=0;for(k=d.length;k>g;g++)f=d[g],l.push(f.name);f=l}else f=null;return e=f,c(a,e,b,d)})},b.prototype.metadata=function(a,b,c){return this.stat(a,b,c)},b.prototype.makeUrl=function(a,b,c){var d,e,f,g,k;return c||"function"!=typeof b||(c=b,b=null),e=b&&(b["long"]||b.longUrl||b.downloadHack)?{short_url:"false"}:{},a=this._urlEncodePath(a),f=""+this._urls.shares+"/"+a,d=!1,g=!1,b&& (b.downloadHack?(d=!0,g=!0):b.download&&(d=!0,f=""+this._urls.media+"/"+a)),k=(new m.Util.Xhr("POST",f)).setParams(e).signWithOauth(this._oauth),this._dispatchXhr(k,function(a){return function(b,e){return g&&(null!=e?e.url:void 0)&&(e.url=e.url.replace(a._authServer,a._downloadServer)),c(b,m.File.ShareUrl.parse(e,d))}}(this))},b.prototype.history=function(a,b,c){var d,e,f;return c||"function"!=typeof b||(c=b,b=null),e={},d=!1,b&&(null!=b.limit&&(e.rev_limit=b.limit),b.httpCache&&(d=!0)),f=new m.Util.Xhr("GET", ""+this._urls.revisions+"/"+this._urlEncodePath(a)),f.setParams(e).signWithOauth(this._oauth,d),this._dispatchXhr(f,function(a,b){var d,e;if(b){var f,g,k;k=[];f=0;for(g=b.length;g>f;f++)d=b[f],k.push(m.File.Stat.parse(d));d=k}else d=void 0;return e=d,c(a,e)})},b.prototype.revisions=function(a,b,c){return this.history(a,b,c)},b.prototype.thumbnailUrl=function(a,b){var c;return c=this.thumbnailXhr(a,b),c.addOauthParams(this._oauth).paramsToUrl().url},b.prototype.readThumbnail=function(a,b,c){var d, e;return c||"function"!=typeof b||(c=b,b=null),d="b",b&&(b.blob&&(d="blob"),b.arrayBuffer&&(d="arraybuffer"),b.buffer&&(d="buffer")),e=this.thumbnailXhr(a,b),e.setResponseType(d).signWithOauth(this._oauth),this._dispatchXhr(e,function(a,b,d){return c(a,b,m.File.Stat.parse(d))})},b.prototype.thumbnailXhr=function(a,b){var c,d;return c={},b&&(b.format?c.format=b.format:b.png&&(c.format="png"),b.size&&(c.size=b.size)),d=new m.Util.Xhr("GET",""+this._urls.thumbnails+"/"+this._urlEncodePath(a)),d.setParams(c)}, b.prototype.revertFile=function(a,b,c){var d;return d=new m.Util.Xhr("POST",""+this._urls.restore+"/"+this._urlEncodePath(a)),d.setParams({rev:b}).signWithOauth(this._oauth),this._dispatchXhr(d,function(a,b){return c?c(a,m.File.Stat.parse(b)):void 0})},b.prototype.restore=function(a,b,c){return this.revertFile(a,b,c)},b.prototype.findByName=function(a,b,c,d){var e,f,g;return d||"function"!=typeof c||(d=c,c=null),f={query:b},e=!1,c&&(null!=c.limit&&(f.file_limit=c.limit),(c.removed||c.deleted)&&(f.include_deleted= !0),c.httpCache&&(e=!0)),g=new m.Util.Xhr("GET",""+this._urls.search+"/"+this._urlEncodePath(a)),g.setParams(f).signWithOauth(this._oauth,e),this._dispatchXhr(g,function(a,b){var c,e;if(b){var f,g,k;k=[];f=0;for(g=b.length;g>f;f++)c=b[f],k.push(m.File.Stat.parse(c));c=k}else c=void 0;return e=c,d(a,e)})},b.prototype.search=function(a,b,c,d){return this.findByName(a,b,c,d)},b.prototype.makeCopyReference=function(a,b){var c;return c=new m.Util.Xhr("GET",""+this._urls.copyRef+"/"+this._urlEncodePath(a)), c.signWithOauth(this._oauth),this._dispatchXhr(c,function(a,c){return b(a,m.File.CopyReference.parse(c))})},b.prototype.copyRef=function(a,b){return this.makeCopyReference(a,b)},b.prototype.pullChanges=function(a,b){var c,d;return b||"function"!=typeof a||(b=a,a=null),c=a?a.cursorTag?{cursor:a.cursorTag}:{cursor:a}:{},d=new m.Util.Xhr("POST",this._urls.delta),d.setParams(c).signWithOauth(this._oauth),this._dispatchXhr(d,function(a,c){return b(a,m.Http.PulledChanges.parse(c))})},b.prototype.delta= function(a,b){return this.pullChanges(a,b)},b.prototype.pollForChanges=function(a,b,c){var d,e;return c||"function"!=typeof b||(c=b,b=null),d=a.cursorTag?{cursor:a.cursorTag}:{cursor:a},b&&"timeout"in b&&(d.timeout=b.timeout),e=new m.Util.Xhr("GET",this._urls.longpollDelta),e.setParams(d),this._dispatchXhr(e,function(a,b){if("string"==typeof b)try{b=JSON.parse(b)}catch(d){b=null}return c(a,m.Http.PollResult.parse(b))})},b.prototype.mkdir=function(a,b){var c;return c=new m.Util.Xhr("POST",this._urls.fileopsCreateFolder), c.setParams({root:"auto",path:this._normalizePath(a)}).signWithOauth(this._oauth),this._dispatchXhr(c,function(a,c){return b?b(a,m.File.Stat.parse(c)):void 0})},b.prototype.remove=function(a,b){var c;return c=new m.Util.Xhr("POST",this._urls.fileopsDelete),c.setParams({root:"auto",path:this._normalizePath(a)}).signWithOauth(this._oauth),this._dispatchXhr(c,function(a,c){return b?b(a,m.File.Stat.parse(c)):void 0})},b.prototype.unlink=function(a,b){return this.remove(a,b)},b.prototype["delete"]=function(a, b){return this.remove(a,b)},b.prototype.copy=function(a,b,c){var d,e,f;return c||"function"!=typeof d||(c=d,d=null),e={root:"auto",to_path:this._normalizePath(b)},a instanceof m.File.CopyReference?e.from_copy_ref=a.tag:e.from_path=this._normalizePath(a),f=new m.Util.Xhr("POST",this._urls.fileopsCopy),f.setParams(e).signWithOauth(this._oauth),this._dispatchXhr(f,function(a,b){return c?c(a,m.File.Stat.parse(b)):void 0})},b.prototype.move=function(a,b,c){var d,e;return c||"function"!=typeof d||(c=d, d=null),e=new m.Util.Xhr("POST",this._urls.fileopsMove),e.setParams({root:"auto",from_path:this._normalizePath(a),to_path:this._normalizePath(b)}).signWithOauth(this._oauth),this._dispatchXhr(e,function(a,b){return c?c(a,m.File.Stat.parse(b)):void 0})},b.prototype.appInfo=function(a,b){var c;return b||"function"!=typeof a||(b=a,a=this._oauth.credentials().key),c=new m.Util.Xhr("GET",this._urls.appsInfo),c.setParams({app_key:a}),this._dispatchXhr(c,function(c,d){return b(c,m.Http.AppInfo.parse(d,a))})}, b.prototype.isAppDeveloper=function(a,b,c){var d;return"object"==typeof a&&"uid"in a&&(a=a.uid),c||"function"!=typeof b?"object"==typeof b&&"key"in b&&(b=b.key):(c=b,b=this._oauth.credentials().key),d=new m.Util.Xhr("GET",this._urls.appsCheckDeveloper),d.setParams({app_key:b,uid:a}),this._dispatchXhr(d,function(a,b){return b?c(a,b.is_developer):c(a)})},b.prototype.hasOauthRedirectUri=function(a,b,c){var d;return c||"function"!=typeof b?"object"==typeof b&&"key"in b&&(b=b.key):(c=b,b=this._oauth.credentials().key), d=new m.Util.Xhr("GET",this._urls.appsCheckRedirectUri),d.setParams({app_key:b,redirect_uri:a}),this._dispatchXhr(d,function(a,b){return b?c(a,b.has_redirect_uri):c(a)})},b.prototype.reset=function(){var a;return this._uid=null,this._oauth.reset(),a=this.authStep,this.authStep=this._oauth.step(),a!==this.authStep&&this.onAuthStepChange.dispatch(this),this.authError=null,this._credentials=null,this},b.prototype.setCredentials=function(a){var b;return b=this.authStep,this._oauth.setCredentials(a),this.authStep= this._oauth.step(),this._uid=a.uid||null,this.authError=null,this._credentials=null,b!==this.authStep&&this.onAuthStepChange.dispatch(this),this},b.prototype.appHash=function(){return this._oauth.appHash()},b.prototype.setupUrls=function(){return this._apiServer=this._chooseApiServer(),this._urls={authorize:""+this._authServer+"/1/oauth2/authorize",token:""+this._apiServer+"/1/oauth2/token",signOut:""+this._apiServer+"/1/unlink_access_token",accountInfo:""+this._apiServer+"/1/account/info",getFile:""+ this._fileServer+"/1/files/auto",postFile:""+this._fileServer+"/1/files/auto",putFile:""+this._fileServer+"/1/files_put/auto",metadata:""+this._apiServer+"/1/metadata/auto",delta:""+this._apiServer+"/1/delta",longpollDelta:""+this._notifyServer+"/1/longpoll_delta",revisions:""+this._apiServer+"/1/revisions/auto",restore:""+this._apiServer+"/1/restore/auto",search:""+this._apiServer+"/1/search/auto",shares:""+this._apiServer+"/1/shares/auto",media:""+this._apiServer+"/1/media/auto",copyRef:""+this._apiServer+ "/1/copy_ref/auto",thumbnails:""+this._fileServer+"/1/thumbnails/auto",chunkedUpload:""+this._fileServer+"/1/chunked_upload",commitChunkedUpload:""+this._fileServer+"/1/commit_chunked_upload/auto",fileopsCopy:""+this._apiServer+"/1/fileops/copy",fileopsCreateFolder:""+this._apiServer+"/1/fileops/create_folder",fileopsDelete:""+this._apiServer+"/1/fileops/delete",fileopsMove:""+this._apiServer+"/1/fileops/move",appsInfo:""+this._apiServer+"/1/apps/info",appsCheckDeveloper:""+this._apiServer+"/1/apps/check_developer", appsCheckRedirectUri:""+this._apiServer+"/1/apps/check_redirect_uri"}},b.prototype._chooseApiServer=function(){var a,b;return b=Math.floor(Math.random()*(this._maxApiServer+1)),a=0===b?"":b.toString(),this._serverRoot.replace("$",a)},b.prototype.authStep=null,b.ERROR=0,b.RESET=1,b.PARAM_SET=2,b.PARAM_LOADED=3,b.AUTHORIZED=4,b.DONE=5,b.SIGNED_OUT=6,b.prototype._urlEncodePath=function(a){return m.Util.Xhr.urlEncodeValue(this._normalizePath(a)).replace(/%2F/gi,"/")},b.prototype._normalizePath=function(a){var b; if("/"===a.substring(0,1)){for(b=1;"/"===a.substring(b,b+1);)b+=1;return a.substring(b)}return a},b.prototype.authorizeUrl=function(){var a;return a=this._oauth.authorizeUrlParams(this._driver.authType(),this._driver.url()),this._urls.authorize+"?"+m.Util.Xhr.urlEncode(a)},b.prototype.getAccessToken=function(a){var b,c;return b=this._oauth.accessTokenParams(this._driver.url()),c=(new m.Util.Xhr("POST",this._urls.token)).setParams(b).addOauthParams(this._oauth),this._dispatchXhr(c,function(b,c){return b&& b.status===m.ApiError.INVALID_PARAM&&b.response&&b.response.error&&(b=new m.AuthError(b.response)),a(b,c)})},b.prototype._dispatchXhr=function(a,b){var c;return a.setCallback(b),a.onError=this._xhrOnErrorHandler,a.prepare(),c=a.xhr,this.onXhr.dispatch(a)&&a.send(),c},b.prototype._handleXhrError=function(b,c){return b.status===m.ApiError.INVALID_TOKEN&&this.authStep===a.DONE&&(this.authError=b,this.authStep=a.ERROR,this.onAuthStepChange.dispatch(this),this._driver&&this._driver.onAuthStepChange)?(this._driver.onAuthStepChange(this, function(a){return function(){return a.onError.dispatch(b),c(b)}}(this)),null):(this.onError.dispatch(b),void c(b))},b.prototype._defaultServerRoot=function(){return"https://api$.dropbox.com"},b.prototype._defaultAuthServer=function(){return this._serverRoot.replace("api$","www")},b.prototype._defaultFileServer=function(){return this._serverRoot.replace("api$","api-content")},b.prototype._defaultDownloadServer=function(){return"https://dl.dropboxusercontent.com"},b.prototype._defaultNotifyServer= function(){return this._serverRoot.replace("api$","api-notify")},b.prototype._defaultMaxApiServer=function(){return 30},b.prototype._computeCredentials=function(){var a;a=this._oauth.credentials();this._uid&&(a.uid=this._uid);this._serverRoot!==this._defaultServerRoot()&&(a.server=this._serverRoot);this._maxApiServer!==this._defaultMaxApiServer()&&(a.maxApiServer=this._maxApiServer);this._authServer!==this._defaultAuthServer()&&(a.authServer=this._authServer);this._fileServer!==this._defaultFileServer()&& (a.fileServer=this._fileServer);this._downloadServer!==this._defaultDownloadServer()&&(a.downloadServer=this._downloadServer);this._notifyServer!==this._defaultNotifyServer()&&(a.notifyServer=this._notifyServer);this._credentials=a},b}(),a=m.Client,m.File.ShareUrl=function(){function a(b,c){this.url=b.url;this.expiresAt=m.Util.parseDate(b.expires);this.isDirect=!0===c?!0:!1===c?!1:"direct"in b?b.direct:864E5>=Date.now()-this.expiresAt;this.isPreview=!this.isDirect;this._json=null}return a.parse=function(a, b){return a&&"object"==typeof a?new m.File.ShareUrl(a,b):a},a.prototype.url=null,a.prototype.expiresAt=null,a.prototype.isDirect=null,a.prototype.isPreview=null,a.prototype.toJSON=function(){return this._json||(this._json={url:this.url,expires:this.expiresAt.toUTCString(),direct:this.isDirect})},a.prototype.json=function(){return this.toJSON()},a}(),m.File.CopyReference=function(){function a(b){"object"==typeof b?(this.tag=b.copy_ref,this.expiresAt=m.Util.parseDate(b.expires),this._json=b):(this.tag= b,this.expiresAt=new Date(1E3*Math.ceil(Date.now()/1E3)),this._json=null)}return a.parse=function(a){return!a||"object"!=typeof a&&"string"!=typeof a?a:new m.File.CopyReference(a)},a.prototype.tag=null,a.prototype.expiresAt=null,a.prototype.toJSON=function(){return this._json||(this._json={copy_ref:this.tag,expires:this.expiresAt.toUTCString()})},a.prototype.json=function(){return this.toJSON()},a}(),m.File.Stat=function(){function a(b){var c,d,e,f;switch(this._json=b,this.path=b.path,"/"!==this.path.substring(0, 1)&&(this.path="/"+this.path),c=this.path.length-1,0<=c&&"/"===this.path.substring(c)&&(this.path=this.path.substring(0,c)),d=this.path.lastIndexOf("/"),this.name=this.path.substring(d+1),this.isFolder=b.is_dir||!1,this.isFile=!this.isFolder,this.isRemoved=b.is_deleted||!1,this.typeIcon=b.icon,this.modifiedAt=null!=(e=b.modified)&&e.length?m.Util.parseDate(b.modified):null,this.clientModifiedAt=null!=(f=b.client_mtime)&&f.length?m.Util.parseDate(b.client_mtime):null,b.root){case "dropbox":this.inAppFolder= !1;break;case "app_folder":this.inAppFolder=!0;break;default:this.inAppFolder=null}this.size=b.bytes||0;this.humanSize=b.size||"";this.hasThumbnail=b.thumb_exists||!1;this.versionTag=b.rev;this.contentHash=b.hash||null;this.mimeType=this.isFolder?b.mime_type||"inode/directory":b.mime_type||"application/octet-stream"}return a.parse=function(a){return a&&"object"==typeof a?new m.File.Stat(a):a},a.prototype.path=null,a.prototype.name=null,a.prototype.inAppFolder=null,a.prototype.isFolder=null,a.prototype.isFile= null,a.prototype.isRemoved=null,a.prototype.typeIcon=null,a.prototype.versionTag=null,a.prototype.contentHash=null,a.prototype.mimeType=null,a.prototype.size=null,a.prototype.humanSize=null,a.prototype.hasThumbnail=null,a.prototype.modifiedAt=null,a.prototype.clientModifiedAt=null,a.prototype.toJSON=function(){return this._json},a.prototype.json=function(){return this.toJSON()},a}(),m.Http.AppInfo=function(){function a(b,c){var d;this.name=b.name;this._icons=b.icons;d=b.permissions||{};this.canUseDatastores= !!d.datastores;this.canUseFiles=!!d.files;this.canUseFullDropbox="full_dropbox"===d.files;this.hasAppFolder="app_folder"===d.files;this.key=c?c:b.key||null}return a.parse=function(a,b){return a?new m.Http.AppInfo(a,b):a},a.prototype.name=void 0,a.prototype.key=void 0,a.prototype.canUseDatastores=void 0,a.prototype.canUseFiles=void 0,a.prototype.hasAppFolder=void 0,a.prototype.canUseFullDropbox=void 0,a.prototype.icon=function(a,b){return b||(b=a),this._icons[""+a+"x"+b]||null},a.ICON_SMALL=64,a.ICON_LARGE= 256,a}(),m.Http.PollResult=function(){function a(b){this.hasChanges=b.changes;this.retryAfter=b.backoff||0}return a.parse=function(a){return a?new m.Http.PollResult(a):a},a.prototype.hasChanges=void 0,a.prototype.retryAfter=void 0,a}(),m.Http.PulledChanges=function(){function a(b){this.blankSlate=b.reset||!1;this.cursorTag=b.cursor;this.shouldPullAgain=b.has_more;this.shouldBackOff=!this.shouldPullAgain;if(b.cursor&&b.cursor.length){var c,d,e,f;e=b.entries;f=[];c=0;for(d=e.length;d>c;c++)b=e[c],f.push(m.Http.PulledChange.parse(b)); b=f}else b=[];this.changes=b}return a.parse=function(a){return a&&"object"==typeof a?new m.Http.PulledChanges(a):a},a.prototype.blankSlate=void 0,a.prototype.cursorTag=void 0,a.prototype.changes=void 0,a.prototype.shouldPullAgain=void 0,a.prototype.shouldBackOff=void 0,a.prototype.cursor=function(){return this.cursorTag},a}(),m.Http.PulledChange=function(){function a(b){this.path=b[0];(this.stat=m.File.Stat.parse(b[1]))?this.wasRemoved=!1:(this.stat=null,this.wasRemoved=!0)}return a.parse=function(a){return a&& "object"==typeof a?new m.Http.PulledChange(a):a},a.prototype.path=void 0,a.prototype.wasRemoved=void 0,a.prototype.stat=void 0,a}(),m.Http.RangeInfo=function(){function a(b){var c;(c=/^bytes (\d*)-(\d*)\/(.*)$/.exec(b))?(this.start=parseInt(c[1]),this.end=parseInt(c[2]),this.size="*"===c[3]?null:parseInt(c[3])):(this.start=0,this.end=0,this.size=null)}return a.parse=function(a){return"string"==typeof a?new m.Http.RangeInfo(a):a},a.prototype.start=null,a.prototype.size=null,a.prototype.end=null,a}(), m.Http.UploadCursor=function(){function a(b){this.replace(b)}return a.parse=function(a){return!a||"object"!=typeof a&&"string"!=typeof a?a:new m.Http.UploadCursor(a)},a.prototype.tag=null,a.prototype.offset=null,a.prototype.expiresAt=null,a.prototype.toJSON=function(){return this._json||(this._json={upload_id:this.tag,offset:this.offset,expires:this.expiresAt.toUTCString()})},a.prototype.json=function(){return this.toJSON()},a.prototype.replace=function(a){return"object"==typeof a?(this.tag=a.upload_id|| null,this.offset=a.offset||0,this.expiresAt=m.Util.parseDate(a.expires)||Date.now(),this._json=a):(this.tag=a||null,this.offset=0,this.expiresAt=new Date(1E3*Math.floor(Date.now()/1E3)),this._json=null),this},a}(),"function"==typeof m.Env.global.atob&&"function"==typeof m.Env.global.btoa?(m.Util.atob=function(a){return m.Env.global.atob(a)},m.Util.btoa=function(a){return m.Env.global.btoa(a)}):m.Env.global.require&&m.Env.global.Buffer?(m.Util.atob=function(a){var b;a=new Buffer(a,"base64");var c, d,e;e=[];b=c=0;for(d=a.length;0<=d?d>c:c>d;b=0<=d?++c:--c)e.push(String.fromCharCode(a[b]));return e.join("")},m.Util.btoa=function(a){var b,c,d=Buffer,e,f,g;g=[];c=e=0;for(f=a.length;0<=f?f>e:e>f;c=0<=f?++e:--e)g.push(a.charCodeAt(c));return b=new d(g),b.toString("base64")}):!function(){var a,b;return b=function(a,b,c){var d,e;e=3-b;a<<=8*e;for(d=3;d>=e;)c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>6*d&63)),d-=1;for(d=b;3>d;)c.push("\x3d"),d+=1;return null}, a=function(a,b,c){var d;d=4-b;a<<=6*d;for(b=2;b>=d;)c.push(String.fromCharCode(a>>8*b&255)),b-=1;return null},m.Util.btoa=function(a){var c,d,e,f,g,k;f=[];e=g=d=c=0;for(k=a.length;0<=k?k>g:g>k;e=0<=k?++g:--g)c=c<<8|a.charCodeAt(e),d+=1,3===d&&(b(c,d,f),c=d=0);return 0k:k>l)&&(d=b.charAt(f),"\x3d"!==d);f=0<=l?++k:--k)c=c<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d), e+=1,4===e&&(a(c,e,g),c=e=0);return 0a;g=++a)c.push(909522486^b[g]);return c}(),l=function(){var a,c;c=[];for(g=a=0;16>a;g=++a)c.push(1549556828^b[g]);return c}(),f=d(k.concat(a),64+c),d(l.concat(f),84)},d=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,u,v,s,t,x,A;a[b>>2]|=1<<31-((3&b)<<3);a[(b+8>> 6<<4)+15]=b<<3;t=Array(80);c=1732584193;e=4023233417;g=2562383102;l=271733878;n=3285377520;q=0;for(v=a.length;v>q;){d=c;f=e;k=g;m=l;p=n;for(u=A=0;80>A;u=++A)16>u?t[u]=0|a[q+u<<2>>2]:(s=(0|t[u-3<<2>>2])^(0|t[u-8<<2>>2])^(0|t[u-14<<2>>2])^(0|t[u-16<<2>>2]),t[u]=s<<1|s>>>31),x=((c<<5|c>>>27)+n|0)+t[u<<2>>2]|0,x=20>u?x+((e&g|~e&l)+1518500249|0)|0:40>u?x+((e^g^l)+1859775393|0)|0:60>u?x+((e&g|e&l|g&l)-1894007588)|0:x+((e^g^l)-899497514|0)|0,n=l,l=g,g=e<<30|e>>>2,e=c,c=x;c=d+c|0;e=f+e|0;g=k+g|0;l=m+l|0; n=p+n|0;q=q+16|0}return[c,e,g,l,n]},e=function(a,b){var c,d,e,k,l,m,n,p,q,u,v,s,t,x,A,y,B,C,F,Z,aa,Y,S,ha,ca,ba,ga,ja,ea,la;a[b>>2]|=1<<31-((3&b)<<3);a[(b+8>>6<<4)+15]=b<<3;ea=Array(80);c=f[0];e=f[1];l=f[2];p=f[3];u=f[4];s=f[5];x=f[6];Z=f[7];Y=0;for(ha=a.length;ha>Y;){d=c;k=e;m=l;q=p;v=u;t=s;A=x;aa=Z;for(S=la=0;64>la;S=++la)16>S?ja=ea[S]=0|a[Y+S<<2>>2]:(B=0|ea[S-15<<2>>2],y=(B<<25|B>>>7)^(B<<14|B>>>18)^B>>>3,F=0|ea[S-2<<2>>2],C=(F<<15|F>>>17)^(F<<13|F>>>19)^F>>>10,ja=ea[S]=(y+(0|ea[S-7<<2>>2])|0)+ (C+(0|ea[S-16<<2>>2])|0)|0),n=u&s^~u&x,ca=c&e^c&l^e&l,ba=(c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22),ga=(u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25),n=((Z+ga|0)+(n+ja|0)|0)+(0|g[S<<2>>2])|0,ca=ba+ca|0,Z=x,x=s,s=u,u=p+n|0,p=l,l=e,e=c,c=n+ca|0;c=d+c|0;e=k+e|0;l=m+l|0;p=q+p|0;u=v+u|0;s=t+s|0;x=A+x|0;Z=aa+Z|0;Y+=16}return[c,e,l,p,u,s,x,Z]},f=[],g=[],function(){var a,b,c,d,e,k,l;b=function(a){return 4294967296*(a-Math.floor(a))|0};e=2;l=[];for(c=k=0;64>k;c=++k){for(;;){d=!0;for(a=2;e>=a*a;){if(0===e%a){d= !1;break}a+=1}if(d)break;e+=1}8>c&&(f[c]=b(Math.pow(e,0.5)));g[c]=b(Math.pow(e,1/3));l.push(e+=1)}return l}(),a=function(a){var b,c,d,e,f;e="";b=0;for(d=4*a.length;d>b;)c=b,f=(a[c>>2]>>(3-(3&c)<<3)&255)<<16,c+=1,f|=(a[c>>2]>>(3-(3&c)<<3)&255)<<8,c+=1,f|=a[c>>2]>>(3-(3&c)<<3)&255,e+=l[f>>18&63],e+=l[f>>12&63],b+=1,e+=b>=d?"\x3d":l[f>>6&63],b+=1,e+=b>=d?"\x3d":l[63&f],b+=1;return e},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=function(a){var b,c,d,e;b=[];c=d=0;for(e=a.length;0<= e?e>d:d>e;c=0<=e?++d:--d)b[c>>2]|=(a.charCodeAt(c)&255)<<(3-(3&c)<<3);return b}}(),m.Util.Oauth=function(){function a(b){this._loaded=this._appHash=this._error=this._tokenKid=this._tokenKey=this._token=this._authCode=this._stateParam=this._secret=this._id=null;this.setCredentials(b)}return a.prototype.setCredentials=function(a){if(a.key)this._id=a.key;else{if(!a.token)throw Error("No API key supplied");this._id=null}return this._secret=a.secret||null,this._appHash=null,this._error=null,this._loaded= !0,this.reset(),a.token?(this._token=a.token,a.tokenKey&&(this._tokenKey=a.tokenKey,this._tokenKid=a.tokenKid)):a.oauthCode?this._authCode=a.oauthCode:a.oauthStateParam&&(this._stateParam=a.oauthStateParam),this},a.prototype.credentials=function(){var a;return a={},this._id&&(a.key=this._id),this._secret&&(a.secret=this._secret),null!==this._token?(a.token=this._token,this._tokenKey&&(a.tokenKey=this._tokenKey,a.tokenKid=this._tokenKid)):null!==this._authCode?a.oauthCode=this._authCode:null!==this._stateParam&& (a.oauthStateParam=this._stateParam),a},a.prototype.step=function(){return null!==this._token?m.Client.DONE:null!==this._authCode?m.Client.AUTHORIZED:null!==this._stateParam?this._loaded?m.Client.PARAM_LOADED:m.Client.PARAM_SET:null!==this._error?m.Client.ERROR:m.Client.RESET},a.prototype.setAuthStateParam=function(a){if(null===this._id)throw Error("No API key supplied, cannot do authorization");return this.reset(),this._loaded=!1,this._stateParam=a,this},a.prototype.checkAuthStateParam=function(a){return this._stateParam=== a&&null!==this._stateParam},a.prototype.authStateParam=function(){return this._stateParam},a.prototype.error=function(){return this._error},a.prototype.processRedirectParams=function(a){var b;if(a.error){if(null===this._id)throw Error("No API key supplied, cannot process errors");return this.reset(),this._error=new m.AuthError(a),!0}if(a.code){if(null===this._id)throw Error("No API key supplied, cannot do Authorization Codes");return this.reset(),this._loaded=!1,this._authCode=a.code,!0}if(b=a.token_type){if(b= b.toLowerCase(),"bearer"!==b&&"mac"!==b)throw Error("Unimplemented token type "+b);if(this.reset(),this._loaded=!1,"mac"===b){if("hmac-sha-1"!==a.mac_algorithm)throw Error("Unimplemented MAC algorithms "+a.mac_algorithm);this._tokenKey=a.mac_key;this._tokenKid=a.kid}return this._token=a.access_token,!0}return!1},a.prototype.authHeader=function(a,b,c){var d,e;return null===this._token?(e=m.Util.btoa(null===this._secret?""+this._id+":":""+this._id+":"+this._secret),"Basic "+e):null===this._tokenKey? "Bearer "+this._token:(d=this.macParams(a,b,c),"MAC kid\x3d"+d.kid+" ts\x3d"+d.ts+" "+("access_token\x3d"+this._token+" mac\x3d"+d.mac))},a.prototype.addAuthParams=function(a,b,c){var d;return null===this._token?(c.client_id=this._id,null!==this._secret&&(c.client_secret=this._secret)):(null!==this._tokenKey&&(d=this.macParams(a,b,c),c.kid=d.kid,c.ts=d.ts,c.mac=d.mac),c.access_token=this._token),c},a.prototype.authorizeUrlParams=function(a,b){var c;if("token"!==a&&"code"!==a)throw Error("Unimplemented /authorize response type "+ a);return c={client_id:this._id,state:this._stateParam,response_type:a},b&&(c.redirect_uri=b),c},a.prototype.accessTokenParams=function(a){var b;return b={grant_type:"authorization_code",code:this._authCode},a&&(b.redirect_uri=a),b},a.queryParamsFromUrl=function(a){var b,c,d,e,f;if(c=/^[^?#]+(\?([^\#]*))?(\#(.*))?$/.exec(a),!c)return{};a=c[2]||"";"/"===a.substring(0,1)&&(a=a.substring(1));b=c[4]||"";c=b.indexOf("?");-1!==c&&(b=b.substring(c+1));"/"===b.substring(0,1)&&(b=b.substring(1));c={};f=a.split("\x26").concat(b.split("\x26")); d=0;for(e=f.length;e>d;d++)a=f[d],b=a.indexOf("\x3d"),-1!==b&&(c[decodeURIComponent(a.substring(0,b))]=decodeURIComponent(a.substring(b+1)));return c},a.prototype.macParams=function(a,b,c){var d,e;return d={kid:this._tokenKid,ts:m.Util.Oauth.timestamp()},e=a.toUpperCase()+"\x26"+m.Util.Xhr.urlEncodeValue(b)+"\x26"+m.Util.Xhr.urlEncodeValue(m.Util.Xhr.urlEncode(c)),d.mac=m.Util.hmac(e,this._tokenKey),d},a.prototype.appHash=function(){return this._appHash?this._appHash:this._appHash=m.Util.sha1("oauth2-"+ this._id).replace(/[\/+=]/g,"")},a.prototype.reset=function(){return this._stateParam=null,this._authCode=null,this._token=null,this._tokenKey=null,this._tokenKid=null,this._error=null,this},a.timestamp=function(){return Math.floor(Date.now()/1E3)},a.randomAuthStateParam=function(){return["oas",Date.now().toString(36),Math.random().toString(36)].join("_")},a}(),null==Date.now&&(m.Util.Oauth.timestamp=function(){return Math.floor((new Date).getTime()/1E3)}),2274814865E3===(new Date("Fri, 31 Jan 2042 21:01:05 +0000")).valueOf()? m.Util.parseDate=function(a){return new Date(a)}:2274814865E3===Date.parse("Fri, 31 Jan 2042 21:01:05 +0000")?m.Util.parseDate=function(a){return new Date(Date.parse(a))}:!function(){var a,b;return b=/^\w+\, (\d+) (\w+) (\d+) (\d+)\:(\d+)\:(\d+) (\+\d+|UTC|GMT)$/,a={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},m.Util.parseDate=function(c){var d;return(d=b.exec(c))?new Date(Date.UTC(parseInt(d[3]),a[d[2]],parseInt(d[1]),parseInt(d[4]),parseInt(d[5]),parseInt(d[6]),0)): 0/0}}(),m.Env.global.XMLHttpRequest?(!m.Env.global.XDomainRequest||"withCredentials"in new XMLHttpRequest?(k=XMLHttpRequest,g=!1,b="undefined"!=typeof FormData&&-1===navigator.userAgent.indexOf("Firefox")):(k=XDomainRequest,g=!0,b=!1),e=!0):(k=m.Env.require("xhr2"),g=!1,b=!1,e=!1),m.Env.global.Uint8Array)if(Object.getPrototypeOf?d=Object.getPrototypeOf(Object.getPrototypeOf(new Uint8Array(0))).constructor:Object.__proto__&&(d=(new Uint8Array(0)).__proto__.__proto__.constructor),m.Env.global.Blob){try{!(2=== (new Blob([new Uint8Array(2)])).size?(n=!0,l=!0):(l=!1,n=2===(new Blob([new ArrayBuffer(2)])).size))}catch(q){n=l=!1,m.Env.global.WebKitBlobBuilder&&-1!==navigator.userAgent.indexOf("Android")&&(b=!1)}d===Object&&(l=!1)}else n=!1,l=!0;else d=null,l=n=!1;m.Util.Xhr=function(){function a(b,c){this.method=b;this.isGet="GET"===this.method;this.url=c;this.wantHeaders=!1;this.headers={};this.body=this.params=null;this.preflight=!(this.isGet||"POST"===this.method);this.completed=this.signed=!1;this.onError= this.xhr=this.callback=this.responseType=null}return a.Request=k,a.ieXdr=g,a.canSendForms=b,a.doesPreflight=e,a.ArrayBufferView=d,a.sendArrayBufferView=l,a.wrapBlob=n,a.prototype.xhr=null,a.prototype.onError=null,a.prototype.setParams=function(a){if(this.signed)throw Error("setParams called after addOauthParams or addOauthHeader");if(this.params)throw Error("setParams cannot be called twice");return this.params=a,this},a.prototype.setCallback=function(a){return this.callback=a,this},a.prototype.signWithOauth= function(a,b){return m.Util.Xhr.ieXdr?this.addOauthParams(a):this.preflight||!m.Util.Xhr.doesPreflight?this.addOauthHeader(a):this.isGet&&b?this.addOauthHeader(a):this.addOauthParams(a)},a.prototype.addOauthParams=function(a){if(this.signed)throw Error("Request already has an OAuth signature");return this.params||(this.params={}),a.addAuthParams(this.method,this.url,this.params),this.signed=!0,this},a.prototype.addOauthHeader=function(a){if(this.signed)throw Error("Request already has an OAuth signature"); return this.params||(this.params={}),this.signed=!0,this.setHeader("Authorization",a.authHeader(this.method,this.url,this.params))},a.prototype.setBody=function(a){if(this.isGet)throw Error("setBody cannot be called on GET requests");if(null!==this.body)throw Error("Request already has a body");return"string"==typeof a||"undefined"!=typeof FormData&&a instanceof FormData||(this.headers["Content-Type"]="application/octet-stream",this.preflight=!0),this.body=a,this},a.prototype.setResponseType=function(a){return this.responseType= a,this},a.prototype.setHeader=function(a,b){var c;if(this.headers[a])throw c=this.headers[a],Error("HTTP header "+a+" already set to "+c);if("Content-Type"===a)throw Error("Content-Type is automatically computed based on setBody");return this.preflight=!0,this.headers[a]=b,this},a.prototype.reportResponseHeaders=function(){return this.wantHeaders=!0},a.prototype.setFileField=function(a,b,c,d){var e,f,g;if(null!==this.body)throw Error("Request already has a body");if(this.isGet)throw Error("setFileField cannot be called on GET requests"); if("object"==typeof c){"undefined"!=typeof ArrayBuffer&&(c instanceof ArrayBuffer?m.Util.Xhr.sendArrayBufferView&&(c=new Uint8Array(c)):!m.Util.Xhr.sendArrayBufferView&&0===c.byteOffset&&c.buffer instanceof ArrayBuffer&&(c=c.buffer));d||(d="application/octet-stream");try{c=new Blob([c],{type:d})}catch(k){window.WebKitBlobBuilder&&(g=new WebKitBlobBuilder,g.append(c),(e=g.getBlob(d))&&(c=e))}"undefined"!=typeof File&&c instanceof File&&(c=new Blob([c],{type:c.type}));e=c instanceof Blob}else e=!1; return e?(this.body=new FormData,this.body.append(a,c,b)):(d||(d="application/octet-stream"),f=this.multipartBoundary(),this.headers["Content-Type"]="multipart/form-data; boundary\x3d"+f,this.body=["--",f,'\r\nContent-Disposition: form-data; name\x3d"',a,'"; filename\x3d"',b,'"\r\nContent-Type: ',d,"\r\nContent-Transfer-Encoding: binary\r\n\r\n",c,"\r\n--",f,"--\r\n"].join(""))},a.prototype.multipartBoundary=function(){return[Date.now().toString(36),Math.random().toString(36)].join("----")},a.prototype.paramsToUrl= function(){var a;return this.params&&(a=m.Util.Xhr.urlEncode(this.params),0!==a.length&&(this.url=[this.url,"?",a].join("")),this.params=null),this},a.prototype.paramsToBody=function(){if(this.params){if(null!==this.body)throw Error("Request already has a body");if(this.isGet)throw Error("paramsToBody cannot be called on GET requests");this.headers["Content-Type"]="application/x-www-form-urlencoded";this.body=m.Util.Xhr.urlEncode(this.params);this.params=null}return this},a.prototype.prepare=function(){var a, b,c;if(b=m.Util.Xhr.ieXdr,this.isGet||null!==this.body||b?(this.paramsToUrl(),null!==this.body&&"string"==typeof this.body&&(this.headers["Content-Type"]="text/plain; charset\x3dutf8")):this.paramsToBody(),this.xhr=new m.Util.Xhr.Request,b?(this.xhr.onload=function(a){return function(){return a.onXdrLoad()}}(this),this.xhr.onerror=function(a){return function(){return a.onXdrError()}}(this),this.xhr.ontimeout=function(a){return function(){return a.onXdrError()}}(this),this.xhr.onprogress=function(){}): this.xhr.onreadystatechange=function(a){return function(){return a.onReadyStateChange()}}(this),this.xhr.open(this.method,this.url,!0),!b)for(a in b=this.headers,b)p.call(b,a)&&(c=b[a],this.xhr.setRequestHeader(a,c));return this.responseType&&("b"===this.responseType?this.xhr.overrideMimeType&&this.xhr.overrideMimeType("text/plain; charset\x3dx-user-defined"):this.xhr.responseType=this.responseType),this},a.prototype.send=function(a){if(this.callback=a||this.callback,null!==this.body){a=this.body; m.Util.Xhr.sendArrayBufferView?a instanceof ArrayBuffer&&(a=new Uint8Array(a)):0===a.byteOffset&&a.buffer instanceof ArrayBuffer&&(a=a.buffer);try{this.xhr.send(a)}catch(b){if(m.Util.Xhr.sendArrayBufferView||!m.Util.Xhr.wrapBlob)throw b;a=new Blob([a],{type:"application/octet-stream"});this.xhr.send(a)}}else this.xhr.send();return this},a.urlEncode=function(a){var b,c,d;b=[];for(c in a)d=a[c],b.push(this.urlEncodeValue(c)+"\x3d"+this.urlEncodeValue(d));return b.sort().join("\x26")},a.urlEncodeValue= function(a){return encodeURIComponent(a.toString()).replace(/\!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")},a.urlDecode=function(a){var b,c,d,e;c={};e=a.split("\x26");a=0;for(d=e.length;d>a;a++)b=e[a],b=b.split("\x3d"),c[decodeURIComponent(b[0])]=decodeURIComponent(b[1]);return c},a.prototype.onReadyStateChange=function(){var a,b,c,d,e,f,g,k;if(4!==this.xhr.readyState||this.completed)return!0;if(this.completed=!0,200>this.xhr.status||300<=this.xhr.status)return b= new m.ApiError(this.xhr,this.method,this.url),this.onError?this.onError(b,this.callback):this.callback(b),!0;if(this.wantHeaders?(a=this.xhr.getAllResponseHeaders(),f=a?m.Util.Xhr.parseResponseHeaders(a):this.guessResponseHeaders(),k=f["x-dropbox-metadata"]):(f=void 0,k=this.xhr.getResponseHeader("x-dropbox-metadata")),null!=k?k.length:void 0)try{g=JSON.parse(k)}catch(l){if(e=k.search(/\}\,\s*\{/),-1!==e)try{k=k.substring(0,e+1),g=JSON.parse(k)}catch(n){g=void 0}else g=void 0}else g=void 0;if(this.responseType){if("b"=== this.responseType){d=null!=this.xhr.responseText?this.xhr.responseText:this.xhr.response;c=[];a=b=0;for(e=d.length;0<=e?e>b:b>e;a=0<=e?++b:--b)c.push(String.fromCharCode(255&d.charCodeAt(a)));a=c.join("");this.callback(null,a,g,f)}else this.callback(null,this.xhr.response,g,f);return!0}switch(a=null!=this.xhr.responseText?this.xhr.responseText:this.xhr.response,c=this.xhr.getResponseHeader("Content-Type"),c&&(d=c.indexOf(";"),-1!==d&&(c=c.substring(0,d))),c){case "application/x-www-form-urlencoded":this.callback(null, m.Util.Xhr.urlDecode(a),g,f);break;case "application/json":case "text/javascript":this.callback(null,JSON.parse(a),g,f);break;default:this.callback(null,a,g,f)}return!0},a.parseResponseHeaders=function(a){var b,c,d,e,f,g;c={};a=a.split("\n");f=0;for(g=a.length;g>f;f++)d=a[f],b=d.indexOf(":"),e=d.substring(0,b).trim().toLowerCase(),b=d.substring(b+1).trim(),c[e]=b;return c},a.prototype.guessResponseHeaders=function(){var a,b,c,d,e,f;a={};f="cache-control content-language content-range content-type expires last-modified pragma x-dropbox-metadata".split(" "); d=0;for(e=f.length;e>d;d++)b=f[d],(c=this.xhr.getResponseHeader(b))&&(a[b]=c);return a},a.prototype.onXdrLoad=function(){var a,b;if(this.completed)return!0;if(this.completed=!0,b=this.xhr.responseText,a=this.wantHeaders?{"content-type":this.xhr.contentType}:void 0,this.responseType)return this.callback(null,b,void 0,a),!0;switch(this.xhr.contentType){case "application/x-www-form-urlencoded":this.callback(null,m.Util.Xhr.urlDecode(b),void 0,a);break;case "application/json":case "text/javascript":this.callback(null, JSON.parse(b),void 0,a);break;default:this.callback(null,b,void 0,a)}return!0},a.prototype.onXdrError=function(){var a;return this.completed?!0:(this.completed=!0,a=new m.ApiError(this.xhr,this.method,this.url),this.onError?this.onError(a,this.callback):this.callback(a),!0)},a}()}.call(this);function mxAsyncCanvas(a){mxAbstractCanvas2D.call(this);this.htmlCanvas=a;a.images=a.images||[];a.subCanvas=a.subCanvas||[]}mxUtils.extend(mxAsyncCanvas,mxAbstractCanvas2D);mxAsyncCanvas.prototype.htmlCanvas=null;mxAsyncCanvas.prototype.canvasIndex=0;mxAsyncCanvas.prototype.waitCounter=0;mxAsyncCanvas.prototype.onComplete=null;mxAsyncCanvas.prototype.incWaitCounter=function(){this.waitCounter++}; mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxAsyncCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily};mxAsyncCanvas.prototype.rotate=function(a,c,f,d,b){}; mxAsyncCanvas.prototype.setAlpha=function(a){this.state.alpha=a};mxAsyncCanvas.prototype.setFontColor=function(a){this.state.fontColor=a};mxAsyncCanvas.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAsyncCanvas.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxAsyncCanvas.prototype.setFontSize=function(a){this.state.fontSize=a}; mxAsyncCanvas.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAsyncCanvas.prototype.setFontStyle=function(a){this.state.fontStyle=a};mxAsyncCanvas.prototype.rect=function(a,c,f,d){};mxAsyncCanvas.prototype.roundrect=function(a,c,f,d,b,e){};mxAsyncCanvas.prototype.ellipse=function(a,c,f,d){};mxAsyncCanvas.prototype.rewriteImageSource=function(a){if("http://"==a.substring(0,7)||"https://"==a.substring(0,8))a="/proxy?url\x3d"+encodeURIComponent(a);return a}; mxAsyncCanvas.prototype.image=function(a,c,f,d,b,e,g,k){b=this.rewriteImageSource(b);a=this.htmlCanvas.images[b];null==a&&(a=new Image,a.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),a.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[b]=a,a.src=b)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){}; mxAsyncCanvas.prototype.text=function(a,c,f,d,b,e,g,k,l,n,m,p){if(!(null==b||0==b.length))if(a=this.state.scale,"html"==l&&"function"===typeof html2canvas){this.incWaitCounter();var s=this.canvasIndex++;html2canvas(b,{onrendered:mxUtils.bind(this,function(a){this.htmlCanvas.subCanvas[s]=a;this.decWaitCounter()}),scale:a,logging:!0})}};mxAsyncCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};function mxJsCanvas(a){mxAbstractCanvas2D.call(this);this.ctx=a.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null; mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,f,d,b){return f+f+d+d+b+b});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++}; mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var a="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="italic ");this.ctx.font=a+this.state.fontSize+"px "+this.state.fontFamily}; mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a;this.ctx.scale(a,a)};mxJsCanvas.prototype.translate=function(a,c){this.state.dx+=a;this.state.dy+=c;this.ctx.translate(a,c)}; mxJsCanvas.prototype.rotate=function(a,c,f,d,b){d-=this.state.dx;b-=this.state.dy;this.ctx.translate(d,b);if(c||f)this.ctx.scale(c?-1:1,f?-1:1);this.ctx.rotate(a*this.M_RAD_PER_DEG);this.ctx.translate(-d,-b)};mxJsCanvas.prototype.setAlpha=function(a){this.state.alpha=a;this.ctx.globalAlpha=a};mxJsCanvas.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null;this.ctx.fillStyle=a}; mxJsCanvas.prototype.setGradient=function(a,c,f,d,b,e,g,k,l){f=this.ctx.createLinearGradient(0,d,0,d+e);d=this.state;d.fillColor=a;d.fillAlpha=null!=k?k:1;d.gradientColor=c;d.gradientAlpha=null!=l?l:1;d.gradientDirection=g;a=this.hexToRgb(a);c=this.hexToRgb(c);null!=a&&f.addColorStop(0,"rgba("+a.r+","+a.g+","+a.b+","+d.fillAlpha+")");null!=c&&f.addColorStop(1,"rgba("+c.r+","+c.g+","+c.b+","+d.gradientAlpha+")");this.ctx.fillStyle=f}; mxJsCanvas.prototype.setStrokeColor=function(a){null!=a&&(a==mxConstants.NONE?(this.state.strokeColor=null,this.ctx.strokeStyle="rgba(0, 0, 0, 0)"):(this.ctx.strokeStyle=a,this.state.strokeColor=a))};mxJsCanvas.prototype.setStrokeWidth=function(a){this.ctx.lineWidth=a};mxJsCanvas.prototype.setDashed=function(a){if(this.state.dashed=a){a=this.state.dashPattern.split(" ");for(var c=0;cthis.diagrams.length&&"0"==urlParams.pages)this.ui.fileNode=null,this.ui.pages=null,0==this.diagrams.length?(this.diagramMap=this.rtModel.createMap(),this.diagrams.push(this.diagramMap)):this.diagramMap=this.diagrams.get(0),this.page=new DiagramPage(document.createElement("diagram")),this.page.mapping=new RealtimeMapping(this,this.diagramMap,this.page),this.diagramMap.has("name")||this.diagramMap.set("name",mxResources.get("pageWithNumber",[1])),this.page.setName(this.page.mapping.diagramMap.get("name")), this.page.mapping.init(),this.ui.editor.fireEvent(new mxEventObject("resetGraphView"));else{this.ui.fileNode=mxUtils.createXmlDocument().createElement("mxfile");this.ui.pages=[];0==this.diagrams.length&&this.diagrams.push(this.rtModel.createMap());Math.max(0,Math.min(this.diagrams.length-1,urlParams.page||0));for(a=0;aa&&!this.sizeLimitWarningShown)&&(this.sizeLimitWarningShown=!0,this.ui.showError(mxResources.get("warning"),mxResources.get("fileNearlyFullSeeFaq"),mxResources.get("close"), mxUtils.bind(this,function(){}),null,mxResources.get("show"),mxUtils.bind(this,function(){window.open("https://desk.draw.io/solution/articles/16000041695-what-does-the-error-message-file-nearly-full-please-see-faq-mean")}))))}));a=mxUtils.bind(this,function(){this.resetUpdateStatusThread();this.ui.resetScrollbars();this.updateStatus();c=!1});c?(this.ui.editor.setStatus(mxResources.get("saving")+"..."),this.file.save(!1,a,a)):a();null==this.previousUndoListener&&(this.previousUndoListener=this.ui.editor.undoListener, this.ui.editor.undoListener=mxUtils.bind(this,function(a,b){this.ignoreChange||this.previousUndoListener.apply(this,arguments)}))}; DriveRealtime.prototype.triggerAutosave=function(){this.ui.editor.setStatus(mxResources.get("updatingPreview"));this.file.autosave(this.realtimeAutosaveDelay,this.realtimeMaxAutosaveDelay,mxUtils.bind(this,function(a){this.realtimeAutosaveDelay=this.defaultRealtimeAutosaveDelay+Math.min(1E4,this.file.saveDelay);this.ui.getCurrentFile()==this.file&&!this.saving&&this.ui.editor.setStatus(mxResources.get("allChangesSaved"))}),mxUtils.bind(this,function(a){this.ui.editor.setStatus(mxResources.get("errorUpdatingPreview")); this.ui.isLegacyDriveDomain()&&("1"!=urlParams.ignoremime&&null!=a&&null!=a.error&&(400==a.error.code||403==a.error.code))&&this.ui.drive.verifyMimeType(this.file.getId(),null,!0)}))}; DriveRealtime.prototype.triggerAutosave=function(){this.ui.editor.setStatus(mxResources.get("updatingPreview"));this.file.autosave(this.realtimeAutosaveDelay,this.realtimeMaxAutosaveDelay,mxUtils.bind(this,function(a){this.realtimeAutosaveDelay=this.defaultRealtimeAutosaveDelay+Math.min(1E4,this.file.saveDelay);this.ui.getCurrentFile()==this.file&&!this.saving&&this.ui.editor.setStatus(mxResources.get("allChangesSaved"))}),mxUtils.bind(this,function(a){this.ui.editor.setStatus(mxResources.get("errorUpdatingPreview")); this.ui.isLegacyDriveDomain()&&("1"!=urlParams.ignoremime&&null!=a&&null!=a.error&&(400==a.error.code||403==a.error.code))&&this.ui.drive.verifyMimeType(this.file.getId(),null,!0)}))};DriveRealtime.prototype.installReadOnlyListener=function(){this.doc.addEventListener(gapi.drive.realtime.EventType.ATTRIBUTE_CHANGED,mxUtils.bind(this,function(a){"is_read_only"==a.attribute&&(this.file.descriptorChanged(),this.file.isEditable()?this.ui.editor.setStatus(""):(this.ui.editor.graph.reset(),this.ui.editor.setStatus(mxResources.get("readOnly"))))}))}; DriveRealtime.prototype.installUiChangeListeners=function(){this.pageFormatListener=mxUtils.bind(this,function(a,c){if(!this.ignorePageFormatChanged)try{this.setFileModified(),this.getDiagramMap().set("pageFormat",this.graph.pageFormat.width+","+this.graph.pageFormat.height)}catch(f){this.ui.handleError(f)}});this.ui.addListener("pageFormatChanged",this.pageFormatListener);this.pageScaleListener=mxUtils.bind(this,function(a,c){if(!this.ignorePageScaleChanged)try{this.setFileModified(),this.getDiagramMap().set("pageScale", this.graph.pageScale)}catch(f){this.ui.handleError(f)}});this.ui.addListener("pageScaleChanged",this.pageScaleListener);this.backgroundColorListener=mxUtils.bind(this,function(a,c){if(!this.ignoreBackgroundColorChanged)try{this.setFileModified(),this.getDiagramMap().set("backgroundColor",null!=this.graph.background?this.graph.background:"")}catch(f){this.ui.handleError(f)}});this.ui.addListener("backgroundColorChanged",this.backgroundColorListener);this.shadowVisibleListener=mxUtils.bind(this,function(a, c){if(!this.ignoreShadowVisibleChanged&&this.getDiagramMap().get("shadowVisible")!=(this.graph.shadowVisible?"1":"0"))try{this.setFileModified(),this.getDiagramMap().set("shadowVisible",this.graph.shadowVisible?"1":"0")}catch(f){this.ui.handleError(f)}});this.graph.addListener("shadowVisibleChanged",this.shadowVisibleListener);this.foldingEnabledListener=mxUtils.bind(this,function(a,c){if(!this.ignoreFoldingEnabledChanged)try{this.setFileModified(),this.getDiagramMap().set("foldingEnabled",this.graph.foldingEnabled? "1":"0")}catch(f){this.ui.handleError(f)}});this.ui.addListener("foldingEnabledChanged",this.foldingEnabledListener);this.graph.addListener("shadowVisibleChanged",this.shadowVisibleListener);this.pageVisibleListener=mxUtils.bind(this,function(a,c){if(!this.ignorePageVisibleChanged)try{this.setFileModified(),this.getDiagramMap().set("pageVisible",this.graph.pageVisible?"1":"0")}catch(f){this.ui.handleError(f)}});this.ui.addListener("pageViewChanged",this.pageVisibleListener);this.backgroundImageListener= mxUtils.bind(this,function(a,c){if(!this.ignoreBackgroundImageChanged)try{this.setFileModified(),this.getDiagramMap().set("backgroundImage",null!=this.graph.backgroundImage?JSON.stringify(this.graph.backgroundImage):"")}catch(f){this.ui.handleError(f)}});this.ui.addListener("backgroundImageChanged",this.backgroundImageListener);this.mathEnabledListener=mxUtils.bind(this,function(a,c){if(!this.ignoreMathEnabledChanged)try{this.setFileModified(),this.getDiagramMap().set("mathEnabled",this.graph.mathEnabled? "1":"0")}catch(f){this.ui.handleError(f)}});this.ui.addListener("mathEnabledChanged",this.mathEnabledListener)};DriveRealtime.prototype.isLocalEvent=function(a){return a.isLocal};DriveRealtime.prototype.resetUpdateStatusThread=function(){null!=this.updateStatusThread&&window.clearInterval(this.updateStatusThread);this.updateStatusThread=window.setInterval(mxUtils.bind(this,function(){this.ui.drive.checkToken(mxUtils.bind(this,function(){this.updateStatus()}))}),this.updateStatusInterval)}; DriveRealtime.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1f;d+=1){var b=this.doc.getCollaborators()[d];!b.isMe&&null==c[b.color]&&(c[b.color]=b.displayName,f++)}for(var e in c)a+='\x3cdiv title\x3d"'+mxUtils.htmlEntities(c[e])+'" style\x3d"display:inline-block;background-color:'+ e+';width:13px;height:13px;margin-left:4px;margin-top:-1px;"\x3e\x3c/div\x3e';this.collaboratorsElement.innerHTML=a};DriveRealtime.prototype.createPrefix=function(){for(var a=this.doc.getCollaborators(),c=0;cthis.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){a();c&&this.fireEvent(new mxEventObject("disconnected"))})):a()}; DriveClient.prototype.updateUser=function(a,c,f){var d="https://www.googleapis.com/oauth2/v2/userinfo?alt\x3djson\x26access_token\x3d"+gapi.auth.getToken().access_token;this.ui.loadUrl(d,mxUtils.bind(this,function(b){var d=JSON.parse(b);this.executeRequest(gapi.client.drive.about.get(),mxUtils.bind(this,function(b){this.setUser(new DrawioUser(d.id,b.user.emailAddress,b.user.displayName,null!=b.user.picture?b.user.picture.url:null));this.setUserId(d.id,f);null!=a&&a()}),c)}),c)}; DriveClient.prototype.copyFile=function(a,c,f,d){null!=a&&null!=c&&this.executeRequest(gapi.client.drive.files.copy({fileId:a,resource:{title:c}}),f,d)};DriveClient.prototype.renameFile=function(a,c,f,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{title:c}),f,d)};DriveClient.prototype.moveFile=function(a,c,f,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{parents:[{kind:"drive#fileLink",id:c}]}),f,d)}; DriveClient.prototype.createDriveRequest=function(a,c){return gapi.client.request({path:"/drive/v2/files/"+a,method:"PUT",params:{uploadType:"multipart"},headers:{"Content-Type":"application/json; charset\x3dUTF-8"},body:JSON.stringify(c)})};DriveClient.prototype.getLibrary=function(a,c,f){return this.getFile(a,c,f,!0,!0)}; DriveClient.prototype.convertFile=function(a,c,f){var d=a.title,d=d.substring(0,d.lastIndexOf("."))+this.extension,b=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"\x26access_token\x3d"+b,mxUtils.bind(this,function(b){this.ui.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){4==b.readyState&&(200==b.status&&"\x3cmxGraphModel"==b.responseText.substring(0,13)?this.insertFile(d,b.responseText,null!=a.parents&&0 this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");k(b,"image/png")})))&&k(null,null,a.constructor!=DriveLibrary&&b)});b||!c?l():this.verifyMimeType(a.getId(),l,!0)}else this.ui.editor.graph.reset(),null!=d&&d({message:mxResources.get("readOnly")})}; DriveClient.prototype.verifyMimeType=function(a,c,f,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var b=(new Date).getTime();if(f||b-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=b,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType"}),mxUtils.bind(this,function(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!=c&&c()})))}; DriveClient.prototype.redirectToNewApp=function(a,c){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var f=window.location.protocol+"//"+this.newAppHostname+"/"+this.ui.getSearch("create title mode url drive splash".split(" "))+"#G"+c;null!=a?this.ui.confirm(mxResources.get("redirectToNewApp"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href=f}),mxUtils.bind(this,function(){this.redirectDialogShowing=!1;null!=a&&a()})):this.ui.alert(mxResources.get("redirectToNewApp"), mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href=f}))}}; DriveClient.prototype.insertFile=function(a,c,f,d,b,e,g,k){e=null!=e?e:this.mimeType;k=null!=k?k:!0;a={mimeType:e,title:a};null!=f&&(a.parents=[{kind:"drive#fileLink",id:f}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,g),mxUtils.bind(this,function(a){e==this.libraryMimeType?d(new DriveLibrary(this.ui,c,a)):!1==a?null!=b&&b({message:mxResources.get("errorSavingFile")}):k?this.loadRealtime(a,mxUtils.bind(this,function(e){null!=this.user?(e=new DriveFile(this.ui,c,a,e),e.lastAutosaveRevision= (new Date).getTime(),d(e)):null!=b&&b({message:mxResources.get("loggedOut")})}),b):d(a)}),b)}; DriveClient.prototype.createUploadRequest=function(a,c,f,d,b){b=null!=b?b:!1;a={path:"/upload/drive/v2/files"+(null!=a?"/"+a:""),method:null!=a?"PUT":"POST",params:{uploadType:"multipart"},headers:{"Content-Type":'multipart/mixed; boundary\x3d"-------314159265358979323846"'},body:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!= f?b?f:Base64.encode(f):"")+"\r\n---------314159265358979323846--"};d||(a.params.newRevision=!1);return gapi.client.request(a)}; DriveClient.prototype.pickFile=function(a,c){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,d=c?"genericPicker":"filePicker",b=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"== mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",b),this[d].setVisible(!1))});if(null==this[d]||this[d+"Token"]!=a){this[d+"Token"]=a;var a=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),e=new google.picker.DocsView,g=(new google.picker.DocsUploadView).setIncludeFolders(!0);c||(a.setMimeTypes(this.mimeTypes),e.setMimeTypes(this.mimeTypes));this[d]=(new google.picker.PickerBuilder).setOAuthToken(this[d+"Token"]).setLocale(mxLanguage).setAppId(this.appId).addView(a).addView(e).addView(google.picker.ViewId.RECENTLY_PICKED).addView(g).setCallback(mxUtils.bind(this, function(a){(a.action==google.picker.Action.PICKED||a.action==google.picker.Action.CANCEL)&&mxEvent.removeListener(document,"click",b);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",b);this[d].setVisible(!0);this.ui.movePickersToTop()}))}; DriveClient.prototype.pickFolder=function(a){this.folderPickerCallback=a;this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,f=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",f),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||this.folderPickerToken!=a){this.folderPickerToken= a;var a=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");this.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).addView(a).addView(d).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder")).setCallback(mxUtils.bind(this, function(a){(a.action==google.picker.Action.PICKED||a.action==google.picker.Action.CANCEL)&&mxEvent.removeListener(document,"click",f);this.folderPickerCallback(a)})).build()}mxEvent.addListener(document,"click",f);this.folderPicker.setVisible(!0);this.ui.movePickersToTop()}))}; DriveClient.prototype.pickLibrary=function(a){this.filePickerCallback=a;this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED?this.filePickerCallback(a.docs[0].id):a.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(b).className&& (mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))}),f=gapi.auth.getToken().access_token;if(null==this.libraryPicker||this.libraryPickerToken!=f){this.libraryPickerToken=f;var f=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),d=(new google.picker.DocsView).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"), b=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).addView(f).addView(d).addView(google.picker.ViewId.RECENTLY_PICKED).addView(b).setCallback(mxUtils.bind(this,function(b){(b.action==google.picker.Action.PICKED||b.action==google.picker.Action.CANCEL)&&mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document, "click",a);this.libraryPicker.setVisible(!0);this.ui.movePickersToTop()}))};DriveClient.prototype.showPermissions=function(a){this.checkToken(mxUtils.bind(this,function(){var c=new gapi.drive.share.ShareClient(this.appId);c.setOAuthToken(gapi.auth.getToken().access_token);c.setItemIds([a]);c.showSettingsDialog()}))};DropboxFile=function(a,c,f){DrawioFile.call(this,a,c);this.stat=f};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.stat.path.substring(1))};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};DropboxFile.prototype.isRenamable=function(){return!0}; DropboxFile.prototype.save=function(a,c,f){this.doSave(this.getTitle(),c,f)};DropboxFile.prototype.saveAs=function(a,c,f){this.doSave(a,c,f)};DropboxFile.prototype.doSave=function(a,c,f){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(a,!1,c,f)}; DropboxFile.prototype.saveFile=function(a,c,f,d){this.isEditable()?this.savingFile?null!=d&&d({code:App.ERROR_BUSY}):(c=mxUtils.bind(this,function(b){if(b){this.savingFile=!0;var c=this.isModified,g=this.isModified();this.setModified(!1);this.isModified=function(){return g};this.ui.dropbox.saveFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=c;this.stat=a;this.contentChanged();null!=f&&f()}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=c;this.setModified(g|| this.isModified());null!=d&&d(a)}))}else null!=d&&d()}),this.getTitle()==a?c(!0):this.ui.dropbox.checkExists(a,c)):null!=f&&f()};DropboxFile.prototype.rename=function(a,c,f){this.ui.dropbox.renameFile(this,a,mxUtils.bind(this,function(d){this.hasSameExtension(a,this.getTitle())?(this.stat=d,this.descriptorChanged(),null!=c&&c()):(this.stat=d,this.descriptorChanged(),this.save(!0,c,f))}),f)};DropboxLibrary=function(a,c,f){DropboxFile.call(this,a,c,f)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!1};DropboxLibrary.prototype.doSave=function(a,c,f){this.saveFile(a,!1,c,f)};DropboxLibrary.prototype.open=function(){};DropboxClient=function(a){mxEventSource.call(this);this.ui=a;this.client=new Dropbox.Client({key:App.DROPBOX_APPKEY,sandbox:!0});this.client.authDriver(new Dropbox.AuthDriver.Popup({rememberUser:!0,receiverUrl:"https://"+window.location.host+"/dropbox.html"}))};mxUtils.extend(DropboxClient,mxEventSource);DropboxClient.prototype.appPath="/drawio/";DropboxClient.prototype.extension=".html";DriveClient.prototype.maxRetries=4;DropboxClient.prototype.user=null;DropboxClient.prototype.writingFile=!1; DropboxClient.prototype.logout=function(){this.client.signOut(mxUtils.bind(this,function(){this.setUser(null)}))};DropboxClient.prototype.setUser=function(a){this.user=a;this.fireEvent(new mxEventObject("userChanged"))};DropboxClient.prototype.getUser=function(){return this.user};DropboxClient.prototype.updateUser=function(a,c,f){this.client.getUserInfo(null,mxUtils.bind(this,function(a,b){null==a?this.setUser(new DrawioUser(b.uid,b.email,b.name)):this.setUser(null)}))}; DropboxClient.prototype.execute=function(a){this.client.isAuthenticated()?a():this.authorize(!1,mxUtils.bind(this,function(c,f){null!=c?this.ui.handleError(c):this.client.isAuthenticated()?(this.updateUser(),a()):this.ui.showAuthDialog(this,!1,mxUtils.bind(this,function(c,b){this.authorize(!0,mxUtils.bind(this,function(c,d){null!=c?this.ui.handleError(c):this.client.isAuthenticated()&&(this.updateUser(),null!=b&&b(),a())}))}))}))}; DropboxClient.prototype.authorize=function(a,c){this.client.authenticate({interactive:a},mxUtils.bind(this,function(a,d){null!=a?null!=window.console&&console.log(a):c()}))};DropboxClient.prototype.getLibrary=function(a,c,f){this.getFile(a,c,f,!1,!0)}; DropboxClient.prototype.getFile=function(a,c,f,d,b){b=null!=b?b:!1;var e=mxUtils.bind(this,function(){this.execute(mxUtils.bind(this,function(){var d=!0,k=window.setTimeout(mxUtils.bind(this,function(){d=!1;f({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),l=null;null!=urlParams.rev&&(l={versionTag:urlParams.rev});this.client.readFile("/"+a,l,mxUtils.bind(this,function(a,e,l){try{window.clearTimeout(k),d&&(null!=a?f(a):b?c(new DropboxLibrary(this.ui,e,l)):c(new DropboxFile(this.ui,e,l)))}catch(s){f(s)}}))}))}); e()};DropboxClient.prototype.checkExists=function(a,c){this.client.stat(a,mxUtils.bind(this,function(f,d){null!=f&&404==f.status||null!=d&&d.isRemoved?c(!0):this.ui.confirm(mxResources.get("replaceIt",[a]),function(){c(!0)},function(){c(!1)})}))}; DropboxClient.prototype.renameFile=function(a,c,f,d){null!=a&&null!=c&&this.execute(mxUtils.bind(this,function(){this.checkExists(c,mxUtils.bind(this,function(b){b?this.writeFile(c,a.getData(),mxUtils.bind(this,function(b){this.client.remove(a.getTitle(),function(a,c){null!=a?d(a):f(b)})}),d):d()}))}))};DropboxClient.prototype.insertLibrary=function(a,c,f,d){this.insertFile(a,c,f,d,!0)}; DropboxClient.prototype.insertFile=function(a,c,f,d,b){b=null!=b?b:!1;this.execute(mxUtils.bind(this,function(){this.checkExists(a,mxUtils.bind(this,function(e){e?this.writeFile(a,c,mxUtils.bind(this,function(a){b?f(new DropboxLibrary(this.ui,c,a)):f(new DropboxFile(this.ui,c,a))}),d):d()}))}))};DropboxClient.prototype.saveFile=function(a,c,f,d){this.execute(mxUtils.bind(this,function(){this.writeFile(a,c,f,d)}))}; DropboxClient.prototype.writeFile=function(a,c,f,d){if(/[\\\/:\?\*"\|]/.test(a))null!=d&&d({message:mxResources.get("dropboxCharsNotAllowed")});else if(this.writingFile)null!=d&&d({code:App.ERROR_BUSY});else{var b=!0,e=null;this.writingFile=!0;var g=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var k=mxUtils.bind(this,function(){null!=e&&window.clearTimeout(e);e=window.setTimeout(mxUtils.bind(this,function(){b=this.writingFile=!1;null!=d&&d({code:App.ERROR_TIMEOUT,retry:k})}), this.ui.timeout);this.client.writeFile(a,c,mxUtils.bind(this,function(a,c){window.clearTimeout(e);if(b)if(null!=a)if(gf?f=a.length:postCookie=a.substring(f);return a.substring(c,f)}return""}; OneDriveClient.prototype.execute=function(a,c){c=null!=c?c:!1;var f=this.getTokenFromCookie();if(null!=this.getUser()&&null!=f&&0/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#039;")};App=function(a,c,f){EditorUi.call(this,a,c,null!=f?f:"1"==urlParams.lightbox);mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII\x3d": (new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,c,d){var f=window.open(a);null==f||void 0===f?this.showDialog((new PopupDialog(this,a,c,d)).container,320,140,!0,!0):null!=c&&c()});this.updateUi();a=document.createElement("canvas");this.canvasSupported=!(!a.getContext||!a.getContext("2d"));window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});this.isOffline()||(EditDataDialog.placeholderHelpLink= "https://support.draw.io/questions/9338941");ColorDialog.recentColors=mxSettings.getRecentColors(ColorDialog.recentColors);this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(a=0;anavigator.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&&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!= f;)"shapes"==f.nodeName&&null!=f.getAttribute("name")&&(mxStencilRegistry.stencilSet[f.getAttribute("name").toLowerCase()]=f,mxStencilRegistry.parseStencilSet(f)),f=f.nextSibling}"0"!=urlParams.picker&&(!mxClient.IS_QUIRKS&&8!=document.documentMode)&&mxscript(document.location.protocol+"//www.google.com/jsapi?autoload\x3d%7B%22modules%22%3A%5B%7B%22name%22%3A%22picker%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22"+mxClient.language+"%22%7D%5D%7D");"function"===typeof window.DriveClient&&"undefined"=== typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload\x3dDrawGapiClientCallback"):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();mxResources.loadDefaultBundle=!1;f=mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage); mxUtils.getAll("1"!=urlParams.dev?[f]:[f,STYLE_PATH+"/default.xml"],function(c){mxResources.parse(c[0].getText());1navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript("https://js.live.net/v5.0/wl.js",window.DrawOneDriveClientCallback):"undefined"===typeof window.WL&&(window.OneDriveClient=null)}null!=a&&a(c);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:", "1"==urlParams.test?"active":"inactive"))},function(){document.getElementById("geStatus").innerHTML='Error loading page. \x3ca href\x3d"javascript:void(0);" onclick\x3d"location.reload();"\x3ePlease try refreshing.\x3c/a\x3e'})};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz\x3d30";App.prototype.micImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA5UlEQVR4Xr3SMYrCQBTGcSfIQiAgRIS9hOANBCurPUAuIAp7A7FVsFkIbLGYA9gKtoKNYG3jll5AFNKG518YMD6SISD4wY9J4MvkMYwRkZqOMSZkifGFe1b4pnvW3TqK8oMo14twxUgXPRSlDxU7TcUNPqATlG7wCi93cA2Iq2x7l7IJsgofB6UTiEjKklFqsabQSdFA5jqDAzrYQGeNNv5d9yDBEAME6NreFmP8Yuma4A8hFpiLSFNAYYYYn0jwCIUnxMcER4h1whS+7hseXKcu9ifGeQ+qeO8GjN7DPve+Q6+oewPhmE63Qfsb6AAAAABJRU5ErkJggg\x3d\x3d"; App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg\x3d\x3d"; App.prototype.chevronUpImage=!mxClient.IS_SVG?IMAGE_PATH+"/chevron-up.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUY1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NjA1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1RDUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1RTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pg+qUokAAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAAL0lEQVR42mJgRgMMRAswMKAKMDDARBjg8lARBoR6KImkH0wTbygT6YaS4DmAAAMAYPkClOEDDD0AAAAASUVORK5CYII\x3d"; App.prototype.chevronDownImage=!mxClient.IS_SVG?IMAGE_PATH+"/chevron-down.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUI1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NUM1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1OTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1QTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsCtve8AAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAALUlEQVR42mJgRgMMRAkwQEXBNAOcBSPhclB1cNVwfcxI+vEZykSpoSR6DiDAAF23ApT99bZ+AAAAAElFTkSuQmCC"; App.prototype.formatShowImage=!mxClient.IS_SVG?IMAGE_PATH+"/format-show.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODdCREY5REY1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODdCREY5RTA1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4N0JERjlERDU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4N0JERjlERTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PlnMQ/8AAAAJUExURQAAAP///3FxcTfTiAsAAAACdFJOU/8A5bcwSgAAACFJREFUeNpiYEQDDEQJMMABTAAixcQ00ALoDiPRcwABBgB6DADly9Yx8wAAAABJRU5ErkJggg\x3d\x3d"; App.prototype.formatHideImage=!mxClient.IS_SVG?IMAGE_PATH+"/format-hide.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODdCREY5REI1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODdCREY5REM1NkQ3MTFFNTkyNjNEMTA5NjgwODUyRTgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4N0JERjlEOTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4N0JERjlEQTU2RDcxMUU1OTI2M0QxMDk2ODA4NTJFOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqjT9SMAAAAGUExURQAAAP///6XZn90AAAACdFJOU/8A5bcwSgAAAB9JREFUeNpiYEQDDEQJMMABTAAmNdAC6A4j0XMAAQYAcbwA1Xvj1CgAAAAASUVORK5CYII\x3d"; App.prototype.fullscreenImage=!mxClient.IS_SVG?IMAGE_PATH+"/fullscreen.png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABpJREFUCNdjgAAbGxAy4AEh5gNwBBGByoIBAIueBd12TUjqAAAAAElFTkSuQmCC";App.prototype.timeout=25E3;App.prototype.enableLogging=!0;App.prototype.formatEnabled="0"!=urlParams.format;App.prototype.formatWidth=600>screen.width?0:mxSettings.getFormatWidth();"1"!=urlParams.embed&&(App.prototype.menubarHeight=60); App.prototype.init=function(){EditorUi.prototype.init.apply(this,arguments);this.defaultLibraryName=mxResources.get("untitledLibrary");this.descriptorChangedListener=mxUtils.bind(this,this.descriptorChanged);if("1"!=urlParams.embed||"1"==urlParams.od){var a=mxUtils.bind(this,function(){"undefined"!==typeof WL?(this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded", "client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=a)});a()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var c=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var a=mxUtils.bind(this,function(){this.drive=new DriveClient(this);"420247213240"==this.drive.appId&&this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile&&(a=document.getElementById("geFooterItem2"),null!= a&&(a.innerHTML='\x3ca href\x3d"https://support.draw.io/display/DO/2014/11/27/Switching+application+in+Google+Drive" target\x3d"_blank" title\x3d"IMPORTANT NOTICE" \x3eIMPORTANT NOTICE\x3c/a\x3e'))}));this.drive.addListener("userChanged",mxUtils.bind(this,function(){null!=this.updateAd&&(this.adsHtml=['\x3ca title\x3d"Quick start video" href\x3d"https://www.youtube.com/watch?v\x3d8OaMWa4R1SE\x26t\x3d1" target\x3d"_blank"\x3e\x3cimg border\x3d"0" align\x3d"absmiddle" style\x3d"margin-top:-4px;" src\x3d"images/glyphicons_star.png"/\x3e\x26nbsp;\x26nbsp;Quick start video\x3c/a\x3e', '\x3ca title\x3d"Google Docs Add-on" href\x3d"https://chrome.google.com/webstore/detail/drawio-diagrams/clpbjldiohnnmfmkngmaohehlnfkmoea" target\x3d"_blank"\x3e\x3cimg border\x3d"0" align\x3d"absmiddle" style\x3d"margin-top:-4px;" src\x3d"images/glyphicons_star.png"/\x3e\x26nbsp;\x26nbsp;Google Docs Add-on\x3c/a\x3e','\x3ca title\x3d"Google Chrome App" href\x3d"https://chrome.google.com/webstore/detail/drawio-desktop/pebppomjfocnoigkeepgbmcifnnlndla" target\x3d"_blank"\x3e\x3cimg border\x3d"0" align\x3d"absmiddle" style\x3d"margin-top:-4px;" src\x3d"images/glyphicons_star.png"/\x3e\x26nbsp;\x26nbsp;Google Chrome App\x3c/a\x3e', '\x3ca title\x3d"Please help us to 5 stars" href\x3d"https://chrome.google.com/webstore/detail/drawio-pro/onlkggianjhjenigcpigpjehhpplldkc/reviews" target\x3d"_blank"\x3e\x3cimg border\x3d"0" align\x3d"absmiddle" style\x3d"margin-top:-4px;" src\x3d"images/glyphicons_star.png"/\x3e\x26nbsp;\x26nbsp;Please help us to 5 stars\x3c/a\x3e'],this.updateAd(this.adsHtml.length-1));this.updateUserElement();this.restoreLibraries();this.checkLicense()}));this.fireEvent(new mxEventObject("clientLoaded","client", this.drive))});null!=window.DrawGapiClientCallback?(gapi.load("auth:client,drive-realtime,drive-share",mxUtils.bind(this,function(b){null!=gapi.drive&&null!=gapi.drive.realtime&&gapi.client.load("drive","v2",mxUtils.bind(this,function(){this.defineCustomObjects();gapi.auth.init(mxUtils.bind(this,function(){null!=gapi.client.drive&&a()}))}))})),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=c)});c()}if("1"!=urlParams.embed||"1"==urlParams.db){var f= mxUtils.bind(this,function(){null!=window.Dropbox&&"undefined"!==typeof Dropbox.choose?(window.DrawDropboxClientCallback=null,this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))):null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=f)});f()}"1"!=urlParams.embed?(this.bg=this.createBackground(),document.body.appendChild(this.bg), this.diagramContainer.style.visibility="hidden",this.formatContainer.style.visibility="hidden",this.hsplit.style.display="none",this.sidebarContainer.style.display="none",this.sidebarFooterContainer.style.display="none","1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode):null!=this.menubar&&(this.menubar.container.style.paddingTop="0px");this.updateHeader();var d=document.getElementById("geFooterItem2");if(null!=d){this.adsHtml=['\x3ca title\x3d"Quick start video" href\x3d"https://www.youtube.com/watch?v\x3d8OaMWa4R1SE\x26t\x3d1" target\x3d"_blank"\x3e\x3cimg border\x3d"0" align\x3d"absmiddle" style\x3d"margin-top:-4px;" src\x3d"images/glyphicons_star.png"/\x3e\x26nbsp;\x26nbsp;Quick start video\x3c/a\x3e']; this.adsHtml.push(d.innerHTML);mxUtils.setPrefixedStyle(d.style,"transition","all 1s ease");var b=this.adsHtml.length-1;this.updateAd=function(a){a==b&&(a=this.adsHtml.length-1);a!=b&&(mxUtils.setPrefixedStyle(d.style,"transform","scale(0)"),d.style.opacity="0",b=a,window.setTimeout(mxUtils.bind(this,function(){d.innerHTML=this.adsHtml[a];mxUtils.setPrefixedStyle(d.style,"transform","scale(1)");d.style.opacity="1"}),1E3))};window.setInterval(mxUtils.bind(this,function(){if(3==this.adsHtml.length)this.updateAd(mxUtils.mod(b+ 1,3));else{var a=Math.random();this.updateAd(Math.round(a*(this.adsHtml.length-1)))}}),3E5)}null!=this.menubar&&(this.buttonContainer=document.createElement("div"),this.buttonContainer.style.display="inline-block",this.buttonContainer.style.paddingRight="48px",this.buttonContainer.style.position="absolute",this.buttonContainer.style.right="0px",this.menubar.container.appendChild(this.buttonContainer));"atlas"==uiTheme&&null!=this.menubar&&(null!=this.toggleElement&&(this.toggleElement.click(),this.toggleElement.style.display= "none"),this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.style.paddingTop="11px",this.icon.style.marginLeft="4px",this.icon.style.marginRight="6px",mxClient.IS_QUIRKS&&(this.icon.style.marginTop="12px"),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild));if(isLocalStorage||mxClient.IS_CHROMEAPP){this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle(); this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged")); this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor); mxSettings.save()}));mxClient.IS_CHROMEAPP&&(this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave());null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);if(!this.editor.chromeless&&null!=this.sidebar&&(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0)))this.toggleScratchpad(),mxSettings.save();this.addListener("formatWidthChanged", function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};App.prototype.isDriveDomain=function(){return"0"!=urlParams.drive&&("test.draw.io"==window.location.hostname||"cdn.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"jgraph.github.io"==window.location.hostname)};App.prototype.isLegacyDriveDomain=function(){return 0==urlParams.drive||"legacy.draw.io"==window.location.hostname}; App.prototype.checkLicense=function(){var a=this.drive.getUser(),a=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=a){var c=a.lastIndexOf("@"),f=a;0<=c&&(f=a.substring(c+1),a=this.crc32(a.substring(0,c))+"@"+f);mxUtils.post("/license","domain\x3d"+encodeURIComponent(f)+"\x26email\x3d"+encodeURIComponent(a)+"\x26ts\x3d"+(new Date).getTime(),mxUtils.bind(this,function(a){try{if(200==a.getStatus()){var b=a.getText();if(0e){var g="https://support.draw.io/display/DKB/draw.io+footer+state+that+license+is+expiring+on+Google+For+Work+account?domain\x3d"+encodeURIComponent(c);f.style.height="100%";f.style.margin="0px";f.style.display= "";0>e?(this.footerHeight=80,f.innerHTML='\x3ctable height\x3d"100%"\x3e\x3ctr\x3e\x3ctd valign\x3d"middle" align\x3d"center" class\x3d"geStatusAlert geBlink"\x3e\x3ca href\x3d"'+g+'" style\x3d"padding-top:16px;" target\x3d"_blank"\x3e\x3cimg border\x3d"0" src\x3d"'+mxGraph.prototype.warningImage.src+'" align\x3d"top" style\x3d"margin-right:6px"\x3e'+mxResources.get("licenseHasExpired",[c,b.toLocaleDateString()])+"\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e"):(this.footerHeight=46,f.innerHTML= '\x3ctable height\x3d"100%"\x3e\x3ctr\x3e\x3ctd valign\x3d"middle" align\x3d"center" class\x3d"geStatusAlert"\x3e\x3ca href\x3d"'+g+'" target\x3d"_blank"\x3e\x3cimg border\x3d"0" src\x3d"'+mxGraph.prototype.warningImage.src+'" align\x3d"top" style\x3d"margin-right:6px"\x3e'+mxResources.get("licenseWillExpire",[c,b.toLocaleDateString()])+"\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e");this.refresh()}}return d}; App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.chromeless&&this.editor.graph.lightbox&&null==a.realtime?a.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);var a=this.getCurrentFile();this.actions.get("revisionHistory").setEnabled(null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile))}; App.prototype.updateDraft=function(){isLocalStorage&&null!=localStorage&&localStorage.setItem(".draft",JSON.stringify({modified:(new Date).getTime(),data:this.getFileData()}))};App.prototype.getDraft=function(){return null};App.prototype.addRecent=function(a){if(isLocalStorage&&null!=localStorage){var c=this.getRecent();if(null==c)c=[];else for(var f=0;ff;f++){c=f;for(var d=0;8>d;d++)c=c&1?3988292384^c>>>1:c>>>1;a[f]=c}return a}; App.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,f=0;f>>8^this.crcTable[(c^a.charCodeAt(f))&255];return(c^-1)>>>0}; App.prototype.getThumbnail=function(a,c){var f=!1;try{if(null==this.thumbImageCache&&(this.thumbImageCache={}),this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){c(a)}),a,this.thumbImageCache,"#ffffff",function(){c()}),f=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var d=this.editor.graph,b=document.createElement("canvas"),e=d.getGraphBounds(),g=a/e.width,g=Math.min(1,Math.min(3*a/(4*e.height),g)),k=Math.floor(e.x),l=Math.floor(e.y);b.setAttribute("width",Math.ceil(g* (e.width+4)));b.setAttribute("height",Math.ceil(g*(e.height+4)));var n=b.getContext("2d");n.scale(g,g);n.translate(-k,-l);var m=d.background;if(null==m||""==m||m==mxConstants.NONE)m="#ffffff";n.save();n.fillStyle=m;n.fillRect(k,l,Math.ceil(e.width+4),Math.ceil(e.height+4));n.restore();var p=new mxJsCanvas(b),s=new mxAsyncCanvas(this.thumbImageCache);p.images=this.thumbImageCache.images;var t=new mxImageExport;t.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(0.5, 0.5),a.shape.paint(b),b.translate(-0.5,-0.5),b.restore())};t.drawText=function(a,b){};t.drawState(d.getView().getState(d.model.root),s);s.finish(function(){t.drawState(d.getView().getState(d.model.root),p);c(b)});f=!0}}catch(q){}return f}; App.prototype.getPublicUrl=function(a,c){null!=a&&a.constructor==DriveFile?gapi.client.drive.permissions.list({fileId:a.desc.id}).execute(function(f){if(null!=f)for(var d=0;d=window.location.hash.length)&&null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("loading")))try{var c=mxUtils.bind(this,function(){this.spinner.spin(document.body, mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["url"]))});a(decodeURIComponent(urlParams.url),mxUtils.bind(this,function(a){this.spinner.stop();if(null!=a&&0=window.location.hash.length)&&null!=e&&0=window.location.hash.length)&&(null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action)&&null!=this.stateArg.ids)window.location.hash="G"+this.stateArg.ids[0];(null==window.location.hash|| 1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):b()}}}; App.prototype.showSplash=function(a){var c=mxUtils.bind(this,function(){var a=new SplashDialog(this),c=this.getServiceCount();this.showDialog(a.container,340,2>c?180:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,App.MODE_DEVICE),this.setMode(null),Editor.useLocalStorage=a)}));a.init()});this.editor.chromeless?this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"), mxUtils.bind(this,function(){this.showSplash()})):null==this.mode||a?(a=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();c()})),this.showDialog(a.container,isLocalStorage&&"1"==urlParams.browser?480:380,300,!0,!1),a.init()):null==urlParams.create&&c()}; App.prototype.addLanguageMenu=function(a){var c=null;if((!this.isOfflineApp()||mxClient.IS_CHROMEAPP)&&null!=this.menus.get("language"))c=document.createElement("div"),c.setAttribute("title",mxResources.get("language")),c.className="geIcon geSprite geSprite-globe",c.style.position="absolute",c.style.cursor="pointer",c.style.bottom="20px",c.style.right="20px",mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(this.menus.get("language").funct); d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxUtils.getOffset(c);d.popup(b.x,b.y+c.offsetHeight,null,a);this.setCurrentMenu(d)})),a.appendChild(c);return c}; App.prototype.defineCustomObjects=function(){null!=gapi.drive.realtime&&null!=gapi.drive.realtime.custom&&(gapi.drive.realtime.custom.registerType(mxRtCell,"Cell"),mxRtCell.prototype.cellId=gapi.drive.realtime.custom.collaborativeField("cellId"),mxRtCell.prototype.type=gapi.drive.realtime.custom.collaborativeField("type"),mxRtCell.prototype.value=gapi.drive.realtime.custom.collaborativeField("value"),mxRtCell.prototype.xmlValue=gapi.drive.realtime.custom.collaborativeField("xmlValue"),mxRtCell.prototype.style= gapi.drive.realtime.custom.collaborativeField("style"),mxRtCell.prototype.geometry=gapi.drive.realtime.custom.collaborativeField("geometry"),mxRtCell.prototype.visible=gapi.drive.realtime.custom.collaborativeField("visible"),mxRtCell.prototype.collapsed=gapi.drive.realtime.custom.collaborativeField("collapsed"),mxRtCell.prototype.connectable=gapi.drive.realtime.custom.collaborativeField("connectable"),mxRtCell.prototype.parent=gapi.drive.realtime.custom.collaborativeField("parent"),mxRtCell.prototype.children= gapi.drive.realtime.custom.collaborativeField("children"),mxRtCell.prototype.source=gapi.drive.realtime.custom.collaborativeField("source"),mxRtCell.prototype.target=gapi.drive.realtime.custom.collaborativeField("target"))};mxRtCell=function(){};mxCodecRegistry.getCodec(mxCell).exclude.push("rtCell");mxCell.prototype.mxTransient.push("rtCell"); App.prototype.pickFile=function(a){a=null!=a?a:this.mode;if(a==App.MODE_DROPBOX)null!=this.dropbox&&this.dropbox.pickFile();else if(a==App.MODE_ONEDRIVE)null!=this.oneDrive&&this.oneDrive.pickFile();else if(a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():window.open("https://drive.google.com");else if(a==App.MODE_DEVICE&&Graph.fileSupport&&!mxClient.IS_IE&&!mxClient.IS_IE11){var c=document.createElement("input");c.setAttribute("type", "file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.openFiles(c.files)}));c.click()}else{this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";var f=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,function(b,c){0<(".png"==c.substring(c.length-4))&&(c=c.substring(0,c.length-4)+".xml");this.fileLoaded(a== App.MODE_BROWSER?new StorageFile(this,b,c):new LocalFile(this,b,c))}));var d=this.dialog,b=d.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=f;b.apply(d,arguments);null==this.getCurrentFile()&&this.showSplash()})}}; App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE){var c=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:this.dropbox;null!=c&&c.pickLibrary(mxUtils.bind(this,function(a,d){null!=d?this.loadLibrary(d):this.spinner.spin(document.body,mxResources.get("loading"))&&c.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(b){this.handleError(b,mxResources.get("errorLoadingFile"))}}), mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a==App.MODE_DEVICE&&Graph.fileSupport&&!mxClient.IS_IE&&!mxClient.IS_IE11){var f=document.createElement("input");f.setAttribute("type","file");mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if(null!=f.files)for(var a=0;aa.indexOf("."),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,c,f,null==this.mode,b)})):null!= c&&this.save(a,f))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,d,this.isOffline()?null:"https://support.draw.io/questions/9338901",!0);this.showDialog(a.container,440,380,!0,!0);a.init()}}}; App.prototype.createFile=function(a,c,f,d,b,e,g){d=null!=d?d:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){c=null!=c?c:this.emptyDiagramXml;var k=mxUtils.bind(this,function(){this.spinner.stop()}),l=mxUtils.bind(this,function(a){k();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});d==App.MODE_GOOGLE&&null!=this.drive?(g=null!=this.stateArg?this.stateArg.folderId:g,this.drive.insertFile(a,c,g,mxUtils.bind(this, function(a){k();this.fileCreated(a,f,e,b)}),l)):d==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(a,c,mxUtils.bind(this,function(a){k();this.fileCreated(a,f,e,b)}),l):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(a,c,mxUtils.bind(this,function(a){k();this.fileCreated(a,f,e,b)}),l,!1,g):d==App.MODE_BROWSER?(k(),d=mxUtils.bind(this,function(){var d=new StorageFile(this,c,a);d.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(d,f,e,b)}),l)}),null==localStorage.getItem(a)? d():this.confirm(mxResources.get("replaceIt",[a]),d,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))):(k(),this.fileCreated(new LocalFile(this,c,a),f,e,b))}}; App.prototype.fileCreated=function(a,c,f,d){var b=window.location.pathname;null!=c&&0=screen.height&&"undefined"!==typeof this.toggleElement.click&&window.setTimeout(mxUtils.bind(this,function(){this.toggleElement.click()}),0))}}; App.prototype.toggleCompactMode=function(a){!a&&"none"==this.appIcon.style.display?(this.menubar.container.style.position="absolute",this.menubar.container.style.paddingLeft="52px",this.menubar.container.style.paddingTop="",this.menubar.container.style.paddingBottom="",this.menubar.container.style.top="29px",this.toolbar.container.style.paddingLeft="56px",this.buttonContainer.style.visibility="visible",this.appIcon.style.display="block",this.fnameWrapper.style.display="block",this.fnameWrapper.style.visibility= "visible",this.menubarHeight=App.prototype.menubarHeight,this.refresh(),this.toggleElement.style.backgroundImage="url('"+this.chevronUpImage+"')"):(this.menubar.container.style.position="relative",this.menubar.container.style.paddingLeft="4px",this.menubar.container.style.paddingTop="0px",this.menubar.container.style.paddingBottom="0px",this.menubar.container.style.top="0px",this.toolbar.container.style.paddingLeft="4px",this.buttonContainer.style.visibility="hidden",this.appIcon.style.display="none", this.fnameWrapper.style.display="none",this.fnameWrapper.style.visibility="hidden",this.menubarHeight=EditorUi.prototype.menubarHeight,this.refresh(),this.toggleElement.style.backgroundImage="url('"+this.chevronDownImage+"')")}; App.prototype.updateUserElement=function(){if((null==this.drive||null==this.drive.getUser())&&(null==this.oneDrive||null==this.oneDrive.getUser())&&(null==this.dropbox||null==this.dropbox.getUser()))null!=this.userElement&&(this.userElement.parentNode.removeChild(this.userElement),this.userElement=null);else{null==this.userElement&&(this.userElement=document.createElement("a"),this.userElement.setAttribute("href","javascript:void(0);"),this.userElement.className="geItem",this.userElement.style.position= "absolute",this.userElement.style.fontSize="8pt",this.userElement.style.top="4px",this.userElement.style.right="30px",this.userElement.style.color="#666",this.userElement.style.margin="4px",this.userElement.style.padding="2px",this.userElement.style.paddingRight="16px",this.userElement.style.verticalAlign="middle",this.userElement.style.backgroundImage="url("+IMAGE_PATH+"/expanded.gif)",this.userElement.style.backgroundPosition="100% 60%",this.userElement.style.backgroundRepeat="no-repeat",this.menubarContainer.appendChild(this.userElement), mxEvent.addListener(this.userElement,"click",mxUtils.bind(this,function(a){if(null==this.userPanel){var f=document.createElement("div");f.className="geDialog";f.style.position="absolute";f.style.top=this.userElement.clientTop+this.userElement.clientHeight+6+"px";f.style.right="36px";f.style.padding="0px";this.userPanel=f}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var d=!1;this.userPanel.innerHTML="";f=document.createElement("img");f.setAttribute("src", Dialog.prototype.closeImage);f.setAttribute("title",mxResources.get("close"));f.className="geDialogClose";f.style.top="8px";f.style.right="8px";mxEvent.addListener(f,"click",mxUtils.bind(this,function(){null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)}));this.userPanel.appendChild(f);null!=this.drive&&(f=this.drive.getUser(),null!=f&&(d=!0,this.userPanel.innerHTML+='\x3ctable title\x3d"User ID: '+f.id+'" style\x3d"font-size:10pt;padding:20px 20px 10px 10px;"\x3e\x3ctr\x3e\x3ctd valign\x3d"top"\x3e'+ (null!=f.pictureUrl?'\x3cimg style\x3d"margin-right:10px;border-radius:50%;" src\x3d"'+f.pictureUrl+'"/\x3e':'\x3cimg style\x3d"margin-right:4px;margin-top:2px;" src\x3d"'+this.defaultUserPicture+'"/\x3e')+'\x3c/td\x3e\x3ctd valign\x3d"top" style\x3d"white-space:nowrap;'+(null!=f.pictureUrl?"padding-top:14px;":"")+'"\x3e\x3cb\x3e'+mxUtils.htmlEntities(f.displayName)+"\x3c/b\x3e\x3cbr\x3e\x3csmall\x3e"+mxUtils.htmlEntities(f.email)+"\x3c/small\x3e\x3c/tr\x3e\x3c/table\x3e",f=document.createElement("div"), f.style.textAlign="center",f.style.padding="12px",f.style.background="whiteSmoke",f.style.borderTop="1px solid #e0e0e0",f.style.whiteSpace="nowrap",f.appendChild(mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile?this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("signOut"));this.diagramContainer.style.display="none";this.formatContainer.style.display= "none";this.hsplit.style.display="none";this.sidebarContainer.style.display="none";this.sidebarFooterContainer.style.display="none";null!=this.tabContainer&&(this.tabContainer.style.display="none");a.close();window.setTimeout(mxUtils.bind(this,function(){this.showDialog=function(){};window.location.hash="";this.drive.clearUserId();gapi.auth.signOut();window.location.reload()}),null!=a&&a.constructor==DriveFile?2E3:0)})):(this.drive.clearUserId(),this.drive.setUser(null),gapi.auth.signOut())}))),this.userPanel.appendChild(f))); f=mxUtils.bind(this,function(a,c,f){null!=a&&(d&&this.userPanel.appendChild(document.createElement("hr")),d=!0,this.userPanel.innerHTML+='\x3ctable style\x3d"font-size:10pt;padding:20px 20px 10px 10px;"\x3e\x3ctr\x3e\x3ctd valign\x3d"top"\x3e'+(null!=c?'\x3cimg style\x3d"margin-right:10px;" src\x3d"'+c+'" width\x3d"40" height\x3d"40"/\x3e\x3c/td\x3e':"")+'\x3ctd valign\x3d"middle" style\x3d"white-space:nowrap;"\x3e\x3cb\x3e'+mxUtils.htmlEntities(a.displayName)+"\x3c/b\x3e"+(null!=a.email?'\x3cbr\x3e\x3cfont color\x3d"gray"\x3e'+ mxUtils.htmlEntities(a.email)+"\x3c/font\x3e\x3c/td\x3e":"")+"\x3c/tr\x3e\x3c/table\x3e",a=document.createElement("div"),a.style.textAlign="center",a.style.padding="12px",a.style.background="whiteSmoke",a.style.borderTop="1px solid #e0e0e0",a.style.whiteSpace="nowrap",null!=f&&a.appendChild(mxUtils.button(mxResources.get("signOut"),f)),this.userPanel.appendChild(a))});null!=this.dropbox&&f(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",mxUtils.bind(this,function(){var a=this.getCurrentFile(); if(null!=a&&a.constructor==DropboxFile){var c=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});a.isModified()?this.confirm(mxResources.get("allChangesLost"),c):c()}else this.dropbox.logout()}));null!=this.oneDrive&&f(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.constructor==OneDriveFile){var c=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});a.isModified()?this.confirm(mxResources.get("allChangesLost"), c):c()}else this.oneDrive.logout()}));d||(f=document.createElement("div"),f.style.textAlign="center",f.style.padding="20px 20px 10px 10px",f.innerHTML=mxResources.get("notConnected"),this.userPanel.appendChild(f));document.body.appendChild(this.userPanel)}mxEvent.consume(a)})),mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(a){!mxEvent.isConsumed(a)&&(null!=this.userPanel&&null!=this.userPanel.parentNode)&&this.userPanel.parentNode.removeChild(this.userPanel)})));var a=null;null!= this.drive&&null!=this.drive.getUser()?a=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?a=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()&&(a=this.dropbox.getUser());null!=a?(this.userElement.innerHTML="",mxUtils.write(this.userElement,a.displayName),this.userElement.style.display="block"):this.userElement.style.display="none"}};(function(){var a=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){a.apply(this,arguments);this.div.style.overflowY="auto";this.div.style.overflowX="hidden";var c=Math.max(document.body.clientHeight,document.documentElement.clientHeight);this.div.style.maxHeight=c-10+"px"};Menus.prototype.addLinkToItem=function(a,c){if(null!=a){var b=document.createElement("span");b.setAttribute("title",mxResources.get("help"));b.style.cssText="color:blue;text-decoration:underline;margin-left:12px;cursor:help;"; var e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("valign","bottom");e.setAttribute("src",Editor.helpImage);b.appendChild(e);mxEvent.addGestureListeners(b,mxUtils.bind(this,function(a){this.editorUi.menubar.hideMenu();window.open(c);mxEvent.consume(a)}));a.firstChild.nextSibling.appendChild(b)}};var c=Menus.prototype.init;Menus.prototype.init=function(){c.apply(this,arguments);var a=this.editorUi,d=a.editor.graph,b=mxUtils.bind(d,d.isEnabled),e=("1"!=urlParams.embed&& "0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),g=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9navigator.userAgent.indexOf("MSIE")||10<=document.documentMode);a.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container, 360,null!=a.pages&&1=a.pages.length,c=document.createElement("div");c.style.padding="6px";var e=document.createElement("input");e.style.marginRight="8px";e.setAttribute("type","checkbox");d.isSelectionEmpty()&&e.setAttribute("disabled","disabled");c.appendChild(e);mxUtils.write(c,mxResources.get("selectionOnly"));var g= document.createElement("input");g.setAttribute("type","checkbox");g.setAttribute("checked","checked");g.defaultChecked=!0;g.style.marginRight="8px";g.style.marginTop="16px";mxUtils.br(c);c.appendChild(g);b?mxUtils.write(c,mxResources.get("compressed")):(mxUtils.write(c,mxResources.get("allPages")),mxEvent.addListener(e,"change",function(){e.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")}));c=new CustomDialog(a,c,mxUtils.bind(this,function(){a.downloadFile("xml",b?!g.checked: null,null,!e.checked,!b?!g.checked:null)}),null,mxResources.get("export"));a.showDialog(c.container,300,120,!0,!0)}),c);b.addItem(mxResources.get("url")+"...",null,mxUtils.bind(this,function(){a.showPublishLinkDialog(mxResources.get("url"),!0,null,null,function(b,c,d,e){b=new EmbedDialog(a,a.createLink(b,c,d,e,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}),c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+ "...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(b,c){function l(b){if(b&&Graph.fileSupport&&!mxClient.IS_IE&&!mxClient.IS_IE11){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",function(){null!=c.files&&a.importFiles(c.files,null,null,a.maxImageSize)});c.click()}else{window.openNew=!1;window.openKey="import";var e=Editor.useLocalStorage;Editor.useLocalStorage= !b;window.openFile=new OpenFile(function(b){a.hideDialog(b)});window.openFile.setConsumer(function(b,c){d.setSelectionCells(a.importXml(b))});a.showDialog((new OpenDialog(a)).container,360,220,!0,!0,function(){window.openFile=null});var g=a.dialog,k=g.close;a.dialog.close=function(b){Editor.useLocalStorage=e;k.apply(g,arguments);b&&(null==a.getCurrentFile()&&"1"!=urlParams.embed)&&a.showSplash()}}}function m(b){b.pickFile(function(c){if(a.spinner.spin(document.body,mxResources.get("loading")))if(b== a.dropbox){var d=/(\.png)$/i.test(c)?"image/png":"text/xml";a.loadUrl(c,function(a){n(a,d,c)},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},"image/png"==d)}else b.getFile(c,function(a){var b=/(\.png)$/i.test(a.getTitle())?"image/png":"text/xml";n(a.getData(),b,a.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},!0)},!0)}var n=mxUtils.bind(this,function(b,c,e){"image/png"==c?a.loadImage(b,mxUtils.bind(this,function(g){a.resizeImage(g, b,mxUtils.bind(this,function(g,k,l){g=Math.min(1,Math.min(a.maxImageSize/k,a.maxImageSize/l));a.importFile(b,c,0,0,Math.round(k*g),Math.round(l*g),e,function(b){a.spinner.stop();d.setSelectionCells(b)})}),!0)})):a.importFile(b,c,0,0,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b)})});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){m(a.drive)},c):e&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+ "...)",null,function(){},c,null,!1));null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){m(a.dropbox)},c):g&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){m(a.oneDrive)},c):k&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+ "...",null,function(){l(!1)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){l(!0)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0this.tabContainer.clientWidth-f){null!=d&&(d.style.position="absolute",d.style.right="0px",c.style.marginRight="30px");var g=this.createControlTab(4,"\x26nbsp;\x26#10094;\x26nbsp;");g.style.position="absolute";g.style.right=this.editor.chromeless?"29px":"55px";g.style.fontSize="13pt";this.tabContainer.appendChild(g);var k=this.createControlTab(4,"\x26nbsp;\x26#10095;");k.style.position="absolute"; k.style.right=this.editor.chromeless?"0px":"29px";k.style.fontSize="13pt";this.tabContainer.appendChild(k);var l=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));c.style.width=l+"px";mxEvent.addListener(g,"click",mxUtils.bind(this,function(a){c.scrollLeft-=Math.max(20,l-20);mxUtils.setOpacity(g,0