/* * GoJS v2.3.3 JavaScript Library for HTML Diagrams, https://gojs.net * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com. * Copyright (C) 1998-2023 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.3.3/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (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):C("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Da(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):C("Cannot remove an object from an HTMLCollection or NodeList at "+b)} function Ea(){var a=Fa.pop();return void 0===a?[]:a}function Ga(a){a.length=0;Fa.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(za(a)&&a.constructor)return Ha(a.constructor);return typeof a} function Ia(a){var b=a;za(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.sA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ka(a,b,c){Object.defineProperty(La.prototype,a,{get:b,set:c})} function Ma(a){for(var b=[],c=0;256>c;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.s;var b=a.length,c=++this.Ya,d=this.lf;if(null!==d)for(;cthis.key)return!1;var b=--this.Ya;if(0<=b)return this.key=b,this.value=a.s[b],!0;this.$d();return!1};ab.prototype.ud=function(){return this.next()}; ab.prototype.first=function(){var a=this.Bb;this.qa=a.Ja;var b=a.s;this.Ya=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};ab.prototype.any=function(a){var b=this.Bb;b.Dg=null;b=b.s;var c=b.length;this.Ya=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};ab.prototype.all=function(a){var b=this.Bb;b.Dg=null;b=b.s;var c=b.length;this.Ya=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; ab.prototype.each=function(a){var b=this.Bb;b.Dg=null;b=b.s;var c=b.length;this.Ya=c;for(--c;0<=c;c--)a(b[c]);return this};ab.prototype.map=function(a){var b=this.Bb;b.Dg=null;var c=[];b=b.s;var d=b.length;this.Ya=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new F;a.s=c;a.xb();return a.iterator};ab.prototype.filter=function(a){var b=this.Bb;b.Dg=null;var c=[];b=b.s;var d=b.length;this.Ya=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new F;a.s=c;a.xb();return a.iterator}; ab.prototype.$d=function(){this.key=-1;this.value=null;this.qa=-1;this.Bb.Dg=this};ab.prototype.toString=function(){return"ListIteratorBackwards("+this.Ya+"/"+this.Bb.count+")"};ma.Object.defineProperties(ab.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}});ab.prototype.first=ab.prototype.first;ab.prototype.hasNext=ab.prototype.ud;ab.prototype.next=ab.prototype.next;ab.prototype.reset=ab.prototype.reset; ab.className="ListIteratorBackwards";function F(a){Qa(this);this._isFrozen=!1;this.s=[];this.Ja=0;this.Dg=this.Sa=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=F.prototype;t.xb=function(){var a=this.Ja;a++;999999999a||a>=b.length)&&xa(a,"0 <= i < length",F,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.Xc=function(a,b){var c=this.s;(0>a||a>=c.length)&&xa(a,"0 <= i < length",F,"setElt:i");this._isFrozen&&va(this,a);c[a]=b};t.set=function(a,b){this.Xc(a,b)};t.first=function(){var a=this.s;return 0===a.length?null:a[0]};t.fc=function(){var a=this.s,b=a.length;return 0a&&xa(a,">= 0",F,"insertAt:i");this._isFrozen&&va(this,a);var c=this.s;a>=c.length?c.push(b):c.splice(a,0,b);this.xb()};t.remove=function(a){if(null===a)return!1;this._isFrozen&&va(this,a);var b=this.s;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.xb();return!0};t.delete=function(a){return this.remove(a)}; t.nb=function(a){var b=this.s;(0>a||a>=b.length)&&xa(a,"0 <= i < length",F,"removeAt:i");this._isFrozen&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.xb()};t.removeRange=function(a,b){var c=this.s,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._isFrozen&&va(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&xa(b,"0 <= from < length",F,"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.s.length)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new $a(this)}},iteratorBackwards:{ get:function(){if(0>=this.s.length)return Ya;var a=this.Dg;return null!==a?(a.reset(),a):new ab(this)}}});F.prototype.reverse=F.prototype.reverse;F.prototype.sortRange=F.prototype.wi;F.prototype.sort=F.prototype.sort;F.prototype.toSet=F.prototype.Bv;F.prototype.toArray=F.prototype.Fa;F.prototype.removeRange=F.prototype.removeRange;F.prototype.removeAt=F.prototype.nb;F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.insertAt=F.prototype.Eb; F.prototype.pop=F.prototype.pop;F.prototype.last=F.prototype.fc;F.prototype.first=F.prototype.first;F.prototype.set=F.prototype.set;F.prototype.setElt=F.prototype.Xc;F.prototype.get=F.prototype.get;F.prototype.elt=F.prototype.L;F.prototype.indexOf=F.prototype.indexOf;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.clear=F.prototype.clear;F.prototype.addAll=F.prototype.addAll;F.prototype.push=F.prototype.push;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ka; F.prototype.freeze=F.prototype.freeze;F.className="List";function cb(a){this.ag=a;a.Sa=null;this.qa=a.Ja;this.sa=null}cb.prototype.reset=function(){var a=this.ag;a.Sa=null;this.qa=a.Ja;this.sa=null};cb.prototype.next=function(){var a=this.ag;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.ua;if(null!==b)return this.sa=b,this.value=b.value,this.key=b.key,!0;this.$d();return!1};cb.prototype.ud=function(){return this.next()}; cb.prototype.first=function(){var a=this.ag;this.qa=a.Ja;a=a.ea;if(null!==a){this.sa=a;var b=a.value;this.key=a.key;return this.value=b}return null};cb.prototype.any=function(a){var b=this.ag;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(a(b.value))return!0;b=b.ua}return!1};cb.prototype.all=function(a){var b=this.ag;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(!a(b.value))return!1;b=b.ua}return!0};cb.prototype.each=function(a){var b=this.ag;this.sa=b.Sa=null;for(b=b.ea;null!==b;)a(b.value),b=b.ua;return this}; cb.prototype.map=function(a){var b=this.ag;b.Sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.value)),b=b.ua;return c.iterator};cb.prototype.filter=function(a){var b=this.ag;b.Sa=null;var c=new F;for(b=b.ea;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.ua}return c.iterator};cb.prototype.$d=function(){this.value=this.key=null;this.qa=-1;this.ag.Sa=this};cb.prototype.toString=function(){return null!==this.sa?"SetIterator@"+this.sa.value:"SetIterator"}; ma.Object.defineProperties(cb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ag.Nb}}});cb.prototype.first=cb.prototype.first;cb.prototype.hasNext=cb.prototype.ud;cb.prototype.next=cb.prototype.next;cb.prototype.reset=cb.prototype.reset;cb.className="SetIterator"; function H(a){Qa(this);this._isFrozen=!1;this.Ob={};this.Nb=0;this.Sa=null;this.Ja=0;this.ff=this.ea=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=H.prototype;t.xb=function(){var a=this.Ja;a++;999999999=this.Nb)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new cb(this)}}});H.prototype.toList=H.prototype.Av;H.prototype.toArray=H.prototype.Fa; H.prototype.clear=H.prototype.clear;H.prototype.retainAll=H.prototype.fA;H.prototype.removeAll=H.prototype.ap;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.first=H.prototype.first;H.prototype.containsAny=H.prototype.Ly;H.prototype.containsAll=H.prototype.Ky;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.addAll=H.prototype.addAll;H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ka;H.prototype.freeze=H.prototype.freeze; var jb=1;H.className="Set";H.uniqueHash=Qa;H.hashIdUnique=fb;H.hashId=bb;function kb(a){this.ma=a;this.qa=a.Ja;this.sa=null}kb.prototype.reset=function(){this.qa=this.ma.Ja;this.sa=null};kb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.ua;if(null!==b)return this.sa=b,this.value=this.key=a=b.key,!0;this.$d();return!1};kb.prototype.ud=function(){return this.next()}; kb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;return null!==a?(this.sa=a,this.value=this.key=a=a.key):null};kb.prototype.any=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;){if(a(b.key))return!0;b=b.ua}return!1};kb.prototype.all=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;){if(!a(b.key))return!1;b=b.ua}return!0};kb.prototype.each=function(a){var b=this.ma;this.sa=null;for(b=b.ea;null!==b;)a(b.key),b=b.ua;return this}; kb.prototype.map=function(a){var b=this.ma;this.sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.key)),b=b.ua;return c.iterator};kb.prototype.filter=function(a){var b=this.ma;this.sa=null;var c=new F;for(b=b.ea;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.ua}return c.iterator};kb.prototype.$d=function(){this.value=this.key=null;this.qa=-1};kb.prototype.toString=function(){return null!==this.sa?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"}; ma.Object.defineProperties(kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Nb}}});kb.prototype.first=kb.prototype.first;kb.prototype.hasNext=kb.prototype.ud;kb.prototype.next=kb.prototype.next;kb.prototype.reset=kb.prototype.reset;kb.className="MapKeySetIterator";function lb(a){H.call(this);Qa(this);this._isFrozen=!0;this.ma=a}la(lb,H);t=lb.prototype;t.freeze=function(){return this};t.ka=function(){return this}; t.toString=function(){return"MapKeySet("+this.ma.toString()+")"};t.add=function(){C("This Set is read-only: "+this.toString())};t.contains=function(a){return this.ma.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){C("This Set is read-only: "+this.toString())};t.delete=function(a){return this.remove(a)};t.clear=function(){C("This Set is read-only: "+this.toString())};t.first=function(){var a=this.ma.ea;return null!==a?a.key:null}; lb.prototype.any=function(a){for(var b=this.ma.ea;null!==b;){if(a(b.key))return!0;b=b.ua}return!1};lb.prototype.all=function(a){for(var b=this.ma.ea;null!==b;){if(!a(b.key))return!1;b=b.ua}return!0};lb.prototype.each=function(a){for(var b=this.ma.ea;null!==b;)a(b.key),b=b.ua;return this};lb.prototype.map=function(a){for(var b=new H,c=this.ma.ea;null!==c;)b.add(a(c.key)),c=c.ua;return b};lb.prototype.filter=function(a){for(var b=new H,c=this.ma.ea;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.ua}return b}; lb.prototype.copy=function(){return new lb(this.ma)};lb.prototype.Bv=function(){var a=new H,b=this.ma.Ob,c;for(c in b)a.add(b[c].key);return a};lb.prototype.Fa=function(){var a=this.ma.Ob,b=Array(this.ma.Nb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};lb.prototype.Av=function(){var a=new F,b=this.ma.Ob,c;for(c in b)a.add(b[c].key);return a}; ma.Object.defineProperties(lb.prototype,{count:{get:function(){return this.ma.Nb}},size:{get:function(){return this.ma.Nb}},iterator:{get:function(){return 0>=this.ma.Nb?Ya:new kb(this.ma)}}});lb.prototype.toList=lb.prototype.Av;lb.prototype.toArray=lb.prototype.Fa;lb.prototype.toSet=lb.prototype.Bv;lb.prototype.first=lb.prototype.first;lb.prototype.clear=lb.prototype.clear;lb.prototype["delete"]=lb.prototype.delete; lb.prototype.remove=lb.prototype.remove;lb.prototype.has=lb.prototype.has;lb.prototype.contains=lb.prototype.contains;lb.prototype.add=lb.prototype.add;lb.prototype.thaw=lb.prototype.ka;lb.prototype.freeze=lb.prototype.freeze;lb.className="MapKeySet";function mb(a){this.ma=a;a.ef=null;this.qa=a.Ja;this.sa=null}mb.prototype.reset=function(){var a=this.ma;a.ef=null;this.qa=a.Ja;this.sa=null}; mb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.ua;if(null!==b)return this.sa=b,this.value=b.value,this.key=b.key,!0;this.$d();return!1};mb.prototype.ud=function(){return this.next()};mb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;if(null!==a){this.sa=a;var b=a.value;this.key=a.key;return this.value=b}return null}; mb.prototype.any=function(a){var b=this.ma;this.sa=b.ef=null;for(b=b.ea;null!==b;){if(a(b.value))return!0;b=b.ua}return!1};mb.prototype.all=function(a){var b=this.ma;this.sa=b.ef=null;for(b=b.ea;null!==b;){if(!a(b.value))return!1;b=b.ua}return!0};mb.prototype.each=function(a){var b=this.ma;this.sa=b.ef=null;for(b=b.ea;null!==b;)a(b.value),b=b.ua;return this};mb.prototype.map=function(a){var b=this.ma;this.sa=b.ef=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b.value)),b=b.ua;return c.iterator}; mb.prototype.filter=function(a){var b=this.ma;this.sa=b.ef=null;var c=new F;for(b=b.ea;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.ua}return c.iterator};mb.prototype.$d=function(){this.value=this.key=null;this.qa=-1;this.ma.ef=this};mb.prototype.toString=function(){return null!==this.sa?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"};ma.Object.defineProperties(mb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Nb}}}); mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.ud;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset;mb.className="MapValueSetIterator";function ib(a,b){this.key=a;this.value=b;this.gl=this.ua=null}ib.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};ib.className="KeyValuePair";function nb(a){this.ma=a;a.Sa=null;this.qa=a.Ja;this.sa=null}nb.prototype.reset=function(){var a=this.ma;a.Sa=null;this.qa=a.Ja;this.sa=null}; nb.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&null===this.key)return!1;var b=this.sa;b=null===b?a.ea:b.ua;if(null!==b)return this.sa=b,this.key=b.key,this.value=b.value,!0;this.$d();return!1};nb.prototype.ud=function(){return this.next()};nb.prototype.first=function(){var a=this.ma;this.qa=a.Ja;a=a.ea;return null!==a?(this.sa=a,this.key=a.key,this.value=a.value,a):null};nb.prototype.any=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(a(b))return!0;b=b.ua}return!1}; nb.prototype.all=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;){if(!a(b))return!1;b=b.ua}return!0};nb.prototype.each=function(a){var b=this.ma;this.sa=b.Sa=null;for(b=b.ea;null!==b;)a(b),b=b.ua;return this};nb.prototype.map=function(a){var b=this.ma;this.sa=b.Sa=null;var c=new F;for(b=b.ea;null!==b;)c.add(a(b)),b=b.ua;return c.iterator};nb.prototype.filter=function(a){var b=this.ma;this.sa=b.Sa=null;var c=new F;for(b=b.ea;null!==b;)a(b)&&c.add(b),b=b.ua;return c.iterator}; nb.prototype.$d=function(){this.value=this.key=null;this.qa=-1;this.ma.Sa=this};nb.prototype.toString=function(){return null!==this.sa?"MapIterator@"+this.sa:"MapIterator"};ma.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Nb}}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.ud;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset; nb.className="MapIterator";function ob(a){Qa(this);this._isFrozen=!1;this.Ob={};this.Nb=0;this.ef=this.Sa=null;this.Ja=0;this.ff=this.ea=null;"string"===typeof a&&C("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=ob.prototype;t.xb=function(){var a=this.Ja;a++;999999999=this.count)return Ya;var a=this.Sa;return null!==a?(a.reset(),a):new nb(this)}},iteratorKeys:{get:function(){return 0>=this.count?Ya:new kb(this)}},iteratorValues:{get:function(){if(0>=this.count)return Ya; var a=this.ef;return null!==a?(a.reset(),a):new mb(this)}}});ob.prototype.toKeySet=ob.prototype.If;ob.prototype.toArray=ob.prototype.Fa;ob.prototype.clear=ob.prototype.clear;ob.prototype["delete"]=ob.prototype.delete;ob.prototype.remove=ob.prototype.remove;ob.prototype.get=ob.prototype.get;ob.prototype.getValue=ob.prototype.I;ob.prototype.has=ob.prototype.has;ob.prototype.contains=ob.prototype.contains;ob.prototype.first=ob.prototype.first;ob.prototype.addAll=ob.prototype.addAll; ob.prototype.set=ob.prototype.set;ob.prototype.add=ob.prototype.add;ob.prototype.thaw=ob.prototype.ka;ob.prototype.freeze=ob.prototype.freeze;ob.className="Map";function I(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):C("Invalid arguments to Point constructor: "+a+", "+b);this._isFrozen=!1}var pb,qb,rb,sb,tb;I.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.h=function(a,b){this.x=a;this.y=b;return this}; I.prototype.og=function(a,b){this.x=a;this.y=b;return this};I.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.copy=function(){var a=new I;a.x=this.x;a.y=this.y;return a};t=I.prototype;t.ha=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this}; t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};function ub(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 I(c,e)}return new I}function vb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.C=function(a){return a instanceof I?this.x===a.x&&this.y===a.y:!1}; t.ei=function(a,b){return this.x===a&&this.y===b};t.ab=function(a){return K.B(this.x,a.x)&&K.B(this.y,a.y)};t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.ne=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}; I.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=I.prototype;t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.yf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.td=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.Jy=function(a,b){return K.Bl(a.x,a.y,b.x,b.y,this.x,this.y)}; t.Wz=function(a,b,c,d){K.lh(a,b,c,d,this.x,this.y,this);return this};t.Xz=function(a,b){K.lh(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.kA=function(a,b,c,d){K.Jo(this.x,this.y,a,b,c,d,this);return this};t.lA=function(a,b){K.Jo(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};t.ui=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.vi=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.Ga(this);return this};function xb(a,b){b.Ld(a);return a}function yb(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 zb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}function Ab(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.w=function(){return isFinite(this.x)&&isFinite(this.y)};I.alloc=function(){var a=Bb.pop();return void 0===a?new I:a};I.allocAt=function(a,b){var c=Bb.pop();if(void 0===c)return new I(a,b);c.x=a;c.y=b;return c};I.free=function(a){Bb.push(a)};I.prototype.isReal=I.prototype.w;I.prototype.setSpot=I.prototype.vi;I.prototype.setRectSpot=I.prototype.ui;I.prototype.snapToGridPoint=I.prototype.lA;I.prototype.snapToGrid=I.prototype.kA;I.prototype.projectOntoLineSegmentPoint=I.prototype.Xz; I.prototype.projectOntoLineSegment=I.prototype.Wz;I.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return K.Ml(a,b,c,d,e,f,g,h)};I.prototype.compareWithLineSegmentPoint=I.prototype.Jy;I.compareWithLineSegment=function(a,b,c,d,e,f){return K.Bl(a,b,c,d,e,f)};I.prototype.direction=I.prototype.direction;I.prototype.directionPoint=I.prototype.$a;I.prototype.normalize=I.prototype.normalize;I.prototype.distanceSquared=I.prototype.td;I.prototype.distanceSquaredPoint=I.prototype.yf;I.prototype.scale=I.prototype.scale; I.prototype.rotate=I.prototype.rotate;I.prototype.offset=I.prototype.offset;I.prototype.subtract=I.prototype.ne;I.prototype.add=I.prototype.add;I.prototype.equalsApprox=I.prototype.ab;I.prototype.equalTo=I.prototype.ei;I.prototype.equals=I.prototype.C;I.prototype.set=I.prototype.set;I.prototype.setTo=I.prototype.og;var Bb=[];I.className="Point";I.parse=ub;I.stringify=vb;I.distanceLineSegmentSquared=yb;I.distanceSquared=zb;I.direction=Ab;I.Origin=pb=(new I(0,0)).ha(); I.InfiniteTopLeft=qb=(new I(-Infinity,-Infinity)).ha();I.InfiniteBottomRight=rb=(new I(Infinity,Infinity)).ha();I.SixPoint=sb=(new I(6,6)).ha();I.NoPoint=tb=(new I(NaN,NaN)).ha();I.parse=ub;I.stringify=vb;I.distanceLineSegmentSquared=yb;I.distanceSquared=zb;I.direction=Ab; function L(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):C("Invalid arguments to Size constructor: "+a+", "+b);this._isFrozen=!1}var Cb,Gb,Hb,Ib,Jb,Kb,Lb;L.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};L.prototype.h=function(a,b){this.width=a;this.height=b;return this};L.prototype.og=function(a,b){this.width=a;this.height=b;return this}; L.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};L.prototype.copy=function(){var a=new L;a.width=this.width;a.height=this.height;return a};t=L.prototype;t.ha=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this}; function Mb(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 L(c,e)}return new L}function Nb(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.C=function(a){return a instanceof L?this.width===a.width&&this.height===a.height:!1};t.ei=function(a,b){return this.width===a&&this.height===b}; t.ab=function(a){return K.B(this.width,a.width)&&K.B(this.height,a.height)};t.yc=function(a,b){a=this.width+a;this.width=0<=a?a:0;b=this.height+b;this.height=0<=b?b:0;return this};t.w=function(){return isFinite(this.width)&&isFinite(this.height)};L.alloc=function(){var a=Ob.pop();return void 0===a?new L:a};L.free=function(a){Ob.push(a)};L.prototype.isReal=L.prototype.w;L.prototype.inflate=L.prototype.yc;L.prototype.equalsApprox=L.prototype.ab;L.prototype.equalTo=L.prototype.ei; L.prototype.equals=L.prototype.C;L.prototype.set=L.prototype.set;L.prototype.setTo=L.prototype.og;var Ob=[];L.className="Size";L.parse=Mb;L.stringify=Nb;L.ZeroSize=Cb=(new L(0,0)).ha();L.OneSize=Gb=(new L(1,1)).ha();L.SixSize=Hb=(new L(6,6)).ha();L.EightSize=Ib=(new L(8,8)).ha();L.TenSize=Jb=(new L(10,10)).ha();L.InfiniteSize=Kb=(new L(Infinity,Infinity)).ha();L.NoSize=Lb=(new L(NaN,NaN)).ha();L.parse=Mb;L.stringify=Nb; function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:"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):a instanceof I?(c=a.x,a=a.y,b instanceof I?(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 L?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):C("Incorrect second argument supplied to Rect constructor "+ b)):C("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}t=N.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 Pb(a,b,c){a.width=b;a.height=c}t.og=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.Yc=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};N.prototype.copy=function(){var a=new N;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=N.prototype;t.ha=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this}; t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};function Qb(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 N(c,e,f,g)}return new N} function Rb(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.C=function(a){return a instanceof N?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.ei=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.ab=function(a){return K.B(this.x,a.x)&&K.B(this.y,a.y)&&K.B(this.width,a.width)&&K.B(this.height,a.height)}; function Ub(a,b){return K.$(a.x,b.x)&&K.$(a.y,b.y)&&K.$(a.width,b.width)&&K.$(a.height,b.height)}t.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Me=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.offset=function(a,b){this.x+=a;this.y+=b;return this}; t.yc=function(a,b){return Vb(this,b,a,b,a)};t.yo=function(a){return Vb(this,a.top,a.right,a.bottom,a.left)};t.yv=function(a){return Vb(this,-a.top,-a.right,-a.bottom,-a.left)};t.zz=function(a,b,c,d){return Vb(this,a,b,c,d)};function Vb(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.xx=function(a){return Wb(this,a.x,a.y,a.width,a.height)};t.Qu=function(a,b,c,d){return Wb(this,a,b,c,d)}; function Wb(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.Tc=function(a){return this.Ru(a.x,a.y,a.width,a.height)};t.Ru=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 Xb(a,b){var c=a.width,d=a.x,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.height;a=a.y;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ue=function(a){return Yb(this,a.x,a.y,0,0)};t.Zc=function(a){return Yb(this,a.x,a.y,a.width,a.height)};t.Dv=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return Yb(this,a,b,c,d)}; function Yb(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.vi=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 Zb(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 $b(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.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Ez=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=ac.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=ac.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){ac.push(a)}; ma.Object.defineProperties(N.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 I(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new L(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new I(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}}});N.prototype.isEmpty=N.prototype.Ez;N.prototype.isReal=N.prototype.w;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return K.yx(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.vi;N.prototype.union=N.prototype.Dv;N.prototype.unionRect=N.prototype.Zc;N.prototype.unionPoint=N.prototype.Ue;N.prototype.intersects=N.prototype.Ru; N.prototype.intersectsRect=N.prototype.Tc;N.prototype.intersect=N.prototype.Qu;N.prototype.intersectRect=N.prototype.xx;N.prototype.grow=N.prototype.zz;N.prototype.subtractMargin=N.prototype.yv;N.prototype.addMargin=N.prototype.yo;N.prototype.inflate=N.prototype.yc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Me;N.prototype.containsPoint=N.prototype.ca;N.prototype.equalsApprox=N.prototype.ab;N.prototype.equalTo=N.prototype.ei; N.prototype.equals=N.prototype.C;N.prototype.setSize=N.prototype.jA;N.prototype.setPoint=N.prototype.Yc;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.og;var bc=null,cc=null,ac=[];N.className="Rect";N.parse=Qb;N.stringify=Rb;N.contains=Zb;N.intersects=$b;N.ZeroRect=bc=(new N(0,0,0,0)).ha();N.NoRect=cc=(new N(NaN,NaN,NaN,NaN)).ha();N.parse=Qb;N.stringify=Rb;N.contains=Zb;N.intersects=$b; function hc(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):C("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}hc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this}; hc.prototype.og=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};hc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};hc.prototype.copy=function(){var a=new hc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=hc.prototype;t.ha=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()}; t.freeze=function(){this._isFrozen=!0;return this};t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this}; function ic(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 hc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new hc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new hc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new hc(c,e):new hc(c,e,f,g)}return new hc} function jc(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.C=function(a){return a instanceof hc?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};t.ei=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d}; t.ab=function(a){return K.B(this.top,a.top)&&K.B(this.right,a.right)&&K.B(this.bottom,a.bottom)&&K.B(this.left,a.left)};t.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};hc.alloc=function(){var a=kc.pop();return void 0===a?new hc:a};hc.free=function(a){kc.push(a)};hc.prototype.isReal=hc.prototype.w;hc.prototype.equalsApprox=hc.prototype.ab;hc.prototype.equalTo=hc.prototype.ei;hc.prototype.equals=hc.prototype.C;hc.prototype.set=hc.prototype.set; hc.prototype.setTo=hc.prototype.og;var pc=null,qc=null,kc=[];hc.className="Margin";hc.parse=ic;hc.stringify=jc;hc.ZeroMargin=pc=(new hc(0,0,0,0)).ha();hc.TwoMargin=qc=(new hc(2,2,2,2)).ha();hc.parse=ic;hc.stringify=jc;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._isFrozen=!1} var rc,sc,tc,uc,vc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,Hc,Ic,Jc,Kc,Lc,Mc,Nc,Oc,Pc,Qc,Rc,Sc,Wc,Xc,Yc,Zc,$c,ad,bd,cd,dd,gd;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.og=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.ha=function(){this._isFrozen=!0;Object.freeze(this);return this};t.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;return this};function hd(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a} function id(a){if("string"===typeof a){a=a.trim();if("None"===a)return rc;if("TopLeft"===a)return sc;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return tc;if("TopRight"===a)return uc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return vc;if("Center"===a)return xc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return yc;if("BottomLeft"===a)return zc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Ac;if("BottomRight"===a)return Bc;if("TopSide"===a)return Cc;if("LeftSide"=== a)return Dc;if("RightSide"===a)return Ec;if("BottomSide"===a)return Fc;if("TopBottomSides"===a)return Hc;if("LeftRightSides"===a)return Ic;if("TopLeftSides"===a)return Jc;if("TopRightSides"===a)return Kc;if("BottomLeftSides"===a)return Lc;if("BottomRightSides"===a)return Mc;if("NotTopSide"===a)return Nc;if("NotLeftSide"===a)return Oc;if("NotRightSide"===a)return Pc;if("NotBottomSide"===a)return Qc;if("AllSides"===a)return Rc;if("Default"===a)return Sc;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=ld.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.Ga=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.Ld=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.Uw=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=1.25*a.x,d=1.2*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.jp=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};ld.alloc=function(){var a=md.pop();return void 0===a?new ld:a}; ld.free=function(a){md.push(a)};ld.prototype.transformRect=ld.prototype.jp;ld.prototype.transformPoint=ld.prototype.Ga;ld.prototype.scale=ld.prototype.scale;ld.prototype.translate=ld.prototype.translate;ld.prototype.rotate=ld.prototype.rotate;ld.prototype.invert=ld.prototype.Ol;ld.prototype.multiplyInverted=ld.prototype.Yu;ld.prototype.multiply=ld.prototype.multiply;ld.prototype.reset=ld.prototype.reset;ld.prototype.isIdentity=ld.prototype.ps;ld.prototype.equals=ld.prototype.C; ld.prototype.setTransform=ld.prototype.setTransform;ld.prototype.set=ld.prototype.set;var md=[];ld.className="Transform";ld.xF="54a702f3e53909c447824c6706603faf4c"; var K={qA:"7da71ca0ad381e90",sg:(Math.sqrt(2)-1)/3*4,Nv:null,sqrt:function(a){if(0>=a)return 0;var b=K.Nv;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);K.Nv=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},B: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},Ur:function(a,b,c,d,e,f,g,h,k,l,m,n){if(K.Ub(a,b,g,h,n,c,d)&&K.Ub(a,b,g,h,n,e,f))return K.Ub(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 w=(d+q)/2,v=(c+u)/2;return K.Ur(a, b,p,r,d,c,w,v,k,l,m,n)||K.Ur(w,v,q,u,e,f,g,h,k,l,m,n)},Vw: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},Fy:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Ab(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},zl:function(a,b,c,d,e,f,g,h,k,l){if(K.Ub(a,b,g,h,k,c,d)&&K.Ub(a,b,g,h,k,e,f))Yb(l,a,b,0,0),Yb(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;K.zl(a,b,m,n,d,c,q,u,k,l);K.zl(q,u,p,r,e,f,g,h,k,l)}return l},Le:function(a,b,c,d,e,f,g,h,k,l){if(K.Ub(a,b,g,h,k,c,d)&&K.Ub(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;K.Le(a,b,m,n,d,c,q,u,k,l);K.Le(q,u,p,r,e,f,g,h,k,l)}return l},fv:function(a,b,c,d,e,f,g,h,k,l){if(K.Ub(a,b,e,f,l,c,d))return K.Ub(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 K.fv(a,b,m,n,p,r,g,h,k,l)||K.fv(p,r,c,d,e,f,g,h,k,l)},EA: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},ev:function(a,b,c,d,e,f,g,h){if(K.Ub(a,b,e,f,g,c,d))Yb(h,a,b,0,0),Yb(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;K.ev(a,b,k,l,m,n,g,h);K.ev(m,n,c,d,e,f,g,h)}return h},Yo:function(a,b,c,d,e,f,g,h){if(K.Ub(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;K.Yo(a,b,k,l,m,n,g,h);K.Yo(m,n,c,d,e,f,g,h)}return h},Ao:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(K.Ub(a,b,g,h,p,c,d)&&K.Ub(a,b,g,h,p,e,f)){if(!K.Ml(a,b,g,h,k,l,m,n))return!1;p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return!1;r.h(((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p);return!0}var q=(a+c)/2,u=(b+d)/2,w=(c+e)/2,v=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+w)/2;c=(u+v)/2;w=(w+e)/ 2;v=(v+f)/2;var z=(d+w)/2,y=(c+v)/2,A=Infinity,B=!1,E=0,M=0;K.Ao(a,b,q,u,d,c,z,y,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(ba)return r}else if(aa)return r;0p&&r--}else{q=(a+c)/2;u=(b+d)/2;var w=(c+e)/2,v=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+w)/2;c=(u+v)/2;w=(w+e)/2;v=(v+f)/2;var z=(d+w)/2,y=(c+v)/2;r+=K.Bo(a,b,q,u,d,c,z,y,k,l,m,n,p);r+=K.Bo(z,y,w,v,e,f,g,h,k,l,m,n,p)}return r},lh:function(a,b,c,d,e,f,g){if(K.$(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(K.$(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(K.$(h,g))return K.lh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(K.$(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return K.lh(a,b,c,d,e,g*(e-a)+b,k)},CA:function(a,b,c,d,e){return K.Re(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},AA: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},Cf:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(K.Re(a,b,a,d,e,f,g, h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},ns:function(a,b,c){return K.yx(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},yx:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f=b):f===h?(e=a):Zb(a,b,c,d,e,f)||Zb(a,b,c,d,g,h)||K.Ml(a,b,k,b,e,f,g,h)||K.Ml(k,b,k,l,e,f,g,h)||K.Ml(k,l,a,l,e,f,g,h)||K.Ml(a,l,a,b,e,f,g,h)?!0:!1},Ml:function(a,b,c,d,e,f,g,h){return a===c&&b===d&&e===g&&f===h?a===e&&b===f:0>=K.Bl(a,b,c,d,e,f)*K.Bl(a,b,c,d,g,h)&&0>=K.Bl(e,f,g,h,a,b)*K.Bl(e,f,g,h,c,d)},Bl: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 f},Wo:function(a){0>a&&(a+=360); 360<=a&&(a-=360);return a},bx: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 P.u:var b=new N(this.startX,this.startY,0,0);b.Dv(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 P.F:b=new N(this.startX,this.startY,0,0);b.Dv(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 P.m:b="";c=this.figures.s;for(var d=c.length,e=0;e=A-1?!0:null!==l[u+1].match(B)}function d(){u++;return l[u]}function e(a){var b=parseFloat(d()),c=parseFloat(d());w===w.toLowerCase()&&(b=y.x+b,c=y.y+c);a.h(b,c)}function f(){e(y);return y}function g(){e(z);return z}function h(){var a=v.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?y:new I(2*y.x-z.x,2*y.y-z.y)}void 0===b&&(b=!1);var k=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," ");a=a.replace(k,"$1 $2"); a=a.replace(k,"$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(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");var l=a.split(" ");for(a=0;a=A-1);)if(v=w,w=d(),""!==w)switch(w.toUpperCase()){case "X":r=!0;n=m=!1;break;case "M":q=f();null===a.ic||!0===r?(wd(a,q.x,q.y,m,!n,p),r=!1):a.moveTo(q.x,q.y);for(k.assign(y);!c();)q=f(),a.lineTo(q.x,q.y);break;case "L":for(;!c();)q=f(),a.lineTo(q.x,q.y);break;case "H":for(;!c();)y=new I((w===w.toLowerCase()?y.x:0)+parseFloat(d()), y.y),a.lineTo(y.x,y.y);break;case "V":for(;!c();)y=new I(y.x,(w===w.toLowerCase()?y.y:0)+parseFloat(d())),a.lineTo(y.x,y.y);break;case "C":for(;!c();){q=new I;e(q);var E=g(),M=f();xd(a,q.x,q.y,E.x,E.y,M.x,M.y)}break;case "S":for(;!c();)q=h(),E=g(),M=f(),xd(a,q.x,q.y,E.x,E.y,M.x,M.y);break;case "Q":for(;!c();)q=g(),E=f(),yd(a,q.x,q.y,E.x,E.y);break;case "T":for(;!c();)z=q=h(),E=f(),yd(a,q.x,q.y,E.x,E.y);break;case "B":for(;!c();){q=parseFloat(d());E=parseFloat(d());M=parseFloat(d());var R=parseFloat(d()), S=parseFloat(d()),J=S,G=!1;c()||(J=parseFloat(d()),c()||(G=0!==parseFloat(d())));w===w.toLowerCase()&&(M+=y.x,R+=y.y);a.arcTo(q,E,M,R,S,J,G)}break;case "A":for(;!c();)q=Math.abs(parseFloat(d())),E=Math.abs(parseFloat(d())),M=parseFloat(d()),S=R=!1,G=J=0,J=d(),1===J.length?(R=!!parseFloat(J),S=!!parseFloat(d()),J=parseFloat(d())):2===J.length?(R=!!parseFloat(J[0]),S=!!parseFloat(J[1]),J=parseFloat(d())):(R=!!parseFloat(J[0]),S=!!parseFloat(J[1]),J=parseFloat(J.slice(2))),G=parseFloat(d()),w===w.toLowerCase()&& (J=y.x+J,G=y.y+G),y.h(J,G),zd(a,q,E,M,R,S,J,G);break;case "Z":Ad(a);y.assign(k);break;case "F":q="";for(E=1;l[u+E];)if("0"===l[u+E])p=!0,E++;else if(null!==l[u+E].match(/[Uu]/))E++;else if(null===l[u+E].match(B))E++;else{q=l[u+E];break}q.match(/[Mm]/)?m=!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 Md:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;if(0===q.radiusX||0===q.radiusY)break;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:C("Unknown Segment type: "+q.type)}}}}this._isInvalidBounds=!0;return this}; t.ca=function(a,b){void 0===b&&(b=0);var c=this.fd,d=this.gd,e=this.Ac,f=this.Bc;switch(this.type){case P.j:return K.Ub(c,d,e,f,b,a.x,a.y);case P.u:var g=N.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.ca(a);N.free(g);return a;case P.F:g=Math.min(c,e)-b;var h=Math.min(d,f)-b;c=(Math.abs(e-c)+2*b)/2;b=(Math.abs(f-d)+2*b)/2;if(0>=c||0>=b)return!1;g=a.x-(g+c);h=a.y-(h+b);return 1>=g*g/(c*c)+h*h/(b*b);case P.m:return Pd(this,a,b,!0,!1);default:return!1}}; function Pd(a,b,c,d,e){var f=b.x;b=b.y;for(var g=a.bounds.x-20,h=0,k,l,m,n,p=a.figures.s,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.px=function(a){0>a?a=0:1=e)return e=b[g],b=e[2*a],c=e[2*a+1],d=e[2*a+2],a=e[2*a+3],1>Math.abs(d-b)&&1>Math.abs(a-c)?0:1>Math.abs(d-b)?0<=a-c?90:270:1>Math.abs(a-c)?0<=d-b?0:180:180*Math.atan2(a-c,d-b)/Math.PI;f+=l}}return NaN}; t.Mu=function(a,b){0>a?a=0:1=f)return d=f-g,d=0===m?0:d/m,m=c[h],c=m[2*a],h=m[2*a+1],e=m[2*a+2],a=m[2* a+3],b[0]=c+(e-c)*d,b[1]=h+(a-h)*d,b[2]=1>Math.abs(e-c)&&1>Math.abs(a-h)?0:1>Math.abs(e-c)?0<=a-h?90:270:1>Math.abs(a-h)?0<=e-c?0:180:180*Math.atan2(a-h,e-c)/Math.PI,b;g+=m}}return b}; t.qx=function(a){if(this.type===P.j){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)}if(c===e)return b=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=I.alloc();K.lh(b,c,d,e,f,a,h);a=h.x;f=h.y;I.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===P.u){g=this.startX;h=this.startY;var 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=I.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.s,d=c.length,e=0;ea&&(a+=360),this.Je=a,this.Rh=0,this.Sh=Math.max(d,0),this.Kg=Math.max(e,0),"boolean"===typeof g?g&&(this.isLargeArc=!0):"number"===typeof g&&g&&(this.isLargeArc=!0),h&&(this.isClockwiseArc=!0)):(this.Je=d,this.Rh=e,a===Ld&&(f=Math.max(f,0)),this.Sh=f,"number"===typeof g?(a=== Ld&&(g=Math.max(g,0)),this.Kg=g):this.Kg=0);this.Xd=null}Xd.prototype.copy=function(){var a=new Xd;a.na=this.na;a.o=this.o&-2;a.Ac=this.Ac;a.Bc=this.Bc;a.Je=this.Je;a.Rh=this.Rh;a.Sh=this.Sh;a.Kg=this.Kg;return a};t=Xd.prototype; t.ab=function(a){if(!(a instanceof Xd)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Dd:case pd:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY);case Ed:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.point1X,a.point1X)&&K.B(this.point1Y,a.point1Y)&&K.B(this.point2X,a.point2X)&&K.B(this.point2Y,a.point2Y);case Kd:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.point1X,a.point1X)&&K.B(this.point1Y,a.point1Y);case Ld:return K.B(this.startAngle, a.startAngle)&&K.B(this.sweepAngle,a.sweepAngle)&&K.B(this.centerX,a.centerX)&&K.B(this.centerY,a.centerY)&&K.B(this.radiusX,a.radiusX)&&K.B(this.radiusY,a.radiusY);case Md:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&K.B(this.xAxisRotation,a.xAxisRotation)&&K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.radiusX,a.radiusX)&&K.B(this.radiusY,a.radiusY);default:return!1}};t.rb=function(a){a.classType===Xd&&(this.type=a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Dd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case pd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Ed: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 Kd: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 Ld: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 Md: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.isClosed?"z":"")};t.freeze=function(){this._isFrozen=!0;return this};t.ka=function(){this._isFrozen=!1;return this};t.close=function(){this.isClosed=!0;return this}; function Nd(a,b){if(null!==a.Xd&&!1===b._isInvalidBounds)return a.Xd;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Xd=[],a.Xd;b=a.Je;var e=a.Rh,f=K.bx(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=K.bx(0,0,b>f?b:f,m,m+g,!0);f=ld.alloc();f.reset();f.translate(c,d);f.rotate(a.Je,0,0);f.scale(k,r);P.Ha(b,f); ld.free(f);a.Xd=b;return a.Xd} ma.Object.defineProperties(Xd.prototype,{_isFrozen:{get:function(){return 0!==(this.o&1)},set:function(a){this.o=a?this.o|1:this.o&-2}},_isInvalidBounds:{get:function(){return 0!==(this.o&2)},set:function(a){this.o=a?this.o|2:this.o&-3}},isClosed:{get:function(){return 0!==(this.o&8)},set:function(a){this.isClosed!==a&&(this.o=a?this.o|8:this.o&-9,this._isInvalidBounds=!0)}},type:{ get:function(){return this.na},set:function(a){this._isFrozen&&va(this,a);this.na=a;this._isInvalidBounds=!0}},endX:{get:function(){return this.Ac},set:function(a){this._isFrozen&&va(this,a);this.Ac=a;this._isInvalidBounds=!0}},endY:{get:function(){return this.Bc},set:function(a){this._isFrozen&&va(this,a);this.Bc=a;this._isInvalidBounds=!0}},point1X:{get:function(){return this.Je},set:function(a){this._isFrozen&& va(this,a);this.Je=a;this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Rh},set:function(a){this._isFrozen&&va(this,a);this.Rh=a;this._isInvalidBounds=!0}},point2X:{get:function(){return this.Sh},set:function(a){this._isFrozen&&va(this,a);this.Sh=a;this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Kg},set:function(a){this._isFrozen&&va(this,a);this.Kg=a;this._isInvalidBounds=!0}},centerX:{ get:function(){return this.Je},set:function(a){this._isFrozen&&va(this,a);this.Je=a;this._isInvalidBounds=!0}},centerY:{get:function(){return this.Rh},set:function(a){this._isFrozen&&va(this,a);this.Rh=a;this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Sh},set:function(a){0>a&&xa(a,">= zero",Xd,"radiusX");this._isFrozen&&va(this,a);this.Sh=a;this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Kg}, set:function(a){0>a&&xa(a,">= zero",Xd,"radiusY");this._isFrozen&&va(this,a);this.Kg=a;this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Ac},set:function(a){this._isFrozen&&va(this,a);a%=360;0>a&&(a+=360);this.Ac=a;this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Bc},set:function(a){this._isFrozen&&va(this,a);360a&&(a=-360);this.Bc=a;this._isInvalidBounds=!0}},isClockwiseArc:{ get:function(){return 0!==(this.o&4)},set:function(a){this._isFrozen&&va(this,a);this.o=a?this.o|4:this.o&-5;this._isInvalidBounds=!0}},isLargeArc:{get:function(){return 0!==(this.o&16)},set:function(a){this._isFrozen&&va(this,a);this.o=a?this.o|16:this.o&-17;this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Je},set:function(a){this._isFrozen&&va(this,a);a%=360;0>a&&(a+=360);this.Je=a;this._isInvalidBounds= !0}}});Xd.prototype.equalsApprox=Xd.prototype.ab;var Dd=new D(Xd,"Move",0),pd=new D(Xd,"Line",1),Ed=new D(Xd,"Bezier",2),Kd=new D(Xd,"QuadraticBezier",3),Ld=new D(Xd,"Arc",4),Md=new D(Xd,"SvgArc",4);Xd.className="PathSegment";Xd.Move=Dd;Xd.Line=pd;Xd.Bezier=Ed;Xd.QuadraticBezier=Kd;Xd.Arc=Ld;Xd.SvgArc=Md; function Zd(){this.H=null;this.su=(new I(0,0)).freeze();this.et=(new I(0,0)).freeze();this.vp=this.Kq=0;this.wp=1;this.qq="";this.Or=this.Np=!1;this.Lp=this.yp=0;this.tg=this.gq=this.mq=!1;this.Sp=null;this.Jr=0;this.rd=this.Fr=null}Zd.prototype.copy=function(){var a=new Zd;return this.clone(a)}; Zd.prototype.clone=function(a){a.H=this.H;a.su.assign(this.viewPoint);a.et.assign(this.documentPoint);a.Kq=this.Kq;a.vp=this.vp;a.wp=this.wp;a.qq=this.qq;a.Np=this.Np;a.Or=this.Or;a.yp=this.yp;a.Lp=this.Lp;a.mq=this.mq;a.gq=this.gq;a.tg=this.tg;a.Sp=this.Sp;a.Jr=this.Jr;a.Fr=this.Fr;a.rd=this.rd;return a}; Zd.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};Zd.prototype.Mo=function(a,b){var c=this.diagram;if(null===c)return b;$d(c,a,b);return b}; Zd.prototype.sz=function(a,b){var c=this.diagram;if(null===c)return b;$d(c,a,b);b.assign(c.Is(b));return b}; ma.Object.defineProperties(Zd.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{get:function(){return this.su},set:function(a){this.su.assign(a)}},documentPoint:{get:function(){return this.et},set:function(a){this.et.assign(a)}},modifiers:{get:function(){return this.Kq},set:function(a){this.Kq=a}},button:{get:function(){return this.vp}, set:function(a){this.vp=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.wp},set:function(a){this.wp=a}},key:{get:function(){return this.qq},set:function(a){this.qq=a}},down:{get:function(){return this.Np},set:function(a){this.Np=a}},up:{get:function(){return this.Or},set:function(a){this.Or= a}},clickCount:{get:function(){return this.yp},set:function(a){this.yp=a}},delta:{get:function(){return this.Lp},set:function(a){this.Lp=a}},isMultiTouch:{get:function(){return this.mq},set:function(a){this.mq=a}},handled:{get:function(){return this.gq},set:function(a){this.gq=a}},bubbles:{get:function(){return this.tg},set:function(a){this.tg=a}},event:{ get:function(){return this.Sp},set:function(a){this.Sp=a}},isTouchEvent:{get:function(){var a=this.event;return null===a?!1:"touch"===a.pointerType||"pen"===a.pointerType}},timestamp:{get:function(){return this.Jr},set:function(a){this.Jr=a}},targetDiagram:{get:function(){return this.Fr},set:function(a){this.Fr=a}},targetObject:{get:function(){return this.rd},set:function(a){this.rd= 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}}});Zd.prototype.getMultiTouchDocumentPoint=Zd.prototype.sz; Zd.prototype.getMultiTouchViewPoint=Zd.prototype.Mo;Zd.className="InputEvent";function ae(){this.H=null;this.wa="";this.Uq=this.Dr=null}ae.prototype.copy=function(){var a=new ae;a.H=this.H;a.wa=this.wa;a.Dr=this.Dr;a.Uq=this.Uq;return a};ae.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(ae.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},name:{get:function(){return this.wa},set:function(a){this.wa=a}},subject:{get:function(){return this.Dr},set:function(a){this.Dr=a}},parameter:{get:function(){return this.Uq},set:function(a){this.Uq=a}}});ae.className="DiagramEvent"; function be(){this.Cm=ce;this.mf=this.Jq="";this.Hn=this.In=this.Nn=this.On=this.Mn=this.H=this.$b=null}be.prototype.clear=function(){this.Hn=this.In=this.Nn=this.On=this.Mn=this.H=this.$b=null}; be.prototype.copy=function(){var a=new be;a.Cm=this.Cm;a.Jq=this.Jq;a.mf=this.mf;a.$b=this.$b;a.H=this.H;a.Mn=this.Mn;var b=this.On;a.On=za(b)&&"function"===typeof b.J?b.J():b;b=this.Nn;a.Nn=za(b)&&"function"===typeof b.J?b.J():b;b=this.In;a.In=za(b)&&"function"===typeof b.J?b.J():b;b=this.Hn;a.Hn=za(b)&&"function"===typeof b.J?b.J():b;return a};be.prototype.rb=function(a){a.classType===be&&(this.change=a)}; be.prototype.toString=function(){var a="";a=this.change===de?a+"* ":this.change===ce?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===de?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};be.prototype.I=function(a){return a?this.oldValue:this.newValue};be.prototype.vz=function(a){return a?this.oldParam:this.newParam};be.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; be.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};be.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};be.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; ma.Object.defineProperties(be.prototype,{model:{get:function(){return this.$b},set:function(a){this.$b=a}},diagram:{get:function(){return this.H},set:function(a){this.H=a}},change:{get:function(){return this.Cm},set:function(a){this.Cm=a}},modelChange:{get:function(){return this.Jq},set:function(a){this.Jq=a}},propertyName:{get:function(){return this.mf}, set:function(a){this.mf=a}},isTransactionFinished:{get:function(){return this.Cm===de&&("CommittedTransaction"===this.mf||"FinishedUndo"===this.mf||"FinishedRedo"===this.mf)}},object:{get:function(){return this.Mn},set:function(a){this.Mn=a}},oldValue:{get:function(){return this.On},set:function(a){this.On=a}},oldParam:{get:function(){return this.Nn},set:function(a){this.Nn=a}}, newValue:{get:function(){return this.In},set:function(a){this.In=a}},newParam:{get:function(){return this.Hn},set:function(a){this.Hn=a}}});be.prototype.redo=be.prototype.redo;be.prototype.canRedo=be.prototype.canRedo;be.prototype.undo=be.prototype.undo;be.prototype.canUndo=be.prototype.canUndo;be.prototype.getParam=be.prototype.vz;be.prototype.getValue=be.prototype.I;be.prototype.clear=be.prototype.clear; var de=new D(be,"Transaction",-1),ce=new D(be,"Property",0),ee=new D(be,"Insert",1),fe=new D(be,"Remove",2);be.className="ChangedEvent";be.Transaction=de;be.Property=ce;be.Insert=ee;be.Remove=fe;function ge(){this.m=(new F).freeze();this.wa="";this.j=!1}ge.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0b&&a.Xc(b,d),b++);for(;a.length>b;)a.pop();a.freeze()}}; ma.Object.defineProperties(ge.prototype,{changes:{get:function(){return this.m}},name:{get:function(){return this.wa},set:function(a){this.wa=a}},isComplete:{get:function(){return this.j},set:function(a){this.j=a}}});ge.prototype.optimize=ge.prototype.Yj;ge.prototype.redo=ge.prototype.redo;ge.prototype.canRedo=ge.prototype.canRedo;ge.prototype.undo=ge.prototype.undo;ge.prototype.canUndo=ge.prototype.canUndo; ge.prototype.clear=ge.prototype.clear;ge.className="Transaction";function he(){this.Kt=new H;this.Ad=!1;this.u=(new F).freeze();this.ye=-1;this.m=999;this.Be=!1;this.Hp=null;this.Zh=0;this.j=!1;this.Ee=(new F).freeze();this.cl=new F;this.mt=!0;this.wt=this.kq=this.zt=this.yt=!1} he.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;da.transactionLevel&&ya("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Lb("CommittingTransaction",c,e));var f=0;if(0a.historyIndex;d--)f=b.L(d),null!==f&&f.clear(),b.nb(d),a.kq=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.L(0),null!==f&&f.clear(),b.nb(0),a.ye--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.ye++);b.freeze()}a.isInternalTransaction||a.Lb("CommittedTransaction",c,e)}else{a.Be=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction|| a.Lb("RolledBackTransaction",c,e),a.Be=!1}null!==e&&e.clear()}a.Hp=null;a.isPendingClear&&a.clear();a.isPendingClear=!1;a.isPendingUnmodified=!1;return!0}if(a.isEnabled&&!b&&null!==e){a=f;c=e.changes;for(e=c.count-1;e>=a;e--)b=c.L(e),null!==b&&b.undo(),c.ka(),c.nb(e);c.freeze()}return!1}he.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.mt&&(a=a.diagram,null!==a&&!1===a.mi||ya("Change not within a transaction: "+c.toString()))}}; he.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(null===a)return!1;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(he.prototype,{models:{get:function(){return this.Kt.iterator}},isEnabled:{get:function(){return this.Ad},set:function(a){this.Ad=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||Math.abs(b.y-a.y)>d}; ma.Object.defineProperties(je.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof Q&&(this.H=a)}},name:{get:function(){return this.wa},set:function(a){this.wa=a}},isEnabled:{get:function(){return this.Ad},set:function(a){this.Ad=a}},isActive:{get:function(){return this.ob},set:function(a){this.ob=a}},transactionResult:{get:function(){return this.tm}, set:function(a){this.tm=a}}});je.prototype.startTransaction=je.prototype.Ea;je.className="Tool";function La(){je.call(this);this.name="ToolManager";this.hb=new F;this.pb=new F;this.Fb=new F;this.F=this.V=850;this.m=(new L(2,2)).ha();this.Ha=5E3;this.ga=ne;this.u=ue;this.Gp=this.j=null;this.xj=-1}la(La,je);La.prototype.initializeStandardTools=function(){}; La.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof te&&this.Gp===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; La.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===ve&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===we){b.bubbles=!0;return}if(this.gestureBehavior===ve)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.yc.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.Ke;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=sf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=sf(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.Ix&&d.R("LinkRelinked",c,d.Ix),c.toPort!==d.Jx&&d.R("LinkRelinked",c,d.Jx)):tf(e,g,f,k,h):tf(e,null,null,null,null)}}}}Ae.prototype.doDragOver=function(){}; function uf(a,b){var c=a.diagram;a.dragsLink&&of(a,!0);Te(a);var d=a.findDragOverObject(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;vf(a,e,f);f=rf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==De){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof V&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!==De){a=N.alloc();for(b= c.selection.iterator;b.next();)d=b.value,d instanceof V&&wf(c,d,a);N.free(a)}}}function vf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof pf||(c=a.mouseDrop,null!==c&&c(b))}function wf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.Me(c)&&(d=!0);a=a.Ju(c,function(a){return a.part},function(a){return a instanceof T},!0,function(a){return a instanceof T},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.Md(b)&&c.isAvoiding&&c.bb()} Ae.prototype.doDropOnto=function(){};Ae.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()?(af(this,!1),Ge(a,this.copiedParts),cf(this,this.copiedParts,!1),Ue(a,this.copiedParts)):this.mayMove()?(We(this),cf(this,this.draggedParts,!0)):this.mayDragOut()?(af(this,!1),cf(this,this.copiedParts,!1)):We(this),nf(this,a.lastInput.documentPoint))}}; Ae.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?(We(this),af(this,!0),Ge(a,this.copiedParts),cf(this,this.copiedParts,!1),Ue(a,this.copiedParts),null!==this.copiedParts&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,We(this),this.mayMove()&&(cf(this,this.draggedParts, !0),nf(this,a.lastInput.documentPoint)));this.Vm=!0;uf(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.If():this.draggedParts.If();this.copiedParts=null;b&&xf(this);a.Xa();Ue(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.R(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.R("ChangedSelection",a.selection)}}}; Ae.prototype.simulatedMouseMove=function(a,b,c){if(null===De)return!1;var d=De.diagram;c instanceof Q||(c=null);var e=He;c!==e&&(null!==e&&e!==d&&(e.qg(),De.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),He=c,null!==c&&c!==d&&(Ze(),e=c.toolManager.findTool("Dragging"),null!==e&&(Ce.contains(e)||Ce.add(e),e.doSimulatedDragEnter())),this.doUpdateCursor(null));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&&(0g&&(g=l),m>h&&(h=m))}}Infinity===d?f.h(0,0,0,0):f.h(d,e,g-d,h-e);d=f.x+f.width/2;e=f.y+f.height/2;N.free(f); f=a.xr;g=new ob;h=I.alloc();for(k=b.iterator;k.next();)l=k.value,l instanceof T&&l.canCopy()&&(m=c.I(l),null!==m&&(m.points=l.points,bf(m,f.x-d,f.y-e),m.suspendsRouting=!0,g.add(m,a.Gd())));for(b=b.iterator;b.next();)l=b.value,l.Uc()&&l.canCopy()&&(k=c.I(l),null!==k&&(l=l.location,h.h(f.x-(d-l.x),f.y-(e-l.y)),k.location=h,k.Va(),g.add(k,a.Gd(h))));I.free(h);a.copiedParts=g;Ee(a,g.If());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,bf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/ 2)));a.doUpdateCursor(null)}}}Ae.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Gs=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.xn=null};Ae.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new I}; ma.Object.defineProperties(Ae.prototype,{isCopyEnabled:{get:function(){return this.pb},set:function(a){this.pb=a}},copiesEffectiveCollection:{get:function(){return this.u},set:function(a){this.u=a}},dragOptions:{get:function(){return this.ga},set:function(a){this.ga=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled= a}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(a){this.hb=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.C(a)||(a=a.J(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{ get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.C(a)||(a=a.J(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.C(a)||(a=a.J(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink= a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.F},set:function(a){this.F=a}},moveCursor:{get:function(){return this.Lc},set:function(a){this.Lc=a}},nodropCursor:{get:function(){return this.Mc},set:function(a){this.Mc=a}},currentPart:{get:function(){return this.V}, set:function(a){this.V=a}},copiedParts:{get:function(){return this.m},set:function(a){this.m=a}},draggedParts:{get:function(){return this.Ha},set:function(a){this.Ha=a}},draggingParts:{get:function(){return null!==this.copiedParts?this.copiedParts.If():null!==this.draggedParts?this.draggedParts.If():this.pe}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink= a}},isDragOutStarted:{get:function(){return this.Fb},set:function(a){this.Fb=a}},startPoint:{get:function(){return this.xr},set:function(a){this.xr.C(a)||this.xr.assign(a)}},delay:{get:function(){return this.Dk},set:function(a){this.Dk=a}}});Ae.prototype.getDraggingSource=Ae.prototype.rz;var De=null,He=null;Ae.className="DraggingTool";Ce=new F; Ka("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)});La.prototype.doCancel=function(){null!==De&&De.doCancel();je.prototype.doCancel.call(this)}; function Af(){je.call(this);this.pe=100;this.Ha=!1;this.u="pointer";var a=new T,b=new Bf;b.isPanelMain=!0;b.stroke="blue";a.add(b);b=new Bf;b.toArrow="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.layerName="Tool";this.zi=a;a=new V;b=new Bf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize=Gb;a.add(b);a.selectable=!1;a.layerName="Tool";this.yi=a;this.j=b;a=new V;b=new Bf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth= 2;b.desiredSize=Gb;a.add(b);a.selectable=!1;a.layerName="Tool";this.Ai=a;this.m=b;this.Mc=this.Lc=this.pb=this.hb=this.Fb=null;this.ga=!0;this.ay=new ob;this.Lf=this.ej=this.Mf=null}la(Af,je);Af.prototype.doStop=function(){this.diagram.qg();this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null;this.validPortsCache.clear();this.targetPort=null}; Af.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){var f=b.Af(),g=L.alloc();g.width=b.naturalBounds.width*f;g.height=b.naturalBounds.height*f;d.desiredSize=g;L.free(g);e?(d.toSpot=b.toSpot,d.toEndSegmentLength=b.toEndSegmentLength):(d.fromSpot=b.fromSpot,d.fromEndSegmentLength=b.fromEndSegmentLength);c.locationSpot=xc;f=I.alloc();c.location=b.ja(xc,f);I.free(f);d.angle=b.ii();null!==this.portTargeted&&this.portTargeted(a,b,c,d,e)}}; Af.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.desiredSize=Gb,b.fromSpot=rc,b.toSpot=rc);null!==a&&(a.location=this.diagram.lastInput.documentPoint);null!==this.portTargeted&&this.portTargeted(null,null,a,b,c)};Af.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()}; Af.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort&&this.targetPort.part instanceof V){var b=this.targetPort.part;this.isForwards?this.copyPortProperties(b,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(b,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort, !0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.Zr(a.lastInput.viewPoint)}};Af.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.part;if(!(c instanceof V))return null;for(;null!==a;){var d=b?a.toLinkable:a.fromLinkable;if(!0===d&&(null!==a.portId||a instanceof V)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.panel}return null}; Af.prototype.findTargetPort=function(a){var b=this.diagram,c=b.lastInput.documentPoint,d=this.portGravity;0>=d&&(d=.1);var e=this,f=b.kg(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 V){var k=g.ja(xc,I.alloc()),l=c.x-k.x,m=c.y-k.y;I.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.Io(b).count>=c)return!1}return!0}; Af.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.Kd(b).count>=c)return!1}return!0}; Af.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};Af.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof V))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof V))return!1;b=b.portId;null===b&&(b="");for(b=d.Kd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Af.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};Af.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 H;d.add(a);return Cf(this,c,b,d)}; function Cf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Cf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Cf(a,b.labeledLink,c,d))?!0:!1} Af.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!==Df){if(d===Ef){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!Ff(this,a,b,c,!0)}if(d===Gf){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!Ff(this,a,b,c,!0)}if(d===Hf)return a===b?a=!0:(d=new H,d.add(b),a=If(this,d,a,b,c)),!a;if(d===Qf)return!Ff(this,a,b,c,!1);if(d===Rf)return a===b?a=!0:(d=new H,d.add(b),a=Sf(this,d,a,b,c)),!a}return!0};function Ff(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&&Ff(a,g,c,d,e)))return!0}return!1} function If(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&&If(a,b,g,d,e)))return!0}return!1}function Sf(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&&Sf(a,b,h,d,e))return!0}}return!1} ma.Object.defineProperties(Af.prototype,{portGravity:{get:function(){return this.pe},set:function(a){0<=a&&(this.pe=a)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(a){this.Ha=a}},linkingCursor:{get:function(){return this.u},set:function(a){this.u=a}},temporaryLink:{get:function(){return this.zi},set:function(a){this.zi=a}},temporaryFromNode:{ get:function(){return this.yi},set:function(a){if(this.yi=a)this.j=a.port}},temporaryFromPort:{get:function(){return this.j},set:function(a){if(null!==this.j){var b=this.j.panel;if(null!==b){var c=b.P.indexOf(this.j);b.nb(c);b.Eb(c,a)}}this.j=a}},temporaryToNode:{get:function(){return this.Ai},set:function(a){if(this.Ai=a)this.m=a.port}},temporaryToPort:{get:function(){return this.m},set:function(a){if(null!== this.m){var b=this.m.panel;if(null!==b){var c=b.P.indexOf(this.m);b.nb(c);b.Eb(c,a)}}this.m=a}},originalLink:{get:function(){return this.Fb},set:function(a){this.Fb=a}},originalFromNode:{get:function(){return this.hb},set:function(a){this.hb=a}},originalFromPort:{get:function(){return this.pb},set:function(a){this.pb=a}},originalToNode:{get:function(){return this.Lc},set:function(a){this.Lc= a}},originalToPort:{get:function(){return this.Mc},set:function(a){this.Mc=a}},isForwards:{get:function(){return this.ga},set:function(a){this.ga=a}},validPortsCache:{get:function(){return this.ay}},targetPort:{get:function(){return this.Mf},set:function(a){this.Mf=a}},linkValidation:{get:function(){return this.ej},set:function(a){this.ej=a}},portTargeted:{ get:function(){return this.Lf},set:function(a){this.Lf=a}}});Af.className="LinkingBaseTool";function Tf(){Af.call(this);this.name="Linking";this.V={};this.F=null;this.K=Uf;this.Sd=null}la(Tf,Af);Tf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.qs()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:null!==this.findLinkablePort()}; Tf.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null===b&&(b=a.ec(a.firstInput.documentPoint,null,null));if(null===b)return null;a=b.part;if(!(a instanceof V))return null;var c=this.direction;if(c===Uf||c===Vf){var d=this.findValidLinkablePort(b,!1);if(null!==d||this.startObject===a&&(d=a.port,this.findValidLinkablePort(d,!1)))return this.isForwards=!0,d}if(c===Uf||c===Wf)if(b=this.findValidLinkablePort(b,!0),null!==b||this.startObject===a&&(b=a.port,this.findValidLinkablePort(b, !0)))return this.isForwards=!1,b;return null}; Tf.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null===b?this.stopTool():(this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null!==this.temporaryToNode&&(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof V&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(null!== this.temporaryFromNode&&(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof V&&(this.originalToNode=b),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),a.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),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.bb(),a.add(this.temporaryLink)),this.isActive=!0)};Tf.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.stopTransaction()}; Tf.prototype.doStop=function(){Af.prototype.doStop.call(this);this.startObject=null}; Tf.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,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 V&&(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),a.clearSelection(!0),f.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",f)):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)}}};Tf.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null===a)return!0;if(a instanceof T)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}; Tf.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};Tf.prototype.doNoLink=function(){}; ma.Object.defineProperties(Tf.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(a){this.V=a}},archetypeLabelNodeData:{get:function(){return this.F},set:function(a){this.F=a}},direction:{get:function(){return this.K},set:function(a){this.K=a}},startObject:{get:function(){return this.Sd},set:function(a){this.Sd=a}}}); var Uf=new D(Tf,"Either",0),Vf=new D(Tf,"ForwardsOnly",0),Wf=new D(Tf,"BackwardsOnly",0);Tf.className="LinkingTool";Tf.Either=Uf;Tf.ForwardsOnly=Vf;Tf.BackwardsOnly=Wf; function Ie(){Af.call(this);this.name="Relinking";var a=new Bf;a.figure="Diamond";a.desiredSize=Ib;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.V=a;a=new Bf;a.figure="Diamond";a.desiredSize=Ib;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.Sd=a;this.F=null;this.xw=new N}la(Ie,Af); Ie.prototype.updateAdornments=function(a){if(null!==a&&a instanceof T){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly){var d=a.selectionObject;null!==d&&a.canRelinkFrom()&&a.actualBounds.w()&&a.isVisible()&&d.actualBounds.w()&&d.Nd()&&(c=a.Nj(b),null===c&&(c=this.makeAdornment(d,!1),a.Wg(b,c)))}null===c&&a.Gf(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!==d&&a.canRelinkTo()&&a.actualBounds.w()&&a.isVisible()&&d.actualBounds.w()&&d.Nd()&& (c=a.Nj(b),null===c?(c=this.makeAdornment(d,!0),a.Wg(b,c)):c.v()));null===c&&a.Gf(b)}};Ie.prototype.makeAdornment=function(a,b){var c=new te;c.type=W.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!==b&&c.add(b.copy());c.adornedObject=a;return c}; Ie.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.qs()||!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}; Ie.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 te&&c.adornedPart instanceof T))return;this.handle=b;this.isForwards=null===c||"RelinkTo"===c.category;this.originalLink=c.adornedPart}this.Ea(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.xw.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 W)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};gg.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}; gg.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&&(a.isMouseCaptured=!0,a.animationManager.zc(),this.Ea(this.name),this.Qq.set(this.adornedObject.ja(this.handle.alignment.cv())),this.Pn.set(this.adornedObject.part.location),this.ww.set(this.adornedObject.desiredSize),this.it=this.computeCellSize(),this.kt= this.computeMinSize(),this.jt=this.computeMaxSize(),this.isActive=!0))};gg.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.qe=this.handle=null;this.isActive=a.isMouseCaptured=!1};gg.prototype.stopTransaction=function(){var a=this.diagram,b=je.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.Yj();return b}; gg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()};gg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.kt,c=this.jt,d=this.it,e=this.adornedObject.js(a.lastInput.documentPoint,I.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.Wc();I.free(e)}}; gg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.kt,c=this.jt,d=this.it,e=this.adornedObject.js(a.lastInput.documentPoint,I.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);I.free(e);a.Xa();this.transactionResult=this.name;a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; gg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.Va();c=c.ja(this.handle.alignment.cv());if(a instanceof pf){var d=new F;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Be;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().ne(c),!0,e)}else a.location=a.location.copy().ne(c).add(this.oppositePoint);b.Wc()}}; gg.prototype.computeResize=function(a,b,c,d,e,f){b.Jc()&&(b=xc);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=I.alloc();K.Jo(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)));I.free(p);return a};gg.prototype.computeReshape=function(){var a=kg;this.adornedObject instanceof Bf&&(a=lg(this.adornedObject));return!(a===mg||this.diagram.lastInput.shift)}; gg.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};gg.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.ja(b)};ng.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.qe=this.handle=null;this.dr=new I(NaN,NaN);this.isActive=a.isMouseCaptured=!1};ng.prototype.stopTransaction=function(){var a=this.diagram,b=je.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.Yj();return b};ng.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()}; ng.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))};ng.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Xa();this.transactionResult=this.name;a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; ng.prototype.rotate=function(a){var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.Va();var c=b.locationObject,d=b.rotateObject;if(c===d||c.ng(d))c=this.Pn.copy(),b.location=c.ne(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.Wc()}}; ng.prototype.computeRotate=function(a){a=this.rotationPoint.$a(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.ii());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(ng.prototype,{handleArchetype:{get:function(){return this.m},set:function(a){this.m=a}},handle:{get:function(){return this.j},set:function(a){if(null!==a&&!(a.part instanceof te))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{get:function(){return this.qe},set:function(a){if(null!==a&&a.part instanceof te)throw Error("new handle must not be in an Adornment: "+ a);this.qe=a}},snapAngleMultiple:{get:function(){return this.ga},set:function(a){this.ga=a}},snapAngleEpsilon:{get:function(){return this.V},set:function(a){this.V=a}},originalAngle:{get:function(){return this.vw}},rotationPoint:{get:function(){return this.dr},set:function(a){this.dr=a.copy()}},handleAngle:{get:function(){return this.u},set:function(a){this.u= a}},handleDistance:{get:function(){return this.F},set:function(a){this.F=a}}});ng.className="RotatingTool";Ka("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function og(){je.call(this);this.name="ClickSelecting"}la(og,je);og.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0}; og.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};og.className="ClickSelectingTool";function pg(){je.call(this);this.name="Action";this.jk=null}la(pg,je); pg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.ec(b.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a});if(null!==c){if(!c.isActionable)return!1;this.jk=c;a.xk=a.ec(b.documentPoint,null,null);return!0}return!1};pg.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.jk;null!==b&&(a.targetObject=b,null!==b.actionDown&&b.actionDown(a,b))}else this.canStart()&&this.doActivate()}; pg.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.jk;null!==b&&(a.targetObject=b,null!==b.actionMove&&b.actionMove(a,b))}};pg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.jk;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()}; pg.prototype.doCancel=function(){var a=this.diagram.lastInput,b=this.jk;null!==b&&(a.targetObject=b,null!==b.actionCancel&&b.actionCancel(a,b),this.stopTool())};pg.prototype.doStop=function(){this.jk=null};pg.className="ActionTool";function qg(){je.call(this);this.name="ClickCreating";this.Oi=null;this.m=!0;this.j=!1;this.fw=new I(0,0)}la(qg,je); qg.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.fw=a.lastInput.viewPoint.copy()),2!==a.lastInput.clickCount||this.isBeyondDragSize(this.fw))return!1}else if(1!==a.lastInput.clickCount)return!1;return a.currentTool!==this&&null!==a.Jl(a.lastInput.documentPoint,!0)?!1:!0}; qg.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint);this.stopTool()}; qg.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.Ea(this.name);if(c instanceof U)c.Uc()&&(jg(c),d=c.copy(),null!==d&&b.add(d));else if(null!==c){var e=b.model.copyNodeData(c);za(e)&&(b.model.uf(e),d=b.Ic(e))}if(null!==d){var f=I.allocAt(a.x,a.y);this.isGridSnapEnabled&&zg(this.diagram,d,a,f);d.location=f;b.allowSelect&&(b.clearSelection(!0),d.isSelected=!0);I.free(f)}b.Xa();this.transactionResult= this.name;b.R("PartCreated",d)}finally{this.stopTransaction(),b.R("ChangedSelection",b.selection)}return d};ma.Object.defineProperties(qg.prototype,{archetypeNodeData:{get:function(){return this.Oi},set:function(a){this.Oi=a}},isDoubleClick:{get:function(){return this.m},set:function(a){this.m=a}},isGridSnapEnabled:{get:function(){return this.j},set:function(a){this.j=a}}});qg.className="ClickCreatingTool"; function Ag(){je.call(this);this.name="DragSelecting";this.Dk=175;this.m=!1;var a=new U;a.layerName="Tool";a.selectable=!1;var b=new Bf;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.j=a}la(Ag,je); Ag.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};Og.prototype.doStart=function(){Yg=this;null!==this.textBlock&&this.doActivate()}; Og.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.ec(a.lastInput.documentPoint));if(null!==b&&b instanceof Pg&&(this.textBlock=b,null!==b.part)){a.animationManager.zc();this.isActive=!0;this.qa=Vg;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.Wh=this.textBlock.copy();var d=new N(this.textBlock.ja(sc),this.textBlock.ja(Bc));a.ov(d);c.show(b,a,this);this.currentTextEditor=c}}}};Og.prototype.doCancel=function(){this.stopTool()}; Og.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};Og.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Zg)};Og.prototype.acceptText=function(a){switch(a){case Zg:if(this.qa===ah)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.qa===Vg||this.qa===Xg||this.qa===Wg)this.qa=bh,ch(this);break;case dh:case Tg:case Ug:if(Tg!==a||!0!==this.textBlock.isMultiline)if(this.qa===Vg||this.qa===Xg||this.qa===Wg)this.qa=bh,ch(this)}}; function ch(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());a.isValidText(b,e,f)?(a.Ea(a.name),a.qa=ah,a.transactionResult=a.name,b.text=f,a.doSuccess(e,f),null!==c&&c.R("TextEdited",b,e),a.stopTransaction(),a.stopTool(),null!==c&&c.doFocus()):(a.qa=Xg,a.doError(e,f))}} Og.prototype.doError=function(a,b){var c=this.textBlock;null!==c.errorFunction&&c.errorFunction(this,a,b);(a=this.currentTextEditor)&&a.show(c,this.diagram,this)};Og.prototype.doSuccess=function(a,b){var c=this.textBlock;null!==c.textEdited&&c.textEdited(c,a,b)};Og.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.qa=Rg,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)};Og.prototype.doStop=function(){Yg=null}; Og.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};Og.prototype.Gx=function(a){var b=this.Wh;b.text=a;b.measure(this.textBlock.Eh,Infinity);return b}; ma.Object.defineProperties(Og.prototype,{textBlock:{get:function(){return this.ga},set:function(a){this.ga=a}},currentTextEditor:{get:function(){return this.m},set:function(a){this.m=a}},defaultTextEditor:{get:function(){return this.j},set:function(a){this.j=a}},starting:{get:function(){return this.V},set:function(a){this.V=a}},textValidation:{get:function(){return this.tj}, set:function(a){this.tj=a}},minimumEditorScale:{get:function(){return this.u},set:function(a){this.u=a}},selectsTextOnActivate:{get:function(){return this.F},set:function(a){this.F=a}},state:{get:function(){return this.qa},set:function(a){this.qa!==a&&(this.qa=a)}}});Og.prototype.measureTemporaryTextBlock=Og.prototype.Gx; var dh=new D(Og,"LostFocus",0),Zg=new D(Og,"MouseDown",1),Ug=new D(Og,"Tab",2),Tg=new D(Og,"Enter",3),eh=new D(Og,"SingleClick",0),Qg=new D(Og,"SingleClickSelected",1),$g=new D(Og,"DoubleClick",2),Rg=new D(Og,"StateNone",0),Vg=new D(Og,"StateActive",1),Wg=new D(Og,"StateEditing",2),bh=new D(Og,"StateValidating",3),Xg=new D(Og,"StateInvalid",4),ah=new D(Og,"StateValidated",5),Yg=null;Og.className="TextEditingTool";Og.LostFocus=dh;Og.MouseDown=Zg;Og.Tab=Ug;Og.Enter=Tg;Og.SingleClick=eh; Og.SingleClickSelected=Qg;Og.DoubleClick=$g;Og.StateNone=Rg;Og.StateActive=Vg;Og.StateEditing=Wg;Og.StateValidating=bh;Og.StateInvalid=Xg;Og.StateValidated=ah;Ka("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)}); function fh(a){gh||(hh(),gh=!0);this.H=ke;this.Jk=this.zb=this.oq=this.Zb=!1;this.Jw=!0;this.Kk=ih;this.Am=!1;this.Ch=this.Ad=!0;this.zg=600;this.Wv=this.Hw=!1;this.Ud=new H;this.Zd=new jh;this.Zd.Td=this;this.Bi=new H;this.ku=new H;this.Kr=new H;this.kl=new H;a&&Object.assign(this,a)}fh.prototype.Te=function(a){this.H=a};fh.prototype.canStart=function(){return!0};function kh(a,b){a.Ad&&a.canStart(b)&&(a.Ud.add(b),a.defaultAnimation.isAnimating&&a.zc(),lh(a.H),a.zb=!0)} function mh(a){if(a.Ad&&a.zb){var b=a.Zd,c=a.H,d=a.Ud.contains("Model");d&&(a.Jk=!0,a.Kk===ih?(b.isViewportUnconstrained=!0,b.sc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.Kk===nh&&b.sc.clear(),a.Jw=a.Kk===oh&&c.Zt.C(c.pa)?!0:!1,c.R("InitialAnimationStarting",a));d&&!a.Ch||0===b.sc.count?(a.Ud.clear(),a.zb=!1,b.sc.clear(),ph(b,c),a.Jk=!1,c.N()):(a.Ud.clear(),c.gg=!1,d=b.sc.get(c),c.autoScale!==qh&&null!==d&&(delete d.start.scale,delete d.end.scale), x.requestAnimationFrame(function(){!1===a.zb||b.Zb||(c.Df("temporaryPixelRatio")&&Fe(c),rh(c),a.zb=!1,b.start(),b.Zb&&(sh(a),c.Xa(),th(b,0),yf(c,!0),uh(a),c.R("AnimationStarting",a)))}))}}function vh(a){return a.Ud.contains("Trigger")&&1===a.Ud.count}function Gh(a,b,c,d){a.isTicking||vh(a)||b instanceof T&&(null!==b.fromNode||null!==b.toNode)||a.Zd.add(b,"position",c,d,!1)}t=fh.prototype;t.bv=function(a){return this.Zd.bv(a)};t.Tu=function(a){return this.Zd.Tu(a)}; function Hh(a,b){function c(){0f?f+=360:k+=360);f=e(c,f,k-f,d)%360;g=e(c,g,l-g,d);h=e(c,h,m-h,d);c=e(c,a,b-a,d);return"hsla("+f+", "+g+"%, "+h+"%, "+c+")"} function hh(){function a(a,b,e,f,g,h){a.position=new I(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))}var b=new ob;b.add("position:diagram",a);b.add("position",a);b.add("position:part",function(a,b,e,f,g,h){ga&&xa(a,">= 1",fh,"duration");this.zg=a}},isAnimating:{get:function(){return this.Zb}}, isTicking:{get:function(){return this.oq}},isInitial:{get:function(){return this.Ch},set:function(a){this.Ch=a}},defaultAnimation:{get:function(){return this.Zd}},activeAnimations:{get:function(){return this.Bi}},initialAnimationStyle:{get:function(){return this.Kk},set:function(a){this.Kk=a}}});fh.prototype.stopAnimation=fh.prototype.zc; var Oh=null,gh=!1,ih=new D(fh,"Default",1),oh=new D(fh,"AnimateLocations",2),nh=new D(fh,"None",3);fh.className="AnimationManager";fh.defineAnimationEffect=function(a,b){gh||(hh(),gh=!0);Oh.add(a,b)};fh.Default=ih;fh.AnimateLocations=oh;fh.None=nh; function jh(a){this.qu=this.Gw=this.Td=this.H=null;this.Sk=this.Zb=this.j=!1;this.Zm=this.Hd=0;this.Fp=this.ht=Ph;this.Rk=this.bo=!1;this.Yt=1;this.Wt=0;this.yd=this.zg=NaN;this.$v=0;this.$m=null;this.m=pb;this.sc=new ob;this.Ot=new ob;this.ul=new H;this.Pt=new H;this.Xv=Qh;a&&Object.assign(this,a)}jh.prototype.suspend=function(){this.Sk=!0};jh.prototype.advanceTo=function(a,b){b&&(this.Sk=!1);this.bo&&a>=this.yd&&(this.Rk=!0,a-=this.yd);this.$v=a;Ih(this,!0);sh(this.Td);yf(this.H);uh(this.Td);this.H.redraw()}; function ph(a,b){a.Ot.clear();a.Rk=!1;a.Wt=0;a.yd=NaN;0a.Zm?a.yd:d-a.Hd;b&&(e=a.$v,ea.Zm&&(a.bo&&!a.Rk?(a.Hd=+new Date,a.Zm=a.Hd+a.yd,a.Rk=!0):a.Hl(!1))}}} function th(a,b){for(var c=a.yd,d=a.sc.iterator,e=a.Rk;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=Oh,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:nodeCollapse"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.Fp,b,c,a)}}}t.stop=function(){if(!this.Zb)return this;this.Hl(!0);return this}; t.Hl=function(a){null!==this.qu&&this.qu.eo.remove(this.Gw);if(this.Zb){var b=this.H,c=this.Td;this.Sk=this.Zb=c.Jk=!1;sh(c);for(var d=this.sc,e=this.ul.iterator;e.next();)b.remove(e.value);for(e=this.Pt.iterator;e.next();)e.value.v();e=this.bo;d=d.iterator;for(var f=Oh;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.Eu,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Bu||"position:nodeCollapse"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]: h.Bu?k[n]:l[n],this.Fp,this.yd,this.yd,this)}h.Bu&&void 0!==m.location&&g instanceof U&&(g.location=m.location);h.iv&&g instanceof U&&g.Vb(!1)}b.ts.clear();Xe(b,!1);b.Xa();b.N();yf(b,!0);if(c.defaultAnimation===this){for(n=c.kl.iterator;n.next();)e=n.value,null!==e.nf&&(e.points=e.nf,e.nf=null);c.kl.clear()}yf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.Xv);uh(c);this.Wt++;!a&&this.Yt>this.Wt?(this.Rk=!1,this.start()):(this.$m&&this.$m(this),ph(this,null),c.Hl(this),b.Wb())}}; t.Aj=function(a,b){var c=b.actualBounds,d=null;b instanceof pf&&(d=b.placeholder);null!==d?(c=d.ja(sc),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new I(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof pf)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Aj(d,b)}; t.yj=function(a,b){if(a.isVisible()){var c=null;b instanceof pf&&(c=b.placeholder);if(null!==c){var d=c.ja(sc);c=c.padding;d.x+=c.left;d.y+=c.top;this.add(a,"position:placeholder",a.position,d,!0)}else this.add(a,"position:nodeCollapse",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);d=this.sc;d.contains(a)&&(d.I(a).iv=!0);if(a instanceof pf)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.yj(d,b)}};t.wz=function(a){var b=this.Ot.get(a);null===b&&(b={},this.Ot.add(a,b));return b}; ma.Object.defineProperties(jh.prototype,{duration:{get:function(){return this.zg},set:function(a){1>a&&xa(a,">= 1",jh,"duration");this.zg=a}},reversible:{get:function(){return this.bo},set:function(a){this.bo=a}},runCount:{get:function(){return this.Yt},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function Rh(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}jh.className="Animation";jh.EaseLinear=function(a,b,c,d){return c*a/d+b};jh.EaseInOutQuad=Ph;jh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};jh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};jh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};jh.EaseOutExpo=Rh; function Xh(a,b,c){this.start=a;this.end=b;this.Eu={};this.Bu=c;this.iv=!1}Xh.className="AnimationState";function Yh(a,b,c){this.rd=null;this.mf=a;this.oo=c||Zh;this.pk=null;void 0!==b&&(this.pk=b,void 0===c&&(this.oo=$h))}Yh.prototype.copy=function(){var a=new Yh(this.mf);a.oo=this.oo;var b=this.pk;if(null!==b){var c={};void 0!==b.duration&&(c.duration=b.duration);void 0!==b.finished&&(c.finished=b.finished);void 0!==b.easing&&(c.easing=b.easing);a.pk=c}return a}; function ai(a,b){a=a.pk;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))}ma.Object.defineProperties(Yh.prototype,{propertyName:{get:function(){return this.mf},set:function(a){this.mf=a}},animationSettings:{get:function(){return this.pk},set:function(a){this.pk=a}},startCondition:{get:function(){return this.oo},set:function(a){this.oo=a}}}); var Zh=new D(Yh,"Default",1),$h=new D(Yh,"Immediate",2),bi=new D(Yh,"Bundled",3);Yh.className="AnimationTrigger";Yh.Default=Zh;Yh.Immediate=$h;Yh.Bundled=bi;function ci(a){Qa(this);this.H=null;this.Oa=new F;this.wa="";this.qb=1;this.m=!1;this.j=this.Qh=this.u=this.Li=this.Ki=this.Ji=this.Ii=this.Gi=this.Hi=this.Fi=this.Ni=this.Ei=this.Mi=this.Di=this.Ci=!0;this.Sq=[];a&&Object.assign(this,a)}t=ci.prototype; t.clear=function(){for(var a=this.Oa,b=0;b=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Oa.iterator;h.next();){var k=h.value;k instanceof pf?e++:k instanceof V?d++:k instanceof T?f++:k instanceof te?g++:c++}h="";0c.Hq||h.height*e>c.Hq?b.cc(a,c):(e=b.actualBounds,f=b.naturalBounds,0===e.width|| 0===e.height||isNaN(e.x)||isNaN(e.y)||!b.isVisible()||(c=b.transform,null!==b.areaBackground&&(hi(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(hi(b,a,"rgba(0,0,0,0.3)",!0,!1,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null!==b.background&&(a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),hi(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.ps()||(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))))));d&&(a.restore(),a.Qc(!0))}};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.cb(ce,a,this,b,c,d,e)};t.li=function(a,b,c){var d=this.Oa;di(b,this);if(a>=d.count)a=d.count;else if(d.L(a)===b)return-1;d.Eb(a,b);b.Po(c);d=this.diagram;null!==d&&(c?d.N():d.li(b));ii(this,a,b);return a}; t.mc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.mc(a,b,c);var d=this.Oa;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.Qo(c);d.nb(a);d=this.diagram;null!==d&&(c?d.N():d.mc(b));di(b,null);return a}; function ii(a,b,c){b=ji(a,b,c);if(c instanceof pf&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Oa.s,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.nb(b);a.Eb(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.nb(b);a.Eb(h,c);return h}for(k=NaN;++h< e&&(k=a.L(h).zOrder,isNaN(k)););}return b} ma.Object.defineProperties(ci.prototype,{parts:{get:function(){return this.Oa.iterator}},partsBackwards:{get:function(){return this.Oa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.wa},set:function(a){var b=this.wa;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&C("Cannot rename default Layer to: "+a),c=c.layers;c.next();)c.value.name=== a&&C("Layer.name is already present in this diagram: "+a);this.wa=a;this.g("name",b,a);for(a=this.Oa.iterator;a.next();)a.value.layerName=this.wa}}},opacity:{get:function(){return this.qb},set:function(a){var b=this.qb;b!==a&&((0>a||1=a)return b;for(var c=this.Wa.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b}; function ti(a,b){if(Ng){void 0!==b&&null!==b||C("Diagram setup requires an argument DIV.");null!==a.Ka&&C("Diagram has already completed setup.");"string"===typeof b?a.Ka=x.document.getElementById(b):b instanceof HTMLDivElement?a.Ka=b:C("No DIV or DIV id supplied: "+b);null===a.Ka&&C("Invalid DIV id; could not get element with id: "+b);void 0!==a.Ka.H&&C("Invalid div id; div already has a Diagram associated with it.");if(!a.jl&&x.ResizeObserver){var c=sa(function(){a.Wb()},250);a.jl=new x.ResizeObserver(function(){c()}); a.jl.observe(a.Ka)}"static"===x.getComputedStyle(a.Ka,null).position&&(a.Ka.style.position="relative");b=5;var d="rgba(2"+b+"5, 255, 255, 0)";b--;a.Ka.style["-webkit-tap-highlight-color"]=d;a.Ka.innerHTML="";a.Ka.H=a;a.Ka.goDiagram=a;a.Ka.go=x.go;var e=new Ni(a);void 0!==e.style&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px","rtl"===x.getComputedStyle(a.Ka,null).getPropertyValue("direction")&&(a.pn=!0),e.style.zIndex="2",e.style.userSelect="none",e.style.MozUserSelect="none",e.style.touchAction= "none");a.xa=e;a.jb=e.context;d=a.jb;a.Pb=a.computePixelRatio();a.viewSize.w()||(a.Ca=a.Ka.clientWidth||1,a.Ba=a.Ka.clientHeight||1);Oi(a,a.Ca,a.Ba);a.Ka.insertBefore(e.La,a.Ka.firstChild);e=new Ni(null);e.width=1;e.height=1;a.cw=e;a.ky=e.context;if(Ng){e=ua("div");var f=ua("div");e.style.position="absolute";e.style.overflow="auto";e.style.width=a.Ca+"px";e.style.height=a.Ba+"px";e.style.zIndex="1";f.style.position="absolute";f.style.width="1px";f.style.height="1px";a.Ka.appendChild(e);e.appendChild(f); e.onscroll=Pi;e.addEventListener("pointerdown",Qi);e.H=a;e.py=!0;e.qy=!0;a.fu=e;a.cu=f}a.Xl=sa(function(){a.Vh=null;a.N()},300);a.Hv=sa(function(){rh(a)},250);a.preventDefault=function(a){a.preventDefault();return!1};a.Xj=function(b){if(a.isEnabled){var c=Ri(a,b,!0);c.bubbles=!0;var d=0,e=0;c.delta=0;void 0!==b.deltaX?(0!==b.deltaX&&(d=0Math.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=0c||Math.abs(e.y-b.screenY)>c)?a.rq++:a.rq=1;d.clickCount=a.rq;a.mw=b.timeStamp;a.nw.og(b.screenX,b.screenY);a.doMouseDown(); 1===b.button?b.preventDefault():Si(d,b)}};a.$j=function(b){if(a.isEnabled){a.Qk=!0;var c=a.mj;if(null===c[0]||c[0].pointerId!==b.pointerId&&c[0].pointerType===b.pointerType){if(null!==c[1]&&c[1].pointerId===b.pointerId){c[1]=b;return}if(null===c[0])c[0]=b;else return}else c[0]=b;if(c[0].pointerId===b.pointerId){c=Ti(a,b,!1,!1,!1,null!==c[1]);var d=x.document.elementFromPoint(b.clientX,b.clientY)||null;null!==d&&void 0!==d.shadowRoot&&null!==d.shadowRoot&&(d=d.shadowRoot.elementFromPoint(b.clientX, b.clientY));var e=a,f=b;d&&d.H&&(f=b,e=d.H);c.targetDiagram=e;Ui(a,f,c);c.targetObject=null;a.doMouseMove();Si(c,b)}}};a.bk=function(b){if(a.isEnabled){a.Qk=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.Tt;if(c&&a.lu)delete d[b.pointerId],b.preventDefault();else if(d=a.mj,null===d[0]||d[0].pointerId!==b.pointerId&&d[0].pointerType===b.pointerType)null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null);else{d[0]=null;d=Ti(a,b,!1,!0,!0,!1);var e=x.document.elementFromPoint(b.clientX,b.clientY)|| null;null!==e&&void 0!==e.shadowRoot&&null!==e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(b.clientX,b.clientY));null!==e&&e.H instanceof Q&&e.H!==a&&Ui(e.H,b,d);null===e&&(e=b.target);Ui(a,b,d);d.clickCount=a.rq;d.targetDiagram=Vi(b,e);d.targetObject=null;a.doMouseUp();Si(d,b);c&&(a.pq=!1)}}};a.ak=function(b){if(a.isEnabled){a.Qk=!1;var c=a.Tt;c[b.pointerId]&&delete c[b.pointerId];c=a.mj;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())}};a.Zj=function(b){var c=a.mj;null!==c[0]&&c[0].pointerId===b.pointerId?(c[0]=null,a.pq=!1):null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null)};a.gt=d.Z["d"+Wi[1]+Wi[2]+"wI"+Xi.slice(1,5)]["b"+Yi.slice(1,b)](d.Z,Zi,b,b);d.Qc(!0);$i(a);"svg"===a.il&&(b=a.nj.get("svg"),a.Ka.appendChild(b.La),a.jb=b.context)}} Q.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})};Q.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})}; function $i(a){var b=a.xa.La;b instanceof HTMLCanvasElement||(b=a.div);a.addEventListener(b,"pointerdown",a.ri,!1);a.addEventListener(b,"pointermove",a.$j,!1);a.addEventListener(b,"pointerup",a.bk,!1);a.addEventListener(b,"pointerout",a.ak,!1);a.addEventListener(b,"pointercancel",a.Zj,!1);a.addEventListener(b,"pointerenter",a.Uy,!1);a.addEventListener(b,"pointerleave",a.Vy,!1);a.addEventListener(b,"wheel",a.Xj,!1);a.addEventListener(b,"keydown",a.Hz,!1);a.addEventListener(b,"keyup",a.Iz,!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(x,"resize",a.Hv,!1)}function Fe(a){30q&&(this.position=w.h(-(b.scrollWidth-this.Ca)+v-this.Ca/e+m,this.position.y))),a.qy&&this.allowVerticalScroll&&(hu&&(this.position= w.h(this.position.x,-(b.scrollHeight-this.Ba)+a.scrollTop-this.Ba/e+f))),I.free(w),this.pd=!0,this.Ae=this.hr=!1,d=this.documentBounds,e=this.viewportBounds,m=d.right,q=e.right,f=d.bottom,u=e.bottom,g=d.x,n=e.x,h=d.y,d=e.y,p>=k&&g>=n&&m<=q&&(c.style.width="1px"),r>=l&&h>=d&&f<=u&&(c.style.height="1px"))}};Q.prototype.computeBounds=function(a){void 0===a&&(a=new N);lh(this);return cj(this,a)}; function cj(a,b){if(a.fixedBounds.w())return b.assign(a.fixedBounds),b.yo(a.yb),b;for(var c=!0,d=a.Wa.s,e=d.length,f=0;fc&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===hj?(b=k>h?(g-a.Db)/d:(f-a.Db)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} Q.prototype.zoomToFit=function(){var a=this.qj;this.qj=Qh;this.scale=ej(this,gj);a!==Qh&&(dj(this,!1),fj(this,this.documentBounds,this.Ca/this.Aa,this.Ba/this.Aa,this.uk,!1));this.qj=a};t=Q.prototype; t.rA=function(a,b){void 0===b&&(b=gj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===gj||b===hj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Ca;var f=this.Ba;e=b===hj?f/d>e/c?(f-(this.xe?this.Db:0))/d:(e-(this.cf?this.Db:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new I(a.x,a.y)}}; t.Cy=function(a,b){this.Va();var c=this.documentBounds,d=this.viewportBounds;this.position=new I(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.qz=function(a){if(a instanceof Y){this.Xp=a;var b=I.alloc();this.Yp=this.ip(a.ja(sc,b));I.free(b)}else this.Xp=null,this.Yp=tb}; function fj(a,b,c,d,e,f){var g=I.allocAt(a.pa.x,a.pa.y),h=g.x,k=g.y;if(null!==a.Xp){var l=I.alloc();l=a.Xp.ja(sc,l);h=l.x-a.Yp.x/a.scale;k=l.y-a.Yp.y/a.scale;e=rc;I.free(l)}if(f||a.scrollMode===Qh)e.tb()&&(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.pj,f=c-b.width,cb.left?h=b.left:hb.top?k=b.top:kb;b++){var c=a.ze.iterator;if(null===c||0===a.ze.count)break;a.ze=new H;a.Gv(c,a.ze)}a.nodes.each(function(a){a instanceof pf&&0!==(a.U&65536)!==!1&&(a.U=a.U^65536)})}} t.Gv=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Uc()||c instanceof pf||(c.oi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof pf&&c.isVisible()&&rj(this,c);for(a.reset();a.next();)c=a.value,c instanceof T&&c.isVisible()&&(c.oi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof te&&c.isVisible()&&(c.oi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function rj(a,b){for(var c=Ea(),d=Ea(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof pf?(sj(f)||tj(f)||uj(f))&&rj(a,f):f instanceof T?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;en&&(z=M.left, y=M.right),v.height>E&&(A=M.top,B=M.bottom)):(z=M.left,y=M.right,A=M.top,B=M.bottom);var R=v.width+z+y,S=v.height+A+B;M=a.scale;var J=R>u/M,G=S>w/M;if(!(p||a.cf||a.xe||J||G))return!0;z=v.x-z;u=e.x;y=v.right+y;w=e.right+r;A=v.y-A;var ca=e.y;v=v.bottom+B;e=e.bottom+q;var X="1px";B="1px";a.scrollMode===Qh&&(J||G)&&(J&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(J=1,z+1w+1&&(J=Math.max((y-w)*M+a.Ca,J)),n+r+1e+1&&(J=Math.max((v-e)*M+a.Ba,J)),E+q+1w+1&&(r=Math.max((y-w)*M+a.Ca,r)),n+1e+1&&(q=Math.max((v-e)*M+r,q)),E+1w+1&&(b=a.position.x*M));if(a.pn)switch(a.Xt){case "negative":b=-(l.scrollWidth-b-l.clientWidth);break;case "reverse":b=l.scrollWidth-b-l.clientWidth}l.scrollLeft=b;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(E+1e+1&&(l.scrollTop=a.position.y*M));u=a.Ca;w=a.Ba;l.style.width=u+(a.cf?a.Db:0)+"px";l.style.height=w+(a.xe?a.Db:0)+"px";return c!==u||d!==w||a.animationManager.zb?(c=N.allocAt(f,g,h,k),a.onViewportBoundsChanged(c,a.viewportBounds,M,p),N.free(c),!1):!0}t=Q.prototype; t.add=function(a){var b=a.diagram;if(b!==this&&(null!==b&&C("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.Oj(a.layerName),null===b&&(b=this.Oj("")),null===b&&C('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.li(99999999,a,a.diagram===this);0<=c&&this.cb(ee,"parts",b,null,a,null,c);b.isTemporary||this.Xa();a.D(1);c=a.layerChanged;null!==c&&c(a,null,b)}}; t.li=function(a){this.partManager.li(a);var b=this;Gj(a,function(a){Hj(b,a)});(a instanceof te||a instanceof pf&&null!==a.placeholder)&&a.v();null!==a.data&&Gj(a,function(a){Ij(b.partManager,a)});!0!==tj(a)&&!0!==uj(a)||this.ze.add(a);Jj(a,!0,this);Kj(a)?(a.actualBounds.w()&&this.N(Fj(a,a.actualBounds)),this.Xa()):a.isVisible()&&a.actualBounds.w()&&this.N(Fj(a,a.actualBounds));this.Wb()}; t.mc=function(a){a.Cj();this.partManager.mc(a);var b=this;null!==a.data&&Gj(a,function(a){Lj(b.partManager,a,b)});this.ze.remove(a);Kj(a)?(a.actualBounds.w()&&this.N(Fj(a,a.actualBounds)),this.Xa()):a.isVisible()&&a.actualBounds.w()&&this.N(Fj(a,a.actualBounds));this.Wb()};t.remove=function(a){Mj(this,a,!0)}; function Mj(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.D(2),c&&b.Jj(),c=d.mc(-1,b,!1),0<=c&&a.cb(fe,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.Bs=function(a,b){void 0===b&&(b=!1);if(Aa(a))for(var c=a.length,d=0;dd&&this.Xa();return this}; t.xy=function(a,b){Sj(this,a,b);a.Te(this);var c=this.Wa,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.$b&&this.cb(fe,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.Xa();return this}; t.aA=function(a){a.diagram!==this&&C("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.Wa,c=b.indexOf(a);if(b.remove(a)){for(b=a.Oa.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.$b&&this.cb(fe,"layers",this,a,null,c,null);this.N();this.Xa()}}};t.Oj=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.Rw=function(a){null===this.kf&&(this.kf=new F);this.kf.add(a);this.model.Xg(a);return this};t.cA=function(a){null!==this.kf&&(this.kf.remove(a),0===this.kf.count&&(this.kf=null));this.model.dk(a)};t.Xg=function(a){null===this.vg&&(this.vg=new F);this.vg.add(a);return this};t.dk=function(a){null!==this.vg&&(this.vg.remove(a),0===this.vg.count&&(this.vg=null))}; t.Vr=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Pu(a);a.change!==de&&(this.isModified=!0);if(null!==this.vg)for(var b=this.vg,c=b.length,d=0;dn.Oa.indexOf(r)&&n.li(p,r,q):(r.isSelected=!1,r.isHighlighted=!1,r.Sb(),n.mc(q?p:-1,r,q)))}else n instanceof Q?"number"===typeof p&&r instanceof ci&&(b?(r.Te(this),this.Wa.Eb(p,r)):this.Wa.nb(p)):C("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else d!==de&&C("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings= c}}};Q.prototype.Ea=function(a){return this.undoManager.Ea(a)};Q.prototype.eb=function(a){return this.undoManager.eb(a)};Q.prototype.Hf=function(){return this.undoManager.Hf()};Q.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ea(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.eb(b):this.undoManager.Hf(),this.skipsUndoManager=c}};Q.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)}; Q.prototype.lp=function(){this.partManager.lp()}; function Xj(a,b,c){var d=a.animationManager;if(a.vb||a.cd)a.Aa=c,Li(a),a.N(),a.Ae=!0,d.zb&&(vh(d)||d.Zd.add(d.H,"scale",b,a.Aa));else if(null===a.xa)a.Aa=c,Li(a);else{a.vb=!0;var e=a.viewportBounds.copy(),f=a.Ca,g=a.Ba,h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.Vc()?l.Ef(Dc)?h=0:l.Ef(Ec)&&(h=f-1):h=l.tb()?l.x*(f-1):f/2);isNaN(k)&&(l.Vc()?l.Ef(Cc)?k=0:l.Ef(Fc)&&(k=g-1):k=l.tb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.defaultAnimation.isAnimating||(c=a.scaleComputation(a, c));ca.maxScale&&(c=a.maxScale);f=I.allocAt(a.pa.x+h/b-h/c,a.pa.y+k/b-k/c);a.position=f;I.free(f);a.Aa=c;Li(a);a.vb=!1;a.onViewportBoundsChanged(e,a.viewportBounds,b,!1);dj(a,!1);d.zb&&(vh(d)||d.Zd.add(d.H,"scale",b,a.Aa))}} Q.prototype.onViewportBoundsChanged=function(a,b,c,d){if(!a.C(b)){void 0===d&&(d=!1);d||(this.Ae=!0);this.pd=!0;var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==qh||a.width===b.width&&a.height===b.height||e.D();e=this.currentTool;!0===this.Qk&&e instanceof La&&(this.lastInput.documentPoint=this.Is(this.lastInput.viewPoint),xe(e,this));this.vb||this.invalidateViewport(a,b);oj(this);this.jd.scale=c;this.jd.position.x=a.x;this.jd.position.y=a.y;this.jd.bounds.assign(a);this.jd.Ww.width= Math.round(a.width*c);this.jd.Ww.height=Math.round(a.height*c);this.jd.Hx.width=this.Ca;this.jd.Hx.height=this.Ba;this.jd.Ax=d;this.R("ViewportBoundsChanged",this.jd,a);this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Tc(b)&&a.bb()})}}; function oj(a,b){var c=a.be;if(null!==c&&c.visible){for(var d=L.alloc(),e=1,f=1,g=c.P.s,h=g.length,k=0;km||(Yj(l.figure)?f=f*m/K.ox(f,m):e=e*m/K.ox(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(void 0!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=N.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.w()){N.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;N.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=I.alloc();K.Jo(a,g,0,0,d.width,d.height, b);b.offset(-d.width,-d.height);L.free(d);c.part.location=b;I.free(b)}}Q.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.R("ChangingSelection",b);for(var c=b.Fa(),d=c.length,e=0;e=d&&!f.defaultAnimation.isAnimating&&!f.zb&&(b||kh(f,"Layout"));a.sh=!1;for(var g=a.Yh.iterator;g.next();)gk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),lh(a),e.isValidLayout=!0):a.sh=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.eb("Layout"),a.undoManager.isInternalTransaction= !1),!b||0!==d&&1!==d||mh(f),a.aa=c}}}function gk(a,b,c,d){if(null!==b){for(var e=b.bl.iterator;e.next();)gk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.mh=!b.location.w(),e.doLayout(b),b.D(32),rj(a,b),e.isValidLayout=!0):a.sh=!0)}}t.pz=function(){for(var a=new F,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.fh()&&a.add(c)}return a.iterator}; function vi(a){function b(a){var b=a.toLowerCase(),e=new F;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new ob,d=new ob;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.bw=c;a.aw=d} function Cj(a,b){var c=a.aw.I(b);return null!==c?c:a.aw.I(b.toLowerCase())}function hk(a,b){var c=a.bw.I(b);if(null!==c)return c;c=a.bw.I(b.toLowerCase());if(null!==c)return c;C("Unknown DiagramEvent name: "+b)}t.zj=function(a,b){a=hk(this,a);null!==a&&a.add(b);return this};t.Yl=function(a,b){a=hk(this,a);null!==a&&a.remove(b)}; t.R=function(a,b,c){var d=hk(this,a),e=new ae;e.diagram=this;a=Cj(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.Fa(),c=0;c=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=N.allocAt(0,0,d.width*e,d.height*e);var f=I.allocAt(0,0);if(a.x>=d.x&&a.xd.x+d.width-c.right&&this.allowHorizontalScroll&&(g=Math.max(this.scrollHorizontalLineChange, 1),g|=0,f.x+=g,a.x>d.x+d.width-c.right/2&&(f.x+=g),a.x>d.x+d.width-c.right/4&&(f.x+=4*g));a.y>=d.y&&a.yd.y+d.height-c.bottom&&this.allowVerticalScroll&&(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y+=g,a.y>d.y+d.height-c.bottom/2&&(f.y+=g),a.y>d.y+d.height-c.bottom/4&&(f.y+=4*g));f.ab(pb)||(b=new I(b.x+f.x/e,b.y+f.y/e)); N.free(d);I.free(f);return b};t=Q.prototype;t.vs=function(){return null};t.Xu=function(){return null};t.Tr=function(a,b){this.nj.add(a,b)};t.zu=function(a){(this.Iw=a)||this.nodes.each(function(a){a instanceof pf&&(a.Tp=null)})}; function Dk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].Wk){f=!1;break}f||a-l>k?b(c,e,h):x.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Jg.iterator;g.next();)if(!g.value[0].Wk){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.Nz=function(a){if(!Ng)return null;void 0===a&&(a={});a.returnType="Image";return this.Ex(a)}; t.Ex=function(a){void 0===a&&(a={});return Dk(this,this.Oz,a)}; t.Oz=function(a,b,c){var d=Ek(c,a,"canvas",null);if(null===d)return null;c=d.Z.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case Xi+"data":e=d.getImageData(0,0,c.width,c.height);break;case Xi:d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!==typeof b&&C('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";b(null);return null;default:e=c.toDataURL(a.type,a.details)}return"function"===typeof b?(b(e),null):e}; function Ek(a,b,c,d){a.animationManager.zc();a.Wc();if(null===a.xa)return null;"object"!==typeof b&&C("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 L(Infinity,Infinity):new L(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 hc(l):l instanceof hc||C("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.jb.Qc(!0);n=new Ni(null,p,void 0,!0);var u=n.context;if(!(e||f||k||h)){n.width=a.Ca+Math.ceil(l.left+l.right);n.height=a.Ba+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.$r=r;zj(a,d.context,l,new L(n.width,n.height),a.Aa,a.pa,k,m,q,b);return d.context}a.Um=!1;zj(a,u,l,new L(n.width,n.height),a.Aa,a.pa,k,m,q,b);a.Um=!0;return n.context}var w=a.Jp,v=a.documentBounds.copy();v.yv(a.yb);if(q)for(var z=a.Wa.s,y=z.length,A=0;Aw?(f=w,e=v.width,v=v.height):(e=g.width,v=g.height)):(e=v.width*f,v=v.height*f):(f=w,e=v.width,v=v.height);null!==l?(e+=h,v+=y):l=new hc(0);null!==g&&(w=g.width,g=g.height,isNaN(w)&&(w=2E3),isNaN(g)&&(g=2E3),isFinite(w)&& (e=Math.min(e,w)),isFinite(g)&&(v=Math.min(v,g)));n.width=Math.ceil(e);n.height=Math.ceil(v);if("SVG"===c){if(null===d)return null;d.resize(n.width,n.height,n.width,n.height);d.ownerDocument=p;d.$r=r;zj(a,d.context,l,new L(Math.ceil(e),Math.ceil(v)),f,z,k,m,q,b);return d.context}a.Um=!1;zj(a,u,l,new L(Math.ceil(e),Math.ceil(v)),f,z,k,m,q,b);a.Um=!0;return n.context} ma.Object.defineProperties(Q.prototype,{renderer:{get:function(){return this.il},set:function(a){this instanceof Fk||(a=a.toLowerCase(),a!==this.il&&(this.il=a,"default"===a?(a=this.nj.get("svg"),null!==a&&a.La.remove(),this.xa&&(this.jb=this.xa.context)):"svg"===a?(this.nj.contains("svg")?a=this.nj.get("svg"):(a=new Ej(this,x.document),this.Tr("svg",a),null!==this.div&&this.div.appendChild(a.La)),this.jb=a.context,this.xa&&(this.xa.context.setTransform(this.Pb,0,0,this.Pb, 0,0),this.xa.context.clearRect(0,0,this.Ca,this.Ba))):"debug"!==a||this.nj.contains("SVG")||(a=new Ej(this,x.document),this.Tr("SVG",a),a.La.style.backgroundColor="whitesmoke",null!==this.div&&this.div.after(a.La)),this.Xl()))}},div:{get:function(){return this.Ka},set:function(a){if(this.Ka!==a){var b=this.Ka;null!==b?(b.H=void 0,b.goDiagram=void 0,b.go=void 0,b.innerHTML="",null!==this.xa&&(b=this.xa.La,this.removeEventListener(b,"pointermove",this.$j,!1),this.removeEventListener(b, "pointerdown",this.ri,!1),this.removeEventListener(b,"pointerup",this.bk,!1),this.removeEventListener(b,"pointerout",this.ak,!1),this.removeEventListener(b,"pointercancel",this.Zj,!1),this.xa.gx()),this.jl&&(this.jl.disconnect(),this.jl=null),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.xa=null, this.removeEventListener(x,"resize",this.Hv,!1),this.removeEventListener(x,"wheel",this.Xj,!0),ke===this&&(ke=null)):null===this.ri&&(this.df=!1);this.Ka=null;if(null!==a){if(b=a.H)b.div=null;ti(this,a);this.redraw()}}}},Tw:{get:function(){return this.Lq}},mi:{get:function(){return this.df}},draggedLink:{get:function(){return this.ft},set:function(a){this.ft!==a&&(this.ft=a,null!==a&&(this.Qt=a.fromPort,this.Rt= a.toPort))}},Ix:{get:function(){return this.Qt},set:function(a){this.Qt=a}},Jx:{get:function(){return this.Rt},set:function(a){this.Rt=a}},animationManager:{get:function(){return this.Td}},undoManager:{get:function(){return this.$b.undoManager}},skipsUndoManager:{get:function(){return this.Qg},set:function(a){this.Qg=a;this.$b.skipsUndoManager=a}},delaysLayout:{ get:function(){return this.dt},set:function(a){this.dt=a}},opacity:{get:function(){return this.qb},set:function(a){var b=this.qb;b!==a&&((0>a||1a&&xa(a,">= 0",Q,"scrollHorizontalLineChange"),this.du= a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{get:function(){return this.hu},set:function(a){var b=this.hu;b!==a&&(0>a&&xa(a,">= 0",Q,"scrollVerticalLineChange"),this.hu=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{get:function(){return this.$i},set:function(a){this.$i=a}},previousInput:{get:function(){return this.Lg},set:function(a){this.Lg=a}},firstInput:{ get:function(){return this.Vp},set:function(a){this.Vp=a}},currentCursor:{get:function(){return this.at},set:function(a){""===a&&(a=this.Ip);if(this.at!==a){var b=this.xa,c=this.Ka;if(null!==b&&null!==c){this.at=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.Ip},set:function(a){""===a&&(a="auto");var b=this.Ip;b!==a&&(this.Ip=a,this.g("defaultCursor",b,a))}},click:{get:function(){return this.uh},set:function(a){var b=this.uh;b!==a&&(this.uh=a,this.g("click",b,a))}},doubleClick:{get:function(){return this.Ah},set:function(a){var b=this.Ah;b!==a&&(this.Ah=a,this.g("doubleClick",b,a))}},contextClick:{ get:function(){return this.wh},set:function(a){var b=this.wh;b!==a&&(this.wh=a,this.g("contextClick",b,a))}},mouseOver:{get:function(){return this.Mh},set:function(a){var b=this.Mh;b!==a&&(this.Mh=a,this.g("mouseOver",b,a))}},mouseHover:{get:function(){return this.Kh},set:function(a){var b=this.Kh;b!==a&&(this.Kh=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return this.Jh},set:function(a){var b= this.Jh;b!==a&&(this.Jh=a,this.g("mouseHold",b,a))}},mouseDragOver:{get:function(){return this.Lt},set:function(a){var b=this.Lt;b!==a&&(this.Lt=a,this.g("mouseDragOver",b,a))}},mouseDrop:{get:function(){return this.Hh},set:function(a){var b=this.Hh;b!==a&&(this.Hh=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.qt},set:function(a){var b=this.qt;b!==a&&(this.qt=a,this.g("handlesDragDropForTopLevelParts", b,a))}},mouseEnter:{get:function(){return this.Ih},set:function(a){var b=this.Ih;b!==a&&(this.Ih=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return this.Lh},set:function(a){var b=this.Lh;b!==a&&(this.Lh=a,this.g("mouseLeave",b,a))}},toolTip:{get:function(){return this.Xh},set:function(a){var b=this.Xh;b!==a&&(this.Xh=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return this.xh}, set:function(a){var b=this.xh;b!==a&&(this.xh=a,this.g("contextMenu",b,a))}},commandHandler:{get:function(){return this.ob},set:function(a){this.ob!==a&&(this.ob=a,a.Te(this))}},toolManager:{get:function(){return this.pe},set:function(a){this.pe!==a&&(this.pe=a,a.diagram=this)}},defaultTool:{get:function(){return this.pb},set:function(a){var b=this.pb;b!==a&&(this.pb=a,a.diagram=this,this.currentTool===b&&(this.currentTool= a))}},currentTool:{get:function(){return this.hb},set:function(a){var b=this.hb;b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(this.hb=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.Aw}},maxSelectionCount:{get:function(){return this.Gt},set:function(a){var b=this.Gt;if(b!==a)if(0<=a&&!isNaN(a)){if(this.Gt=a,this.g("maxSelectionCount", b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0= 0",Q,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.Nt},set:function(a){var b=this.Nt;b!==a&&(this.Nt=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{ get:function(){return this.pt},set:function(a){var b=this.pt;b!==a&&(this.pt=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.Dt},set:function(a){var b=this.Dt;b!==a&&(this.Dt=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.nn&&this.ye!==a.historyIndex:this.nn},set:function(a){if(this.nn!==a){this.nn=a;var b=this.undoManager;!a&&b.isEnabled&&(this.ye=b.historyIndex);a||Zj(this)}}},model:{get:function(){return this.$b},set:function(a){var b=this.$b;if(b!==a){this.currentTool.doCancel();b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&C("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.zc(!0);var c=Ji(this,!0);this.df=!1;this.bn= !0;this.ye=-2;this.gg=!1;var d=this.vb;this.vb=!0;kh(this.animationManager,"Model");b&&(null!==this.kf&&this.kf.each(function(a){return b.dk(a)}),b.dk(this.Lc));this.$b=a;this.partManager=ak(this.$b.type);for(var e=0;ethis.scale&&(this.scale=a)):xa(a,"> 0",Q,"minScale"))}},maxScale:{get:function(){return this.Ft},set:function(a){var b=this.Ft;b!==a&&(0 0",Q,"maxScale"))}},zoomPoint:{get:function(){return this.uu},set:function(a){this.uu.C(a)||(this.uu=a=a.J())}},contentAlignment:{get:function(){return this.uk}, set:function(a){var b=this.uk;b.C(a)||(this.uk=a=a.J(),this.g("contentAlignment",b,a),dj(this,!1))}},initialContentAlignment:{get:function(){return this.iq},set:function(a){var b=this.iq;b.C(a)||(this.iq=a=a.J(),this.g("initialContentAlignment",b,a))}},padding:{get:function(){return this.yb},set:function(a){"number"===typeof a&&(a=new hc(a));var b=this.yb;b.C(a)||(this.yb=a=a.J(),this.Xa(),this.g("padding",b,a))}},partManager:{ get:function(){return this.Mc},set:function(a){var b=this.Mc;b!==a&&(null!==a.diagram&&C("Cannot share PartManagers between Diagrams: "+a.toString()),b&&b.Te(null),this.Mc=a,a.Te(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.Oc},set:function(a){var b=this.Oc;b!==a&&(this.Oc=a,a.diagram=this,a.group=null,this.sh=!0,this.g("layout",b,a),this.Wb())}},isTreePathToChildren:{get:function(){return this.At},set:function(a){var b=this.At;if(b!==a&&(this.At=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Gk(a.value)}},treeCollapsePolicy:{get:function(){return this.pu},set:function(a){var b= this.pu;b!==a&&(a!==wi&&a!==Hk&&a!==Ik&&C("Unknown Diagram.treeCollapsePolicy: "+a),this.pu=a,this.g("treeCollapsePolicy",b,a))}},Pe:{get:function(){return this.iw},set:function(a){this.iw=a}},avoidanceCellSize:{get:function(){return this.Uv},set:function(a){this.Th=null;this.Uv=new L(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{get:function(){return this.Vv},set:function(a){this.Vv=Math.max(1, a)}},autoScrollInterval:{get:function(){return this.op},set:function(a){var b=this.op;b!==a&&(this.op=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{get:function(){return this.qp},set:function(a){"number"===typeof a&&(a=new hc(a));var b=this.qp;b.C(a)||(this.qp=a=a.J(),this.Xa(),this.g("autoScrollRegion",b,a))}}}); ma.Object.defineProperties(Q,{licenseKey:{get:function(){return Jk.fc()},set:function(a){Jk.add(a.replace(/\s/g,""))}},version:{get:function(){return Kk}}});Q.prototype.makeImageData=Q.prototype.Ex;Q.prototype.makeImage=Q.prototype.Nz;Q.prototype.cacheGroupExternalLinks=Q.prototype.zu;Q.prototype.addRenderer=Q.prototype.Tr;Q.prototype.makeSVG=Q.prototype.Xu;Q.prototype.makeSvg=Q.prototype.vs;Q.prototype.stopAutoScroll=Q.prototype.qg; Q.prototype.doAutoScroll=Q.prototype.Zr;Q.prototype.isUnoccupied=Q.prototype.Vj;Q.prototype.raiseDiagramEvent=Q.prototype.R;Q.prototype.removeDiagramListener=Q.prototype.Yl;Q.prototype.addDiagramListener=Q.prototype.zj;Q.prototype.findTreeRoots=Q.prototype.pz;Q.prototype.layoutDiagram=Q.prototype.Lz;Q.prototype.findTopLevelGroups=Q.prototype.iz;Q.prototype.findTopLevelNodesAndLinks=Q.prototype.jz;Q.prototype.ensureBounds=Q.prototype.Va;Q.prototype.findLinksByExample=Q.prototype.ds; Q.prototype.findNodesByExample=Q.prototype.es;Q.prototype.findLinkForData=Q.prototype.Hc;Q.prototype.findNodeForData=Q.prototype.fi;Q.prototype.findPartForData=Q.prototype.Ic;Q.prototype.findLinkForKey=Q.prototype.findLinkForKey;Q.prototype.findNodeForKey=Q.prototype.Rb;Q.prototype.findPartForKey=Q.prototype.findPartForKey;Q.prototype.rebuildParts=Q.prototype.Rd;Q.prototype.transformViewToDoc=Q.prototype.Is;Q.prototype.transformRectDocToView=Q.prototype.pA;Q.prototype.transformDocToView=Q.prototype.ip; Q.prototype.centerRect=Q.prototype.Wr;Q.prototype.scrollToRect=Q.prototype.ov;Q.prototype.scroll=Q.prototype.scroll;Q.prototype.highlightCollection=Q.prototype.Bz;Q.prototype.highlight=Q.prototype.Az;Q.prototype.selectCollection=Q.prototype.hA;Q.prototype.select=Q.prototype.select;Q.prototype.updateAllRelationshipsFromData=Q.prototype.lp;Q.prototype.updateAllTargetBindings=Q.prototype.updateAllTargetBindings;Q.prototype.commit=Q.prototype.commit;Q.prototype.rollbackTransaction=Q.prototype.Hf; Q.prototype.commitTransaction=Q.prototype.eb;Q.prototype.startTransaction=Q.prototype.Ea;Q.prototype.raiseChanged=Q.prototype.g;Q.prototype.raiseChangedEvent=Q.prototype.cb;Q.prototype.removeChangedListener=Q.prototype.dk;Q.prototype.addChangedListener=Q.prototype.Xg;Q.prototype.removeModelChangedListener=Q.prototype.cA;Q.prototype.addModelChangedListener=Q.prototype.Rw;Q.prototype.findLayer=Q.prototype.Oj;Q.prototype.removeLayer=Q.prototype.aA;Q.prototype.addLayerAfter=Q.prototype.xy; Q.prototype.addLayerBefore=Q.prototype.Pw;Q.prototype.addLayer=Q.prototype.wl;Q.prototype.moveParts=Q.prototype.moveParts;Q.prototype.copyParts=Q.prototype.Ij;Q.prototype.removeParts=Q.prototype.Bs;Q.prototype.remove=Q.prototype.remove;Q.prototype.add=Q.prototype.add;Q.prototype.clearDelayedGeometries=Q.prototype.Xw;Q.prototype.setProperties=Q.prototype.km;Q.prototype.attach=Q.prototype.yu;Q.prototype.set=Q.prototype.set;Q.prototype.resetInputOptions=Q.prototype.Ox;Q.prototype.setInputOption=Q.prototype.iA; Q.prototype.getInputOption=Q.prototype.Ll;Q.prototype.resetRenderingHints=Q.prototype.Px;Q.prototype.setRenderingHint=Q.prototype.Tx;Q.prototype.getRenderingHint=Q.prototype.Df;Q.prototype.maybeUpdate=Q.prototype.Wc;Q.prototype.requestUpdate=Q.prototype.Wb;Q.prototype.delayInitialization=Q.prototype.Py;Q.prototype.isUpdateRequested=Q.prototype.Gz;Q.prototype.invalidateDocumentBounds=Q.prototype.Xa;Q.prototype.findObjectsNear=Q.prototype.kg;Q.prototype.findPartsNear=Q.prototype.ez; Q.prototype.findObjectsIn=Q.prototype.zf;Q.prototype.findPartsIn=Q.prototype.nx;Q.prototype.findObjectsAt=Q.prototype.gi;Q.prototype.findPartsAt=Q.prototype.dz;Q.prototype.findObjectAt=Q.prototype.ec;Q.prototype.findPartAt=Q.prototype.Jl;Q.prototype.focusObject=Q.prototype.qz;Q.prototype.alignDocument=Q.prototype.Cy;Q.prototype.zoomToRect=Q.prototype.rA;Q.prototype.zoomToFit=Q.prototype.zoomToFit;Q.prototype.diagramScroll=Q.prototype.ex;Q.prototype.focus=Q.prototype.focus; var mi=new ob,Mi=null,Ng=void 0!==x.document,Hi=null,Ii="",qh=new D(Q,"None",0),gj=new D(Q,"Uniform",1),hj=new D(Q,"UniformToFill",2),Df=new D(Q,"CycleAll",10),Hf=new D(Q,"CycleNotDirected",11),Qf=new D(Q,"CycleNotDirectedFast",12),Rf=new D(Q,"CycleNotUndirected",13),Ef=new D(Q,"CycleDestinationTree",14),Gf=new D(Q,"CycleSourceTree",15),Qh=new D(Q,"DocumentScroll",1),Sh=new D(Q,"InfiniteScroll",2),wi=new D(Q,"TreeParentCollapsed",21),Hk=new D(Q,"AllParentsCollapsed",22),Ik=new D(Q,"AnyParentsCollapsed", 23),Jk=new F,Kk="2.3.3",Xi="image",Zi=null,ki=!1; function li(){if(Ng){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Ma("7ca11abfd022028846");b[c]=Ma("398c3597c01238");for(var d=["5da73c80a36455d7038e4972187c3cae51fd22",ra.Dx+"4ae6247590da4bb21c324ba3a84e385776",ld.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",K.za],e=1;5>e;e++)b[Ma("7ca11abfd7330390")](Ma(d[e-1]),10,15*e);b[c]=Ma("39f046ebb36e4b");for(c=1;5>c;c++)b[Ma("7ca11abfd7330390")](Ma(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])ld.prototype.Ld=ld.prototype.Uw; Zi=a}}Q.className="Diagram";Q.fromDiv=function(a){var b=a;"string"===typeof a&&(b=x.document.getElementById(a));return b instanceof HTMLDivElement&&b.H instanceof Q?b.H:null};Q.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};Q.useDOM=function(a){Ng=a?void 0!==x.document:!1};Q.isUsingDOM=function(){return Ng};Q.None=qh;Q.Uniform=gj; Q.UniformToFill=hj;Q.CycleAll=Df;Q.CycleNotDirected=Hf;Q.CycleNotDirectedFast=Qf;Q.CycleNotUndirected=Rf;Q.CycleDestinationTree=Ef;Q.CycleSourceTree=Gf;Q.DocumentScroll=Qh;Q.InfiniteScroll=Sh;Q.TreeParentCollapsed=wi;Q.AllParentsCollapsed=Hk;Q.AnyParentsCollapsed=Ik;function si(){this.sy=null;this.j="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.nd=this.j=!0:this.nd=null} function yj(a,b){b.jb.setTransform(b.Pb,0,0,b.Pb,0,0);b.jb.vc();if(null===a.nd)a:{b="f";var c=x[Ma("76a715b2f73f148a")][Ma("72ba13b5")];a.nd=!0;if(Ng){var d=Q[Ma("76a115b6ed251eaf4692")];if(d)for(var e=Jk.iterator;e.next();){d=e.value;d=Ma(d).split(Ma("39e9"));if(6>d.length)break;var f=Ma(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Ma(ra[Ma("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){var h=x[Ma("74a900bae4370f8b51")][Ma("6fbb13a1c2311e8a57")].toLowerCase();g=h[Ma("73a612b6fb191d")](Ma("3aad1ab6e022098b4dc4")); f=Ma(d[2]);if(-1g&&f!==Ma("7da71ca0ad381e90")&&(g=b[Ma("73a612b6fb191d")](Ma("76a715b2ef3e149757")));0>g&&(g=b[Ma("73a612b6fb191d")](Ma("76a715b2ef3e149757")));0>g&&(g=c[Ma("73a612b6fb191d")](Ma("7baa19a6f76c1988428554")));a.nd=!(0<=g&&gk.length;)k+="9";h=k;k=k.substr(k.length-4);d="";d+=["gsh","gsf"][parseInt(k.substr(0,1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(k.substr(0,1),10)%4];g[Ma("79a417a0f0181a8946")]=d;if(x.document[Ma("78a712aa")]){x.document[Ma("78a712aa")][Ma("7bb806b6ed32388c4a875b")](g); k=x.getComputedStyle(g).getPropertyValue(Ma("78a704b7e62456904c9b12701b6532a8"));var l=x.getComputedStyle(g).getPropertyValue(Ma("75b817b0ea2202"));x.document[Ma("78a712aa")][Ma("68ad1bbcf533388c4a875b")](g);if(k)if(g=x[Ma("77a902b0eb1b1e804a8a")],l==="0."+parseInt(h,10)%100||-1!==k.indexOf(parseInt(f[1]+f[2],16))&&-1!==k.indexOf(parseInt(f[3]+f[4],16))){a.nd=!1;break}else if(g&&g(Ma("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(d="."+d,f=0;fd.updateDelay?d.N():d.m||(d.m=!0,setTimeout(function(){return d.redraw()}, d.updateDelay))};c.Lf=function(){null!==d.observed&&Pk(d)};c.autoScale=gj;c.vb=!1;b&&Object.assign(c,b);return c}la(Fk,Q);Fk.prototype.computePixelRatio=function(){return 1}; Fk.prototype.redraw=function(){if(this.m&&1<=this.updateDelay){this.m=!1;var a=this.xa,b=this.jb;if(null!==a&&null!==b){vj(this);if(null===this.ml){var c=new Ni(null);c.width=a.width;c.height=a.height;this.ml=c}try{this.xa=this.ml,this.jb=this.xa.context,this.jb.Qc(!0),this.jb.setTransform(1,0,0,1,0,0),this.jb.clearRect(0,0,this.xa.width,this.xa.height),Qk(this)}finally{this.xa=a,this.jb=b}}}Q.prototype.redraw.call(this)}; Fk.prototype.cc=function(){null===this.Ka&&C("No div specified");null===this.xa&&C("No canvas specified");if(!(this.xa instanceof Ej)&&(ei(this.box),this.Cc)){var a=this.observed;if(null!==a&&!a.animationManager.defaultAnimation.isAnimating&&a.mi){vj(this);var b=this.xa;a=this.jb;a.Qc(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?Qk(this):null!==this.ml&&(a.drawImage(this.ml.La,0,0),b=this.Ab,b.reset(),1!==this.scale&&b.scale(this.scale),0===this.position.x&& 0===this.position.y||b.translate(-this.position.x,-this.position.y),a.scale(this.Pb,this.Pb),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy),a.vc());b=this.Wa.s;for(var c=b.length,d=0;da&&(a=0);this.ga!==a&&(this.ga=a)}}});Fk.className="Overview";function Ok(){Ae.call(this);this.j=null}la(Ok,Ae); Ok.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(null===a||!a.allowMove||!a.allowSelect)return!1;var b=a.observed;if(null===b)return!1;var c=a.lastInput;if(!c.left||a.currentTool!==this&&(!this.isBeyondDragSize()||c.isTouchEvent&&c.timestamp-a.firstInput.timestampb.maxScale||(b.scale=a))};Rk.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);var b=this.diagram;if(b.autoScale!==qh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom}; Rk.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;b.autoScale===qh&&(a=b.scale*a,ab.maxScale||(b.scale=a))};Rk.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);var b=this.diagram;if(b.autoScale!==qh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};Rk.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;ab.maxScale||(b.scale=a)}; Rk.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);var b=this.diagram;return ab.maxScale?!1:b.allowZoom}; Rk.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.zc();a.redraw();var c=a.position,d=a.scale;kh(b,"Zoom To Fit");this.isZoomToFitRestoreEnabled&&d===this.vu&&!isNaN(this.Ct)&&a.documentBounds.C(this.tu)?(a.scale=this.Ct,a.position=this.lw,this.vu=NaN,this.tu=bc):(this.Ct=d,this.lw=c.copy(),a.zoomToFit(),this.vu=a.scale,this.tu=a.documentBounds.copy());mh(b)};Rk.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; Rk.prototype.scrollToPart=function(a){void 0===a&&(a=null);var b=this.diagram;b.Va();if(null===a){try{null!==this.Zf&&(this.Zf.next()?a=this.Zf.value:this.Zf=null)}catch(k){this.Zf=null}null===a&&(0a&&(a+=360));return a}; t.Af=function(){if(0!==(this.o&4096)===!1)return this.Fk;var a=this.Aa;return null!==this.panel?a*this.panel.Af():a};t.js=function(a,b){void 0===b&&(b=new I);b.assign(a);this.ke.Ld(b);return b};t.ks=function(a,b,c){return this.Qj(a.x,a.y,b.x,b.y,c)}; t.Qj=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,K.Cf(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=K.Cf(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!==sj(this)){var e=this.Fg,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=this.cq();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 W;switch(il(this,!0)){case kg:g=e=0;h&&(b=a=Infinity);break;case nd: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.Cb> a.width)))c=!0;this.o=c?this.o|256:this.o&-257;this.Gb.w()||C("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Gb.toString());this.Tl(f,this.Gb);kl(this,!1);N.free(f)};t=Y.prototype;t.Zg=function(){}; function ll(a,b,c,d,e){a.Gb.h(b,c,d,e);if(!a.desiredSize.w()){var f=a.rc;c=a.Fg;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=il(a,!0);c===d&&f===e&&(b=kg);switch(b){case kg:if(c>d||f>e)nj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case nd:nj(a,!0);a.measure(d,e,0,0);break;case Vk:nj(a,!0);a.measure(d,f,0,0);break;case Wk:nj(a,!0),a.measure(c,e,0,0)}}} t.Tl=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(),Ub(a,b)||(c.jh(),this.Ln(c)))};t.Ln=function(a){null!==this.portId&&(ml(a,!0),a instanceof V&&nl(a,this))}; t.cc=function(a,b){if(!ol(this,a,b)&&this.visible){var c=this.opacity;if(0!==c){var d=1;1!==c&&(d=a.globalAlpha,a.globalAlpha=d*c);var e=this instanceof W&&jl(this),f=this.Gb;if(e){var g=this.Gb,h=this.ac,k=this.areaBackground,l=this.Ra;null===k&&null===l||a.vc();null!==k&&(hi(this,a,k,!0,!0,h,g),k instanceof pl&&k.type===ql?(a.beginPath(),a.rect(g.x,g.y,g.width,g.height),a.jg(k)):a.fillRect(g.x,g.y,g.width,g.height));null!==l&&(hi(this,a,l,!0,!1,h,g),l instanceof pl&&l.type===ql?(a.beginPath(),a.rect(g.x, g.y,g.width,g.height),a.jg(l)):a.fillRect(g.x,g.y,g.width,g.height));this.bh(a,b)}if(!e&&(e||0!==f.width&&0!==f.height&&!isNaN(f.x)&&!isNaN(f.y))){e=this.transform;g=this.panel;0!==(this.o&4096)===!0&&rl(this);k=this.part;h=!1;var m=0;k&&b.Df("drawShadows")&&(h=k.isShadowed)&&(l=k.shadowOffset,m=Math.max(l.y,l.x)*b.scale*b.Pb);l=this.Qe();var n;if(!(n=b.Xi||!l)){var p=this.naturalBounds;n=this.rh;var r=n.m11,q=n.m21,u=n.dx,w=n.m12,v=n.m22,z=n.dy,y,A=y=0;n=y*r+A*q+u;var B=y*w+A*v+z;y=p.width+m;A=0; var E=y*r+A*q+u;y=y*w+A*v+z;A=Math.min(n,E);var M=Math.min(B,y);var R=Math.max(n+0,E)-A;var S=Math.max(B+0,y)-M;n=A;B=M;y=p.width+m;A=p.height+m;E=y*r+A*q+u;y=y*w+A*v+z;A=Math.min(n,E);M=Math.min(B,y);R=Math.max(n+R,E)-A;S=Math.max(B+S,y)-M;n=A;B=M;y=0;A=p.height+m;E=y*r+A*q+u;y=y*w+A*v+z;A=Math.min(n,E);M=Math.min(B,y);R=Math.max(n+R,E)-A;S=Math.max(B+S,y)-M;n=A;B=M;m=b.viewportBounds;p=m.x;r=m.y;n=!(n>m.width+p||p>R+n||B>m.height+r||r>S+B)}if(n){n=0!==(this.o&256);a.clipInsteadOfFill&&(n=!1);this instanceof Pg&&(a.font=this.font);if(n){B=g.oe()?g.naturalBounds:g.actualBounds;null!==this.ib?(p=this.ib,R=p.x,S=p.y,m=p.width,p=p.height):(R=Math.max(f.x,B.x),S=Math.max(f.y,B.y),m=Math.min(f.right,B.right)-R,p=Math.min(f.bottom,B.bottom)-S);if(R>f.width+f.x||f.x>B.width+B.x){1!==c&&(a.globalAlpha=d);return}a.save();a.beginPath();a.rect(R,S,m,p);a.clip()}if(l){if(!k.isVisible()){1!==c&&(a.globalAlpha=d);return}h&&(B=k.shadowOffset,a.xv(B.x*b.scale*this.scale*b.Pb,B.y*b.scale*this.scale*b.Pb,k.shadowBlur), sl(a),a.shadowColor=k.shadowColor)}h&&!0===this.shadowVisible?sl(a):h&&!1===this.shadowVisible&&tl(a);k=this.naturalBounds;null!==this.areaBackground&&(a.vc(),ul(this,a,k,f));a.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy);h&&(null!==g&&0!==(g.o&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&&g.sb()!==this)&&null===this.shadowVisible&&tl(a);null!==this.Ra&&(a.vc(),vl(this,a,k,f));h&&(null!==this.Ra||null!==this.areaBackground||null!==g&&0!==(g.o&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&& g.sb()!==this)?(wl(this,!0),null===this.shadowVisible&&tl(a)):wl(this,!1);this.bh(a,b);h&&0!==(this.o&512)===!0&&sl(a);l&&h&&tl(a);n&&(a.restore(),a.Qc(this instanceof W));e.ps()||(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)))}}1!==c&&(a.globalAlpha=d)}}}; function xl(a,b,c,d){var e=a.part,f=!1;e&&b.Df("drawShadows")&&(f=e.isShadowed);c.clipInsteadOfFill&&(f=!1);a.Qe()&&f&&sl(c);f&&!0===a.shadowVisible?sl(c):f&&!1===a.shadowVisible&&tl(c);e=a.panel;f&&(null!==e&&0!==(e.o&512)||null!==e&&(e.type===W.Auto||e.type===W.Spot)&&e.sb()!==a)&&null===a.shadowVisible&&tl(c);c.Dl&&(b=b.computePixelRatio(),b="drop-shadow("+c.shadowOffsetX/b+"px "+c.shadowOffsetY/b+"px "+c.shadowBlur/b/2+"px "+c.shadowColor+")",null!==a.background&&d.Ra.setAttributeNS(null,"filter", b),null!==a.areaBackground&&d.Vd.setAttributeNS(null,"filter",b));f&&(null!==a.Ra||null!==a.areaBackground||null!==e&&0!==(e.o&512)||null!==e&&(e.type===W.Auto||e.type===W.Spot)&&e.sb()!==a)?(wl(a,!0),null===a.shadowVisible&&tl(c)):wl(a,!1);return f}function yl(a,b,c,d,e){d.Dl&&(c=c.computePixelRatio(),a.wv(b,"drop-shadow("+d.shadowOffsetX/c+"px "+d.shadowOffsetY/c+"px "+d.shadowBlur/c/2+"px "+d.shadowColor+")"));e&&0!==(a.o&512)===!0&&sl(d);a.Qe()&&tl(d)}t.wv=function(){}; function ul(a,b,c,d){hi(a,b,a.areaBackground,!0,!0,c,d);a.areaBackground instanceof pl&&a.areaBackground.type===ql?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.jg(a.areaBackground)):b.fillRect(d.x,d.y,d.width,d.height)}function vl(a,b,c,d){var e=a.cq(),f=c.x,g=c.y,h=c.width+e,k=c.height+e;hi(a,b,a.Ra,!0,!1,c,d);a.Ra instanceof pl&&a.Ra.type===ql?(b.beginPath(),b.rect(f-e/2,g-e/2,h,k),b.jg(a.Ra)):b.fillRect(f-e/2,g-e/2,h,k)} function zl(a,b,c){for(var d=b.P.s,e=d.length,f=-1,g=0;ge)&&C("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)&&C("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index=e);e=new Ta;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);Bj(a,e)}else Bj(a,b);else C('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function Wl(a,b){Sl.add(a,b)} function Xl(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,{bindingId:{get:function(){return null!==this.A?this.A.sp:-1},set:function(a){this.bindingId!==a&&(null===this.A&&(this.A=new cl),this.A.sp=a)}},localBindings:{get:function(){return null!==this.A?this.A.pe:null},set:function(a){this.localBindings!==a&&(null===this.A&&(this.A=new cl),this.A.pe=a)}},srcBindings:{get:function(){return null!==this.A?this.A.tm:null},set:function(a){this.srcBindings!== a&&(null===this.A&&(this.A=new cl),this.A.tm=a)}},shadowVisible:{get:function(){return null!==this.A?this.A.zi:null},set:function(a){var b=this.shadowVisible;b!==a&&(bl(this),this.A.zi=a,this.N(),this.g("shadowVisible",b,a))}},enabledChanged:{get:function(){return null!==this.A?this.A.Fb:null},set:function(a){var b=this.enabledChanged;b!==a&&(bl(this),this.A.Fb=a,this.g("enabledChanged",b,a))}},segmentOrientation:{ get:function(){return null!==this.Ua?this.Ua.ir:Zf},set:function(a){var b=this.segmentOrientation;b!==a&&(null===this.Ua&&(this.Ua=new Yl),this.Ua.ir=a,this.v(),this.g("segmentOrientation",b,a),a===Zf&&(this.angle=0))}},segmentIndex:{get:function(){return null!==this.Ua?this.Ua.u:-Infinity},set:function(a){a=Math.round(a);var b=this.segmentIndex;b!==a&&(null===this.Ua&&(this.Ua=new Yl),this.Ua.u=a,this.v(),this.g("segmentIndex",b,a))}},segmentFraction:{ get:function(){return null!==this.Ua?this.Ua.m:0},set:function(a){isNaN(a)?a=0:0>a?a=0:1a||1=a&&C("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Aa=a,this.v(),this.g("scale",b,a))}},angle:{get:function(){return this.Ib},set:function(a){var b=this.Ib;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.Ib=a,Ol(this),this.v(),this.g("angle",b,a)))}},desiredSize:{get:function(){return this.ad},set:function(a){var b=a.width,c=a.height,d=this.ad,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&& isNaN(c))||(this.ad=a=a.J(),this.v(),this instanceof Bf&&this.nc(),this.g("desiredSize",d,a),el(this)&&(a=this.part,null!==a&&(fl(this,a,"width"),fl(this,a,"height"))))}},width:{get:function(){return this.ad.width},set:function(a){var b=this.ad.width;b===a||isNaN(b)&&isNaN(a)||(b=this.ad,this.ad=a=(new L(a,this.ad.height)).freeze(),this.v(),this instanceof Bf&&this.nc(),this.g("desiredSize",b,a),el(this)&&(a=this.part,null!==a&&fl(this,a,"width")))}},height:{ get:function(){return this.ad.height},set:function(a){var b=this.ad.height;b===a||isNaN(b)&&isNaN(a)||(b=this.ad,this.ad=a=(new L(this.ad.width,a)).freeze(),this.v(),this instanceof Bf&&this.nc(),this.g("desiredSize",b,a),el(this)&&(a=this.part,null!==a&&fl(this,a,"height")))}},minSize:{get:function(){return null!==this.A?this.A.u:Cb},set:function(a){var b=this.minSize;b.C(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(), bl(this),this.A.u=a,this.v(),this.g("minSize",b,a))}},maxSize:{get:function(){return null!==this.A?this.A.m:Kb},set:function(a){var b=this.maxSize;b.C(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),bl(this),this.A.m=a,this.v(),this.g("maxSize",b,a))}},measuredBounds:{get:function(){return this.rc}},naturalBounds:{get:function(){return this.ac}},margin:{ get:function(){return this.Fg},set:function(a){"number"===typeof a&&(a=new hc(a));var b=this.Fg;b.C(a)||(this.Fg=a=a.J(),this.v(),this.g("margin",b,a))}},transform:{get:function(){0!==(this.o&2048)===!0&&rl(this);return this.Ab}},ke:{get:function(){0!==(this.o&4096)===!0&&rl(this);return this.rh}},animationTriggers:{get:function(){return null!==this.A?this.A.hb:null},set:function(a){this.animationTriggers!== a&&(bl(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return null!==this.A?this.A.Mf:kg},set:function(a){this.reshapingBehavior!==a&&(bl(this),this.A.Mf=a)}},alignment:{get:function(){return this.Hb},set:function(a){var b=this.Hb;b.C(a)||(a.Jc()&&!a.Tb()&&C("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Hb=a=a.J(),Jl(this),this.g("alignment",b,a))}},column:{get:function(){return this.wg}, set:function(a){a=Math.round(a);var b=this.wg;b!==a&&(0>a&&xa(a,">= 0",Y,"column"),this.wg=a,this.v(),this.g("column",b,a),null!==this.svg&&this.svg.remove())}},columnSpan:{get:function(){return null!==this.A?this.A.pb:1},set:function(a){a=Math.round(a);var b=this.columnSpan;b!==a&&(1>a&&xa(a,">= 1",Y,"columnSpan"),bl(this),this.A.pb=a,this.v(),this.g("columnSpan",b,a))}},row:{get:function(){return this.co},set:function(a){a=Math.round(a); var b=this.co;b!==a&&(0>a&&xa(a,">= 0",Y,"row"),this.co=a,this.v(),this.g("row",b,a),null!==this.svg&&this.svg.remove())}},rowSpan:{get:function(){return null!==this.A?this.A.yi:1},set:function(a){a=Math.round(a);var b=this.rowSpan;b!==a&&(1>a&&xa(a,">= 1",Y,"rowSpan"),bl(this),this.A.yi=a,this.v(),this.g("rowSpan",b,a))}},spanAllocation:{get:function(){return null!==this.A?this.A.Ai:null},set:function(a){var b=this.spanAllocation;b!==a&& (bl(this),this.A.Ai=a,this.v(),this.g("spanAllocation",b,a))}},alignmentFocus:{get:function(){return this.mk},set:function(a){var b=this.mk;b.C(a)||(this.mk=a=a.J(),this.v(),this.g("alignmentFocus",b,a))}},portId:{get:function(){return this.Un},set:function(a){var b=this.Un;if(b!==a){var c=this.part;null===c||c instanceof V||C("Cannot set portID on a Link: "+a);null!==b&&null!==c&&$l(c,this);this.Un=a;null!==a&&null!==c&&(c.Oe=!0,am(c,this)); this.g("portId",b,a)}}},toSpot:{get:function(){return null!==this.ba?this.ba.wj:rc},set:function(a){var b=this.toSpot;b.C(a)||(a=a.J(),this.Sc(),this.ba.wj=a,this.g("toSpot",b,a),Nl(this))}},toEndSegmentLength:{get:function(){return null!==this.ba?this.ba.uj:10},set:function(a){var b=this.toEndSegmentLength;b!==a&&(0>a&&xa(a,">= 0",Y,"toEndSegmentLength"),this.Sc(),this.ba.uj=a,this.g("toEndSegmentLength",b,a),Nl(this))}},toShortLength:{ get:function(){return null!==this.ba?this.ba.vj:0},set:function(a){var b=this.toShortLength;b!==a&&(this.Sc(),this.ba.vj=a,this.g("toShortLength",b,a),Nl(this))}},toLinkable:{get:function(){return null!==this.ba?this.ba.Lr:null},set:function(a){var b=this.toLinkable;b!==a&&(this.Sc(),this.ba.Lr=a,this.g("toLinkable",b,a))}},toMaxLinks:{get:function(){return null!==this.ba?this.ba.Mr:Infinity},set:function(a){var b=this.toMaxLinks; b!==a&&(0>a&&xa(a,">= 0",Y,"toMaxLinks"),this.Sc(),this.ba.Mr=a,this.g("toMaxLinks",b,a))}},fromSpot:{get:function(){return null!==this.ba?this.ba.Ui:rc},set:function(a){var b=this.fromSpot;b.C(a)||(a=a.J(),this.Sc(),this.ba.Ui=a,this.g("fromSpot",b,a),Nl(this))}},fromEndSegmentLength:{get:function(){return null!==this.ba?this.ba.Si:10},set:function(a){var b=this.fromEndSegmentLength;b!==a&&(0>a&&xa(a,">= 0",Y,"fromEndSegmentLength"),this.Sc(), this.ba.Si=a,this.g("fromEndSegmentLength",b,a),Nl(this))}},fromShortLength:{get:function(){return null!==this.ba?this.ba.Ti:0},set:function(a){var b=this.fromShortLength;b!==a&&(this.Sc(),this.ba.Ti=a,this.g("fromShortLength",b,a),Nl(this))}},fromLinkable:{get:function(){return null!==this.ba?this.ba.$p:null},set:function(a){var b=this.fromLinkable;b!==a&&(this.Sc(),this.ba.$p=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{ get:function(){return null!==this.ba?this.ba.aq:Infinity},set:function(a){var b=this.fromMaxLinks;b!==a&&(0>a&&xa(a,">= 0",Y,"fromMaxLinks"),this.Sc(),this.ba.aq=a,this.g("fromMaxLinks",b,a))}},cursor:{get:function(){return null!==this.A?this.A.j:""},set:function(a){var b=this.cursor;b!==a&&(bl(this),this.A.j=a,this.g("cursor",b,a))}},click:{get:function(){return null!==this.A?this.A.uh:null},set:function(a){var b=this.click; b!==a&&(bl(this),this.A.uh=a,this.g("click",b,a))}},doubleClick:{get:function(){return null!==this.A?this.A.Ah:null},set:function(a){var b=this.doubleClick;b!==a&&(bl(this),this.A.Ah=a,this.g("doubleClick",b,a))}},contextClick:{get:function(){return null!==this.A?this.A.wh:null},set:function(a){var b=this.contextClick;b!==a&&(bl(this),this.A.wh=a,this.g("contextClick",b,a))}},mouseEnter:{get:function(){return null!== this.A?this.A.Ih:null},set:function(a){var b=this.mouseEnter;b!==a&&(bl(this),this.A.Ih=a,this.g("mouseEnter",b,a))}},mouseLeave:{get:function(){return null!==this.A?this.A.Lh:null},set:function(a){var b=this.mouseLeave;b!==a&&(bl(this),this.A.Lh=a,this.g("mouseLeave",b,a))}},mouseOver:{get:function(){return null!==this.A?this.A.Mh:null},set:function(a){var b=this.mouseOver;b!==a&&(bl(this),this.A.Mh=a,this.g("mouseOver",b,a))}},mouseHover:{ get:function(){return null!==this.A?this.A.Kh:null},set:function(a){var b=this.mouseHover;b!==a&&(bl(this),this.A.Kh=a,this.g("mouseHover",b,a))}},mouseHold:{get:function(){return null!==this.A?this.A.Jh:null},set:function(a){var b=this.mouseHold;b!==a&&(bl(this),this.A.Jh=a,this.g("mouseHold",b,a))}},mouseDragEnter:{get:function(){return null!==this.A?this.A.Lf:null},set:function(a){var b=this.mouseDragEnter;b!==a&&(bl(this), this.A.Lf=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{get:function(){return null!==this.A?this.A.Sd:null},set:function(a){var b=this.mouseDragLeave;b!==a&&(bl(this),this.A.Sd=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{get:function(){return null!==this.A?this.A.Hh:null},set:function(a){var b=this.mouseDrop;b!==a&&(bl(this),this.A.Hh=a,this.g("mouseDrop",b,a))}},actionDown:{get:function(){return null!== this.A?this.A.V:null},set:function(a){var b=this.actionDown;b!==a&&(bl(this),this.A.V=a,this.g("actionDown",b,a))}},actionMove:{get:function(){return null!==this.A?this.A.ga:null},set:function(a){var b=this.actionMove;b!==a&&(bl(this),this.A.ga=a,this.g("actionMove",b,a))}},actionUp:{get:function(){return null!==this.A?this.A.Ha:null},set:function(a){var b=this.actionUp;b!==a&&(bl(this),this.A.Ha=a,this.g("actionUp",b,a))}},actionCancel:{ get:function(){return null!==this.A?this.A.F:null},set:function(a){var b=this.actionCancel;b!==a&&(bl(this),this.A.F=a,this.g("actionCancel",b,a))}},toolTip:{get:function(){return null!==this.A?this.A.Xh:null},set:function(a){var b=this.toolTip;b!==a&&(bl(this),this.A.Xh=a,this.g("toolTip",b,a))}},contextMenu:{get:function(){return null!==this.A?this.A.xh:null},set:function(a){var b=this.contextMenu;b!==a&&(bl(this),this.A.xh= a,this.g("contextMenu",b,a))}}});Y.prototype.trigger=Y.prototype.Cv;Y.prototype.findBindingPanel=Y.prototype.dh;Y.prototype.findTemplateBinder=Y.prototype.hz;Y.prototype.setProperties=Y.prototype.km;Y.prototype.apply=Y.prototype.apply;Y.prototype.attach=Y.prototype.yu;Y.prototype.set=Y.prototype.set;Y.prototype.isEnabledObject=Y.prototype.Ff;Y.prototype.isVisibleObject=Y.prototype.Nd;Y.prototype.isContainedBy=Y.prototype.ng;Y.prototype.getNearestIntersectionPoint=Y.prototype.ks; Y.prototype.getLocalPoint=Y.prototype.js;Y.prototype.getDocumentScale=Y.prototype.Af;Y.prototype.getDocumentAngle=Y.prototype.ii;Y.prototype.getDocumentBounds=Y.prototype.ji;Y.prototype.getDocumentPoint=Y.prototype.ja;Y.prototype.intersectsRect=Y.prototype.Tc;Y.prototype.containedInRect=Y.prototype.$g;Y.prototype.containsRect=Y.prototype.Me;Y.prototype.containsPoint=Y.prototype.ca;Y.prototype.raiseChanged=Y.prototype.g;Y.prototype.raiseChangedEvent=Y.prototype.cb;Y.prototype.addCopyProperty=Y.prototype.Ow; var Sl=null;Y.className="GraphObject";Sl=new ob; Wl("Button",function(){function a(a,b){return null!==a.diagram.ec(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=Rl(W,W.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof W){var c=a.fb("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"},Rl(Bf,{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.Ff()&&b instanceof W&&(a=b.fb("ButtonBorder"),a instanceof Bf)){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.Ff()&&b instanceof W&&(a=b.fb("ButtonBorder"),a instanceof Bf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Ff()&&b instanceof W&&null!==b._buttonFillPressed&&0===a.button){var c=b.fb("ButtonBorder");if(c instanceof Bf){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.Ff()&&d instanceof W&&null!==d._buttonFillPressed&&0===b.button){var c=d.fb("ButtonBorder");if(c instanceof Bf){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.Ff()&&d instanceof W&&null!==d._buttonFillPressed){var c=d.fb("ButtonBorder");if(c instanceof Bf){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.Ff()&&d instanceof W&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.fb("ButtonBorder"),b instanceof Bf))){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}); Wl("TreeExpanderButton",function(){var a=Rl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Rl(Bf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ib},(new xi("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).Xo()),{visible:!1},(new xi("visible","isTreeLeaf",function(a){return!a})).Xo());a.click=function(a,c){c=c.part;c instanceof te&&(c=c.adornedPart);if(c instanceof V){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}); Wl("SubGraphExpanderButton",function(){var a=Rl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Rl(Bf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ib},(new xi("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).Xo()));a.click=function(a,c){c=c.part;c instanceof te&&(c=c.adornedPart);if(c instanceof pf){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});Wl("ToolTip",function(){return Rl(te,W.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new I(0,3),shadowBlur:5},Rl(Bf,{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)}))}); Wl("ContextMenu",function(){return Rl(te,W.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new I(0,3),shadowBlur:5},new xi("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});Wl("ContextMenuButton",function(){var a=Rl("Button");a.stretch=Vk;var b=a.fb("ButtonBorder");b instanceof Bf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new O(0,0,2,3),b.spot2=new O(1,1,-2,-2));return a}); Wl("PanelExpanderButton",function(a){var b=Xl(a,"COLLAPSIBLE"),c=Rl("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},Rl(Bf,{name:"ButtonIcon",strokeWidth:2},(new xi("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).Xo(b))); a=c.fb("ButtonBorder");a instanceof Bf&&(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.dh();null===e&&(e=c.part);null!==e&&(c=e.fb(b),null!==c&&(a.handled=!0,d.Ea("Collapse/Expand Panel"),c.visible=!c.visible,d.eb("Collapse/Expand Panel")))}};return c}); Wl("CheckBoxButton",function(a){var b=Xl(a);a=Rl("Button",{desiredSize:new L(14,14)},Rl(Bf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:nd,geometryStretch:mg,visible:!1},""!==b?(new xi("visible",b)).Fx():[]));a.click=function(a,d){if(d instanceof W){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.fb("ButtonIcon");c.Ea("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.eb("checkbox")}}};return a}); Wl("CheckBox",function(a){a=Xl(a);a=Rl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new hc(0,1,0,0)});var b=Rl(W,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new hc(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=kg=new D(Y,"None",0);Y.Default=Xk=new D(Y,"Default",0);Y.Vertical=Wk=new D(Y,"Vertical",4);Y.Horizontal=Vk=new D(Y,"Horizontal",5);Y.Fill=nd=new D(Y,"Fill",3);Y.Uniform=mg=new D(Y,"Uniform",1); Y.UniformToFill=Yk=new D(Y,"UniformToFill",2);Y.FlipVertical=Zk=new D(Y,"FlipVertical",1);Y.FlipHorizontal=$k=new D(Y,"FlipHorizontal",2);Y.FlipBoth=al=new D(Y,"FlipBoth",3);Y.make=Rl;Y.getBuilders=function(){var a=new ob,b;for(b in Sl)if(b!==b.toLowerCase()){var c=Sl.I(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};Y.defineBuilder=Wl; Y.build=function(a,b,c){for(var d=[],e=2;ea&&(a+=360);if(0!==a){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.ia[1]*a+this.ia[3]*d,f=this.ia[0]*-d+this.ia[2]*a,g=this.ia[1]*-d+this.ia[3]*a;this.ia[0]=this.ia[0]*a+this.ia[2]*d;this.ia[1]=e;this.ia[2]=f;this.ia[3]=g;this.translate(-b,-c)}};bm.className="STransform"; function cm(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.Zw=[];this.pattern=null}cm.prototype.addColorStop=function(a,b){this.Zw.push({offset:a,color:b})};cm.className="SGradient"; function Ej(a,b,c){this.ownerDocument=a=void 0===b?x.document:b;this.Tz="http://www.w3.org/2000/svg";void 0!==a&&(this.La=this.Pd("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.La.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.La.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.$r=null;this.context=new Aj(this,c)} Ej.prototype.resize=function(a,b,c,d){return this.width!==a||this.height!==b?(this.width=a,this.height=b,this.style.width=c+"px",this.style.height=d+"px",this.La.setAttributeNS(null,"width",c+"px"),this.La.setAttributeNS(null,"height",d+"px"),this.La.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.pw.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.pw.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Ej.prototype.Pd=function(a,b,c){a=this.ownerDocument.createElementNS(this.Tz,a);if(za(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};Ej.prototype.getBoundingClientRect=function(){return this.La.getBoundingClientRect()};Ej.prototype.focus=function(){this.La.focus()};Ej.prototype.gx=function(){this.ownerDocument=null}; ma.Object.defineProperties(Ej.prototype,{width:{get:function(){return this.La.width.baseVal.value},set:function(a){this.La.setAttribute("width",a+"px")}},height:{get:function(){return this.La.height.baseVal.value},set:function(a){this.La.setAttribute("height",a+"px")}},style:{get:function(){return this.La.style}}});Ej.className="SVGSurface"; function Aj(a,b){this.zv=a;this.svg=a.La;this.stack=[];this.ih=[];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.Dl=!1;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.Pg=this.tr=this.sr=0;this.sd=this.Od=null;this.path=[];this.Ul={};this.vt=!1; this.Sg=null;this.sj=0;this.lc=new bm;this.j=Bl(this);this.Lj=Bl(this,"gojs-diagram");this.Xr=this.pi=null;var c=jb++,d=this.Pd("clipPath",{id:"mainClip"+c});d.appendChild(this.Pd("rect",{x:0,y:0,width:a.width,height:a.height}));this.pw=d;this.svg.appendChild(this.j);this.j.appendChild(this.Lj);this.svg.appendChild(d);this.j.setAttributeNS(null,"clip-path","url(#mainClip"+c+")");this.Vz={};this.isTemporary=!!b} function wj(a,b,c,d,e,f,g){void 0===a.Lj?Al(a,b,c,d,e,f,g):a.Lj.setAttribute("transform","matrix("+b+", "+c+", "+d+", "+e+", "+f+", "+g+")")}t=Aj.prototype; 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=[];this.Ul={stroke:"none",fill:"none"}};t.Ne=function(a){this.addPath(this.path,this.lc,a||0)}; 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.Ul.clipPath=!0};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new cm("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.Vz;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+jb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.Pd("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.Pd(Xi,e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new cm("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){f="";a instanceof HTMLCanvasElement&&(f=a.toDataURL());a instanceof HTMLImageElement&&(f=a.getAttribute("src"));g=a instanceof HTMLImageElement?a.naturalWidth:a.width;var l=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(h=d=g,k=e=l);d=d||0;e=e||0;h=h||0;k=k||0;a={x:0,y:0,width:h||g||d,height:k||l||e,href:f};K.$(d,h)&&K.$(e,k)?-1===f.toLowerCase().indexOf(".svg")&&-1===f.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio="xMidYMid slice"): a.preserveAspectRatio="none";if(0!==b||0!==c||d!==g||e!==l)h="CLIP"+jb++,k=this.Pd("clipPath",{id:h}),k.appendChild(this.Pd("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(k),a["clip-path"]="url(#"+h+")";dm(this,Xi,a,this.lc);this.addElement(Xi,a)};t.fill=function(a){a&&(this.Ul["fill-rule"]="evenodd");em(this,this.Ul)};t.jg=function(a,b){this.clipInsteadOfFill?this.clip():this.fill(b)}; 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]};dm(this,"fill",a,this.lc);this.addElement("rect",a)};t.ix=function(a,b,c,d){a={x:a,y:b,width:c,height:d};dm(this,"fill",a,this.lc);em(this,a);this.svg.prepend(this.Pd("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};dm(this,"fill",b,this.lc);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.lc=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;ec?(this.scale(c/a,1),this.translate((a-c)/2,0)):c>a&&(this.scale(1,a/c),this.translate(0,(c-a)/2));this.Em?this.clip():this.fill(b);a>c?(this.translate(-(a-c)/2,0),this.scale(1/(c/a),1)):c>a&&(this.translate(0,-(c-a)/2),this.scale(1,1/(a/c)))}else this.Em?this.clip():this.fill(b)};t.ek=function(){this.Em||this.stroke()};t.xv=function(a,b,c){this.sr=a;this.tr=b;this.Pg=c}; t.bs=function(a,b){var c=this.Z;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.Yr=function(){var a=this.Z;void 0!==a.setLineDash&&(a.setLineDash(im),a.lineDashOffset=0)};t.Qc=function(a){a&&(this.Ws="");this.Vs=this.Xs=""};t.As=function(){}; ma.Object.defineProperties(El.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(a){this.Vs!==a&&(this.Vs=this.Z.fillStyle=a)}},font:{get:function(){return this.Z.font},set:function(a){this.Ws!==a&&(this.Ws=this.Z.font=a)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(a){this.Z.globalAlpha=a}},lineCap:{get:function(){return this.Z.lineCap}, set:function(a){this.Z.lineCap=a}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(a){this.Z.lineDashOffset=a}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(a){this.Z.lineJoin=a}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(a){this.Z.lineWidth=a}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(a){this.Z.miterLimit= a}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(a){this.Z.shadowBlur=a}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(a){this.Z.shadowColor=a}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(a){this.Z.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(a){this.Z.shadowOffsetY= a}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(a){this.Xs!==a&&(this.Xs=this.Z.strokeStyle=a)}},textAlign:{get:function(){return this.Z.textAlign},set:function(a){this.Z.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(a){this.Z.imageSmoothingEnabled=a}},clipInsteadOfFill:{get:function(){return this.Em}, set:function(a){this.Em=a}}});var im=Object.freeze([]);El.className="CanvasSurfaceContext";function jm(){this.F=this.m=this.u=this.j=0}jm.className="ColorNumbers"; function pl(a,b){km||(lm(),km=!0);Qa(this);this._isFrozen=!1;void 0===a?(this.na=Dl,this.sk="black"):"string"===typeof a?(this.na=Dl,this.sk=a):(this.na=a,this.sk="black");a=this.na;a===Gl?(this.Hd=tc,this.Gk=Ac):this.Gk=a===ql?this.Hd=xc:this.Hd=rc;this.yr=0;this.Qp=NaN;this.te=this.Wq=this.se=null;this.Ys=this.tk=0;b&&Object.assign(this,b)} pl.prototype.copy=function(){var a=new pl;a.na=this.na;a.sk=this.sk;a.Hd=this.Hd.J();a.Gk=this.Gk.J();a.yr=this.yr;a.Qp=this.Qp;null!==this.se&&(a.se=this.se.copy());a.Wq=this.Wq;return a};t=pl.prototype;t.freeze=function(){this._isFrozen=!0;null!==this.se&&this.se.freeze();return this};t.ka=function(){Object.isFrozen(this)&&C("cannot thaw constant: "+this);this._isFrozen=!1;null!==this.se&&this.se.ka();return this};t.rb=function(a){a.classType===pl&&(this.type=a)}; t.toString=function(){var a="Brush(";if(this.type===Dl)a+=this.color;else if(a=this.type===Gl?a+"Linear ":this.type===ql?a+"Radial ":this.type===Fl?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._isFrozen&&va(this);("number"!==typeof a||!isFinite(a)||1a)&&xa(a,"0 <= loc <= 1",pl,"addColorStop:loc");null===this.se&&(this.se=new ob);this.se.add(a,b);this.na===Dl&&(this.type=Gl);this.te=null;return this}; t.Mz=function(a,b){this._isFrozen&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?mm:b;if(this.type===Dl)Th(this.color),this.color=nm(a,b);else if((this.type===Gl||this.type===ql)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Th(c.value),this.addColorStop(c.key,nm(a,b));return this};function om(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?mm:c;Th(a);return nm(b,c)} t.Oy=function(a,b){this._isFrozen&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?mm:b;if(this.type===Dl)Th(this.color),this.color=nm(-a,b);else if((this.type===Gl||this.type===ql)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)Th(c.value),this.addColorStop(c.key,nm(-a,b));return this};function pm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?mm:c;Th(a);return nm(-b,c)} function qm(a,b,c){Th(a);a=rm.j;var d=rm.u,e=rm.m,f=rm.F;Th(b);void 0===c&&(c=.5);return"rgba("+Math.round((rm.j-a)*c+a)+", "+Math.round((rm.u-d)*c+d)+", "+Math.round((rm.m-e)*c+e)+", "+Math.round((rm.F-f)*c+f)+")"} t.zx=function(){if(this.type===Dl)return sm(this.color);if((this.type===Gl||this.type===ql)&&null!==this.colorStops){var a=this.colorStops;if(this.type===ql)return sm(a.first().value);if(null!==a.get(.5))return sm(a.get(.5));if(2===a.count)return a=a.Fa(),sm(qm(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&&(f=c,c=d,d=f,f=e);e=d-c;return sm(qm(a.get(c),a.get(d),1-f/e))}return!1}; function sm(a){if(!a)return!1;if(a instanceof pl)return a.zx();Th(a);return 128>(299*rm.j+587*rm.u+114*rm.m)/1E3} function nm(a,b){switch(b){case mm:b=100*tm(rm.j);var c=100*tm(rm.u),d=100*tm(rm.m);um.j=.4124564*b+.3575761*c+.1804375*d;um.u=.2126729*b+.7151522*c+.072175*d;um.m=.0193339*b+.119192*c+.9503041*d;um.F=rm.F;b=vm(um.j/wm[0]);c=vm(um.u/wm[1]);d=vm(um.m/wm[2]);xm.j=116*c-16;xm.u=500*(b-c);xm.m=200*(c-d);xm.F=um.F;xm.j=Math.min(100,Math.max(0,xm.j+100*a));a=(xm.j+16)/116;b=a-xm.m/200;um.j=wm[0]*ym(xm.u/500+a);um.u=wm[1]*(xm.j>zm*Am?Math.pow(a,3):xm.j/zm);um.m=wm[2]*ym(b);um.F=xm.F;a=-.969266*um.j+1.8760108* um.u+.041556*um.m;b=.0556434*um.j+-.2040259*um.u+1.0572252*um.m;rm.j=255*Bm((3.2404542*um.j+-1.5371385*um.u+-.4985314*um.m)/100);rm.u=255*Bm(a/100);rm.m=255*Bm(b/100);rm.F=um.F;rm.j=Math.round(rm.j);255rm.j&&(rm.j=0);rm.u=Math.round(rm.u);255rm.u&&(rm.u=0);rm.m=Math.round(rm.m);255rm.m&&(rm.m=0);return"rgba("+rm.j+", "+rm.u+", "+rm.m+", "+rm.F+")";case Cm:return Uh(),Vh.m=Math.min(100,Math.max(0,Vh.m+100*a)),"hsla("+Vh.j+", "+Vh.u+"%, "+Vh.m+"%, "+ Vh.F+")";default:C("Unknown color space: "+b)}}function Th(a){km||(lm(),km=!0);var b=Dm;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,rm.j=a[0],rm.u=a[1],rm.m=a[2],rm.F=a[3]/255):(b.fillStyle="#FFFFFF",b.fillStyle=a,rm.j=0,rm.u=0,rm.m=0,rm.F=1)}} function Uh(){var a=rm.j/255,b=rm.u/255,c=rm.m/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))}Vh.j=Math.round(g);Vh.u=Math.round(100*a);Vh.m=Math.round(100*e);Vh.F=rm.F}function tm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Bm(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} function vm(a){return a>Am?Math.pow(a,1/3):(zm*a+16)/116}function ym(a){var b=a*a*a;return b>Am?b:(116*a-16)/zm}function Zl(a,b){"string"!==typeof a&&(a instanceof pl||C("Value for "+b+" must be a color string or a Brush, not "+a))}function lm(){Dm=Ng?(new Ni(null,void 0,{willReadFrequently:!0})).context:null} ma.Object.defineProperties(pl.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&va(this,a);this.na=a;this.start.Jc()&&(a===Gl?this.start=tc:a===ql&&(this.start=xc));this.end.Jc()&&(a===Gl?this.end=Ac:a===ql&&(this.end=xc));this.te=null}},color:{get:function(){return this.sk},set:function(a){this._isFrozen&&va(this,a);this.sk=a;this.te=null}},start:{get:function(){return this.Hd}, set:function(a){this._isFrozen&&va(this,a);this.Hd=a.J();this.te=null}},end:{get:function(){return this.Gk},set:function(a){this._isFrozen&&va(this,a);this.Gk=a.J();this.te=null}},startRadius:{get:function(){return this.yr},set:function(a){this._isFrozen&&va(this,a);0>a&&xa(a,">= zero",pl,"startRadius");this.yr=a;this.te=null}},endRadius:{get:function(){return this.Qp},set:function(a){this._isFrozen&&va(this, a);0>a&&xa(a,">= zero",pl,"endRadius");this.Qp=a;this.te=null}},colorStops:{get:function(){return this.se},set:function(a){this._isFrozen&&va(this,a);this.se=a;this.te=null}},pattern:{get:function(){return this.Wq},set:function(a){this._isFrozen&&va(this,a);this.Wq=a;this.te=null}}});pl.prototype.isDark=pl.prototype.zx;pl.prototype.darkenBy=pl.prototype.Oy;pl.prototype.lightenBy=pl.prototype.Mz;pl.prototype.addColorStop=pl.prototype.addColorStop; var Am=216/24389,zm=24389/27,wm=[95.047,100,108.883],Dm=null,rm=new jm,Vh=new jm,um=new jm,xm=new jm,km=!1;pl.className="Brush";var Dl;pl.Solid=Dl=new D(pl,"Solid",0);var Gl;pl.Linear=Gl=new D(pl,"Linear",1);var ql;pl.Radial=ql=new D(pl,"Radial",2);var Fl;pl.Pattern=Fl=new D(pl,"Pattern",4);var mm;pl.Lab=mm=new D(pl,"Lab",5);var Cm;pl.HSL=Cm=new D(pl,"HSL",6); pl.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}; pl.isValidColor=function(a){if("black"===a)return!0;if(""===a)return!1;km||(lm(),km=!0);var b=Dm;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};pl.lighten=function(a){return om(a)};pl.lightenBy=om;pl.darken=function(a){return pm(a)};pl.darkenBy=pm;pl.mix=qm;pl.isDark=sm;function Vl(){this.wa="Base"}Vl.prototype.measure=function(){}; Vl.prototype.Pz=function(a,b,c,d,e){a.measure(b,c,d,e)};Vl.prototype.arrange=function(){};Vl.prototype.Ey=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};Vl.prototype.Zz=function(a){a.Sj()};Vl.prototype.cc=function(){};ma.Object.defineProperties(Vl.prototype,{name:{get:function(){return this.wa},set:function(a){this.wa=a}},classType:{get:function(){return W}}});Vl.prototype.remeasureObject=Vl.prototype.Zz;Vl.prototype.arrangeElement=Vl.prototype.Ey; Vl.prototype.measureElement=Vl.prototype.Pz;Vl.className="PanelLayout";function Em(){this.wa="Base"}la(Em,Vl); Em.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=Fm(a);for(var k=0;kR&&(eb=Math.max(R-ff,0));var lk=0===G.oa;G.kc=G.kc+eb;G.actual=G.oa+eb;R=Math.max(R-(eb+(lk?ff:0)),0)}if(1===dc.columnSpan&&(Fb===kg||Fb===Wk)){G=a.getColumnDefinition(Eb); var zi=G.Rc();eb=Math.max(Jf-G.actual,0);eb+zi>M&&(eb=Math.max(M-zi,0));var Mn=0===G.oa;G.kc=G.kc+eb;G.actual=G.oa+eb;M=Math.max(M-(eb+(Mn?zi:0)),0)}ef&&dc.Sj()}}}}}Ga(z);var Td=0,oe=0;f=a.columnCount;for(var sg=0;sg=a.rowCount);Oe++)G=a.getRowDefinition(Oa.row+Oe),eb=0,eb=Fb===nd||Fb===Wk?Math.max(G.minimum,0===ud[Oa.row+Oe]?G.maximum:Math.min(ud[Oa.row+Oe],G.maximum)):Math.max(G.minimum,isNaN(G.Ec)?G.maximum:Math.min(G.Ec,G.maximum)),Id.height+=eb,oc+=G.minimum;for(var Vc=1;Vc=a.columnCount);Vc++)G=a.getColumnDefinition(Oa.column+Vc),eb= 0,eb=Fb===nd||Fb===Vk?Math.max(G.minimum,0===Gc[Oa.column+Vc]?G.maximum:Math.min(Gc[Oa.column+Vc],G.maximum)):Math.max(G.minimum,isNaN(G.Ec)?G.maximum:Math.min(G.Ec,G.maximum)),Id.width+=eb,pk+=G.minimum;hb.width+=Id.width;hb.height+=Id.height;var Dh=Oa.margin,lf=Dh.right+Dh.left,Bi=Dh.top+Dh.bottom;Oa.measure(hb.width,hb.height,pk,oc);for(var Eh=Oa.measuredBounds,Jd=Math.max(Eh.width+lf,0),Nf=Math.max(Eh.height+Bi,0),mf=0,Fh=0;Fh=a.rowCount);Fh++)G=a.getRowDefinition(Oa.row+ Fh),mf+=G.total||0;if(mf=Pe)&&!(Oa.row+re>=a.rowCount);re++){G=a.getRowDefinition(Oa.row+re);var Re=G.oa||0,Of=Qe(Oa,G,Vd);G.actual=Math.min(G.maximum,Re+Of);G.oa!==Re&&(Pe-=G.oa-Re)}for(;0vd&&(G.actual=Math.min(G.maximum,vd+Pe),G.oa!==vd&&(Pe-=G.oa-vd));if(0===G.index)break;G=a.getRowDefinition(G.index-1)}}for(var vg=0,Se=0;Se=a.columnCount);Se++)G=a.getColumnDefinition(Oa.column+Se),vg+=G.total||0;if(vg=wg)&&!(Oa.column+Pf>=a.columnCount);Pf++){G=a.getColumnDefinition(Oa.column+Pf);var Ci=G.oa||0,Pn=se(Oa,G,On);G.actual=Math.min(G.maximum,Ci+Pn);G.oa!==Ci&&(wg-=G.oa-Ci)}for(;0qk&&(G.actual=Math.min(G.maximum,qk+wg),G.oa!==qk&&(wg-=G.oa-qk));if(0=== G.index)break;G=a.getColumnDefinition(G.index-1)}}}}Ga(y);L.free(Id);L.free(hb);void 0!==ud&&Ga(ud);void 0!==Gc&&Ga(Gc);var xg=0,yg=0,rk=a.desiredSize,Br=a.maxSize;Fb=il(a,!0);var Di=oe=Td=0,Ei=0;f=a.columnCount;for(var sk=0;sk=a.rowCount);G++){var ca=a.getRowDefinition(z+G);0!==ca.oa&&(v.height+=ca.total)}for(G=1;G=a.columnCount);G++)ca=a.getColumnDefinition(A+G),0!==ca.oa&&(v.width+=ca.total);var X=B.oa+v.width,na=y.oa+v.height;G=h;ca=k;var wa=X,db=na,gb=h,Db=k,eb=X,Ke=na;h+X>c.width&&(eb=Math.max(c.width-h,0));k+na>c.height&&(Ke=Math.max(c.height-k,0));var Ua=S.alignment;if(Ua.Tb()){Ua=a.defaultAlignment;Ua.tb()||(Ua=xc);var rd=Ua.x;var Eb=Ua.y;var Le=Ua.offsetX; Ua=Ua.offsetY;var wc=B.alignment,Tc=y.alignment;wc.tb()&&(rd=wc.x,Le=wc.offsetX);Tc.tb()&&(Eb=Tc.y,Ua=Tc.offsetY)}else rd=Ua.x,Eb=Ua.y,Le=Ua.offsetX,Ua=Ua.offsetY;if(isNaN(rd)||isNaN(Eb))Eb=rd=.5,Ua=Le=0;wc=J.width;Tc=J.height;var lc=S.margin,dc=lc.left+lc.right,ef=lc.top+lc.bottom,sd=Kl(S,y,B,!1);!isNaN(S.desiredSize.width)||sd!==nd&&sd!==Vk||(wc=Math.max(X-dc,0));!isNaN(S.desiredSize.height)||sd!==nd&&sd!==Wk||(Tc=Math.max(na-ef,0));X=S.maxSize;na=S.minSize;wc=Math.min(X.width,wc);Tc=Math.min(X.height, Tc);wc=Math.max(na.width,wc);Tc=Math.max(na.height,Tc);X=Tc+ef;G+=wa*rd-(wc+dc)*rd+Le+lc.left;ca+=db*Eb-X*Eb+Ua+lc.top;S.visible&&(Zb(gb,Db,eb,Ke,G,ca,J.width,J.height)?S.arrange(G,ca,wc,Tc):S.arrange(G,ca,wc,Tc,new N(gb,Db,eb,Ke)))}}L.free(v);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,p=n.x;n=n.y;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();b.Ne();for(var r=[],q=a.P.s,u=q.length,w=0;wy)){v=Yj(v.figure);for(var A=0;Ay&&z.push(B))}}}}q= a.P.s;u=q.length;for(w=0;we*v*c))){y=E.segmentIndex;if(!isFinite(y)||isNaN(y))y=0;0>y&&(y=v-Math.min(-y,v));y=Math.round(y%v);v=E.opacity;A=1;if(1!==v){if(0===v)continue;A=b.globalAlpha;b.globalAlpha=A*v}B=r[w];var M=!1,R=E.strokeDashArray;null!==R&&(M=!0,b.bs(R,E.strokeDashOffset));if("LineV"===E.figure&&null!==E.stroke&&0b)return a%b===c;if(a%b!==c)return!1;b=d.length;for(var e=0;en)z.measure(Infinity,Infinity,0,0),y=z.measuredBounds,c.Zc(y),r.push(y);else{var A=z.segmentIndex,B=z.segmentFraction,E=z.alignmentFocus;E.Jc()&&(E=xc);var M=z.segmentOrientation,R=z.segmentOffset;if(isNaN(A)){var S=k.ta;y=Ea();S.Mu(B,y);var J=I.allocAt(y[0],y[1]);J.add(k.i(0));S.type=== P.j?J.offset(-S.startX,-S.startY):(S=S.figures.first(),null!==S&&J.offset(-S.startX,-S.startY));S=y[2];if(M!==Zf){var G=k.computeAngle(z,M,S);z.Ib=G}G=J.x-b.x;var ca=J.y-b.y;I.free(J);Ga(y)}else if(A<-n||A>=n)y=I.alloc(),k.rg(),k.computeMidPoint(y),S=k.midAngle,M!==Zf&&(G=k.computeAngle(z,M,S),z.Ib=G),G=y.x-b.x,ca=y.y-b.y,I.free(y);else{G=0;0<=A?(ca=m.L(A),y=AX+10?0<=A?S.$a(ca):ca.$a(S):X>J+10?0<=A?y.$a(G):G.$a(y):0<=A?S.$a(G):G.$a(S)}else S=0<=A?ca.$a(y):y.$a(ca);M!==Zf&&(G=k.computeAngle(z,M,S),z.Ib=G);G=ca.x+(y.x-ca.x)*B-b.x;ca=ca.y+(y.y-ca.y)*B-b.y}z.measure(Infinity,Infinity,0,0);y=z.measuredBounds;J=z.naturalBounds;var na=0;z instanceof Bf&&(na=z.strokeWidth);X=J.width+na;var wa=J.height+na;q.reset();q.translate(-y.x,-y.y);q.scale(z.scale,z.scale);q.rotate(M===Zf?z.angle:S,X/2,wa/2);M!==Xm&&M!==Ym||q.rotate(90, X/2,wa/2);M!==Zm&&M!==$m||q.rotate(-90,X/2,wa/2);M===an&&(45S||225S)&&q.rotate(-S,X/2,wa/2);J=new N(0,0,X,wa);u.ui(J,E);q.Ga(u);E=-u.x+na/2*z.scale;z=-u.y+na/2*z.scale;w.assign(R);na=isNaN(R.x);var db=isNaN(R.y);if(na||db){X=X/2+3;wa=wa/2+3;var gb=45<=S&&135>=S,Db=225<=S&&315>=S;M===Zf&&(gb||Db)?(w.x=db?X:R.y,w.y=na?wa:R.x,gb?0<=A||isNaN(A)&&.5>B||!na||(w.y=-wa):Db&&((0<=A||isNaN(A)&&.5>B)&&na&&(w.y=-wa),db&&(w.x=-X))):(na&&(w.x=0<=A||isNaN(A)&&.5>B?X:-X),db&&(w.y=-wa),w.rotate(S))}else w.rotate(S); G+=w.x;ca+=w.y;J.set(y);J.h(G+E,ca+z,y.width,y.height);r.push(J);c.Zc(J)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.fg=c;a.position.h(b.x+c.x,b.y+c.y);Pb(e,c.width||0,c.height||0);ld.free(q);I.free(u);I.free(w)}}}}; Vm.prototype.arrange=function(a,b){var c=b.length;if(a instanceof te||a instanceof T){var d=a,e=null;a instanceof te&&(e=a,d=e.adornedPart);var f=a instanceof te?null:d.path,g=a.j;if(0!==g.length){var h=0;if(null!==f&&h=c)q=I.alloc(),r=n,w=q,r.rg(),r.computeMidPoint(w),r=n.midAngle,l!==Zf&&(n=n.computeAngle(g,l,r),g.angle=n),n=q.x,w=q.y, I.free(q);else{u=0;0<=h?(q=b.s[h],w=hz+10?0<=h?r.$a(q):q.$a(r):z>v+10?0<=h?w.$a(u):u.$a(w):0<=h?r.$a(u):u.$a(r)}else r=0<=h?q.$a(w):w.$a(q);l!==Zf&&(n=n.computeAngle(g,l,r),g.angle=n);n=q.x+(w.x-q.x)*k;w=q.y+(w.y-q.y)*k}if(p.rs())g.location=new I(n,w);else{p.Jc()&&(p=xc);q=ld.alloc();q.reset();q.scale(g.scale,g.scale);q.rotate(g.angle, 0,0);var y=g.naturalBounds;u=N.allocAt(0,0,y.width,y.height);v=I.alloc();v.ui(u,p);q.Ga(v);p=-v.x;z=-v.y;var A=y.width,B=y.height;y=I.alloc();y.assign(m);var E=isNaN(m.x),M=isNaN(m.y);if(E||M){A=A/2+3;B=B/2+3;var R=45<=r&&135>=r,S=225<=r&&315>=r;l===Zf&&(R||S)?(y.x=M?A:m.y,y.y=E?B:m.x,R?0<=h||isNaN(h)&&.5>k||!E||(y.y=-B):S&&((0<=h||isNaN(h)&&.5>k)&&E&&(y.y=-B),M&&(y.x=-A))):(E&&(y.x=0<=h||isNaN(h)&&.5>k?A:-A),M&&(y.y=-B),y.rotate(r))}else y.rotate(r);n+=y.x;w+=y.y;q.jp(u);p+=u.x;z+=u.y;h=I.allocAt(n+ p,w+z);g.move(h);I.free(h);I.free(y);I.free(v);N.free(u);ld.free(q)}}null!==e?e.Ql(!1):d.Ql(!1);d=bn(a);a.location.h(a.position.x+d.x,a.position.y+d.y);I.free(d)}}; function Wm(a,b,c,d){if(!1!==sj(d)){var e=d.strokeWidth;0===e&&a instanceof te&&a.type===W.Link&&a.adornedObject instanceof Bf&&(e=a.adornedObject.strokeWidth);e*=d.Aa;a instanceof T&&null!==a.ta?(a=a.geometry.bounds,d.Ce(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof te&&null!==a.adornedPart.ta?(a=a.adornedPart.ta.bounds,d.Ce(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):d.Ce(-(e/2),-(e/2),b+e,c+e);e=d.desiredSize;e.w()||null===d.ta?d.ac.h(0,0,e.width,e.height):d.ac.assign(d.ta.bounds);nj(d,!1)}} function cn(){this.wa="Base"}la(cn,Vl); cn.prototype.measure=function(a,b,c,d,e,f,g){var h=a.sb();a.graduatedBounds=[];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 N(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.graduatedBounds.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,w=r.flattenedLengths,v=r.flattenedTotalLength,z=u.length,y=0,A=0,B=Ea(),E=0;EX&&(X+=360);R.push(X)}y=G;A=ca}B.push(R)}if(null===a.graduatedIntervals){for(var na=[],wa=a.P.s,db=wa.length,gb=0;gbKe))for(var Ua=0;UaKe&&eb.push(Eb)}}}}a.graduatedIntervals=na}var Le=a.graduatedIntervals;var wc=a.P.s,Tc=wc.length,lc=0,dc=0,ef=v;a.graduatedMarks=[];for(var sd, wh=0;whyi*Fb*v/a.graduatedRange&&null===mc.graduatedSkip)){var rg=w[0][0],Fd=0,ec=0;dc=v*mc.graduatedStart-1E-4;ef=v*mc.graduatedEnd+1E-4;var Jf=yi*Fb,nc=a.graduatedTickBase;if(nca.graduatedMin+Jf&&(nc-=Math.floor((nc-a.graduatedMin)/Jf)*Jf);for(var lk=Le[wh],zi=nc,Mn=1E-6*a.graduatedMax,Td= 1;nc<=a.graduatedMax+Mn;Td++){a:{for(var oe=lk.length,sg=0;sg-xh){var hf=!1;break a}}hf=!0}if(hf&&(nc>a.graduatedMax&&(nc=a.graduatedMax),null===mc.graduatedSkip||mc instanceof Pg&&!mc.graduatedSkip(nc,mc)||mc instanceof Bf&&!mc.graduatedSkip(nc,mc))&&(lc=(nc-a.graduatedMin)*v/a.graduatedRange,lc>v&&(lc=v),dc<=lc&&lc<=ef)){for(var Ud=B[Fd][ec],Me=w[Fd][ec];Fdrg&&ecpe&&.4995pe?0pe||.9995tg){var zh=1-Math.abs(.5-pe);Ud=(td*zh+Hd*(1-zh))%360;break a}}}Ud=td}if(mc instanceof Pg){var ed="";null!==mc.graduatedFunction?(ed=mc.graduatedFunction(nc,mc),ed=null!==ed&&void 0!==ed?ed.toString():""):ed=(+nc.toFixed(2)).toString();""!==ed&&sd.push({Wl:yh,angle:Ud,text:ed})}else sd.push({Wl:yh,angle:Ud})}nc=zi+Td*Jf}}}a.graduatedMarks.push(sd)}Ga(B); var hb=a.graduatedMarks;if(null!==hb)for(var Ai=d.length,Sb=0;Sbfd;fd++){switch(fd){case 0:gc.h(Id,ud);break;case 1:gc.h(Id+Ah,ud);break;case 2:gc.h(Id,ud+Mf);break;case 3:gc.h(Id+Ah,ud+Mf)}gc.rotate(Oa+Va.angle);gc.offset(ok,Ch);0===Bh&&0===fd?Gc.h(gc.x,gc.y,0,0):Gc.Ue(gc);gc.offset(-ok,-Ch);gc.rotate(-Oa-Va.angle)}I.free(gc);null!==qe.graduatedBounds&&qe.graduatedBounds.push(Gc);Yb(Ne,Gc.x,Gc.y,Gc.width,Gc.height)}else if(Va instanceof Pg){var Uc=a,pk=e;null===Uc.temporaryTextBlock&&(Uc.temporaryTextBlock=new Pg);var oc=Uc.temporaryTextBlock;dn(oc,Va); var Oe=Va.alignmentFocus;Oe.Jc()&&(Oe=tc);for(var Vc=Va.segmentOrientation,Dh=Va.segmentOffset,lf=new N,Bi=0,Eh=0,Jd=0,Nf=0,mf=0,Fh=Tb.length,Pe=0;PeJd||225Jd)&&vd.rotate(-Jd,Re/2,Of/2);var vg=N.allocAt(0,0,Re,Of),Se=I.alloc();Se.ui(vg,Oe);vd.Ga(Se);var wg=-Se.x,On=-Se.y,se=I.alloc();se.assign(Dh);isNaN(se.x)&&(se.x=Re/2+3);isNaN(se.y)&&(se.y=-(Of/2+3));se.rotate(Jd);Bi+=se.x+wg;Eh+=se.y+On;var Pf=new N(Bi,Eh,Qe.width,Qe.height),Ci=new N(Qe.x,Qe.y,Qe.width,Qe.height),Pn=new N(re.x,re.y,re.width,re.height); Vd.Jz=Nf;Vd.lineCount=oc.lineCount;Vd.lines=[oc.Cb,oc.Eh,oc.$e,oc.He,oc.Nc,oc.Xb,oc.ve];Vd.actualBounds=Pf;Vd.measuredBounds=Ci;Vd.naturalBounds=Pn;0===Pe?lf.assign(Pf):lf.Zc(Pf);I.free(se);I.free(Se);N.free(vg);ld.free(vd)}null!==Uc.graduatedBounds&&Uc.graduatedBounds.push(lf);Yb(pk,lf.x,lf.y,lf.width,lf.height)}nj(Va,!1)}}}; cn.prototype.arrange=function(a,b,c){if(null!==a.graduatedBounds){var d=a.sb(),e=a.graduatedMarks;if(null!==e){var f=a.graduatedBounds,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=g&&(g=1);for(var h=f.actualBounds,k=a.P.s,l=a.graduatedMarks,m=k.length,n=0;na.graduatedTickUnit*p.interval*f.geometry.flattenedTotalLength/a.graduatedRange*g&&null===p.graduatedSkip)){var u= p.measuredBounds,w=p.strokeWidth*p.scale,v=p.alignmentFocus;v.Jc()&&(v=tc);for(var z=0;zg.height)continue}else if(l.position>g.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var n=l.separatorStroke;null===n&&(n=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(0!==m&&null!==n){hi(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray; null===p&&(p=c?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray);null!==p&&(n=!0,b.bs(p,0));b.beginPath();p=l.position+m;c?p>g.height&&(m-=p-g.height):p>g.width&&(m-=p-g.width);l=l.position+m/2;b.lineWidth=m;m=a.yb;c?(l+=m.top,p=g.width-m.right,b.moveTo(m.left,l),b.lineTo(p,l)):(l+=m.left,p=g.height-m.bottom,b.moveTo(l,m.top),b.lineTo(l,p));b.stroke();b.Ne();n&&b.Yr()}}}} function hn(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=kn(a,!0),l=kn(a,!1),m=0;mp)){var r=n.Rc(),q=n.separatorStrokeWidth;isNaN(q)&&(q=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var u=n.separatorStroke;null===u&&(u=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(null===u||n.index===(c?k:l))q=0;r-= q;q=n.position+q;r+=n.actual;q+r>p&&(r=p-q);0>=r||(p=a.yb,hi(a,b,n.background,!0,!1,h,g),c?b.fillRect(p.left,q+p.top,g.width-(p.left+p.right),r):b.fillRect(q+p.left,p.top,r,g.height-(p.top+p.bottom)))}}}}function kn(a,b){for(var c=b?a.rowCount:a.columnCount,d=0;dd&&e.set(q),I.free(q));I.free(m);f&&e.transform(g);return l}; t.Ej=function(){for(var a=this.P.s,b=a.length,c=0;cc||f>d)this.v(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case nd:this.v(!0);this.measure(c+h,d+g,0,0);break;case Vk:this.v(!0);this.measure(c+h,f+g,0,0);break;case Wk:this.v(!0),this.measure(b+h,d+g,0,0)}}this.na.arrange(this,e,this.fg)}}; t.ah=function(a){var b=this.naturalBounds,c=Fm(this);if(Zb(0,0,b.width,b.height,a.x,a.y)){b=this.P.s;for(var d=b.length,e=I.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(xb(e.set(a),f.transform),f.ca(e))return I.free(e),!0}I.free(e);return null===this.Ra&&null===this.areaBackground?!1:!0}return!1};t.cs=function(a){if(this.bindingId===a)return this;for(var b=this.P.s,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 W?m:null;p=ld.alloc();p.set(g); if(null!==m?m.zf(a,b,c,d,e,p):hl(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);ld.free(p)}}}void 0===f&&ld.free(g);return d}void 0===f&&ld.free(g);return!1};function rn(a,b,c,d){for(var e=a.P.s,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 W&&rn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.kg=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.oe(),k=h?a:xb(I.allocAt(a.x,a.y),this.transform),l=h?b:xb(I.allocAt(b.x,b.y),this.transform),m=k.yf(l),n=0w.width||u.y>w.height||0>u.x+u.width||0>u.y+u.height))if(q.oe()?(u=q.transform,xb(k.set(a),u),xb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof W?q:null,null!==q?q.kg(k,l,c,d,e,f):u.mx(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}I.free(k);I.free(l)}return e?n:g}return!1}; function Lm(a){var b=null;a instanceof Bf&&(b=a.spot1,b===Sc&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=sc);return b}function Mm(a){var b=null;a instanceof Bf&&(b=a.spot2,b===Sc&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Bc);return b}t.add=function(a){for(var b=[],c=0;c=e.count&&a>=e.count)return; e.nb(f);d=f}else C("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Eb(a,b);if(0===a||b.isPanelMain)this.Ug=null;sj(this)||this.v();b.v(!1);null!==b.portId?this.Oe=!0:b instanceof W&&!0===b.Oe&&(this.Oe=!0);this.graduatedIntervals=null;this.Ff()||sn(this,b,!1);c=this.part;null!==c&&(c.Nh=null,c.Xf=NaN,this.Oe&&c instanceof V&&(c.Oe=!0),c.Oe&&c instanceof V&&(c.tc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&& c.cb(fe,"elements",this,b,null,d,null),c.cb(ee,"elements",this,null,b,null,a)))};function tn(a,b){a.o=b?a.o|16777216:a.o&-16777217}t.remove=function(a){for(var b=this.P.s,c=b.length,d=-1,e=0;ea&&xa(a,">= 0",W,"getRowDefinition:idx");a=Math.round(a);var b=this.rowDefs;if(void 0===b[a]){var c=new Uj;c.ti(this);c.isRow=!0;c.index=a;b[a]=c;this.cb(ee,"rowdefs",this,null,c,null,a)}return b[a]};W.prototype.eA=function(a){0>a&&xa(a,">= 0",W,"removeRowDefinition:idx");if(0!==this.rowCount){a=Math.round(a);var b=this.rowDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.cb(fe,"rowdefs",this,c,null,a,null);this.v()}}}; function Vj(a,b,c){var d=a.rowDefs;if(!(0>b)){d[b]=c instanceof Uj?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.v()}}W.prototype.getColumnDefinition=function(a){0>a&&xa(a,">= 0",W,"getColumnDefinition:idx");a=Math.round(a);var b=this.colDefs;if(void 0===b[a]){var c=new Uj;c.ti(this);c.isRow=!1;c.index=a;b[a]=c;this.cb(ee,"coldefs",this,null,c,null,a)}return b[a]}; W.prototype.$z=function(a){0>a&&xa(a,">= 0",W,"removeColumnDefinition:idx");if(0!==this.columnCount){a=Math.round(a);var b=this.colDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.cb(fe,"coldefs",this,c,null,a,null);this.v()}}};function Wj(a,b,c){var d=a.colDefs;if(!(0>b)){d[b]=c instanceof Uj?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.v()}} W.prototype.addRowColumnDefinition=function(a){var b=null;a.isRow?b=this.getRowDefinition(a.index):a.isRow||(b=this.getColumnDefinition(a.index));b&&Ul(b,a);return this};t=W.prototype;t.fz=function(a){if(0>a||this.type!==W.Table||0===this.rowCount)return-1;for(var b=0,c=this.rowDefs,d=c.length,e=this.topIndex;ea||this.type!==W.Table||0===this.columnCount)return-1;for(var b=0,c=this.colDefs,d=c.length,e=this.leftIndex;ea;)this.mc(this.P.length-1,!1);wn(this,this.itemArray)}; function wn(a,b){var c=pn(a);if(null===b||0===b.length)for(;a.P.length>c;)a.mc(a.P.length-1,!1);else if(a.P.length<=c){c=b.length;for(var d=0;dc)){var e=yn(a,b);e=zn(a,e);if(null!==e){jg(e);e=e.copy();if(0!==(e.o&16777216)){var f=a.dh();null!==f&&tn(f,!0)}"object"===typeof b&&(null===a.ce&&(a.ce=new ob),a.ce.add(b,e));f=c+pn(a);a.Eb(f,e);d&&(e.ub=b,An(a,f,c),e.ub=null);e.data=b}}} function An(a,b,c){for(a=a.P;ba&&xa(a,">= 0",W,"padding"), a=new hc(a)):(0>a.left&&xa(a.left,">= 0",W,"padding:value.left"),0>a.right&&xa(a.right,">= 0",W,"padding:value.right"),0>a.top&&xa(a.top,">= 0",W,"padding:value.top"),0>a.bottom&&xa(a.bottom,">= 0",W,"padding:value.bottom"));var b=this.yb;b.C(a)||(this.yb=a=a.J(),this.v(),this.g("padding",b,a))}},defaultAlignment:{get:function(){return this.Qm},set:function(a){var b=this.Qm;b.C(a)||(this.Qm=a=a.J(),this.v(),this.g("defaultAlignment",b,a))}},defaultStretch:{ get:function(){return this.Rf},set:function(a){var b=this.Rf;b!==a&&(this.Rf=a,this.v(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{get:function(){return null!==this.T?this.T.Kp:pc},set:function(a){"number"===typeof a&&(a=new hc(a));var b=this.defaultSeparatorPadding;b.C(a)||(a=a.J(),null===this.T&&(this.T=new Fn),this.T.Kp=a,this.v(),this.g("defaultSeparatorPadding",b,a))}},defaultRowSeparatorStroke:{get:function(){return null!== this.T?this.T.ga:null},set:function(a){var b=this.defaultRowSeparatorStroke;b!==a&&(null===a||"string"===typeof a||a instanceof pl)&&(a instanceof pl&&a.freeze(),null===this.T&&(this.T=new Fn),this.T.ga=a,this.N(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return null!==this.T?this.T.Ha:1},set:function(a){var b=this.defaultRowSeparatorStrokeWidth;b!==a&&isFinite(a)&&0<=a&&(null===this.T&&(this.T=new Fn),this.T.Ha=a,this.v(), this.g("defaultRowSeparatorStrokeWidth",b,a))}},defaultRowSeparatorDashArray:{get:function(){return null!==this.T?this.T.V:null},set:function(a){var b=this.defaultRowSeparatorDashArray;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea)&&C("Panel.topIndex must be greater than zero and a real number, not: "+a),null===this.T&&(this.T=new Fn),this.T.Fb=a,this.v(),this.g("topIndex",b,a))}},leftIndex:{get:function(){return null!==this.T?this.T.hb:0},set:function(a){var b=this.leftIndex;b!==a&&((!isFinite(a)||0>a)&&C("Panel.leftIndex must be greater than zero and a real number, not: "+ a),null===this.T&&(this.T=new Fn),this.T.hb=a,this.v(),this.g("leftIndex",b,a))}},data:{get:function(){return this.ub},set:function(a){var b=this.ub;if(b!==a){var c=this instanceof U&&!(this instanceof te);jg(this);this.ub=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof T?(null!==b&&c.Ye.remove(b),null!==a&&c.Ye.add(a,this)):this instanceof U&&(null!==b&&c.Ze.remove(b),null!==a&&c.Ze.add(a,this))):(c=this.panel,null!==c&&null!==c.ce&&(null!==b&&c.ce.remove(b), null!==a&&c.ce.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Ma()}}},itemIndex:{get:function(){return this.vn},set:function(a){var b=this.vn;b!==a&&(this.vn=a,this.g("itemIndex",b,a))}},allBindings:{get:function(){return null!==this.A?this.A.ob:null},set:function(a){this.localBindings!==a&&(null===this.A&&(this.A=new cl),this.A.ob=a)}},itemArray:{get:function(){return this.Dh}, set:function(a){var b=this.Dh;if(b!==a||null!==a&&vn(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&Lj(c.partManager,this,c),this.Dh=a,null!==c&&null!==a&&Ij(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||wn(this,a)}}},itemTemplate:{get:function(){return null===this.itemTemplateMap?null:this.itemTemplateMap.I("")},set:function(a){if(null===this.itemTemplateMap){if(null===a)return;this.itemTemplateMap=new ob}var b=this.itemTemplateMap.I(""); b!==a&&((a instanceof U||a.isPanelMain)&&C("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.hv())}},itemTemplateMap:{get:function(){return null!==this.A?this.A.Mc:null},set:function(a){var b=this.itemTemplateMap;if(b!==a){for(var c=a.iterator;c.next(););bl(this);this.A.Mc=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing|| this.hv()}}},itemCategoryProperty:{get:function(){return null!==this.A?this.A.Lc:"category"},set:function(a){var b=this.itemCategoryProperty;b!==a&&(bl(this),this.A.Lc=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{get:function(){return 0!==(this.o&1048576)},set:function(a){var b=0!==(this.o&1048576);b!==a&&(this.o^=1048576,this.g("isAtomic",b,a))}},isClipping:{get:function(){return 0!==(this.o&2097152)}, set:function(a){var b=0!==(this.o&2097152);b!==a&&(this.o^=2097152,this instanceof pf&&(this.ib=null),this.v(),this.g("isClipping",b,a))}},isOpposite:{get:function(){return 0!==(this.o&33554432)},set:function(a){var b=0!==(this.o&33554432);b!==a&&(this.o^=33554432,this.v(),this.g("isOpposite",b,a))}},isEnabled:{get:function(){return 0!==(this.o&4194304)},set:function(a){var b=0!==(this.o&4194304);if(b!==a){var c=null===this.panel||this.panel.Ff(); this.o^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&sn(this,this,a)}}},alignmentFocusName:{get:function(){return this.We},set:function(a){var b=this.We;b!==a&&(this.We=a,this.v(),this.g("alignmentFocusName",b,a))}}}); ma.Object.defineProperties(W,{Position:{get:function(){return Tl.I("Position")}},Horizontal:{get:function(){return Tl.I("Horizontal")}},Vertical:{get:function(){return Tl.I("Vertical")}},Spot:{get:function(){return Tl.I("Spot")}},Auto:{get:function(){return Tl.I("Auto")}},Table:{get:function(){return Tl.I("Table")}},Viewbox:{ get:function(){return Tl.I("Viewbox")}},TableRow:{get:function(){return Tl.I("TableRow")}},TableColumn:{get:function(){return Tl.I("TableColumn")}},Link:{get:function(){return Tl.I("Link")}},Grid:{get:function(){return Tl.I("Grid")}},Graduated:{get:function(){return Tl.I("Graduated")}}});W.prototype.rebuildItemElements=W.prototype.hv; W.prototype.findItemPanelForData=W.prototype.lx;W.prototype.updateTargetBindings=W.prototype.Ma;W.prototype.copyTemplate=W.prototype.My;W.prototype.graduatedValueForPoint=W.prototype.yz;W.prototype.graduatedPointForValue=W.prototype.xz;W.prototype.findColumnForLocalX=W.prototype.Yy;W.prototype.findRowForLocalY=W.prototype.fz;W.prototype.removeColumnDefinition=W.prototype.$z;W.prototype.removeRowDefinition=W.prototype.eA;W.prototype.removeAt=W.prototype.nb;W.prototype.remove=W.prototype.remove; W.prototype.insertAt=W.prototype.Eb;W.prototype.elt=W.prototype.L;W.prototype.add=W.prototype.add;W.prototype.findObject=W.prototype.fb;W.prototype.findInVisualTree=W.prototype.Il;W.prototype.walkVisualTreeFrom=W.prototype.nm;W.prototype.findMainElement=W.prototype.sb;var Cn=!1,Dn=null,Tl=new ob;W.className="Panel";W.definePanelLayout=En;En("Position",new Em);En("Vertical",new Hm);En("Auto",new Km);En("Link",new Vm); function Gn(){this.eq=0;this.F=100;this.ga=10;this.V=0;this.Wh=this.m=this.j=this.u=null}Gn.prototype.copy=function(){var a=new Gn;a.eq=this.eq;a.F=this.F;a.ga=this.ga;a.V=this.V;a.u=this.u;a.j=this.j;a.m=this.m;a.Wh=this.Wh;return a};Gn.className="GradPanelSettings";function Fn(){this.Mc=[];this.Lc=[];this.j=this.pb=Hn;this.hb=this.Fb=0;this.Kp=pc;this.Ha=1;this.V=this.ga=null;this.F=1;this.ob=this.m=this.u=null} Fn.prototype.copy=function(a){for(var b=new Fn,c=this.Mc,d=c.length,e=b.Mc,f=0;fa&&xa(a,">= 0",Uj,"height"),this.Ec=a,this.actual=this.oa,null!==this.panel&&this.panel.v(), this.Lb("height",b,a))}},width:{get:function(){return this.Ec},set:function(a){var b=this.Ec;b!==a&&(0>a&&xa(a,">= 0",Uj,"width"),this.Ec=a,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Lb("width",b,a))}},minimum:{get:function(){return this.hj},set:function(a){var b=this.hj;b!==a&&((0>a||!isFinite(a))&&xa(a,">= 0",Uj,"minimum"),this.hj=a,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Lb("minimum",b,a))}},maximum:{ get:function(){return this.fj},set:function(a){var b=this.fj;b!==a&&(0>a&&xa(a,">= 0",Uj,"maximum"),this.fj=a,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Lb("maximum",b,a))}},alignment:{get:function(){return this.Hb},set:function(a){var b=this.Hb;b.C(a)||(this.Hb=a.J(),null!==this.panel&&this.panel.v(),this.Lb("alignment",b,a))}},stretch:{get:function(){return this.dg},set:function(a){var b=this.dg;b!==a&&(this.dg= a,null!==this.panel&&this.panel.v(),this.Lb("stretch",b,a))}},separatorPadding:{get:function(){return this.$f},set:function(a){"number"===typeof a&&(a=new hc(a));var b=this.$f;null!==a&&null!==b&&b.C(a)||(null!==a&&(a=a.J()),this.$f=a,null!==this.panel&&this.panel.v(),this.Lb("separatorPadding",b,a))}},separatorStroke:{get:function(){return this.ho},set:function(a){var b=this.ho;b!==a&&(null!==a&&Zl(a,"RowColumnDefinition.separatorStroke"), a instanceof pl&&a.freeze(),this.ho=a,null!==this.panel&&this.panel.v(),this.Lb("separatorStroke",b,a))}},separatorStrokeWidth:{get:function(){return this.io},set:function(a){var b=this.io;b!==a&&(this.io=a,null!==this.panel&&this.panel.v(),this.Lb("separatorStrokeWidth",b,a))}},separatorDashArray:{get:function(){return this.rj},set:function(a){var b=this.rj;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,w=Ea(),v=2;vn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;v=0;q=w[v];n=q[0];r=q[1];p=q[2];q=q[3];for(var z=0;.1<=u;){0===z&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1)); if(e>u){Ga(w);return}e>q?(z=e-q,e=q):z=0;var y=Math.sqrt(e*e/(1+p*p));0>n&&(y=-y);h+=y;k+=p*y;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===z&&d.bh(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==z){v++;if(v===w.length){Ga(w);return}q=w[v];n=q[0];r=q[1];p=q[2];q=q[3];e=z}}Ga(w)}} t.bh=function(a,b){var c=this.uc,d=this.Ri;if(null!==c||null!==d){var e=this.ta;if(null!==e){a.vc();var f=this.actualBounds,g=this.naturalBounds;null!==d&&hi(this,a,d,!0,!1,g,f);var h=this.part,k=this.eg;null===c||0!==k||null===h||!this.isPanelMain&&h.sb()!==this||(k=h.type===W.Link&&h instanceof te&&"Selection"===h.category&&h.adornedObject instanceof Bf&&h.adornedPart.sb()===h.adornedObject?h.adornedObject.strokeWidth:0);0===k&&(c=null);null!==c&&0!==k&&(hi(this,a,c,!1,!1,g,f),a.lineWidth=k,a.lineJoin= this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit);f=!1;h&&b.Df("drawShadows")&&(f=h.isShadowed);!1===a.Dl&&(f=!1);h=!0;null===c||null!==d&&"transparent"!==d||(h=!1);g=!1;k=this.strokeDashArray;null!==k&&(g=!0,a.bs(k,this.strokeDashOffset));if(e.type===P.j)a.beginPath(),a.moveTo(e.startX,e.startY),a.lineTo(e.endX,e.endY),null!==c&&a.ek(),a.Ne();else if(e.type===P.u){var l=e.startX;k=e.startY;var m=e.endX,n=e.endY;e=Math.min(l,m);var p=Math.min(k,n);l=Math.abs(m-l);k=Math.abs(n- k);a.beginPath();a.rect(e,p,l,k);null!==d&&a.jg(d);null!==c&&(h&&f&&tl(a),a.ek(),h&&f&&sl(a));a.Ne()}else if(e.type===P.F)l=e.startX,k=e.startY,m=e.endX,n=e.endY,e=Math.abs(m-l)/2,p=Math.abs(n-k)/2,l=Math.min(l,m)+e,k=Math.min(k,n)+p,a.beginPath(),a.moveTo(l,k-p),a.bezierCurveTo(l+K.sg*e,k-p,l+e,k-K.sg*p,l+e,k),a.bezierCurveTo(l+e,k+K.sg*p,l+K.sg*e,k+p,l,k+p),a.bezierCurveTo(l-K.sg*e,k+p,l-e,k+K.sg*p,l-e,k),a.bezierCurveTo(l-e,k-K.sg*p,l-K.sg*e,k-p,l,k-p),a.closePath(),null!==d&&a.jg(d),null!==c&& (h&&f&&tl(a),a.ek(),h&&f&&sl(a)),a.Ne();else if(e.type===P.m)for(e=e.figures,k=e.length,p=0;pu.sweepAngle,null!==r?r.endX:l.startX,null!==r?r.endY:l.startY)}else if(r=Nd(u,l),w=r.length,0===w)a.lineTo(u.centerX,u.centerY);else for(var v=0;v(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;N.free(f);return K.Ub(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== P.u){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.yc(-d,-d);if(f.ca(a))return N.free(f),!1;f.yc(d,d)}null!==this.stroke&&f.yc(e,e);a=f.ca(a);N.free(f);return a}if(c.type===P.F){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 N.free(f), !1;g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);N.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===P.m)return N.free(f),null===this.fill?Rd(c,a.x,a.y,e):Pd(c,a,e,1=this.strokeWidth)m=K.Re(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=Ea();a=new I;K.Re(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new I;K.Re(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new I;K.Re(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new I;K.Re(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 Ga(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)Math.abs(q)?(u*=.5/q,q=.5):0!==u&&.5>Math.abs(u)&&(q*=.5/u,u=.5),v-=q,z-= u;r.contains(v,z);)v-=q,z-=u;e.x=h;e.y=k;for(u=0;uc?a-c:c-a)<(b>d?b-d:d-b)?(a=ba||K.$(k.y,a))&&(k.yb||K.$(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.mx=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.ah(a,!0))return!0;var e=a.yf(b),f=e;1.5=e||zb(b,f,0,-n)>=e||zb(b, f,0,n)>=e||zb(b,f,m,0)>=e?!1:!0}else if(b.type===P.m){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&&yb(a.x,a.y,f,h,k,h)>e&&yb(a.x,a.y,k,l,f,l)>e&&yb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?Rd(b,a.x,a.y,f):Pd(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;be)return!1;h=f.segments.s;k=h.length;for(l=0;le)return!1;break;case Ed:var p=Ea();K.Le(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Ga(p);if(g)return!1;g=n.endX;m=n.endY;if(a.td(g,m)>e)return!1;break;case Kd:p=Ea();K.Yo(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Ga(p);if(g)return!1;g=n.endX;m=n.endY;if(a.td(g,m)>e)return!1;break;case Ld:case Md:p=n.type===Ld?Nd(n,f):Od(n,f,g,m);var r=p.length;if(0===r){g=n.type===Ld?n.centerX:n.endX;m=n.type===Ld?n.centerY:n.endY;if(a.td(g,m)>e)return!1; break}n=null;for(var q=Ea(),u=0;u= 0",Bf,"strokeWidth:value")}},strokeCap:{ get:function(){return null!==this.Na?this.Na.zr:"butt"},set:function(a){var b=this.strokeCap;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?xa(a,'"butt", "round", or "square"',Bf,"strokeCap"):(Jn(this),this.Na.zr=a,this.N(),this.g("strokeCap",b,a)))}},strokeJoin:{get:function(){return null!==this.Na?this.Na.Ar:"miter"},set:function(a){var b=this.strokeJoin;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?xa(a,'"miter", "bevel", or "round"', Bf,"strokeJoin"):(Jn(this),this.Na.Ar=a,this.N(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{get:function(){return null!==this.Na?this.Na.Br:10},set:function(a){var b=this.strokeMiterLimit;if(b!==a&&1<=a){Jn(this);this.Na.Br=a;this.N();var c=this.part;null!==c&&(c.Xf=NaN);this.g("strokeMiterLimit",b,a)}}},strokeDashArray:{get:function(){return this.Sg},set:function(a){var b=this.Sg;if(b!==a){if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1(n*n+m*m)*p*p&&(c=!0);b.jb!==a&&(c=!1);b.jb instanceof Aj&& (c=!1);!1===b.Df("textGreeking")&&(c=!1);b=this.spacingAbove;n=this.spacingBelow;switch(this.flip){case $k:a.translate(e,0);a.scale(-1,1);break;case Zk:a.translate(0,f);a.scale(1,-1);break;case al:a.translate(e,f),a.scale(-1,-1)}a.vc();m=this.Dc;p=(b+g+n)*m;f>p&&(d=this.verticalAlignment,d=d.y*f-d.y*p+d.offsetY);if(1===m&&null!==this.ve)n=this.Cb,n>e&&(n=e),this.Mj(this.ve,a,0,d+b,e,g,n,c,h,k,l);else if(null!==this.Nc&&null!==this.Xb)for(p=0;pe&&(r=e);d+=b;this.Mj(this.Xb[p], a,0,d,e,g,r,c,h,k,l);d+=g+n}switch(this.flip){case $k:a.scale(-1,1);a.translate(-e,0);break;case Zk:a.scale(1,-1);a.translate(0,-f);break;case al:a.scale(-1,-1),a.translate(-e,-f)}}}; t.Mj=function(a,b,c,d,e,f,g,h,k,l,m){var n=0;if(h)"left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),b.fillRect(c+n,d+.25*f,g,1);else{"left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2);e=null!==go?go(this,f):.75*f;b.fillText(a,c+n,d+e);a=f/20|0;0===a&&(a=1);"right"===k?n-=g:"center"===k&&(n-=g/2);if(l){h=null!==ho?ho(this,f):.8*f;k=c+n;l=d+h;e=c+n+g;h=d+h;var p=a;b.beginPath();b.lineWidth=p;b.moveTo(k,l);b.lineTo(e,h);b.stroke();b.Ne();b instanceof Aj&&b.Od.classList.add("gojs-td")}m&&(m= d+f-f/2.2|0,0!==a%2&&(m+=.5),d=c+n,f=m,c=c+n+g,g=m,n=a,b.beginPath(),b.lineWidth=n,b.moveTo(d,f),b.lineTo(c,g),b.stroke(),b.Ne(),b instanceof Aj&&b.Od.classList.add("gojs-td"))}}; t.fk=function(a,b,c){if(!Y.prototype.fk.call(this,a,b,c))return!1;hi(this,a,this.uc,!0,!1,this.naturalBounds,this.actualBounds);if(c){if(0===this.svg.getElementsByTagName("text").length)return!0;b=this.svg.getElementsByClassName("gojs-td");for(c=0;c=this.Xb.length))){l=this.Xb[k]; for(b=Math.max(1,a-b);ko(l)>b&&1=a.maxLines)null!==d&&d.h(0,h);else if(g=b,a.wrap===so){a.He=1;var l=ko(b);if(0===k||l<=c)a.Cb=Math.max(a.Cb,l),qo(a,b,a.Cb),null!==d&&d.h(l,h);else{f=to(a,g);g=g.substr(f.length);b=to(a,g);for(l=ko(f+b);0 c&&1c;){var n=1;l=ko(b.substr(0,n));for(m=0;l<=c;)n++,m=l,l=ko(b.substr(0,n));if(1===n){var p=l;f=Math.max(f,l)}else p=m,f=Math.max(f,m);n--;1>n&&(n=1);qo(a,b.substr(0,n),p);k++;b=b.substr(n);if(a.Dc+k>a.maxLines)break}m=to(a,g);for(l=ko(b+m);0a.maxLines))break}a.He=Math.min(a.maxLines,k);a.Cb=Math.max(a.Cb,f);null!==d&&d.h(a.Cb,h*a.He)}} function to(a,b){if(a.wrap===uo)return b.substr(0,1);for(var c=b.length,d=0,e=vo;d=b.length?b:b.substr(0,d)}function ko(a){return null===bo?8*a.length:bo.measureText(a).width}function fo(a){if(null!==a.$e)return a.$e;var b=a.we;if(null===bo){var c=16;return a.$e=c}void 0!==xo[b]&&5E3>yo?c=xo[b]:(c=1.3*bo.measureText("M").width,xo[b]=c,yo++);return a.$e=c} function no(a){if(null===bo)return 6;if(void 0!==zo[a]&&5E3>Ao)var b=zo[a];else b=bo.measureText(oo).width,zo[a]=b,Ao++;return b} function lo(a,b){var c=a.bc.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.spacingAbove+a.spacingBelow;d=Math.max(0,fo(a)+d);if(0===c.length)return a.Cb=0,a.Dc=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.Dc=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.wrap!==so){a.He=0;var k=L.alloc();ro(a,f,b,k);e+=k.height;L.free(k);a.Dc+=a.He}else ro(a,f,b,null),e+=d,a.Dc++;a.Dc===a.maxLines&&(h=!0)}f=g+1}return a.Eq=e} ma.Object.defineProperties(Pg.prototype,{font:{get:function(){return this.we},set:function(a){var b=this.we;b!==a&&(this.we=a,this.$e=null,this.v(),this.g("font",b,a))}},text:{get:function(){return this.bc},set:function(a){var b=this.bc;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.bc=a,this.v(),this.g("text",b,a),this.Uh=!0)}},textAlign:{get:function(){return null!==this.da?this.da.Gr:"start"},set:function(a){var b= this.textAlign;b===a||"start"!==a&&"end"!==a&&"left"!==a&&"right"!==a&&"center"!==a||(co(this),this.da.Gr=a,this.N(),this.g("textAlign",b,a))}},flip:{get:function(){return null!==this.da?this.da.Uf:kg},set:function(a){var b=this.flip;b!==a&&(co(this),this.da.Uf=a,this.N(),this.g("flip",b,a))}},verticalAlignment:{get:function(){return null!==this.da?this.da.Qr:Yc},set:function(a){var b=this.verticalAlignment;b.C(a)||(a=a.J(),co(this),this.da.Qr= a,Jl(this),this.g("verticalAlignment",b,a))}},naturalBounds:{get:function(){if(!this.ac.w()){var a=L.alloc();ro(this,this.bc,999999,a);var b=a.width;L.free(a);a=lo(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);Pb(this.ac,b,a)}return this.ac}},isMultiline:{get:function(){return 0!==(this.o&2097152)},set:function(a){var b=0!==(this.o&2097152);b!==a&&(this.o^=2097152,this.v(),this.g("isMultiline",b, a))}},isUnderline:{get:function(){return 0!==(this.o&4194304)},set:function(a){var b=0!==(this.o&4194304);b!==a&&(this.o^=4194304,this.Uh=!0,this.N(),this.g("isUnderline",b,a))}},isStrikethrough:{get:function(){return 0!==(this.o&8388608)},set:function(a){var b=0!==(this.o&8388608);b!==a&&(this.o^=8388608,this.Uh=!0,this.N(),this.g("isStrikethrough",b,a))}},wrap:{get:function(){return null!==this.da?this.da.Sr: Bo},set:function(a){var b=this.wrap;b!==a&&(co(this),this.da.Sr=a,this.v(),this.g("wrap",b,a))}},overflow:{get:function(){return null!==this.da?this.da.Tq:Co},set:function(a){var b=this.overflow;b!==a&&(co(this),this.da.Tq=a,this.v(),this.g("overflow",b,a))}},stroke:{get:function(){return this.uc},set:function(a){var b=this.uc;b!==a&&(null!==a&&Zl(a,"TextBlock.stroke"),a instanceof pl&&a.freeze(),this.uc=a,this.N(),this.g("stroke",b,a))}}, lineCount:{get:function(){return this.Dc}},lineHeight:{get:function(){return fo(this)}},editable:{get:function(){return 0!==(this.o&1048576)},set:function(a){var b=0!==(this.o&1048576);b!==a&&(this.o^=1048576,this.g("editable",b,a))}},textEditor:{get:function(){return null!==this.da?this.da.Ir:null},set:function(a){var b=this.textEditor;b!==a&&(co(this),this.da.Ir=a,this.g("textEditor", b,a))}},errorFunction:{get:function(){return null!==this.da?this.da.zd:null},set:function(a){var b=this.errorFunction;b!==a&&(co(this),this.da.zd=a,this.g("errorFunction",b,a))}},interval:{get:function(){return null!==this.fa?this.fa.Ok:1},set:function(a){var b=this.interval;a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){null===this.fa&&(this.fa=new $n);this.fa.Ok=a;this.v();var c=this.panel;null!==c&&(c.graduatedIntervals=null);this.g("interval", b,a)}}},graduatedStart:{get:function(){return null!==this.fa?this.fa.u:0},set:function(a){var b=this.graduatedStart;b!==a&&(0>a?a=0:1a?a=0:1=a&&xa(a,"> 0",Pg,"maxLines"),co(this),this.da.Cq=a,this.v(),this.g("maxLines",b,a))}},metrics:{get:function(){return{arrSize:null!==this.Nc?this.Nc:[this.Cb],arrText:null!==this.Xb?this.Xb:[this.ve],maxLineWidth:this.Cb,fontHeight:this.$e}}},choices:{get:function(){return this.Dm},set:function(a){var b=this.Dm;b!==a&&(this.Dm= a,this.g("choices",b,a))}}});var go=null,ho=null,so=new D(Pg,"None",0),po=new D(Pg,"WrapFit",1),Bo=new D(Pg,"WrapDesiredSize",2),uo=new D(Pg,"WrapBreakAll",3),Co=new D(Pg,"OverflowClip",0),mo=new D(Pg,"OverflowEllipsis",1),jo=new D(Pg,"FormatTrim",0),wo=new D(Pg,"FormatNone",0),vo=/[ \u200b\u00ad]/,xo=new Ta,yo=0,zo=new Ta,Ao=0,oo="...",io="",bo=null,ao=!1;Pg.className="TextBlock"; function eo(){this.jc=!1;this.zd=null;this.Uf=kg;this.Zp=jo;this.Cq=Infinity;this.Tq=Co;this.wr=this.vr=0;this.Gr="start";this.tj=this.Ir=this.Hr=null;this.Qr=Yc;this.Sr=Bo}eo.prototype.copy=function(){var a=new eo;a.zd=this.zd;a.Uf=this.Uf;a.Zp=this.Zp;a.Cq=this.Cq;a.Tq=this.Tq;a.vr=this.vr;a.wr=this.wr;a.Gr=this.Gr;a.Hr=this.Hr;a.Ir=this.Ir;a.tj=this.tj;a.Qr=this.Qr;a.Sr=this.Sr;return a};Pg.getEllipsis=function(){return oo};Pg.setEllipsis=function(a){oo=a;zo=new Ta;Ao=0};Pg.getBaseline=function(){return go}; Pg.setBaseline=function(a){go=a};Pg.getUnderline=function(){return ho};Pg.setUnderline=function(a){ho=a};Pg.isValidFont=function(a){ao||(bo=Ng?(new Ni(null)).context:null,ao=!0);if(null===bo)return!0;var b=bo.font;if(a===b||"10px sans-serif"===a)return!0;bo.font="10px sans-serif";bo.font=a;var c=bo.font;if("10px sans-serif"!==c)return bo.font=b,!0;bo.font="19px serif";var d=bo.font;bo.font=a;c=bo.font;bo.font=b;return c!==d};Pg.FormatNone=wo;Pg.FormatTrim=jo;Pg.None=so;Pg.OverflowClip=Co; Pg.OverflowEllipsis=mo;Pg.WrapBreakAll=uo;Pg.WrapDesiredSize=Bo;Pg.WrapFit=po;function $n(){this.Ok=1;this.u=0;this.j=1;this.m=this.F=null}$n.prototype.copy=function(){var a=new $n;a.Ok=this.Ok;a.u=this.u;a.j=this.j;a.F=this.F;a.m=this.m;return a};$n.className="GradElementSettings"; function ck(a,b){Y.call(this);this.Ag=null;this.mo="";this.Rg=cc;this.Ik=nd;this.Tg=this.zd=null;this.Hk=xc;this.Uf=kg;this.rl=null;this.mn=!1;this.an=!0;this.Wk=!1;this.nl=null;"string"===typeof a?this.source=a:a&&Object.assign(this,a);b&&Object.assign(this,b)}var Do;la(ck,Y);ck.prototype.cloneProtected=function(a){Y.prototype.cloneProtected.call(this,a);a.mo=this.mo;a.element=this.Ag;a.Rg=this.Rg.J();a.Ik=this.Ik;a.Uf=this.Uf;a.zd=this.zd;a.Tg=this.Tg;a.Hk=this.Hk.J();a.an=this.an;a.nl=this.nl}; ck.prototype.rb=function(a){a===kg||a===mg||a===Yk?this.imageStretch=a:Y.prototype.rb.call(this,a)};ck.prototype.toString=function(){return"Picture("+this.source+")#"+bb(this)};function Ki(a){void 0===a&&(a="");""!==a?Do[a]&&(delete Do[a],Eo--):(Do=new Ta,Eo=0)} function Fo(a,b){b.my||(b.yq=function(c){b.lq=!0;b.gn=!1;var d=b.xg.copy();if(null!==d&&void 0!==d){for(d=d.iterator;d.next();){var e=d.value;e.N();var f=b.getAttribute("src")||"";var g=e.Jg.I(f);if(null!==g)for(var h=g.length,k=0;k=d.width&&(f=f+q.offsetX+(n*q.x-d.width*q.x));p>=d.height&&(g=g+q.offsetY+(p*q.y-d.height*q.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case nd:n=d.width;p=d.height;break;case mg:case Yk:r===mg?(r=Math.min(d.height/p,d.width/n),n*=r,p*=r):r===Yk&&(r=Math.max(d.height/p,d.width/n),n*=r,p*=r,n>=d.width&&(f=(f+q.offsetX+(n*q.x-d.width*q.x)/n)*k),p>=d.height&&(g=(g+q.offsetY+(p*q.y-d.height*q.y)/ p)*h),k*=1/(n/d.width),h*=1/(p/d.height),n=d.width,p=d.height)}r=this.Af()*b.scale;var u=n*r*p*r,w=k*h/u,v=c.__goCache;r=null;var z=Go;if(!e){if(c.lq&&void 0!==v&&4z*z)for(null===v.di&&(Ho(v,4,l,m,c),Ho(v,16,l,m,c)),e=v.di,l=e.length,m=0;ma)a=5;a=Math.min(a,b/3);a=Math.min(a,c/3);var d="rr"+b+","+c+","+a,e=K.Jf[d];if(void 0!==e)return e;var f=a*K.sg;e=(new P).add((new Wd(a,0,!0)).add(new Xd(pd,b-a,0)).add(new Xd(Ed,b,a,b-f,0,b,f)).add(new Xd(pd,b,c-a)).add(new Xd(Ed,b-a,c,b,c-f,b-f,c)).add(new Xd(pd,a,c)).add(new Xd(Ed,0,c-a,f,c,0,c-f)).add(new Xd(pd,0,a)).add((new Xd(Ed,a,0,0,f,f,0)).close()));1e.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.maxSelectionCount)){this.G^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection; e.ka();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Sb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.Wb(),c.skipsUndoManager=d)}}}},isHighlighted:{get:function(){return 0!==(this.G&524288)},set:function(a){var b=0!==(this.G&524288);if(b!==a){this.G^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.ka(),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.G&8192)},set:function(a){var b=0!==(this.G&8192);b!==a&&(this.G^=8192,this.g("isShadowed",b,a),this.N())}},isAnimated:{get:function(){return 0!==(this.G&262144)},set:function(a){var b=0!==(this.G&262144);b!==a&&(this.G^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{get:function(){return null!==this.O?this.O.hq:null},set:function(a){var b=this.highlightedChanged; b!==a&&(No(this),this.O.hq=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{get:function(){return null!==this.O?this.O.mr:""},set:function(a){var b=this.selectionObjectName;b!==a&&(No(this),this.O.mr=a,this.Og=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{get:function(){return null!==this.O?this.O.kr:null},set:function(a){var b=this.selectionAdornmentTemplate;b!==a&&(No(this),this.O.kr=a,this.g("selectionAdornmentTemplate", b,a))}},selectionObject:{get:function(){if(null===this.Og){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.fb(a),null!==a?this.Og=a:this.Og=this):this instanceof T?(a=this.path,null!==a?this.Og=a:this.Og=this):this.Og=this}return this.Og}},selectionChanged:{get:function(){return null!==this.O?this.O.lr:null},set:function(a){var b=this.selectionChanged;b!==a&&(No(this),this.O.lr=a,this.g("selectionChanged",b,a))}},resizeAdornmentTemplate:{ get:function(){return null!==this.O?this.O.Zq:null},set:function(a){var b=this.resizeAdornmentTemplate;b!==a&&(No(this),this.O.Zq=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{get:function(){return null!==this.O?this.O.ar:""},set:function(a){var b=this.resizeObjectName;b!==a&&(No(this),this.O.ar=a,this.g("resizeObjectName",b,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.fb(a), null!==a)?a:this}},resizeCellSize:{get:function(){return null!==this.O?this.O.$q:Lb},set:function(a){var b=this.resizeCellSize;b.C(a)||(a=a.J(),No(this),this.O.$q=a,this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{get:function(){return null!==this.O?this.O.br:null},set:function(a){var b=this.rotateAdornmentTemplate;b!==a&&(No(this),this.O.br=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{ get:function(){return null!==this.O?this.O.cr:""},set:function(a){var b=this.rotateObjectName;b!==a&&(No(this),this.O.cr=a,this.g("rotateObjectName",b,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.fb(a),null!==a)?a:this}},rotationSpot:{get:function(){return null!==this.O?this.O.er:Sc},set:function(a){var b=this.rotationSpot;b.C(a)||(a=a.J(),No(this),this.O.er=a,this.g("rotationSpot",b,a))}},text:{ get:function(){return this.bc},set:function(a){var b=this.bc;b!==a&&(this.bc=a,this.g("text",b,a))}},containingGroup:{get:function(){return this.vh},set:function(a){if(this.Uc()){var b=this.vh;if(b!==a){null===a||this!==a&&!a.Md(this)||(this===a&&C("Cannot make a Group a member of itself: "+this.toString()),C("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.D(2);var c=this.diagram;null!==b?ap(b,this): this instanceof pf&&null!==c&&c.Yh.remove(this);this.vh=a;null!==a?$o(a,this):this instanceof pf&&null!==c&&c.Yh.add(this);this.D(1);if(null!==c&&c.aa){var d=this.data,e=c.model;if(null!==d&&e.Uj()){var f=e.va(null!==a?a.data:null);e.gp(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 pf)for(c=new H,Sk(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof V)for(d=d.linksConnected;d.next();)fp(d.value);if(this instanceof V){for(c=this.linksConnected;c.next();)fp(c.value);c=this.labeledLink;null!==c&&fp(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&ii(b,-1,a))}}else C("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return null!==this.O?this.O.Ep:null},set:function(a){var b=this.containingGroupChanged;b!==a&&(No(this),this.O.Ep=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{get:function(){return null!== this.containingGroup||this instanceof V&&null!==this.labeledLink?!1:!0}},layoutConditions:{get:function(){return null!==this.O?this.O.vq:127},set:function(a){var b=this.layoutConditions;b!==a&&(No(this),this.O.vq=a,this.g("layoutConditions",b,a))}},dragComputation:{get:function(){return null!==this.O?this.O.Op:null},set:function(a){var b=this.dragComputation;b!==a&&(No(this),this.O.Op=a,this.g("dragComputation",b,a))}},shadowOffset:{ get:function(){return null!==this.O?this.O.rr:sb},set:function(a){var b=this.shadowOffset;b.C(a)||(a=a.J(),No(this),this.O.rr=a,this.N(),this.g("shadowOffset",b,a))}},shadowColor:{get:function(){return null!==this.O?this.O.qr:"gray"},set:function(a){var b=this.shadowColor;b!==a&&(No(this),this.O.qr=a,this.N(),this.g("shadowColor",b,a))}},shadowBlur:{get:function(){return null!==this.O?this.O.Pg:4},set:function(a){var b=this.shadowBlur; b!==a&&(No(this),this.O.Pg=a,this.N(),this.g("shadowBlur",b,a))}}});U.prototype.invalidateLayout=U.prototype.D;U.prototype.findCommonContainingGroup=U.prototype.jx;U.prototype.isMemberOf=U.prototype.Md;U.prototype.findTopLevelPart=U.prototype.kz;U.prototype.findSubGraphLevel=U.prototype.gz;U.prototype.ensureBounds=U.prototype.Va;U.prototype.getDocumentBounds=U.prototype.ji;U.prototype.findObject=U.prototype.fb;U.prototype.moveTo=U.prototype.moveTo;U.prototype.invalidateAdornments=U.prototype.Sb; U.prototype.clearAdornments=U.prototype.Cj;U.prototype.removeAdornment=U.prototype.Gf;U.prototype.addAdornment=U.prototype.Wg;U.prototype.findAdornment=U.prototype.Nj;U.prototype.updateTargetBindings=U.prototype.Ma;var Yo=!1;U.className="Part";U.LayoutNone=0;U.LayoutAdded=1;U.LayoutRemoved=2;U.LayoutShown=4;U.LayoutHidden=8;U.LayoutNodeSized=16;U.LayoutGroupLayout=32;U.LayoutNodeReplaced=64;U.LayoutStandard=127;U.LayoutAll=16777215; function te(a,b){void 0===a||a instanceof Vl||"string"===typeof a?U.call(this,a):(U.call(this),a&&(b=a));this.G&=-257;this.Eg="Adornment";this.qe=null;this.tw=0;this.Nw=!1;this.j=this.Za=null;b&&Object.assign(this,b)}la(te,U);te.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};te.prototype.updateRelationshipsFromData=function(){}; te.prototype.Ql=function(a){var b=this.adornedObject,c=null===b||void 0===b?void 0:b.part;if(c instanceof T&&b instanceof Bf){b=c.path;c.Ql(a);a=b.geometry;c=this.P.s;b=c.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.Pe){b.Pe=!0;var c=new H;c.add(this);sp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===wi);b.Pe=!1}};function sp(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.Pe){b.Pe=!0;var c=new H;c.add(this);up(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===wi);b.Pe=!1}}; function up(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.Io():a.Kd();k.next();){var l=k.value;l.isTreeLink&&(h||l.xd||l.bb(),l=l.No(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Vb(!0),l.jh(),g&&e.Aj(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(ig.prototype,{padding:{get:function(){return this.yb},set:function(a){"number"===typeof a&&(a=new hc(a));var b=this.yb;b.C(a)||(this.yb=a=a.J(),this.g("padding",b,a),this.v())}}});ig.className="Placeholder"; function T(a){U.call(this,W.Link);this.Pa=8;this.af=null;this.bf="";this.rf=this.cn=null;this.sf="";this.qo=null;this.kk=Zf;this.Lm=0;this.Nm=Zf;this.Om=NaN;this.oj=zp;this.lo=.5;this.qd=null;this.Kb=(new F).freeze();this.nf=this.Hg=null;this.hl=new N;this.ta=new P;this.u=this.m=this.Pf=this.Tf=null;this.nu=new I;this.Wp=this.Fw=this.Ew=null;this.ot=NaN;this.ba=null;this.j=[];a&&Object.assign(this,a)}la(T,U); T.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);a.Pa=this.Pa&-113;a.bf=this.bf;a.cn=this.cn;a.sf=this.sf;a.qo=this.qo;a.kk=this.kk;a.Lm=this.Lm;a.Nm=this.Nm;a.Om=this.Om;a.oj=this.oj;a.lo=this.lo;null!==this.ba&&(a.ba=this.ba.copy())};t=T.prototype;t.xf=function(a){U.prototype.xf.call(this,a);this.bf=a.bf;this.sf=a.sf;a.Hg=null;a.bb();a.Pf=this.Pf;var b=a.fromPort;null!==b&&lp(b);a=a.toPort;null!==a&&lp(a)}; t.rb=function(a){a.classType===T?2===(a.value&2)?this.routing=a:a===bg||a===Yf||a===Xf?this.curve=a:a===Ap||a===Bp||a===Cp?this.adjusting=a:a!==zp&&a!==Zf&&C("Unknown Link enum value for a Link property: "+a):U.prototype.rb.call(this,a)};t.Sc=function(){null===this.ba&&(this.ba=new dl)};t.oi=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(tj(a)||uj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),tj(a)||uj(a))?!1:!0};t.sv=function(){return!1}; t.tv=function(){};t.Uc=function(){return!1};T.prototype.computeAngle=function(a,b,c){return T.computeAngle(b,c)};T.computeAngle=function(a,b){switch(a){default:case Zf:a=0;break;case en:a=b;break;case Xm:a=b+90;break;case Zm:a=b-90;break;case Dp:a=b+180;break;case fn:a=K.Wo(b);90a&&(a-=180);break;case Ym:a=K.Wo(b+90);90a&&(a-=180);break;case $m:a=K.Wo(b-90);90a&&(a-=180);break;case an:a=K.Wo(b);if(45a||225a)return 0;90a&&(a-=180)}return K.Wo(a)}; function fp(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.jx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.vh;if(c!==b){null!==c&&ap(c,a);a.vh=b;null!==b&&$o(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.xd||a.Ew!==c&&a.Fw!==c||a.bb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=T.prototype; t.jh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&U.prototype.jh.call(this)};t.No=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 pp(a,b){null===a.qd&&(a.qd=new H);a.qd.add(b);a.v()} t.Po=function(a){U.prototype.Po.call(this,a);Ep(this)&&this.Ro(this.actualBounds);if(!a){a=this.af;var b=null;null!==a&&(b=this.fromPort,np(a,this,b));var c=this.rf;if(null!==c){var d=this.toPort;c===a&&d===b||np(c,this,d)}Fp(this)}};t.Qo=function(a){U.prototype.Qo.call(this,a);Ep(this)&&this.Ro(this.actualBounds);if(!a){a=this.af;var b=null;null!==a&&(b=this.fromPort,op(a,this,b));var c=this.rf;if(null!==c){var d=this.toPort;c===a&&d===b||op(c,this,d)}Gp(this)}}; t.Jj=function(){this.xd=!0;if(null!==this.qd){var a=this.diagram;if(null!==a)for(var b=this.qd.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};T.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; T.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?U.prototype.move.call(this,a,!1):(a=I.allocAt(c.x+d,c.y+e),U.prototype.move.call(this,a,!1),I.free(a));bf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; T.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};T.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}; T.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(tb),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()===bg))return this.ta.Lu(.5,a),a.add(this.i(0)),c=this.ta.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===bg){if(3===b){c=this.i(0);d=this.i(1);var e=this.i(2);K.Vw(c.x,c.y,d.x,d.y,d.x,d.y,e.x,e.y,a); return a}d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);e=this.i(c+1);var f=this.i(c+2);c=this.i(c+3);K.Vw(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}; T.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).$a(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===bg))return this.ta.px(.5);if(this.computeCurve()===bg&&4<=a){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){c=Math.floor(c);a=this.i(c);b=this.i(c+1);var d=this.i(c+2);c=this.i(c+3);return K.Fy(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0d/2)break;e+=f;c++}b=this.i(c);d=this.i(c+1);if(1>Math.abs(b.x-d.x)&&1>Math.abs(b.y-d.y)){if(0Math.abs(b.x-d.x))return b.y>d.y?270:90;if(1>Math.abs(b.y-d.y))return b.x>d.x?180:0}return b.$a(d)};t=T.prototype;t.i=function(a){return this.Kb.s[a]};t.Yc=function(a,b){this.Kb.Xc(a,b)};t.M=function(a,b,c){this.Kb.Xc(a,new I(b,c))};t.Cz=function(a,b){this.Kb.Eb(a,b)}; t.l=function(a,b,c){this.Kb.Eb(a,new I(b,c))};t.je=function(a){this.Kb.add(a)};t.vf=function(a,b){this.Kb.add(new I(a,b))};t.kv=function(a){this.Kb.nb(a)};t.Dj=function(){this.Kb.clear()}; function bf(a,b,c){if(0!==b||0!==c)if(0===a.pointsCount)a.defaultFromPoint&&a.defaultFromPoint.offset(b,c),a.defaultToPoint&&a.defaultToPoint.offset(b,c);else{for(var d=a.xd,e=new F,f=a.Kb.iterator;f.next();){var g=f.value;e.add((new I(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Kb;a.Kb=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.zb?a.v():(a.ge.h(a.ge.x+b,a.ge.y+c),a.pa.h(a.pa.x+b,a.pa.y+c),Jl(a));d?Hp(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint= a.i(a.pointsCount-1)));null!==g&&g.animationManager.zb&&(b=g.animationManager,a.nf=e,b.kl.add(a));a.g("points",f,e)}}t.ph=function(){null===this.Hg&&(this.Hg=this.Kb,this.Kb=this.Kb.copy())}; t.wf=function(){if(null!==this.Hg){for(var a=this.Hg,b=this.Kb,c=Infinity,d=Infinity,e=a.s,f=e.length,g=0;gl&&(n=-n),u= (0>k?-1:1)*n+r,w=m*(u-r)+q);r=f.x+2*h/3;q=f.y+2*k/3;var v=r,z=q;K.B(k,0)?z=0k?-1:1)*n+r,z=m*(v-r)+q);this.Dj();this.je(f);this.vf(u,w);this.vf(v,z);this.je(p);this.Yc(0,this.getLinkPoint(a,b,g,!0,!1,d,e));this.Yc(3,this.getLinkPoint(d,e,c,!1,!1,a,b))}else if(f=d,p=e,d=this.getLinkPoint(a,b,g,!0,!1,f,p),e=this.getLinkPoint(f,p,c,!1,!1,a,b),this.hasCurviness())p=e.x-d.x,c=e.y-d.y,g=this.computeCurviness(),a=d.x+p/2,b=d.y+c/2,f=a,h=b,K.B(c,0)?h=0g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.je(d),this.vf(f,h),this.je(e);else{this.je(d);this.je(e);h=N.alloc();b.ji(h);k=h.ca(e);p.ji(h);l=h.ca(d);if(k||l)g=b.ja(Mp(g),new I),this.Yc(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.ja(Mp(c),new I),this.Yc(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));N.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Dj();var y=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);r=u=q=0;if(m||!h||l)w=this.computeEndSegmentLength(a,b,g,!0),r= this.getLinkDirection(a,b,n,g,!0,m,d,e),l&&(h||g.C(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(r-=m?90:30,0>y&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(w+=Math.abs(y)*(m?1:2)),0===r?q=w:90===r?u=w:180===r?q=-w:270===r?u=-w:(q=w*Math.cos(r*Math.PI/180),u=w*Math.sin(r*Math.PI/180)),g.Jc()&&l&&(w=b.ja(xc,I.alloc()),v=I.allocAt(w.x+1E3*q,w.y+1E3*u),this.getLinkPointFromPoint(a,b,w,v,!0,n),I.free(w),I.free(v));w=this.getLinkPoint(d,e,c,!1,m,a,b);var A=z=v=0;if(m||!k||l){var B=this.computeEndSegmentLength(d,e, c,!1);A=this.getLinkDirection(d,e,w,c,!1,m,a,b);l&&(k||g.C(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(A+=m?0:30,0>y&&(A+=180));0>A?A+=360:360<=A&&(A-=360);l&&(B+=Math.abs(y)*(m?1:2));0===A?v=B:90===A?z=B:180===A?v=-B:270===A?z=-B:(v=B*Math.cos(A*Math.PI/180),z=B*Math.sin(A*Math.PI/180));c.Jc()&&l&&(c=e.ja(xc,I.alloc()),g=I.allocAt(c.x+1E3*v,c.y+1E3*z),this.getLinkPointFromPoint(d,e,c,g,!1,w),I.free(c),I.free(g))}c=n;if(m||!h||l)c=new I(n.x+q,n.y+u);g=w;if(m||!k||l)g=new I(w.x+v,w.y+z);!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} T.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new I);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.oe()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.ke;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.Qj(e,d,g,c,f);null!== a&&f.transform(a);return f};function Op(a,b){var c=b.Vn;null===c&&(c=new Pp,c.port=b,c.node=b.part,b.Vn=c);return Qp(c,a)} T.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new I);if(c.tb()&&!Lp(c))return b.ja(c,h),h;if(c.Vc()){var k=Op(this,b);if(null!==k){h.assign(k.To);if(e&&this.routing===Rp){var l=Op(this,g);if(null!==l&&k.Cl=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.Ef(Cc)||c.Ef(Fc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);I.free(k);I.free(l)}}return h}}c= b.ja(Mp(c),I.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=I.alloc(),g=g.ja(Mp(k),f),e&&(g=Np(c,g)),I.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);I.free(c);return h}; T.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.tb())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=I.alloc(),h=h.ja(xc,c),I.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;I.free(k);k=c}d.Jc()&&g.Md(a)&&(k+=180,360<=k&&(k-=360));if(Lp(d))return k;a=b.ii();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};T.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.Vc()&&(a=Op(this,b),null!==a))return a.Du;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; T.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=xc:(b=this.fromSpot,b.Tb()&&(b=a.fromSpot),a=b===Sc?rc:b)):(a=b?b:this.toPort,null===a?a=xc:(b=this.toSpot,b.Tb()&&(b=a.toSpot),a=b===Sc?rc:b));return a};function Lp(a){return a===rc||.5===a.x&&.5===a.y}function Mp(a){return.5===a.x&&.5===a.y?a:xc} T.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==Zf&&4p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=ld.alloc();n.set(g); if(m instanceof W)h=m.zf(a,b,c,d,e,n);else if(this.path===m){if(m instanceof Bf)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.$g(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.Me(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var w=I.alloc(),v=I.alloc(),z=I.alloc(),y=ld.alloc();y.set(q);y.Yu(m.transform);y.Ol();v.x=p;v.y=u;v.transform(y);w.x=h;w.y=u;w.transform(y);q=!1;Wn(m,w,v,z)?q=!0:(w.x=p,w.y=r,w.transform(y),Wn(m,w,v,z)?q=!0:(v.x= h,v.y=r,v.transform(y),Wn(m,w,v,z)?q=!0:(w.x=h,w.y=u,w.transform(y),Wn(m,w,v,z)&&(q=!0))));ld.free(y);I.free(w);I.free(v);I.free(z);h=q}}else h=m.$g(h,n)}else h=hl(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));ld.free(n)}}}void 0===f&&ld.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&ld.free(g);return!1}; T.prototype.computeCurve=function(){if(null===this.Tf){var a=this.fromPort,b=this.isOrthogonal;this.Tf=null!==a&&a===this.toPort&&!b}return this.Tf?bg:this.curve};T.prototype.computeCorner=function(){if(this.curve===bg)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; T.prototype.findMidLabel=function(){for(var a=this.path,b=this.P.s,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);K.$(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.Yc(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.M(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.Yc(c,d)}}return!0;case Cp:f=this.i(a);n=this.i(c);if(!f.ab(b)||!n.ab(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.Yc(a,b);for(a+=1;ab?b+=360:360<=b&&(b-=360);0>d?d+=360:360<=d&&(d-=360);var g=d;b=315<=b||45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=315<=d||45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.actualBounds.copy(),k=f.actualBounds.copy();if(h.w()&&k.w()){h.yc(Up,Up);k.yc(Up,Up);h.Ue(a);k.Ue(c);var l=I.alloc(),m=I.alloc();if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l.h(c.x,a.y),m.h(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.xk.top&&a.yh.bottom)180===d&&(k.ca(a)||h.ca(c))? l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l.h(Math.max((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y&&k.lefta.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,a.y,k.right,c.y,!1):a.x>k.left&&(270===d&&a.yk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.left,m.x=l.x, m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.yh.bottom)0===d&&(k.ca(a)||h.ca(c))?l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x= c.x,m.y=l.y;if(l.y>h.top&&l.y=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l.h(Math.min((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y||180===d&&c.xa.y||0===d&&c.x>a.x&&k.bottom>a.y)l.h(a.x,c.y),m.h((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.x,a.y,c.x, c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.xa.x?(l.y=a.yk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.yk.left&&a.xh.right)270===d&&(k.ca(a)||h.ca(c))?l.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1):c.xa.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l.h(a.x,Math.max((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xa.x&&k.top=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,k.bottom,!0):a.y>k.top&&(180===d&&a.xk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.xh.right)90===d&&(k.ca(a)||h.ca(c))?l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.xa.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l.h(a.x,Math.min((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x=Xp&&(yk(r),h.yc(r.Do*r.Bx,r.Co*r.Cx),Vp(r,a,b,n,d,h,!1),k=Wp(r, n.x,n.y));if(!r.abort&&kthis.pointsCount)0===b||180===b?(h.x=a.x,h.y=n.y):(h.x=n.x,h.y=a.y),this.M(2,h.x,h.y),this.l(3,h.x,h.y);else if(g=this.i(3),0===b||180===b)K.B(h.x,g.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.M(2,h,a.y),this.M(3,h,g.y)):K.B(h.y,g.y)?(Math.abs(a.y-h.y)<=r.Co/2&&(this.M(2,h.x,a.y),this.M(3,g.x,a.y)),this.l(2,h.x,a.y)):this.M(2,a.x,h.y);else if(90===b||270===b)K.B(h.y,g.y)?(h=90===b?Math.max(h.y,a.y): Math.min(h.y,a.y),this.M(2,a.x,h),this.M(3,g.x,h)):K.B(h.x,g.x)?(Math.abs(a.x-h.x)<=r.Do/2&&(this.M(2,a.x,h.y),this.M(3,a.x,g.y)),this.l(2,a.x,h.y)):this.M(2,h.x,a.y);null!==c&&(a=this.i(1),g=this.i(2),a.x!==g.x&&a.y!==g.y?0===b||180===b?this.l(2,a.x,g.y):this.l(2,g.x,a.y):0===b||180===b?this.l(2,e.x,c.y):this.l(2,c.x,e.y));null!==q&&(0===d||180===d?this.vf(f.x,q.y):this.vf(q.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.je(l.copy()),this.je(m.copy()));I.free(l);I.free(m)}}; T.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;!this.hasCurviness()||this.computeSpot(!0,this.fromPort).Vc()||this.computeSpot(!1,this.toPort).Vc()||(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f}; function Rj(a){if(null===a.diagram||!a.isAvoiding||!ik(a.diagram))return!1;var b=a.points.s,c=b.length;if(4>c)return!1;a=jk(a.diagram,!0,a.containingGroup,null);for(var d=1;dZp&&Wp(b,m,n)!==l-1&&(Wp(b,c-h,d)===l-1?(e=180,m=c-h,n=d):Wp(b,c+h,d)===l-1?(e=0,m=c+h,n=d):Wp(b,c,d-k)===l-1?(e=270,m=c,n=d-k):Wp(b,c,d+k)===l-1&&(e=90,m=c,n=d+k));for(;l>Zp&&Wp(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,--l;if(f){if(l>Zp)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/ k)*k+k/2;l>Zp&&(f=e,g=c,m=d,0===e?(f=90,m+=k):90===e?(f=180,g-=h):180===e?(f=270,m-=k):270===e&&(f=0,g+=h),Wp(b,g,m)===l-1?Yp(a,b,g,m,f,!1,f):(g=c,m=d,0===e?(f=270,m-=k):90===e?(f=0,g+=h):180===e?(f=90,m+=k):270===e&&(f=180,g-=h),Wp(b,g,m)===l-1&&Yp(a,b,g,m,f,!1,f)));a.vf(c,d)}T.prototype.Xy=function(a){var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=yb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gthis.pointsCount?this.gk=!0:this.ta=this.makeGeometry();a=this.path;if(null!==a){a.ta=this.ta;for(var b=this.P.s,c=b.length,d=0;d=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;kw?q>r?(f.x=v-y,f.y=r-y,e.x=v+u,e.y=r+u):(f.x=v-y,f.y=r+y,e.x=v+u,e.y=r-u):q>r?(f.x=v+y,f.y=r-y,e.x=v-u,e.y=r+u):(f.x=v+y,f.y=r+y,e.x=v-u,e.y=r-u));K.$(w,v)&&K.$(r,q)&&(r>p?(z>v?(f.x=v-y,f.y=r-y,e.x=v+u):(f.x=v+y,f.y=r-y,e.x=v-u),e.y=r+u):(z>v?(f.x=v-y,f.y=r+y,e.x=v+u):(f.x=v+y,f.y=r+y,e.x=v-u),e.y=r-u));if(K.$(w,v)&&K.$(v,z)||K.$(p,r)&&K.$(r,q))w=.5*(w+z),p=.5*(p+q),f.x=w,f.y=p,e.x=w,e.y=p;1===n?(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y)):2===n&&K.$(g.x,this.i(0).x)&&K.$(g.y,this.i(0).y)&& (c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y));xd(h,c.x-d,c.y-k,f.x-d,f.y-k,l.x-d,l.y-k);b.set(f);c.set(e);g=l}}l=g.x;g=g.y;m=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(m=$p(this,m.copy(),!1,pb));l=.5*(l+m.x);g=.5*(g+m.y);xd(h,e.x-d,e.y-k,l-d,g-k,m.x-d,m.y-k);I.free(b);I.free(c);I.free(f);I.free(e)}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=$p(this,g.copy(),!1,pb)),xd(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f= I.alloc();f.assign(this.i(0));e=I.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=0;n=b-1){if(!f.C(m))0!==this.computeShortLength(!1)&&(m=$p(this,m.copy(),!1,pb)),cq(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;nf.x?A=p.x-q:A=p.x+q;v.y>p.y?z=p.y+y:z=p.y-y;v=I.allocAt(A,B);cq(this,h,n,w,f,v,u);I.free(v);yd(h,p.x+n,p.y+w,r+n,z+w);f.h(r,z)}else K.B(f.x,p.x)&&K.B(p.y,v.y)?(q=Math.min(g,Math.abs(p.y-e.y)/2),q=y=Math.min(q,Math.abs(v.x-p.x)/2),K.B(y,0)?(cq(this,h,n,w,f,p,u),f.assign(p)):(A=p.x,B=p.y,r=A,z=B,p.y>f.y?B=p.y-q:B=p.y+q,v.x>p.x?r=p.x+y:r=p.x-y,v=I.allocAt(A,B),cq(this,h,n,w,f,v,u),I.free(v),yd(h,p.x+n,p.y+w,r+n,z+w),f.h(r,z))):(cq(this,h,n,w,f, p,u),f.assign(p));e.assign(m);n=l}I.free(f)}Bd=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=$p(this,e,!0,f)),0!==this.computeShortLength(!1)&&(h=$p(this,h,!1,f)),a.type=P.j,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.gk=!0;return a};function bq(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 K.$(a,0)?b:K.$(b,0)?a:Math.sqrt(a*a+b*b)} function $p(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=bq(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=bq(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 aq(a,b,c,d){for(var e=a.pointsCount,f=b;K.$(b.x,f.x)&&K.$(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!K.$(b.x,f.x)&&!K.$(b.y,f.y))return c-1;for(var g=f;K.$(b.x,f.x)&&K.$(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||K.$(b.y,f.y)&&K.$(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}T.prototype.computeJumpLength=function(){return 10}; function cq(a,b,c,d,e,f,g){if(!g&&Ep(a)){g=a.computeJumpLength();var h=g/2,k=[],l=0;a.isVisible()&&(l=dq(a,e,f,k));if(0n-g)l--,n=Math.max(m-h,f.x);else break;m=f.y-g+d;n+=c;r=f.y+d;a.curve===Yf?wd(b,n,r,!1):xd(b,p,m,n,m,n,r)}else if(K.B(e.x,f.x))if(e.ym-g)l--,m=Math.max(n-h,f.y);else break;n=f.x-g+c;r=f.x+c;m+=d;a.curve===Yf?wd(b,r,m,!1):xd(b,n,p,n,m,r,m)}}b.lineTo(f.x+c,f.y+d)} function dq(a,b,c,d){var e=a.diagram;if(null===e||b.C(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Oa.s;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,w)n&&!K.B(g,w)){h.x=q;h.y=n;m=!0;break a}}else if(!K.B(n,r)&& K.B(g,w)&&Math.min(n,r)g&&Math.min(q,u)m&&!K.B(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}I.free(h)}function Ep(a){a=a.curve;return a===Xf||a===Yf}function Ip(a,b){if(b||Ep(a))b=a.diagram,null===b||b.animationManager.isTicking||b.zh.contains(a)||0===a.hl.width&&0===a.hl.height||b.zh.add(a,a.hl.copy())} T.prototype.Ro=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isTicking){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.Oa.s;for(var g=e.length,h=0;ha&&xa(a,">= 0",T,"fromEndSegmentLength"),this.Sc(), this.ba.Si=a,this.g("fromEndSegmentLength",b,a),this.bb())}},fromShortLength:{get:function(){return null!==this.ba?this.ba.Ti:NaN},set:function(a){var b=this.fromShortLength;b!==a&&(this.Sc(),this.ba.Ti=a,this.nc(),this.g("fromShortLength",b,a))}},toSpot:{get:function(){return null!==this.ba?this.ba.wj:Sc},set:function(a){var b=this.toSpot;b.C(a)||(a=a.J(),this.Sc(),this.ba.wj=a,this.g("toSpot",b,a),(b.Vc()||a.Vc())&&null!==this.toNode&& lp(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return null!==this.ba?this.ba.uj:NaN},set:function(a){var b=this.toEndSegmentLength;b!==a&&(0>a&&xa(a,">= 0",T,"toEndSegmentLength"),this.Sc(),this.ba.uj=a,this.g("toEndSegmentLength",b,a),this.bb())}},toShortLength:{get:function(){return null!==this.ba?this.ba.vj:NaN},set:function(a){var b=this.toShortLength;b!==a&&(this.Sc(),this.ba.vj=a,this.nc(),this.g("toShortLength",b, a))}},isLabeledLink:{get:function(){return null===this.qd?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);K.zl(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.Ue(f),e=2;ed&&(d=-d)):K.$(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.yf(e)); a.push(d)}}return this.Wp}},flattenedTotalLength:{get:function(){var a=this.ot;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;dthis.pointsCount)return this.gk=!0,this.ta;this.ta=this.makeGeometry()}return this.ta}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Lp(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return 0=== a?0:2>=a?a-1:this.isOrthogonal||!Lp(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.kk},set:function(a){var b=this.kk;b!==a&&(this.kk=a,this.g("adjusting",b,a))}},corner:{get:function(){return this.Lm},set:function(a){var b=this.Lm;b!==a&&(this.Lm=a,this.nc(),this.g("corner",b,a))}},curve:{get:function(){return this.Nm},set:function(a){var b=this.Nm;b!==a&&(this.Nm=a,this.bb(),this.nc(), Ip(this,b===Yf||b===Xf||a===Yf||a===Xf),this.g("curve",b,a))}},curviness:{get:function(){return this.Om},set:function(a){var b=this.Om;b!==a&&(this.Om=a,this.bb(),this.nc(),this.g("curviness",b,a))}},routing:{get:function(){return this.oj},set:function(a){var b=this.oj;b!==a&&(this.oj=a,this.Tf=null,this.bb(),Ip(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{get:function(){return this.lo}, set:function(a){var b=this.lo;b!==a&&(this.lo=a,this.nc(),this.g("smoothness",b,a))}},key:{get:function(){var a=this.diagram;if(null!==a&&a.model.ni())return a.model.xc(this.data)}}});T.prototype.invalidateOtherJumpOvers=T.prototype.Ro;T.prototype.findClosestSegment=T.prototype.Xy;T.prototype.updateRoute=T.prototype.rg;T.prototype.invalidateRoute=T.prototype.bb;T.prototype.rollbackRoute=T.prototype.mv;T.prototype.commitRoute=T.prototype.wf;T.prototype.startRoute=T.prototype.ph; T.prototype.clearPoints=T.prototype.Dj;T.prototype.removePoint=T.prototype.kv;T.prototype.addPointAt=T.prototype.vf;T.prototype.addPoint=T.prototype.je;T.prototype.insertPointAt=T.prototype.l;T.prototype.insertPoint=T.prototype.Cz;T.prototype.setPointAt=T.prototype.M;T.prototype.setPoint=T.prototype.Yc;T.prototype.getPoint=T.prototype.i;T.prototype.getOtherPort=T.prototype.uz;T.prototype.getOtherNode=T.prototype.No; var Jp=null,Kp=null,zp=new D(T,"Normal",1),hq=new D(T,"Orthogonal",2),iq=new D(T,"AvoidsNodes",6),Rp=new D(T,"AvoidsNodesStraight",7),Zf=new D(T,"None",0),bg=new D(T,"Bezier",9),Yf=new D(T,"JumpGap",10),Xf=new D(T,"JumpOver",11),Ap=new D(T,"End",17),Bp=new D(T,"Scale",18),Cp=new D(T,"Stretch",19),en=new D(T,"OrientAlong",21),Xm=new D(T,"OrientPlus90",22),Zm=new D(T,"OrientMinus90",23),Dp=new D(T,"OrientOpposite",24),fn=new D(T,"OrientUpright",25),Ym=new D(T,"OrientPlus90Upright",26),$m=new D(T,"OrientMinus90Upright", 27),an=new D(T,"OrientUpright45",28),Tp=16,Sp=14,Up=8;T.className="Link";T.Normal=zp;T.Orthogonal=hq;T.AvoidsNodes=iq;T.AvoidsNodesStraight=Rp;T.None=Zf;T.Bezier=bg;T.JumpGap=Yf;T.JumpOver=Xf;T.End=Ap;T.Scale=Bp;T.Stretch=Cp;T.OrientAlong=en;T.OrientPlus90=Xm;T.OrientMinus90=Zm;T.OrientOpposite=Dp;T.OrientUpright=fn;T.OrientPlus90Upright=Ym;T.OrientMinus90Upright=$m;T.OrientUpright45=an;T.EndSegmentStep=8;T.CurvinessStart=Tp;T.SpacingMin=Sp;T.OrthoShortCut=Up; function gq(a,b,c,d){Qa(this);this.Be=this.jq=!1;this.ws=a;this.Kx=b;this.Zu=c;this.Lx=d;this.links=[]}gq.prototype.Nl=function(){if(!this.jq){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.Ed=Math.floor((a.x-this.oc)/this.oc)*this.oc;this.Fd=Math.floor((b-this.pc)/this.pc)*this.pc;this.An=Math.ceil((c+2*this.oc)/this.oc)*this.oc;this.Bn=Math.ceil((d+2*this.pc)/this.pc)*this.pc;a=1+(Math.ceil((this.An-this.Ed)/this.oc)|0);b=1+(Math.ceil((this.Bn-this.Fd)/this.pc)|0);if(null===this.Yb||this.ai=Zp&&(c[d]=jq)} kk.prototype.Vj=function(a,b,c,d){if(a>this.An||a+cthis.Bn||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.ai)|0;for(c=Math.min(b+e-1,this.bi)|0;a<=d;a++){e=this.Yb[a];for(var f=b;f<=c;f++)if(e[f]===Ak)return!1}return!0}; function kq(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.Yb[l][m];if(n>=Zp&&n=a.Yb[l][m]);)a.Yb[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)kq(a,b,c,1,!e,f,g,h,k),kq(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)kq(a,b,c,1,!e,f,g,h,k),kq(a,b,c,-1,!e,f,g,h, k)}}function lq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=Ak,m=Zp;for(a.Yb[b][c]=m;l===Ak&&b>f&&bh&&cf&&bh&&c=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=f.x;d=f.y;b=f.x+f.width;var p=f.y+f.height;n-=a.Ed;n/=a.oc;d-=a.Fd;d/=a.pc;b-=a.Ed;b/=a.oc;p-=a.Fd;p/=a.pc;f=Math.max(0,Math.min(a.ai,n|0));b=Math.min(a.ai,Math.max(0,b|0));n=Math.max(0,Math.min(a.bi,d|0));p=Math.min(a.bi,Math.max(0,p|0));d=a.Yb;h|=0;k|=0;l|=0;m|= 0;var r=0===c||90===c?1:-1;c=90===c||270===c;d[h][k]===Ak?(lq(a,h,k,r,c,f,b,n,p),lq(a,h,k,1,!c,f,b,n,p),lq(a,h,k,-1,!c,f,b,n,p)):lq(a,h,k,r,c,h,k,h,k);d[l][m]===Ak?(mq(a,l,m,0===e||90===e?1:-1,90===e||270===e,f,b,n,p),mq(a,l,m,1,!(90===e||270===e),f,b,n,p),mq(a,l,m,-1,!(90===e||270===e),f,b,n,p)):mq(a,l,m,r,c,l,m,l,m);c=Ea();if(g&&nq(a,l,m,e,h,k,c)){if(c[0]!==l||c[1]!==m)c.unshift(m),c.unshift(l);if(c[c.length-2]!==h||c[c.length-1]!==k)c.push(h),c.push(k);a=Zp;e=c[c.length-2];g=c[c.length-1];d[e][g]= a++;for(f=c.length-4;0<=f;f-=2)for(e=c[f+2],g=c[f+3],b=c[f],l=c[f+1];b>e?e++:bg?g++:le)m--;else break;else if(n>f)n--;else break;var p=h[m][n];if(0===p||p===oq)break;k=m;l=n}for(;;){m=d;n=k;p=l;0===d?pf&&(m=270,p--):90===d?ne&&(m=180,n--):180===d?pf&&(m=270,p--):ne&&(m=180,n--);n=h[n][p];if(m!==d&&0!==n&&n!==oq){g.push(k);g.push(l);if(nq(a,k,l, m,e,f,g))return!0;g.pop();g.pop()}h[k][l]=oq;if(0===d){if(k===b)return!1;k--}else if(90===d){if(l===c)return!1;l--}else if(180===d){if(k===b)return!1;k++}else{if(l===c)return!1;l++}}} ma.Object.defineProperties(kk.prototype,{bounds:{get:function(){return new N(this.Ed,this.Fd,this.An-this.Ed,this.Bn-this.Fd)}},Do:{get:function(){return this.oc},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.Nl=function(){this.le.length=0}; function Qp(a,b){var c=a.le;if(0===c.length){a:if(!a.Vo){c=a.Vo;a.Vo=!0;var d=null,e=a.node,f=e instanceof pf?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.kx();else{if(!f.actualBounds.w()){a.Vo=c;break a}d=f;g=d.Fu()}f=a.le.length=0;var h=a.port.ja(sc,I.alloc()),k=a.port.ja(Bc,I.alloc());e=N.allocAt(h.x,h.y,0,0);e.Ue(k);I.free(h);I.free(k);h=I.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.ii();for(g=g.iterator;g.next();){var l=g.value;if(l.isVisible()&& l.fromPort!==l.toPort){var m=l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Md(d),n=l.computeSpot(m,a.port);if(n.Vc()&&(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.$a(m);p-=k;0>p?p+=360:360<=p&&(p-=360);n=pq(e,n,p,l.isOrthogonal);0===n?(n=4,180p&&(p+=360));r=a.le[f];void 0===r?(r=new qq(l,p,n),a.le[f]=r):(r.link=l,r.angle=p,r.Kc= n);r.dv.set(m);f++}}}}I.free(h);a.le.sort(Pp.prototype.j);k=a.le.length;d=-1;for(f=h=0;fMath.abs(u)?(z=Math.abs(u)/p,p=Math.abs(u)):z=1;break;case 2:r>Math.abs(y)?(z=Math.abs(y)/r,r=Math.abs(y)):z=1;break;case 1:n>Math.abs(u)?(z=Math.abs(u)/n,n=Math.abs(u)):z=1;break;default:case 4:m>Math.abs(y)?(z=Math.abs(y)/ m,m=Math.abs(y)):z=1}v=0}var E=A.To;if(d===wp){A=A.link.computeThickness();A*=z;E.set(B);switch(q){case 8:E.x=B.x+u/2+p/2-v-A/2;break;case 2:E.y=B.y+y/2+r/2-v-A/2;break;case 1:E.x=B.x+u/2-n/2+v+A/2;break;default:case 4:E.y=B.y+y/2-m/2+v+A/2}v+=A}else{var M=.5;d===hp&&(M=(A.Oo+1)/(A.Cl+1));E.x=B.x+u*M;E.y=B.y+y*M}}}I.free(h);I.free(k);I.free(g);I.free(l);B=a.le;for(f=0;fb.Kc?1:a.angleb.angle?1:0}; Pp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,rc,b.fromPort===this.port),d=a.Oo;if(0>d)return c;var e=a.Cl;if(1>=e||!b.isOrthogonal)return c;b=a.dv;var f=a.To;if(2===a.Kc||8===a.Kc)d=e-1-d;return((a=2===a.Kc||4===a.Kc)?b.y=b-1?(f=0,d=c,e+=g+20,g=0):f++}}; ri.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var b=this.arrangementOrigin.x,c=b,d=this.arrangementOrigin.y,e=0,f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value.node;if(!(null===h||h instanceof T)&&(tq(h),this.mh(h))){var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(c,d);h instanceof pf&&(h.mh=!1);c+=Math.max(l,50)+20;f=Math.max(f,Math.max(k,50));e>=a-1?(e= 0,c=b,d+=f+20,f=0):e++}}};ri.prototype.mh=function(a){return!a.location.w()||a instanceof pf&&a.mh?!0:!1};function sq(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 V?k.isLinkLabel||(k instanceof pf?null===k.layout?sq(a,b,k.memberParts,!1,e,f,g,h):(tq(k),b.add(k)):(tq(k),b.add(k))):g&&k instanceof T?b.add(k):!h||!k.Uc()||k instanceof V||(tq(k),b.add(k)))}} function tq(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Va()}ri.prototype.ki=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new N),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b}; ri.prototype.Yw=function(a){var b=new H;a instanceof Q?(sq(this,b,a.nodes,!0,null,!0,!0,!0),sq(this,b,a.links,!0,null,!0,!0,!0),sq(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof pf?sq(this,b,a.memberParts,!1,null,!0,!0,!0):sq(this,b,a.iterator,!1,null,!0,!0,!0);return b}; ri.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.ja(sc),(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(ri.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},group:{get:function(){return this.m},set:function(a){this.m!==a&&(this.m=a,null!==a&&(this.H=a.diagram))}},isOngoing:{get:function(){return this.on},set:function(a){this.on!==a&&(this.on=a)}},isInitial:{get:function(){return this.Ch},set:function(a){this.Ch=a;a||(this.tn=!0)}}, isViewportSized:{get:function(){return this.un},set:function(a){this.un!==a&&(this.un=a)&&this.D()}},isRouting:{get:function(){return this.rn},set:function(a){this.rn!==a&&(this.rn=a)}},isRealtime:{get:function(){return this.qn},set:function(a){this.qn!==a&&(this.qn=a)}},isValidLayout:{get:function(){return this.tn},set:function(a){this.tn!==a&&(this.tn=a,a||(a=this.diagram,null!== a&&(a.sh=!0)))}},network:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,null!==a&&(a.layout=this))}},boundsComputation:{get:function(){return this.Bm},set:function(a){this.Bm!==a&&(this.Bm=a,this.D())}},arrangementOrigin:{get:function(){return this.xm},set:function(a){this.xm.C(a)||(this.xm.assign(a),this.D())}}});ri.prototype.collectParts=ri.prototype.Yw;ri.prototype.getLayoutBounds=ri.prototype.ki; ri.prototype.invalidateLayout=ri.prototype.D;ri.className="Layout";function rq(a){Qa(this);this.Oc=a;this.tf=new H;this.ue=new H;this.xs=new ob;this.ss=new ob}rq.prototype.clear=function(){if(this.tf)for(var a=this.tf.iterator;a.next();)a.value.clear();if(this.ue)for(a=this.ue.iterator;a.next();)a.value.clear();this.tf=new H;this.ue=new H;this.xs=new ob;this.ss=new ob}; rq.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.tf.count+" edges: "+this.ue.count;if(1b?1:0):1:null!==b?-1:0} ma.Object.defineProperties(uq.prototype,{sourceEdgesArrayAccess:{get:function(){return this.pg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.ig._dataArray}},data:{get:function(){return this.ub},set:function(a){this.ub=a;if(null!==a&&a.bounds){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.m.h(d/2,b/2);this.j.h(a,c,d,b)}}},node:{get:function(){return this.Oh}, set:function(a){if(this.Oh!==a){this.Oh=a;a.Va();var b=this.network.layout,c=N.alloc(),d=b.ki(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.j.h(b,e,f,d);N.free(c);if(!(a instanceof pf)&&(a=a.locationObject.ja(xc),a.w())){this.m.h(a.x-b,a.y-e);return}this.m.h(f/2,d/2)}}},bounds:{get:function(){return this.j},set:function(a){this.j.C(a)||this.j.assign(a)}},focus:{get:function(){return this.m},set:function(a){this.m.C(a)|| this.m.assign(a)}},centerX:{get:function(){return this.j.x+this.m.x},set:function(a){var b=this.j;b.x+this.m.x!==a&&(b.ka(),b.x=a-this.m.x,b.freeze())}},centerY:{get:function(){return this.j.y+this.m.y},set:function(a){var b=this.j;b.y+this.m.y!==a&&(b.ka(),b.y=a-this.m.y,b.freeze())}},focusX:{get:function(){return this.m.x},set:function(a){var b=this.m;b.x!==a&&(b.ka(),b.x=a,b.freeze())}},focusY:{ get:function(){return this.m.y},set:function(a){var b=this.m;b.y!==a&&(b.ka(),b.y=a,b.freeze())}},x:{get:function(){return this.j.x},set:function(a){var b=this.j;b.x!==a&&(b.ka(),b.x=a,b.freeze())}},y:{get:function(){return this.j.y},set:function(a){var b=this.j;b.y!==a&&(b.ka(),b.y=a,b.freeze())}},width:{get:function(){return this.j.width},set:function(a){var b=this.j;b.width!==a&&(b.ka(),b.width= a,b.freeze())}},height:{get:function(){return this.j.height},set:function(a){var b=this.j;b.height!==a&&(b.ka(),b.height=a,b.freeze())}},network:{get:function(){return this.pb},set:function(a){this.pb=a}},sourceVertexes:{get:function(){for(var a=new H,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new H,b= this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new H,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.pg.iterator}},destinationEdges:{get:function(){return this.ig.iterator}},edges:{get:function(){for(var a= new F,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.pg.count+this.ig.count}}});uq.prototype.deleteDestinationEdge=uq.prototype.El;uq.prototype.addDestinationEdge=uq.prototype.vl;uq.prototype.deleteSourceEdge=uq.prototype.Fl;uq.prototype.addSourceEdge=uq.prototype.yl;uq.className="LayoutVertex";uq.standardComparer=Bq; uq.smartComparer=function(a,b){if(null!==a){if(null!==b){a=a.Oh;var c=b.Oh;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.Ea("Layout");d=[];switch(this.alignment){case Kq:var h=b,k=c,l=N.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n=m=0;nf-1||0g)d.push(new N(0,u,g+h,v)),w=0,q=r,u+=v,v=0;v=Math.max(v,E);switch(p){case Jq:A=-A.width;break;default:A= 0}y.moveTo(q+A,u);switch(p){case Jq:q-=B;break;default:q+=B}w++}d.push(new N(0,u,g+h,v));N.free(l);break;case Cq:k=g;m=f;n=b;p=c;g=N.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=I.alloc();for(q=0;q=l&&(k-=l);l=y=0;B=Math.max(this.cellSize.height,1);A=f=0;E=!0;w=I.alloc();for(M=0;Mm-1||0k){d.push(new N(0,E?z-f:z,k+n,A+f+p));for(R=0;Rl&&(f.width+=f.x-l,f.x=l);N.free(g)}for(h=f=g=e=0;hb?1:0} ma.Object.defineProperties(Nk.prototype,{wrappingWidth:{get:function(){return this.vo},set:function(a){this.vo!==a&&(0n)){var u=n+pn(q);q.mc(u,!0);An(q,u,n)}}b.isModified=!0}}finally{b.aa=!0}}}}};ni.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Ma(a);for(b=this.nodes.iterator;b.next();)b.value.Ma(a);for(b=this.links.iterator;b.next();)b.value.Ma(a)}; ni.prototype.lp=function(){for(var a=this.H.model,b=new H,c=a.nodeDataArray,d=0;d=d)return"[]";var e=new Sa;e.add("[");c&&1d)return;Da(a.Pc,d)}wr(a,"nodeDataArray",fe,"nodeDataArray",a,b,null,d,null);a.kp(b)}t.dA=function(a){if(Aa(a))for(var b=a.length,c=0;cb&&(b=a.length);Ca(a,b,c);wr(this,"",ee,"",a,null,c,null,b)};t.jv=function(a,b){void 0===b&&(b=-1);a===this.Pc&&C("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Da(a,b);wr(this,"",fe,"",a,c,null,b,null)}; t.Lo=function(a){if(null===a)return"";var b=this.jj;if(""===b)return"";b=Bn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;C("getCategoryForNodeData found a non-string category for "+a+": "+b)};t.gm=function(a,b){if(null!==a){var c=this.jj;if(""!==c)if(this.mb(a)){var d=Bn(a,c);void 0===d&&(d="");d!==b&&(Tj(a,c,b),wr(this,"nodeCategory",ce,c,a,d,b))}else Tj(a,c,b)}};t.im=function(a,b){this.gm(b,this.Lo(a))};t.Pl=function(){return!1};t.Tj=function(){return!1};t.ni=function(){return!1}; t.qs=function(){return!1};t.Uj=function(){return!1};function pi(){return new Z}function rr(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 rr(a,b.constructor);return typeof b}function vr(a){return zr[a]?zr[a]:void 0!==x.go&&x.go[a]?x.go[a]:null} function Bn(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 Tj(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.wa},set:function(a){var b=this.wa;b!==a&&(this.wa=a,this.g("name",b,a))}},dataFormat:{get:function(){return this.Pm},set:function(a){var b=this.Pm;b!==a&&(this.Pm=a,this.g("dataFormat",b,a))}},isReadOnly:{get:function(){return this.Cg},set:function(a){var b=this.Cg;b!==a&&(this.Cg=a,this.g("isReadOnly",b,a))}},modelData:{ get:function(){return this.j},set:function(a){var b=this.j;b!==a&&(this.j=a,this.g("modelData",b,a),this.Ma(a))}},undoManager:{get:function(){return this.m},set:function(a){var b=this.m;b!==a&&(null!==b&&b.Nx(this),this.m=a,null!==a&&a.Qw(this))}},skipsUndoManager:{get:function(){return this.Qg},set:function(a){this.Qg=a}},nodeKeyProperty:{get:function(){return this.Ph},set:function(a){var b=this.Ph; b!==a&&(""===a&&C("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===fe){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;za(a)&&"number"===typeof c&&(d=this.xc(a),b?(this.Wf.add(a),this.dd[c]!==a&&this.dd.splice(c,0,a),void 0!==d&&this.wb.add(d,a)):(this.Wf.remove(a),this.dd[c]=== a&&this.dd.splice(c,1),void 0!==d&&this.wb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.Bf(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.changeState.call(this,a,b)}};t=Cr.prototype;t.Rl=function(a){if(void 0!==a){var b=this.Oi;if(null!==b){var c=this.dc(a);null===c&&(c=this.copyNodeData(b),Tj(c,this.nodeKeyProperty,a),this.uf(c))}return a}}; t.sx=function(a){return Yq(this,a,!0)};t.pv=function(a,b){fr(this,a,b,!0)};t.vx=function(a){return Yq(this,a,!1)};t.uv=function(a,b){fr(this,a,b,!1)};function Yq(a,b,c){if(null!==b&&(a=c?a.gf:a.hf,""!==a&&(a=Bn(b,a),void 0!==a))){if($q(a))return a;C((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} function fr(a,b,c,d){null===c&&(c=void 0);if(null!==b){var e=d?a.gf:a.hf;if(""!==e)if(c=a.Rl(c),a.Gc(b)){var f=Bn(b,e);f!==c&&(dr(a,f,b),Tj(b,e,c),null===a.dc(c)&&er(a,c,b),wr(a,d?"linkFromKey":"linkToKey",ce,e,b,f,c),"string"===typeof e&&a.Ma(b,e))}else Tj(b,e,c)}}t.tx=function(a){return Xq(this,a,!0)};t.qv=function(a,b){gr(this,a,b,!0)};t.wx=function(a){return Xq(this,a,!1)};t.vv=function(a,b){gr(this,a,b,!1)}; function Xq(a,b,c){if(null===b)return"";a=c?a.cj:a.dj;if(""===a)return"";b=Bn(b,a);return void 0===b?"":b}function gr(a,b,c,d){if(null!==b){var e=d?a.cj:a.dj;if(""!==e)if(a.Gc(b)){var f=Bn(b,e);void 0===f&&(f="");f!==c&&(Tj(b,e,c),wr(a,d?"linkFromPortId":"linkToPortId",ce,e,b,f,c),"string"===typeof e&&a.Ma(b,e))}else Tj(b,e,c)}}t.Bf=function(a){if(null===a)return Fr;var b=this.fe;if(""===b)return Fr;a=Bn(a,b);return void 0===a?Fr:a}; t.Es=function(a,b){if(null!==a){var c=this.fe;if(""!==c)if(this.Gc(a)){var d=Bn(a,c);void 0===d&&(d=Fr);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.Gc(a)&&(dr(this,b,a),wr(this,"linkLabelKeys",fe,c,a,b,null,e,null)))}else void 0!==d&&C(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};t.xc=function(a){if(null!==a){var b=this.Fh;if(""!==b&&(b=Bn(a,b),void 0!==b)){if($q(b))return b;C("Key value for link data "+a+" is not a number or a string: "+b)}}}; t.Ds=function(a,b){if(null!==a){var c=this.Fh;if(""!==c)if(this.Gc(a)){var d=Bn(a,c);d!==b&&null===this.eh(b)&&(Tj(a,c,b),void 0!==d&&this.wb.remove(d),this.wb.add(b,a),wr(this,"linkKey",ce,c,a,d,b),"string"===typeof c&&this.Ma(a,c))}else Tj(a,c,b)}};t.eh=function(a){null===a&&C("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&$q(a)?this.wb.I(a):null}; t.us=function(a){if(null!==a){var b=this.Fh;if(""!==b){var c=this.xc(a);if(void 0===c||this.wb.contains(c)){var d=this.Yk;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.wb.contains(c))){Tj(a,b,c);return}if("string"===typeof c){for(d=2;this.wb.contains(c+d);)d++;Tj(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.wb.count-1;this.wb.contains(c);)c--;Tj(a,b,c)}}}}};t.Gc=function(a){return null===a?!1:this.Wf.contains(a)};t.ci=function(a){null!==a&&(fb(a),this.Gc(a)||br(this,a,!0))}; function br(a,b,c){if(""!==a.linkKeyProperty){var d=a.xc(b);if(void 0!==d&&a.wb.I(d)===b)return;a.us(b);d=a.xc(b);void 0===d&&C("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");a.wb.add(d,b)}a.Wf.add(b);d=null;c&&(d=a.dd.length,a.dd.splice(d,0,b));wr(a,"linkDataArray",ee,"linkDataArray",a,null,b,null,d);Gr(a,b)}t.zy=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.dd.splice(d,1)}wr(a,"linkDataArray",fe,"linkDataArray",a,b,null,d,null);c=Yq(a,b,!0);dr(a,c,b);c=Yq(a,b,!1);dr(a,c,b);d=a.Bf(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 F;b.addAll(a.iterator);a=new F;var c=new F;var d=this.sort(b);var e,f,g=this.Dp;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===Xr&&k===Yr?h=Jr:h===Xr&&k!==Yr&&(h=this.arrangement);if((this.direction===Sr||this.direction===Tr)&&this.sorting!==Mr){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===Sr?(this.arrangement===Xr&&a.reverse(),d=new F,d.addAll(a),d.addAll(c)):(this.arrangement===Xr&&c.reverse(),d=new F,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===Lr?1:-1)/k,u=d.L(r).diameter;isNaN(u)&&(u=$r(d.L(r),q));360>p&&(0===r||r===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===Xr){isNaN(b)&&(b=6);if(h!==Jr&&h!==Xr){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g= r/(360<=p?k:k-1)}this.dw=h;this.hc=l;this.Wm=m;this.ew=n;this.Pp=p;this.Qi=b;this.ie=f;this.Dp=g;b=d;d=this.dw;h=this.hc;l=this.ew;m=this.Pp;n=this.Qi;p=this.ie;k=this.Dp;if(this.direction!==Sr&&this.direction!==Tr||d!==Xr)if(this.direction===Sr||this.direction===Tr){g=0;switch(d){case Wr:g=180*cs(this,h,p,l,k)/Math.PI;break;case Jr:k=b=0;g=a.first();null!==g&&(b=$r(g,Math.PI/2));g=c.first();null!==g&&(k=$r(g,Math.PI/2));g=180*cs(this,h,p,l,n+(b+k)/2)/Math.PI;break;case Vr:g=m/b.length}if(this.direction=== Sr){switch(d){case Wr:ds(this,a,l,Ur);break;case Jr:es(this,a,l,Ur);break;case Vr:fs(this,a,m/2,l,Ur)}switch(d){case Wr:ds(this,c,l+g,Lr);break;case Jr:es(this,c,l+g,Lr);break;case Vr:fs(this,c,m/2,l+g,Lr)}}else{switch(d){case Wr:ds(this,c,l,Ur);break;case Jr:es(this,c,l,Ur);break;case Vr:fs(this,c,m/2,l,Ur)}switch(d){case Wr:ds(this,a,l+g,Lr);break;case Jr:es(this,a,l+g,Lr);break;case Vr:fs(this,a,m/2,l+g,Lr)}}}else switch(d){case Wr:ds(this,b,l,this.direction);break;case Jr:es(this,b,l,this.direction); break;case Vr:fs(this,b,m,l,this.direction);break;case Xr:gs(this,b,m,l,this.direction)}else gs(this,b,m,l-m/2,Lr)}this.updateParts();this.network=null;this.isValidLayout=!0};function fs(a,b,c,d,e){var f=a.Pp,g=a.hc;a=a.ie;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===Lr?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;js(a,k,l,m,n,e,f)||ks(a,k,l,m,n,e,f);k=f.x;l=f.y}I.free(f);a.kj++;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.kj?a.hc-g/(2*Math.PI):5>m.length&&10=n.length-1)break;js(a,k,l,n,p,e,m)||ks(a,k,l,n,p,e,m);k=m.x;l=m.y}I.free(m);a.kj++;if(!(23a.kj?a.hc-f/(2*Math.PI):a.hc-(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 ks(a,b,c,d,e,f,g){var h=a.hc,k=a.ie,l=0;a=(d[e].height+d[e+1].height)/2+a.Qi;d=!1;if(0<=b!==(f===Lr)){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}Ir.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; Ir.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 I(0,0):(c.x=this.arrangementOrigin.x+this.hc,c.y=this.arrangementOrigin.y+this.ie);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.Va(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.ne(c.ne(a)),this.group.move(b),this.Sv=b.ne(a))}; Ir.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function bs(a,b,c,d,e){var f=a.oy;if(.001>Math.abs(a.Wm-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 as(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?bs(a,1,c,d,e):bs(a,1,c))}function cs(a,b,c,d,e){if(.001>Math.abs(a.Wm-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}} Ir.prototype.sort=function(a){switch(this.sorting){case Qr:break;case Rr:a.reverse();break;case Or:a.sort(this.comparer);break;case Pr:a.sort(this.comparer);a.reverse();break;case Mr:return this.Yj(ls(a));default:C("Invalid sorting type.")}return a}; function ls(a){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]++}return c} Ir.prototype.Yj=function(a){for(var b=[],c=0;cb[c].indexOf(e)&&b[c].push(e);for(d=d.sourceEdges;d.next();)e=a.indexOf(d.value.fromVertex),e!==c&&0>b[c].indexOf(e)&&b[c].push(e)}f=[];for(c=0;cb[c[q]].indexOf(c[q===c.length-1?0:q+1])&&r.push(q===c.length-1?0:q+1);if(0===r.length)for(q=0;qc.indexOf(E)||Bc.indexOf(E)||B=u?B+1:B)),v+=B=u&&B++,y>=u&&y++,B>y&&(A=y,y=B,B=A),y-B<(c.length+2)/2===(Br||r===m||(q=r>m?r-m:m-r,n+=rg-q?1:-1);c.splice(0>n?m:m+1,0,k);d.splice(h,1);h--}else f=!1;if(f)break;else c.push(d[0]),d.splice(0,1)}for(b=0;b=a?this.ql=a:this.ql=360,this.D())}},arrangement:{get:function(){return this.Mb},set:function(a){this.Mb===a||a!==Xr&&a!==Jr&&a!==Wr&&a!==Vr||(this.Mb=a,this.D())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Lr&&a!==Ur&&a!==Sr&&a!==Tr||(this.K=a,this.D())}},sorting:{get:function(){return this.ed},set:function(a){this.ed===a||a!==Qr&&a!==Rr&& a!==Or&&!Pr&&a!==Mr||(this.ed=a,this.D())}},comparer:{get:function(){return this.$c},set:function(a){this.$c!==a&&(this.$c=a,this.D())}},spacing:{get:function(){return this.qf},set:function(a){this.qf!==a&&(this.qf=a,this.D())}},nodeDiameterFormula:{get:function(){return this.Jn},set:function(a){this.Jn===a||a!==Nr&&a!==Yr||(this.Jn=a,this.D())}},actualXRadius:{get:function(){return this.hc}}, actualYRadius:{get:function(){return this.ie}},actualSpacing:{get:function(){return this.Qi}},actualCenter:{get:function(){return this.Sv}}}); var Jr=new D(Ir,"ConstantSpacing",0),Wr=new D(Ir,"ConstantDistance",1),Vr=new D(Ir,"ConstantAngle",2),Xr=new D(Ir,"Packed",3),Lr=new D(Ir,"Clockwise",4),Ur=new D(Ir,"Counterclockwise",5),Sr=new D(Ir,"BidirectionalLeft",6),Tr=new D(Ir,"BidirectionalRight",7),Qr=new D(Ir,"Forwards",8),Rr=new D(Ir,"Reverse",9),Or=new D(Ir,"Ascending",10),Pr=new D(Ir,"Descending",11),Mr=new D(Ir,"Optimized",12),Nr=new D(Ir,"Pythagorean",13),Yr=new D(Ir,"Circular",14);Ir.className="CircularLayout";Ir.ConstantSpacing=Jr; Ir.ConstantDistance=Wr;Ir.ConstantAngle=Vr;Ir.Packed=Xr;Ir.Clockwise=Lr;Ir.Counterclockwise=Ur;Ir.BidirectionalLeft=Sr;Ir.BidirectionalRight=Tr;Ir.Forwards=Qr;Ir.Reverse=Rr;Ir.Ascending=Or;Ir.Descending=Pr;Ir.Optimized=Mr;Ir.Pythagorean=Nr;Ir.Circular=Yr;function Kr(){this.Kl=-Infinity;this.qm=this.hk=null} Kr.prototype.compare=function(a,b){if(0this.Kl||Math.abs(a)a&&0h?(e=p.x+p.width/2,f=p.y+p.height/2,l[0]=new I(p.x+p.width+d.width,p.y),l[1]=new I(p.x,p.y+p.height+d.height),h=2):(k=rs(l,h,e,f,p.width,p.height,d),n=l[k],r=new I(n.x+p.width+d.width,n.y),p=new I(n.x,n.y+ p.height+d.height),k+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.Tc(c)&&(a++,2a.network.vertexes.count)return!1;a.Vg=a.network.vertexes.Fa();a=a.Vg;a.sort(function(a,b){return null===a||null===b||a===b?0:b.Qd-a.Qd});for(b=a.length-1;0<=b&&1>=a[b].Qd;)b--;return 1=g))){for(var l=h=0,m=k.count-g;mr&& (r=1);h=K.sqrt((h+r+l*l*4/(g*g))/r);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new N(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new I(p.x+g,p.y+h)}}a.network=d;return c}function vs(a,b){for(var c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.Se){var e=d.Se.L(d.nv);d.Qd=e.Ks;var f=e.Lv,g=e.Mv;d.bounds=new N(d.centerX-f,d.centerY-g,e.Ls,e.Js);d.focus=new I(f,g);d.nv--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function ws(a,b){var c=b.Fj;if(null!==c&&0!==c.count){var d=b.centerX,e=b.centerY,f=b.width,g=b.height;null!==b.Se&&0=n.Qd?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 rs(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,K.sqrt(c*c+a*a)):a+cg+h?a>b+f?(c=d-g-h,a=a-b-f,K.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.Vf;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=ys(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new As),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 As),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;for(e=d=0;ea.epsilonDistance*a.epsilonDistance}os.prototype.moveVertex=function(a){var b=a.forceX,c=a.forceY,d=this.moveLimit;b<-d?b=-d:b>d&&(b=d);c<-d?c=-d:c>d&&(c=d);a.centerX+=b;a.centerY+=c;return b*b+c*c};os.prototype.moveFixedVertex=function(){};os.prototype.commitLayout=function(){this.rv();this.commitNodes();this.isRouting&&this.commitLinks()}; os.prototype.rv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=Sc,b.toSpot=Sc)}};os.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=N.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;N.free(c)}c=N.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()}N.free(c)}; os.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};os.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Ck:a};os.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Bk:a};os.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.zk:a};os.prototype.electricalFieldX=function(){return 0};os.prototype.electricalFieldY=function(){return 0}; os.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Ak:a};os.prototype.gravitationalFieldX=function(){return 0};os.prototype.gravitationalFieldY=function(){return 0};os.prototype.isFixed=function(a){return a.isFixed}; ma.Object.defineProperties(os.prototype,{currentIteration:{get:function(){return this.wn}},arrangementSpacing:{get:function(){return this.Wd},set:function(a){this.Wd.C(a)||(this.Wd.assign(a),this.D())}},arrangesToOrigin:{get:function(){return this.ym},set:function(a){this.ym!==a&&(this.ym=a,this.D())}},setsPortSpots:{get:function(){return this.pf},set:function(a){this.pf!==a&&(this.pf= a,this.D())}},comments:{get:function(){return this.md},set:function(a){this.md!==a&&(this.md=a,this.D())}},maxIterations:{get:function(){return this.Zk},set:function(a){this.Zk!==a&&0<=a&&(this.Zk=a,this.D())}},epsilonDistance:{get:function(){return this.Xm},set:function(a){this.Xm!==a&&0u&&0u&&0a[this.Dd]&&(this.Bq=a[c]-1,this.Dd=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.Bj===l.Bj||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&r>q)&&h++;wn||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>w)&&h++,qn||u===n&&w>m)&&h++);f[g*e+g]=h;for(k=g+ 1;k=c)for(h=d[g].destinationEdgesArrayAccess,y=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)}Ns(a,b,d);return f}function Vs(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&&Vs(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&&Vs(a,k,c,d,e,f)}} function Ws(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)Ws(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)Ws(a,b.value.fromVertex,c,d,e,f)}} Ds.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.yk){default:case Xs: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!==Ys(a);){for(e=Zs(a);null!==e;)d[c]=e,c--,e.valid=!1,e=Zs(a);for(e=$s(a);null!==e;)d[b]=e,b++,e.valid=!1,e=$s(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.dm(b),b.rev=!0);break;case Es:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.Gl=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Gn=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& at(this,b);for(d.reset();d.next();)b=d.value,-1===b.Gl&&at(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.Gld){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&&Vs(a,h,0,-1,!0,!1)}for(Vs(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 Ls(a,b,c){return 90===a.K?c&&!b.rev||!c&&b.rev?270:90:180===a.K?c&&!b.rev||!c&&b.rev?0:180:270===a.K?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} Ds.prototype.initializeIndices=function(){switch(this.Lk){default:case ht:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.qc[c];this.qc[c]++}break;case Gs:a=this.network.vertexes.iterator;for(b=this.Ia;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&it(this,c);break;case jt:for(a=this.network.vertexes.iterator,b=0;b<=this.Ia;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&kt(this,c)}}; function it(a,b){var c=b.layer;b.index=a.qc[c];a.qc[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=mt(this,d,-1)||f;e=this.countCrossings();e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=mt(this,d,1)||f;e=this.countCrossings();e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=mt(this,d,1)||f;e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= mt(this,d,-1)||f;e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=mt(this,d,0)||f;e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=mt(this,d,0)||f;e>=a?Qs(this,b):(a=e,b=Ps(this))}break;default:case Hs:for(c=this.Ia,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=mt(this,d,-1)||f;e=this.countCrossings();e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=mt(this,d,1)||f;e=this.countCrossings();e>=a?Qs(this,b): (a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=mt(this,d,1)||f;e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=mt(this,d,-1)||f;e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=mt(this,d,0)||f;e>=a?Qs(this,b):(a=e,b=Ps(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=mt(this,d,0)||f;e>=a?Qs(this,b):(a=e,b=Ps(this))}}Qs(this,b)}; function lt(a,b,c){var d=Ms(a,b),e=a.qc[b],f=Us(a,b,c),g=Ts(a,b,c);for(c=0;cf+1&&(p+=4*(z-f),r+=4*(z-(f+1)))}A=d[f].destinationEdges.iterator;for(A.reset();A.next();)if(z=A.value,y=z.toVertex,z.valid&&y.layer===b){for(z=0;d[z]!==y;)z++;z===f+1&&(r+=1)}A=d[f+1].sourceEdges.iterator;for(A.reset();A.next();)if(z=A.value,y=z.fromVertex,z.valid&&y.layer===b){for(z=0;d[z]!==y;)z++;zf+1&&(p+=4*(z-(f+1)),r+=4*(z-f))}A=d[f+1].destinationEdges.iterator; for(A.reset();A.next();)if(z=A.value,y=z.toVertex,z.valid&&y.layer===b){for(z=0;d[z]!==y;)z++;z===f&&(p+=1)}z=y=0;A=g[d[f].index];var B=h[d[f].index],E=g[d[f+1].index],M=h[d[f+1].index];-1!==A&&(y+=Math.abs(A-q),z+=Math.abs(A-v));-1!==B&&(y+=Math.abs(B-q),z+=Math.abs(B-v));-1!==E&&(y+=Math.abs(E-u),z+=Math.abs(E-w));-1!==M&&(y+=Math.abs(M-u),z+=Math.abs(M-w));if(r>1)+8*d;this.Qa*=8}if(0!==(this.Yf&2))for(c=!0;c;){c=!1;for(b=this.Dd+1;b<=this.Ia;b++)c= qt(this,b,1)||c;for(b=this.Dd-1;0<=b;b--)c=qt(this,b,-1)||c;c=qt(this,this.Dd,0)||c}if(0!==(this.Yf&4)){for(b=this.Dd+1;b<=this.Ia;b++)rt(this,b,1);for(b=this.Dd-1;0<=b;b--)rt(this,b,-1);rt(this,this.Dd,0)}a&&(st(this,-1),st(this,1));if(0!==(this.Yf&2))for(c=!0;c;){c=!1;c=qt(this,this.Dd,0)||c;for(b=this.Dd+1;b<=this.Ia;b++)c=qt(this,b,0)||c;for(b=this.Dd-1;0<=b;b--)c=qt(this,b,0)||c}}else tt(this)};function qt(a,b,c){for(var d=!1;ut(a,b,c);)d=!0;return d} function ut(a,b,c){var d,e=Ms(a,b),f=a.qc[b],g=Ts(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 w=e[d].sourceEdges.iterator;w.next();){var v=w.value;var z=v.fromVertex; if(v.valid&&z.layer!==b){var y=Os(v);var A=v.portFromColOffset;v=v.portToColOffset;z=z.column;p+=(Math.abs(m+v-(z+A))+1)*y;q+=(Math.abs(r+v-(z+A))+1)*y;u+=(Math.abs(n+v-(z+A))+1)*y}}if(0<=c)for(w=e[d].destinationEdges.iterator;w.next();)v=w.value,z=v.toVertex,v.valid&&z.layer!==b&&(y=Os(v),A=v.portFromColOffset,v=v.portToColOffset,z=z.column,p+=(Math.abs(m+A-(z+v))+1)*y,q+=(Math.abs(r+A-(z+v))+1)*y,u+=(Math.abs(n+A-(z+v))+1)*y);v=A=y=0;w=g[e[d].index];z=h[e[d].index];-1!==w&&(y+=Math.abs(w-m),A+= Math.abs(w-r),v+=Math.abs(w-n));-1!==z&&(y+=Math.abs(z-m),A+=Math.abs(z-r),v+=Math.abs(z-n));if(q=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}Ns(a,b,d);a.normalize()} function vt(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 wt(a,b){var c=b+1;var d,e=[],f=[];for(d=0;d<=a.Ia;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.Ia;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 st(a,b){for(var c=0;c<=a.Qa;c++)for(;vt(a,c););a.normalize();for(c=0;cf?Qs(a,e):gb)for(c=a.Qa;0<=c;c--)for(e=Ps(a),f=Ss(a),d=f+1;ff?Qs(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.he);a.he++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Ws(a,b,a.he,-1,!0,!0),a.he++);var f;b=[];for(f=0;fc)for(g=a.Qa;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} function tt(a){for(var b=Ea(),c=a.al.length,d=0;d<=c;d++)b[d]=[];for(d=a.network.vertexes.iterator;d.next();){var e=d.value;b[c-e.layer][e.index]=e}c=new H;yt(b,c);var f=null,g=null,h=null,k=null,l=0!==(a.re&1),m=0!==(a.re&2),n=0!==(a.re&4),p=0!==(a.re&8);l&&(a.verticalAlignment(b,c,!0),f=zt(a,b,!0,!1));b.reverse();n&&(a.verticalAlignment(b,c,!1),h=zt(a,b,!1,!1));d=ba(b);for(e=d.next();!e.done;e=d.next())e.value.reverse();p&&(a.verticalAlignment(b,c,!1),k=zt(a,b,!1,!0));b.reverse();m&&(a.verticalAlignment(b, c,!0),g=zt(a,b,!0,!0));Ga(b);a.u(f,g,h,k);a.network.vertexes.each(function(a){var b=Ea();l&&b.push(f.get(a));m&&b.push(g.get(a));n&&b.push(h.get(a));p&&b.push(k.get(a));b.sort(function(a,b){return a-b});var c=b.length;c=(b[Math.floor((c-1)/2)]+b[Math.ceil((c-1)/2)])/2;Ga(b);a.wc=c})} function yt(a,b){for(var c=a.length,d=1;dm)&&b.add(n);f++}e= m}}}Ds.prototype.verticalAlignment=function(a,b,c){Bt(a);a=ba(a);for(var d=a.next();!d.done;d=a.next()){var e=-1;d=ba(d.value);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=c?At(f):Ct(f),h=g.length;if(0=b[c].length)&&(g=b[c][0],g.ld===g)){Infinity===g.ld.shift&&(g.ld.shift=0);g=c;h=0;do{for(f=b[g][h];f.align!==f.root;)f=f.align,g++,0a&&C("Could not determine previous vertex in layer");return b[c][a-1]} Ds.prototype.u=function(a){for(var b=[],c=0;cg;g++)if(b[g]){var h=Gt(this,b[g],d,e,g);hg;f={delta:f.delta},g++)b[g]&&(f.delta=0===g||2===g?d[c]-d[g]:e[c]-e[g],0!==f.delta&&b[g].each(function(a){return function(b){b.value+=a.delta}}(f)));Ga(d);Ga(e)}; function Gt(a,b,c,d,e){if(!b||0===b.count)return c[e]=0,d[e]=0,Infinity;var f=Infinity,g=-Infinity;b.each(function(b){var c=b.key;b=b.value;c=90===a.K||270===a.K?c.width:c.height;bg&&(g=b+c)});c[e]=f;d[e]=g;return g-f}Ds.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=Ks(this,!0),b=Ks(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.Au();this.isRouting&&this.commitLinks()}; function Ks(a,b){return 270===a.K?b?$c:cd:90===a.K?b?cd:$c:180===a.K?b?ad:bd:b?bd:ad} Ds.prototype.commitNodes=function(){this.de=[];this.Cd=[];this.Bd=[];this.Ta=[];for(var a=0;a<=this.Ia;a++)this.de[a]=0,this.Cd[a]=0,this.Bd[a]=0,this.Ta[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.de[c]=Math.max(this.de[c],this.nodeMinLayerSpace(b,!0));this.Cd[c]=Math.max(this.Cd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.ee;for(var d=0;d<=this.Ia;d++){var e=c;0>=this.de[d]+this.Cd[d]&&(e=0);0=n.bounds.bottom?(n=n.bounds.y+n.bounds.height,b.l(q++,A,n+E),b.l(q++,A,n),b.l(q++,A,n-y)):(b.l(q++,A,B+E),b.l(q++,A,B),b.l(q++,A,B-y)):270===this.K?B<=n.bounds.y?(n=n.bounds.y,b.l(q++,A,n-y),b.l(q++,A,n),b.l(q++,A,n+E)):(b.l(q++,A,B-y),b.l(q++,A,B),b.l(q++,A,B+E)):0===this.K&&(A>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.l(q++,n+E,B),b.l(q++,n,B),b.l(q++,n-y,B)):(b.l(q++,A+E,B),b.l(q++,A,B),b.l(q++,A-y,B)));else{b.l(q++,v,z);var M=0;if(180=== this.K||0===this.K){if(180===this.K?A>=n.bounds.right:A<=n.bounds.x)M=(0===this.K?-y:E)/2;b.l(q++,v+M,B)}else{if(270===this.K?B>=n.bounds.bottom:B<=n.bounds.y)M=(90===this.K?-y:E)/2;b.l(q++,A,z+M)}b.l(q++,A,B)}}else y=Math.max(10,this.de[w.layer]),E=Math.max(10,this.Cd[w.layer]),r?180===this.K?(b.l(q++,A-y-u,B),b.l(q++,Math.min(A-y+u/2,A),B),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,Math.max(A+E-u/2,A),B),b.l(q++,A+E+u,B)):90===this.K?(b.l(q++,A,B+E+u),b.l(q++,A,Math.max(B+E-u/2,B)),b.l(q++,A,B),b.l(q++, A,B),b.l(q++,A,Math.min(B-y+u/2,B)),b.l(q++,A,B-y-u)):270===this.K?(b.l(q++,A,B-y-u),b.l(q++,A,Math.min(B-y+u/2,B)),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,A,Math.max(B+E-u/2,B)),b.l(q++,A,B+E+u)):(b.l(q++,A+E+u,B),b.l(q++,Math.max(A+E-u/2,A),B),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,Math.min(A-y+u/2,A),B),b.l(q++,A-y-u,B)):b.l(q++,A,B)}n=w}if(null===h||l!==rc||p)if(v=b.i(q-1).x,z=b.i(q-1).y,A=b.i(q).x,B=b.i(q).y,p)u=this.Cd[m.layer],180===this.K||0===this.K?(p=z,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.K? A>=m.bounds.x:A<=m.bounds.right)&&(n=m.centerX+(180===this.K?-u:u),p=m.bounds.x&&p<=m.bounds.right&&(270===this.K?B>=m.bounds.y:B<=m.bounds.bottom)&&(n=m.centerY+(270===this.K?-u:u),p=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.M(q-2,n,z),b.M(q-1,n+E,z)):90===this.K&&B<=m.bounds.bottom?(n=m.bounds.y,b.M(q-2,v,n),b.M(q-1,v,n-y)):270===this.K&&B>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.M(q-2,v,n),b.M(q-1,v,n+E)):0===this.K&&A<=m.bounds.right&&(n=m.bounds.x,b.M(q-2,n,z),b.M(q-1,n-y,z));else{y=Math.max(10,this.de[m.layer]);E=Math.max(10,this.Cd[m.layer]);p=0;if(180===this.K||0===this.K){if(180===this.K?A<=m.bounds.x:A>=m.bounds.right)p=(0===this.K? E:-y)/2;b.l(q++,A+p,z)}else{if(270===this.K?B<=m.bounds.y:B>=m.bounds.bottom)p=(90===this.K?E:-y)/2;b.l(q++,v,B+p)}b.l(q++,A,B)}}else{for(;null!==m&&m!==n;){y=w=null;for(m=m.destinationEdges.iterator;m.next()&&(v=m.value,v.link!==c.link||(w=v.toVertex,y=v.fromVertex,null!==y.node&&(y=null),null!==w.node)););if(null===w)break;w!==n&&(v=b.i(q-1).x,z=b.i(q-1).y,A=w.centerX,B=w.centerY,p?180===this.K||0===this.K?(null!==y?y.centerY:z)!==B&&(y=this.Ta[w.layer]+this.Of.x,q===b.firstPickIndex+1&&(y=0=== this.K?Math.max(y,v):Math.min(y,v)),b.l(q++,y,z),b.l(q++,y,B)):(null!==y?y.centerX:v)!==A&&(y=this.Ta[w.layer]+this.Of.y,q===b.firstPickIndex+1&&(y=90===this.K?Math.max(y,z):Math.min(y,z)),b.l(q++,v,y),b.l(q++,A,y)):(y=Math.max(10,this.de[w.layer]),E=Math.max(10,this.Cd[w.layer]),r?180===this.K?(b.l(q++,A+E+u,B),b.l(q++,Math.max(A+E-u/2,A),B),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,Math.min(A-y+u/2,A),B),b.l(q++,A-y-u,B)):90===this.K?(b.l(q++,A,B-y-u),b.l(q++,A,Math.min(B-y+u/2,B)),b.l(q++,A,B),b.l(q++, A,B),b.l(q++,A,Math.max(B+E-u/2,B)),b.l(q++,A,B+E+u)):270===this.K?(b.l(q++,A,B+E+u),b.l(q++,A,Math.max(B+E-u/2,B)),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,A,Math.min(B-y+u/2,B)),b.l(q++,A,B-y-u)):(b.l(q++,A-y-u,B),b.l(q++,Math.min(A-y+u/2,A),B),b.l(q++,A,B),b.l(q++,A,B),b.l(q++,Math.max(A+E-u/2,A),B),b.l(q++,A+E+u,B)):180===this.K?(b.l(q++,A+E,B),b.l(q++,A-y,B)):90===this.K?(b.l(q++,A,B-y),b.l(q++,A,B+E)):270===this.K?(b.l(q++,A,B+E),b.l(q++,A,B-y)):(b.l(q++,A-y,B),b.l(q++,A+E,B))));m=w}p&&(v=b.i(q-1).x, z=b.i(q-1).y,A=b.i(q).x,B=b.i(q).y,180===this.K||0===this.K?z!==B&&(y=0===this.K?Math.min(Math.max((A+v)/2,this.Ta[n.layer]+this.Of.x),A):Math.max(Math.min((A+v)/2,this.Ta[n.layer]+this.Of.x),A),b.l(q++,y,z),b.l(q++,y,B)):v!==A&&(y=90===this.K?Math.min(Math.max((B+z)/2,this.Ta[n.layer]+this.Of.y),B):Math.max(Math.min((B+z)/2,this.Ta[n.layer]+this.Of.y),B),b.l(q++,v,y),b.l(q++,A,y)))}null!==d&&r&&(null!==g&&(l===rc&&(l=b.i(0),d=b.i(2),l.C(d)||b.M(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,rc, !0,!1,f,h),l.w()||l.set(e.actualBounds.center),b.M(0,l.x,l.y)),null!==h&&(k===rc&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.C(l)||b.M(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,rc,!1,!1,e,g),e.w()||e.set(f.actualBounds.center),b.M(b.pointsCount-1,e.x,e.y)));b.wf();c.commit()}}}this.avoidOrthogonalOverlaps()}; Ds.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new F,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.kdb.kd?1:a.Fcb.Fc?1:0:0};t.Qx=function(a,b){return a instanceof Ht&&b instanceof Ht&&a!==b?a.firstb.first||a.jb.j||a.kdb.kd?1:a.Fcb.Fc?1:0:0}; t.Cs=function(a,b){return a instanceof Ht&&b instanceof Ht&&a!==b?a.fcb.fc||a.jb.j||a.kdb.kd?1:a.Fcb.Fc?1:0:0};t.B=function(a,b){a-=b;return-1a}; t.wi=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&C("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.De.length){var d=[];for(var e=0;ea&&(this.Yf=a,this.D())}},alignOption:{get:function(){return this.re},set:function(a){this.re!==a&&0<=a&&16>a&&(this.re= a,this.D())}},setsPortSpots:{get:function(){return this.pf},set:function(a){this.pf!==a&&(this.pf=a,this.D())}},linkSpacing:{get:function(){return this.yn},set:function(a){this.yn!==a&&0<=a&&(this.yn=a,this.D())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Bq}},maxColumn:{get:function(){return this.Qa}},minIndexLayer:{ get:function(){return this.Dn}},maxIndexLayer:{get:function(){return this.Dd}}}); var Es=new D(Ds,"CycleDepthFirst",0),Xs=new D(Ds,"CycleGreedy",1),Js=new D(Ds,"CycleFromLayers",2),Fs=new D(Ds,"LayerOptimalLinkLength",0),bt=new D(Ds,"LayerLongestPathSink",1),dt=new D(Ds,"LayerLongestPathSource",2),Gs=new D(Ds,"InitDepthFirstOut",0),jt=new D(Ds,"InitDepthFirstIn",1),ht=new D(Ds,"InitNaive",2),nt=new D(Ds,"AggressiveNone",0),Hs=new D(Ds,"AggressiveLess",1),ot=new D(Ds,"AggressiveMore",2),pt=8;Ds.className="LayeredDigraphLayout";Ds.CycleDepthFirst=Es;Ds.CycleGreedy=Xs; Ds.CycleFromLayers=Js;Ds.LayerOptimalLinkLength=Fs;Ds.LayerLongestPathSink=bt;Ds.LayerLongestPathSource=dt;Ds.InitDepthFirstOut=Gs;Ds.InitDepthFirstIn=jt;Ds.InitNaive=ht;Ds.AggressiveNone=nt;Ds.AggressiveLess=Hs;Ds.AggressiveMore=ot;Ds.PackNone=0;Ds.PackExpand=1;Ds.PackStraighten=2;Ds.PackMedian=4;Ds.PackAll=15;Ds.AlignNone=0;Ds.AlignUpperLeft=1;Ds.AlignUpperRight=2;Ds.AlignLowerLeft=4;Ds.AlignLowerRight=8;Ds.AlignAll=15; function Ht(){this.index=this.Fc=this.kd=this.fc=this.first=this.layer=0;this.link=null;this.j=0}Ht.className="SegInfo";function Is(a){rq.call(this,a)}la(Is,rq);Is.prototype.createVertex=function(){return new It(this)};Is.prototype.createEdge=function(){return new Jt(this)};Is.className="LayeredDigraphNetwork";function It(a){uq.call(this,a);this.Wn=this.Yn=this.Xn=this.Zn=null;this.Ya=this.wg=this.aj=-1;this.u=NaN;this.F=null;this.valid=!1;this.finish=this.Gl=NaN;this.Bj=0;this.$u=this.av=null} la(It,uq);function Kt(a,b){return a.index-b.index}function Dt(a,b){if(!a.Wn){for(var c=[],d=ba(a.destinationEdgesArrayAccess),e=d.next();!e.done;e=d.next())e=e.value,e.valid&&c.push(e);a.Wn=c}a=ba(a.Wn);for(c=a.next();!c.done;c=a.next())if(c=c.value,c.toVertex===b)return c;C("Unable to find destination edge to given vertex")}function At(a){if(!a.Zn){for(var b=[],c=ba(a.sourceEdgesArrayAccess),d=c.next();!d.done;d=c.next())d=d.value,d.valid&&b.push(d.fromVertex);b.sort(Kt);a.Zn=b}return a.Zn} function Ct(a){if(!a.Xn){for(var b=[],c=ba(a.destinationEdgesArrayAccess),d=c.next();!d.done;d=c.next())d=d.value,d.valid&&b.push(d.toVertex);b.sort(Kt);a.Xn=b}return a.Xn}It.prototype.yl=function(a){uq.prototype.yl.call(this,a);this.Yn=this.Zn=null};It.prototype.Fl=function(a){uq.prototype.Fl.call(this,a);this.Yn=this.Zn=null};It.prototype.vl=function(a){uq.prototype.vl.call(this,a);this.Wn=this.Xn=null};It.prototype.El=function(a){uq.prototype.El.call(this,a);this.Wn=this.Xn=null}; ma.Object.defineProperties(It.prototype,{layer:{get:function(){return this.aj},set:function(a){this.aj!==a&&(this.aj=a)}},column:{get:function(){return this.wg},set:function(a){this.wg!==a&&(this.wg=a)}},index:{get:function(){return this.Ya},set:function(a){this.Ya!==a&&(this.Ya=a)}},component:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},near:{ get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}});It.prototype.deleteDestinationEdge=It.prototype.El;It.prototype.addDestinationEdge=It.prototype.vl;It.prototype.deleteSourceEdge=It.prototype.Fl;It.prototype.addSourceEdge=It.prototype.yl;It.className="LayeredDigraphVertex";function Jt(a){vq.call(this,a);this.j=this.ga=this.Ha=!1;this.V=this.u=NaN;this.F=this.m=0}la(Jt,vq); ma.Object.defineProperties(Jt.prototype,{fromVertex:{get:function(){return this.bd},set:function(a){this.bd!==a&&(this.bd=a)}},toVertex:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a)}},valid:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},rev:{get:function(){return this.ga},set:function(a){this.ga!==a&&(this.ga=a)}},forest:{ get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},portFromPos:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToPos:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},portFromColOffset:{get:function(){return this.m},set:function(a){this.m!==a&&(this.m=a)}},portToColOffset:{get:function(){return this.F}, set:function(a){this.F!==a&&(this.F=a)}}});Jt.className="LayeredDigraphEdge";function Lt(a){ri.call(this);this.Qb=new H;this.Sn=Mt;this.od=Nt;this.ro=Ot;this.uq=Pt;this.Tv=[];this.md=!0;this.Mb=Qt;this.Wd=(new L(10,10)).freeze();var b=new Rt(this);this.W=new St(b);this.Y=new St(b);this.mu=[];a&&Object.assign(this,a)}la(Lt,ri); Lt.prototype.cloneProtected=function(a){ri.prototype.cloneProtected.call(this,a);a.Sn=this.Sn;a.ro=this.ro;a.uq=this.uq;a.md=this.md;a.Mb=this.Mb;a.Wd.assign(this.Wd);a.W.copyInheritedPropertiesFrom(this.W);a.Y.copyInheritedPropertiesFrom(this.Y)}; Lt.prototype.rb=function(a){a.classType===Lt?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:C("Unknown enum value: "+a):ri.prototype.rb.call(this,a)};Lt.prototype.createNetwork=function(){return new Rt(this)}; Lt.prototype.makeNetwork=function(a){function b(a){if(a instanceof V)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof T){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 Q?(c.hg(a.nodes,!0,b),c.hg(a.links,!0,b)):a instanceof pf?c.hg(a.memberParts,!1,b):c.hg(a.iterator,!1,b);return c}; Lt.prototype.doLayout=function(a){null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==Tt&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof Q&&(b=a);this.path===Mt&&null!==b?this.od=b.isTreePathToChildren?Nt:Ut:this.od=this.path===Mt?Nt:this.path;if(0b.level)return!1;a.removeChild(c.parent,c)}return!0}Lt.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;ee?Au(this,a,g,X,v,z):Bu(this,a,g,X,v,z);X=z.x;v=z.width;z=z.height;break;case qu:for(A=0;An&&(Rgb&&(Gu(a,-gb,0,ca,na-1),Hu(A,-gb,0),Hu(B,-gb,0),gb=0)}wa.S.h(gb,S);v=Math.max(v,E);z=Math.max(z,y+(0===J?0:q)+db.height);R=E}else{0n&&(Sgb&&(Gu(a,0,-gb,ca,na-1),Hu(A,0,-gb),Hu(B,0,-gb),gb=0);wa.S.h(R,gb);z=Math.max(z,M);v=Math.max(v,y+(0===J?0:q)+db.width);S=M}G++}0l&&(l=0),135u&&(u=0),k===ru&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>v&&(v=Mu(k,d-v,0),g=v.x,h=v.y,v=d,l=0):v=Ku(a,v,l),0>l&&(g-=l,l=0),135z&&(z=Mu(k,0,w-z),g=z.x,h=z.y,z=w,u=0):z=Lu(a,z,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])),J[0].h(l+d,0),J[1].h(J[0].x,w),J[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])),J[0].h(0,u+w),J[1].h(d,J[0].y),J[2].xd?Au(a,b,e,G,y,A):Bu(a,b,e,G,y,A);G=A.x;y=A.width;A=A.height;break;case qu:for(p=0;pp&&(Ep&&(Mn&&(n=0),135v&&(v=0));b.la.h(n,v);b.Da.h(y,A)}}Lt.prototype.customAlignment=function(a,b,c,d,e){return[b,c,d,e]}; function Au(a,b,c,d,e,f){var g=c.length;if(0===g)return new N(d,0,e,f);if(1===g)return b=c[0],e=b.Da.width,f=b.Da.height,new N(d,0,e,f);for(var h=b.nodeSpacing,k=b.rowSpacing,l=90===xu(b),m=0,n=0,p=0,r=0;rl&&(e-=l),f=Math.max(f,Math.max(r,p)+a+g.height),0>c.S.x&&(d=Ou(b,c.S.x,!1,d,h))):(c.S.h(e+a,d+h/2-c.focus.y-c.la.y),e=Math.max(e,Math.max(q,n)+a+g.width),p=d+h/2-c.focus.y-c.la.y,f=Math.max(f,p+g.height),0>p&&(f-=p),0>c.S.y&&(d=Ou(b,c.S.y,!0,d,h))));return new N(d,0,e,f)} function Bu(a,b,c,d,e,f){var g=c.length;if(0===g)return new N(d,0,e,f);if(1===g)return c=c[0],e=c.Da.width,f=c.Da.height,new N(d,0,e,f);for(var h=b.nodeSpacing,k=b.rowSpacing,l=270===xu(b),m=0,n=0,p=0,r=0;rn&&(e-=n),f=Math.max(f,Math.abs(Math.min(r,p))+a+m.height),0>k.S.x&&(d=Ou(b,k.S.x,!1,d,h))):(k.S.h(-e-m.width-a,d+h/2-k.focus.y-k.la.y),e=Math.max(e,Math.abs(Math.min(q,n))+a+m.width),p=d+h/2-k.focus.y-k.la.y,f=Math.max(f,p+m.height),0>p&&(f-=p),0>k.S.y&&(d=Ou(b,k.S.y,!0,d,h))));for(b=0;bb&&(b=c+a.width),0>c&&(b-=c),b;case yu:return a.width>b?a.width:b;case zu:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case nu:case du:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case qu:return a.width-a.focus.x+a.nodeSpacing/2+b;case ru:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function Lu(a,b,c){switch(a.alignment){case Ju:case Iu:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case yu:return a.height>b?a.height:b;case zu:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case nu:case du:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case qu:return a.height-a.focus.y+a.nodeSpacing/2+b;case ru:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function Mu(a,b,c){switch(a){case Iu:b/=2;c/=2;break;case Ju:b/=2;c/=2;break;case yu:c=b=0;break;case zu:break;default:C("Unhandled alignment value "+a.toString())}return new I(b,c)}function Du(a,b,c,d,e,f){b=Mu(b,c,d);Gu(a,b.x,b.y,e,f)}function Gu(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 Eu(a,b,c,d){var e=b.parent;switch(a.od){case Nt:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case Ut:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:C("Unhandled path value "+a.od.toString())}}function Hu(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=Cu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=Cu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Cu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Cu(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=Cu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=Cu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Cu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Cu(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}Lt.prototype.computeLayerSpacing=function(a){var b=xu(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.W.nodeIndentPastParent=a,this.D())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(a){this.W.nodeSpacing!==a&&(this.W.nodeSpacing=a,this.D())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!== a&&(this.W.layerSpacing=a,this.D())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.W.layerSpacingParentOverlap=a,this.D())}},compaction:{get:function(){return this.W.compaction},set:function(a){this.W.compaction===a||a!==uu&&a!==wu||(this.W.compaction=a,this.D())}},breadthLimit:{get:function(){return this.W.breadthLimit}, set:function(a){this.W.breadthLimit!==a&&0<=a&&(this.W.breadthLimit=a,this.D())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(a){this.W.rowSpacing!==a&&(this.W.rowSpacing=a,this.D())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&0<=a&&(this.W.rowIndent=a,this.D())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!== a&&(this.W.commentSpacing=a,this.D())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(this.W.commentMargin=a,this.D())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(this.W.setsPortSpot=a,this.D())}},portSpot:{get:function(){return this.W.portSpot},set:function(a){this.W.portSpot.C(a)||(this.W.portSpot= a,this.D())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(this.W.setsChildPortSpot=a,this.D())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(a){this.W.childPortSpot.C(a)||(this.W.childPortSpot=a,this.D())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(a){this.Y.sorting===a||a!==iu&&a!==ju&& a!==ku&&!lu||(this.Y.sorting=a,this.D())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(a){this.Y.comparer!==a&&(this.Y.comparer=a,this.D())}},alternateAngle:{get:function(){return this.Y.angle},set:function(a){this.Y.angle===a||0!==a&&90!==a&&180!==a&&270!==a||(this.Y.angle=a,this.D())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(a){this.Y.alignment!== a&&(this.Y.alignment=a,this.D())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(a){this.Y.nodeIndent!==a&&0<=a&&(this.Y.nodeIndent=a,this.D())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(a){this.Y.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.Y.nodeIndentPastParent=a,this.D())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing}, set:function(a){this.Y.nodeSpacing!==a&&(this.Y.nodeSpacing=a,this.D())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(this.Y.layerSpacing=a,this.D())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.D())}},alternateCompaction:{ get:function(){return this.Y.compaction},set:function(a){this.Y.compaction===a||a!==uu&&a!==wu||(this.Y.compaction=a,this.D())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(a){this.Y.breadthLimit!==a&&0<=a&&(this.Y.breadthLimit=a,this.D())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(this.Y.rowSpacing=a,this.D())}},alternateRowIndent:{ get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&0<=a&&(this.Y.rowIndent=a,this.D())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(this.Y.commentSpacing=a,this.D())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(this.Y.commentMargin=a,this.D())}},alternateSetsPortSpot:{ get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(this.Y.setsPortSpot=a,this.D())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(a){this.Y.portSpot.C(a)||(this.Y.portSpot=a,this.D())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(this.Y.setsChildPortSpot=a,this.D())}},alternateChildPortSpot:{ get:function(){return this.Y.childPortSpot},set:function(a){this.Y.childPortSpot.C(a)||(this.Y.childPortSpot=a,this.D())}}}); var Mt=new D(Lt,"PathDefault",-1),Nt=new D(Lt,"PathDestination",0),Ut=new D(Lt,"PathSource",1),iu=new D(Lt,"SortingForwards",10),ju=new D(Lt,"SortingReverse",11),ku=new D(Lt,"SortingAscending",12),lu=new D(Lt,"SortingDescending",13),Iu=new D(Lt,"AlignmentCenterSubtrees",20),Ju=new D(Lt,"AlignmentCenterChildren",21),yu=new D(Lt,"AlignmentStart",22),zu=new D(Lt,"AlignmentEnd",23),nu=new D(Lt,"AlignmentBus",24),du=new D(Lt,"AlignmentBusBranching",25),qu=new D(Lt,"AlignmentTopLeftBus",26),ru=new D(Lt, "AlignmentBottomRightBus",27),uu=new D(Lt,"CompactionNone",30),wu=new D(Lt,"CompactionBlock",31),Ot=new D(Lt,"StyleLayered",40),hu=new D(Lt,"StyleLastParents",41),gu=new D(Lt,"StyleAlternating",42),fu=new D(Lt,"StyleRootOnly",43),Qt=new D(Lt,"ArrangementVertical",50),Qu=new D(Lt,"ArrangementHorizontal",51),Tt=new D(Lt,"ArrangementFixedRoots",52),Pt=new D(Lt,"LayerIndividual",60),bu=new D(Lt,"LayerSiblings",61),au=new D(Lt,"LayerUniform",62);Lt.className="TreeLayout";Lt.PathDefault=Mt; Lt.PathDestination=Nt;Lt.PathSource=Ut;Lt.SortingForwards=iu;Lt.SortingReverse=ju;Lt.SortingAscending=ku;Lt.SortingDescending=lu;Lt.AlignmentCenterSubtrees=Iu;Lt.AlignmentCenterChildren=Ju;Lt.AlignmentStart=yu;Lt.AlignmentEnd=zu;Lt.AlignmentBus=nu;Lt.AlignmentBusBranching=du;Lt.AlignmentTopLeftBus=qu;Lt.AlignmentBottomRightBus=ru;Lt.CompactionNone=uu;Lt.CompactionBlock=wu;Lt.StyleLayered=Ot;Lt.StyleLastParents=hu;Lt.StyleAlternating=gu;Lt.StyleRootOnly=fu;Lt.ArrangementVertical=Qt; Lt.ArrangementHorizontal=Qu;Lt.ArrangementFixedRoots=Tt;Lt.LayerIndividual=Pt;Lt.LayerSiblings=bu;Lt.LayerUniform=au;function Rt(a){rq.call(this,a)}la(Rt,rq);Rt.prototype.createVertex=function(){return new St(this)};Rt.prototype.createEdge=function(){return new Su(this)};Rt.className="TreeNetwork"; function St(a){uq.call(this,a);this.V=!1;this.hb=null;this.u=[];this.ob=this.Ha=this.F=this.ga=0;this.md=null;this.S=new I(0,0);this.Da=new L(0,0);this.la=new I(0,0);this.fm=this.em=this.gA=!1;this.ep=this.So=null;this.ed=iu;this.$c=Bq;this.Ib=0;this.Hb=Ju;this.Oq=this.Nq=0;this.Pq=20;this.ee=50;this.tq=0;this.Bp=wu;this.tp=0;this.gr=25;this.Ap=this.fr=10;this.zp=20;this.pr=!0;this.Xq=Sc;this.nr=!0;this.xp=Sc}la(St,uq); St.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.ed=a.sorting,this.$c=a.comparer,this.Ib=a.angle,this.Hb=a.alignment,this.Nq=a.nodeIndent,this.Oq=a.nodeIndentPastParent,this.Pq=a.nodeSpacing,this.ee=a.layerSpacing,this.tq=a.layerSpacingParentOverlap,this.Bp=a.compaction,this.tp=a.breadthLimit,this.gr=a.rowSpacing,this.fr=a.rowIndent,this.Ap=a.commentSpacing,this.zp=a.commentMargin,this.pr=a.setsPortSpot,this.Xq=a.portSpot,this.nr=a.setsChildPortSpot,this.xp=a.childPortSpot)}; ma.Object.defineProperties(St.prototype,{initialized:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},parent:{get:function(){return this.hb},set:function(a){this.hb!==a&&(this.hb=a)}},children:{get:function(){return this.u},set:function(a){if(this.u!==a){if(null!==a)for(var b=a.length,c=0;cr.y+c.rowIndent&&(f=Math.min(f,Math.max(n.y,f-b.computeNodeIndent(c))))):c.alignment===yu?(f=d.top+e.y,0===e.y&&n.yr.x+c.rowIndent&&(f=Math.min(f,Math.max(n.x,f-b.computeNodeIndent(c))))):c.alignment===yu?(f=d.left+e.x,0===e.x&&n.xr.y+c.rowIndent&&(f=Math.min(f,Math.max(n.y,f-b.computeNodeIndent(c))))):c.alignment===yu?(f=d.top+e.y,0===e.y&&n.yr.x+c.rowIndent&&(f=Math.min(f,Math.max(n.x,f-b.computeNodeIndent(c))))): c.alignment===yu?(f=d.left+e.x,0===e.x&&n.x