gojs插件源码

/* * GoJS v2.1.2 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-2019 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.2/license.html. */ (function() { var t;function aa(a){var b=0;return function(){return bc&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c=a.length?a.push(c):a.splice(b,0,c):B("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Ca(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):B("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Da(){var a=Ea.pop();return void 0===a?[]:a}function Fa(a){a.length=0;Ea.push(a)} function Ha(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(ya(a)&&a.constructor)return Ha(a.constructor);return typeof a} function Ia(a){var b=a;ya(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()}function Ja(a,b){if(a.hasOwnProperty(b))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(b))return!0;var c=a.uA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function La(a,b,c){Object.defineProperty(Na.prototype,a,{get:b,set:c})}function Oa(){var a=Qa;if(0===a.length)for(var b=x.document.getElementsByTagName("canvas"),c=b.length,d=0;dc;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);c=[];for(var d=0,e=0;ec;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;gthis.key)return!1;a=a.j;var b=a.length,c=++this.Oa,d=this.We;if(null!==d)for(;cthis.key)return!1;var b=--this.Oa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.Ad();return!1};jb.prototype.fd=function(){return this.next()}; jb.prototype.first=function(){var a=this.lb;this.ia=a.xa;var b=a.j;this.Oa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};jb.prototype.any=function(a){var b=this.lb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};jb.prototype.all=function(a){var b=this.lb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; jb.prototype.each=function(a){var b=this.lb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)a(b[c]);return this};jb.prototype.map=function(a){var b=this.lb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.ib();return a.iterator};jb.prototype.filter=function(a){var b=this.lb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.ib();return a.iterator}; jb.prototype.Ad=function(){this.key=-1;this.value=null;this.ia=-1;this.lb.Zg=this};jb.prototype.toString=function(){return"ListIteratorBackwards("+this.Oa+"/"+this.lb.count+")"};ma.Object.defineProperties(jb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.lb.j.length}}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.fd;jb.prototype.next=jb.prototype.next;jb.prototype.reset=jb.prototype.reset; jb.className="ListIteratorBackwards";function E(a){Za(this);this.s=!1;this.j=[];this.xa=0;this.Zg=this.Ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?xa():this.addAll(a))}t=E.prototype;t.ib=function(){var a=this.xa;a++;999999999a||a>=b.length)&&va(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.hd=function(a,b){var c=this.j;(0>a||a>=c.length)&&va(a,"0 <= i < length",E,"setElt:i");this.s&&ua(this,a);c[a]=b};t.set=function(a,b){this.hd(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.Vb=function(){var a=this.j,b=a.length;return 0a&&va(a,">= 0",E,"insertAt:i");this.s&&ua(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.ib()};t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=this.j;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.ib();return!0};t.delete=function(a){return this.remove(a)}; t.jb=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 <= i < length",E,"removeAt:i");this.s&&ua(this,a);a===b.length-1?b.pop():b.splice(a,1);this.ib()};t.removeRange=function(a,b){var c=this.j,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.s&&ua(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&va(b,"0 <= from < length",E,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a=e)for(c=d.slice(b),c.sort(a),a=b;a=this.j.length)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new ib(this)}},iteratorBackwards:{ get:function(){if(0>=this.j.length)return fb;var a=this.Zg;return null!==a?(a.reset(),a):new jb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.$i;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.Yv;E.prototype.toArray=E.prototype.ma;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.jb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.Kb; E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.Vb;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.hd;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.L;E.prototype.indexOf=E.prototype.indexOf;E.prototype.has=E.prototype.has;E.prototype.contains=E.prototype.contains;E.prototype.clear=E.prototype.clear;E.prototype.addAll=E.prototype.addAll;E.prototype.push=E.prototype.push;E.prototype.add=E.prototype.add;E.prototype.thaw=E.prototype.ea; E.prototype.freeze=E.prototype.freeze;E.className="List";function nb(a){this.og=a;a.Ga=null;this.ia=a.xa;this.ka=null}nb.prototype.reset=function(){var a=this.og;a.Ga=null;this.ia=a.xa;this.ka=null};nb.prototype.next=function(){var a=this.og;if(a.xa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.na;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Ad();return!1};nb.prototype.fd=function(){return this.next()}; nb.prototype.first=function(){var a=this.og;this.ia=a.xa;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};nb.prototype.any=function(a){var b=this.og;this.ka=b.Ga=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.na}return!1};nb.prototype.all=function(a){var b=this.og;this.ka=b.Ga=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.na}return!0};nb.prototype.each=function(a){var b=this.og;this.ka=b.Ga=null;for(b=b.ba;null!==b;)a(b.value),b=b.na;return this}; nb.prototype.map=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.na;return c.iterator};nb.prototype.filter=function(a){var b=this.og;b.Ga=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.na}return c.iterator};nb.prototype.Ad=function(){this.value=this.key=null;this.ia=-1;this.og.Ga=this};nb.prototype.toString=function(){return null!==this.ka?"SetIterator@"+this.ka.value:"SetIterator"}; ma.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.og.Db}}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.fd;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;nb.className="SetIterator"; function F(a){Za(this);this.s=!1;this.Eb={};this.Db=0;this.Ga=null;this.xa=0;this.Re=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?xa():this.addAll(a))}t=F.prototype;t.ib=function(){var a=this.xa;a++;999999999=this.Db)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new nb(this)}}});F.prototype.toList=F.prototype.Xv;F.prototype.toArray=F.prototype.ma;F.prototype.clear=F.prototype.clear;F.prototype.retainAll=F.prototype.fA;F.prototype.removeAll=F.prototype.uq; F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.first=F.prototype.first;F.prototype.containsAny=F.prototype.Ky;F.prototype.containsAll=F.prototype.Jy;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.addAll=F.prototype.addAll;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ea;F.prototype.freeze=F.prototype.freeze;var rb=1;F.className="Set";F.uniqueHash=Za;F.hashIdUnique=ob;F.hashId=lb; function sb(a){this.fa=a;this.ia=a.xa;this.ka=null}sb.prototype.reset=function(){this.ia=this.fa.xa;this.ka=null};sb.prototype.next=function(){var a=this.fa;if(a.xa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.na;if(null!==b)return this.ka=b,this.value=this.key=a=b.key,!0;this.Ad();return!1};sb.prototype.fd=function(){return this.next()};sb.prototype.first=function(){var a=this.fa;this.ia=a.xa;a=a.ba;return null!==a?(this.ka=a,this.value=this.key=a=a.key):null}; sb.prototype.any=function(a){var b=this.fa;this.ka=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.na}return!1};sb.prototype.all=function(a){var b=this.fa;this.ka=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.na}return!0};sb.prototype.each=function(a){var b=this.fa;this.ka=null;for(b=b.ba;null!==b;)a(b.key),b=b.na;return this};sb.prototype.map=function(a){var b=this.fa;this.ka=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.na;return c.iterator}; sb.prototype.filter=function(a){var b=this.fa;this.ka=null;var c=new E;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.na}return c.iterator};sb.prototype.Ad=function(){this.value=this.key=null;this.ia=-1};sb.prototype.toString=function(){return null!==this.ka?"MapKeySetIterator@"+this.ka.value:"MapKeySetIterator"};ma.Object.defineProperties(sb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}}); sb.prototype.first=sb.prototype.first;sb.prototype.hasNext=sb.prototype.fd;sb.prototype.next=sb.prototype.next;sb.prototype.reset=sb.prototype.reset;sb.className="MapKeySetIterator";function tb(a){F.call(this);Za(this);this.s=!0;this.fa=a}la(tb,F);t=tb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.fa.toString()+")"};t.add=function(){B("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.fa.contains(a)}; t.has=function(a){return this.contains(a)};t.remove=function(){B("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){B("This Set is read-only: "+this.toString())};t.first=function(){var a=this.fa.ba;return null!==a?a.key:null};tb.prototype.any=function(a){for(var b=this.fa.ba;null!==b;){if(a(b.key))return!0;b=b.na}return!1};tb.prototype.all=function(a){for(var b=this.fa.ba;null!==b;){if(!a(b.key))return!1;b=b.na}return!0}; tb.prototype.each=function(a){for(var b=this.fa.ba;null!==b;)a(b.key),b=b.na;return this};tb.prototype.map=function(a){for(var b=new F,c=this.fa.ba;null!==c;)b.add(a(c.key)),c=c.na;return b};tb.prototype.filter=function(a){for(var b=new F,c=this.fa.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.na}return b};tb.prototype.copy=function(){return new tb(this.fa)};tb.prototype.Yv=function(){var a=new F,b=this.fa.Eb,c;for(c in b)a.add(b[c].key);return a}; tb.prototype.ma=function(){var a=this.fa.Eb,b=Array(this.fa.Db),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};tb.prototype.Xv=function(){var a=new E,b=this.fa.Eb,c;for(c in b)a.add(b[c].key);return a};ma.Object.defineProperties(tb.prototype,{count:{get:function(){return this.fa.Db}},size:{get:function(){return this.fa.Db}},iterator:{get:function(){return 0>=this.fa.Db?fb:new sb(this.fa)}}}); tb.prototype.toList=tb.prototype.Xv;tb.prototype.toArray=tb.prototype.ma;tb.prototype.toSet=tb.prototype.Yv;tb.prototype.first=tb.prototype.first;tb.prototype.clear=tb.prototype.clear;tb.prototype["delete"]=tb.prototype.delete;tb.prototype.remove=tb.prototype.remove;tb.prototype.has=tb.prototype.has;tb.prototype.contains=tb.prototype.contains;tb.prototype.add=tb.prototype.add;tb.prototype.thaw=tb.prototype.ea;tb.prototype.freeze=tb.prototype.freeze;tb.className="MapKeySet"; function ub(a){this.fa=a;a.Qe=null;this.ia=a.xa;this.ka=null}ub.prototype.reset=function(){var a=this.fa;a.Qe=null;this.ia=a.xa;this.ka=null};ub.prototype.next=function(){var a=this.fa;if(a.xa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.na;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Ad();return!1};ub.prototype.fd=function(){return this.next()}; ub.prototype.first=function(){var a=this.fa;this.ia=a.xa;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};ub.prototype.any=function(a){var b=this.fa;this.ka=b.Qe=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.na}return!1};ub.prototype.all=function(a){var b=this.fa;this.ka=b.Qe=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.na}return!0};ub.prototype.each=function(a){var b=this.fa;this.ka=b.Qe=null;for(b=b.ba;null!==b;)a(b.value),b=b.na;return this}; ub.prototype.map=function(a){var b=this.fa;this.ka=b.Qe=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.na;return c.iterator};ub.prototype.filter=function(a){var b=this.fa;this.ka=b.Qe=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.na}return c.iterator};ub.prototype.Ad=function(){this.value=this.key=null;this.ia=-1;this.fa.Qe=this};ub.prototype.toString=function(){return null!==this.ka?"MapValueSetIterator@"+this.ka.value:"MapValueSetIterator"}; ma.Object.defineProperties(ub.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.fd;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;ub.className="MapValueSetIterator";function pb(a,b){this.key=a;this.value=b;this.Bl=this.na=null}pb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; pb.className="KeyValuePair";function vb(a){this.fa=a;a.Ga=null;this.ia=a.xa;this.ka=null}vb.prototype.reset=function(){var a=this.fa;a.Ga=null;this.ia=a.xa;this.ka=null};vb.prototype.next=function(){var a=this.fa;if(a.xa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.na;if(null!==b)return this.ka=b,this.key=b.key,this.value=b.value,!0;this.Ad();return!1};vb.prototype.fd=function(){return this.next()}; vb.prototype.first=function(){var a=this.fa;this.ia=a.xa;a=a.ba;return null!==a?(this.ka=a,this.key=a.key,this.value=a.value,a):null};vb.prototype.any=function(a){var b=this.fa;this.ka=b.Ga=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.na}return!1};vb.prototype.all=function(a){var b=this.fa;this.ka=b.Ga=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.na}return!0};vb.prototype.each=function(a){var b=this.fa;this.ka=b.Ga=null;for(b=b.ba;null!==b;)a(b),b=b.na;return this}; vb.prototype.map=function(a){var b=this.fa;this.ka=b.Ga=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b)),b=b.na;return c.iterator};vb.prototype.filter=function(a){var b=this.fa;this.ka=b.Ga=null;var c=new E;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.na;return c.iterator};vb.prototype.Ad=function(){this.value=this.key=null;this.ia=-1;this.fa.Ga=this};vb.prototype.toString=function(){return null!==this.ka?"MapIterator@"+this.ka:"MapIterator"}; ma.Object.defineProperties(vb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}});vb.prototype.first=vb.prototype.first;vb.prototype.hasNext=vb.prototype.fd;vb.prototype.next=vb.prototype.next;vb.prototype.reset=vb.prototype.reset;vb.className="MapIterator"; function G(a){Za(this);this.s=!1;this.Eb={};this.Db=0;this.Qe=this.Ga=null;this.xa=0;this.Re=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?xa():this.addAll(a))}t=G.prototype;t.ib=function(){var a=this.xa;a++;999999999=this.count)return fb;var a=this.Ga;return null!==a?(a.reset(),a):new vb(this)}},iteratorKeys:{get:function(){return 0>=this.count?fb:new sb(this)}},iteratorValues:{get:function(){if(0>=this.count)return fb; var a=this.Qe;return null!==a?(a.reset(),a):new ub(this)}}});G.prototype.toKeySet=G.prototype.Af;G.prototype.toArray=G.prototype.ma;G.prototype.clear=G.prototype.clear;G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.get=G.prototype.get;G.prototype.getValue=G.prototype.H;G.prototype.has=G.prototype.has;G.prototype.contains=G.prototype.contains;G.prototype.first=G.prototype.first;G.prototype.addAll=G.prototype.addAll;G.prototype.set=G.prototype.set; G.prototype.add=G.prototype.add;G.prototype.thaw=G.prototype.ea;G.prototype.freeze=G.prototype.freeze;G.className="Map";function H(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):B("Invalid arguments to Point constructor: "+a+", "+b);this.s=!1}H.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};H.prototype.h=function(a,b){this.x=a;this.y=b;return this};H.prototype.Cg=function(a,b){this.x=a;this.y=b;return this}; H.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};H.prototype.copy=function(){var a=new H;a.x=this.x;a.y=this.y;return a};t=H.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function wb(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 H(c,e)}return new H}function xb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof H?this.x===a.x&&this.y===a.y:!1};t.Li=function(a,b){return this.x===a&&this.y===b};t.Ma=function(a){return I.w(this.x,a.x)&&I.w(this.y,a.y)}; t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.Xd=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this};H.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.x=a*b-d*c;this.y=d*b+a*c;return this};t=H.prototype; t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.we=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.ed=function(a,b){a-=this.x;b-=this.y;return a*a+b*b};t.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}t.$z=function(a,b,c,d){I.Xi(a,b,c,d,this.x,this.y,this);return this};t.aA=function(a,b){I.Xi(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.lA=function(a,b,c,d){I.aq(this.x,this.y,a,b,c,d,this);return this};t.mA=function(a,b){I.aq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this}; t.Zi=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};t.sk=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};t.transform=function(a){a.ra(this);return this};function zb(a,b){b.Td(a);return a}function Ab(a,b,c,d,e,f){var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k}function Bb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b} function Cb(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}t.v=function(){return isFinite(this.x)&&isFinite(this.y)};H.alloc=function(){var a=Eb.pop();return void 0===a?new H:a};H.allocAt=function(a,b){var c=Eb.pop();if(void 0===c)return new H(a,b);c.x=a;c.y=b;return c};H.free=function(a){Eb.push(a)};H.prototype.isReal=H.prototype.v; H.prototype.setSpot=H.prototype.sk;H.prototype.setRectSpot=H.prototype.Zi;H.prototype.snapToGridPoint=H.prototype.mA;H.prototype.snapToGrid=H.prototype.lA;H.prototype.projectOntoLineSegmentPoint=H.prototype.aA;H.prototype.projectOntoLineSegment=H.prototype.$z;H.prototype.direction=H.prototype.direction;H.prototype.directionPoint=H.prototype.Sa;H.prototype.normalize=H.prototype.normalize;H.prototype.distanceSquared=H.prototype.ed;H.prototype.distanceSquaredPoint=H.prototype.we;H.prototype.scale=H.prototype.scale; H.prototype.rotate=H.prototype.rotate;H.prototype.offset=H.prototype.offset;H.prototype.subtract=H.prototype.Xd;H.prototype.add=H.prototype.add;H.prototype.equalsApprox=H.prototype.Ma;H.prototype.equalTo=H.prototype.Li;H.prototype.equals=H.prototype.A;H.prototype.set=H.prototype.set;H.prototype.setTo=H.prototype.Cg;var Fb=null,Gb=null,Hb=null,Ib=null,Jb=null,Eb=[];H.className="Point";H.parse=wb;H.stringify=xb;H.distanceLineSegmentSquared=Ab;H.distanceSquared=Bb;H.direction=Cb; H.Origin=Fb=(new H(0,0)).ca();H.InfiniteTopLeft=Gb=(new H(-Infinity,-Infinity)).ca();H.InfiniteBottomRight=Hb=(new H(Infinity,Infinity)).ca();H.SixPoint=Ib=(new H(6,6)).ca();H.NoPoint=Jb=(new H(NaN,NaN)).ca();H.parse=wb;H.stringify=xb;H.distanceLineSegmentSquared=Ab;H.distanceSquared=Bb;H.direction=Cb; function Kb(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):B("Invalid arguments to Size constructor: "+a+", "+b);this.s=!1}var Lb,Mb,Nb,Ob,Qb,Rb,Sb;Kb.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};Kb.prototype.h=function(a,b){this.width=a;this.height=b;return this};Kb.prototype.Cg=function(a,b){this.width=a;this.height=b;return this}; Kb.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};Kb.prototype.copy=function(){var a=new Kb;a.width=this.width;a.height=this.height;return a};t=Kb.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function Tb(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 Kb(c,e)}return new Kb}function Ub(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof Kb?this.width===a.width&&this.height===a.height:!1};t.Li=function(a,b){return this.width===a&&this.height===b}; t.Ma=function(a){return I.w(this.width,a.width)&&I.w(this.height,a.height)};t.v=function(){return isFinite(this.width)&&isFinite(this.height)};Kb.alloc=function(){var a=Vb.pop();return void 0===a?new Kb:a};Kb.free=function(a){Vb.push(a)};Kb.prototype.isReal=Kb.prototype.v;Kb.prototype.equalsApprox=Kb.prototype.Ma;Kb.prototype.equalTo=Kb.prototype.Li;Kb.prototype.equals=Kb.prototype.A;Kb.prototype.set=Kb.prototype.set;Kb.prototype.setTo=Kb.prototype.Cg;var Vb=[];Kb.className="Size";Kb.parse=Tb; Kb.stringify=Ub;Kb.ZeroSize=Lb=(new Kb(0,0)).ca();Kb.OneSize=Mb=(new Kb(1,1)).ca();Kb.SixSize=Nb=(new Kb(6,6)).ca();Kb.EightSize=Ob=(new Kb(8,8)).ca();Kb.TenSize=Qb=(new Kb(10,10)).ca();Kb.InfiniteSize=Rb=(new Kb(Infinity,Infinity)).ca();Kb.NoSize=Sb=(new Kb(NaN,NaN)).ca();Kb.parse=Tb;Kb.stringify=Ub; function M(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof H?(c=a.x,a=a.y,b instanceof H?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof Kb?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):B("Incorrect arguments supplied to Rect constructor")):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.x=a,this.y=b,this.width=c, this.height=d):B("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}t=M.prototype;t.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};t.h=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};function Xb(a,b,c){a.width=b;a.height=c}t.Cg=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};t.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this}; t.jd=function(a){this.x=a.x;this.y=a.y;return this};t.jA=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.copy=function(){var a=new M;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=M.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this}; t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function Yb(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 g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new M(c,e,f,g)}return new M} function Zb(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.A=function(a){return a instanceof M?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.Li=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Ma=function(a){return I.w(this.x,a.x)&&I.w(this.y,a.y)&&I.w(this.width,a.width)&&I.w(this.height,a.height)}; function bc(a,b){return I.Z(a.x,b.x)&&I.Z(a.y,b.y)&&I.Z(a.width,b.width)&&I.Z(a.height,b.height)}t.$=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.nf=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};t.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}; t.reset=function(){this.height=this.width=this.y=this.x=0};t.offset=function(a,b){this.x+=a;this.y+=b;return this};t.Tc=function(a,b){return cc(this,b,a,b,a)};t.Tp=function(a){return cc(this,a.top,a.right,a.bottom,a.left)};t.Wv=function(a){return cc(this,-a.top,-a.right,-a.bottom,-a.left)};t.Dz=function(a,b,c,d){return cc(this,a,b,c,d)};function cc(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} t.Hz=function(a){return dc(this,a.x,a.y,a.width,a.height)};t.pv=function(a,b,c,d){return dc(this,a,b,c,d)};function dc(a,b,c,d,e){var f=Math.max(a.x,b),g=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=g;a.width=Math.max(0,b-f);a.height=Math.max(0,c-g);return a}t.Gc=function(a){return this.qv(a.x,a.y,a.width,a.height)}; t.qv=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 ec(a,b,c){var d=a.width,e=a.x,f=b.x-c;if(e>b.width+c+c+f||f>d+e)return!1;d=a.height;a=a.y;e=b.y-c;return a>b.height+c+c+e||e>d+a?!1:!0}t.Ce=function(a){return fc(this,a.x,a.y,0,0)};t.Hc=function(a){return fc(this,a.x,a.y,a.width,a.height)}; t.cw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return fc(this,a,b,c,d)};function fc(a,b,c,d,e){var f=Math.min(a.x,b),g=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=g;a.width=b-f;a.height=c-g;return a}t.sk=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};function kc(a,b,c,d,e,f,g,h){void 0===g&&(g=0);void 0===h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d} function lc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.v=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Jz=function(){return 0===this.width&&0===this.height};M.alloc=function(){var a=mc.pop();return void 0===a?new M:a};M.allocAt=function(a,b,c,d){var e=mc.pop();return void 0===e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){mc.push(a)}; ma.Object.defineProperties(M.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{ get:function(){return new H(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new Kb(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new H(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/ 2},set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});M.prototype.isEmpty=M.prototype.Jz;M.prototype.isReal=M.prototype.v;M.prototype.setSpot=M.prototype.sk;M.prototype.union=M.prototype.cw;M.prototype.unionRect=M.prototype.Hc;M.prototype.unionPoint=M.prototype.Ce;M.prototype.intersects=M.prototype.qv;M.prototype.intersectsRect=M.prototype.Gc;M.prototype.intersect=M.prototype.pv; M.prototype.intersectRect=M.prototype.Hz;M.prototype.grow=M.prototype.Dz;M.prototype.subtractMargin=M.prototype.Wv;M.prototype.addMargin=M.prototype.Tp;M.prototype.inflate=M.prototype.Tc;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains;M.prototype.containsRect=M.prototype.nf;M.prototype.containsPoint=M.prototype.$;M.prototype.equalsApprox=M.prototype.Ma;M.prototype.equalTo=M.prototype.Li;M.prototype.equals=M.prototype.A;M.prototype.setSize=M.prototype.jA; M.prototype.setPoint=M.prototype.jd;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Cg;var nc=null,oc=null,mc=[];M.className="Rect";M.parse=Yb;M.stringify=Zb;M.contains=kc;M.intersects=lc;M.ZeroRect=nc=(new M(0,0,0,0)).ca();M.NoRect=oc=(new M(NaN,NaN,NaN,NaN)).ca();M.parse=Yb;M.stringify=Zb;M.contains=kc;M.intersects=lc; function pc(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?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):B("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}pc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this}; pc.prototype.Cg=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};pc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};pc.prototype.copy=function(){var a=new pc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=pc.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()}; t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this}; function qc(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 pc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new pc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new pc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new pc(c,e):new pc(c,e,f,g)}return new pc} function rc(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.A=function(a){return a instanceof pc?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};t.Li=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d}; t.Ma=function(a){return I.w(this.top,a.top)&&I.w(this.right,a.right)&&I.w(this.bottom,a.bottom)&&I.w(this.left,a.left)};t.v=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};pc.alloc=function(){var a=sc.pop();return void 0===a?new pc:a};pc.free=function(a){sc.push(a)};pc.prototype.isReal=pc.prototype.v;pc.prototype.equalsApprox=pc.prototype.Ma;pc.prototype.equalTo=pc.prototype.Li;pc.prototype.equals=pc.prototype.A;pc.prototype.set=pc.prototype.set; pc.prototype.setTo=pc.prototype.Cg;var tc=null,uc=null,sc=[];pc.className="Margin";pc.parse=qc;pc.stringify=rc;pc.ZeroMargin=tc=(new pc(0,0,0,0)).ca();pc.TwoMargin=uc=(new pc(2,2,2,2)).ca();pc.parse=qc;pc.stringify=rc;function O(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);this.s=!1} var wc,xc,yc,zc,Ac,Bc,Ec,Fc,Gc,Hc,Ic,Jc,Kc,Lc,Mc,Nc,Pc,Qc,Rc,Sc,Tc,Uc,Xc,Yc,Zc,$c,ad,bd,cd,dd,ed,fd,gd,hd,id,jd;O.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};O.prototype.Cg=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};O.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this}; O.prototype.copy=function(){var a=new O;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};t=O.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};function kd(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a} function pd(a){if("string"===typeof a){a=a.trim();if("None"===a)return wc;if("TopLeft"===a)return xc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return yc;if("TopRight"===a)return zc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Ac;if("Center"===a)return Bc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Ec;if("BottomLeft"===a)return Fc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Gc;if("BottomRight"===a)return Hc;if("TopSide"===a)return Ic;if("LeftSide"=== a)return Jc;if("RightSide"===a)return Kc;if("BottomSide"===a)return Lc;if("TopBottomSides"===a)return Mc;if("LeftRightSides"===a)return Nc;if("TopLeftSides"===a)return Pc;if("TopRightSides"===a)return Qc;if("BottomLeftSides"===a)return Rc;if("BottomRightSides"===a)return Sc;if("NotTopSide"===a)return Tc;if("NotLeftSide"===a)return Uc;if("NotRightSide"===a)return Xc;if("NotBottomSide"===a)return Yc;if("AllSides"===a)return Zc;if("Default"===a)return $c;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0a&&(a+=360);if(0===a)return this;this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,f=this.m11*-d+this.m21*a,g=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=sd.prototype;t.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this}; t.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.ra=function(a){var b=a.x,c=a.y;return a.h(b*this.m11+c*this.m21+this.dx,b*this.m12+c*this.m22+this.dy)};t.Td=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=a.x,d=a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; t.bw=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,r=d*f+c*h+l,q=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,r);n=Math.max(n,r);r=Math.min(p,q);p=Math.max(p,q);e=Math.min(e,c);n=Math.max(n,c);r=Math.min(r,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);r=Math.min(r,d);p=Math.max(p,d);a.h(e,r,n-e,p-r);return a};sd.alloc=function(){var a=td.pop();return void 0===a?new sd:a}; sd.free=function(a){td.push(a)};sd.prototype.transformRect=sd.prototype.bw;sd.prototype.invertedTransformPoint=sd.prototype.Td;sd.prototype.transformPoint=sd.prototype.ra;sd.prototype.scale=sd.prototype.scale;sd.prototype.translate=sd.prototype.translate;sd.prototype.rotate=sd.prototype.rotate;sd.prototype.invert=sd.prototype.ft;sd.prototype.multiplyInverted=sd.prototype.wv;sd.prototype.multiply=sd.prototype.multiply;sd.prototype.reset=sd.prototype.reset;sd.prototype.isIdentity=sd.prototype.gt; sd.prototype.equals=sd.prototype.A;sd.prototype.set=sd.prototype.set;var td=[];sd.className="Transform";sd.xF="54a702f3e53909c447824c6706603faf4c"; var I={sA:"7da71ca0ad381e90",Fg:(Math.sqrt(2)-1)/3*4,ow:null,sqrt:function(a){if(0>=a)return 0;var b=I.ow;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);I.ow=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},w:function(a,b){a-=b;return.5>a&&-.5a&&-5E-8=e&&(e=1E-6);if(am-l)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=g&&g<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(g=(c-a)/(d-b)*(g-b)+a,g-e<=f&&f<=g+e)return!0}else return!0;return!1},Ms:function(a,b,c,d,e,f,g,h,k,l,m,n){if(I.Wb(a,b,g,h,n,c,d)&&I.Wb(a,b,g,h,n,e,f))return I.Wb(a,b,g,h,n,l,m);var p=(a+c)/2,r=(b+d)/2,q=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+q)/2;c=(r+u)/2;q=(q+e)/2;u=(u+f)/2;var v=(d+q)/2,w=(c+u)/2;return I.Ms(a, b,p,r,d,c,v,w,k,l,m,n)||I.Ms(v,w,q,u,e,f,g,h,k,l,m,n)},Fy:function(a,b,c,d,e,f,g,h,k){var l=(c+e)/2,m=(d+f)/2;k.h((((a+c)/2+l)/2+(l+(e+g)/2)/2)/2,(((b+d)/2+m)/2+(m+(f+h)/2)/2)/2);return k},Ey:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Cb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Xl:function(a,b,c,d,e,f,g,h,k,l){if(I.Wb(a,b,g,h,k,c,d)&&I.Wb(a,b,g,h,k,e,f))fc(l,a,b,0,0),fc(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/ 2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;I.Xl(a,b,m,n,d,c,q,u,k,l);I.Xl(q,u,p,r,e,f,g,h,k,l)}return l},ve:function(a,b,c,d,e,f,g,h,k,l){if(I.Wb(a,b,g,h,k,c,d)&&I.Wb(a,b,g,h,k,e,f))0===l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;I.ve(a,b,m,n,d,c,q,u,k,l);I.ve(q,u,p,r,e,f,g,h,k,l)}return l},Dv:function(a,b,c,d,e,f,g,h,k,l){if(I.Wb(a,b,e,f,l,c,d))return I.Wb(a, b,e,f,l,h,k);var m=(a+c)/2,n=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var p=(m+c)/2,r=(n+d)/2;return I.Dv(a,b,m,n,p,r,g,h,k,l)||I.Dv(p,r,c,d,e,f,g,h,k,l)},yA:function(a,b,c,d,e,f,g){g.h(((a+c)/2+(c+e)/2)/2,((b+d)/2+(d+f)/2)/2);return g},Cv:function(a,b,c,d,e,f,g,h){if(I.Wb(a,b,e,f,g,c,d))fc(h,a,b,0,0),fc(h,e,f,0,0);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;I.Cv(a,b,k,l,m,n,g,h);I.Cv(m,n,c,d,e,f,g,h)}return h},rq:function(a,b,c,d,e,f,g,h){if(I.Wb(a,b,e,f,g,c,d))0===h.length&&(h.push(a), h.push(b)),h.push(e),h.push(f);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;I.rq(a,b,k,l,m,n,g,h);I.rq(m,n,c,d,e,f,g,h)}return h},Up:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(I.Wb(a,b,g,h,p,c,d)&&I.Wb(a,b,g,h,p,e,f)){var q=(a-g)*(l-n)-(b-h)*(k-m);if(0===q)return!1;p=((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/q;q=((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/q;if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(bh)return!1}else if(ag)return!1;r.h(p,q);return!0}q= (a+c)/2;var u=(b+d)/2;c=(c+e)/2;d=(d+f)/2;e=(e+g)/2;f=(f+h)/2;var v=(q+c)/2,w=(u+d)/2;c=(c+e)/2;d=(d+f)/2;var y=(v+c)/2,z=(w+d)/2,A=(m-k)*(m-k)+(n-l)*(n-l),C=!1;I.Up(a,b,q,u,v,w,y,z,k,l,m,n,p,r)&&(a=(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l),a=m)return r;if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(bb)return r}else if(aa)return r;0p&&r--}else{q=(a+c)/2;u=(b+d)/2;var v=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+v)/2;c=(u+w)/2;v=(v+e)/2;w=(w+f)/2;var y=(d+v)/2,z=(c+w)/2;r+=I.Vp(a,b,q,u,d,c,y,z,k,l,m,n,p);r+=I.Vp(y,z,v,w,e,f,g,h,k,l,m,n,p)}return r},Xi:function(a,b,c,d,e,f,g){if(I.Z(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(I.Z(b,d)){aa)return g.h(a,b),!1;g.h(e,b);return!0}e=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>e)return g.h(a,b),!1;if(1.000005b)return k.h(a,b),!1;k.h(a,c);return!0}g=(d-b)/(c-a);if(I.Z(h,g))return I.Xi(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(I.Z(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return I.Xi(a,b,c,d,e,g*(e-a)+b,k)},xA:function(a,b,c,d,e){return I.ze(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},wA:function(a,b,c,d,e,f,g,h,k,l){function m(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e(c>a?c-a:a-c)){p=1-(c-e)*(c-e)/(p*p);if(0>p)return k;p=Math.sqrt(p);d=-l*p+f;m(c,l*p+f);m(c,d)}else{c=(d-b)/(c-a);d=1/(p*p)+c*c/(l*l);h=2*c*(b-c*a)/(l*l)-2*c*f/(l*l)-2*e/(p*p);p=h*h-4*d*(2*c*a*f/(l*l)-2*b*f/(l*l)+f*f/(l*l)+e*e/(p*p)-1+(b-c*a)*(b-c*a)/(l*l));if(0>p)return k;p=Math.sqrt(p);l=(-h+p)/(2*d);m(l,c*l-c*a+b);p=(-h-p)/(2*d);m(p,c*p-c*a+b)}return k}, Sc:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(I.ze(a,b,a,d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},vA:function(a,b,c,d,e,f,g,h,k){c=a-c;g=e-g;0===c||0===g?0===c?(b=(f-h)/g,h=a,e=b*h+(f- b*e)):(f=(b-d)/c,h=e,e=f*h+(b-f*a)):(d=(b-d)/c,h=(f-h)/g,a=b-d*a,h=(f-h*e-a)/(d-h),e=d*h+a);k.h(h,e);return k},dt:function(a,b,c){var d=b.x,e=b.y,f=c.x,g=c.y,h=a.left,k=a.right,l=a.top,m=a.bottom;return d===f?(e=l):e===g?(d=h):a.$(b)||a.$(c)||I.ct(h,l,k,l,d,e,f,g)||I.ct(k,l,k,m,d,e,f,g)||I.ct(k,m,h,m,d,e,f,g)||I.ct(h,m,h,l,d,e,f,g)?!0:!1},ct:function(a,b,c,d,e,f,g,h){return 0>=I.Ps(a,b,c,d,e,f)*I.Ps(a,b,c,d,g,h)&&0>=I.Ps(e, f,g,h,a,b)*I.Ps(e,f,g,h,c,d)},Ps:function(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},sx:function(a,b,c,d,e,f){var g=Math.PI;f||(d*=g/180,e*=g/180);var h=d>e?-1:1;f=[];var k=g/2,l=d;d=Math.min(2*g,Math.abs(e-d));if(1E-5>d)return k=l+h*Math.min(d,k),h=a+c*Math.cos(l),l=b+c*Math.sin(l),a+=c*Math.cos(k),b+=c*Math.sin(k),c=(h+a)/2,k=(l+b)/2,f.push([h,l,c,k,c,k,a,b]),f; for(;1E-5c,f=0>d;if(al;++l){b=.5*(h+k);if(b===h||b===k)break;var m=a/(b+ e),n=g/(b+f);m=m*m+n*n-1;if(0m)k=b;else break}c=e*c/(b+e)-c;d=f*d/(b+f)-d;c=Math.sqrt(c*c+d*d)}else c=Math.abs(d-b);else d=a*a-b*b,f=a*c,fa?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case Hd:var b=new M(this.startX,this.startY,0,0);b.cw(this.endX,this.endY,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 Id:b=new M(this.startX,this.startY,0,0);b.cw(this.endX,this.endY,0,0);if(0>a)return a=b.left.toString()+" "+(b.y+b.height/2).toString(),"M"+a+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+(b.right.toString()+" "+(b.y+b.height/2).toString())+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+a;var c=b.left.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 "+(b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a))+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case vd:b="";c=this.figures.j;for(var d=c.length,e=0;e=A-1?!0:null!==k[u+1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)}function d(){u++;return k[u]}function e(){var a=new H(parseFloat(d()),parseFloat(d()));v===v.toLowerCase()&&(a.x=z.x+a.x,a.y=z.y+a.y);return a}function f(){return z=e()}function g(){return y=e()}function h(){var a=w.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?z:new H(2*z.x-y.x,2*z.y-y.y)}void 0===b&&(b=!1);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,"");var k=a.split(" ");for(a=0;a=A-1);)if(w=v,v=d(),""!==v)switch(v.toUpperCase()){case "X":p=!0;n=l=!1;break;case "M":r=f();null===a.ec||!0===p?(Ld(a,r.x,r.y,l,!n),p=!1):a.moveTo(r.x,r.y);for(m=z;!c();)r=f(),a.lineTo(r.x,r.y);break; case "L":for(;!c();)r=f(),a.lineTo(r.x,r.y);break;case "H":for(;!c();)z=new H((v===v.toLowerCase()?z.x:0)+parseFloat(d()),z.y),a.lineTo(z.x,z.y);break;case "V":for(;!c();)z=new H(z.x,(v===v.toLowerCase()?z.y:0)+parseFloat(d())),a.lineTo(z.x,z.y);break;case "C":for(;!c();){r=e();q=g();var C=f();Md(a,r.x,r.y,q.x,q.y,C.x,C.y)}break;case "S":for(;!c();)r=h(),q=g(),C=f(),Md(a,r.x,r.y,q.x,q.y,C.x,C.y);break;case "Q":for(;!c();)r=g(),q=f(),Rd(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)y=r=h(),q=f(),Rd(a, r.x,r.y,q.x,q.y);break;case "B":for(;!c();){r=parseFloat(d());q=parseFloat(d());C=parseFloat(d());var J=parseFloat(d()),K=parseFloat(d()),L=K,V=!1;c()||(L=parseFloat(d()),c()||(V=0!==parseFloat(d())));v===v.toLowerCase()&&(C+=z.x,J+=z.y);a.arcTo(r,q,C,J,K,L,V)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),C=parseFloat(d()),J=!!parseFloat(d()),K=!!parseFloat(d()),L=f(),Sd(a,r,q,C,J,K,L.x,L.y);break;case "Z":Td(a);z=m;break;case "F":r="";for(q=1;k[u+q];)if(null!== k[u+q].match(/[Uu]/))q++;else if(null===k[u+q].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/))q++;else{r=k[u+q];break}r.match(/[Mm]/)?l=!0:0g&&(g+=360),q.startAngle+=g);0>a&&(q.startAngle=180-q.startAngle,q.sweepAngle=-q.sweepAngle);0>d&& (q.startAngle=-q.startAngle,q.sweepAngle=-q.sweepAngle);q.radiusX*=Math.sqrt(a*a+c*c);void 0!==q.radiusY&&(q.radiusY*=Math.sqrt(b*b+d*d));break;case ae:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.xAxisRotation+=g);0>a&&(q.xAxisRotation=180-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);0>d&&(q.xAxisRotation=-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);q.radiusX*=Math.sqrt(a*a+c*c);q.radiusY*=Math.sqrt(b*b+d*d);break;default:B("Unknown Segment type: "+ q.type)}}}}this.pa=!0;return this}; t.$=function(a,b,c,d){var e=a.x;a=a.y;for(var f=this.bounds.x-20,g=0,h,k,l,m,n,p=this.figures.j,r=p.length,q=0;q=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(fh)return 0}else{if(bf)return 0}else if(eg)return 0}else if(le)return 0;return 0a?a=0:1=f)return d=f-g,d=0===m?0:d/m,c=c[h],h=c[2*a],e=c[2*a+1],b.h(h+(c[2*a+2]-h)*d,e+(c[2*a+3]-e)*d),b;g+=m}}return b}; t.Cx=function(a){if(this.type===xd){var b=this.startX,c=this.startY,d=this.endX,e=this.endY;if(b!==d||c!==e){var f=a.x;a=a.y;if(b===d){if(c=d?d===c?0:1:Math.abs(a-c)/(d-g)}return c===e?(b=d?d===b?0:1:Math.abs(f-b)/(d-g)):((f-b)*(f-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===Hd){g=this.startX;var h=this.startY,k=this.endX;e=this.endY;if(g!==k||h!==e){b=k-g;c=e-h;f=2*b+2*c;d=a.x;a=a.y;d=Math.min(Math.max(d, g),k);a=Math.min(Math.max(a,h),e);g=Math.abs(d-g);k=Math.abs(d-k);h=Math.abs(a-h);e=Math.abs(a-e);var l=Math.min(g,k,h,e);if(l===h)return d/f;if(l===k)return(b+a)/f;if(l===e)return(2*b+c-d)/f;if(l===g)return(2*b+2*c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=H.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;na?0:1a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.j,d=c.length,e=0;ea&&(a+=360),this.re=a,this.vi=0,this.wi=Math.max(d,0),this.hh=Math.max(e,0),this.ol="boolean"===typeof g?!!g:!1,this.Fk=!!h):(this.re=d,this.vi=e,a===$d&&(f=Math.max(f,0)),this.wi=f,"number"===typeof g?(a===$d&&(g=Math.max(g,0)),this.hh=g):this.hh=0,this.Fk=this.ol=!1);this.pj= !1;this.pa=!0;this.Ge=null}le.prototype.copy=function(){var a=new le;a.qa=this.qa;a.mc=this.mc;a.Ac=this.Ac;a.re=this.re;a.vi=this.vi;a.wi=this.wi;a.hh=this.hh;a.ol=this.ol;a.Fk=this.Fk;a.pj=this.pj;a.pa=this.pa;return a};t=le.prototype; t.Ma=function(a){if(!(a instanceof le)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Xd:case Fd:return I.w(this.endX,a.endX)&&I.w(this.endY,a.endY);case Yd:return I.w(this.endX,a.endX)&&I.w(this.endY,a.endY)&&I.w(this.point1X,a.point1X)&&I.w(this.point1Y,a.point1Y)&&I.w(this.point2X,a.point2X)&&I.w(this.point2Y,a.point2Y);case Zd:return I.w(this.endX,a.endX)&&I.w(this.endY,a.endY)&&I.w(this.point1X,a.point1X)&&I.w(this.point1Y,a.point1Y);case $d:return I.w(this.startAngle, a.startAngle)&&I.w(this.sweepAngle,a.sweepAngle)&&I.w(this.centerX,a.centerX)&&I.w(this.centerY,a.centerY)&&I.w(this.radiusX,a.radiusX)&&I.w(this.radiusY,a.radiusY);case ae:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&I.w(this.xAxisRotation,a.xAxisRotation)&&I.w(this.endX,a.endX)&&I.w(this.endY,a.endY)&&I.w(this.radiusX,a.radiusX)&&I.w(this.radiusY,a.radiusY);default:return!1}};t.cb=function(a){a.classType===le&&(this.type=a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Xd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Fd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Yd:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+ " "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Zd:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case $d:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+ " "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case ae:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+ " "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.pj?"z":"")};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.close=function(){this.pj=!0;return this}; function be(a,b){if(null!==a.Ge&&!1===b.pa)return a.Ge;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Ge=[],a.Ge;b=a.re;var e=a.vi,f=I.sx(0,0,c=r?g=Math.PI:1<=r&&(g=0);!k&&0g&&(g+=2*Math.PI);k=b>f?1:b/f;r=b>f?f/b:1;b=I.sx(0,0,b>f?b:f,m,m+g,!0);f=sd.alloc();f.reset();f.translate(c,d);f.rotate(a.re,0,0);f.scale(k,r);Vd(b,f);sd.free(f);a.Ge=b;return a.Ge} ma.Object.defineProperties(le.prototype,{isClosed:{get:function(){return this.pj},set:function(a){this.pj!==a&&(this.pj=a,this.pa=!0)}},type:{get:function(){return this.qa},set:function(a){this.s&&ua(this,a);this.qa=a;this.pa=!0}},endX:{get:function(){return this.mc},set:function(a){this.s&&ua(this,a);this.mc=a;this.pa=!0}},endY:{get:function(){return this.Ac},set:function(a){this.s&& ua(this,a);this.Ac=a;this.pa=!0}},point1X:{get:function(){return this.re},set:function(a){this.s&&ua(this,a);this.re=a;this.pa=!0}},point1Y:{get:function(){return this.vi},set:function(a){this.s&&ua(this,a);this.vi=a;this.pa=!0}},point2X:{get:function(){return this.wi},set:function(a){this.s&&ua(this,a);this.wi=a;this.pa=!0}},point2Y:{get:function(){return this.hh},set:function(a){this.s&& ua(this,a);this.hh=a;this.pa=!0}},centerX:{get:function(){return this.re},set:function(a){this.s&&ua(this,a);this.re=a;this.pa=!0}},centerY:{get:function(){return this.vi},set:function(a){this.s&&ua(this,a);this.vi=a;this.pa=!0}},radiusX:{get:function(){return this.wi},set:function(a){0>a&&va(a,">= zero",le,"radiusX");this.s&&ua(this,a);this.wi=a;this.pa=!0}},radiusY:{get:function(){return this.hh}, set:function(a){0>a&&va(a,">= zero",le,"radiusY");this.s&&ua(this,a);this.hh=a;this.pa=!0}},startAngle:{get:function(){return this.mc},set:function(a){this.mc!==a&&(this.s&&ua(this,a),a%=360,0>a&&(a+=360),this.mc=a,this.pa=!0)}},sweepAngle:{get:function(){return this.Ac},set:function(a){this.s&&ua(this,a);360a&&(a=-360);this.Ac=a;this.pa=!0}},isClockwiseArc:{get:function(){return this.Fk},set:function(a){this.s&& ua(this,a);this.Fk=a;this.pa=!0}},isLargeArc:{get:function(){return this.ol},set:function(a){this.s&&ua(this,a);this.ol=a;this.pa=!0}},xAxisRotation:{get:function(){return this.re},set:function(a){a%=360;0>a&&(a+=360);this.s&&ua(this,a);this.re=a;this.pa=!0}}});le.prototype.equalsApprox=le.prototype.Ma; var Xd=new D(le,"Move",0),Fd=new D(le,"Line",1),Yd=new D(le,"Bezier",2),Zd=new D(le,"QuadraticBezier",3),$d=new D(le,"Arc",4),ae=new D(le,"SvgArc",4);le.className="PathSegment";le.Move=Xd;le.Line=Fd;le.Bezier=Yd;le.QuadraticBezier=Zd;le.Arc=$d;le.SvgArc=ae;function ne(){this.B=null;this.Lu=(new H(0,0)).freeze();this.Vt=(new H(0,0)).freeze();this.Uq=this.Yr=0;this.Vq=1;this.Nr="";this.Hs=this.ir=!1;this.hr=this.Xq=0;this.Kg=this.yr=this.Hr=!1;this.pr=null;this.Es=0;this.bd=this.Ds=null} ne.prototype.copy=function(){var a=new ne;return this.clone(a)};ne.prototype.clone=function(a){a.B=this.B;a.Lu.assign(this.viewPoint);a.Vt.assign(this.documentPoint);a.Yr=this.Yr;a.Uq=this.Uq;a.Vq=this.Vq;a.Nr=this.Nr;a.ir=this.ir;a.Hs=this.Hs;a.Xq=this.Xq;a.hr=this.hr;a.Hr=this.Hr;a.yr=this.yr;a.Kg=this.Kg;a.pr=this.pr;a.Es=this.Es;a.Ds=this.Ds;a.bd=this.bd;return a}; ne.prototype.toString=function(){var a="^";0!==this.modifiers&&(a+="M:"+this.modifiers);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.clickCount&&(a+="C:"+this.clickCount);0!==this.delta&&(a+="D:"+this.delta);this.handled&&(a+="h");this.bubbles&&(a+="b");null!==this.documentPoint&&(a+="@"+this.documentPoint.toString());return a};ne.prototype.eq=function(a,b){var c=this.diagram;if(null===c)return b;oe(c,this.event,a,b);return b}; ne.prototype.sz=function(a,b){var c=this.diagram;if(null===c)return b;oe(c,this.event,a,b);b.assign(c.Bt(b));return b}; ma.Object.defineProperties(ne.prototype,{diagram:{get:function(){return this.B},set:function(a){this.B=a}},viewPoint:{get:function(){return this.Lu},set:function(a){this.Lu.assign(a)}},documentPoint:{get:function(){return this.Vt},set:function(a){this.Vt.assign(a)}},modifiers:{get:function(){return this.Yr},set:function(a){this.Yr=a}},button:{get:function(){return this.Uq}, set:function(a){this.Uq=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Vq},set:function(a){this.Vq=a}},key:{get:function(){return this.Nr},set:function(a){this.Nr=a}},down:{get:function(){return this.ir},set:function(a){this.ir=a}},up:{get:function(){return this.Hs},set:function(a){this.Hs= a}},clickCount:{get:function(){return this.Xq},set:function(a){this.Xq=a}},delta:{get:function(){return this.hr},set:function(a){this.hr=a}},isMultiTouch:{get:function(){return this.Hr},set:function(a){this.Hr=a}},handled:{get:function(){return this.yr},set:function(a){this.yr=a}},bubbles:{get:function(){return this.Kg},set:function(a){this.Kg=a}},event:{ get:function(){return this.pr},set:function(a){this.pr=a}},isTouchEvent:{get:function(){var a=x.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=x.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{get:function(){return this.Es},set:function(a){this.Es=a}},targetDiagram:{get:function(){return this.Ds},set:function(a){this.Ds=a}},targetObject:{ get:function(){return this.bd},set:function(a){this.bd=a}},control:{get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers=a?this.modifiers| 2:this.modifiers&-3}},meta:{get:function(){return 0!==(this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get: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},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get: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},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get: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},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}}); ne.prototype.getMultiTouchDocumentPoint=ne.prototype.sz;ne.prototype.getMultiTouchViewPoint=ne.prototype.eq;ne.className="InputEvent";function pe(){this.B=null;this.Qa="";this.hs=this.Bs=null}pe.prototype.copy=function(){var a=new pe;a.B=this.B;a.Qa=this.Qa;a.Bs=this.Bs;a.hs=this.hs;return a};pe.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; ma.Object.defineProperties(pe.prototype,{diagram:{get:function(){return this.B},set:function(a){this.B=a}},name:{get:function(){return this.Qa},set:function(a){this.Qa=a}},subject:{get:function(){return this.Bs},set:function(a){this.Bs=a}},parameter:{get:function(){return this.hs},set:function(a){this.hs=a}}});pe.className="DiagramEvent"; function qe(){this.Zm=re;this.Ye=this.Xr="";this.Do=this.Eo=this.Jo=this.Ko=this.Io=this.B=this.ac=null}qe.prototype.clear=function(){this.Do=this.Eo=this.Jo=this.Ko=this.Io=this.B=this.ac=null}; qe.prototype.copy=function(){var a=new qe;a.Zm=this.Zm;a.Xr=this.Xr;a.Ye=this.Ye;a.ac=this.ac;a.B=this.B;a.Io=this.Io;var b=this.Ko;a.Ko=ya(b)&&"function"===typeof b.G?b.G():b;b=this.Jo;a.Jo=ya(b)&&"function"===typeof b.G?b.G():b;b=this.Eo;a.Eo=ya(b)&&"function"===typeof b.G?b.G():b;b=this.Do;a.Do=ya(b)&&"function"===typeof b.G?b.G():b;return a};qe.prototype.cb=function(a){a.classType===qe&&(this.change=a)}; qe.prototype.toString=function(){var a="";a=this.change===se?a+"* ":this.change===re?a+(null!==this.model?"!m":"!d"):a+((null!==this.model?"!m":"!d")+this.change);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange);a+=": ";this.change===se?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ia(this.object)),null!==this.oldValue&&(a+=" old: "+Ia(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ia(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};qe.prototype.H=function(a){return a?this.oldValue:this.newValue};qe.prototype.vz=function(a){return a?this.oldParam:this.newParam};qe.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1};qe.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.Sj(this,!0):null!==this.diagram&&this.diagram.Sj(this,!0))}; qe.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};qe.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.Sj(this,!1):null!==this.diagram&&this.diagram.Sj(this,!1))}; ma.Object.defineProperties(qe.prototype,{model:{get:function(){return this.ac},set:function(a){this.ac=a}},diagram:{get:function(){return this.B},set:function(a){this.B=a}},change:{get:function(){return this.Zm},set:function(a){this.Zm=a}},modelChange:{get:function(){return this.Xr},set:function(a){this.Xr=a}},propertyName:{get:function(){return this.Ye}, set:function(a){this.Ye=a}},isTransactionFinished:{get:function(){return this.Zm===se&&("CommittedTransaction"===this.Ye||"FinishedUndo"===this.Ye||"FinishedRedo"===this.Ye)}},object:{get:function(){return this.Io},set:function(a){this.Io=a}},oldValue:{get:function(){return this.Ko},set:function(a){this.Ko=a}},oldParam:{get:function(){return this.Jo},set:function(a){this.Jo=a}}, newValue:{get:function(){return this.Eo},set:function(a){this.Eo=a}},newParam:{get:function(){return this.Do},set:function(a){this.Do=a}}});qe.prototype.redo=qe.prototype.redo;qe.prototype.canRedo=qe.prototype.canRedo;qe.prototype.undo=qe.prototype.undo;qe.prototype.canUndo=qe.prototype.canUndo;qe.prototype.getParam=qe.prototype.vz;qe.prototype.getValue=qe.prototype.H;qe.prototype.clear=qe.prototype.clear; var se=new D(qe,"Transaction",-1),re=new D(qe,"Property",0),te=new D(qe,"Insert",1),ue=new D(qe,"Remove",2);qe.className="ChangedEvent";qe.Transaction=se;qe.Property=re;qe.Insert=te;qe.Remove=ue;function ve(){this.u=(new E).freeze();this.Qa="";this.l=!1}ve.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0a.transactionLevel&&wa("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel;d&&b&&a.yb("CommittingTransaction",c,a.currentTransaction);var e=0;if(0a.historyIndex;e--)f=d.L(e),null!==f&&f.clear(),d.jb(e),a.gu=!0;e=a.maxHistoryLength;0<=e&&(0===e?d.clear():d.count>=e&&(f=d.L(0),null!==f&&f.clear(),d.jb(0),a.fe--));0!==e&&(d.add(b),a.fe++);d.freeze();f=b}a.yb("CommittedTransaction",c,f)}else{a.ge=!0;try{a.isEnabled&&null!==f&&(f.isComplete=!0,f.undo())}finally{a.yb("RolledBackTransaction",c,f),a.ge=!1}null!==f&&f.clear()}a.fr=null;return!0}if(a.isEnabled&&!b&&null!==f){a=e;c= f.changes;for(b=c.count-1;b>=a;b--)d=c.L(b),null!==d&&d.undo(),c.ea(),c.jb(b);c.freeze()}return!1}we.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.bu&&(a=a.diagram,null!==a&&!1===a.fk||wa("Change not within a transaction: "+c.toString()))}}; we.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(void 0!==a.layer){if(a=a.layer,null!==a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; ma.Object.defineProperties(we.prototype,{models:{get:function(){return this.mu.iterator}},isEnabled:{get:function(){return this.Lc},set:function(a){this.Lc=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.L(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndexe&&(e=-3),0g&&(g=-3);if(void 0===h||void 0===e||void 0===g||0===e&&0===g||b.shift)!b.shift&&a.allowVerticalScroll?(f=3*f*a.scrollVerticalLineChange,0e||Math.abs(b.y-a.y)>d}; ma.Object.defineProperties(ye.prototype,{diagram:{get:function(){return this.B},set:function(a){a instanceof P&&(this.B=a)}},name:{get:function(){return this.Qa},set:function(a){this.Qa=a}},isEnabled:{get:function(){return this.Lc},set:function(a){this.Lc=a}},isActive:{get:function(){return this.kd},set:function(a){this.kd=a}},transactionResult:{get:function(){return this.nw}, set:function(a){this.nw=a}}});ye.prototype.stopTransaction=ye.prototype.Eg;ye.prototype.startTransaction=ye.prototype.ta;ye.className="Tool";function Na(){ye.call(this);this.name="ToolManager";this.Ic=new E;this.Vc=new E;this.Bf=new E;this.Y=this.Ia=850;this.u=(new Kb(2,2)).ca();this.Za=5E3;this.Ja=Ce;this.I=Ke;this.er=this.l=null;this.Kj=-1}la(Na,ye);Na.prototype.initializeStandardTools=function(){}; Na.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof De&&this.er===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; Na.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===Le&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Me){b.bubbles=!0;return}if(this.gestureBehavior===Le)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var c=this.mouseDownTools.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.ye&&(e=g),h>f&&(f=h))}}Infinity===c?b.h(0,0,0,0):b.h(c,d,e-c,f-d)} function qf(a,b){if(null===a.copiedParts){var c=a.diagram;if((!b||!c.isReadOnly&&!c.isModelReadOnly)&&null!==a.draggedParts){var d=c.undoManager;d.isEnabled&&d.isInTransaction?null!==d.currentTransaction&&0c.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.kg;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=zf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=zf(a,c.i(c.pointsCount-1),!0),null!==h&&(k=h.part));e.isValidLink(g,f,k,h)?b?(c.defaultFromPoint=c.i(0),c.defaultToPoint=c.i(c.pointsCount-1),c.suspendsRouting=!1,c.fromNode=g,null!==f&&(c.fromPortId=f.portId),c.toNode=k,null!==h&&(c.toPortId=h.portId),c.fromPort!== d.Lx&&d.R("LinkRelinked",c,d.Lx),c.toPort!==d.Mx&&d.R("LinkRelinked",c,d.Mx)):Ff(e,g,f,k,h):Ff(e,null,null,null,null)}}}}Qe.prototype.doDragOver=function(){}; function Gf(a,b){var c=a.diagram;a.dragsLink&&wf(a,!0);ff(a);var d=xf(c,b,null,function(b){return!uf(a,b)}),e=c.lastInput;e.targetObject=d;if(null!==d){e.handled=!1;for(var f=d;null!==f;){var g=f.mouseDrop;if(null!==g&&(g(e,f),e.handled))break;Hf(a,e,f);f=yf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==Te){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof U&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!== Te){b=M.alloc();for(d=c.selection.iterator;d.next();)e=d.value,e instanceof U&&If(a,c,e,b);M.free(b)}}}function Hf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof S||(c=a.mouseDrop,null!==c&&c(b))}function If(a,b,c,d){var e=!1;c.getAvoidableRect(d);b.viewportBounds.nf(d)&&(e=!0);b=b.links;for(a=a.copiedParts||a.draggedParts;b.next();){var f=b.value;if(!e||Jf(f))a.contains(f)&&a.contains(c)||!f.Ud(c)&&f.isAvoiding&&ec(f.actualBounds,d,0)&&f.Na()}} Qe.prototype.doDropOnto=function(){};Qe.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,b.documentPoint,b.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(qf(this,!1),We(a,this.copiedParts),sf(this,this.copiedParts,!1),gf(a,this.copiedParts)):this.mayMove()?(kf(this),sf(this,this.draggedParts,!0)):this.mayDragOut()?(qf(this,!1),sf(this,this.copiedParts,!1)):kf(this),vf(this,a.lastInput.documentPoint))}}; Qe.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(kf(this),qf(this,!0),We(a,this.copiedParts),sf(this,this.copiedParts,!1),gf(a,this.copiedParts),null!==this.copiedParts&&(a.R("ChangingSelection",a.selection),Se(a),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,kf(this),this.mayMove()&&(sf(this,this.draggedParts,!0), vf(this,a.lastInput.documentPoint)));this.wn=!0;Gf(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Af():this.draggedParts.Af();this.copiedParts=null;b&&Kf(this);a.Ta();gf(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.R(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.R("ChangedSelection",a.selection)}}}; Qe.prototype.simulatedMouseMove=function(a,b,c){if(null===Te)return!1;var d=Te.diagram;c instanceof P||(c=null);var e=Xe;c!==e&&(null!==e&&e!==d&&(e.zf(),Te.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),Xe=c,null!==c&&c!==d&&(nf(),e=c.toolManager.findTool("Dragging"),null!==e&&(hf.contains(e)||hf.add(e),e.doSimulatedDragEnter())));if(null===c||c===d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging");null!==d&&(null!== a&&(void 0!==a.targetTouches&&(0=d&&(d=.1);var e=this,f=b.xg(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof U){var k=g.ga(Bc,H.alloc()),l=c.x-k.x,m=c.y-k.y;H.free(k);k=l*l+m*m;kc){if(null!==this.originalLink&&a===this.originalFromNode&&b===this.originalFromPort)return!0;b=b.portId;null===b&&(b="");if(a.$p(b).count>=c)return!1}return!0}; Nf.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.toLinkable))return!1;var c=b.toMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalToNode&&b===this.originalToPort)return!0;b=b.portId;null===b&&(b="");if(a.td(b).count>=c)return!1}return!0}; Nf.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;a=a.part;b=b.part;return null!==a&&a===b};Nf.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof U))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof U))return!1;b=b.portId;null===b&&(b="");for(b=d.td(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Nf.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.fromLinkableSelfNode&&d.toLinkableSelfNode||!this.isInSameNode(b,d))&&(b.fromLinkableDuplicates&&d.toLinkableDuplicates||!this.isLinked(b,d)))||null!==this.originalLink&&(null!==a&&this.isLabelDependentOnLink(a,this.originalLink)||null!==c&&this.isLabelDependentOnLink(c,this.originalLink))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a, c,this.originalLink))return!1;if(null!==a){var e=a.linkValidation;if(null!==e&&!e(a,b,c,d,this.originalLink))return!1}if(null!==c&&(e=c.linkValidation,null!==e&&!e(a,b,c,d,this.originalLink)))return!1;e=this.linkValidation;return null!==e?e(a,b,c,d,this.originalLink):!0};Nf.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.labeledLink;if(null===c)return!1;if(c===b)return!0;var d=new F;d.add(a);return Of(this,c,b,d)}; function Of(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Of(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Of(a,b.labeledLink,c,d))?!0:!1} Nf.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.isUnconnectedLinkValid;var d=this.diagram.validCycle;if(d!==Pf){if(d===Qf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=b.linksConnected;d.next();){var e=d.value;if(e!==c&&e.isTreeLink&&e.toNode===b)return!1}return!Rf(this,a,b,c,!0)}if(d===Sf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=a.linksConnected;d.next();)if(e=d.value,e!==c&&e.isTreeLink&&e.fromNode=== a)return!1;return!Rf(this,a,b,c,!0)}if(d===Tf)return a===b?a=!0:(d=new F,d.add(b),a=Uf(this,d,a,b,c)),!a;if(d===Vf)return!Rf(this,a,b,c,!1);if(d===Wf)return a===b?a=!0:(d=new F,d.add(b),a=Xf(this,d,a,b,c)),!a}return!0};function Rf(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.linksConnected;f.next();){var g=f.value;if(g!==d&&(!e||g.isTreeLink)&&g.toNode===b&&(g=g.fromNode,g!==b&&Rf(a,g,c,d,e)))return!0}return!1} function Uf(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.linksConnected;f.next();){var g=f.value;if(g!==e&&g.toNode===c&&(g=g.fromNode,g!==c&&Uf(a,b,g,d,e)))return!0}return!1}function Xf(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.linksConnected;f.next();){var g=f.value;if(g!==e){var h=g.fromNode;g=g.toNode;h=h===c?g:h;if(h!==c&&Xf(a,b,h,d,e))return!0}}return!1} ma.Object.defineProperties(Nf.prototype,{portGravity:{get:function(){return this.Bf},set:function(a){0<=a&&(this.Bf=a)}},isUnconnectedLinkValid:{get:function(){return this.Y},set:function(a){this.Y=a}},linkingCursor:{get:function(){return this.$h},set:function(a){this.$h=a}},temporaryLink:{get:function(){return this.Km},set:function(a){this.Km=a}},temporaryFromNode:{ get:function(){return this.Im},set:function(a){this.Im=a}},temporaryFromPort:{get:function(){return this.Jm},set:function(a){this.Jm=a}},temporaryToNode:{get:function(){return this.Hq},set:function(a){this.Hq=a}},temporaryToPort:{get:function(){return this.mw},set:function(a){this.mw=a}},originalLink:{get:function(){return this.Za},set:function(a){this.Za=a}},originalFromNode:{ get:function(){return this.Ia},set:function(a){this.Ia=a}},originalFromPort:{get:function(){return this.Ja},set:function(a){this.Ja=a}},originalToNode:{get:function(){return this.Ic},set:function(a){this.Ic=a}},originalToPort:{get:function(){return this.Vc},set:function(a){this.Vc=a}},isForwards:{get:function(){return this.I},set:function(a){this.I=a}},validPortsCache:{ get:function(){return this.iy}},targetPort:{get:function(){return this.dj},set:function(a){this.dj=a}},linkValidation:{get:function(){return this.ri},set:function(a){this.ri=a}},portTargeted:{get:function(){return this.Ih},set:function(a){this.Ih=a}}});Nf.className="LinkingBaseTool";function Yf(){Nf.call(this);this.name="Linking";this.u={};this.l=null;this.J=Zf;this.De=null}la(Yf,Nf); Yf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.ht()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:null!==this.findLinkablePort()}; Yf.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null===b&&(b=a.Sb(a.firstInput.documentPoint,null,null));if(null===b||!(b.part instanceof U))return null;a=this.direction;if(a===Zf||a===$f){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.isForwards=!0,c}if(a===Zf||a===ag)if(b=this.findValidLinkablePort(b,!0),null!==b)return this.isForwards=!1,b;return null}; Yf.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null!==b&&(this.ta(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null===this.temporaryToNode||this.temporaryToNode.location.v()||(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof U&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort, !1)):(null===this.temporaryFromNode||this.temporaryFromNode.location.v()||(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof U&&(this.originalToNode=b),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),null!==this.temporaryLink&&(null!==this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode), null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.Na(),a.add(this.temporaryLink)),this.isActive=!0)};Yf.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.Eg()};Yf.prototype.doStop=function(){Nf.prototype.doStop.call(this);this.startObject=null}; Yf.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.transactionResult=null,c=null,d=null,e=null,f=null;try{var g=this.targetPort=this.findTargetPort(this.isForwards);if(null!==g){var h=g.part;h instanceof U&&(this.isForwards?(null!==this.originalFromNode&&(b=this.originalFromNode,c=this.originalFromPort),d=h,e=g):(b=h,c=g,null!==this.originalToNode&&(d=this.originalToNode,e=this.originalToPort)))}else this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&& (b=this.originalFromNode,c=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(d=this.originalToNode,e=this.originalToPort);null!==b||null!==d?(f=this.insertLink(b,c,d,e),null!==f?(null===g&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint:f.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),f.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",f)):(a.model.Uu(),this.doNoLink(b,c,d,e))):this.isForwards? this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),f&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}};Yf.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null===a)return!0;if(a instanceof Q)return a.isTreeLink;var b=this.diagram;if(null===b)return!0;a=b.partManager.getLinkCategoryForData(a);b=b.partManager.findLinkTemplateForCategory(a);return null!==b?b.isTreeLink:!0}; Yf.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};Yf.prototype.doNoLink=function(){}; ma.Object.defineProperties(Yf.prototype,{archetypeLinkData:{get:function(){return this.u},set:function(a){this.u=a}},archetypeLabelNodeData:{get:function(){return this.l},set:function(a){this.l=a}},direction:{get:function(){return this.J},set:function(a){this.J=a}},startObject:{get:function(){return this.De},set:function(a){this.De=a}}}); var Zf=new D(Yf,"Either",0),$f=new D(Yf,"ForwardsOnly",0),ag=new D(Yf,"BackwardsOnly",0);Yf.className="LinkingTool";Yf.Either=Zf;Yf.ForwardsOnly=$f;Yf.BackwardsOnly=ag; function Ye(){Nf.call(this);this.name="Relinking";var a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.u=a;a=new W;a.figure="Diamond";a.desiredSize=Ob;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.De=a;this.l=null;this.Pw=new M}la(Ye,Nf); Ye.prototype.updateAdornments=function(a){if(null!==a&&a instanceof Q){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly){var d=a.selectionObject;null!==d&&a.canRelinkFrom()&&a.actualBounds.v()&&a.isVisible()&&d.actualBounds.v()&&d.vf()&&(c=a.ak(b),null===c&&(c=this.makeAdornment(d,!1),a.xh(b,c)))}null===c&&a.xf(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!==d&&a.canRelinkTo()&&a.actualBounds.v()&&a.isVisible()&&d.actualBounds.v()&&d.vf()&& (c=a.ak(b),null===c?(c=this.makeAdornment(d,!0),a.xh(b,c)):c.o()));null===c&&a.xf(b)}};Ye.prototype.makeAdornment=function(a,b){var c=new De;c.type=X.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!==b&&c.add(b.copy());c.adornedObject=a;return c}; Ye.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.ht()||!a.lastInput.left)return!1;var b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"));return null!==b}; Ye.prototype.doActivate=function(){var a=this.diagram;if(null===this.originalLink){var b=this.handle;null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")));if(null===b)return;var c=b.part;if(!(c instanceof De&&c.adornedPart instanceof Q))return;this.handle=b;this.isForwards=null===c||"RelinkTo"===c.category;this.originalLink=c.adornedPart}this.ta(this.name);a.isMouseCaptured=!0;a.currentCursor=this.linkingCursor; this.originalFromPort=this.originalLink.fromPort;this.originalFromNode=this.originalLink.fromNode;this.originalToPort=this.originalLink.toPort;this.originalToNode=this.originalLink.toNode;this.Pw.set(this.originalLink.actualBounds);null!==this.originalLink&&0b.firstPickIndex+1&&c=c.x)b=0>=c.y?b+225:1<=c.y?b+135:b+180;else if(1<=c.x)0>=c.y?b+=315:1<=c.y&&(b+=45);else if(0>=c.y)b+=270;else if(1<=c.y)b+=90;else break a;0>b?b+=360:360<=b&&(b-=360);a.cursor=22.5>b?"e-resize":67.5>b?"se-resize":112.5>b?"s-resize":157.5>b?"sw-resize":202.5>b?"w-resize":247.5>b?"nw-resize":292.5>b?"n-resize":337.5>b?"ne-resize": "e-resize"}else if(a instanceof X)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};xg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; xg.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(this.zl.set(this.adornedObject.ga(this.handle.alignment.Av())),this.Mo.set(this.adornedObject.part.location),this.Ow.set(this.adornedObject.desiredSize),this.Yt=this.computeCellSize(),this.$t=this.computeMinSize(),this.Zt=this.computeMaxSize(),a.isMouseCaptured= !0,this.Lw=a.animationManager.isEnabled,a.animationManager.isEnabled=!1,this.ta(this.name),this.isActive=!0))};xg.prototype.doDeactivate=function(){var a=this.diagram;this.Eg();this.Zd=this.handle=null;this.isActive=a.isMouseCaptured=!1;a.animationManager.isEnabled=this.Lw};xg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()}; xg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.$t,c=this.Zt,d=this.Yt,e=this.adornedObject.$s(a.lastInput.documentPoint,H.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.ud();H.free(e)}}; xg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.$t,c=this.Zt,d=this.Yt,e=this.adornedObject.$s(a.lastInput.documentPoint,H.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);H.free(e);a.Ta();this.transactionResult=this.name;a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; xg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject,d=c.part;c.desiredSize=a.size;d.zb();a=this.adornedObject.ga(this.handle.alignment.Av());d instanceof S?(c=new E,c.add(d),b.moveParts(c,this.zl.copy().Xd(a),!0)):d.location=d.location.copy().Xd(a).add(this.zl)}; xg.prototype.computeResize=function(a,b,c,d,e,f){b.jc()&&(b=Bc);var g=this.adornedObject.naturalBounds,h=g.x,k=g.y,l=g.x+g.width,m=g.y+g.height,n=1;if(!f){n=g.width;var p=g.height;0>=n&&(n=1);0>=p&&(p=1);n=p/n}p=H.alloc();I.aq(a.x,a.y,h,k,e.width,e.height,p);a=g.copy();0>=b.x?0>=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n* a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width,a.y=m-a.height)):1<=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width)):(a.x= Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=l-a.x,f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width), a.y=m-a.height)):1<=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width))):(a.width=Math.max(Math.min(p.x-h,d.width),c.width),f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):0>=b.y?(a.y=Math.max(p.y,m-d.height), a.y=Math.min(a.y,m-c.height),a.height=m-a.y,f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width))):1<=b.y&&(a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width)));H.free(p);return a};xg.prototype.computeReshape=function(){var a=Ag;this.adornedObject instanceof W&&(a=Bg(this.adornedObject));return!(a===Cg||this.diagram.lastInput.shift)}; xg.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),b=this.minSize;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};xg.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.widthc?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0===c?b.x=a.naturalBounds.width+d:45===c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90===c?b.y=a.naturalBounds.height+d:135===c?(b.x=-d,b.y=a.naturalBounds.height+d):180===c?b.x=-d:225===c?(b.x=-d,b.y=-d):270===c?b.y=-d:315===c&&(b.x=a.naturalBounds.width+ d,b.y=-d);return a.ga(b)};Dg.prototype.doDeactivate=function(){var a=this.diagram;this.Eg();this.Zd=this.handle=null;this.wu=new H(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Dg.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()};Dg.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))}; Dg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Ta();this.transactionResult=this.name;a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()};Dg.prototype.rotate=function(a){var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.zb();var c=b.locationObject,d=b.rotateObject;if(c===d||c.Ag(d))c=this.Mo.copy(),b.location=c.Xd(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint)}}; Dg.prototype.computeRotate=function(a){a=this.rotationPoint.Sa(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.Ri());360<=a?a-=360:0>a&&(a+=360);b=Math.min(Math.abs(this.snapAngleMultiple),180);var c=Math.min(Math.abs(this.snapAngleEpsilon),b/2);!this.diagram.lastInput.shift&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a}; ma.Object.defineProperties(Dg.prototype,{handleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},handle:{get:function(){return this.l},set:function(a){if(null!==a&&!(a.part instanceof De))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{get:function(){return this.Zd},set:function(a){if(null!==a&&a.part instanceof De)throw Error("new handle must not be in an Adornment: "+ a);this.Zd=a}},snapAngleMultiple:{get:function(){return this.Ja},set:function(a){this.Ja=a}},snapAngleEpsilon:{get:function(){return this.Ia},set:function(a){this.Ia=a}},originalAngle:{get:function(){return this.Nw}},rotationPoint:{get:function(){return this.wu}},handleAngle:{get:function(){return this.I},set:function(a){this.I=a}},handleDistance:{ get:function(){return this.Y},set:function(a){this.Y=a}}});Dg.className="RotatingTool";La("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.Va("Rotating",a,this.mouseDownTools)});function Eg(){ye.call(this);this.name="ClickSelecting"}la(Eg,ye);Eg.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0}; Eg.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};Eg.className="ClickSelectingTool";function Fg(){ye.call(this);this.name="Action";this.wk=null}la(Fg,ye); Fg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.Sb(b.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a});if(null!==c){if(!c.isActionable)return!1;this.wk=c;a.Kk=a.Sb(b.documentPoint,null,null);return!0}return!1};Fg.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.wk;null!==b&&(a.targetObject=b,null!==b.actionDown&&b.actionDown(a,b))}else this.canStart()&&this.doActivate()}; Fg.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.wk;null!==b&&(a.targetObject=b,null!==b.actionMove&&b.actionMove(a,b))}};Fg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.wk;if(null===b)return;a.targetObject=b;null!==b.actionUp&&b.actionUp(a,b);this.standardMouseClick(function(a){for(;null!==a.panel&&(!a.isActionable||a!==b);)a=a.panel;return a},function(a){return a===b})}this.stopTool()}; Fg.prototype.doCancel=function(){var a=this.diagram.lastInput,b=this.wk;null!==b&&(a.targetObject=b,null!==b.actionCancel&&b.actionCancel(a,b),this.stopTool())};Fg.prototype.doStop=function(){this.wk=null};Fg.className="ActionTool";function Gg(){ye.call(this);this.name="ClickCreating";this.ej=null;this.u=!0;this.l=!1;this.Ew=new H(0,0)}la(Gg,ye); Gg.prototype.canStart=function(){if(!this.isEnabled||null===this.archetypeNodeData)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1===a.lastInput.clickCount&&(this.Ew=a.lastInput.viewPoint.copy()),2!==a.lastInput.clickCount||this.isBeyondDragSize(this.Ew))return!1}else if(1!==a.lastInput.clickCount)return!1;return a.currentTool!==this&&null!==a.em(a.lastInput.documentPoint,!0)?!1:!0}; Gg.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint);this.stopTool()}; Gg.prototype.insertPart=function(a){var b=this.diagram,c=this.archetypeNodeData;if(null===c)return null;var d=null;try{b.R("ChangingSelection",b.selection);this.ta(this.name);if(c instanceof T)c.Ub()&&(zg(c),d=c.copy(),null!==d&&b.add(d));else if(null!==c){var e=b.model.copyNodeData(c);ya(e)&&(b.model.kf(e),d=b.vc(e))}if(null!==d){var f=H.allocAt(a.x,a.y);this.isGridSnapEnabled&&Hg(this.diagram,d,a,f);d.location=f;b.allowSelect&&(Se(b),d.isSelected=!0);H.free(f)}b.Ta();this.transactionResult=this.name; b.R("PartCreated",d)}finally{this.Eg(),b.R("ChangedSelection",b.selection)}return d};ma.Object.defineProperties(Gg.prototype,{archetypeNodeData:{get:function(){return this.ej},set:function(a){this.ej=a}},isDoubleClick:{get:function(){return this.u},set:function(a){this.u=a}},isGridSnapEnabled:{get:function(){return this.l},set:function(a){this.l=a}}});Gg.className="ClickCreatingTool"; function Ig(){ye.call(this);this.name="DragSelecting";this.Rk=175;this.u=!1;var a=new T;a.layerName="Tool";a.selectable=!1;var b=new W;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.l=a}la(Ig,ye); Ig.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.timestamp-a.firstInput.timestampe.right&&(c.x-=d.width+5/b.scale);c.xe.bottom&&(c.y-=d.height+5/b.scale);c.ya.lastInput.clickCount?!1:!0};Wg.prototype.doStart=function(){this.isActive||null===this.textBlock||this.doActivate()}; Wg.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.Sb(a.lastInput.documentPoint));if(null!==b&&b instanceof Xg&&(this.textBlock=b,null!==b.part)){this.isActive=!0;this.ia=ch;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.rh=this.textBlock.copy();var d=new M(this.textBlock.ga(xc),this.textBlock.ga(Hc));a.Ov(d);c.show(b,a,this);this.currentTextEditor=c}}}};Wg.prototype.doCancel=function(){this.stopTool()}; Wg.prototype.doMouseUp=function(){!this.isActive&&this.canStart()&&this.doActivate()};Wg.prototype.doMouseDown=function(){this.isActive&&this.acceptText(gh)}; Wg.prototype.acceptText=function(a){switch(a){case gh:if(this.ia===hh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.ia===ch||this.ia===eh||this.ia===dh)this.ia=ih,rh(this);break;case sh:case ah:case bh:if(ah!==a||!0!==this.textBlock.isMultiline)if(this.ia===ch||this.ia===eh||this.ia===dh)this.ia=ih,rh(this)}}; function rh(a){var b=a.textBlock,c=a.diagram,d=a.currentTextEditor;if(null!==b&&null!==d){var e=b.text,f="";null!==d.valueFunction&&(f=d.valueFunction());if(a.isValidText(b,e,f))a.ta(a.name),a.ia=hh,a.transactionResult=a.name,b.text=f,d=a.textBlock,null!==d.textEdited&&d.textEdited(d,e,f),null!==c&&c.R("TextEdited",b,e),a.Eg(),a.stopTool(),null!==c&&c.doFocus();else{a.ia=eh;var g=a.textBlock;null!==g.errorFunction&&g.errorFunction(a,e,f);d.show(b,c,a)}}} Wg.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.ia=Zg,this.textBlock=null,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.isActive=!1)};Wg.prototype.isValidText=function(a,b,c){var d=this.textValidation;if(null!==d&&!d(a,b,c))return!1;d=a.textValidation;return null===d||d(a,b,c)?!0:!1};Wg.prototype.Kx=function(a){var b=this.rh;b.text=a;b.measure(this.textBlock.mi,Infinity);return b}; ma.Object.defineProperties(Wg.prototype,{textBlock:{get:function(){return this.Ja},set:function(a){this.Ja=a}},currentTextEditor:{get:function(){return this.u},set:function(a){this.u=a}},defaultTextEditor:{get:function(){return this.l},set:function(a){this.l=a}},starting:{get:function(){return this.Ia},set:function(a){this.Ia=a}},textValidation:{get:function(){return this.Di}, set:function(a){this.Di=a}},minimumEditorScale:{get:function(){return this.I},set:function(a){this.I=a}},selectsTextOnActivate:{get:function(){return this.Y},set:function(a){this.Y=a}},state:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}}});Wg.prototype.measureTemporaryTextBlock=Wg.prototype.Kx; var sh=new D(Wg,"LostFocus",0),gh=new D(Wg,"MouseDown",1),bh=new D(Wg,"Tab",2),ah=new D(Wg,"Enter",3),th=new D(Wg,"SingleClick",0),Yg=new D(Wg,"SingleClickSelected",1),fh=new D(Wg,"DoubleClick",2),Zg=new D(Wg,"StateNone",0),ch=new D(Wg,"StateActive",1),dh=new D(Wg,"StateEditing",2),ih=new D(Wg,"StateValidating",3),eh=new D(Wg,"StateInvalid",4),hh=new D(Wg,"StateValidated",5);Wg.className="TextEditingTool";Wg.LostFocus=sh;Wg.MouseDown=gh;Wg.Tab=bh;Wg.Enter=ah;Wg.SingleClick=th; Wg.SingleClickSelected=Yg;Wg.DoubleClick=fh;Wg.StateNone=Zg;Wg.StateActive=ch;Wg.StateEditing=dh;Wg.StateValidating=ih;Wg.StateInvalid=eh;Wg.StateValidated=hh;La("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.Va("TextEditing",a,this.mouseUpTools)}); function uh(){vh||(wh(),vh=!0);this.B=ze;this.dl=this.Ve=this.ic=this.Kr=this.gc=!1;this.$w=!0;this.el=xh;this.ii=this.Lc=!0;this.Rg=600;this.tw=this.Zw=!1;this.Fe=new F;this.zd=new yh;this.zd.zc=this;this.xk=new F;this.Eu=new F;this.Fs=new F}uh.prototype.Wd=function(a){this.B=a};uh.prototype.canStart=function(){return!0};function zh(a,b){Ah(a,b)&&(a.Ve=!0)}function Ah(a,b){if(!a.Lc||!a.canStart(b))return!1;a.Fe.add(b);a.defaultAnimation.isAnimating&&a.Uc();return a.ic=!0} function Bh(a){if(a.Lc&&a.ic){var b=a.zd,c=a.B,d=a.Fe.contains("Model");d&&(a.dl=!0,a.el===xh?(b.isViewportUnconstrained=!0,b.qc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.el===Ch&&b.qc.clear(),c.R("InitialAnimationStarting",a));d&&!a.ii||0===b.qc.count?(a.Fe.clear(),a.ic=!1,a.Ve=!1,b.qc.clear(),Dh(b),a.dl=!1,c.N()):(a.Fe.clear(),c.cd=!1,x.requestAnimationFrame(function(){!1===a.ic||b.gc||(c.xe("temporaryPixelRatio")&&Ve(c),Eh(c),a.ic=!1,a.Ve= !1,a.$w=d&&a.el===Fh&&c.Rw.A(c.la)?!0:!1,b.start(),Gh(a),c.Ta(),Hh(b,0),Lf(c,!0),Ih(a),c.R("AnimationStarting",a))}))}}function Jh(a,b,c,d){b instanceof Q&&(null!==b.fromNode||null!==b.toNode)||a.zd.add(b,"position",c,d,!1)}t=uh.prototype;t.pt=function(a){return this.zd.pt(a)};t.sv=function(a){return this.zd.sv(a)}; function Kh(a,b){function c(){0a&&va(a,">= 1",uh,"duration");this.Rg=a}},isAnimating:{get:function(){return this.gc}},isTicking:{get:function(){return this.Kr}},isInitial:{ get:function(){return this.ii},set:function(a){this.ii=a}},defaultAnimation:{get:function(){return this.zd}},activeAnimations:{get:function(){return this.xk}},initialAnimationStyle:{get:function(){return this.el},set:function(a){this.el=a}}});uh.prototype.stopAnimation=uh.prototype.Uc;var Th=null,vh=!1,xh=new D(uh,"Default",1),Fh=new D(uh,"AnimateLocations",2),Ch=new D(uh,"None",3); uh.className="AnimationManager";uh.defineAnimationEffect=function(a,b){vh||(wh(),vh=!0);Th.add(a,b)};uh.Default=xh;uh.AnimateLocations=Fh;uh.None=Ch;function yh(){this.Ku=this.Yw=this.zc=this.B=null;this.ll=this.gc=this.l=!1;this.Bn=this.rd=0;this.dr=this.Xt=Uh;this.kl=this.$o=!1;this.yu=1;this.vu=0;this.md=this.Rg=NaN;this.ww=0;this.Cn=null;this.u=Fb;this.qc=new G;this.ou=new G;this.Tl=new F;this.pu=new F;this.uw=Vh}yh.prototype.suspend=function(){this.ll=!0}; yh.prototype.advanceTo=function(a,b){b&&(this.ll=!1);this.$o&&a>=this.md&&(this.kl=!0,a-=this.md);this.ww=a;Lh(this,!0);Gh(this.zc);Lf(this.B);Ih(this.zc);this.B.wf()};function Dh(a){a.ou.clear();a.kl=!1;a.vu=0;a.md=NaN;0a.Bn?a.md:d-a.rd;b&&(e=a.ww,ea.Bn&&(a.$o&&!a.kl?(a.rd=+new Date,a.Bn=a.rd+a.md,a.kl=!0):a.bm(!1))}}} function Hh(a,b){for(var c=a.md,d=a.qc.iterator,e=a.kl;d.next();){var f=d.key;if(!(f instanceof Y&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=Th,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:node"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.dr,b,c,a)}}}t.stop=function(){this.gc&&this.bm(!0)}; t.bm=function(a){null!==this.Ku&&this.Ku.jp.remove(this.Yw);if(this.gc){var b=this.B,c=this.zc;this.ll=this.gc=c.dl=!1;Gh(c);for(var d=this.qc,e=this.Tl.iterator;e.next();)b.remove(e.value);for(e=this.pu.iterator;e.next();)e.value.o();e=this.$o;d=d.iterator;for(var f=Th;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.cv,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Yu||"position:node"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]:h.Yu?k[n]: l[n],this.dr,this.md,this.md,this)}h.Yu&&void 0!==m.location&&g instanceof T&&(g.location=m.location);h.Fv&&g instanceof T&&g.Nb(!1)}if(c.defaultAnimation===this)for(n=this.B.links;n.next();)e=n.value,null===e.jh?(d=e.path,null!==d&&(e.yc=!1,e.o(),d.o())):(e.points=e.jh,e.jh=null);b.kt.clear();lf(b,!1);b.Ta();b.N();Lf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.uw);Ih(c);this.vu++;!a&&this.yu>this.vu?(this.kl=!1,this.start()):(this.Cn&&this.Cn(this),Dh(this),c.bm(this),b.Xb())}}; t.Pj=function(a,b){var c=b.actualBounds,d=null;b instanceof S&&(d=b.placeholder);null!==d?(c=d.ga(xc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new H(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof S)for(a=a.memberParts;a.next();)d=a.value,d instanceof U&&this.Pj(d,b)}; t.Nj=function(a,b){if(a.isVisible()){var c=null;b instanceof S&&(c=b.placeholder);null!==c?this.add(a,"position:placeholder",a.position,c,!0):this.add(a,"position:node",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);c=this.qc;c.contains(a)&&(c.H(a).Fv=!0);if(a instanceof S)for(a=a.memberParts;a.next();)c=a.value,c instanceof U&&this.Nj(c,b)}};t.wz=function(a){var b=this.ou.get(a);null===b&&(b={},this.ou.add(a,b));return b}; ma.Object.defineProperties(yh.prototype,{duration:{get:function(){return this.Rg},set:function(a){1>a&&va(a,">= 1",yh,"duration");this.Rg=a}},reversible:{get:function(){return this.$o},set:function(a){this.$o=a}},runCount:{get:function(){return this.yu},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function Wh(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}yh.className="Animation";yh.EaseLinear=function(a,b,c,d){return c*a/d+b};yh.EaseInOutQuad=Uh;yh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};yh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};yh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};yh.EaseOutExpo=Wh; function Zh(a,b,c){this.start=a;this.end=b;this.cv={};this.Yu=c;this.Fv=!1}Zh.className="AnimationState";function $h(a,b,c){this.bd=null;this.Ye=a;this.Cp=c||ai;this.Bk=null;void 0!==b&&(this.Bk=b,void 0===c&&(this.Cp=bi))}$h.prototype.copy=function(){var a=new $h(this.Ye);a.Cp=this.Cp;var b=this.Bk;if(null!==b){var c={};void 0!==b.duration&&(c.wx=b.duration);void 0!==b.finished&&(c.wx=b.finished);void 0!==b.easing&&(c.wx=b.easing);a.Bk=c}return a}; function ci(a,b){a=a.Bk;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))}ma.Object.defineProperties($h.prototype,{propertyName:{get:function(){return this.Ye},set:function(a){this.Ye=a}},animationSettings:{get:function(){return this.Bk},set:function(a){this.Bk=a}},startCondition:{get:function(){return this.Cp},set:function(a){this.Cp=a}}}); var ai=new D($h,"Default",1),bi=new D($h,"Immediate",2),di=new D($h,"Bundled",3);$h.className="AnimationTrigger";$h.Default=ai;$h.Immediate=bi;$h.Bundled=di;function ei(){Za(this);this.B=null;this.Ca=new E;this.Qa="";this.ob=1;this.u=!1;this.Ej=this.I=this.Uh=this.Th=this.Sh=this.Rh=this.Ph=this.Qh=this.Oh=this.Wh=this.Nh=this.Vh=this.Mh=this.Lh=!0;this.l=!1;this.No=[]}t=ei.prototype;t.clear=function(){this.Ca.clear();this.No.length=0};t.Wd=function(a){this.B=a}; t.toString=function(a){void 0===a&&(a=0);var b='Layer "'+this.name+'"';if(0>=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ca.iterator;h.next();){var k=h.value;k instanceof S?e++:k instanceof U?d++:k instanceof Q?f++:k instanceof De?g++:c++}h="";0b.ke||l.height*g>b.ke?k.tb(a,b):ii(a,k)}}a.globalAlpha=e}}}; function ii(a,b){var c=b.actualBounds,d=b.naturalBounds;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)&&b.isVisible()){var e=b.transform;null!==b.areaBackground&&(ji(b,a,b.areaBackground,!0,!0,d,c),a.fillRect(c.x,c.y,c.width,c.height));null===b.areaBackground&&null===b.background&&(ji(b,a,"rgba(0,0,0,0.3)",!0,!1,d,c),a.fillRect(c.x,c.y,c.width,c.height));null!==b.background&&(a.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),ji(b,a,b.background,!0,!1,d,c),a.fillRect(0,0,d.width/2,d.height/2), e.gt()||(b=1/(e.m11*e.m22-e.m12*e.m21),a.transform(e.m22*b,-e.m12*b,-e.m21*b,e.m11*b,b*(e.m21*e.dy-e.m22*e.dx),b*(e.m12*e.dx-e.m11*e.dy))))}}t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.Ya(re,a,this,b,c,d,e)};t.Vi=function(a,b,c){var d=this.Ca;b.ni=this;if(a>=d.count)a=d.count;else if(d.L(a)===b)return-1;d.Kb(a,b);b.gq(c);d=this.diagram;null!==d&&(c?d.N():d.Vi(b));ki(this,a,b);return a}; t.Fc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.Fc(a,b,c);var d=this.Ca;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.L(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.hq(c);d.jb(a);d=this.diagram;null!==d&&(c?d.N():d.Fc(b));b.ni=null;return a}; function ki(a,b,c){b=li(a,b,c);if(c instanceof S&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ca.j,f=e.length,g=0;gd&&h.containingGroup===c&&(d=g,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,g=NaN;0<=f;){g=a.L(f).zOrder;if(!isNaN(g))break;f--}for(var h=b+1,k=NaN;hd)for(;;){if(-1===f||g<=d){f++;if(f===b)break;a.jb(b);a.Kb(f,c);return f}for(g=NaN;0<=--f&&(g=a.L(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k=d){h--;if(h===b)break;a.jb(b);a.Kb(h,c);return h}for(k=NaN;++h< e&&(k=a.L(h).zOrder,isNaN(k)););}return b} ma.Object.defineProperties(ei.prototype,{parts:{get:function(){return this.Ca.iterator}},partsBackwards:{get:function(){return this.Ca.iteratorBackwards}},diagram:{get:function(){return this.B}},name:{get:function(){return this.Qa},set:function(a){var b=this.Qa;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&B("Cannot rename default Layer to: "+a),c=c.layers;c.next();)c.value.name=== a&&B("Layer.name is already present in this diagram: "+a);this.Qa=a;this.g("name",b,a);for(a=this.Ca.iterator;a.next();)a.value.layerName=this.Qa}}},opacity:{get:function(){return this.ob},set:function(a){var b=this.ob;b!==a&&((0>a||1=a)return b;for(var c=this.Ka.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b};P.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,d)}; P.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,d)}; function Mi(a){var b=a.Ba.Da;b instanceof HTMLCanvasElement&&(a.Rq?(a.addEventListener(b,"pointerdown",a.nm,!1),a.addEventListener(b,"pointermove",a.om,!1),a.addEventListener(b,"pointerup",a.qm,!1),a.addEventListener(b,"pointerout",a.pm,!1)):(a.addEventListener(b,"touchstart",a.aw,!1),a.addEventListener(b,"touchmove",a.$v,!1),a.addEventListener(b,"touchend",a.Zv,!1),a.addEventListener(b,"mousemove",a.kk,!1),a.addEventListener(b,"mousedown",a.jk,!1),a.addEventListener(b,"mouseup",a.mk,!1),a.addEventListener(b, "mouseout",a.lk,!1)),a.addEventListener(b,"mouseenter",a.Ty,!1),a.addEventListener(b,"mouseleave",a.Uy,!1),a.addEventListener(b,"wheel",a.nk,!1),a.addEventListener(b,"keydown",a.Mz,!1),a.addEventListener(b,"keyup",a.Nz,!1),a.addEventListener(b,"blur",a.Gy,!1),a.addEventListener(b,"focus",a.Hy,!1),a.addEventListener(b,"selectstart",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"contextmenu",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"gesturestart",function(b){a.toolManager.gestureBehavior!== Me&&(a.toolManager.gestureBehavior===Le?b.preventDefault():a.Pe&&a.lastInput.handled||(b.preventDefault(),a.Lo=a.scale,a.currentTool.doCancel()))},!1),a.addEventListener(b,"gesturechange",function(b){if(a.toolManager.gestureBehavior!==Me)if(a.toolManager.gestureBehavior===Le)b.preventDefault();else if(!a.Pe||!a.lastInput.handled){b.preventDefault();var c=b.scale;if(null!==a.Lo){var e=a.Ba.getBoundingClientRect();b=new H(b.pageX-window.scrollX-a.va/e.width*e.left,b.pageY-window.scrollY-a.ua/e.height* e.top);c=a.Lo*c;e=a.commandHandler;if(c!==a.scale&&e.canResetZoom(c)){var f=a.zoomPoint;a.zoomPoint=b;e.resetZoom(c);a.zoomPoint=f}}}},!1),a.addEventListener(x,"resize",a.gw,!1))}function Ve(a){30p&&(this.position=q.h(-(this.ss.scrollWidth-this.va)+u-this.va/c+k,this.position.y))),a.oy&&this.allowVerticalScroll&&(fr&&(this.position=q.h(this.position.x, -(this.ss.scrollHeight-this.ua)+a.scrollTop-this.ua/c+d))),H.free(q),Ri(this),this.oj=this.qs=!1,b=this.documentBounds,c=this.viewportBounds,k=b.right,p=c.right,d=b.bottom,r=c.bottom,e=b.x,l=c.x,f=b.y,b=c.y,m>=g&&e>=l&&k<=p&&(this.lp.style.width="1px"),n>=h&&f>=b&&d<=r&&(this.lp.style.height="1px"))}};P.prototype.computeBounds=function(){0c&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===aj?(b=k>h?(g-a.qb)/d:(f-a.qb)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} P.prototype.zoomToFit=function(){var a=this.Ai;this.Ai=Vh;this.scale=Vi(this,$i);a!==Vh&&(Ui(this,!1),Wi(this,this.documentBounds,this.va/this.ya,this.ua/this.ya,this.gj,!1));this.Ai=a};t=P.prototype; t.tA=function(a,b){void 0===b&&(b=$i);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===$i||b===aj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.va;var f=this.ua;e=b===aj?f/d>e/c?(f-(this.Ne?this.qb:0))/d:(e-(this.Rf?this.qb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new H(a.x,a.y)}}; t.By=function(a,b){Zi(this);var c=this.documentBounds,d=this.viewportBounds;this.position=new H(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))};t.oz=function(a){if(a instanceof Y){this.ur=a;var b=H.alloc();this.vr=this.Cq(a.ga(xc,b));H.free(b)}else this.ur=null,this.vr=Jb}; function Wi(a,b,c,d,e,f){var g=H.allocAt(a.la.x,a.la.y),h=g.x,k=g.y;if(null!==a.ur){var l=H.alloc();l=a.ur.ga(xc,l);h=l.x-a.vr.x/a.scale;k=l.y-a.vr.y/a.scale;e=wc;H.free(l)}if(f||a.scrollMode===Vh)e.eb()&&(c>b.width&&(h=b.x+(e.x*b.width+e.offsetX)-(e.x*c-e.offsetX)),d>b.height&&(k=b.y+(e.y*b.height+e.offsetY)-(e.y*d-e.offsetY))),e=a.zi,f=c-b.width,cb.left?h=b.left:hb.top?k=b.top:kb.targetTouches.length)return;b=b.targetTouches[c]}else if(null!==a.Al[0])b=a.Al[c];else return;c=a.Ba;null!==c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.va/c.width*c.left,b.clientY-a.ua/c.height*c.top))}t=P.prototype;t.Ta=function(){this.nj||(this.nj=!0,this.Xb(!0))};function lj(a){a.$b||Si(a);Zi(a)}t.wf=function(){this.Gb||this.$b||(this.N(),Xi(this),Ri(this),this.Ta(),this.ud())};t.Lz=function(){return this.cd}; t.Oy=function(a){void 0===a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.Uc();b.isEnabled=!1;Lf(this);this.Oe=!1;b.isEnabled=c;null!==a&&sa(function(){zh(b,"Model");a()},1)};t.Xb=function(a){void 0===a&&(a=!1);if(!0!==this.cd&&!(this.Gb||!1===a&&this.$b)){this.cd=!0;var b=this;x.requestAnimationFrame(function(){b.cd&&b.ud()})}};t.ud=function(){if(!this.Xk||this.cd)this.Xk&&(this.Xk=!1),Lf(this)}; function Yi(a,b,c){a.animationManager.defaultAnimation.isAnimating||a.Gb||!a.oj||Pi(a)||(b&&Si(a),c&&Ui(a,!1))} function Lf(a,b){if(!a.$b&&(a.cd=!1,null!==a.Fa||a.Np.v())){a.$b=!0;var c=a.animationManager,d=a.ru;if(!c.isAnimating&&0!==d.length){for(var e=d.j,f=e.length,g=0;gb;b++){var c=a.Gd.iterator;if(null===c||0===a.Gd.count)break;a.Gd=new F;a.fw(c,a.Gd)}a.nodes.each(function(a){a instanceof S&&0!==(a.P&65536)!==!1&&(a.P=a.P^65536)})}} t.fw=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Ub()||c instanceof S||(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof S&&c.isVisible()&&qj(this,c);for(a.reset();a.next();)c=a.value,c instanceof Q&&c.isVisible()&&(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof De&&c.isVisible()&&(c.Wi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function qj(a,b){for(var c=Da(),d=Da(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof S?(rj(f)||sj(f)||tj(f))&&qj(a,f):f instanceof Q?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;eh.ke||n.height* k>h.ke?m.tb(a,h):ii(a,m)}}a.globalAlpha=g}}}:function(b){b.tb(a,h)};g=f.length;for(m=0;ma.ke||m.height*g>a.ke?l.tb(b,a):ii(b,l)}}b.globalAlpha=f}}}}else if(!k&&l){var C=a.grid.part,J=C.layer;A=function(c){c===J?C.tb(b,a):c.tb(b,a,k)}}else A=function(c){c.tb(b,a,k)};for(c=0;cthis.ke||w.height*p>this.ke?u.tb(f,this):ii(f,u))}f.globalAlpha=k}f.restore();f.Qc(!0);this.gi&&wj(this.gi,this)&&this.kr();this.nc=this.hi=!1;this.tt()}Fa(e);Fa(a);this.$b=!1}}else this.ud();M.free(d);c&&(Ve(this),this.ud(),lf(this,!0))}else c?(Ve(this),this.ud(),lf(this,!0)):this.ud()}};function Xi(a){!1===a.oj&&(a.oj=!0)}function Ri(a){!1===a.hi&&(a.hi=!0)}function uj(a){!1!==a.Pn&&(a.Pn=!1,Dj(a,a.va,a.ua))} function Dj(a,b,c){var d=a.Pb;a.Ba.resize(b*d,c*d,b,c)&&(a.nc=!0,a.Xc.Qc(!0))} function Pi(a){var b=a.Ba;if(null===b)return!0;var c=a.Fa,d=a.va,e=a.ua,f=a.ax.copy();if(isNaN(f.width)||isNaN(f.height))return!0;var g=!1,h=a.Rf?a.qb:0,k=a.Ne?a.qb:0,l=c.clientWidth||d+h,m=c.clientHeight||e+k;if(l!==d+h||m!==e+k)a.Rf=!1,a.Ne=!1,k=h=0,a.va=l,a.ua=m,g=a.Pn=!0;if(!(g||a.Rf||a.Ne||a.$k||a.al))return!0;a.oj=!1;var n=a.viewportBounds,p=a.documentBounds,r=0,q=0,u=0,v=0;c=n.width;var w=n.height,y=a.zi;a.contentAlignment.eb()?(p.width>c&&(r=y.left,q=y.right),p.height>w&&(u=y.top,v=y.bottom)): (r=y.left,q=y.right,u=y.top,v=y.bottom);y=p.width+r+q;var z=p.height+u+v;r=p.x-r;var A=n.x;q=p.right+q;var C=n.right+h;u=p.y-u;var J=n.y;p=p.bottom+v;n=n.bottom+k;var K="1px",L="1px";v=a.scale;l=y>l/v;m=z>m/v;a.scrollMode===Vh&&(l||m)&&(l&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(l=1,r+1C+1&&(l=Math.max((q-C)*v+a.va,l)),c+h+1n+1&&(l=Math.max((p-n)*v+a.ua,l)),w+k+1C+1&&(h=Math.max((q-C)*v+a.va,h)),c+1n+1&&(k=Math.max((p-n)*v+h,k)),w+1C+1&&(k=a.position.x*v));if(a.Tn)switch(a.xu){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=k;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(w+1n+1&&(b.scrollTop= a.position.y*v));l=a.va;m=a.ua;b.style.width=l+(a.Rf?a.qb:0)+"px";b.style.height=m+(a.Ne?a.qb:0)+"px";return d!==l||e!==m||a.animationManager.ic?(a.qq(f,a.viewportBounds,v,g),!1):!0} t.add=function(a){var b=a.diagram;if(b!==this&&(null!==b&&B("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.dm(a.layerName),null===b&&(b=this.dm("")),null===b&&B('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.Vi(99999999,a,a.diagram===this);0<=c&&this.Ya(te,"parts",b,null,a,null,c);b.isTemporary||this.Ta();a.C(1);c=a.layerChanged;null!==c&&c(a,null,b)}}; t.Vi=function(a){this.partManager.Vi(a);var b=this;Ej(a,function(a){Fj(b,a)});(a instanceof De||a instanceof S&&null!==a.placeholder)&&a.o();null!==a.data&&Ej(a,function(a){Gj(b.partManager,a)});!0!==sj(a)&&!0!==tj(a)||this.Gd.add(a);Hj(a,!0,this);Ij(a)?(a.actualBounds.v()&&this.N(Cj(a,a.actualBounds)),this.Ta()):a.isVisible()&&a.actualBounds.v()&&this.N(Cj(a,a.actualBounds));this.Xb()}; t.Fc=function(a){a.Tj();this.partManager.Fc(a);var b=this;null!==a.data&&Ej(a,function(a){Jj(b.partManager,a,b)});this.Gd.remove(a);Ij(a)?(a.actualBounds.v()&&this.N(Cj(a,a.actualBounds)),this.Ta()):a.isVisible()&&a.actualBounds.v()&&this.N(Cj(a,a.actualBounds));this.Xb()};t.remove=function(a){Kj(this,a,!0)}; function Kj(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.C(2),c&&b.Zj(),c=d.Fc(-1,b,!1),0<=c&&a.Ya(ue,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.vt=function(a,b){if(za(a))for(var c=a.length,d=0;dd&&this.Ta()}; t.vy=function(a,b){ak(this,a,b);a.Wd(this);var c=this.Ka,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ac&&this.Ya(ue,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.Ta()}; t.bA=function(a){a.diagram!==this&&B("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.Ka,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ca.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.ac&&this.Ya(ue,"layers",this,a,null,c,null);this.N();this.Ta()}}};t.dm=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.jx=function(a){null===this.le&&(this.le=new E);this.le.add(a);this.model.yh(a)};t.dA=function(a){null!==this.le&&(this.le.remove(a),0===this.le.count&&(this.le=null));this.model.rk(a)};t.yh=function(a){null===this.If&&(this.If=new E);this.If.add(a)};t.rk=function(a){null!==this.If&&(this.If.remove(a),0===this.If.count&&(this.If=null))}; t.Ns=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.ov(a);a.change!==se&&(this.isModified=!0);if(null!==this.If)for(var b=this.If,c=b.length,d=0;dp.Ca.indexOf(q)&&p.Vi(r,q,u):(q.isSelected=!1,q.isHighlighted=!1,q.Lb(),p.Fc(u?r:-1,q,u)))}else p instanceof P?"number"===typeof r&&q instanceof ei&&(b?(q.Wd(this),this.Ka.Kb(r,q)):this.Ka.jb(r)):B("unknown ChangedEvent.Remove object: "+ a.toString());this.isModified=!0}else d!==se&&B("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=c}}};t.ta=function(a){return this.undoManager.ta(a)};t.Ua=function(a){return this.undoManager.Ua(a)};t.yf=function(){return this.undoManager.yf()}; P.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.ta(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.Ua(b):this.undoManager.yf(),this.skipsUndoManager=c}};P.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)};t=P.prototype;t.Eq=function(){this.partManager.Eq()}; function gk(a,b,c){var d=a.animationManager;if(a.Gb||a.$b)a.ya=c,d.Ve&&d.zd.add(d.B,"scale",b,a.ya);else if(a.Gb=!0,null===a.Ba)a.ya=c;else{var e=a.viewportBounds.copy(),f=a.va,g=a.ua;e.width=a.va/b;e.height=a.ua/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.uf()?l.sf(Jc)?h=0:l.sf(Kc)&&(h=f-1):h=l.eb()?l.x*(f-1):f/2);isNaN(k)&&(l.uf()?l.sf(Ic)?k=0:l.sf(Lc)&&(k=g-1):k=l.eb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.isAnimating||(c=a.scaleComputation(a, c));ca.maxScale&&(c=a.maxScale);f=H.allocAt(a.la.x+h/b-h/c,a.la.y+k/b-k/c);a.position=f;H.free(f);a.ya=c;a.qq(e,a.viewportBounds,b,!1);a.Gb=!1;Ui(a,!1);d.Ve&&d.zd.add(d.B,"scale",b,a.ya);a.N();Xi(a)}} t.qq=function(a,b,c,d){if(!a.A(b)){void 0===d&&(d=!1);d||Xi(this);Ri(this);var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==oi||d||a.width===b.width&&a.height===b.height||e.C();e=this.currentTool;!0===this.Yg&&e instanceof Na&&(this.lastInput.documentPoint=this.Bt(this.lastInput.viewPoint),Ne(e,this));this.Gb||this.Fx(a,b);nj(this);this.te.scale=c;this.te.position.x=a.x;this.te.position.y=a.y;this.te.bounds.assign(a);this.te.Hx=d;this.R("ViewportBoundsChanged",this.te,a);this.isVirtualized&& this.links.each(function(a){a.isAvoiding&&a.actualBounds.Gc(b)&&a.Na()})}}; function nj(a,b){void 0===b&&(b=null);var c=a.Fb;if(null!==c&&c.visible){for(var d=Kb.alloc(),e=1,f=1,g=c.W.j,h=g.length,k=0;km||(hk(l.figure)?f=f*m/I.Bx(f,m):e=e*m/I.Bx(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(null!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=M.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.v()){M.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;M.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=H.alloc();I.aq(a,g,0,0, d.width,d.height,b);b.offset(-d.width,-d.height);Kb.free(d);c.part.location=b;H.free(b)}}t.Tu=function(){var a=0=d&&!f.isAnimating&&!f.ic&&(b||zh(f,"Layout"));a.Ig=!1;for(var g=a.Fi.iterator;g.next();)qk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),Si(a),e.isValidLayout=!0):a.Ig=!0)}finally{0===d&&a.Ua("Layout"),a.Ig=!e.isValidLayout,a.aa=c}}} function qk(a,b,c,d){if(null!==b){for(var e=b.wl.iterator;e.next();)qk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.pk=!b.location.v(),e.doLayout(b),b.C(32),qj(a,b),e.isValidLayout=!0):a.Ig=!0)}}t.nz=function(){for(var a=new E,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.Pi()&&a.add(c)}return a.iterator}; function pi(a){function b(a){var b=a.toLowerCase(),e=new E;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new G,d=new G;b("InitialAnimationStarting");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("GainedFocus");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped"); b("LostFocus");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");b("InvalidateDraw");a.Ut=c;a.Tt=d} function zj(a,b){var c=a.Tt.H(b);return null!==c?c:a.Tt.H(b.toLowerCase())}function rk(a,b){var c=a.Ut.H(b);if(null!==c)return c;c=a.Ut.H(b.toLowerCase());if(null!==c)return c;B("Unknown DiagramEvent name: "+b);return null}t.Oj=function(a,b){a=rk(this,a);null!==a&&a.add(b)};t.sm=function(a,b){a=rk(this,a);null!==a&&a.remove(b)}; t.R=function(a,b,c){var d=rk(this,a),e=new pe;e.diagram=this;a=zj(this,a);null!==a&&(e.name=a);void 0!==b&&(e.subject=b);void 0!==c&&(e.parameter=c);b=d.length;if(1===b)d.L(0)(e);else if(0!==b)for(d=d.ma(),c=0;c=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.viewportBounds,f=a.scale;e=M.allocAt(0,0,e.width*f,e.height*f);var g=H.allocAt(0,0);if(b.x>=e.x&&b.xe.x+e.width-d.right&&(h=Math.max(a.scrollHorizontalLineChange,1),h|=0,g.x+=h,b.x>e.x+e.width-d.right/2&&(g.x+=h),b.x>e.x+e.width-d.right/4&& (g.x+=4*h));b.y>=e.y&&b.ye.y+e.height-d.bottom&&(a=Math.max(a.scrollVerticalLineChange,1),a|=0,g.y+=a,b.y>e.y+e.height-d.bottom/2&&(g.y+=a),b.y>e.y+e.height-d.bottom/4&&(g.y+=4*a));g.Ma(Fb)||(c=new H(c.x+g.x/f,c.y+g.y/f));M.free(e);H.free(g);return c}t.mt=function(){return null};t.vv=function(){return null};t.zy=function(a,b){this.uu.add(a,b)}; function Bk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].sl){f=!1;break}f||a-l>k?b(c,e,h):x.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Fj.iterator;g.next();)if(!g.value[0].sl){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;x.requestAnimationFrame(function(){d()});return null}t.Sz=function(a){if(!Vg)return null;void 0===a&&(a=new db);a.returnType="Image";return this.Ix(a)}; t.Ix=function(a){void 0===a&&(a=new db);return Bk(this,this.Tz,a)}; t.Tz=function(a,b,c){var d=Ck(c,a,"canvas",null);if(null===d)return null;c=d.V.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case "imagedata":e=d.getImageData(0,0,c.width,c.height);break;case "image":d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!==typeof b&&B('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.');if("function"=== typeof c.toBlob)return c.toBlob(b,a.type,a.details),"toBlob";if("function"===typeof c.msToBlob)return b(c.msToBlob()),"msToBlob";b(null);return null;default:e=c.toDataURL(a.type,a.details)}return"function"===typeof b?(b(e),null):e}; function Ck(a,b,c,d){a.animationManager.Uc();a.ud();if(null===a.Ba)return null;"object"!==typeof b&&B("properties argument must be an Object.");var e=b.size||null,f=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(f="NaN");var g=b.maxSize;void 0===b.maxSize&&(g="SVG"===c?new Kb(Infinity,Infinity):new Kb(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,r=b.elementFinished||null,q=b.showTemporary; void 0===q&&(q=!n);b=b.showGrid;void 0===b&&(b=q);null!==e&&isNaN(e.width)&&isNaN(e.height)&&(e=null);"number"===typeof l?l=new pc(l):l instanceof pc||B("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.Xc.Qc(!0);n=new Dk(null,p);var u=n.context;if(!(e||f||k||h)){n.width=a.va+Math.ceil(l.left+l.right);n.height=a.ua+Math.ceil(l.top+l.bottom);if("SVG"===c){if(null===d)return null;d.resize(n.width, n.height,n.width,n.height);d.ownerDocument=p;d.Yp=r;xj(a,d.context,l,new Kb(n.width,n.height),a.ya,a.la,k,m,q,b);return d.context}a.vn=!1;xj(a,u,l,new Kb(n.width,n.height),a.ya,a.la,k,m,q,b);a.vn=!0;return n.context}var v=a.gr,w=a.documentBounds.copy();w.Wv(a.bb);if(q)for(var y=a.Ka.j,z=y.length,A=0;Av?(f=v,e=w.width,w=w.height):(e=g.width,w=g.height)):(e=w.width*f,w=w.height*f):(f=v,e=w.width,w=w.height);null!==l?(e+=h,w+=V):l=new pc(0);null!==g&&(v=g.width,g=g.height,isNaN(v)&&(v=2E3),isNaN(g)&&(g=2E3),isFinite(v)&& (e=Math.min(e,v)),isFinite(g)&&(w=Math.min(w,g)));n.width=Math.ceil(e);n.height=Math.ceil(w);if("SVG"===c){if(null===d)return null;d.resize(n.width,n.height,n.width,n.height);d.ownerDocument=p;d.Yp=r;xj(a,d.context,l,new Kb(Math.ceil(e),Math.ceil(w)),f,y,k,m,q,b);return d.context}a.vn=!1;xj(a,u,l,new Kb(Math.ceil(e),Math.ceil(w)),f,y,k,m,q,b);a.vn=!0;return n.context} ma.Object.defineProperties(P.prototype,{div:{get:function(){return this.Fa},set:function(a){if(this.Fa!==a){Qa=[];var b=this.Fa;null!==b?(b.B=void 0,b.innerHTML="",null!==this.Ba&&(b=this.Ba.Da,this.removeEventListener(b,"touchstart",this.aw,!1),this.removeEventListener(b,"touchmove",this.$v,!1),this.removeEventListener(b,"touchend",this.Zv,!1),this.Ba.ux()),b=this.toolManager,null!==b&&(b.mouseDownTools.each(function(a){a.cancelWaitAfter()}),b.mouseMoveTools.each(function(a){a.cancelWaitAfter()}), b.mouseUpTools.each(function(a){a.cancelWaitAfter()})),b.cancelWaitAfter(),this.currentTool.doCancel(),this.Xc=this.Ba=null,this.removeEventListener(x,"resize",this.gw,!1),this.removeEventListener(x,"mousemove",this.kk,!0),this.removeEventListener(x,"mousedown",this.jk,!0),this.removeEventListener(x,"mouseup",this.mk,!0),this.removeEventListener(x,"wheel",this.nk,!0),this.removeEventListener(x,"mouseout",this.lk,!0),ze===this&&(ze=null)):this.Oe=!1;this.Fa=null;if(null!==a){if(b=a.B)b.div=null;Fi(this, a);this.wf()}}}},lx:{get:function(){return this.xo}},fk:{get:function(){return this.Oe}},draggedLink:{get:function(){return this.jr},set:function(a){this.jr!==a&&(this.jr=a,null!==a&&(this.es=a.fromPort,this.fs=a.toPort))}},Lx:{get:function(){return this.es},set:function(a){this.es=a}},Mx:{get:function(){return this.fs},set:function(a){this.fs=a}},animationManager:{ get:function(){return this.zc}},undoManager:{get:function(){return this.ac.undoManager}},skipsUndoManager:{get:function(){return this.lh},set:function(a){this.lh=a;this.ac.skipsUndoManager=a}},delaysLayout:{get:function(){return this.St},set:function(a){this.St=a}},opacity:{get:function(){return this.ob},set:function(a){var b=this.ob;b!==a&&((0>a||1a&&va(a,">= 0",P,"scrollHorizontalLineChange"),this.rs=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{get:function(){return this.ts},set:function(a){var b=this.ts;b!==a&&(0>a&&va(a,">= 0",P,"scrollVerticalLineChange"),this.ts=a,this.g("scrollVerticalLineChange", b,a))}},lastInput:{get:function(){return this.uj},set:function(a){this.uj=a}},firstInput:{get:function(){return this.ei},set:function(a){this.ei=a}},currentCursor:{get:function(){return this.cr},set:function(a){""===a&&(a=this.sn);if(this.cr!==a){var b=this.Ba,c=this.Fa;if(null!==b){this.cr=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)))}}}},defaultCursor:{get:function(){return this.sn},set:function(a){""===a&&(a="auto");var b=this.sn;b!==a&&(this.sn=a,this.g("defaultCursor",b,a))}},click:{get:function(){return this.Jf},set:function(a){var b=this.Jf;b!==a&&(this.Jf=a,this.g("click",b,a))}},doubleClick:{ get:function(){return this.Of},set:function(a){var b=this.Of;b!==a&&(this.Of=a,this.g("doubleClick",b,a))}},contextClick:{get:function(){return this.Kf},set:function(a){var b=this.Kf;b!==a&&(this.Kf=a,this.g("contextClick",b,a))}},mouseOver:{get:function(){return this.eg},set:function(a){var b=this.eg;b!==a&&(this.eg=a,this.g("mouseOver",b,a))}},mouseHover:{get:function(){return this.cg},set:function(a){var b= this.cg;b!==a&&(this.cg=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return this.bg},set:function(a){var b=this.bg;b!==a&&(this.bg=a,this.g("mouseHold",b,a))}},mouseDragOver:{get:function(){return this.Zr},set:function(a){var b=this.Zr;b!==a&&(this.Zr=a,this.g("mouseDragOver",b,a))}},mouseDrop:{get:function(){return this.$f},set:function(a){var b=this.$f;b!==a&&(this.$f=a,this.g("mouseDrop",b,a))}}, handlesDragDropForTopLevelParts:{get:function(){return this.zr},set:function(a){var b=this.zr;b!==a&&(this.zr=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{get:function(){return this.ag},set:function(a){var b=this.ag;b!==a&&(this.ag=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return this.dg},set:function(a){var b=this.dg;b!==a&&(this.dg=a,this.g("mouseLeave",b,a))}},toolTip:{ get:function(){return this.qg},set:function(a){var b=this.qg;b!==a&&(this.qg=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return this.Lf},set:function(a){var b=this.Lf;b!==a&&(this.Lf=a,this.g("contextMenu",b,a))}},commandHandler:{get:function(){return this.I},set:function(a){this.I!==a&&(this.I=a,a.Wd(this))}},toolManager:{get:function(){return this.Za},set:function(a){this.Za!==a&&(this.Za= a,a.diagram=this)}},defaultTool:{get:function(){return this.Ia},set:function(a){var b=this.Ia;b!==a&&(this.Ia=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{get:function(){return this.Y},set:function(a){var b=this.Y;null!==b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(this.Y=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.Tw}}, maxSelectionCount:{get:function(){return this.Vr},set:function(a){var b=this.Vr;if(b!==a)if(0<=a&&!isNaN(a)){if(this.Vr=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0= 0",P,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{ get:function(){return this.cs},set:function(a){var b=this.cs;b!==a&&(this.cs=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{get:function(){return this.xr},set:function(a){var b=this.xr;b!==a&&(this.xr=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.Rr},set:function(a){var b=this.Rr;b!==a&&(this.Rr=a,this.g("linkSelectionAdornmentTemplate",b, a))}},highlighteds:{get:function(){return this.Gw}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.u&&this.fe!==a.historyIndex:this.u},set:function(a){if(this.u!==a){this.u=a;var b=this.undoManager;!a&&b.isEnabled&&(this.fe=b.historyIndex);a||ik(this)}}},model:{get:function(){return this.ac},set:function(a){var b=this.ac;if(b!==a){this.currentTool.doCancel(); null!==b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&B("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Uc(!0);var c=Ii(this,!0);this.Oe=!1;this.Xk=!0;this.fe=-2;this.cd=!1;var d=this.$b;this.$b=!0;zh(this.animationManager,"Model");null!==b&&(null!==this.le&&this.le.each(function(a){b.rk(a)}),b.rk(this.Ih));this.ac=a;this.partManager=jk(this.ac.constructor.type);for(var e=0;ethis.scale&&(this.scale=a)):va(a,"> 0",P,"minScale"))}},maxScale:{get:function(){return this.Ur},set:function(a){var b=this.Ur;b!==a&&(0 0",P,"maxScale"))}},zoomPoint:{get:function(){return this.Ls},set:function(a){this.Ls.A(a)||(this.Ls=a=a.G())}},contentAlignment:{get:function(){return this.gj},set:function(a){var b=this.gj;b.A(a)||(this.gj=a=a.G(),this.g("contentAlignment",b,a),Ui(this,!1))}},initialContentAlignment:{get:function(){return this.On},set:function(a){var b=this.On;b.A(a)||(this.On=a=a.G(),this.g("initialContentAlignment", b,a))}},padding:{get:function(){return this.bb},set:function(a){"number"===typeof a&&(a=new pc(a));var b=this.bb;b.A(a)||(this.bb=a=a.G(),this.Ta(),this.g("padding",b,a))}},partManager:{get:function(){return this.Ja},set:function(a){var b=this.Ja;b!==a&&(null!==a.diagram&&B("Cannot share PartManagers between Diagrams: "+a.toString()),null!==b&&b.Wd(null),this.Ja=a,a.Wd(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}}, links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.hc},set:function(a){var b=this.hc;b!==a&&(this.hc=a,a.diagram=this,a.group=null,this.Ig=!0,this.g("layout",b,a),this.Xb())}},isTreePathToChildren:{get:function(){return this.Lr},set:function(a){var b=this.Lr;if(b!==a&&(this.Lr= a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Ek(a.value)}},treeCollapsePolicy:{get:function(){return this.Gs},set:function(a){var b=this.Gs;b!==a&&(a!==wi&&a!==Fk&&a!==Gk&&B("Unknown Diagram.treeCollapsePolicy: "+a),this.Gs=a,this.g("treeCollapsePolicy",b,a))}},ye:{get:function(){return this.kd},set:function(a){this.kd=a}},autoScrollInterval:{get:function(){return this.Wm}, set:function(a){var b=this.Wm;b!==a&&(this.Wm=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{get:function(){return this.Xm},set:function(a){"number"===typeof a&&(a=new pc(a));var b=this.Xm;b.A(a)||(this.Xm=a=a.G(),this.Ta(),this.g("autoScrollRegion",b,a))}}});ma.Object.defineProperties(P,{licenseKey:{get:function(){return Hk.Vb()},set:function(a){Hk.add(a)}},version:{get:function(){return Ik}}}); P.prototype.makeImageData=P.prototype.Ix;P.prototype.makeImage=P.prototype.Sz;P.prototype.addRenderer=P.prototype.zy;P.prototype.makeSVG=P.prototype.vv;P.prototype.makeSvg=P.prototype.mt;P.prototype.stopAutoScroll=P.prototype.zf;P.prototype.doAutoScroll=P.prototype.Ss;P.prototype.isUnoccupied=P.prototype.gk;P.prototype.raiseDiagramEvent=P.prototype.R;P.prototype.removeDiagramListener=P.prototype.sm;P.prototype.addDiagramListener=P.prototype.Oj;P.prototype.findTreeRoots=P.prototype.nz; P.prototype.layoutDiagram=P.prototype.Qz;P.prototype.findTopLevelGroups=P.prototype.gz;P.prototype.findTopLevelNodesAndLinks=P.prototype.hz;P.prototype.findLinksByExample=P.prototype.Vs;P.prototype.findNodesByExample=P.prototype.Ws;P.prototype.findLinkForData=P.prototype.uc;P.prototype.findNodeForData=P.prototype.Mi;P.prototype.findPartForData=P.prototype.vc;P.prototype.findLinkForKey=P.prototype.findLinkForKey;P.prototype.findNodeForKey=P.prototype.Jb;P.prototype.findPartForKey=P.prototype.findPartForKey; P.prototype.rebuildParts=P.prototype.wd;P.prototype.transformViewToDoc=P.prototype.Bt;P.prototype.transformRectDocToView=P.prototype.qA;P.prototype.transformDocToView=P.prototype.Cq;P.prototype.centerRect=P.prototype.Os;P.prototype.scrollToRect=P.prototype.Ov;P.prototype.scroll=P.prototype.scroll;P.prototype.highlightCollection=P.prototype.Fz;P.prototype.highlight=P.prototype.Ez;P.prototype.clearHighlighteds=P.prototype.mx;P.prototype.selectCollection=P.prototype.hA;P.prototype.select=P.prototype.select; P.prototype.clearSelection=P.prototype.Tu;P.prototype.updateAllRelationshipsFromData=P.prototype.Eq;P.prototype.updateAllTargetBindings=P.prototype.updateAllTargetBindings;P.prototype.commit=P.prototype.commit;P.prototype.rollbackTransaction=P.prototype.yf;P.prototype.commitTransaction=P.prototype.Ua;P.prototype.startTransaction=P.prototype.ta;P.prototype.raiseChanged=P.prototype.g;P.prototype.raiseChangedEvent=P.prototype.Ya;P.prototype.removeChangedListener=P.prototype.rk; P.prototype.addChangedListener=P.prototype.yh;P.prototype.removeModelChangedListener=P.prototype.dA;P.prototype.addModelChangedListener=P.prototype.jx;P.prototype.findLayer=P.prototype.dm;P.prototype.removeLayer=P.prototype.bA;P.prototype.addLayerAfter=P.prototype.vy;P.prototype.addLayerBefore=P.prototype.hx;P.prototype.addLayer=P.prototype.Vl;P.prototype.moveParts=P.prototype.moveParts;P.prototype.copyParts=P.prototype.Yj;P.prototype.removeParts=P.prototype.vt;P.prototype.remove=P.prototype.remove; P.prototype.add=P.prototype.add;P.prototype.clearDelayedGeometries=P.prototype.Su;P.prototype.setProperties=P.prototype.Uv;P.prototype.resetInputOptions=P.prototype.Lv;P.prototype.setInputOption=P.prototype.iA;P.prototype.getInputOption=P.prototype.gm;P.prototype.resetRenderingHints=P.prototype.Mv;P.prototype.setRenderingHint=P.prototype.Xx;P.prototype.getRenderingHint=P.prototype.xe;P.prototype.maybeUpdate=P.prototype.ud;P.prototype.requestUpdate=P.prototype.Xb;P.prototype.delayInitialization=P.prototype.Oy; P.prototype.isUpdateRequested=P.prototype.Lz;P.prototype.redraw=P.prototype.wf;P.prototype.invalidateDocumentBounds=P.prototype.Ta;P.prototype.findObjectsNear=P.prototype.xg;P.prototype.findPartsNear=P.prototype.dz;P.prototype.findObjectsIn=P.prototype.wg;P.prototype.findPartsIn=P.prototype.Ax;P.prototype.findObjectsAt=P.prototype.Ni;P.prototype.findPartsAt=P.prototype.cz;P.prototype.findObjectAt=P.prototype.Sb;P.prototype.findPartAt=P.prototype.em;P.prototype.focusObject=P.prototype.oz; P.prototype.alignDocument=P.prototype.By;P.prototype.zoomToRect=P.prototype.tA;P.prototype.zoomToFit=P.prototype.zoomToFit;P.prototype.diagramScroll=P.prototype.tx;P.prototype.focus=P.prototype.focus;P.prototype.reset=P.prototype.reset;P.useDOM=function(a){Vg=a?void 0!==x.document:!1};P.isUsingDOM=function(){return Vg}; var ze=null,xi=new G,Li=null,Ki=null,Vg=void 0!==x.document,Gi=null,Hi="",oi=new D(P,"None",0),$i=new D(P,"Uniform",1),aj=new D(P,"UniformToFill",2),Pf=new D(P,"CycleAll",10),Tf=new D(P,"CycleNotDirected",11),Vf=new D(P,"CycleNotDirectedFast",12),Wf=new D(P,"CycleNotUndirected",13),Qf=new D(P,"CycleDestinationTree",14),Sf=new D(P,"CycleSourceTree",15),Vh=new D(P,"DocumentScroll",1),Xh=new D(P,"InfiniteScroll",2),wi=new D(P,"TreeParentCollapsed",21),Fk=new D(P,"AllParentsCollapsed",22),Gk=new D(P, "AnyParentsCollapsed",23),Hk=new E,Ik="2.1.2",Jk=null,mi=!1;function ni(){if(Vg){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Ra("7ca11abfd022028846");b[c]=Ra("398c3597c01238");for(var d=["5da73c80a36455d5038e4972187c3cae51fd22",qa.Dx+"4ae6247590da4bb21c324ba3a84e385776",sd.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",I.za],e=1;5>e;e++)b[Ra("7ca11abfd7330390")](Ra(d[e-1]),10,15*e);b[c]=Ra("39f046ebb36e4b");for(c=1;5>c;c++)b[Ra("7ca11abfd7330390")](Ra(d[c-1]),10,15*c);Jk=a}} P.className="Diagram";P.fromDiv=function(a){var b=a;"string"===typeof a&&(b=x.document.getElementById(a));return b instanceof HTMLDivElement&&b.B instanceof P?b.B:null};P.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};P.None=oi;P.Uniform=$i;P.UniformToFill=aj;P.CycleAll=Pf;P.CycleNotDirected=Tf;P.CycleNotDirectedFast=Vf; P.CycleNotUndirected=Wf;P.CycleDestinationTree=Qf;P.CycleSourceTree=Sf;P.DocumentScroll=Vh;P.InfiniteScroll=Xh;P.TreeParentCollapsed=wi;P.AllParentsCollapsed=Fk;P.AnyParentsCollapsed=Gk;function Ei(){this.py=null;this.l="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.Ke=this.l=!0:this.Ke=null} function wj(a,b){b.Xc.setTransform(b.Pb,0,0,b.Pb,0,0);if(null===a.Ke){b="f";var c=x[Ra("76a715b2f73f148a")][Ra("72ba13b5")];a.Ke=!0;if(Vg){var d=P[Ra("76a115b6ed251eaf4692")];if(d)for(var e=Hk.iterator;e.next();){d=e.value;d=Ra(d).split(Ra("39e9"));if(6>d.length)break;var f=Ra(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Ra(qa[Ra("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){f=c[Ra("76ad18b4f73e")];for(g=c[Ra("73a612b6fb191d")](Ra("35e7"))+2;gf&&Ra(d[2])!==Ra("7da71ca0ad381e90")&&(f=b[Ra("73a612b6fb191d")](Ra("76a715b2ef3e149757")));0>f&&(f=b[Ra("73a612b6fb191d")](Ra("76a715b2ef3e149757")));0>f&&(f=c[Ra("73a612b6fb191d")](Ra("7baa19a6f76c1988428554")));a.Ke=!(0<=f&&fh.length;)h+="9";h=h.substr(h.length-4);d="";d+=["gsh","gsf"][parseInt(h.substr(0, 1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(h.substr(0,1),10)%4];g[Ra("79a417a0f0181a8946")]=d;if(x.document[Ra("78a712aa")]){x.document[Ra("78a712aa")][Ra("7bb806b6ed32388c4a875b")](g);h=x.getComputedStyle(g).getPropertyValue(Ra("78a704b7e62456904c9b12701b6532a8"));x.document[Ra("78a712aa")][Ra("68ad1bbcf533388c4a875b")](g);if(!h)break;if(-1!==h.indexOf(parseInt(f[1]+f[2],16))&&-1!==h.indexOf(parseInt(f[3]+f[4],16))){a.Ke=!1;break}else if(Sa||Ta||Ua||Va)for(d="."+d,f=0;fMath.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(0!==b.wheelDeltaX&&(d=0Math.abs(b.wheelDeltaY)?-d:-e):void 0!==b.wheelDelta&&0!==b.wheelDelta&&(c.delta=0e||Math.abs(d.y-b.screenY)>e)?a.Jd++:a.Jd=1;c.clickCount=a.Jd;a.pl=b.timeStamp;a.Or.Cg(b.screenX,b.screenY);a.doMouseDown();1===b.button?b.preventDefault():kj(c,b)}};a.om=function(b){if(a.isEnabled){a.Yg=!0;var c=a.Al;if(null!==c[0]&&c[0].pointerId===b.pointerId)c[0]=b;else{if(null!==c[1]&&c[1].pointerId===b.pointerId){c[1]=b;return}if(null===c[0])c[0]=b;else return}c[0].pointerId===b.pointerId&& (c=jj(a,b,b,null!==c[1]),c.targetDiagram=gj(b),a.doMouseMove(),kj(c,b))}};a.qm=function(b){if(a.isEnabled){a.Yg=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.su;if(c&&a.Ql)delete d[b.pointerId],b.preventDefault();else if(d=a.Al,null!==d[0]&&d[0].pointerId===b.pointerId){d[0]=null;d=ij(a,b,!1,!0,!0,!1);var e=x.document.elementFromPoint(b.clientX,b.clientY);null!==e&&e.B instanceof P&&e.B!==a&&fj(e.B,b,d);fj(a,b,d);d.clickCount=a.Jd;null===e?d.targetDiagram=gj(b):e.B?d.targetDiagram=e.B: d.targetDiagram=null;d.targetObject=null;a.doMouseUp();kj(d,b);c&&(a.Pe=!1)}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.pm=function(b){if(a.isEnabled){a.Yg=!1;var c=a.su;c[b.pointerId]&&delete c[b.pointerId];c=a.Al;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.currentTool,b.cancelWaitAfter(),b.standardMouseOver())}};b.Qc(!0);Mi(a)}}Ei.className="DiagramHelper"; function ef(a){this.l=void 0===a?new H:a;this.u=new H}ma.Object.defineProperties(ef.prototype,{point:{get:function(){return this.l},set:function(a){this.l=a}},shifted:{get:function(){return this.u},set:function(a){this.u=a}}});ef.className="DraggingInfo";function Oj(a,b,c){this.node=a;this.info=b;this.nv=c}Oj.className="DraggingNodeInfoPair";function Re(){this.reset()} Re.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new Kb(NaN,NaN)).freeze();this.gridSnapCellSpot=xc;this.gridSnapOrigin=(new H(NaN,NaN)).freeze();this.Cz=this.dragsTree=this.dragsLink=!1;this.Bz=!0}; function Kk(a){1this.ke||q.height*m>this.ke?r.tb(b,this):ii(b,r))}b.globalAlpha=l}}e.drawImage(c.Da,0,0);c=this.Ka.j;e=c.length;for(d=0;db.maxScale||(b.scale=a))};Qk.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);var b=this.diagram;if(b.autoScale!==oi)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom}; Qk.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;b.autoScale===oi&&(a=b.scale*a,ab.maxScale||(b.scale=a))};Qk.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;if(b.autoScale!==oi)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};Qk.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;ab.maxScale||(b.scale=a)}; Qk.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;return ab.maxScale?!1:b.allowZoom};Qk.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Uc();a.wf();var c=a.position,d=a.scale;zh(b,"Zoom To Fit");d===this.Nu&&!isNaN(this.hu)&&a.documentBounds.A(this.Mu)?(a.scale=this.hu,a.position=this.Iw,this.Nu=NaN,this.Mu=nc):(this.hu=d,this.Iw=c.copy(),a.zoomToFit(),this.Nu=a.scale,this.Mu=a.documentBounds.copy());Bh(b)}; Qk.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; Qk.prototype.scrollToPart=function(a){void 0===a&&(a=null);var b=this.diagram;Zi(b);if(null===a){try{null!==this.mg&&(this.mg.next()?a=this.mg.value:this.mg=null)}catch(k){this.mg=null}null===a&&(0a&&(a+=360));return a}; t.qf=function(){if(0!==(this.F&4096)===!1)return this.Tk;var a=this.ya;return null!==this.panel?a*this.panel.qf():a};t.$s=function(a,b){void 0===b&&(b=new H);b.assign(a);this.sd.Td(b);return b};t.Sc=function(a,b,c){return this.ck(a.x,a.y,b.x,b.y,c)}; t.ck=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11*f.m22-f.m12*f.m21),h=f.m22*g,k=-f.m12*g,l=-f.m21*g,m=f.m11*g,n=g*(f.m21*f.dy-f.m22*f.dx),p=g*(f.m12*f.dx-f.m11*f.dy);if(null!==this.areaBackground)return f=this.actualBounds,I.Sc(f.left,f.top,f.right,f.bottom,a,b,c,d,e);g=a*h+b*l+n;a=a*k+b*m+p;b=c*h+d*l+n;c=c*k+d*m+p;e.h(0,0);d=this.naturalBounds;c=I.Sc(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; Y.prototype.measure=function(a,b,c,d){if(!1!==rj(this)){var e=this.bh,f=e.right+e.left;e=e.top+e.bottom;a=Math.max(a-f,0);b=Math.max(b-e,0);c=Math.max((c||0)-f,0);d=Math.max((d||0)-e,0);f=this.angle;e=this.desiredSize;var g=0;this instanceof W&&(g=this.strokeWidth);90===f||270===f?(a=isFinite(e.height)?e.height+g:a,b=isFinite(e.width)?e.width+g:b):(a=isFinite(e.width)?e.width+g:a,b=isFinite(e.height)?e.height+g:b);e=c||0;g=d||0;var h=this instanceof X;switch(jl(this,!0)){case Ag:g=e=0;h&&(b=a=Infinity); break;case wd:isFinite(a)&&a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case Vk:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case Wk:isFinite(b)&&b>d&&(g=b),e=0,h&&(a=Infinity)}h=this.maxSize;var k=this.minSize;e>h.width&&k.widthh.height&&k.heighta.height||this.nb>a.width)))c=!0;this.F=c?this.F|256:this.F&-257;this.vb.v()||B("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.vb.toString());this.qt(f,this.vb);kl(this,!1);M.free(f)};t=Y.prototype;t.Ah=function(){}; function ll(a,b,c,d,e){a.vb.h(b,c,d,e);if(!a.desiredSize.v()){var f=a.oc;c=a.bh;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=jl(a,!0);c===d&&f===e&&(b=Ag);switch(b){case Ag:if(c>d||f>e)mj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case wd:mj(a,!0);a.measure(d,e,0,0);break;case Vk:mj(a,!0);a.measure(d,f,0,0);break;case Wk:mj(a,!0),a.measure(c,e,0,0)}}} t.qt=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||ml(c,!0),this.N(),bc(a,b)||(c.Eh(),this.Ho(c)))};t.Ho=function(a){null!==this.portId&&(ml(a,!0),a instanceof U&&nl(a,this))}; t.tb=function(a,b){if(this.visible){var c=this instanceof X&&(this.type===X.TableRow||this.type===X.TableColumn),d=this.vb;if(c||0!==d.width&&0!==d.height&&!isNaN(d.x)&&!isNaN(d.y)){var e=this.opacity;if(0!==e){var f=1;1!==e&&(f=a.globalAlpha,a.globalAlpha=f*e);if(!this.vx(a,b))if(c)ol(this,a,b);else{this instanceof Q&&this.ik(!1);c=this.transform;var g=this.panel;0!==(this.F&4096)===!0&&pl(this);var h=this.part,k=!1,l=0;if(h&&b.xe("drawShadows")&&(k=h.isShadowed)){var m=h.shadowOffset;l=Math.max(m.y, m.x)*b.scale*b.Pb}if(!(m=b.qj||!this.tf())){var n=this.naturalBounds;m=this.Kh;var p=m.m11,r=m.m21,q=m.dx,u=m.m12,v=m.m22,w=m.dy,y,z=y=0;m=y*p+z*r+q;var A=y*u+z*v+w;y=n.width+l;z=0;var C=y*p+z*r+q;y=y*u+z*v+w;z=Math.min(m,C);var J=Math.min(A,y);var K=Math.max(m+0,C)-z;var L=Math.max(A+0,y)-J;m=z;A=J;y=n.width+l;z=n.height+l;C=y*p+z*r+q;y=y*u+z*v+w;z=Math.min(m,C);J=Math.min(A,y);K=Math.max(m+K,C)-z;L=Math.max(A+L,y)-J;m=z;A=J;y=0;z=n.height+l;C=y*p+z*r+q;y=y*u+z*v+w;z=Math.min(m,C);J=Math.min(A,y); K=Math.max(m+K,C)-z;L=Math.max(A+L,y)-J;m=z;A=J;l=b.viewportBounds;n=l.x;p=l.y;m=!(m>l.width+n||n>K+m||A>l.height+p||p>L+A)}if(m){m=0!==(this.F&256);a.clipInsteadOfFill&&(m=!1);this instanceof Xg&&(a.font=this.font);if(m){A=g.Yd()?g.naturalBounds:g.actualBounds;null!==this.ld?(n=this.ld,K=n.x,L=n.y,l=n.width,n=n.height):(K=Math.max(d.x,A.x),L=Math.max(d.y,A.y),l=Math.min(d.right,A.right)-K,n=Math.min(d.bottom,A.bottom)-L);if(K>d.width+d.x||d.x>A.width+A.x){1!==e&&(a.globalAlpha=f);return}a.save(); a.beginPath();a.rect(K,L,l,n);a.clip()}if(this.tf()){if(!h.isVisible()){1!==e&&(a.globalAlpha=f);return}k&&(A=h.shadowOffset,a.Vv(A.x*b.scale*b.Pb,A.y*b.scale*b.Pb,h.shadowBlur),ql(a),a.shadowColor=h.shadowColor)}!0===this.shadowVisible?ql(a):!1===this.shadowVisible&&rl(a);h=this.naturalBounds;null!==this.dc&&(ji(this,a,this.dc,!0,!0,h,d),this.dc instanceof sl&&this.dc.type===tl?(a.beginPath(),a.rect(d.x,d.y,d.width,d.height),a.Sd(this.dc)):a.fillRect(d.x,d.y,d.width,d.height));a.transform(c.m11, c.m12,c.m21,c.m22,c.dx,c.dy);k&&(null!==g&&0!==(g.F&512)||null!==g&&(g.type===X.Auto||g.type===X.Spot)&&g.Ab()!==this)&&null===this.shadowVisible&&rl(a);null!==this.gb&&(l=this.naturalBounds,K=A=0,L=l.width,l=l.height,n=0,this instanceof W&&(l=this.oa.bounds,A=l.x,K=l.y,L=l.width,l=l.height,n=this.strokeWidth),ji(this,a,this.gb,!0,!1,h,d),this.gb instanceof sl&&this.gb.type===tl?(a.beginPath(),a.rect(A-n/2,K-n/2,L+n,l+n),a.Sd(this.gb)):a.fillRect(A-n/2,K-n/2,L+n,l+n));k&&(null!==this.gb||null!==this.dc|| null!==g&&0!==(g.F&512)||null!==g&&(g.type===X.Auto||g.type===X.Spot)&&g.Ab()!==this)?(ul(this,!0),null===this.shadowVisible&&rl(a)):ul(this,!1);this.Ki(a,b);k&&0!==(this.F&512)===!0&&ql(a);this.tf()&&k&&rl(a);m?(a.restore(),this instanceof X?a.Qc(!0):a.Qc(!1)):c.gt()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*b,-c.m12*b,-c.m21*b,c.m11*b,b*(c.m21*c.dy-c.m22*c.dx),b*(c.m12*c.dx-c.m11*c.dy)))}}1!==e&&(a.globalAlpha=f)}}}};t.vx=function(){return!1}; function ol(a,b,c){var d=a.vb,e=a.pc;null!==a.dc&&(ji(a,b,a.dc,!0,!0,e,d),a.dc instanceof sl&&a.dc.type===tl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Sd(a.dc)):b.fillRect(d.x,d.y,d.width,d.height));null!==a.gb&&(ji(a,b,a.gb,!0,!1,e,d),a.gb instanceof sl&&a.gb.type===tl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Sd(a.gb)):b.fillRect(d.x,d.y,d.width,d.height));a.Ki(b,c)}t.Ki=function(){}; function ji(a,b,c,d,e,f,g){if(null!==c){var h=1,k=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===vl)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{h=f.width;k=f.height;e&&(h=g.width,k=g.height);if((f=b instanceof wl)&&c.ae&&(c.type===xl||c.Hk===h&&c.Nt===k))var l=c.ae;else{var m=0,n=0,p=0,r=0,q=0,u=0;u=q=0;e&&(q=g.x,u=g.y);m=c.start.x*h+c.start.offsetX;n=c.start.y*k+c.start.offsetY;p=c.end.x*h+c.end.offsetX;r=c.end.y*k+c.end.offsetY;m+=q;p+=q;n+=u;r+=u;if(c.type===yl)l= b.createLinearGradient(m,n,p,r);else if(c.type===tl)u=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(q=0,u=Math.max(h,k)/2):q=c.startRadius,l=b.createRadialGradient(m,n,q,p,r,u);else if(c.type===xl)try{l=b.createPattern(c.pattern,"repeat")}catch(w){l=null}if(c.type!==xl&&(e=c.colorStops,null!==e))for(e=e.iterator;e.next();)l.addColorStop(e.key,e.value);if(f&&(c.ae=l,null!==l&&(c.Hk=h,c.Nt=k),null===l&&c.type===xl&&-1!==c.Hk)){c.Hk=-1;var v=a.diagram;null!==v&&-1===c.Hk&&sa(function(){v.wf()}, 600)}}d?b.fillStyle=l:b.strokeStyle=l}}}t.Ag=function(a){if(a instanceof X)a:{if(this!==a&&null!==a)for(var b=this.panel;null!==b;){if(b===a){a=!0;break a}b=b.panel}a=!1}else a=!1;return a};t.vf=function(){if(!this.visible)return!1;var a=this.panel;return null!==a?a.vf():!0};t.Bg=function(){for(var a=this instanceof X?this:this.panel;null!==a&&a.isEnabled;)a=a.panel;return null===a}; function pl(a){if(0!==(a.F&2048)===!0){var b=a.rb;b.reset();if(!a.vb.v()||!a.oc.v()){zl(a,!1);return}b.translate(a.vb.x-a.oc.x,a.vb.y-a.oc.y);if(1!==a.scale||0!==a.angle){var c=a.naturalBounds;hl(a,b,c.x,c.y,c.width,c.height)}zl(a,!1);Al(a,!0)}0!==(a.F&4096)===!0&&(b=a.panel,null===b?(a.Kh.set(a.rb),a.Tk=a.scale,Al(a,!1)):null!==b.sd&&(c=a.Kh,c.reset(),b.Yd()?c.multiply(b.Kh):null!==b.panel&&c.multiply(b.panel.Kh),c.multiply(a.rb),a.Tk=a.scale*b.Tk,Al(a,!1)))} function hl(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.cc){var g=Bc;a.tf()&&a.locationSpot.eb()&&(g=a.locationSpot);var h=H.alloc();if(a instanceof T&&a.locationObject!==a)for(c=a.locationObject,d=c.naturalBounds,h.sk(d.x,d.y,d.width,d.height,g),c.Wf.ra(h),h.offset(-c.measuredBounds.x,-c.measuredBounds.y),g=c.panel;null!==g&&g!==a;)g.Wf.ra(h),h.offset(-g.measuredBounds.x,-g.measuredBounds.y),g=g.panel;else h.sk(c,d,e,f,g);b.rotate(a.cc,h.x,h.y);H.free(h)}} t.o=function(a){void 0===a&&(a=!1);if(!0!==rj(this)){mj(this,!0);kl(this,!0);var b=this.panel;null===b||a||b.o()}};t.im=function(){!0!==rj(this)&&(mj(this,!0),kl(this,!0))};function Bl(a){if(!1===sj(a)){var b=a.panel;null!==b?b.o():a.tf()&&(b=a.diagram,null!==b&&(b.Gd.add(a),a instanceof U&&a.gd(),b.Xb()));kl(a,!0)}}t.jl=function(){0!==(this.F&2048)===!1&&(zl(this,!0),Al(this,!0))};t.rv=function(){Al(this,!0)};t.N=function(){var a=this.part;null!==a&&a.N()}; function jl(a,b){var c=a.stretch,d=a.panel;if(null!==d&&d.type===X.Table)return Cl(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!==d&&d.type===X.Auto&&d.Ab()===a)return Dl(a,wd,b);if(c===Uk){if(null!==d){if(d.type===X.Spot&&d.Ab()===a)return Dl(a,wd,b);c=d.defaultStretch;return c===Uk?Dl(a,Ag,b):Dl(a,c,b)}return Dl(a,Ag,b)}return Dl(a,c,b)} function Cl(a,b,c,d){var e=a.stretch;if(e!==Uk)return Dl(a,e,d);var f=e=null;switch(b.stretch){case Wk:f=!0;break;case wd:f=!0}switch(c.stretch){case Vk:e=!0;break;case wd:e=!0}b=a.panel.defaultStretch;null===e&&(e=b===Vk||b===wd);null===f&&(f=b===Wk||b===wd);return!0===e&&!0===f?Dl(a,wd,d):!0===e?Dl(a,Vk,d):!0===f?Dl(a,Wk,d):Dl(a,Ag,d)} function Dl(a,b,c){if(c)return b;if(b===Ag)return Ag;c=a.desiredSize;if(c.v())return Ag;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===Vk)return Ag;if(b===wd)return Wk}else{if(b===Wk)return Ag;if(b===wd)return Vk}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===Wk)return Ag;if(b===wd)return Vk}else{if(b===Vk)return Ag;if(b===wd)return Wk}return b}function ul(a,b){a.F=b?a.F|512:a.F&-513}function dl(a){return 0!==(a.F&1024)}function El(a,b){a.F=b?a.F|1024:a.F&-1025} function zl(a,b){a.F=b?a.F|2048:a.F&-2049}function Al(a,b){a.F=b?a.F|4096:a.F&-4097}function rj(a){return 0!==(a.F&8192)}function mj(a,b){a.F=b?a.F|8192:a.F&-8193}function sj(a){return 0!==(a.F&16384)}function kl(a,b){a.F=b?a.F|16384:a.F&-16385}t.Yi=function(a){this.jg=a};t.Tv=function(){};t.Sv=function(a){this.la.assign(a);Bl(this);return!0};t.zq=function(a,b){if(this.la.x!==a||this.la.y!==b)this.la.h(a,b),this.jl()}; function Fl(a){var b=a.part;if(b instanceof U&&(null!==a.portId||a===b.port)){var c=b.diagram;null===c||c.undoManager.isUndoingRedoing||nl(b,a)}}function Gl(a){var b=a.diagram;null===b||b.undoManager.isUndoingRedoing||(a instanceof X?a instanceof U?a.gd():a.Em(a,function(a){Fl(a)}):Fl(a))}t.bind=function(a){a.bd=this;var b=this.Oi();null!==b&&Hl(b)&&B("Cannot add a Binding to a template that has already been copied: "+a);null===this.$a&&(this.$a=new E);this.$a.add(a)}; t.Oi=function(){for(var a=this instanceof X?this:this.panel;null!==a;){if(null!==a.Xh)return a;a=a.panel}return null};t.Uv=function(a){yj(this,a)};function Il(a,b){b.bd=a;null===a.Hg&&(a.Hg=new G);a.Hg.add(b.propertyName,b)} function Jl(a,b){for(var c=1;ce)&&B("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.isRow= !0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&B("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index=e);e=new db;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);yj(a,e)}else yj(a,b);else B('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function Ol(a,b){Kl.add(a,b)} function Pl(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} ma.Object.defineProperties(Y.prototype,{shadowVisible:{get:function(){return this.Hl},set:function(a){var b=this.Hl;b!==a&&(this.Hl=a,this.N(),this.g("shadowVisible",b,a))}},enabledChanged:{get:function(){return null!==this.M?this.M.zn:null},set:function(a){al(this);var b=this.M.zn;b!==a&&(this.M.zn=a,this.g("enabledChanged",b,a))}},segmentOrientation:{get:function(){return this.Fl},set:function(a){var b=this.Fl; b!==a&&(this.Fl=a,this.o(),this.g("segmentOrientation",b,a),a===pg&&(this.angle=0))}},segmentIndex:{get:function(){return this.mp},set:function(a){a=Math.round(a);var b=this.mp;b!==a&&(this.mp=a,this.o(),this.g("segmentIndex",b,a))}},segmentFraction:{get:function(){return this.Dl},set:function(a){isNaN(a)?a=0:0>a?a=0:1a||1=a&&B("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.ya=a,this.o(),this.g("scale",b,a))}},angle:{get:function(){return this.cc},set:function(a){var b=this.cc;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.cc=a,Gl(this),this.o(),this.g("angle",b,a)))}},desiredSize:{get:function(){return this.Kc},set:function(a){var b=a.width,c=a.height,d=this.Kc,e=d.width,f=d.height;(e===b||isNaN(e)&& isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Kc=a=a.G(),this.o(),this instanceof W&&this.bc(),this.g("desiredSize",d,a),dl(this)&&(a=this.part,null!==a&&(el(this,a,"width"),el(this,a,"height"))))}},width:{get:function(){return this.Kc.width},set:function(a){var b=this.Kc.width;b===a||isNaN(b)&&isNaN(a)||(b=this.Kc,this.Kc=a=(new Kb(a,this.Kc.height)).freeze(),this.o(),this instanceof W&&this.bc(),this.g("desiredSize",b,a),dl(this)&&(a=this.part,null!==a&&el(this,a,"width")))}}, height:{get:function(){return this.Kc.height},set:function(a){var b=this.Kc.height;b===a||isNaN(b)&&isNaN(a)||(b=this.Kc,this.Kc=a=(new Kb(this.Kc.width,a)).freeze(),this.o(),this instanceof W&&this.bc(),this.g("desiredSize",b,a),dl(this)&&(a=this.part,null!==a&&el(this,a,"height")))}},minSize:{get:function(){return this.Zf},set:function(a){var b=this.Zf;b.A(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(), this.Zf=a,this.o(),this.g("minSize",b,a))}},maxSize:{get:function(){return this.Yf},set:function(a){var b=this.Yf;b.A(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Yf=a,this.o(),this.g("maxSize",b,a))}},measuredBounds:{get:function(){return this.oc}},naturalBounds:{get:function(){return this.pc}},margin:{get:function(){return this.bh}, set:function(a){"number"===typeof a&&(a=new pc(a));var b=this.bh;b.A(a)||(this.bh=a=a.G(),this.o(),this.g("margin",b,a))}},transform:{get:function(){0!==(this.F&2048)===!0&&pl(this);return this.rb}},sd:{get:function(){0!==(this.F&4096)===!0&&pl(this);return this.Kh}},alignment:{get:function(){return this.wb},set:function(a){var b=this.wb;b.A(a)||(a.jc()&&!a.Mb()&&B("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+ a),this.wb=a=a.G(),Bl(this),this.g("alignment",b,a))}},column:{get:function(){return this.Mg},set:function(a){a=Math.round(a);var b=this.Mg;b!==a&&(0>a&&va(a,">= 0",Y,"column"),this.Mg=a,this.o(),this.g("column",b,a))}},columnSpan:{get:function(){return this.bn},set:function(a){a=Math.round(a);var b=this.bn;b!==a&&(1>a&&va(a,">= 1",Y,"columnSpan"),this.bn=a,this.o(),this.g("columnSpan",b,a))}},row:{get:function(){return this.gp}, set:function(a){a=Math.round(a);var b=this.gp;b!==a&&(0>a&&va(a,">= 0",Y,"row"),this.gp=a,this.o(),this.g("row",b,a))}},rowSpan:{get:function(){return this.hp},set:function(a){a=Math.round(a);var b=this.hp;b!==a&&(1>a&&va(a,">= 1",Y,"rowSpan"),this.hp=a,this.o(),this.g("rowSpan",b,a))}},spanAllocation:{get:function(){return this.Ap},set:function(a){var b=this.Ap;b!==a&&(this.Ap=a,this.o(),this.g("spanAllocation",b,a))}},alignmentFocus:{ get:function(){return this.zk},set:function(a){var b=this.zk;b.A(a)||(this.zk=a=a.G(),this.o(),this.g("alignmentFocus",b,a))}},portId:{get:function(){return this.So},set:function(a){var b=this.So;if(b!==a){var c=this.part;null===c||c instanceof U||(B("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&Rl(c,this);this.So=a;null!==a&&null!==c&&(c.Dh=!0,Sl(c,this));this.g("portId",b,a)}}},toSpot:{get:function(){return null!== this.O?this.O.uh:wc},set:function(a){this.Ec();var b=this.O.uh;b.A(a)||(a=a.G(),this.O.uh=a,this.g("toSpot",b,a),Fl(this))}},toEndSegmentLength:{get:function(){return null!==this.O?this.O.sh:10},set:function(a){this.Ec();var b=this.O.sh;b!==a&&(0>a&&va(a,">= 0",Y,"toEndSegmentLength"),this.O.sh=a,this.g("toEndSegmentLength",b,a),Fl(this))}},toShortLength:{get:function(){return null!==this.O?this.O.th:0},set:function(a){this.Ec();var b=this.O.th; b!==a&&(this.O.th=a,this.g("toShortLength",b,a),Fl(this))}},toLinkable:{get:function(){return null!==this.O?this.O.Ip:null},set:function(a){this.Ec();var b=this.O.Ip;b!==a&&(this.O.Ip=a,this.g("toLinkable",b,a))}},toMaxLinks:{get:function(){return null!==this.O?this.O.Jp:Infinity},set:function(a){this.Ec();var b=this.O.Jp;b!==a&&(0>a&&va(a,">= 0",Y,"toMaxLinks"),this.O.Jp=a,this.g("toMaxLinks",b,a))}},fromSpot:{ get:function(){return null!==this.O?this.O.Vg:wc},set:function(a){this.Ec();var b=this.O.Vg;b.A(a)||(a=a.G(),this.O.Vg=a,this.g("fromSpot",b,a),Fl(this))}},fromEndSegmentLength:{get:function(){return null!==this.O?this.O.Tg:10},set:function(a){this.Ec();var b=this.O.Tg;b!==a&&(0>a&&va(a,">= 0",Y,"fromEndSegmentLength"),this.O.Tg=a,this.g("fromEndSegmentLength",b,a),Fl(this))}},fromShortLength:{get:function(){return null!==this.O?this.O.Ug: 0},set:function(a){this.Ec();var b=this.O.Ug;b!==a&&(this.O.Ug=a,this.g("fromShortLength",b,a),Fl(this))}},fromLinkable:{get:function(){return null!==this.O?this.O.Dn:null},set:function(a){this.Ec();var b=this.O.Dn;b!==a&&(this.O.Dn=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{get:function(){return null!==this.O?this.O.En:Infinity},set:function(a){this.Ec();var b=this.O.En;b!==a&&(0>a&&va(a,">= 0",Y,"fromMaxLinks"),this.O.En=a,this.g("fromMaxLinks", b,a))}},cursor:{get:function(){return this.$h},set:function(a){var b=this.$h;b!==a&&(this.$h=a,this.g("cursor",b,a))}},click:{get:function(){return null!==this.M?this.M.Jf:null},set:function(a){al(this);var b=this.M.Jf;b!==a&&(this.M.Jf=a,this.g("click",b,a))}},doubleClick:{get:function(){return null!==this.M?this.M.Of:null},set:function(a){al(this);var b=this.M.Of;b!==a&&(this.M.Of=a,this.g("doubleClick",b, a))}},contextClick:{get:function(){return null!==this.M?this.M.Kf:null},set:function(a){al(this);var b=this.M.Kf;b!==a&&(this.M.Kf=a,this.g("contextClick",b,a))}},mouseEnter:{get:function(){return null!==this.M?this.M.ag:null},set:function(a){al(this);var b=this.M.ag;b!==a&&(this.M.ag=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return null!==this.M?this.M.dg:null},set:function(a){al(this);var b= this.M.dg;b!==a&&(this.M.dg=a,this.g("mouseLeave",b,a))}},mouseOver:{get:function(){return null!==this.M?this.M.eg:null},set:function(a){al(this);var b=this.M.eg;b!==a&&(this.M.eg=a,this.g("mouseOver",b,a))}},mouseHover:{get:function(){return null!==this.M?this.M.cg:null},set:function(a){al(this);var b=this.M.cg;b!==a&&(this.M.cg=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return null!==this.M?this.M.bg: null},set:function(a){al(this);var b=this.M.bg;b!==a&&(this.M.bg=a,this.g("mouseHold",b,a))}},mouseDragEnter:{get:function(){return null!==this.M?this.M.uo:null},set:function(a){al(this);var b=this.M.uo;b!==a&&(this.M.uo=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{get:function(){return null!==this.M?this.M.vo:null},set:function(a){al(this);var b=this.M.vo;b!==a&&(this.M.vo=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{ get:function(){return null!==this.M?this.M.$f:null},set:function(a){al(this);var b=this.M.$f;b!==a&&(this.M.$f=a,this.g("mouseDrop",b,a))}},actionDown:{get:function(){return null!==this.M?this.M.Mm:null},set:function(a){al(this);var b=this.M.Mm;b!==a&&(this.M.Mm=a,this.g("actionDown",b,a))}},actionMove:{get:function(){return null!==this.M?this.M.Nm:null},set:function(a){al(this);var b=this.M.Nm;b!==a&&(this.M.Nm=a,this.g("actionMove", b,a))}},actionUp:{get:function(){return null!==this.M?this.M.Om:null},set:function(a){al(this);var b=this.M.Om;b!==a&&(this.M.Om=a,this.g("actionUp",b,a))}},actionCancel:{get:function(){return null!==this.M?this.M.Lm:null},set:function(a){al(this);var b=this.M.Lm;b!==a&&(this.M.Lm=a,this.g("actionCancel",b,a))}},toolTip:{get:function(){return null!==this.M?this.M.qg:null},set:function(a){al(this);var b=this.M.qg; b!==a&&(this.M.qg=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return null!==this.M?this.M.Lf:null},set:function(a){al(this);var b=this.M.Lf;b!==a&&(this.M.Lf=a,this.g("contextMenu",b,a))}}});Y.prototype.setProperties=Y.prototype.Uv;Y.prototype.findTemplateBinder=Y.prototype.Oi;Y.prototype.bind=Y.prototype.bind;Y.prototype.isEnabledObject=Y.prototype.Bg;Y.prototype.isVisibleObject=Y.prototype.vf;Y.prototype.isContainedBy=Y.prototype.Ag; Y.prototype.getNearestIntersectionPoint=Y.prototype.Sc;Y.prototype.getLocalPoint=Y.prototype.$s;Y.prototype.getDocumentScale=Y.prototype.qf;Y.prototype.getDocumentAngle=Y.prototype.Ri;Y.prototype.getDocumentBounds=Y.prototype.cq;Y.prototype.getDocumentPoint=Y.prototype.ga;Y.prototype.intersectsRect=Y.prototype.Gc;Y.prototype.containedInRect=Y.prototype.Bh;Y.prototype.containsRect=Y.prototype.nf;Y.prototype.containsPoint=Y.prototype.$;Y.prototype.raiseChanged=Y.prototype.g; Y.prototype.raiseChangedEvent=Y.prototype.Ya;Y.prototype.addCopyProperty=Y.prototype.gx;var Kl=null;Y.className="GraphObject";Kl=new G; Ol("Button",function(){function a(a,b){return null!==a.diagram.Sb(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=Jl(X,X.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof X){var c=a.Xa("ButtonBorder");null!==c&&(c.fill=b?a._buttonFillNormal:a._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD", _buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Jl(W,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new O(0,0,2.76142374915397,2.761423749153969),spot2:new O(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Bg()&&b instanceof X&&(a=b.Xa("ButtonBorder"),a instanceof W)){var c=b._buttonFillOver;b._buttonFillNormal=a.fill;a.fill=c;c=b._buttonStrokeOver;b._buttonStrokeNormal=a.stroke;a.stroke=c}}; b.mouseLeave=function(a,b){b.Bg()&&b instanceof X&&(a=b.Xa("ButtonBorder"),a instanceof W&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Bg()&&b instanceof X&&null!==b._buttonFillPressed&&0===a.button){var c=b.Xa("ButtonBorder");if(c instanceof W){a=a.diagram;var d=a.skipsUndoManager;a.skipsUndoManager=!0;var g=b._buttonFillPressed;b._buttonFillOver=c.fill;c.fill=g;g=b._buttonStrokePressed;b._buttonStrokeOver=c.stroke;c.stroke=g;a.skipsUndoManager=d}}}; b.actionUp=function(b,d){if(d.Bg()&&d instanceof X&&null!==d._buttonFillPressed&&0===b.button){var c=d.Xa("ButtonBorder");if(c instanceof W){var f=b.diagram,g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionCancel=function(b,d){if(d.Bg()&&d instanceof X&&null!==d._buttonFillPressed){var c=d.Xa("ButtonBorder");if(c instanceof W){var f=b.diagram,g=f.skipsUndoManager; f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionMove=function(b,d){if(d.Bg()&&d instanceof X&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.Xa("ButtonBorder"),b instanceof W))){var f=c.skipsUndoManager;c.skipsUndoManager=!0;var g=d._buttonFillPressed;b.fill!==g&&(b.fill=g);g=d._buttonStrokePressed; b.stroke!==g&&(b.stroke=g);c.skipsUndoManager=f}}};return b}); Ol("TreeExpanderButton",function(){var a=Jl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Jl(W,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ob},(new Ji("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).pq()),{visible:!1},(new Ji("visible","isTreeLeaf",function(a){return!a})).pq());a.click=function(a,c){c=c.part;c instanceof De&&(c=c.adornedPart);if(c instanceof U){var b=c.diagram; if(null!==b){b=b.commandHandler;if(c.isTreeExpanded){if(!b.canCollapseTree(c))return}else if(!b.canExpandTree(c))return;a.handled=!0;c.isTreeExpanded?b.collapseTree(c):b.expandTree(c)}}};return a}); Ol("SubGraphExpanderButton",function(){var a=Jl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Jl(W,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ob},(new Ji("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).pq()));a.click=function(a,c){c=c.part;c instanceof De&&(c=c.adornedPart);if(c instanceof S){var b=c.diagram;if(null!==b){b=b.commandHandler;if(c.isSubGraphExpanded){if(!b.canCollapseSubGraph(c))return}else if(!b.canExpandSubGraph(c))return; a.handled=!0;c.isSubGraphExpanded?b.collapseSubGraph(c):b.expandSubGraph(c)}}};return a});Ol("ToolTip",function(){return Jl(De,X.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new H(0,3),shadowBlur:5},Jl(W,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new O(0,0,4,6),spot2:new O(1,1,-4,-4)}))}); Ol("ContextMenu",function(){return Jl(De,X.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new H(0,3),shadowBlur:5},new Ji("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});Ol("ContextMenuButton",function(){var a=Jl("Button");a.stretch=Vk;var b=a.Xa("ButtonBorder");b instanceof W&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new O(0,0,2,3),b.spot2=new O(1,1,-2,-2));return a}); Ol("PanelExpanderButton",function(a){var b=Pl(a,"COLLAPSIBLE"),c=Jl("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},Jl(W,{name:"ButtonIcon",strokeWidth:2},(new Ji("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).pq(b))); a=c.Xa("ButtonBorder");a instanceof W&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)");c.click=function(a,c){var d=c.diagram;if(null!==d&&!d.isReadOnly){var e=c.Oi();null===e&&(e=c.part);null!==e&&(c=e.Xa(b),null!==c&&(a.handled=!0,d.ta("Collapse/Expand Panel"),c.visible=!c.visible,d.Ua("Collapse/Expand Panel")))}};return c}); Ol("CheckBoxButton",function(a){var b=Pl(a);a=Jl("Button",{desiredSize:new Kb(14,14)},Jl(W,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:wd,geometryStretch:Cg,visible:!1},""!==b?(new Ji("visible",b)).Jx():[]));a.click=function(a,d){if(d instanceof X){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.Xa("ButtonIcon");c.ta("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.Ua("checkbox")}}};return a}); Ol("CheckBox",function(a){a=Pl(a);a=Jl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new pc(0,1,0,0)});var b=Jl(X,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave, actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});a.mouseEnter=null;a.mouseLeave=null;a.actionDown=null;a.actionUp=null;a.actionCancel=null;a.actionMove=null;a.click=null;return b});Y.None=Ag=new D(Y,"None",0);Y.Default=Uk=new D(Y,"Default",0);Y.Vertical=Wk=new D(Y,"Vertical",4);Y.Horizontal=Vk=new D(Y,"Horizontal",5);Y.Fill=wd=new D(Y,"Fill",3);Y.Uniform=Cg=new D(Y,"Uniform",1); Y.UniformToFill=Xk=new D(Y,"UniformToFill",2);Y.FlipVertical=Yk=new D(Y,"FlipVertical",1);Y.FlipHorizontal=Zk=new D(Y,"FlipHorizontal",2);Y.FlipBoth=$k=new D(Y,"FlipBoth",3);Y.make=Jl;Y.getBuilders=function(){var a=new G,b;for(b in Kl)if(b!==b.toLowerCase()){var c=Kl.H(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};Y.defineBuilder=Ol;Y.takeBuilderArgument=Pl; function bl(){this.zn=this.Lf=this.qg=this.Lm=this.Om=this.Nm=this.Mm=this.$f=this.vo=this.uo=this.bg=this.cg=this.eg=this.dg=this.ag=this.Kf=this.Of=this.Jf=null}bl.prototype.copy=function(){var a=new bl;a.Jf=this.Jf;a.Of=this.Of;a.Kf=this.Kf;a.ag=this.ag;a.dg=this.dg;a.eg=this.eg;a.cg=this.cg;a.bg=this.bg;a.uo=this.uo;a.vo=this.vo;a.$f=this.$f;a.Mm=this.Mm;a.Nm=this.Nm;a.Om=this.Om;a.Lm=this.Lm;a.qg=this.qg;a.Lf=this.Lf;a.zn=this.zn;return a};bl.className="GraphObjectEventHandlers"; function Tl(){this.La=[1,0,0,1,0,0]}Tl.prototype.copy=function(){var a=new Tl;a.La[0]=this.La[0];a.La[1]=this.La[1];a.La[2]=this.La[2];a.La[3]=this.La[3];a.La[4]=this.La[4];a.La[5]=this.La[5];return a};Tl.prototype.translate=function(a,b){this.La[4]+=this.La[0]*a+this.La[2]*b;this.La[5]+=this.La[1]*a+this.La[3]*b};Tl.prototype.scale=function(a,b){this.La[0]*=a;this.La[1]*=a;this.La[2]*=b;this.La[3]*=b};Tl.className="STransform"; function Ul(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.ox=[];this.pattern=null}Ul.prototype.addColorStop=function(a,b){this.ox.push({offset:a,color:b})};Ul.className="SGradient"; function Bj(a,b){this.ownerDocument=a=void 0===b?x.document:b;this.Xz="http://www.w3.org/2000/svg";void 0!==a&&(this.Da=this.ub("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Da.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Da.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.Yp=null;this.context=new Vl(this)} Bj.prototype.resize=function(a,b,c,d){return this.width!==a||this.height!==b?(this.style.width=c+"px",this.style.height=d+"px",this.Da.setAttributeNS(null,"width",c+"px"),this.Da.setAttributeNS(null,"height",d+"px"),this.Da.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.ju.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.ju.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Bj.prototype.ub=function(a,b,c){a=this.ownerDocument.createElementNS(this.Xz,a);if(ya(b))for(var d in b)a.setAttributeNS("href"===d?"http://www.w3.org/1999/xlink":"",d,b[d]);void 0!==c&&(a.textContent=c);return a};Bj.prototype.getBoundingClientRect=function(){return this.Da.getBoundingClientRect()};Bj.prototype.focus=function(){this.Da.focus()};Bj.prototype.ux=function(){this.ownerDocument=null}; ma.Object.defineProperties(Bj.prototype,{width:{get:function(){return this.Da.width.baseVal.value},set:function(a){this.Da.width=a}},height:{get:function(){return this.Da.height.baseVal.value},set:function(a){this.Da.height=a}},style:{get:function(){return this.Da.style}}});Bj.className="SVGSurface"; function Vl(a){this.tk=a;this.svg=a.Da;this.stack=[];this.wc=[];this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.lineDashOffset=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.$e=this.wp=this.vp=0;this.jq=null;this.path=[];this.eu=!1;this.nh=null;this.oh=0;this.Rd=new Tl; Wl(this,1,0,0,1,0,0);var b=rb++,c=this.ub("clipPath",{id:"mainClip"+b});c.appendChild(this.ub("rect",{x:0,y:0,width:a.width,height:a.height}));this.ju=c;this.tk.Da.appendChild(c);this.wc[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.Zz={}}t=Vl.prototype; t.reset=function(){this.stack=[];this.wc=[];this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.lineDashOffset=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.$e=this.wp=this.vp=0;this.jq=null;this.path=[];this.Rd=new Tl;Wl(this,1,0,0,1,0,0);var a=rb++,b=this.ub("clipPath", {id:"mainClip"+a});b.appendChild(this.ub("rect",{x:0,y:0,width:this.tk.width,height:this.tk.height}));this.ju=b;this.tk.Da.appendChild(b);this.wc[0].setAttributeNS(null,"clip-path","url(#mainClip"+a+")")}; t.arc=function(a,b,c,d,e,f,g,h){var k=2*Math.PI,l=k-1E-6,m=c*Math.cos(d),n=c*Math.sin(d),p=a+m,r=b+n,q=f?0:1;d=f?d-e:e-d;(1E-6d&&(d=d%k+k);d>l?(this.path.push(["A",c,c,0,1,q,a-m,b-n]),this.path.push(["A",c,c,0,1,q,p,r])):1E-6=Math.PI),q,a+c*Math.cos(e),b+c*Math.sin(e)])};t.beginPath=function(){this.path=[]};t.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};t.clearRect=function(){}; t.clip=function(){this.addPath("clipPath",this.path,this.Rd);this.addPath("clipPath",this.path,new Tl)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new Ul("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e}; t.createPattern=function(a){var b="";a instanceof HTMLCanvasElement&&(b=a.toDataURL());a instanceof HTMLImageElement&&(b=a.getAttribute("src"));var c=this.Zz;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+rb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.ub("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.ub("image",e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new Ul("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g}; t.drawImage=function(a,b,c,d,e,f,g,h,k){var l="";a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width,n=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(f=b,g=c,h=d=m,k=e=n);d=d||0;e=e||0;f=f||0;g=g||0;h=h||0;k=k||0;l={x:0,y:0,width:m||d,height:n||e,href:l,preserveAspectRatio:"xMidYMid slice"};I.Z(d,h)&&I.Z(e,k)||(l.preserveAspectRatio="none");a="";h/=d;k/=e;if(0!==f|| 0!==g)a+=" translate("+f+", "+g+")";if(1!==h||1!==k)a+=" scale("+h+", "+k+")";if(0!==b||0!==c)a+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==m||e!==n)f="CLIP"+rb++,g=this.ub("clipPath",{id:f}),g.appendChild(this.ub("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),l["clip-path"]="url(#"+f+")";Xl(this,"image",l,this.Rd,a);this.addElement("image",l)};t.fill=function(){this.addPath("fill",this.path,this.Rd)};t.Sd=function(){this.clipInsteadOfFill?this.clip():this.fill()}; t.fillRect=function(a,b,c,d){a=[a,b,c,d];a={x:a[0],y:a[1],width:a[2],height:a[3]};Xl(this,"fill",a,this.Rd);this.addElement("rect",a)};t.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};Xl(this,"fill",b,this.Rd);this.addElement("text",b,a[0])};t.lineTo=function(a,b){this.path.push(["L",a,b])};t.moveTo=function(a,b){this.path.push(["M",a,b])}; t.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};t.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"])}; t.restore=function(){this.Rd=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.lineDashOffset=a.lineDashOffset;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}; t.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,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(e=0;ee.width+e.x||e.x>k.width+k.x||n>e.height+e.y||e.y>k.height+k.y)return!0;k=!0;Wl(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.tf()&&!this.isVisible())return!0;a.Rd.La=[1,0,0,1,0,0];(this instanceof Xg&&1b?(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.an?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.an?this.clip():this.fill()};t.aj=function(){this.an||this.stroke()};t.Vv=function(a,b,c){this.vp=a;this.wp=b;this.$e=c}; t.Ts=function(a,b){var c=this.V;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.Rs=function(){var a=this.V;void 0!==a.setLineDash&&(a.setLineDash(Zl),a.lineDashOffset=0)};t.Qc=function(a){a&&(this.Lt="");this.Kt=this.Mt=""}; ma.Object.defineProperties(wl.prototype,{fillStyle:{get:function(){return this.V.fillStyle},set:function(a){this.Kt!==a&&(this.Kt=this.V.fillStyle=a)}},font:{get:function(){return this.V.font},set:function(a){this.Lt!==a&&(this.Lt=this.V.font=a)}},globalAlpha:{get:function(){return this.V.globalAlpha},set:function(a){this.V.globalAlpha=a}},lineCap:{get:function(){return this.V.lineCap}, set:function(a){this.V.lineCap=a}},lineDashOffset:{get:function(){return this.V.lineDashOffset},set:function(a){this.V.lineDashOffset=a}},lineJoin:{get:function(){return this.V.lineJoin},set:function(a){this.V.lineJoin=a}},lineWidth:{get:function(){return this.V.lineWidth},set:function(a){this.V.lineWidth=a}},miterLimit:{get:function(){return this.V.miterLimit},set:function(a){this.V.miterLimit= a}},shadowBlur:{get:function(){return this.V.shadowBlur},set:function(a){this.V.shadowBlur=a}},shadowColor:{get:function(){return this.V.shadowColor},set:function(a){this.V.shadowColor=a}},shadowOffsetX:{get:function(){return this.V.shadowOffsetX},set:function(a){this.V.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.V.shadowOffsetY},set:function(a){this.V.shadowOffsetY= a}},strokeStyle:{get:function(){return this.V.strokeStyle},set:function(a){this.Mt!==a&&(this.Mt=this.V.strokeStyle=a)}},textAlign:{get:function(){return this.V.textAlign},set:function(a){this.V.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.V.imageSmoothingEnabled},set:function(a){this.V.imageSmoothingEnabled=a}},clipInsteadOfFill:{get:function(){return this.an}, set:function(a){this.an=a}}});var Zl=Object.freeze([]);wl.className="CanvasSurfaceContext";function $l(){this.Y=this.u=this.I=this.l=0}$l.className="ColorNumbers";function sl(a){am||(bm(),am=!0);Za(this);this.s=!1;void 0===a?(this.qa=vl,this.Gk="black"):"string"===typeof a?(this.qa=vl,this.Gk=a):(this.qa=a,this.Gk="black");a=this.qa;a===yl?(this.rd=yc,this.Uk=Gc):this.Uk=a===tl?this.rd=Bc:this.rd=wc;this.As=0;this.nr=NaN;this.ae=this.js=this.$d=null;this.Nt=this.Hk=0} sl.prototype.copy=function(){var a=new sl;a.qa=this.qa;a.Gk=this.Gk;a.rd=this.rd.G();a.Uk=this.Uk.G();a.As=this.As;a.nr=this.nr;null!==this.$d&&(a.$d=this.$d.copy());a.js=this.js;return a};t=sl.prototype;t.freeze=function(){this.s=!0;null!==this.$d&&this.$d.freeze();return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;null!==this.$d&&this.$d.ea();return this};t.cb=function(a){a.classType===sl&&(this.type=a)}; t.toString=function(){var a="Brush(";if(this.type===vl)a+=this.color;else if(a=this.type===yl?a+"Linear ":this.type===tl?a+"Radial ":this.type===xl?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.colorStops)for(var b=this.colorStops.iterator;b.next();)a+=" "+b.key+":"+b.value;return a+")"}; t.addColorStop=function(a,b){this.s&&ua(this);("number"!==typeof a||!isFinite(a)||1a)&&va(a,"0 <= loc <= 1",sl,"addColorStop:loc");null===this.$d&&(this.$d=new G);this.$d.add(a,b);this.qa===vl&&(this.type=yl);this.ae=null;return this}; t.Rz=function(a,b){this.s&&ua(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?cm:b;if(this.type===vl)Qh(this.color),this.color=dm(a,b);else if((this.type===yl||this.type===tl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Qh(c.value),this.addColorStop(c.key,dm(a,b));return this};function em(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?cm:c;Qh(a);return dm(b,c)} t.Ny=function(a,b){this.s&&ua(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?cm:b;if(this.type===vl)Qh(this.color),this.color=dm(-a,b);else if((this.type===yl||this.type===tl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Qh(c.value),this.addColorStop(c.key,dm(-a,b));return this};function fm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?cm:c;Qh(a);return dm(-b,c)} function gm(a,b,c){Qh(a);a=hm.l;var d=hm.I,e=hm.u,f=hm.Y;Qh(b);void 0===c&&(c=.5);return"rgba("+Math.round((hm.l-a)*c+a)+", "+Math.round((hm.I-d)*c+d)+", "+Math.round((hm.u-e)*c+e)+", "+Math.round((hm.Y-f)*c+f)+")"} t.Gx=function(){if(this.type===vl)return im(this.color);if((this.type===yl||this.type===tl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===tl)return im(a.first().value);if(null!==a.get(.5))return im(a.get(.5));if(2===a.count)return a=a.ma(),im(gm(a[0].value,a[1].value));for(var b=a.iterator,c=-1,d=-1,e=1,f=1;b.next();){var g=b.key,h=Math.abs(.5-b.key);e>f&&h=e&&hd&&(c=[d,d=c][0]);b=d-c;return im(gm(a.get(c),a.get(d),1-e/b))}return!1}; function im(a){if(null===a)return null;if(a instanceof sl)return a.Gx();Qh(a);return 128>(299*hm.l+587*hm.I+114*hm.u)/1E3} function dm(a,b){switch(b){case cm:b=100*jm(hm.l);var c=100*jm(hm.I),d=100*jm(hm.u);km.l=.4124564*b+.3575761*c+.1804375*d;km.I=.2126729*b+.7151522*c+.072175*d;km.u=.0193339*b+.119192*c+.9503041*d;km.Y=hm.Y;b=lm(km.l/mm[0]);c=lm(km.I/mm[1]);d=lm(km.u/mm[2]);nm.l=116*c-16;nm.I=500*(b-c);nm.u=200*(c-d);nm.Y=km.Y;nm.l=Math.min(100,Math.max(0,nm.l+100*a));a=(nm.l+16)/116;b=a-nm.u/200;km.l=mm[0]*om(nm.I/500+a);km.I=mm[1]*(nm.l>pm*qm?Math.pow(a,3):nm.l/pm);km.u=mm[2]*om(b);km.Y=nm.Y;a=-.969266*km.l+1.8760108* km.I+.041556*km.u;b=.0556434*km.l+-.2040259*km.I+1.0572252*km.u;hm.l=255*rm((3.2404542*km.l+-1.5371385*km.I+-.4985314*km.u)/100);hm.I=255*rm(a/100);hm.u=255*rm(b/100);hm.Y=km.Y;hm.l=Math.round(hm.l);255hm.l&&(hm.l=0);hm.I=Math.round(hm.I);255hm.I&&(hm.I=0);hm.u=Math.round(hm.u);255hm.u&&(hm.u=0);return"rgba("+hm.l+", "+hm.I+", "+hm.u+", "+hm.Y+")";case sm:return Rh(),Sh.u=Math.min(100,Math.max(0,Sh.u+100*a)),"hsla("+Sh.l+", "+Sh.I+"%, "+Sh.u+"%, "+ Sh.Y+")";default:return B("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}}function Qh(a){am||(bm(),am=!0);var b=tm;if(null!==b){b.clearRect(0,0,1,1);b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;b.fillStyle!==c?(b.fillRect(0,0,1,1),a=b.getImageData(0,0,1,1).data,hm.l=a[0],hm.I=a[1],hm.u=a[2],hm.Y=a[3]/255):(b.fillStyle="#FFFFFF",b.fillStyle=a,hm.l=0,hm.I=0,hm.u=0,hm.Y=1)}} function Rh(){var a=hm.l/255,b=hm.I/255,c=hm.u/255,d=Math.max(a,b,c),e=Math.min(a,b,c),f=d-e;e=(d+e)/2;if(0===f)var g=a=0;else{switch(d){case a:g=(b-c)/f%6;break;case b:g=(c-a)/f+2;break;case c:g=(a-b)/f+4}g*=60;0>g&&(g+=360);a=f/(1-Math.abs(2*e-1))}Sh.l=Math.round(g);Sh.I=Math.round(100*a);Sh.u=Math.round(100*e);Sh.Y=hm.Y}function jm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function rm(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} function lm(a){return a>qm?Math.pow(a,1/3):(pm*a+16)/116}function om(a){var b=a*a*a;return b>qm?b:(116*a-16)/pm}function Ql(a,b){"string"!==typeof a&&(a instanceof sl||B("Value for "+b+" must be a color string or a Brush, not "+a))}function bm(){tm=Vg?(new Dk(null)).context:null} ma.Object.defineProperties(sl.prototype,{type:{get:function(){return this.qa},set:function(a){this.s&&ua(this,a);this.qa=a;this.start.jc()&&(a===yl?this.start=yc:a===tl&&(this.start=Bc));this.end.jc()&&(a===yl?this.end=Gc:a===tl&&(this.end=Bc));this.ae=null}},color:{get:function(){return this.Gk},set:function(a){this.s&&ua(this,a);this.Gk=a;this.ae=null}},start:{get:function(){return this.rd},set:function(a){this.s&& ua(this,a);this.rd=a.G();this.ae=null}},end:{get:function(){return this.Uk},set:function(a){this.s&&ua(this,a);this.Uk=a.G();this.ae=null}},startRadius:{get:function(){return this.As},set:function(a){this.s&&ua(this,a);0>a&&va(a,">= zero",sl,"startRadius");this.As=a;this.ae=null}},endRadius:{get:function(){return this.nr},set:function(a){this.s&&ua(this,a);0>a&&va(a,">= zero",sl,"endRadius");this.nr=a;this.ae= null}},colorStops:{get:function(){return this.$d},set:function(a){this.s&&ua(this,a);this.$d=a;this.ae=null}},pattern:{get:function(){return this.js},set:function(a){this.s&&ua(this,a);this.js=a;this.ae=null}}});sl.prototype.isDark=sl.prototype.Gx;sl.prototype.darkenBy=sl.prototype.Ny;sl.prototype.lightenBy=sl.prototype.Rz;sl.prototype.addColorStop=sl.prototype.addColorStop; var qm=216/24389,pm=24389/27,mm=[95.047,100,108.883],tm=null,hm=new $l,Sh=new $l,km=new $l,nm=new $l,am=!1;sl.className="Brush";var vl;sl.Solid=vl=new D(sl,"Solid",0);var yl;sl.Linear=yl=new D(sl,"Linear",1);var tl;sl.Radial=tl=new D(sl,"Radial",2);var xl;sl.Pattern=xl=new D(sl,"Pattern",4);var cm;sl.Lab=cm=new D(sl,"Lab",5);var sm;sl.HSL=sm=new D(sl,"HSL",6); sl.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a);b=Math.floor(a+Math.random()*c).toString(16);var d=Math.floor(a+Math.random()*c).toString(16);a=Math.floor(a+Math.random()*c).toString(16);2>b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+a}; sl.isValidColor=function(a){if("black"===a)return!0;if(""===a)return!1;am||(bm(),am=!0);var b=tm;if(null===b)return!0;b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;if(b.fillStyle!==c)return!0;b.fillStyle="#FFFFFF";c=b.fillStyle;b.fillStyle=a;return b.fillStyle!==c};sl.lighten=function(a){return em(a)};sl.lightenBy=em;sl.darken=function(a){return fm(a)};sl.darkenBy=fm;sl.mix=gm;sl.isDark=im;function Nl(){this.name="Base"}Nl.prototype.measure=function(){}; Nl.prototype.Uz=function(a,b,c,d,e){a.measure(b,c,d,e)};Nl.prototype.arrange=function(){};Nl.prototype.Dy=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};Nl.prototype.tb=function(){};ma.Object.defineProperties(Nl.prototype,{classType:{get:function(){return X}}});Nl.prototype.arrangeElement=Nl.prototype.Dy;Nl.prototype.measureElement=Nl.prototype.Uz;Nl.className="PanelLayout";function um(){this.name="Base";this.name="Position"}la(um,Nl); um.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=vm(a);for(var k=0;kR&&(kb=Math.max(R-kh,0));var pn=0===N.actual;N.actual=N.actual+kb;R=Math.max(R-(kb+(pn?kh:0)),0)}if(1===Cc.columnSpan&&(Db===Ag||Db===Wk)){N=a.getColumnDefinition(vc); var cg=N.tc();kb=Math.max(Vc-N.actual,0);kb+cg>V&&(kb=Math.max(V-cg,0));var Rj=0===N.actual;N.actual=N.actual+kb;V=Math.max(V-(kb+(Rj?cg:0)),0)}Bf&&Cc.im()}}}}}Fa(A);var Wb=0,Oc=0;h=a.columnCount;for(var ac=0;ac=a.rowCount);Ge++)N=a.getRowDefinition(Ma.row+Ge),kb=0, kb=Db===wd||Db===Wk?Math.max(N.minimum,0===Wc[Ma.row+Ge]?N.maximum:Math.min(Wc[Ma.row+Ge],N.maximum)):Math.max(N.minimum,isNaN(N.Oc)?N.maximum:Math.min(N.Oc,N.maximum)),Cd.height+=kb;for(var Ef=1;Ef=a.columnCount);Ef++)N=a.getColumnDefinition(Ma.column+Ef),kb=0,kb=Db===wd||Db===Vk?Math.max(N.minimum,0===ie[Ma.column+Ef]?N.maximum:Math.min(ie[Ma.column+Ef],N.maximum)):Math.max(N.minimum,isNaN(N.Oc)?N.maximum:Math.min(N.Oc,N.maximum)),Cd.width+=kb;ab.width+=Cd.width;ab.height+= Cd.height;var cf=Ma.margin,Qd=cf.right+cf.left,He=cf.top+cf.bottom;Ma.measure(ab.width,ab.height,f,g);for(var df=Ma.measuredBounds,Ie=Math.max(df.width+Qd,0),Je=Math.max(df.height+He,0),md=0,jg=0;jg=a.rowCount);jg++)N=a.getRowDefinition(Ma.row+jg),md+=N.total||0;if(md=ke)&&!(Ma.row+nd>=a.rowCount);nd++){N=a.getRowDefinition(Ma.row+nd);var kg=N.ha||0,vn=un(Ma,N,tn);N.actual= Math.min(N.maximum,kg+vn);N.ha!==kg&&(ke-=N.ha-kg)}for(;0qh&&(N.actual=Math.min(N.maximum,qh+ke),N.ha!==qh&&(ke-=N.ha-qh));if(0===N.index)break;N=a.getRowDefinition(N.index-1)}}for(var Uj=0,Vj=0;Vj=a.columnCount);Vj++)N=a.getColumnDefinition(Ma.column+Vj),Uj+=N.total||0;if(Uj=ti)&&!(Ma.column+Wj>=a.columnCount);Wj++){N= a.getColumnDefinition(Ma.column+Wj);var wn=N.ha||0,Mt=Lt(Ma,N,Kt);N.actual=Math.min(N.maximum,wn+Mt);N.ha!==wn&&(ti-=N.ha-wn)}for(;0Xj&&(N.actual=Math.min(N.maximum,Xj+ti),N.ha!==Xj&&(ti-=N.ha-Xj));if(0===N.index)break;N=a.getColumnDefinition(N.index-1)}}}}Fa(C);Kb.free(Cd);Kb.free(ab);void 0!==Wc&&Fa(Wc);void 0!==ie&&Fa(ie);var lg=0,mg=0,Yj=a.desiredSize,hr=a.maxSize;Db=jl(a,!0);var ui=Oc=Wb=0,vi=0;h=a.columnCount;for(var Zj=0;Zj=a.rowCount);L++)K=a.getRowDefinition(q+L),r.height+=K.total;for(L=1;L=a.columnCount);L++)K=a.getColumnDefinition(v+L),r.width+=K.total;var V=w.ha+r.width,R=u.ha+r.height;L= h;K=k;var ea=V,pa=R,N=h,Ga=k,Pa=V,hb=R;h+V>c.width&&(Pa=Math.max(c.width-h,0));k+R>c.height&&(hb=Math.max(c.height-k,0));var Ka=C.alignment;if(Ka.Mb()){Ka=a.defaultAlignment;Ka.eb()||(Ka=Bc);var mb=Ka.x;var yd=Ka.y;var kb=Ka.offsetX;Ka=Ka.offsetY;var $b=w.alignment,Ya=u.alignment;$b.eb()&&(mb=$b.x,kb=$b.offsetX);Ya.eb()&&(yd=Ya.y,Ka=Ya.offsetY)}else mb=Ka.x,yd=Ka.y,kb=Ka.offsetX,Ka=Ka.offsetY;if(isNaN(mb)||isNaN(yd))yd=mb=.5,Ka=kb=0;$b=J.width;Ya=J.height;var Nd=C.margin,vc=Nd.left+Nd.right,Af=Nd.top+ Nd.bottom,Ze=Cl(C,u,w,!1);!isNaN(C.desiredSize.width)||Ze!==wd&&Ze!==Vk||($b=Math.max(V-vc,0));!isNaN(C.desiredSize.height)||Ze!==wd&&Ze!==Wk||(Ya=Math.max(R-Af,0));V=C.maxSize;R=C.minSize;$b=Math.min(V.width,$b);Ya=Math.min(V.height,Ya);$b=Math.max(R.width,$b);Ya=Math.max(R.height,Ya);V=Ya+Af;L+=ea*mb-($b+vc)*mb+kb+Nd.left;K+=pa*yd-V*yd+Ka+Nd.top;C.visible&&(kc(N,Ga,Pa,hb,L,K,J.width,J.height)?C.arrange(L,K,$b,Ya):C.arrange(L,K,$b,Ya,new M(N,Ga,Pa,hb)))}else C.jl(),C.actualBounds.ea(),ea=C.actualBounds, L=M.allocAt(ea.x,ea.y,ea.width,ea.height),ea.x=K.type===X.TableRow?f:h,ea.y=K.type===X.TableColumn?e:k,ea.width=J.width,ea.height=J.height,C.actualBounds.freeze(),kl(C,!1),bc(L,ea)||(J=C.part,null!==J&&(J.Eh(),C.Ho(J))),M.free(L)}}}Kb.free(r);for(a=0;a=c&&(c=1);var d=a.gridCellSize,e=d.width;d=d.height;var f=a.naturalBounds,g=a.actualBounds,h=f.width,k=f.height,l=Math.ceil(h/e),m=Math.ceil(k/d),n=a.gridOrigin;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();for(var p=[],r=a.W.j,q=r.length,u=0;ue*w*c))){v=A.opacity;y=1;if(1!==v){if(0===v)continue;y=b.globalAlpha;b.globalAlpha=y*v}z=p[u];var C=!1,J=A.strokeDashArray;null!==J&&(C=!0,b.Ts(J,A.strokeDashOffset));if("LineV"===A.figure&&null!==A.stroke){b.lineWidth=A.strokeWidth;ji(a,b,A.stroke,!1,!1,f,g);b.beginPath();for(J=A=Math.floor(-n.x/e);J<=A+l;J++){var K=J*e+n.x;0<=K&&K<=h&&Jm(J,w,z)&&(b.moveTo(K,0),b.lineTo(K,k))}b.stroke()}else if("LineH"===A.figure&&null!==A.stroke){b.lineWidth=A.strokeWidth;ji(a,b, A.stroke,!1,!1,f,g);b.beginPath();for(J=A=Math.floor(-n.y/d);J<=A+m;J++)K=J*d+n.y,0<=K&&K<=k&&Jm(J,w,z)&&(b.moveTo(0,K),b.lineTo(h,K));b.stroke()}else if("BarV"===A.figure&&null!==A.fill)for(ji(a,b,A.fill,!0,!1,f,g),A=A.width,isNaN(A)&&(A=e),K=J=Math.floor(-n.x/e);K<=J+l;K++){var L=K*e+n.x;0<=L&&L<=h&&Jm(K,w,z)&&b.fillRect(L,0,A,k)}else if("BarH"===A.figure&&null!==A.fill)for(ji(a,b,A.fill,!0,!1,f,g),A=A.height,isNaN(A)&&(A=d),K=J=Math.floor(-n.y/d);K<=J+m;K++)L=K*d+n.y,0<=L&&L<=k&&Jm(K,w,z)&&b.fillRect(0, L,h,A);C&&b.Rs();1!==v&&(b.globalAlpha=y)}}b.restore();b.Qc(!1)};function Jm(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;df)w.measure(Infinity,Infinity,0,0),y=w.measuredBounds,b.Hc(y),a.l.push(y);else{var z=w.segmentIndex;y=w.segmentFraction;var A=w.alignmentFocus;A.jc()&&(A=Bc);var C=w.segmentOrientation,J=w.segmentOffset;if(z<-f||z>=f){y=k.midPoint;var K=k.midAngle;if(C!==pg){var L=k.computeAngle(w,C, K);w.cc=L}L=y.x-m.x;var V=y.y-m.y}else{L=0;if(0<=z){V=n.L(z);var R=zpa+10?0<=z?K.Sa(V):V.Sa(K):pa>ea+10?0<=z?R.Sa(L):L.Sa(R):0<=z?K.Sa(L):L.Sa(K)}else K=0<=z?V.Sa(R):R.Sa(V);C!==pg&&(L=k.computeAngle(w,C,K),w.cc=L);L=V.x+(R.x-V.x)*y-m.x;V=V.y+(R.y-V.y)*y-m.y}w.measure(Infinity,Infinity,0,0);y=w.measuredBounds;R=w.naturalBounds; var N=0;w instanceof W&&(N=w.strokeWidth);ea=R.width+N;pa=R.height+N;h.reset();h.translate(-y.x,-y.y);h.scale(w.scale,w.scale);h.rotate(C===pg?w.angle:K,ea/2,pa/2);C!==Mm&&C!==Nm||h.rotate(90,ea/2,pa/2);C!==Om&&C!==Pm||h.rotate(-90,ea/2,pa/2);C===Qm&&(45K||225K)&&h.rotate(-K,ea/2,pa/2);R=new M(0,0,ea,pa);q.Zi(R,A);h.ra(q);A=-q.x+N/2*w.scale;w=-q.y+N/2*w.scale;u.assign(J);N=isNaN(J.x);var Ga=isNaN(J.y);if(N||Ga){ea=ea/2+3;pa=pa/2+3;var Pa=45<=K&&135>=K,hb=225<=K&&315>=K;C===pg&&(Pa|| hb)?(u.x=Ga?ea:J.y,u.y=N?pa:J.x,Pa?0<=z||!N||(u.y=-pa):hb&&(0<=z&&N&&(u.y=-pa),Ga&&(u.x=-ea))):(N&&(u.x=0<=z?ea:-ea),Ga&&(u.y=-pa),u.rotate(K))}else u.rotate(K);L+=u.x;V+=u.y;R.set(y);R.h(L+A,V+w,y.width,y.height);a.l.push(R);b.Hc(R)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.rg=b;a=a.location;a.h(a.x+b.x,a.y+b.y);Xb(e,b.width||0,b.height||0);sd.free(h);H.free(q);H.free(u)}}}}; Km.prototype.arrange=function(a,b){var c=b.length;if(a instanceof De||a instanceof Q){var d=null,e=null,f=null;a instanceof Q&&(e=d=a);a instanceof De&&(f=a,d=f.adornedPart);var g=a instanceof De?null:d.path;if(0!==a.l.length){var h=a.l,k=0;if(null!==g&&k=c){var q=n.midPoint;m=n.midAngle;r!==pg&&(n=n.computeAngle(g,r,m),g.angle=n);n=q.x;var u=q.y}else{var v=0;0<=h?(u=b.j[h],q=hy+10?0<=h?m.Sa(u):u.Sa(m):y>w+10?0<=h?q.Sa(v):v.Sa(q): 0<=h?m.Sa(v):v.Sa(m)}else m=0<=h?u.Sa(q):q.Sa(u);r!==pg&&(n=n.computeAngle(g,r,m),g.angle=n);n=u.x+(q.x-u.x)*p;u=u.y+(q.y-u.y)*p}l.it()?g.location=new H(n,u):(l.jc()&&(l=Bc),q=sd.alloc(),q.reset(),q.scale(g.scale,g.scale),q.rotate(g.angle,0,0),p=g.naturalBounds,p=M.allocAt(0,0,p.width,p.height),r=H.alloc(),r.Zi(p,l),q.ra(r),l=-r.x,v=-r.y,k=k.copy(),isNaN(k.x)&&(0<=h?k.x=r.x+3:k.x=-(r.x+3)),isNaN(k.y)&&(k.y=-(r.y+3)),k.rotate(m),n+=k.x,u+=k.y,q.bw(p),l+=p.x,v+=p.y,h=H.allocAt(n+l,u+v),g.move(h),H.free(h), H.free(r),M.free(p),sd.free(q))}null!==f?f.ik(!1):null!==e&&e.ik(!1)}};function Lm(a,b,c,d){if(!1!==rj(d)){var e=d.strokeWidth;0===e&&a instanceof De&&a.type===X.Link&&a.adornedObject instanceof W&&(e=a.adornedObject.strokeWidth);e*=d.ya;a instanceof Q&&null!==a.oa?(a=a.oa.bounds,gl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof De&&null!==a.adornedPart.oa?(a=a.adornedPart.oa.bounds,gl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):gl(d,-(e/2),-(e/2),b+e,c+e);mj(d,!1)}} function Rm(){this.name="Base";this.name="Graduated"}la(Rm,Nl); Rm.prototype.measure=function(a,b,c,d,e,f,g){var h=a.Ab();a.Wg=[];var k=h.margin,l=k.right+k.left,m=k.top+k.bottom;h.measure(b,c,f,g);var n=h.measuredBounds,p=new M(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.Wg.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,v=r.flattenedLengths,w=r.flattenedTotalLength,y=u.length,z=0,A=0,C=Da(),J=0;JN&&(N+=360);L.push(N)}z=ea;A=pa}C.push(L)}if(null===a.Xg){for(var Ga=[],Pa=a.W.j,hb=Pa.length,Ka=0;Kakb&&yd.push(Nd)}}}a.Xg=Ga}var vc=a.Xg;var Af=a.W.j,Ze=Af.length,Ee=0,jh=0,Cc=w;a.mj=[];for(var Bf,$e=0;$eDb*Qj*w/a.graduatedRange)){var Cf=v[0][0],zd=0,gc=0;jh=w*Od.graduatedStart-1E-4;Cc=w*Od.graduatedEnd+1E-4;var af=Db*Qj,Vc=a.graduatedTickBase;if(Vca.graduatedMin+af&&(Vc-=Math.floor((Vc-a.graduatedMin)/af)*af);for(var kh=vc[$e];Vc<=a.graduatedMax;){a:{for(var pn=kh.length,cg=0;cgw&&(Ee=w),jh<=Ee&&Ee<=Cc)){for(var Wb=C[zd][gc],Oc=v[zd][gc];zdCf&&gcbf?0Cd;Cd++){switch(Cd){case 0:bb.h(Ad,Bd);break;case 1:bb.h(Ad+hg,Bd);break;case 2:bb.h(Ad,Bd+ic);break;case 3:bb.h(Ad+hg,Bd+ic)}bb.rotate(ig+Pb.angle);bb.offset(oh,ph);0===mh&&0===Cd?Pd.h(bb.x,bb.y,0,0):Pd.Ce(bb);bb.offset(-oh,-ph);bb.rotate(-ig-Pb.angle)}H.free(bb);null!==Tj.Wg&&Tj.Wg.push(Pd);fc(ri,Pd.x,Pd.y,Pd.width,Pd.height)}else if(Pb instanceof Xg){var Wc=a,ie=e;null===Wc.rh&&(Wc.rh=new Xg);var qb=Wc.rh;Sm(qb,Pb);var si=Pb.alignmentFocus;si.jc()&&(si=yc);for(var ld= Pb.segmentOrientation,sn=Pb.segmentOffset,je=new M,Ma=0,Dd=0,jc=0,Ge=0,Ef=fg.length,cf=0;cfjc||225jc)&&md.rotate(-jc,Ie/2,Je/2);var jg=M.allocAt(0,0,Ie,Je),ke=H.alloc();ke.Zi(jg,si);md.ra(ke);var tn=-ke.x,un=-ke.y,nd=H.alloc();nd.assign(sn);isNaN(nd.x)&&(nd.x=Ie/2+3);isNaN(nd.y)&&(nd.y=-(Je/2+3));nd.rotate(jc);Ma+=nd.x+tn;Dd+=nd.y+un;var kg=new M(Ma,Dd,He.width,He.height),vn=new M(He.x,He.y,He.width,He.height),qh=new M(df.x,df.y,df.width,df.height);Qd.Oz=Ge;Qd.lineCount=qb.lineCount;Qd.lines=[qb.nb,qb.mi,qb.ee,qb.qe,qb.Ob,qb.fb,qb.ce];Qd.actualBounds= kg;Qd.measuredBounds=vn;Qd.naturalBounds=qh;0===cf?je.assign(kg):je.Hc(kg);H.free(nd);H.free(ke);M.free(jg);sd.free(md)}null!==Wc.Wg&&Wc.Wg.push(je);fc(ie,je.x,je.y,je.width,je.height)}mj(Pb,!1)}}}; Rm.prototype.arrange=function(a,b,c){if(null!==a.Wg){var d=a.Ab(),e=a.mj;if(null!==e){var f=a.Wg,g=0,h=f[g];g++;null!==d&&d.arrange(h.x-c.x,h.y-c.y,h.width,h.height);for(var k=b.length,l=0;l=e&&(e=1);for(var g=f.actualBounds,h=a.W.j,k=a.mj,l=h.length,m=0;ma.graduatedTickUnit*n.interval*f.geometry.flattenedTotalLength/a.graduatedRange*e)){var q=n.measuredBounds,u=n.strokeWidth*n.scale,v=n.alignmentFocus;v.jc()&& (v=yc);for(var w=0;wf.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.Pg:a.Og);var n=l.separatorStroke;null===n&&(n=c?a.ci:a.Ng);if(0!==m&&null!==n){ji(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray;null===p&&(p=c?a.bi:a.ai);null!==p&&(n=!0,b.Ts(p,0));b.beginPath();p=l.position+m;c?p>f.height&&(m-= p-f.height):p>f.width&&(m-=p-f.width);l=l.position+m/2;b.lineWidth=m;m=a.bb;c?(l+=m.top,p=f.width-m.right,b.moveTo(m.left,l),b.lineTo(p,l)):(l+=m.left,p=f.height-m.bottom,b.moveTo(l,m.top),b.lineTo(l,p));b.stroke();n&&b.Rs()}}}} function Vm(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=0;km)){var n=l.tc(),p=l.separatorStrokeWidth;isNaN(p)&&(p=c?a.Pg:a.Og);var r=l.separatorStroke;null===r&&(r=c?a.ci:a.Ng);null===r&&(p=0);n-=p;p=l.position+p;n+=l.actual;p+n>m&&(n=m-p);0>=n||(m=a.bb,ji(a,b,l.background,!0,!1,h,g),c?b.fillRect(m.left,p+m.top,g.width-(m.left+m.right),n):b.fillRect(p+ m.left,m.top,n,g.height-(m.top+m.bottom)))}}}}function hk(a){return"LineV"===a||"BarV"===a} t.ck=function(a,b,c,d,e){var f=this.Yd(),g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),r=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.areaBackground)return g=this.actualBounds,I.Sc(g.left,g.top,g.right,g.bottom,a,b,c,d,e);if(null!==this.background)return f=a*k+b*m+p,h=a*l+b*n+r,a=c*k+d*m+p,k=c*l+d*n+r,e.h(0,0),c=this.naturalBounds,f=I.Sc(0,0,c.width,c.height,f,h,a,k,e),e.transform(g),f;f||(k=1,m=l=0,n=1,r=p=0);h=a*k+b*m+p;a=a*l+b* n+r;k=c*k+d*m+p;c=c*l+d*n+r;e.h(k,c);d=(k-h)*(k-h)+(c-a)*(c-a);l=!1;n=this.W.j;r=n.length;m=H.alloc();p=null;b=Infinity;var q=null;this.isClipping&&(q=H.alloc(),p=this.Ab(),(l=p.ck(h,a,k,c,q))&&(b=(h-q.x)*(h-q.x)+(a-q.y)*(a-q.y)));for(var u=0;ud&&e.set(q),H.free(q));H.free(m);f&&e.transform(g);return l}; t.o=function(a){if(!0!==rj(this)){Y.prototype.o.call(this,a);a=null;if(this.qa===X.Auto||this.qa===X.Link)a=this.Ab();for(var b=this.W.j,c=b.length,d=0;dc||f>d)this.o(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case wd:this.o(!0);this.measure(c+h,d+g,0,0);break;case Vk:this.o(!0);this.measure(c+h,f+g,0,0);break;case Wk:this.o(!0),this.measure(b+h,d+g,0,0)}}this.qa.arrange(this,e,this.rg)}}; t.Ch=function(a){var b=this.naturalBounds,c=vm(this);if(kc(0,0,b.width,b.height,a.x,a.y)){b=this.W.j;for(var d=b.length,e=H.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(zb(e.set(a),f.transform),f.$(e))return H.free(e),!0}H.free(e);return null===this.gb&&null===this.dc?!1:!0}return!1};t.Us=function(a){if(this.Ek===a)return this;for(var b=this.W.j,c=b.length,d=0;dp.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof X?m:null;p=sd.alloc();p.set(g); if(null!==m?m.wg(a,b,c,d,e,p):il(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);sd.free(p)}}}void 0===f&&sd.free(g);return d}void 0===f&&sd.free(g);return!1};function cn(a,b,c,d){for(var e=a.W.j,f=e.length;f--;){var g=e[f];if(g.visible){var h=g.actualBounds,k=a.naturalBounds;h.x>k.width||h.y>k.height||0>h.x+h.width||0>h.y+h.height||(g instanceof X&&cn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.xg=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var g=this.naturalBounds,h=this.Yd(),k=h?a:zb(H.allocAt(a.x,a.y),this.transform),l=h?b:zb(H.allocAt(b.x,b.y),this.transform),m=k.we(l),n=0v.width||u.y>v.height||0>u.x+u.width||0>u.y+u.height))if(q.Yd()?(u=q.transform,zb(k.set(a),u),zb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof X?q:null,null!==q?q.xg(k,l,c,d,e,f):u.zx(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}H.free(k);H.free(l)}return e?n:g}return!1}; function Am(a){var b=null;a instanceof W&&(b=a.spot1,b===$c&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=xc);return b}function Bm(a){var b=null;a instanceof W&&(b=a.spot2,b===$c&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Hc);return b}t.add=function(a){this.Kb(this.W.count,a)};t.L=function(a){return this.W.L(a)}; t.Kb=function(a,b){b instanceof T&&B("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.Ag(b))this===b&&B("Cannot make a Panel contain itself: "+this.toString()),B("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.panel;null!==c&&c!==this&&B("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.qa!==X.Grid||b instanceof W||B("Can only add Shapes to a Grid Panel, not: "+b);this.qa!==X.Graduated||b instanceof W||b instanceof Xg||B("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.Yi(this);b.Dj=null;if(null!==this.itemArray){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Hd&&(this.Hd=new G),this.Hd.add(d,b))}var e=this.W;d=-1;if(c===this){for(var f=-1,g=this.W.j,h=g.length,k=0;k=e.count&&a>=e.count)return; e.jb(f);d=f}else B("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Kb(a,b);if(0===a||b.isPanelMain)this.Bi=null;rj(this)||this.o();b.o(!1);null!==b.portId?this.Dh=!0:b instanceof X&&!0===b.Dh&&(this.Dh=!0);this.Xg=null;c=this.part;null!==c&&(c.zj=null,c.dh=NaN,this.Dh&&c instanceof U&&(c.Dh=!0),c.Dh&&c instanceof U&&(c.rc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&&c.Ya(ue,"elements",this,b,null,d,null),c.Ya(te, "elements",this,null,b,null,a),this.Bg()||dn(this,b,!1)))};function en(a,b){a.F=b?a.F|16777216:a.F&-16777217}t.remove=function(a){for(var b=this.W.j,c=b.length,d=-1,e=0;ea&&va(a,">= 0",X,"getRowDefinition:idx");a=Math.round(a);var b=this.pb;if(void 0===b)return null;if(void 0===b[a]){var c=new fk;c.Yi(this);c.isRow=!0;c.index=a;b[a]=c}return b[a]};X.prototype.Jv=function(a){0>a&&va(a,">= 0",X,"removeRowDefinition:idx");a=Math.round(a);var b=this.pb;void 0!==b&&(this.Ya(ue,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.o())}; X.prototype.getColumnDefinition=function(a){0>a&&va(a,">= 0",X,"getColumnDefinition:idx");a=Math.round(a);var b=this.kb;if(void 0===b)return null;if(void 0===b[a]){var c=new fk;c.Yi(this);c.isRow=!1;c.index=a;b[a]=c}return b[a]};t=X.prototype;t.Hv=function(a){0>a&&va(a,">= 0",X,"removeColumnDefinition:idx");a=Math.round(a);var b=this.kb;void 0!==b&&(this.Ya(ue,"coldefs",this,b[a],null,a,null),b[a]&&delete b[a],this.o())}; t.ez=function(a){if(0>a||this.type!==X.Table)return-1;for(var b=0,c=this.pb,d=c.length,e=this.Ei;ea||this.type!==X.Table)return-1;for(var b=0,c=this.kb,d=c.length,e=this.oi;ea;)this.Fc(this.W.length-1,!1);a=this.itemArray;if(null!==a)for(var b=a.length,c=0;cc)){var d=jn(a,b),e=a.itemTemplateMap,f=null;null!==e&&(f=e.H(d));null===f&&(kn||(kn=!0,wa('No item template Panel found for category "'+d+'" on '+a),wa(" Using default item template."),d=new X,e=new Xg,e.bind(new Ji("text","",Ia)),d.add(e),ln=d),f=ln);d=f;null!==d&&(zg(d),d=d.copy(),0!==(d.F&16777216)&&(e=a.Oi(),null!==e&&en(e,!0)),"object"===typeof b&&(null===a.Hd&&(a.Hd=new G),a.Hd.add(b,d)),e=c+an(a),a.Kb(e,d),d.hb=b,mn(a,e,c),d.hb=null,d.data= b)}}function mn(a,b,c){for(a=a.W;ba&&va(a,">= 0",X,"padding"),a=new pc(a)):(0>a.left&&va(a.left,">= 0",X,"padding:value.left"),0>a.right&&va(a.right,">= 0",X,"padding:value.right"),0>a.top&&va(a.top,">= 0",X,"padding:value.top"),0>a.bottom&&va(a.bottom,">= 0",X,"padding:value.bottom"));var b=this.bb;b.A(a)||(this.bb=a=a.G(),this.o(),this.g("padding",b,a))}},defaultAlignment:{get:function(){return this.pn},set:function(a){var b=this.pn;b.A(a)||(this.pn=a=a.G(),this.o(),this.g("defaultAlignment", b,a))}},defaultStretch:{get:function(){return this.Mf},set:function(a){var b=this.Mf;b!==a&&(this.Mf=a,this.o(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{get:function(){return void 0===this.hj?tc:this.hj},set:function(a){if(void 0!==this.hj){"number"===typeof a&&(a=new pc(a));var b=this.hj;b.A(a)||(this.hj=a=a.G(),this.o(),this.g("defaultSeparatorPadding",b,a))}}},defaultRowSeparatorStroke:{get:function(){return void 0=== this.ci?null:this.ci},set:function(a){var b=this.ci;b!==a&&(null===a||"string"===typeof a||a instanceof sl)&&(a instanceof sl&&a.freeze(),this.ci=a,this.N(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return void 0===this.Pg?1:this.Pg},set:function(a){if(void 0!==this.Pg){var b=this.Pg;b!==a&&isFinite(a)&&0<=a&&(this.Pg=a,this.o(),this.g("defaultRowSeparatorStrokeWidth",b,a))}}},defaultRowSeparatorDashArray:{ get:function(){return void 0===this.bi?null:this.bi},set:function(a){if(void 0!==this.bi){var b=this.bi;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea)&&B("Panel.topIndex must be greater than zero and a real number, not: "+a),this.Ei=a,this.o(), this.g("topIndex",b,a))}}},leftIndex:{get:function(){return void 0===this.oi?0:this.oi},set:function(a){if(void 0!==this.oi){var b=this.oi;b!==a&&((!isFinite(a)||0>a)&&B("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.oi=a,this.o(),this.g("leftIndex",b,a))}}},data:{get:function(){return this.hb},set:function(a){var b=this.hb;if(b!==a){var c=this instanceof T&&!(this instanceof De);zg(this);this.hb=a;var d=this.diagram; null!==d&&(c?(c=d.partManager,this instanceof Q?(null!==b&&c.Ie.remove(b),null!==a&&c.Ie.add(a,this)):this instanceof T&&(null!==b&&c.Je.remove(b),null!==a&&c.Je.add(a,this))):(c=this.panel,null!==c&&null!==c.Hd&&(null!==b&&c.Hd.remove(b),null!==a&&c.Hd.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Aa()}}},itemIndex:{get:function(){return this.Zn},set:function(a){var b=this.Zn;b!==a&&(this.Zn=a,this.g("itemIndex",b,a))}},itemArray:{ get:function(){return this.li},set:function(a){var b=this.li;if(b!==a||null!==a&&gn(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&Jj(c.partManager,this,c),this.li=a,null!==c&&null!==a&&Gj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||this.st()}}},itemTemplate:{get:function(){return null===this.he?null:this.he.H("")},set:function(a){if(null===this.he){if(null===a)return;this.he=new G}var b=this.he.H(""); b!==a&&((a instanceof T||a.isPanelMain)&&B("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.he.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.st())}},itemTemplateMap:{get:function(){return this.he},set:function(a){var b=this.he;if(b!==a){for(var c=a.iterator;c.next(););this.he=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing||this.st()}}},itemCategoryProperty:{ get:function(){return this.ml},set:function(a){var b=this.ml;b!==a&&(this.ml=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{get:function(){return 0!==(this.F&1048576)},set:function(a){var b=0!==(this.F&1048576);b!==a&&(this.F^=1048576,this.g("isAtomic",b,a))}},isClipping:{get:function(){return 0!==(this.F&2097152)},set:function(a){var b=0!==(this.F&2097152);b!==a&&(this.F^=2097152,this.o(),this.g("isClipping",b,a))}},isOpposite:{ get:function(){return 0!==(this.F&33554432)},set:function(a){var b=0!==(this.F&33554432);b!==a&&(this.F^=33554432,this.o(),this.g("isOpposite",b,a))}},isEnabled:{get:function(){return 0!==(this.F&4194304)},set:function(a){var b=0!==(this.F&4194304);if(b!==a){var c=null===this.panel||this.panel.Bg();this.F^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&dn(this,this,a)}}},alignmentFocusName:{ get:function(){return this.Gg},set:function(a){var b=this.Gg;b!==a&&(this.Gg=a,this.o(),this.g("alignmentFocusName",b,a))}}}); ma.Object.defineProperties(X,{Position:{get:function(){return Ml.H("Position")}},Horizontal:{get:function(){return Ml.H("Horizontal")}},Vertical:{get:function(){return Ml.H("Vertical")}},Spot:{get:function(){return Ml.H("Spot")}},Auto:{get:function(){return Ml.H("Auto")}},Table:{get:function(){return Ml.H("Table")}},Viewbox:{ get:function(){return Ml.H("Viewbox")}},TableRow:{get:function(){return Ml.H("TableRow")}},TableColumn:{get:function(){return Ml.H("TableColumn")}},Link:{get:function(){return Ml.H("Link")}},Grid:{get:function(){return Ml.H("Grid")}},Graduated:{get:function(){return Ml.H("Graduated")}}});X.prototype.findItemPanelForData=X.prototype.yx; X.prototype.rebuildItemElements=X.prototype.st;X.prototype.updateTargetBindings=X.prototype.Aa;X.prototype.copyTemplate=X.prototype.Ly;X.prototype.graduatedValueForPoint=X.prototype.Az;X.prototype.graduatedPointForValue=X.prototype.zz;X.prototype.findColumnForLocalX=X.prototype.Xy;X.prototype.findRowForLocalY=X.prototype.ez;X.prototype.removeColumnDefinition=X.prototype.Hv;X.prototype.removeRowDefinition=X.prototype.Jv;X.prototype.removeAt=X.prototype.jb;X.prototype.remove=X.prototype.remove; X.prototype.insertAt=X.prototype.Kb;X.prototype.elt=X.prototype.L;X.prototype.add=X.prototype.add;X.prototype.findObject=X.prototype.Xa;X.prototype.findInVisualTree=X.prototype.cm;X.prototype.walkVisualTreeFrom=X.prototype.Em;X.prototype.findMainElement=X.prototype.Ab;var kn=!1,ln=null,Ml=new G;X.className="Panel";X.definePanelLayout=on;on("Position",new um);on("Vertical",new xm);on("Auto",new zm);on("Link",new Km); function fk(){Za(this);this.jg=null;this.Ir=!0;this.Oa=0;this.Oc=NaN;this.fh=0;this.eh=Infinity;this.wb=$c;this.la=this.ha=0;this.$a=null;this.xp=An;this.se=Uk;this.qp=this.ng=null;this.rp=NaN;this.gb=this.Ij=null;this.ln=!1} fk.prototype.copy=function(){var a=new fk;a.Ir=this.Ir;a.Oa=this.Oa;a.Oc=this.Oc;a.fh=this.fh;a.eh=this.eh;a.wb=this.wb;a.ha=this.ha;a.la=this.la;a.se=this.se;a.xp=this.xp;null===this.ng?a.ng=null:a.ng=this.ng.G();a.qp=this.qp;a.rp=this.rp;a.Ij=null;null!==this.Ij&&(a.separatorDashArray=Aa(this.separatorDashArray));a.gb=this.gb;a.ln=this.ln;a.$a=this.$a;return a};t=fk.prototype; t.Qs=function(a){a.isRow?this.height=a.height:this.width=a.width;this.minimum=a.minimum;this.maximum=a.maximum;this.alignment=a.alignment;this.stretch=a.stretch;this.sizing=a.sizing;this.ng=null===a.separatorPadding?null:a.separatorPadding.G();this.separatorStroke=a.separatorStroke;this.separatorStrokeWidth=a.separatorStrokeWidth;this.Ij=null;a.separatorDashArray&&(this.Ij=Aa(a.separatorDashArray));this.background=a.background;this.coversSeparators=a.coversSeparators;this.$a=a.$a}; t.cb=function(a){a.classType===fk&&(this.sizing=a)};t.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+lb(this)};t.Yi=function(a){this.jg=a}; t.Wu=function(){var a=0,b=0,c=this.jg,d=this.isRow;if(null!==c&&c.type===X.Table)for(var e=d?c.pb.length:c.kb.length,f=0;fa&&va(a,">= 0",fk,"height"),this.Oc=a,this.actual=this.ha,null!==this.panel&&this.panel.o(), this.yb("height",b,a))}},width:{get:function(){return this.Oc},set:function(a){var b=this.Oc;b!==a&&(0>a&&va(a,">= 0",fk,"width"),this.Oc=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.yb("width",b,a))}},minimum:{get:function(){return this.fh},set:function(a){var b=this.fh;b!==a&&((0>a||!isFinite(a))&&va(a,">= 0",fk,"minimum"),this.fh=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.yb("minimum",b,a))}},maximum:{ get:function(){return this.eh},set:function(a){var b=this.eh;b!==a&&(0>a&&va(a,">= 0",fk,"maximum"),this.eh=a,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.yb("maximum",b,a))}},alignment:{get:function(){return this.wb},set:function(a){var b=this.wb;b.A(a)||(this.wb=a.G(),null!==this.panel&&this.panel.o(),this.yb("alignment",b,a))}},stretch:{get:function(){return this.se},set:function(a){var b=this.se;b!==a&&(this.se= a,null!==this.panel&&this.panel.o(),this.yb("stretch",b,a))}},separatorPadding:{get:function(){return this.ng},set:function(a){"number"===typeof a&&(a=new pc(a));var b=this.ng;null!==a&&null!==b&&b.A(a)||(null!==a&&(a=a.G()),this.ng=a,null!==this.panel&&this.panel.o(),this.yb("separatorPadding",b,a))}},separatorStroke:{get:function(){return this.qp},set:function(a){var b=this.qp;b!==a&&(null!==a&&Ql(a,"RowColumnDefinition.separatorStroke"), a instanceof sl&&a.freeze(),this.qp=a,null!==this.panel&&this.panel.o(),this.yb("separatorStroke",b,a))}},separatorStrokeWidth:{get:function(){return this.rp},set:function(a){var b=this.rp;b!==a&&(this.rp=a,null!==this.panel&&this.panel.o(),this.yb("separatorStrokeWidth",b,a))}},separatorDashArray:{get:function(){return this.Ij},set:function(a){var b=this.Ij;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ee)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,r,q,u=0,v=Da(),w=2;wn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;w=0;q=v[w];n=q[0];r=q[1];p=q[2];q=q[3];for(var y=0;.1<=u;){0===y&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1));if(e> u){Fa(v);return}e>q?(y=e-q,e=q):y=0;var z=Math.sqrt(e*e/(1+p*p));0>n&&(z=-z);h+=z;k+=p*z;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===y&&d.Ki(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==y){w++;if(w===v.length){Fa(v);return}q=v[w];n=q[0];r=q[1];p=q[2];q=q[3];e=y}}Fa(v)}} t.Ki=function(a,b){var c=this.Dc,d=this.Wk;if(null!==c||null!==d){var e=this.actualBounds,f=this.naturalBounds;null!==d&&ji(this,a,d,!0,!1,f,e);var g=this.part,h=this.ph;null!==c&&0===h&&null!==g&&(h=g.type===X.Link&&g instanceof De&&"Selection"===g.category&&g.adornedObject instanceof W&&g.adornedPart.Ab()===g.adornedObject?g.adornedObject.strokeWidth:0);null!==c&&0!==h&&(ji(this,a,c,!1,!1,f,e),a.lineWidth=h,a.lineJoin=this.Nl,a.lineCap=this.Ml,a.miterLimit=this.Jj);e=!1;g&&b.xe("drawShadows")&& (e=g.isShadowed);g=!0;null===c||null!==d&&"transparent"!==d||(g=!1);f=!1;var k=this.strokeDashArray;null!==k&&(f=!0,a.Ts(k,this.oh));var l=this.oa;if(null!==l){if(l.type===xd)a.beginPath(),a.moveTo(l.startX,l.startY),a.lineTo(l.endX,l.endY),null!==d&&a.Sd(d),0!==h&&null!==c&&a.aj();else if(l.type===Hd){var m=l.startX;k=l.startY;var n=l.endX,p=l.endY;l=Math.min(m,n);var r=Math.min(k,p);m=Math.abs(n-m);k=Math.abs(p-k);a.beginPath();a.rect(l,r,m,k);null!==d&&a.Sd(d);if(null!==c){g&&e&&rl(a);if(0!==h){if(0=== m||0===k)a.beginPath(),a.rect(l,r,Math.max(m,.1),Math.max(k,.1));a.aj()}g&&e&&ql(a)}}else if(l.type===Id)m=l.startX,k=l.startY,n=l.endX,p=l.endY,l=Math.abs(n-m)/2,r=Math.abs(p-k)/2,m=Math.min(m,n)+l,k=Math.min(k,p)+r,a.beginPath(),a.moveTo(m,k-r),a.bezierCurveTo(m+I.Fg*l,k-r,m+l,k-I.Fg*r,m+l,k),a.bezierCurveTo(m+l,k+I.Fg*r,m+I.Fg*l,k+r,m,k+r),a.bezierCurveTo(m-I.Fg*l,k+r,m-l,k+I.Fg*r,m-l,k),a.bezierCurveTo(m-l,k-I.Fg*r,m-I.Fg*l,k-r,m,k-r),a.closePath(),null!==d&&a.Sd(d),0!==h&&null!==c&&(g&&e?(rl(a), a.aj(),ql(a)):a.aj());else if(l.type===vd)for(k=l.figures,l=k.length,r=0;rv.sweepAngle,null!==q?q.endX:m.startX,null!==q?q.endY:m.startY)}else if(q=be(v,m),w=q.length,0===w)a.lineTo(v.centerX,v.centerY);else for(var y=0;y(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;M.free(f);return I.Wb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== Hd){b=c.startX;var g=c.startY,h=c.endX;c=c.endY;f.x=Math.min(b,h);f.y=Math.min(g,c);f.width=Math.abs(h-b);f.height=Math.abs(c-g);if(null===this.fill){f.Tc(-d,-d);if(f.$(a))return M.free(f),!1;f.Tc(d,d)}null!==this.stroke&&f.Tc(e,e);a=f.$(a);M.free(f);return a}if(c.type===Id){g=c.startX;e=c.startY;h=c.endX;var k=c.endY;c=Math.min(g,h);b=Math.min(e,k);g=Math.abs(h-g)/2;e=Math.abs(k-e)/2;c=a.x-(c+g);b=a.y-(b+e);if(null===this.fill){g-=d;e-=d;if(0>=g||0>=e||1>=c*c/(g*g)+b*b/(e*e))return M.free(f),!1; g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);M.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===vd)return M.free(f),null===this.fill?ee(c,a.x,a.y,e):c.$(a,e,1=this.strokeWidth)m=I.ze(l.startX,l.startY,l.endX,l.endY,f,g,h,k,e);else{l.startX===l.endX?(d=n,m=0):(b=(l.endY-l.startY)/(l.endX-l.startX),m=n/Math.sqrt(1+b*b),d=m* b);b=Da();a=new H;I.ze(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new H;I.ze(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new H;I.ze(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new H;I.ze(l.endX+d,l.endY+m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);h=b.length;if(0===h)return Fa(b),!1;m=!0;k=Infinity;for(d=0;dMath.abs(c)){k=g-m-c*(f-d);if(0>a*a*c*c+l*l-k*k){e.x=NaN;e.y=NaN;m=!1;break a}n=Math.sqrt(a*a*c*c+l*l-k*k);h=(-(a*a*c*k)+a*l*n)/(l*l+a*a*c*c)+d;a=(-(a*a*c*k)-a*l*n)/(l*l+a*a*c*c)+d;l=c*(h-d)+k+m;k=c* (a-d)+k+m;Math.abs((f-h)*(f-h))+Math.abs((g-l)*(g-l))h){e.x=NaN;e.y=NaN;m=!1;break a}k=Math.sqrt(h);h=m+k;k=m-k;Math.abs(h-g)c?a-c:c-a)<(b>d?b-d:d-b)?(a=ba||I.Z(k.y,a))&&(k.yb||I.Z(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.zx=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.Ch(a,!0))return!0;var e=a.we(b),f=e;1.5=e||Bb(b,f,0,-n)>=e||Bb(b, f,0,n)>=e||Bb(b,f,m,0)>=e?!1:!0}else if(b.type===vd){l=b.bounds;f=l.x;h=l.y;k=l.x+l.width;l=l.y+l.height;if(a.x>k&&a.xl&&a.ye&&Ab(a.x,a.y,f,h,k,h)>e&&Ab(a.x,a.y,k,l,f,l)>e&&Ab(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?ee(b,a.x,a.y,f):b.$(a,f,!0))return!0}else{c=b.figures;for(b=0;be)return!1;h=f.segments.j;k=h.length;for(l=0;le)return!1;break;case Yd:var p=Da();I.ve(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Fa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.ed(g,m)>e)return!1;break;case Zd:p=Da();I.rq(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Fa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.ed(g,m)>e)return!1;break;case $d:case ae:p=n.type===$d?be(n,f):ce(n,f,g,m);var r=p.length;if(0===r){g=n.centerX;m=n.centerY;if(a.ed(g,m)>e)return!1;break}n=null;for(var q=Da(),u=0;u= 0",W,"strokeWidth:value")}},strokeCap:{get:function(){return this.Ml},set:function(a){var b= this.Ml;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?va(a,'"butt", "round", or "square"',W,"strokeCap"):(this.Ml=a,this.N(),this.g("strokeCap",b,a)))}},strokeJoin:{get:function(){return this.Nl},set:function(a){var b=this.Nl;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?va(a,'"miter", "bevel", or "round"',W,"strokeJoin"):(this.Nl=a,this.N(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{get:function(){return this.Jj}, set:function(a){var b=this.Jj;if(b!==a&&1<=a){this.Jj=a;this.N();var c=this.part;null!==c&&(c.dh=NaN);this.g("strokeMiterLimit",b,a)}}},strokeDashArray:{get:function(){return this.nh},set:function(a){var b=this.nh;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1p*m*m&&(c=!0);b.Xc!==a&&(c=!1);!1===b.xe("textGreeking")&& (c=!1);b=this.bf;p=this.cf;switch(this.flip){case Zk:a.translate(e,0);a.scale(-1,1);break;case Yk:a.translate(0,f);a.scale(1,-1);break;case $k:a.translate(e,f),a.scale(-1,-1)}m=this.Mc;n=(b+g+p)*m;f>n&&(d=this.Hi,d=d.y*f-d.y*n+d.offsetY);if(1===m&&null!==this.ce)p=this.nb,p>e&&(p=e),Pn(this,this.ce,a,d+b,e,g,p,c,h,k,l);else if(null!==this.Ob&&null!==this.fb)for(n=0;ne&&(r=e);d+=b;Pn(this,this.fb[n],a,d,e,g,r,c,h,k,l);d+=g+p}switch(this.flip){case Zk:a.scale(-1,1);a.translate(-e, 0);break;case Yk:a.scale(1,-1);a.translate(0,-f);break;case $k:a.scale(-1,-1),a.translate(-e,-f)}}}; function Pn(a,b,c,d,e,f,g,h,k,l,m){var n=0;h?("left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),c.fillRect(0+n,d+.25*f,g,1)):("left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2),e=null!==Qn?Qn(a,f):.75*f,c.fillText(b,0+n,d+e),b=f/20|0,0===b&&(b=1),"right"===k?n-=g:"center"===k&&(n-=g/2),l&&(a=null!==Rn?Rn(a,f):.8*f,c.beginPath(),c.lineWidth=b,c.moveTo(0+n,d+a),c.lineTo(0+n+g,d+a),c.stroke()),m&&(c.beginPath(),c.lineWidth=b,d=d+f-f/2.2|0,0!==b%2&&(d+=.5),c.moveTo(0+n,d),c.lineTo(0+n+g,d), c.stroke()))} t.mm=function(a,b,c,d){this.mi=a;var e=this.de;null!==Ln&&Sn!==e&&(Sn=Ln.font=e);this.nb=this.qe=0;this.ce=this.fb=this.Ob=this.ee=null;var f;if(isNaN(this.desiredSize.width)){e=this.Rb.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===e.length)e=0;else if(this.isMultiline){for(var g=f=0,h=!1;!h;){var k=e.indexOf("\n",g);-1===k&&(k=e.length,h=!0);f=Math.max(f,Tn(e.substr(g,k-g).trim()));g=k+1}e=f}else f=e.indexOf("\n",0),0<=f&&(e=e.substr(0,f)),e=Tn(e);e=Math.min(e,a/this.scale);e=Math.max(8,e)}else e= this.desiredSize.width;null!==this.panel&&(e=Math.min(e,this.panel.maxSize.width));f=Un(this,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;g=f;if(0!==this.nb&&null!==this.Ob&&null!==this.fb&&this.hg===Vn&&(b=this.de,b=this.hg===Vn?Wn(b):0,h=this.bf+this.cf,h=Math.max(0,On(this)+h),g=Math.min(this.maxLines-1,Math.max(Math.floor(g/h+.01)-1,0)),!(g+1>=this.fb.length))){h=this.fb[g];for(b=Math.max(1,a-b);Tn(h)>b&&1=a.je)null!==d&&d.h(0,g);else{var k=b;if(a.sg===ao)if(a.qe=1,f=Tn(b),0===h||f<=c)a.nb=Math.max(a.nb,f),Zn(a,b,a.nb),null!==d&&d.h(f,g);else{e=bo(a,k);k=k.substr(e.length);b=bo(a,k);for(f=Tn(e+b);0c&&1c;){var m=1;f=Tn(l.substr(0,m));for(b=0;f<=c;)m++,b=f,f=Tn(l.substr(0,m));if(1===m){var n=f;e=Math.max(e,f)}else n=b,e=Math.max(e,b);m--;1>m&&(m=1);Zn(a,l.substr(0,m),n);h++;l=l.substr(m);if(a.Mc+h>a.je)break}b=bo(a,k);for(f=Tn(l+b);0a.je))break}a.qe=Math.min(a.je,h);a.nb=Math.max(a.nb,e);null!==d&&d.h(a.nb,g*a.qe)}}}function bo(a,b){if(a.sg===co)return b.substr(0,1);a=b.length;for(var c=0,d=eo;c=a?b:b.substr(0,c)}function Tn(a){return null===Ln?8*a.length:Ln.measureText(a).width} function On(a){if(null!==a.ee)return a.ee;var b=a.de;if(null===Ln){var c=16;return a.ee=c}void 0!==fo[b]&&5E3>go?c=fo[b]:(c=1.3*Ln.measureText("M").width,fo[b]=c,go++);return a.ee=c}function Wn(a){if(null===Ln)return 6;if(void 0!==ho[a]&&5E3>io)var b=ho[a];else b=Ln.measureText(Xn).width,ho[a]=b,io++;return b} function Un(a,b){var c=a.Rb.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.bf+a.cf;d=Math.max(0,On(a)+d);if(0===c.length)return a.nb=0,a.Mc=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.Mc=0,g,h=!1;!h;){g=c.indexOf("\n",f);-1===g&&(g=c.length,h=!0);if(f<=g){f=c.substr(f,g-f);if(a.sg!==ao){a.qe=0;var k=Kb.alloc();$n(a,f,b,k);e+=k.height;Kb.free(k);a.Mc+=a.qe}else $n(a,f,b,null),e+=d,a.Mc++;a.Mc===a.je&&(h=!0)}f=g+1}return a.Tr=e} ma.Object.defineProperties(Xg.prototype,{font:{get:function(){return this.de},set:function(a){var b=this.de;b!==a&&(this.de=a,this.ee=null,this.o(),this.g("font",b,a))}},text:{get:function(){return this.Rb},set:function(a){var b=this.Rb;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.Rb=a,this.o(),this.g("text",b,a))}},textAlign:{get:function(){return this.Ci},set:function(a){var b=this.Ci;b===a||"start"!== a&&"end"!==a&&"left"!==a&&"right"!==a&&"center"!==a||(this.Ci=a,this.N(),this.g("textAlign",b,a))}},flip:{get:function(){return this.Bd},set:function(a){var b=this.Bd;b!==a&&(this.Bd=a,this.N(),this.g("flip",b,a))}},verticalAlignment:{get:function(){return this.Hi},set:function(a){var b=this.Hi;b.A(a)||(this.Hi=a=a.G(),Bl(this),this.g("verticalAlignment",b,a))}},naturalBounds:{get:function(){if(!this.pc.v()){var a= Kb.alloc();$n(this,this.Rb,999999,a);var b=a.width;Kb.free(a);a=Un(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);Xb(this.pc,b,a)}return this.pc}},isMultiline:{get:function(){return this.rj},set:function(a){var b=this.rj;b!==a&&(this.rj=a,this.o(),this.g("isMultiline",b,a))}},isUnderline:{get:function(){return this.ki},set:function(a){var b=this.ki;b!==a&&(this.ki=a,this.N(),this.g("isUnderline", b,a))}},isStrikethrough:{get:function(){return this.ji},set:function(a){var b=this.ji;b!==a&&(this.ji=a,this.N(),this.g("isStrikethrough",b,a))}},wrap:{get:function(){return this.sg},set:function(a){var b=this.sg;b!==a&&(this.sg=a,this.o(),this.g("wrap",b,a))}},overflow:{get:function(){return this.hg},set:function(a){var b=this.hg;b!==a&&(this.hg=a,this.o(),this.g("overflow",b,a))}},stroke:{ get:function(){return this.Dc},set:function(a){var b=this.Dc;b!==a&&(null!==a&&Ql(a,"TextBlock.stroke"),a instanceof sl&&a.freeze(),this.Dc=a,this.N(),this.g("stroke",b,a))}},lineCount:{get:function(){return this.Mc}},editable:{get:function(){return this.yn},set:function(a){var b=this.yn;b!==a&&(this.yn=a,this.g("editable",b,a))}},textEditor:{get:function(){return this.Hp},set:function(a){var b=this.Hp;b!==a&& (this.Hp=a,this.g("textEditor",b,a))}},errorFunction:{get:function(){return this.Bc},set:function(a){var b=this.Bc;b!==a&&(this.Bc=a,this.g("errorFunction",b,a))}},interval:{get:function(){return this.Fd},set:function(a){var b=this.Fd;a=Math.floor(a);if(b!==a&&0<=a){this.Fd=a;this.o();var c=this.panel;null!==c&&(c.Xg=null);this.g("interval",b,a)}}},graduatedStart:{get:function(){return this.Ed},set:function(a){var b= this.Ed;b!==a&&(0>a?a=0:1a?a=0:1=a&&va(a,"> 0",Xg,"maxLines"),this.je=a,this.g("maxLines",b,a),this.o())}},metrics:{get:function(){return{arrSize:null!==this.Ob?this.Ob:[this.nb], arrText:null!==this.fb?this.fb:[this.ce],maxLineWidth:this.nb,fontHeight:this.ee}}},choices:{get:function(){return this.$m},set:function(a){var b=this.$m;b!==a&&(this.$m=a,this.g("choices",b,a))}}});var Qn=null,Rn=null,ao=new D(Xg,"None",0),Yn=new D(Xg,"WrapFit",1),Nn=new D(Xg,"WrapDesiredSize",2),co=new D(Xg,"WrapBreakAll",3),Mn=new D(Xg,"OverflowClip",0),Vn=new D(Xg,"OverflowEllipsis",1),eo=/[ \u200b\u00ad]/,fo=new db,go=0,ho=new db,io=0,Xn="...",Sn="",Ln=null,Kn=!1; Xg.className="TextBlock";Xg.getEllipsis=function(){return Xn};Xg.setEllipsis=function(a){Xn=a;ho=new db;io=0};Xg.getBaseline=function(){return Qn};Xg.setBaseline=function(a){Qn=a;a=Oa();for(var b=a.length,c=0;c=d.width&&(e=e+r.offsetX+(m*r.x-d.width*r.x));n>=d.height&&(f=f+r.offsetY+(n*r.y-d.height*r.y));h=Math.min(d.width,m);g=Math.min(d.height,n);break;case wd:m=d.width;n=d.height;break;case Cg:case Xk:p===Cg?(p=Math.min(d.height/n,d.width/m),m*=p,n*=p):p===Xk&&(p=Math.max(d.height/n,d.width/m),m*=p,n*=p,m>=d.width&&(e=(e+r.offsetX+(m*r.x-d.width*r.x)/m)*h),n>=d.height&&(f=(f+r.offsetY+(n*r.y-d.height*r.y)/ n)*g),h*=1/(m/d.width),g*=1/(n/d.height),m=d.width,n=d.height)}p=this.qf()*b.scale;var q=m*p*n*p,u=h*g/q,v=c.__goCache;p=null;var w=oo;if(c.Gr&&void 0!==v&&4w*w)for(null===v.Ji&&(po(v,4,k,l,c),po(v,16,k,l,c)),k=v.Ji,l=k.length,q=0;qI.Df;var d="r"+b+","+c,e=I.Cf[d];if(void 0!==e)return e;e=new ud(Hd);e.endX=b;e.endY=c;a&&(I.Cf[d]=e,I.Df++);return e});to("Square",function(a,b,c){a=50>I.Df;var d="s"+b+","+c,e=I.Cf[d];if(void 0!==e)return e;e=new ud(Hd);e.endX=b;e.endY=c;e.defaultStretch=Cg;a&&(I.Cf[d]=e,I.Df++);return e}); to("RoundedRectangle",function(a,b,c){var d=50>I.Df,e="rr"+b+","+c,f=I.Cf[e];if(void 0===f){f=a?a.parameter1:NaN;if(isNaN(f)||0>=f)f=5;f=Math.min(f,b/3);f=Math.min(f,c/3);a=f*I.Fg;f=(new ud).add((new ge(f,0,!0)).add(new le(Fd,b-f,0)).add(new le(Yd,b,f,b-a,0,b,a)).add(new le(Fd,b,c-f)).add(new le(Yd,b-f,c,b,c-a,b-a,c)).add(new le(Fd,f,c)).add(new le(Yd,0,c-f,a,c,0,c-a)).add(new le(Fd,0,f)).add((new le(Yd,f,0,0,a,a,0)).close()));1I.Df;var d="e"+b+","+c,e=I.Cf[d];if(void 0!==e)return e;e=new ud(Id);e.endX=b;e.endY=c;e.spot1=id;e.spot2=jd;a&&(I.Cf[d]=e,I.Df++);return e});to("Circle",function(a,b,c){a=50>I.Df;var d="c"+b+","+c,e=I.Cf[d];if(void 0!==e)return e;e=new ud(Id);e.endX=b;e.endY=c;e.spot1=id;e.spot2=jd;e.defaultStretch=Cg;a&&(I.Cf[d]=e,I.Df++);return e}); to("TriangleRight",function(a,b,c){return(new ud).add((new ge(0,0)).add(new le(Fd,b,.5*c)).add((new le(Fd,0,c)).close())).Dm(0,.25,.5,.75)});to("TriangleDown",function(a,b,c){return(new ud).add((new ge(0,0)).add(new le(Fd,b,0)).add((new le(Fd,.5*b,c)).close())).Dm(.25,0,.75,.5)});to("TriangleLeft",function(a,b,c){return(new ud).add((new ge(b,c)).add(new le(Fd,0,.5*c)).add((new le(Fd,b,0)).close())).Dm(.5,.25,1,.75)}); to("TriangleUp",function(a,b,c){return(new ud).add((new ge(b,c)).add(new le(Fd,0,c)).add((new le(Fd,.5*b,0)).close())).Dm(.25,.5,.75,1)});to("Triangle","TriangleUp");to("Diamond",function(a,b,c){return(new ud).add((new ge(.5*b,0)).add(new le(Fd,0,.5*c)).add(new le(Fd,.5*b,c)).add((new le(Fd,b,.5*c)).close())).Dm(.25,.25,.75,.75)});to("LineH",function(a,b,c){a=new ud(xd);a.startX=0;a.startY=c/2;a.endX=b;a.endY=c/2;return a}); to("LineV",function(a,b,c){a=new ud(xd);a.startX=b/2;a.startY=0;a.endX=b/2;a.endY=c;return a});to("None","Rectangle");to("BarH","Rectangle");to("BarV","Rectangle");to("MinusLine","LineH");to("PlusLine",function(a,b,c){return(new ud).add((new ge(0,c/2,!1)).add(new le(Fd,b,c/2)).add(new le(Xd,b/2,0)).add(new le(Fd,b/2,c)))});to("XLine",function(a,b,c){return(new ud).add((new ge(0,c,!1)).add(new le(Fd,b,0)).add(new le(Xd,0,0)).add(new le(Fd,b,c)))}); I.Hm={"":"",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 T(a){X.call(this,a);this.D=2408959;this.$g=this.Hf="";this.ap=this.Xo=this.np=this.bo=null;this.pp="";this.Ef=this.Nn=this.op=this.kh=null;this.Zo="";this.Yo=Sb;this.Rb=this.bp="";this.ni=this.cn=this.Yh=null;this.Xf=(new H(NaN,NaN)).freeze();this.jo="";this.Ue=null;this.ko=xc;this.cp=$c;this.so=Gb;this.lo=Hb;this.un=null;this.co=127;this.tp=Ib;this.sp="gray";this.$e=4;this.Jw=-1;this.Rp=NaN;this.ly=new M;this.zj=null;this.dh=NaN}la(T,X); T.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.D=this.D&-4097|49152;a.Hf=this.Hf;a.$g=this.$g;a.bo=this.bo;a.np=this.np;a.Xo=this.Xo;a.ap=this.ap;a.pp=this.pp;a.op=this.op;a.Nn=this.Nn;a.Ef=null;a.Zo=this.Zo;a.Yo=this.Yo.G();a.bp=this.bp;a.cp=this.cp.G();a.Rb=this.Rb;a.cn=this.cn;a.Xf.assign(this.Xf);a.jo=this.jo;a.ko=this.ko.G();a.so=this.so.G();a.lo=this.lo.G();a.un=this.un;a.co=this.co;a.tp=this.tp.G();a.sp=this.sp;a.$e=this.$e;a.Rp=this.Rp}; T.prototype.pf=function(a){X.prototype.pf.call(this,a);a.Eh();a.kh=null;a.Ue=null;a.zj=null};T.prototype.toString=function(){var a=Ha(this.constructor)+"#"+lb(this);null!==this.data&&(a+="("+Ia(this.data)+")");return a};T.prototype.qk=function(a,b,c,d,e,f,g){var h=this.diagram;null!==h&&(a===te&&"elements"===b?e instanceof X?Ej(e,function(a){Gj(h.partManager,a);Fj(h,a)}):kk(h,e):a===ue&&"elements"===b&&(e instanceof X?Ej(e,function(a){Jj(h.partManager,a,h)}):mk(h,e)),h.Ya(a,b,c,d,e,f,g))}; T.prototype.Aa=function(a){X.prototype.Aa.call(this,a);if(null!==this.data){for(var b=this.W.j,c=b.length,d=0;de.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.maxSelectionCount)){this.D^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;e.ea();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Lb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.Xb(),c.skipsUndoManager=d)}}}},isHighlighted:{get:function(){return 0!==(this.D&524288)},set:function(a){var b=0!==(this.D&524288);if(b!==a){this.D^=524288;var c= this.diagram;null!==c&&(c=c.highlighteds,c.ea(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.N();a=this.highlightedChanged;null!==a&&a(this)}}},isShadowed:{get:function(){return 0!==(this.D&8192)},set:function(a){var b=0!==(this.D&8192);b!==a&&(this.D^=8192,this.g("isShadowed",b,a),this.N())}},isAnimated:{get:function(){return 0!==(this.D&262144)},set:function(a){var b=0!==(this.D&262144);b!==a&&(this.D^=262144, this.g("isAnimated",b,a))}},highlightedChanged:{get:function(){return this.Nn},set:function(a){var b=this.Nn;b!==a&&(this.Nn=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{get:function(){return this.pp},set:function(a){var b=this.pp;b!==a&&(this.pp=a,this.kh=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{get:function(){return this.np},set:function(a){var b=this.np;b!==a&&(this.np= a,this.g("selectionAdornmentTemplate",b,a))}},selectionObject:{get:function(){if(null===this.kh){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.Xa(a),null!==a?this.kh=a:this.kh=this):this instanceof Q?(a=this.path,null!==a?this.kh=a:this.kh=this):this.kh=this}return this.kh}},selectionChanged:{get:function(){return this.op},set:function(a){var b=this.op;b!==a&&(this.op=a,this.g("selectionChanged",b,a))}},resizeAdornmentTemplate:{ get:function(){return this.Xo},set:function(a){var b=this.Xo;b!==a&&(this.Xo=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{get:function(){return this.Zo},set:function(a){var b=this.Zo;b!==a&&(this.Zo=a,this.g("resizeObjectName",b,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.Xa(a),null!==a)?a:this}},resizeCellSize:{get:function(){return this.Yo}, set:function(a){var b=this.Yo;b.A(a)||(this.Yo=a=a.G(),this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{get:function(){return this.ap},set:function(a){var b=this.ap;b!==a&&(this.ap=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{get:function(){return this.bp},set:function(a){var b=this.bp;b!==a&&(this.bp=a,this.g("rotateObjectName",b,a))}},rotateObject:{get:function(){var a=this.rotateObjectName; return""!==a&&(a=this.Xa(a),null!==a)?a:this}},rotationSpot:{get:function(){return this.cp},set:function(a){var b=this.cp;b.A(a)||(this.cp=a=a.G(),this.g("rotationSpot",b,a))}},text:{get:function(){return this.Rb},set:function(a){var b=this.Rb;b!==a&&(this.Rb=a,this.g("text",b,a))}},containingGroup:{get:function(){return this.Yh},set:function(a){if(this.Ub()){var b=this.Yh;if(b!==a){null===a||this!==a&&!a.Ud(this)|| (this===a&&B("Cannot make a Group a member of itself: "+this.toString()),B("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.C(2);var c=this.diagram;null!==b?Go(b,this):this instanceof S&&null!==c&&c.Fi.remove(this);this.Yh=a;null!==a?Fo(a,this):this instanceof S&&null!==c&&c.Fi.add(this);this.C(1);if(null!==c){var d=this.data,e=c.model;if(null!==d&&e.ek()){var f=e.ja(null!==a?a.data:null);e.yt(d,f)}}d=this.containingGroupChanged;null!==d&& (e=!0,null!==c&&(e=c.aa,c.aa=!0),d(this,b,a),null!==c&&(c.aa=e));if(this instanceof S)for(c=new F,Rk(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof U)for(d=d.linksConnected;d.next();)Lo(d.value);if(this instanceof U){for(c=this.linksConnected;c.next();)Lo(c.value);c=this.labeledLink;null!==c&&Lo(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&ki(b,-1,a))}}else B("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{ get:function(){return this.cn},set:function(a){var b=this.cn;b!==a&&(this.cn=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{get:function(){return null!==this.containingGroup||this instanceof U&&null!==this.labeledLink?!1:!0}},layoutConditions:{get:function(){return this.co},set:function(a){var b=this.co;b!==a&&(this.co=a,this.g("layoutConditions",b,a))}},dragComputation:{get:function(){return this.un}, set:function(a){var b=this.un;b!==a&&(this.un=a,this.g("dragComputation",b,a))}},shadowOffset:{get:function(){return this.tp},set:function(a){var b=this.tp;b.A(a)||(this.tp=a=a.G(),this.N(),this.g("shadowOffset",b,a))}},shadowColor:{get:function(){return this.sp},set:function(a){var b=this.sp;b!==a&&(this.sp=a,this.N(),this.g("shadowColor",b,a))}},shadowBlur:{get:function(){return this.$e},set:function(a){var b= this.$e;b!==a&&(this.$e=a,this.N(),this.g("shadowBlur",b,a))}}});T.prototype.invalidateLayout=T.prototype.C;T.prototype.findCommonContainingGroup=T.prototype.xx;T.prototype.isMemberOf=T.prototype.Ud;T.prototype.findTopLevelPart=T.prototype.iz;T.prototype.findSubGraphLevel=T.prototype.fz;T.prototype.ensureBounds=T.prototype.zb;T.prototype.getDocumentBounds=T.prototype.cq;T.prototype.getRelativePoint=T.prototype.rf;T.prototype.findObject=T.prototype.Xa;T.prototype.moveTo=T.prototype.moveTo; T.prototype.invalidateAdornments=T.prototype.Lb;T.prototype.clearAdornments=T.prototype.Tj;T.prototype.removeAdornment=T.prototype.xf;T.prototype.addAdornment=T.prototype.xh;T.prototype.findAdornment=T.prototype.ak;T.prototype.updateTargetBindings=T.prototype.Aa;var Do=!1;T.className="Part";T.LayoutNone=0;T.LayoutAdded=1;T.LayoutRemoved=2;T.LayoutShown=4;T.LayoutHidden=8;T.LayoutNodeSized=16;T.LayoutGroupLayout=32;T.LayoutNodeReplaced=64;T.LayoutStandard=127;T.LayoutAll=16777215; function De(a){T.call(this,a);this.D&=-257;this.$g="Adornment";this.Zd=null;this.Mw=0;this.ex=!1;this.l=[];this.Ra=null}la(De,T);De.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};De.prototype.updateRelationshipsFromData=function(){}; De.prototype.ik=function(a){var b=this.adornedObject.part;if(b instanceof Q&&this.adornedObject instanceof W){var c=b.path;b.ik(a);a=c.geometry;b=this.W.j;c=b.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.ye){b.ye=!0;var c=new F;c.add(this);Vo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===wi);b.ye=!1}};function Vo(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.ye){b.ye=!0;var c=new F;c.add(this);Xo(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===wi);b.ye=!1}}; function Xo(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.$p():a.td();k.next();){var l=k.value;l.isTreeLink&&(h||l.yc||l.Na(),l=l.at(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Nb(!0),l.Eh(),g&&e.Pj(l,f)),2e&&(e=h.right);h.bottom>f&&(f=h.bottom)}}isFinite(c)&&isFinite(d)?a.h(c,d,e-c,f-d):(b=b.location, a.h(b.x,b.y,0,0));return a};ma.Object.defineProperties(yg.prototype,{padding:{get:function(){return this.bb},set:function(a){"number"===typeof a&&(a=new pc(a));var b=this.bb;b.A(a)||(this.bb=a=a.G(),this.g("padding",b,a))}}});yg.className="Placeholder"; function Q(){T.call(this,X.Link);this.Pa=8;this.Le=null;this.Me="";this.gf=this.Fn=null;this.hf="";this.Kp=null;this.Pm=pg;this.kn=0;this.mn=pg;this.nn=NaN;this.Gj=bp;this.yp=.5;this.Zc=null;this.xb=(new E).freeze();this.jh=this.gh=null;this.Cl=new M;this.oa=new ud;this.Qn=!0;this.I=this.u=this.Gf=this.Pf=null;this.l=[];this.Hu=new H;this.tr=this.Xw=this.Ww=null;this.cu=NaN;this.O=null}la(Q,T); Q.prototype.cloneProtected=function(a){T.prototype.cloneProtected.call(this,a);a.Pa=this.Pa&-113;a.Me=this.Me;a.Fn=this.Fn;a.hf=this.hf;a.Kp=this.Kp;a.Pm=this.Pm;a.kn=this.kn;a.mn=this.mn;a.nn=this.nn;a.Gj=this.Gj;a.yp=this.yp;null!==this.O&&(a.O=this.O.copy())};t=Q.prototype;t.pf=function(a){T.prototype.pf.call(this,a);this.Me=a.Me;this.hf=a.hf;a.gh=null;a.Na();a.Gf=this.Gf;var b=a.fromPort;null!==b&&Po(a.fromNode,b);b=a.toPort;null!==b&&Po(a.toNode,b)}; t.cb=function(a){a.classType===Q?2===(a.value&2)?this.routing=a:a===sg||a===og||a===ng?this.curve=a:a===cp||a===dp||a===ep?this.adjusting=a:a!==bp&&a!==pg&&B("Unknown Link enum value for a Link property: "+a):T.prototype.cb.call(this,a)};t.Ec=function(){null===this.O&&(this.O=new cl)};t.Wi=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(sj(a)||tj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),sj(a)||tj(a))?!1:!0};t.Sv=function(){return!1}; t.Tv=function(){};t.Ub=function(){return!1};Q.prototype.computeAngle=function(a,b,c){return Q.computeAngle(b,c)};Q.computeAngle=function(a,b){switch(a){default:case pg:a=0;break;case Hn:a=b;break;case Mm:a=b+90;break;case Om:a=b-90;break;case fp:a=b+180;break;case gp:a=I.oq(b);90a&&(a-=180);break;case Nm:a=I.oq(b+90);90a&&(a-=180);break;case Pm:a=I.oq(b-90);90a&&(a-=180);break;case Qm:a=I.oq(b);if(45a||225a)return 0;90a&&(a-=180)}return I.oq(a)}; function Lo(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.xx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.Yh;if(c!==b){null!==c&&Go(c,a);a.Yh=b;null!==b&&Fo(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.aa,g.aa=!0);e(a,c,b);null!==g&&(g.aa=f)}!a.yc||a.Ww!==c&&a.Xw!==c||a.Na()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=Q.prototype; t.Eh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&T.prototype.Eh.call(this)};t.at=function(a){var b=this.fromNode;return a===b?this.toNode:b};t.uz=function(a){var b=this.fromPort;return a===b?this.toPort:b};function So(a,b){null===a.Zc&&(a.Zc=new F);a.Zc.add(b);a.o()} t.gq=function(a){T.prototype.gq.call(this,a);hp(this)&&this.iq(this.actualBounds);if(!a){a=this.Le;var b=null;null!==a&&(b=this.fromPort,Qo(a,this,b));var c=this.gf;if(null!==c){var d=this.toPort;c===a&&d===b||Qo(c,this,d)}ip(this)}};t.hq=function(a){T.prototype.hq.call(this,a);hp(this)&&this.iq(this.actualBounds);if(!a){a=this.Le;var b=null;null!==a&&(b=this.fromPort,Ro(a,this,b));var c=this.gf;if(null!==c){var d=this.toPort;c===a&&d===b||Ro(c,this,d)}jp(this)}}; t.Zj=function(){this.yc=!0;if(null!==this.Zc){var a=this.diagram;if(null!==a)for(var b=this.Zc.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};Q.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; Q.prototype.move=function(a,b){var c=b?this.location:this.position,d=c.x;isNaN(d)&&(d=0);var e=c.y;isNaN(e)&&(e=0);d=a.x-d;e=a.y-e;!0===b?T.prototype.move.call(this,a,!1):(a=H.allocAt(c.x+d,c.y+e),T.prototype.move.call(this,a,!1),H.free(a));rf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; Q.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1};Q.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1}; Q.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(Jb),a;if(1===b)return a.assign(this.i(0)),a;if(2===b){var c=this.i(0),d=this.i(1);a.h((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===sg))return this.oa.lv(.5,a),a.add(this.i(0)),c=this.oa.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===sg){if(3===b)return this.i(1);d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);var e=this.i(c+1), f=this.i(c+2);c=this.i(c+3);I.Fy(d.x,d.y,e.x,e.y,f.x,f.y,c.x,c.y,a)}else a.assign(this.i(c));return a}var g=this.flattenedLengths;c=this.flattenedTotalLength;for(e=f=d=0;dc/2)break;d+=e;f++}b=this.i(f);f=this.i(f+1);1>Math.abs(b.x-f.x)?b.y>f.y?a.h(b.x,b.y-(c/2-d)):a.h(b.x,b.y+(c/2-d)):1>Math.abs(b.y-f.y)?b.x>f.x?a.h(b.x-(c/2-d),b.y):a.h(b.x+(c/2-d),b.y):(c=(c/2-d)/e,a.h(b.x+c*(f.x-b.x),b.y+c*(f.y-b.y)));return a}; Q.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).Sa(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===sg)){a:{a=this.oa;var b=.5;0>b?b=0:1=b){b=c[g];c=b[2*a]; d=b[2*a+1];e=b[2*a+2];a=b[2*a+3];a=1>Math.abs(e-c)&&1>Math.abs(a-d)?0:1>Math.abs(e-c)?0<=a-d?90:270:1>Math.abs(a-d)?0<=e-c?0:180:180*Math.atan2(a-d,e-c)/Math.PI;break a}f+=l}}a=NaN}}return a}if(this.computeCurve()===sg&&4<=a){d=(a-1)/3|0;c=3*(d/2|0);if(1===d%2)return c=Math.floor(c),a=this.i(c),d=this.i(c+1),e=this.i(c+2),c=this.i(c+3),I.Ey(a.x,a.y,d.x,d.y,e.x,e.y,c.x,c.y);if(0e/2)break;b+=f;c++}d=this.i(c);e=this.i(c+1);if(1>Math.abs(d.x-e.x)&&1>Math.abs(d.y-e.y)){if(0Math.abs(d.x-e.x))return d.y>e.y?270:90;if(1>Math.abs(d.y-e.y))return d.x>e.x?180:0}return d.Sa(e)};t=Q.prototype;t.i=function(a){return this.xb.j[a]};t.jd=function(a,b){this.xb.hd(a,b)};t.K=function(a,b,c){this.xb.hd(a,new H(b,c))};t.Gz=function(a,b){this.xb.Kb(a,b)};t.m=function(a,b,c){this.xb.Kb(a,new H(b,c))};t.ue=function(a){this.xb.add(a)}; t.lf=function(a,b){this.xb.add(new H(a,b))};t.Iv=function(a){this.xb.jb(a)};t.Uj=function(){this.xb.clear()};function rf(a,b,c){if(0!==b||0!==c){for(var d=a.yc,e=new E,f=a.xb.iterator;f.next();){var g=f.value;e.add((new H(g.x+b,g.y+c)).freeze())}e.freeze();f=a.xb;a.xb=e;isNaN(b)||isNaN(c)||a.diagram.animationManager.ic?a.o():(a.Xf.h(a.Xf.x+b,a.Xf.y+c),a.la.h(a.la.x+b,a.la.y+c),Bl(a));d&&kp(a);b=a.diagram;null!==b&&b.animationManager.ic&&(a.jh=e);a.g("points",f,e)}} t.Hh=function(){null===this.gh&&(this.gh=this.xb,this.xb=this.xb.copy())}; t.mf=function(){if(null!==this.gh){for(var a=this.gh,b=this.xb,c=Infinity,d=Infinity,e=a.j,f=e.length,g=0;gl&&(n=-n),u=(0>k?-1:1)*n+r,v=m*(u-r)+q);r=g.x+2*h/3;q=g.y+2*k/3;var w=r,y=q;I.w(k,0)?y=0k?-1:1)*n+r,y=m*(w-r)+q);this.Uj();this.ue(g);this.lf(u,v);this.lf(w,y);this.ue(p);this.jd(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.jd(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()?(p=a.x-d.x,e=a.y-d.y,f=this.computeCurviness(),b=d.x+p/2,c=d.y+e/2,g=b,h=c,I.w(e,0)?h=0f&&(g=-g),g=(0>e?-1:1)*g+b,h=p*(g-b)+c),this.ue(d),this.lf(g,h)):this.ue(d),this.ue(a)}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Uj();var z=l?this.computeCurviness():0;n=this.getLinkPoint(b,c,d,!0,m,e,f);r=u=q=0;if(m||!h||l)v=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,n,d,!0,m,e,f),l&&(h||d.A(a)||!m&&1===d.x+ a.x&&1===d.y+a.y)&&(r-=m?90:30,0>z&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(v+=Math.abs(z)*(m?1:2)),0===r?q=v:90===r?u=v:180===r?q=-v:270===r?u=-v:(q=v*Math.cos(r*Math.PI/180),u=v*Math.sin(r*Math.PI/180)),d.jc()&&l&&(v=c.ga(Bc,H.alloc()),w=H.allocAt(v.x+1E3*q,v.y+1E3*u),this.getLinkPointFromPoint(b,c,v,w,!0,n),H.free(v),H.free(w));v=this.getLinkPoint(e,f,a,!1,m,b,c);var A=y=w=0;if(m||!k||l){var C=this.computeEndSegmentLength(e,f,a,!1);A=this.getLinkDirection(e,f,v,a,!1,m,b,c);l&&(k||d.A(a)||!m&& 1===d.x+a.x&&1===d.y+a.y)&&(A+=m?0:30,0>z&&(A+=180));0>A?A+=360:360<=A&&(A-=360);l&&(C+=Math.abs(z)*(m?1:2));0===A?w=C:90===A?y=C:180===A?w=-C:270===A?y=-C:(w=C*Math.cos(A*Math.PI/180),y=C*Math.sin(A*Math.PI/180));a.jc()&&l&&(a=f.ga(Bc,H.alloc()),d=H.allocAt(a.x+1E3*w,a.y+1E3*y),this.getLinkPointFromPoint(e,f,a,d,!1,v),H.free(a),H.free(d))}a=n;if(m||!h||l)a=new H(n.x+q,n.y+u);d=v;if(m||!k||l)d=new H(v.x+w,v.y+y);!p&&!m&&h&&3Math.abs(b.y-a.y)?(b.x>=a.x?b.x=a.x+9E9:b.x=a.x-9E9,b.y=a.y):(b.y>=a.y?b.y=a.y+9E9:b.y=a.y-9E9,b.x=a.x);return b} Q.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new H);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));a=null;e=b.panel;null===e||e.Yd()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.sd;e=1/(a.m11*a.m22-a.m12*a.m21);g=a.m22*e;var h=-a.m12*e,k=-a.m21*e,l=a.m11*e,m=e*(a.m21*a.dy-a.m22*a.dx),n=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*g+d.y*k+m;d=d.x*h+d.y*l+n;g=c.x*g+c.y*k+m;c=c.x*h+c.y*l+n}b.ck(e,d,g,c,f);null!== a&&f.transform(a);return f};function op(a,b){var c=b.To;null===c&&(c=new pp,c.port=b,c.node=b.part,b.To=c);return qp(c,a)} Q.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new H);if(c.eb()&&!mp(c))return b.ga(c,h),h;if(c.uf()){var k=op(this,b);if(null!==k){h.assign(k.lq);if(e&&this.routing===rp){var l=op(this,g);if(null!==l&&k.$l=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.sf(Ic)||c.sf(Lc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);H.free(k);H.free(l)}}return h}}c= b.ga(.5===c.x&&.5===c.y?c:Bc,H.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=np(c,g.copy()))):(k=this.computeSpot(!d,g),f=H.alloc(),g=g.ga(.5===k.x&&.5===k.y?k:Bc,f),e&&(g=np(c,g)),H.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);H.free(c);return h}; Q.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.eb())var k=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)?(h=e?this.i(1):this.i(this.pointsCount-2),h=f?np(k,h.copy()):c):(c=H.alloc(),h=h.ga(Bc,c),H.free(c));c=Math.abs(h.x-k.x)>Math.abs(h.y-k.y)?h.x>= k.x?0:180:h.y>=k.y?90:270;H.free(k);k=c}d.jc()&&g.Ud(a)&&(k+=180,360<=k&&(k-=360));if(mp(d))return k;a=b.Ri();if(0===a)return k;45<=a&&135>a?k+=90:135<=a&&225>a?k+=180:225<=a&&315>a&&(k+=270);360<=k&&(k-=360);return k};Q.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.uf()&&(a=op(this,b),null!==a))return a.bv;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; Q.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=Bc:(b=this.fromSpot,b.Mb()&&(b=a.fromSpot),a=b===$c?wc:b)):(a=b?b:this.toPort,null===a?a=Bc:(b=this.toSpot,b.Mb()&&(b=a.toSpot),a=b===$c?wc:b));return a};function mp(a){return a===wc||.5===a.x&&.5===a.y}Q.prototype.computeOtherPoint=function(a,b){a=b.ga(Bc);b=b.To;b=null!==b?qp(b,this):null;null!==b&&(a=b.lq);return a}; Q.prototype.computeShortLength=function(a){if(a){a=this.fromShortLength;if(isNaN(a)){var b=this.fromPort;null!==b&&(a=b.fromShortLength)}return isNaN(a)?0:a}a=this.toShortLength;isNaN(a)&&(b=this.toPort,null!==b&&(a=b.toShortLength));return isNaN(a)?0:a}; Q.prototype.wg=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var g=f;void 0===f&&(g=sd.alloc(),g.reset());g.multiply(this.transform);if(this.Bh(a,g))return cn(this,b,c,e),void 0===f&&sd.free(g),!0;if(this.Gc(a,g)){var h=!1;if(!this.isAtomic)for(var k=this.W.j,l=k.length;l--;){var m=k[l];if(m.visible||m===this.locationObject){var n=m.actualBounds,p=this.naturalBounds;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=sd.alloc();n.set(g); if(m instanceof X)h=m.wg(a,b,c,d,e,n);else if(this.path===m){if(m instanceof W)if(h=a,p=d,!1===m.pickable)h=!1;else if(n.multiply(m.transform),p)b:{var r=h,q=n;if(m.Bh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.nf(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var v=H.alloc(),w=H.alloc(),y=H.alloc(),z=sd.alloc();z.set(q);z.wv(m.transform);z.ft();w.x=p;w.y=u;w.transform(z);v.x=h;v.y=u;v.transform(z);q=!1;Fn(m,v,w,y)?q=!0:(v.x=p,v.y=r,v.transform(z),Fn(m,v,w,y)?q=!0:(w.x= h,w.y=r,w.transform(z),Fn(m,v,w,y)?q=!0:(v.x=h,v.y=u,v.transform(z),Fn(m,v,w,y)&&(q=!0))));sd.free(z);H.free(v);H.free(w);H.free(y);h=q}}else h=m.Bh(h,n)}else h=il(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));sd.free(n)}}}void 0===f&&sd.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&sd.free(g);return!1}; Q.prototype.computeCurve=function(){if(null===this.Pf){var a=this.fromPort,b=this.isOrthogonal;this.Pf=null!==a&&a===this.toPort&&!b}return this.Pf?sg:this.curve};Q.prototype.computeCorner=function(){if(this.curve===sg)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; Q.prototype.findMidLabel=function(){for(var a=this.path,b=this.W.j,c=b.length,d=0;dk?-Math.PI/2:Math.PI/2;else m=Math.atan(k/Math.abs(h)),0>h&&(m=Math.PI-m);g=b.x;var n=b.y;h=d.x-g;var p=d.y-n;k=Math.sqrt(h*h+p*p);I.Z(h,0)?p=0>p?-Math.PI/2:Math.PI/2:(p=Math.atan(p/Math.abs(h)),0>h&&(p=Math.PI-p));l=k/l;m=p- m;this.jd(a,b);for(a+=1;ak?-Math.PI/2:Math.PI/2:(k=Math.atan(k/Math.abs(h)),0>h&&(k=Math.PI-k)),h=k+m,b*=l,this.K(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.jd(c,d)}}return!0;case ep:f=this.i(a);n=this.i(c);if(!f.Ma(b)||!n.Ma(d)){e=f.x;f=f.y;g=n.x;n=n.y;l=(g-e)*(g-e)+(n-f)*(n-f);h=b.x;m=b.y;k=d.x;p=d.y;var r=1;if(0!==k-h){var q=(p-m)/(k-h);r=Math.sqrt(1+1/(q*q))}else q=9E9;this.jd(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 g=e.actualBounds.copy(),h=f.actualBounds.copy();if(g.v()&&h.v()){g.Tc(8,8);h.Tc(8,8);g.Ce(a);h.Ce(c);if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&h.right>a.x){var k=new H(c.x,a.y);var l=new H(c.x,(a.y+c.y)/2);180===d?(k.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1),l.x=k.x,l.y=c.y):270===d&&c.ya.y?(k.x=a.xh.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):h.right,l.x=k.x,l.y=c.y):0===d&&a.xh.top&&a.yg.bottom)180===d&&(h.$(a)||g.$(c))?k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0): c.ya.y&&(180===d||270===d)&&(k.y=this.computeMidOrthoPosition(a.x,g.bottom,c.x,Math.min(c.y,h.top),!0)),l.x=c.x,l.y=k.y;if(k.y>g.top&&k.y=g.left&&c.x<=a.x||a.x<=h.right&&a.x>=c.x){if(90===d||270===d)k=new H(Math.max((a.x+c.x)/2,a.x),a.y),l=new H(k.x,c.y)}else k.y=270===d||(0===d||180===d)&&c.ya.y&&h.lefta.y?(k.x=a.x>h.right?this.computeMidOrthoPosition(a.x,a.y,h.right,c.y,!1):a.x>h.left&&(270===d&&a.yh.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):h.left,l.x=k.x,l.y=c.y):180===d&&a.x>h.right&&a.y>h.top&&a.y< h.bottom&&(k.x=a.x,k.y=a.yg.bottom)0===d&&(h.$(a)||g.$(c))?k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(0===d||270===d)&&(k.y=this.computeMidOrthoPosition(a.x,g.bottom,c.x,Math.min(c.y,h.top),!0)),l.x=c.x,l.y=k.y;if(k.y>g.top&&k.y=a.x||a.x>=h.left&&a.x<=c.x){if(90===d||270===d)k=new H(Math.min((a.x+c.x)/2,a.x),a.y),l=new H(k.x,c.y)}else k.y=270===d||(0===d||180===d)&&c.ya.y||180===d&&c.xa.y||0===d&&c.x>a.x&&h.bottom>a.y)k=new H(a.x,c.y),l=new H((a.x+c.x)/2,c.y),270===d?(k.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0),l.x=c.x,l.y=k.y):180=== d&&c.xa.x?(k.y=a.yh.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):h.bottom,l.x=c.x,l.y=k.y):90===d&&a.yh.left&&a.xg.right)270===d&&(h.$(a)||g.$(c))?k.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1):c.xa.x&&(270===d||180===d)&&(k.x=this.computeMidOrthoPosition(g.right,a.y,Math.min(c.x,h.left),c.y,!1)),l.x=k.x,l.y=c.y;if(k.x>g.left&&k.x=g.top&&c.y<=a.y||a.y<=h.bottom&&a.y>=c.y){if(0===d||180===d)k=new H(a.x,Math.max((a.y+c.y)/2,a.y)),l=new H(c.x,k.y)}else k.x=180===d||(90===d||270===d)&&c.xa.x&&h.top=a.x?(k.y=a.y>h.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,h.bottom,!0):a.y>h.top&&(180===d&&a.xh.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):h.top,l.x=c.x,l.y=k.y):270===d&&a.y>h.bottom&&a.x> h.left&&a.xg.right)90===d&&(h.$(a)||g.$(c))?k.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.xa.x&&(90===d||180===d)&&(k.x=this.computeMidOrthoPosition(g.right,a.y,Math.min(c.x,h.left),c.y,!1)),l.x=k.x,l.y=c.y;if(k.x>g.left&& k.x=a.y||a.y>=h.top&&a.y<=c.y){if(0===d||180===d)k=new H(a.x,Math.min((a.y+c.y)/2,a.y)),l=new H(c.x,k.y)}else k.x=180===d||(90===d||270===d)&&c.x=vp&&(wk(q),h=q.Pz,g.Tc(q.Zl*h,q.Yl*h),tp(q,a,b,p,d,g), h=up(q,p.x,p.y));!q.abort&&h>=vp&&q.rA&&(wk(q),tp(q,a,b,p,d,q.bounds),h=up(q,p.x,p.y));if(!q.abort&&hthis.pointsCount)0===b||180===b?(g.x=a.x,g.y=p.y):(g.x=p.x,g.y=a.y),this.K(2,g.x,g.y),this.m(3,g.x,g.y);else if(p=this.i(3),0===b||180===b)I.w(g.x,p.x)?(g=0===b?Math.max(g.x,a.x):Math.min(g.x,a.x),this.K(2,g,a.y),this.K(3,g,p.y)):I.w(g.y,p.y)?(Math.abs(a.y-g.y)<=q.Yl/2&&(this.K(2,g.x,a.y),this.K(3,p.x,a.y)),this.m(2,g.x,a.y)):this.K(2, a.x,g.y);else if(90===b||270===b)I.w(g.y,p.y)?(g=90===b?Math.max(g.y,a.y):Math.min(g.y,a.y),this.K(2,a.x,g),this.K(3,p.x,g)):I.w(g.x,p.x)?(Math.abs(a.x-g.x)<=q.Zl/2&&(this.K(2,a.x,g.y),this.K(3,a.x,p.y)),this.m(2,a.x,g.y)):this.K(2,g.x,a.y);null!==c&&(a=this.i(1),p=this.i(2),a.x!==p.x&&a.y!==p.y?0===b||180===b?this.m(2,a.x,p.y):this.m(2,p.x,a.y):0===b||180===b?this.m(2,e.x,c.y):this.m(2,c.x,e.y));null!==u&&(0===d||180===d?this.lf(f.x,u.y):this.lf(u.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.ue(k), this.ue(l))}};Q.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;this.hasCurviness()&&(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f};function Pj(a){if(null===a.diagram||!a.isAvoiding||!sk(a.diagram))return!1;var b=a.points.j,c=b.length;if(4>c)return!1;a=tk(a.diagram,!0,a.containingGroup,null);for(var d=1;dyp&&up(b,l,m)===k-1;)c=l,d=m,0===e?l+=g:90===e?m+=h:180===e?l-=g:m-=h,--k;if(f){if(k>yp)if(180===e||0===e)c=Math.floor(c/g)*g+g/2;else if(90===e||270===e)d=Math.floor(d/h)*h+h/2}else c=Math.floor(c/g)*g+g/2,d=Math.floor(d/h)*h+h/2;k>yp&&(f=e,l=c,m=d,0===e?(f=90,m+=h):90===e?(f=180,l-=g):180===e?(f=270,m-=h):270===e&&(f=0,l+=g),up(b,l,m)===k-1?xp(a,b,l,m,f,!1):(l=c,m=d,0===e?(f=270,m-=h):90=== e?(f=0,l+=g):180===e?(f=90,m+=h):270===e&&(f=180,l-=g),up(b,l,m)===k-1&&xp(a,b,l,m,f,!1)));a.lf(c,d)}Q.prototype.Wy=function(a){var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Ab(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gb)return a.type=xd,this.Qn=!1,a;var c=!1,d=this.diagram;null!==d&&hp(this)&&d.di.contains(this)&&(0!==this.Cl.width||0!==this.Cl.height)&&(c=!0);var e=this.i(0).copy(),f=e.copy();d=this.xb.j;var g=this.computeCurve();if(g===sg&&3<=b&&!I.Z(this.smoothness,0))if(3===b){var h=this.i(1);d=Math.min(e.x,h.x);var k=Math.min(e.y,h.y);h=this.i(2);d=Math.min(d,h.x);k=Math.min(k,h.y)}else{if(this.isOrthogonal)for(k=0;k=b&&(d=b-1),k=this.i(d),f.x=Math.min(k.x,f.x),f.y=Math.min(k.y,f.y);d=f.x;k=f.y}else{for(k=0;kv?q>r?(g.x=w-z,g.y=r-z,b.x=w+u,b.y=r+u):(g.x= w-z,g.y=r+z,b.x=w+u,b.y=r-u):q>r?(g.x=w+z,g.y=r-z,b.x=w-u,b.y=r+u):(g.x=w+z,g.y=r+z,b.x=w-u,b.y=r-u));I.Z(v,w)&&I.Z(r,q)&&(r>p?(y>w?(g.x=w-z,g.y=r-z,b.x=w+u):(g.x=w+z,g.y=r-z,b.x=w-u),b.y=r+u):(y>w?(g.x=w-z,g.y=r+z,b.x=w+u):(g.x=w+z,g.y=r+z,b.x=w-u),b.y=r-u));if(I.Z(v,w)&&I.Z(w,y)||I.Z(p,r)&&I.Z(r,q))v=.5*(v+y),p=.5*(p+q),g.x=v,g.y=p,b.x=v,b.y=p;1===n?(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y)):2===n&&I.Z(c.x,this.i(0).x)&&I.Z(c.y,this.i(0).y)&&(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y));Md(h,e.x-d,e.y-k,g.x-d,g.y- k,l.x-d,l.y-k);f.set(g);e.set(b);c=l}}f=c.x;c=c.y;e=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(e=zp(this,e.copy(),!1,Fb));f=.5*(f+e.x);c=.5*(c+e.y);Md(h,b.x-d,b.y-k,f-d,c-k,e.x-d,e.y-k)}else for(c=3;c=b&&(c=b-1),e=this.i(c-1),g=this.i(c),c===b-1&&0!==this.computeShortLength(!1)&&(g=zp(this,g.copy(),!1,Fb)),Md(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f=H.alloc();f.assign(this.i(0));g=1;for(e=0;g=b-1){if(!f.A(m))0!== this.computeShortLength(!1)&&(m=zp(this,m.copy(),!1,Fb)),Cp(this,h,-d,-k,f,m,c);else if(0===e)for(g=1;gf.x?w=m.x-p:w=m.x+p,n.y>m.y?q=m.y+u:q=m.y-u,Cp(this,h,g,l,f,new H(w,r),v),Rd(h,m.x+g,m.y+l,y+g,q+l), f.h(y,q))):I.w(f.x,m.x)&&I.w(m.y,n.y)?(p=this.computeCorner(),p=Math.min(p,Math.abs(m.y-f.y)/2),p=u=Math.min(p,Math.abs(n.x-m.x)/2),I.w(u,0)?(Cp(this,h,g,l,f,m,v),f.assign(m)):(w=m.x,r=m.y,y=w,q=r,m.y>f.y?r=m.y-p:r=m.y+p,n.x>m.x?y=m.x+u:y=m.x-u,Cp(this,h,g,l,f,new H(w,r),v),Rd(h,m.x+g,m.y+l,y+g,q+l),f.h(y,q))):(Cp(this,h,g,l,f,m,v),f.assign(m));g=e}H.free(f)}Ud=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=zp(this,e,!0,f)),0!==this.computeShortLength(!1)&&(h=zp(this, h,!1,f)),a.type=xd,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.Qn=!1;return a};function Bp(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 I.Z(a,0)?b:I.Z(b,0)?a:Math.sqrt(a*a+b*b)} function zp(a,b,c,d){var e=a.pointsCount;if(2>e)return b;if(c){var f=a.i(1);c=f.x-d.x;f=f.y-d.y;d=Bp(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!0);a>e&&(a=e);e=a*(f-b.y)/d;b.x+=a*(c-b.x)/d;b.y+=e}else{f=a.i(e-2);c=f.x-d.x;f=f.y-d.y;d=Bp(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!1);a>e&&(a=e);e=a*(b.y-f)/d;b.x-=a*(b.x-c)/d;b.y-=e}return b} function Ap(a,b,c,d){for(var e=a.pointsCount,f=b;I.Z(b.x,f.x)&&I.Z(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!I.Z(b.x,f.x)&&!I.Z(b.y,f.y))return c-1;for(var g=f;I.Z(b.x,f.x)&&I.Z(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||I.Z(b.y,f.y)&&I.Z(f.y,g.y)&&(!d||(b.x>=f.x?f.x>=g.x:f.x<=g.x));){if(c>=e)return e-1;g=a.i(c++)}return c-2} function Cp(a,b,c,d,e,f,g){if(!g&&hp(a)){g=[];var h=0;a.isVisible()&&(h=Dp(a,e,f,g));if(0 l-10)h--,l=Math.max(k-5,f.x);else break;k=f.y-10+d;l+=c;n=f.y+d;a.curve===og?Ld(b,l,n,!1):Md(b,m,k,l,k,l,n)}else if(I.w(e.x,f.x))if(e.yk-10)h--,k=Math.max(l-5,f.y);else break;l=f.x-10+c;n=f.x+c;k+=d;a.curve===og?Ld(b,n,k,!1):Md(b,l,m,l,k,n,k)}}b.lineTo(f.x+c,f.y+d)} function Dp(a,b,c,d){var e=a.diagram;if(null===e||b.A(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Ca.j;for(var g=f.length,h=0;hg.x&&m.x>=l.x||l.xg.y&&m.y>=l.y||l.yq&&Math.min(g,v)n&&!I.w(g,v)){h.x=q;h.y=n;m=!0;break a}}else if(!I.w(n,r)&& I.w(g,v)&&Math.min(n,r)g&&Math.min(q,u)m&&!I.w(q,u)){h.x=m;h.y=g;m=!0;break a}h.x=0;h.y=0;m=!1}m&&(e?c.push(h.x):c.push(h.y));g=l}H.free(h)}function hp(a){a=a.curve;return a===ng||a===og}function lp(a,b){if(b||hp(a))b=a.diagram,null===b||b.animationManager.isTicking||b.di.contains(a)||0===a.Cl.width&&0===a.Cl.height||b.di.add(a,a.Cl.copy())} Q.prototype.iq=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isAnimating){var d=!1;for(c=c.layers;c.next();){var e=c.value;if(e.visible)if(e===b){d=!0;var f=!1;e=e.Ca.j;for(var g=e.length,h=0;ha&&va(a,">= 0",Q,"fromEndSegmentLength"),this.O.Tg=a,this.g("fromEndSegmentLength",b,a),this.Na())}}, fromShortLength:{get:function(){return null!==this.O?this.O.Ug:NaN},set:function(a){this.Ec();var b=this.O.Ug;b!==a&&(this.O.Ug=a,this.g("fromShortLength",b,a),this.Na(),this.bc())}},toSpot:{get:function(){return null!==this.O?this.O.uh:$c},set:function(a){this.Ec();var b=this.O.uh;b.A(a)||(a=a.G(),this.O.uh=a,this.g("toSpot",b,a),this.Na())}},toEndSegmentLength:{get:function(){return null!==this.O?this.O.sh: NaN},set:function(a){this.Ec();var b=this.O.sh;b!==a&&(0>a&&va(a,">= 0",Q,"toEndSegmentLength"),this.O.sh=a,this.g("toEndSegmentLength",b,a),this.Na())}},toShortLength:{get:function(){return null!==this.O?this.O.th:NaN},set:function(a){this.Ec();var b=this.O.th;b!==a&&(this.O.th=a,this.g("toShortLength",b,a),this.Na(),this.bc())}},isLabeledLink:{get:function(){return null===this.Zc?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);I.Xl(e.x,e.y,g.x,g.y,h.x,h.y,k.x,k.y,.5,a);b=Math.min(k.x,b);c=Math.min(k.y,c);e=k}else for(e=this.i(0),f=this.i(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.h(e.x,e.y,0,0),a.Ce(f),e=2;ed&&(d=-d)):I.Z(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.we(e));a.push(d)}}return this.tr}},flattenedTotalLength:{get:function(){var a=this.cu;if(isNaN(a)){for(var b=this.flattenedLengths, c=b.length,d=a=0;d=this.pointsCount?0:this.isOrthogonal|| !mp(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!mp(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.Pm},set:function(a){var b=this.Pm;b!==a&&(this.Pm=a,this.g("adjusting",b,a))}},corner:{get:function(){return this.kn},set:function(a){var b=this.kn;b!==a&&(this.kn=a,this.bc(),this.g("corner",b,a))}},curve:{ get:function(){return this.mn},set:function(a){var b=this.mn;b!==a&&(this.mn=a,this.Na(),this.bc(),lp(this,b===og||b===ng||a===og||a===ng),this.g("curve",b,a))}},curviness:{get:function(){return this.nn},set:function(a){var b=this.nn;b!==a&&(this.nn=a,this.Na(),this.bc(),this.g("curviness",b,a))}},routing:{get:function(){return this.Gj},set:function(a){var b=this.Gj;b!==a&&(this.Gj=a,this.Pf=null,this.Na(),lp(this,2===(b.value& 2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{get:function(){return this.yp},set:function(a){var b=this.yp;b!==a&&(this.yp=a,this.bc(),this.g("smoothness",b,a))}},key:{get:function(){var a=this.diagram;if(null!==a&&a.model.jm())return a.model.Tb(this.data)}}});Q.prototype.invalidateOtherJumpOvers=Q.prototype.iq;Q.prototype.findClosestSegment=Q.prototype.Wy;Q.prototype.updateRoute=Q.prototype.cj;Q.prototype.invalidateRoute=Q.prototype.Na; Q.prototype.rollbackRoute=Q.prototype.Rx;Q.prototype.commitRoute=Q.prototype.mf;Q.prototype.startRoute=Q.prototype.Hh;Q.prototype.clearPoints=Q.prototype.Uj;Q.prototype.removePoint=Q.prototype.Iv;Q.prototype.addPointAt=Q.prototype.lf;Q.prototype.addPoint=Q.prototype.ue;Q.prototype.insertPointAt=Q.prototype.m;Q.prototype.insertPoint=Q.prototype.Gz;Q.prototype.setPointAt=Q.prototype.K;Q.prototype.setPoint=Q.prototype.jd;Q.prototype.getPoint=Q.prototype.i;Q.prototype.getOtherPort=Q.prototype.uz; Q.prototype.getOtherNode=Q.prototype.at; var bp=new D(Q,"Normal",1),Hp=new D(Q,"Orthogonal",2),Ip=new D(Q,"AvoidsNodes",6),rp=new D(Q,"AvoidsNodesStraight",7),pg=new D(Q,"None",0),sg=new D(Q,"Bezier",9),og=new D(Q,"JumpGap",10),ng=new D(Q,"JumpOver",11),cp=new D(Q,"End",17),dp=new D(Q,"Scale",18),ep=new D(Q,"Stretch",19),Hn=new D(Q,"OrientAlong",21),Mm=new D(Q,"OrientPlus90",22),Om=new D(Q,"OrientMinus90",23),fp=new D(Q,"OrientOpposite",24),gp=new D(Q,"OrientUpright",25),Nm=new D(Q,"OrientPlus90Upright",26),Pm=new D(Q,"OrientMinus90Upright", 27),Qm=new D(Q,"OrientUpright45",28);Q.className="Link";Q.Normal=bp;Q.Orthogonal=Hp;Q.AvoidsNodes=Ip;Q.AvoidsNodesStraight=rp;Q.None=pg;Q.Bezier=sg;Q.JumpGap=og;Q.JumpOver=ng;Q.End=cp;Q.Scale=dp;Q.Stretch=ep;Q.OrientAlong=Hn;Q.OrientPlus90=Mm;Q.OrientMinus90=Om;Q.OrientOpposite=fp;Q.OrientUpright=gp;Q.OrientPlus90Upright=Nm;Q.OrientMinus90Upright=Pm;Q.OrientUpright45=Qm;function Gp(a,b,c,d){Za(this);this.ge=this.Er=!1;this.nt=a;this.Nx=b;this.xv=c;this.Ox=d;this.links=[]} Gp.prototype.hm=function(){if(!this.Er){var a=this.links;0=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Md=Math.floor((a.x-this.kc)/this.kc)*this.kc;this.Nd=Math.floor((b-this.lc)/this.lc)*this.lc;this.mo=Math.ceil((c+2*this.kc)/this.kc)*this.kc;this.no=Math.ceil((d+2*this.lc)/this.lc)*this.lc;a=1+(Math.ceil((this.mo-this.Md)/this.kc)|0);b=1+(Math.ceil((this.no-this.Nd)/this.lc)|0);if(null===this.Cb||this.Lj=yp&&(a.Cb[b][c]=Jp)} uk.prototype.gk=function(a,b,c,d){if(a>this.mo||a+cthis.no||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.Lj)|0;for(c=Math.min(b+e-1,this.Mj)|0;a<=d;a++)for(e=b;e<=c;e++)if(this.Cb[a][e]===wp)return!1;return!0}; function Kp(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.Cb[l][m];if(n>=yp&&n=a.Cb[l][m]);)a.Cb[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)Kp(a,b,c,1,!e,f,g,h,k),Kp(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)Kp(a,b,c,1,!e,f,g,h,k),Kp(a,b,c,-1,!e,f,g,h, k)}}function Lp(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=wp,m=yp;for(a.Cb[b][c]=m;l===wp&&b>f&&bh&&cf&&bh&&c=Math.abs(g-b)&&1>=Math.abs(h-d))a.abort=!0;else{var k=f.x,l=f.y,m=f.x+f.width,n=f.y+f.height;k-=a.Md;k/=a.kc;l-=a.Nd;l/=a.lc;m-=a.Md;m/=a.kc;n-=a.Nd;n/=a.lc;f=Math.max(0,Math.min(a.Lj,k|0));m=Math.min(a.Lj,Math.max(0,m|0));l=Math.max(0,Math.min(a.Mj,l|0));n=Math.min(a.Mj,Math.max(0,n|0));g|=0;h|=0;b|=0;d|=0;k=0===c||90===c? 1:-1;c=90===c||270===c;a.Cb[g][h]===wp?(Lp(a,g,h,k,c,f,m,l,n),Lp(a,g,h,1,!c,f,m,l,n),Lp(a,g,h,-1,!c,f,m,l,n)):Lp(a,g,h,k,c,g,h,g,h);a.Cb[b][d]===wp?(Mp(a,b,d,0===e||90===e?1:-1,90===e||270===e,f,m,l,n),Mp(a,b,d,1,!(90===e||270===e),f,m,l,n),Mp(a,b,d,-1,!(90===e||270===e),f,m,l,n)):Mp(a,b,d,k,c,b,d,b,d);a.abort||(Kp(a,g,h,1,!1,f,m,l,n),Kp(a,g,h,-1,!1,f,m,l,n),Kp(a,g,h,1,!0,f,m,l,n),Kp(a,g,h,-1,!0,f,m,l,n))}}} ma.Object.defineProperties(uk.prototype,{bounds:{get:function(){return new M(this.Md,this.Nd,this.mo-this.Md,this.no-this.Nd)}},Zl:{get:function(){return this.kc},set:function(a){0=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case 3:return c>a&&c<=180+a?180:270;case 5:return c>180-a&&c<=360-a?270:0;case 12:return c>a&&c<=180+a?90:0;case 10:return c>180-a&&c<=360-a?180:90;case 7:return 90180+a&&c<=360-a?270:0;case 13:return 180a&&180>=c?90:0;case 14:return c> a&&c<=180-a?90:c>180-a&&270>=c?180:0;case 11:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&15!==b&&(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}pp.prototype.hm=function(){this.Vd.length=0}; function qp(a,b){var c=a.Vd;if(0===c.length){a:if(!a.nq){c=a.nq;a.nq=!0;var d=null,e=a.node;e=e instanceof S?e:null;if(null===e||e.isSubGraphExpanded)var f=a.node.ev(a.port.portId);else{if(!e.actualBounds.v()){a.nq=c;break a}d=e;f=d.dv()}var g=a.Vd.length=0,h=a.port.ga(xc,H.alloc()),k=a.port.ga(Hc,H.alloc());e=M.allocAt(h.x,h.y,0,0);e.Ce(k);H.free(h);H.free(k);h=H.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.Ri();for(f=f.iterator;f.next();){var l=f.value;if(l.isVisible()&&l.fromPort!==l.toPort){var m= l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Ud(d),n=l.computeSpot(m,a.port);if(n.uf()&&(m=m?l.toPort:l.fromPort,null!==m)){var p=m.part;if(null!==p){var r=p.findVisibleNode();null!==r&&r!==p&&(p=r,m=p.port);m=l.computeOtherPoint(p,m);p=h.Sa(m);p-=k;0>p&&(p+=360);n=Np(e,n,p,l.isOrthogonal);0===n?(n=4,180Math.abs(u)?(y=Math.abs(u)/p,p=Math.abs(u)):y=1;break;case 2:r>Math.abs(z)?(y=Math.abs(z)/r,r=Math.abs(z)):y=1;break;case 1:n>Math.abs(u)?(y=Math.abs(u)/n,n=Math.abs(u)):y=1;break;default:case 4:m>Math.abs(z)?(y=Math.abs(z)/m,m=Math.abs(z)):y=1}w=0}var J=A.lq;if(d===Zo){A=A.link.computeThickness(); A*=y;J.set(C);switch(q){case 8:J.x=C.x+u/2+p/2-w-A/2;break;case 2:J.y=C.y+z/2+r/2-w-A/2;break;case 1:J.x=C.x+u/2-n/2+w+A/2;break;default:case 4:J.y=C.y+z/2-m/2+w+A/2}w+=A}else{var K=.5;d===Mo&&(K=(A.fq+1)/(A.$l+1));J.x=C.x+u*K;J.y=C.y+z*K}}}H.free(h);H.free(k);H.free(f);H.free(l);C=a.Vd;for(g=0;gb.xc?1:a.angleb.angle?1:0};pp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,wc,b.fromPort===this.port),d=a.fq;if(0>d)return c;var e=a.$l;if(1>=e||!b.isOrthogonal)return c;b=a.Bv;var f=a.lq;if(2===a.xc||8===a.xc)d=e-1-d;return((a=2===a.xc||4===a.xc)?b.y=c-1?(g=0,e=d,f+=h+20,h=0):g++}null!==a&&a.Ua("Layout")}this.isValidLayout=!0};Di.prototype.pk=function(a){return!a.location.v()||a instanceof S&&a.pk?!0:!1}; function Qp(a,b,c,d,e,f,g,h){for(c=c.iterator;c.next();){var k=c.value;d&&!k.isTopLevel||null!==e&&!e(k)||!k.canLayout()||(f&&k instanceof U?k.isLinkLabel||(k instanceof S?null===k.layout?Qp(a,b,k.memberParts,!1,e,f,g,h):(Rp(k),b.add(k)):(Rp(k),b.add(k))):g&&k instanceof Q?b.add(k):!h||!k.Ub()||k instanceof U||(Rp(k),b.add(k)))}}function Rp(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.zb()} Di.prototype.Ti=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new M),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b};Di.prototype.nx=function(a){var b=new F;a instanceof P?(Qp(this,b,a.nodes,!0,null,!0,!0,!0),Qp(this,b,a.links,!0,null,!0,!0,!0),Qp(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof S?Qp(this,b,a.memberParts,!1,null,!0,!0,!0):Qp(this,b,a.iterator,!1,null,!0,!0,!0);return b}; Di.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.ga(xc),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a}; ma.Object.defineProperties(Di.prototype,{diagram:{get:function(){return this.B},set:function(a){this.B=a}},group:{get:function(){return this.I},set:function(a){this.I!==a&&(this.I=a,null!==a&&(this.B=a.diagram))}},isOngoing:{get:function(){return this.Sn},set:function(a){this.Sn!==a&&(this.Sn=a)}},isInitial:{get:function(){return this.ii},set:function(a){this.ii=a;a||(this.Xn=!0)}}, isViewportSized:{get:function(){return this.Yn},set:function(a){this.Yn!==a&&(this.Yn=a)&&this.C()}},isRouting:{get:function(){return this.Vn},set:function(a){this.Vn!==a&&(this.Vn=a)}},isRealtime:{get:function(){return this.Un},set:function(a){this.Un!==a&&(this.Un=a)}},isValidLayout:{get:function(){return this.Xn},set:function(a){this.Xn!==a&&(this.Xn=a,a||(a=this.diagram,null!== a&&(a.Ig=!0)))}},network:{get:function(){return this.l},set:function(a){this.l!==a&&(this.l=a,null!==a&&(a.layout=this))}},boundsComputation:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a,this.C())}},arrangementOrigin:{get:function(){return this.Tm},set:function(a){this.Tm.A(a)||(this.Tm.assign(a),this.C())}}});Di.prototype.collectParts=Di.prototype.nx;Di.prototype.getLayoutBounds=Di.prototype.Ti; Di.prototype.invalidateLayout=Di.prototype.C;Di.className="Layout";function Pp(a){Za(this);this.hc=a;this.jf=new F;this.be=new F;this.ot=new G;this.jt=new G}Pp.prototype.clear=function(){if(this.jf)for(var a=this.jf.iterator;a.next();)a.value.clear();if(this.be)for(a=this.be.iterator;a.next();)a.value.clear();this.jf=new F;this.be=new F;this.ot=new G;this.jt=new G}; Pp.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.jf.count+" edges: "+this.be.count;if(1b?1:0):1:null!==b?-1:0} ma.Object.defineProperties(Sp.prototype,{sourceEdgesArrayAccess:{get:function(){return this.Dg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.ug._dataArray}},data:{get:function(){return this.hb},set:function(a){this.hb=a;if(null!==a){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.u.h(d/2,b/2);this.l.h(a,c,d,b)}}},node:{get:function(){return this.ti}, set:function(a){if(this.ti!==a){this.ti=a;a.zb();var b=this.network.layout,c=M.alloc(),d=b.Ti(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.l.h(b,e,f,d);M.free(c);if(!(a instanceof S)&&(a=a.locationObject.ga(Bc),a.v())){this.u.h(a.x-b,a.y-e);return}this.u.h(f/2,d/2)}}},bounds:{get:function(){return this.l},set:function(a){this.l.A(a)||this.l.assign(a)}},focus:{get:function(){return this.u},set:function(a){this.u.A(a)|| this.u.assign(a)}},centerX:{get:function(){return this.l.x+this.u.x},set:function(a){var b=this.l;b.x+this.u.x!==a&&(b.ea(),b.x=a-this.u.x,b.freeze())}},centerY:{get:function(){return this.l.y+this.u.y},set:function(a){var b=this.l;b.y+this.u.y!==a&&(b.ea(),b.y=a-this.u.y,b.freeze())}},focusX:{get:function(){return this.u.x},set:function(a){var b=this.u;b.x!==a&&(b.ea(),b.x=a,b.freeze())}},focusY:{ get:function(){return this.u.y},set:function(a){var b=this.u;b.y!==a&&(b.ea(),b.y=a,b.freeze())}},x:{get:function(){return this.l.x},set:function(a){var b=this.l;b.x!==a&&(b.ea(),b.x=a,b.freeze())}},y:{get:function(){return this.l.y},set:function(a){var b=this.l;b.y!==a&&(b.ea(),b.y=a,b.freeze())}},width:{get:function(){return this.l.width},set:function(a){var b=this.l;b.width!==a&&(b.ea(),b.width= a,b.freeze())}},height:{get:function(){return this.l.height},set:function(a){var b=this.l;b.height!==a&&(b.ea(),b.height=a,b.freeze())}},network:{get:function(){return this.Vc},set:function(a){this.Vc=a}},sourceVertexes:{get:function(){for(var a=new F,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new F,b= this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new F,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);for(b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},sourceEdges:{get:function(){return this.Dg.iterator}},destinationEdges:{get:function(){return this.ug.iterator}},edges:{get:function(){for(var a= new E,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{get:function(){return this.Dg.count+this.ug.count}}});Sp.prototype.deleteDestinationEdge=Sp.prototype.Zu;Sp.prototype.addDestinationEdge=Sp.prototype.Ou;Sp.prototype.deleteSourceEdge=Sp.prototype.$u;Sp.prototype.addSourceEdge=Sp.prototype.Qu;Sp.className="LayoutVertex";Sp.standardComparer=Zp; Sp.smartComparer=function(a,b){if(null!==a){if(null!==b){a=a.ti;var c=b.ti;if(null!==a){if(null!==c){b=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/);a=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/);for(c=0;c=f&&0>=g&&(f=1);b=this.spacing.width;isFinite(b)||(b=0);c=this.spacing.height;isFinite(c)||(c=0);null!==a&&a.ta("Layout");d=[];switch(this.alignment){case hq:var h=b,k=c,l=M.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n=m=0;nf-1||0g)d.push(new M(0,u,g+h,w)),v=0,q=r,u+=w,w=0;w=Math.max(w,J);switch(p){case gq:A=-A.width;break;default:A= 0}z.moveTo(q+A,u);switch(p){case gq:q-=C;break;default:q+=C}v++}d.push(new M(0,u,g+h,w));M.free(l);break;case $p:k=g;m=f;n=b;p=c;g=M.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=H.alloc();for(q=0;q=l&&(k-=l);l=z=0;C=Math.max(this.cellSize.height,1);A=f=0;J=!0;v=H.alloc();for(K=0;Km-1||0k){d.push(new M(0,J?y-f:y,k+n,A+f+p));for(L=0;Ll&&(f.width+=f.x-l,f.x=l);M.free(g)}for(h=f=g=e=0;hb?1:0} ma.Object.defineProperties(Lk.prototype,{wrappingWidth:{get:function(){return this.Qp},set:function(a){this.Qp!==a&&(0n)){var u=n+an(q);q.Fc(u,!0);mn(q,u,n)}}b.isModified=!0}}finally{b.aa=!0}}}}};yi.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Aa(a);for(b=this.nodes.iterator;b.next();)b.value.Aa(a);for(b=this.links.iterator;b.next();)b.value.Aa(a)}; yi.prototype.Eq=function(){for(var a=this.B.model,b=new F,c=a.nodeDataArray,d=0;df?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+'"'}; t.Fm=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.Fm(a.valueOf()):za(a)?Oq(this,a):ya(a)?Lq(this,a):"function"===typeof a?"null":a.toString()}; function Oq(a,b,c){void 0===c&&(c=!1);var d=b.length;if(0>=d)return"[]";var e=new cb;e.add("[ ");c&&1d)return;Ca(a.Cc,d)}Wq(a,"nodeDataArray",ue,"nodeDataArray",a,b,null,d,null);a.Dq(b)}t.eA=function(a){if(za(a))for(var b=a.length,c=0;cb&&(b=a.length);Ba(a,b,c);Wq(this,"",te,"",a,null,c,null,b)};t.Gv=function(a,b){void 0===b&&(b=-1);a===this.Cc&&B("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Ca(a,b);Wq(this,"",ue,"",a,c,null,b,null)}; t.Zs=function(a){if(null===a)return"";var b=this.Aj;if(""===b)return"";b=nn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;B("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};t.yq=function(a,b){if(null!==a){var c=this.Aj;if(""!==c)if(this.sb(a)){var d=nn(a,c);void 0===d&&(d="");d!==b&&(ek(a,c,b),Wq(this,"nodeCategory",re,c,a,d,b))}else ek(a,c,b)}};t.km=function(){return!1};t.dk=function(){return!1};t.jm=function(){return!1};t.ht=function(){return!1};t.ek=function(){return!1}; function Ci(){return new Z}function Rq(a,b){if("function"===typeof b){if(b.className)return b.className;if(b.name)return b.name}else if("object"===typeof b&&null!==b&&b.constructor)return Rq(a,b.constructor);return typeof b}function Uq(a){return Zq[a]?Zq[a]:void 0!==x.go&&x.go[a]?x.go[a]:null}function nn(a,b){if(!a||!b)return null;try{if("function"===typeof b)var c=b(a);else"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c} function ek(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){}} ma.Object.defineProperties(Z.prototype,{name:{get:function(){return this.Qa},set:function(a){var b=this.Qa;b!==a&&(this.Qa=a,this.g("name",b,a))}},dataFormat:{get:function(){return this.on},set:function(a){var b=this.on;b!==a&&(this.on=a,this.g("dataFormat",b,a))}},isReadOnly:{get:function(){return this.Uf},set:function(a){var b=this.Uf;b!==a&&(this.Uf=a,this.g("isReadOnly",b,a))}},modelData:{ get:function(){return this.l},set:function(a){var b=this.l;b!==a&&(this.l=a,this.g("modelData",b,a),this.Aa(a))}},undoManager:{get:function(){return this.u},set:function(a){var b=this.u;b!==a&&(null!==b&&b.Qx(this),this.u=a,null!==a&&a.ix(this))}},skipsUndoManager:{get:function(){return this.lh},set:function(a){this.lh=a}},nodeKeyProperty:{get:function(){return this.ui},set:function(a){var b=this.ui; b!==a&&(""===a&&B("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c, 0,a.newValue));return}}else if(a.change===ue){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;ya(a)&&"number"===typeof c&&(d=this.Tb(a),b?(this.Vf.add(a),this.Nc[c]!==a&&this.Nc.splice(c,0,a),void 0!==d&&this.mb.add(d,a)):(this.Vf.remove(a),this.Nc[c]===a&&this.Nc.splice(c,1),void 0!==d&&this.mb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.zg(a.object);Array.isArray(d)&&"number"===typeof c&&(b?0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue):(c=d.indexOf(a.newValue), 0<=c&&d.splice(c,1)));return}}Z.prototype.Sj.call(this,a,b)};t.lm=function(a){if(void 0!==a){var b=this.ej;if(null!==b){var c=this.Ib(a);null===c&&(c=this.copyNodeData(b),ek(c,this.nodeKeyProperty,a),this.kf(c))}return a}};t.qz=function(a){return vq(this,a,!0)};t.Ux=function(a,b){Dq(this,a,b,!0)};t.xz=function(a){return vq(this,a,!1)};t.Yx=function(a,b){Dq(this,a,b,!1)}; function vq(a,b,c){if(null!==b&&(a=c?a.Se:a.Te,""!==a&&(a=nn(b,a),void 0!==a))){if(xq(a))return a;B((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}}function Dq(a,b,c,d){null===c&&(c=void 0);if(null!==b){var e=d?a.Se:a.Te;if(""!==e)if(c=a.lm(c),a.dd(b)){var f=nn(b,e);f!==c&&(Bq(a,f,b),ek(b,e,c),null===a.Ib(c)&&Cq(a,c,b),Wq(a,d?"linkFromKey":"linkToKey",re,e,b,f,c),"string"===typeof e&&a.Aa(b,e))}else ek(b,e,c)}}t.rz=function(a){return uq(this,a,!0)}; t.Vx=function(a,b){Eq(this,a,b,!0)};t.yz=function(a){return uq(this,a,!1)};t.Zx=function(a,b){Eq(this,a,b,!1)};function uq(a,b,c){if(null===b)return"";a=c?a.wj:a.xj;if(""===a)return"";b=nn(b,a);return void 0===b?"":b}function Eq(a,b,c,d){if(null!==b){var e=d?a.wj:a.xj;if(""!==e)if(a.dd(b)){var f=nn(b,e);void 0===f&&(f="");f!==c&&(ek(b,e,c),Wq(a,d?"linkFromPortId":"linkToPortId",re,e,b,f,c),"string"===typeof e&&a.Aa(b,e))}else ek(b,e,c)}} t.zg=function(a){if(null===a)return cr;var b=this.Ld;if(""===b)return cr;a=nn(a,b);return void 0===a?cr:a};t.Pv=function(a,b){if(null!==a){var c=this.Ld;if(""!==c)if(this.dd(a)){var d=nn(a,c);void 0===d&&(d=cr);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.dd(a)&&(Bq(this,b,a),Wq(this,"linkLabelKeys",ue,c,a,b,null,e,null)))}else void 0!==d&&B(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};t.Tb=function(a){if(null!==a){var b=this.pi;if(""!==b&&(b=nn(a,b),void 0!==b)){if(xq(b))return b;B("Key value for link data "+a+" is not a number or a string: "+b)}}}; t.zt=function(a,b){if(null!==a){var c=this.pi;if(""!==c)if(this.dd(a)){var d=nn(a,c);d!==b&&null===this.vg(b)&&(ek(a,c,b),void 0!==d&&this.mb.remove(d),this.mb.add(b,a),Wq(this,"linkKey",re,c,a,d,b),"string"===typeof c&&this.Aa(a,c))}else ek(a,c,b)}};t.vg=function(a){null===a&&B("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&xq(a)?this.mb.H(a):null}; t.mq=function(a){if(null!==a){var b=this.pi;if(""!==b){var c=this.Tb(a);if(void 0===c||this.mb.contains(c)){var d=this.ul;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.mb.contains(c))){ek(a,b,c);return}if("string"===typeof c){for(d=2;this.mb.contains(c+d);)d++;ek(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.mb.count-1;this.mb.contains(c);)c--;ek(a,b,c)}}}}};t.dd=function(a){return null===a?!1:this.Vf.contains(a)};t.Ii=function(a){null!==a&&(ob(a),this.dd(a)||zq(this,a,!0))}; function zq(a,b,c){if(""!==a.linkKeyProperty){var d=a.Tb(b);if(void 0!==d&&a.mb.H(d)===b)return;a.mq(b);d=a.Tb(b);if(void 0===d){B("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.mb.add(d,b)}a.Vf.add(b);d=null;c&&(d=a.Nc.length,a.Nc.splice(d,0,b));Wq(a,"linkDataArray",te,"linkDataArray",a,null,b,null,d);dr(a,b)}t.xy=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.Nc.splice(d,1)}Wq(a,"linkDataArray",ue,"linkDataArray",a,b,null,d,null);c=vq(a,b,!0);Bq(a,c,b);c=vq(a,b,!1);Bq(a,c,b);d=a.zg(b);if(Array.isArray(d))for(var e=d.length,f=0;f=a.count)1===a.count&&(a=a.first(),a.centerX=0,a.centerY=0);else{var b=new E;b.addAll(a.iterator);a=new E;var c=new E;var d=this.sort(b);var e,f,g=this.br;var h=this.arrangement;var k=this.nodeDiameterFormula;var l=this.radius;if(!isFinite(l)||0>=l)l=NaN;var m=this.aspectRatio;if(!isFinite(m)||0>=m)m=1;var n=this.startAngle; isFinite(n)||(n=0);var p=this.sweepAngle;if(!isFinite(p)||360p)p=360;b=this.spacing;isFinite(b)||(b=NaN);h===vr&&k===wr?h=gr:h===vr&&k!==wr&&(h=this.arrangement);if((this.direction===qr||this.direction===rr)&&this.sorting!==kr){for(k=0;!(k>=d.length);k+=2){a.add(d.L(k));if(k+1>=d.length)break;c.add(d.L(k+1))}this.direction===qr?(this.arrangement===vr&&a.reverse(),d=new E,d.addAll(a),d.addAll(c)):(this.arrangement===vr&&c.reverse(),d=new E,d.addAll(c),d.addAll(a))}k=d.length;for(var r=f=e=0;r< d.length;r++){var q=n+p*f*(this.direction===jr?1:-1)/k,u=d.L(r).diameter;isNaN(u)&&(u=yr(d.L(r),q));360>p&&(0===r||r===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===vr){isNaN(b)&&(b=6);if(h!==gr&&h!==vr){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g= r/(360<=p?k:k-1)}this.Cw=h;this.Zb=l;this.xn=m;this.Dw=n;this.mr=p;this.jj=b;this.Qd=f;this.br=g;b=d;d=this.Cw;h=this.Zb;l=this.Dw;m=this.mr;n=this.jj;p=this.Qd;k=this.br;if(this.direction!==qr&&this.direction!==rr||d!==vr)if(this.direction===qr||this.direction===rr){g=0;switch(d){case ur:g=180*Br(this,h,p,l,k)/Math.PI;break;case gr:k=b=0;g=a.first();null!==g&&(b=yr(g,Math.PI/2));g=c.first();null!==g&&(k=yr(g,Math.PI/2));g=180*Br(this,h,p,l,n+(b+k)/2)/Math.PI;break;case tr:g=m/b.length}if(this.direction=== qr){switch(d){case ur:Cr(this,a,l,sr);break;case gr:Dr(this,a,l,sr);break;case tr:Er(this,a,m/2,l,sr)}switch(d){case ur:Cr(this,c,l+g,jr);break;case gr:Dr(this,c,l+g,jr);break;case tr:Er(this,c,m/2,l+g,jr)}}else{switch(d){case ur:Cr(this,c,l,sr);break;case gr:Dr(this,c,l,sr);break;case tr:Er(this,c,m/2,l,sr)}switch(d){case ur:Cr(this,a,l+g,jr);break;case gr:Dr(this,a,l+g,jr);break;case tr:Er(this,a,m/2,l+g,jr)}}}else switch(d){case ur:Cr(this,b,l,this.direction);break;case gr:Dr(this,b,l,this.direction); break;case tr:Er(this,b,m,l,this.direction);break;case vr:Fr(this,b,m,l,this.direction)}else Fr(this,b,m,l-m/2,jr)}this.updateParts();this.network=null;this.isValidLayout=!0};function Er(a,b,c,d,e){var f=a.mr,g=a.Zb;a=a.Qd;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===jr?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;Ir(a,k,l,m,n,e,f)||Jr(a,k,l,m,n,e,f);k=f.x;l=f.y}H.free(f);a.Bj++;if(!(23Math.abs(r)?Math.abs(k-f)<(m[0].width+m[m.length-1].width)/2&&(g=0):g=0Math.abs(p)? 0:p;k=Math.abs(f)>Math.abs(n)?0n:0a.Bj?a.Zb-g/(2*Math.PI):5>m.length&&10=n.length-1)break;Ir(a,k,l,n,p,e,m)||Jr(a,k,l,n,p,e,m);k=m.x;l=m.y}H.free(m);a.Bj++;if(!(23a.Bj?a.Zb-f/(2*Math.PI):a.Zb-(0h){f=b-a;if(f<-h)return g.x=f,g.y=l,!1;m=!0}}else if(f=b-a,f<-h){f=b+a;if(f>h)return g.x=f,g.y=l,!1;m=!0}l=Math.sqrt(1-Math.min(1,f*f/(h*h)))*k;0>c!==m&&(l=-l);if(Math.abs(c-l)>(d[e].height+d[e+1].height)/2)return g.x=f,g.y=l,!1;g.x=f;g.y=l;return!0} function Jr(a,b,c,d,e,f,g){var h=a.Zb,k=a.Qd,l=0;a=(d[e].height+d[e+1].height)/2+a.jj;d=!1;if(0<=b!==(f===jr)){if(f=c-a,f<-k){f=c+a;if(f>k){g.x=l;g.y=f;return}d=!0}}else if(f=c+a,f>k){f=c-a;if(f<-k){g.x=l;g.y=f;return}d=!0}l=Math.sqrt(1-Math.min(1,f*f/(k*k)))*h;0>b!==d&&(l=-l);g.x=l;g.y=f}fr.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; fr.prototype.commitNodes=function(){var a=null!==this.group&&null!==this.group.placeholder&&this.group.isSubGraphExpanded,b=a?this.group.location.copy():null,c=this.actualCenter;a?c=new H(0,0):(c.x=this.arrangementOrigin.x+this.Zb,c.y=this.arrangementOrigin.y+this.Qd);for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;e.x+=c.x;e.y+=c.y;e.commit()}a&&(this.group.zb(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.Xd(c.Xd(a)),this.group.move(b),this.rw=b.Xd(a))}; fr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function Ar(a,b,c,d,e){var f=a.my;if(.001>Math.abs(a.xn-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;var g=0;var h=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1));for(var k=0,l=0;l<=f;l++){void 0!==d&&void 0!==e?k=d+l*e/f:k=l*Math.PI/(2*f);var m=Math.sin(k);g+=Math.sqrt(1-a*a*m*m)*h}return void 0!==d&&void 0!==e?(b>c?b:c)*g:4*(b>c?b:c)*g} function zr(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?Ar(a,1,c,d,e):Ar(a,1,c))}function Br(a,b,c,d,e){if(.001>Math.abs(a.xn-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,g=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var h=0;;h++){var k=Math.sin(d+h*a);g+=(b>c?b:c)*Math.sqrt(1-f*f*k*k)*a;if(g>=e)return h*a}} fr.prototype.sort=function(a){switch(this.sorting){case or:break;case pr:a.reverse();break;case mr:a.sort(this.comparer);break;case nr:a.sort(this.comparer);a.reverse();break;case kr:for(var b=[],c=0;ce&&(e=h,f=g)}else for(g=0;ge&&(e=h,f=g);c.add(a.L(f));b[f]=-1;f=a.L(f);for(g=f.sourceEdges;g.next();)e=a.indexOf(g.value.fromVertex),0>e||0<= b[e]&&b[e]++;for(f=f.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(b=0;ba[b].indexOf(d)&&a[b].push(d);for(e=e.sourceEdges;e.next();)d=c.indexOf(e.value.fromVertex),d!==b&&0>a[b].indexOf(d)&&a[b].push(d)}f=[];for(b=0;ba[b[q]].indexOf(b[q===b.length-1?0:q+1])&&r.push(q===b.length-1?0:q+1);if(0===r.length)for(q=0;qb.indexOf(J)||Cb.indexOf(J)||C=u?C+1:C)),w+=C=u&&C++,z>=u&&z++,C>z&&(A=z,z=C,C=A),z-C<(b.length+2)/2===(Cr||r===m||(q=r>m?r-m:m-r,n+=rg-q?1:-1);b.splice(0>n?m:m+1,0,k);e.splice(h,1);h--}else f=!1;if(f)break;else b.push(e[0]),e.splice(0,1)}for(a=0;a=a?this.Ol=a:this.Ol=360,this.C())}},arrangement:{get:function(){return this.Bb},set:function(a){this.Bb===a||a!==vr&&a!==gr&&a!==ur&&a!==tr||(this.Bb=a,this.C())}},direction:{get:function(){return this.J},set:function(a){this.J===a||a!==jr&&a!==sr&&a!==qr&&a!==rr||(this.J=a,this.C())}},sorting:{get:function(){return this.Pc},set:function(a){this.Pc===a||a!==or&&a!==pr&& a!==mr&&!nr&&a!==kr||(this.Pc=a,this.C())}},comparer:{get:function(){return this.Jc},set:function(a){this.Jc!==a&&(this.Jc=a,this.C())}},spacing:{get:function(){return this.af},set:function(a){this.af!==a&&(this.af=a,this.C())}},nodeDiameterFormula:{get:function(){return this.Fo},set:function(a){this.Fo===a||a!==lr&&a!==wr||(this.Fo=a,this.C())}},actualXRadius:{get:function(){return this.Zb}}, actualYRadius:{get:function(){return this.Qd}},actualSpacing:{get:function(){return this.jj}},actualCenter:{get:function(){return this.rw}}}); var gr=new D(fr,"ConstantSpacing",0),ur=new D(fr,"ConstantDistance",1),tr=new D(fr,"ConstantAngle",2),vr=new D(fr,"Packed",3),jr=new D(fr,"Clockwise",4),sr=new D(fr,"Counterclockwise",5),qr=new D(fr,"BidirectionalLeft",6),rr=new D(fr,"BidirectionalRight",7),or=new D(fr,"Forwards",8),pr=new D(fr,"Reverse",9),mr=new D(fr,"Ascending",10),nr=new D(fr,"Descending",11),kr=new D(fr,"Optimized",12),lr=new D(fr,"Pythagorean",13),wr=new D(fr,"Circular",14);fr.className="CircularLayout";fr.ConstantSpacing=gr; fr.ConstantDistance=ur;fr.ConstantAngle=tr;fr.Packed=vr;fr.Clockwise=jr;fr.Counterclockwise=sr;fr.BidirectionalLeft=qr;fr.BidirectionalRight=rr;fr.Forwards=or;fr.Reverse=pr;fr.Ascending=mr;fr.Descending=nr;fr.Optimized=kr;fr.Pythagorean=lr;fr.Circular=wr;function ir(){this.fm=-Infinity;this.Gm=this.vk=null} ir.prototype.compare=function(a,b){if(0this.fm||Math.abs(a)a&&0f?(e=r.x+r.width/2,h=r.y+r.height/2,k[0]=new H(r.x+r.width+d.width,r.y),k[1]=new H(r.x,r.y+r.height+d.height),f=2):(m=Pr(k,f,e,h,r.width,r.height,d),p=k[m],n=new H(p.x+r.width+d.width,p.y),r=new H(p.x,p.y+r.height+ d.height),m+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().bounds,d=this.network.vertexes.iterator;d.next();){if(d.value.bounds.Gc(c)&&(a++,2a.network.vertexes.count)return!1;a.wh=a.network.vertexes.ma();a=a.wh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.vd-a.vd});for(b=a.length-1;0<=b&&1>=a[b].vd;)b--;return 1=g))){for(var l=h=0,m=k.count-g;mr&& (r=1);h=I.sqrt((h+r+l*l*4/(g*g))/r);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new M(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new H(p.x+g,p.y+h)}}a.network=d;return c}function Tr(a,b){for(var c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.Ae){var e=d.Ae.L(d.Nv);d.vd=e.Dt;var f=e.kw,g=e.lw;d.bounds=new M(d.centerX-f,d.centerY-g,e.Et,e.Ct);d.focus=new H(f,g);d.Nv--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function Ur(a,b){var c=b.Vj;if(null!==c&&0!==c.count){var d=b.centerX,e=b.centerY,f=b.width,g=b.height;null!==b.Ae&&0=n.vd?k++:(h=!0,l++,g+=Math.atan2(b.centerY-n.centerY,b.centerX-n.centerX))}if(0!==k)for(0>1)+l)*(0===h%2?1:-1);k.centerX=d+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}} function Pr(a,b,c,d,e,f,g){var h=9E19,k=-1,l=0;a:for(;lm.y&&a[p].x-m.xm.x&&a[p].y-m.yb+f?(c=d+e-g,a=a-b-f,I.sqrt(c*c+a*a)):a+cg+h?a>b+f?(c=d-g-h,a=a-b-f,I.sqrt(c*c+a*a)):a+cb+f?a-(b+f):a+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.centerX,e=d,f=c=c.centerY,g=1;gf-c)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerX-b.centerX}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerY-b.centerY});c=a.Sf;var l=d=h=0;for(f= 0;fc||l-k>c){if(e)break}else if(m-r>c||r-m>c){if(!e)break}else{var q=Wr(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Yr),q=d.random(), h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)*q):kr?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)*h):kn?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new Yr),h=n.random(),n=n.random(),d=(d>k?1:-1)*(1+(f.width>c.width?f.width:c.width))*h,l=(g>m?1:-1)*(1+(f.height>c.height?f.height:c.height))*n):(h=h.stiffness*(n-h.length),d=(k-d)/n*h,l=(m-g)/n*h),c.forceX+=d,c.forceY+=l,f.forceX-=d,f.forceY-=l;d=0;e=a.moveLimit;for(c=0;ce&&(g=e),k<-e?k=-e:k>e&&(k=e),f.centerX+=g,f.centerY+=k,d=Math.max(d,g*g+k*k));return d>a.epsilonDistance*a.epsilonDistance}Mr.prototype.moveFixedVertex=function(){};Mr.prototype.commitLayout=function(){this.Rv();this.commitNodes();this.isRouting&&this.commitLinks()};Mr.prototype.Rv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=$c,b.toSpot=$c)}}; Mr.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=M.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;M.free(c)}c=M.alloc();for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.bounds),c.x+=a,c.y+=b,e.bounds=c;e.commit()}M.free(c)};Mr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()}; Mr.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Qk:a};Mr.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Pk:a};Mr.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Nk:a};Mr.prototype.electricalFieldX=function(){return 0};Mr.prototype.electricalFieldY=function(){return 0};Mr.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Ok:a};Mr.prototype.gravitationalFieldX=function(){return 0}; Mr.prototype.gravitationalFieldY=function(){return 0};Mr.prototype.isFixed=function(a){return a.isFixed}; ma.Object.defineProperties(Mr.prototype,{currentIteration:{get:function(){return this.$n}},arrangementSpacing:{get:function(){return this.yd},set:function(a){this.yd.A(a)||(this.yd.assign(a),this.C())}},arrangesToOrigin:{get:function(){return this.Um},set:function(a){this.Um!==a&&(this.Um=a,this.C())}},setsPortSpots:{get:function(){return this.Ze},set:function(a){this.Ze!==a&&(this.Ze= a,this.C())}},comments:{get:function(){return this.Wc},set:function(a){this.Wc!==a&&(this.Wc=a,this.C())}},maxIterations:{get:function(){return this.vl},set:function(a){this.vl!==a&&0<=a&&(this.vl=a,this.C())}},epsilonDistance:{get:function(){return this.An},set:function(a){this.An!==a&&0u&&0u&&0a[this.pd]&&(this.Sr=a[c]-1,this.pd=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.Qj===l.Qj||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&r>q)&&h++;vn||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>v)&&h++,qn||u===n&&v>m)&&h++);f[g*e+g]=h;for(k=g+ 1;k=c)for(h=d[g].destinationEdgesArrayAccess,z=d[k].destinationEdgesArrayAccess,l=0;l=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=0,p=h.near;null!==p&&p.layer===h.layer&&(m+=p.column-1,n++);if(null!==k)for(p=0;p=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=[],p=h.near;null!==p&&p.layer===h.layer&&(n[m]=p.column-1,m++);h=void 0;if(null!==k)for(p=0;p>1,f[g]=0!==(m&1)?n[l]:n[l-1]+n[l]>>1)}ks(a,b,d);return f}function ss(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();){var h=g.value;var k=h.toVertex;var l=b.layer-k.layer;h=a.linkMinLength(h);l===h&&ss(a,k,c,d,e,f)}if(f)for(g=b.sourceEdges;g.next();)h=g.value,k=h.fromVertex,l=k.layer-b.layer,h=a.linkMinLength(h),l===h&&ss(a,k,c,d,e,f)}} function ts(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)ts(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)ts(a,b.value.fromVertex,c,d,e,f)}} as.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Lk){default:case us:a=this.network;var b=0,c=a.vertexes.count-1,d=[];d.length=c+1;for(var e=a.vertexes.iterator;e.next();)e.value.valid=!0;for(;null!==vs(a);){for(e=ws(a);null!==e;)d[c]=e,c--,e.valid=!1,e=ws(a);for(e=xs(a);null!==e;)d[b]=e,b++,e.valid=!1,e=xs(a);e=null;for(var f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.destinationEdges;l.next();)l.value.toVertex.valid&& k++;l=0;for(var m=h.sourceEdges;m.next();)m.value.fromVertex.valid&&l++;if(null===e||fb.toVertex.index&&(a.ym(b),b.rev=!0);break;case bs:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.am=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Bo=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& ys(this,b);for(d.reset();d.next();)b=d.value,-1===b.am&&ys(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.amd){if(0>d)for(b.reset();b.next();)b.value.layer-=d;d=[];for(b.reset();b.next();)c=b.value,e=d[c.layer],void 0===e?d[c.layer]=[c]:e.push(c);for(c=b=0;cg&&ss(a,h,0,-1,!0,!1)}for(ss(a,b,1,-1,!0,!0);0!==b.component;){f=0;d=Infinity;h=0;k=null;for(g=a.network.vertexes.iterator;g.next();){var l=g.value;if(1===l.component){var m=0,n=!1,p=l.sourceEdgesArrayAccess; e=p.length;for(var r=0;rf)&&!m&&(h=g,f=l)}if(0>d){for(c.reset();c.next();)d=c.value,1===d.component&&(d.layer-=e);b.component=0}else h.component=0}}} function is(a,b,c){return 90===a.J?c&&!b.rev||!c&&b.rev?270:90:180===a.J?c&&!b.rev||!c&&b.rev?0:180:270===a.J?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} as.prototype.initializeIndices=function(){switch(this.fl){default:case Fs:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.fc[c];this.fc[c]++}break;case ds:a=this.network.vertexes.iterator;for(b=this.wa;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Gs(this,c);break;case Hs:for(a=this.network.vertexes.iterator,b=0;b<=this.wa;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Is(this,c)}}; function Gs(a,b){var c=b.layer;b.index=a.fc[c];a.fc[c]++;b=b.destinationEdgesArrayAccess;for(c=!0;c;){c=!1;for(var d=0;df.portFromColOffset&&(c=!0,b[d]=f,b[d+1]=e)}}for(c=0;cf.portToColOffset&&(d=!0,b[c]=f,b[c+1]=e)}for(c=0;c=g;d--)f=Ks(this,d,-1)||f;e=this.countCrossings();e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,1)||f;e=this.countCrossings();e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,1)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= Ks(this,d,-1)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,0)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,0)||f;e>=a?ns(this,b):(a=e,b=ms(this))}break;default:case es:for(c=this.wa,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=Ks(this,d,-1)||f;e=this.countCrossings();e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,1)||f;e=this.countCrossings();e>=a?ns(this,b): (a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,1)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,-1)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ks(this,d,0)||f;e>=a?ns(this,b):(a=e,b=ms(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ks(this,d,0)||f;e>=a?ns(this,b):(a=e,b=ms(this))}}ns(this,b)}; function Js(a,b,c){var d=js(a,b),e=a.fc[b],f=rs(a,b,c),g=qs(a,b,c);for(c=0;cf+1&&(p+=4*(y-f),r+=4*(y-(f+1)))}A=d[f].destinationEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.toVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;y===f+1&&(r+=1)}A=d[f+1].sourceEdges.iterator;for(A.reset();A.next();)if(y=A.value,z=y.fromVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;yf+1&&(p+=4*(y-(f+1)),r+=4*(y-f))}A=d[f+1].destinationEdges.iterator; for(A.reset();A.next();)if(y=A.value,z=y.toVertex,y.valid&&z.layer===b){for(y=0;d[y]!==z;)y++;y===f&&(p+=1)}y=z=0;A=g[d[f].index];var C=h[d[f].index],J=g[d[f+1].index],K=h[d[f+1].index];-1!==A&&(z+=Math.abs(A-q),y+=Math.abs(A-w));-1!==C&&(z+=Math.abs(C-q),y+=Math.abs(C-w));-1!==J&&(z+=Math.abs(J-u),y+=Math.abs(J-v));-1!==K&&(z+=Math.abs(K-u),y+=Math.abs(K-v));if(r>1)+8*d;this.Ea*=8}if(0!==(this.ig&2))for(c=!0;c;){c=!1;for(b=this.pd+1;b<=this.wa;b++)c=Ns(this,b,1)||c;for(b= this.pd-1;0<=b;b--)c=Ns(this,b,-1)||c;c=Ns(this,this.pd,0)||c}if(0!==(this.ig&4)){for(b=this.pd+1;b<=this.wa;b++)Os(this,b,1);for(b=this.pd-1;0<=b;b--)Os(this,b,-1);Os(this,this.pd,0)}a&&(Ps(this,-1),Ps(this,1));if(0!==(this.ig&2))for(c=!0;c;){c=!1;c=Ns(this,this.pd,0)||c;for(b=this.pd+1;b<=this.wa;b++)c=Ns(this,b,0)||c;for(b=this.pd-1;0<=b;b--)c=Ns(this,b,0)||c}};function Ns(a,b,c){for(var d=!1;Qs(a,b,c);)d=!0;return d} function Qs(a,b,c){var d,e=js(a,b),f=a.fc[b],g=qs(a,b,-1);if(0c)for(d=0;dd-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?r=m-1:r=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var q=p=0,u=0;if(0>=c)for(var v=e[d].sourceEdges.iterator;v.next();){var w=v.value;var y=w.fromVertex; if(w.valid&&y.layer!==b){var z=ls(w);var A=w.portFromColOffset;w=w.portToColOffset;y=y.column;p+=(Math.abs(m+w-(y+A))+1)*z;q+=(Math.abs(r+w-(y+A))+1)*z;u+=(Math.abs(n+w-(y+A))+1)*z}}if(0<=c)for(v=e[d].destinationEdges.iterator;v.next();)w=v.value,y=w.toVertex,w.valid&&y.layer!==b&&(z=ls(w),A=w.portFromColOffset,w=w.portToColOffset,y=y.column,p+=(Math.abs(m+A-(y+w))+1)*z,q+=(Math.abs(r+A-(y+w))+1)*z,u+=(Math.abs(n+A-(y+w))+1)*z);w=A=z=0;v=g[e[d].index];y=h[e[d].index];-1!==v&&(z+=Math.abs(v-m),A+= Math.abs(v-r),w+=Math.abs(v-n));-1!==y&&(z+=Math.abs(y-m),A+=Math.abs(y-r),w+=Math.abs(y-n));if(q=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}ks(a,b,d);a.normalize()} function Rs(a,b){for(var c=!0,d=a.network.vertexes.iterator;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),g=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+g>=b){c=!1;break}}a=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(--c.column,a=!0);return a} function Ss(a,b){var c=b+1;var d,e=[],f=[];for(d=0;d<=a.wa;d++)e[d]=!1,f[d]=!1;for(var g=a.network.vertexes.iterator;g.next();){d=g.value;var h=d.column-a.nodeMinColumnSpace(d,!0),k=d.column+a.nodeMinColumnSpace(d,!1);h<=b&&k>=b&&(e[d.layer]=!0);h<=c&&k>=c&&(f[d.layer]=!0)}h=!0;c=!1;for(d=0;d<=a.wa;d++)h=h&&!(e[d]&&f[d]);if(h)for(g.reset();g.next();)a=g.value,a.column>b&&(--a.column,c=!0);return c} function Ps(a,b){for(var c=0;c<=a.Ea;c++)for(;Rs(a,c););a.normalize();for(c=0;cf?ns(a,e):gb)for(c=a.Ea;0<=c;c--)for(e=ms(a),f=ps(a),d=f+1;ff?ns(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Od);a.Od++;for(d.reset();d.next();)b=d.value,-1===b.component&&(ts(a,b,a.Od,-1,!0,!0),a.Od++);var f;b=[];for(f=0;fc)for(g=a.Ea;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} as.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=hs(this,!0),b=hs(this,!1),c=this.network.edges.iterator;c.next();){var d=c.value.link;null!==d&&(d.fromSpot=a,d.toSpot=b)}this.commitNodes();this.Vu();this.isRouting&&this.commitLinks()};function hs(a,b){return 270===a.J?b?ed:hd:90===a.J?b?hd:ed:180===a.J?b?fd:gd:b?gd:fd} as.prototype.commitNodes=function(){this.Kd=[];this.od=[];this.nd=[];this.Ha=[];for(var a=0;a<=this.wa;a++)this.Kd[a]=0,this.od[a]=0,this.nd[a]=0,this.Ha[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.Kd[c]=Math.max(this.Kd[c],this.nodeMinLayerSpace(b,!0));this.od[c]=Math.max(this.od[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.ie;for(var d=0;d<=this.wa;d++){var e=c;0>=this.Kd[d]+this.od[d]&&(e=0);0=n.bounds.bottom? (n=n.bounds.y+n.bounds.height,b.m(q++,z,n+C),b.m(q++,z,n),b.m(q++,z,n-y)):(b.m(q++,z,A+C),b.m(q++,z,A),b.m(q++,z,A-y)):270===this.J?A<=n.bounds.y?(n=n.bounds.y,b.m(q++,z,n-y),b.m(q++,z,n),b.m(q++,z,n+C)):(b.m(q++,z,A-y),b.m(q++,z,A),b.m(q++,z,A+C)):0===this.J&&(z>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.m(q++,n+C,A),b.m(q++,n,A),b.m(q++,n-y,A)):(b.m(q++,z+C,A),b.m(q++,z,A),b.m(q++,z-y,A)));else{b.m(q++,v,w);var J=0;if(180===this.J||0===this.J){if(180===this.J?z>=n.bounds.right:z<=n.bounds.x)J= (0===this.J?-y:C)/2;b.m(q++,v+J,A)}else{if(270===this.J?A>=n.bounds.bottom:A<=n.bounds.y)J=(90===this.J?-y:C)/2;b.m(q++,z,w+J)}b.m(q++,z,A)}}else y=Math.max(10,this.Kd[u.layer]),C=Math.max(10,this.od[u.layer]),180===this.J?(r&&b.m(q++,z-y,A),b.m(q++,z,A),r&&b.m(q++,z+C,A)):90===this.J?(r&&b.m(q++,z,A+C),b.m(q++,z,A),r&&b.m(q++,z,A-y)):270===this.J?(r&&b.m(q++,z,A-y),b.m(q++,z,A),r&&b.m(q++,z,A+C)):(r&&b.m(q++,z+C,A),b.m(q++,z,A),r&&b.m(q++,z-y,A))}n=u}if(null===h||l!==wc||p)if(v=b.i(q-1).x,w=b.i(q- 1).y,z=b.i(q).x,A=b.i(q).y,p)n=this.od[m.layer],180===this.J||0===this.J?(p=w,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.J?z>=m.bounds.x:z<=m.bounds.right)&&(n=m.centerX+(180===this.J?-n:n),p=m.bounds.x&&p<=m.bounds.right&&(270===this.J?A>=m.bounds.y:A<=m.bounds.bottom)&&(n=m.centerY+(270===this.J?-n:n),p=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.K(q-2,n,w),b.K(q-1,n+C,w)):90===this.J&&A<=m.bounds.bottom?(n=m.bounds.y,b.K(q-2,v,n),b.K(q-1,v,n-y)):270===this.J&&A>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.K(q-2,v,n),b.K(q-1,v,n+C)):0===this.J&&z<=m.bounds.right&&(n=m.bounds.x,b.K(q-2,n,w),b.K(q-1,n-y,w));else{y=Math.max(10,this.Kd[m.layer]);C=Math.max(10, this.od[m.layer]);p=0;if(180===this.J||0===this.J){if(180===this.J?z<=m.bounds.x:z>=m.bounds.right)p=(0===this.J?C:-y)/2;b.m(q++,z+p,w)}else{if(270===this.J?A<=m.bounds.y:A>=m.bounds.bottom)p=(90===this.J?C:-y)/2;b.m(q++,v,A+p)}b.m(q++,z,A)}}else{for(;null!==m&&m!==n;){y=u=null;for(m=m.destinationEdges.iterator;m.next()&&(v=m.value,v.link!==c.link||(u=v.toVertex,y=v.fromVertex,null!==y.node&&(y=null),null!==u.node)););u!==n&&(v=b.i(q-1).x,w=b.i(q-1).y,z=u.centerX,A=u.centerY,p?180===this.J||0===this.J? (null!==y?y.centerY:w)!==A&&(y=this.Ha[u.layer]+this.Ff.x,q===b.firstPickIndex+1&&(y=0===this.J?Math.max(y,v):Math.min(y,v)),b.m(q++,y,w),b.m(q++,y,A)):(null!==y?y.centerX:v)!==z&&(y=this.Ha[u.layer]+this.Ff.y,q===b.firstPickIndex+1&&(y=90===this.J?Math.max(y,w):Math.min(y,w)),b.m(q++,v,y),b.m(q++,z,y)):(y=Math.max(10,this.Kd[u.layer]),C=Math.max(10,this.od[u.layer]),180===this.J?(b.m(q++,z+C,A),r&&b.m(q++,z,A),b.m(q++,z-y,A)):90===this.J?(b.m(q++,z,A-y),r&&b.m(q++,z,A),b.m(q++,z,A+C)):270===this.J? (b.m(q++,z,A+C),r&&b.m(q++,z,A),b.m(q++,z,A-y)):(b.m(q++,z-y,A),r&&b.m(q++,z,A),b.m(q++,z+C,A))));m=u}p&&(v=b.i(q-1).x,w=b.i(q-1).y,z=b.i(q).x,A=b.i(q).y,180===this.J||0===this.J?w!==A&&(y=0===this.J?Math.min(Math.max((z+v)/2,this.Ha[n.layer]+this.Ff.x),z):Math.max(Math.min((z+v)/2,this.Ha[n.layer]+this.Ff.x),z),b.m(q++,y,w),b.m(q++,y,A)):v!==z&&(y=90===this.J?Math.min(Math.max((A+w)/2,this.Ha[n.layer]+this.Ff.y),A):Math.max(Math.min((A+w)/2,this.Ha[n.layer]+this.Ff.y),A),b.m(q++,v,y),b.m(q++,z,y)))}null!== d&&r&&(null!==g&&(l===wc&&(l=b.i(0),d=b.i(2),l.A(d)||b.K(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,wc,!0,!1,f,h),l.v()||l.set(e.actualBounds.center),b.K(0,l.x,l.y)),null!==h&&(k===wc&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.A(l)||b.K(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,wc,!1,!1,e,g),e.v()||e.set(f.actualBounds.center),b.K(b.pointsCount-1,e.x,e.y)));b.mf();c.commit()}}}this.avoidOrthogonalOverlaps()}; as.prototype.avoidOrthogonalOverlaps=function(){for(var a=new E,b=this.network.edges.iterator;b.next();){var c=b.value.link;null!==c&&c.isOrthogonal&&!a.contains(c)&&a.add(c)}if(0f.y&&(m=l.y>f.y?0:g.xf.x&&(m=l.x>f.x?0:g.yb.layer?1:a.Rcb.Rc?1:a.scb.sc?1:0:0};t.Sx=function(a,b){return a instanceof Us&&b instanceof Us&&a!==b?a.firstb.first||a.lb.l||a.Rcb.Rc?1:a.scb.sc?1:0:0}; t.wt=function(a,b){return a instanceof Us&&b instanceof Us&&a!==b?a.Vbb.Vb||a.lb.l||a.Rcb.Rc?1:a.scb.sc?1:0:0};t.w=function(a,b){a-=b;return-1a}; t.$i=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&B("not in range 0 <= from < length: "+c),2===f)d=a[c],e=a[c+1],0=e)a.sort(b);else for(c=a.slice(0,d),c.sort(b),b=0;b=e)for(d=a.slice(c),d.sort(b),b=c;b=a.me.length){var d=[];for(var e=0;ea&&(this.ig=a,this.C())}},setsPortSpots:{get:function(){return this.Ze},set:function(a){this.Ze!==a&&(this.Ze=a,this.C())}}, linkSpacing:{get:function(){return this.ho},set:function(a){this.ho!==a&&0<=a&&(this.ho=a,this.C())}},maxLayer:{get:function(){return this.wa}},maxIndex:{get:function(){return this.Sr}},maxColumn:{get:function(){return this.Ea}},minIndexLayer:{get:function(){return this.ro}},maxIndexLayer:{get:function(){return this.pd}}}); var bs=new D(as,"CycleDepthFirst",0),us=new D(as,"CycleGreedy",1),gs=new D(as,"CycleFromLayers",2),cs=new D(as,"LayerOptimalLinkLength",0),zs=new D(as,"LayerLongestPathSink",1),Bs=new D(as,"LayerLongestPathSource",2),ds=new D(as,"InitDepthFirstOut",0),Hs=new D(as,"InitDepthFirstIn",1),Fs=new D(as,"InitNaive",2),Ls=new D(as,"AggressiveNone",0),es=new D(as,"AggressiveLess",1),Ms=new D(as,"AggressiveMore",2);as.className="LayeredDigraphLayout";as.CycleDepthFirst=bs;as.CycleGreedy=us; as.CycleFromLayers=gs;as.LayerOptimalLinkLength=cs;as.LayerLongestPathSink=zs;as.LayerLongestPathSource=Bs;as.InitDepthFirstOut=ds;as.InitDepthFirstIn=Hs;as.InitNaive=Fs;as.AggressiveNone=Ls;as.AggressiveLess=es;as.AggressiveMore=Ms;as.PackNone=0;as.PackExpand=1;as.PackStraighten=2;as.PackMedian=4;as.PackAll=7;function Us(){this.index=this.sc=this.Rc=this.Vb=this.first=this.layer=0;this.link=null;this.l=0}Us.className="SegInfo";function fs(a){Pp.call(this,a)}la(fs,Pp);fs.prototype.createVertex=function(){return new Vs(this)}; fs.prototype.createEdge=function(){return new Ws(this)};fs.className="LayeredDigraphNetwork";function Vs(a){Sp.call(this,a);this.Oa=this.Mg=this.ni=-1;this.I=NaN;this.Y=null;this.valid=!1;this.finish=this.am=NaN;this.Qj=0;this.yv=this.zv=null}la(Vs,Sp); ma.Object.defineProperties(Vs.prototype,{layer:{get:function(){return this.ni},set:function(a){this.ni!==a&&(this.ni=a)}},column:{get:function(){return this.Mg},set:function(a){this.Mg!==a&&(this.Mg=a)}},index:{get:function(){return this.Oa},set:function(a){this.Oa!==a&&(this.Oa=a)}},component:{get:function(){return this.I},set:function(a){this.I!==a&&(this.I=a)}},near:{ get:function(){return this.Y},set:function(a){this.Y!==a&&(this.Y=a)}}});Vs.className="LayeredDigraphVertex";function Ws(a){Tp.call(this,a);this.l=this.Ja=this.Za=!1;this.Ia=this.I=NaN;this.Y=this.u=0}la(Ws,Tp); ma.Object.defineProperties(Ws.prototype,{valid:{get:function(){return this.Za},set:function(a){this.Za!==a&&(this.Za=a)}},rev:{get:function(){return this.Ja},set:function(a){this.Ja!==a&&(this.Ja=a)}},forest:{get:function(){return this.l},set:function(a){this.l!==a&&(this.l=a)}},portFromPos:{get:function(){return this.I},set:function(a){this.I!==a&&(this.I=a)}},portToPos:{ get:function(){return this.Ia},set:function(a){this.Ia!==a&&(this.Ia=a)}},portFromColOffset:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToColOffset:{get:function(){return this.Y},set:function(a){this.Y!==a&&(this.Y=a)}}});Ws.className="LayeredDigraphEdge"; function Xs(){Di.call(this);this.Hb=new F;this.Qo=Ys;this.Yc=Zs;this.Mp=$s;this.Qr=at;this.sw=[];this.Wc=!0;this.Bb=bt;this.yd=(new Kb(10,10)).freeze();var a=new ct(this);this.T=new dt(a);this.U=new dt(a);this.Fu=[]}la(Xs,Di);Xs.prototype.cloneProtected=function(a){Di.prototype.cloneProtected.call(this,a);a.Qo=this.Qo;a.Mp=this.Mp;a.Qr=this.Qr;a.Wc=this.Wc;a.Bb=this.Bb;a.yd.assign(this.yd);a.T.copyInheritedPropertiesFrom(this.T);a.U.copyInheritedPropertiesFrom(this.U)}; Xs.prototype.cb=function(a){a.classType===Xs?0===a.name.indexOf("Alignment")?this.alignment=a:0===a.name.indexOf("Arrangement")?this.arrangement=a:0===a.name.indexOf("Compaction")?this.compaction=a:0===a.name.indexOf("Path")?this.path=a:0===a.name.indexOf("Sorting")?this.sorting=a:0===a.name.indexOf("Style")?this.treeStyle=a:B("Unknown enum value: "+a):Di.prototype.cb.call(this,a)};Xs.prototype.createNetwork=function(){return new ct(this)}; Xs.prototype.makeNetwork=function(a){function b(a){if(a instanceof U)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof Q){var b=a.fromNode;if(null===b||b.isLinkLabel||"Comment"===b.category)return!1;a=a.toNode;return null===a||a.isLinkLabel||"Comment"===a.category?!1:!0}return!1}var c=this.createNetwork();a instanceof P?(c.tg(a.nodes,!0,b),c.tg(a.links,!0,b)):a instanceof S?c.tg(a.memberParts,!1,b):c.tg(a.iterator,!1,b);return c}; Xs.prototype.doLayout=function(a){null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==et&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof P&&(b=a);this.path===Ys&&null!==b?this.Yc=b.isTreePathToChildren?Zs:ft:this.Yc=this.path===Ys?Zs:this.path;if(0b.level)return!1;a.removeChild(c.parent,c)}return!0}Xs.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;ee?Rt(a,g,N,w,y):St(a,g,N,w,y);N=y.x;w=y.width;y=y.height;break;case At:for(A=0;An&&(LKa&&(Xt(a,-Ka,0,pa,Ga-1),Yt(A,-Ka,0),Yt(C,-Ka,0),Ka=0)}Pa.S.h(Ka,V);w=Math.max(w,J);y=Math.max(y,z+(0===R?0:q)+hb.height);L=J}else{0n&&(VKa&&(Xt(a,0,-Ka,pa,Ga-1),Yt(A,0,-Ka),Yt(C,0,-Ka),Ka=0);Pa.S.h(L,Ka);y=Math.max(y,K);w=Math.max(w,z+(0===R?0:q)+hb.width);V=K}ea++}0l&&(l=0),135u&&(u=0), k===Bt&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>w&&(w=cu(k,d-w,0),g=w.x,h=w.y,w=d,l=0):w=au(a,w,l),0>l&&(g-=l,l=0),135y&&(y=cu(k,0,v-y),g=y.x,h=y.y,y=v,u=0):y=bu(a,y,u),0>u&&(h-=u,u=0),g+=d+c);if(0e[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].ye[0].x?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(l+d,0),R[1].h(R[0].x,v),R[2].ye[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].xe[0].y?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(0,u+v),R[1].h(d,R[0].y),R[2].xd?Rt(b,e,ea, z,A):St(b,e,ea,z,A);ea=A.x;z=A.width;A=A.height;break;case At:for(a=0;ap&&(Jp&&(Kn&&(n=0),135w&&(w=0));b.da.h(n,w);b.sa.h(z,A)}} function Rt(a,b,c,d,e){var f=b.length;if(0===f)return new M(c,0,d,e);if(1===f)return a=b[0],d=a.sa.width,e=a.sa.height,new M(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90===Ht(a),l=0,m=0,n=0,p=0;pk&&(d-=k),e=Math.max(e,Math.max(p,n)+h+f.height),0>b.S.x&& (c=fu(a,b.S.x,!1,c,g))):(b.S.h(d+h,c+g/2-b.focus.y-b.da.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.da.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.S.y&&(c=fu(a,b.S.y,!0,c,g))));return new M(c,0,d,e)} function St(a,b,c,d,e){var f=b.length;if(0===f)return new M(c,0,d,e);if(1===f)return b=b[0],d=b.sa.width,e=b.sa.height,new M(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270===Ht(a),l=0,m=0,n=0,p=0;pm&&(d-=m),e=Math.max(e,Math.abs(Math.min(p,n))+q+l.height), 0>h.S.x&&(c=fu(a,h.S.x,!1,c,g))):(h.S.h(-d-l.width-q,c+g/2-h.focus.y-h.da.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.da.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.S.y&&(c=fu(a,h.S.y,!0,c,g))));for(a=0;ab&&(b=c+a.width),0>c&&(b-=c),b;case Qt:return a.width>b?a.width:b;case It:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case zt:case pt:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case At:return a.width-a.focus.x+a.nodeSpacing/2+b;case Bt:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function bu(a,b,c){switch(a.alignment){case $t:case Zt:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Qt:return a.height>b?a.height:b;case It:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case zt:case pt:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case At:return a.height-a.focus.y+a.nodeSpacing/2+b;case Bt:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function cu(a,b,c){switch(a){case Zt:b/=2;c/=2;break;case $t:b/=2;c/=2;break;case Qt:c=b=0;break;case It:break;default:B("Unhandled alignment value "+a.toString())}return new H(b,c)}function Ut(a,b,c,d,e,f){b=cu(b,c,d);Xt(a,b.x,b.y,e,f)}function Xt(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].S;f.x+=b;f.y+=c}} function Vt(a,b,c,d){var e=b.parent;switch(a.Yc){case Zs:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case ft:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:B("Unhandled path value "+a.Yc.toString())}}function Yt(a,b,c){for(var d=0;dn.length||null===r||2>r.length))for(e=c=0;cl&&f.yf.y&&lb.length||null===c||2>c.length)d=null;else{m=Tt(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=Tt(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Tt(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Tt(a,e);for(c=0;cn.length||null===r||2>r.length))for(e=c=0;ck&&f.xf.x&&kb.length||null===c||2>c.length)d=null;else{m=Tt(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=Tt(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Tt(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Tt(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}function Jt(a){var b=Ht(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.T.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(){return this.T.nodeSpacing},set:function(a){this.T.nodeSpacing!==a&&(this.T.nodeSpacing=a,this.C())}},layerSpacing:{get:function(){return this.T.layerSpacing},set:function(a){this.T.layerSpacing!== a&&(this.T.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(){return this.T.layerSpacingParentOverlap},set:function(a){this.T.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.T.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(){return this.T.compaction},set:function(a){this.T.compaction===a||a!==Et&&a!==Gt||(this.T.compaction=a,this.C())}},breadthLimit:{get:function(){return this.T.breadthLimit}, set:function(a){this.T.breadthLimit!==a&&0<=a&&(this.T.breadthLimit=a,this.C())}},rowSpacing:{get:function(){return this.T.rowSpacing},set:function(a){this.T.rowSpacing!==a&&(this.T.rowSpacing=a,this.C())}},rowIndent:{get:function(){return this.T.rowIndent},set:function(a){this.T.rowIndent!==a&&0<=a&&(this.T.rowIndent=a,this.C())}},commentSpacing:{get:function(){return this.T.commentSpacing},set:function(a){this.T.commentSpacing!== a&&(this.T.commentSpacing=a,this.C())}},commentMargin:{get:function(){return this.T.commentMargin},set:function(a){this.T.commentMargin!==a&&(this.T.commentMargin=a,this.C())}},setsPortSpot:{get:function(){return this.T.setsPortSpot},set:function(a){this.T.setsPortSpot!==a&&(this.T.setsPortSpot=a,this.C())}},portSpot:{get:function(){return this.T.portSpot},set:function(a){this.T.portSpot.A(a)||(this.T.portSpot= a,this.C())}},setsChildPortSpot:{get:function(){return this.T.setsChildPortSpot},set:function(a){this.T.setsChildPortSpot!==a&&(this.T.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(){return this.T.childPortSpot},set:function(a){this.T.childPortSpot.A(a)||(this.T.childPortSpot=a,this.C())}},alternateSorting:{get:function(){return this.U.sorting},set:function(a){this.U.sorting===a||a!==ut&&a!==vt&& a!==wt&&!xt||(this.U.sorting=a,this.C())}},alternateComparer:{get:function(){return this.U.comparer},set:function(a){this.U.comparer!==a&&(this.U.comparer=a,this.C())}},alternateAngle:{get:function(){return this.U.angle},set:function(a){this.U.angle===a||0!==a&&90!==a&&180!==a&&270!==a||(this.U.angle=a,this.C())}},alternateAlignment:{get:function(){return this.U.alignment},set:function(a){this.U.alignment!== a&&(this.U.alignment=a,this.C())}},alternateNodeIndent:{get:function(){return this.U.nodeIndent},set:function(a){this.U.nodeIndent!==a&&0<=a&&(this.U.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.U.nodeIndentPastParent},set:function(a){this.U.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.U.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(){return this.U.nodeSpacing}, set:function(a){this.U.nodeSpacing!==a&&(this.U.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(){return this.U.layerSpacing},set:function(a){this.U.layerSpacing!==a&&(this.U.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.U.layerSpacingParentOverlap},set:function(a){this.U.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.U.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{ get:function(){return this.U.compaction},set:function(a){this.U.compaction===a||a!==Et&&a!==Gt||(this.U.compaction=a,this.C())}},alternateBreadthLimit:{get:function(){return this.U.breadthLimit},set:function(a){this.U.breadthLimit!==a&&0<=a&&(this.U.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(){return this.U.rowSpacing},set:function(a){this.U.rowSpacing!==a&&(this.U.rowSpacing=a,this.C())}},alternateRowIndent:{ get:function(){return this.U.rowIndent},set:function(a){this.U.rowIndent!==a&&0<=a&&(this.U.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(){return this.U.commentSpacing},set:function(a){this.U.commentSpacing!==a&&(this.U.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(){return this.U.commentMargin},set:function(a){this.U.commentMargin!==a&&(this.U.commentMargin=a,this.C())}},alternateSetsPortSpot:{ get:function(){return this.U.setsPortSpot},set:function(a){this.U.setsPortSpot!==a&&(this.U.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(){return this.U.portSpot},set:function(a){this.U.portSpot.A(a)||(this.U.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.U.setsChildPortSpot},set:function(a){this.U.setsChildPortSpot!==a&&(this.U.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{ get:function(){return this.U.childPortSpot},set:function(a){this.U.childPortSpot.A(a)||(this.U.childPortSpot=a,this.C())}}}); var Ys=new D(Xs,"PathDefault",-1),Zs=new D(Xs,"PathDestination",0),ft=new D(Xs,"PathSource",1),ut=new D(Xs,"SortingForwards",10),vt=new D(Xs,"SortingReverse",11),wt=new D(Xs,"SortingAscending",12),xt=new D(Xs,"SortingDescending",13),Zt=new D(Xs,"AlignmentCenterSubtrees",20),$t=new D(Xs,"AlignmentCenterChildren",21),Qt=new D(Xs,"AlignmentStart",22),It=new D(Xs,"AlignmentEnd",23),zt=new D(Xs,"AlignmentBus",24),pt=new D(Xs,"AlignmentBusBranching",25),At=new D(Xs,"AlignmentTopLeftBus",26),Bt=new D(Xs, "AlignmentBottomRightBus",27),Et=new D(Xs,"CompactionNone",30),Gt=new D(Xs,"CompactionBlock",31),$s=new D(Xs,"StyleLayered",40),tt=new D(Xs,"StyleLastParents",41),st=new D(Xs,"StyleAlternating",42),rt=new D(Xs,"StyleRootOnly",43),bt=new D(Xs,"ArrangementVertical",50),hu=new D(Xs,"ArrangementHorizontal",51),et=new D(Xs,"ArrangementFixedRoots",52),at=new D(Xs,"LayerIndividual",60),nt=new D(Xs,"LayerSiblings",61),mt=new D(Xs,"LayerUniform",62);Xs.className="TreeLayout";Xs.PathDefault=Ys; Xs.PathDestination=Zs;Xs.PathSource=ft;Xs.SortingForwards=ut;Xs.SortingReverse=vt;Xs.SortingAscending=wt;Xs.SortingDescending=xt;Xs.AlignmentCenterSubtrees=Zt;Xs.AlignmentCenterChildren=$t;Xs.AlignmentStart=Qt;Xs.AlignmentEnd=It;Xs.AlignmentBus=zt;Xs.AlignmentBusBranching=pt;Xs.AlignmentTopLeftBus=At;Xs.AlignmentBottomRightBus=Bt;Xs.CompactionNone=Et;Xs.CompactionBlock=Gt;Xs.StyleLayered=$s;Xs.StyleLastParents=tt;Xs.StyleAlternating=st;Xs.StyleRootOnly=rt;Xs.ArrangementVertical=bt; Xs.ArrangementHorizontal=hu;Xs.ArrangementFixedRoots=et;Xs.LayerIndividual=at;Xs.LayerSiblings=nt;Xs.LayerUniform=mt;function ct(a){Pp.call(this,a)}la(ct,Pp);ct.prototype.createVertex=function(){return new dt(this)};ct.prototype.createEdge=function(){return new ju(this)};ct.className="TreeNetwork"; function dt(a){Sp.call(this,a);this.Ia=!1;this.Ic=null;this.I=[];this.kd=this.Za=this.Y=this.Ja=0;this.Wc=null;this.S=new H(0,0);this.sa=new Kb(0,0);this.da=new H(0,0);this.Am=this.zm=this.gA=!1;this.xq=this.kq=null;this.Pc=ut;this.Jc=Zp;this.cc=0;this.wb=$t;this.bs=this.$r=0;this.ds=20;this.ie=50;this.Pr=0;this.$q=Gt;this.Tq=0;this.os=25;this.Zq=this.ns=10;this.Yq=20;this.xs=!0;this.ks=$c;this.ws=!0;this.Wq=$c}la(dt,Sp); dt.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.Pc=a.sorting,this.Jc=a.comparer,this.cc=a.angle,this.wb=a.alignment,this.$r=a.nodeIndent,this.bs=a.nodeIndentPastParent,this.ds=a.nodeSpacing,this.ie=a.layerSpacing,this.Pr=a.layerSpacingParentOverlap,this.$q=a.compaction,this.Tq=a.breadthLimit,this.os=a.rowSpacing,this.ns=a.rowIndent,this.Zq=a.commentSpacing,this.Yq=a.commentMargin,this.xs=a.setsPortSpot,this.ks=a.portSpot,this.ws=a.setsChildPortSpot,this.Wq=a.childPortSpot)}; ma.Object.defineProperties(dt.prototype,{initialized:{get:function(){return this.Ia},set:function(a){this.Ia!==a&&(this.Ia=a)}},parent:{get:function(){return this.Ic},set:function(a){this.Ic!==a&&(this.Ic=a)}},children:{get:function(){return this.I},set:function(a){if(this.I!==a){if(null!==a)for(var b=a.length,c=0;cp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Pt(c))))):c.alignment===Qt?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Pt(c))))):c.alignment===Qt?(e=d.left+b.x,0===b.x&&m.xp.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Pt(c))))):c.alignment===Qt?(e=d.top+b.y,0===b.y&&m.yp.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Pt(c))))):c.alignment===Qt?(e=d.left+b.x,0===b.x&&m.x
posted @ 2020-04-14 19:45  alen_zhan  阅读(391)  评论(0编辑  收藏  举报
返回顶部