/* * GoJS v1.8.26 JavaScript Library for HTML Diagrams * Northwoods Software, https://www.nwoods.com/ * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation. * Copyright (C) 1998-2018 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.8.26/license.html. */ (function(window) { var g,ca={};if(!window.document||void 0===window.document.createElement("canvas").getContext)throw window.console&&window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."),Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");if(!Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript"); Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return f.apply(a,e.concat(d.call(arguments)))}function c(){}var d=Array.prototype.slice,e=d.call(arguments,1),f=this;c.prototype=this.prototype;b.prototype=new c;return b}); (function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c=a.length?a.push(c):a.splice(b,0,c):w.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Ig:function(a, b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):w.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},Ny:[],K:function(){var a=w.Ny.pop();return void 0===a?new y:a},xb:function(a,b){var c=w.Ny.pop();if(void 0===c)return new y(a,b);c.x=a;c.y=b;return c},v:function(a){w.Ny.push(a)},dC:[],sm:function(){var a=w.dC.pop();return void 0===a?new ia:a},Kk:function(a){w.dC.push(a)},Oy:[],vf:function(){var a=w.Oy.pop();return void 0===a?new B:a},kg:function(a,b,c,d){var e=w.Oy.pop(); if(void 0===e)return new B(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},Bb:function(a){w.Oy.push(a)},eC:[],Vg:function(){var a=w.eC.pop();return void 0===a?new ka:a},bf:function(a){w.eC.push(a)},Py:null,s:function(){var a=w.Py;return null!==a?(w.Py=null,a):new la},q:function(a){a.reset();w.Py=a},My:[],gb:function(){var a=w.My.pop();return void 0===a?[]:a},ta:function(a){a.length=0;w.My.push(a)},jo:Object.freeze([]),vm:1,nc:function(a){a.__gohashid=w.vm++},Yp:function(a){var b=a.__gohashid; void 0===b&&(b=w.vm++,a.__gohashid=b);return b},Pd:function(a){return a.__gohashid},ga:function(a,b){b.Zy=a;ca[a]=b},La:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},ni:function(a){a.dH=!0},defineProperty:function(a,b,c,d,e){w.j(a,"function","Util.defineProperty:classfunc");w.j(b,"object","Util.defineProperty:propobj");w.j(c,"function","Util.defineProperty:getter");w.j(d,"function","Util.defineProperty:setter");for(var f in b){b=b[f];c={get:c,set:d, enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,f,c);e=Object.getOwnPropertyDescriptor(a.prototype,f);b&&e&&Object.defineProperty(a.prototype,b,e);break}},dK:!1,u:function(a,b,c,d){w.j(a,"function","Util.defineReadOnlyProperty:classfunc");w.j(b,"object","Util.defineReadOnlyProperty:propobj");w.j(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var f=b[e];b={get:c,set:function(a){w.k('The property "'+f+'" is read-only and cannot be set to '+ a)},enumerable:!0};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);f&&d&&Object.defineProperty(a.prototype,f,d);break}},ae:function(a,b){for(var c in b)b[c]=!0;a.prototype.$G=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?w.pf(a):null===a?"*":""},pf:function(a){if("function"===typeof a){if(a.Zy)return a.Zy;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9, c).trim();if(""!==b)return a.Zy=b}else if(w.Pa(a)&&a.constructor)return w.pf(a.constructor);return typeof a},p:function(a,b,c){w.j(a,"function","Util.defineEnumValue:classfunc");w.j(b,"string","Util.defineEnumValue:name");w.j(c,"number","Util.defineEnumValue:num");c=new da(a,b,c);Object.freeze(c);a[b]=c;var d=a.hv;d instanceof ma||(d=new ma("string",da),a.hv=d);d.add(b,c);return c},vb:function(a,b){if(!a||!b)return null;var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute? (c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c},Ma:function(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){}},Xu:function(a,b){w.j(a,"object","Setting properties requires Objects as arguments");w.j(b,"object","Setting properties requires Objects as arguments");var c=a instanceof C,d=a instanceof E,e;for(e in b){""===e&&w.k("Setting properties requires non-empty property names");var f=a,h=e;if(c||d){var k= e.indexOf(".");if(0c;c++)b[c]=c;for(var d=0,e=0,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;for(var d=c=0,f="",h=0;hc;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);for(var d=[],e=0,c=0;cd;d++)b[w.Jg("7ca11abfd7330390")](w.Jg(c[d-1]),10,15*d+0);b[w.Jg("7ca11abfd022028846")]=w.Jg("39f046ebb36e4b");for(d=1;5>d;d++)b[w.Jg("7ca11abfd7330390")](w.Jg(c[d- 1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])w.p=function(a,b){var c=new da(a,b,2);Object.freeze(c);a[b]=c;var d=a.hv;d instanceof ma||(d=new ma("string",da),a.hv=d);d.add(b,c);return c};return a}();function da(a,b,c){w.nc(this);this.sC=a;this.Sb=b;this.hH=c}w.ga("EnumValue",da);da.prototype.toString=function(){return w.pf(this.sC)+"."+this.Sb};w.u(da,{Je:"classType"},function(){return this.sC});w.u(da,{name:"name"},function(){return this.Sb});w.u(da,{value:"value"},function(){return this.hH}); var pa;da.findName=pa=function(a,b){if(void 0===b||null===b||""===b)return null;w.j(a,"function","findName:classfunc");w.j(b,"string","EnumValue.findName:name");var c=a.hv;return c instanceof ma?c.ka(b):null};function qa(){this.qC=[]}qa.prototype.toString=function(){return this.qC.join("")};qa.prototype.add=function(a){""!==a&&this.qC.push(a)};function ra(){} function sa(a){void 0===a&&(a=42);this.seed=a;this.Iy=48271;this.gv=2147483647;this.cC=this.gv/this.Iy;this.PG=this.gv%this.Iy;this.OG=1/this.gv;this.random()}sa.prototype.random=function(){var a=this.seed%this.cC*this.Iy-this.seed/this.cC*this.PG;this.seed=0this.key)return!1;w.Na(a)}var a=a.n,b=a.length,c=++this.zc,d=this.$h;if(null!==d)for(;cthis.key)return!1;w.Na(a)}var b=--this.zc;if(0<=b)return this.key=b,this.value=a.n[b],!0;this.Nf();return!1};Aa.prototype.hasNext=function(){return this.next()}; Aa.prototype.first=Aa.prototype.first=function(){var a=this.Ac;this.Ta=a.F;var b=a.n;this.zc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Aa.prototype.any=function(a){var b=this.Ac;b.Ti=null;var c=b.F,d=b.n,e=d.length;this.zc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.F!==c&&w.Na(b)}return!1};Aa.prototype.all=function(a){var b=this.Ac;b.Ti=null;var c=b.F,d=b.n,e=d.length;this.zc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.F!==c&&w.Na(b)}return!0}; Aa.prototype.each=function(a){var b=this.Ac;b.Ti=null;var c=b.F,d=b.n,e=d.length;this.zc=e;for(e-=1;0<=e;e--)a(d[e]),b.F!==c&&w.Na(b);return this};Aa.prototype.map=function(a){var b=this.Ac;b.Ti=null;var c=b.F,d=[],e=b.n,f=e.length;this.zc=f;for(f-=1;0<=f;f--)d.push(a(e[f])),b.F!==c&&w.Na(b);a=new H;a.n=d;a.Lc();return a.i}; Aa.prototype.filter=function(a){var b=this.Ac;b.Ti=null;var c=b.F,d=[],e=b.n,f=e.length;this.zc=f;for(f-=1;0<=f;f--){var h=e[f];a(h)&&d.push(h);b.F!==c&&w.Na(b)}a=new H(b.na);a.n=d;a.Lc();return a.i};Aa.prototype.concat=function(a){this.Ac.Ti=null;return new xa(this,a.i)};w.u(Aa,{count:"count"},function(){return this.Ac.n.length});Aa.prototype.Nf=function(){this.key=-1;this.value=null;this.Ta=-1;this.Ac.Ti=this}; Aa.prototype.toString=function(){return"ListIteratorBackwards("+this.zc+"/"+this.Ac.count+")"}; function H(a){w.nc(this);this.P=!1;this.n=[];this.F=0;this.Ti=this.Gb=null;void 0===a||null===a?this.na=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.na=a:w.Fa(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.na=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:w.Fa(a,"null, a primitive type name, or a class type", "List constructor: type")}w.ga("List",H);H.prototype.Lc=function(){var a=this.F;a++;999999999a||a>=b.length)&&w.Fa(a,"0 <= i < length",H,"elt:i");return b[a]};H.prototype.get=H.prototype.get=function(a){return this.ea(a)};H.prototype.setElt=H.prototype.jg=function(a,b){var c=this.n;(0>a||a>=c.length)&&w.Fa(a,"0 <= i < length",H,"setElt:i");this.P&&w.ma(this,a);c[a]=b};H.prototype.set=H.prototype.set=function(a,b){this.jg(a,b)}; H.prototype.first=H.prototype.first=function(){var a=this.n;return 0===a.length?null:a[0]};H.prototype.last=H.prototype.ie=function(){var a=this.n,b=a.length;return 0a&&w.Fa(a,">= 0",H,"insertAt:i");this.P&&w.ma(this,a);var c=this.n;a>=c.length?c.push(b):c.splice(a,0,b);this.Lc();return!0}; H.prototype.remove=H.prototype["delete"]=H.prototype.remove=function(a){if(null===a)return!1;this.P&&w.ma(this,a);var b=this.n;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Lc();return!0};H.prototype.removeAt=H.prototype.dd=function(a){var b=this.n;(0>a||a>=b.length)&&w.Fa(a,"0 <= i < length",H,"removeAt:i");this.P&&w.ma(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Lc()}; H.prototype.removeRange=H.prototype.removeRange=function(a,b){var c=this.n,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.P&&w.ma(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&w.Fa(b,"0 <= from < length",H,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(f=d.slice(0,c),f.sort(a),a=0;a=e)for(f=d.slice(b),f.sort(a),a=b;a=this.n.length)return ua;var a=this.Gb;return null!==a?(a.reset(),a):new za(this)}); w.u(H,{Jn:"iteratorBackwards"},function(){if(0>=this.n.length)return ua;var a=this.Ti;return null!==a?(a.reset(),a):new Aa(this)});function Ba(a){this.bi=a;a.Gb=null;this.Ta=a.F;this.Wa=null}w.ae(Ba,{key:!0,value:!0});w.u(Ba,{i:"iterator"},function(){return this});Ba.prototype.reset=Ba.prototype.reset=function(){var a=this.bi;a.Gb=null;this.Ta=a.F;this.Wa=null}; Ba.prototype.next=Ba.prototype.next=function(){var a=this.bi;if(a.F!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Wa,b=null===b?a.Ea:b.Za;if(null!==b)return this.Wa=b,this.value=b.value,this.key=b.key,!0;this.Nf();return!1};Ba.prototype.hasNext=function(){return this.next()};Ba.prototype.first=Ba.prototype.first=function(){var a=this.bi;this.Ta=a.F;a=a.Ea;if(null!==a){this.Wa=a;var b=a.value;this.key=a.key;return this.value=b}return null}; Ba.prototype.any=function(a){var b=this.bi;b.Gb=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;){if(a(d.value))return!0;b.F!==c&&w.Na(b);d=d.Za}return!1};Ba.prototype.all=function(a){var b=this.bi;b.Gb=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;){if(!a(d.value))return!1;b.F!==c&&w.Na(b);d=d.Za}return!0};Ba.prototype.each=function(a){var b=this.bi;b.Gb=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;)a(d.value),b.F!==c&&w.Na(b),d=d.Za;return this}; Ba.prototype.map=function(a){var b=this.bi;b.Gb=null;for(var c=new H,d=b.F,e=b.Ea;null!==e;)c.add(a(e.value)),b.F!==d&&w.Na(b),e=e.Za;return c.i};Ba.prototype.filter=function(a){var b=this.bi;b.Gb=null;for(var c=new H(b.na),d=b.F,e=b.Ea;null!==e;){var f=e.value;a(f)&&c.add(f);b.F!==d&&w.Na(b);e=e.Za}return c.i};Ba.prototype.concat=function(a){this.bi.Gb=null;return new xa(this,a.i)};w.u(Ba,{count:"count"},function(){return this.bi.rd}); Ba.prototype.Nf=function(){this.value=this.key=null;this.Ta=-1;this.bi.Gb=this};Ba.prototype.toString=function(){return null!==this.Wa?"SetIterator@"+this.Wa.value:"SetIterator"}; function I(a){w.nc(this);this.P=!1;void 0===a||null===a?this.na=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.na=a:w.Fa(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.na=a===Object?"object":a===String?"string":a===Number?"number":a:w.Fa(a,"null, a primitive type name, or a class type","Set constructor: type");this.sd={};this.rd=0;this.Gb=null;this.F=0;this.Uh=this.Ea=null}w.ga("Set",I); I.prototype.Lc=function(){var a=this.F;a++;999999999=this.rd)return ua;var a=this.Gb;return null!==a?(a.reset(),a):new Ba(this)});function Da(a){this.Ga=a;this.Ta=a.F;this.Wa=null}w.ae(Da,{key:!0,value:!0});w.u(Da,{i:"iterator"},function(){return this});Da.prototype.reset=Da.prototype.reset=function(){this.Ta=this.Ga.F;this.Wa=null}; Da.prototype.next=Da.prototype.next=function(){var a=this.Ga;if(a.F!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Wa,b=null===b?a.Ea:b.Za;if(null!==b)return this.Wa=b,this.value=this.key=a=b.key,!0;this.Nf();return!1};Da.prototype.hasNext=function(){return this.next()};Da.prototype.first=Da.prototype.first=function(){var a=this.Ga;this.Ta=a.F;a=a.Ea;return null!==a?(this.Wa=a,this.value=this.key=a=a.key):null}; Da.prototype.any=function(a){var b=this.Ga,c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;){if(a(d.key))return!0;b.F!==c&&w.Na(b);d=d.Za}return!1};Da.prototype.all=function(a){var b=this.Ga,c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;){if(!a(d.key))return!1;b.F!==c&&w.Na(b);d=d.Za}return!0};Da.prototype.each=function(a){var b=this.Ga,c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;)a(d.key),b.F!==c&&w.Na(b),d=d.Za;return this}; Da.prototype.map=function(a){var b=this.Ga,c=b.F;this.Wa=null;for(var d=new H,e=b.Ea;null!==e;)d.add(a(e.key)),b.F!==c&&w.Na(b),e=e.Za;return d.i};Da.prototype.filter=function(a){var b=this.Ga,c=b.F;this.Wa=null;for(var d=new H(b.Th),e=b.Ea;null!==e;){var f=e.key;a(f)&&d.add(f);b.F!==c&&w.Na(b);e=e.Za}return d.i};Da.prototype.concat=function(a){return new xa(this,a.i)};w.u(Da,{count:"count"},function(){return this.Ga.rd});Da.prototype.Nf=function(){this.value=this.key=null;this.Ta=-1}; Da.prototype.toString=function(){return null!==this.Wa?"MapKeySetIterator@"+this.Wa.value:"MapKeySetIterator"};function Ea(a){w.nc(this);this.P=!0;this.Ga=a}w.La(Ea,I);Ea.prototype.freeze=function(){return this};Ea.prototype.Qa=function(){return this};Ea.prototype.toString=function(){return"MapKeySet("+this.Ga.toString()+")"};Ea.prototype.add=Ea.prototype.add=function(){w.k("This Set is read-only: "+this.toString());return!1}; Ea.prototype.set=Ea.prototype.set=function(){w.k("This Set is read-only: "+this.toString());return!1};Ea.prototype.contains=Ea.prototype.contains=function(a){return this.Ga.contains(a)};Ea.prototype.has=Ea.prototype.has=function(a){return this.contains(a)};Ea.prototype.remove=Ea.prototype["delete"]=Ea.prototype.remove=function(){w.k("This Set is read-only: "+this.toString());return!1};Ea.prototype.clear=Ea.prototype.clear=function(){w.k("This Set is read-only: "+this.toString())}; Ea.prototype.first=Ea.prototype.first=function(){var a=this.Ga.Ea;return null!==a?a.key:null};Ea.prototype.any=function(a){for(var b=this.Ga.Ea;null!==b;){if(a(b.key))return!0;b=b.Za}return!1};Ea.prototype.all=function(a){for(var b=this.Ga.Ea;null!==b;){if(!a(b.key))return!1;b=b.Za}return!0};Ea.prototype.each=function(a){for(var b=this.Ga.Ea;null!==b;)a(b.key),b=b.Za;return this};Ea.prototype.map=function(a){for(var b=new I,c=this.Ga.Ea;null!==c;)b.add(a(c.key)),c=c.Za;return b}; Ea.prototype.filter=function(a){for(var b=new I(this.Ga.Th),c=this.Ga.Ea;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Za}return b};Ea.prototype.concat=function(a){return this.EG().Oc(a)};Ea.prototype.copy=function(){return new Ea(this.Ga)};Ea.prototype.toSet=Ea.prototype.EG=function(){var a=new I(this.Ga.Th),b=this.Ga.sd,c;for(c in b)a.add(b[c].key);return a};Ea.prototype.toArray=Ea.prototype.xc=function(){var a=this.Ga.sd,b=Array(this.Ga.rd),c=0,d;for(d in a)b[c]=a[d].key,c++;return b}; Ea.prototype.toList=function(){var a=new H(this.Ga.Th),b=this.Ga.sd,c;for(c in b)a.add(b[c].key);return a};w.u(Ea,{count:"count"},function(){return this.Ga.rd});w.u(Ea,{size:"size"},function(){return this.Ga.rd});w.u(Ea,{i:"iterator"},function(){return 0>=this.Ga.rd?ua:new Da(this.Ga)});function Fa(a){this.Ga=a;a.fh=null;this.Ta=a.F;this.Wa=null}w.ae(Fa,{key:!0,value:!0});w.u(Fa,{i:"iterator"},function(){return this}); Fa.prototype.reset=Fa.prototype.reset=function(){var a=this.Ga;a.fh=null;this.Ta=a.F;this.Wa=null};Fa.prototype.next=Fa.prototype.next=function(){var a=this.Ga;if(a.F!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Wa,b=null===b?a.Ea:b.Za;if(null!==b)return this.Wa=b,this.value=b.value,this.key=b.key,!0;this.Nf();return!1};Fa.prototype.hasNext=function(){return this.next()}; Fa.prototype.first=Fa.prototype.first=function(){var a=this.Ga;this.Ta=a.F;a=a.Ea;if(null!==a){this.Wa=a;var b=a.value;this.key=a.key;return this.value=b}return null};Fa.prototype.any=function(a){var b=this.Ga;b.fh=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;){if(a(d.value))return!0;b.F!==c&&w.Na(b);d=d.Za}return!1};Fa.prototype.all=function(a){var b=this.Ga;b.fh=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;){if(!a(d.value))return!1;b.F!==c&&w.Na(b);d=d.Za}return!0}; Fa.prototype.each=function(a){var b=this.Ga;b.fh=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;)a(d.value),b.F!==c&&w.Na(b),d=d.Za;return this};Fa.prototype.map=function(a){var b=this.Ga;b.fh=null;var c=b.F;this.Wa=null;for(var d=new H,e=b.Ea;null!==e;)d.add(a(e.value)),b.F!==c&&w.Na(b),e=e.Za;return d.i};Fa.prototype.filter=function(a){var b=this.Ga;b.fh=null;var c=b.F;this.Wa=null;for(var d=new H(b.Th),e=b.Ea;null!==e;){var f=e.value;a(f)&&d.add(f);b.F!==c&&w.Na(b);e=e.Za}return d.i}; Fa.prototype.concat=function(a){this.Ga.fh=null;return new xa(this,a.i)};w.u(Fa,{count:"count"},function(){return this.Ga.rd});Fa.prototype.Nf=function(){this.value=this.key=null;this.Ta=-1;this.Ga.fh=this};Fa.prototype.toString=function(){return null!==this.Wa?"MapValueSetIterator@"+this.Wa.value:"MapValueSetIterator"};function Ca(a,b){this.key=a;this.value=b;this.hp=this.Za=null}w.ae(Ca,{key:!0,value:!0});Ca.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; function Ha(a){this.Ga=a;a.Gb=null;this.Ta=a.F;this.Wa=null}w.ae(Ha,{key:!0,value:!0});w.u(Ha,{i:"iterator"},function(){return this});Ha.prototype.reset=Ha.prototype.reset=function(){var a=this.Ga;a.Gb=null;this.Ta=a.F;this.Wa=null};Ha.prototype.next=Ha.prototype.next=function(){var a=this.Ga;if(a.F!==this.Ta){if(null===this.key)return!1;w.Na(a)}var b=this.Wa,b=null===b?a.Ea:b.Za;if(null!==b)return this.Wa=b,this.key=b.key,this.value=b.value,!0;this.Nf();return!1};Ha.prototype.hasNext=function(){return this.next()}; Ha.prototype.first=Ha.prototype.first=function(){var a=this.Ga;this.Ta=a.F;a=a.Ea;return null!==a?(this.Wa=a,this.key=a.key,this.value=a.value,a):null};Ha.prototype.any=function(a){var b=this.Ga;b.Gb=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;){if(a(d))return!0;b.F!==c&&w.Na(b);d=d.Za}return!1};Ha.prototype.all=function(a){var b=this.Ga;b.Gb=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;){if(!a(d))return!1;b.F!==c&&w.Na(b);d=d.Za}return!0}; Ha.prototype.each=function(a){var b=this.Ga;b.Gb=null;var c=b.F;this.Wa=null;for(var d=b.Ea;null!==d;)a(d),b.F!==c&&w.Na(b),d=d.Za;return this};Ha.prototype.map=function(a){var b=this.Ga;b.Gb=null;var c=b.F;this.Wa=null;for(var d=new H,e=b.Ea;null!==e;)d.add(a(e)),b.F!==c&&w.Na(b),e=e.Za;return d.i};Ha.prototype.filter=function(a){var b=this.Ga;b.Gb=null;var c=b.F;this.Wa=null;for(var d=new H,e=b.Ea;null!==e;)a(e)&&d.add(e),b.F!==c&&w.Na(b),e=e.Za;return d.i}; Ha.prototype.concat=function(a){this.Ga.Gb=null;return new xa(this,a.i)};w.u(Ha,{count:"count"},function(){return this.Ga.rd});Ha.prototype.Nf=function(){this.value=this.key=null;this.Ta=-1;this.Ga.Gb=this};Ha.prototype.toString=function(){return null!==this.Wa?"MapIterator@"+this.Wa:"MapIterator"}; function ma(a,b){w.nc(this);this.P=!1;void 0===a||null===a?this.Th=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.Th=a:w.Fa(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.Th=a===Object?"object":a===String?"string":a===Number?"number":a:w.Fa(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.Ft=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"=== b||"function"===b?this.Ft=b:w.Fa(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.Ft=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:w.Fa(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.sd={};this.rd=0;this.fh=this.Gb=null;this.F=0;this.Uh=this.Ea=null}w.ga("Map",ma); ma.prototype.Lc=function(){var a=this.F;a++;999999999=this.count)return ua;var a=this.Gb;return null!==a?(a.reset(),a):new Ha(this)});w.u(ma,{JF:"iteratorKeys"},function(){return 0>=this.count?ua:new Da(this)});w.u(ma,{KF:"iteratorValues"},function(){if(0>=this.count)return ua;var a=this.fh;return null!==a?(a.reset(),a):new Fa(this)});function y(a,b){void 0===a?this.y=this.x=0:(this.x=a,this.y=b)}w.ga("Point",y); w.ni(y);w.ae(y,{x:!0,y:!0});y.prototype.assign=function(a){this.x=a.x;this.y=a.y};y.prototype.setTo=y.prototype.m=function(a,b){this.x=a;this.y=b;return this};y.prototype.set=y.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};y.prototype.copy=function(){var a=new y;a.x=this.x;a.y=this.y;return a};y.prototype.Ha=function(){Object.freeze(this);return this};y.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};y.prototype.freeze=function(){return this}; y.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};y.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new y(c,e)}return new y};y.stringify=function(a){return a.x.toString()+" "+a.y.toString()};y.prototype.toString=function(){return"Point("+this.x+","+this.y+")"}; y.prototype.equals=y.prototype.L=function(a){return a instanceof y?this.x===a.x&&this.y===a.y:!1};y.prototype.equalTo=y.prototype.Ax=function(a,b){return this.x===a&&this.y===b};y.prototype.equalsApprox=y.prototype.Pc=function(a){return J(this.x,a.x)&&J(this.y,a.y)};y.prototype.add=y.prototype.add=function(a){this.x+=a.x;this.y+=a.y;return this};y.prototype.subtract=y.prototype.ui=function(a){this.x-=a.x;this.y-=a.y;return this}; y.prototype.offset=y.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};y.prototype.rotate=y.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.x=d*b-e*c;this.y=e*b+d*c;return this};y.prototype.scale=y.prototype.scale=function(a,b){this.x*=a;this.y*=b;return this}; y.prototype.distanceSquaredPoint=y.prototype.Cf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};y.prototype.distanceSquared=y.prototype.Tp=function(a,b){var c=a-this.x,d=b-this.y;return c*c+d*d};y.prototype.normalize=y.prototype.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}y.prototype.projectOntoLineSegment=function(a,b,c,d){La(a,b,c,d,this.x,this.y,this);return this};y.prototype.projectOntoLineSegmentPoint=function(a,b){La(a.x,a.y,b.x,b.y,this.x,this.y,this);return this}; y.prototype.snapToGrid=function(a,b,c,d){Na(this.x,this.y,a,b,c,d,this);return this};y.prototype.snapToGridPoint=function(a,b){Na(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};y.prototype.setRectSpot=y.prototype.Zn=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};y.prototype.setSpot=y.prototype.Zu=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};y.prototype.transform=function(a){a.nb(this);return this}; function Pa(a,b){b.wh(a);return a}var Ra;y.distanceLineSegmentSquared=Ra=function(a,b,c,d,e,f){var h=e-c,k=f-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=f-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var Sa;y.distanceSquared=Sa=function(a,b,c,d){a=c-a;b=d-b;return a*a+b*b};var Ta; y.direction=Ta=function(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d};y.prototype.isReal=y.prototype.I=function(){return isFinite(this.x)&&isFinite(this.y)};function ia(a,b){void 0===a?this.height=this.width=0:(this.width=a,this.height=b)}w.ga("Size",ia);w.ni(ia);w.ae(ia,{width:!0,height:!0}); ia.prototype.assign=function(a){this.width=a.width;this.height=a.height};ia.prototype.setTo=ia.prototype.m=function(a,b){this.width=a;this.height=b;return this};ia.prototype.set=ia.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};ia.prototype.copy=function(){var a=new ia;a.width=this.width;a.height=this.height;return a};ia.prototype.Ha=function(){Object.freeze(this);return this};ia.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()}; ia.prototype.freeze=function(){return this};ia.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};ia.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new ia(c,e)}return new ia};ia.stringify=function(a){return a.width.toString()+" "+a.height.toString()}; ia.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};ia.prototype.equals=ia.prototype.L=function(a){return a instanceof ia?this.width===a.width&&this.height===a.height:!1};ia.prototype.equalTo=ia.prototype.Ax=function(a,b){return this.width===a&&this.height===b};ia.prototype.equalsApprox=ia.prototype.Pc=function(a){return J(this.width,a.width)&&J(this.height,a.height)};ia.prototype.isReal=ia.prototype.I=function(){return isFinite(this.width)&&isFinite(this.height)}; function B(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof y?b instanceof y?(this.x=Math.min(a.x,b.x),this.y=Math.min(a.y,b.y),this.width=Math.abs(a.x-b.x),this.height=Math.abs(a.y-b.y)):b instanceof ia?(this.x=a.x,this.y=a.y,this.width=b.width,this.height=b.height):w.k("Incorrect arguments supplied to Rect constructor"):(this.x=a,this.y=b,this.width=c,this.height=d)}w.ga("Rect",B);w.ni(B);w.ae(B,{x:!0,y:!0,width:!0,height:!0}); B.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height};function Ua(a,b,c){a.width=b;a.height=c}B.prototype.setTo=B.prototype.m=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};B.prototype.set=B.prototype.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};B.prototype.setPoint=B.prototype.Ug=function(a){this.x=a.x;this.y=a.y;return this}; B.prototype.setSize=function(a){this.width=a.width;this.height=a.height;return this};B.prototype.copy=function(){var a=new B;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};B.prototype.Ha=function(){Object.freeze(this);return this};B.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};B.prototype.freeze=function(){return this};B.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this}; B.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new B(c,e,f,h)}return new B};B.stringify=function(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}; B.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};B.prototype.equals=B.prototype.L=function(a){return a instanceof B?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};B.prototype.equalTo=B.prototype.Ax=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};B.prototype.equalsApprox=B.prototype.Pc=function(a){return J(this.x,a.x)&&J(this.y,a.y)&&J(this.width,a.width)&&J(this.height,a.height)}; function Va(a,b){return Wa(a.x,b.x)&&Wa(a.y,b.y)&&Wa(a.width,b.width)&&Wa(a.height,b.height)}B.prototype.containsPoint=B.prototype.Ia=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};B.prototype.containsRect=B.prototype.Ek=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height}; B.prototype.contains=B.prototype.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};B.prototype.reset=function(){this.height=this.width=this.y=this.x=0};B.prototype.offset=B.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};B.prototype.inflate=B.prototype.Yf=function(a,b){return Xa(this,b,a,b,a)};B.prototype.addMargin=B.prototype.ax=function(a){return Xa(this,a.top,a.right,a.bottom,a.left)}; B.prototype.subtractMargin=B.prototype.zG=function(a){return Xa(this,-a.top,-a.right,-a.bottom,-a.left)};B.prototype.grow=function(a,b,c,d){return Xa(this,a,b,c,d)};function Xa(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}B.prototype.intersectRect=function(a){return Ya(this,a.x,a.y,a.width,a.height)};B.prototype.intersect=B.prototype.uF=function(a,b,c,d){return Ya(this,a,b,c,d)}; function Ya(a,b,c,d,e){var f=Math.max(a.x,b),h=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=h;a.width=Math.max(0,b-f);a.height=Math.max(0,c-h);return a}B.prototype.intersectsRect=B.prototype.Zf=function(a){return this.vF(a.x,a.y,a.width,a.height)}; B.prototype.intersects=B.prototype.vF=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};function $a(a,b){var c=a.width,d=b.width+10+10,e=a.x,f=b.x-10;if(e>d+f||f>c+e)return!1;c=a.height;d=b.height+10+10;e=a.y;f=b.y-10;return e>d+f||f>c+e?!1:!0}B.prototype.unionPoint=B.prototype.yi=function(a){return ab(this,a.x,a.y,0,0)}; B.prototype.unionRect=B.prototype.Jh=function(a){return ab(this,a.x,a.y,a.width,a.height)};B.prototype.union=B.prototype.IG=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return ab(this,a,b,c,d)};function ab(a,b,c,d,e){var f=Math.min(a.x,b),h=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=h;a.width=b-f;a.height=c-h;return a}B.prototype.setSpot=B.prototype.Zu=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this}; var db;B.contains=db=function(a,b,c,d,e,f,h,k){void 0===h&&(h=0);void 0===k&&(k=0);return a<=e&&e+h<=a+c&&b<=f&&f+k<=b+d};B.intersects=function(a,b,c,d,e,f,h,k){c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=f;return b>k||f>a?!1:!0};w.defineProperty(B,{left:"left"},function(){return this.x},function(a){this.x=a});w.defineProperty(B,{top:"top"},function(){return this.y},function(a){this.y=a});w.defineProperty(B,{right:"right"},function(){return this.x+this.width},function(a){this.x+=a-(this.x+this.width)}); w.defineProperty(B,{bottom:"bottom"},function(){return this.y+this.height},function(a){this.y+=a-(this.y+this.height)});w.defineProperty(B,{position:"position"},function(){return new y(this.x,this.y)},function(a){this.x=a.x;this.y=a.y});w.defineProperty(B,{size:"size"},function(){return new ia(this.width,this.height)},function(a){this.width=a.width;this.height=a.height}); w.defineProperty(B,{Tl:"center"},function(){return new y(this.x+this.width/2,this.y+this.height/2)},function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2});w.defineProperty(B,{la:"centerX"},function(){return this.x+this.width/2},function(a){this.x=a-this.width/2});w.defineProperty(B,{ra:"centerY"},function(){return this.y+this.height/2},function(a){this.y=a-this.height/2});B.prototype.isReal=B.prototype.I=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)}; B.prototype.isEmpty=function(){return 0===this.width&&0===this.height};function hb(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):w.k("Invalid arguments to Margin constructor")}w.ga("Margin",hb);w.ni(hb);w.ae(hb,{top:!0,right:!0,bottom:!0,left:!0}); hb.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left};hb.prototype.setTo=hb.prototype.m=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};hb.prototype.set=hb.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};hb.prototype.copy=function(){var a=new hb;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a}; hb.prototype.Ha=function(){Object.freeze(this);return this};hb.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};hb.prototype.freeze=function(){return this};hb.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this}; hb.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new hb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new hb(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new hb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new hb(c,e):new hb(c,e,f,h)}return new hb}; hb.stringify=function(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()};hb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};hb.prototype.equals=hb.prototype.L=function(a){return a instanceof hb?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1}; hb.prototype.equalTo=hb.prototype.Ax=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};hb.prototype.equalsApprox=hb.prototype.Pc=function(a){return J(this.top,a.top)&&J(this.right,a.right)&&J(this.bottom,a.bottom)&&J(this.left,a.left)};hb.prototype.isReal=hb.prototype.I=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function ka(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}w.ni(ka); w.ae(ka,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});ka.prototype.set=ka.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};ka.prototype.copy=function(){var a=new ka;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};ka.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}; ka.prototype.equals=ka.prototype.L=function(a){return a instanceof ka?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};ka.prototype.isIdentity=ka.prototype.vu=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};ka.prototype.reset=ka.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this}; ka.prototype.multiply=ka.prototype.multiply=function(a){var b=this.m12*a.m11+this.m22*a.m12,c=this.m11*a.m21+this.m21*a.m22,d=this.m12*a.m21+this.m22*a.m22,e=this.m11*a.dx+this.m21*a.dy+this.dx,f=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=this.m11*a.m11+this.m21*a.m12;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; ka.prototype.multiplyInverted=ka.prototype.SF=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;f=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=f;this.dy=h;return this}; ka.prototype.invert=ka.prototype.SA=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this}; ka.prototype.rotate=ka.prototype.rotate=function(a,b,c){360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);var d=0,e=0;90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(e=a*Math.PI/180,d=Math.cos(e),e=Math.sin(e));a=this.m12*d+this.m22*e;var f=this.m11*-e+this.m21*d,h=this.m12*-e+this.m22*d;this.m11=this.m11*d+this.m21*e;this.m12=a;this.m21=f;this.m22=h;this.translate(-b,-c);return this}; ka.prototype.translate=ka.prototype.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};ka.prototype.scale=ka.prototype.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};ka.prototype.transformPoint=ka.prototype.nb=function(a){var b=a.x,c=a.y;a.x=b*this.m11+c*this.m21+this.dx;a.y=b*this.m12+c*this.m22+this.dy;return a}; ka.prototype.invertedTransformPoint=ka.prototype.wh=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=-this.m12*b,d=this.m11*b,e=b*(this.m12*this.dx-this.m11*this.dy),f=a.x,h=a.y;a.x=f*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.y=f*c+h*d+e;return a}; ka.prototype.transformRect=ka.prototype.HG=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*f+c*k+m,q=b*h+c*l+n,r=d*f+c*k+m,c=d*h+c*l+n,s=b*f+e*k+m,b=b*h+e*l+n,f=d*f+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,f),e=Math.max(e,f),h=Math.min(h,d),q=Math.max(q,d);a.x=p;a.y=h;a.width=e-p;a.height=q-h;return a}; function L(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d)}w.ga("Spot",L);w.ni(L);w.ae(L,{x:!0,y:!0,offsetX:!0,offsetY:!0});L.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY};L.prototype.setTo=L.prototype.m=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this}; L.prototype.set=L.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};L.prototype.copy=function(){var a=new L;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};L.prototype.Ha=function(){Object.freeze(this);return this};L.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};L.prototype.freeze=function(){return this}; L.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};function ib(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a}var xb; L.parse=xb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return yb;if("TopLeft"===a)return zb;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Bb;if("TopRight"===a)return Cb;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Hb;if("Center"===a)return Jb;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Kb;if("BottomLeft"===a)return Qb;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Rb;if("BottomRight"===a)return Sb;if("TopSide"===a)return Xb;if("LeftSide"=== a)return Yb;if("RightSide"===a)return Zb;if("BottomSide"===a)return $b;if("TopBottomSides"===a)return ac;if("LeftRightSides"===a)return bc;if("TopLeftSides"===a)return ec;if("TopRightSides"===a)return fc;if("BottomLeftSides"===a)return gc;if("BottomRightSides"===a)return hc;if("NotTopSide"===a)return ic;if("NotLeftSide"===a)return jc;if("NotRightSide"===a)return nc;if("NotBottomSide"===a)return oc;if("AllSides"===a)return pc;if("Default"===a)return qc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0d&&(d=d%h+h);d>h-1E-6?(this.path.push(["A",c,c,0,1,p,a-k,b-l]),this.path.push(["A",c,c,0,1,p,m,n])):1E-6=Math.PI),p,a+c*Math.cos(e),b+c*Math.sin(e)])};g.beginPath=function(){this.path=[]}; g.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};g.clearRect=function(){};g.clip=function(){Rc(this,"clipPath",this.path,new Kc)};g.closePath=function(){this.path.push(["z"])};g.createLinearGradient=function(a,b,c,d){var e=new Nc("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};g.createPattern=function(){return null};g.createRadialGradient=function(a,b,c,d,e,f){var h=new Nc("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=f;return h}; g.drawImage=function(a,b,c,d,e,f,h,k,l){var m="";a instanceof HTMLCanvasElement&&(m=a.toDataURL());a instanceof HTMLImageElement&&(m=a.src);void 0===d&&(f=b,h=c,k=d=a.naturalWidth,l=e=a.naturalHeight);d=d||0;e=e||0;f=f||0;h=h||0;k=k||0;l=l||0;m={x:0,y:0,width:a.naturalWidth,height:a.naturalHeight,href:m,preserveAspectRatio:"xMidYMid slice"};Wa(d,k)&&Wa(e,l)||(m.preserveAspectRatio="none");var n="";k/=d;l/=e;if(0!==f||0!==h)n+=" translate("+f+", "+h+")";if(1!==k||1!==l)n+=" scale("+k+", "+l+")";if(0!== b||0!==c)n+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==a.naturalWidth||e!==a.naturalHeight)a="CLIP"+w.vm++,f=Pc(this,"clipPath",{id:a}),f.appendChild(Pc(this,"rect",{x:b,y:c,width:d,height:e})),this.qm.appendChild(f),m["clip-path"]="url(#"+a+")";Sc(this,"image",m,this.uh,n);this.addElement("image",m)};g.fill=function(){Rc(this,"fill",this.path,this.uh)};g.Kg=function(){this.Lp?this.clip():this.fill()};g.fillRect=function(a,b,c,d){Tc(this,"fill",[a,b,c,d],this.uh)}; g.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};Sc(this,"fill",b,this.uh);this.addElement("text",b,a[0])};g.lineTo=function(a,b){this.path.push(["L",a,b])};g.moveTo=function(a,b){this.path.push(["M",a,b])};g.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};g.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])}; g.restore=function(){this.uh=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.Kn=a.Kn;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign}; g.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,Kn:this.Kn,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;bb.offset?1:-1});for(k=0;kb?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.ar?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.ar?this.clip():this.fill()}; g.Kj=function(){this.ar||this.stroke()};w.defineProperty(Wc,{Lp:"clipInsteadOfFill"},function(){return this.ar},function(a){this.ar=a});g=Wc.prototype;g.IB=function(a,b,c){this.nt=a;this.ot=b;this.Dg=c};g.om=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};g.ao=function(){this.shadowOffsetX=this.nt;this.shadowOffsetY=this.ot;this.shadowBlur=this.Dg}; g.yx=function(a,b){var c=this.ua;if(void 0!==c.setLineDash)c.setLineDash(a),c.lineDashOffset=b;else if(void 0!==c.webkitLineDash)c.webkitLineDash=a,c.webkitLineDashOffset=b;else return!1;return!0};g.vx=function(){var a=this.ua;void 0!==a.setLineDash?(a.setLineDash(w.jo),a.lineDashOffset=0):void 0!==a.webkitLineDash&&(a.webkitLineDash=w.jo,a.webkitLineDashOffset=0)};g.Ke=function(a){a&&(this.Xy="");this.Wy=this.Yy=""}; var bd=(Math.sqrt(2)-1)/3*4,cd=(new y(0,0)).Ha(),dd=(new B(0,0,0,0)).Ha(),ed=(new hb(0,0,0,0)).Ha(),fd=(new hb(2,2,2,2)).Ha(),nd=(new y(6,6)).Ha(),od=(new y(-Infinity,-Infinity)).Ha(),pd=(new y(Infinity,Infinity)).Ha(),qd=(new ia(0,0)).Ha(),rd=(new ia(1,1)).Ha(),sd=(new ia(6,6)).Ha(),Bd=(new ia(8,8)).Ha(),Cd=(new ia(10,10)).Ha(),Dd=(new ia(Infinity,Infinity)).Ha(),Ed=(new y(NaN,NaN)).Ha(),Fd=(new ia(NaN,NaN)).Ha(),Gd=(new B(NaN,NaN,NaN,NaN)).Ha(),Nd=(new L(.156,.156)).Ha(),Od=(new L(.844,.844)).Ha(), Pd=new ra,Qd=new ra,Rd=null;function Sd(a){if(0>=a)return 0;var b=Rd;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);Rd=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)}function J(a,b){var c=a-b;return.5>c&&-.5c&&-5E-8=e&&(e=1E-6);var k=0,l=0,m=0,n=0;am-n)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=h&&h<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(h=(c-a)/(d-b)*(h-b)+a,h-e<=f&&f<=h+e)return!0}else return!0;return!1} function Ud(a,b,c,d,e,f,h,k,l,m,n,p){if(Td(a,b,h,k,p,c,d)&&Td(a,b,h,k,p,e,f))return Td(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,u=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(q+s)/2;c=(r+u)/2;var s=(s+e)/2,u=(u+f)/2,t=(d+s)/2,x=(c+u)/2;return Ud(a,b,q,r,d,c,t,x,l,m,n,p)||Ud(t,x,s,u,e,f,h,k,l,m,n,p)} function Vd(a,b,c,d,e,f,h,k,l,m){if(Td(a,b,h,k,l,c,d)&&Td(a,b,h,k,l,e,f))ab(m,a,b,0,0),ab(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Vd(a,b,n,p,d,c,s,u,l,m);Vd(s,u,q,r,e,f,h,k,l,m)}} function Wd(a,b,c,d,e,f,h,k,l,m){if(Td(a,b,h,k,l,c,d)&&Td(a,b,h,k,l,e,f))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(k);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Wd(a,b,n,p,d,c,s,u,l,m);Wd(s,u,q,r,e,f,h,k,l,m)}} function Xd(a,b,c,d,e,f,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+f*l;e=e*s+h*l;f=f*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+f*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=f}function ee(a,b,c,d,e,f,h,k,l,m){if(Td(a,b,e,f,m,c,d))return Td(a,b,e,f,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var q=(n+c)/2,r=(p+d)/2;return ee(a,b,n,p,q,r,h,k,l,m)||ee(q,r,c,d,e,f,h,k,l,m)} function fe(a,b,c,d,e,f,h,k){if(Td(a,b,e,f,h,c,d))ab(k,a,b,0,0),ab(k,e,f,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;fe(a,b,l,m,n,p,h,k);fe(n,p,c,d,e,f,h,k)}}function ge(a,b,c,d,e,f,h,k){if(Td(a,b,e,f,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(f);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;ge(a,b,l,m,n,p,h,k);ge(n,p,c,d,e,f,h,k)}} function he(a,b,c,d,e,f,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(Td(a,b,h,k,q,c,d)&&Td(a,b,h,k,q,e,f)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(h=l=0,bh)return!1}else if(ah)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,u=(b+d)/2;c=(c+e)/2;d=(d+f)/2;e=(e+h)/2;f=(f+k)/2;var t=(s+c)/2,x=(u+d)/2;c=(c+e)/2;d=(d+f)/2;var v=(t+c)/2,z=(x+d)/2, A=(n-l)*(n-l)+(p-m)*(p-m),K=!1;he(a,b,s,u,t,x,v,z,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b=q&&(q=1E-6);if(Td(a,b,h,k,q,c,d)&&Td(a,b,h,k,q,e,f)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,u=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(a=l=0,ba)return r}else if(aa)return r;0q&&r--}else{var s=(a+c)/2,u=(b+d)/2,t=(c+e)/2,x=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(s+t)/2;c=(u+x)/2;var t=(t+e)/2,x=(x+f)/2, v=(d+t)/2,z=(c+x)/2,r=r+ie(a,b,s,u,d,c,v,z,l,m,n,p,q),r=r+ie(v,z,t,x,e,f,h,k,l,m,n,p,q)}return r} function La(a,b,c,d,e,f,h){if(Wa(a,c)){var k=0;c=0;bc)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(Wa(b,d)){ac)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005c)return l.x=a,l.y=c,!1;l.x=a;l.y=f;return!0}h=(d-b)/(c-a);if(Wa(k,h))return La(a,b,c,d,e,f,l),!1;e=(h*a-k*e+f-b)/(h-k);if(Wa(h,0)){ac)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}f= h*(e-a)+b;return La(a,b,c,d,e,f,l)}function ke(a,b,c,d,e,f,h,k,l){var m=1E21,n=a,p=b;if(je(a,b,a,d,e,f,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f);qm} function le(a,b,c,d,e,f,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(f-k)/m,h=a,n=k*h+(f-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(f-k)/m,a=b-d*a,h=(f-k*e-a)/(d-k),n=d*h+a);l.m(h,n);return l} function me(a,b,c){var d=b.x,e=b.y,f=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===f?(f=a=0,e=m):e===h?(d=k):a.Ia(b)||a.Ia(c)||ne(k,m,l,m,d,e,f,h)||ne(l,m,l,n,d,e,f,h)||ne(l,n,k,n,d,e,f,h)||ne(k,n,k,m,d,e,f,h)?!0:!1}function ne(a,b,c,d,e,f,h,k){return 0>=oe(a,b,c,d,e,f)*oe(a,b,c,d,h,k)&&0>=oe(e,f,h,k,a,b)*oe(e,f,h,k,c,d)} function oe(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0f&&(f=0)));return 0>f?-1:0a&&(a+=360);360<=a&&(a-=360);return a} function ye(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);var f=b>c?-1:1;d=[];var h=e/2,k=b;c=Math.min(2*e,Math.abs(c-b));if(1E-5>c)return b=k+f*Math.min(c,h),f=0+a*Math.cos(k),k=0+a*Math.sin(k),h=0+a*Math.cos(b),a=0+a*Math.sin(b),b=(f+h)/2,c=(k+a)/2,d.push([f,k,b,c,b,c,h,a]),d;for(;1E-5c,f=0>d,h=0,k=h=0;af;++f){m=.5*(d+e);if(m===d||m===e)break;k=l/(m+b);h=c/(m+a);k=k*k+h*h-1;if(0k)e=m;else break}n=b*n/(m+b)-n;p=a*p/(m+a)-p;a=Math.sqrt(n*n+p*p)}else a=Math.abs(p-m);else p=l*l-m*m,a=l*n,aa?"M"+this.ha.toString()+" "+this.fa.toString()+"L"+this.C.toString()+" "+this.D.toString():"M"+this.ha.toFixed(a)+" "+this.fa.toFixed(a)+"L"+this.C.toFixed(a)+" "+this.D.toFixed(a);case Ge:var b=new B(this.ha,this.fa,0,0);b.IG(this.C,this.D,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+ "V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case He:b=new B(this.ha,this.fa,0,0);b.IG(this.C,this.D,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/ 2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case Ce:for(var b="",c=this.fc.n,d=c.length,e=0;e=K-1?!0:null!==l[t+1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)}function d(){t++;return l[t]}function e(){var a=new y(parseFloat(d()),parseFloat(d()));x===x.toLowerCase()&&(a.x=A.x+a.x,a.y=A.y+a.y);return a}function f(){return A=e()}function h(){return z=e()}function k(){return"c"!==v.toLowerCase()&&"s"!==v.toLowerCase()?A:new y(2*A.x-z.x,2*A.y-z.y)}void 0===b&&(b=!1);"string"!==typeof a&&w.Gd(a,"string",Be,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");for(var l=a.split(" "),m=0;m=K-1);)if(v=x,x=d(),""!==x)switch(x.toUpperCase()){case "X":s=!0;r=q=!1;break;case "M":m=f();null===p.Yb||!0===s?(M(p,m.x,m.y,q,!1,!r),s=!1):p.moveTo(m.x,m.y);for(n=A;!c();)m=f(),p.lineTo(m.x,m.y);break;case "L":for(;!c();)m= f(),p.lineTo(m.x,m.y);break;case "H":for(;!c();)A=m=new y((x===x.toLowerCase()?A.x:0)+parseFloat(d()),A.y),p.lineTo(A.x,A.y);break;case "V":for(;!c();)A=m=new y(A.x,(x===x.toLowerCase()?A.y:0)+parseFloat(d())),p.lineTo(A.x,A.y);break;case "C":for(;!c();){var u=e(),D=h(),m=f();N(p,u.x,u.y,D.x,D.y,m.x,m.y)}break;case "S":for(;!c();)u=k(),D=h(),m=f(),N(p,u.x,u.y,D.x,D.y,m.x,m.y);break;case "Q":for(;!c();)D=h(),m=f(),Pe(p,D.x,D.y,m.x,m.y);break;case "T":for(;!c();)z=D=k(),m=f(),Pe(p,D.x,D.y,m.x,m.y); break;case "B":for(;!c();){var m=parseFloat(d()),u=parseFloat(d()),D=parseFloat(d()),O=parseFloat(d()),X=parseFloat(d()),S=X,ba=!1;c()||(S=parseFloat(d()),c()||(ba=0!==parseFloat(d())));x===x.toLowerCase()&&(D+=A.x,O+=A.y);p.arcTo(m,u,D,O,X,S,ba)}break;case "A":for(;!c();)u=Math.abs(parseFloat(d())),D=Math.abs(parseFloat(d())),O=parseFloat(d()),X=!!parseFloat(d()),S=!!parseFloat(d()),m=f(),Qe(p,u,D,O,X,S,m.x,m.y);break;case "Z":m=p.o.fc.n[p.o.fc.length-1];P(p);A=n;break;case "F":u="";for(m=1;l[t+ m];)if(null!==l[t+m].match(/[Uu]/))m++;else if(null===l[t+m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))m++;else{u=l[t+m];break}u.match(/[Mm]/)?q=!0:Re(p);break;case "U":u="";for(m=1;l[t+m];)if(null!==l[t+m].match(/[Ff]/))m++;else if(null===l[t+m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))m++;else{u=l[t+m];break}u.match(/[Mm]/)?r=!0:p.eb(!1)}n=p.o;w.q(p);if(b)for(p=n.fc.i;p.next();)m=p.value,m.tu=!0;return n}; function Se(a,b){for(var c=a.length,d=w.K(),e=0;eh&&(h+=360),s.Ae+=h);0>a&&(s.Ae=180-s.Ae,s.uf=-s.uf);0>d&&(s.Ae=-s.Ae,s.uf=-s.uf);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case qf:h=s.C;k=s.D;s.C=h* a+k*c+e;s.D=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Nj+=h);0>a&&(s.Nj=180-s.Nj,s.fm=!s.fm);0>d&&(s.Nj=-s.Nj,s.fm=!s.fm);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:w.k("Unknown Segment type: "+s.type)}}}}this.hb=!0;return this}; Be.prototype.Ia=function(a,b,c,d){var e=a.x,f=a.y,h=this.cb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.fc.n,s=r.length,u=0;u=a)return 0;if((e>h?e-h:h-e)<(f>k?f-k:k-f)){if(e=a=0,fe)return 0}else if(ee)return 0;return 0a?a=0:1=f)return d=(f-h)/p,c=c[k],k=c[2*n],e=c[2*n+1],b.m(k+(c[2*n+2]-k)*d,e+(c[2*n+3]-e)*d),b;h+=p}b.m(NaN,NaN);return b}; Be.prototype.getAngleAlongPath=Be.prototype.hF=function(a){0>a?a=0:1=e)return b=b[h],b=180*Math.atan2(b[2*a+3]-b[2*a+1],b[2*a+2]-b[2*a])/Math.PI;f+=m}}return NaN}; Be.prototype.getFractionForPoint=Be.prototype.cI=function(a){if(this.type===Fe){var b=this.ha,c=this.fa,d=this.C,e=this.D;if(b!==d||c!==e){var f=a.x;a=a.y;var h=0,k=0;return b===d?(c=k?k===c?0:1:Math.abs(a-c)/(k-h)):c===e?(b=k?k===b?0:1:Math.abs(f-b)/(k-h)):((f-b)*(f-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===Ge){if(b=this.ha,c=this.fa,d=this.C,e=this.D,b!==d||c!==e){var h=d-b,k=e-c,l=2*h+2*k,f=a.x; a=a.y;f=Math.min(Math.max(f,b),d);a=Math.min(Math.max(a,c),e);var b=Math.abs(f-b),d=Math.abs(f-d),c=Math.abs(a-c),e=Math.abs(a-e),m=Math.min(b,d,c,e);if(m===c)return f/l;if(m===d)return(h+a)/l;if(m===e)return(2*h+k-f)/l;if(m===b)return(2*h+2*k-a)/l}}else{for(var e=this.Gx,h=this.cu,k=this.du,l=w.K(),c=Infinity,b=d=0,f=e.length,n=m=0,p=0;pa?0:1a?"M"+this.ha.toString()+" "+this.fa.toString():"M"+this.ha.toFixed(a)+" "+this.fa.toFixed(a),c=this.wb.n,d=c.length,e=0;ea&&(a+=360),this.Kd=a,this.Xe=0,this.mh=Math.max(d,0),this.Cg=Math.max(e,0),this.Uo="boolean"===typeof h?!!h:!1,this.qo=!!k):(this.Kd=d,this.Xe=e,a===pf&&(f=Math.max(f,0)),this.mh=f,"number"===typeof h?(a===pf&&(h=Math.max(h,0)),this.Cg=h):this.Cg=0,this.qo=this.Uo=!1);this.Sh=!1;this.hb= !0;this.Kh=null}w.ga("PathSegment",wf);w.ni(wf);wf.prototype.copy=function(){var a=new wf;a.na=this.na;a.zb=this.zb;a.Jb=this.Jb;a.Kd=this.Kd;a.Xe=this.Xe;a.mh=this.mh;a.Cg=this.Cg;a.Uo=this.Uo;a.qo=this.qo;a.Sh=this.Sh;a.hb=this.hb;return a}; wf.prototype.equalsApprox=wf.prototype.Pc=function(a){if(!(a instanceof wf)||this.type!==a.type||this.Kx!==a.Kx)return!1;switch(this.type){case Ue:case Je:return J(this.C,a.C)&&J(this.D,a.D);case Ve:return J(this.C,a.C)&&J(this.D,a.D)&&J(this.wc,a.wc)&&J(this.Sc,a.Sc)&&J(this.Dh,a.Dh)&&J(this.Eh,a.Eh);case We:return J(this.C,a.C)&&J(this.D,a.D)&&J(this.wc,a.wc)&&J(this.Sc,a.Sc);case pf:return J(this.Ae,a.Ae)&&J(this.uf,a.uf)&&J(this.la,a.la)&&J(this.ra,a.ra)&&J(this.radiusX,a.radiusX)&&J(this.radiusY, a.radiusY);case qf:return this.fm===a.fm&&this.Mx===a.Mx&&J(this.Nj,a.Nj)&&J(this.C,a.C)&&J(this.D,a.D)&&J(this.radiusX,a.radiusX)&&J(this.radiusY,a.radiusY);default:return!1}};wf.prototype.gc=function(a){a.Je===wf?this.type=a:w.Lj(this,a)}; wf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case Ue:b=0>a?"M"+this.C.toString()+" "+this.D.toString():"M"+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case Je:b=0>a?"L"+this.C.toString()+" "+this.D.toString():"L"+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case Ve:b=0>a?"C"+this.wc.toString()+" "+this.Sc.toString()+" "+this.Dh.toString()+" "+this.Eh.toString()+" "+this.C.toString()+" "+this.D.toString():"C"+this.wc.toFixed(a)+" "+this.Sc.toFixed(a)+" "+this.Dh.toFixed(a)+ " "+this.Eh.toFixed(a)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case We:b=0>a?"Q"+this.wc.toString()+" "+this.Sc.toString()+" "+this.C.toString()+" "+this.D.toString():"Q"+this.wc.toFixed(a)+" "+this.Sc.toFixed(a)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case pf:b=0>a?"B"+this.Ae.toString()+" "+this.uf.toString()+" "+this.la.toString()+" "+this.ra.toString()+" "+this.radiusX:"B"+this.Ae.toFixed(a)+" "+this.uf.toFixed(a)+" "+this.la.toFixed(a)+" "+this.ra.toFixed(a)+" "+this.radiusX; break;case qf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Nj.toString()+" "+(this.Mx?1:0)+" "+(this.fm?1:0)+" "+this.C.toString()+" "+this.D.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Nj.toFixed(a)+" "+(this.Mx?1:0)+" "+(this.fm?1:0)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;default:b=this.type.toString()}return b+(this.Sh?"z":"")};var Ue;wf.Move=Ue=w.p(wf,"Move",0);var Je;wf.Line=Je=w.p(wf,"Line",1);var Ve; wf.Bezier=Ve=w.p(wf,"Bezier",2);var We;wf.QuadraticBezier=We=w.p(wf,"QuadraticBezier",3);var pf;wf.Arc=pf=w.p(wf,"Arc",4);var qf;wf.SvgArc=qf=w.p(wf,"SvgArc",4);wf.prototype.freeze=function(){this.P=!0;return this};wf.prototype.Qa=function(){this.P=!1;return this};wf.prototype.close=wf.prototype.close=function(){this.Sh=!0;return this}; function rf(a,b){if(null!==a.Kh&&!1===b.hb)return a.Kh;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Kh=[],a.Kh;var e=a.Kd,f=a.Xe,h=ye(c=r?h=Math.PI:1<=r&&(h=0);!l&&0h&&(h+=2*Math.PI);l=b>f?1:b/f;r=b>f?f/b:1;b=ye(b>f?b:f,n,n+h,!0);f=w.Vg();f.reset();f.translate(c,d);f.rotate(a.Kd,0,0);f.scale(l,r);Se(b,f);w.bf(f);a.Kh=b;return a.Kh} w.defineProperty(wf,{Kx:"isClosed"},function(){return this.Sh},function(a){this.Sh!==a&&(this.Sh=a,this.hb=!0)});w.defineProperty(wf,{type:"type"},function(){return this.na},function(a){this.P&&w.ma(this,a);this.na=a;this.hb=!0});w.defineProperty(wf,{C:"endX"},function(){return this.zb},function(a){this.P&&w.ma(this,a);this.zb=a;this.hb=!0});w.defineProperty(wf,{D:"endY"},function(){return this.Jb},function(a){this.P&&w.ma(this,a);this.Jb=a;this.hb=!0}); w.defineProperty(wf,{wc:"point1X"},function(){return this.Kd},function(a){this.P&&w.ma(this,a);this.Kd=a;this.hb=!0});w.defineProperty(wf,{Sc:"point1Y"},function(){return this.Xe},function(a){this.P&&w.ma(this,a);this.Xe=a;this.hb=!0});w.defineProperty(wf,{Dh:"point2X"},function(){return this.mh},function(a){this.P&&w.ma(this,a);this.mh=a;this.hb=!0});w.defineProperty(wf,{Eh:"point2Y"},function(){return this.Cg},function(a){this.P&&w.ma(this,a);this.Cg=a;this.hb=!0}); w.defineProperty(wf,{la:"centerX"},function(){return this.Kd},function(a){this.P&&w.ma(this,a);this.Kd=a;this.hb=!0});w.defineProperty(wf,{ra:"centerY"},function(){return this.Xe},function(a){this.P&&w.ma(this,a);this.Xe=a;this.hb=!0});w.defineProperty(wf,{radiusX:"radiusX"},function(){return this.mh},function(a){0>a&&w.Fa(a,">= zero",wf,"radiusX");this.P&&w.ma(this,a);this.mh=a;this.hb=!0}); w.defineProperty(wf,{radiusY:"radiusY"},function(){return this.Cg},function(a){0>a&&w.Fa(a,">= zero",wf,"radiusY");this.P&&w.ma(this,a);this.Cg=a;this.hb=!0});w.defineProperty(wf,{Ae:"startAngle"},function(){return this.zb},function(a){this.zb!==a&&(this.P&&w.ma(this,a),a%=360,0>a&&(a+=360),this.zb=a,this.hb=!0)});w.defineProperty(wf,{uf:"sweepAngle"},function(){return this.Jb},function(a){this.P&&w.ma(this,a);360a&&(a=-360);this.Jb=a;this.hb=!0}); w.defineProperty(wf,{fm:"isClockwiseArc"},function(){return this.qo},function(a){this.P&&w.ma(this,a);this.qo=a;this.hb=!0});w.defineProperty(wf,{Mx:"isLargeArc"},function(){return this.Uo},function(a){this.P&&w.ma(this,a);this.Uo=a;this.hb=!0});w.defineProperty(wf,{Nj:"xAxisRotation"},function(){return this.Kd},function(a){a%=360;0>a&&(a+=360);this.P&&w.ma(this,a);this.Kd=a;this.hb=!0}); function yf(){this.aa=null;this.dA=(new y(0,0)).freeze();this.jz=(new y(0,0)).freeze();this.uv=this.rw=0;this.vv=1;this.fw="";this.Vw=this.Iv=!1;this.Gv=this.wv=0;this.Qj=this.Rv=this.bw=!1;this.Er=null;this.Tw=0;this.Fg=this.Sw=null}w.ga("InputEvent",yf); yf.prototype.copy=function(){var a=new yf;a.aa=this.aa;a.dA.assign(this.Ce);a.jz.assign(this.da);a.rw=this.rw;a.uv=this.uv;a.vv=this.vv;a.fw=this.fw;a.Iv=this.Iv;a.Vw=this.Vw;a.wv=this.wv;a.Gv=this.Gv;a.bw=this.bw;a.Rv=this.Rv;a.Qj=this.Qj;a.Er=this.Er;a.Tw=this.Tw;a.Sw=this.Sw;a.Fg=this.Fg;return a}; yf.prototype.toString=function(){var a="^";0!==this.md&&(a+="M:"+this.md);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.te&&(a+="C:"+this.te);0!==this.oi&&(a+="D:"+this.oi);this.tc&&(a+="h");this.bubbles&&(a+="b");null!==this.da&&(a+="@"+this.da.toString());return a};w.defineProperty(yf,{g:"diagram"},function(){return this.aa},function(a){this.aa=a});w.defineProperty(yf,{Ce:"viewPoint"},function(){return this.dA},function(a){w.G(a,y,yf,"viewPoint");this.dA.assign(a)}); w.defineProperty(yf,{da:"documentPoint"},function(){return this.jz},function(a){w.G(a,y,yf,"documentPoint");this.jz.assign(a)});yf.prototype.getMultiTouchViewPoint=yf.prototype.Hx=function(a,b){var c=this.g;if(null===c)return b;zf(c,this.event,a,b);return b};yf.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;zf(c,this.event,a,b);b.assign(c.SB(b));return b};w.defineProperty(yf,{md:"modifiers"},function(){return this.rw},function(a){this.rw=a}); w.defineProperty(yf,{button:"button"},function(){return this.uv},function(a){this.uv=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});w.defineProperty(yf,{buttons:"buttons"},function(){return this.vv},function(a){this.vv=a});w.defineProperty(yf,{key:"key"},function(){return this.fw},function(a){this.fw=a});w.defineProperty(yf,{Gk:"down"},function(){return this.Iv},function(a){this.Iv=a}); w.defineProperty(yf,{up:"up"},function(){return this.Vw},function(a){this.Vw=a});w.defineProperty(yf,{te:"clickCount"},function(){return this.wv},function(a){this.wv=a});w.defineProperty(yf,{oi:"delta"},function(){return this.Gv},function(a){this.Gv=a});w.defineProperty(yf,{wu:"isMultiTouch"},function(){return this.bw},function(a){this.bw=a});w.defineProperty(yf,{tc:"handled"},function(){return this.Rv},function(a){this.Rv=a}); w.defineProperty(yf,{bubbles:"bubbles"},function(){return this.Qj},function(a){this.Qj=a});w.defineProperty(yf,{event:"event"},function(){return this.Er},function(a){this.Er=a});w.u(yf,{Aj:"isTouchEvent"},function(){var a=window.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=window.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)});w.u(yf,{yh:"isMac"},function(){return w.yh}); w.defineProperty(yf,{timestamp:"timestamp"},function(){return this.Tw},function(a){this.Tw=a});w.defineProperty(yf,{Jf:"targetDiagram"},function(){return this.Sw},function(a){this.Sw=a});w.defineProperty(yf,{Be:"targetObject"},function(){return this.Fg},function(a){this.Fg=a});w.defineProperty(yf,{control:"control"},function(){return 0!==(this.md&1)},function(a){this.md=a?this.md|1:this.md&-2}); w.defineProperty(yf,{shift:"shift"},function(){return 0!==(this.md&4)},function(a){this.md=a?this.md|4:this.md&-5});w.defineProperty(yf,{alt:"alt"},function(){return 0!==(this.md&2)},function(a){this.md=a?this.md|2:this.md&-3});w.defineProperty(yf,{Fu:"meta"},function(){return 0!==(this.md&8)},function(a){this.md=a?this.md|8:this.md&-9}); w.defineProperty(yf,{left:"left"},function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&1):0===this.button},function(a){this.buttons=a?this.buttons|1:this.buttons&-2}); w.defineProperty(yf,{right:"right"},function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&2):2===this.button},function(a){this.buttons=a?this.buttons|2:this.buttons&-3}); w.defineProperty(yf,{xL:"middle"},function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&4):1===this.button},function(a){this.buttons=a?this.buttons|4:this.buttons&-5});function Af(){this.aa=null;this.Sb="";this.zw=this.Qw=null;this.Yq=!1}w.ga("DiagramEvent",Af);Af.prototype.copy=function(){var a=new Af;a.aa=this.aa;a.Sb=this.Sb;a.Qw=this.Qw;a.zw=this.zw;a.Yq=this.Yq;return a}; Af.prototype.toString=function(){var a="*"+this.name;null!==this.KB&&(a+=":"+this.KB.toString());null!==this.nB&&(a+="("+this.nB.toString()+")");return a};w.defineProperty(Af,{g:"diagram"},function(){return this.aa},function(a){this.aa=a});w.defineProperty(Af,{name:"name"},function(){return this.Sb},function(a){this.Sb=a});w.defineProperty(Af,{KB:"subject"},function(){return this.Qw},function(a){this.Qw=a});w.defineProperty(Af,{nB:"parameter"},function(){return this.zw},function(a){this.zw=a}); w.defineProperty(Af,{cancel:"cancel"},function(){return this.Yq},function(a){this.Yq!==a&&w.Ut("DiagramEvent.cancel","2.0");this.Yq=a});function Bf(){this.Zq=Cf;this.Ym=this.qw="";this.Ds=this.Es=this.Js=this.Ks=this.Hs=this.aa=this.qe=null}w.ga("ChangedEvent",Bf);var Df;Bf.Transaction=Df=w.p(Bf,"Transaction",-1);var Cf;Bf.Property=Cf=w.p(Bf,"Property",0);var Ef;Bf.Insert=Ef=w.p(Bf,"Insert",1);var Ff;Bf.Remove=Ff=w.p(Bf,"Remove",2); Bf.prototype.clear=Bf.prototype.clear=function(){this.Ds=this.Es=this.Js=this.Ks=this.Hs=this.aa=this.qe=null};Bf.prototype.copy=function(){var a=new Bf;a.Zq=this.Zq;a.qw=this.qw;a.Ym=this.Ym;a.qe=this.qe;a.aa=this.aa;a.Hs=this.Hs;var b=this.Ks;a.Ks=w.Pa(b)&&"function"===typeof b.S?b.S():b;b=this.Js;a.Js=w.Pa(b)&&"function"===typeof b.S?b.S():b;b=this.Es;a.Es=w.Pa(b)&&"function"===typeof b.S?b.S():b;b=this.Ds;a.Ds=w.Pa(b)&&"function"===typeof b.S?b.S():b;return a}; Bf.prototype.gc=function(a){a.Je===Bf?this.Dc=a:w.Lj(this,a)}; Bf.prototype.toString=function(){var a="",a=this.Dc===Df?a+"* ":this.Dc===Cf?a+(null!==this.$?"!m":"!d"):a+((null!==this.$?"!m":"!d")+this.Dc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.tf&&this.tf!==this.propertyName&&(a+=" "+this.tf);a+=": ";this.Dc===Df?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Qf(this.object)),null!==this.oldValue&&(a+=" old: "+Qf(this.oldValue)),null!==this.Gj&&(a+=" "+this.Gj),null!==this.newValue&&(a+= " new: "+Qf(this.newValue)),null!==this.Fj&&(a+=" "+this.Fj));return a};Bf.prototype.getValue=Bf.prototype.ka=function(a){return a?this.oldValue:this.newValue};Bf.prototype.getParam=function(a){return a?this.Gj:this.Fj};Bf.prototype.canUndo=Bf.prototype.canUndo=function(){return null!==this.$||null!==this.g?!0:!1};Bf.prototype.undo=Bf.prototype.undo=function(){this.canUndo()&&(null!==this.$?this.$.pn(this,!0):null!==this.g&&this.g.pn(this,!0))}; Bf.prototype.canRedo=Bf.prototype.canRedo=function(){return null!==this.$||null!==this.g?!0:!1};Bf.prototype.redo=Bf.prototype.redo=function(){this.canRedo()&&(null!==this.$?this.$.pn(this,!1):null!==this.g&&this.g.pn(this,!1))};w.defineProperty(Bf,{$:"model"},function(){return this.qe},function(a){this.qe=a});w.defineProperty(Bf,{g:"diagram"},function(){return this.aa},function(a){this.aa=a});w.defineProperty(Bf,{Dc:"change"},function(){return this.Zq},function(a){this.Zq=a}); w.defineProperty(Bf,{tf:"modelChange"},function(){return this.qw},function(a){this.qw=a});w.defineProperty(Bf,{propertyName:"propertyName"},function(){return this.Ym},function(a){this.Ym=a});w.u(Bf,{IF:"isTransactionFinished"},function(){return this.Zq===Df&&("CommittedTransaction"===this.Ym||"FinishedUndo"===this.Ym||"FinishedRedo"===this.Ym)});w.defineProperty(Bf,{object:"object"},function(){return this.Hs},function(a){this.Hs=a}); w.defineProperty(Bf,{oldValue:"oldValue"},function(){return this.Ks},function(a){this.Ks=a});w.defineProperty(Bf,{Gj:"oldParam"},function(){return this.Js},function(a){this.Js=a});w.defineProperty(Bf,{newValue:"newValue"},function(){return this.Es},function(a){this.Es=a});w.defineProperty(Bf,{Fj:"newParam"},function(){return this.Ds},function(a){this.Ds=a}); function F(a){1f?b+("\\u000"+a.charCodeAt(d).toString(16)):32>f?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===f?b+"\\u2028":8233===f?b+"\\u2029":b+e}return'"'+b+'"'}; F.prototype.writeJsonValue=F.prototype.fv=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.fv(a.valueOf()):w.isArray(a)?Wf(this,a):w.Pa(a)?Tf(this,a):"function"===typeof a?"null":a.toString()}; function Wf(a,b,c){void 0===c&&(c=!1);var d=w.bb(b);if(0>=d)return"[]";var e=new qa;e.add("[ ");c&&1d)return;w.Ig(a.He,d)}ug(a,"nodeDataArray",Ff,"nodeDataArray",a,b,null,d,null);a.ev(b)} F.prototype.removeNodeDataCollection=function(a){if(w.isArray(a))for(var b=w.bb(a),c=0;cb&&(b=w.bb(a));w.qh(a,b,c);ug(this,"",Ef,"",a,null,c,null,b)};F.prototype.removeArrayItem=F.prototype.aG=function(a,b){void 0===b&&(b=-1);a===this.He&&w.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=w.bb(a)-1);var c=w.Ba(a,b);w.Ig(a,b);ug(this,"",Ff,"",a,c,null,b,null)}; w.defineProperty(F,{Vn:"nodeCategoryProperty"},function(){return this.Tm},function(a){var b=this.Tm;b!==a&&(vg(a,F,"nodeCategoryProperty"),this.Tm=a,this.h("nodeCategoryProperty",b,a))});F.prototype.getCategoryForNodeData=F.prototype.HA=function(a){if(null===a)return"";var b=this.Tm;if(""===b)return"";b=w.vb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""}; F.prototype.setCategoryForNodeData=F.prototype.xy=function(a,b){w.j(b,"string",F,"setCategoryForNodeData:cat");if(null!==a){var c=this.Tm;if(""!==c)if(this.Le(a)){var d=w.vb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),ug(this,"nodeCategory",Cf,c,a,d,b))}else w.Ma(a,c,b)}}; function Q(a,b){F.call(this);2w.Rl(d,a.newValue)&&w.qh(d,c,a.newValue));return}}else if(a.Dc=== Ff){c=a.Gj;if("linkDataArray"===a.tf){d=a.oldValue;w.Pa(d)&&"number"===typeof c&&(e=this.cf(d),b?(this.Vi.add(d),w.Ba(this.kf,c)!==d&&w.qh(this.kf,c,d),void 0!==e&&this.gd.add(e,d)):(this.Vi.remove(d),w.Ba(this.kf,c)===d&&w.Ig(this.kf,c),void 0!==e&&this.gd.remove(e)));return}if("linkLabelKeys"===a.tf){d=this.Mk(a.object);w.isArray(d)&&"number"===typeof c&&(b?0>w.Rl(d,a.newValue)&&w.qh(d,c,a.newValue):(c=w.Rl(d,a.newValue),0<=c&&w.Ig(d,c)));return}}F.prototype.pn.call(this,a,b)}; w.defineProperty(Q,{kA:"archetypeNodeData"},function(){return this.ym},function(a){var b=this.ym;b!==a&&(null!==a&&w.G(a,Object,Q,"archetypeNodeData"),this.ym=a,this.h("archetypeNodeData",b,a))});Q.prototype.Nn=function(a){if(void 0!==a){var b=this.ym;if(null!==b){var c=this.we(a);null===c&&(c=this.copyNodeData(b),w.Ma(c,this.ok,a),this.Ol(c))}return a}}; w.defineProperty(Q,{Ln:"linkFromKeyProperty"},function(){return this.Wh},function(a){var b=this.Wh;b!==a&&(vg(a,Q,"linkFromKeyProperty"),this.Wh=a,this.h("linkFromKeyProperty",b,a))});Q.prototype.getFromKeyForLinkData=Q.prototype.bm=function(a){if(null!==a){var b=this.Wh;if(""!==b&&(b=w.vb(a,b),void 0!==b)){if(wg(b))return b;w.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}}; Q.prototype.setFromKeyForLinkData=Q.prototype.AB=function(a,b){null===b&&(b=void 0);void 0===b||wg(b)||w.Gd(b,"number or string",Q,"setFromKeyForLinkData:key");if(null!==a){var c=this.Wh;if(""!==c)if(b=this.Nn(b),this.th(a)){var d=w.vb(a,c);d!==b&&(Bg(this,d,a),w.Ma(a,c,b),null===this.we(b)&&Ag(this,b,a),ug(this,"linkFromKey",Cf,c,a,d,b),"string"===typeof c&&this.Lb(a,c))}else w.Ma(a,c,b)}}; w.defineProperty(Q,{Mn:"linkToKeyProperty"},function(){return this.Xh},function(a){var b=this.Xh;b!==a&&(vg(a,Q,"linkToKeyProperty"),this.Xh=a,this.h("linkToKeyProperty",b,a))});Q.prototype.getToKeyForLinkData=Q.prototype.cm=function(a){if(null!==a){var b=this.Xh;if(""!==b&&(b=w.vb(a,b),void 0!==b)){if(wg(b))return b;w.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}}; Q.prototype.setToKeyForLinkData=Q.prototype.GB=function(a,b){null===b&&(b=void 0);void 0===b||wg(b)||w.Gd(b,"number or string",Q,"setToKeyForLinkData:key");if(null!==a){var c=this.Xh;if(""!==c)if(b=this.Nn(b),this.th(a)){var d=w.vb(a,c);d!==b&&(Bg(this,d,a),w.Ma(a,c,b),null===this.we(b)&&Ag(this,b,a),ug(this,"linkToKey",Cf,c,a,d,b),"string"===typeof c&&this.Lb(a,c))}else w.Ma(a,c,b)}}; w.defineProperty(Q,{Bu:"linkFromPortIdProperty"},function(){return this.Om},function(a){var b=this.Om;b!==a&&(vg(a,Q,"linkFromPortIdProperty"),a!==this.Ln&&a!==this.Mn||w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Om=a,this.h("linkFromPortIdProperty",b,a))});Q.prototype.getFromPortIdForLinkData=Q.prototype.dI=function(a){if(null===a)return"";var b=this.Om;if(""===b)return"";a=w.vb(a,b);return void 0===a?"":a}; Q.prototype.setFromPortIdForLinkData=Q.prototype.BB=function(a,b){w.j(b,"string",Q,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.Om;if(""!==c)if(this.th(a)){var d=w.vb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),ug(this,"linkFromPortId",Cf,c,a,d,b),"string"===typeof c&&this.Lb(a,c))}else w.Ma(a,c,b)}}; w.defineProperty(Q,{Du:"linkToPortIdProperty"},function(){return this.Pm},function(a){var b=this.Pm;b!==a&&(vg(a,Q,"linkToPortIdProperty"),a!==this.Ln&&a!==this.Mn||w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Pm=a,this.h("linkToPortIdProperty",b,a))});Q.prototype.getToPortIdForLinkData=Q.prototype.hI=function(a){if(null===a)return"";var b=this.Pm;if(""===b)return"";a=w.vb(a,b);return void 0===a?"":a}; Q.prototype.setToPortIdForLinkData=Q.prototype.HB=function(a,b){w.j(b,"string",Q,"setToPortIdForLinkData:portname");if(null!==a){var c=this.Pm;if(""!==c)if(this.th(a)){var d=w.vb(a,c);void 0===d&&(d="");d!==b&&(w.Ma(a,c,b),ug(this,"linkToPortId",Cf,c,a,d,b),"string"===typeof c&&this.Lb(a,c))}else w.Ma(a,c,b)}};w.defineProperty(Q,{Cu:"linkLabelKeysProperty"},function(){return this.yg},function(a){var b=this.yg;b!==a&&(vg(a,Q,"linkLabelKeysProperty"),this.yg=a,this.h("linkLabelKeysProperty",b,a))}); Q.prototype.getLabelKeysForLinkData=Q.prototype.Mk=function(a){if(null===a)return w.jo;var b=this.yg;if(""===b)return w.jo;a=w.vb(a,b);return void 0===a?w.jo:a}; Q.prototype.setLabelKeysForLinkData=Q.prototype.sG=function(a,b){w.mA(b,Q,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.yg;if(""!==c)if(this.th(a)){var d=w.vb(a,c);void 0===d&&(d=w.jo);if(d!==b){for(var e=w.bb(d),f=0;fe||(w.Ig(d,e),this.th(a)&&(Bg(this,b,a),ug(this,"linkLabelKeys",Ff,c,a,b,null,e,null)))}else void 0!==d&&w.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; w.defineProperty(Q,{zh:"linkDataArray"},function(){return this.kf},function(a){var b=this.kf;if(b!==a){w.mA(a,Q,"linkDataArray");this.gd.clear();for(var c=w.bb(a),d=0;dd)return;w.Ig(a.kf,d)}ug(a,"linkDataArray",Ff,"linkDataArray",a,b,null,d,null);c=a.bm(b);Bg(a,c,b);c=a.cm(b);Bg(a,c,b);d=a.Mk(b);if(w.isArray(d))for(var e=w.bb(d),f=0;fa.wi&&w.trace("Ending transaction without having started a transaction: "+c);var d=1===a.wi;d&&b&&a.jd("CommittingTransaction",c,a.sj);var e=0;if(0a.wj;e--)f=d.ea(e),null!==f&&f.clear(), d.dd(e),a.Dz=!0;e=a.OF;0===e&&(e=1);0=e&&(f=d.ea(0),null!==f&&f.clear(),d.dd(0),a.ah--);d.add(b);a.ah++;d.freeze();f=b}a.jd("CommittedTransaction",c,f)}else{a.eh=!0;try{a.isEnabled&&null!==f&&(f.ru=!0,f.undo())}finally{a.jd("RolledBackTransaction",c,f),a.eh=!1}null!==f&&f.clear()}a.Fv=null;return!0}if(a.isEnabled&&!b&&null!==f){a=e;c=f.Wf;for(b=c.count-1;b>=a;b--)d=c.ea(b),null!==d&&d.undo(),c.Qa(),c.dd(b);c.freeze()}return!1} Rf.prototype.canUndo=Rf.prototype.canUndo=function(){if(!this.isEnabled||0=this.wi&&!this.uz&&(a=a.g,null!==a&&!1===a.In||w.trace("Change not within a transaction: "+c.toString()))}}; Rf.prototype.skipsEvent=function(a){if(null===a||0>a.Dc.value)return!0;a=a.object;if(a instanceof G){if(a=a.layer,null!==a&&a.Qc)return!0}else if(a instanceof pg&&a.Qc)return!0;return!1};w.u(Rf,{aJ:"models"},function(){return this.Iz.i});w.defineProperty(Rf,{isEnabled:"isEnabled"},function(){return this.jf},function(a){this.jf=a});w.u(Rf,{GG:"transactionToUndo"},function(){return 0<=this.wj&&this.wj<=this.history.count-1?this.history.ea(this.wj):null}); w.u(Rf,{FG:"transactionToRedo"},function(){return this.wjb.Ah||(b.scale=a))};rg.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.Hy);w.Bd(a,rg,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.Sl!==oh)return!1;a*=b.scale;return ab.Ah?!1:b.kx}; rg.prototype.increaseZoom=function(a){void 0===a&&(a=this.Hy);w.Bd(a,rg,"increaseZoom:factor");var b=this.g;null!==b&&b.Sl===oh&&(a*=b.scale,ab.Ah||(b.scale=a))};rg.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.Hy);w.Bd(a,rg,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.Sl!==oh)return!1;a*=b.scale;return ab.Ah?!1:b.kx};rg.prototype.resetZoom=function(a){void 0===a&&(a=this.sx);w.Bd(a,rg,"resetZoom:newscale");var b=this.g;null===b||ab.Ah||(b.scale=a)}; rg.prototype.canResetZoom=function(a){void 0===a&&(a=this.sx);w.Bd(a,rg,"canResetZoom:newscale");var b=this.g;return null===b||ab.Ah?!1:b.kx};rg.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.hA&&!isNaN(this.Ez)&&a.be.L(this.gA)?(a.scale=this.Ez,a.position=this.rD,this.hA=NaN,this.gA=dd):(this.Ez=b,this.rD=c.copy(),a.zoomToFit(),this.hA=a.scale,this.gA=a.be.copy())}};rg.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.kx}; rg.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&w.G(a,R,rg,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.hj&&(this.hj.next()?a=this.hj.value:this.hj=null)}catch(c){this.hj=null}null===a&&(0h&&(h=-3),0k&&(k=-3); if(void 0===f||void 0===h||void 0===k||0===h&&0===k||b.shift)!b.shift&&a.se?(f=a.Wu,e=3*e*f,0e||Math.abs(b.y-a.y)>d};w.u(qg,{g:"diagram"},function(){return this.aa}); w.defineProperty(qg,{name:"name"},function(){return this.Sb},function(a){w.j(a,"string",qg,"name");this.Sb=a});w.defineProperty(qg,{isEnabled:"isEnabled"},function(){return this.jf},function(a){w.j(a,"boolean",qg,"isEnabled");this.jf=a});w.defineProperty(qg,{sa:"isActive"},function(){return this.eD},function(a){w.j(a,"boolean",qg,"isActive");this.eD=a});w.defineProperty(qg,{Lf:"transactionResult"},function(){return this.lE},function(a){null!==a&&w.j(a,"string",qg,"transactionResult");this.lE=a}); function nh(){qg.call(this);0e&&(e=k),l>f&&(f=l))}}Infinity===c?b.m(0,0,0,0):b.m(c,d,e-c,f-d)} function ri(a,b){if(null===a.ec){var c=a.g;if(!(null===c||b&&(c.ib||c.Ef))&&null!==a.$b){var d=c.ja;d.isEnabled&&d.DF?null!==d.sj&&0c.qa)){var d=a.g;if(null!==d&&!d.ib){var e=a.fj;if(null!==e){var f=null,h=null;null===c.Y&&(f=Oi(a,c.l(0),!1),null!==f&&(h=f.V));var k=null,l=null;null===c.Z&&(k=Oi(a,c.l(c.qa-1),!0),null!==k&&(l=k.V));e.isValidLink(h,f,l,k)?b?(c.Pp=c.l(0),c.Qp=c.l(c.qa-1),c.vi=!1,c.Y=h,null!==f&&(c.Mg=f.le),c.Z=l,null!==k&&(c.Ih=k.le),c.kc!==a.uw&&d.Aa("LinkRelinked",c,a.uw),c.Ic!==a.vw&&d.Aa("LinkRelinked",c,a.vw)):Pi(e,h,f,l,k):Pi(e,null,null,null,null)}}}} nh.prototype.doDragOver=function(){}; function Qi(a,b){var c=a.g;if(null!==c){a.uj&&Li(a,!0);Zh(a);var d=Mi(c,b,null,function(b){return!Ji(a,b)}),e=c.Q;e.Be=d;if(null!==d){e.tc=!1;for(var f=d;null!==f;){var h=f.fB;if(null!==h&&(h(e,f),e.tc))break;f=Ni(f)}}else f=c.fB,null!==f&&f(e);if(a.sa||null!==Sh){for(e=(a.ec||a.$b).i;e.next();)f=e.key,f instanceof T&&f.je.each(function(a){a.vi=!1});a.doDropOnto(b,d);if(a.sa||null!==Sh){d=w.vf();for(e=c.selection.i;e.next();)f=e.value,f instanceof T&&Ri(c,f.getAvoidableRect(d));w.Bb(d)}}}} function Ri(a,b){var c=!1;a.sb.Ek(b)&&(c=!0);c=a.CA(b,function(a){return a.V},function(a){return a instanceof W},!0,function(a){return a instanceof W},c);if(0!==c.count)for(c=c.i;c.next();){var d=c.value;d.em&&d.Wb()}}nh.prototype.doDropOnto=function(){}; nh.prototype.doMouseMove=function(){if(this.sa){var a=this.g;null!==a&&null!==this.wn&&null!==this.$b&&(this.mayCopy()?(a.ic="copy",ri(this,!1),Rh(this,this.ec),Ei(this,this.ec,!1),$h(this,this.ec)):this.mayMove()?(ci(this),Ei(this,this.$b,!0)):this.mayDragOut()?(a.ic="no-drop",ri(this,!1),Ei(this,this.ec,!1)):ci(this),Ki(this,a.Q.da))}}; nh.prototype.doMouseUp=function(){if(this.sa){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.ec?(ci(this),ri(this,!0),Rh(this,this.ec),Ei(this,this.ec,!1),$h(this,this.ec),null!==this.ec&&a.oG(this.ec.Mj())):(b=!0,ci(this),this.mayMove()&&(Ei(this,this.$b,!0),Ki(this,a.Q.da)));this.zr=!0;Qi(this,a.Q.da);if(this.sa){this.ec=null;if(b&&null!==this.$b)for(b=this.$b.i;b.next();){var d=b.key;d instanceof T&&(d=d.Da,null===d||null===d.placeholder||this.$b.contains(d)||d.placeholder.H())}a.Fc(); $h(this,this.$b);this.Lf=c?"Copy":"Move";a.Aa(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};nh.prototype.mayCopy=function(){if(!this.zF)return!1;var a=this.g;if(null===a||a.ib||a.Ef||!a.Fp||!a.Bk||(w.yh?!a.Q.alt:!a.Q.control))return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.he()&&b.canCopy())return!0}return null!==this.ld&&this.uj&&this.ld.canCopy()?!0:!1}; nh.prototype.mayDragOut=function(){if(!this.zF)return!1;var a=this.g;if(null===a||!a.Nt||!a.Bk||a.Ql)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.he()&&b.canCopy())return!0}return null!==this.ld&&this.uj&&this.ld.canCopy()?!0:!1};nh.prototype.mayMove=function(){var a=this.g;if(null===a||a.ib||!a.Ql)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.he()&&b.canMove())return!0}return null!==this.ld&&this.uj&&this.ld.canMove()?!0:!1};var ai=new H(nh),Sh=null,Th=null; nh.prototype.getDraggingSource=function(){return Sh};nh.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.yE||a.ib||a.Ef||!a.Fp)return!1;var b=Sh;return null===b||null===b.g||b.g.$.Xl!==a.$.Xl?!1:!0};nh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Ka.Hh();Si(a);a.Ka.Hh();a=Sh;null!==a&&null!==a.g&&(a.g.ic="copy")}};nh.prototype.doSimulatedDragLeave=function(){var a=Sh;null!==a&&a.doSimulatedDragOut();this.doCancel()}; nh.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=Sh;null!==b&&null!==b.$b&&this.mayDragIn()&&(a.ic="copy",Ti(this,b.$b.Mj(),!1),Ei(this,this.ec,!1),Ki(this,a.Q.da))}}; nh.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=Sh;if(null!==b){var c=b.g;b.zr=!0;ci(this);this.mayDragIn()&&(this.Kb("Drop"),Ti(this,b.$b.Mj(),!0),Ei(this,this.ec,!1),null!==this.ec&&a.oG(this.ec.Mj()),Qi(this,a.Q.da),a.Fc(),b=a.selection,null!==this.ec?this.Lf="ExternalCopy":b=new I(R),this.ec=null,a.doFocus(),a.Aa("ExternalObjectsDropped",b,c),this.Vk())}}}; function Ti(a,b,c){if(null===a.ec){var d=a.g;if(null!==d&&!d.ib&&!d.Ef){d.fb=!c;d.Nq=!c;a.Uk=d.Q.da;c=d.Op(b,d,!0);var e=w.vf();hi(b,e);var d=e.x+e.width/2,f=e.y+e.height/2;w.Bb(e);var e=a.Ow,h=new ma(R),k=w.K();for(b=b.i;b.next();){var l=b.value,m=c.ka(l);l.he()&&l.canCopy()?(l=l.location,k.m(e.x-(d-l.x),e.y-(f-l.y)),m.location=k,m.af(),h.add(m,Wh(a,k))):l instanceof W&&l.canCopy()&&(m.Ej(e.x-d,e.y-f),h.add(m,Wh(a)))}w.v(k);a.ec=h;Qh(a,h.Mj());null!==a.ld&&(c=a.ld,d=c.Yn,c.Ej(a.Uk.x-(d.x+d.width/ 2),a.Uk.y-(d.y+d.height/2)))}}}nh.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.ic="":a.ic="no-drop")};function Xh(a){this.point=a;this.tG=cd}w.ga("DraggingInfo",Xh);function Fi(a,b,c){this.Rc=a;this.info=b;this.kI=c} function Ui(){0=d&&(d=.1);for(var e=this,f=b.yn(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,f=f.i;f.next();){var h=f.value,k=h.V;if(k instanceof T){var l=h.Ya(Jb,w.K()),m=c.x-l.x,n=c.y-l.y;w.v(l);l=m*m+n*n;lc){if(null!==this.lc&&a===this.Pg&&b===this.Qg)return!0;var d=b.le;null===d&&(d="");if(a.Dx(d).count>=c)return!1}return!0}; Ui.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.fq;if(null!==this.g&&this.g.Xa===this&&(null!==a.layer&&!a.layer.Ot||!0!==b.CG))return!1;var c=b.VJ;if(Infinity>c){if(null!==this.lc&&a===this.Rg&&b===this.Sg)return!0;var d=b.le;null===d&&(d="");if(a.Lg(d).count>=c)return!1}return!0};Ui.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.V,d=b.V;return null!==c&&c===d}; Ui.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.V;if(!(c instanceof T))return!1;var d=a.le;null===d&&(d="");var e=b.V;if(!(e instanceof T))return!1;var f=b.le;null===f&&(f="");for(e=e.Lg(f);e.next();)if(f=e.value,f.Y===c&&f.Mg===d)return!0;return!1}; Ui.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.aI&&d.UJ||!this.isInSameNode(b,d))&&(b.$H&&d.TJ||!this.isLinked(b,d)))||null!==this.lc&&(null!==a&&this.isLabelDependentOnLink(a,this.lc)||null!==c&&this.isLabelDependentOnLink(c,this.lc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.lc))return!1;if(null!==a){var e=a.Wx;if(null!==e&&!e(a,b,c,d,this.lc))return!1}if(null!== c&&(e=c.Wx,null!==e&&!e(a,b,c,d,this.lc)))return!1;e=this.Wx;return null!==e?e(a,b,c,d,this.lc):!0};Ui.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Xb;if(null===c)return!1;if(c===b)return!0;var d=new I(T);d.add(a);return Vi(this,c,b,d)};function Vi(a,b,c,d){if(b===c)return!0;var e=b.Y;if(null!==e&&e.Df&&(d.add(e),Vi(a,e.Xb,c,d)))return!0;b=b.Z;return null!==b&&b.Df&&(d.add(b),Vi(a,b.Xb,c,d))?!0:!1} Ui.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.fq;var d=null!==this.g?this.g.aK:Wi;if(d!==Wi){if(d===Xi){d=c||this.wf;if(null!==d&&!d.bc)return!0;for(d=b.je;d.next();){var e=d.value;if(e!==c&&e.bc&&e.Z===b)return!1}return!Yi(this,a,b,c,!0)}if(d===Zi){d=c||this.wf;if(null!==d&&!d.bc)return!0;for(d=a.je;d.next();)if(e=d.value,e!==c&&e.bc&&e.Y===a)return!1;return!Yi(this,a,b,c,!0)}if(d===$i)return a===b?a=!0:(d=new I(T),d.add(b),a=aj(this,d,a,b,c)),!a; if(d===bj)return!Yi(this,a,b,c,!1);if(d===cj)return a===b?a=!0:(d=new I(T),d.add(b),a=dj(this,d,a,b,c)),!a}return!0};function Yi(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.je;f.next();){var h=f.value;if(h!==d&&(!e||h.bc)&&h.Z===b&&(h=h.Y,h!==b&&Yi(a,h,c,d,e)))return!0}return!1} function aj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.je;f.next();){var h=f.value;if(h!==e&&h.Z===c&&(h=h.Y,h!==c&&aj(a,b,h,d,e)))return!0}return!1}function dj(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.je;f.next();){var h=f.value;if(h!==e){var k=h.Y,h=h.Z,k=k===c?h:k;if(k!==c&&dj(a,b,k,d,e))return!0}}return!1} w.defineProperty(Ui,{Wx:"linkValidation"},function(){return this.Al},function(a){null!==a&&w.j(a,"function",Ui,"linkValidation");this.Al=a});w.defineProperty(Ui,{jy:"portTargeted"},function(){return this.ND},function(a){null!==a&&w.j(a,"function",Ui,"portTargeted");this.ND=a});function ej(){0b.bu+1&&c=c.x)d=0>=c.y?d+225:1<=c.y?d+135:d+180;else if(1<=c.x)0>=c.y?d+=315:1<=c.y&&(d+=45);else if(0>=c.y)d+=270;else if(1<=c.y)d+=90;else break a;0>d?d+=360:360<=d&&(d-=360);a.cursor=22.5>d?"e-resize":67.5>d?"se-resize":112.5>d?"s-resize":157.5>d?"sw-resize":202.5>d?"w-resize":247.5>d?"nw-resize":292.5>d?"n-resize":337.5>d? "ne-resize":"e-resize"}else if(a instanceof C)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};w.defineProperty(Nj,{mu:"handleArchetype"},function(){return this.ql},function(a){null!==a&&w.G(a,G,Nj,"handleArchetype");this.ql=a});w.u(Nj,{handle:"handle"},function(){return this.pc});w.defineProperty(Nj,{ub:"adornedObject"},function(){return this.Jc},function(a){null!==a&&w.G(a,G,Nj,"adornedObject");this.Jc=a}); Nj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.ib&&a.Pt&&a.Q.left?null!==this.findToolHandleAt(a.Ec.da,this.name):!1}; Nj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.pc=this.findToolHandleAt(a.Ec.da,this.name),null!==this.pc&&(this.Jc=this.pc.V.ub,this.ep.set(this.ub.Ya(this.handle.alignment.WF())),this.JD.set(this.Jc.V.location),this.DD.set(this.Jc.Ca),this.pz=this.computeCellSize(),this.rz=this.computeMinSize(),this.qz=this.computeMaxSize(),a.ef=!0,this.BD=a.Ka.isEnabled,a.Ka.isEnabled=!1,this.Kb(this.name),this.sa=!0))}; Nj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Vk(),this.Jc=this.pc=null,this.sa=a.ef=!1,a.Ka.isEnabled=this.BD)};Nj.prototype.doCancel=function(){null!==this.ub&&(this.ub.Ca=this.XF,this.ub.V.location=this.jJ);this.stopTool()};Nj.prototype.doMouseMove=function(){var a=this.g;if(this.sa&&null!==a){var b=this.rz,c=this.qz,d=this.pz,e=this.ub.iF(a.Q.da,w.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.cg();w.v(e)}}; Nj.prototype.doMouseUp=function(){var a=this.g;if(this.sa&&null!==a){var b=this.rz,c=this.qz,d=this.pz,e=this.ub.iF(a.Q.da,w.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);w.v(e);a.Fc();this.Lf=this.name;a.Aa("PartResized",this.ub,this.XF)}this.stopTool()}; Nj.prototype.resize=function(a){var b=this.g;if(null!==b){var c=this.ub,d=c.V;c.Ca=a.size;d.af();a=this.ub.Ya(this.handle.alignment.WF());if(d instanceof V){var c=b.Va.ce,e=!1;null!==c&&(e=c.Rk,c.Rk=!1);var f=new H(R);f.add(d);b.moveParts(f,this.ep.copy().ui(a),!0);null!==c&&(c.Rk=e)}else d.location=d.location.copy().ui(a).add(this.ep)}}; Nj.prototype.computeResize=function(a,b,c,d,e,f){b.Td()&&(b=Jb);var h=this.ub.Ja,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!f){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=w.K();Na(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,1<=b?(a.height=Math.max(Math.min(p*a.width, d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),a.x=m-a.width,a.y=n-a.height)):1<=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(b=a.height/a.width,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),a.x=m-a.width)):(a.x=Math.max(q.x, m-d.width),a.x=Math.min(a.x,m-c.width),a.width=m-a.x,f||(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p,a.y=l+.5*(n-l-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width),a.y= n-a.height)):1<=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(b=a.height/a.width,1<=b?(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p):(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width))):(a.width=Math.max(Math.min(q.x-k,d.width),c.width),f||(a.height=Math.max(Math.min(p*a.width,d.height),c.height),a.width=a.height/p,a.y=l+.5*(n-l-a.height))):0>=b.y?(a.y=Math.max(q.y,n-d.height), a.y=Math.min(a.y,n-c.height),a.height=n-a.y,f||(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width,a.x=k+.5*(m-k-a.width))):1<=b.y&&(a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(a.width=Math.max(Math.min(a.height/p,d.width),c.width),a.height=p*a.width,a.x=k+.5*(m-k-a.width)));w.v(q);return a};Nj.prototype.computeReshape=function(){var a=Qj;this.ub instanceof Y&&(a=Rj(this.ub));return!(a===Sj||null!==this.g&&this.g.Q.shift)}; Nj.prototype.computeMinSize=function(){var a=this.ub.si.copy(),b=this.si;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};Nj.prototype.computeMaxSize=function(){var a=this.ub.Hf.copy(),b=this.Hf;!isNaN(b.width)&&b.widtha&&(a+=360));var b=Math.min(Math.abs(this.MJ),180),c=Math.min(Math.abs(this.LJ),b/2);(null===this.g||!this.g.Q.shift)&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};w.defineProperty(Tj,{MJ:"snapAngleMultiple"},function(){return this.UD},function(a){w.j(a,"number",Tj,"snapAngleMultiple");this.UD=a}); w.defineProperty(Tj,{LJ:"snapAngleEpsilon"},function(){return this.TD},function(a){w.j(a,"number",Tj,"snapAngleEpsilon");this.TD=a});w.u(Tj,{DL:"originalAngle"},function(){return this.ww});function Vj(){qg.call(this);0e.right&&(c.x-=d.width+5/b.scale);c.xe.bottom&&(c.y-=d.height+5/b.scale);c.ya.Q.te?!1:!0};hk.prototype.doStart=function(){this.sa||null===this.Wg||this.doActivate()}; hk.prototype.doActivate=function(){if(!this.sa){var a=this.g;if(null!==a){var b=this.Wg;null===b&&(b=a.Oe(a.Q.da));if(null!==b&&b instanceof Lh&&(this.Wg=b,null!==b.V)){this.sa=!0;this.Ta=qk;var c=this.NH;null!==b.BG&&(c=b.BG);this.uk=this.Wg.copy();var d=new B(this.Wg.Ya(zb),this.Wg.Ya(Sb));a.lG(d);if(c instanceof Yj)c.show(b,a,this);else{c.style.position="absolute";c.style.zIndex="100";c.textEditingTool=this;if("function"===typeof c.onActivate)c.onActivate();a.tj.appendChild(c);"function"===typeof c.focus&& c.focus();"function"===typeof c.select&&this.wy&&(c.select(),c.setSelectionRange(0,9999))}this.rj=c}}}};hk.prototype.doCancel=function(){null!==this.Is&&this.rj instanceof HTMLElement&&(this.rj.style.border=this.Is,this.Is=null);this.stopTool()};hk.prototype.doMouseUp=function(){!this.sa&&this.canStart()&&this.doActivate()};hk.prototype.doMouseDown=function(){this.sa&&this.acceptText(mk)}; hk.prototype.acceptText=function(a){switch(a){case mk:if(this.Ta===uk)this.rj instanceof HTMLElement&&this.rj.focus();else if(this.Ta===qk||this.Ta===tk||this.Ta===rk)this.Ta=sk,xk(this);break;case lk:case ok:case nk:if(ok===a&&!0===this.Zz.Nx)break;if(this.Ta===qk||this.Ta===tk||this.Ta===rk)this.Ta=sk,xk(this)}}; function xk(a){var b=a.Wg,c=a.g,d=a.rj;if(null!==b&&null!==d){var e=b.text,f="";d instanceof Yj?null!==d.WB&&(f=d.WB()):(f=d.value,f="function"===typeof f?f():f);a.isValidText(b,e,f)?(a.Kb(a.name),a.Ta=uk,a.Lf=a.name,b.text=f,null!==b.AG&&b.AG(b,e,f),null!==c&&c.Aa("TextEdited",b,e),a.Vk(),a.stopTool(),null!==c&&c.doFocus()):(a.Ta=tk,null!==b.BA&&b.BA(a,e,f),d instanceof Yj?d.show(b,c,a):(null===a.Is&&(a.Is=d.style.border,d.style.border="3px solid red"),"function"===typeof d.focus&&d.focus()))}} hk.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.Ta=jk;this.Wg=null;if(null!==this.rj){var b=this.rj;if(b instanceof Yj)b.Fn(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.tj.removeChild(b)}}this.sa=!1}};hk.prototype.doFocus=function(){vk(this)};hk.prototype.doBlur=function(){wk(this)};function vk(a){if(null!==a.rj&&a.state!==jk){var b=a.ez;a.Ta===qk&&(a.Ta=rk);"function"===typeof b.select&&a.wy&&(b.select(),b.setSelectionRange(0,9999))}} function wk(a){if(null!==a.rj&&a.state!==jk){var b=a.ez;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.wy&&(b.select(),b.setSelectionRange(0,9999))}}hk.prototype.isValidText=function(a,b,c){w.G(a,Lh,hk,"isValidText:textblock");var d=this.MB;if(null!==d&&!d(a,b,c))return!1;d=a.MB;return null===d||d(a,b,c)?!0:!1};w.defineProperty(hk,{MB:"textValidation"},function(){return this.Jl},function(a){null!==a&&w.j(a,"function",hk,"textValidation");this.Jl=a}); w.defineProperty(hk,{RF:"minimumEditorScale"},function(){return this.wD},function(a){null!==a&&w.j(a,"number",hk,"minimumEditorScale");this.wD=a});w.defineProperty(hk,{wy:"selectsTextOnActivate"},function(){return this.RD},function(a){null!==a&&w.j(a,"boolean",hk,"selectsTextOnActivate");this.RD=a});w.defineProperty(hk,{state:"state"},function(){return this.Ta},function(a){this.Ta!==a&&(w.ob(a,hk,hk,"starting"),this.Ta=a)}); hk.prototype.measureTemporaryTextBlock=hk.prototype.WI=function(a){var b=this.uk;b.text=a;yk(b,this.Wg.Vo,Infinity);return b};function hh(){qg.call(this);this.name="ToolManager";this.WG=new H(qg);this.XG=new H(qg);this.YG=new H(qg);this.bD=this.cD=850;this.SC=(new ia(2,2)).Ha();this.jE=5E3;this.AD=Ph;this.$C=zk;this.Ev=this.GC=null;this.jn=-1}w.La(hh,qg);w.ga("ToolManager",hh);var Ph;hh.WheelScroll=Ph=w.p(hh,"WheelScroll",0);var Oh;hh.WheelZoom=Oh=w.p(hh,"WheelZoom",1); hh.WheelNone=w.p(hh,"WheelNone",2);var zk;hh.GestureZoom=zk=w.p(hh,"GestureZoom",3);var Ak;hh.GestureCancel=Ak=w.p(hh,"GestureCancel",4);var Bk;hh.GestureNone=Bk=w.p(hh,"GestureNone",5);w.defineProperty(hh,{Iu:"mouseWheelBehavior"},function(){return this.AD},function(a){w.ob(a,hh,hh,"mouseWheelBehavior");this.AD=a});w.defineProperty(hh,{Lk:"gestureBehavior"},function(){return this.$C},function(a){w.ob(a,hh,hh,"gestureBehavior");this.$C=a}); hh.prototype.initializeStandardTools=function(){this.iH=new Wj;this.$F=new Uh;this.NI=new oj;this.jG=new Nj;this.zJ=new Tj;this.NF=new ej;this.ce=new nh;this.SH=new fk;this.kJ=new gk;this.tA=new ak;this.LB=new hk;this.vH=new Xj;this.wH=new Vj};hh.prototype.updateAdornments=function(a){var b=this.Wl;if(b instanceof jh&&this.Ev===a){var c=b.ub;(null!==a?c.V===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; hh.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.Q;b.Aj&&this.Lk===Ak&&(b.bubbles=!1);if(b.wu){this.cancelWaitAfter();if(this.Lk===Bk){b.bubbles=!0;return}if(this.Lk===Ak)return;if(a.Xa.canStartMultiTouch()){a.Xa.standardPinchZoomStart();return}}var c=a.ja;c.nA&&0!==c.wi&&w.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.gf.length,d=0;de.right&&(c.x-=d.width+5/b.scale);c.xe.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.ya?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}w.u(Wg,{CK:"animationReasons"},function(){return this.rv}); Wg.prototype.canStart=function(){return!0};Wg.prototype.prepareAutomaticAnimation=Wg.prototype.Wn=function(a){this.jf&&(this.vl||this.aa.In)&&(this.rv.add(a),this.canStart(a)&&(this.dk&&this.Hh(),this.rc=!0))};function Gk(a){if(a.jf&&(a.rv.clear(),a.rc))if(!a.no)a.rc=!1;else if(0===a.xm){var b=+new Date;a.xm=b;requestAnimationFrame(function(){if(!1!==a.rc&&!a.dk&&a.xm===b){var c=a.aa;c.Nk("temporaryPixelRatio")&&(c.tk=1);Hk(c);a.rc=!1;c.Aa("AnimationStarting");Uk(a,b)}})}} function Vk(a,b,c,d,e,f){if(!(!a.rc||"position"===c&&d.L(e)||b instanceof R&&!b.xF)){var h=a.Um;if(h.contains(b)){var h=h.ka(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=Wk(d));h.ox&&void 0!==l[c]?h.Xt[c]=Wk(e):(f||(h.Xt[c]=Wk(e)),l[c]=Wk(e));f&&0===c.indexOf("position:")&&b instanceof R&&(h.Xt.location=Wk(b.location))}else k=new ra,l=new ra,k[c]=Wk(d),l[c]=Wk(e),d=l,e=k.position,e instanceof y&&!e.I()&&a.rv.contains("Expand SubGraph")&&e.assign(d.position),k=new Fk(k,l,f),f&&0===c.indexOf("position:")&& b instanceof R&&(k.Xt.location=Wk(b.location)),h.add(b,k);a.no=!0}}function Wk(a){return a instanceof y?a.copy():a instanceof ia?a.copy():a} function Uk(a,b){var c;function d(){if(!1!==f.dk&&f.xm===b){var a=+new Date,c=a>s?m:a-r;Xk(f);bl(f,e,q,h,c,m);f.Bv&&f.Bv();Si(e);cl(f);a>s?dl(f):requestAnimationFrame(d)}}void 0===c&&(c=new ra);var e=a.aa;if(null!==e){var f=a,h=c.cL||a.HC,k=c.BL||null,l=c.CL||null,m=c.duration||a.mz,n=a.ZG;for(c=a.Um.i;c.next();){var p=c.value.start.position;p instanceof y&&(p.I()||p.assign(n))}a.CC=h;a.Bv=k;a.Cv=l;a.BC=m;a.Dv=a.Um;var q=a.Dv;for(c=q.i;c.next();)k=c.value.end,k["position:placeholder"]&&(l=c.key.findVisibleNode(), l instanceof V&&null!==l.placeholder&&(l=l.placeholder,n=l.Ya(zb),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n));a.dk=!0;Xk(a);bl(a,e,q,h,0,m);Si(a.aa);cl(a);var r=+new Date,s=r+m;f.xm===b&&requestAnimationFrame(function(){d()})}}function Xk(a){if(!a.Ro){var b=a.aa;a.mE=b.fb;a.oC=b.Qe;a.pC=b.av;b.fb=!0;b.Qe=!0;b.av=!0;a.Ro=!0}}function cl(a){var b=a.aa;b.fb=a.mE;b.Qe=a.oC;b.av=a.pC;a.Ro=!1} function bl(a,b,c,d,e,f){for(c=c.i;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==el[m])el[m](h,l[m],k[m],d,e,f)}d=b.TA;b.TA=!0;m=a.HC;0!==a.vr&&0!==a.ur&&(c=a.vr,b.rb=m(e,c,a.ur-c,f));null!==a.tr&&null!==a.sr&&(c=a.tr,a=a.sr,b.$a=new y(m(e,c.x,a.x-c.x,f),m(e,c.y,a.y-c.y,f)));b.TA=d} Wg.prototype.stopAnimation=Wg.prototype.Hh=function(){!0===this.rc&&(this.rc=!1,this.xm=0,this.no&&this.aa.ye());this.dk&&this.jf&&dl(this)}; function dl(a){a.dk=!1;a.no=!1;Xk(a);for(var b=a.aa,c=a.CC,d=a.BC,e=a.Dv.i;e.next();){var f=e.key,h=e.value,k=h.start,l=h.end,m=h.Xt,n;for(n in l)if(void 0!==el[n]){var p=n;!h.ox||"position:node"!==p&&"position:placeholder"!==p||(p="position");el[p](f,k[n],void 0!==m[n]?m[n]:h.ox?k[n]:l[n],c,d,d)}h.ox&&void 0!==m.location&&f instanceof R&&(f.location=m.location);h.my&&f instanceof R&&f.Ed(!1)}for(c=a.aa.links;c.next();)d=c.value,null!==d.kp&&(d.points=d.kp,d.kp=null);b.Xx.clear();b.tk=null;b.Fc(); b.oa();b.cg();fl(b);cl(a);a.Cv&&a.Cv();a.xm=0;a.Dv=null;a.Cv=null;a.Bv=null;a.tr=null;a.sr=null;a.vr=0;a.ur=0;a.Um=new ma(G,Fk);b.Aa("AnimationFinished");b.ye()} function gl(a,b,c){var d=b.U,e=c.U,f=null;c instanceof V&&(f=c.placeholder);null!==f?(d=f.Ya(zb),d.x+=f.padding.left,d.y+=f.padding.top,Vk(a,b,"position",d,b.position,!1)):Vk(a,b,"position",new y(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);Vk(a,b,"scale",.01,b.scale,!1);if(b instanceof V)for(b=b.vc;b.next();)f=b.value,f instanceof T&&gl(a,f,c)} function hl(a,b,c){if(b.isVisible()){var d=null;c instanceof V&&(d=c.placeholder);null!==d?Vk(a,b,"position:placeholder",b.position,d,!0):Vk(a,b,"position:node",b.position,c,!0);Vk(a,b,"scale",b.scale,.01,!0);a.rc&&(d=a.Um,d.contains(b)&&(d.ka(b).my=!0));if(b instanceof V)for(b=b.vc;b.next();)d=b.value,d instanceof T&&hl(a,d,c)}}function il(a,b,c){a.rc&&(null===a.tr&&b.I()&&null===a.sr&&(a.tr=b.copy()),a.sr=c.copy(),a.no=!0)} function jl(a,b,c){a.rc&&a.aa.In&&(0===a.vr&&0===a.ur&&(a.vr=b),a.ur=c,a.no=!0)}w.defineProperty(Wg,{isEnabled:"isEnabled"},function(){return this.jf},function(a){w.j(a,"boolean",Wg,"isEnabled");this.jf=a});w.defineProperty(Wg,{duration:"duration"},function(){return this.mz},function(a){w.j(a,"number",Wg,"duration");1>a&&w.Fa(a,">= 1",Wg,"duration");this.mz=a});w.u(Wg,{df:"isAnimating"},function(){return this.dk});w.u(Wg,{FI:"isTicking"},function(){return this.Ro}); w.defineProperty(Wg,{EF:"isInitial"},function(){return this.vl},function(a){w.j(a,"boolean",Wg,"isInitial");this.vl=a});function Fk(a,b,c){this.start=a;this.end=b;this.Xt=new ra;this.ox=c;this.my=!1} var el={opacity:function(a,b,c,d,e,f){a.opacity=d(e,b,c-b,f)},position:function(a,b,c,d,e,f){e!==f?a.Ay(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)):a.position=new y(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},"position:node":function(a,b,c,d,e,f){var h=a.U,k=c.U;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==f?a.Ay(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f)):a.position=new y(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f))},"position:placeholder":function(a,b,c,d,e,f){e!==f?a.Ay(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)): a.position=new y(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},scale:function(a,b,c,d,e,f){a.scale=d(e,b,c-b,f)},visible:function(a,b,c,d,e,f){a.visible=e!==f?b:c}};function pg(){0=a)return b;for(var c=0,d=0,e=0,f=0,h=0,k=this.Ab.i;k.next();){var l=k.value;l instanceof V?e++:l instanceof T?d++:l instanceof W?f++:l instanceof jh?h++:c++}k="";0=d.count)a=d.count;else if(d.ea(a)===b)return-1;d.Rd(a,b);b.nu(c);d=this.g;null!==d&&(c?d.oa():d.$p(b));pl(this,a,b);return a}; g.rf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.rf(a,b,c);var d=this.Ab;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.ea(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.ou(c);d.dd(a);d=this.g;null!==d&&(c?d.oa():d.rf(b));b.hw=null;return a}; function pl(a,b,c){b=ql(a,b,c);if(c instanceof V&&null!==c&&isNaN(c.io)){if(0!==c.vc.count){for(var d=-1,e=a.Ab.n,f=e.length,h=0;hd&&k.Da===c&&(d=h,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,h=NaN;0<=f;){h=a.ea(f).io;if(!isNaN(h))break;f--}for(var k=b+1,l=NaN;kd)for(;;){if(-1===f||h<=d){f++;if(f===b)break;a.dd(b);a.Rd(f,c);return f}for(h=NaN;0<=--f&&(h=a.ea(f).io,isNaN(h)););}else if(!isNaN(l)&&l=d){k--;if(k===b)break;a.dd(b);a.Rd(k,c);return k}for(l=NaN;++ka||1parseInt(e[1],10)&&(w.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version "+w.vfo+". This license key will do nothing until you upgrade to GoJS 1.7 or later."),w.ux.licenseKey=!0);this.Vh=1;this.ik=0;this.gw=new y;this.bA=500;this.sv=new y;this.pt=null;this.fk=!1;this.preventDefault=this.ly=this.pq=this.qq=this.oq=this.nq=this.Rn=this.Tn=this.Sn=this.Pn=this.Qn=this.XB=this.PB=this.QB=this.RB=this.Gl=this.ct= this.Fl=this.bt=null;this.aw=!1;this.sl=new Dl;void 0!==a&&El(this,a);this.Wc=!1}w.ga("Diagram",E);E.prototype.clear=E.prototype.clear=function(){this.$.clear();fh=null;gh="";Fl(this,!1);this.Hv=(new B(NaN,NaN,NaN,NaN)).freeze();this.oa()}; function Fl(a,b){var c=null;null!==a.td&&(c=a.td.V);a.Ka.Hh();for(var d=[],e=a.dc.length,f=0;f=a)return b;for(var c=this.dc.i;c.next();)b+="\n "+c.value.toString(a-1);return b};E.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.aa instanceof E?b.aa:null}; w.defineProperty(E,{tj:"div"},function(){return this.Ob},function(a){null!==a&&w.G(a,HTMLDivElement,E,"div");if(this.Ob!==a){sl=[];var b=this.Ob;null!==b?(b.aa=void 0,b.innerHTML="",null!==this.yb&&(this.yb.removeEventListener("touchstart",this.RB,!1),this.yb.removeEventListener("touchmove",this.QB,!1),this.yb.removeEventListener("touchend",this.PB,!1),this.yb.Od.aa=null),b=this.Va,null!==b&&(b.gf.each(function(a){a.cancelWaitAfter()}),b.dg.each(function(a){a.cancelWaitAfter()}),b.eg.each(function(a){a.cancelWaitAfter()})), b.cancelWaitAfter(),this.Xa.doCancel(),this.hf=this.yb=null,window.removeEventListener("resize",this.XB,!1),window.removeEventListener("mousemove",this.Qn,!0),window.removeEventListener("mousedown",this.Pn,!0),window.removeEventListener("mouseup",this.Sn,!0),window.removeEventListener("wheel",this.Tn,!0),window.removeEventListener("mouseout",this.Rn,!0)):this.bh=!1;this.Ob=null;if(null!==a){if(b=a.aa)b.tj=null;El(this,a);this.Pu()}}}); function Il(a){var b=a.yb;a.Vy?(b.addEventListener("pointerdown",a.nq,!1),b.addEventListener("pointermove",a.oq,!1),b.addEventListener("pointerup",a.qq,!1),b.addEventListener("pointerout",a.pq,!1)):(b.addEventListener("touchstart",a.RB,!1),b.addEventListener("touchmove",a.QB,!1),b.addEventListener("touchend",a.PB,!1),b.addEventListener("mousemove",a.Qn,!1),b.addEventListener("mousedown",a.Pn,!1),b.addEventListener("mouseup",a.Sn,!1),b.addEventListener("mouseout",a.Rn,!1));b.addEventListener("wheel", a.Tn,!1);b.addEventListener("keydown",a.HI,!1);b.addEventListener("keyup",a.II,!1);b.addEventListener("selectstart",function(a){a.preventDefault();return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturestart",function(b){a.Va.Lk!==Bk&&(a.Va.Lk===Ak?b.preventDefault():(b.preventDefault(),a.Ls=a.scale,a.Xa.doCancel()))},!1);b.addEventListener("gesturechange",function(b){if(a.Va.Lk!==Bk)if(a.Va.Lk===Ak)b.preventDefault();else{b.preventDefault(); var d=b.scale;if(null!==a.Ls){var e=a.Fb,f=a.Eb,h=a.yb.getBoundingClientRect();b=new y(b.pageX-window.scrollX-e/h.width*h.left,b.pageY-window.scrollY-f/h.height*h.top);d*=a.Ls;e=a.pb;d!==a.scale&&e.canResetZoom(d)&&(f=a.zi,a.zi=b,e.resetZoom(d),a.zi=f)}}},!1);window.addEventListener("resize",a.XB,!1)} E.prototype.computePixelRatio=function(){if(null!==this.tk)return this.tk;var a=this.hf;return(window.devicePixelRatio||1)/(a.ua.webkitBackingStorePixelRatio||a.ua.mozBackingStorePixelRatio||a.ua.msBackingStorePixelRatio||a.ua.oBackingStorePixelRatio||a.ua.backingStorePixelRatio||1)};E.prototype.doMouseMove=function(){this.Xa.doMouseMove()};E.prototype.doMouseDown=function(){this.Xa.doMouseDown()};E.prototype.doMouseUp=function(){this.Xa.doMouseUp()};E.prototype.doMouseWheel=function(){this.Xa.doMouseWheel()}; E.prototype.doKeyDown=function(){this.Xa.doKeyDown()};E.prototype.doKeyUp=function(){this.Xa.doKeyUp()};E.prototype.doFocus=function(){this.focus()};E.prototype.focus=E.prototype.focus=function(){if(this.yb)if(this.DJ)this.yb.focus();else{var a=window.scrollX||window.pageXOffset,b=window.scrollY||window.pageYOffset;this.yb.focus();window.scrollTo(a,b)}}; function Hk(a){if(null!==a.yb){var b=a.Ob;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.rl?a.zd:0,d=a.bk?a.zd:0,e=a.wd;a.wd=a.computePixelRatio();a.wd!==e&&(a.Sr=!0,a.ye());if(b.clientWidth!==a.Fb+c||b.clientHeight!==a.Eb+d)a.Hm=!0,a.Fe=!0,b=a.Tb,null!==b&&b.Px&&a.Sl===oh&&(a.wr=!0,b.J()),a.Zd||a.ye()}}} function Bl(a){var b=new pg;b.name="Background";a.Jt(b);b=new pg;b.name="";a.Jt(b);b=new pg;b.name="Foreground";a.Jt(b);b=new pg;b.name="Adornment";b.Qc=!0;a.Jt(b);b=new pg;b.name="Tool";b.Qc=!0;b.yF=!0;a.Jt(b);b=new pg;b.name="Grid";b.Bf=!1;b.Tg=!1;b.Qc=!0;a.lH(b,a.Zt("Background"))} function Jl(a){a.td=new C(Kl);a.td.name="GRID";var b=new Y;b.Hb="LineH";b.stroke="lightgray";b.mb=.5;b.interval=1;a.td.add(b);b=new Y;b.Hb="LineH";b.stroke="gray";b.mb=.5;b.interval=5;a.td.add(b);b=new Y;b.Hb="LineH";b.stroke="gray";b.mb=1;b.interval=10;a.td.add(b);b=new Y;b.Hb="LineV";b.stroke="lightgray";b.mb=.5;b.interval=1;a.td.add(b);b=new Y;b.Hb="LineV";b.stroke="gray";b.mb=.5;b.interval=5;a.td.add(b);b=new Y;b.Hb="LineV";b.stroke="gray";b.mb=1;b.interval=10;a.td.add(b);b=new R;b.add(a.td); b.ag="Grid";b.io=0;b.WA=!1;b.xF=!1;b.Tg=!1;b.aB="GRID";a.add(b);a.Ab.remove(b);a.td.visible=!1}function Ll(){this.aa.Rz?this.aa.Rz=!1:this.aa.isEnabled?this.aa.RH(this):Ml(this.aa)}function Nl(a){this.aa.isEnabled?(this.aa.Tz=a.target.scrollTop,this.aa.Sz=a.target.scrollLeft):Ml(this.aa)} E.prototype.diagramScroll=E.prototype.RH=function(a){if(null!==this.yb){this.Ew=!0;var b=this.be,c=this.sb,d=this.ty,e=b.x-d.left,f=b.y-d.top,h=b.width+d.left+d.right,k=b.height+d.top+d.bottom,l=b.right+d.right,d=b.bottom+d.bottom,m=c.x,b=c.y,n=c.width,p=c.height,q=c.right,r=c.bottom,c=this.scale,s;s=a.scrollLeft;if(this.Xr)switch(this.Pz){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var u=s;nq&&(this.position=s.m(-(this.Iw.scrollWidth-this.Fb)+u-this.Fb/c+l,this.position.y))),a.cH&&this.se&&(fr&&(this.position=s.m(this.position.x,-(this.Iw.scrollHeight-this.Eb)+a.scrollTop-this.Eb/c+d))),w.v(s),Ol(this), this.Hm=this.Ew=!1,b=this.be,c=this.sb,l=b.right,q=c.right,d=b.bottom,r=c.bottom,e=b.x,m=c.x,f=b.y,b=c.y,n>=h&&e>=m&&l<=q&&(this.gt.style.width="1px"),p>=k&&f>=b&&d<=r&&(this.gt.style.height="1px"))}};E.prototype.computeBounds=E.prototype.sh=function(){0c&&(e=c),ea.Ah&&(e=a.Ah),e):b===Vl?(e=l>k?(h-a.zd)/d:(f-a.zd)/e,e>c&&(e=c),ea.Ah&&(e=a.Ah),e):a.scale}E.prototype.zoomToFit=E.prototype.zoomToFit=function(){this.scale=Rl(this,Ul);this.uy!==tl&&(this.$a.Qa(),Sl(this,this.$a,this.be,this.Fb/this.rb,this.Eb/this.rb,this.Cm,!0),this.$a.freeze())}; E.prototype.zoomToRect=function(a,b){void 0===b&&(b=Ul);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Ul||b===Vl)if(isNaN(c))e=this.sb.height*this.scale/d;else if(isNaN(d))e=this.sb.width*this.scale/c;else var e=this.Fb,f=this.Eb,e=b===Vl?f/d>e/c?(f-(this.bk?this.zd:0))/d:(e-(this.rl?this.zd:0))/c:Math.min(f/d,e/c);this.scale=e;this.position=new y(a.x,a.y)}};w.defineProperty(E,{TA:null},function(){return this.Wc},function(a){this.Wc=a}); E.prototype.alignDocument=function(a,b){this.ck&&Tl(this,this.sh());var c=this.be,d=this.sb;this.position=new y(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))}; function Sl(a,b,c,d,e,f,h){var k=b.x,l=b.y;if(h||a.uy===tl)f.$c()&&(d>c.width&&(k=c.x+(f.x*c.width+f.offsetX)-(f.x*d-f.offsetX)),e>c.height&&(l=c.y+(f.y*c.height+f.offsetY)-(f.y*e-f.offsetY))),f=a.ty,h=d-c.width,dc.left?k=c.left:kc.top?l=c.top:lb.targetTouches.length)return;e=b.targetTouches[c]}else if(null!==a.gp[0])e=a.gp[c];else return;c=a.yb;b=a.Fb;a=a.Eb;var f=0,h=0;null!==c&&null!==e&&(c=c.getBoundingClientRect(),f=e.clientX-b/c.width*c.left,h=e.clientY-a/c.height*c.top);d.m(f,h)}E.prototype.invalidateDocumentBounds=E.prototype.Fc=function(){this.ck||(this.ck=!0,this.ye(!0))};function fl(a){a.Zd||Ii(a);a.ck&&Tl(a,a.sh())} E.prototype.redraw=E.prototype.Pu=function(){this.Wc||this.Zd||(this.oa(),bm(this),Ol(this),this.Fc(),this.cg())};E.prototype.isUpdateRequested=function(){return this.Tf};E.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Ka,c=b.isEnabled;b.Hh();b.isEnabled=!1;Si(this);this.bh=!1;b.isEnabled=c;null!==a&&w.setTimeout(a,1)}; E.prototype.requestUpdate=E.prototype.ye=function(a){void 0===a&&(a=!1);if(!0!==this.Tf&&!(this.Wc||!1===a&&this.Zd)){this.Tf=!0;var b=this;requestAnimationFrame(function(){b.Tf&&b.cg()})}};E.prototype.maybeUpdate=E.prototype.cg=function(){if(!this.Go||this.Tf)this.Go&&(this.Go=!1),Si(this)};function cm(a,b){a.Ka.df||a.Wc||!a.Hm||Ml(a)||(b&&Ii(a),Ql(a,!1))} function Si(a){if(!a.Zd&&(a.Tf=!1,null!==a.Ob)){a.Zd=!0;var b=a.Ka,c=a.Mz;if(!b.Ro&&0!==c.length){for(var d=c.n,e=d.length,f=0;fb;b++){var c=a.ug.i;if(null===c||0===a.ug.count)break;a.ug=new I(R);a.VB(c,a.ug)}a.hg.each(function(a){a instanceof V&&0!==(a.ya&65536)!==!1&&(a.ya^=65536)})}} E.prototype.VB=function(a,b){for(a.reset();a.next();){var c=a.value;!c.he()||c instanceof V||(c.hm()?(yk(c,Infinity,Infinity),c.hc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof V&&c.isVisible()&&km(this,c);for(a.reset();a.next();)c=a.value,c instanceof W&&c.isVisible()&&(c.hm()?(yk(c,Infinity,Infinity),c.hc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof jh&&c.isVisible()&&(c.hm()?(yk(c,Infinity,Infinity),c.hc()):b.add(c))}; function km(a,b){for(var c=w.gb(),d=w.gb(),e=b.vc;e.next();){var f=e.value;f.isVisible()&&(f instanceof V?(sm(f)||Gm(f)||Hm(f))&&km(a,f):f instanceof W?f.Y===b||f.Z===b?d.push(f):c.push(f):(yk(f,Infinity,Infinity),f.hc()))}for(var e=c.length,h=0;hm&&(q=t.left,r=t.right),p.height>c&&(s=t.top,u=t.bottom)):(q=t.left,r=t.right,s=t.top,u=t.bottom);var t=p.width+q+r,x=p.height+s+u,q=p.x-q,v=n.x,r=p.right+r,z=n.right+ k,s=p.y-s,A=n.y,u=p.bottom+u,n=n.bottom+l,K="1px",D="1px",p=a.scale,O=!(tz+1&&(K=Math.max((r-z)*p+a.Fb,K)),m+k+1n+1&&(D=Math.max((u-n)*p+a.Eb,D)),c+l+1z+1&&(K=Math.max((r-z)*p+a.Fb,K)),m+1n+1&&(D=Math.max((u-n)*p+k,D)),c+1z+1&&(k=a.position.x*p));if(a.Xr)switch(a.Pz){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth- k-b.clientWidth}b.scrollLeft=k;a.NA&&a.se&&(c+1n+1&&(b.scrollTop=a.position.y*p));m=a.Fb;c=a.Eb;b.style.width=m+(a.rl?a.zd:0)+"px";b.style.height=c+(a.bk?a.zd:0)+"px";return d!==m||e!==c||a.Ka.rc?(n=a.sb,a.Mu(f,n,p,a.scale,h),!1):!0} E.prototype.add=E.prototype.add=function(a){w.G(a,R,E,"add:part");var b=a.g;if(b!==this){null!==b&&w.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.Nq&&(a.yl="Tool");var c=a.ag,b=this.Zt(c);null===b&&(b=this.Zt(""));null===b&&w.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.$p(99999999,a,a.g===this),0<=c&&this.cd(Ef,"parts",b,null,a,null,c),b.Qc||this.Fc(),a.J(Om),c=a.Sx,null!== c&&c(a,null,b))}}; E.prototype.$p=function(a){if(a instanceof T){if(this.dp.add(a),a instanceof V){var b=a.Da;null===b?this.Kl.add(a):b.ap.add(a);b=a.Tb;null!==b&&(b.g=this)}}else a instanceof W?this.Xo.add(a):a instanceof jh||this.Ab.add(a);var c=this;Pm(a,function(a){Qm(c,a)});(a instanceof jh||a instanceof V&&null!==a.Nb)&&a.H();b=a.data;null!==b&&(a instanceof jh||(a instanceof W?this.Sj.add(b,a):this.Ii.add(b,a)),Pm(a,function(a){Rm(c,a)}));!0!==Gm(a)&&!0!==Hm(a)||this.ug.add(a);Sm(a,!0,this);Tm(a)?(a.U.I()&&this.oa(ol(a, a.U)),this.Fc()):a.isVisible()&&a.U.I()&&this.oa(ol(a,a.U));this.ye()}; E.prototype.rf=function(a){a.Qt();if(a instanceof T){if(this.dp.remove(a),a instanceof V){var b=a.Da;null===b?this.Kl.remove(a):b.ap.remove(a);b=a.Tb;null!==b&&(b.g=null)}}else a instanceof W?this.Xo.remove(a):a instanceof jh||this.Ab.remove(a);var c=this;Pm(a,function(a){Um(c,a)});b=a.data;null!==b&&(a instanceof jh||(a instanceof W?this.Sj.remove(b):this.Ii.remove(b)),Pm(a,function(a){Vm(c,a)}));this.ug.remove(a);Tm(a)?(a.U.I()&&this.oa(ol(a,a.U)),this.Fc()):a.isVisible()&&a.U.I()&&this.oa(ol(a, a.U));this.ye()};E.prototype.remove=E.prototype.remove=function(a){w.G(a,R,E,"remove:part");Wm(this,a,!0)};function Wm(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.jb=!1,b.Ng=!1,b.J(Xm),c&&b.xn(),c=d.rf(-1,b,!1),0<=c&&a.cd(Ff,"parts",d,b,null,c,null),a=b.Sx,null!==a&&a(b,d,null))} E.prototype.removeParts=E.prototype.tB=function(a,b){if(w.isArray(a))for(var c=w.bb(a),d=0;dd&&this.Fc()}; E.prototype.addLayerAfter=function(a,b){Ym(this,a,b);a.Tc(this);var c=this.dc,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.qe&&this.cd(Ff,"layers",this,a,null,d,null));for(var e=c.count,f=0;fd&&this.Fc()}; E.prototype.removeLayer=function(a){w.G(a,pg,E,"removeLayer:layer");a.g!==this&&w.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.dc,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ab.copy().i;b.next();){var d=b.value,e=d.ag;d.ag=e!==a.name?e:""}null!==this.qe&&this.cd(Ff,"layers",this,a,null,c,null);this.oa();this.Fc()}}};E.prototype.findLayer=E.prototype.Zt=function(a){for(var b=this.Tx;b.next();){var c=b.value;if(c.name===a)return c}return null}; E.prototype.addModelChangedListener=E.prototype.nH=function(a){w.j(a,"function",E,"addModelChangedListener:listener");null===this.hh&&(this.hh=new H("function"));this.hh.add(a);this.$.kn(a)};E.prototype.removeModelChangedListener=function(a){w.j(a,"function",E,"removeModelChangedListener:listener");null!==this.hh&&(this.hh.remove(a),0===this.hh.count&&(this.hh=null));this.$.Qu(a)}; E.prototype.addChangedListener=E.prototype.kn=function(a){w.j(a,"function",E,"addChangedListener:listener");null===this.Di&&(this.Di=new H("function"));this.Di.add(a)};E.prototype.removeChangedListener=E.prototype.Qu=function(a){w.j(a,"function",E,"removeChangedListener:listener");null!==this.Di&&(this.Di.remove(a),0===this.Di.count&&(this.Di=null))};E.prototype.lx=function(a){this.fb||this.ja.rF(a);a.Dc!==Df&&(this.ri=!0);if(null!==this.Di)for(var b=this.Di,c=b.length,d=0;da.Ah&&(c=a.Ah);e=w.xb(a.$a.x+h/b-h/c,a.$a.y+k/b-k/c);a.position=e;w.v(e);a.rb=c;a.Mu(d,a.sb,b,c,!1);a.Wc=!1;Ql(a, !1);c=a.Ka;c.rc&&jl(c,b,a.rb);a.oa();bm(a)}} E.prototype.Mu=function(a,b,c,d,e){a.L(b)||(void 0===e&&(e=!1),e||bm(this),Ol(this),d=this.Tb,null===d||!d.Px||this.Sl!==oh||e||a.width===b.width&&a.height===b.height||d.J(),d=this.Xa,!0===this.dh&&d instanceof hh&&(this.Q.da=this.SB(this.Q.Ce),Ck(d,this)),this.Wc||this.wF(a,b),em(this),this.nh.scale=c,this.nh.position.x=a.x,this.nh.position.y=a.y,this.nh.bounds.set(a),this.nh.isScroll=e,this.Aa("ViewportBoundsChanged",this.nh,a),this.YA&&this.links.each(function(a){a.em&&a.U.Zf(b)&&a.Wb()}))}; function em(a,b){void 0===b&&(b=null);var c=a.td;if(null!==c&&c.visible){for(var d=w.sm(),e=1,f=1,h=c.xa.n,k=h.length,l=0;ln||($m(m.Hb)?f=f*n/ze(f,n):e=e*n/ze(e,n))}h=c.Ix;d.m(f*h.width,e*h.height);h=f=l=k=0;if(null!==b)k=b.width,l=b.height,f=b.x,h=b.y;else{e=w.vf();f=a.sb;e.m(f.x,f.y,f.width,f.height);for(h=a.yw.i;h.next();)f=h.value.sb,f.I()&&ab(e,f.x,f.y,f.width,f.height);if(!e.I()){w.Bb(e);return}k=e.width;l=e.height;f=e.x;h=e.y;w.Bb(e)}c.width=k+2*d.width;c.height= l+2*d.height;e=w.K();Na(f,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);w.Kk(d);c.V.location=e;w.v(e)}}E.prototype.clearSelection=E.prototype.oA=function(){var a=0a&&w.Fa(a,">= 0",E,"scrollHorizontalLineChange"),this.Fw=a,this.h("scrollHorizontalLineChange",b,a))}); w.defineProperty(E,{Wu:"scrollVerticalLineChange"},function(){return this.Jw},function(a){var b=this.Jw;b!==a&&(w.j(a,"number",E,"scrollVerticalLineChange"),0>a&&w.Fa(a,">= 0",E,"scrollVerticalLineChange"),this.Jw=a,this.h("scrollVerticalLineChange",b,a))});w.defineProperty(E,{Q:"lastInput"},function(){return this.Rb},function(a){this.Rb=a});w.defineProperty(E,{Ec:"firstInput"},function(){return this.Pi},function(a){this.Pi=a}); w.defineProperty(E,{ic:"currentCursor"},function(){return this.Av},function(a){""===a&&(a=this.rr);if(this.Av!==a){w.j(a,"string",E,"currentCursor");var b=this.yb,c=this.Ob;if(null!==b){this.Av=a;var d=b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursor===d&&(b.style.cursor="-webkit-"+a,c.style.cursor="-webkit-"+a,b.style.cursor===d&&(b.style.cursor="-moz-"+a,c.style.cursor="-moz-"+a,b.style.cursor===d&&(b.style.cursor=a,c.style.cursor=a)))}}}); w.defineProperty(E,{RK:"defaultCursor"},function(){return this.rr},function(a){""===a&&(a="auto");var b=this.rr;b!==a&&(w.j(a,"string",E,"defaultCursor"),this.rr=a,this.h("defaultCursor",b,a))});w.defineProperty(E,{click:"click"},function(){return this.Ei},function(a){var b=this.Ei;b!==a&&(null!==a&&w.j(a,"function",E,"click"),this.Ei=a,this.h("click",b,a))}); w.defineProperty(E,{Vt:"doubleClick"},function(){return this.Mi},function(a){var b=this.Mi;b!==a&&(null!==a&&w.j(a,"function",E,"doubleClick"),this.Mi=a,this.h("doubleClick",b,a))});w.defineProperty(E,{sA:"contextClick"},function(){return this.Gi},function(a){var b=this.Gi;b!==a&&(null!==a&&w.j(a,"function",E,"contextClick"),this.Gi=a,this.h("contextClick",b,a))}); w.defineProperty(E,{iB:"mouseOver"},function(){return this.aj},function(a){var b=this.aj;b!==a&&(null!==a&&w.j(a,"function",E,"mouseOver"),this.aj=a,this.h("mouseOver",b,a))});w.defineProperty(E,{hB:"mouseHover"},function(){return this.$i},function(a){var b=this.$i;b!==a&&(null!==a&&w.j(a,"function",E,"mouseHover"),this.$i=a,this.h("mouseHover",b,a))}); w.defineProperty(E,{gB:"mouseHold"},function(){return this.Zi},function(a){var b=this.Zi;b!==a&&(null!==a&&w.j(a,"function",E,"mouseHold"),this.Zi=a,this.h("mouseHold",b,a))});w.defineProperty(E,{dJ:"mouseDragOver"},function(){return this.sw},function(a){var b=this.sw;b!==a&&(null!==a&&w.j(a,"function",E,"mouseDragOver"),this.sw=a,this.h("mouseDragOver",b,a))}); w.defineProperty(E,{fB:"mouseDrop"},function(){return this.Yi},function(a){var b=this.Yi;b!==a&&(null!==a&&w.j(a,"function",E,"mouseDrop"),this.Yi=a,this.h("mouseDrop",b,a))});w.defineProperty(E,{OB:"toolTip"},function(){return this.jj},function(a){var b=this.jj;b!==a&&(this.jj=a,this.h("toolTip",b,a))});w.defineProperty(E,{contextMenu:"contextMenu"},function(){return this.Hi},function(a){var b=this.Hi;b!==a&&(this.Hi=a,this.h("contextMenu",b,a))}); w.defineProperty(E,{pb:"commandHandler"},function(){return this.$y},function(a){var b=this.$y;b!==a&&(w.G(a,rg,E,"commandHandler"),null!==a.g&&w.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Tc(null),this.$y=a,a.Tc(this))});w.defineProperty(E,{Va:"toolManager"},function(){return this.$z},function(a){var b=this.$z;b!==a&&(w.G(a,hh,E,"toolManager"),null!==a.g&&w.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Tc(null),this.$z=a,a.Tc(this))}); w.defineProperty(E,{Tt:"defaultTool"},function(){return this.fz},function(a){var b=this.fz;b!==a&&(w.G(a,qg,E,"defaultTool"),this.fz=a,this.Xa===b&&(this.Xa=a))});w.defineProperty(E,{Xa:"currentTool"},function(){return this.cz},function(a){var b=this.cz;null!==b&&(b.sa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.Tt);null!==a&&(w.G(a,qg,E,"currentTool"),this.cz=a,a.Tc(this),a.doStart())});w.u(E,{selection:"selection"},function(){return this.Mw}); w.defineProperty(E,{VI:"maxSelectionCount"},function(){return this.ow},function(a){var b=this.ow;if(b!==a)if(w.j(a,"number",E,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.ow=a,this.h("maxSelectionCount",b,a),!this.ja.lb&&(a=this.selection.count-a,0= 0",E,"maxSelectionCount")}); w.defineProperty(E,{hJ:"nodeSelectionAdornmentTemplate"},function(){return this.tw},function(a){var b=this.tw;b!==a&&(w.G(a,jh,E,"nodeSelectionAdornmentTemplate"),this.tw=a,this.h("nodeSelectionAdornmentTemplate",b,a))});w.defineProperty(E,{lI:"groupSelectionAdornmentTemplate"},function(){return this.Qv},function(a){var b=this.Qv;b!==a&&(w.G(a,jh,E,"groupSelectionAdornmentTemplate"),this.Qv=a,this.h("groupSelectionAdornmentTemplate",b,a))}); w.defineProperty(E,{OI:"linkSelectionAdornmentTemplate"},function(){return this.jw},function(a){var b=this.jw;b!==a&&(w.G(a,jh,E,"linkSelectionAdornmentTemplate"),this.jw=a,this.h("linkSelectionAdornmentTemplate",b,a))});w.u(E,{dm:"highlighteds"},function(){return this.Uv}); w.defineProperty(E,{ri:"isModified"},function(){var a=this.ja;return a.isEnabled?null!==a.sj?!0:this.aw&&this.ah!==a.wj:this.aw},function(a){if(this.aw!==a){w.j(a,"boolean",E,"isModified");this.aw=a;var b=this.ja;!a&&b.isEnabled&&(this.ah=b.wj);a||cn(this)}});function cn(a){var b=a.ri;a.oE!==b&&(a.oE=b,a.Aa("Modified"))} w.defineProperty(E,{$:"model"},function(){return this.qe},function(a){var b=this.qe;if(b!==a){w.G(a,F,E,"model");this.Xa.doCancel();null!==b&&b.ja!==a.ja&&b.ja.DF&&w.k("Do not replace a Diagram.model while a transaction is in progress.");Fl(this,!0);this.bh=!1;this.Go=!0;this.ah=-2;this.Tf=!1;var c=this.Zd;this.Zd=!0;this.Ka.Wn("Model");null!==b&&(null!==this.hh&&this.hh.each(function(a){b.Qu(a)}),b.Qu(this.yD));this.qe=a;a.kn(this.xD);dn(this,a.Og);a instanceof Q&&en(this,a.zh);a.Qu(this.xD);a.kn(this.yD); null!==this.hh&&this.hh.each(function(b){a.kn(b)});this.Zd=c;this.Wc||this.oa();null!==b&&(a.ja.isEnabled=b.ja.isEnabled)}});w.defineProperty(E,{Ua:null},function(){return this.qD},function(a){this.qD=a});w.u(E,{Xx:null},function(){return this.VG}); function xl(a,b){if(b.$===a.$){var c=b.Dc,d=b.propertyName;if(c===Df&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.Va,c.gf.each(function(b){b.Tc(a)}),c.dg.each(function(b){b.Tc(a)}),c.eg.each(function(b){b.Tc(a)}),a.Zd||a.bh||(a.wr=!0,a.Go&&(a.Tf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Ka;e.df&&!a.fb&&e.Hh();a.Aa("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Ka,e.df&&!a.fb&&e.Hh());else if(a.Ua){a.Ua=!1;try{var f=b.tf;if(""!==f)if(c===Cf){if("linkFromKey"===f){var h= b.object,k=a.Xf(h);if(null!==k){var l=b.newValue,m=a.Ne(l);k.Y=m}}else if("linkToKey"===f)h=b.object,k=a.Xf(h),null!==k&&(l=b.newValue,m=a.Ne(l),k.Z=m);else if("linkFromPortId"===f){if(h=b.object,k=a.Xf(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.Mg=n)}}else if("linkToPortId"===f)h=b.object,k=a.Xf(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.Ih=n));else if("nodeGroupKey"===f){var h=b.object,p=a.vh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Ne(q);p.Da=r instanceof V?r: null}else p.Da=null}}else if("linkLabelKeys"===f){if(h=b.object,k=a.Xf(h),null!==k){var s=b.oldValue,u=b.newValue;if(w.isArray(s))for(var t=w.bb(s),x=0;xl)){var m=l;nn(k)&&m++;k.rf(m,!0);on(k,m,l)}}}}function Rm(a,b){var c=b.hk;if(w.isArray(c)){var d=a.Km.ka(c);if(null===d)d=[],d.push(b),a.Km.add(c,d);else{for(c=0;cthis.scale&&(this.scale=a)):w.Fa(a,"> 0",E,"minScale"))}); w.defineProperty(E,{Ah:"maxScale"},function(){return this.nw},function(a){w.Bd(a,E,"maxScale");var b=this.nw;b!==a&&(0 0",E,"maxScale"))});w.defineProperty(E,{zi:"zoomPoint"},function(){return this.Zw},function(a){this.Zw.L(a)||(w.G(a,y,E,"zoomPoint"),this.Zw=a=a.S())}); w.defineProperty(E,{rA:"contentAlignment"},function(){return this.Cm},function(a){var b=this.Cm;b.L(a)||(w.G(a,L,E,"contentAlignment"),this.Cm=a=a.S(),this.h("contentAlignment",b,a),Ql(this,!1))});w.defineProperty(E,{iL:"initialContentAlignment"},function(){return this.Lo},function(a){var b=this.Lo;b.L(a)||(w.G(a,L,E,"initialContentAlignment"),this.Lo=a=a.S(),this.h("initialContentAlignment",b,a))}); w.defineProperty(E,{padding:"padding"},function(){return this.lf},function(a){"number"===typeof a?a=new hb(a):w.G(a,hb,E,"padding");var b=this.lf;b.L(a)||(this.lf=a=a.S(),this.Fc(),this.h("padding",b,a))});w.u(E,{hg:"nodes"},function(){return this.dp.i});w.u(E,{links:"links"},function(){return this.Xo.i});w.u(E,{Hj:"parts"},function(){return this.Ab.i}); E.prototype.findTopLevelNodesAndLinks=function(){for(var a=new I(R),b=this.dp.i;b.next();){var c=b.value;c.eq&&a.add(c)}for(b=this.Xo.i;b.next();)c=b.value,c.eq&&a.add(c);return a.i};E.prototype.findTopLevelGroups=function(){return this.Kl.i};w.defineProperty(E,{Tb:"layout"},function(){return this.oe},function(a){var b=this.oe;b!==a&&(w.G(a,sg,E,"layout"),null!==b&&(b.g=null,b.group=null),this.oe=a,a.g=this,a.group=null,this.Pj=!0,this.h("layout",b,a),this.ye())}); E.prototype.layoutDiagram=function(a){Ii(this);a&&un(this,!0);fm(this,!1)};function un(a,b){for(var c=a.Kl.i;c.next();)Bn(a,c.value,b);null!==a.Tb&&(b?a.Tb.sf=!1:a.Tb.J())}function Bn(a,b,c){if(null!==b){for(var d=b.ap.i;d.next();)Bn(a,d.value,c);null!==b.Tb&&(c?b.Tb.sf=!1:b.Tb.J())}} function fm(a,b){if(a.Pj&&!a.gz){var c=a.Ua;a.Ua=!0;var d=a.ja.wi,e=a.Tb;try{0===d&&a.Kb("Layout");var f=a.Ka;1>=d&&!f.df&&!f.rc&&(b||f.Wn("Layout"));a.Pj=!1;for(var h=a.Kl.i;h.next();)Cn(a,h.value,b,d);e.sf||(!b||e.HF||0===d?(e.doLayout(a),Ii(a),e.sf=!0):a.Pj=!0)}finally{0===d&&a.Yc("Layout"),a.Pj=!e.sf,a.Ua=c}}} function Cn(a,b,c,d){if(null!==b){for(var e=b.ap.i;e.next();)Cn(a,e.value,c,d);e=b.Tb;null===e||e.sf||(!c||e.HF||0===d?(b.Un=!b.location.I(),e.doLayout(b),b.J(Dn),km(a,b),e.sf=!0):a.Pj=!0)}}w.defineProperty(E,{Ud:"isTreePathToChildren"},function(){return this.dw},function(a){var b=this.dw;if(b!==a&&(w.j(a,"boolean",E,"isTreePathToChildren"),this.dw=a,this.h("isTreePathToChildren",b,a),!this.ja.lb))for(a=this.hg;a.next();)En(a.value)}); E.prototype.findTreeRoots=function(){for(var a=new H(T),b=this.hg;b.next();){var c=b.value;c.eq&&null===c.zn()&&a.add(c)}return a.i};w.defineProperty(E,{TB:"treeCollapsePolicy"},function(){return this.Uw},function(a){var b=this.Uw;b!==a&&(a!==vl&&a!==an&&a!==bn&&w.k("Unknown Diagram.treeCollapsePolicy: "+a),this.Uw=a,this.h("treeCollapsePolicy",b,a))});w.defineProperty(E,{xh:null},function(){return this.fD},function(a){this.fD=a}); function ul(a){function b(a){var b=a.toLowerCase(),h=new H("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ma("string",H),d=new ma("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified"); b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.iz=c;a.hz=d} function oa(a,b){var c=a.hz.ka(b);return null!==c?c:a.hz.ka(b.toLowerCase())}function Fn(a,b){var c=a.iz.ka(b);if(null!==c)return c;c=a.iz.ka(b.toLowerCase());if(null!==c)return c;w.k("Unknown DiagramEvent name: "+b);return null}E.prototype.addDiagramListener=E.prototype.$w=function(a,b){w.j(a,"string",E,"addDiagramListener:name");w.j(b,"function",E,"addDiagramListener:listener");var c=Fn(this,a);null!==c&&c.add(b)}; E.prototype.removeDiagramListener=E.prototype.sB=function(a,b){w.j(a,"string",E,"removeDiagramListener:name");w.j(b,"function",E,"addDiagramListener:listener");var c=Fn(this,a);null!==c&&c.remove(b)};E.prototype.raiseDiagramEvent=E.prototype.Aa=function(a,b,c){var d=Fn(this,a),e=new Af;e.g=this;a=oa(this,a);null!==a&&(e.name=a);void 0!==b&&(e.KB=b);void 0!==c&&(e.nB=c);b=d.length;if(1===b)d=d.ea(0),d(e);else if(0!==b)for(c=d.xc(),a=0;a=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.sb,f=a.scale,e=w.kg(0,0,e.width*f,e.height*f),h=w.xb(0,0);if(b.x>=e.x&&b.xe.x+e.width-d.right&&(k=Math.max(a.Vu,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.ye.y+e.height-d.bottom&&(k=Math.max(a.Wu,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Pc(cd)||(c=new y(c.x+h.x/f,c.y+h.y/f));w.Bb(e);w.v(h);return c}E.prototype.makeSvg=E.prototype.makeSVG=function(a){void 0===a&&(a=new ra);a.context="svg";a=Nn(this,a);return null!==a?a.qm:null}; E.prototype.makeImage=function(a){void 0===a&&(a=new ra);var b=(a.document||document).createElement("img");b.src=this.QI(a);return b}; E.prototype.makeImageData=E.prototype.QI=function(a){void 0===a&&(a=new ra);var b=Nn(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.Fk.getImageData(0,0,b.width,b.height);case "blob":b=b.Od;c=a.callback;if("function"!==typeof c){w.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.');break}if("function"===typeof b.toBlob)return b.toBlob(c,a.type,a.details),"toBlob";if("function"=== typeof b.msToBlob)return c(b.msToBlob()),"msToBlob";c(null);break;default:return b.toDataURL(a.type,a.details)}}return""};var On=!1; function Nn(a,b){a.Ka.Hh();a.cg();if(null===a.yb)return null;"object"!==typeof b&&w.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var f=b.maxSize;void 0===b.maxSize&&(c=!0,f="svg"===b.context?new ia(Infinity,Infinity):new ia(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r= b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new hb(l):l instanceof hb||w.k("MakeImage padding must be a Margin or a number.");l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.hf.Ke(!0);var s=new Vc(null,p),u=s.Fk;if(!(d||e||k||h)){s.width=a.Fb+Math.ceil(l.left+l.right);s.height=a.Eb+Math.ceil(l.top+l.bottom);if("svg"===b.context)return u=new Oc(s.Od, p,q),Lm(a,u,l,new ia(s.width,s.height),a.rb,a.$a,k,m,r,n),u;a.yr=!1;Lm(a,u,l,new ia(s.width,s.height),a.rb,a.$a,k,m,r,n);a.yr=!0;return s}var t=a.pb.sx,x=new y(0,0),v=a.be.copy();v.zG(a.padding);if(r)for(var z=!0,z=a.dc.n,A=z.length,K=0;Kt?(e=t,h=v.width,ba=v.height):(h=f.width,ba=f.height)):(h=v.width*e,ba=v.height*e):(e=t,h=v.width,ba=v.height);null!==l?(h+=S,ba+=z):l=new hb(0);null!==f&&(d=f.width,f=f.height,"svg"!==b.context&&c&&!On&&(h>d||ba>f)&&(w.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(ba)+ " vs 2000x2000) Consider increasing the max size."),On=!0),isNaN(d)&&(d=2E3),isNaN(f)&&(f=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(f)&&(ba=Math.min(ba,f)));s.width=Math.ceil(h);s.height=Math.ceil(ba);if("svg"===b.context)return u=new Oc(s.Od,p,q),Lm(a,u,l,new ia(Math.ceil(h),Math.ceil(ba)),e,x,k,m,r,n),u;a.yr=!1;Lm(a,u,l,new ia(Math.ceil(h),Math.ceil(ba)),e,x,k,m,r,n);a.yr=!0;return s} E.inherit=function(a,b){w.j(a,"function",E,"inherit");w.j(b,"function",E,"inherit");b.dH&&w.k("Cannot inherit from "+w.pf(b));w.La(a,b)};function Dl(){this.ZD=null;this.fH="63ad05bbe23a1786468a4c741b6d2";this.Ni=this.fH===this._tk?!0:null} Dl.prototype.um=function(a){a.hf.setTransform(a.wd,0,0,a.wd,0,0);if(null===this.Ni){var b="f",c=window[w.Jg("76a715b2f73f148a")][w.Jg("72ba13b5")];a=w.Jg;this.Ni=!0;if(window[a("7da7")]&&window[a("7da7")][a("76a115b6ed251eaf4692")]){var d=window[a("7da7")][a("76a115b6ed251eaf4692")],d=a(d).split(a("39e9"));if(!(6>d.length)){var e=a(d[1]).split(".");if("7da71ca0"===d[4]){var f=a(w[a("6cae19")]).split(".");if(e[0]>f[0]||e[0]===f[0]&&e[1]>=f[1]){f=c[a("76ad18b4f73e")];for(e=c[a("73a612b6fb191d")](a("35e7"))+ 2;ec&&a(d[2])!==a("7da71ca0ad381e90")&&(c=b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));0>c&&(c=b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));if(this.Ni=!(0<=c&&ce.length;)e+="9";e=e.substr(e.length-4);d=""+["gsh","gsf"][parseInt(e.substr(0,1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(e.substr(0, 1),10)%4];c[a("79a417a0f0181a8946")]=d;if(window.document[a("78a712aa")]){if(window.document[a("78a712aa")][a("7bb806b6ed32388c4a875b")](c),e=window[a("7dad0290ec3b0b91578e5b40007031bf")](c)[a("7dad0283f1390b81519f4645156528bf")](a("78a704b7e62456904c9b12701b6532a8")),window.document[a("78a712aa")][a("68ad1bbcf533388c4a875b")](c),e)if(-1!==e.indexOf(parseInt(b[1]+b[2],16))&&-1!==e.indexOf(parseInt(b[3]+b[4],16)))this.Ni=!1;else if(w.uu||w.cq||w.dq||w.UA)for(d="."+d,e=0;eb.timeStamp-a.ik)b.preventDefault();else if(a.fk)b.preventDefault();else{a.xd=a.Rb;a.Rb=c;Wl(a,a,b,c,!0);c.Gk=!0;c.te=b.detail;if(w.cq||w.dq)b.timeStamp-a.ikb.timeStamp-a.ik){b.preventDefault();return}a.ik=b.timeStamp}if(w.Gn&&null!==a.pt)a.pt=null,b.preventDefault();else{a.xd=a.Rb;a.Rb=c;Wl(a,a,b,c,!0);c.up=!0;c.te=b.detail;if(w.cq||w.dq)c.te=a.Vh;c.bubbles=b.bubbles;c.Jf=Yl(b);a.simulatedMouseUp(b,null,new y,c.Jf)||(a.doMouseUp(),Yh(a),am(c,b))}}};a.Tn=function(b){if(a.isEnabled){var c= a.xd;a.xd=a.Rb;a.Rb=c;Wl(a,a,b,c,!0);c.bubbles=!0;var d=0,e=0;void 0!==b.deltaX?(d=0Math.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(d=0Math.abs(b.wheelDeltaY)?-d:-e):c.oi=void 0!==b.wheelDelta?0n||Math.abs(m.y-b.screenY)>n)?a.Vh++:a.Vh=1;d.te=a.Vh;a.ik=b.timeStamp;a.gw.m(b.screenX,b.screenY);m=0;b.ctrlKey&&(m+=1);b.altKey&&(m+=2);b.shiftKey&&(m+=4);b.metaKey&&(m+=8);d.md=m;d.button=b.button;void 0===b.buttons||w.uu||(d.buttons=b.buttons);w.yh&&0===b.button&&b.ctrlKey&&(d.button=2);d.Gk=!1;d.up=!0;d.oi=0;d.tc=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.Jf=null===e?Yl(b): e.aa?e.aa:null;d.Be=null;a.simulatedMouseUp(b,null,new y,d.Jf)||(a.doMouseUp(),Yh(a),am(d,b),c&&(a.fk=!1))}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.pq=function(b){if(a.isEnabled){a.dh=!1;var c=a.Nz;c[b.pointerId]&&delete c[b.pointerId];c=a.gp;null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null);null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null);"touch"!==b.pointerType&&"pen"!==b.pointerType&&(b=a.Xa,b.cancelWaitAfter(),b.standardMouseOver())}};d.Ke(!0);Il(a)} function Pn(a){1a)&&w.Fa(a,"0 <= loc <= 1",ga,"addColorStop:loc");w.j(b,"string",ga,"addColorStop:color");null===this.Zg&&(this.Zg=new ma("number","string"));this.Zg.add(a,b);this.na===cg&&(this.type=og);this.$g=null}; w.defineProperty(ga,{type:"type"},function(){return this.na},function(a){this.P&&w.ma(this,a);w.ob(a,ga,ga,"type");this.na=a;this.start.Td()&&(a===og?this.start=Bb:a===Xc&&(this.start=Jb));this.end.Td()&&(a===og?this.end=Rb:a===Xc&&(this.end=Jb));this.$g=null});w.defineProperty(ga,{color:"color"},function(){return this.ro},function(a){this.P&&w.ma(this,a);this.ro=a;this.$g=null}); w.defineProperty(ga,{start:"start"},function(){return this.pp},function(a){this.P&&w.ma(this,a);w.G(a,L,ga,"start");this.pp=a.S();this.$g=null});w.defineProperty(ga,{end:"end"},function(){return this.Eo},function(a){this.P&&w.ma(this,a);w.G(a,L,ga,"end");this.Eo=a.S();this.$g=null});w.defineProperty(ga,{bv:"startRadius"},function(){return this.Pw},function(a){this.P&&w.ma(this,a);w.Bd(a,ga,"startRadius");0>a&&w.Fa(a,">= zero",ga,"startRadius");this.Pw=a;this.$g=null}); w.defineProperty(ga,{Wt:"endRadius"},function(){return this.Lv},function(a){this.P&&w.ma(this,a);w.Bd(a,ga,"endRadius");0>a&&w.Fa(a,">= zero",ga,"endRadius");this.Lv=a;this.$g=null});w.defineProperty(ga,{Ck:"colorStops"},function(){return this.Zg},function(a){this.P&&w.ma(this,a);this.Zg=a;this.$g=null});w.defineProperty(ga,{pattern:"pattern"},function(){return this.Aw},function(a){this.P&&w.ma(this,a);this.Aw=a;this.$g=null}); ga.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a),d=Math.floor(a+Math.random()*c).toString(16),e=Math.floor(a+Math.random()*c).toString(16),c=Math.floor(a+Math.random()*c).toString(16);2>d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+d+e+c};var Zn=(new Vc(null)).Fk,fa; ga.isValidColor=fa=function(a){if("black"===a)return!0;if(""===a)return!1;Zn.fillStyle="#000000";var b=Zn.fillStyle;Zn.fillStyle=a;if(Zn.fillStyle!==b)return!0;Zn.fillStyle="#FFFFFF";b=Zn.fillStyle;Zn.fillStyle=a;return Zn.fillStyle!==b};var $n=new Vn,ao=new Vn,bo=new Vn,co=new Vn;ga.lighten=function(a){return eo(a)}; ga.prototype.lightenBy=function(a,b){this.P&&w.ma(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Xn:b;if(this.type===cg)fo(this.color),this.color=ho(c,d);else if((this.type===og||this.type===Xc)&&null!==this.Ck)for(var e=this.Ck.i;e.next();)fo(e.value),this.addColorStop(e.key,ho(c,d));return this};var eo;ga.lightenBy=eo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Xn:c;fo(a);return ho(b,c)};ga.darken=function(a){return io(a)}; ga.prototype.darkenBy=function(a,b){this.P&&w.ma(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Xn:b;if(this.type===cg)fo(this.color),this.color=ho(-c,d);else if((this.type===og||this.type===Xc)&&null!==this.Ck)for(var e=this.Ck.i;e.next();)fo(e.value),this.addColorStop(e.key,ho(-c,d));return this};var io;ga.darkenBy=io=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Xn:c;fo(a);return ho(-b,c)}; function ho(a,b){switch(b){case Xn:var c=100*jo($n.Gc),d=100*jo($n.Fd),e=100*jo($n.bd);bo.Gc=.4124564*c+.3575761*d+.1804375*e;bo.Fd=.2126729*c+.7151522*d+.072175*e;bo.bd=.0193339*c+.119192*d+.9503041*e;bo.gg=$n.gg;c=ko(bo.Gc/lo[0]);d=ko(bo.Fd/lo[1]);e=ko(bo.bd/lo[2]);co.Gc=116*d-16;co.Fd=500*(c-d);co.bd=200*(d-e);co.gg=bo.gg;co.Gc=Math.min(100,Math.max(0,co.Gc+100*a));c=(co.Gc+16)/116;d=c-co.bd/200;bo.Gc=lo[0]*mo(co.Fd/500+c);bo.Fd=lo[1]*(co.Gc>no*oo?Math.pow(c,3):co.Gc/no);bo.bd=lo[2]*mo(d);bo.gg= co.gg;c=-.969266*bo.Gc+1.8760108*bo.Fd+.041556*bo.bd;d=.0556434*bo.Gc+-.2040259*bo.Fd+1.0572252*bo.bd;$n.Gc=255*po((3.2404542*bo.Gc+-1.5371385*bo.Fd+-.4985314*bo.bd)/100);$n.Fd=255*po(c/100);$n.bd=255*po(d/100);$n.gg=bo.gg;$n.Gc=Math.round($n.Gc);255<$n.Gc?$n.Gc=255:0>$n.Gc&&($n.Gc=0);$n.Fd=Math.round($n.Fd);255<$n.Fd?$n.Fd=255:0>$n.Fd&&($n.Fd=0);$n.bd=Math.round($n.bd);255<$n.bd?$n.bd=255:0>$n.bd&&($n.bd=0);return"rgba("+$n.Gc+", "+$n.Fd+", "+$n.bd+", "+$n.gg+")";case Yn:var e=$n.Gc/255,f=$n.Fd/ 255,h=$n.bd/255,k=Math.max(e,f,h),d=Math.min(e,f,h),l=k-d,d=(k+d)/2;if(0===l)c=e=0;else{switch(k){case e:c=(f-h)/l%6;break;case f:c=(h-e)/l+2;break;case h:c=(e-f)/l+4}c*=60;0>c&&(c+=360);e=l/(1-Math.abs(2*d-1))}ao.Gc=Math.round(c);ao.Fd=Math.round(100*e);ao.bd=Math.round(100*d);ao.gg=$n.gg;ao.bd=Math.min(100,Math.max(0,ao.bd+100*a));return"hsla("+ao.Gc+", "+ao.Fd+"%, "+ao.bd+"%, "+ao.gg+")";default:return w.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}} function fo(a){Zn.clearRect(0,0,1,1);Zn.fillStyle="#000000";var b=Zn.fillStyle;Zn.fillStyle=a;Zn.fillStyle!==b?(Zn.fillRect(0,0,1,1),a=Zn.getImageData(0,0,1,1).data,$n.Gc=a[0],$n.Fd=a[1],$n.bd=a[2],$n.gg=a[3]/255):(Zn.fillStyle="#FFFFFF",Zn.fillStyle=a,$n.Gc=0,$n.Fd=0,$n.bd=0,$n.gg=1)}function jo(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function po(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var oo=216/24389,no=24389/27,lo=[95.047,100,108.883]; function ko(a){return a>oo?Math.pow(a,1/3):(no*a+16)/116}function mo(a){var b=a*a*a;return b>oo?b:(116*a-16)/no} function G(){w.nc(this);this.M=4225027;this.Bc=1;this.ej=null;this.Sb="";this.cc=this.Ib=null;this.$a=(new y(NaN,NaN)).freeze();this.Te=Fd;this.Zh=qd;this.Yh=Dd;this.kd=new ka;this.Wk=new ka;this.Wi=new ka;this.rb=this.Co=1;this.lg=0;this.Eg=qo;this.Qm=ed;this.ud=(new B(NaN,NaN,NaN,NaN)).freeze();this.oc=(new B(NaN,NaN,NaN,NaN)).freeze();this.Mc=(new B(0,0,NaN,NaN)).freeze();this.W=this.Rs=this.Ss=null;this.wm=this.me=qc;this.dt=0;this.gj=1;this.br=0;this.Fi=1;this.tt=null;this.ht=-Infinity;this.an= 0;this.bn=cd;this.cn=mj;this.kr="";this.yc=this.ia=null;this.po=-1;this.gn=this.ng=this.kl=this.op=null;this.Oz=pj;this.Xm=null}w.ni(G);w.ga("GraphObject",G); G.prototype.cloneProtected=function(a){a.M=this.M|6144;a.Bc=this.Bc;a.Sb=this.Sb;a.Ib=this.Ib;a.cc=this.cc;a.$a.assign(this.$a);a.Te=this.Te.S();a.Zh=this.Zh.S();a.Yh=this.Yh.S();a.Wi=this.Wi.copy();a.rb=this.rb;a.lg=this.lg;a.Eg=this.Eg;a.Qm=this.Qm.S();a.ud.assign(this.ud);a.oc.assign(this.oc);a.Mc.assign(this.Mc);a.Rs=this.Rs;null!==this.W&&(a.W=this.W.copy());a.me=this.me.S();a.wm=this.wm.S();a.dt=this.dt;a.gj=this.gj;a.br=this.br;a.Fi=this.Fi;a.tt=this.tt;a.ht=this.ht;a.an=this.an;a.bn=this.bn.S(); a.cn=this.cn;a.kr=this.kr;null!==this.ia&&(a.ia=this.ia.copy());a.yc=this.yc;a.po=this.po;null!==this.kl&&(a.kl=w.Ul(this.kl));null!==this.ng&&(a.ng=this.ng.copy());a.gn=this.gn};G.prototype.addCopyProperty=G.prototype.kH=function(a){var b=this.kl;if(w.isArray(b))for(var c=0;ck;)k+=f[n++%l],p=!p;q=!1}else k=f[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}} G.prototype.raiseChangedEvent=G.prototype.cd=function(a,b,c,d,e,f,h){var k=this.V;if(null!==k&&(k.Xn(a,b,c,d,e,f,h),Co(this)&&c===this&&a===Cf&&Do(this,k,b),c===k&&0!==(k.M&16777216)&&null!==k.data))for(a=this.xa.n,c=a.length,d=0;da&&(a+=360));return a};G.prototype.getDocumentScale=G.prototype.vj=function(){if(0!==(this.M&4096)===!1)return this.Co;var a=this.rb;return null!==this.R?a*this.R.vj():a};G.prototype.getLocalPoint=G.prototype.iF=function(a,b){void 0===b&&(b=new y);b.assign(a);this.ph.wh(b);return b}; G.prototype.getNearestIntersectionPoint=G.prototype.jF=function(a,b,c){return this.Cn(a.x,a.y,b.x,b.y,c)};g=G.prototype;g.Cn=function(a,b,c,d,e){var f=this.transform,h=1/(f.m11*f.m22-f.m12*f.m21),k=f.m22*h,l=-f.m12*h,m=-f.m21*h,n=f.m11*h,p=h*(f.m21*f.dy-f.m22*f.dx),q=h*(f.m12*f.dx-f.m11*f.dy);if(null!==this.nn)return f=this.U,ke(f.left,f.top,f.right,f.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.m(0,0);d=this.Ja;c=ke(0,0,d.width,d.height,h,a,b,c,e);e.transform(f);return c}; function yk(a,b,c,d,e){if(!1!==sm(a)){var f=a.margin,h=f.right+f.left,f=f.top+f.bottom;b=Math.max(b-h,0);c=Math.max(c-f,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-f,0);var h=a.angle,f=0,f=a.Ca,k=0;a instanceof Y&&(k=a.mb);90===h||270===h?(b=isFinite(f.height)?f.height+k:b,c=isFinite(f.width)?f.width+k:c):(b=isFinite(f.width)?f.width+k:b,c=isFinite(f.height)?f.height+k:c);var f=d||0,k=e||0,l=a instanceof C;switch(Ho(a,!0)){case Qj:k=f=0;l&&(c=b=Infinity);break;case Ee:isFinite(b)&&b>d&&(f=b);isFinite(c)&& c>e&&(k=c);break;case so:isFinite(b)&&b>d&&(f=b);k=0;l&&(c=Infinity);break;case ro:isFinite(c)&&c>e&&(k=c),f=0,l&&(b=Infinity)}var l=a.Hf,m=a.si;f>l.width&&m.widthl.height&&m.heighta.height||this.zf.Ge>a.width))&&(c=!0);this.M=c?this.M|256:this.M&-257;this.oc.I()|| w.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.oc.toString());this.by(f,this.oc);Io(this,!1);w.Bb(f)};g.pj=function(){}; function Jo(a,b,c,d,e){var f=a.U;f.x=b;f.y=c;f.width=d;f.height=e;if(!a.Ca.I()){f=a.ud;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=f.width+b;f=f.height+h;d+=b;e+=h;b=Ho(a,!0);c===d&&f===e&&(b=Qj);switch(b){case Qj:if(c>d||f>e)dm(a,!0),yk(a,c>d?d:c,f>e?e:f);break;case Ee:dm(a,!0);yk(a,d,e,0,0);break;case so:dm(a,!0);yk(a,d,f,0,0);break;case ro:dm(a,!0),yk(a,c,e,0,0)}}} g.by=function(a,b){var c=this.V;null!==c&&null!==c.g&&(c.zq!==this&&c.hG!==this&&c.vB!==this||Ko(c,!0),this.oa(),Va(a,b)||(c.Qk(),this.Gs(c)))};g.Gs=function(a){null!==this.le&&(Ko(a,!0),a instanceof T&&Lo(a,this))};w.defineProperty(G,{$n:"shadowVisible"},function(){return this.gn},function(a){var b=this.gn;b!==a&&(this.gn=a,this.oa(),this.h("shadowVisible",b,a))}); G.prototype.ve=function(a,b){if(this.visible){var c=this.oc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=this.opacity;if(0!==d){var e=1;1!==d&&(e=a.globalAlpha,a.globalAlpha=e*d);if(a instanceof Oc)a:{if(this.visible){var f=null,h=a.Qx;if(this instanceof C&&(this.type===Mo||this.type===No))Oo(this,a,b);else{var k=this.oc;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.R;0!==(this.M&4096)===!0&&Po(this);var c=0!==(this.M&256),n=!1;this instanceof Lh&&(a.font=this.font);if(c){n=m.Xg()?m.Ja:m.U;if(null!==this.ng)var p=this.ng,q=p.x,r=p.y,s=p.width,p=p.height;else q=Math.max(k.x,n.x),r=Math.max(k.y,n.y),s=Math.min(k.right,n.right)-q,p=Math.min(k.bottom,n.bottom)-r;if(q>k.width+k.x||k.x>n.width+n.x||r>k.height+k.y||k.y>n.height+n.y)break a;n=!0;Qc(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.yj()){var u=this;if(!u.isVisible())break a}a.uh.Ub=[1,0,0,1,0,0];this instanceof Lh&&1s.width+p||p>q+k||l>s.height+t||t>r+l)}if(l){k=0!==(this.M&256);a.Lp&&(k=!1);this instanceof Lh&&(a.font=this.font);if(k){l=h.Xg()?h.Ja:h.U;null!==this.ng?(p=this.ng,q=p.x,r=p.y,s=p.width,p=p.height):(q=Math.max(c.x,l.x),r=Math.max(c.y,l.y),s=Math.min(c.right,l.right)-q,p=Math.min(c.bottom,l.bottom)-r);if(q>c.width+c.x||c.x>l.width+l.x){1!==d&&(a.globalAlpha=e);return}a.save(); a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.yj()){if(!u.isVisible()){1!==d&&(a.globalAlpha=e);return}m&&(a.IB(n.x*b.scale*b.wd,n.y*b.scale*b.wd,u.Dg),a.ao(),a.shadowColor=u.en)}!0===this.$n?a.ao():!1===this.$n&&a.om();null!==this.cc&&(Qo(this,a,this.cc,!0,!0),this.cc instanceof ga&&this.cc.type===Xc?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),a.Kg(this.cc)):a.fillRect(c.x,c.y,c.width,c.height));f.vu()||a.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);m&&(null!==h&&0!==(h.M&512)||null!==h&&(h.type=== Hl||h.type===Oj)&&h.Cd()!==this)&&null===this.$n&&a.om();null!==this.Ib&&(l=this.Ja,n=c=0,u=l.width,l=l.height,q=0,this instanceof Y&&(l=this.Sa.cb,c=l.x,n=l.y,u=l.width,l=l.height,q=this.ji),Qo(this,a,this.Ib,!0,!1),this.Ib instanceof ga&&this.Ib.type===Xc?(a.beginPath(),a.rect(c-q/2,n-q/2,u+q,l+q),a.Kg(this.Ib)):a.fillRect(c-q/2,n-q/2,u+q,l+q));m&&(null!==this.Ib||null!==this.cc||null!==h&&0!==(h.M&512)||null!==h&&(h.type===Hl||h.type===Oj)&&h.Cd()!==this)?(Ro(this,!0),null===this.$n&&a.om()):Ro(this, !1);this.Hk(a,b);m&&0!==(this.M&512)===!0&&a.ao();this.yj()&&m&&a.om();k?(a.restore(),this instanceof C?a.Ke(!0):a.Ke(!1)):f.vu()||(h=1/(f.m11*f.m22-f.m12*f.m21),a.transform(f.m22*h,-f.m12*h,-f.m21*h,f.m11*h,h*(f.m21*f.dy-f.m22*f.dx),h*(f.m12*f.dx-f.m11*f.dy)))}}1!==d&&(a.globalAlpha=e)}}}}; function Oo(a,b,c){var d=a.oc;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.cc&&(Qo(a,b,a.cc,!0,!0),a.cc instanceof ga&&a.cc.type===Xc?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Kg(a.cc)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Ib&&(Qo(a,b,a.Ib,!0,!1),a.Ib instanceof ga&&a.Ib.type===Xc?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Kg(a.Ib)):b.fillRect(d.x,d.y,d.width,d.height)),a.Hk(b,c))}G.prototype.Hk=function(){}; function Qo(a,b,c,d,e){if(null!==c){var f=1,h=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===cg)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Ja,f=h.width,h=h.height;if(e)var l=a.U,f=l.width,h=l.height;var m=b instanceof Wc;if(m&&c.$g&&(c.type===Wn||c.so===f&&c.az===h))k=c.$g;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.U,f=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*f+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*f+c.end.offsetX;q=c.end.y*h+c.end.offsetY; l+=r;p+=r;n+=s;q+=s;if(c.type===og)k=b.createLinearGradient(l,n,p,q);else if(c.type===Xc)s=isNaN(c.Wt)?Math.max(f,h)/2:c.Wt,isNaN(c.bv)?(r=0,s=Math.max(f,h)/2):r=c.bv,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===Wn)try{k=b.createPattern(c.pattern,"repeat")}catch(u){k=null}else w.Gd(c.type,"Brush type");if(c.type!==Wn&&(e=c.Ck,null!==e))for(e=e.i;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.$g=k,null!==k&&(c.so=f,c.az=h),null===k&&c.type===Wn&&-1!==c.so)){c.so=-1;var t=a.g;null!==t&& -1===c.so&&w.setTimeout(function(){t.Pu()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}G.prototype.isContainedBy=G.prototype.gm=function(a){if(a instanceof C)a:{if(this!==a&&null!==a)for(var b=this.R;null!==b;){if(b===a){a=!0;break a}b=b.R}a=!1}else a=!1;return a};G.prototype.isVisibleObject=G.prototype.Cj=function(){if(!this.visible)return!1;var a=this.R;return null!==a?a.Cj():!0}; G.prototype.isEnabledObject=G.prototype.su=function(){for(var a=this instanceof C?this:this.R;null!==a&&a.isEnabled;)a=a.R;return null===a};w.defineProperty(G,{WE:"enabledChanged"},function(){return null!==this.ia?this.ia.Cr:null},function(a){xo(this);var b=this.ia.Cr;b!==a&&(null!==a&&w.j(a,"function",G,"enabledChanged"),this.ia.Cr=a,this.h("enabledChanged",b,a))}); function Po(a){if(0!==(a.M&2048)===!0){var b=a.kd;b.reset();if(!a.oc.I()||!a.ud.I()){So(a,!1);return}b.translate(a.oc.x,a.oc.y);b.translate(-a.za.x,-a.za.y);var c=a.Ja;Fo(a,b,c.x,c.y,c.width,c.height);So(a,!1);To(a,!0)}0!==(a.M&4096)===!0&&(b=a.R,null===b?(a.Wk.set(a.kd),a.Co=a.scale,To(a,!1)):null!==b.ph&&(c=a.Wk,c.reset(),b.Xg()?c.multiply(b.Wk):null!==b.R&&c.multiply(b.R.Wk),c.multiply(a.kd),a.Co=a.scale*b.Co,To(a,!1)))} function Fo(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=Jb;a.yj()&&a.Gf.$c()&&(h=a.Gf);var k=w.K();if(a instanceof R&&a.bg!==a)for(c=a.bg,d=c.Ja,k.Zu(d.x,d.y,d.width,d.height,h),c.Wi.nb(k),k.offset(-c.za.x,-c.za.y),h=c.R;null!==h&&h!==a;)h.Wi.nb(k),k.offset(-h.za.x,-h.za.y),h=h.R;else k.Zu(c,d,e,f,h);b.rotate(a.angle,k.x,k.y);w.v(k)}}g=G.prototype;g.H=function(a){void 0===a&&(a=!1);if(!0!==sm(this)){dm(this,!0);Io(this,!0);var b=this.R;null===b||a||b.H()}}; g.bq=function(){!0!==sm(this)&&(dm(this,!0),Io(this,!0))};function Uo(a){if(!1===Gm(a)){var b=a.R;null!==b?b.H():a.yj()&&(b=a.g,null!==b&&(b.ug.add(a),a instanceof T&&a.$f(),b.ye()));Io(a,!0)}}g.Ri=function(){0!==(this.M&2048)===!1&&(So(this,!0),To(this,!0))};g.QA=function(){To(this,!0)};g.oa=function(){var a=this.V;null!==a&&a.oa()}; function Ho(a,b){var c=a.stretch,d=a.R;if(null!==d&&d.na===Vo)return Wo(a,d.ee(a.Vb),d.de(a.column),b);if(null!==d&&d.na===Hl&&d.Cd()===a)return Xo(a,Ee,b);if(c===qo){if(null!==d){if(d.na===Oj&&d.Cd()===a)return Xo(a,Ee,b);c=d.$d;return c===qo?Xo(a,Qj,b):Xo(a,c,b)}return Xo(a,Qj,b)}return Xo(a,c,b)} function Wo(a,b,c,d){var e=a.stretch;if(e!==qo)return Xo(a,e,d);var f=e=null;switch(b.stretch){case ro:f=!0;break;case Ee:f=!0}switch(c.stretch){case so:e=!0;break;case Ee:e=!0}b=a.R.$d;null===e&&(e=b===so||b===Ee);null===f&&(f=b===ro||b===Ee);return!0===e&&!0===f?Xo(a,Ee,d):!0===e?Xo(a,so,d):!0===f?Xo(a,ro,d):Xo(a,Qj,d)} function Xo(a,b,c){if(c)return b;if(b===Qj)return Qj;c=a.Ca;if(c.I())return Qj;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===so)return Qj;if(b===Ee)return ro}else{if(b===ro)return Qj;if(b===Ee)return so}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===ro)return Qj;if(b===Ee)return so}else{if(b===so)return Qj;if(b===Ee)return ro}return b} w.defineProperty(G,{yq:"segmentOrientation"},function(){return this.cn},function(a){var b=this.cn;b!==a&&(this.cn=a,this.H(),this.h("segmentOrientation",b,a),a===mj&&(this.angle=0))});w.defineProperty(G,{Pe:"segmentIndex"},function(){return this.ht},function(a){a=Math.round(a);var b=this.ht;b!==a&&(this.ht=a,this.H(),this.h("segmentIndex",b,a))}); w.defineProperty(G,{xB:"segmentFraction"},function(){return this.an},function(a){isNaN(a)?a=0:0>a?a=0:1a||1=a&&w.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.rb=a,this.Ri(),this.H(),this.h("scale",b,a))});w.defineProperty(G,{angle:"angle"},function(){return this.lg},function(a){var b=this.lg;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.lg=a,Yo(this),this.H(),this.Ri(),this.h("angle",b,a)))}); w.defineProperty(G,{Ca:"desiredSize"},function(){return this.Te},function(a){var b=a.width,c=a.height,d=this.Te,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Te=a=a.S(),this.H(),this instanceof Y&&this.ge(),this.h("desiredSize",d,a),Co(this)&&(a=this.V,null!==a&&(Do(this,a,"width"),Do(this,a,"height"))))}); w.defineProperty(G,{width:"width"},function(){return this.Te.width},function(a){var b=this.Te.width;b===a||isNaN(b)&&isNaN(a)||(b=this.Te,this.Te=a=(new ia(a,this.Te.height)).freeze(),this.H(),this instanceof Y&&this.ge(),this.h("desiredSize",b,a),Co(this)&&(a=this.V,null!==a&&Do(this,a,"width")))}); w.defineProperty(G,{height:"height"},function(){return this.Te.height},function(a){var b=this.Te.height;b===a||isNaN(b)&&isNaN(a)||(b=this.Te,this.Te=a=(new ia(this.Te.width,a)).freeze(),this.H(),this instanceof Y&&this.ge(),this.h("desiredSize",b,a),Co(this)&&(a=this.V,null!==a&&Do(this,a,"height")))}); w.defineProperty(G,{si:"minSize"},function(){return this.Zh},function(a){var b=this.Zh;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.Zh=a,this.H(),this.h("minSize",b,a))});w.defineProperty(G,{Hf:"maxSize"},function(){return this.Yh},function(a){var b=this.Yh;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Yh=a,this.H(),this.h("maxSize",b,a))});w.u(G,{za:"measuredBounds"},function(){return this.ud}); w.u(G,{Ja:"naturalBounds"},function(){return this.Mc},{configurable:!0});w.defineProperty(G,{margin:"margin"},function(){return this.Qm},function(a){"number"===typeof a&&(a=new hb(a));var b=this.Qm;b.L(a)||(this.Qm=a=a.S(),this.H(),this.h("margin",b,a))});w.u(G,{transform:null},function(){0!==(this.M&2048)===!0&&Po(this);return this.kd});w.u(G,{ph:null},function(){0!==(this.M&4096)===!0&&Po(this);return this.Wk}); w.defineProperty(G,{alignment:"alignment"},function(){return this.me},function(a){var b=this.me;b.L(a)||(a.Td()&&!a.Zc()&&w.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.me=a=a.S(),Uo(this),this.h("alignment",b,a))});w.defineProperty(G,{column:"column"},function(){return this.br},function(a){a=Math.round(a);var b=this.br;b!==a&&(0>a&&w.Fa(a,">= 0",G,"column"),this.br=a,this.H(),this.h("column",b,a))}); w.defineProperty(G,{zH:"columnSpan"},function(){return this.Fi},function(a){a=Math.round(a);var b=this.Fi;b!==a&&(1>a&&w.Fa(a,">= 1",G,"columnSpan"),this.Fi=a,this.H(),this.h("columnSpan",b,a))});w.defineProperty(G,{Vb:"row"},function(){return this.dt},function(a){a=Math.round(a);var b=this.dt;b!==a&&(0>a&&w.Fa(a,">= 0",G,"row"),this.dt=a,this.H(),this.h("row",b,a))}); w.defineProperty(G,{rowSpan:"rowSpan"},function(){return this.gj},function(a){a=Math.round(a);var b=this.gj;b!==a&&(1>a&&w.Fa(a,">= 1",G,"rowSpan"),this.gj=a,this.H(),this.h("rowSpan",b,a))});w.defineProperty(G,{By:"spanAllocation"},function(){return this.tt},function(a){var b=this.tt;b!==a&&(null!==a&&w.j(a,"function",G,"spanAllocation"),this.tt=a,this.H(),this.h("spanAllocation",b,a))}); w.defineProperty(G,{oh:"alignmentFocus"},function(){return this.wm},function(a){var b=this.wm;b.L(a)||(!a.Td()||a.Zc()||a.L(yb)&&this instanceof T||w.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.wm=a=a.S(),this.H(),this.h("alignmentFocus",b,a))}); w.defineProperty(G,{le:"portId"},function(){return this.Rs},function(a){var b=this.Rs;if(b!==a){var c=this.V;null===c||c instanceof T||(w.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&$o(c,this);this.Rs=a;null!==a&&null!==c&&(c.Pk=!0,ap(c,this));this.h("portId",b,a)}});function bp(a){var b=a.V;if(b instanceof T&&(null!==a.le||a===b.port)){var c=b.g;null===c||c.ja.lb||Lo(b,a)}} function Yo(a){var b=a.g;null===b||b.ja.lb||(a instanceof C?a instanceof T?a.$f():cp(a,a,function(a){bp(a)}):bp(a))}w.defineProperty(G,{Db:"toSpot"},function(){return null!==this.W?this.W.yk:yb},function(a){this.Qd();var b=this.W.yk;b.L(a)||(a=a.S(),this.W.yk=a,this.h("toSpot",b,a),bp(this))}); w.defineProperty(G,{tm:"toEndSegmentLength"},function(){return null!==this.W?this.W.wk:10},function(a){this.Qd();var b=this.W.wk;b!==a&&(0>a&&w.Fa(a,">= 0",G,"toEndSegmentLength"),this.W.wk=a,this.h("toEndSegmentLength",b,a),bp(this))});w.defineProperty(G,{cv:"toEndSegmentDirection"},function(){return null!==this.W?this.W.vk:Ao},function(a){this.Qd();var b=this.W.vk;b!==a&&(w.Ut("GraphObject.toEndSegmentDirection","2.0"),this.W.vk=a,this.h("toEndSegmentDirection",b,a),bp(this))}); w.defineProperty(G,{dv:"toShortLength"},function(){return null!==this.W?this.W.xk:0},function(a){this.Qd();var b=this.W.xk;b!==a&&(this.W.xk=a,this.h("toShortLength",b,a),bp(this))});w.defineProperty(G,{CG:"toLinkable"},function(){return null!==this.W?this.W.At:null},function(a){this.Qd();var b=this.W.At;b!==a&&(this.W.At=a,this.h("toLinkable",b,a))}); w.defineProperty(G,{VJ:"toMaxLinks"},function(){return null!==this.W?this.W.Bt:Infinity},function(a){this.Qd();var b=this.W.Bt;b!==a&&(0>a&&w.Fa(a,">= 0",G,"toMaxLinks"),this.W.Bt=a,this.h("toMaxLinks",b,a))});w.defineProperty(G,{Cb:"fromSpot"},function(){return null!==this.W?this.W.$j:yb},function(a){this.Qd();var b=this.W.$j;b.L(a)||(a=a.S(),this.W.$j=a,this.h("fromSpot",b,a),bp(this))}); w.defineProperty(G,{$l:"fromEndSegmentLength"},function(){return null!==this.W?this.W.Yj:10},function(a){this.Qd();var b=this.W.Yj;b!==a&&(0>a&&w.Fa(a,">= 0",G,"fromEndSegmentLength"),this.W.Yj=a,this.h("fromEndSegmentLength",b,a),bp(this))});w.defineProperty(G,{hu:"fromEndSegmentDirection"},function(){return null!==this.W?this.W.Xj:Ao},function(a){this.Qd();var b=this.W.Xj;b!==a&&(w.Ut("GraphObject.fromEndSegmentDirection","2.0"),this.W.Xj=a,this.h("fromEndSegmentDirection",b,a),bp(this))}); w.defineProperty(G,{iu:"fromShortLength"},function(){return null!==this.W?this.W.Zj:0},function(a){this.Qd();var b=this.W.Zj;b!==a&&(this.W.Zj=a,this.h("fromShortLength",b,a),bp(this))});w.defineProperty(G,{fF:"fromLinkable"},function(){return null!==this.W?this.W.Fr:null},function(a){this.Qd();var b=this.W.Fr;b!==a&&(this.W.Fr=a,this.h("fromLinkable",b,a))}); w.defineProperty(G,{FA:"fromMaxLinks"},function(){return null!==this.W?this.W.Gr:Infinity},function(a){this.Qd();var b=this.W.Gr;b!==a&&(0>a&&w.Fa(a,">= 0",G,"fromMaxLinks"),this.W.Gr=a,this.h("fromMaxLinks",b,a))});w.defineProperty(G,{cursor:"cursor"},function(){return this.kr},function(a){var b=this.kr;b!==a&&(w.j(a,"string",G,"cursor"),this.kr=a,this.h("cursor",b,a))}); w.defineProperty(G,{click:"click"},function(){return null!==this.ia?this.ia.Ei:null},function(a){xo(this);var b=this.ia.Ei;b!==a&&(null!==a&&w.j(a,"function",G,"click"),this.ia.Ei=a,this.h("click",b,a))});w.defineProperty(G,{Vt:"doubleClick"},function(){return null!==this.ia?this.ia.Mi:null},function(a){xo(this);var b=this.ia.Mi;b!==a&&(null!==a&&w.j(a,"function",G,"doubleClick"),this.ia.Mi=a,this.h("doubleClick",b,a))}); w.defineProperty(G,{sA:"contextClick"},function(){return null!==this.ia?this.ia.Gi:null},function(a){xo(this);var b=this.ia.Gi;b!==a&&(null!==a&&w.j(a,"function",G,"contextClick"),this.ia.Gi=a,this.h("contextClick",b,a))});w.defineProperty(G,{Gu:"mouseEnter"},function(){return null!==this.ia?this.ia.xs:null},function(a){xo(this);var b=this.ia.xs;b!==a&&(null!==a&&w.j(a,"function",G,"mouseEnter"),this.ia.xs=a,this.h("mouseEnter",b,a))}); w.defineProperty(G,{Hu:"mouseLeave"},function(){return null!==this.ia?this.ia.ys:null},function(a){xo(this);var b=this.ia.ys;b!==a&&(null!==a&&w.j(a,"function",G,"mouseLeave"),this.ia.ys=a,this.h("mouseLeave",b,a))});w.defineProperty(G,{iB:"mouseOver"},function(){return null!==this.ia?this.ia.aj:null},function(a){xo(this);var b=this.ia.aj;b!==a&&(null!==a&&w.j(a,"function",G,"mouseOver"),this.ia.aj=a,this.h("mouseOver",b,a))}); w.defineProperty(G,{hB:"mouseHover"},function(){return null!==this.ia?this.ia.$i:null},function(a){xo(this);var b=this.ia.$i;b!==a&&(null!==a&&w.j(a,"function",G,"mouseHover"),this.ia.$i=a,this.h("mouseHover",b,a))});w.defineProperty(G,{gB:"mouseHold"},function(){return null!==this.ia?this.ia.Zi:null},function(a){xo(this);var b=this.ia.Zi;b!==a&&(null!==a&&w.j(a,"function",G,"mouseHold"),this.ia.Zi=a,this.h("mouseHold",b,a))}); w.defineProperty(G,{bJ:"mouseDragEnter"},function(){return null!==this.ia?this.ia.vs:null},function(a){xo(this);var b=this.ia.vs;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDragEnter"),this.ia.vs=a,this.h("mouseDragEnter",b,a))});w.defineProperty(G,{cJ:"mouseDragLeave"},function(){return null!==this.ia?this.ia.ws:null},function(a){xo(this);var b=this.ia.ws;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDragLeave"),this.ia.ws=a,this.h("mouseDragLeave",b,a))}); w.defineProperty(G,{fB:"mouseDrop"},function(){return null!==this.ia?this.ia.Yi:null},function(a){xo(this);var b=this.ia.Yi;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDrop"),this.ia.Yi=a,this.h("mouseDrop",b,a))});w.defineProperty(G,{sE:"actionDown"},function(){return null!==this.ia?this.ia.Kq:null},function(a){xo(this);var b=this.ia.Kq;b!==a&&(null!==a&&w.j(a,"function",G,"actionDown"),this.ia.Kq=a,this.h("actionDown",b,a))}); w.defineProperty(G,{tE:"actionMove"},function(){return null!==this.ia?this.ia.Lq:null},function(a){xo(this);var b=this.ia.Lq;b!==a&&(null!==a&&w.j(a,"function",G,"actionMove"),this.ia.Lq=a,this.h("actionMove",b,a))});w.defineProperty(G,{uE:"actionUp"},function(){return null!==this.ia?this.ia.Mq:null},function(a){xo(this);var b=this.ia.Mq;b!==a&&(null!==a&&w.j(a,"function",G,"actionUp"),this.ia.Mq=a,this.h("actionUp",b,a))}); w.defineProperty(G,{rE:"actionCancel"},function(){return null!==this.ia?this.ia.Jq:null},function(a){xo(this);var b=this.ia.Jq;b!==a&&(null!==a&&w.j(a,"function",G,"actionCancel"),this.ia.Jq=a,this.h("actionCancel",b,a))});w.defineProperty(G,{OB:"toolTip"},function(){return null!==this.ia?this.ia.jj:null},function(a){xo(this);var b=this.ia.jj;b!==a&&(this.ia.jj=a,this.h("toolTip",b,a))}); w.defineProperty(G,{contextMenu:"contextMenu"},function(){return null!==this.ia?this.ia.Hi:null},function(a){xo(this);var b=this.ia.Hi;b!==a&&(this.ia.Hi=a,this.h("contextMenu",b,a))});G.prototype.bind=G.prototype.bind=function(a){a.Fg=this;var b=this.Zl();null!==b&&dp(b)&&w.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.yc&&(this.yc=new H(ah));this.yc.add(a)}; G.prototype.findTemplateBinder=G.prototype.Zl=function(){for(var a=this instanceof C?this:this.R;null!==a;){if(null!==a.il)return a;a=a.R}return null};G.prototype.setProperties=function(a){w.Xu(this,a)};var ep; G.make=ep=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var f=fp.ka(a);"function"===typeof f?(c=w.Ul(arguments),d=f(c),w.Pa(d)||w.k('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=ca[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||w.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);f=1;if(d instanceof E&&1e)&&w.k("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.xe=!0, a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&w.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.xe=!1,a.index=e);e=new ra;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);w.Xu(a,e)}else w.Xu(a,b);else w.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var fp=new ma("string","function"); G.getBuilders=function(){var a=new ma("string","function"),b;for(b in fp)if(b!==b.toLowerCase()){var c=fp.ka(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};var hp;G.defineBuilder=hp=function(a,b){w.j(a,"string",G,"defineBuilder:name");w.j(b,"function",G,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||w.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);fp.add(a,b)};var ip; G.takeBuilderArgument=ip=function(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b}; hp("Button",function(){var a=new ga(og);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new ga(og);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=ep(C,Hl,{Jx:!0,WE:function(a,b){var e=a.Dd("ButtonBorder");null!==e&&(e.fill=b?a._buttonFillNormal:a._buttonFillDisabled)},_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue",_buttonFillDisabled:"darkgray"},ep(Y,{name:"ButtonBorder",Hb:"Rectangle",A:new L(0,0,2.761423749153968,2.761423749153968), B:new L(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.Gu=function(a,b){if(b.su()){var e=b.Dd("ButtonBorder");if(e instanceof Y){var f=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=f;f=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=f}}};a.Hu=function(a,b){if(b.su()){var e=b.Dd("ButtonBorder");e instanceof Y&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)}};return a}); hp("TreeExpanderButton",function(){var a=ep("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},ep(Y,{name:"ButtonIcon",Hb:"MinusLine",Ca:sd},(new ah("figure","isTreeExpanded",function(a,c){var d=c.R;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).ay()),{visible:!1},(new ah("visible","isTreeLeaf",function(a){return!a})).ay());a.click=function(a,c){var d=c.V;d instanceof jh&&(d=d.Ye);if(d instanceof T){var e=d.g;if(null!==e){e=e.pb;if(d.uc){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return; a.tc=!0;d.uc?e.collapseTree(d):e.expandTree(d)}}};return a}); hp("SubGraphExpanderButton",function(){var a=ep("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},ep(Y,{name:"ButtonIcon",Hb:"MinusLine",Ca:sd},(new ah("figure","isSubGraphExpanded",function(a,c){var d=c.R;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).ay()));a.click=function(a,c){var d=c.V;d instanceof jh&&(d=d.Ye);if(d instanceof V){var e=d.g;if(null!==e){e=e.pb;if(d.ad){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.tc= !0;d.ad?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});hp("ToolTip",function(){var a=new jh(Hl),b=new Y;b.name="Border";b.fill="#FFFFE0";b.stroke="#CCCCCC";a.add(b);return a});hp("ContextMenu",function(){return new jh(Gl)});hp("ContextMenuButton",function(){var a=ep("Button");a.stretch=so;var b=a.Dd("ButtonBorder");b instanceof Y&&(b.Hb="Rectangle",b.A=new L(0,0,2,3),b.B=new L(1,1,-2,-2));return a}); hp("PanelExpanderButton",function(a){var b=ip(a,"COLLAPSIBLE"),c=ep("Button",{_buttonExpandedFigure:"TriangleUp",_buttonCollapsedFigure:"TriangleDown"},ep(Y,"TriangleUp",{name:"ButtonIcon",Ca:new ia(6,4)},(new ah("figure","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).ay(b)));a=c.Dd("ButtonBorder");a instanceof Y&&(a.stroke=null,a.fill="transparent");c.click=function(a,c){var f=c.g;if(null!==f&&!f.ib){var h=c.Zl();null===h&&(h=c.V);null!==h&&(h=h.Dd(b),null!==h&& (f.Kb("Collapse/Expand Panel"),h.visible=!h.visible,f.Yc("Collapse/Expand Panel")))}};return c}); hp("CheckBoxButton",function(a){var b=ip(a);a=ep("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},ep(Y,{name:"ButtonIcon",bI:"M0 4 L3 9 9 0",mb:2,stretch:Ee,GA:Sj,visible:!1},""!==b?(new ah("visible",b)).RI():[]));a.click=function(a,d){var e=a.g;if(!(null===e||e.ib||""!==b&&e.$.ib)){a.tc=!0;var f=d.Dd("ButtonIcon");e.Kb("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.Yc("checkbox")}};return a}); hp("CheckBox",function(a){a=ip(a);a=ep("CheckBoxButton",a,{name:"Button",margin:new hb(0,1,0,0)});var b=ep(C,"Horizontal",a,{Jx:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillDisabled:a._buttonFillDisabled,Gu:a.Gu,Hu:a.Hu,click:a.click,_buttonClick:a.click});a.Gu=null;a.Hu=null;a.click=null;return b}); function yo(){this.Cr=this.Hi=this.jj=this.Jq=this.Mq=this.Lq=this.Kq=this.Yi=this.ws=this.vs=this.Zi=this.$i=this.aj=this.ys=this.xs=this.Gi=this.Mi=this.Ei=null}yo.prototype.copy=function(){var a=new yo;a.Ei=this.Ei;a.Mi=this.Mi;a.Gi=this.Gi;a.xs=this.xs;a.ys=this.ys;a.aj=this.aj;a.$i=this.$i;a.Zi=this.Zi;a.vs=this.vs;a.ws=this.ws;a.Yi=this.Yi;a.Kq=this.Kq;a.Lq=this.Lq;a.Mq=this.Mq;a.Jq=this.Jq;a.jj=this.jj;a.Hi=this.Hi;a.Cr=this.Cr;return a}; function C(a){G.call(this);void 0===a?this.na=Uj:(w.ob(a,C,C,"type"),this.na=a);this.xa=new H(G);this.lf=ed;this.na===Kl&&(this.Hn=!0);this.or=qc;this.Ki=qo;this.na===Vo&&jp(this);this.Cp=Sj;this.Pr=Cd;this.Qr=cd;this.Lr=0;this.Kr=100;this.Nr=10;this.Mr=0;this.il=this.Yd=this.ak=this.Em=this.Gm=null;this.cs=NaN;this.wg=this.hk=null;this.So="category";this.vg=null;this.lj=new B(NaN,NaN,NaN,NaN);this.uk=this.et=this.Hl=null;this.Oj=""}w.La(C,G);w.ni(C);w.ga("Panel",C); function jp(a){a.Tj=ed;a.Qh=1;a.Ji=null;a.ml=null;a.Ph=1;a.Oh=null;a.ll=null;a.Xc=[];a.Vc=[];a.$m=kp;a.Bm=kp;a.kj=0;a.Ui=0} C.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.na=this.na;a.lf=this.lf.S();a.or=this.or.S();a.Ki=this.Ki;if(a.na===Vo){a.Tj=this.Tj.S();a.Qh=this.Qh;a.Ji=this.Ji;a.ml=this.ml;a.Ph=this.Ph;a.Oh=this.Oh;a.ll=this.ll;var b=[];if(0a&&w.Fa(a,">= 0",C,"padding"),a=new hb(a)):(w.G(a,hb,C,"padding"),0>a.left&&w.Fa(a.left,">= 0",C,"padding:value.left"),0>a.right&&w.Fa(a.right,">= 0",C,"padding:value.right"),0>a.top&&w.Fa(a.top,">= 0",C,"padding:value.top"),0>a.bottom&&w.Fa(a.bottom,">= 0",C,"padding:value.bottom"));var b=this.lf;b.L(a)||(this.lf=a=a.S(),this.H(),this.h("padding",b,a))}); w.defineProperty(C,{Yl:"defaultAlignment"},function(){return this.or},function(a){var b=this.or;b.L(a)||(this.or=a=a.S(),this.H(),this.h("defaultAlignment",b,a))});w.defineProperty(C,{$d:"defaultStretch"},function(){return this.Ki},function(a){var b=this.Ki;b!==a&&(w.ob(a,G,C,"defaultStretch"),this.Ki=a,this.H(),this.h("defaultStretch",b,a))}); w.defineProperty(C,{XK:"defaultSeparatorPadding"},function(){return void 0===this.Tj?ed:this.Tj},function(a){if(void 0!==this.Tj){"number"===typeof a&&(a=new hb(a));var b=this.Tj;b.L(a)||(this.Tj=a=a.S(),this.H(),this.h("defaultSeparatorPadding",b,a))}}); w.defineProperty(C,{VK:"defaultRowSeparatorStroke"},function(){return void 0===this.Ji?null:this.Ji},function(a){var b=this.Ji;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.Ji=a,this.oa(),this.h("defaultRowSeparatorStroke",b,a))}); w.defineProperty(C,{WK:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.Qh?1:this.Qh},function(a){if(void 0!==this.Qh){var b=this.Qh;b!==a&&isFinite(a)&&0<=a&&(this.Qh=a,this.H(),this.h("defaultRowSeparatorStrokeWidth",b,a))}}); w.defineProperty(C,{UK:"defaultRowSeparatorDashArray"},function(){return void 0===this.ml?null:this.ml},function(a){if(void 0!==this.ml){var b=this.ml;if(b!==a){null===a||Array.isArray(a)||w.Gd(a,"Array",C,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e=c&&(c=1);var d=this.Ix,e=d.width,d=d.height,f=this.Ja,h=f.width,f=f.height,k=Math.ceil(h/e),l=Math.ceil(f/d),m=this.pF;a.save();a.beginPath();a.rect(0,0,h,f);a.clip();for(var n=[],p=this.xa.n,q=p.length,r=0;r e*u*c))){s=v.opacity;t=1;if(1!==s){if(0===s)continue;t=a.globalAlpha;a.globalAlpha=t*s}var x=n[r],z=!1,A=!0,K=v.yG;null!==K&&(z=!0,A=a.yx(K,v.Af));if("LineV"===v.Hb&&null!==v.stroke){a.lineWidth=v.mb;Qo(this,a,v.stroke,!1,!1);a.beginPath();for(var D=Math.floor(-m.x/e),O=D;O<=D+k;O++){var X=O*e+m.x;0<=X&&X<=h&&mp(O,u,x)&&(z&&!A?Bo(a,X,0,X,f,K,v.Af):(a.moveTo(X,0),a.lineTo(X,f)))}a.stroke()}else if("LineH"===v.Hb&&null!==v.stroke){a.lineWidth=v.mb;Qo(this,a,v.stroke,!1,!1);a.beginPath();for(O=D=Math.floor(-m.y/ d);O<=D+l;O++)X=O*d+m.y,0<=X&&X<=f&&mp(O,u,x)&&(z&&!A?Bo(a,0,X,h,X,K,v.Af):(a.moveTo(0,X),a.lineTo(h,X)));a.stroke()}else if("BarV"===v.Hb&&null!==v.fill)for(Qo(this,a,v.fill,!0,!1),v=v.width,isNaN(v)&&(v=e),O=D=Math.floor(-m.x/e);O<=D+k;O++)X=O*e+m.x,0<=X&&X<=h&&mp(O,u,x)&&a.fillRect(X,0,v,f);else if("BarH"===v.Hb&&null!==v.fill)for(Qo(this,a,v.fill,!0,!1),v=v.height,isNaN(v)&&(v=d),O=D=Math.floor(-m.y/d);O<=D+l;O++)X=O*d+m.y,0<=X&&X<=f&&mp(O,u,x)&&a.fillRect(0,X,h,v);z&&a.vx();1!==s&&(a.globalAlpha= t)}}a.restore();a.Ke(!1)}else if(this.na===lp){e=this.Ja;c=e.width;e=e.height;a.save();a.beginPath();a.rect(-1,-1,c+1,e+1);a.clip();c=this.Cd();c.ve(a,b);e=this.vj()*b.scale;0>=e&&(e=1);d=c.U;h=this.xa.n;f=this.Gm;k=h.length;for(l=0;lthis.KA*q.interval*c.of.du/this.lu*e))for(r=q.za,u=q.mb*q.scale,s=q.oh,s.Td()&&(s=Bb),p=0;pf.height)continue}else if(l.position>f.width)continue;var m=l.Bq;isNaN(m)&&(m=c?a.Qh:a.Ph);var n=l.Aq;null===n&&(n=c?a.Ji:a.Oh);if(0!==m&&null!==n){Qo(a,b,n,!1,!1);var n=!1,p=!0,q=l.HJ;null===q&&(q=c?a.ml:a.ll);null!==q&&(n=!0,p=b.yx(q,0));b.beginPath();var r=l.position+m;c?r>f.height&&(m-=r-f.height):r>f.width&&(m-=r-f.width);l=l.position+m/2;b.lineWidth=m;r=a.padding; c?(l+=r.top,m=r.left,r=f.width-r.right,n&&!p?Bo(b,m,l,r,l,q,0):(b.moveTo(m,l),b.lineTo(r,l))):(l+=r.left,m=r.top,r=f.height-r.bottom,n&&!p?Bo(b,l,m,l,r,q,0):(b.moveTo(l,m),b.lineTo(l,r)));b.stroke();n&&b.vx()}}}} function op(a,b,c,d,e){for(var f=d.length,h=a.U,k=0;km)){var n=l.$e(),p=l.Bq;isNaN(p)&&(p=c?a.Qh:a.Ph);var q=l.Aq;null===q&&(q=c?a.Ji:a.Oh);null===q&&(p=0);n-=p;p=l.position+p;n+=l.ab;p+n>m&&(n=m-p);0>=n||(m=a.padding,Qo(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}} function mp(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;dm&&e.set(s),w.v(s));w.v(n);f&&e.transform(h)}return c}; g.H=function(a){G.prototype.H.call(this,a);a=null;if(this.na===Hl||this.na===jj)a=this.Cd();for(var b=this.xa.n,c=b.length,d=0;dJd&&(lc=Math.max(Jd-mc,0));var kg=0===Z.ab;Z.ab+=lc;Jd=Math.max(Jd-(lc+(kg?mc:0)),0)}1!==aa.Fi||Pb!==Qj&&Pb!==ro||(Z=this.de(Gb),mc=Z.$e(),lc=Math.max(df-Z.ab,0),lc+mc>$c&&(lc=Math.max($c-mc,0)),kg=0===Z.ab,Z.ab+=lc,$c=Math.max($c-(lc+(kg?mc:0)),0));oi&&aa.bq()}}}w.ta($e);for(var Dc=0,Ab=0,Fb=this.Mp,ea=0;ea=this.xq);cb++)Z=this.ee(aa.Vb+cb),lc=Pb===Ee||Pb=== ro?Math.max(Z.Ch,0===xd[aa.Vb+cb]?Z.ke:Math.min(xd[aa.Vb+cb],Z.ke)):Math.max(Z.Ch,isNaN(Z.mf)?Z.ke:Math.min(Z.mf,Z.ke)),Kd.height+=lc;for(cb=1;cb=this.Mp);cb++)Z=this.de(aa.column+cb),lc=Pb===Ee||Pb===so?Math.max(Z.Ch,0===gf[aa.column+cb]?Z.ke:Math.min(gf[aa.column+cb],Z.ke)):Math.max(Z.Ch,isNaN(Z.mf)?Z.ke:Math.min(Z.mf,Z.ke)),Kd.width+=lc;ob.width+=Kd.width;ob.height+=Kd.height;xc=aa.margin;Kf=xc.right+xc.left;jg=xc.top+xc.bottom;yk(aa,ob.width,ob.height,vj,wj);for(var Lf= aa.za,df=Math.max(Lf.width+Kf,0),ef=Math.max(Lf.height+jg,0),hf=0,cb=0;cb=this.xq);cb++)Z=this.ee(aa.Vb+cb),hf+=Z.total||0;if(hf=ld)&&!(aa.Vb+cb>=this.xq);cb++){var Z=this.ee(aa.Vb+cb),Fc=Z.Ra||0,qi=jf(aa,Z,Lg);Z.ab=Math.min(Z.ke,Fc+qi);Z.Ra!==Fc&&(ld-=Z.Ra-Fc)}for(;0Fc&&(Z.ab=Math.min(Z.ke,Fc+ld),Z.Ra!==Fc&&(ld-=Z.Ra-Fc));if(0===Z.index)break;Z=this.ee(Z.index- 1)}}for(var Me=0,cb=0;cb=this.Mp);cb++)Z=this.de(aa.column+cb),Me+=Z.total||0;if(Me=ld)&&!(aa.column+cb>=this.Mp);cb++)Z=this.de(aa.column+cb),Fc=Z.Ra||0,qi=jf(aa,Z,Lg),Z.ab=Math.min(Z.ke,Fc+qi),Z.Ra!==Fc&&(ld-=Z.Ra-Fc);for(;0Fc&&(Z.ab=Math.min(Z.ke,Fc+ld),Z.Ra!==Fc&&(ld-=Z.Ra-Fc));if(0===Z.index)break;Z=this.de(Z.index-1)}}}w.ta(Le);w.Kk(Kd);w.Kk(ob);void 0!==xd&&w.ta(xd); void 0!==gf&&w.ta(gf);for(var Mg=0,Ng=0,Pb=Ho(this,!0),yj=this.Ca,Lk=this.Hf,we=Ab=Dc=0,ad=0,Fb=this.Mp,ea=0;eati)yk(Ub,Infinity,Infinity),xe=Ub.za,lf.Jh(xe),this.Yg.add(xe);else{var yd=Ub.Pe,yt=Ub.xB,rp=Ub.oh;rp.Td()&&(rp=Jb);var lg=Ub.yq,fw=Ub.yB,Rk=0,Sk=0,rm=0;if(yd<-ti||yd>=ti){var zt=Pk.QF,Nf=Pk.PF;lg!==mj&&(rm=Pk.computeAngle(Ub,lg,Nf),Ub.lg=rm);Rk=zt.x-Og.x;Sk=zt.y-Og.y}else{var Ld, mf;if(0<=yd)Ld=Eh.ea(yd),mf=ydBt+10?0<=yd?vi.Qb(Ld):Ld.Qb(vi):Bt>At+10?0<=yd?mf.Qb(wi):wi.Qb(mf):0<=yd?vi.Qb(wi):wi.Qb(vi)}else Nf=0<=yd?Ld.Qb(mf):mf.Qb(Ld);lg!==mj&&(rm=Pk.computeAngle(Ub,lg,Nf),Ub.lg=rm);Rk=Ld.x+(mf.x-Ld.x)*yt-Og.x;Sk=Ld.y+(mf.y-Ld.y)*yt-Og.y}yk(Ub, Infinity,Infinity);var xe=Ub.za,pm=Ub.Ja,Tk=0;Ub instanceof Y&&(Tk=Ub.mb);var xi=pm.width+Tk,Aj=pm.height+Tk;Pg.reset();Pg.translate(-xe.x,-xe.y);Pg.scale(Ub.scale,Ub.scale);Pg.rotate(lg===mj?Ub.angle:Nf,xi/2,Aj/2);lg!==Tp&&lg!==Up||Pg.rotate(90,xi/2,Aj/2);lg!==Vp&&lg!==Wp||Pg.rotate(-90,xi/2,Aj/2);lg===Xp&&(45Nf||225Nf)&&Pg.rotate(-Nf,xi/2,Aj/2);var Bj=new B(0,0,xi,Aj);Qk.Zn(Bj,rp);Pg.nb(Qk);var gw=-Qk.x+Tk/2*Ub.scale,hw=-Qk.y+Tk/2*Ub.scale;Qg.assign(fw);isNaN(Qg.x)&&(Qg.x=0<=yd? xi/2+3:-(xi/2+3));isNaN(Qg.y)&&(Qg.y=-(Aj/2+3));Qg.rotate(Nf);Rk+=Qg.x;Sk+=Qg.y;Bj.set(xe);Bj.x=Rk+gw;Bj.y=Sk+hw;this.Yg.add(Bj);lf.Jh(Bj)}}if(this instanceof W)for(var Ct=this.Ff;Ct.next();)yk(Ct.value,Infinity,Infinity);this.lj=lf;var sp=this.Xi;sp.m(sp.x+lf.x,sp.y+lf.y);Ua(e,lf.width||0,lf.height||0);w.bf(Pg);w.v(Qk);w.v(Qg)}}}break;case "Grid":break;case "Graduated":var iw=a,jw=b,kw=c,lw=d,Rg=this.Cd();this.Em=[];var Cj=Rg.margin,mw=Cj.right+Cj.left,nw=Cj.top+Cj.bottom;yk(Rg,iw,jw,kw,lw);var Dt= Rg.za,ow=Dt.height,pw=Math.max(Dt.width+mw,0),qw=Math.max(ow+nw,0),Et=new B(-Cj.left,-Cj.top,pw,qw);this.Em.push(Et);e.assign(Et);for(var Yk=Rg.of,Ft=Rg.mb,tp=Yk.Gx,Dj=Yk.cu,yi=Yk.du,rw=tp.length,up=0,vp=0,Ej=w.gb(),wp=0;wpzd&&(zd+=360);Gt.push(zd)}up=Ht;vp=It}Ej.push(Gt)}var Jt;if(null===this.ak){for(var Kt=[],yp=this.xa.n,Lt=yp.length,zp=0;zp< Lt;zp++){var Zk=yp[zp],Mt=[];Kt.push(Mt);if(Zk.visible)for(var tw=Zk.interval,Ap=0;Aptw&&Mt.push(Nt)}}}this.ak=Kt}Jt=this.ak;var Ot=this.xa.n,uw=Ot.length,Fh=0,Pt=0,Qt=yi;this.Gm=[];for(var tm=[],um=0;umSt*Rt*yi/this.lu)){var ce=this.oF,Tt=Jt[um],zi=Dj[0][0],Of= 0,Ad=0,Pt=yi*Gh.nF-1E-4,Qt=yi*Gh.lF+1E-4,Gj=St*Rt;if(cethis.Ok+Gj&&(Ai=Math.floor((ce-this.Ok)/Gj),ce-=Ai*Gj);for(;ce<=this.JA;){var Bp;a:{for(var vw=Tt.length,Cp=0;Cpyi&&(Fh=yi),Pt<=Fh&&Fh<=Qt)){for(var zd=Ej[Of][Ad],Hj=Dj[Of][Ad];Ofzi&&Advm?0Am;Am++){switch(Am){case 0:de.m(xm,ym);break;case 1:de.m(xm+Gp,ym);break;case 2:de.m(xm,ym+Hp);break;case 3:de.m(xm+Gp,ym+Hp)}de.rotate(au+Ih.angle);de.offset(Zt,$t);0===zm&&0===Am?Ci.m(de.x,de.y,0,0):Ci.yi(de);de.offset(-Zt,-$t);de.rotate(-au-Ih.angle)}w.v(de);this.Em.push(Ci);ab(yw,Ci.x,Ci.y,Ci.width,Ci.height)}else if(Bi instanceof Lh){var Bm=Bi,bu=Ep,Bw=e;null===this.uk&&(this.uk=new Lh);var Pf=this.uk;np(Bm,Pf);var Jp=Bm.oh;Jp.Td()&&(Jp=Bb);for(var Jh=Bm.yq,Cw=Bm.yB,Di=null,Cm=0,Dm=0,Sg=0,Kp=0,Dw=bu.length,Em=0;EmSg||225Sg)&&Tg.rotate(-Sg,Kj/2,Lj/2);var cu=w.kg(0,0,Kj,Lj),al=w.K();al.Zn(cu,Jp);Tg.nb(al);var Ew=-al.x,Fw=-al.y,Ug=w.K();Ug.assign(Cw);isNaN(Ug.x)&&(Ug.x=Kj/2+3);isNaN(Ug.y)&&(Ug.y=-(Lj/2+3));Ug.rotate(Sg);var Cm=Cm+(Ug.x+Ew),Dm=Dm+(Ug.y+Fw),Lp=new B(Cm,Dm,Kh.width,Kh.height),Gw=new B(Kh.x,Kh.y,Kh.width,Kh.height),Hw=new B(Jj.x,Jj.y,Jj.width,Jj.height),du=new Yp;du.Np(Pf.zf);ng.push(Kp);ng.push(Pf.pe); ng.push(du);ng.push(Lp);ng.push(Gw);ng.push(Hw);0===Em?Di=Lp.copy():Di.Jh(Lp);w.v(Ug);w.v(al);w.Bb(cu);w.bf(Tg)}this.Em.push(Di);ab(Bw,Di.x,Di.y,Di.width,Di.height)}dm(Bi,!1)}}break;case "TableRow":case "TableColumn":w.k(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:w.k("Unknown panel type: "+n)}}var nf=e.width,of=e.height,Fm=this.padding,Iw=Fm.top+Fm.bottom,nf=nf+(Fm.left+Fm.right),of=of+Iw;isFinite(f.width)&& (nf=f.width);isFinite(f.height)&&(of=f.height);nf=Math.min(k.width,nf);of=Math.min(k.height,of);nf=Math.max(h.width,nf);of=Math.max(h.height,of);nf=Math.max(c,nf);of=Math.max(d,of);e.width=nf;e.height=of;Ua(this.Mc,nf,of);Eo(this,0,0,nf,of)};C.prototype.findMainElement=C.prototype.Cd=function(){if(null===this.Hl){var a=this.xa.n,b=a.length;if(0===b)return null;for(var c=0;cc||p>d)this.H(),yk(this,n>c?c:n,p>d?d:p);break;case Ee:this.H(!0);yk(this,c+r,d+s,0,0);break;case so:this.H(!0);yk(this,c+r,p+s,0,0);break;case ro:this.H(!0),yk(this,n+r,d+s,0,0)}}k=this.U;k.x=a;k.y=b; k.width=c;k.height=d;var u=this.na.Sb;switch(u){case "Position":for(var t=f.length,x=e.x-this.padding.left,v=e.y-this.padding.top,z=0;z=this.xq);Ke++){var ji=this.ee(jb+Ke);te.height+=ji.total}for(Ke=1;Ke=this.Mp);Ke++){var ki=this.de(Zc+Ke);te.width+=ki.total}var vj=Jf.Ra+te.width,wj=Ze.Ra+te.height;h.x=Id;h.y=cc;h.width=vj;h.height=wj;var Fb=Id,yh=cc,zh=vj,ea=wj;Id+vj>e.width&&(zh=Math.max(e.width-Id,0));cc+wj>e.height&&(ea=Math.max(e.height-cc,0));var aa=wb.alignment,be=0,hg=0,li=0,Gb=0;if(aa.Zc()){aa=this.Yl;aa.$c()||(aa=Jb);var be=aa.x,hg=aa.y,li=aa.offsetX,Gb=aa.offsetY,mi=Jf.alignment, Tb=Ze.alignment;mi.$c()&&(be=mi.x,li=mi.offsetX);Tb.$c()&&(hg=Tb.y,Gb=Tb.offsetY)}else be=aa.x,hg=aa.y,li=aa.offsetX,Gb=aa.offsetY;if(isNaN(be)||isNaN(hg))hg=be=.5,Gb=li=0;var $e=ae.width,Le=ae.height,af=wb.margin,ue=af.left+af.right,ve=af.top+af.bottom,$c=Wo(wb,Ze,Jf,!1);!isNaN(wb.Ca.width)||$c!==Ee&&$c!==so||($e=Math.max(vj-ue,0));!isNaN(wb.Ca.height)||$c!==Ee&&$c!==ro||(Le=Math.max(wj-ve,0));var Jd=wb.Hf,Ah=wb.si,$e=Math.min(Jd.width,$e),Le=Math.min(Jd.height,Le),$e=Math.max(Ah.width,$e),Le=Math.max(Ah.height, Le),Z=Le+ve;h.x+=h.width*be-($e+ue)*be+li+af.left;h.y+=h.height*hg-Z*hg+Gb+af.top;wb.visible&&(db(Fb,yh,zh,ea,h.x,h.y,ae.width,ae.height)?wb.hc(h.x,h.y,$e,Le):wb.hc(h.x,h.y,$e,Le,new B(Fb,yh,zh,ea)))}else{wb.Ri();wb.oc.Qa();var kd=wb.oc,ig=w.kg(kd.x,kd.y,kd.width,kd.height);kd.x=jd.type===Mo?wh:Id;kd.y=jd.type===No?Fg:cc;kd.width=ae.width;kd.height=ae.height;wb.oc.freeze();Io(wb,!1);if(!Va(ig,kd)){var ni=wb.V;null!==ni&&(ni.Qk(),wb.Gs(ni))}w.Bb(ig)}}}}w.Kk(te);for(jb=0;jb<$d;jb++)wb=f[jb],jd=wb instanceof C?wb:null,null===jd||jd.type!==Mo&&jd.type!==No||(kd=wb.oc,wb.Mc.Qa(),wb.Mc.m(0,0,kd.width,kd.height),wb.Mc.freeze());break;case "Viewbox":var Bh=f[0],lc=Bh.za,Ch=Bh.margin,mb=Ch.top+Ch.bottom,nb=Math.max(lc.width+(Ch.right+Ch.left),0),im=Math.max(lc.height+mb,0),bf=Bh.alignment;bf.Zc()&&(bf=this.Yl);bf.$c()||(bf=Jb);h.x=e.width*bf.x-nb*bf.x+bf.offsetX;h.y=e.height*bf.y-im*bf.y+bf.offsetY;h.width=lc.width;h.height=lc.height;Bh.hc(h.x,h.y,h.width,h.height);break;case "Link":var Jk=f.length;if(this instanceof jh||this instanceof W){var oi=null;this instanceof W&&(oi=this);this instanceof jh&&(oi=this.Ye);var xc=oi,Kf=this instanceof jh?null:xc.path;if(null!==this.Yg){var jg=this.Yg.n,Pb=0;if(null!==Kf&&Pb=kg){var Kg=this.QF,ob=this.PF;xj!==mj&&(Jg=this.computeAngle(mc,xj,ob),mc.angle=Jg);Ig=Kg.x;Mf=Kg.y}else{var Wb=void 0,Ec=void 0;if(0<=Ab)Wb=Dc.n[Ab],Ec=Ab cb+10?0<=Ab?Kd.Qb(Wb):Wb.Qb(Kd):cb>gf+10?0<=Ab?Ec.Qb(xd):xd.Qb(Ec):0<=Ab?Kd.Qb(xd):xd.Qb(Kd)}else ob=0<=Ab?Wb.Qb(Ec):Ec.Qb(Wb);xj!==mj&&(Jg=this.computeAngle(mc,xj,ob),mc.angle=Jg);Ig=Wb.x+(Ec.x-Wb.x)*pi;Mf=Wb.y+(Ec.y-Wb.y)*pi}if(Hg.L(yb))mc.location=new y(Ig,Mf);else{Hg.Td()&&(Hg=Jb);var hf=w.Vg();hf.reset();hf.scale(mc.scale,mc.scale);hf.rotate(mc.angle,0,0);var ld=mc.Ja,Lg=w.kg(0,0,ld.width,ld.height),jf=w.K();jf.Zn(Lg,Hg);hf.nb(jf);var Fc=-jf.x,qi=-jf.y,Me=pp.copy();isNaN(Me.x)&&(Me.x=0<=Ab?jf.x+ 3:-(jf.x+3));isNaN(Me.y)&&(Me.y=-(jf.y+3));Me.rotate(ob);Ig+=Me.x;Mf+=Me.y;hf.HG(Lg);var Fc=Fc+Lg.x,qi=qi+Lg.y,Mg=w.xb(Ig+Fc,Mf+qi);mc.move(Mg);w.v(Mg);w.v(jf);w.Bb(Lg);w.bf(hf)}}this.Eu(!1)}break;case "Grid":break;case "Graduated":if(null!==this.Em){var Ng=this.Cd(),yj=this.Gm,Lk=this.Em,we=0,ad=Lk[we];we++;Ng.hc(ad.x-e.x,ad.y-e.y,ad.width,ad.height);for(var Mk=f.length,Dh=0;Dhq.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=n;n=n instanceof C?n:null;q=w.Vg();q.set(h);if(null!==n?n.Ik(a,b,c,d,e,q):Go(p,a,d, q))null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||e.add(p);w.bf(q)}}}void 0===f&&w.bf(h);return d}void 0===f&&w.bf(h);return!1};function cq(a,b,c,d){for(var e=a.xa.n,f=e.length;f--;){var h=e[f];if(h.visible){var k=h.U,l=a.Ja;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof C&&cq(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}} g.yn=function(a,b,c,d,e,f){if(!1===this.Tg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ja,k=this.Xg(),l=k?a:Pa(w.xb(a.x,a.y),this.transform),m=k?b:Pa(w.xb(b.x,b.y),this.transform),n=l.Cf(m),p=0t.width||u.y>t.height||0>u.x+u.width||0>u.y+u.height))if(s.Xg()?(u=s.transform,Pa(l.set(a),u),Pa(m.set(b),u)):(l.set(a),m.set(b)),u=s,s=s instanceof C?s:null,null!==s?s.yn(l,m,c,d,e,f):u.cF(l,m,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}w.v(l);w.v(m)}return e? p:h}return!1};function Op(a){var b=null;a instanceof Y&&(b=a.A,b===qc&&(b=null),a=a.of,null!==a&&null===b&&(b=a.A));null===b&&(b=zb);return b}function Pp(a){var b=null;a instanceof Y&&(b=a.B,b===qc&&(b=null),a=a.of,null!==a&&null===b&&(b=a.B));null===b&&(b=Sb);return b}C.prototype.add=C.prototype.add=function(a){w.G(a,G,C,"add:element");this.Rd(this.xa.count,a)};C.prototype.elt=C.prototype.ea=function(a){return this.xa.ea(a)}; C.prototype.insertAt=C.prototype.Rd=function(a,b){b instanceof R&&w.k("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.gm(b))this===b&&w.k("Cannot make a Panel contain itself: "+this.toString()),w.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.R;null!==c&&c!==this&&w.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+ this.toString());this.na!==Kl||b instanceof Y||w.k("Can only add Shapes to a Grid Panel, not: "+b);this.na!==lp||b instanceof Y||b instanceof Lh||w.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.nm(this);b.Xm=null;if(null!==this.hq){var d=b.data;null!==d&&"object"===typeof d&&(null===this.vg&&(this.vg=new ma(Object,C)),this.vg.add(d,b))}var e=this.xa,d=-1;if(c===this){for(var f=-1,h=this.xa.n,k=h.length,l=0;l=e.count&& a>=e.count)return;e.dd(f);d=f}else w.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Rd(a,b);if(0===a||b.ff)this.Hl=null;sm(this)||this.H();b.H(!1);null!==b.le?this.Pk=!0:b instanceof C&&!0===b.Pk&&(this.Pk=!0);this.ak=null;c=this.V;null!==c&&(c.Sm=null,c.lk=NaN,this.Pk&&c instanceof T&&(c.Pk=!0),c.Pk&&c instanceof T&&(c.Ie=null),e=this.g,null!==e&&e.ja.lb||(-1!==d&&c.cd(Ff,"elements",this,b,null,d,null),c.cd(Ef,"elements",this,null, b,null,a),this.su()||dq(this,b,!1)))};w.defineProperty(C,{Pk:null},function(){return 0!==(this.M&8388608)},function(a){0!==(this.M&8388608)!==a&&(this.M^=8388608)});function eq(a,b){a.M=b?a.M|16777216:a.M&-16777217}C.prototype.remove=C.prototype.remove=function(a){w.G(a,G,C,"remove:element");for(var b=this.xa.n,c=b.length,d=-1,e=0;ea&&w.Fa(a,">= 0",C,"getRowDefinition:idx");a=Math.round(a);var b=this.Xc;if(void 0===b[a]){var c=new Vg;c.nm(this);c.xe=!0;c.index=a;b[a]=c}return b[a]};C.prototype.removeRowDefinition=C.prototype.dG=function(a){0>a&&w.Fa(a,">= 0",C,"removeRowDefinition:idx");a=Math.round(a);var b=this.Xc;this.cd(Ff,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.H()};w.u(C,{Mp:"columnCount"},function(){return void 0===this.Vc?0:this.Vc.length}); C.prototype.getColumnDefinition=C.prototype.de=function(a){0>a&&w.Fa(a,">= 0",C,"getColumnDefinition:idx");a=Math.round(a);var b=this.Vc;if(void 0===b[a]){var c=new Vg;c.nm(this);c.xe=!1;c.index=a;b[a]=c}return b[a]};C.prototype.removeColumnDefinition=C.prototype.bG=function(a){0>a&&w.Fa(a,">= 0",C,"removeColumnDefinition:idx");a=Math.round(a);var b=this.Vc;this.cd(Ff,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.H()}; w.defineProperty(C,{BJ:"rowSizing"},function(){return void 0===this.$m?kp:this.$m},function(a){if(void 0!==this.$m){var b=this.$m;b!==a&&(a!==kp&&a!==Rp&&w.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.$m=a,this.H(),this.h("rowSizing",b,a))}}); w.defineProperty(C,{yH:"columnSizing"},function(){return void 0===this.Bm?kp:this.Bm},function(a){if(void 0!==this.Bm){var b=this.Bm;b!==a&&(a!==kp&&a!==Rp&&w.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Bm=a,this.H(),this.h("columnSizing",b,a))}}); w.defineProperty(C,{$L:"topIndex"},function(){return void 0===this.kj?0:this.kj},function(a){if(void 0!==this.kj){var b=this.kj;b!==a&&((!isFinite(a)||0>a)&&w.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.kj=a,this.H(),this.h("topIndex",b,a))}}); w.defineProperty(C,{oL:"leftIndex"},function(){return void 0===this.Ui?0:this.Ui},function(a){if(void 0!==this.Ui){var b=this.Ui;b!==a&&((!isFinite(a)||0>a)&&w.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.Ui=a,this.H(),this.h("leftIndex",b,a))}});C.prototype.findRowForLocalY=function(a){if(0>a||this.type!==Vo)return-1;for(var b=0,c=this.Xc,d=c.length,e=this.kj;ea||this.type!==Vo)return-1;for(var b=0,c=this.Vc,d=c.length,e=this.Ui;ea;)this.rf(this.xa.length-1,!1);a=this.hq;if(null!==a)for(var b=w.bb(a),c=0;cc)){var d;d=fq(a,b);var e=a.GI,f=null;null!==e&&(f=e.ka(d));null===f&&(gq||(gq=!0,w.trace('No item template Panel found for category "'+d+'" on '+a),w.trace(" Using default item template."),d=new C,e=new Lh,e.bind(new ah("text","",Qf)),d.add(e),hq=d),f=hq);d=f;null!==d&&(lh(d),d=d.copy(),0!==(d.M&16777216)&&(e=a.Zl(),null!==e&&eq(e,!0)),"object"===typeof b&&(null===a.vg&&(a.vg=new ma(Object,C)),a.vg.add(b,d)),e=c,nn(a)&&e++,a.Rd(e,d),d.Yd=b,on(a,e, c),d.Yd=null,d.data=b)}}function on(a,b,c){for(a=a.xa;ba&&w.Fa(a,">= 0",Vg,"height"),this.mf=a,this.ab=this.Ra,null!==this.R&&this.R.H(),this.jd("height",b,a))});w.defineProperty(Vg,{width:"width"},function(){return this.mf},function(a){var b=this.mf;b!==a&&(0>a&&w.Fa(a,">= 0",Vg,"width"),this.mf=a,this.ab=this.Ra,null!==this.R&&this.R.H(),this.jd("width",b,a))}); w.defineProperty(Vg,{Ch:"minimum"},function(){return this.nk},function(a){var b=this.nk;b!==a&&((0>a||!isFinite(a))&&w.Fa(a,">= 0",Vg,"minimum"),this.nk=a,this.ab=this.Ra,null!==this.R&&this.R.H(),this.jd("minimum",b,a))});w.defineProperty(Vg,{ke:"maximum"},function(){return this.mk},function(a){var b=this.mk;b!==a&&(0>a&&w.Fa(a,">= 0",Vg,"maximum"),this.mk=a,this.ab=this.Ra,null!==this.R&&this.R.H(),this.jd("maximum",b,a))}); w.defineProperty(Vg,{alignment:"alignment"},function(){return this.me},function(a){var b=this.me;b.L(a)||(this.me=a.S(),null!==this.R&&this.R.H(),this.jd("alignment",b,a))});w.defineProperty(Vg,{stretch:"stretch"},function(){return this.Eg},function(a){var b=this.Eg;b!==a&&(this.Eg=a,null!==this.R&&this.R.H(),this.jd("stretch",b,a))}); w.defineProperty(Vg,{pG:"separatorPadding"},function(){return this.rk},function(a){"number"===typeof a&&(a=new hb(a));var b=this.rk;null!==a&&null!==b&&b.L(a)||(null!==a&&(a=a.S()),this.rk=a,null!==this.R&&this.R.H(),this.jd("separatorPadding",b,a))});w.defineProperty(Vg,{Aq:"separatorStroke"},function(){return this.lt},function(a){var b=this.lt;b!==a&&(null===a||"string"===typeof a||a instanceof ga)&&(a instanceof ga&&a.freeze(),this.lt=a,null!==this.R&&this.R.H(),this.jd("separatorStroke",b,a))}); w.defineProperty(Vg,{Bq:"separatorStrokeWidth"},function(){return this.mt},function(a){var b=this.mt;b!==a&&(this.mt=a,null!==this.R&&this.R.H(),this.jd("separatorStrokeWidth",b,a))}); w.defineProperty(Vg,{HJ:"separatorDashArray"},function(){return this.ai},function(a){var b=this.ai;if(b!==a){null===a||Array.isArray(a)||w.Gd(a,"Array",Vg,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ee)){for(var f=d.za,h=Math.max(1,f.width),f=f.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,u=q=0,t=w.gb(),x=2;xp&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,x=0,q=t[x],p=q[0],s=q[1],r=q[2],q=q[3],v=0;.1<=u;){0===v&&(n?(e=c,e-=m,u-=m,n=!1):e=c,0===e&&(e=1));if(e>u){w.ta(t);return}e> q?(v=e-q,e=q):v=0;var z=Math.sqrt(e*e/(1+r*r));0>p&&(z=-z);k+=z;l+=r*z;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(f/2));0===v&&d.Hk(a,b);a.translate(h/2,f/2);a.rotate(-s);a.translate(-k,-l);u-=e;q-=e;if(0!==v){x++;if(x===t.length){w.ta(t);return}q=t[x];p=q[0];s=q[1];r=q[2];q=q[3];e=v}}w.ta(t)}} Y.prototype.Hk=function(a,b){if(null!==this.sc||null!==this.Jd){null!==this.Jd&&Qo(this,a,this.Jd,!0,!1);null!==this.sc&&Qo(this,a,this.sc,!1,!1);var c=this.ji;if(0===c){var d=this.V;d instanceof jh&&d.type===jj&&"Selection"===d.Ad&&d.ub instanceof Y&&d.Ye.Cd()===d.ub&&(c=d.ub.mb)}a.lineWidth=c;a.lineJoin=this.tp;a.lineCap=this.rp;a.miterLimit=this.hn;var e=!1;this.V&&b.Nk("drawShadows")&&(e=this.V.im);var f=!0;null!==this.sc&&null===this.Jd&&(f=!1);var d=!1,h=!0,k=this.yG;null!==k&&(d=!0,h=a.yx(k, this.Af));var l=this.Sa;if(null!==l){if(l.na===Fe)a.beginPath(),d&&!h?Bo(a,l.Cc,l.Nc,l.zb,l.Jb,k,this.Af):(a.moveTo(l.Cc,l.Nc),a.lineTo(l.zb,l.Jb)),null!==this.Jd&&a.Kg(this.Jd),0!==c&&null!==this.sc&&a.Kj();else if(l.na===Ge){var m=l.Cc,n=l.Nc,p=l.zb,q=l.Jb,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.Jd&&(a.beginPath(),a.rect(l,r,m,n),a.Kg(this.Jd));if(null!==this.sc){var s=p=0,u=0;f&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= 0,a.shadowBlur=0);d&&!h?(h=w.gb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),kq(a,h,k,this.Af),a.Kj(),w.ta(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.Kj());f&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u)}}else if(l.na===He)m=l.Cc,n=l.Nc,p=l.zb,q=l.Jb,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+bd*l,n-r,m+l,n-bd*r,m+l,n),a.bezierCurveTo(m+ l,n+bd*r,m+bd*l,n+r,m,n+r),a.bezierCurveTo(m-bd*l,n+r,m-l,n+bd*r,m-l,n),a.bezierCurveTo(m-l,n-bd*r,m-bd*l,n-r,m,n-r),a.closePath(),null!==this.Jd&&a.Kg(this.Jd),d&&!h&&(h=w.gb(),Wd(m,n-r,m+bd*l,n-r,m+l,n-bd*r,m+l,n,.5,h),Wd(m+l,n,m+l,n+bd*r,m+bd*l,n+r,m,n+r,.5,h),Wd(m,n+r,m-bd*l,n+r,m-l,n+bd*r,m-l,n,.5,h),Wd(m-l,n,m-l,n-bd*r,m-bd*l,n-r,m,n-r,.5,h),a.beginPath(),kq(a,h,k,this.Af),w.ta(h)),0!==c&&null!==this.sc&&(f&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY= 0,a.shadowBlur=0,a.Kj(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u):a.Kj());else if(l.na===Ce){r=l.Vj;n=r.length;for(q=0;qx.uf);else{var t=rf(x,m),v=t.length;if(0===v){a.lineTo(x.la,x.ra);break}for(var z=0;ze)){var f=.001,h=c.length,k=b[0],l=b[1];if(4===e)Bo(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=f=0,n=0,p=0,q=0,r=p=0,s=w.gb(),u=2;ur&&(f=r);f>p?(t=f-p,f=p):t=0;var x=Math.sqrt(f*f/(1+q*q));0>n&&(x=-x);k+=x;l+= q*x;e?a.lineTo(k,l):a.moveTo(k,l);r-=f;p-=f;if(0!==t){u++;if(u===s.length){w.ta(s);return}p=s[u];n=p[0];q=p[1];p=p[2];f=t}else e=!e}w.ta(s)}}}Y.prototype.getDocumentPoint=Y.prototype.Ya=function(a,b){void 0===b&&(b=new y);if(a instanceof L){a.Td()&&w.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Ja,d=this.mb;b.m(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.ph.nb(b);return b}; Y.prototype.Dk=function(a,b){var c=this.of;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.cb,e=this.mb/2;c.type!==Fe||b||(e+=2);var f=w.vf();f.assign(d);f.Yf(e+2,e+2);if(!f.Ia(a))return w.Bb(f),!1;d=e+1E-4;if(c.type===Fe){if(null===this.stroke)return!1;d=(c.C-c.ha)*(a.x-c.ha)+(c.D-c.fa)*(a.y-c.fa);if(0>(c.ha-c.C)*(a.x-c.C)+(c.fa-c.D)*(a.y-c.D)||0>d)return!1;w.Bb(f);return Td(c.ha,c.fa,c.C,c.D,e,a.x,a.y)}if(c.type===Ge){var h=c.ha,k=c.fa,l=c.C,c=c.D;f.x=Math.min(h,l);f.y=Math.min(k, c);f.width=Math.abs(l-h);f.height=Math.abs(c-k);if(null===this.fill){f.Yf(-d,-d);if(f.Ia(a))return w.Bb(f),!1;f.Yf(d,d)}null!==this.stroke&&f.Yf(e,e);d=f.Ia(a);w.Bb(f);return d}if(c.type===He){var h=c.ha,k=c.fa,l=c.C,c=c.D,e=Math.min(h,l),m=Math.min(k,c),h=Math.abs(l-h)/2,k=Math.abs(c-k)/2,e=a.x-(e+h),m=a.y-(m+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=e*e/(h*h)+m*m/(k*k))return w.Bb(f),!1;h+=d;k+=d}null!==this.stroke&&(h+=d,k+=d);w.Bb(f);return 0>=h||0>=k?!1:1>=e*e/(h*h)+m*m/(k*k)}if(c.type=== Ce)return w.Bb(f),null===this.fill?uf(c,a.x,a.y,e):c.Ia(a,e,1=this.mb)n=je(p.Cc,p.Nc,p.zb,p.Jb,f,h,k,l,e);else{var r=0,s=0;p.Cc===p.zb?(r=m,s=0):(b=(p.Jb-p.Nc)/(p.zb-p.Cc),s=m/Math.sqrt(1+b*b),r=s*b);d=w.gb();b=new y;je(p.Cc+ r,p.Nc+s,p.zb+r,p.Jb+s,f,h,k,l,b)&&d.push(b);b=new y;je(p.Cc-r,p.Nc-s,p.zb-r,p.Jb-s,f,h,k,l,b)&&d.push(b);b=new y;je(p.Cc+r,p.Nc+s,p.Cc-r,p.Nc-s,f,h,k,l,b)&&d.push(b);b=new y;je(p.zb+r,p.Jb+s,p.zb-r,p.Jb-s,f,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return w.ta(d),!1;n=!0;s=Infinity;for(r=0;rMath.abs(c)){n=h-b-c*(f-d);if(0>a*a*c*c+t*t-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+t*t-n*n);k=(-(a*a*c*n)+a*t*m)/(t*t+a*a*c*c)+d;a=(-(a*a*c*n)-a*t*m)/(t*t+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((f-k)*(f-k))+Math.abs((h-l)*(h-l));h=Math.abs((f-a)*(f-a))+Math.abs((h-b)*(h- b));dk){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);dc?a-c:c-a)<(b>d?b-d:d-b)?(e=be||Wa(l.y,e))&&(l.ye||Wa(l.x,e))&&(l.x=h&&d<=a}a=h&&f<=a} Y.prototype.cF=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.Dk(a,!0))return!0;var e=a.Cf(b);b=e;1.5=e||Sa(b,f,0,-p)>=e||Sa(b,f,0,p)>=e||Sa(b,f,n,0)>= e?!1:!0}else if(f.type===Ce){h=f.cb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.xh&&a.ye&&Ra(a.x,a.y,k,l,m,l)>e&&Ra(a.x,a.y,m,h,k,h)>e&&Ra(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?uf(f,a.x,a.y,b):f.Ia(a,b,!0))return!0}else{c=f.fc;for(b=0;be)return!1;l=k.wb.n;m=l.length;for(h=0;he)return!1;break;case Ve:f=w.gb(); Wd(n,p,q.wc,q.Sc,q.Dh,q.Eh,q.C,q.D,.8,f);n=d(f,a);w.ta(f);if(n)return!1;n=q.C;p=q.D;if(a.Tp(n,p)>e)return!1;break;case We:f=w.gb();ge(n,p,q.wc,q.Sc,q.C,q.D,.8,f);n=d(f,a);w.ta(f);if(n)return!1;n=q.C;p=q.D;if(a.Tp(n,p)>e)return!1;break;case pf:case qf:var r=q.type===pf?rf(q,k):sf(q,k,n,p),s=r.length;if(0===s){n=q.la;p=q.ra;if(a.Tp(n,p)>e)return!1;break}q=null;f=w.gb();for(b=0;b= 0",Y,"strokeWidth:value")});w.defineProperty(Y,{TL:"strokeCap"},function(){return this.rp},function(a){var b=this.rp;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?w.Fa(a,'"butt", "round", or "square"',Y,"strokeCap"):(this.rp=a,this.oa(),this.h("strokeCap",b,a)))}); w.defineProperty(Y,{VL:"strokeJoin"},function(){return this.tp},function(a){var b=this.tp;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?w.Fa(a,'"miter", "bevel", or "round"',Y,"strokeJoin"):(this.tp=a,this.oa(),this.h("strokeJoin",b,a)))});w.defineProperty(Y,{WL:"strokeMiterLimit"},function(){return this.hn},function(a){var b=this.hn;if(b!==a)if(1<=a){this.hn=a;this.oa();var c=this.V;null!==c&&(c.lk=NaN);this.h("strokeMiterLimit",b,a)}else w.Fa(a,"value >= 1",Y,"strokeWidth:value")}); w.defineProperty(Y,{yG:"strokeDashArray"},function(){return this.sp},function(a){var b=this.sp;if(b!==a){null===a||Array.isArray(a)||w.Gd(a,"Array",Y,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1a?a=0:1a?a=0:1n*l*l&&(h=!0);b.hf!==a&&(h=!1);!1===b.Nk("textGreeking")&&(h=!1);n=this.fi;l=this.gi;switch(this.eu){case vo:a.translate(c, 0);a.scale(-1,1);break;case uo:a.translate(0,d);a.scale(1,-1);break;case wo:a.translate(c,d),a.scale(-1,-1)}var m=this.pe,p=(n+e+l)*m;d>p&&(k=this.Ml,k=k.y*d-k.y*p+k.offsetY);for(var p=this.zf,q=0;qc&&(r=c);var k=k+n,u=s,s=a,t=k,x=c,v=e,z=f,A=0;h?("left"===z?A=0:"right"===z?A=x-r:"center"===z&&(A=(x-r)/2),s.fillRect(0+A,t+.25*v,r,1)):("left"===z?A=0:"right"===z?A=x:"center"===z&&(A=x/2),s.fillText(u,0+A,t+v-.25*v),u=v/20|0,0===u&&(u=1),"right"===z?A-=r:"center"=== z&&(A-=r/2),this.gk&&(s.beginPath(),s.lineWidth=u,s.moveTo(0+A,t+v-.2*v),s.lineTo(0+A+r,t+v-.2*v),s.stroke()),this.ek&&(s.beginPath(),s.lineWidth=u,t=t+v-v/2.2|0,0!==u%2&&(t+=.5),s.moveTo(0+A,t),s.lineTo(0+A+r,t),s.stroke()));k+=e+l}switch(this.eu){case vo:a.scale(-1,1);a.translate(-c,0);break;case uo:a.scale(1,-1);a.translate(0,-d);break;case wo:a.scale(-1,-1),a.translate(-c,-d)}}}; Lh.prototype.On=function(a,b,c,d){this.Vo=a;var e=this.zf;e.reset();var f=0,h=0;if(isNaN(this.Ca.width)){f=this.Md.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===f.length)f=0;else if(this.Nx){for(var k=h=0,l=!1;!l;){var m=f.indexOf("\n",k);-1===m&&(m=f.length,l=!0);k=Kq(f.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.pg);k>h&&(h=k);k=m+1}f=h}else h=f.indexOf("\n",0),0<=h&&(f=f.substr(0,h)),f=k=Kq(f,this.pg);f=Math.min(f,a/this.scale);f=Math.max(8,f)}else f=this.Ca.width;null!==this.R&&(f=Math.min(f, this.R.Hf.width));h=Iq(this,f,e);m=h=isNaN(this.Ca.height)?Math.min(h,b/this.scale):this.Ca.height;if(0!==e.Ge&&1!==e.Se.length&&this.cj===Gq&&(b=this.pg,l=this.cj===Gq?Lq(b):0,k=this.fi+this.gi,k=Math.max(0,Jq(this)+k),m=Math.min(this.TI-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.Se.length))){k=e.Se[m];for(l=Math.max(1,a-l);Kq(k,b)>l&&1=a.gh)return new ia(0,l);if(a.nj===Dq){c.mj=1;f=Kq(b,k);if(0===h||f<=d)return c.Ge=Math.max(c.Ge,f),c.xf.push(c.Ge),c.Se.push(b),new ia(f,l);var m=Mq(a,b);b=b.substr(m.length);for(var n=Mq(a,b),f=Kq(m+n,k);0d&&1d;){n=1;f=Kq(m.substr(0,n),k);for(h=0;f<=d;)n++,h=f,f=Kq(m.substr(0,n),k);1===n?(c.xf[a.pe+p]=f,e=Math.max(e,f)):(c.xf[a.pe+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Se[a.pe+p]=m.substr(0,n);p++;m=m.substr(n);if(a.pe+p>a.gh)break}n=Mq(a,b);for(f=Kq(m+n,k);0a.gh))break}c.mj=Math.min(a.gh,p);c.Ge=Math.max(c.Ge,e);return new ia(c.Ge,l*c.mj)} function Mq(a,b){if(a.nj===Fq)return b.substr(0,1);for(var c=b.length,d=0;d=c?b:b.substr(0,d)}function Kq(a,b){Bq!==b&&(Bq=Cq.font=b);return Cq.measureText(a).width}function Jq(a){if(null!==a.zf.Wj)return a.zf.Wj;var b=a.pg;Bq!==b&&(Bq=Cq.font=b);var c=0;void 0!==wq[b]&&5E3>xq?c=wq[b]:(c=1.3*Cq.measureText("M").width,wq[b]=c,xq++);return a.zf.Wj=c} function Lq(a){Bq!==a&&(Bq=Cq.font=a);var b=0;void 0!==yq[a]&&5E3>zq?b=yq[a]:(b=Cq.measureText(Aq).width,yq[a]=b,zq++);return b} function Iq(a,b,c){var d=a.Md.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.fi+a.gi,e=Math.max(0,Jq(a)+e);if(0===d.length)return c.Ge=0,a.pe=1,e;if(!a.Nx){var f=d.indexOf("\n",0);0<=f&&(d=d.substr(0,f))}for(var f=0,h=a.pe=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.nj!==Dq?(c.mj=0,h=Hq(a,h,c,b),f+=h.height,a.pe+=c.mj):(Hq(a,h,c,b),f+=e,a.pe++),a.pe===a.gh&&(l=!0)),h=k+1;return a.mw=f} w.defineProperty(Lh,{MB:"textValidation"},function(){return this.Jl},function(a){var b=this.Jl;b!==a&&(null!==a&&w.j(a,"function",Lh,"textValidation"),this.Jl=a,this.h("textValidation",b,a))});w.defineProperty(Lh,{AG:"textEdited"},function(){return this.yt},function(a){var b=this.yt;b!==a&&(null!==a&&w.j(a,"function",Lh,"textEdited"),this.yt=a,this.h("textEdited",b,a))}); w.defineProperty(Lh,{QL:"spacingAbove"},function(){return this.fi},function(a){var b=this.fi;b!==a&&(this.fi=a,this.h("spacingAbove",b,a))});w.defineProperty(Lh,{RL:"spacingBelow"},function(){return this.gi},function(a){var b=this.gi;b!==a&&(this.gi=a,this.h("spacingBelow",b,a))});w.defineProperty(Lh,{TI:"maxLines"},function(){return this.gh},function(a){var b=this.gh;b!==a&&(a=Math.floor(a),0>=a&&w.Fa(a,"> 0",Lh,"maxLines"),this.gh=a,this.h("maxLines",b,a),this.H())});w.u(Lh,{wL:"metrics"},function(){return this.zf}); w.defineProperty(Lh,{HK:"choices"},function(){return this.$q},function(a){var b=this.$q;b!==a&&(null===a||Array.isArray(a)||w.Gd(a,"Array",Lh,"choices:value"),this.$q=a,this.h("choices",b,a))});function Yp(){this.Ge=this.mj=0;this.xf=[];this.Se=[];this.Wj=null}Yp.prototype.reset=function(){this.Ge=this.mj=0;this.Wj=null;this.xf=[];this.Se=[]};Yp.prototype.Np=function(a){this.mj=a.mj;this.Wj=a.Wj;this.Ge=a.Ge;this.xf=w.Ul(a.xf);this.Se=w.Ul(a.Se)};w.u(Yp,{DK:"arrSize"},function(){return this.xf}); w.u(Yp,{EK:"arrText"},function(){return this.Se});w.u(Yp,{vL:"maxLineWidth"},function(){return this.Ge});w.u(Yp,{dL:"fontHeight"},function(){return this.Wj});function yl(){G.call(this);this.Ue=null;this.st="";this.sk=Gd;this.Ko=Ee;this.ki=this.Ve=null;this.Jo=Jb;this.og=Qj;this.vp=null;this.Bz=!1;this.Nv=!0;this.kw=!1;this.mp=null}w.La(yl,G);w.ga("Picture",yl); yl.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.element=this.Ue;a.st=this.st;a.sk=this.sk.S();a.Ko=this.Ko;a.og=this.og;a.Ve=this.Ve;a.ki=this.ki;a.Jo=this.Jo.S();a.Nv=this.Nv;a.mp=this.mp};yl.prototype.gc=function(a){a===Qj||a===Sj||a===to?this.rI=a:G.prototype.gc.call(this,a)};yl.prototype.toString=function(){return"Picture("+this.source+")#"+w.Pd(this)};var Nq=new ra,Oq=0,sl=[]; function Pq(){var a=sl;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d=d.width&&(e=e+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(f=f+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case Ee:n=d.width;p=d.height;break;case Sj:case to:var s=0;q===Sj?(s=Math.min(d.height/p,d.width/n),n*=s,p*=s):q===to&&(s=Math.max(d.height/p,d.width/n),n*=s,p*=s,n>=d.width&&(e=(e+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(f=(f+r.offsetY+(p*r.y-d.height*r.y)/p)*h),k*=1/(n/d.width),h*=1/(p/d.height), n=d.width,p=d.height)}var q=this.vj()*b.scale,u=k*h/(n*q*p*q),s=Nq[this.source],q=null;if(c.Vr&&void 0!==s&&16s.Gp.length&&(Tq(s,4,l,m),Tq(s,16,l,m));for(var l=s.Gp,m=l.length,q=l[0],t=0;te;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.2,.22);b.B=new L(.8, .9);w.q(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=Xq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.07,.25);b.B=new L(.93,.75);w.q(a);return b},Heptagon:function(a,b,c){var d=Xq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.2,.15);b.B=new L(.8,.85);w.q(a);return b},Octagon:function(a,b,c){var d=Xq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0); for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.85);w.q(a);return b},Nonagon:function(a,b,c){var d=Xq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.17,.13);b.B=new L(.82,.82);w.q(a);return b},Decagon:function(a,b,c){var d=Xq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);w.q(a);return b}, Dodecagon:function(a,b,c){var d=Xq(12);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);w.q(a);return b},FivePointedStar:function(a,b,c){var d=Wq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.312,.383);b.B=new L(.693,.765);w.q(a);return b},SixPointedStar:function(a,b,c){var d=Wq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x* b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.17,.251);b.B=new L(.833,.755);w.q(a);return b},SevenPointedStar:function(a,b,c){var d=Wq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.363,.361);b.B=new L(.641,.709);w.q(a);return b},EightPointedStar:function(a,b,c){var d=Wq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.252,.255);b.B=new L(.75,.75);w.q(a);return b},NinePointedStar:function(a, b,c){var d=Wq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.355,.361);b.B=new L(.645,.651);w.q(a);return b},TenPointedStar:function(a,b,c){var d=Wq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);P(a);b=a.o;b.A=new L(.281,.261);b.B=new L(.723,.748);w.q(a);return b},FivePointedBurst:function(a,b,c){var d=Vq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;ea&&(a=.15);var d=w.s(),e=.2*bd;M(d,0,.2*c,!0);N(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);N(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);N(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);N(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c); M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.eb(!1);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);w.q(d);return b},DividedProcess:function(a,b,c){a=a?a.Hc:NaN;if(isNaN(a)||.1>a)a=.1;var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.eb(!1);b=d.o;b.A=new L(0,a);b.B=Sb;w.q(d);return b},Document:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);P(a);b=a.o;b.A=zb;b.B=new L(1,.6);w.q(a); return b},ExternalOrganization:function(a,b,c){a=a?a.Hc:NaN;if(isNaN(a)||.2>a)a=.2;var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);M(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-a)*c);d.eb(!1);b=d.o;b.A=new L(a/2,a/2);b.B=new L(1-a/2,1-a/2);w.q(d);return b},ExternalProcess:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);P(a); M(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.eb(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.75);w.q(a);return b},File:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);P(a);M(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.eb(!1);b=a.o;b.A=new L(0,.25);b.B=Sb;w.q(a);return b},Interrupt:function(a,b,c){a=w.s();M(a,1*b, .5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},InternalStorage:function(a,b,c){var d=a?a.Hc:NaN;a=a?a.Nu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=w.s();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);P(e);M(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.eb(!1);b=e.o;b.A=new L(d,a);b.B=Sb;w.q(e);return b},Junction:function(a,b, c){a=w.s();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,f=.5*bd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+f)*c,(.5+f)*b,1*c,.5*b,1*c);N(a,(.5-f)*b,1*c,0,(.5+f)*c,0,.5*c);N(a,0,(.5-f)*c,(.5-f)*b,0,.5*b,0);N(a,(.5+f)*b,0,1*b,(.5-f)*c,1*b,.5*c);M(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.eb(!1);b=a.o;b.$d=Sj;w.q(a);return b},LinedDocument:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);P(a);M(a,.1* b,0,!1);a.lineTo(.1*b,.75*c);a.eb(!1);b=a.o;b.A=new L(.1,0);b.B=new L(1,.6);w.q(a);return b},LoopLimit:function(a,b,c){a=w.s();M(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);P(a);b=a.o;b.A=new L(0,.25);b.B=Sb;w.q(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=w.s();var d=.5*bd;M(a,.5*b,1*c,!0);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+ d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.8);w.q(a);return b},ManualInput:function(a,b,c){a=w.s();M(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);P(a);b=a.o;b.A=new L(0,.25);b.B=Sb;w.q(a);return b},MessageFromUser:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.7);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);b=d.o;b.A=zb;b.B=new L(a,1);w.q(d);return b}, MicroformProcessing:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.25);var d=w.s();M(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);P(d);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);w.q(d);return b},MicroformRecording:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=new L(0,.25);b.B=new L(1,.75);w.q(a);return b},MultiDocument:function(a,b,c){c/=.8;a=w.s(); M(a,b,0,!0);a.lineTo(b,.5*c);N(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);N(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);N(a,.4*b,.4*c,.4*b,1*c,0,.7*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);a.lineTo(.1*b,.1*c);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);P(a);M(a,.1*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.54*c);a.moveTo(.2*b,.1*c);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.44*c);a.eb(!1);b=a.o;b.A=new L(0,.25);b.B=new L(.8,.77);w.q(a);return b},MultiProcess:function(a,b,c){a=w.s(); M(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);P(a);M(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.9*c);a.eb(!1);b=a.o;b.A=new L(0,.2);b.B=new L(.8,1);w.q(a);return b},OfflineStorage:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=w.s();M(e,0,0,!0);e.lineTo(1* b,0);e.lineTo(.5*b,1*c);P(e);M(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.eb(!1);b=e.o;b.A=new L(d/4+.5*a,a);b.B=new L(3*d/4+.5*a,a+.5*d);w.q(e);return b},OffPageConnector:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=zb;b.B=new L(.75,1);w.q(a);return b},Or:function(a,b,c){a=w.s();var d=.5*bd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a, (.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.eb(!1);b=a.o;b.$d=Sj;w.q(a);return b},PaperTape:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,.3*c);N(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);P(a);b=a.o;b.A=new L(0,.49);b.B=new L(1,.75);w.q(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Hc:NaN;a=a?a.Nu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.s();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1- a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);P(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);w.q(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Hc:NaN;a=a?a.Nu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.s();M(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);P(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);w.q(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0, 1*c);P(d);M(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.eb(!1);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);w.q(d);return b},Process:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);P(d);M(d,a*b,0,!1);d.lineTo(a*b,1*c);d.eb(!1);b=d.o;b.A=new L(a,0);b.B=Sb;w.q(d);return b},Sort:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);P(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5* c);a.eb(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.5);w.q(a);return b},Start:function(a,b,c){a=w.s();M(a,.25*b,0,!0);M(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);M(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.eb(!1);b=a.o;b.A=new L(.25,0);b.B=new L(.75,1);w.q(a);return b},Terminator:function(a,b,c){a=w.s();M(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);b=a.o;b.A=new L(.23,0); b.B=new L(.77,1);w.q(a);return b},TransmittalTape:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);P(d);b=d.o;b.A=zb;b.B=new L(1,1-a);w.q(d);return b},AndGate:function(a,b,c){a=w.s();var d=.5*bd;M(a,0,0,!0);a.lineTo(.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=zb;b.B=new L(.55,1);w.q(a);return b},Buffer:function(a,b,c){a=w.s();M(a, 0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);P(a);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},Clock:function(a,b,c){a=w.s();var d=.5*bd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);M(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2* b,.75*c);a.eb(!1);b=a.o;b.$d=Sj;w.q(a);return b},Ground:function(a,b,c){a=w.s();M(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.o;w.q(a);return b},Inverter:function(a,b,c){a=w.s();var d=.1*bd;M(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);N(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);N(a,.8*b,(.5-d)*c,(.9-d)*b,.4* c,.9*b,.4*c);N(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.A=new L(0,.25);b.B=new L(.4,.75);w.q(a);return b},NandGate:function(a,b,c){a=w.s();var d=.5*bd,e=.4*bd,f=.1*bd;M(a,.8*b,.5*c,!0);N(a,.8*b,(.5+e)*c,(.4+d)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);N(a,(.4+d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);M(a,1*b,.5*c,!0);N(a,1*b,(.5+f)*c,(.9+f)*b,.6*c,.9*b,.6*c);N(a,(.9-f)*b,.6*c,.8*b,(.5+f)*c,.8*b,.5*c);N(a,.8*b,(.5-f)*c,(.9-f)*b,.4*c,.9*b,.4*c);N(a,(.9+f)*b,.4*c,1*b,(.5-f)*c,1*b,.5* c);b=a.o;b.A=new L(0,.05);b.B=new L(.55,.95);w.q(a);return b},NorGate:function(a,b,c){a=w.s();var d=.5,e=bd*d,f=0,h=.5;M(a,.8*b,.5*c,!0);N(a,.7*b,(h+e)*c,(f+e)*b,(h+d)*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);N(a,(f+e)*b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*bd;f=.9;h=.5;M(a,(f-d)*b,h*c,!0);N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);N(a,(f+d)*b,(h+e)*c,(f+e)*b,(h+d)*c,f*b,(h+d)*c);N(a,(f-e)*b,(h+d)*c,(f-d)*b,(h+e)*c,(f-d)*b,h*c);b=a.o;b.A= new L(.2,.25);b.B=new L(.6,.75);w.q(a);return b},OrGate:function(a,b,c){a=w.s();var d=.5*bd;M(a,0,0,!0);N(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);N(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);P(a);b=a.o;b.A=new L(.2,.25);b.B=new L(.75,.75);w.q(a);return b},XnorGate:function(a,b,c){a=w.s();var d=.5,e=bd*d,f=.2,h=.5;M(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.8*b,.5*c,!0);N(a,.7*b,(h+e)*c,(f+e)*b,(h+d)*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);N(a,(f+e)* b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*bd;f=.9;h=.5;M(a,(f-d)*b,h*c,!0);N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);N(a,(f+d)*b,(h+e)*c,(f+e)*b,(h+d)*c,f*b,(h+d)*c);N(a,(f-e)*b,(h+d)*c,(f-d)*b,(h+e)*c,(f-d)*b,h*c);b=a.o;b.A=new L(.4,.25);b.B=new L(.65,.75);w.q(a);return b},XorGate:function(a,b,c){a=w.s();var d=.5*bd;M(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.2*b,0,!0);N(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);N(a,.9*b,(.5+d)* c,(.2+d)*b,1*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);P(a);b=a.o;b.A=new L(.4,.25);b.B=new L(.8,.75);w.q(a);return b},Capacitor:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},Resistor:function(a,b,c){a=w.s();M(a,0,.5*c,!1);a.lineTo(.1*b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.o;w.q(a);return b},Inductor:function(a,b,c){a=w.s();var d=.1*bd,e=.1;M(a,(e-.5* d)*b,c,!1);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;N(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.o;w.q(a);return b},ACvoltageSource:function(a,b,c){a=w.s();var d=.5*bd;M(a,0*b,.5*c,!1);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)* c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);N(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.o;b.$d=Sj;w.q(a);return b},DCvoltageSource:function(a,b,c){a=w.s();M(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},Diode:function(a,b,c){a=w.s();M(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},Wifi:function(a,b,c){var d=b,e=c; b*=.38;c*=.6;a=w.s();var f=.8*bd,h=.8,k=0,l=.5,d=(d-b)/2,e=(e-c)/2;M(a,k*b+d,(l+h)*c+e,!0);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);N(a,k*b+d,(l-h)*c+e,(k-h+.5*f)*b+d,(l-f)*c+e,(k-h+.5*f)*b+d,l*c+e);N(a,(k-h+.5*f)*b+d,(l+f)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);P(a);f=.4*bd;h=.4;k=.2;l=.5;M(a,k*b+d,(l+h)*c+e,!0);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k* b+d,(l-h)*c+e);N(a,k*b+d,(l-h)*c+e,(k-h+.5*f)*b+d,(l-f)*c+e,(k-h+.5*f)*b+d,l*c+e);N(a,(k-h+.5*f)*b+d,(l+f)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);P(a);f=.2*bd;h=.2;l=k=.5;M(a,(k-h)*b+d,l*c+e,!0);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);N(a,(k+f)*b+d,(l-h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);f=.4*bd;h=.4;k=.8;l=.5;M(a,k*b+d,(l-h)*c+e,!0);N(a,(k+f)*b+d,(l- h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,k*b+d,(l+h)*c+e,(k+h-.5*f)*b+d,(l+f)*c+e,(k+h-.5*f)*b+d,l*c+e);N(a,(k+h-.5*f)*b+d,(l-f)*c+e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);P(a);f=.8*bd;h=.8;k=1;l=.5;M(a,k*b+d,(l-h)*c+e,!0);N(a,(k+f)*b+d,(l-h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,k*b+d,(l+h)*c+e,(k+h-.5*f)*b+d,(l+f)*c+e,(k+h-.5*f)*b+d,l*c+e);N(a,(k+h-.5*f)*b+d,(l-f)*c+ e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);P(a);b=a.o;w.q(a);return b},Email:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);P(a);M(a,0,0,!1);a.lineTo(.5*b,.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(.45*b,.54*c);a.moveTo(1*b,1*c);a.lineTo(.55*b,.54*c);a.eb(!1);b=a.o;w.q(a);return b},Ethernet:function(a,b,c){a=w.s();M(a,.35*b,0,!0);a.lineTo(.65*b,0);a.lineTo(.65*b,.4*c);a.lineTo(.35*b,.4*c);a.lineTo(.35*b,0);P(a);M(a,.1*b,1*c,!0,!0);a.lineTo(.4*b,1*c); a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);P(a);M(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);P(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*b,.6*c);a.eb(!1);b=a.o;w.q(a);return b},Power:function(a,b,c){a=w.s();var d=.4*bd,e=.4,f=w.K(),h=w.K(),k=w.K(),l=w.K();Xd(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,f,f,h,k,l);var m=w.xb(h.x, h.y);M(a,h.x*b,h.y*c,!0);N(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);N(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);Xd(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,f,f);N(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*bd;e=.3;Xd(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,f,f);a.lineTo(h.x*b,h.y*c);N(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);N(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+ e)*b,.5*c);Xd(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,f,f,h,k,l);N(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);P(a);M(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);P(a);w.v(f);w.v(h);w.v(k);w.v(l);w.v(m);b=a.o;b.A=new L(.25,.55);b.B=new L(.75,.8);w.q(a);return b},Fallout:function(a,b,c){a=w.s();var d=.5*bd;M(a,0*b,.5*c,!0);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b, .5*c);var e=d=0;M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;P(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;P(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);P(a);b=a.o;b.$d=Sj;w.q(a);return b},IrritationHazard:function(a,b,c){a=w.s();M(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8* b,0*c);a.lineTo(1*b,.2*c);a.lineTo(.7*b,.5*c);a.lineTo(1*b,.8*c);a.lineTo(.8*b,1*c);a.lineTo(.5*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0*b,.8*c);a.lineTo(.3*b,.5*c);a.lineTo(0*b,.2*c);P(a);b=a.o;b.A=new L(.3,.3);b.B=new L(.7,.7);w.q(a);return b},ElectricalHazard:function(a,b,c){a=w.s();M(a,.37*b,0*c,!0);a.lineTo(.5*b,.11*c);a.lineTo(.77*b,.04*c);a.lineTo(.33*b,.49*c);a.lineTo(1*b,.37*c);a.lineTo(.63*b,.86*c);a.lineTo(.77*b,.91*c);a.lineTo(.34*b,1*c);a.lineTo(.34*b,.78*c);a.lineTo(.44*b,.8*c);a.lineTo(.65* b,.56*c);a.lineTo(0*b,.68*c);P(a);b=a.o;w.q(a);return b},FireHazard:function(a,b,c){a=w.s();M(a,.1*b,1*c,!0);N(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);N(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);N(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);N(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);N(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*c);N(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);P(a);b=a.o;b.A=new L(.05,.645);b.B=new L(.884,.908);w.q(a);return b},BpmnActivityLoop:function(a,b,c){a=w.s();var d=4*(Math.SQRT2-1)/3*.5;M(a,.65*b,1*c, !1);N(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);N(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);N(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);N(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.35*b,.98*c);a.moveTo(.25*b,.8*c);a.lineTo(.35*b,1*c);a.lineTo(.1*b,1*c);b=a.o;w.q(a);return b},BpmnActivityParallel:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},BpmnActivitySequential:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(1* b,0);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);a.moveTo(0,1*c);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},BpmnActivityAdHoc:function(a,b,c){a=w.s();M(a,0,0,!1);M(a,1*b,1*c,!1);M(a,0,.5*c,!1);N(a,.2*b,.35*c,.3*b,.35*c,.5*b,.5*c);N(a,.7*b,.65*c,.8*b,.65*c,1*b,.5*c);b=a.o;w.q(a);return b},BpmnActivityCompensation:function(a,b,c){a=w.s();M(a,0,.5*c,!0);a.lineTo(.5*b,0);a.lineTo(.5*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);a.lineTo(.5*b,1*c);P(a);b=a.o;w.q(a);return b},BpmnTaskMessage:function(a, b,c){a=w.s();M(a,0,.2*c,!0);a.lineTo(1*b,.2*c);a.lineTo(1*b,.8*c);a.lineTo(0,.8*c);a.lineTo(0,.8*c);P(a);M(a,0,.2*c,!1);a.lineTo(.5*b,.5*c);a.lineTo(1*b,.2*c);a.eb(!1);b=a.o;w.q(a);return b},BpmnTaskScript:function(a,b,c){a=w.s();M(a,.7*b,1*c,!0);a.lineTo(.3*b,1*c);N(a,.6*b,.5*c,0,.5*c,.3*b,0);a.lineTo(.7*b,0);N(a,.4*b,.5*c,1*b,.5*c,.7*b,1*c);P(a);M(a,.45*b,.73*c,!1);a.lineTo(.7*b,.73*c);a.moveTo(.38*b,.5*c);a.lineTo(.63*b,.5*c);a.moveTo(.31*b,.27*c);a.lineTo(.56*b,.27*c);a.eb(!1);b=a.o;w.q(a);return b}, BpmnTaskUser:function(a,b,c){a=w.s();M(a,0,0,!1);M(a,.335*b,(1-.555)*c,!0);a.lineTo(.335*b,.595*c);a.lineTo(.665*b,.595*c);a.lineTo(.665*b,(1-.555)*c);N(a,.88*b,.46*c,.98*b,.54*c,1*b,.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.68*c);N(a,.02*b,.54*c,.12*b,.46*c,.335*b,(1-.555)*c);a.lineTo(.365*b,.405*c);var d=.5-.285,e=Math.PI/4,f=4*(1-Math.cos(e))/(3*Math.sin(e)),e=f*d,f=f*d;N(a,(.5-(e+d)/2)*b,(d+(d+f)/2)*c,(.5-d)*b,(d+f)*c,(.5-d)*b,d*c);N(a,(.5-d)*b,(d-f)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c); N(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-f)*c,(.5+d)*b,d*c);N(a,(.5+d)*b,(d+f)*c,(.5+(e+d)/2)*b,(d+(d+f)/2)*c,.635*b,.405*c);a.lineTo(.635*b,.405*c);a.lineTo(.665*b,(1-.555)*c);a.lineTo(.665*b,.595*c);a.lineTo(.335*b,.595*c);M(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);M(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.o;w.q(a);return b},BpmnEventConditional:function(a,b,c){a=w.s();M(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);P(a);M(a,.2*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.moveTo(.2*b,.4*c);a.lineTo(.8* b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.2*b,.8*c);a.lineTo(.8*b,.8*c);a.eb(!1);b=a.o;w.q(a);return b},BpmnEventError:function(a,b,c){a=w.s();M(a,0,1*c,!0);a.lineTo(.33*b,0);a.lineTo(.66*b,.5*c);a.lineTo(1*b,0);a.lineTo(.66*b,1*c);a.lineTo(.33*b,.5*c);P(a);b=a.o;w.q(a);return b},BpmnEventEscalation:function(a,b,c){a=w.s();M(a,0,0,!1);M(a,1*b,1*c,!1);M(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);P(a);b=a.o;w.q(a);return b},BpmnEventTimer:function(a,b,c){a= w.s();var d=.5*bd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.eb(!1);b=a.o;b.$d=Sj;w.q(a);return b}},Yq;for(Yq in lq)lq[Yq.toLowerCase()]=Yq; var sq={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8", BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4", BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8", TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4", BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z", DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z", TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z", OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8", OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"}; function pq(a){var b=Qd[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=Qd[c];if(void 0===b){var d=null,e;for(e in sq)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=Oe(sq[d],!1),Qd[d]=a,c!==d&&(Qd[c]=d),d}}return"string"===typeof b?b:b instanceof Be?a:null} function R(a){C.call(this,a);this.N=2408959;this.yl=this.Ci="";this.$s=this.Xs=this.it=this.es=null;this.kt="";this.Ai=this.Rr=this.jt=this.dn=null;this.Zs="";this.ip=null;this.Ys=Fd;this.at="";this.jp=null;this.Md="";this.hw=this.cr=this.jl=null;this.Xi=(new y(NaN,NaN)).freeze();this.ks="";this.Bl=null;this.ls=zb;this.ts=od;this.ms=pd;this.xr=null;this.fs=Zq;this.fn=nd;this.en="gray";this.Dg=4;this.sD=-1;this.It=NaN;this.SG=new B;this.Sm=null;this.lk=NaN}w.La(R,C);w.ga("Part",R); R.prototype.cloneProtected=function(a){C.prototype.cloneProtected.call(this,a);a.N=this.N&-4097|49152;a.Ci=this.Ci;a.yl=this.yl;a.es=this.es;a.it=this.it;a.Xs=this.Xs;a.$s=this.$s;a.kt=this.kt;a.jt=this.jt;a.Rr=this.Rr;a.Ai=null;a.Zs=this.Zs;a.Ys=this.Ys.S();a.at=this.at;a.Md=this.Md;a.cr=this.cr;a.Xi.assign(this.Xi);a.ks=this.ks;a.ls=this.ls.S();a.ts=this.ts.S();a.ms=this.ms.S();a.xr=this.xr;a.fs=this.fs;a.fn=this.fn.S();a.en=this.en;a.Dg=this.Dg;a.It=this.It}; R.prototype.pi=function(a){C.prototype.pi.call(this,a);a.Qk();a.dn=null;a.ip=null;a.jp=null;a.Bl=null;a.Sm=null};R.prototype.toString=function(){var a=w.pf(Object.getPrototypeOf(this))+"#"+w.Pd(this);null!==this.data&&(a+="("+Qf(this.data)+")");return a};R.LayoutNone=0;var Om;R.LayoutAdded=Om=1;var Xm;R.LayoutRemoved=Xm=2;R.LayoutShown=4;R.LayoutHidden=8;R.LayoutNodeSized=16;var Dn;R.LayoutGroupLayout=Dn=32;R.LayoutNodeReplaced=64;var Zq;R.LayoutStandard=Zq=Om|Xm|28|Dn|64;R.LayoutAll=16777215; R.prototype.Xn=function(a,b,c,d,e,f,h){var k=this.g;null!==k&&(a===Ef&&"elements"===b?e instanceof C?Pm(e,function(a){Rm(k,a);Qm(k,a)}):e instanceof yl&&pn(k,e):a===Ff&&"elements"===b&&(e instanceof C?Pm(e,function(a){Vm(k,a);Um(k,a)}):e instanceof yl&&qn(k,e)),k.cd(a,b,c,d,e,f,h))};R.prototype.updateTargetBindings=R.prototype.Lb=function(a){C.prototype.Lb.call(this,a);if(null!==this.data){a=this.xa.n;for(var b=a.length,c=0;ce.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.VI)){this.N^=4096;var d=!1;if(null!==c){d=c.fb;c.fb=!0;var e=c.selection;e.Qa();a?e.add(this):e.remove(this);e.freeze()}this.h("isSelected",b,a);this.fe();a=this.GJ;null!==a&&a(this);null!==c&&(c.ye(),c.fb=d)}}}); w.defineProperty(R,{Ng:"isHighlighted"},function(){return 0!==(this.N&524288)},function(a){var b=0!==(this.N&524288);if(b!==a){this.N^=524288;var c=this.g;null!==c&&(c=c.dm,c.Qa(),a?c.add(this):c.remove(this),c.freeze());this.h("isHighlighted",b,a);this.oa();a=this.pI;null!==a&&a(this)}});w.defineProperty(R,{im:"isShadowed"},function(){return 0!==(this.N&8192)},function(a){var b=0!==(this.N&8192);b!==a&&(this.N^=8192,this.h("isShadowed",b,a),this.oa())});function Hm(a){return 0!==(a.N&32768)} function br(a,b){a.N=b?a.N|32768:a.N&-32769}function Ko(a,b){a.N=b?a.N|65536:a.N&-65537}function kl(a){return 0!==(a.N&131072)}R.prototype.If=function(a){this.N=a?this.N|131072:this.N&-131073};function kr(a,b){a.N=b?a.N|1048576:a.N&-1048577}w.defineProperty(R,{xF:"isAnimated"},function(){return 0!==(this.N&262144)},function(a){var b=0!==(this.N&262144);b!==a&&(this.N^=262144,this.h("isAnimated",b,a))}); w.defineProperty(R,{pI:"highlightedChanged"},function(){return this.Rr},function(a){var b=this.Rr;b!==a&&(null!==a&&w.j(a,"function",R,"highlightedChanged"),this.Rr=a,this.h("highlightedChanged",b,a))});w.defineProperty(R,{zB:"selectionObjectName"},function(){return this.kt},function(a){var b=this.kt;b!==a&&(this.kt=a,this.dn=null,this.h("selectionObjectName",b,a))}); w.defineProperty(R,{FJ:"selectionAdornmentTemplate"},function(){return this.it},function(a){var b=this.it;b!==a&&(this.it=a,this.h("selectionAdornmentTemplate",b,a))});w.u(R,{zq:"selectionObject"},function(){if(null===this.dn){var a=this.zB;null!==a&&""!==a?(a=this.Dd(a),this.dn=null!==a?a:this):this instanceof W?(a=this.path,this.dn=null!==a?a:this):this.dn=this}return this.dn}); w.defineProperty(R,{GJ:"selectionChanged"},function(){return this.jt},function(a){var b=this.jt;b!==a&&(null!==a&&w.j(a,"function",R,"selectionChanged"),this.jt=a,this.h("selectionChanged",b,a))});w.defineProperty(R,{gG:"resizeAdornmentTemplate"},function(){return this.Xs},function(a){var b=this.Xs;b!==a&&(this.Xs=a,this.h("resizeAdornmentTemplate",b,a))}); w.defineProperty(R,{iG:"resizeObjectName"},function(){return this.Zs},function(a){var b=this.Zs;b!==a&&(this.Zs=a,this.ip=null,this.h("resizeObjectName",b,a))});w.u(R,{hG:"resizeObject"},function(){if(null===this.ip){var a=this.iG;null!==a&&""!==a?(a=this.Dd(a),this.ip=null!==a?a:this):this.ip=this}return this.ip});w.defineProperty(R,{uJ:"resizeCellSize"},function(){return this.Ys},function(a){var b=this.Ys;b.L(a)||(this.Ys=a=a.S(),this.h("resizeCellSize",b,a))}); w.defineProperty(R,{xJ:"rotateAdornmentTemplate"},function(){return this.$s},function(a){var b=this.$s;b!==a&&(this.$s=a,this.h("rotateAdornmentTemplate",b,a))});w.defineProperty(R,{yJ:"rotateObjectName"},function(){return this.at},function(a){var b=this.at;b!==a&&(this.at=a,this.jp=null,this.h("rotateObjectName",b,a))});w.u(R,{vB:"rotateObject"},function(){if(null===this.jp){var a=this.yJ;null!==a&&""!==a?(a=this.Dd(a),this.jp=null!==a?a:this):this.jp=this}return this.jp}); w.defineProperty(R,{text:"text"},function(){return this.Md},function(a){var b=this.Md;b!==a&&(this.Md=a,this.h("text",b,a))}); w.defineProperty(R,{Da:"containingGroup"},function(){return this.jl},function(a){if(this.he()){var b=this.jl;if(b!==a){null===a||this!==a&&!a.qi(this)||(this===a&&w.k("Cannot make a Group a member of itself: "+this.toString()),w.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.J(Xm);var c=this.g;null!==b?lr(b,this):this instanceof V&&null!==c&&c.Kl.remove(this);this.jl=a;null!==a?mr(a,this):this instanceof V&&null!==c&&c.Kl.add(this);this.J(Om); if(null!==c){var d=this.data,e=c.$;null!==d&&e instanceof Q&&e.CB(d,e.qb(null!==a?a.data:null))}d=this.LE;null!==d&&(e=!0,null!==c&&(e=c.Ua,c.Ua=!0),d(this,b,a),null!==c&&(c.Ua=e));if(this instanceof V)for(c=new I(R),ih(c,this,!0,0,!0),c=c.i;c.next();)if(d=c.value,d instanceof T)for(d=d.je;d.next();)tn(d.value);if(this instanceof T){for(d=this.je;d.next();)tn(d.value);c=this.Xb;null!==c&&tn(c)}this.h("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&pl(b,-1,a))}}else w.k("cannot set the Part.containingGroup of a Link or Adornment")}); g=R.prototype;g.Qk=function(){var a=this.Da;null!==a&&(a.H(),null!==a.Nb&&a.Nb.H(),a.$f())};g.oa=function(){var a=this.g;null!==a&&!Gm(this)&&!Hm(this)&&this.isVisible()&&this.oc.I()&&a.oa(ol(this,this.oc))};g.H=function(){C.prototype.H.call(this);var a=this.g;null!==a&&(a.ug.add(this),this instanceof T&&null!==this.Xb&&Uo(this.Xb),a.ye(!0))};g.nu=function(a){a||(a=this.jl,null!==a&&mr(a,this))};g.ou=function(a){a||(a=this.jl,null!==a&&lr(a,this))}; g.xn=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.$,null!==b&&b.py(a))}};w.defineProperty(R,{LE:"containingGroupChanged"},function(){return this.cr},function(a){var b=this.cr;b!==a&&(null!==a&&w.j(a,"function",R,"containingGroupChanged"),this.cr=a,this.h("containingGroupChanged",b,a))});R.prototype.findSubGraphLevel=function(){return nr(this,this)};function nr(a,b){var c=b.Da;return null!==c?1+nr(a,c):b instanceof T&&(c=b.Xb,null!==c)?nr(a,c):0} R.prototype.findTopLevelPart=function(){return or(this,this)};function or(a,b){var c=b.Da;return null!==c?or(a,c):b instanceof T&&(c=b.Xb,null!==c)?or(a,c):b}w.u(R,{eq:"isTopLevel"},function(){return null!==this.Da||this instanceof T&&null!==this.Xb?!1:!0});R.prototype.isMemberOf=R.prototype.qi=function(a){return a instanceof V?pr(this,this,a):!1};function pr(a,b,c){if(b===c||null===c)return!1;var d=b.Da;return null===d||d!==c&&!pr(a,d,c)?b instanceof T&&(b=b.Xb,null!==b)?pr(a,b,c):!1:!0} R.prototype.findCommonContainingGroup=R.prototype.WH=function(a){if(null===a)return null;if(this===a)return this.Da;for(var b=this;null!==b;){b instanceof V&&kr(b,!0);if(b instanceof T){var c=b.Xb;null!==c&&(b=c)}b=b.Da}for(var d=null,b=a;null!==b;){if(0!==(b.N&1048576)){d=b;break}b instanceof T&&(c=b.Xb,null!==c&&(b=c));b=b.Da}for(b=this;null!==b;)b instanceof V&&kr(b,!1),b instanceof T&&(c=b.Xb,null!==c&&(b=c)),b=b.Da;return d}; w.defineProperty(R,{KI:"layoutConditions"},function(){return this.fs},function(a){var b=this.fs;b!==a&&(this.fs=a,this.h("layoutConditions",b,a))});R.prototype.canLayout=function(){if(!this.FF||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Qc||this instanceof T&&this.Df?!1:!0}; R.prototype.invalidateLayout=R.prototype.J=function(a){void 0===a&&(a=16777215);var b;this.FF&&0!==(a&this.KI)?(b=this.layer,null!==b&&b.Qc||this instanceof T&&this.Df?b=!1:(b=this.g,b=null!==b&&b.ja.lb?!1:!0)):b=!1;if(b)if(b=this.jl,null!==b){var c=b.Tb;null!==c?c.J():b.J(a)}else a=this.g,null!==a&&(c=a.Tb,null!==c&&c.J())};function Tm(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Qc?!1:!0} w.defineProperty(R,{wx:"dragComputation"},function(){return this.xr},function(a){var b=this.xr;b!==a&&(null!==a&&w.j(a,"function",R,"dragComputation"),this.xr=a,this.h("dragComputation",b,a))});w.defineProperty(R,{KJ:"shadowOffset"},function(){return this.fn},function(a){var b=this.fn;b.L(a)||(this.fn=a=a.S(),this.oa(),this.h("shadowOffset",b,a))}); w.defineProperty(R,{shadowColor:"shadowColor"},function(){return this.en},function(a){var b=this.en;b!==a&&(this.en=a,this.oa(),this.h("shadowColor",b,a))});w.defineProperty(R,{shadowBlur:"shadowBlur"},function(){return this.Dg},function(a){var b=this.Dg;b!==a&&(this.Dg=a,this.oa(),this.h("shadowBlur",b,a))});function jh(a){0===arguments.length?R.call(this,Uj):R.call(this,a);this.N&=-257;this.yl="Adornment";this.Jc=null;this.CD=0;this.pE=!1;this.Nb=this.Yg=null}w.La(jh,R);w.ga("Adornment",jh); jh.prototype.toString=function(){var a=this.Ye;return"Adornment("+this.Ad+")"+(null!==a?a.toString():"")};jh.prototype.updateRelationshipsFromData=function(){};jh.prototype.Eu=function(a){var b=this.ub.V,c=this.ub;if(b instanceof W&&c instanceof Y){var d=b.path,c=d.of;b.Eu(a);c=d.of;a=this.xa.n;b=a.length;for(d=0;da&&(a=1);var b=this.g;if(null!==b&&!b.xh){b.xh=!0;var c=new I(T);c.add(this);Cr(this,c,b.Ud,a,b.Ka,this,b.TB===vl);b.xh=!1}}; function Cr(a,b,c,d,e,f,h){if(1a&&(a=2);var b=this.g;if(null!==b&&!b.xh){b.xh=!0;var c=new I(T);c.add(this);Er(this,c,b.Ud,a,b.Ka,this,b.TB===vl);b.xh=!1}};function Er(a,b,c,d,e,f,h){for(var k=f===a?!1:a.uc,l=c?a.Dx():a.Lg();l.next();){var m=l.value;m.bc&&(k||m.Mf||m.Wb(),m=m.IA(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.Ed(!0),m.Qk(),h&&gl(e,m,f)),2c&&(c-=180);break;case Up:c=pe(b+90);90c&&(c-=180);break;case Wp:c=pe(b-90);90c&&(c-=180);break;case Xp:c=pe(b);if(45c||225c)return 0;90c&&(c-=180)}return pe(c)}; w.defineProperty(W,{Y:"fromNode"},function(){return this.qg},function(a){var b=this.qg;if(b!==a){var c=this.kc;null!==b&&(this.Gg!==b&&yr(b,this,c),Mr(this),this.J(Xm));this.qg=a;null!==a&&this.Ed(a.isVisible());this.Oi=null;this.Wb();var d=this.g;if(null!==d){var e=this.data,f=d.$;if(null!==e)if(f instanceof Q){var h=null!==a?a.data:null;f.AB(e,f.qb(h))}else f instanceof Zf&&(h=null!==a?a.data:null,d.Ud?f.ti(e,f.qb(h)):(null!==b&&f.ti(b.data,void 0),f.ti(h,f.qb(null!==this.Gg?this.Gg.data:null))))}e= this.kc;f=this.gF;null!==f&&(h=!0,null!==d&&(h=d.Ua,d.Ua=!0),f(this,c,e),null!==d&&(d.Ua=h));null!==a&&(this.Gg!==a&&xr(a,this,e),Nr(this),this.J(Om));this.h("fromNode",b,a);tn(this)}}); w.defineProperty(W,{Mg:"fromPortId"},function(){return this.Rh},function(a){var b=this.Rh;if(b!==a){var c=this.Y,d=this.kc;null!==d&&wr(c,d);Mr(this);this.Rh=a;var e=this.kc;null!==e&&wr(c,e);c=this.g;if(null!==c){var f=this.data,h=c.$;null!==f&&h instanceof Q&&h.BB(f,a)}d!==e&&(this.Oi=null,this.Wb(),f=this.gF,null!==f&&(h=!0,null!==c&&(h=c.Ua,c.Ua=!0),f(this,d,e),null!==c&&(c.Ua=h)));Nr(this);this.h("fromPortId",b,a)}});w.u(W,{kc:"fromPort"},function(){var a=this.qg;return null===a?null:a.DA(this.Rh)}); w.defineProperty(W,{gF:"fromPortChanged"},function(){return this.Hr},function(a){var b=this.Hr;b!==a&&(null!==a&&w.j(a,"function",W,"fromPortChanged"),this.Hr=a,this.h("fromPortChanged",b,a))}); w.defineProperty(W,{Z:"toNode"},function(){return this.Gg},function(a){var b=this.Gg;if(b!==a){var c=this.Ic;null!==b&&(this.qg!==b&&yr(b,this,c),Mr(this),this.J(Xm));this.Gg=a;null!==a&&this.Ed(a.isVisible());this.Oi=null;this.Wb();var d=this.g;if(null!==d){var e=this.data,f=d.$;if(null!==e)if(f instanceof Q){var h=null!==a?a.data:null;f.GB(e,f.qb(h))}else f instanceof Zf&&(h=null!==a?a.data:null,d.Ud?(null!==b&&f.ti(b.data,void 0),f.ti(h,f.qb(null!==this.qg?this.qg.data:null))):f.ti(e,f.qb(h)))}e= this.Ic;f=this.DG;null!==f&&(h=!0,null!==d&&(h=d.Ua,d.Ua=!0),f(this,c,e),null!==d&&(d.Ua=h));null!==a&&(this.qg!==a&&xr(a,this,e),Nr(this),this.J(Om));this.h("toNode",b,a);tn(this)}}); w.defineProperty(W,{Ih:"toPortId"},function(){return this.li},function(a){var b=this.li;if(b!==a){var c=this.Z,d=this.Ic;null!==d&&wr(c,d);Mr(this);this.li=a;var e=this.Ic;null!==e&&wr(c,e);c=this.g;if(null!==c){var f=this.data,h=c.$;null!==f&&h instanceof Q&&h.HB(f,a)}d!==e&&(this.Oi=null,this.Wb(),f=this.DG,null!==f&&(h=!0,null!==c&&(h=c.Ua,c.Ua=!0),f(this,d,e),null!==c&&(c.Ua=h)));Nr(this);this.h("toPortId",b,a)}});w.u(W,{Ic:"toPort"},function(){var a=this.Gg;return null===a?null:a.DA(this.li)}); w.defineProperty(W,{DG:"toPortChanged"},function(){return this.Ct},function(a){var b=this.Ct;b!==a&&(null!==a&&w.j(a,"function",W,"toPortChanged"),this.Ct=a,this.h("toPortChanged",b,a))});w.defineProperty(W,{Cb:"fromSpot"},function(){return null!==this.W?this.W.$j:qc},function(a){this.Qd();var b=this.W.$j;b.L(a)||(a=a.S(),this.W.$j=a,this.h("fromSpot",b,a),this.Wb())}); w.defineProperty(W,{$l:"fromEndSegmentLength"},function(){return null!==this.W?this.W.Yj:NaN},function(a){this.Qd();var b=this.W.Yj;b!==a&&(0>a&&w.Fa(a,">= 0",W,"fromEndSegmentLength"),this.W.Yj=a,this.h("fromEndSegmentLength",b,a),this.Wb())});w.defineProperty(W,{hu:"fromEndSegmentDirection"},function(){return null!==this.W?this.W.Xj:rr},function(a){this.Qd();var b=this.W.Xj;b!==a&&(w.Ut("Link.fromEndSegmentDirection","2.0"),this.W.Xj=a,this.h("fromEndSegmentDirection",b,a),this.Wb())}); w.defineProperty(W,{iu:"fromShortLength"},function(){return null!==this.W?this.W.Zj:NaN},function(a){this.Qd();var b=this.W.Zj;b!==a&&(this.W.Zj=a,this.h("fromShortLength",b,a),this.Wb(),this.ge())});w.defineProperty(W,{Db:"toSpot"},function(){return null!==this.W?this.W.yk:qc},function(a){this.Qd();var b=this.W.yk;b.L(a)||(a=a.S(),this.W.yk=a,this.h("toSpot",b,a),this.Wb())}); w.defineProperty(W,{tm:"toEndSegmentLength"},function(){return null!==this.W?this.W.wk:NaN},function(a){this.Qd();var b=this.W.wk;b!==a&&(0>a&&w.Fa(a,">= 0",W,"toEndSegmentLength"),this.W.wk=a,this.h("toEndSegmentLength",b,a),this.Wb())});w.defineProperty(W,{cv:"toEndSegmentDirection"},function(){return null!==this.W?this.W.vk:rr},function(a){this.Qd();var b=this.W.vk;b!==a&&(w.Ut("Link.toEndSegmentDirection","2.0"),this.W.vk=a,this.h("toEndSegmentDirection",b,a),this.Wb())}); w.defineProperty(W,{dv:"toShortLength"},function(){return null!==this.W?this.W.xk:NaN},function(a){this.Qd();var b=this.W.xk;b!==a&&(this.W.xk=a,this.h("toShortLength",b,a),this.Wb(),this.ge())}); function tn(a){var b=a.Y,c=a.Z,d=null,b=d=null!==b?null!==c?b.WH(c):b.Da:null!==c?c.Da:null,c=a.jl;if(c!==b){null!==c&&lr(c,a);a.jl=b;null!==b&&mr(b,a);var e=a.LE;if(null!==e){var f=!0,h=a.g;null!==h&&(f=h.Ua,h.Ua=!0);e(a,c,b);null!==h&&(h.Ua=f)}!a.Mf||a.bE!==c&&a.cE!==c||a.Wb()}if(a.zI)for(a=a.Ff;a.next();)a.value.Da=d}W.prototype.Qk=function(){var a=this.Da;null!==a&&this.Y!==a&&this.Z!==a&&a.mx&&R.prototype.Qk.call(this)}; W.prototype.getOtherNode=W.prototype.IA=function(a){var b=this.Y;return a===b?this.Z:b};W.prototype.getOtherPort=function(a){var b=this.kc;return a===b?this.Ic:b};w.u(W,{zI:"isLabeledLink"},function(){return null===this.yf?!1:0=d&&(h=d-1);var l=this.l(h-1),f=this.l(h);Vd(e.x,e.y,k.x,k.y,l.x,l.y,f.x,f.y,.5,a);b=Math.min(f.x,b);c=Math.min(f.y,c);e=f}else for(e=this.l(0),f=this.l(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.m(e.x,e.y,0,0),a.yi(f),h=2;hc&&(c=-c)):Wa(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.Cf(d)),f.push(c),e+=c;for(d=h=c=0;ce/2)break;c+=d;h++}w.ta(f);b=this.l(h);f=this.l(h+1);b.x===f.x?b.y>f.y?a.m(b.x,b.y-(e/2-c)):a.m(b.x,b.y+(e/2-c)):b.y===f.y?b.x>f.x?a.m(b.x-(e/2-c),b.y):a.m(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.m(b.x+c*(f.x-b.x),b.y+c*(f.y-b.y)));return a};w.u(W,{PF:"midAngle"},function(){this.eo();return this.computeMidAngle()}); W.prototype.computeMidAngle=function(){var a=this.qa;if(2>a)return NaN;if(this.computeCurve()===tj&&4<=a&&!this.ac){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.l(c),d=this.l(c+1),a=this.l(c+2),c=this.l(c+3),e=d.x,d=d.y,f=a.x,a=a.y,h=(e+f)/2,k=(d+a)/2;return Ta(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(f+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0e+10?b.Qb(d):e>c+10?d.Qb(a):b.Qb(a)):null===this.Sa||this.ac?b.Qb(d):this.Sa.hF(.5);if(null!==this.Sa&&!this.ac)return this.Sa.hF(.5);b=this.l(c-1);d=this.l(c);a=this.l(c+1);c=b.Cf(d);e=d.Cf(a);return c>e+10?b.Qb(d):e>c+10?d.Qb(a):b.Qb(a)}; w.defineProperty(W,{points:"points"},function(){return this.hd},function(a){var b=this.hd;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;em&&(p=-p),u=(0> l?-1:1)*p+r,t=n*(u-r)+s);var r=h.x+2*k/3,s=h.y+2*l/3,x=r,v=s;J(l,0)?v=0l?-1:1)*p+r,v=n*(x-r)+s);this.Kp();this.mi(h);this.oj(u,t);this.oj(x,v);this.mi(q);this.Ug(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.Ug(3,this.getLinkPoint(e,f,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,f),a=this.getLinkPoint(e,f,a,!1,!1,b,c),this.hasCurviness()?(q=a.x-d.x,e=a.y-d.y,f=this.computeCurviness(),b=d.x+q/2,c=d.y+e/2,h=b,k=c,J(e,0)?k=0f&&(h=-h), h=(0>e?-1:1)*h+b,k=q*(h-b)+c),this.mi(d),this.oj(h,k)):this.mi(d),this.mi(a)}else{p=this.em;q&&(n&&p||m)&&this.Kp();var z=m?this.computeCurviness():0,p=this.getLinkPoint(b,c,d,!0,n,e,f),r=u=s=0;if(n||!k||m)if(t=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,p,d,!0,n,e,f),m&&(k||d.L(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(r-=n?90:30,0>z&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),m&&(t+=Math.abs(z)*(n?1:2)),0===r?s=t:90===r?u=t:180===r?s=-t:270===r?u=-t:(s=t*Math.cos(r*Math.PI/180),u=t* Math.sin(r*Math.PI/180)),d.Td()&&m){var A=c.Ya(Jb,w.K()),K=w.xb(A.x+1E3*s,A.y+1E3*u);this.getLinkPointFromPoint(b,c,A,K,!0,p);w.v(A);w.v(K)}var t=this.getLinkPoint(e,f,a,!1,n,b,c),D=v=x=0;if(n||!l||m)A=this.computeEndSegmentLength(e,f,a,!1),D=this.getLinkDirection(e,f,t,a,!1,n,b,c),m&&(l||d.L(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(D+=n?0:30,0>z&&(D+=180)),0>D?D+=360:360<=D&&(D-=360),m&&(A+=Math.abs(z)*(n?1:2)),0===D?x=A:90===D?v=A:180===D?x=-A:270===D?v=-A:(x=A*Math.cos(D*Math.PI/180),v=A*Math.sin(D* Math.PI/180)),a.Td()&&m&&(A=f.Ya(Jb,w.K()),K=w.xb(A.x+1E3*x,A.y+1E3*v),this.getLinkPointFromPoint(e,f,A,K,!1,t),w.v(A),w.v(K));a=p;if(n||!k||m)a=new y(p.x+s,p.y+u);d=t;if(n||!l||m)d=new y(t.x+x,t.y+v);!q&&!n&&k&&3Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b} W.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new y);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.R;null===e||e.Xg()||(e=e.R);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.ph;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.Cn(e,h,k,l, f);null!==a&&f.transform(a);return f};function Sr(a,b){var c=b.Ss;null===c&&(c=new Tr,c.port=b,c.Rc=b.V,b.Ss=c);return Ur(c,a)} W.prototype.getLinkPoint=function(a,b,c,d,e,f,h,k){void 0===k&&(k=new y);if(c.$c())return b.Ya(c,k),k;if(c.zj()){var l=Sr(this,b);if(null!==l){k.assign(l.iq);if(e&&this.sy===Jr){var m=Sr(this,h);if(null!==m&&l.vn=n.y&&a.y<=n.y+n.height?k.y=a.y:(c.xj(Xb)||c.xj($b))&&a.x>=n.x&&a.x<=n.x+n.width&&(k.x=a.x);w.v(l);w.v(m)}}return k}}c=b.Ya(Jb,w.K());l=f=null; this.qa>(e?6:2)?(l=d?this.l(1):this.l(this.qa-2),e&&(l=Rr(c,l.copy()))):(f=w.K(),l=h.Ya(Jb,f),e&&(l=Rr(c,l)),w.v(f));this.getLinkPointFromPoint(a,b,c,l,d,k);w.v(c);return k}; W.prototype.getLinkDirection=function(a,b,c,d,e,f,h,k){a:if(d.$c())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(f?6:2)?(n=e?this.l(1):this.l(this.qa-2),n=f?Rr(l,n.copy()):c):(m=w.K(),n=k.Ya(Jb,m),w.v(m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y- l.y)?n.x>=l.x?0:180:n.y>=l.y?90:270;w.v(l)}d.Td()&&h.qi(a)&&(c+=180,360<=c&&(c-=360));a=rr;a=e?this.hu:this.cv;a===rr&&(a=e?b.hu:b.cv);switch(a){case sr:b=b.am();c+=b;360<=c&&(c-=360);break;case rr:case Ao:if(d.CI())break;b=b.am();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c}; W.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.zj()&&(a=Sr(this,b),null!==a))return a.zx;a=NaN;a=d?this.$l:this.tm;null!==b&&isNaN(a)&&(a=d?b.$l:b.tm);isNaN(a)&&(a=10);return a};W.prototype.computeSpot=function(a,b){var c;if(a)if(c=b?b:this.kc,null===c)c=Jb;else{var d=this.Cb;d.Zc()&&null!==c&&(d=c.Cb);c=d===qc?yb:d}else c=b?b:this.Ic,null===c?c=Jb:(d=this.Db,d.Zc()&&null!==c&&(d=c.Db),c=d===qc?yb:d);return c}; W.prototype.computeOtherPoint=function(a,b){var c=b.Ya(Jb),d;d=b.Ss;d=null!==d?Ur(d,this):null;null!==d&&(c=d.iq);return c};W.prototype.computeShortLength=function(a){if(a){if(a=this.iu,isNaN(a)){var b=this.kc;null!==b&&(a=b.iu)}}else a=this.dv,isNaN(a)&&(b=this.Ic,null!==b&&(a=b.dv));return isNaN(a)?0:a}; W.prototype.Ik=function(a,b,c,d,e,f){if(!1===this.Tg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=f;void 0===f&&(h=w.Vg(),h.reset());h.multiply(this.transform);if(this.sn(a,h))return cq(this,b,c,e),void 0===f&&w.bf(h),!0;if(this.Zf(a,h)){var k=!1;if(!this.Hn)for(var l=this.xa.n,m=l.length;m--;){var n=l[m];if(n.visible||n===this.bg){var p=n.U,q=this.Ja;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=w.Vg();p.set(h);if(n instanceof C)k=n.Ik(a,b,c,d,e,p);else if(this.path=== n){if(n instanceof Y){var k=n,r=a,s=d,q=p;if(!1===k.Tg)k=!1;else if(q.multiply(k.transform),s)b:{var u=r,t=q;if(k.sn(u,t))k=!0;else{if(void 0===t&&(t=k.transform,u.Ek(k.U))){k=!0;break b}var q=u.left,r=u.right,s=u.top,u=u.bottom,x=w.K(),v=w.K(),z=w.K(),A=w.Vg();A.set(t);A.SF(k.transform);A.SA();v.x=r;v.y=s;v.transform(A);x.x=q;x.y=s;x.transform(A);t=!1;oq(k,x,v,z)?t=!0:(x.x=r,x.y=u,x.transform(A),oq(k,x,v,z)?t=!0:(v.x=q,v.y=u,v.transform(A),oq(k,x,v,z)?t=!0:(x.x=q,x.y=s,x.transform(A),oq(k,x,v,z)&& (t=!0))));w.bf(A);w.v(x);w.v(v);w.v(z);k=t}}else k=k.sn(r,q)}}else k=Go(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&(e instanceof I&&e.add(n),e instanceof H&&e.add(n)));w.bf(p)}}}void 0===f&&w.bf(h);return k||null!==this.background||null!==this.nn}void 0===f&&w.bf(h);return!1};w.u(W,{ac:"isOrthogonal"},function(){return 2===(this.Zm.value&2)});w.u(W,{em:"isAvoiding"},function(){return 4===(this.Zm.value&4)}); W.prototype.computeCurve=function(){if(null===this.Oi){var a=this.kc,b=this.ac;this.Oi=null!==a&&a===this.Ic&&!b}return this.Oi?tj:this.nf};W.prototype.computeCorner=function(){if(this.nf===tj)return 0;var a=this.wA;if(isNaN(a)||0>a)a=10;return a};W.prototype.findMidLabel=function(){for(var a=this.path,b=this.xa.n,c=b.length,d=0;dl?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;Wa(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.Ug(a,b);for(a+= 1;al?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ca(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.Ug(c,d)}}return!0;case Ir:f=this.l(a);p=this.l(c);if(!f.Pc(b)||!p.Pc(d)){var e=f.x,f=f.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-f)*(p-f),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1;0!==l-k?(r=(q-n)/(l-k),s=Math.sqrt(1+1/(r*r))):r=9E9;this.Ug(a,b);for(a+=1;ab?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.U.copy(),k=f.U.copy();if(h.I()&&k.I()){h.Yf(8,8);k.Yf(8,8);h.yi(a);k.yi(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l=new y(c.x,a.y),m=new y(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xk.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.xk.top&&a.yh.bottom)180===d&&(k.Ia(a)||h.Ia(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.ya.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l=new y(Math.max((a.x+c.x)/2,a.x),a.y),m=new y(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y&&k.lefta.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,k.right,!1):a.x>k.left&&(270===d&&a.yk.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.left,m.x=l.x,m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.yh.bottom)0===d&&(k.Ia(a)||h.Ia(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.ya.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l=new y(Math.min((a.x+c.x)/2,a.x),a.y),m=new y(l.x,c.y)}else l.y=270=== d||(0===d||180===d)&&c.ya.y||180===d&&c.xa.y||0===d&&c.x>a.x&&k.bottom>a.y)l=new y(a.x,c.y),m=new y((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.y,c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.xa.x?(l.y=a.yk.right)? this.computeMidOrthoPosition(a.y,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.yk.left&&a.xh.right)270===d&&(k.Ia(a)||h.Ia(c))?l.x=this.computeMidOrthoPosition(a.x,c.x,!1):c.xa.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right, Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l=new y(a.x,Math.max((a.y+c.y)/2,a.y)),m=new y(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xa.x&&k.top=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.y,k.bottom,!0):a.y>k.top&&(180===d&&a.xk.right)?this.computeMidOrthoPosition(a.y,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.xh.right)90===d&&(k.Ia(a)||h.Ia(c))?l.x=this.computeMidOrthoPosition(a.x, c.x,!1):c.xa.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l=new y(a.x,Math.min((a.y+c.y)/2,a.y)),m=new y(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xk&&0!==Xr(s,c.x,c.y)){Yr(this,s,c.x,c.y,d,!0);h=this.l(2);if(4>this.qa)0===b||180===b?(h.x=a.x,h.y=c.y):(h.x=c.x,h.y=a.y),this.ca(2,h.x,h.y),this.w(3,h.x,h.y);else if(c= this.l(3),0===b||180===b)J(h.x,c.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.ca(2,h,a.y),this.ca(3,h,c.y)):J(h.y,c.y)?(Math.abs(a.y-h.y)<=s.Hp/2&&(this.ca(2,h.x,a.y),this.ca(3,c.x,a.y)),this.w(2,h.x,a.y)):this.ca(2,a.x,h.y);else if(90===b||270===b)J(h.y,c.y)?(h=90===b?Math.max(h.y,a.y):Math.min(h.y,a.y),this.ca(2,a.x,h),this.ca(3,c.x,h)):J(h.x,c.x)?(Math.abs(a.x-h.x)<=s.Jp/2&&(this.ca(2,a.x,h.y),this.ca(3,a.x,c.y)),this.w(2,a.x,h.y)):this.ca(2,h.x,a.y);null!==r&&(a=this.l(1),c=this.l(2), a.x!==c.x&&a.y!==c.y?0===b||180===b?this.w(2,a.x,c.y):this.w(2,c.x,a.y):0===b||180===b?this.w(2,e.x,r.y):this.w(2,r.x,e.y));null!==u&&(0===d||180===d?this.oj(f.x,u.y):this.oj(u.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.mi(l),this.mi(m))}};W.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2}; function gi(a){if(null===a.g||!a.em)return!1;var b=a.points.n,c=b.length;if(4>c)return!1;a=Gn(a.g,!0,a.Da,null);for(var d=1;da)return new Be(Fe);var b=!1,c=this.g;null!==c&&Or(this)&&c.nl.contains(this)&&null!==this.Cw&&(b=!0);var d=c=0,e=this.l(0).copy(),f=e.copy(),c=this.hd.n,h=this.computeCurve();if(h===tj&&3<=a&&!Wa(this.Dq,0))if(3===a)var k=this.l(1),c=Math.min(e.x,k.x),d=Math.min(e.y,k.y),k=this.l(2),c=Math.min(c,k.x),d=Math.min(d,k.y);else{if(this.ac)for(k=0;k=a&&(k=a-1),c=this.l(k), f.x=Math.min(c.x,f.x),f.y=Math.min(c.y,f.y);c=f.x;d=f.y}else{for(k=0;kx?r>q?(u.x=v-A,u.y=q-A,t.x=v+s,t.y=q+s):(u.x=v-A,u.y=q+A,t.x=v+s,t.y=q-s):r>q?(u.x=v+A,u.y=q-A,t.x=v-s,t.y=q+s):(u.x=v+A,u.y=q+A,t.x=v-s,t.y=q-s));Wa(x,v)&&Wa(q,r)&&(q>p?(z>v?(u.x= v-A,u.y=q-A,t.x=v+s):(u.x=v+A,u.y=q-A,t.x=v-s),t.y=q+s):(z>v?(u.x=v-A,u.y=q+A,t.x=v+s):(u.x=v+A,u.y=q+A,t.x=v-s),t.y=q-s));if(Wa(x,v)&&Wa(v,z)||Wa(p,q)&&Wa(q,r))x=.5*(x+z),p=.5*(p+r),u.x=x,u.y=p,t.x=x,t.y=p;1===k?(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y)):2===k&&Wa(b.x,this.l(0).x)&&Wa(b.y,this.l(0).y)&&(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y));N(l,e.x-c,e.y-d,h.x-c,h.y-d,m.x-c,m.y-d);f.set(h);e.set(a);b=m}}k=b.x;b=b.y;f=this.l(this.qa-1);0!==this.computeShortLength(!1)&&(f=Zr(this,f.copy(),!1,cd));k=.5*(k+f.x); b=.5*(b+f.y);N(l,a.x-c,a.y-d,k-c,b-d,f.x-c,f.y-d)}else for(k=3;k=a&&(k=a-1),f=this.l(k-1),e=this.l(k),k===a-1&&0!==this.computeShortLength(!1)&&(e=Zr(this,e.copy(),!1,cd)),N(l,b.x-c,b.y-d,f.x-c,f.y-d,e.x-c,e.y-d);else{f=w.K();f.assign(this.l(0));k=1;for(e=0;k=a-1){if(!f.L(u))0!==this.computeShortLength(!1)&&(u=Zr(this,u.copy(),!1,cd)),bs(this,l,-c,-d,f,u,b);else if(0===e)for(k=1;kn.x?u.x-s:u.x+s,A=t.y>u.y?u.y+v:u.y-v,bs(this,k,h,m,n,new y(q,z),p),Pe(k,u.x+h,u.y+m,r+h,A+m),x.m(r,A))):J(n.x,u.x)&&J(u.y,t.y)?(s=this.computeCorner(),v=Math.min(s,Math.abs(u.y-n.y)/2),v=s=Math.min(v,Math.abs(t.x-u.x)/2),J(s,0)?(bs(this,k,h,m,n,u, p),x.assign(u)):(q=u.x,A=z=u.y,z=u.y>n.y?u.y-v:u.y+v,r=t.x>u.x?u.x+s:u.x-s,bs(this,k,h,m,n,new y(q,z),p),Pe(k,u.x+h,u.y+m,r+h,A+m),x.m(r,A))):(bs(this,k,h,m,n,u,p),x.assign(u));k=e}w.v(f)}c=l.o;w.q(l)}else l=this.l(1).copy(),l.x-=c,l.y-=d,0!==this.computeShortLength(!0)&&(e=Zr(this,e,!0,f)),0!==this.computeShortLength(!1)&&(l=Zr(this,l,!1,f)),c=new Be(Fe),c.ha=e.x,c.fa=e.y,c.C=l.x,c.D=l.y;return c}; function as(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return Wa(a,0)?b:Wa(b,0)?a:Math.sqrt(a*a+b*b)} function Zr(a,b,c,d){var e=a.qa;if(2>e)return b;if(c){var f=a.l(1);c=f.x-d.x;d=f.y-d.y;f=as(b.x,b.y,c,d);if(0===f)return b;e=2===e?.5*f:f;a=a.computeShortLength(!0);a>e&&(a=e);c=a*(c-b.x)/f;a=a*(d-b.y)/f;b.x+=c;b.y+=a}else{f=a.l(e-2);c=f.x-d.x;d=f.y-d.y;f=as(b.x,b.y,c,d);if(0===f)return b;e=2===e?.5*f:f;a=a.computeShortLength(!1);a>e&&(a=e);c=a*(b.x-c)/f;a=a*(b.y-d)/f;b.x-=c;b.y-=a}return b} function $r(a,b,c,d){for(var e=a.qa,f=b;Wa(b.x,f.x)&&Wa(b.y,f.y);){if(c>=e)return e-1;f=a.l(c++)}if(!Wa(b.x,f.x)&&!Wa(b.y,f.y))return c-1;for(var h=f;Wa(b.x,f.x)&&Wa(f.x,h.x)&&(!d||(b.y>=f.y?f.y>=h.y:f.y<=h.y))||Wa(b.y,f.y)&&Wa(f.y,h.y)&&(!d||(b.x>=f.x?f.x>=h.x:f.x<=h.x));){if(c>=e)return e-1;h=a.l(c++)}return c-2} function bs(a,b,c,d,e,f,h){if(!h&&Or(a)){h=[];var k=0;a.isVisible()&&(k=cs(a,e,f,h));var l=e.x,l=e.y;if(0p-10)m--,p=Math.max(q-5,f.x);else break;q=f.y-10+d;n=p+c;p=f.y+d;a.nf===lj?M(b,n,p,!1,!1):N(b,l,q,n,q,n,p)}else if(J(e.x,f.x))if(e.yp-10)m--,p=Math.max(q-5,f.y);else break;q=f.x-10+c;n=f.x+c;p+=d;a.nf===lj?M(b,n,p,!1,!1):N(b,q,l,q,p,n,p)}}b.lineTo(f.x+c,f.y+d)} function cs(a,b,c,d){var e=a.g;if(null===e||b.L(c))return 0;for(e=e.Tx;e.next();){var f=e.value;if(null!==f&&f.visible)for(var f=f.Ab.n,h=f.length,k=0;kh.x&&n.x>m.x||m.xh.y&&n.y>m.y||m.yu&&Math.min(h,x)q&&!J(h,x)){n.x=u;n.y=q;n=!0;break a}}else if(!J(q,s)&&J(h,x)&&Math.min(q,s)h&&Math.min(u,t)p&&!J(u,t)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}w.v(k)}w.u(W,{bu:"firstPickIndex"},function(){var a;2>=this.qa?a=0:((a=this.ac)||(a=this.computeSpot(!0)!==yb),a=a?1:0);return a});w.u(W,{Rx:"lastPickIndex"},function(){var a=this.qa;if(0===a)a=0;else if(2>=a)a-=1;else{var b;(b=this.ac)||(b=this.computeSpot(!1)!==yb);a=b?a-2:a-1}return a});function Or(a){a=a.nf;return a===kj||a===lj} function Qr(a,b){if(b||Or(a)){var c=a.g;null===c||c.nl.contains(a)||null===a.Cw||c.nl.add(a,a.Cw)}}function nj(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Qc){var d=c.g;if(null!==d)for(var e=!1,d=d.Tx;d.next();){var f=d.value;if(f.visible)if(f===c)for(var e=!0,h=!1,f=f.Ab.n,k=f.length,l=0;l=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.zg=Math.floor((a.x-this.De)/this.De)*this.De;this.Ag=Math.floor((b-this.Ee)/this.Ee)*this.Ee;this.ns=Math.ceil((c+2*this.De)/this.De)*this.De;this.os=Math.ceil((d+2*this.Ee)/this.Ee)*this.Ee;a=1+(Math.ceil((this.ns-this.zg)/this.De)|0);b=1+(Math.ceil((this.os-this.Ag)/this.Ee)|0);if(null===this.qd||this.Apthis.ns||a+cthis.os||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.Ap)|0;for(c=Math.min(b+e-1,this.Bp)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.qd[a][e])return!1;return!0}; function fs(a,b,c,d,e,f,h,k,l){if(!(bh||cl)){var m,n;m=b|0;n=c|0;var p=a.qd[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;f<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.qd[m][n]);)a.qd[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0m;c+=d)fs(a,b,c,1,!e,f,h,k,l),fs(a,b,c,-1,!e,f,h,k,l);else if(0m;b+=d)fs(a,b,c,1,!e,f,h,k,l),fs(a,b,c,-1,!e,f,h, k,l)}}function gs(a,b,c,d,e,f,h,k,l){b|=0;c|=0;var m=0,n=1;for(a.qd[b][c]=n;0===m&&b>f&&bk&&cf&&bk&&c=Math.abs(h-b)&&1>=Math.abs(k-d))a.abort=!0;else{var l=f.x,m=f.y,n=f.x+f.width,p=f.y+f.height,l=l-a.zg,l=l/a.De,m=m-a.Ag,m=m/a.Ee,n=n-a.zg,n=n/a.De,p=p-a.Ag,p=p/a.Ee;f=Math.max(0,Math.min(a.Ap,l|0));n=Math.min(a.Ap,Math.max(0,n|0));m=Math.max(0,Math.min(a.Bp,m|0));p=Math.min(a.Bp,Math.max(0,p|0));h|=0;k|=0;b|=0;d|=0;l=0===c|| 90===c?1:-1;c=90===c||270===c;0===a.qd[h][k]?(gs(a,h,k,l,c,f,n,m,p),gs(a,h,k,1,!c,f,n,m,p),gs(a,h,k,-1,!c,f,n,m,p)):gs(a,h,k,l,c,h,k,h,k);0===a.qd[b][d]?(hs(a,b,d,0===e||90===e?1:-1,90===e||270===e,f,n,m,p),hs(a,b,d,1,!(90===e||270===e),f,n,m,p),hs(a,b,d,-1,!(90===e||270===e),f,n,m,p)):hs(a,b,d,l,c,b,d,b,d);a.abort||(fs(a,h,k,1,!1,f,n,m,p),fs(a,h,k,-1,!1,f,n,m,p),fs(a,h,k,1,!0,f,n,m,p),fs(a,h,k,-1,!0,f,n,m,p))}}}function Tr(){w.nc(this);this.port=this.Rc=null;this.fg=[];this.kq=!1} w.ae(Tr,{Rc:!0,port:!0,fg:!0,kq:!0});Tr.prototype.toString=function(){for(var a=this.fg,b=this.Rc.toString()+" "+a.length.toString()+":",c=0;c=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case w.Uc|w.od:return c>a&&c<=180+a?180:270;case w.od|w.fd:return c>180-a&&c<=360-a?270:0;case w.fd|w.ed:return c>a&&c<=180+a?90:0;case w.ed|w.Uc:return c>180-a&&c<=360-a?180:90;case w.Uc|w.od|w.fd:return 90180+a&&c<=360- a?270:0;case w.od|w.fd|w.ed:return 180a&&180>=c?90:0;case w.fd|w.ed|w.Uc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case w.ed|w.Uc|w.od:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(w.Uc|w.od|w.fd|w.ed)&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}Tr.prototype.aq=function(){this.fg.length=0}; function Ur(a,b){var c=a.fg;if(0===c.length){a:if(!a.kq){c=a.kq;a.kq=!0;var d,e=null,f=a.Rc,f=f instanceof V?f:null;if(null===f||f.ad)d=a.Rc.ZE(a.port.le);else{if(!f.U.I()){a.kq=c;break a}e=f;d=e.YE()}var h=a.fg.length=0,k=a.port.Ya(zb,w.K()),l=a.port.Ya(Sb,w.K()),f=w.kg(k.x,k.y,0,0);f.yi(l);w.v(k);w.v(l);k=w.xb(f.x+f.width/2,f.y+f.height/2);l=a.port.am();for(d=d.i;d.next();){var m=d.value;if(m.isVisible()&&m.kc!==m.Ic){var n=m.kc===a.port||null!==m.Y&&m.Y.qi(e),p=m.computeSpot(n,a.port);if(p.zj()&& (n=n?m.Ic:m.kc,null!==n)){var q=n.V;if(null!==q){var r=q.findVisibleNode();null!==r&&r!==q&&(q=r,n=q.port);n=m.computeOtherPoint(q,n);q=k.Qb(n);q-=l;0>q&&(q+=360);p=is(f,p,q,m.ac);r=0;0===p?(r=w.fd,180Math.abs(D)?(z=Math.abs(D)/q,q=Math.abs(D)):z=1;break;case w.Uc:r>Math.abs(K)?(z=Math.abs(K)/r,r=Math.abs(K)):z=1;break;case w.od:p>Math.abs(D)?(z=Math.abs(D)/p,p=Math.abs(D)):z=1;break;default:case w.fd:n>Math.abs(K)?(z=Math.abs(K)/n,n=Math.abs(K)):z=1}v=0}var O=u.iq;if(e===tr){t=u.link.computeThickness();t*=z;O.set(A);switch(x){case w.ed:O.x=A.x+D/2+q/2-v-t/2;break;case w.Uc:O.y=A.y+K/2+r/2-v- t/2;break;case w.od:O.x=A.x+D/2-p/2+v+t/2;break;default:case w.fd:O.y=A.y+K/2-n/2+v+t/2}v+=t}else t=.5,e===qr&&(t=(u.Zp+1)/(u.vn+1)),O.x=A.x+D*t,O.y=A.y+K*t}w.v(k);w.v(l);w.v(d);w.v(m);A=a.fg;for(D=0;Db.ze?1:a.angleb.angle?1:0}; Tr.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Rc,this.port,yb,b.kc===this.port),d=a.Zp;if(0>d)return c;var e=a.vn;if(1>=e||!b.ac)return c;var b=a.ey,f=a.iq;if(a.ze===w.Uc||a.ze===w.ed)d=e-1-d;return((a=a.ze===w.Uc||a.ze===w.fd)?b.ye&&(e=k.right);k.bottom>f&&(f=k.bottom)}}isFinite(c)&&isFinite(d)?a.m(c,d,e-c,f-d):(b=b.location,c=this.padding,a.m(b.x+c.left,b.y+c.top,0,0));return a}; w.defineProperty(Pj,{padding:"padding"},function(){return this.lf},function(a){"number"===typeof a?a=new hb(a):w.G(a,hb,Pj,"padding");var b=this.lf;b.L(a)||(this.lf=a=a.S(),this.h("padding",b,a))});function sg(){0=c-1?(h=0,e=d,f+=k+20,k=0):h++}null!==a&&a.Yc("Layout")}this.sf=!0};sg.prototype.Un=function(a){return!a.location.I()||a instanceof V&&a.Un?!0:!1}; function ms(a,b,c,d,e,f,h,k){for(c=c.i;c.next();){var l=c.value;d&&!l.eq||null!==e&&!e(l)||!l.canLayout()||(f&&l instanceof T?l.Df||(l instanceof V?null===l.Tb?ms(a,b,l.vc,!1,e,f,h,k):(ns(l),b.add(l)):(ns(l),b.add(l))):h&&l instanceof W?b.add(l):!k||!l.he()||l instanceof T||(ns(l),b.add(l)))}}function ns(a){var b=a.U;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.af()} sg.prototype.collectParts=sg.prototype.xH=function(a){var b=new I(R);a instanceof E?(ms(this,b,a.hg,!0,null,!0,!0,!0),ms(this,b,a.links,!0,null,!0,!0,!0),ms(this,b,a.Hj,!0,null,!0,!0,!0)):a instanceof V?ms(this,b,a.vc,!1,null,!0,!0,!0):ms(this,b,a.i,!1,null,!0,!0,!0);return b};w.defineProperty(sg,{Nd:"arrangementOrigin"},function(){return this.Sq},function(a){w.G(a,y,sg,"arrangementOrigin");this.Sq.L(a)||(this.Sq.assign(a),this.J())}); sg.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.Ya(zb),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a}; function tg(){w.nc(this);this.oe=null;if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new I(os);this.edges=new I(ps);this.$x=new ma(T,os);this.Vx=new ma(W,ps)}w.ga("LayoutNetwork",tg); tg.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new I(os);this.edges=new I(ps);this.$x=new ma(T,os);this.Vx=new ma(W,ps)}; tg.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Tb?"("+this.Tb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1d?1:0):1:null!==d?-1:0}; os.smartComparer=function(a,b){if(null!==a){if(null!==b){var c=a.vd,d=b.vd;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=f&&0>=h&&(f=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.Kb("Layout");d=[];switch(this.alignment){case Ds:var k=a,l=c,m=Math.max(this.Ip.width,1);if(!isFinite(m))for(var n=m=0;nf-1||0h)d.push(new B(0,x,h+k,z)),v=0,t=u,x+=z,z=0;z=Math.max(z,K);K=0;switch(s){case Cs:K=-q.width;break;default:K=0}p.moveTo(t+K,x);switch(s){case Cs:t-=A;break; default:t+=A}v++}d.push(new B(0,x,h+k,z));break;case vs:k=f;l=a;m=c;n=Math.max(this.Ip.width,1);p=x=A=0;q=w.K();for(f=0;f=A&&(h-=A);for(var A=K=0,D=Math.max(this.Ip.height,1),X=p=0,S=!0,ba=w.K(),f=0;fk-1||0h){d.push(new B(0,S?v-p:v,h+l,X+p+m));for(O=0;OA&&(e.width+=e.x-A,e.x=A)}for(k=f=h=e=0;kd?1:0}; Qn.smartComparer=function(a,b){if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e=a.count)1===a.count&&(a=a.first(),a.la=0,a.ra=0);else{var b=new H(Ws);b.Oc(a.i);a=new H(Ws);var c=new H(Ws),d;d=this.sort(b);var e=this.nz,f=this.XC,h=this.Hd,k=this.Do,l=this.oz,m=this.Ar,b=this.ol,n=this.kE,p=this.Uf,q=this.yv, e=this.Vf,f=this.Zx,h=this.mJ;if(!isFinite(h)||0>=h)h=NaN;k=this.rH;if(!isFinite(k)||0>=k)k=1;l=this.Ae;isFinite(l)||(l=0);m=this.uf;if(!isFinite(m)||360m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Ts&&f===Us?e=Fs:e===Ts&&f!==Us&&(f=Us,e=this.Vf);if((this.direction===Os||this.direction===Ps)&&this.sorting!==Is){for(var r=0;!(r>=d.length);r+=2){a.add(d.ea(r));if(r+1>=d.length)break;c.add(d.ea(r+1))}this.direction===Os?(this.Vf===Ts&&a.reverse(),d=new H(Ws),d.Oc(a),d.Oc(c)):(this.Vf===Ts&& c.reverse(),d=new H(Ws),d.Oc(c),d.Oc(a))}for(var s=d.length,u=n=0,r=0;rm&&(0===r||r===d.length-1)&&(t/=2);n+=t;u++}if(isNaN(h)||e===Ts){isNaN(b)&&(b=6);if(e!==Fs&&e!==Ts){t=-Infinity;for(r=0;rh?(h=r,p=h*k):q=u/(360<=m?s:s-1)}this.nz=e;this.XC=f;this.Hd=h;this.Do=k;this.oz=l;this.Ar=m;this.ol=b;this.kE=n;this.Uf=p;this.yv=q;b=d;d=this.nz;e=this.Hd;f=this.oz;k=this.Ar;l=this.ol;m=this.Uf;n=this.yv;if(this.direction!==Os&&this.direction!==Ps||d!==Ts)if(this.direction===Os||this.direction===Ps){h=0;switch(d){case Ss:h=180*$s(this,e,m,f,n)/Math.PI;break;case Fs:n=b=0;h=a.first();null!==h&&(b=Xs(h,Math.PI/2));h=c.first();null!== h&&(n=Xs(h,Math.PI/2));h=180*$s(this,e,m,f,l+(b+n)/2)/Math.PI;break;case Rs:h=k/b.length}if(this.direction===Os){switch(d){case Ss:at(this,a,f,Qs);break;case Fs:bt(this,a,f,Qs);break;case Rs:ct(this,a,k/2,f,Qs)}switch(d){case Ss:at(this,c,f+h,Hs);break;case Fs:bt(this,c,f+h,Hs);break;case Rs:ct(this,c,k/2,f+h,Hs)}}else{switch(d){case Ss:at(this,c,f,Qs);break;case Fs:bt(this,c,f,Qs);break;case Rs:ct(this,c,k/2,f,Qs)}switch(d){case Ss:at(this,a,f+h,Hs);break;case Fs:bt(this,a,f+h,Hs);break;case Rs:ct(this, a,k/2,f+h,Hs)}}}else switch(d){case Ss:at(this,b,f,this.direction);break;case Fs:bt(this,b,f,this.direction);break;case Rs:ct(this,b,k,f,this.direction);break;case Ts:dt(this,b,k,f,this.direction)}else dt(this,b,k,f-k/2,Hs)}this.updateParts();this.network=null;this.sf=!0}; function ct(a,b,c,d,e){var f=a.Ar,h=a.Hd;a=a.Uf;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;lc){for(f=d+(e===Hs?f:-f);0>f;)f+=360;f%=360;180=n.length-1)break;gt(a,l,m,n,p,e,f)||ht(a,l,m,n,p,e,f);l=f.x;m=f.y}w.v(f);a.Vm++;if(!(23Math.abs(r)?Math.abs(l-f)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0Math.abs(q)?0:q;q=!1;q=Math.abs(f)>Math.abs(p)?0p:0a.Vm?a.Hd-h/(2*Math.PI):5>n.length&&10=p.length-1)break;gt(a,l,m,p,q,e,n)||ht(a,l,m,p,q,e,n);l=n.x;m=n.y}w.v(n);a.Vm++;if(!(23a.Vm?a.Hd-f/(2*Math.PI):a.Hd-(0k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0} function ht(a,b,c,d,e,f,h){var k=a.Hd,l=a.Uf,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.ol;d=!1;if(0<=b!==(f===Hs)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}Es.prototype.commitLayout=function(){this.commitNodes();this.xu&&this.commitLinks()}; Es.prototype.commitNodes=function(){var a=this.jH,b=null!==this.group&&null!==this.group.placeholder&&this.group.ad,c=b?this.group.location.copy():null;b?a=new y(0,0):(a.x=this.Nd.x+this.Hd,a.y=this.Nd.y+this.Uf);for(var d=this.network.vertexes.i;d.next();){var e=d.value;e.x+=a.x;e.y+=a.y;e.commit()}b&&(this.group.af(),a=this.group.position.copy(),b=this.group.location.copy(),c=c.ui(b.ui(a)),this.group.move(c),this.hC=c.ui(a))};Es.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()}; function Zs(a,b,c,d,e){var f=a.aH;if(.001>Math.abs(a.Do-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1)),l=0,m=0;m<=f;m++)l=void 0!==d&&void 0!==e?d+m*e/f:m*Math.PI/(2*f),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function Ys(a,b,c,d,e){var f=0,f=void 0!==d&&void 0!==e?Zs(a,1,c,d,e):Zs(a,1,c);return b/f} function $s(a,b,c,d,e){if(.001>Math.abs(a.Do-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-f*f*l*l)*a;if(h>=e)return k*a}} Es.prototype.sort=function(a){switch(this.sorting){case Ms:break;case Ns:a.reverse();break;case Ks:a.sort(this.comparer);break;case Ls:a.sort(this.comparer);a.reverse();break;case Is:for(var b=[],c=0;ce&&(e=k,f=h)}else for(h=0;he&&(e=k,f=h);d.add(a.ea(f));b[f]=-1;f=a.ea(f);e=0;for(h=f.mc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&& b[e]++;for(f=f.jc;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(f=0;fa[f].indexOf(l)&&a[f].push(l);for(b=b.mc;b.next();)l=d.indexOf(b.value.fromVertex),l!==f&&0>a[f].indexOf(l)&&a[f].push(l)}h=[];for(f=0;fa[b[p]].indexOf(b[p===b.length-1?0:p+1])&&u.push(p===b.length-1?0:p+1);if(0===u.length)for(p=0;pK.indexOf(S)||baK.indexOf(S)||ba< z[S]&&z[S]=t?l+1:l)),v+=l=t&&l++,A>=t&&A++,l>A&&(K=A,A=l,l=K),A-l<(b.length+2)/2===(lq||q===l||(s=q>l?q-l:l-q,p+=qh-s?1:-1);b.splice(0>p?l:l+1,0,m);c.splice(k,1);k--}else f=!1;if(f)break;else b.push(c[0]),c.splice(0,1)}for(f=0;f=a?a:360,this.J())}); w.defineProperty(Es,{Vf:"arrangement"},function(){return this.pd},function(a){this.pd!==a&&(w.ob(a,Es,Es,"arrangement"),a===Ts||a===Fs||a===Ss||a===Rs)&&(this.pd=a,this.J())});w.defineProperty(Es,{direction:"direction"},function(){return this.ba},function(a){this.ba!==a&&(w.ob(a,Es,Es,"direction"),a===Hs||a===Qs||a===Os||a===Ps)&&(this.ba=a,this.J())}); w.defineProperty(Es,{sorting:"sorting"},function(){return this.di},function(a){this.di!==a&&(w.ob(a,Es,Es,"sorting"),a===Ms||a===Ns||a===Ks||Ls||a===Is)&&(this.di=a,this.J())});w.defineProperty(Es,{comparer:"comparer"},function(){return this.Nh},function(a){this.Nh!==a&&(w.j(a,"function",Es,"comparer"),this.Nh=a,this.J())});w.defineProperty(Es,{spacing:"spacing"},function(){return this.ei},function(a){this.ei!==a&&(w.j(a,"number",Es,"spacing"),this.ei=a,this.J())}); w.defineProperty(Es,{Zx:"nodeDiameterFormula"},function(){return this.Fs},function(a){this.Fs!==a&&(w.ob(a,Es,Es,"nodeDiameterFormula"),a===Js||a===Us)&&(this.Fs=a,this.J())});w.u(Es,{fK:"actualXRadius"},function(){return this.Hd});w.u(Es,{gK:"actualYRadius"},function(){return this.Uf});w.u(Es,{eK:"actualSpacing"},function(){return this.ol});w.u(Es,{jH:"actualCenter"},function(){return this.hC});var Fs;Es.ConstantSpacing=Fs=w.p(Es,"ConstantSpacing",0);var Ss; Es.ConstantDistance=Ss=w.p(Es,"ConstantDistance",1);var Rs;Es.ConstantAngle=Rs=w.p(Es,"ConstantAngle",2);var Ts;Es.Packed=Ts=w.p(Es,"Packed",3);var Hs;Es.Clockwise=Hs=w.p(Es,"Clockwise",4);var Qs;Es.Counterclockwise=Qs=w.p(Es,"Counterclockwise",5);var Os;Es.BidirectionalLeft=Os=w.p(Es,"BidirectionalLeft",6);var Ps;Es.BidirectionalRight=Ps=w.p(Es,"BidirectionalRight",7);var Ms;Es.Forwards=Ms=w.p(Es,"Forwards",8);var Ns;Es.Reverse=Ns=w.p(Es,"Reverse",9);var Ks;Es.Ascending=Ks=w.p(Es,"Ascending",10); var Ls;Es.Descending=Ls=w.p(Es,"Descending",11);var Is;Es.Optimized=Is=w.p(Es,"Optimized",12);var Js;Es.Pythagorean=Js=w.p(Es,"Pythagorean",13);var Us;Es.Circular=Us=w.p(Es,"Circular",14);function Gs(){this.Xp=-Infinity;this.Iq=this.ho=null}Gs.prototype.compare=function(a,b){if(0this.Xp||Math.abs(a)a&&0f?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new y(n.x+n.width+d.width,n.y),l[1]=new y(n.x,n.y+n.height+d.height),f=2):(p=mt(l,f,e,k,n.width,n.height,d),q=l[p],r=new y(q.x+n.width+d.width, q.y),s=new y(q.x,q.y+n.height+d.height),p+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().cb,d=this.network.vertexes.i;d.next();){if(d.value.cb.Zf(c)&&(a++,2a.network.vertexes.count)return!1;null===a.Hg?a.Hg=new H(gu):a.Hg.clear();a.Hg.Oc(a.network.vertexes);var c=a.Hg;c.sort(function(a,b){return null===a||null===b||a===b?0:b.ig-a.ig});for(var d=c.count-1;0<=d&&1>=c.ea(d).ig;)d--;return 1=h))){for(var m=0,n=0,p=l.count-h;ps&&(s=1);m=Sd((m+s+n*n*4/(h*h))/ s);h=(m-1)*p/2;m=(m-1)*q/2;f.cb=new B(k-r.x-h,l-r.y-m,p+2*h,q+2*m);f.focus=new y(r.x+h,r.y+m)}a.network=d;return c}function fu(a,b){for(var c=a.network.vertexes.i;c.next();){var d=c.value;d.network=b;if(null!==d.Gh){var e=d.Gh.ea(d.wB);d.ig=e.Ky;var f=e.aC,h=e.bC;d.cb=new B(d.la-f,d.ra-h,e.Ly,e.Jy);d.focus=new y(f,h);d.wB--}}for(c=a.network.edges.i;c.next();)c.value.network=b;a.network=b} function hu(a,b){var c=b.rn;if(null!==c&&0!==c.count){var d=b.la,e=b.ra,f=b.width,h=b.height;null!==b.Gh&&0=p.ig?l++:(k=!0,m++,h+=Math.atan2(b.ra-p.ra,b.la-p.la))}if(0!==l)for(0>1)+n)*(0===k%2?1:-1);l.la=d+p*Math.cos(q);l.ra=e+p*Math.sin(q);k++}}}function mt(a,b,c,d,e,f,h){var k=9E19,l=-1,m=0;a:for(;mn.y&&a[q].x-n.xn.x&&a[q].y-n.yl+h?(d=d+f-k,e=e-l-h,Sd(d*d+e*e)):e+ck+m?e>l+h?(d=d-k-m,e=e-l-h,Sd(d*d+e*e)):e+cl+h?e-(l+h):e+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.la,e=d,f=c.ra,h=f,c=1;ch-f)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.la-b.la}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.ra-b.ra});for(var h=a.Qi,m=0,n=0,p=0,c=0;ch||p-d>h){if(f)break}else if(l-r>h||r-l>h){if(!f)break}else{var s=ju(k,e);1>s?(n=a.ky,null===n&&(a.ky=n=new sa(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.O.right-k.O.x),n=(1+n)*m):dr?(p=Math.abs(e.O.bottom-k.O.y),p=(1+p)*s):ds?(n=a.ky,null===n&&(a.ky=n=new sa(0)),m=n.random(),s= n.random(),n=(d>p?1:-1)*(1+(e.width>k.width?e.width:k.width))*m,p=(l>r?1:-1)*(1+(e.height>k.height?e.height:k.height))*s):(m=f.stiffness*(s-f.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=a.fJ;for(e=0;ed&&(f=d),h<-d?h=-d:h>d&&(h=d),k.la+=f,k.ra+=h,c=Math.max(c,f*f+h*h));return c>a.XE*a.XE}jt.prototype.moveFixedVertex=function(){}; jt.prototype.commitLayout=function(){this.DB();this.commitNodes();this.xu&&this.commitLinks()};jt.prototype.DB=function(){if(this.Cq)for(var a=this.network.edges.i;a.next();){var b=a.value.link;null!==b&&(b.Cb=qc,b.Db=qc)}};jt.prototype.commitNodes=function(){var a=0,b=0;if(this.qH){var c=w.vf();this.sh(this.network,c);b=this.Nd;a=b.x-c.x;b=b.y-c.y;w.Bb(c)}for(var c=w.vf(),d=this.network.vertexes.i;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.cb),c.x+=a,c.y+=b,e.cb=c;e.commit()}w.Bb(c)}; jt.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};jt.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Ao:a};jt.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.zo:a};jt.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.xo:a};jt.prototype.electricalFieldX=function(){return 0};jt.prototype.electricalFieldY=function(){return 0}; jt.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.yo:a};jt.prototype.gravitationalFieldX=function(){return 0};jt.prototype.gravitationalFieldY=function(){return 0};jt.prototype.isFixed=function(a){return a.isFixed};w.u(jt,{NK:"currentIteration"},function(){return this.ds});w.defineProperty(jt,{DE:"arrangementSpacing"},function(){return this.mg},function(a){w.G(a,ia,jt,"arrangementSpacing");this.mg.L(a)||(this.mg.assign(a),this.J())}); w.defineProperty(jt,{qH:"arrangesToOrigin"},function(){return this.Tq},function(a){this.Tq!==a&&(w.j(a,"boolean",jt,"arrangesToOrigin"),this.Tq=a,this.J())});w.defineProperty(jt,{Cq:"setsPortSpots"},function(){return this.ci},function(a){this.ci!==a&&(w.j(a,"boolean",jt,"setsPortSpots"),this.ci=a,this.J())});w.defineProperty(jt,{comments:"comments"},function(){return this.Mh},function(a){this.Mh!==a&&(w.j(a,"boolean",jt,"comments"),this.Mh=a,this.J())}); w.defineProperty(jt,{dB:"maxIterations"},function(){return this.$o},function(a){this.$o!==a&&(w.j(a,"number",jt,"maxIterations"),0<=a&&(this.$o=a,this.J()))});w.defineProperty(jt,{XE:"epsilonDistance"},function(){return this.Dr},function(a){this.Dr!==a&&(w.j(a,"number",jt,"epsilonDistance"),0b.toVertex.index&&(a.qy(b),b.rev=!0);break;case nu:for(d=this.network.vertexes.i;d.next();)a=d.value,a.Sp=-1,a.finish=-1;for(a=this.network.edges.i;a.next();)a.value.forest=!1;this.Bs=0;for(d.reset();d.next();)b=d.value,0===b.mc.count&&xu(this,b);for(d.reset();d.next();)b=d.value,-1===b.Sp&&xu(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,f=e.finish,e.Spu&&0u&&0d[this.Rf]&&(this.lw=d[b]-1,this.Rf=b),d[b]h)for(var p=h+1;pn;p--)l=d[p],l.near===m&&l.on===m.on||k++;var m=0,q,r=q=p=l=0,s,u=0,t=0;s=0;var x;if(0<=c)for(n=d[h].Re,m=0;mu||l===u&&q>s)&&k++,tl||u===l&&s>q)&&k++);if(0>=c)for(n=d[h].Me,m=0;mu||l===u&&p>t)&&k++,sl||u===l&&t>p)&&k++);f[h*e+h]=k;for(n=h+1;n=c)for(k=d[h].Me,x=d[n].Me,m=0;m=c&&(l=k.Re);var m=null;0<=c&&(m=k.Me);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q=c&&(l=k.Re);var m=null;0<=c&&(m=k.Me);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q>1,f[h]=0!==(n&1)?p[m]:p[m-1]+p[m]>>1)}Bu(a,b,d);return f}function Ju(a,b,c,d,e,f){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.jc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Ju(a,m,c,d,e,f)}if(f)for(l=b.mc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Ju(a,m,c,d,e,f)}} function Ku(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var h=b.jc;h.next();)Ku(a,h.value.toVertex,c,d,e,f);if(f)for(b=b.mc;b.next();)Ku(a,b.value.fromVertex,c,d,e,f)}}function uu(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid)return b}return null}function vu(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.jc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null} function wu(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.mc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function xu(a,b){b.Sp=a.Bs;a.Bs++;for(var c=b.jc;c.next();){var d=c.value,e=d.toVertex;-1===e.Sp&&(d.forest=!0,xu(a,e))}b.finish=a.Bs;a.Bs++} mu.prototype.assignLayers=function(){switch(this.Wo){case Lu:Mu(this);break;case Nu:for(var a=0,b=this.network.vertexes.i;b.next();)a=Ou(this,b.value),this.tb=Math.max(a,this.tb);for(b.reset();b.next();)a=b.value,a.layer=this.tb-a.layer;break;default:case ou:Mu(this);for(b=this.network.vertexes.i;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.mc.count&&Pu(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.tb=-1;for(b.reset();b.next();){var c=b.value;c.layer-= a;this.tb=Math.max(this.tb,c.layer)}}};function Mu(a){for(var b=a.network.vertexes.i;b.next();){var c=Qu(a,b.value);a.tb=Math.max(c,a.tb)}}function Qu(a,b){var c=0;if(-1===b.layer){for(var d=b.jc;d.next();)var e=d.value,f=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Qu(a,f)+e);b.layer=c}else c=b.layer;return c}function Ou(a,b){var c=0;if(-1===b.layer){for(var d=b.mc;d.next();)var e=d.value,f=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Ou(a,f)+e);b.layer=c}else c=b.layer;return c} function Pu(a,b){if(!b.valid){b.valid=!0;for(var c=b.jc;c.next();)Pu(a,c.value.toVertex);for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(var d=b.Re.n,e=d.length,f=0;fh&&Ju(a,k,0,-1,!0,!1)}for(Ju(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.i;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Re.n,e=s.length,f=0;fd)&&!n&&(h=l,d=m)}if(0>f){for(c.reset();c.next();)f=c.value,1===f.component&&(f.layer-=e);b.component=0}else h.component=0}}} function zu(a,b,c){return 90===a.ba?c&&!b.rev||!c&&b.rev?270:90:180===a.ba?c&&!b.rev||!c&&b.rev?0:180:270===a.ba?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} mu.prototype.initializeIndices=function(){switch(this.Mo){default:case Ru:for(var a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;b.index=this.ne[c];this.ne[c]++}break;case pu:a=this.network.vertexes.i;for(b=this.tb;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Su(this,c);break;case Tu:for(a=this.network.vertexes.i,b=0;b<=this.tb;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Uu(this,c)}}; function Su(a,b){var c=b.layer;b.index=a.ne[c];a.ne[c]++;for(var c=b.Me.xc(),d=!0;d;)for(var d=!1,e=0;eh.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;eh.portToColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;e=h;d--)f=Wu(this,d,-1)||f;e=this.countCrossings();e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Wu(this,d,1)||f;e=this.countCrossings();e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Wu(this,d,1)||f;e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1, d=h;d<=c;d++)f=Wu(this,d,-1)||f;e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Wu(this,d,0)||f;e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Wu(this,d,0)||f;e>=a?Eu(this,b):(a=e,b=Du(this))}break;default:case qu:for(c=this.tb,h=0,k=a+1;(d=this.countCrossings())=h;d--)f=Wu(this,d,-1)||f;e=this.countCrossings();e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Wu(this,d,1)||f;e=this.countCrossings(); e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Wu(this,d,1)||f;e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Wu(this,d,-1)||f;e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Wu(this,d,0)||f;e>=a?Eu(this,b):(a=e,b=Du(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Wu(this,d,0)||f;e>=a?Eu(this,b):(a=e,b=Du(this))}}Eu(this,b)}; function Vu(a,b,c){var d=0,e=Au(a,b),f=a.ne[b],h=Iu(a,b,c);c=Hu(a,b,c);for(d=0;df+1&&(q+=4*(v-f),r+=4*(v-(f+1)))}A=d[f].jc.i;for(A.reset();A.next();)if(v=A.value,z=v.toVertex,v.valid&&z.layer===b){for(v=0;d[v]!==z;)v++;v===f+1&&(r+=1)}A=d[f+1].mc.i;for(A.reset();A.next();)if(v=A.value,z=v.fromVertex,v.valid&&z.layer===b){for(v=0;d[v]!==z;)v++;vf+1&&(q+=4*(v-(f+1)),r+=4*(v-f))}A=d[f+1].jc.i;for(A.reset();A.next();)if(v=A.value,z=v.toVertex,v.valid&& z.layer===b){for(v=0;d[v]!==z;)v++;v===f&&(q+=1)}var v=z=0,A=h[d[f].index],K=k[d[f].index],D=h[d[f+1].index],O=k[d[f+1].index];-1!==A&&(z+=Math.abs(A-s),v+=Math.abs(A-x));-1!==K&&(z+=Math.abs(K-s),v+=Math.abs(K-x));-1!==D&&(z+=Math.abs(D-u),v+=Math.abs(D-t));-1!==O&&(z+=Math.abs(O-u),v+=Math.abs(O-t));if(r>1)+8*d;this.Mb*=8}if(0!==(this.dj&$u))for(b=!0;b;){b=!1;for(a=this.Rf+1;a<=this.tb;a++)b=av(this,a,1)||b; for(a=this.Rf-1;0<=a;a--)b=av(this,a,-1)||b;b=av(this,this.Rf,0)||b}if(0!==(this.dj&bv)){for(a=this.Rf+1;a<=this.tb;a++)cv(this,a,1);for(a=this.Rf-1;0<=a;a--)cv(this,a,-1);cv(this,this.Rf,0)}c&&(dv(this,-1),dv(this,1));if(0!==(this.dj&$u))for(b=!0;b;){b=!1;b=av(this,this.Rf,0)||b;for(a=this.Rf+1;a<=this.tb;a++)b=av(this,a,0)||b;for(a=this.Rf-1;0<=a;a--)b=av(this,a,0)||b}};function av(a,b,c){for(var d=!1;ev(a,b,c);)d=!0;return d} function ev(a,b,c){var d=0,e=Au(a,b),f=a.ne[b],h=Hu(a,b,-1);if(0c)for(d=0;dd-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=f||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=0,u=0,t=0,x=0,v=0;if(0>=c)for(var z=e[d].mc.i;z.next();){var v=z.value,A=v.fromVertex;v.valid&& A.layer!==b&&(t=Cu(v),x=v.portFromColOffset,v=v.portToColOffset,A=A.column,q+=(Math.abs(n+v-(A+x))+1)*t,s+=(Math.abs(r+v-(A+x))+1)*t,u+=(Math.abs(p+v-(A+x))+1)*t)}if(0<=c)for(z=e[d].jc.i;z.next();)v=z.value,A=v.toVertex,v.valid&&A.layer!==b&&(t=Cu(v),x=v.portFromColOffset,v=v.portToColOffset,A=A.column,q+=(Math.abs(n+x-(A+v))+1)*t,s+=(Math.abs(r+x-(A+v))+1)*t,u+=(Math.abs(p+x-(A+v))+1)*t);v=x=t=0;z=h[e[d].index];A=k[e[d].index];-1!==z&&(t+=Math.abs(z-n),x+=Math.abs(z-r),v+=Math.abs(z-p));-1!==A&& (t+=Math.abs(A-n),x+=Math.abs(A-r),v+=Math.abs(A-p));if(s=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}Bu(a,b,e);a.normalize()} function fv(a,b){for(var c=!0,d=a.network.vertexes.i;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e} function gv(a,b){for(var c=b,c=b+1,d=0,e=[],f=[],d=0;d<=a.tb;d++)e[d]=!1,f[d]=!1;for(var h=a.network.vertexes.i;h.next();){var d=h.value,k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(f[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.tb;d++)k=k&&!(e[d]&&f[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c} function dv(a,b){for(var c=0;c<=a.Mb;c++)for(;fv(a,c););a.normalize();for(c=0;ce?Eu(a,d):hb)for(c=a.Mb;0<=c;c--)for(d=Du(a),e=Gu(a),f=e+1;ee?Eu(a,d):hc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Bg);a.Bg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Ku(a,b,a.Bg,-1,!0,!0),a.Bg++);var f=0;b=[];for(f=0;fc)for(k=a.Mb;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} mu.prototype.commitLayout=function(){if(this.Cq)for(var a=yu(this,!0),b=yu(this,!1),c=this.network.edges.i;c.next();){var d=c.value.link;null!==d&&(d.Cb=a,d.Db=b)}this.commitNodes();this.pA();this.xu&&this.commitLinks()};function yu(a,b){return 270===a.ba?b?Gc:Jc:90===a.ba?b?Jc:Gc:180===a.ba?b?Hc:Ic:b?Ic:Hc} mu.prototype.commitNodes=function(){this.xg=[];this.Qf=[];this.Pf=[];this.Pb=[];for(var a=0;a<=this.tb;a++)this.xg[a]=0,this.Qf[a]=0,this.Pf[a]=0,this.Pb[a]=0;for(a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;this.xg[c]=Math.max(this.xg[c],this.nodeMinLayerSpace(b,!0));this.Qf[c]=Math.max(this.Qf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.Mm,c=0;c<=this.tb;c++){var e=d;0>=this.xg[c]+this.Qf[c]&&(e=0);0=r.O.bottom?(Ma=r.O.y+r.O.height, b.w(U++,na,Ma+kb),b.w(U++,na,Ma),b.w(U++,na,Ma-Ia)):(b.w(U++,na,ja+kb),b.w(U++,na,ja),b.w(U++,na,ja-Ia)):270===this.ba?ja<=r.O.y?(Ma=r.O.y,b.w(U++,na,Ma-Ia),b.w(U++,na,Ma),b.w(U++,na,Ma+kb)):(b.w(U++,na,ja-Ia),b.w(U++,na,ja),b.w(U++,na,ja+kb)):0===this.ba&&(na>=r.O.right?(Ma=r.O.x+r.O.width,b.w(U++,Ma+kb,ja),b.w(U++,Ma,ja),b.w(U++,Ma-Ia,ja)):(b.w(U++,na+kb,ja),b.w(U++,na,ja),b.w(U++,na-Ia,ja)));else{b.w(U++,fb,pb);var td=0;if(180===this.ba||0===this.ba){if(180===this.ba?na>=r.O.right:na<=r.O.x)td= (0===this.ba?-Ia:kb)/2;b.w(U++,fb+td,ja)}else{if(270===this.ba?ja>=r.O.bottom:ja<=r.O.y)td=(90===this.ba?-Ia:kb)/2;b.w(U++,na,pb+td)}b.w(U++,na,ja)}else Ia=Math.max(10,this.xg[Oa.layer]),kb=Math.max(10,this.Qf[Oa.layer]),180===this.ba?(Ga&&b.w(U++,na-Ia,ja),b.w(U++,na,ja),Ga&&b.w(U++,na+kb,ja)):90===this.ba?(Ga&&b.w(U++,na,ja+kb),b.w(U++,na,ja),Ga&&b.w(U++,na,ja-Ia)):270===this.ba?(Ga&&b.w(U++,na,ja-Ia),b.w(U++,na,ja),Ga&&b.w(U++,na,ja+kb)):(Ga&&b.w(U++,na+kb,ja),b.w(U++,na,ja),Ga&&b.w(U++,na-Ia, ja));r=Oa}if(null===k||n!==yb||eb)if(fb=b.l(U-1).x,pb=b.l(U-1).y,na=b.l(U).x,ja=b.l(U).y,eb){var ud=this.Qf[q.layer],Mc=0;180===this.ba||0===this.ba?(Mc=pb,Mc>=q.O.y&&Mc<=q.O.bottom&&(180===this.ba?na>=q.O.x:na<=q.O.right)&&(Ma=q.la+(180===this.ba?-ud:ud),Mc=Mc=q.O.x&&Mc<=q.O.right&&(270===this.ba?ja>=q.O.y:ja<=q.O.bottom)&&(Ma=q.ra+(270===this.ba?-ud:ud),Mc=Mc=q.O.x?(Ma=q.O.x+q.O.width,b.ca(U-2,Ma,pb),b.ca(U-1,Ma+kb,pb)):90===this.ba&&ja<=q.O.bottom?(Ma=q.O.y,b.ca(U-2,fb,Ma),b.ca(U-1,fb,Ma-Ia)):270===this.ba&&ja>=q.O.y?(Ma=q.O.y+q.O.height,b.ca(U-2,fb,Ma),b.ca(U-1,fb,Ma+kb)):0===this.ba&&na<=q.O.right&&(Ma=q.O.x,b.ca(U-2,Ma,pb),b.ca(U-1,Ma-Ia,pb));else{Ia=Math.max(10, this.xg[q.layer]);kb=Math.max(10,this.Qf[q.layer]);td=0;if(180===this.ba||0===this.ba){if(180===this.ba?na<=q.O.x:na>=q.O.right)td=(0===this.ba?kb:-Ia)/2;b.w(U++,na+td,pb)}else{if(270===this.ba?ja<=q.O.y:ja>=q.O.bottom)td=(90===this.ba?kb:-Ia)/2;b.w(U++,fb,ja+td)}b.w(U++,na,ja)}}else{for(;null!==q&&q!==r;){Lc=Oa=null;for(var rh=q.jc.i;rh.next();){var Xe=rh.value;if(Xe.link===c.link&&(Oa=Xe.toVertex,Lc=Xe.fromVertex,null!==Lc.vd&&(Lc=null),null===Oa.vd))break}var fb=0,pb=0,na=0,ja=0,Za=0,Ia=0,kb=0; if(Oa!==r)if(fb=b.l(U-1).x,pb=b.l(U-1).y,na=Oa.la,ja=Oa.ra,eb)if(180===this.ba||0===this.ba){var Hd=null!==Lc?Lc.ra:pb;Hd!==ja&&(Za=this.Pb[Oa.layer],2===U&&(Za=0===this.ba?Math.max(Za,fb):Math.min(Za,fb)),b.w(U++,Za,pb),b.w(U++,Za,ja))}else{var Gf=null!==Lc?Lc.la:fb;Gf!==na&&(Za=this.Pb[Oa.layer],2===U&&(Za=90===this.ba?Math.max(Za,pb):Math.min(Za,pb)),b.w(U++,fb,Za),b.w(U++,na,Za))}else Ia=Math.max(10,this.xg[Oa.layer]),kb=Math.max(10,this.Qf[Oa.layer]),180===this.ba?(b.w(U++,na+kb,ja),Ga&&b.w(U++, na,ja),b.w(U++,na-Ia,ja)):90===this.ba?(b.w(U++,na,ja-Ia),Ga&&b.w(U++,na,ja),b.w(U++,na,ja+kb)):270===this.ba?(b.w(U++,na,ja+kb),Ga&&b.w(U++,na,ja),b.w(U++,na,ja-Ia)):(b.w(U++,na-Ia,ja),Ga&&b.w(U++,na,ja),b.w(U++,na+kb,ja));q=Oa}eb&&(fb=b.l(U-1).x,pb=b.l(U-1).y,na=b.l(U).x,ja=b.l(U).y,180===this.ba||0===this.ba?pb!==ja&&(Za=0===this.ba?Math.min(Math.max((na+fb)/2,this.Pb[r.layer]),na):Math.max(Math.min((na+fb)/2,this.Pb[r.layer]),na),b.w(U++,Za,pb),b.w(U++,Za,ja)):fb!==na&&(Za=90===this.ba?Math.min(Math.max((ja+ pb)/2,this.Pb[r.layer]),ja):Math.max(Math.min((ja+pb)/2,this.Pb[r.layer]),ja),b.w(U++,fb,Za),b.w(U++,na,Za)))}if(null!==d&&Ga){if(null!==h){if(n===yb){var qe=b.l(0),Yd=b.l(2);qe.L(Yd)||b.ca(1,(qe.x+Yd.x)/2,(qe.y+Yd.y)/2)}ya=b.getLinkPoint(e,h,yb,!0,!1,f,k);ya.I()||ya.set(e.U.Tl);b.ca(0,ya.x,ya.y)}null!==k&&(p===yb&&(qe=b.l(b.qa-1),Yd=b.l(b.qa-3),qe.L(Yd)||b.ca(b.qa-2,(qe.x+Yd.x)/2,(qe.y+Yd.y)/2)),ya=b.getLinkPoint(f,k,yb,!1,!1,e,h),ya.I()||ya.set(f.U.Tl),b.ca(b.qa-1,ya.x,ya.y))}b.qj();c.commit()}}}for(var gd= new H(W),sh=this.network.edges.i;sh.next();){var Hf=sh.value.link;null!==Hf&&Hf.ac&&!gd.contains(Hf)&&gd.add(Hf)}if(0Ac.y&&(tc=gb.y>Ac.y?0:Zd.xCc.x&&(Fg=wh.x>Cc.x?0:wc.yb.layer?1:a.Zeb.Ze?1:a.ueb.ue?1:0:0};mu.prototype.mG=function(a,b){return a instanceof iv&&b instanceof iv&&a!==b?a.firstb.first||a.xib.xi||a.Zeb.Ze?1:a.ueb.ue?1:0:0}; mu.prototype.vy=function(a,b){return a instanceof iv&&b instanceof iv&&a!==b?a.ieb.ie||a.xib.xi||a.Zeb.Ze?1:a.ueb.ue?1:0:0};function jv(a,b){var c=a-b;return-1c}function Au(a,b){var c,d=a.ne[b];if(d>=a.ih.length){c=[];for(var e=0;ea&&(this.dj=a,this.J()))});w.defineProperty(mu,{Cq:"setsPortSpots"},function(){return this.ci},function(a){this.ci!==a&&(w.j(a,"boolean",mu,"setsPortSpots"),this.ci=a,this.J())});w.defineProperty(mu,{MF:"linkSpacing"},function(){return this.js},function(a){this.js!==a&&(w.j(a,"number",mu,"linkSpacing"),0<=a&&(this.js=a,this.J()))});w.u(mu,{SI:"maxLayer"},function(){return this.tb}); w.u(mu,{tL:"maxIndex"},function(){return this.lw});w.u(mu,{sL:"maxColumn"},function(){return this.Mb});w.u(mu,{yL:"minIndexLayer"},function(){return this.ss});w.u(mu,{uL:"maxIndexLayer"},function(){return this.Rf});var nu;mu.CycleDepthFirst=nu=w.p(mu,"CycleDepthFirst",0);var tu;mu.CycleGreedy=tu=w.p(mu,"CycleGreedy",1);var ou;mu.LayerOptimalLinkLength=ou=w.p(mu,"LayerOptimalLinkLength",0);var Lu;mu.LayerLongestPathSink=Lu=w.p(mu,"LayerLongestPathSink",1);var Nu; mu.LayerLongestPathSource=Nu=w.p(mu,"LayerLongestPathSource",2);var pu;mu.InitDepthFirstOut=pu=w.p(mu,"InitDepthFirstOut",0);var Tu;mu.InitDepthFirstIn=Tu=w.p(mu,"InitDepthFirstIn",1);var Ru;mu.InitNaive=Ru=w.p(mu,"InitNaive",2);var Xu;mu.AggressiveNone=Xu=w.p(mu,"AggressiveNone",0);var qu;mu.AggressiveLess=qu=w.p(mu,"AggressiveLess",1);var Yu;mu.AggressiveMore=Yu=w.p(mu,"AggressiveMore",2);mu.PackNone=0;var Zu;mu.PackExpand=Zu=1;var $u;mu.PackStraighten=$u=2;var bv;mu.PackMedian=bv=4;var ru; mu.PackAll=ru=7;function iv(){this.index=this.ue=this.Ze=this.ie=this.first=this.layer=0;this.link=null;this.xi=0}w.ae(iv,{layer:!0,first:!0,ie:!0,Ze:!0,ue:!0,index:!0,link:!0,xi:!0});function su(){tg.call(this)}w.La(su,tg);w.ga("LayeredDigraphNetwork",su);su.prototype.createVertex=function(){return new kv};su.prototype.createEdge=function(){return new lv}; function kv(){os.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.Sp=NaN;this.on=0;this.jB=this.kB=null}w.La(kv,os);w.ga("LayeredDigraphVertex",kv);function lv(){ps.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}w.La(lv,ps);w.ga("LayeredDigraphEdge",lv); function $(){0b.level)return!1;a.removeChild(c.parent,c)}return!0}$.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;ef?bw(a,k,va,z,A):cw(a,k,va,z,A);va=A.x;z=A.width;A=A.height;break;case Qv:for(m=0;ms&&(basb&&(Mw(a,-sb,0,eb,m-1),Nw(D,-sb,0),Nw(O,-sb,0),sb=0)}n.pa.m(sb,ha);z=Math.max(z,X);A=Math.max(A,K+(0===ya?0:x)+U.height);ba=X}else{0s&&(hasb&&(Mw(a,0,-sb,eb,m-1),Nw(D,0,-sb),Nw(O,0,-sb),sb=0);n.pa.m(ba,sb);A=Math.max(A,S);z=Math.max(z,K+(0===ya?0:x)+U.width);ha=S}Ga++}0q&&(q=0),135v&&(v=0),p===Rv&&(l+=u/2+a.T.y),k+=d+c):b?(null===a.comments?d>z&&(p=Rw(p,d-z,0),k=p.x,l=p.y,z=d,q=0):z=Pw(a,z,q),0>q&&(k-=q,q=0),135A&&(p=Rw(p,0,e-A),k=p.x,l=p.y,A=e,v=0):A=Qw(a,A,v),0>v&&(l-=v,v=0),k+=d+c);if(0f[0].x?f[2].assign(f[1]):f[1].assign(f[2])),f[3].yf[0].x?f[3].assign(f[2]):f[2].assign(f[3])),p[0].m(q+d,0),p[1].m(p[0].x,e),p[2].yf[0].y?f[2].assign(f[1]):f[1].assign(f[2])),f[3].xf[0].y?f[3].assign(f[2]):f[2].assign(f[3])),p[0].m(0,v+e),p[1].m(d,p[0].y),p[2].xc?bw(b,e,Ga,K,D):cw(b,e,Ga,K,D);Ga=D.x;K=D.width;D=D.height;break;case Qv:for(k=0;kr&&(Xr&&(Sp&&(p=0),135z&&(z=0));b.Oa.m(p,z);b.kb.m(K,D)}} function bw(a,b,c,d,e){var f=b.length;if(0===f)return new B(c,0,d,e);if(1===f){var h=b[0];d=h.kb.width;e=h.kb.height;return new B(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===Xv(a),n=0,p=0,q=0,r=0;rm&&(d-=m),e=Math.max(e,Math.max(v, q)+b+s.height),0>h.pa.x&&(c=Vw(a,h.pa.x,!1,c,k))):(h.pa.m(d+b,c+k/2-h.T.y-h.Oa.y),d=Math.max(d,Math.max(x,p)+b+s.width),m=c+k/2-h.T.y-h.Oa.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.pa.y&&(c=Vw(a,h.pa.y,!0,c,k))));return new B(c,0,d,e)} function cw(a,b,c,d,e){var f=b.length;if(0===f)return new B(c,0,d,e);if(1===f){var h=b[0];d=h.kb.width;e=h.kb.height;return new B(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===Xv(a),n=0,p=0,q=0,r=0;rp&&(d-=p),e=Math.max(e,Math.abs(Math.min(v, q))+l+s.height),0>h.pa.x&&(c=Vw(a,h.pa.x,!1,c,k))):(h.pa.m(-d-s.width-l,c+k/2-h.T.y-h.Oa.y),d=Math.max(d,Math.abs(Math.min(x,p))+l+s.width),p=c+k/2-h.T.y-h.Oa.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.pa.y&&(c=Vw(a,h.pa.y,!0,c,k))));for(r=0;rd&&(d=c+a.width);0>c&&(d-=c);return d;case Yv:return a.width>b?a.width:b;case Zv:return 2*a.T.x>b?a.width:b+a.width-2*a.T.x;case Pv:case Ev:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Qv:return a.width-a.T.x+a.nodeSpacing/2+b;case Rv:return Math.max(a.width,a.T.x+a.nodeSpacing/2+b);default:return b}} function Qw(a,b,c){switch(a.alignment){case Nv:case Ow:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case Yv:return a.height>b?a.height:b;case Zv:return 2*a.T.y>b?a.height:b+a.height-2*a.T.y;case Pv:case Ev:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Qv:return a.height-a.T.y+a.nodeSpacing/2+b;case Rv:return Math.max(a.height,a.T.y+a.nodeSpacing/2+b);default:return b}} function Rw(a,b,c){switch(a){case Ow:b/=2;c/=2;break;case Nv:b/=2;c/=2;break;case Yv:c=b=0;break;case Zv:break;default:w.k("Unhandled alignment value "+a.toString())}return new y(b,c)}function Jw(a,b,c,d,e,f){b=Rw(b,c,d);Mw(a,b.x,b.y,e,f)}function Mw(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].pa;f.x+=b;f.y+=c}} function Kw(a,b,c,d){var e=b.parent;switch(a.Of){case nv:for(a=b.mc;a.next();)b=a.value,b.fromVertex===e&&b.Ws.m(c,d);break;case uv:for(a=b.jc;a.next();)b=a.value,b.toVertex===e&&b.Ws.m(c,d);break;default:w.k("Unhandled path value "+a.Of.toString())}}function Nw(a,b,c){for(var d=0;dp.length||null===q||2>q.length))for(m=l=0;lt&&e.ye.y&&tb.length||null===l||2>l.length)d=null;else{n=dw(a,b.length+l.length);for(d=f=e=0;fe;)t=l[f++],n[d++].m(t.x+m,t.y);l=dw(a,d);for(e=0;ep.length||null===f||2>f.length)e=null;else{n=dw(a,p.length+f.length);for(m=x=l=0;lf;)e=p[l++],n[m++].m(e.x,e.y);e=dw(a,m);for(l=0;lp.length||null===q||2>q.length))for(m=l=0;lf&&e.xe.x&&fb.length||null===l||2>l.length)d=null;else{n=dw(a, b.length+l.length);for(d=f=e=0;fe;)t=l[f++],n[d++].m(t.x,t.y+m);l=dw(a,d);for(e=0;ep.length||null===f||2>f.length)e=null;else{n=dw(a,p.length+f.length);for(m=x=l=0;lf;)e=p[l++],n[m++].m(e.x,e.y);e=dw(a,m);for(l=0;l=a?0:135>=a?90:225>=a?180:315>=a?270:0} function $v(a){var b=Xv(a),b=90===b||270===b,c=a.layerSpacing;if(0=a&&(this.va.nodeIndentPastParent=a,this.J()))}); w.defineProperty($,{nodeSpacing:"nodeSpacing"},function(){return this.va.nodeSpacing},function(a){this.va.nodeSpacing!==a&&(w.j(a,"number",$,"nodeSpacing"),this.va.nodeSpacing=a,this.J())});w.defineProperty($,{layerSpacing:"layerSpacing"},function(){return this.va.layerSpacing},function(a){this.va.layerSpacing!==a&&(w.j(a,"number",$,"layerSpacing"),this.va.layerSpacing=a,this.J())}); w.defineProperty($,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.va.layerSpacingParentOverlap},function(a){this.va.layerSpacingParentOverlap!==a&&(w.j(a,"number",$,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.va.layerSpacingParentOverlap=a,this.J()))});w.defineProperty($,{compaction:"compaction"},function(){return this.va.compaction},function(a){this.va.compaction!==a&&(w.ob(a,$,$,"compaction"),a===Uv||a===Wv)&&(this.va.compaction=a,this.J())}); w.defineProperty($,{breadthLimit:"breadthLimit"},function(){return this.va.breadthLimit},function(a){this.va.breadthLimit!==a&&(w.j(a,"number",$,"breadthLimit"),0<=a&&(this.va.breadthLimit=a,this.J()))});w.defineProperty($,{rowSpacing:"rowSpacing"},function(){return this.va.rowSpacing},function(a){this.va.rowSpacing!==a&&(w.j(a,"number",$,"rowSpacing"),this.va.rowSpacing=a,this.J())}); w.defineProperty($,{rowIndent:"rowIndent"},function(){return this.va.rowIndent},function(a){this.va.rowIndent!==a&&(w.j(a,"number",$,"rowIndent"),0<=a&&(this.va.rowIndent=a,this.J()))});w.defineProperty($,{commentSpacing:"commentSpacing"},function(){return this.va.commentSpacing},function(a){this.va.commentSpacing!==a&&(w.j(a,"number",$,"commentSpacing"),this.va.commentSpacing=a,this.J())}); w.defineProperty($,{commentMargin:"commentMargin"},function(){return this.va.commentMargin},function(a){this.va.commentMargin!==a&&(w.j(a,"number",$,"commentMargin"),this.va.commentMargin=a,this.J())});w.defineProperty($,{setsPortSpot:"setsPortSpot"},function(){return this.va.setsPortSpot},function(a){this.va.setsPortSpot!==a&&(w.j(a,"boolean",$,"setsPortSpot"),this.va.setsPortSpot=a,this.J())}); w.defineProperty($,{portSpot:"portSpot"},function(){return this.va.portSpot},function(a){w.G(a,L,$,"portSpot");this.va.portSpot.L(a)||(this.va.portSpot=a,this.J())});w.defineProperty($,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.va.setsChildPortSpot},function(a){this.va.setsChildPortSpot!==a&&(w.j(a,"boolean",$,"setsChildPortSpot"),this.va.setsChildPortSpot=a,this.J())}); w.defineProperty($,{childPortSpot:"childPortSpot"},function(){return this.va.childPortSpot},function(a){w.G(a,L,$,"childPortSpot");this.va.childPortSpot.L(a)||(this.va.childPortSpot=a,this.J())});w.defineProperty($,{BK:"alternateSorting"},function(){return this.wa.sorting},function(a){this.wa.sorting!==a&&(w.ob(a,$,$,"alternateSorting"),a===Jv||a===Kv||a===Lv||Mv)&&(this.wa.sorting=a,this.J())}); w.defineProperty($,{pK:"alternateComparer"},function(){return this.wa.comparer},function(a){this.wa.comparer!==a&&(w.j(a,"function",$,"alternateComparer"),this.wa.comparer=a,this.J())});w.defineProperty($,{jK:"alternateAngle"},function(){return this.wa.angle},function(a){this.wa.angle!==a&&(w.j(a,"number",$,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.wa.angle=a,this.J())}); w.defineProperty($,{iK:"alternateAlignment"},function(){return this.wa.alignment},function(a){this.wa.alignment!==a&&(w.ob(a,$,$,"alternateAlignment"),this.wa.alignment=a,this.J())});w.defineProperty($,{tK:"alternateNodeIndent"},function(){return this.wa.nodeIndent},function(a){this.wa.nodeIndent!==a&&(w.j(a,"number",$,"alternateNodeIndent"),0<=a&&(this.wa.nodeIndent=a,this.J()))}); w.defineProperty($,{uK:"alternateNodeIndentPastParent"},function(){return this.wa.nodeIndentPastParent},function(a){this.wa.nodeIndentPastParent!==a&&(w.j(a,"number",$,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.wa.nodeIndentPastParent=a,this.J()))});w.defineProperty($,{vK:"alternateNodeSpacing"},function(){return this.wa.nodeSpacing},function(a){this.wa.nodeSpacing!==a&&(w.j(a,"number",$,"alternateNodeSpacing"),this.wa.nodeSpacing=a,this.J())}); w.defineProperty($,{rK:"alternateLayerSpacing"},function(){return this.wa.layerSpacing},function(a){this.wa.layerSpacing!==a&&(w.j(a,"number",$,"alternateLayerSpacing"),this.wa.layerSpacing=a,this.J())});w.defineProperty($,{sK:"alternateLayerSpacingParentOverlap"},function(){return this.wa.layerSpacingParentOverlap},function(a){this.wa.layerSpacingParentOverlap!==a&&(w.j(a,"number",$,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.wa.layerSpacingParentOverlap=a,this.J()))}); w.defineProperty($,{oK:"alternateCompaction"},function(){return this.wa.compaction},function(a){this.wa.compaction!==a&&(w.ob(a,$,$,"alternateCompaction"),a===Uv||a===Wv)&&(this.wa.compaction=a,this.J())});w.defineProperty($,{kK:"alternateBreadthLimit"},function(){return this.wa.breadthLimit},function(a){this.wa.breadthLimit!==a&&(w.j(a,"number",$,"alternateBreadthLimit"),0<=a&&(this.wa.breadthLimit=a,this.J()))}); w.defineProperty($,{yK:"alternateRowSpacing"},function(){return this.wa.rowSpacing},function(a){this.wa.rowSpacing!==a&&(w.j(a,"number",$,"alternateRowSpacing"),this.wa.rowSpacing=a,this.J())});w.defineProperty($,{xK:"alternateRowIndent"},function(){return this.wa.rowIndent},function(a){this.wa.rowIndent!==a&&(w.j(a,"number",$,"alternateRowIndent"),0<=a&&(this.wa.rowIndent=a,this.J()))}); w.defineProperty($,{nK:"alternateCommentSpacing"},function(){return this.wa.commentSpacing},function(a){this.wa.commentSpacing!==a&&(w.j(a,"number",$,"alternateCommentSpacing"),this.wa.commentSpacing=a,this.J())});w.defineProperty($,{mK:"alternateCommentMargin"},function(){return this.wa.commentMargin},function(a){this.wa.commentMargin!==a&&(w.j(a,"number",$,"alternateCommentMargin"),this.wa.commentMargin=a,this.J())}); w.defineProperty($,{AK:"alternateSetsPortSpot"},function(){return this.wa.setsPortSpot},function(a){this.wa.setsPortSpot!==a&&(w.j(a,"boolean",$,"alternateSetsPortSpot"),this.wa.setsPortSpot=a,this.J())});w.defineProperty($,{wK:"alternatePortSpot"},function(){return this.wa.portSpot},function(a){w.G(a,L,$,"alternatePortSpot");this.wa.portSpot.L(a)||(this.wa.portSpot=a,this.J())}); w.defineProperty($,{zK:"alternateSetsChildPortSpot"},function(){return this.wa.setsChildPortSpot},function(a){this.wa.setsChildPortSpot!==a&&(w.j(a,"boolean",$,"alternateSetsChildPortSpot"),this.wa.setsChildPortSpot=a,this.J())});w.defineProperty($,{lK:"alternateChildPortSpot"},function(){return this.wa.childPortSpot},function(a){w.G(a,L,$,"alternateChildPortSpot");this.wa.childPortSpot.L(a)||(this.wa.childPortSpot=a,this.J())});var mv;$.PathDefault=mv=w.p($,"PathDefault",-1);var nv; $.PathDestination=nv=w.p($,"PathDestination",0);var uv;$.PathSource=uv=w.p($,"PathSource",1);var Jv;$.SortingForwards=Jv=w.p($,"SortingForwards",10);var Kv;$.SortingReverse=Kv=w.p($,"SortingReverse",11);var Lv;$.SortingAscending=Lv=w.p($,"SortingAscending",12);var Mv;$.SortingDescending=Mv=w.p($,"SortingDescending",13);var Ow;$.AlignmentCenterSubtrees=Ow=w.p($,"AlignmentCenterSubtrees",20);var Nv;$.AlignmentCenterChildren=Nv=w.p($,"AlignmentCenterChildren",21);var Yv; $.AlignmentStart=Yv=w.p($,"AlignmentStart",22);var Zv;$.AlignmentEnd=Zv=w.p($,"AlignmentEnd",23);var Pv;$.AlignmentBus=Pv=w.p($,"AlignmentBus",24);var Ev;$.AlignmentBusBranching=Ev=w.p($,"AlignmentBusBranching",25);var Qv;$.AlignmentTopLeftBus=Qv=w.p($,"AlignmentTopLeftBus",26);var Rv;$.AlignmentBottomRightBus=Rv=w.p($,"AlignmentBottomRightBus",27);var Uv;$.CompactionNone=Uv=w.p($,"CompactionNone",30);var Wv;$.CompactionBlock=Wv=w.p($,"CompactionBlock",31);var ov; $.StyleLayered=ov=w.p($,"StyleLayered",40);var Iv;$.StyleLastParents=Iv=w.p($,"StyleLastParents",41);var Hv;$.StyleAlternating=Hv=w.p($,"StyleAlternating",42);var Gv;$.StyleRootOnly=Gv=w.p($,"StyleRootOnly",43);var qv;$.ArrangementVertical=qv=w.p($,"ArrangementVertical",50);var Xw;$.ArrangementHorizontal=Xw=w.p($,"ArrangementHorizontal",51);var tv;$.ArrangementFixedRoots=tv=w.p($,"ArrangementFixedRoots",52);var pv;$.LayerIndividual=pv=w.p($,"LayerIndividual",60);var Cv; $.LayerSiblings=Cv=w.p($,"LayerSiblings",61);var Bv;$.LayerUniform=Bv=w.p($,"LayerUniform",62);function sv(){tg.call(this)}w.La(sv,tg);w.ga("TreeNetwork",sv);sv.prototype.createVertex=function(){return new rv};sv.prototype.createEdge=function(){return new Zw}; function rv(){os.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.pa=new y(0,0);this.kb=new ia(0,0);this.Oa=new y(0,0);this.wq=this.vq=this.AJ=!1;this.Uu=this.zu=null;this.sorting=Jv;this.comparer=us;this.angle=0;this.alignment=Nv;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=Wv;this.breadthLimit= 0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=qc;this.setsChildPortSpot=!0;this.childPortSpot=qc}w.La(rv,os);w.ga("TreeVertex",rv); rv.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing, this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};w.u(rv,{qn:"childrenCount"},function(){return this.children.length});w.defineProperty(rv,{ML:"relativePosition"},function(){return this.pa},function(a){this.pa.set(a)});w.defineProperty(rv,{YL:"subtreeSize"},function(){return this.kb},function(a){this.kb.set(a)}); w.defineProperty(rv,{XL:"subtreeOffset"},function(){return this.Oa},function(a){this.Oa.set(a)});function Zw(){ps.call(this);this.Ws=new y(0,0)}w.La(Zw,ps);w.ga("TreeEdge",Zw); Zw.prototype.commit=function(){var a=this.link;if(null!==a&&!a.em){var b=this.network.Tb,c=null,d=null;switch(b.Of){case nv:c=this.fromVertex;d=this.toVertex;break;case uv:c=this.toVertex;d=this.fromVertex;break;default:w.k("Unhandled path value "+b.Of.toString())}if(null!==c&&null!==d)if(b=this.Ws,0!==b.x||0!==b.y||c.AJ){var d=c.cb,e=Xv(c),f=$v(c),h=c.rowSpacing;a.eo();var k=a.nf===tj,l=a.ac,m=0,n,p;a.pm();if(l||k){for(m=2;4q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-aw(c))))):c.alignment===Yv?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-aw(c))))):c.alignment===Yv?(r=d.left+b.x,0===b.x&&n.xq.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-aw(c))))):c.alignment===Yv?(r=d.top+b.y,0===b.y&&n.yq.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-aw(c))))):c.alignment===Yv?(r=d.left+b.x,0===b.x&&n.x